]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Extend ieee80211_freq_to_channel_ext() to cover channels 52-64
authorAvraham Stern <avraham.stern@intel.com>
Thu, 27 Oct 2016 12:18:29 +0000 (15:18 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 29 Oct 2016 18:51:04 +0000 (21:51 +0300)
Add frequency to channel conversion for the 5 GHz channels 52-64.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
src/common/ieee802_11_common.c

index 603b9616821b2f7806e9a04042a6dd45596f511e..26e08b7db06f0d42a9d032719d692ff5ffafcb6a 100644 (file)
@@ -794,6 +794,25 @@ enum hostapd_hw_mode ieee80211_freq_to_channel_ext(unsigned int freq,
                return HOSTAPD_MODE_IEEE80211A;
        }
 
+       /* 5 GHz, channels 52..64 */
+       if (freq >= 5260 && freq <= 5320) {
+               if ((freq - 5000) % 5)
+                       return NUM_HOSTAPD_MODES;
+
+               if (vht_opclass)
+                       *op_class = vht_opclass;
+               else if (sec_channel == 1)
+                       *op_class = 119;
+               else if (sec_channel == -1)
+                       *op_class = 120;
+               else
+                       *op_class = 118;
+
+               *channel = (freq - 5000) / 5;
+
+               return HOSTAPD_MODE_IEEE80211A;
+       }
+
        /* 5 GHz, channels 149..169 */
        if (freq >= 5745 && freq <= 5845) {
                if ((freq - 5000) % 5)