mt76: only stop tx queues on offchannel, not during the entire scan
authorFelix Fietkau <nbd@nbd.name>
Sun, 20 May 2018 05:43:45 +0000 (07:43 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 23 May 2018 07:58:09 +0000 (10:58 +0300)
During scans, mac80211 frequently switches back to the home channel to
minimize interruption of ongoing traffic. Keep regular tx queues active
during that time.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/mediatek/mt76/mac80211.c
drivers/net/wireless/mediatek/mt76/mt76.h
drivers/net/wireless/mediatek/mt76/tx.c

index 915e617..d862e5e 100644 (file)
@@ -366,6 +366,11 @@ void mt76_set_channel(struct mt76_dev *dev)
        struct mt76_channel_state *state;
        bool offchannel = hw->conf.flags & IEEE80211_CONF_OFFCHANNEL;
 
+       if (offchannel)
+               set_bit(MT76_OFFCHANNEL, &dev->state);
+       else
+               clear_bit(MT76_OFFCHANNEL, &dev->state);
+
        if (dev->drv->update_survey)
                dev->drv->update_survey(dev);
 
index a74e6ee..2d098fa 100644 (file)
@@ -189,6 +189,7 @@ enum {
        MT76_STATE_RUNNING,
        MT76_SCANNING,
        MT76_RESET,
+       MT76_OFFCHANNEL,
 };
 
 struct mt76_hw_cap {
index 7ecd2d7..e969567 100644 (file)
@@ -332,7 +332,7 @@ mt76_txq_send_burst(struct mt76_dev *dev, struct mt76_queue *hwq,
                if (probe)
                        break;
 
-               if (test_bit(MT76_SCANNING, &dev->state) ||
+               if (test_bit(MT76_OFFCHANNEL, &dev->state) ||
                    test_bit(MT76_RESET, &dev->state))
                        return -EBUSY;
 
@@ -385,7 +385,7 @@ restart:
                bool empty = false;
                int cur;
 
-               if (test_bit(MT76_SCANNING, &dev->state) ||
+               if (test_bit(MT76_OFFCHANNEL, &dev->state) ||
                    test_bit(MT76_RESET, &dev->state))
                        return -EBUSY;