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