2
0

319-ath10k-fix-recent-bandwidth-conversion-bug.patch 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. From: Christian Lamparter <[email protected]>
  2. Date: Wed, 1 Nov 2017 21:01:57 +0100
  3. Subject: [PATCH] ath10k: fix recent bandwidth conversion bug
  4. The commit "cfg80211: make RATE_INFO_BW_20 the default" changed
  5. the index of RATE_INFO_BW_20, but the updates to ath10k missed
  6. the special bandwidth calculation case in
  7. ath10k_update_per_peer_tx_stats().
  8. Fixes: 842be75c77cb ("cfg80211: make RATE_INFO_BW_20 the default")
  9. Signed-off-by: Christian Lamparter <[email protected]>
  10. Patchwork-Id: 10037035
  11. Signed-off-by: Kalle Valo <[email protected]>
  12. ---
  13. --- a/drivers/net/wireless/ath/ath10k/htt_rx.c
  14. +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
  15. @@ -592,6 +592,9 @@ struct amsdu_subframe_hdr {
  16. #define GROUP_ID_IS_SU_MIMO(x) ((x) == 0 || (x) == 63)
  17. +static const u8 ath10k_bw_to_mac80211[] = { RATE_INFO_BW_20, RATE_INFO_BW_40,
  18. + RATE_INFO_BW_80, RATE_INFO_BW_160 };
  19. +
  20. static void ath10k_htt_rx_h_rates(struct ath10k *ar,
  21. struct ieee80211_rx_status *status,
  22. struct htt_rx_desc *rxd)
  23. @@ -694,23 +697,7 @@ static void ath10k_htt_rx_h_rates(struct
  24. if (sgi)
  25. status->enc_flags |= RX_ENC_FLAG_SHORT_GI;
  26. - switch (bw) {
  27. - /* 20MHZ */
  28. - case 0:
  29. - break;
  30. - /* 40MHZ */
  31. - case 1:
  32. - status->bw = RATE_INFO_BW_40;
  33. - break;
  34. - /* 80MHZ */
  35. - case 2:
  36. - status->bw = RATE_INFO_BW_80;
  37. - break;
  38. - case 3:
  39. - status->bw = RATE_INFO_BW_160;
  40. - break;
  41. - }
  42. -
  43. + status->bw = ath10k_bw_to_mac80211[bw];
  44. status->encoding = RX_ENC_VHT;
  45. break;
  46. default:
  47. @@ -2297,7 +2284,7 @@ ath10k_update_per_peer_tx_stats(struct a
  48. arsta->txrate.flags |= RATE_INFO_FLAGS_SHORT_GI;
  49. arsta->txrate.nss = txrate.nss;
  50. - arsta->txrate.bw = txrate.bw + RATE_INFO_BW_20;
  51. + arsta->txrate.bw = ath10k_bw_to_mac80211[txrate.bw];
  52. }
  53. static void ath10k_htt_fetch_peer_stats(struct ath10k *ar,