Commit 9c9c25f1 authored by Peter Chiu's avatar Peter Chiu Committed by Felix Fietkau

wifi: mt76: mt7996: check txs format before getting skb by pid

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: 2569ea53 ("wifi: mt76: mt7996: enable PPDU-TxS to host")
Signed-off-by: default avatarPeter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: default avatarShayne Chen <shayne.chen@mediatek.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 396e41a7
......@@ -1188,15 +1188,17 @@ 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);
/* 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))
......@@ -1208,6 +1210,7 @@ mt7996_mac_add_txs_skb(struct mt7996_dev *dev, struct mt76_wcid *wcid,
info->status.rates[0].idx = -1;
}
}
if (mtk_wed_device_active(&dev->mt76.mmio.wed) && wcid->sta) {
struct ieee80211_sta *sta;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment