]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP: Publish only HE capabilities and operation IEs on 6 GHz band
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>
Wed, 19 Jun 2019 12:49:13 +0000 (15:49 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 15 Oct 2019 12:39:22 +0000 (15:39 +0300)
When operating on the 6 GHz band, add 6 GHz Operation Information inside
the HE Operation element and don't publish HT/VHT IEs.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
- Replace HOSTAPD_MODE_IEEE80211AX mode checks with is_6ghz_op_class()

Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
src/ap/beacon.c
src/ap/ieee802_11.c
src/ap/ieee802_11_he.c
src/ap/ieee802_11_ht.c
src/ap/ieee802_11_vht.c
src/common/ieee802_11_common.c
src/common/ieee802_11_common.h
src/common/ieee802_11_defs.h

index 0754ada73aad44a858cd62ccd4085e6053f36cf0..331c09bc20ab9a71ade0f30ab12986f2c1b6b8d5 100644 (file)
@@ -499,7 +499,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
 #endif /* CONFIG_FST */
 
 #ifdef CONFIG_IEEE80211AC
-       if (hapd->iconf->ieee80211ac && !hapd->conf->disable_11ac) {
+       if (hapd->iconf->ieee80211ac && !hapd->conf->disable_11ac &&
+           !is_6ghz_op_class(hapd->iconf->op_class)) {
                pos = hostapd_eid_vht_capabilities(hapd, pos, 0);
                pos = hostapd_eid_vht_operation(hapd, pos);
                pos = hostapd_eid_txpower_envelope(hapd, pos);
index 2c60040218b4f2b1d5c86b3d2e23d7f27f080a46..401f907f47348278c087238cc11ad923306fe1af 100644 (file)
@@ -3657,7 +3657,8 @@ static u16 send_assoc_resp(struct hostapd_data *hapd, struct sta_info *sta,
 #endif /* CONFIG_IEEE80211N */
 
 #ifdef CONFIG_IEEE80211AC
-       if (hapd->iconf->ieee80211ac && !hapd->conf->disable_11ac) {
+       if (hapd->iconf->ieee80211ac && !hapd->conf->disable_11ac &&
+           !is_6ghz_op_class(hapd->iconf->op_class)) {
                u32 nsts = 0, sta_nsts;
 
                if (sta && hapd->conf->use_sta_nsts && sta->vht_capabilities) {
index 42b05d7ee2c46def01ded6311b20038d6fea809a..abd39409e9d3c5f8d808f7ff22c3defc7b179162 100644 (file)
@@ -11,6 +11,7 @@
 
 #include "utils/common.h"
 #include "common/ieee802_11_defs.h"
+#include "common/ieee802_11_common.h"
 #include "hostapd.h"
 #include "ap_config.h"
 #include "beacon.h"
@@ -170,6 +171,9 @@ u8 * hostapd_eid_he_operation(struct hostapd_data *hapd, u8 *eid)
        if (!hapd->iface->current_mode)
                return eid;
 
+       if (is_6ghz_op_class(hapd->iconf->op_class))
+               oper_size += 5;
+
        *pos++ = WLAN_EID_EXTENSION;
        *pos++ = 1 + oper_size;
        *pos++ = WLAN_EID_EXT_HE_OPERATION;
@@ -198,9 +202,26 @@ u8 * hostapd_eid_he_operation(struct hostapd_data *hapd, u8 *eid)
 
        /* TODO: conditional MaxBSSID Indicator subfield */
 
-       oper->he_oper_params = host_to_le32(params);
+       pos += 6; /* skip the fixed part */
+
+       if (is_6ghz_op_class(hapd->iconf->op_class)) {
+               u8 seg0 = hostapd_get_oper_centr_freq_seg0_idx(hapd->iconf);
+
+               if (!seg0)
+                       seg0 = hapd->iconf->channel;
 
-       pos += oper_size;
+               params |= HE_OPERATION_6GHZ_OPER_INFO;
+               *pos++ = hapd->iconf->channel; /* Primary Channel */
+               *pos++ = center_idx_to_bw_6ghz(seg0); /* Control: Channel Width
+                                                      */
+               /* Channel Center Freq Seg0/Seg0 */
+               *pos++ = seg0;
+               *pos++ = hostapd_get_oper_centr_freq_seg1_idx(hapd->iconf);
+               /* Minimum Rate */
+               *pos++ = 6; /* TODO: what should be set here? */
+       }
+
+       oper->he_oper_params = host_to_le32(params);
 
        return pos;
 }
index 214855dccb8cf9c8319641b19f9217f210626d1d..6db93658c669fe8912c5dc67b6cd6316897a570f 100644 (file)
@@ -27,7 +27,7 @@ u8 * hostapd_eid_ht_capabilities(struct hostapd_data *hapd, u8 *eid)
        u8 *pos = eid;
 
        if (!hapd->iconf->ieee80211n || !hapd->iface->current_mode ||
-           hapd->conf->disable_11n)
+           hapd->conf->disable_11n || is_6ghz_op_class(hapd->iconf->op_class))
                return eid;
 
        *pos++ = WLAN_EID_HT_CAP;
@@ -84,7 +84,8 @@ u8 * hostapd_eid_ht_operation(struct hostapd_data *hapd, u8 *eid)
        struct ieee80211_ht_operation *oper;
        u8 *pos = eid;
 
-       if (!hapd->iconf->ieee80211n || hapd->conf->disable_11n)
+       if (!hapd->iconf->ieee80211n || hapd->conf->disable_11n ||
+           is_6ghz_op_class(hapd->iconf->op_class))
                return eid;
 
        *pos++ = WLAN_EID_HT_OPERATION;
@@ -113,7 +114,8 @@ u8 * hostapd_eid_secondary_channel(struct hostapd_data *hapd, u8 *eid)
        u8 sec_ch;
 
        if (!hapd->cs_freq_params.channel ||
-           !hapd->cs_freq_params.sec_channel_offset)
+           !hapd->cs_freq_params.sec_channel_offset ||
+           is_6ghz_op_class(hapd->iconf->op_class))
                return eid;
 
        if (hapd->cs_freq_params.sec_channel_offset == -1)
index 269345fbf85b68883112abab6d925efe844ff257..f50f142dc0bbbdea8e70d8bdd11f654e9111bd9a 100644 (file)
@@ -26,7 +26,7 @@ u8 * hostapd_eid_vht_capabilities(struct hostapd_data *hapd, u8 *eid, u32 nsts)
        struct hostapd_hw_modes *mode = hapd->iface->current_mode;
        u8 *pos = eid;
 
-       if (!mode)
+       if (!mode || is_6ghz_op_class(hapd->iconf->op_class))
                return eid;
 
        if (mode->mode == HOSTAPD_MODE_IEEE80211G && hapd->conf->vendor_vht &&
@@ -76,6 +76,9 @@ u8 * hostapd_eid_vht_operation(struct hostapd_data *hapd, u8 *eid)
        struct ieee80211_vht_operation *oper;
        u8 *pos = eid;
 
+       if (is_6ghz_op_class(hapd->iconf->op_class))
+               return eid;
+
        *pos++ = WLAN_EID_VHT_OPERATION;
        *pos++ = sizeof(*oper);
 
index f75ce1e30f2efc4e670a3464c2e6a1ee43c4bde9..adfdaa797537cc1c96cdfce3e917a99b15198871 100644 (file)
@@ -1958,6 +1958,12 @@ int is_6ghz_freq(int freq)
 }
 
 
+int is_6ghz_op_class(u8 op_class)
+{
+       return op_class >= 131 && op_class <= 135;
+}
+
+
 int ieee802_11_parse_candidate_list(const char *pos, u8 *nei_rep,
                                    size_t nei_rep_len)
 {
index d8b6fa216fc36a8387dc664eb155e6a59fb6714e..3a54aa0872689824ee3d12455ab68b28b58b66c8 100644 (file)
@@ -222,6 +222,7 @@ const struct oper_class_map * get_oper_class(const char *country, u8 op_class);
 int oper_class_bw_to_int(const struct oper_class_map *map);
 int center_idx_to_bw_6ghz(u8 idx);
 int is_6ghz_freq(int freq);
+int is_6ghz_op_class(u8 op_class);
 
 int ieee802_11_parse_candidate_list(const char *pos, u8 *nei_rep,
                                    size_t nei_rep_len);
index 02cf0ee9b33cdb55634e62da329e2af42f329833..fbed05119d87f7fedf0a576abbc5d517895c18e9 100644 (file)
@@ -2185,6 +2185,10 @@ struct ieee80211_spatial_reuse {
                                                BIT(10) | BIT(11) | \
                                                BIT(12) | BIT(13)))
 #define HE_OPERATION_RTS_THRESHOLD_OFFSET      4
+#define HE_OPERATION_VHT_OPER_INFO             ((u32) BIT(14))
+#define HE_OPERATION_COHOSTED_BSS              ((u32) BIT(15))
+#define HE_OPERATION_ER_SU_DISABLE             ((u32) BIT(16))
+#define HE_OPERATION_6GHZ_OPER_INFO            ((u32) BIT(17))
 #define HE_OPERATION_BSS_COLOR_MASK            ((u32) (BIT(24) | BIT(25) | \
                                                        BIT(26) | BIT(27) | \
                                                        BIT(28) | BIT(29)))