qcacld-3.0: Fill dot11mode and cbmode in LIM

Fill dot11mode and cb mode according to the
bss description and IEs in LIM layer itself.

Change-Id: I55cdeffdd55cfc1787a2929b349aea25f499499f
CRs-Fixed: 2846126
This commit is contained in:
gaurank kathpalia
2020-12-29 14:24:20 +05:30
committed by snandini
orang tua 68f52c6624
melakukan 0b02b4ba2f
11 mengubah file dengan 1194 tambahan dan 466 penghapusan

Melihat File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -908,21 +908,8 @@ struct join_req {
uint16_t length;
uint8_t vdev_id;
tSirMacSSid ssId;
tSirMacAddr self_mac_addr; /* self Mac address */
uint8_t dot11mode; /* to support BT-AMP */
#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
uint8_t cc_switch_mode;
#endif
bool wps_registration;
ePhyChanBondState cbMode; /* Pass CB mode value in Join. */
/*This contains the UAPSD Flag for all 4 AC
* B0: AC_VO UAPSD FLAG
* B1: AC_VI UAPSD FLAG
* B2: AC_BK UAPSD FLAG
* B3: AC_BE UASPD FLAG
*/
uint8_t uapsdPerAcBitmask;
tSirMacRateSet operationalRateSet; /* Has 11a or 11b rates */
tSirMacRateSet extendedRateSet; /* Has 11g rates */
@@ -951,17 +938,12 @@ struct join_req {
bool isESEconnection;
tESETspecInfo eseTspecInfo;
#endif
bool he_with_wep_tkip;
bool isOSENConnection;
bool spectrumMgtIndicator;
struct power_cap_info powerCap;
struct supported_channels supportedChannels;
bool sae_pmk_cached;
/* Pls make this as last variable in struct */
bool force_24ghz_in_ht20;
bool force_rsne_override;
bool supported_nss_1x1;
bool enable_session_twt_support;
struct bss_description bssDescription;
/*
* WARNING: Pls make bssDescription as last variable in struct

Melihat File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -1262,6 +1262,8 @@ wlan_get_parsed_bss_description_ies(struct mac_context *mac_ctx,
struct bss_description *bss_desc,
tDot11fBeaconIEs **ie_struct);
int8_t wlan_get_cfg_max_tx_power(struct mac_context *mac, uint32_t ch_freq);
QDF_STATUS
wlan_fill_bss_desc_from_scan_entry(struct mac_context *mac_ctx,
struct bss_description *bss_desc,

Melihat File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -317,6 +317,8 @@ struct pe_session {
uint32_t lim11hEnable;
int8_t maxTxPower; /* MIN (Regulatory and local power constraint) */
int8_t min_11h_pwr;
int8_t max_11h_pwr;
enum QDF_OPMODE opmode;
int8_t txMgmtPower;
bool is11Rconnection;

Melihat File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2012, 2014-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2011-2012, 2014-2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -108,6 +108,5 @@ QDF_STATUS rrm_reject_req(tpSirMacRadioMeasureReport *radiomes_report,
uint8_t *num_report, uint8_t index,
uint8_t measurement_type);
void lim_update_rrm_capability(struct mac_context *mac_ctx,
struct join_req *join_req);
void lim_update_rrm_capability(struct mac_context *mac_ctx);
#endif

File diff ditekan karena terlalu besar Load Diff

Melihat File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -143,7 +143,7 @@ void lim_send_reassoc_req_with_ft_ies_mgmt_frame(struct mac_context *mac_ctx,
LIM_BSS_CAPS_GET(WSM, pe_session->limReassocBssQosCaps);
if (pe_session->lim11hEnable &&
pe_session->pLimReAssocReq->spectrumMgtIndicator == true) {
pe_session->spectrumMgtEnabled) {
power_caps_populated = true;
populate_dot11f_power_caps(mac_ctx, &frm->PowerCaps,
@@ -609,7 +609,7 @@ void lim_send_reassoc_req_mgmt_frame(struct mac_context *mac,
LIM_BSS_CAPS_GET(WSM, pe_session->limReassocBssQosCaps);
if (pe_session->lim11hEnable &&
pe_session->pLimReAssocReq->spectrumMgtIndicator == true) {
pe_session->spectrumMgtEnabled) {
PowerCapsPopulated = true;
populate_dot11f_power_caps(mac, &frm->PowerCaps, LIM_REASSOC,
pe_session);

Melihat File

@@ -2155,7 +2155,7 @@ lim_send_assoc_req_mgmt_frame(struct mac_context *mac_ctx,
LIM_BSS_CAPS_GET(WSM, pe_session->limCurrentBssQosCaps);
if (pe_session->lim11hEnable &&
pe_session->lim_join_req->spectrumMgtIndicator == true) {
pe_session->spectrumMgtEnabled == true) {
power_caps = true;
populate_dot11f_power_caps(mac_ctx, &frm->PowerCaps,

Melihat File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -475,20 +475,6 @@ uint8_t lim_is_sme_join_req_valid(struct mac_context *mac,
goto end;
}
/*
Reject Join Req if the Self Mac Address and
the Ap's Mac Address is same
*/
if (!qdf_mem_cmp((uint8_t *)pJoinReq->self_mac_addr,
(uint8_t *)pJoinReq->bssDescription.bssId,
(uint8_t) (sizeof(tSirMacAddr)))) {
/* Log the event */
pe_err("received SME_JOIN_REQ with Self Mac and BSSID Same");
valid = false;
goto end;
}
end:
return valid;
} /*** end lim_is_sme_join_req_valid() ***/

Melihat File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -1578,8 +1578,7 @@ void rrm_cleanup(struct mac_context *mac, uint8_t idx)
*
* Return: None
*/
void lim_update_rrm_capability(struct mac_context *mac_ctx,
struct join_req *join_req)
void lim_update_rrm_capability(struct mac_context *mac_ctx)
{
mac_ctx->rrm.rrmPEContext.rrmEnable =
mac_ctx->rrm.rrmConfig.rrm_enabled;

Melihat File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -1452,18 +1452,8 @@ populate_dot11f_power_caps(struct mac_context *mac,
{
struct vdev_mlme_obj *mlme_obj;
if (nAssocType == LIM_REASSOC) {
pCaps->minTxPower =
pe_session->pLimReAssocReq->powerCap.minTxPower;
pCaps->maxTxPower =
pe_session->pLimReAssocReq->powerCap.maxTxPower;
} else {
pCaps->minTxPower =
pe_session->lim_join_req->powerCap.minTxPower;
pCaps->maxTxPower =
pe_session->lim_join_req->powerCap.maxTxPower;
}
pCaps->minTxPower = pe_session->min_11h_pwr;
pCaps->maxTxPower = pe_session->maxTxPower;
/* Use firmware updated max tx power if non zero */
mlme_obj = wlan_vdev_mlme_get_cmpt_obj(pe_session->vdev);
@@ -6311,6 +6301,69 @@ wlan_get_parsed_bss_description_ies(struct mac_context *mac_ctx,
return status;
}
int8_t wlan_get_cfg_max_tx_power(struct mac_context *mac, uint32_t ch_freq)
{
uint32_t cfg_length = 0;
int8_t maxTxPwr = 0;
tSirMacChanInfo *pCountryInfo = NULL;
uint8_t count = 0;
uint8_t maxChannels;
int32_t rem_length = 0;
if (WLAN_REG_IS_5GHZ_CH_FREQ(ch_freq)) {
cfg_length = mac->mlme_cfg->power.max_tx_power_5.len;
} else if (WLAN_REG_IS_24GHZ_CH_FREQ(ch_freq)) {
cfg_length = mac->mlme_cfg->power.max_tx_power_24.len;
} else if (wlan_reg_is_6ghz_chan_freq(ch_freq)) {
return wlan_reg_get_channel_reg_power_for_freq(mac->pdev,
ch_freq);
} else {
return maxTxPwr;
}
if (!cfg_length)
goto error;
pCountryInfo = qdf_mem_malloc(cfg_length);
if (!pCountryInfo)
goto error;
if (WLAN_REG_IS_5GHZ_CH_FREQ(ch_freq)) {
if (cfg_length > CFG_MAX_TX_POWER_5_LEN)
goto error;
qdf_mem_copy(pCountryInfo,
mac->mlme_cfg->power.max_tx_power_5.data,
cfg_length);
} else if (WLAN_REG_IS_24GHZ_CH_FREQ(ch_freq)) {
if (cfg_length > CFG_MAX_TX_POWER_2_4_LEN)
goto error;
qdf_mem_copy(pCountryInfo,
mac->mlme_cfg->power.max_tx_power_24.data,
cfg_length);
}
/* Identify the channel and maxtxpower */
rem_length = cfg_length;
while (rem_length >= (sizeof(tSirMacChanInfo))) {
maxChannels = pCountryInfo[count].numChannels;
maxTxPwr = pCountryInfo[count].maxTxPower;
count++;
rem_length -= (sizeof(tSirMacChanInfo));
if (ch_freq >= pCountryInfo[count].first_freq &&
ch_freq < (pCountryInfo[count].first_freq + maxChannels)) {
break;
}
}
error:
if (pCountryInfo)
qdf_mem_free(pCountryInfo);
return maxTxPwr;
}
#ifdef FEATURE_WLAN_ESE
static void wlan_fill_qbss_load_param(tDot11fBeaconIEs *bcn_ies,
struct bss_description *bss_desc)

Melihat File

@@ -13153,65 +13153,7 @@ QDF_STATUS csr_get_cfg_valid_channels(struct mac_context *mac,
int8_t csr_get_cfg_max_tx_power(struct mac_context *mac, uint32_t ch_freq)
{
uint32_t cfg_length = 0;
int8_t maxTxPwr = 0;
tSirMacChanInfo *pCountryInfo = NULL;
uint8_t count = 0;
uint8_t maxChannels;
int32_t rem_length = 0;
if (WLAN_REG_IS_5GHZ_CH_FREQ(ch_freq)) {
cfg_length = mac->mlme_cfg->power.max_tx_power_5.len;
} else if (WLAN_REG_IS_24GHZ_CH_FREQ(ch_freq)) {
cfg_length = mac->mlme_cfg->power.max_tx_power_24.len;
} else if (wlan_reg_is_6ghz_chan_freq(ch_freq)) {
return wlan_reg_get_channel_reg_power_for_freq(mac->pdev,
ch_freq);
} else {
return maxTxPwr;
}
if (!cfg_length)
goto error;
pCountryInfo = qdf_mem_malloc(cfg_length);
if (!pCountryInfo)
goto error;
if (WLAN_REG_IS_5GHZ_CH_FREQ(ch_freq)) {
if (cfg_length > CFG_MAX_TX_POWER_5_LEN)
goto error;
qdf_mem_copy(pCountryInfo,
mac->mlme_cfg->power.max_tx_power_5.data,
cfg_length);
} else if (WLAN_REG_IS_24GHZ_CH_FREQ(ch_freq)) {
if (cfg_length > CFG_MAX_TX_POWER_2_4_LEN)
goto error;
qdf_mem_copy(pCountryInfo,
mac->mlme_cfg->power.max_tx_power_24.data,
cfg_length);
}
/* Identify the channel and maxtxpower */
rem_length = cfg_length;
while (rem_length >= (sizeof(tSirMacChanInfo))) {
maxChannels = pCountryInfo[count].numChannels;
maxTxPwr = pCountryInfo[count].maxTxPower;
count++;
rem_length -= (sizeof(tSirMacChanInfo));
if (ch_freq >= pCountryInfo[count].first_freq &&
ch_freq < (pCountryInfo[count].first_freq + maxChannels)) {
break;
}
}
error:
if (pCountryInfo)
qdf_mem_free(pCountryInfo);
return maxTxPwr;
return wlan_get_cfg_max_tx_power(mac, ch_freq);
}
bool csr_roam_is_channel_valid(struct mac_context *mac, uint32_t chan_freq)
@@ -14764,9 +14706,6 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
uint32_t dot11mode = 0;
uint8_t *wpaRsnIE = NULL;
struct join_req *csr_join_req;
tSirMacCapabilityInfo *pAP_capabilityInfo;
bool fTmp;
int8_t pwr_limit = 0;
struct ps_global_info *ps_global_info = &mac->sme.ps_global_info;
struct ps_params *ps_param = &ps_global_info->ps_params[sessionId];
tpCsrNeighborRoamControlInfo neigh_roam_info;
@@ -14857,9 +14796,7 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
} else {
csr_join_req->ssId.length = 0;
}
qdf_mem_copy(&csr_join_req->self_mac_addr,
&pSession->self_mac_addr,
sizeof(tSirMacAddr));
sme_nofl_info("vdev-%d: Connecting to %.*s " QDF_MAC_ADDR_FMT
" rssi: %d freq: %d akm %d cipher: uc %d mc %d, CC: %c%c",
sessionId, csr_join_req->ssId.length,
@@ -14881,15 +14818,8 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
csr_update_sae_single_pmk_ap_cap(mac, pBssDescription,
sessionId, akm);
csr_join_req->supported_nss_1x1 = pSession->supported_nss_1x1;
csr_join_req->dot11mode = (uint8_t)dot11mode;
#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
csr_join_req->cc_switch_mode =
mac->roam.configParam.cc_switch_mode;
#endif
csr_join_req->wps_registration = pProfile->bWPSAssociation;
csr_join_req->cbMode = (uint8_t) pSession->bssParams.cbMode;
csr_join_req->force_24ghz_in_ht20 =
pProfile->force_24ghz_in_ht20;
pSession->uapsd_mask = pProfile->uapsd_mask;
@@ -15151,10 +15081,6 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
}
}
if (!CSR_IS_11n_ALLOWED(pProfile->negotiatedUCEncryptionType))
csr_join_req->he_with_wep_tkip =
mac->roam.configParam.wep_tkip_in_he;
csr_join_req->UCEncryptionType =
csr_translate_encrypt_type_to_ed_type
(pProfile->negotiatedUCEncryptionType);
@@ -15247,45 +15173,11 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
else
csr_join_req->isOSENConnection = false;
pAP_capabilityInfo =
(tSirMacCapabilityInfo *)
&pBssDescription->capabilityInfo;
/*
* tell the target AP my 11H capability only if both AP and STA
* support
* 11H and the channel being used is 11a
*/
if (csr_is11h_supported(mac) && pAP_capabilityInfo->spectrumMgt
&& eSIR_11A_NW_TYPE == pBssDescription->nwType) {
fTmp = true;
} else
fTmp = false;
csr_join_req->spectrumMgtIndicator = fTmp;
csr_join_req->powerCap.minTxPower = MIN_TX_PWR_CAP;
/*
* This is required for 11k test VoWiFi Ent: Test 2.
* We need the power capabilities for Assoc Req.
* This macro is provided by the halPhyCfg.h. We pick our
* max and min capability by the halPhy provided macros
* Any change in this power cap IE should also be done
* in csr_update_driver_assoc_ies() which would send
* assoc IE's to FW which is used for LFR3 roaming
* ie. used in reassociation requests from FW.
*/
pwr_limit = csr_get_cfg_max_tx_power(mac, bss_freq);
if (0 != pwr_limit && pwr_limit < MAX_TX_PWR_CAP)
csr_join_req->powerCap.maxTxPower = pwr_limit;
else
csr_join_req->powerCap.maxTxPower = MAX_TX_PWR_CAP;
csr_add_supported_5Ghz_channels(mac,
csr_join_req->supportedChannels.channelList,
&csr_join_req->supportedChannels.numChnl,
false);
/* Enable UAPSD only if TWT is not supported */
if (!csr_enable_twt(mac, pIes))
csr_join_req->uapsdPerAcBitmask = pProfile->uapsd_mask;
/* Move the entire BssDescription into the join request. */
qdf_mem_copy(&csr_join_req->bssDescription, pBssDescription,
pBssDescription->length +
@@ -15339,8 +15231,6 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
break;
}
csr_join_req->enable_session_twt_support = csr_enable_twt(mac,
pIes);
status = umac_send_mb_message_to_mac(csr_join_req);
if (!QDF_IS_STATUS_SUCCESS(status)) {
/*