diff --git a/mac80211.c b/mac80211.c index 915e6173..d862e5ef 100644 --- a/mac80211.c +++ b/mac80211.c @@ -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); diff --git a/mt76.h b/mt76.h index a74e6eef..2d098fac 100644 --- a/mt76.h +++ b/mt76.h @@ -189,6 +189,7 @@ enum { MT76_STATE_RUNNING, MT76_SCANNING, MT76_RESET, + MT76_OFFCHANNEL, }; struct mt76_hw_cap { diff --git a/tx.c b/tx.c index 7ecd2d7c..e9695671 100644 --- a/tx.c +++ b/tx.c @@ -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;