From ffaa467dfffac89245797ace219d63ad87f55e91 Mon Sep 17 00:00:00 2001 From: Jinwei Chen Date: Thu, 30 Aug 2018 16:55:09 +0800 Subject: [PATCH] qcacld-3.0: support HE STS Caps setting by INI Currently user can not configure HE STS capability through INI, use gTxBFCsnValue that share same INI with VHT to achieve it. Change-Id: Ia83462113cdf06e0af8b9f00c968745363aba9b4 CRs-Fixed: 2306083 --- core/hdd/inc/wlan_hdd_cfg.h | 20 ++++++++++++++++++++ core/hdd/src/wlan_hdd_he.c | 4 +++- core/sme/inc/sme_api.h | 8 ++++++-- core/sme/src/common/sme_api.c | 13 ++++++++++++- 4 files changed, 41 insertions(+), 4 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 31c229b55524..45810af76bb8 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -6031,6 +6031,26 @@ enum hdd_link_speed_rpt_type { #define CFG_VHT_ENABLE_TXBF_SAP_MODE_MAX (1) #define CFG_VHT_ENABLE_TXBF_SAP_MODE_DEFAULT (0) +/* + * + * gTxBFCsnValue - ini to set VHT/HE STS Caps field + * @Min: 0 + * @Max: 7 + * @Default: 7 + * + * This ini is used to configure the STS capability shown in AC/AX mode + * MGMT frame IE, the final STS field shown in VHT/HE IE will be calculated + * by MIN of (INI set, target report value). Only if gTxBFEnable is enabled + * and SU/MU BEAMFORMEE Caps is shown, then STS Caps make sense. + * + * Related: gTxBFEnable. + * + * Supported Feature: STA/SAP + * + * Usage: Internal + * + * + */ #define CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED "gTxBFCsnValue" #define CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_MIN (WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_STAMIN) #define CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_MAX (WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_STAMAX - 1) diff --git a/core/hdd/src/wlan_hdd_he.c b/core/hdd/src/wlan_hdd_he.c index 27457b62ff83..8066e0442814 100644 --- a/core/hdd/src/wlan_hdd_he.c +++ b/core/hdd/src/wlan_hdd_he.c @@ -57,6 +57,7 @@ void hdd_update_tgt_he_cap(struct hdd_context *hdd_ctx, QDF_STATUS status; tDot11fIEhe_cap *he_cap = &cfg->he_cap; struct hdd_config *config = hdd_ctx->config; + tDot11fIEhe_cap he_cap_ini = {0}; hdd_he_set_wni_cfg(hdd_ctx, WNI_CFG_HE_CONTROL, he_cap->htc_he); hdd_he_set_wni_cfg(hdd_ctx, WNI_CFG_HE_TWT_REQUESTOR, @@ -258,7 +259,8 @@ void hdd_update_tgt_he_cap(struct hdd_context *hdd_ctx, if (status == QDF_STATUS_E_FAILURE) hdd_alert("could not set 5G HE PPET"); - sme_update_tgt_he_cap(hdd_ctx->mac_handle, cfg); + he_cap_ini.bfee_sts_lt_80 = config->txBFCsnValue; + sme_update_tgt_he_cap(hdd_ctx->mac_handle, cfg, &he_cap_ini); } void wlan_hdd_check_11ax_support(struct hdd_beacon_data *beacon, diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 8906effa9e30..15a6b14aefb3 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -2449,10 +2449,13 @@ int sme_set_auto_rate_he_ltf(tHalHandle hal, uint8_t session_id, * sme_update_tgt_he_cap() - sets the HE caps to pmac * @mac_handle: Pointer to MAC handle * @cfg: Pointer to WMA target CFG + * @he_cap_ini: Pointer to HE CAP configured by INI * * Return: None */ -void sme_update_tgt_he_cap(mac_handle_t mac_handle, struct wma_tgt_cfg *cfg); +void sme_update_tgt_he_cap(mac_handle_t mac_handle, + struct wma_tgt_cfg *cfg, + tDot11fIEhe_cap *he_cap_ini); /** * sme_update_he_cap_nss() - sets the nss based on user request @@ -2595,7 +2598,8 @@ 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(mac_handle_t mac_handle, - struct wma_tgt_cfg *cfg) + struct wma_tgt_cfg *cfg, + tDot11fIEhe_cap *he_cap_ini) {} 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 4c5790edc79a..27e3023acc67 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -12703,7 +12703,9 @@ int sme_update_tx_bfee_nsts(mac_handle_t hal, uint8_t session_id, return sme_update_he_tx_bfee_nsts(hal, session_id, nsts_set_val); } #ifdef WLAN_FEATURE_11AX -void sme_update_tgt_he_cap(mac_handle_t mac_handle, struct wma_tgt_cfg *cfg) +void sme_update_tgt_he_cap(mac_handle_t mac_handle, + struct wma_tgt_cfg *cfg, + tDot11fIEhe_cap *he_cap_ini) { tpAniSirGlobal mac_ctx = PMAC_STRUCT(mac_handle); @@ -12714,6 +12716,15 @@ void sme_update_tgt_he_cap(mac_handle_t mac_handle, struct wma_tgt_cfg *cfg) qdf_mem_copy(&mac_ctx->he_cap_5g, &cfg->he_cap_5g, sizeof(tDot11fIEhe_cap)); + + /* modify HE Caps field according to INI setting */ + mac_ctx->he_cap_2g.bfee_sts_lt_80 = + QDF_MIN(cfg->he_cap_2g.bfee_sts_lt_80, + he_cap_ini->bfee_sts_lt_80); + + mac_ctx->he_cap_5g.bfee_sts_lt_80 = + QDF_MIN(cfg->he_cap_5g.bfee_sts_lt_80, + he_cap_ini->bfee_sts_lt_80); } void sme_update_he_cap_nss(tHalHandle hal, uint8_t session_id,