From: Pradeep Kumar Chitrapu Date: Thu, 7 Apr 2022 23:56:52 +0000 (-0700) Subject: Extend 6 GHz Operation Info field in HE Operation element X-Git-Tag: hostap_2_11~2095 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc3dc72a3a2001df0412bc8c1c3490c8ad82abdf;p=thirdparty%2Fhostap.git Extend 6 GHz Operation Info field in HE Operation element Add new field definitions for the 6 GHz Operation Information field in the HE Operation element per IEEE Std 802.11ax-2021, 9.4.2.249. These will be used for TPC operation in the 6 GHz band. Signed-off-by: Pradeep Kumar Chitrapu --- diff --git a/src/ap/ieee802_11_he.c b/src/ap/ieee802_11_he.c index 5042286c2..fd373f2c2 100644 --- a/src/ap/ieee802_11_he.c +++ b/src/ap/ieee802_11_he.c @@ -218,6 +218,7 @@ u8 * hostapd_eid_he_operation(struct hostapd_data *hapd, u8 *eid) if (is_6ghz_op_class(hapd->iconf->op_class)) { u8 seg0 = hostapd_get_oper_centr_freq_seg0_idx(hapd->iconf); u8 seg1 = hostapd_get_oper_centr_freq_seg1_idx(hapd->iconf); + u8 control; if (!seg0) seg0 = hapd->iconf->channel; @@ -230,11 +231,23 @@ u8 * hostapd_eid_he_operation(struct hostapd_data *hapd, u8 *eid) */ *pos++ = hapd->iconf->channel; /* Primary Channel */ - /* Control: Channel Width */ + /* Control: + * bits 0-1: Channel Width + * bit 2: Duplicate Beacon + * bits 3-5: Regulatory Info + */ + /* Channel Width */ if (seg1) - *pos++ = 3; + control = 3; + else + control = center_idx_to_bw_6ghz(seg0); + if (hapd->iconf->he_6ghz_reg_pwr_type == 1) + control |= HE_6GHZ_STANDARD_POWER_AP << + HE_6GHZ_OPER_INFO_CTRL_REG_INFO_SHIFT; else - *pos++ = center_idx_to_bw_6ghz(seg0); + control |= HE_6GHZ_INDOOR_AP << + HE_6GHZ_OPER_INFO_CTRL_REG_INFO_SHIFT; + *pos++ = control; /* Channel Center Freq Seg0/Seg1 */ if (hapd->iconf->he_oper_chwidth == 2) { diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h index 928b53500..db41ba1f2 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h @@ -2199,7 +2199,7 @@ struct ieee80211_he_operation { * Operation Information subfield (5 octets). */ } STRUCT_PACKED; -/* IEEE P802.11ax/D6.0, Figure 9-787k - 6 GHz Operation Information field */ +/* IEEE Std 802.11ax-2021, Figure 9-788k - 6 GHz Operation Information field */ struct ieee80211_he_6ghz_oper_info { u8 primary_chan; u8 control; @@ -2208,8 +2208,11 @@ struct ieee80211_he_6ghz_oper_info { u8 min_rate; } STRUCT_PACKED; +/* IEEE Std 802.11ax-2021, Figure 9-788l - Control field format */ #define HE_6GHZ_OPER_INFO_CTRL_CHAN_WIDTH_MASK (BIT(0) | BIT(1)) #define HE_6GHZ_OPER_INFO_CTRL_DUP_BEACON BIT(2) +#define HE_6GHZ_OPER_INFO_CTRL_REG_INFO_MASK (BIT(3) | BIT(4) | BIT(5)) +#define HE_6GHZ_OPER_INFO_CTRL_REG_INFO_SHIFT 3 /* IEEE P802.11ax/D6.0, 9.4.2.261 HE 6 GHz Band Capabilities element */ struct ieee80211_he_6ghz_band_cap { @@ -2306,6 +2309,17 @@ struct ieee80211_spatial_reuse { #define HE_OPERATION_BSS_COLOR_DISABLED ((u32) BIT(31)) #define HE_OPERATION_BSS_COLOR_OFFSET 24 +/** + * enum he_6ghz_ap_type - Allowed Access Point types for 6 GHz Band + * + * IEEE Std 802.11ax-2021, Table E-12 (Regulatory Info subfield encoding in the + * United States) + */ +enum he_6ghz_ap_type { + HE_6GHZ_INDOOR_AP = 0, + HE_6GHZ_STANDARD_POWER_AP = 1, +}; + /* Spatial Reuse defines */ #define SPATIAL_REUSE_SRP_DISALLOWED BIT(0) #define SPATIAL_REUSE_NON_SRG_OBSS_PD_SR_DISALLOWED BIT(1)