From: Ahmet Zeren The retry count of a rate is a 5-bit field in mac80211, so it cannot hold the 64 tries set as max_rate_tries. Radiotap retry counts above 30 wrap around: 31 retries fall back to the default retry limit and 40 retries become 8. Limit max_rate_tries by IEEE80211_MAX_TX_RETRY as well. Tested on RTL8192CU (0bda:8178) with injected frames to an absent station, reading the retry count from the TX report: 31 and 40 requested retries are now capped at 30. Fixes: b2ccb6a04761 ("wifi: rtl8xxxu: honour the retry count of injected frames on gen1 chips") Signed-off-by: Ahmet Zeren --- drivers/net/wireless/realtek/rtl8xxxu/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtl8xxxu/core.c b/drivers/net/wireless/realtek/rtl8xxxu/core.c index f10397294a5..c42bb3666c8 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/core.c @@ -8131,7 +8131,7 @@ static int rtl8xxxu_probe(struct usb_interface *interface, SET_IEEE80211_PERM_ADDR(hw, priv->mac_addr); hw->extra_tx_headroom = priv->fops->tx_desc_size; - hw->max_rate_tries = TXDESC32_RETRY_LIMIT_MAX + 1; + hw->max_rate_tries = min(TXDESC32_RETRY_LIMIT_MAX + 1, IEEE80211_MAX_TX_RETRY); ieee80211_hw_set(hw, SIGNAL_DBM); /* -- 2.56.1