linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 01/12] wifi: mt76: mt7996: check txs format before getting skb by pid
@ 2024-01-26  9:09 Shayne Chen
  2024-01-26  9:09 ` [PATCH v2 02/12] wifi: mt76: mt7996: fix TWT issues Shayne Chen
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Shayne Chen @ 2024-01-26  9:09 UTC (permalink / raw)
  To: Felix Fietkau
  Cc: linux-wireless, Lorenzo Bianconi, Ryder Lee, Evelyn Tsai, Bo Jiao,
	linux-mediatek, Peter Chiu, Shayne Chen

From: Peter Chiu <chui-hao.chiu@mediatek.com>

The PPDU TXS does not include the error bit so it cannot use to report
status to mac80211. This patch fixes issue that STA wrongly detects if AP
is still alive.

Fixes: 2569ea5326e2 ("wifi: mt76: mt7996: enable PPDU-TxS to host")
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
---
 .../net/wireless/mediatek/mt76/mt7996/mac.c   | 23 +++++++++++--------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mac.c b/drivers/net/wireless/mediatek/mt76/mt7996/mac.c
index 53258488d49f..a8414fbb07c8 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mac.c
@@ -1188,25 +1188,28 @@ mt7996_mac_add_txs_skb(struct mt7996_dev *dev, struct mt76_wcid *wcid,
 	struct ieee80211_tx_info *info;
 	struct sk_buff_head list;
 	struct rate_info rate = {};
-	struct sk_buff *skb;
+	struct sk_buff *skb = NULL;
 	bool cck = false;
 	u32 txrate, txs, mode, stbc;
 
 	txs = le32_to_cpu(txs_data[0]);
 
 	mt76_tx_status_lock(mdev, &list);
-	skb = mt76_tx_status_skb_get(mdev, wcid, pid, &list);
 
-	if (skb) {
-		info = IEEE80211_SKB_CB(skb);
-		if (!(txs & MT_TXS0_ACK_ERROR_MASK))
-			info->flags |= IEEE80211_TX_STAT_ACK;
+	/* only report MPDU TXS */
+	if (le32_get_bits(txs_data[0], MT_TXS0_TXS_FORMAT) == 0) {
+		skb = mt76_tx_status_skb_get(mdev, wcid, pid, &list);
+		if (skb) {
+			info = IEEE80211_SKB_CB(skb);
+			if (!(txs & MT_TXS0_ACK_ERROR_MASK))
+				info->flags |= IEEE80211_TX_STAT_ACK;
 
-		info->status.ampdu_len = 1;
-		info->status.ampdu_ack_len =
-			!!(info->flags & IEEE80211_TX_STAT_ACK);
+			info->status.ampdu_len = 1;
+			info->status.ampdu_ack_len =
+				!!(info->flags & IEEE80211_TX_STAT_ACK);
 
-		info->status.rates[0].idx = -1;
+			info->status.rates[0].idx = -1;
+		}
 	}
 
 	if (mtk_wed_device_active(&dev->mt76.mmio.wed) && wcid->sta) {
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-01-26  9:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-26  9:09 [PATCH v2 01/12] wifi: mt76: mt7996: check txs format before getting skb by pid Shayne Chen
2024-01-26  9:09 ` [PATCH v2 02/12] wifi: mt76: mt7996: fix TWT issues Shayne Chen
2024-01-26  9:09 ` [PATCH v2 03/12] wifi: mt76: mt7996: disable AMSDU for non-data frames Shayne Chen
2024-01-26  9:09 ` [PATCH v2 04/12] wifi: mt76: mt7996: fix incorrect interpretation of EHT MCS caps Shayne Chen
2024-01-26  9:09 ` [PATCH v2 05/12] wifi: mt76: mt7996: ensure 4-byte alignment for beacon commands Shayne Chen
2024-01-26  9:09 ` [PATCH v2 06/12] wifi: mt76: mt7996: fix HE beamformer phy cap for station vif Shayne Chen
2024-01-26  9:09 ` [PATCH v2 07/12] wifi: mt76: mt7996: mark GCMP IGTK unsupported Shayne Chen
2024-01-26  9:09 ` [PATCH v2 08/12] wifi: mt76: mt7996: fix efuse reading issue Shayne Chen
2024-01-26  9:09 ` [PATCH v2 09/12] wifi: mt76: mt7996: remove TXS queue setting Shayne Chen
2024-01-26  9:09 ` [PATCH v2 10/12] wifi: mt76: mt7996: add locking for accessing mapped registers Shayne Chen
2024-01-26  9:09 ` [PATCH v2 11/12] wifi: mt76: connac: set correct muar_idx for mt799x chipsets Shayne Chen
2024-01-26  9:09 ` [PATCH v2 12/12] wifi: mt76: mt7996: fix HIF_TXD_V2_1 value Shayne Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).