From 012137620e43cc7c47675d10164ca5aede60eaf0 Mon Sep 17 00:00:00 2001 From: Naveen Rawat Date: Thu, 4 Jan 2018 17:25:31 -0800 Subject: [PATCH] qcacld-3.0: Fix interpretation of PPET capability populated by FW Firmware will provide PPET capability per phy, and phy in-turns is tied to a band. Add support for per band HE PPET in host, which will allow correct HE PPET advertisement based on channel. Change-Id: I476dede3b0f6df107b9980c141c0dbca90f950f1 CRs-Fixed: 2166741 --- core/hdd/src/wlan_hdd_he.c | 13 ++++++--- core/mac/inc/wni_cfg.h | 5 ++-- core/mac/src/cfg/cfg_param_name.c | 5 ++-- core/mac/src/cfg/cfg_proc_msg.c | 14 +++++++--- core/mac/src/pe/lim/lim_utils.c | 9 ++++++- .../src/sys/legacy/src/utils/src/parser_api.c | 14 +++++++--- core/sme/src/csr/csr_api_roam.c | 3 ++- core/wma/inc/wma_tgt_cfg.h | 4 ++- core/wma/src/wma_he.c | 27 ++++++++++--------- 9 files changed, 65 insertions(+), 29 deletions(-) diff --git a/core/hdd/src/wlan_hdd_he.c b/core/hdd/src/wlan_hdd_he.c index 9b103a582044..c195acda2450 100644 --- a/core/hdd/src/wlan_hdd_he.c +++ b/core/hdd/src/wlan_hdd_he.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018 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 @@ -201,9 +201,14 @@ void hdd_update_tgt_he_cap(struct hdd_context *hdd_ctx, hdd_he_set_wni_cfg(hdd_ctx, WNI_CFG_HE_TX_MCS_MAP_80_80, *((uint16_t *)he_cap->tx_he_mcs_map_80_80)); - /* PPET can not be configured by user - Set values from FW */ - status = sme_cfg_set_str(hdd_ctx->hHal, WNI_CFG_HE_PPET, - (void *)&he_cap->ppe_threshold, ppet_size); + /* PPET can not be configured by user - Set per band values from FW */ + status = sme_cfg_set_str(hdd_ctx->hHal, WNI_CFG_HE_PPET_2G, + (void *)&cfg->ppet_2g, ppet_size); + if (status == QDF_STATUS_E_FAILURE) + hdd_alert("could not set HE PPET"); + + status = sme_cfg_set_str(hdd_ctx->hHal, WNI_CFG_HE_PPET_5G, + (void *)&cfg->ppet_5g, ppet_size); if (status == QDF_STATUS_E_FAILURE) hdd_alert("could not set HE PPET"); } diff --git a/core/mac/inc/wni_cfg.h b/core/mac/inc/wni_cfg.h index e5878c82d059..828e4030b046 100644 --- a/core/mac/inc/wni_cfg.h +++ b/core/mac/inc/wni_cfg.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -328,7 +328,8 @@ enum { WNI_CFG_HE_TX_MCS_MAP_160, WNI_CFG_HE_RX_MCS_MAP_80_80, WNI_CFG_HE_TX_MCS_MAP_80_80, - WNI_CFG_HE_PPET, + WNI_CFG_HE_PPET_2G, + WNI_CFG_HE_PPET_5G, WNI_CFG_HE_OPS_BSS_COLOR, WNI_CFG_HE_OPS_DEFAULT_PE, WNI_CFG_HE_OPS_TWT_REQUIRED, diff --git a/core/mac/src/cfg/cfg_param_name.c b/core/mac/src/cfg/cfg_param_name.c index 411253a180bf..f417b7a56e08 100644 --- a/core/mac/src/cfg/cfg_param_name.c +++ b/core/mac/src/cfg/cfg_param_name.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -330,7 +330,8 @@ const char *cfg_get_string(uint16_t cfg_id) CASE_RETURN_STRING(WNI_CFG_HE_TX_MCS_MAP_160); CASE_RETURN_STRING(WNI_CFG_HE_RX_MCS_MAP_80_80); CASE_RETURN_STRING(WNI_CFG_HE_TX_MCS_MAP_80_80); - CASE_RETURN_STRING(WNI_CFG_HE_PPET); + CASE_RETURN_STRING(WNI_CFG_HE_PPET_2G); + CASE_RETURN_STRING(WNI_CFG_HE_PPET_5G); CASE_RETURN_STRING(WNI_CFG_HE_OPS_BSS_COLOR); CASE_RETURN_STRING(WNI_CFG_HE_OPS_DEFAULT_PE); CASE_RETURN_STRING(WNI_CFG_HE_OPS_TWT_REQUIRED); diff --git a/core/mac/src/cfg/cfg_proc_msg.c b/core/mac/src/cfg/cfg_proc_msg.c index 6da26fdf26d9..ea80bc185588 100644 --- a/core/mac/src/cfg/cfg_proc_msg.c +++ b/core/mac/src/cfg/cfg_proc_msg.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -1474,7 +1474,10 @@ cgstatic cfg_static[CFG_PARAM_MAX_NUM] = { WNI_CFG_HE_TX_MCS_MAP_80_80_MIN, WNI_CFG_HE_TX_MCS_MAP_80_80_MAX, WNI_CFG_HE_TX_MCS_MAP_80_80_DEF}, - {WNI_CFG_HE_PPET, + {WNI_CFG_HE_PPET_2G, + CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE, + 0, 0, 0}, + {WNI_CFG_HE_PPET_5G, CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE, 0, 0, 0}, @@ -1775,7 +1778,12 @@ cfgstatic_string cfg_static_string[CFG_MAX_STATIC_STRING] = { WNI_CFG_WPS_UUID_LEN, 6, {0xa, 0xb, 0xc, 0xd, 0xe, 0xf} }, - {WNI_CFG_HE_PPET, + {WNI_CFG_HE_PPET_2G, + WNI_CFG_HE_PPET_LEN, + WNI_CFG_HE_PPET_LEN, + {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0} }, + {WNI_CFG_HE_PPET_5G, WNI_CFG_HE_PPET_LEN, WNI_CFG_HE_PPET_LEN, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index e6c235eaa2f6..e78b2720c1f4 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -7528,6 +7528,14 @@ void lim_log_he_cap(tpAniSirGlobal mac, tDot11fIEhe_cap *he_cap) pe_debug("\tTx MCS map for <= 80+80 Mhz: 0x%04x", *((uint16_t *)he_cap->tx_he_mcs_map_80_80)); + pe_debug("\t ppe_th: present: %d, nss_count: %d, ru_idx_msk: %d", + he_cap->ppe_threshold.present, + he_cap->ppe_threshold.nss_count, + he_cap->ppe_threshold.ru_idx_mask); + + QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, + &he_cap->ppe_threshold, sizeof(tDot11fIEppe_threshold)); + /* HE PPET */ if (!he_cap->ppet_present) return; @@ -7536,7 +7544,6 @@ void lim_log_he_cap(tpAniSirGlobal mac, tDot11fIEhe_cap *he_cap) pe_debug(FL("PPET is not present. Invalid IE")); return; } - } void lim_log_he_op(tpAniSirGlobal mac, tDot11fIEhe_op *he_ops) diff --git a/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/core/mac/src/sys/legacy/src/utils/src/parser_api.c index 750c30ef32f6..fe5f1fa84000 100644 --- a/core/mac/src/sys/legacy/src/utils/src/parser_api.c +++ b/core/mac/src/sys/legacy/src/utils/src/parser_api.c @@ -6296,7 +6296,8 @@ QDF_STATUS populate_dot11f_he_caps(tpAniSirGlobal mac_ctx, tpPESession session, if (he_cap->ppet_present) { value = WNI_CFG_HE_PPET_LEN; - CFG_GET_STR(status, mac_ctx, WNI_CFG_HE_PPET, + /* if session less then take 5g cap */ + CFG_GET_STR(status, mac_ctx, WNI_CFG_HE_PPET_5G, (void *)&he_cap->ppe_threshold, value, value); } else { he_cap->ppe_threshold.present = false; @@ -6308,8 +6309,15 @@ QDF_STATUS populate_dot11f_he_caps(tpAniSirGlobal mac_ctx, tpPESession session, qdf_mem_copy(he_cap, &session->he_config, sizeof(*he_cap)); if (he_cap->ppet_present) { value = WNI_CFG_HE_PPET_LEN; - CFG_GET_STR(status, mac_ctx, WNI_CFG_HE_PPET, - (void *)&he_cap->ppe_threshold, value, value); + /* if session is present, populate PPET based on band */ + if (IS_5G_CH(session->currentOperChannel)) + CFG_GET_STR(status, mac_ctx, WNI_CFG_HE_PPET_5G, + (void *)&he_cap->ppe_threshold, + value, value); + else + CFG_GET_STR(status, mac_ctx, WNI_CFG_HE_PPET_2G, + (void *)&he_cap->ppe_threshold, + value, value); } else { he_cap->ppe_threshold.present = false; } diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 155c250a87dd..c34b9e79ee20 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -2440,7 +2440,8 @@ static void csr_update_session_he_cap(tpAniSirGlobal mac_ctx, if (he_cap->ppet_present) { value = WNI_CFG_HE_PPET_LEN; - sme_cfg_get_str(mac_ctx, WNI_CFG_HE_PPET, + /* till now operating channel is not decided yet, use 5g cap */ + sme_cfg_get_str(mac_ctx, WNI_CFG_HE_PPET_5G, (void *)&he_cap->ppe_threshold, &value); } else { he_cap->ppe_threshold.present = false; diff --git a/core/wma/inc/wma_tgt_cfg.h b/core/wma/inc/wma_tgt_cfg.h index 1e395649f60f..6a1946537bd2 100644 --- a/core/wma/inc/wma_tgt_cfg.h +++ b/core/wma/inc/wma_tgt_cfg.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -190,6 +190,8 @@ struct wma_tgt_cfg { uint16_t wmi_max_len; #ifdef WLAN_FEATURE_11AX tDot11fIEhe_cap he_cap; + tDot11fIEppe_threshold ppet_2g; + tDot11fIEppe_threshold ppet_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 0714e7ad4a7e..8dcabc9629de 100644 --- a/core/wma/src/wma_he.c +++ b/core/wma/src/wma_he.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018 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 @@ -178,7 +178,6 @@ static void wma_convert_he_ppet(tDot11fIEppe_threshold *he_ppet, * @he_cap: pointer to dot11f structure * @mac_cap: Received HE MAC capability * @phy_cap: Received HE PHY capability - * @he_ppet: Received HE PPE threshold * @supp_mcs: Max MCS supported (Tx/Rx) * @tx_chain_mask: Tx chain mask * @rx_chain_mask: Rx chain mask @@ -190,13 +189,11 @@ static void wma_convert_he_ppet(tDot11fIEppe_threshold *he_ppet, * Return: None */ static void wma_convert_he_cap(tDot11fIEhe_cap *he_cap, uint32_t mac_cap, - uint32_t *phy_cap, void *he_ppet, - uint32_t supp_mcs, uint32_t tx_chain_mask, - uint32_t rx_chain_mask) + uint32_t *phy_cap, uint32_t supp_mcs, + uint32_t tx_chain_mask, uint32_t rx_chain_mask) { uint8_t nss, chan_width; uint16_t rx_mcs_le_80, tx_mcs_le_80, rx_mcs_160, tx_mcs_160; - struct wmi_host_ppe_threshold *ppet = he_ppet; nss = QDF_MAX(wma_get_num_of_setbits_from_bitmask(tx_chain_mask), wma_get_num_of_setbits_from_bitmask(rx_chain_mask)); @@ -320,8 +317,6 @@ static void wma_convert_he_cap(tDot11fIEhe_cap *he_cap, uint32_t mac_cap, *((uint16_t *)he_cap->rx_he_mcs_map_160) = tx_mcs_160; *((uint16_t *)he_cap->rx_he_mcs_map_80_80) = rx_mcs_160; *((uint16_t *)he_cap->tx_he_mcs_map_80_80) = tx_mcs_160; - - wma_convert_he_ppet(&he_cap->ppe_threshold, ppet); } /** @@ -876,11 +871,15 @@ void wma_update_target_ext_he_cap(tp_wma_handle wma_handle, wma_convert_he_cap(&he_cap_mac, mac_cap->he_cap_info_2G, mac_cap->he_cap_phy_info_2G, - (uint8_t *)&mac_cap->he_ppet2G, mac_cap->he_supp_mcs_2G, mac_cap->tx_chain_mask_2G, mac_cap->rx_chain_mask_2G); - + WMA_LOGD(FL("2g phy: nss: %d, ru_idx_msk: %d"), + mac_cap->he_ppet2G.numss_m1, + mac_cap->he_ppet2G.ru_mask); + wma_convert_he_ppet(&tgt_cfg->ppet_2g, + (struct wmi_host_ppe_threshold *) + &mac_cap->he_ppet2G); } if (he_cap_mac.present) @@ -893,11 +892,15 @@ void wma_update_target_ext_he_cap(tp_wma_handle wma_handle, wma_convert_he_cap(&he_cap_mac, mac_cap->he_cap_info_5G, mac_cap->he_cap_phy_info_5G, - (uint8_t *)&mac_cap->he_ppet5G, mac_cap->he_supp_mcs_5G, mac_cap->tx_chain_mask_5G, mac_cap->rx_chain_mask_5G); - + WMA_LOGD(FL("5g phy: nss: %d, ru_idx_msk: %d"), + mac_cap->he_ppet2G.numss_m1, + mac_cap->he_ppet2G.ru_mask); + wma_convert_he_ppet(&tgt_cfg->ppet_5g, + (struct wmi_host_ppe_threshold *) + &mac_cap->he_ppet5G); } if (he_cap_mac.present)