summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath9k/main.c
diff options
context:
space:
mode:
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 */