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>
This commit is contained in:
Jouni Malinen
2009-03-03 19:23:27 +02:00
committed by John W. Linville
orang tua 2c3db3d51e
melakukan 8ca21f0185
4 mengubah file dengan 103 tambahan dan 15 penghapusan

Melihat File

@@ -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 */