diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ath9k.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 26 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/main.c | 33 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/recv.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/virtual.c | 18 |
7 files changed, 55 insertions, 37 deletions
diff --git a/drivers/net/wireless/ath/ath.h b/drivers/net/wireless/ath/ath.h index 44f885a37c11..7589b2aa030b 100644 --- a/drivers/net/wireless/ath/ath.h +++ b/drivers/net/wireless/ath/ath.h | |||
@@ -41,6 +41,10 @@ struct ath_regulatory { | |||
41 | 41 | ||
42 | struct ath_common { | 42 | struct ath_common { |
43 | u16 cachelsz; | 43 | u16 cachelsz; |
44 | u16 curaid; | ||
45 | u8 macaddr[ETH_ALEN]; | ||
46 | u8 curbssid[ETH_ALEN]; | ||
47 | u8 bssidmask[ETH_ALEN]; | ||
44 | struct ath_regulatory regulatory; | 48 | struct ath_regulatory regulatory; |
45 | }; | 49 | }; |
46 | 50 | ||
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index e54fac322bd2..757f17fddcfd 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -581,12 +581,9 @@ struct ath_softc { | |||
581 | spinlock_t sc_pm_lock; | 581 | spinlock_t sc_pm_lock; |
582 | struct mutex mutex; | 582 | struct mutex mutex; |
583 | 583 | ||
584 | u8 curbssid[ETH_ALEN]; | ||
585 | u8 bssidmask[ETH_ALEN]; | ||
586 | u32 intrstatus; | 584 | u32 intrstatus; |
587 | u32 sc_flags; /* SC_OP_* */ | 585 | u32 sc_flags; /* SC_OP_* */ |
588 | u16 curtxpow; | 586 | u16 curtxpow; |
589 | u16 curaid; | ||
590 | u8 nbcnvifs; | 587 | u8 nbcnvifs; |
591 | u16 nvifs; | 588 | u16 nvifs; |
592 | u8 tx_chainmask; | 589 | u8 tx_chainmask; |
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 20c1b3edbd0a..4e14c307b3da 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -511,6 +511,7 @@ static int ath9k_hw_rf_claim(struct ath_hw *ah) | |||
511 | 511 | ||
512 | static int ath9k_hw_init_macaddr(struct ath_hw *ah) | 512 | static int ath9k_hw_init_macaddr(struct ath_hw *ah) |
513 | { | 513 | { |
514 | struct ath_common *common = ath9k_hw_common(ah); | ||
514 | u32 sum; | 515 | u32 sum; |
515 | int i; | 516 | int i; |
516 | u16 eeval; | 517 | u16 eeval; |
@@ -519,8 +520,8 @@ static int ath9k_hw_init_macaddr(struct ath_hw *ah) | |||
519 | for (i = 0; i < 3; i++) { | 520 | for (i = 0; i < 3; i++) { |
520 | eeval = ah->eep_ops->get_eeprom(ah, AR_EEPROM_MAC(i)); | 521 | eeval = ah->eep_ops->get_eeprom(ah, AR_EEPROM_MAC(i)); |
521 | sum += eeval; | 522 | sum += eeval; |
522 | ah->macaddr[2 * i] = eeval >> 8; | 523 | common->macaddr[2 * i] = eeval >> 8; |
523 | ah->macaddr[2 * i + 1] = eeval & 0xff; | 524 | common->macaddr[2 * i + 1] = eeval & 0xff; |
524 | } | 525 | } |
525 | if (sum == 0 || sum == 0xffff * 3) | 526 | if (sum == 0 || sum == 0xffff * 3) |
526 | return -EADDRNOTAVAIL; | 527 | return -EADDRNOTAVAIL; |
@@ -2343,6 +2344,7 @@ static void ath9k_enable_rfkill(struct ath_hw *ah) | |||
2343 | int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, | 2344 | int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, |
2344 | bool bChannelChange) | 2345 | bool bChannelChange) |
2345 | { | 2346 | { |
2347 | struct ath_common *common = ath9k_hw_common(ah); | ||
2346 | u32 saveLedState; | 2348 | u32 saveLedState; |
2347 | struct ath_softc *sc = ah->ah_sc; | 2349 | struct ath_softc *sc = ah->ah_sc; |
2348 | struct ath9k_channel *curchan = ah->curchan; | 2350 | struct ath9k_channel *curchan = ah->curchan; |
@@ -2463,8 +2465,8 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, | |||
2463 | 2465 | ||
2464 | ath9k_hw_decrease_chain_power(ah, chan); | 2466 | ath9k_hw_decrease_chain_power(ah, chan); |
2465 | 2467 | ||
2466 | REG_WRITE(ah, AR_STA_ID0, get_unaligned_le32(ah->macaddr)); | 2468 | REG_WRITE(ah, AR_STA_ID0, get_unaligned_le32(common->macaddr)); |
2467 | REG_WRITE(ah, AR_STA_ID1, get_unaligned_le16(ah->macaddr + 4) | 2469 | REG_WRITE(ah, AR_STA_ID1, get_unaligned_le16(common->macaddr + 4) |
2468 | | macStaId1 | 2470 | | macStaId1 |
2469 | | AR_STA_ID1_RTS_USE_DEF | 2471 | | AR_STA_ID1_RTS_USE_DEF |
2470 | | (ah->config. | 2472 | | (ah->config. |
@@ -4007,7 +4009,7 @@ void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit) | |||
4007 | 4009 | ||
4008 | void ath9k_hw_setmac(struct ath_hw *ah, const u8 *mac) | 4010 | void ath9k_hw_setmac(struct ath_hw *ah, const u8 *mac) |
4009 | { | 4011 | { |
4010 | memcpy(ah->macaddr, mac, ETH_ALEN); | 4012 | memcpy(ath9k_hw_common(ah)->macaddr, mac, ETH_ALEN); |
4011 | } | 4013 | } |
4012 | 4014 | ||
4013 | void ath9k_hw_setopmode(struct ath_hw *ah) | 4015 | void ath9k_hw_setopmode(struct ath_hw *ah) |
@@ -4023,15 +4025,19 @@ void ath9k_hw_setmcastfilter(struct ath_hw *ah, u32 filter0, u32 filter1) | |||
4023 | 4025 | ||
4024 | void ath9k_hw_setbssidmask(struct ath_hw *ah) | 4026 | void ath9k_hw_setbssidmask(struct ath_hw *ah) |
4025 | { | 4027 | { |
4026 | REG_WRITE(ah, AR_BSSMSKL, get_unaligned_le32(ah->ah_sc->bssidmask)); | 4028 | struct ath_common *common = ath9k_hw_common(ah); |
4027 | REG_WRITE(ah, AR_BSSMSKU, get_unaligned_le16(ah->ah_sc->bssidmask + 4)); | 4029 | |
4030 | REG_WRITE(ah, AR_BSSMSKL, get_unaligned_le32(common->bssidmask)); | ||
4031 | REG_WRITE(ah, AR_BSSMSKU, get_unaligned_le16(common->bssidmask + 4)); | ||
4028 | } | 4032 | } |
4029 | 4033 | ||
4030 | void ath9k_hw_write_associd(struct ath_hw *ah) | 4034 | void ath9k_hw_write_associd(struct ath_hw *ah) |
4031 | { | 4035 | { |
4032 | REG_WRITE(ah, AR_BSS_ID0, get_unaligned_le32(ah->ah_sc->curbssid)); | 4036 | struct ath_common *common = ath9k_hw_common(ah); |
4033 | REG_WRITE(ah, AR_BSS_ID1, get_unaligned_le16(ah->ah_sc->curbssid + 4) | | 4037 | |
4034 | ((ah->ah_sc->curaid & 0x3fff) << AR_BSS_ID1_AID_S)); | 4038 | REG_WRITE(ah, AR_BSS_ID0, get_unaligned_le32(common->curbssid)); |
4039 | REG_WRITE(ah, AR_BSS_ID1, get_unaligned_le16(common->curbssid + 4) | | ||
4040 | ((common->curaid & 0x3fff) << AR_BSS_ID1_AID_S)); | ||
4035 | } | 4041 | } |
4036 | 4042 | ||
4037 | u64 ath9k_hw_gettsf64(struct ath_hw *ah) | 4043 | u64 ath9k_hw_gettsf64(struct ath_hw *ah) |
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index c0c22dfd3065..6aee01343d3a 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -451,7 +451,6 @@ struct ath_hw { | |||
451 | 451 | ||
452 | bool sw_mgmt_crypto; | 452 | bool sw_mgmt_crypto; |
453 | bool is_pciexpress; | 453 | bool is_pciexpress; |
454 | u8 macaddr[ETH_ALEN]; | ||
455 | u16 tx_trig_level; | 454 | u16 tx_trig_level; |
456 | u16 rfsilent; | 455 | u16 rfsilent; |
457 | u32 rfkill_gpio; | 456 | u32 rfkill_gpio; |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index f2c1feb7d491..a96350d2aace 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -976,13 +976,14 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc, | |||
976 | struct ieee80211_bss_conf *bss_conf) | 976 | struct ieee80211_bss_conf *bss_conf) |
977 | { | 977 | { |
978 | struct ath_hw *ah = sc->sc_ah; | 978 | struct ath_hw *ah = sc->sc_ah; |
979 | struct ath_common *common = ath9k_hw_common(ah); | ||
979 | 980 | ||
980 | if (bss_conf->assoc) { | 981 | if (bss_conf->assoc) { |
981 | DPRINTF(ah, ATH_DBG_CONFIG, "Bss Info ASSOC %d, bssid: %pM\n", | 982 | DPRINTF(ah, ATH_DBG_CONFIG, "Bss Info ASSOC %d, bssid: %pM\n", |
982 | bss_conf->aid, sc->curbssid); | 983 | bss_conf->aid, common->curbssid); |
983 | 984 | ||
984 | /* New association, store aid */ | 985 | /* New association, store aid */ |
985 | sc->curaid = bss_conf->aid; | 986 | common->curaid = bss_conf->aid; |
986 | ath9k_hw_write_associd(ah); | 987 | ath9k_hw_write_associd(ah); |
987 | 988 | ||
988 | /* | 989 | /* |
@@ -1001,7 +1002,7 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc, | |||
1001 | ath_start_ani(sc); | 1002 | ath_start_ani(sc); |
1002 | } else { | 1003 | } else { |
1003 | DPRINTF(ah, ATH_DBG_CONFIG, "Bss Info DISASSOC\n"); | 1004 | DPRINTF(ah, ATH_DBG_CONFIG, "Bss Info DISASSOC\n"); |
1004 | sc->curaid = 0; | 1005 | common->curaid = 0; |
1005 | /* Stop ANI */ | 1006 | /* Stop ANI */ |
1006 | del_timer_sync(&sc->ani.timer); | 1007 | del_timer_sync(&sc->ani.timer); |
1007 | } | 1008 | } |
@@ -1497,6 +1498,7 @@ static int ath_init_btcoex_timer(struct ath_softc *sc) | |||
1497 | static int ath_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid) | 1498 | static int ath_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid) |
1498 | { | 1499 | { |
1499 | struct ath_hw *ah = NULL; | 1500 | struct ath_hw *ah = NULL; |
1501 | struct ath_common *common; | ||
1500 | int r = 0, i; | 1502 | int r = 0, i; |
1501 | int csz = 0; | 1503 | int csz = 0; |
1502 | int qnum; | 1504 | int qnum; |
@@ -1675,8 +1677,10 @@ static int ath_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid) | |||
1675 | ath9k_hw_setcapability(ah, ATH9K_CAP_DIVERSITY, 1, true, NULL); | 1677 | ath9k_hw_setcapability(ah, ATH9K_CAP_DIVERSITY, 1, true, NULL); |
1676 | sc->rx.defant = ath9k_hw_getdefantenna(ah); | 1678 | sc->rx.defant = ath9k_hw_getdefantenna(ah); |
1677 | 1679 | ||
1680 | common = ath9k_hw_common(ah); | ||
1681 | |||
1678 | if (ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK) | 1682 | if (ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK) |
1679 | memcpy(sc->bssidmask, ath_bcast_mac, ETH_ALEN); | 1683 | memcpy(common->bssidmask, ath_bcast_mac, ETH_ALEN); |
1680 | 1684 | ||
1681 | sc->beacon.slottime = ATH9K_SLOT_TIME_9; /* default to short slot time */ | 1685 | sc->beacon.slottime = ATH9K_SLOT_TIME_9; /* default to short slot time */ |
1682 | 1686 | ||
@@ -1780,6 +1784,7 @@ void ath_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) | |||
1780 | int ath_init_device(u16 devid, struct ath_softc *sc, u16 subsysid) | 1784 | int ath_init_device(u16 devid, struct ath_softc *sc, u16 subsysid) |
1781 | { | 1785 | { |
1782 | struct ieee80211_hw *hw = sc->hw; | 1786 | struct ieee80211_hw *hw = sc->hw; |
1787 | struct ath_common *common; | ||
1783 | struct ath_hw *ah; | 1788 | struct ath_hw *ah; |
1784 | int error = 0, i; | 1789 | int error = 0, i; |
1785 | struct ath_regulatory *reg; | 1790 | struct ath_regulatory *reg; |
@@ -1791,19 +1796,20 @@ int ath_init_device(u16 devid, struct ath_softc *sc, u16 subsysid) | |||
1791 | return error; | 1796 | return error; |
1792 | 1797 | ||
1793 | ah = sc->sc_ah; | 1798 | ah = sc->sc_ah; |
1799 | common = ath9k_hw_common(ah); | ||
1794 | 1800 | ||
1795 | /* get mac address from hardware and set in mac80211 */ | 1801 | /* get mac address from hardware and set in mac80211 */ |
1796 | 1802 | ||
1797 | SET_IEEE80211_PERM_ADDR(hw, ah->macaddr); | 1803 | SET_IEEE80211_PERM_ADDR(hw, common->macaddr); |
1798 | 1804 | ||
1799 | ath_set_hw_capab(sc, hw); | 1805 | ath_set_hw_capab(sc, hw); |
1800 | 1806 | ||
1801 | error = ath_regd_init(&sc->common.regulatory, sc->hw->wiphy, | 1807 | error = ath_regd_init(&common->regulatory, sc->hw->wiphy, |
1802 | ath9k_reg_notifier); | 1808 | ath9k_reg_notifier); |
1803 | if (error) | 1809 | if (error) |
1804 | return error; | 1810 | return error; |
1805 | 1811 | ||
1806 | reg = &sc->common.regulatory; | 1812 | reg = &common->regulatory; |
1807 | 1813 | ||
1808 | if (ah->caps.hw_caps & ATH9K_HW_CAP_HT) { | 1814 | if (ah->caps.hw_caps & ATH9K_HW_CAP_HT) { |
1809 | setup_ht_cap(sc, &sc->sbands[IEEE80211_BAND_2GHZ].ht_cap); | 1815 | setup_ht_cap(sc, &sc->sbands[IEEE80211_BAND_2GHZ].ht_cap); |
@@ -2785,6 +2791,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw, | |||
2785 | struct ath_wiphy *aphy = hw->priv; | 2791 | struct ath_wiphy *aphy = hw->priv; |
2786 | struct ath_softc *sc = aphy->sc; | 2792 | struct ath_softc *sc = aphy->sc; |
2787 | struct ath_hw *ah = sc->sc_ah; | 2793 | struct ath_hw *ah = sc->sc_ah; |
2794 | struct ath_common *common = ath9k_hw_common(ah); | ||
2788 | struct ath_vif *avp = (void *)vif->drv_priv; | 2795 | struct ath_vif *avp = (void *)vif->drv_priv; |
2789 | u32 rfilt = 0; | 2796 | u32 rfilt = 0; |
2790 | int error, i; | 2797 | int error, i; |
@@ -2800,8 +2807,8 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw, | |||
2800 | ah->opmode != NL80211_IFTYPE_AP) { | 2807 | ah->opmode != NL80211_IFTYPE_AP) { |
2801 | ah->opmode = NL80211_IFTYPE_STATION; | 2808 | ah->opmode = NL80211_IFTYPE_STATION; |
2802 | ath9k_hw_setopmode(ah); | 2809 | ath9k_hw_setopmode(ah); |
2803 | memcpy(sc->curbssid, sc->sc_ah->macaddr, ETH_ALEN); | 2810 | memcpy(common->curbssid, common->macaddr, ETH_ALEN); |
2804 | sc->curaid = 0; | 2811 | common->curaid = 0; |
2805 | ath9k_hw_write_associd(ah); | 2812 | ath9k_hw_write_associd(ah); |
2806 | /* Request full reset to get hw opmode changed properly */ | 2813 | /* Request full reset to get hw opmode changed properly */ |
2807 | sc->sc_flags |= SC_OP_FULL_RESET; | 2814 | sc->sc_flags |= SC_OP_FULL_RESET; |
@@ -2814,9 +2821,9 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw, | |||
2814 | case NL80211_IFTYPE_ADHOC: | 2821 | case NL80211_IFTYPE_ADHOC: |
2815 | case NL80211_IFTYPE_MESH_POINT: | 2822 | case NL80211_IFTYPE_MESH_POINT: |
2816 | /* Set BSSID */ | 2823 | /* Set BSSID */ |
2817 | memcpy(sc->curbssid, bss_conf->bssid, ETH_ALEN); | 2824 | memcpy(common->curbssid, bss_conf->bssid, ETH_ALEN); |
2818 | memcpy(avp->bssid, bss_conf->bssid, ETH_ALEN); | 2825 | memcpy(avp->bssid, bss_conf->bssid, ETH_ALEN); |
2819 | sc->curaid = 0; | 2826 | common->curaid = 0; |
2820 | ath9k_hw_write_associd(ah); | 2827 | ath9k_hw_write_associd(ah); |
2821 | 2828 | ||
2822 | /* Set aggregation protection mode parameters */ | 2829 | /* Set aggregation protection mode parameters */ |
@@ -2824,7 +2831,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw, | |||
2824 | 2831 | ||
2825 | DPRINTF(sc->sc_ah, ATH_DBG_CONFIG, | 2832 | DPRINTF(sc->sc_ah, ATH_DBG_CONFIG, |
2826 | "RX filter 0x%x bssid %pM aid 0x%x\n", | 2833 | "RX filter 0x%x bssid %pM aid 0x%x\n", |
2827 | rfilt, sc->curbssid, sc->curaid); | 2834 | rfilt, common->curbssid, common->curaid); |
2828 | 2835 | ||
2829 | /* need to reconfigure the beacon */ | 2836 | /* need to reconfigure the beacon */ |
2830 | sc->sc_flags &= ~SC_OP_BEACONS ; | 2837 | sc->sc_flags &= ~SC_OP_BEACONS ; |
@@ -2863,7 +2870,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw, | |||
2863 | if (ath9k_hw_keyisvalid(sc->sc_ah, (u16)i)) | 2870 | if (ath9k_hw_keyisvalid(sc->sc_ah, (u16)i)) |
2864 | ath9k_hw_keysetmac(sc->sc_ah, | 2871 | ath9k_hw_keysetmac(sc->sc_ah, |
2865 | (u16)i, | 2872 | (u16)i, |
2866 | sc->curbssid); | 2873 | common->curbssid); |
2867 | } | 2874 | } |
2868 | 2875 | ||
2869 | /* Only legacy IBSS for now */ | 2876 | /* Only legacy IBSS for now */ |
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index 529cab6bfe66..3bdd4e637219 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c | |||
@@ -272,6 +272,8 @@ rx_next: | |||
272 | static void ath_opmode_init(struct ath_softc *sc) | 272 | static void ath_opmode_init(struct ath_softc *sc) |
273 | { | 273 | { |
274 | struct ath_hw *ah = sc->sc_ah; | 274 | struct ath_hw *ah = sc->sc_ah; |
275 | struct ath_common *common = ath9k_hw_common(ah); | ||
276 | |||
275 | u32 rfilt, mfilt[2]; | 277 | u32 rfilt, mfilt[2]; |
276 | 278 | ||
277 | /* configure rx filter */ | 279 | /* configure rx filter */ |
@@ -286,7 +288,7 @@ static void ath_opmode_init(struct ath_softc *sc) | |||
286 | ath9k_hw_setopmode(ah); | 288 | ath9k_hw_setopmode(ah); |
287 | 289 | ||
288 | /* Handle any link-level address change. */ | 290 | /* Handle any link-level address change. */ |
289 | ath9k_hw_setmac(ah, sc->sc_ah->macaddr); | 291 | ath9k_hw_setmac(ah, common->macaddr); |
290 | 292 | ||
291 | /* calculate and install multicast filter */ | 293 | /* calculate and install multicast filter */ |
292 | mfilt[0] = mfilt[1] = ~0; | 294 | mfilt[0] = mfilt[1] = ~0; |
@@ -527,12 +529,13 @@ static bool ath_beacon_dtim_pending_cab(struct sk_buff *skb) | |||
527 | static void ath_rx_ps_beacon(struct ath_softc *sc, struct sk_buff *skb) | 529 | static void ath_rx_ps_beacon(struct ath_softc *sc, struct sk_buff *skb) |
528 | { | 530 | { |
529 | struct ieee80211_mgmt *mgmt; | 531 | struct ieee80211_mgmt *mgmt; |
532 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | ||
530 | 533 | ||
531 | if (skb->len < 24 + 8 + 2 + 2) | 534 | if (skb->len < 24 + 8 + 2 + 2) |
532 | return; | 535 | return; |
533 | 536 | ||
534 | mgmt = (struct ieee80211_mgmt *)skb->data; | 537 | mgmt = (struct ieee80211_mgmt *)skb->data; |
535 | if (memcmp(sc->curbssid, mgmt->bssid, ETH_ALEN) != 0) | 538 | if (memcmp(common->curbssid, mgmt->bssid, ETH_ALEN) != 0) |
536 | return; /* not from our current AP */ | 539 | return; /* not from our current AP */ |
537 | 540 | ||
538 | sc->sc_flags &= ~SC_OP_WAIT_FOR_BEACON; | 541 | sc->sc_flags &= ~SC_OP_WAIT_FOR_BEACON; |
diff --git a/drivers/net/wireless/ath/ath9k/virtual.c b/drivers/net/wireless/ath/ath9k/virtual.c index 52becd32ad8c..7b763b6555fd 100644 --- a/drivers/net/wireless/ath/ath9k/virtual.c +++ b/drivers/net/wireless/ath/ath9k/virtual.c | |||
@@ -40,6 +40,7 @@ void ath9k_set_bssid_mask(struct ieee80211_hw *hw) | |||
40 | { | 40 | { |
41 | struct ath_wiphy *aphy = hw->priv; | 41 | struct ath_wiphy *aphy = hw->priv; |
42 | struct ath_softc *sc = aphy->sc; | 42 | struct ath_softc *sc = aphy->sc; |
43 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | ||
43 | struct ath9k_vif_iter_data iter_data; | 44 | struct ath9k_vif_iter_data iter_data; |
44 | int i, j; | 45 | int i, j; |
45 | u8 mask[ETH_ALEN]; | 46 | u8 mask[ETH_ALEN]; |
@@ -51,7 +52,7 @@ void ath9k_set_bssid_mask(struct ieee80211_hw *hw) | |||
51 | */ | 52 | */ |
52 | iter_data.addr = kmalloc(ETH_ALEN, GFP_ATOMIC); | 53 | iter_data.addr = kmalloc(ETH_ALEN, GFP_ATOMIC); |
53 | if (iter_data.addr) { | 54 | if (iter_data.addr) { |
54 | memcpy(iter_data.addr, sc->sc_ah->macaddr, ETH_ALEN); | 55 | memcpy(iter_data.addr, common->macaddr, ETH_ALEN); |
55 | iter_data.count = 1; | 56 | iter_data.count = 1; |
56 | } else | 57 | } else |
57 | iter_data.count = 0; | 58 | iter_data.count = 0; |
@@ -86,12 +87,12 @@ void ath9k_set_bssid_mask(struct ieee80211_hw *hw) | |||
86 | kfree(iter_data.addr); | 87 | kfree(iter_data.addr); |
87 | 88 | ||
88 | /* Invert the mask and configure hardware */ | 89 | /* Invert the mask and configure hardware */ |
89 | sc->bssidmask[0] = ~mask[0]; | 90 | common->bssidmask[0] = ~mask[0]; |
90 | sc->bssidmask[1] = ~mask[1]; | 91 | common->bssidmask[1] = ~mask[1]; |
91 | sc->bssidmask[2] = ~mask[2]; | 92 | common->bssidmask[2] = ~mask[2]; |
92 | sc->bssidmask[3] = ~mask[3]; | 93 | common->bssidmask[3] = ~mask[3]; |
93 | sc->bssidmask[4] = ~mask[4]; | 94 | common->bssidmask[4] = ~mask[4]; |
94 | sc->bssidmask[5] = ~mask[5]; | 95 | common->bssidmask[5] = ~mask[5]; |
95 | 96 | ||
96 | ath9k_hw_setbssidmask(sc->sc_ah); | 97 | ath9k_hw_setbssidmask(sc->sc_ah); |
97 | } | 98 | } |
@@ -100,6 +101,7 @@ int ath9k_wiphy_add(struct ath_softc *sc) | |||
100 | { | 101 | { |
101 | int i, error; | 102 | int i, error; |
102 | struct ath_wiphy *aphy; | 103 | struct ath_wiphy *aphy; |
104 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | ||
103 | struct ieee80211_hw *hw; | 105 | struct ieee80211_hw *hw; |
104 | u8 addr[ETH_ALEN]; | 106 | u8 addr[ETH_ALEN]; |
105 | 107 | ||
@@ -138,7 +140,7 @@ int ath9k_wiphy_add(struct ath_softc *sc) | |||
138 | sc->sec_wiphy[i] = aphy; | 140 | sc->sec_wiphy[i] = aphy; |
139 | spin_unlock_bh(&sc->wiphy_lock); | 141 | spin_unlock_bh(&sc->wiphy_lock); |
140 | 142 | ||
141 | memcpy(addr, sc->sc_ah->macaddr, ETH_ALEN); | 143 | memcpy(addr, common->macaddr, ETH_ALEN); |
142 | addr[0] |= 0x02; /* Locally managed address */ | 144 | addr[0] |= 0x02; /* Locally managed address */ |
143 | /* | 145 | /* |
144 | * XOR virtual wiphy index into the least significant bits to generate | 146 | * XOR virtual wiphy index into the least significant bits to generate |