From fba2063db128ef06f0df38131b65c0620e6c1871 Mon Sep 17 00:00:00 2001 From: Kiran Kumar Lokere Date: Thu, 5 Jul 2018 16:51:27 -0700 Subject: [PATCH] qcacld-3.0: Add support to configure HE MU EDCA params Add support to configure the HE MU EDCA params with default values and update the params to FW. Change-Id: Ia7485949c040cb8f83ccfe1f8336267051dbfd13 CRs-Fixed: 2262874 --- core/mac/inc/ani_global.h | 1 + core/mac/inc/sir_mac_prot_def.h | 4 +++ core/mac/inc/wni_api.h | 1 + .../src/pe/lim/lim_process_sme_req_messages.c | 23 +++++++++++++ core/sme/inc/sme_api.h | 28 ++++++++++++++++ core/sme/src/common/sme_api.c | 32 +++++++++++++++++++ 6 files changed, 89 insertions(+) diff --git a/core/mac/inc/ani_global.h b/core/mac/inc/ani_global.h index 606a087c29..0d4ef7f923 100644 --- a/core/mac/inc/ani_global.h +++ b/core/mac/inc/ani_global.h @@ -924,6 +924,7 @@ typedef struct sAniSirGlobal { uint32_t he_sgi_ltf_cfg_bit_mask; uint8_t usr_cfg_tx_bfee_nsts; struct mgmt_beacon_probe_filter bcn_filter; + tSirMacEdcaParamRecord usr_mu_edca_params[MAX_NUM_AC]; #ifdef WLAN_FEATURE_11AX tDot11fIEhe_cap he_cap_2g; tDot11fIEhe_cap he_cap_5g; diff --git a/core/mac/inc/sir_mac_prot_def.h b/core/mac/inc/sir_mac_prot_def.h index 45ec349cb6..8ae6117c6b 100644 --- a/core/mac/inc/sir_mac_prot_def.h +++ b/core/mac/inc/sir_mac_prot_def.h @@ -1128,6 +1128,10 @@ typedef struct sSirMacRRMEnabledCap { #define SIR_MAC_EDCAACI_VIDEO (EDCA_AC_VI) #define SIR_MAC_EDCAACI_VOICE (EDCA_AC_VO) +#define MU_EDCA_DEF_AIFSN 0 +#define MU_EDCA_DEF_CW_MAX 15 +#define MU_EDCA_DEF_CW_MIN 15 +#define MU_EDCA_DEF_TIMER 255 /* access category record */ typedef struct sSirMacAciAifsn { #ifndef ANI_LITTLE_BIT_ENDIAN diff --git a/core/mac/inc/wni_api.h b/core/mac/inc/wni_api.h index e90b3a83c9..6f916942b8 100644 --- a/core/mac/inc/wni_api.h +++ b/core/mac/inc/wni_api.h @@ -228,6 +228,7 @@ enum eWniMsgTypes { eWNI_SME_SEND_SAE_MSG, eWNI_SME_SET_ADDBA_ACCEPT, eWNI_SME_UPDATE_EDCA_PROFILE, + WNI_SME_UPDATE_MU_EDCA_PARAMS, eWNI_SME_MSG_TYPES_END }; diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c index 0d746d6c23..83ab2294ab 100644 --- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c @@ -3636,6 +3636,26 @@ static void lim_process_sme_update_edca_params(tpAniSirGlobal mac_ctx, pe_err("Self entry missing in Hash Table"); } +static void lim_process_sme_update_mu_edca_params(tpAniSirGlobal mac_ctx, + uint32_t sme_session_id) +{ + tpPESession pe_session; + tpDphHashNode sta_ds_ptr; + + pe_session = pe_find_session_by_sme_session_id(mac_ctx, sme_session_id); + if (!pe_session) { + pe_err("Session does not exist: sme_id %d", sme_session_id); + return; + } + sta_ds_ptr = dph_get_hash_entry(mac_ctx, DPH_STA_HASH_INDEX_PEER, + &pe_session->dph.dphHashTable); + if (sta_ds_ptr) + lim_send_edca_params(mac_ctx, mac_ctx->usr_mu_edca_params, + sta_ds_ptr->bssId, true); + else + pe_err("Self entry missing in Hash Table"); +} + static void lim_process_sme_update_config(tpAniSirGlobal mac_ctx, struct update_config *msg) { @@ -4782,6 +4802,9 @@ bool lim_process_sme_req_messages(tpAniSirGlobal pMac, case eWNI_SME_UPDATE_EDCA_PROFILE: lim_process_sme_update_edca_params(pMac, pMsg->bodyval); break; + case WNI_SME_UPDATE_MU_EDCA_PARAMS: + lim_process_sme_update_mu_edca_params(pMac, pMsg->bodyval); + break; default: qdf_mem_free((void *)pMsg->bodyptr); pMsg->bodyptr = NULL; diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 5bfc93e186..053d979103 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -2391,6 +2391,24 @@ int sme_update_he_tx_bfee_nsts(mac_handle_t hal, uint8_t session_id, * Return: 0 on success else err code */ int sme_update_he_mcs(tHalHandle hal, uint8_t session_id, uint16_t he_mcs); + +/** + * sme_set_he_mu_edca_def_cfg() - sets the default MU EDCA params values + * @hal: Pointer to HAL + * + * Return: none + */ +void sme_set_he_mu_edca_def_cfg(mac_handle_t hal); + +/** + * sme_update_mu_edca_params() - updates MU EDCA params values + * @hal: Pointer to HAL + * @session_id: SME session id + * + * Return: 0 on success else err code + */ +int sme_update_mu_edca_params(mac_handle_t hal, uint8_t session_id); + /** * sme_update_he_tx_stbc_cap() - Sets the HE Tx STBC capability * @hal: Pointer to HAL @@ -2444,6 +2462,16 @@ static inline int sme_update_he_mcs(tHalHandle hal, uint8_t session_id, { return 0; } + +static inline void sme_set_he_mu_edca_def_cfg(mac_handle_t hal) +{ +} + +static inline int sme_update_mu_edca_params(mac_handle_t hal, + uint8_t session_id) +{ + return 0; +} static inline int sme_update_he_tx_stbc_cap(tHalHandle hal, uint8_t session_id, int value) { diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 8c1fcb1e43..563b5009ac 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -12864,6 +12864,38 @@ static int sme_update_he_cap(tHalHandle hal, uint8_t session_id, return 0; } +int sme_update_mu_edca_params(mac_handle_t hal, uint8_t session_id) +{ + struct scheduler_msg msg = {0}; + QDF_STATUS status; + + qdf_mem_zero(&msg, sizeof(msg)); + msg.type = WNI_SME_UPDATE_MU_EDCA_PARAMS; + msg.reserved = 0; + msg.bodyval = session_id; + status = scheduler_post_msg(QDF_MODULE_ID_PE, &msg); + if (status != QDF_STATUS_SUCCESS) { + sme_err("Not able to post update edca profile"); + return -EIO; + } + + return 0; +} +void sme_set_he_mu_edca_def_cfg(mac_handle_t hal) +{ + tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal); + uint8_t i; + + for (i = 0; i < MAX_NUM_AC; i++) { + mac_ctx->usr_mu_edca_params[i].aci.aifsn = MU_EDCA_DEF_AIFSN; + mac_ctx->usr_mu_edca_params[i].aci.aci = i; + mac_ctx->usr_mu_edca_params[i].cw.max = MU_EDCA_DEF_CW_MAX; + mac_ctx->usr_mu_edca_params[i].cw.min = MU_EDCA_DEF_CW_MIN; + mac_ctx->usr_mu_edca_params[i].mu_edca_timer = + MU_EDCA_DEF_TIMER; + } +} + int sme_update_he_tx_bfee_supp(tHalHandle hal, uint8_t session_id, uint8_t cfg_val) {