]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EHT: Add puncturing bitmap to EHT Operation element
authorMuna Sinada <quic_msinada@quicinc.com>
Tue, 14 Mar 2023 04:59:18 +0000 (21:59 -0700)
committerJouni Malinen <j@w1.fi>
Fri, 17 Mar 2023 17:46:24 +0000 (19:46 +0200)
Add preamble puncturing bitmap to the EHT Operation element as per IEEE
P802.11be/D3.0, Figure 9-1002c (EHT Operation Information field format).
Bits set to 1 indicate that the subchannel is punctured, otherwise
active.

Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
Signed-off-by: Balamurugan Mahalingam <quic_bmahalin@quicinc.com>
src/ap/beacon.c
src/ap/ieee802_11.c
src/ap/ieee802_11_eht.c
src/common/ieee802_11_defs.h

index 48bc5a1dd5d32e0db4025d522b9dec3a48e3ce17..ec7ca7fc62e780d8ea854742e97fc1394ed1f05c 100644 (file)
@@ -584,6 +584,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
        if (hapd->iconf->ieee80211be && !hapd->conf->disable_11be) {
                buflen += hostapd_eid_eht_capab_len(hapd, IEEE80211_MODE_AP);
                buflen += 3 + sizeof(struct ieee80211_eht_operation);
+               if (hapd->iconf->punct_bitmap)
+                       buflen += EHT_OPER_DISABLED_SUBCHAN_BITMAP_SIZE;
        }
 #endif /* CONFIG_IEEE80211BE */
 
@@ -1687,6 +1689,8 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
        if (hapd->iconf->ieee80211be && !hapd->conf->disable_11be) {
                tail_len += hostapd_eid_eht_capab_len(hapd, IEEE80211_MODE_AP);
                tail_len += 3 + sizeof(struct ieee80211_eht_operation);
+               if (hapd->iconf->punct_bitmap)
+                       tail_len += EHT_OPER_DISABLED_SUBCHAN_BITMAP_SIZE;
        }
 #endif /* CONFIG_IEEE80211BE */
 
index 8304e3c26ab8ba9ce014c2f4674ad96496e5d3b8..0142ee44acacfafe1fa28435b42ee360b5b44041 100644 (file)
@@ -4278,6 +4278,8 @@ static u16 send_assoc_resp(struct hostapd_data *hapd, struct sta_info *sta,
        if (hapd->iconf->ieee80211be && !hapd->conf->disable_11be) {
                buflen += hostapd_eid_eht_capab_len(hapd, IEEE80211_MODE_AP);
                buflen += 3 + sizeof(struct ieee80211_eht_operation);
+               if (hapd->iconf->punct_bitmap)
+                       buflen += EHT_OPER_DISABLED_SUBCHAN_BITMAP_SIZE;
        }
 #endif /* CONFIG_IEEE80211BE */
 
index caaadcecf0eb54c82d1747ad65445f14cc653f52..6ebe0f91d3a1582fd5a570b604644cfcddccba55 100644 (file)
@@ -202,6 +202,9 @@ u8 * hostapd_eid_eht_operation(struct hostapd_data *hapd, u8 *eid)
        if (!hapd->iface->current_mode)
                return eid;
 
+       if (hapd->iconf->punct_bitmap)
+               elen += EHT_OPER_DISABLED_SUBCHAN_BITMAP_SIZE;
+
        *pos++ = WLAN_EID_EXTENSION;
        *pos++ = 1 + elen;
        *pos++ = WLAN_EID_EXT_EHT_OPERATION;
@@ -253,6 +256,12 @@ u8 * hostapd_eid_eht_operation(struct hostapd_data *hapd, u8 *eid)
        oper->oper_info.ccfs0 = seg0 ? seg0 : hapd->iconf->channel;
        oper->oper_info.ccfs1 = seg1;
 
+       if (hapd->iconf->punct_bitmap) {
+               oper->oper_params |= EHT_OPER_DISABLED_SUBCHAN_BITMAP_PRESENT;
+               oper->oper_info.disabled_chan_bitmap =
+                       host_to_le16(hapd->iconf->punct_bitmap);
+       }
+
        return pos + elen;
 }
 
index 202bfc9d19fa825a3c06881719b19ea608531087..dfad0b7b85aec0b7f727107710f1aded02bdcde4 100644 (file)
@@ -2473,6 +2473,7 @@ struct ieee80211_he_mu_edca_parameter_set {
 #define EHT_OPER_DEFAULT_PE_DURATION                   BIT(2)
 #define EHT_OPER_GROUP_ADDR_BU_INDICATION_LIMIT        BIT(3)
 #define EHT_OPER_GROUP_ADDR_BU_INDICATION_EXPONENT     (BIT(4) | BIT(5))
+#define EHT_OPER_DISABLED_SUBCHAN_BITMAP_SIZE          2
 
 /* Control subfield: Channel Width subfield; see Table 9-401b */
 #define EHT_OPER_CHANNEL_WIDTH_20MHZ                   0