diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index 7c866e1a8d..feb5647402 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -129,8 +129,6 @@ extern const struct nla_policy wlan_hdd_wisa_cmd_policy[ #define VENDOR1_AP_OUI_TYPE "\x00\xE0\x4C" #define VENDOR1_AP_OUI_TYPE_SIZE 3 -#define WLAN_BSS_MEMBERSHIP_SELECTOR_VHT_PHY 126 -#define WLAN_BSS_MEMBERSHIP_SELECTOR_HT_PHY 127 #define BASIC_RATE_MASK 0x80 #define RATE_MASK 0x7f diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index fe0d529609..c93bf0e55e 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -126,6 +126,22 @@ #define MAX_SAP_NUM_CONCURRENCY_WITH_NAN 1 #endif +#ifndef BSS_MEMBERSHIP_SELECTOR_HT_PHY +#define BSS_MEMBERSHIP_SELECTOR_HT_PHY 127 +#endif + +#ifndef BSS_MEMBERSHIP_SELECTOR_VHT_PHY +#define BSS_MEMBERSHIP_SELECTOR_VHT_PHY 126 +#endif + +#ifndef BSS_MEMBERSHIP_SELECTOR_SAE_H2E +#define BSS_MEMBERSHIP_SELECTOR_SAE_H2E 123 +#endif + +#ifndef BSS_MEMBERSHIP_SELECTOR_HE_PHY +#define BSS_MEMBERSHIP_SELECTOR_HE_PHY 122 +#endif + /* * 11B, 11G Rate table include Basic rate and Extended rate * The IDX field is the rate index @@ -4116,15 +4132,36 @@ static void wlan_hdd_check_11gmode(const u8 *ie, u8 *require_ht, } } else { if ((BASIC_RATE_MASK | - WLAN_BSS_MEMBERSHIP_SELECTOR_HT_PHY) == ie[i]) + BSS_MEMBERSHIP_SELECTOR_HT_PHY) == ie[i]) *require_ht = true; else if ((BASIC_RATE_MASK | - WLAN_BSS_MEMBERSHIP_SELECTOR_VHT_PHY) == ie[i]) + BSS_MEMBERSHIP_SELECTOR_VHT_PHY) == ie[i]) *require_vht = true; } } } +/** + * wlan_hdd_check_h2e() - check SAE/H2E require flag from support rate sets + * @rs: support rate or extended support rate set + * @require_h2e: pointer to store require h2e flag + * + * Return: none + */ +static void wlan_hdd_check_h2e(const tSirMacRateSet *rs, bool *require_h2e) +{ + uint8_t i; + + if (!rs || !require_h2e) + return; + + for (i = 0; i < rs->numRates; i++) { + if (rs->rate[i] == (BASIC_RATE_MASK | + BSS_MEMBERSHIP_SELECTOR_SAE_H2E)) + *require_h2e = true; + } +} + #ifdef WLAN_FEATURE_11AX /** * wlan_hdd_add_extn_ie() - add extension IE @@ -5776,6 +5813,12 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter, config->extended_rates.rate, config->extended_rates.numRates); } + + config->require_h2e = false; + wlan_hdd_check_h2e(&config->supported_rates, + &config->require_h2e); + wlan_hdd_check_h2e(&config->extended_rates, + &config->require_h2e); } if (!cds_is_sub_20_mhz_enabled()) diff --git a/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/core/mac/src/sys/legacy/src/utils/src/parser_api.c index 295d57fef6..cd8c9d6191 100644 --- a/core/mac/src/sys/legacy/src/utils/src/parser_api.c +++ b/core/mac/src/sys/legacy/src/utils/src/parser_api.c @@ -854,7 +854,7 @@ populate_dot11f_ext_supp_rates(struct mac_context *mac, uint8_t nChannelNum, struct pe_session *pe_session) { QDF_STATUS nsir_status; - qdf_size_t nRates = 0; + qdf_size_t n_rates = 0; uint8_t rates[SIR_MAC_MAX_NUMBER_OF_RATES]; /* Use the ext rates present in session entry whenever nChannelNum is set to OPERATIONAL @@ -863,9 +863,9 @@ populate_dot11f_ext_supp_rates(struct mac_context *mac, uint8_t nChannelNum, */ if (POPULATE_DOT11F_RATES_OPERATIONAL == nChannelNum) { if (pe_session) { - nRates = pe_session->extRateSet.numRates; + n_rates = pe_session->extRateSet.numRates; qdf_mem_copy(rates, pe_session->extRateSet.rate, - nRates); + n_rates); } else { pe_err("no session context exists while populating Operational Rate Set"); } @@ -874,20 +874,21 @@ populate_dot11f_ext_supp_rates(struct mac_context *mac, uint8_t nChannelNum, pe_err("null pe_session"); return QDF_STATUS_E_INVAL; } - nRates = SIR_MAC_MAX_NUMBER_OF_RATES; + n_rates = SIR_MAC_MAX_NUMBER_OF_RATES; nsir_status = mlme_get_ext_opr_rate(pe_session->vdev, rates, - &nRates); + &n_rates); if (QDF_IS_STATUS_ERROR(nsir_status)) { - nRates = 0; + n_rates = 0; pe_err("Failed to retrieve nItem from CFG status: %d", (nsir_status)); return nsir_status; } } - if (0 != nRates) { - pDot11f->num_rates = (uint8_t) nRates; - qdf_mem_copy(pDot11f->rates, rates, nRates); + if (0 != n_rates) { + pe_debug("ext supp rates present, num %d", (uint8_t)n_rates); + pDot11f->num_rates = (uint8_t)n_rates; + qdf_mem_copy(pDot11f->rates, rates, n_rates); pDot11f->present = 1; } diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h index 067554f334..2999b607b6 100644 --- a/core/sap/inc/sap_api.h +++ b/core/sap/inc/sap_api.h @@ -513,6 +513,7 @@ struct sap_config { uint8_t *vendor_ie; tSirMacRateSet supported_rates; tSirMacRateSet extended_rates; + bool require_h2e; enum sap_acs_dfs_mode acs_dfs_mode; struct hdd_channel_info *channel_info; uint32_t channel_info_count; diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index e55ffc2357..cc1cce2e47 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -3316,6 +3316,8 @@ sapconvert_to_csr_profile(struct sap_config *config, eCsrRoamBssType bssType, config->extended_rates.numRates; } + profile->require_h2e = config->require_h2e; + qdf_status = ucfg_mlme_get_sap_chan_switch_rate_enabled( mac_ctx->psoc, &chan_switch_hostapd_rate_enabled); diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 88d4eea738..e1e493e1b4 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -459,6 +459,7 @@ struct csr_roam_profile { uint16_t beacon_tx_rate; tSirMacRateSet supported_rates; tSirMacRateSet extended_rates; + bool require_h2e; uint32_t cac_duration_ms; uint32_t dfs_regdomain; }; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index dde1a3f201..c46ad2f5d3 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -111,7 +111,6 @@ #define ROAMING_OFFLOAD_TIMER_STOP 2 #define CSR_ROAMING_OFFLOAD_TIMEOUT_PERIOD (5 * QDF_MC_TIMER_TO_SEC_UNIT) - #ifdef WLAN_FEATURE_SAE /** * csr_sae_callback - Update SAE info to CSR roam session @@ -3092,6 +3091,7 @@ QDF_STATUS csr_roam_copy_profile(struct mac_context *mac, pDstProfile->extended_rates.numRates = pSrcProfile->extended_rates.numRates; } + pDstProfile->require_h2e = pSrcProfile->require_h2e; pDstProfile->cac_duration_ms = pSrcProfile->cac_duration_ms; pDstProfile->dfs_regdomain = pSrcProfile->dfs_regdomain; pDstProfile->chan_switch_hostapd_rate_enabled = @@ -5361,6 +5361,7 @@ csr_roam_get_bss_start_parms(struct mac_context *mac, uint32_t opr_ch_freq = 0; tSirNwType nw_type; uint32_t tmp_opr_ch_freq = 0; + uint8_t h2e; tSirMacRateSet *opr_rates = &pParam->operationalRateSet; tSirMacRateSet *ext_rates = &pParam->extendedRateSet; @@ -5450,6 +5451,22 @@ csr_roam_get_bss_start_parms(struct mac_context *mac, pParam->operation_chan_freq = opr_ch_freq; } + if (pProfile->require_h2e) { + h2e = WLAN_BASIC_RATE_MASK | + WLAN_BSS_MEMBERSHIP_SELECTOR_SAE_H2E; + if (ext_rates->numRates < SIR_MAC_MAX_NUMBER_OF_RATES) { + ext_rates->rate[ext_rates->numRates] = h2e; + ext_rates->numRates++; + sme_debug("H2E bss membership add to ext support rate"); + } else if (opr_rates->numRates < SIR_MAC_MAX_NUMBER_OF_RATES) { + opr_rates->rate[opr_rates->numRates] = h2e; + opr_rates->numRates++; + sme_debug("H2E bss membership add to support rate"); + } else { + sme_err("rates full, can not add H2E bss membership"); + } + } + pParam->sirNwType = nw_type; pParam->ch_params.ch_width = pProfile->ch_params.ch_width; pParam->ch_params.center_freq_seg0 =