aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/zd1211rw/zd_mac.c
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@mbnet.fi>2011-01-31 13:48:06 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-02-04 16:29:49 -0500
commitc2fadcb3b16b294d7de509c42f1390f672510667 (patch)
treee01f72a37776473d42880b702a91b4df2368508e /drivers/net/wireless/zd1211rw/zd_mac.c
parent5cf6cf819bfffd89fc8c7c3a7406f54da4945a34 (diff)
zd1211rw: support setting BSSID for AP mode
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/zd1211rw/zd_mac.c')
-rw-r--r--drivers/net/wireless/zd1211rw/zd_mac.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index 487ed33e951d..ab0d1b9a08ec 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -231,6 +231,26 @@ static int set_rx_filter(struct zd_mac *mac)
231 return zd_iowrite32(&mac->chip, CR_RX_FILTER, filter); 231 return zd_iowrite32(&mac->chip, CR_RX_FILTER, filter);
232} 232}
233 233
234static int set_mac_and_bssid(struct zd_mac *mac)
235{
236 int r;
237
238 if (!mac->vif)
239 return -1;
240
241 r = zd_write_mac_addr(&mac->chip, mac->vif->addr);
242 if (r)
243 return r;
244
245 /* Vendor driver after setting MAC either sets BSSID for AP or
246 * filter for other modes.
247 */
248 if (mac->type != NL80211_IFTYPE_AP)
249 return set_rx_filter(mac);
250 else
251 return zd_write_bssid(&mac->chip, mac->vif->addr);
252}
253
234static int set_mc_hash(struct zd_mac *mac) 254static int set_mc_hash(struct zd_mac *mac)
235{ 255{
236 struct zd_mc_hash hash; 256 struct zd_mc_hash hash;
@@ -888,7 +908,9 @@ static int zd_op_add_interface(struct ieee80211_hw *hw,
888 return -EOPNOTSUPP; 908 return -EOPNOTSUPP;
889 } 909 }
890 910
891 return zd_write_mac_addr(&mac->chip, vif->addr); 911 mac->vif = vif;
912
913 return set_mac_and_bssid(mac);
892} 914}
893 915
894static void zd_op_remove_interface(struct ieee80211_hw *hw, 916static void zd_op_remove_interface(struct ieee80211_hw *hw,
@@ -896,6 +918,7 @@ static void zd_op_remove_interface(struct ieee80211_hw *hw,
896{ 918{
897 struct zd_mac *mac = zd_hw_mac(hw); 919 struct zd_mac *mac = zd_hw_mac(hw);
898 mac->type = NL80211_IFTYPE_UNSPECIFIED; 920 mac->type = NL80211_IFTYPE_UNSPECIFIED;
921 mac->vif = NULL;
899 zd_set_beacon_interval(&mac->chip, 0); 922 zd_set_beacon_interval(&mac->chip, 0);
900 zd_write_mac_addr(&mac->chip, NULL); 923 zd_write_mac_addr(&mac->chip, NULL);
901} 924}