[PATCH 03/10] wifi: mt76: mt7603: set beacon and CAB queue index in the TXD directly

From: Murad Dadashev via B4 Relay

Date: Fri Nov 27 2026 - 03:35:45 EST


From: Murad Dadashev <llamapersonaltv@xxxxxxxxx>

mt7603_mac_write_txwi() looks up the TX queue to get the hardware queue
index for the TXD. Beacon and CAB frames always go to the BCN and BMC
hardware queues, so use those indices directly for MT_TXQ_BEACON and
MT_TXQ_CAB.

This lets a bus without dedicated beacon and CAB rings queue those
frames on another ring while still targeting the right hardware queue.

No functional change for MT7603E and MT76x8.

Signed-off-by: Murad Dadashev <llamapersonaltv@xxxxxxxxx>
---
drivers/net/wireless/mediatek/mt76/mt7603/mac.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c
index fa0bf9a201ce2d43b48981aab75b70ff21ff5c51..fb5e06d04e5a943a4536676fdf7676e6789db6df 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c
@@ -949,8 +949,8 @@ mt7603_mac_write_txwi(struct mt7603_dev *dev, __le32 *txwi,
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
struct ieee80211_bar *bar = (struct ieee80211_bar *)skb->data;
struct ieee80211_vif *vif = info->control.vif;
- struct mt76_queue *q = dev->mphy.q_tx[qid];
struct mt7603_vif *mvif;
+ u8 q_idx;
int wlan_idx;
int hdr_len = ieee80211_get_hdrlen_from_skb(skb);
int tx_count = 8;
@@ -961,6 +961,13 @@ mt7603_mac_write_txwi(struct mt7603_dev *dev, __le32 *txwi,
u32 val;
u8 bw;

+ if (qid == MT_TXQ_BEACON)
+ q_idx = MT_TX_HW_QUEUE_BCN;
+ else if (qid == MT_TXQ_CAB)
+ q_idx = MT_TX_HW_QUEUE_BMC;
+ else
+ q_idx = dev->mphy.q_tx[qid]->hw_idx;
+
if (vif) {
mvif = (struct mt7603_vif *)vif->drv_priv;
vif_idx = mvif->idx;
@@ -983,7 +990,7 @@ mt7603_mac_write_txwi(struct mt7603_dev *dev, __le32 *txwi,
frame_subtype = (fc & IEEE80211_FCTL_STYPE) >> 4;

val = FIELD_PREP(MT_TXD0_TX_BYTES, skb->len + MT_TXD_SIZE) |
- FIELD_PREP(MT_TXD0_Q_IDX, q->hw_idx);
+ FIELD_PREP(MT_TXD0_Q_IDX, q_idx);
txwi[0] = cpu_to_le32(val);

val = MT_TXD1_LONG_FORMAT |

--
2.47.3