diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/main.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/main.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index dace215b693e..c0c3464d3a86 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -244,11 +244,12 @@ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw, | |||
244 | * the relevant bits of the h/w. | 244 | * the relevant bits of the h/w. |
245 | */ | 245 | */ |
246 | ath9k_hw_set_interrupts(ah, 0); | 246 | ath9k_hw_set_interrupts(ah, 0); |
247 | ath_drain_all_txq(sc, false); | 247 | stopped = ath_drain_all_txq(sc, false); |
248 | 248 | ||
249 | spin_lock_bh(&sc->rx.pcu_lock); | 249 | spin_lock_bh(&sc->rx.pcu_lock); |
250 | 250 | ||
251 | stopped = ath_stoprecv(sc); | 251 | if (!ath_stoprecv(sc)) |
252 | stopped = false; | ||
252 | 253 | ||
253 | /* XXX: do not flush receive queue here. We don't want | 254 | /* XXX: do not flush receive queue here. We don't want |
254 | * to flush data frames already in queue because of | 255 | * to flush data frames already in queue because of |
@@ -1519,8 +1520,6 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw, | |||
1519 | struct ath_softc *sc = aphy->sc; | 1520 | struct ath_softc *sc = aphy->sc; |
1520 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | 1521 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); |
1521 | struct ath_vif *avp = (void *)vif->drv_priv; | 1522 | struct ath_vif *avp = (void *)vif->drv_priv; |
1522 | bool bs_valid = false; | ||
1523 | int i; | ||
1524 | 1523 | ||
1525 | ath_print(common, ATH_DBG_CONFIG, "Detach Interface\n"); | 1524 | ath_print(common, ATH_DBG_CONFIG, "Detach Interface\n"); |
1526 | 1525 | ||
@@ -1534,26 +1533,21 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw, | |||
1534 | if ((sc->sc_ah->opmode == NL80211_IFTYPE_AP) || | 1533 | if ((sc->sc_ah->opmode == NL80211_IFTYPE_AP) || |
1535 | (sc->sc_ah->opmode == NL80211_IFTYPE_ADHOC) || | 1534 | (sc->sc_ah->opmode == NL80211_IFTYPE_ADHOC) || |
1536 | (sc->sc_ah->opmode == NL80211_IFTYPE_MESH_POINT)) { | 1535 | (sc->sc_ah->opmode == NL80211_IFTYPE_MESH_POINT)) { |
1536 | /* Disable SWBA interrupt */ | ||
1537 | sc->sc_ah->imask &= ~ATH9K_INT_SWBA; | ||
1537 | ath9k_ps_wakeup(sc); | 1538 | ath9k_ps_wakeup(sc); |
1539 | ath9k_hw_set_interrupts(sc->sc_ah, sc->sc_ah->imask); | ||
1538 | ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq); | 1540 | ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq); |
1539 | ath9k_ps_restore(sc); | 1541 | ath9k_ps_restore(sc); |
1542 | tasklet_kill(&sc->bcon_tasklet); | ||
1540 | } | 1543 | } |
1541 | 1544 | ||
1542 | ath_beacon_return(sc, avp); | 1545 | ath_beacon_return(sc, avp); |
1543 | sc->sc_flags &= ~SC_OP_BEACONS; | 1546 | sc->sc_flags &= ~SC_OP_BEACONS; |
1544 | 1547 | ||
1545 | for (i = 0; i < ARRAY_SIZE(sc->beacon.bslot); i++) { | 1548 | if (sc->nbcnvifs) { |
1546 | if (sc->beacon.bslot[i] == vif) { | 1549 | /* Re-enable SWBA interrupt */ |
1547 | printk(KERN_DEBUG "%s: vif had allocated beacon " | 1550 | sc->sc_ah->imask |= ATH9K_INT_SWBA; |
1548 | "slot\n", __func__); | ||
1549 | sc->beacon.bslot[i] = NULL; | ||
1550 | sc->beacon.bslot_aphy[i] = NULL; | ||
1551 | } else if (sc->beacon.bslot[i]) | ||
1552 | bs_valid = true; | ||
1553 | } | ||
1554 | if (!bs_valid && (sc->sc_ah->imask & ATH9K_INT_SWBA)) { | ||
1555 | /* Disable SWBA interrupt */ | ||
1556 | sc->sc_ah->imask &= ~ATH9K_INT_SWBA; | ||
1557 | ath9k_ps_wakeup(sc); | 1551 | ath9k_ps_wakeup(sc); |
1558 | ath9k_hw_set_interrupts(sc->sc_ah, sc->sc_ah->imask); | 1552 | ath9k_hw_set_interrupts(sc->sc_ah, sc->sc_ah->imask); |
1559 | ath9k_ps_restore(sc); | 1553 | ath9k_ps_restore(sc); |