From e45db12888cbcbc8e4d4b3d435dcc115438dc853 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 16 Jan 2019 19:53:40 +0100 Subject: [PATCH] mt7603: fix tx status info Reporting A-MPDU length from txs does not work, because only completed subframes are reported. Trying to aggregate tx status report for one completed A-MPDU does not work, because individual subframe retries can be different. Do not report A-MPDU length > 1 and pass individual subframe tx status information to mac80211 to fix rate control errors Signed-off-by: Felix Fietkau --- mt7603/mac.c | 37 ++++++++++--------------------------- mt7603/mt7603.h | 4 ---- 2 files changed, 10 insertions(+), 31 deletions(-) diff --git a/mt7603/mac.c b/mt7603/mac.c index 0c4106a0..10ba250f 100644 --- a/mt7603/mac.c +++ b/mt7603/mac.c @@ -998,39 +998,22 @@ mt7603_fill_txs(struct mt7603_dev *dev, struct mt7603_sta *sta, final_rate = FIELD_GET(MT_TXS0_TX_RATE, txs); ack_timeout = txs & MT_TXS0_ACK_TIMEOUT; - if (!(txs & MT_TXS0_ACK_ERROR_MASK)) { - if (!fixed_rate && !ack_timeout) - sta->ampdu_acked++; - info->flags |= IEEE80211_TX_STAT_ACK; - } - - if (!fixed_rate) - sta->ampdu_count++; - - sta->ampdu_tx_count = max_t(int, sta->ampdu_tx_count, count); - if (ampdu && !final_mpdu) + if (!ampdu && (txs & MT_TXS0_RTS_TIMEOUT)) return false; - if (fixed_rate) { - info->status.ampdu_len = 1; - info->status.ampdu_ack_len = !!(info->flags & - IEEE80211_TX_STAT_ACK); - } else { - info->status.ampdu_len = sta->ampdu_count; - info->status.ampdu_ack_len = sta->ampdu_acked; - if (info->status.ampdu_ack_len) - info->flags |= IEEE80211_TX_STAT_ACK; - } + if (txs & MT_TXS0_QUEUE_TIMEOUT) + return false; + + if (!ack_timeout) + info->flags |= IEEE80211_TX_STAT_ACK; + + info->status.ampdu_len = 1; + info->status.ampdu_ack_len = !!(info->flags & + IEEE80211_TX_STAT_ACK); if (ampdu || (info->flags & IEEE80211_TX_CTL_AMPDU)) info->flags |= IEEE80211_TX_STAT_AMPDU | IEEE80211_TX_CTL_AMPDU; - count = sta->ampdu_tx_count; - - sta->ampdu_count = 0; - sta->ampdu_acked = 0; - sta->ampdu_tx_count = 0; - if (fixed_rate && !probe) { info->status.rates[0].count = count; goto out; diff --git a/mt7603/mt7603.h b/mt7603/mt7603.h index 0e68d7f2..057608f1 100644 --- a/mt7603/mt7603.h +++ b/mt7603/mt7603.h @@ -79,10 +79,6 @@ struct mt7603_sta { u8 rate_probe; - u8 ampdu_count; - u8 ampdu_tx_count; - u8 ampdu_acked; - u8 ps; };