Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fb2f2758 authored by Will Huang's avatar Will Huang Committed by Madan Koyyalamudi
Browse files

qcacld-3.0: Add H2E require flag to extended support rate

If SAE/H2E required by hostapd configure, it must populate in
supported rate or extended support rate set, add host driver support
to check this flag and populate it in extended support rate set.

Change-Id: Id75b5743e93a1a0f1d13150d5436d256e2ca117c
CRs-Fixed: 3016492
parent f170f3c1
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -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

+45 −2
Original line number Diff line number Diff line
@@ -120,6 +120,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
@@ -4028,15 +4044,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
@@ -5669,6 +5706,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())
+10 −9
Original line number Diff line number Diff line
@@ -828,7 +828,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[WLAN_SUPPORTED_RATES_IE_MAX_LEN];

	/* Use the ext rates present in session entry whenever nChannelNum is set to OPERATIONAL
@@ -837,9 +837,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");
		}
@@ -848,20 +848,21 @@ populate_dot11f_ext_supp_rates(struct mac_context *mac, uint8_t nChannelNum,
			pe_err("null pe_session");
			return QDF_STATUS_E_INVAL;
		}
		nRates = WLAN_SUPPORTED_RATES_IE_MAX_LEN;
		n_rates = WLAN_SUPPORTED_RATES_IE_MAX_LEN;
		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;
	}

+1 −0
Original line number Diff line number Diff line
@@ -532,6 +532,7 @@ struct sap_config {
	uint8_t long_retry_limit;
	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;
+2 −0
Original line number Diff line number Diff line
@@ -3109,6 +3109,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);
Loading