]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EHT: Support puncturing for 320 MHz channel bandwidth
authorChenming Huang <quic_chenhuan@quicinc.com>
Wed, 12 Jul 2023 03:02:32 +0000 (08:32 +0530)
committerJouni Malinen <j@w1.fi>
Wed, 16 Aug 2023 17:59:14 +0000 (20:59 +0300)
Determine the channel width by operating class for the 6 GHz band when
validating puncturing bitmap. This is needed to allow puncturing to be
used with 320 MHz channels.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/ap/hw_features.c

index 7d899f50d2ea11a18f2b72f1b8b3abc68d89cf7d..5bef2087d2b8aa809932fe7e954b220f981b63b6 100644 (file)
@@ -908,7 +908,8 @@ static bool hostapd_is_usable_punct_bitmap(struct hostapd_iface *iface)
 {
 #ifdef CONFIG_IEEE80211BE
        struct hostapd_config *conf = iface->conf;
-       u8 bw, start_chan;
+       u16 bw;
+       u8 start_chan;
 
        if (!conf->punct_bitmap)
                return true;
@@ -925,21 +926,30 @@ static bool hostapd_is_usable_punct_bitmap(struct hostapd_iface *iface)
                return false;
        }
 
-       switch (conf->eht_oper_chwidth) {
-       case 0:
-               wpa_printf(MSG_ERROR,
-                          "RU puncturing is supported only in 80 MHz and 160 MHz");
-               return false;
-       case 1:
-               bw = 80;
-               start_chan = conf->eht_oper_centr_freq_seg0_idx - 6;
-               break;
-       case 2:
-               bw = 160;
-               start_chan = conf->eht_oper_centr_freq_seg0_idx - 14;
-               break;
-       default:
-               return false;
+       /*
+        * In the 6 GHz band, eht_oper_chwidth is ignored. Use operating class
+        * to determine channel width.
+        */
+       if (conf->op_class == 137) {
+               bw = 320;
+               start_chan = conf->eht_oper_centr_freq_seg0_idx - 30;
+       } else {
+               switch (conf->eht_oper_chwidth) {
+               case 0:
+                       wpa_printf(MSG_ERROR,
+                                  "RU puncturing is supported only in 80 MHz and 160 MHz");
+                       return false;
+               case 1:
+                       bw = 80;
+                       start_chan = conf->eht_oper_centr_freq_seg0_idx - 6;
+                       break;
+               case 2:
+                       bw = 160;
+                       start_chan = conf->eht_oper_centr_freq_seg0_idx - 14;
+                       break;
+               default:
+                       return false;
+               }
        }
 
        if (!is_punct_bitmap_valid(bw, (conf->channel - start_chan) / 4,