]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: support 160MHz frequency command for 6GHz band
authorDeren Wu <deren.wu@mediatek.com>
Sat, 12 Mar 2022 09:09:04 +0000 (17:09 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 11 Apr 2022 13:06:56 +0000 (15:06 +0200)
Add support to configure 160MHz in 6G band by direct
channel/frequency command.

Example:
iw dev <interface> set freq 6195 160MHz

Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Link: https://lore.kernel.org/r/4366b069d41f469c36554c8dcfc857b5aedf3e1d.1647075278.git.deren.wu@mediatek.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
util.c

diff --git a/util.c b/util.c
index ceb0dc06630069880b9d13948bee3982502cf211..1bddf0f885a1f742245554b28645cbe131779611 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1305,7 +1305,8 @@ int get_cf1(const struct chanmode *chanmode, unsigned long freq)
                                5955, 6035, 6115, 6195, 6275, 6355,
                                6435, 6515, 6595, 6675, 6755, 6835,
                                6195, 6995 };
-       unsigned int vht160[] = { 5180, 5500 };
+       unsigned int bw160[] = { 5180, 5500, 5955, 6115, 6275, 6435,
+                                 6595, 6755, 6915 };
 
        switch (chanmode->width) {
        case NL80211_CHAN_WIDTH_80:
@@ -1322,15 +1323,15 @@ int get_cf1(const struct chanmode *chanmode, unsigned long freq)
                break;
        case NL80211_CHAN_WIDTH_160:
                /* setup center_freq1 */
-               for (j = 0; j < ARRAY_SIZE(vht160); j++) {
-                       if (freq >= vht160[j] && freq < vht160[j] + 160)
+               for (j = 0; j < ARRAY_SIZE(bw160); j++) {
+                       if (freq >= bw160[j] && freq < bw160[j] + 160)
                                break;
                }
 
-               if (j == ARRAY_SIZE(vht160))
+               if (j == ARRAY_SIZE(bw160))
                        break;
 
-               cf1 = vht160[j] + 70;
+               cf1 = bw160[j] + 70;
                break;
        default:
                cf1 = freq + chanmode->freq1_diff;