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
This commit is contained in:
Naveen Rawat
2018-01-04 17:25:31 -08:00
committed by snandini
parent 42b254e496
commit 012137620e
9 changed files with 65 additions and 29 deletions

View File

@@ -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");
}

View File

@@ -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,

View File

@@ -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);

View File

@@ -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,

View File

@@ -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)

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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)