mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-14 12:37:32 +00:00
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: 2569ea5326
("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>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
396e41a74a
commit
9c9c25f1dc
1 changed files with 13 additions and 10 deletions
|
@ -1188,25 +1188,28 @@ mt7996_mac_add_txs_skb(struct mt7996_dev *dev, struct mt76_wcid *wcid,
|
||||||
struct ieee80211_tx_info *info;
|
struct ieee80211_tx_info *info;
|
||||||
struct sk_buff_head list;
|
struct sk_buff_head list;
|
||||||
struct rate_info rate = {};
|
struct rate_info rate = {};
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb = NULL;
|
||||||
bool cck = false;
|
bool cck = false;
|
||||||
u32 txrate, txs, mode, stbc;
|
u32 txrate, txs, mode, stbc;
|
||||||
|
|
||||||
txs = le32_to_cpu(txs_data[0]);
|
txs = le32_to_cpu(txs_data[0]);
|
||||||
|
|
||||||
mt76_tx_status_lock(mdev, &list);
|
mt76_tx_status_lock(mdev, &list);
|
||||||
skb = mt76_tx_status_skb_get(mdev, wcid, pid, &list);
|
|
||||||
|
|
||||||
if (skb) {
|
/* only report MPDU TXS */
|
||||||
info = IEEE80211_SKB_CB(skb);
|
if (le32_get_bits(txs_data[0], MT_TXS0_TXS_FORMAT) == 0) {
|
||||||
if (!(txs & MT_TXS0_ACK_ERROR_MASK))
|
skb = mt76_tx_status_skb_get(mdev, wcid, pid, &list);
|
||||||
info->flags |= IEEE80211_TX_STAT_ACK;
|
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_len = 1;
|
||||||
info->status.ampdu_ack_len =
|
info->status.ampdu_ack_len =
|
||||||
!!(info->flags & IEEE80211_TX_STAT_ACK);
|
!!(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) {
|
if (mtk_wed_device_active(&dev->mt76.mmio.wed) && wcid->sta) {
|
||||||
|
|
Loading…
Reference in a new issue