wifi: mt76: clear offchannel state when a scan leaves no channel to restore

mt76_scan_complete() only restores the operating channel when the phy has
one, and __mt76_set_channel() is the sole place that clears
phy->offchannel. A scan on a phy without an operating channel, such as a
6 GHz radio with no interface configured, therefore leaves the flag set
for good.

mt76_txq_schedule_list() skips every TXQ whose wcid points at a phy in
that state, so all traffic for stations on the band stops being dequeued.
The frames stay in the mac80211 queues, never reach the hardware and are
counted nowhere, until an unrelated channel set clears the flag.

Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Felix Fietkau
2026-08-08 08:22:00 +02:00
parent 476cac3604
commit 2c7b3011d2
2 changed files with 9 additions and 0 deletions
+2
View File
@@ -330,6 +330,8 @@ void mt76_roc_complete(struct mt76_phy *phy)
!test_bit(MT76_MCU_RESET, &dev->phy.state)) {
__mt76_set_channel(phy, &phy->main_chandef, false);
mt76_offchannel_notify(phy, false);
} else {
phy->offchannel = false;
}
mt76_put_vif_phy_link(phy, phy->roc_vif, phy->roc_link);
phy->roc_vif = NULL;
+7
View File
@@ -29,6 +29,13 @@ static void mt76_scan_complete(struct mt76_dev *dev, bool abort)
__mt76_set_channel(phy, &phy->main_chandef, false);
if (offchannel)
mt76_offchannel_notify(phy, false);
} else {
/* A phy that has no operating channel has nothing to restore,
* but the flag also gates the TX queues of every station whose
* wcid points at this band, so leaving it set stalls them until
* something else happens to set a channel.
*/
phy->offchannel = false;
}
mt76_put_vif_phy_link(phy, dev->scan.vif, dev->scan.mlink);
memset(&dev->scan, 0, sizeof(dev->scan));