From: Ahmet Zeren The CCX TX report has a 6-bit retry count, but the count passed to mac80211 is only 5 bits wide. A frame sent with the default retry limit of 48 is reported with 16 retries. Limit the reported count to IEEE80211_MAX_TX_RETRY. Tested on RTL8192CU (0bda:8178): a frame to an absent station sent with the default retry limit is now reported with 30 retries instead of 16. Fixes: 8b29fd95e2d3 ("wifi: rtl8xxxu: report real TX status on RTL8188CU/RTL8192CU") Signed-off-by: Ahmet Zeren --- drivers/net/wireless/realtek/rtl8xxxu/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtl8xxxu/core.c b/drivers/net/wireless/realtek/rtl8xxxu/core.c index c42bb3666c8..f923983bd44 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/core.c @@ -5240,7 +5240,8 @@ static void rtl8xxxu_tx_report_poll_work(struct work_struct *work) ieee80211_tx_info_clear_status(tx_info); if (!(tx_info->flags & IEEE80211_TX_CTL_INJECTED)) tx_info->status.rates[0].idx = -1; - tx_info->status.rates[0].count = (retry & CCX_RETRY_CNT_MASK) + 1; + tx_info->status.rates[0].count = min((retry & CCX_RETRY_CNT_MASK) + 1, + IEEE80211_MAX_TX_RETRY); if (status & CCX_PKT_OK) tx_info->flags |= IEEE80211_TX_STAT_ACK; -- 2.56.1