]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Derive seg0_idx and seg1_idx for 6 GHz when processing channel switch
authorRohan <drohan@codeaurora.org>
Thu, 16 Jul 2020 14:05:14 +0000 (19:35 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 13 Aug 2020 18:37:49 +0000 (21:37 +0300)
The function hostapd_event_ch_switch() derived the seg0_idx and seg1_idx
values only for the 5 GHz and 2.4 GHz bands and the 6 GHz case ended up
using incorrect calculation based on the 5 GHz channel definitions.

Fix this by adding support for 6 GHz frequencies.

Signed-off-by: Rohan <drohan@codeaurora.org>
src/ap/drv_callbacks.c

index 36678e7a31f362f478cca01c46966ab8600e29bc..9faac0ddc396d17433f543813302456e360ae879 100644 (file)
@@ -893,9 +893,18 @@ void hostapd_event_ch_switch(struct hostapd_data *hapd, int freq, int ht,
 
        switch (hapd->iface->current_mode->mode) {
        case HOSTAPD_MODE_IEEE80211A:
-               if (cf1 > 5000)
+               if (cf1 == 5935)
+                       seg0_idx = (cf1 - 5925) / 5;
+               else if (cf1 > 5950)
+                       seg0_idx = (cf1 - 5950) / 5;
+               else if (cf1 > 5000)
                        seg0_idx = (cf1 - 5000) / 5;
-               if (cf2 > 5000)
+
+               if (cf2 == 5935)
+                       seg1_idx = (cf2 - 5925) / 5;
+               else if (cf2 > 5950)
+                       seg1_idx = (cf2 - 5950) / 5;
+               else if (cf2 > 5000)
                        seg1_idx = (cf2 - 5000) / 5;
                break;
        default: