Linux wireless drivers development
 help / color / mirror / Atom feed
From: Sean Wang <sean.wang@kernel.org>
To: nbd@nbd.name, lorenzo.bianconi@kernel.org
Cc: yu-ching.liu@mediatek.com, chengwei.yu@mediatek.com,
	jacobs.wu@mediatek.com, posh.sun@mediatek.com,
	clifford.hsu@mediatek.com, linux-wireless@vger.kernel.org,
	linux-mediatek@lists.infradead.org,
	Sean Wang <sean.wang@mediatek.com>
Subject: [PATCH v2 07/19] wifi: mt76: mt7925: assign the interface WTBL to the NAN management TXQ
Date: Mon, 16 Nov 2026 17:16:18 -0600	[thread overview]
Message-ID: <20261116231630.1733906-8-sean.wang@kernel.org> (raw)
In-Reply-To: <20261116231630.1733906-1-sean.wang@kernel.org>

From: Jacobs Wu <jacobs.wu@mediatek.com>

mac80211 does not allocate vif->txq for a NAN device, so every SDF the
host sends - multicast discovery and unicast follow-up alike - is queued
on the dedicated management TXQ (vif->txq_mgmt) with txq->sta == NULL.

mt7925_mac_link_bss_add() only programs the wcid of vif->txq, so the
management TXQ keeps its initial wcid of 0. The mt76 TXQ scheduler then
resolves dev->wcid[0], i.e. the global WTBL, and every host-originated
SDF is transmitted on it. That WTBL only carries the parameters used for
beacons and has no usable unicast rate, so a unicast follow-up sent on it
is frequently not heard by the peer and the send is reported as failed.
Multicast SDFs are unaffected because they need no acknowledgment.

Program the management TXQ with the same interface WTBL that the beacon
and interface paths already use, which is fully initialised here.

Instrumenting the TX descriptor write shows every follow-up leaving on
WTBL 0 before the fix and on the interface WTBL after it; a 100-frame
unicast follow-up burst goes from 92-96 frames received to 100.

Fixes: 0f3605e4f8de ("wifi: mt76: mt7925: wire up NAN operations")
Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Jacobs Wu <jacobs.wu@mediatek.com>
---
 drivers/net/wireless/mediatek/mt76/mt7925/main.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
index a258996a6aae..2ff58b0742b1 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
@@ -458,6 +458,17 @@ static int mt7925_mac_link_bss_add(struct mt792x_dev *dev,
 		mtxq->wcid = idx;
 	}
 
+	/* A NAN vif has no vif->txq; its SDFs are queued on vif->txq_mgmt,
+	 * whose wcid was never set and defaults to 0 (WTBL 0 has no unicast
+	 * rate), so unicast follow-ups go unacknowledged. Point txq_mgmt at
+	 * the same interface WTBL as the beacon path so SDFs continue to use
+	 * txq_mgmt but with a properly initialised wcid.
+	 */
+	if (vif->txq_mgmt) {
+		mtxq = (struct mt76_txq *)vif->txq_mgmt->drv_priv;
+		mtxq->wcid = idx;
+	}
+
 out:
 	return ret;
 }
-- 
2.43.0


  parent reply	other threads:[~2026-11-16 23:19 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 23:16 [PATCH v2 00/19] wifi: mt76: mt7925: add NAN security and improve NDP reliability (part 2) Sean Wang
2026-11-16 23:16 ` [PATCH v2 01/19] wifi: mt76: mt7925: add NAN low power event control on suspend/resume Sean Wang
2026-11-16 23:16 ` [PATCH v2 02/19] wifi: mt76: mt7925: implement NAN key management MCU command Sean Wang
2026-11-16 23:16 ` [PATCH v2 03/19] wifi: mt76: mt7925: add per-peer RX IGTK/BIGTK and RX GTK WTBLs Sean Wang
2026-11-16 23:16 ` [PATCH v2 04/19] wifi: mt76: mt7925: implement mt7925_nan_set_key for NAN security Sean Wang
2026-11-16 23:16 ` [PATCH v2 05/19] wifi: mt76: mt7925: install NAN BIP keys standalone in sta_key_tlv Sean Wang
2026-11-16 23:16 ` [PATCH v2 06/19] wifi: mt76: mt7925: do not disable RX NAPI twice on unload Sean Wang
2026-11-16 23:16 ` Sean Wang [this message]
2026-11-16 23:16 ` [PATCH v2 08/19] wifi: mt76: mt7925: do not deactivate shared NAN BSS on peer STA removal Sean Wang
2026-11-16 23:16 ` [PATCH v2 09/19] wifi: mt76: gate NAN unicast mgmt by peer availability via STA queues Sean Wang
2026-11-16 23:16 ` [PATCH v2 10/19] wifi: mt76: mt7925: hold NAN mgmt TX to the discovery window Sean Wang
2026-11-16 23:16 ` [PATCH v2 11/19] wifi: mt76: mt7925: double the retry budget for NAN unicast management Sean Wang
2026-11-16 23:16 ` [PATCH v2 12/19] wifi: mt76: mt7925: let TX status of DW-held NAN frames outlive the DW period Sean Wang
2026-11-16 23:16 ` [PATCH v2 13/19] wifi: mt76: mt7925: defer the NAN joined-cluster event out of NAN_START Sean Wang
2026-11-16 23:16 ` [PATCH v2 14/19] wifi: mt76: mt7925: steer NAN handshake frames by committed-bitmap state Sean Wang
2026-11-16 23:16 ` [PATCH v2 15/19] wifi: mt76: mt7925: disable only the RX NAPI instances that exist Sean Wang
2026-11-16 23:16 ` [PATCH v2 16/19] wifi: mt76: mt7925: stop queueing resets once the device is being removed Sean Wang
2026-11-16 23:16 ` [PATCH v2 17/19] wifi: mt76: mt7925: bound the lifetime of NAN unicast management frames Sean Wang
2026-11-16 23:16 ` [PATCH v2 18/19] wifi: mt76: mt7925: always deliver the joined-cluster event through the deferred work Sean Wang
2026-11-16 23:16 ` [PATCH v2 19/19] wifi: mt76: mt792x: allow three channels in the NAN combination Sean Wang

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=20261116231630.1733906-8-sean.wang@kernel.org \
    --to=sean.wang@kernel.org \
    --cc=chengwei.yu@mediatek.com \
    --cc=clifford.hsu@mediatek.com \
    --cc=jacobs.wu@mediatek.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi@kernel.org \
    --cc=nbd@nbd.name \
    --cc=posh.sun@mediatek.com \
    --cc=sean.wang@mediatek.com \
    --cc=yu-ching.liu@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