summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath9k/main.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-03-03 19:23:27 +0200
committerJohn W. Linville <linville@tuxdriver.com>2009-03-05 14:39:44 -0500
commit8ca21f0185a606c490867f7471196aa29639e638 (patch)
treed16405f88eb894c6805bbaae4c2a5fba81b2baef /drivers/net/wireless/ath9k/main.c
parent2c3db3d51ee1fcf84f5828788905a4c091b9ae27 (diff)
downloadlwn-8ca21f0185a606c490867f7471196aa29639e638.tar.gz
lwn-8ca21f0185a606c490867f7471196aa29639e638.zip
ath9k: Set BSSID mask based on configured interfaces
Instead of using a hardcoded BSSID mask (mask for own addresses), iterate through all active interfaces and determine the minimal mask that covers all local addresses. Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k/main.c')
-rw-r--r--drivers/net/wireless/ath9k/main.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
index e43cee7907b2..599218def799 100644
--- a/drivers/net/wireless/ath9k/main.c
+++ b/drivers/net/wireless/ath9k/main.c
@@ -1514,11 +1514,8 @@ static int ath_init(u16 devid, struct ath_softc *sc)
ath9k_hw_setcapability(ah, ATH9K_CAP_DIVERSITY, 1, true, NULL);
sc->rx.defant = ath9k_hw_getdefantenna(ah);
- if (ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK) {
+ if (ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK)
memcpy(sc->bssidmask, ath_bcast_mac, ETH_ALEN);
- ATH_SET_VIF_BSSID_MASK(sc->bssidmask);
- ath9k_hw_setbssidmask(sc);
- }
sc->beacon.slottime = ATH9K_SLOT_TIME_9; /* default to short slot time */
@@ -2128,6 +2125,12 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
mutex_lock(&sc->mutex);
+ if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK) &&
+ sc->nvifs > 0) {
+ ret = -ENOBUFS;
+ goto out;
+ }
+
switch (conf->type) {
case NL80211_IFTYPE_STATION:
ic_opmode = NL80211_IFTYPE_STATION;
@@ -2160,6 +2163,10 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
avp->av_bslot = -1;
sc->nvifs++;
+
+ if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK)
+ ath9k_set_bssid_mask(hw);
+
if (sc->nvifs > 1)
goto out; /* skip global settings for secondary vif */