From 998a1a0e9531d03ad45bb26976e2111158d4e352 Mon Sep 17 00:00:00 2001 From: Jinwei Chen Date: Wed, 20 Jun 2018 17:20:34 +0800 Subject: [PATCH] qcacld-3.0: separate HE caps per band currently some HE capability is shared same value from MIN value of 2G and 5G capability, separate them per band. Change-Id: I37831b4044d4ca2deaf5015fb44227c824996136 CRs-Fixed: 2239070 --- core/hdd/src/wlan_hdd_he.c | 2 ++ core/mac/inc/ani_global.h | 4 ++++ core/sme/inc/sme_api.h | 12 ++++++++++++ core/sme/src/common/sme_api.c | 13 +++++++++++++ core/sme/src/csr/csr_api_roam.c | 19 +++++++++++++++++-- core/wma/inc/wma_tgt_cfg.h | 2 ++ core/wma/src/wma_he.c | 12 ++++++++++-- 7 files changed, 60 insertions(+), 4 deletions(-) diff --git a/core/hdd/src/wlan_hdd_he.c b/core/hdd/src/wlan_hdd_he.c index f0bfd1bc2276..92600da95dbb 100644 --- a/core/hdd/src/wlan_hdd_he.c +++ b/core/hdd/src/wlan_hdd_he.c @@ -240,6 +240,8 @@ void hdd_update_tgt_he_cap(struct hdd_context *hdd_ctx, cfg->ppet_5g, HE_MAX_PPET_SIZE); if (status == QDF_STATUS_E_FAILURE) hdd_alert("could not set 5G HE PPET"); + + sme_update_tgt_he_cap(hdd_ctx->hHal, cfg); } void wlan_hdd_check_11ax_support(struct hdd_beacon_data *beacon, diff --git a/core/mac/inc/ani_global.h b/core/mac/inc/ani_global.h index 1d8ad418007b..1156dbe05cc4 100644 --- a/core/mac/inc/ani_global.h +++ b/core/mac/inc/ani_global.h @@ -922,6 +922,10 @@ typedef struct sAniSirGlobal { uint8_t no_ack_policy_cfg[MAX_NUM_AC]; uint32_t he_sgi_ltf_cfg_bit_mask; struct mgmt_beacon_probe_filter bcn_filter; +#ifdef WLAN_FEATURE_11AX + tDot11fIEhe_cap he_cap_2g; + tDot11fIEhe_cap he_cap_5g; +#endif } tAniSirGlobal; diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 271a66385b03..771daba12e02 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -2255,6 +2255,15 @@ int sme_set_auto_rate_he_ltf(tHalHandle hal, uint8_t session_id, uint8_t cfg_val); #ifdef WLAN_FEATURE_11AX +/** + * sme_update_tgt_he_cap() - sets the HE caps to pmac + * @hal: Pointer to HAL + * @cfg: Pointer to wma target cfg + * + * Return: None + */ +void sme_update_tgt_he_cap(tHalHandle hal, struct wma_tgt_cfg *cfg); + /** * sme_update_he_cap_nss() - sets the nss based on user request * @hal: Pointer to HAL @@ -2327,6 +2336,9 @@ int sme_update_he_frag_supp(tHalHandle hal, uint8_t session_id, int sme_update_he_ldpc_supp(tHalHandle hal, uint8_t session_id, uint16_t he_ldpc); #else +static inline void sme_update_tgt_he_cap(tHalHandle hal, + struct wma_tgt_cfg *cfg) +{} static inline void sme_update_he_cap_nss(tHalHandle hal, uint8_t session_id, uint8_t nss) {} diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index ea1b4d58548c..d5096a0a082f 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -12935,6 +12935,19 @@ int sme_update_tx_bfee_supp(tHalHandle hal, uint8_t session_id, return sme_update_he_tx_bfee_supp(hal, session_id, cfg_val); } #ifdef WLAN_FEATURE_11AX +void sme_update_tgt_he_cap(tHalHandle hal, struct wma_tgt_cfg *cfg) +{ + tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal); + + qdf_mem_copy(&mac_ctx->he_cap_2g, + &cfg->he_cap_2g, + sizeof(tDot11fIEhe_cap)); + + qdf_mem_copy(&mac_ctx->he_cap_5g, + &cfg->he_cap_5g, + sizeof(tDot11fIEhe_cap)); +} + void sme_update_he_cap_nss(tHalHandle hal, uint8_t session_id, uint8_t nss) { diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 14bb26e8611e..2f99e6d5bcb1 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -2377,6 +2377,11 @@ uint32_t csr_convert_phy_cb_state_to_ini_value(ePhyChanBondState phyCbState) } #ifdef WLAN_FEATURE_11AX +#define CSR_REVISE_REQ_HE_CAP_PER_BAND(_req, _pmac, _channelid) \ + (_req)->he_config.bfee_sts_lt_80 = WLAN_CHAN_IS_2GHZ((_channelid)) ? \ + (_pmac)->he_cap_2g.bfee_sts_lt_80 : \ + (_pmac)->he_cap_5g.bfee_sts_lt_80 + /** * csr_update_he_config_param() - Update MAC context with HE config param * @mac_ctx: pointer to MAC context @@ -2634,6 +2639,8 @@ void csr_update_session_he_cap(tpAniSirGlobal mac_ctx, } #else +#define CSR_REVISE_REQ_HE_CAP_PER_BAND(_req, _pmac, _channelid) /* no op */ + static inline void csr_update_he_config_param(tpAniSirGlobal mac_ctx, tCsrConfigParam *param) { @@ -15773,8 +15780,12 @@ QDF_STATUS csr_send_join_req_msg(tpAniSirGlobal pMac, uint32_t sessionId, (unsigned int)(*(uint32_t *) &csr_join_req-> vht_config)); - if (IS_DOT11_MODE_HE(csr_join_req->dot11mode)) + if (IS_DOT11_MODE_HE(csr_join_req->dot11mode)) { csr_join_req_copy_he_cap(csr_join_req, pSession); + /* change the HE caps like sts per band */ + CSR_REVISE_REQ_HE_CAP_PER_BAND(csr_join_req, pMac, + pBssDescription->channelId); + } if (wlan_cfg_get_int(pMac, WNI_CFG_VHT_SU_BEAMFORMEE_CAP, &value) != eSIR_SUCCESS) @@ -16684,8 +16695,12 @@ QDF_STATUS csr_send_mb_start_bss_req_msg(tpAniSirGlobal pMac, uint32_t &pParam->extendedRateSet, sizeof(tSirMacRateSet)); - if (IS_DOT11_MODE_HE(pMsg->dot11mode)) + if (IS_DOT11_MODE_HE(pMsg->dot11mode)) { csr_start_bss_copy_he_cap(pMsg, pSession); + /* change the HE caps like sts per band */ + CSR_REVISE_REQ_HE_CAP_PER_BAND(pMsg, pMac, + pBssDesc->channelId); + } qdf_mem_copy(&pMsg->addIeParams, &pParam->addIeParams, diff --git a/core/wma/inc/wma_tgt_cfg.h b/core/wma/inc/wma_tgt_cfg.h index 488153827cc2..c2c28aa80248 100644 --- a/core/wma/inc/wma_tgt_cfg.h +++ b/core/wma/inc/wma_tgt_cfg.h @@ -207,6 +207,8 @@ struct wma_tgt_cfg { tDot11fIEhe_cap he_cap; uint8_t ppet_2g[HE_MAX_PPET_SIZE]; uint8_t ppet_5g[HE_MAX_PPET_SIZE]; + tDot11fIEhe_cap he_cap_2g; + tDot11fIEhe_cap he_cap_5g; #endif bool dfs_cac_offload; bool tx_bfee_8ss_enabled; diff --git a/core/wma/src/wma_he.c b/core/wma/src/wma_he.c index 9e597907609c..346422b30305 100644 --- a/core/wma/src/wma_he.c +++ b/core/wma/src/wma_he.c @@ -830,6 +830,8 @@ void wma_update_target_ext_he_cap(struct target_psoc_info *tgt_hdl, tDot11fIEhe_cap he_cap_mac; tDot11fIEhe_cap tmp_he_cap = {0}; + qdf_mem_zero(&tgt_cfg->he_cap_2g, sizeof(tgt_cfg->he_cap_2g)); + qdf_mem_zero(&tgt_cfg->he_cap_5g, sizeof(tgt_cfg->he_cap_5g)); num_hw_modes = target_psoc_get_num_hw_modes(tgt_hdl); mac_phy_cap = target_psoc_get_mac_phy_cap(tgt_hdl); total_mac_phy_cnt = target_psoc_get_total_mac_phy_cnt(tgt_hdl); @@ -865,9 +867,12 @@ void wma_update_target_ext_he_cap(struct target_psoc_info *tgt_hdl, &mac_cap->he_ppet2G); } - if (he_cap_mac.present) + if (he_cap_mac.present) { wma_derive_ext_he_cap(&tmp_he_cap, &he_cap_mac); + wma_derive_ext_he_cap(&tgt_cfg->he_cap_2g, + &he_cap_mac); + } qdf_mem_zero(&he_cap_mac, sizeof(tDot11fIEhe_cap)); @@ -885,9 +890,12 @@ void wma_update_target_ext_he_cap(struct target_psoc_info *tgt_hdl, (struct wmi_host_ppe_threshold *) &mac_cap->he_ppet5G); } - if (he_cap_mac.present) + if (he_cap_mac.present) { wma_derive_ext_he_cap(&tmp_he_cap, &he_cap_mac); + wma_derive_ext_he_cap(&tgt_cfg->he_cap_5g, + &he_cap_mac); + } } qdf_mem_copy(he_cap, &tmp_he_cap, sizeof(*he_cap));