wifi: mt76: prevent non-offchannel mgmt tx during scan/roc
authorFelix Fietkau <nbd@nbd.name>
Wed, 13 Aug 2025 12:11:06 +0000 (14:11 +0200)
committerFelix Fietkau <nbd@nbd.name>
Wed, 27 Aug 2025 09:20:25 +0000 (11:20 +0200)
Only put probe request packets in the offchannel queue if
IEEE80211_TX_CTRL_DONT_USE_RATE_MASK is set and IEEE80211_TX_CTL_TX_OFFCHAN
is unset.

Fixes: 0b3be9d1d34e ("wifi: mt76: add separate tx scheduling queue for off-channel tx")
Reported-by: Chad Monroe <chad.monroe@adtran.com>
Link: https://patch.msgid.link/20250813121106.81559-2-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/tx.c

index e6cf16706667e783168dbd7fefe3254f0797ae67..03b042fdf997fca8eb4977321abcd98a8c7452a0 100644 (file)
@@ -332,6 +332,7 @@ mt76_tx(struct mt76_phy *phy, struct ieee80211_sta *sta,
        struct mt76_wcid *wcid, struct sk_buff *skb)
 {
        struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+       struct ieee80211_hdr *hdr = (void *)skb->data;
        struct sk_buff_head *head;
 
        if (mt76_testmode_enabled(phy)) {
@@ -349,7 +350,8 @@ mt76_tx(struct mt76_phy *phy, struct ieee80211_sta *sta,
        info->hw_queue |= FIELD_PREP(MT_TX_HW_QUEUE_PHY, phy->band_idx);
 
        if ((info->flags & IEEE80211_TX_CTL_TX_OFFCHAN) ||
-           (info->control.flags & IEEE80211_TX_CTRL_DONT_USE_RATE_MASK))
+           ((info->control.flags & IEEE80211_TX_CTRL_DONT_USE_RATE_MASK) &&
+            ieee80211_is_probe_req(hdr->frame_control)))
                head = &wcid->tx_offchannel;
        else
                head = &wcid->tx_pending;