blob: bf761baeab5a41c1a589c192f346a7767fd2743b [file] [log] [blame]
developerd243af02023-12-21 14:49:33 +08001From 1313d834950f271d6b84dd71b89535e6e9af1095 Mon Sep 17 00:00:00 2001
2From: Evelyn Tsai <evelyn.tsai@mediatek.com>
3Date: Fri, 8 Dec 2023 07:35:39 +0800
4Subject: [PATCH 10/76] wifi: mt76: check txs format before getting skb by pid
5
6The PPDU TxS does not include the error bit so it cannot use to report
7status to mac80211.
8
9Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
10---
11 mt76_connac2_mac.h | 5 +++++
12 mt76_connac_mac.c | 7 +++++--
13 2 files changed, 10 insertions(+), 2 deletions(-)
14
15diff --git a/mt76_connac2_mac.h b/mt76_connac2_mac.h
16index bd2a924..5f13211 100644
17--- a/mt76_connac2_mac.h
18+++ b/mt76_connac2_mac.h
19@@ -32,6 +32,11 @@ enum {
20 MT_LMAC_PSMP0,
21 };
22
23+enum {
24+ MT_TXS_MPDU_FMT = 0,
25+ MT_TXS_PPDU_FMT = 2,
26+};
27+
28 #define MT_TX_FREE_MSDU_CNT GENMASK(9, 0)
29 #define MT_TX_FREE_WLAN_ID GENMASK(23, 14)
30 #define MT_TX_FREE_COUNT GENMASK(12, 0)
31diff --git a/mt76_connac_mac.c b/mt76_connac_mac.c
32index 630c640..31d2474 100644
33--- a/mt76_connac_mac.c
34+++ b/mt76_connac_mac.c
35@@ -714,10 +714,13 @@ bool mt76_connac2_mac_add_txs_skb(struct mt76_dev *dev, struct mt76_wcid *wcid,
36 int pid, __le32 *txs_data)
37 {
38 struct sk_buff_head list;
39- struct sk_buff *skb;
40+ struct sk_buff *skb = NULL;
41
42 mt76_tx_status_lock(dev, &list);
43- skb = mt76_tx_status_skb_get(dev, wcid, pid, &list);
44+
45+ if (le32_get_bits(txs_data[0], MT_TXS0_TXS_FORMAT) == MT_TXS_MPDU_FMT)
46+ skb = mt76_tx_status_skb_get(dev, wcid, pid, &list);
47+
48 if (skb) {
49 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
50
51--
522.18.0
53