aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath9k/main.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-03-03 12:23:27 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-03-05 14:39:44 -0500
commit8ca21f0185a606c490867f7471196aa29639e638 (patch)
treed16405f88eb894c6805bbaae4c2a5fba81b2baef /drivers/net/wireless/ath9k/main.c
parent2c3db3d51ee1fcf84f5828788905a4c091b9ae27 (diff)
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)
1514 ath9k_hw_setcapability(ah, ATH9K_CAP_DIVERSITY, 1, true, NULL); 1514 ath9k_hw_setcapability(ah, ATH9K_CAP_DIVERSITY, 1, true, NULL);
1515 sc->rx.defant = ath9k_hw_getdefantenna(ah); 1515 sc->rx.defant = ath9k_hw_getdefantenna(ah);
1516 1516
1517 if (ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK) { 1517 if (ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK)
1518 memcpy(sc->bssidmask, ath_bcast_mac, ETH_ALEN); 1518 memcpy(sc->bssidmask, ath_bcast_mac, ETH_ALEN);
1519 ATH_SET_VIF_BSSID_MASK(sc->bssidmask);
1520 ath9k_hw_setbssidmask(sc);
1521 }
1522 1519
1523 sc->beacon.slottime = ATH9K_SLOT_TIME_9; /* default to short slot time */ 1520 sc->beacon.slottime = ATH9K_SLOT_TIME_9; /* default to short slot time */
1524 1521
@@ -2128,6 +2125,12 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
2128 2125
2129 mutex_lock(&sc->mutex); 2126 mutex_lock(&sc->mutex);
2130 2127
2128 if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK) &&
2129 sc->nvifs > 0) {
2130 ret = -ENOBUFS;
2131 goto out;
2132 }
2133
2131 switch (conf->type) { 2134 switch (conf->type) {
2132 case NL80211_IFTYPE_STATION: 2135 case NL80211_IFTYPE_STATION:
2133 ic_opmode = NL80211_IFTYPE_STATION; 2136 ic_opmode = NL80211_IFTYPE_STATION;
@@ -2160,6 +2163,10 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
2160 avp->av_bslot = -1; 2163 avp->av_bslot = -1;
2161 2164
2162 sc->nvifs++; 2165 sc->nvifs++;
2166
2167 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK)
2168 ath9k_set_bssid_mask(hw);
2169
2163 if (sc->nvifs > 1) 2170 if (sc->nvifs > 1)
2164 goto out; /* skip global settings for secondary vif */ 2171 goto out; /* skip global settings for secondary vif */
2165 2172