]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Extend 6 GHz Operation Info field in HE Operation element
authorPradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
Thu, 7 Apr 2022 23:56:52 +0000 (16:56 -0700)
committerJouni Malinen <j@w1.fi>
Fri, 8 Apr 2022 10:22:31 +0000 (13:22 +0300)
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 <quic_pradeepc@quicinc.com>
src/ap/ieee802_11_he.c
src/common/ieee802_11_defs.h

index 5042286c20f5de2e38707749cbfa00cd56958018..fd373f2c22730a9906439a98eb42f70749c18468 100644 (file)
@@ -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) {
index 928b53500c5cc7b4e4ce116bf94626ec569a017b..db41ba1f2ba39d105c6e90c8cdbc7fdc4d2eb2f2 100644 (file)
@@ -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)