diff options
author | Vasanthakumar Thiagarajan <vasanth@atheros.com> | 2010-07-22 05:24:11 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-07-26 15:32:41 -0400 |
commit | 68e8f2fae03cde0ba841325e2660b55fe49bf4b9 (patch) | |
tree | 011191db1afaa3933d1d83f5fcbee1af0f8904fe /drivers/net | |
parent | 2189d13f6cfc58627a01d6a91591e59a2fa62902 (diff) |
ath9k: Fix inconsistency between txq->stopped and the actual queue state
Sometimes txq state(txq->stopped) can be marked as started but the actual
queue may not be started (in ATH_WIPHY_SCAN state, for example). Fix this.
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ath9k.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/virtual.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/xmit.c | 4 |
3 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index 6e486a508edb..998ae2c49ed2 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -687,7 +687,7 @@ bool ath9k_all_wiphys_idle(struct ath_softc *sc); | |||
687 | void ath9k_set_wiphy_idle(struct ath_wiphy *aphy, bool idle); | 687 | void ath9k_set_wiphy_idle(struct ath_wiphy *aphy, bool idle); |
688 | 688 | ||
689 | void ath_mac80211_stop_queue(struct ath_softc *sc, u16 skb_queue); | 689 | void ath_mac80211_stop_queue(struct ath_softc *sc, u16 skb_queue); |
690 | void ath_mac80211_start_queue(struct ath_softc *sc, u16 skb_queue); | 690 | bool ath_mac80211_start_queue(struct ath_softc *sc, u16 skb_queue); |
691 | 691 | ||
692 | void ath_start_rfkill_poll(struct ath_softc *sc); | 692 | void ath_start_rfkill_poll(struct ath_softc *sc); |
693 | extern void ath9k_rfkill_poll_state(struct ieee80211_hw *hw); | 693 | extern void ath9k_rfkill_poll_state(struct ieee80211_hw *hw); |
diff --git a/drivers/net/wireless/ath/ath9k/virtual.c b/drivers/net/wireless/ath/ath9k/virtual.c index 89423ca23d2c..fd20241f57d8 100644 --- a/drivers/net/wireless/ath/ath9k/virtual.c +++ b/drivers/net/wireless/ath/ath9k/virtual.c | |||
@@ -695,16 +695,18 @@ void ath9k_set_wiphy_idle(struct ath_wiphy *aphy, bool idle) | |||
695 | idle ? "idle" : "not-idle"); | 695 | idle ? "idle" : "not-idle"); |
696 | } | 696 | } |
697 | /* Only bother starting a queue on an active virtual wiphy */ | 697 | /* Only bother starting a queue on an active virtual wiphy */ |
698 | void ath_mac80211_start_queue(struct ath_softc *sc, u16 skb_queue) | 698 | bool ath_mac80211_start_queue(struct ath_softc *sc, u16 skb_queue) |
699 | { | 699 | { |
700 | struct ieee80211_hw *hw = sc->pri_wiphy->hw; | 700 | struct ieee80211_hw *hw = sc->pri_wiphy->hw; |
701 | unsigned int i; | 701 | unsigned int i; |
702 | bool txq_started = false; | ||
702 | 703 | ||
703 | spin_lock_bh(&sc->wiphy_lock); | 704 | spin_lock_bh(&sc->wiphy_lock); |
704 | 705 | ||
705 | /* Start the primary wiphy */ | 706 | /* Start the primary wiphy */ |
706 | if (sc->pri_wiphy->state == ATH_WIPHY_ACTIVE) { | 707 | if (sc->pri_wiphy->state == ATH_WIPHY_ACTIVE) { |
707 | ieee80211_wake_queue(hw, skb_queue); | 708 | ieee80211_wake_queue(hw, skb_queue); |
709 | txq_started = true; | ||
708 | goto unlock; | 710 | goto unlock; |
709 | } | 711 | } |
710 | 712 | ||
@@ -718,11 +720,13 @@ void ath_mac80211_start_queue(struct ath_softc *sc, u16 skb_queue) | |||
718 | 720 | ||
719 | hw = aphy->hw; | 721 | hw = aphy->hw; |
720 | ieee80211_wake_queue(hw, skb_queue); | 722 | ieee80211_wake_queue(hw, skb_queue); |
723 | txq_started = true; | ||
721 | break; | 724 | break; |
722 | } | 725 | } |
723 | 726 | ||
724 | unlock: | 727 | unlock: |
725 | spin_unlock_bh(&sc->wiphy_lock); | 728 | spin_unlock_bh(&sc->wiphy_lock); |
729 | return txq_started; | ||
726 | } | 730 | } |
727 | 731 | ||
728 | /* Go ahead and propagate information to all virtual wiphys, it won't hurt */ | 732 | /* Go ahead and propagate information to all virtual wiphys, it won't hurt */ |
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 0644f1e91887..21aa5bdb2592 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -2077,8 +2077,8 @@ static void ath_wake_mac80211_queue(struct ath_softc *sc, struct ath_txq *txq) | |||
2077 | 2077 | ||
2078 | spin_lock_bh(&txq->axq_lock); | 2078 | spin_lock_bh(&txq->axq_lock); |
2079 | if (txq->stopped && sc->tx.pending_frames[qnum] < ATH_MAX_QDEPTH) { | 2079 | if (txq->stopped && sc->tx.pending_frames[qnum] < ATH_MAX_QDEPTH) { |
2080 | ath_mac80211_start_queue(sc, qnum); | 2080 | if (ath_mac80211_start_queue(sc, qnum)) |
2081 | txq->stopped = 0; | 2081 | txq->stopped = 0; |
2082 | } | 2082 | } |
2083 | spin_unlock_bh(&txq->axq_lock); | 2083 | spin_unlock_bh(&txq->axq_lock); |
2084 | } | 2084 | } |