Skip to content
Permalink
Browse files

mt76x2: fix mrr idx/count estimation in mt76x2_mac_fill_tx_status()

Fix mcs and attempt count estimation in mt76x2_mac_fill_tx_status routine
if the number of tx retries reported by the hw is grater than
IEEE80211_TX_MAX_RATES

Fixes: 7bc04215a66b ("mt76: add driver code for MT76x2e")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  • Loading branch information
LorenzoBianconi authored and nbd168 committed Jun 4, 2018
1 parent fbf4791 commit d00c6169c7cc5b6ead9d8a895cc3f6dfde7573a3
Showing with 2 additions and 4 deletions.
  1. +2 −4 mt76x2_mac.c
@@ -456,15 +456,13 @@ mt76x2_mac_fill_tx_status(struct mt76x2_dev *dev,
if (last_rate < IEEE80211_TX_MAX_RATES - 1)
rate[last_rate + 1].idx = -1;

cur_idx = rate[last_rate].idx + st->retry;
cur_idx = rate[last_rate].idx + last_rate;
for (i = 0; i <= last_rate; i++) {
rate[i].flags = rate[last_rate].flags;
rate[i].idx = max_t(int, 0, cur_idx - i);
rate[i].count = 1;
}

if (last_rate > 0)
rate[last_rate - 1].count = st->retry + 1 - last_rate;
rate[last_rate].count = st->retry + 1 - last_rate;

info->status.ampdu_len = n_frames;
info->status.ampdu_ack_len = st->success ? n_frames : 0;

0 comments on commit d00c616

Please sign in to comment.
You can’t perform that action at this time.