]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EHT: Update legacy bandwidth when puncturing is set in 320 MHz
authorGovindaraj Saminathan <quic_gsaminat@quicinc.com>
Fri, 6 Dec 2024 04:31:49 +0000 (10:01 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 12 Dec 2024 10:12:31 +0000 (12:12 +0200)
Update lower bandwidth without puncturing for legacy clients when
the puncturing bitmap is set in 320 MHz. This updates the lower
bandwidth in HE and VHT Operation elements when the puncturing
bitmap is set in EHT 320 MHz.

Signed-off-by: Govindaraj Saminathan <quic_gsaminat@quicinc.com>
src/common/hw_features_common.c

index bffb440785363e2c30cec658bc12a65920d53efe..2a541d5e985ebf3366eba100ec066faca35a7b7b 100644 (file)
@@ -432,6 +432,27 @@ static void punct_update_legacy_bw_160(u8 bitmap, u8 pri,
 }
 
 
+static void punct_update_legacy_bw_320(u16 bitmap, u8 pri,
+                                      enum oper_chan_width *width, u8 *seg0)
+{
+       if (pri < *seg0) {
+               *seg0 -= 16;
+               if (bitmap & 0x00FF) {
+                       *width = 1;
+                       punct_update_legacy_bw_160(bitmap & 0xFF, pri, width,
+                                                  seg0);
+               }
+       } else {
+               *seg0 += 16;
+               if (bitmap & 0xFF00) {
+                       *width = 1;
+                       punct_update_legacy_bw_160((bitmap & 0xFF00) >> 8,
+                                                  pri, width, seg0);
+               }
+       }
+}
+
+
 void punct_update_legacy_bw(u16 bitmap, u8 pri, enum oper_chan_width *width,
                            u8 *seg0, u8 *seg1)
 {
@@ -446,7 +467,10 @@ void punct_update_legacy_bw(u16 bitmap, u8 pri, enum oper_chan_width *width,
                punct_update_legacy_bw_160(bitmap & 0xFF, pri, width, seg0);
        }
 
-       /* TODO: 320 MHz */
+       if (*width == CONF_OPER_CHWIDTH_320MHZ && (bitmap & 0xFFFF)) {
+               *width = CONF_OPER_CHWIDTH_160MHZ;
+               punct_update_legacy_bw_320(bitmap & 0xFFFF, pri, width, seg0);
+       }
 }