]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add frequency to operating class determination for 5 GHz 100..140
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 30 Oct 2015 09:42:23 +0000 (11:42 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 30 Oct 2015 09:45:50 +0000 (11:45 +0200)
This extends ieee80211_freq_to_channel_ext() with knowledge of the
operating classes for the 5 GHz channels 100..140.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/common/ieee802_11_common.c

index 778185d1b59b4fb0b3a7618f1baf73d63c5d640d..8dee8830594193b32c71cc8059d5fb34652e4457 100644 (file)
@@ -689,6 +689,25 @@ enum hostapd_hw_mode ieee80211_freq_to_channel_ext(unsigned int freq,
                return HOSTAPD_MODE_IEEE80211A;
        }
 
+       /* 5 GHz, channels 100..140 */
+       if (freq >= 5000 && freq <= 5700) {
+               if ((freq - 5000) % 5)
+                       return NUM_HOSTAPD_MODES;
+
+               if (vht_opclass)
+                       *op_class = vht_opclass;
+               else if (sec_channel == 1)
+                       *op_class = 122;
+               else if (sec_channel == -1)
+                       *op_class = 123;
+               else
+                       *op_class = 121;
+
+               *channel = (freq - 5000) / 5;
+
+               return HOSTAPD_MODE_IEEE80211A;
+       }
+
        if (freq >= 5000 && freq < 5900) {
                if ((freq - 5000) % 5)
                        return NUM_HOSTAPD_MODES;