ath5k: Fix TX queues stopping
authorBruno Randolf <br1@einfach.org>
Fri, 17 Sep 2010 02:36:46 +0000 (11:36 +0900)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 21 Sep 2010 15:05:10 +0000 (11:05 -0400)
It does not make sense to stop queues for NF calibration. This will not stop
transmissions from the card, if there are queued packets.

If we run out of TX buffers we need to stop all queues, not only one.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath5k/base.c

index 776f415e856772b30cf9f0f6a405f316c85722b3..92d139bbcc31b3141f49f8e25a2cfdbc88f3829e 100644 (file)
@@ -1489,7 +1489,7 @@ static int ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb,
        if (list_empty(&sc->txbuf)) {
                ATH5K_ERR(sc, "no further txbuf available, dropping packet\n");
                spin_unlock_irqrestore(&sc->txbuflock, flags);
-               ieee80211_stop_queue(hw, skb_get_queue_mapping(skb));
+               ieee80211_stop_queues(hw);
                goto drop_packet;
        }
        bf = list_first_entry(&sc->txbuf, struct ath5k_buf, list);
@@ -2138,14 +2138,13 @@ ath5k_tasklet_calibrate(unsigned long data)
                                sc->curchan->center_freq));
 
        /* Noise floor calibration interrupts rx/tx path while I/Q calibration
-        * doesn't. We stop the queues so that calibration doesn't interfere
-        * with TX and don't run it as often */
+        * doesn't.
+        * TODO: We should stop TX here, so that it doesn't interfere.
+        * Note that stopping the queues is not enough to stop TX! */
        if (time_is_before_eq_jiffies(ah->ah_cal_next_nf)) {
                ah->ah_cal_next_nf = jiffies +
                        msecs_to_jiffies(ATH5K_TUNE_CALIBRATION_INTERVAL_NF);
-               ieee80211_stop_queues(sc->hw);
                ath5k_hw_update_noise_floor(ah);
-               ieee80211_wake_queues(sc->hw);
        }
 
        ah->ah_cal_mask &= ~AR5K_CALIBRATION_FULL;