973-ath10k_fix-band_center_freq-handling-for-VHT160-in-recent-firmwares.patch 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. From: Sebastian Gottschall <[email protected]>
  2. starting with firmware 10.4.3.4.x series QCA changed the handling of the channel property band_center_freq1 and band_center_freq2 in vht160 operation mode
  3. likelly for backward compatiblity with vht80 only capable clients.
  4. this patch adjusts the handling to get vht160 to work again with official qca firmwares newer than 3.3
  5. consider that this patch will not work with older firmwares anymore. to avoid undefined behaviour this we disable vht160 capability for outdated firmwares
  6. Signed-off-by: Sebastian Gottschall <[email protected]>
  7. v2: fix trailing whitespace issue and fix some typos within the commit note
  8. ---
  9. drivers/net/wireless/ath/ath10k/mac.c | 7 -------
  10. drivers/net/wireless/ath/ath10k/wmi.c | 11 ++++++++---
  11. 2 files changed, 8 insertions(+), 10 deletions(-)
  12. --- a/drivers/net/wireless/ath/ath10k/mac.c
  13. +++ b/drivers/net/wireless/ath/ath10k/mac.c
  14. @@ -4445,13 +4445,6 @@ static struct ieee80211_sta_vht_cap ath1
  15. vht_cap.cap |= val;
  16. }
  17. - /* Currently the firmware seems to be buggy, don't enable 80+80
  18. - * mode until that's resolved.
  19. - */
  20. - if ((ar->vht_cap_info & IEEE80211_VHT_CAP_SHORT_GI_160) &&
  21. - (ar->vht_cap_info & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK) == 0)
  22. - vht_cap.cap |= IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ;
  23. -
  24. mcs_map = 0;
  25. for (i = 0; i < 8; i++) {
  26. if ((i < ar->num_rf_chains) && (ar->cfg_tx_chainmask & BIT(i)))
  27. --- a/drivers/net/wireless/ath/ath10k/wmi.c
  28. +++ b/drivers/net/wireless/ath/ath10k/wmi.c
  29. @@ -1672,13 +1672,18 @@ void ath10k_wmi_put_wmi_channel(struct w
  30. flags |= WMI_CHAN_FLAG_HT40_PLUS;
  31. if (arg->chan_radar)
  32. flags |= WMI_CHAN_FLAG_DFS;
  33. -
  34. + ch->band_center_freq2 = 0;
  35. ch->mhz = __cpu_to_le32(arg->freq);
  36. ch->band_center_freq1 = __cpu_to_le32(arg->band_center_freq1);
  37. if (arg->mode == MODE_11AC_VHT80_80)
  38. ch->band_center_freq2 = __cpu_to_le32(arg->band_center_freq2);
  39. - else
  40. - ch->band_center_freq2 = 0;
  41. + if (arg->mode == MODE_11AC_VHT160) {
  42. + if (arg->freq < arg->band_center_freq1)
  43. + ch->band_center_freq1 = __cpu_to_le32(arg->band_center_freq1 - 40);
  44. + else
  45. + ch->band_center_freq1 = __cpu_to_le32(arg->band_center_freq1 + 40);
  46. + ch->band_center_freq2 = __cpu_to_le32(arg->band_center_freq1);
  47. + }
  48. ch->min_power = arg->min_power;
  49. ch->max_power = arg->max_power;
  50. ch->reg_power = arg->max_reg_power;