mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Murad Dadashev via B4 Relay <devnull+llamapersonaltv.gmail.com@kernel.org>
To: Felix Fietkau <nbd@nbd.name>,
	Lorenzo Bianconi <lorenzo@kernel.org>,
	 Ryder Lee <ryder.lee@mediatek.com>,
	Shayne Chen <shayne.chen@mediatek.com>,
	 Sean Wang <sean.wang@mediatek.com>,
	 Matthias Brugger <matthias.bgg@gmail.com>,
	 AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	 linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org,
	 Murad Dadashev <llamapersonaltv@gmail.com>
Subject: [PATCH 03/10] wifi: mt76: mt7603: set beacon and CAB queue index in the TXD directly
Date: Fri, 27 Nov 2026 11:35:14 +0300	[thread overview]
Message-ID: <20261127-mt7603u-v1-3-369bee9846f8@gmail.com> (raw)
In-Reply-To: <20261127-mt7603u-v1-0-369bee9846f8@gmail.com>

From: Murad Dadashev <llamapersonaltv@gmail.com>

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@gmail.com>
---
 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



  parent reply	other threads:[~2026-11-27  8:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27  8:35 [PATCH 00/10] wifi: mt76: mt7603: add MT7603U USB support Murad Dadashev via B4 Relay
2026-11-27  8:35 ` [PATCH 01/10] wifi: mt76: mt7603: split core code into mt7603-common Murad Dadashev via B4 Relay
2026-11-27  8:35 ` [PATCH 02/10] wifi: mt76: mt7603: make mcu message helpers usable by other buses Murad Dadashev via B4 Relay
2026-11-27  8:35 ` Murad Dadashev via B4 Relay [this message]
2026-11-27  8:35 ` [PATCH 04/10] wifi: mt76: mt7603: only enable TSSI with valid calibration data Murad Dadashev via B4 Relay
2026-11-27  8:35 ` [PATCH 05/10] wifi: mt76: mt7603: allow configuring TX and RX antennas separately Murad Dadashev via B4 Relay
2026-11-27  8:35 ` [PATCH 06/10] wifi: mt76: mt7603: defer WTBL updates when register access can sleep Murad Dadashev via B4 Relay
2026-11-27  8:35 ` [PATCH 07/10] wifi: mt76: mt7603: skip PCIe specific setup on non-MMIO buses Murad Dadashev via B4 Relay
2026-11-27  8:35 ` [PATCH 08/10] wifi: mt76: usb: add MT7603 queue mapping Murad Dadashev via B4 Relay
2026-11-27  8:35 ` [PATCH 09/10] wifi: mt76: mt7603: add MT7603U USB support Murad Dadashev via B4 Relay
2026-11-27  8:35 ` [PATCH 10/10] wifi: mt76: mt7603: add AP mode support for USB devices Murad Dadashev via B4 Relay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261127-mt7603u-v1-3-369bee9846f8@gmail.com \
    --to=devnull+llamapersonaltv.gmail.com@kernel.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=llamapersonaltv@gmail.com \
    --cc=lorenzo@kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=nbd@nbd.name \
    --cc=ryder.lee@mediatek.com \
    --cc=sean.wang@mediatek.com \
    --cc=shayne.chen@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®