From: John Robin <johnrobin044@gmail.com>
To: linux-wireless@vger.kernel.org
Cc: kuba@kernel.org, matthias.bgg@gmail.com,
angelogioacchino.delregno@collabora.com,
linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
John Robin <johnrobin044@gmail.com>
Subject: [PATCH v2 4/4] wifi: mt7601u: optimize management frame routing and queues
Date: Sun, 8 Nov 2026 12:47:46 +0530 [thread overview]
Message-ID: <20261108071820.35303-5-johnrobin044@gmail.com> (raw)
In-Reply-To: <20261108071820.35303-1-johnrobin044@gmail.com>
Route management and injected frames specifically to the Voice (VO)
hardware queue. This bypasses potential firmware queue suspension
issues. Furthermore, avoid requesting ACKs for multicast frames and
skip the standard data rate fallback logic for management frames to
ensure stable transmission.
Signed-off-by: John Robin <johnrobin044@gmail.com>
---
drivers/net/wireless/mediatek/mt7601u/tx.c | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt7601u/tx.c b/drivers/net/wireless/mediatek/mt7601u/tx.c
index 5aeeac0dd9fe7..47c78c4ff5144 100644
--- a/drivers/net/wireless/mediatek/mt7601u/tx.c
+++ b/drivers/net/wireless/mediatek/mt7601u/tx.c
@@ -27,6 +27,14 @@ static u8 q2hwq(u8 q)
static u8 skb2q(struct sk_buff *skb)
{
int qid = skb_get_queue_mapping(skb);
+ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
+
+ if (ieee80211_is_mgmt(hdr->frame_control) ||
+ (info->flags & IEEE80211_TX_CTL_INJECTED)) {
+ skb_set_queue_mapping(skb, MT_TXQ_VO);
+ return q2hwq(MT_TXQ_VO);
+ }
if (WARN_ON(qid >= MT_TXQ_PSD)) {
qid = MT_TXQ_BE;
@@ -134,6 +142,9 @@ mt7601u_push_txwi(struct mt7601u_dev *dev, struct sk_buff *skb,
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
struct ieee80211_tx_rate *rate = &info->control.rates[0];
struct mt76_txwi *txwi;
+ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
+ bool is_mgmt = ieee80211_is_mgmt(hdr->frame_control);
+ bool is_mcast = is_multicast_ether_addr(hdr->addr1);
unsigned long flags;
bool is_probe;
u32 pkt_id;
@@ -148,14 +159,14 @@ mt7601u_push_txwi(struct mt7601u_dev *dev, struct sk_buff *skb,
info->control.rates, 1);
spin_lock_irqsave(&dev->lock, flags);
- if (rate->idx < 0 || !rate->count)
+ if (!is_mgmt && (rate->idx < 0 || !rate->count))
rate_ctl = wcid->tx_rate;
else
rate_ctl = mt76_mac_tx_rate_val(dev, rate, &nss);
spin_unlock_irqrestore(&dev->lock, flags);
txwi->rate_ctl = cpu_to_le16(rate_ctl);
- if (!(info->flags & IEEE80211_TX_CTL_NO_ACK))
+ if (!(info->flags & IEEE80211_TX_CTL_NO_ACK) && sta && !is_mcast)
txwi->ack_ctl |= MT_TXWI_ACK_CTL_REQ;
if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ)
txwi->ack_ctl |= MT_TXWI_ACK_CTL_NSEQ;
@@ -197,6 +208,8 @@ void mt7601u_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
struct mt76_sta *msta = NULL;
struct mt76_wcid *wcid = dev->mon_wcid;
struct mt76_txwi *txwi;
+ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
+ bool is_mcast = is_multicast_ether_addr(hdr->addr1);
int pkt_len = skb->len;
int hw_q = skb2q(skb);
@@ -211,7 +224,7 @@ void mt7601u_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
if (sta) {
msta = (struct mt76_sta *) sta->drv_priv;
wcid = &msta->wcid;
- } else if (vif) {
+ } else if (vif && is_mcast) {
struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv;
wcid = &mvif->group_wcid;
--
2.56.0
prev parent reply other threads:[~2026-11-08 7:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-15 12:41 [PATCH wireless-next] wifi: mt76: mt7601u: add support for AP and P2P concurrent modes John Robin
2026-10-09 13:11 ` Bitterblue Smith
2026-11-08 7:17 ` [PATCH v2 0/4] wifi: mt7601u: add AP and Wi-Fi Direct support John Robin
2026-11-08 7:17 ` [PATCH v2 1/4] wifi: mt7601u: fix out-of-bounds access in rate index John Robin
2026-11-08 7:17 ` [PATCH v2 2/4] wifi: mt7601u: enable AP and Wi-Fi Direct interface modes John Robin
2026-11-08 7:17 ` [PATCH v2 3/4] wifi: mt7601u: add AP operations and beacon handling John Robin
2026-11-08 7:17 ` John Robin [this message]
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=20261108071820.35303-5-johnrobin044@gmail.com \
--to=johnrobin044@gmail.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=matthias.bgg@gmail.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®