Linux wireless drivers development
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@nbd.name>
To: linux-wireless@vger.kernel.org
Subject: [PATCH mt76-next 3/3] wifi: mt76: mt76x02: clear the wcid drop mask for all powersave responses
Date: Fri, 23 Oct 2026 13:13:18 +0200	[thread overview]
Message-ID: <20261023111318.2802233-3-nbd@nbd.name> (raw)
In-Reply-To: <20261023111318.2802233-1-nbd@nbd.name>

mt76x02_tx_prepare_skb() clears the drop bit of a sleeping station only
for frames on MT_TXQ_PSD. Only frames that
mt76_release_buffered_frames() releases from the driver TXQs use that
queue. Frames that mac80211 buffered itself go through the regular tx
path on their access category queue, and the hardware discards these
PS-Poll and U-APSD responses.

Clear the drop bit for every frame that mac80211 marks as a powersave
response or as exempt from powersave buffering, like
mt7603_tx_prepare_skb() does.

Fixes: 7bc04215a66b ("mt76: add driver code for MT76x2e")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c b/drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c
index 3ca530f1c171..1698eb9051c3 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c
@@ -158,11 +158,15 @@ int mt76x02_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
 {
 	struct mt76x02_dev *dev = container_of(mdev, struct mt76x02_dev, mt76);
 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx_info->skb->data;
+	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx_info->skb);
 	struct mt76x02_txwi *txwi = txwi_ptr;
-	bool ampdu = IEEE80211_SKB_CB(tx_info->skb)->flags & IEEE80211_TX_CTL_AMPDU;
+	bool ampdu = info->flags & IEEE80211_TX_CTL_AMPDU;
 	int hdrlen, len, pid, qsel = MT_QSEL_EDCA;
 
-	if (qid == MT_TXQ_PSD && wcid && wcid->idx < 128)
+	if (wcid && wcid->idx < MT76x02_N_WCIDS &&
+	    ((info->flags & (IEEE80211_TX_CTL_NO_PS_BUFFER |
+			     IEEE80211_TX_CTL_CLEAR_PS_FILT)) ||
+	     (info->control.flags & IEEE80211_TX_CTRL_PS_RESPONSE)))
 		mt76x02_mac_wcid_set_drop(dev, wcid->idx, false);
 
 	hdrlen = ieee80211_hdrlen(hdr->frame_control);
-- 
2.47.3


      parent reply	other threads:[~2026-10-23 11:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-23 11:13 [PATCH mt76-next 1/3] wifi: mt76: honour the more-data flag when releasing buffered frames Felix Fietkau
2026-10-23 11:13 ` [PATCH mt76-next 2/3] wifi: mt76: mt76x02: serialise wcid drop mask updates Felix Fietkau
2026-10-23 11:13 ` Felix Fietkau [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=20261023111318.2802233-3-nbd@nbd.name \
    --to=nbd@nbd.name \
    --cc=linux-wireless@vger.kernel.org \
    /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