diff options
| author | Hong Shi <hongsh@codeaurora.org> | 2016-12-26 21:28:58 +0800 |
|---|---|---|
| committer | Ashish kumar goswami <agoswa@codeaurora.org> | 2017-01-05 16:12:43 +0530 |
| commit | 396d0e512283ffd174ccdfb56e8f170907fc036e (patch) | |
| tree | 0e3e1caa10ce7817128bd64622a82b5b3a413ae3 | |
| parent | ba2dd72d4713f3946325aa740bddf3c9e3dc72c7 (diff) | |
qcacld-2.0: Apply gSapMaxMCSForTxData for all modes
Previously gSapMaxMCSForTxData ini option only configure max mcs
for SAP mode. This change is to apply this config for all modes. Thus
renamed all the related fields and move the mask function inside peer
assoc.
CRs-Fixed: 1105357
Change-Id: Ic69a2d19ad1b3b835c83c7d666fb7821e42e8442
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_cfg.h | 27 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg.c | 16 | ||||
| -rw-r--r-- | CORE/MAC/inc/wni_cfg.h | 10 | ||||
| -rw-r--r-- | CORE/MAC/src/cfg/cfgParamName.c | 4 | ||||
| -rw-r--r-- | CORE/MAC/src/cfg/cfgProcMsg.c | 10 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.c | 96 |
6 files changed, 94 insertions, 69 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h index 211937901e99..e9b092284aab 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg.h +++ b/CORE/HDD/inc/wlan_hdd_cfg.h @@ -1484,13 +1484,26 @@ typedef enum #define CFG_MAX_MPDUS_IN_AMPDU_DEFAULT (0) /* - * SAP TX MCS limit - * Used only for HT rate configure. + * <ini> + * gMaxHTMCSForTxData - max HT mcs for TX + * @Min: 0 + * @Max: 383 + * @Default: 0 + * + * This ini is used to configure the max HT mcs + * for tx data. + * + * Usage: External + * + * bits 0-15: max HT mcs + * bits 16-31: zero to disable, otherwise enable. + * + * </ini> */ -#define CFG_SAP_MAX_MCS_FOR_TX_DATA "gSapMaxMCSForTxData" -#define CFG_SAP_MAX_MCS_FOR_TX_DATA_MIN (0) -#define CFG_SAP_MAX_MCS_FOR_TX_DATA_MAX (383) -#define CFG_SAP_MAX_MCS_FOR_TX_DATA_DEFAULT (0) +#define CFG_MAX_HT_MCS_FOR_TX_DATA "gMaxHTMCSForTxData" +#define CFG_MAX_HT_MCS_FOR_TX_DATA_MIN (WNI_CFG_MAX_HT_MCS_TX_DATA_STAMIN) +#define CFG_MAX_HT_MCS_FOR_TX_DATA_MAX (WNI_CFG_MAX_HT_MCS_TX_DATA_STAMAX) +#define CFG_MAX_HT_MCS_FOR_TX_DATA_DEFAULT (WNI_CFG_MAX_HT_MCS_TX_DATA_STADEF) /* * RSSI Thresholds @@ -4896,7 +4909,7 @@ struct hdd_config { uint32_t auto_channel_select_weight; uint8_t enable_rts_sifsbursting; uint8_t max_mpdus_inampdu; - uint16_t sap_max_mcs_txdata; + uint16_t max_ht_mcs_txdata; #ifdef QCA_LL_TX_FLOW_CT v_U32_t TxFlowLowWaterMark; v_U32_t TxFlowHighWaterMarkOffset; diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c index f1f724262d9e..b4dec658697f 100644 --- a/CORE/HDD/src/wlan_hdd_cfg.c +++ b/CORE/HDD/src/wlan_hdd_cfg.c @@ -2387,12 +2387,12 @@ REG_TABLE_ENTRY g_registry_table[] = CFG_MAX_MPDUS_IN_AMPDU_MIN, CFG_MAX_MPDUS_IN_AMPDU_MAX), - REG_VARIABLE(CFG_SAP_MAX_MCS_FOR_TX_DATA, WLAN_PARAM_Integer, - hdd_config_t, sap_max_mcs_txdata, + REG_VARIABLE(CFG_MAX_HT_MCS_FOR_TX_DATA, WLAN_PARAM_HexInteger, + hdd_config_t, max_ht_mcs_txdata, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_SAP_MAX_MCS_FOR_TX_DATA_DEFAULT, - CFG_SAP_MAX_MCS_FOR_TX_DATA_MIN, - CFG_SAP_MAX_MCS_FOR_TX_DATA_MAX), + CFG_MAX_HT_MCS_FOR_TX_DATA_DEFAULT, + CFG_MAX_HT_MCS_FOR_TX_DATA_MIN, + CFG_MAX_HT_MCS_FOR_TX_DATA_MAX), REG_VARIABLE( CFG_ENABLE_FIRST_SCAN_2G_ONLY_NAME, WLAN_PARAM_Integer, hdd_config_t, enableFirstScan2GOnly, @@ -7490,11 +7490,11 @@ v_BOOL_t hdd_update_config_dat( hdd_context_t *pHddCtx ) hddLog(LOGE, "Could not pass on WNI_CFG_TGT_GTX_USR_CFG to CCM"); } - if (ccmCfgSetInt(pHddCtx->hHal, WNI_CFG_SAP_MAX_MCS_DATA, - pConfig->sap_max_mcs_txdata, NULL, + if (ccmCfgSetInt(pHddCtx->hHal, WNI_CFG_MAX_HT_MCS_TX_DATA, + pConfig->max_ht_mcs_txdata, NULL, eANI_BOOLEAN_FALSE) == eHAL_STATUS_FAILURE) { fStatus = FALSE; - hddLog(LOGE, "Could not pass on WNI_CFG_SAP_MAX_MCS_DATA to CCM"); + hddLog(LOGE, "Could not pass on WNI_CFG_MAX_HT_MCS_TX_DATA to CCM"); } return fStatus; diff --git a/CORE/MAC/inc/wni_cfg.h b/CORE/MAC/inc/wni_cfg.h index bce3465d195d..e0af3deae7dc 100644 --- a/CORE/MAC/inc/wni_cfg.h +++ b/CORE/MAC/inc/wni_cfg.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -328,7 +328,7 @@ enum { WNI_CFG_TGT_GTX_USR_CFG, WNI_CFG_ASSOC_STA_LIMIT_GO, WNI_CFG_ASSOC_STA_LIMIT_AP, - WNI_CFG_SAP_MAX_MCS_DATA, + WNI_CFG_MAX_HT_MCS_TX_DATA, WNI_CFG_MAX, }; @@ -1612,9 +1612,9 @@ enum { #define WNI_CFG_ASSOC_STA_LIMIT_GO_STAMAX 32 #define WNI_CFG_ASSOC_STA_LIMIT_GO_STADEF 10 -#define WNI_CFG_SAP_MAX_MCS_DATA_MIN 0x0 -#define WNI_CFG_SAP_MAX_MCS_DATA_MAX 0x17f -#define WNI_CFG_SAP_MAX_MCS_DATA_DEF 0x0 +#define WNI_CFG_MAX_HT_MCS_TX_DATA_STAMIN 0x0 +#define WNI_CFG_MAX_HT_MCS_TX_DATA_STAMAX 0x17f +#define WNI_CFG_MAX_HT_MCS_TX_DATA_STADEF 0x0 #define CFG_STA_IBUF_MAX_SIZE 245 #define CFG_STA_SBUF_MAX_SIZE 3199 diff --git a/CORE/MAC/src/cfg/cfgParamName.c b/CORE/MAC/src/cfg/cfgParamName.c index fc6d8eaee571..5b18217abd0e 100644 --- a/CORE/MAC/src/cfg/cfgParamName.c +++ b/CORE/MAC/src/cfg/cfgParamName.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -336,5 +336,5 @@ unsigned char *gCfgParamName[] = { (unsigned char *)"TGT_GTX_USR_CFG", (unsigned char *)"ASSOC_STA_LIMIT_GO", (unsigned char *)"ASSOC_STA_LIMIT_AP", - (unsigned char *)"SAP_MAX_MCS_DATA", + (unsigned char *)"MAX_HT_MCS_TX_DATA", }; diff --git a/CORE/MAC/src/cfg/cfgProcMsg.c b/CORE/MAC/src/cfg/cfgProcMsg.c index 4e38be450e51..e8c235675a47 100644 --- a/CORE/MAC/src/cfg/cfgProcMsg.c +++ b/CORE/MAC/src/cfg/cfgProcMsg.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -1897,11 +1897,11 @@ struct cgstatic cfg_static[WNI_CFG_MAX] = { WNI_CFG_ASSOC_STA_LIMIT_AP_STAMAX, WNI_CFG_ASSOC_STA_LIMIT_AP_STADEF}, - {WNI_CFG_SAP_MAX_MCS_DATA, + {WNI_CFG_MAX_HT_MCS_TX_DATA, CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT, - WNI_CFG_SAP_MAX_MCS_DATA_MIN, - WNI_CFG_SAP_MAX_MCS_DATA_MAX, - WNI_CFG_SAP_MAX_MCS_DATA_DEF}, + WNI_CFG_MAX_HT_MCS_TX_DATA_STAMIN, + WNI_CFG_MAX_HT_MCS_TX_DATA_STAMAX, + WNI_CFG_MAX_HT_MCS_TX_DATA_STADEF}, }; diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index 31e37b6a66d3..f55eaa9b43ed 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -14408,6 +14408,58 @@ static void wma_update_txrx_chainmask(int num_rf_chains, int *cmd_value) } } +#define CFG_CTRL_MASK 0xFF00 +#define CFG_DATA_MASK 0x00FF + +/** + * wma_mask_tx_ht_rate() - mask tx ht rate based on config + * @wma: wma handle + * @mcs_set mcs set buffer + * + * Return: None + */ +static void wma_mask_tx_ht_rate(tp_wma_handle wma, uint8_t *mcs_set) +{ + uint32_t mcs_limit, i, j; + uint8_t *rate_pos = mcs_set; + + /* + * Get MCS limit from ini configure, and map it to rate parameters + * This will limit HT rate upper bound. CFG_CTRL_MASK is used to + * check whether ini config is enabled and CFG_DATA_MASK to get the + * MCS value. + */ + if (wlan_cfgGetInt(wma->mac_context, WNI_CFG_MAX_HT_MCS_TX_DATA, + &mcs_limit) != eSIR_SUCCESS) { + mcs_limit = WNI_CFG_MAX_HT_MCS_TX_DATA_STADEF; + } + + if (mcs_limit & CFG_CTRL_MASK) { + WMA_LOGD("%s: set mcs_limit %x", __func__, mcs_limit); + + mcs_limit &= CFG_DATA_MASK; + for (i = 0, j = 0; i < MAX_SUPPORTED_RATES;) { + if (j < mcs_limit / 8) { + rate_pos[j] = 0xff; + j++; + i += 8; + } else if (j < mcs_limit / 8 + 1) { + if (i <= mcs_limit) + rate_pos[i / 8] |= 1 << (i % 8); + else + rate_pos[i / 8] &= ~(1 << (i % 8)); + i++; + + if (i >= (j + 1) * 8) + j++; + } else { + rate_pos[j++] = 0; + i += 8; + } + } + } +} + static int32_t wmi_unified_send_peer_assoc(tp_wma_handle wma, tSirNwType nw_type, tpAddStaParams params) @@ -14442,6 +14494,8 @@ static int32_t wmi_unified_send_peer_assoc(tp_wma_handle wma, return -EINVAL; } + wma_mask_tx_ht_rate(wma, params->supportedRates.supportedMCSSet); + vos_mem_zero(&peer_legacy_rates, sizeof(wmi_rate_set)); vos_mem_zero(&peer_ht_rates, sizeof(wmi_rate_set)); @@ -17498,8 +17552,6 @@ static void wma_add_sta_req_ap_mode(tp_wma_handle wma, tpAddStaParams add_sta) VOS_STATUS status; int32_t ret; struct wma_txrx_node *iface = NULL; - uint32_t mcs_limit, i, j; - uint8_t *rate_pos; pdev = vos_get_context(VOS_MODULE_ID_TXRX, wma->vos_context); @@ -17578,46 +17630,6 @@ static void wma_add_sta_req_ap_mode(tp_wma_handle wma, tpAddStaParams add_sta) wmi_unified_send_txbf(wma, add_sta); - /* - * Get MCS limit from ini configure, and map it to rate parameters - * This will limit HT rate upper bound. CFG_CTRL_MASK is used to - * check whether ini config is enabled and CFG_DATA_MASK to get the - * MCS value. - */ -#define CFG_CTRL_MASK 0xFF00 -#define CFG_DATA_MASK 0x00FF - - if (wlan_cfgGetInt(wma->mac_context, WNI_CFG_SAP_MAX_MCS_DATA, - &mcs_limit) != eSIR_SUCCESS) { - mcs_limit = WNI_CFG_SAP_MAX_MCS_DATA_DEF; - } - - if (mcs_limit & CFG_CTRL_MASK) { - WMA_LOGD("%s: set mcs_limit %x", __func__, mcs_limit); - - mcs_limit &= CFG_DATA_MASK; - rate_pos = (u_int8_t *)add_sta->supportedRates.supportedMCSSet; - for (i = 0, j = 0; i < MAX_SUPPORTED_RATES;) { - if (j < mcs_limit / 8) { - rate_pos[j] = 0xff; - j++; - i += 8; - } else if (j < mcs_limit / 8 + 1) { - if (i <= mcs_limit) - rate_pos[i / 8] |= 1 << (i % 8); - else - rate_pos[i / 8] &= ~(1 << (i % 8)); - i++; - - if (i >= (j + 1) * 8) - j++; - } else { - rate_pos[j++] = 0; - i += 8; - } - } - } - ret = wmi_unified_send_peer_assoc(wma, add_sta->nwType, add_sta); if (ret) { add_sta->status = VOS_STATUS_E_FAILURE; |
