]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: enable 80MHz support for 6GHz band 11s mesh
authorPradeep Kumar Chitrapu <pradeepc@codeaurora.org>
Fri, 9 Oct 2020 22:49:30 +0000 (15:49 -0700)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 6 Nov 2020 08:54:31 +0000 (09:54 +0100)
without this 11s mesh could not be configured with bandwidth 80MHz
in 6G band using iw. Also, this will be required to set frequency
for 6GHz band in 80MHz.

example:
iw <interface> mesh join <meshname> freq 6195 80MHz

Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
Link: https://lore.kernel.org/r/1602283770-8026-2-git-send-email-pradeepc@codeaurora.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
util.c

diff --git a/util.c b/util.c
index 0a9083c613a4ee54cd816cf511f06b93e94e42ae..3f1b787b8cbcc2583478ee79d42f00ecc490bf7c 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1236,21 +1236,24 @@ void iw_hexdump(const char *prefix, const __u8 *buf, size_t size)
 int get_cf1(const struct chanmode *chanmode, unsigned long freq)
 {
        unsigned int cf1 = freq, j;
-       unsigned int vht80[] = { 5180, 5260, 5500, 5580, 5660, 5745 };
+       unsigned int bw80[] = { 5180, 5260, 5500, 5580, 5660, 5745,
+                               5955, 6035, 6115, 6195, 6275, 6355,
+                               6435, 6515, 6595, 6675, 6755, 6835,
+                               6195, 6995 };
        unsigned int vht160[] = { 5180, 5500 };
 
        switch (chanmode->width) {
        case NL80211_CHAN_WIDTH_80:
                /* setup center_freq1 */
-               for (j = 0; j < ARRAY_SIZE(vht80); j++) {
-                       if (freq >= vht80[j] && freq < vht80[j] + 80)
+               for (j = 0; j < ARRAY_SIZE(bw80); j++) {
+                       if (freq >= bw80[j] && freq < bw80[j] + 80)
                                break;
                }
 
-               if (j == ARRAY_SIZE(vht80))
+               if (j == ARRAY_SIZE(bw80))
                        break;
 
-               cf1 = vht80[j] + 30;
+               cf1 = bw80[j] + 30;
                break;
        case NL80211_CHAN_WIDTH_160:
                /* setup center_freq1 */