From 612392c937c4688286698a5fa75682daf73832c4 Mon Sep 17 00:00:00 2001 From: Deepak Dhamdhere Date: Sun, 28 Aug 2016 02:56:51 -0700 Subject: [PATCH] qcacld-3.0: Add .ini configuration for max number of AMSDU qcacld-2.0 to qcacld-3.0 propagation Host driver can send number of max AMSDUs in transmit frames. Added a call to process_wma_set_command() similar to CLI command processing for GEN_VDEV_PARAM_AMSDU during device initialization. Changed name of the field from isAmsduSupportInAMPDU to max_amsdu_num in several places. Existing SME and LIM code passes this parameter to WMA, but it is not used there. It may be useful if AMSDU setting is changed to per-vdev basis in future. WCNSS_qcom_cfg.ini changes: Removed - "gAmsduSupportInAMPDU" Added - Name = "gMaxAmsduNum", Min = 0, Max = 3, Default = 1 Actual function call to ol_txrx_aggr_cfg() send the parameters to firmware is commented out because it is not implemented in firmware. Change-Id: I2dfdd8c8c4a8807596ff28eee192ef66ac425653 CRs-Fixed: 871686 --- core/hdd/inc/wlan_hdd_cfg.h | 27 ++++++++++++++----- core/hdd/src/wlan_hdd_cfg.c | 17 ++++++------ core/hdd/src/wlan_hdd_main.c | 11 ++++++++ core/hdd/src/wlan_hdd_wext.c | 3 +++ core/mac/inc/sir_api.h | 2 +- core/mac/inc/sir_mac_prot_def.h | 1 + core/mac/src/pe/include/lim_session.h | 2 +- core/mac/src/pe/lim/lim_assoc_utils.c | 3 +++ .../src/pe/lim/lim_process_mlm_host_roam.c | 3 +++ .../src/pe/lim/lim_process_mlm_req_messages.c | 3 +++ .../src/pe/lim/lim_process_sme_req_messages.c | 3 +-- core/mac/src/pe/lim/lim_utils.c | 4 +++ core/sme/inc/csr_api.h | 2 +- core/sme/inc/csr_internal.h | 2 +- core/sme/src/csr/csr_api_roam.c | 10 +++---- core/wma/inc/wma_if.h | 2 ++ core/wma/src/wma_main.c | 27 ++++++++++--------- 17 files changed, 83 insertions(+), 39 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index fe415d7110d7..feac0bc80d9f 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -6614,11 +6614,6 @@ enum hdd_link_speed_rpt_type { #define CFG_ENABLE_SNR_MONITORING_MAX (1) #define CFG_ENABLE_SNR_MONITORING_DEFAULT (0) -#define CFG_AMSDU_SUPPORT_IN_AMPDU_NAME "gAmsduSupportInAMPDU" -#define CFG_AMSDU_SUPPORT_IN_AMPDU_MIN (0) -#define CFG_AMSDU_SUPPORT_IN_AMPDU_MAX (1) -#define CFG_AMSDU_SUPPORT_IN_AMPDU_DEFAULT (0) /* disabled */ - /* * * gEnableIpTcpUdpChecksumOffload - It enables IP, TCP and UDP checksum @@ -7182,6 +7177,26 @@ enum hdd_link_speed_rpt_type { #define CFG_AUTO_DETECT_POWER_FAIL_MODE_DEFAULT (0) #define CFG_AUTO_DETECT_POWER_FAIL_MODE_MIN (0) #define CFG_AUTO_DETECT_POWER_FAIL_MODE_MAX (1) +/* + * + * gMaxAmsduNum - Max number of MSDU's in aggregate + * @Min: 0 + * @Max: 3 + * @Default: 1 + * gMaxAmsduNum is the number of MSDU's transmitted in the 11n aggregate + * frame. Setting it to a value larger than 1 enables transmit aggregation. + * It is a PHY parameter that applies to all vdev's in firmware. + * + * Supported Feature: 11n aggregation + * + * Usage: Internal + * + * + */ +#define CFG_MAX_AMSDU_NUM_NAME "gMaxAmsduNum" +#define CFG_MAX_AMSDU_NUM_MIN (0) +#define CFG_MAX_AMSDU_NUM_MAX (3) +#define CFG_MAX_AMSDU_NUM_DEFAULT (1) /* * @@ -10817,7 +10832,7 @@ struct hdd_config { uint32_t configPNOScanTimerRepeatValue; uint32_t pno_slow_scan_multiplier; #endif - uint8_t isAmsduSupportInAMPDU; + uint8_t max_amsdu_num; uint8_t nSelect5GHzMargin; uint8_t isCoalesingInIBSSAllowed; diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index d5fc3a958566..07c703630d35 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -2567,12 +2567,12 @@ struct reg_table_entry g_registry_table[] = { CFG_PNO_SLOW_SCAN_MULTIPLIER_MIN, CFG_PNO_SLOW_SCAN_MULTIPLIER_MAX), #endif - REG_VARIABLE(CFG_AMSDU_SUPPORT_IN_AMPDU_NAME, WLAN_PARAM_Integer, - struct hdd_config, isAmsduSupportInAMPDU, + REG_VARIABLE(CFG_MAX_AMSDU_NUM_NAME , WLAN_PARAM_Integer, + struct hdd_config, max_amsdu_num, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_AMSDU_SUPPORT_IN_AMPDU_DEFAULT, - CFG_AMSDU_SUPPORT_IN_AMPDU_MIN, - CFG_AMSDU_SUPPORT_IN_AMPDU_MAX), + CFG_MAX_AMSDU_NUM_DEFAULT, + CFG_MAX_AMSDU_NUM_MIN, + CFG_MAX_AMSDU_NUM_MAX), REG_VARIABLE(CFG_STRICT_5GHZ_PREF_BY_MARGIN, WLAN_PARAM_Integer, struct hdd_config, nSelect5GHzMargin, @@ -5583,8 +5583,8 @@ void hdd_cfg_print(hdd_context_t *pHddCtx) pHddCtx->config->goKeepAlivePeriod); hdd_info("Name = [gApKeepAlivePeriod]Value = [%u]", pHddCtx->config->apKeepAlivePeriod); - hdd_info("Name = [gAmsduSupportInAMPDU] Value = [%u] ", - pHddCtx->config->isAmsduSupportInAMPDU); + hdd_debug("Name = [max_amsdu_num] Value = [%u] ", + pHddCtx->config->max_amsdu_num); hdd_info("Name = [nSelect5GHzMargin] Value = [%u] ", pHddCtx->config->nSelect5GHzMargin); hdd_info("Name = [gCoalesingInIBSS] Value = [%u] ", @@ -7464,8 +7464,7 @@ QDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx) smeConfig->csrConfig.cc_switch_mode = pConfig->WlanMccToSccSwitchMode; #endif - smeConfig->csrConfig.isAmsduSupportInAMPDU = - pConfig->isAmsduSupportInAMPDU; + smeConfig->csrConfig.max_amsdu_num = pConfig->max_amsdu_num; smeConfig->csrConfig.nSelect5GHzMargin = pConfig->nSelect5GHzMargin; smeConfig->csrConfig.isCoalesingInIBSSAllowed = diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 5f574ac857b0..620fb416167e 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -3638,6 +3638,17 @@ int hdd_set_fw_params(hdd_adapter_t *adapter) goto error; } + hdd_debug("SET AMSDU num %d", hdd_ctx->config->max_amsdu_num); + + ret = wma_cli_set_command(adapter->sessionId, + GEN_VDEV_PARAM_AMSDU, + hdd_ctx->config->max_amsdu_num, + GEN_CMD); + if (ret != 0) { + hdd_err("GEN_VDEV_PARAM_AMSDU set failed %d", ret); + goto error; + } + hdd_set_fw_log_params(hdd_ctx, adapter); EXIT(); diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index e5b05a6de96d..beaee5f05533 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -8298,6 +8298,9 @@ static int __iw_setint_getnone(struct net_device *dev, ret = wma_cli_set_command(pAdapter->sessionId, GEN_VDEV_PARAM_AMSDU, set_value, GEN_CMD); + /* Update the stored ini value */ + if (!ret) + hdd_ctx->config->max_amsdu_num = set_value; break; } diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 814cfd62fd5e..55a6a4b7a89c 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -1189,7 +1189,7 @@ typedef struct sSirSmeJoinReq { uint8_t htSmps; bool send_smps_action; - uint8_t isAmsduSupportInAMPDU; + uint8_t max_amsdu_num; tAniBool isWMEenabled; tAniBool isQosEnabled; tAniBool isOSENConnection; diff --git a/core/mac/inc/sir_mac_prot_def.h b/core/mac/inc/sir_mac_prot_def.h index 02d307ad0053..95bba3b3e39b 100644 --- a/core/mac/inc/sir_mac_prot_def.h +++ b/core/mac/inc/sir_mac_prot_def.h @@ -1693,6 +1693,7 @@ typedef enum eHTCapability { eHT_PSMP, eHT_DSSS_CCK_MODE_40MHZ, eHT_MAX_AMSDU_LENGTH, + eHT_MAX_AMSDU_NUM, eHT_RX_STBC, eHT_TX_STBC, eHT_SHORT_GI_40MHZ, diff --git a/core/mac/src/pe/include/lim_session.h b/core/mac/src/pe/include/lim_session.h index 3f9cec2d56b1..c8fe42c4fb7b 100644 --- a/core/mac/src/pe/include/lim_session.h +++ b/core/mac/src/pe/include/lim_session.h @@ -374,7 +374,7 @@ typedef struct sPESession /* Added to Support BT-AMP */ #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM int8_t rssi; #endif - uint8_t isAmsduSupportInAMPDU; + uint8_t max_amsdu_num; uint8_t isCoalesingInIBSSAllowed; tSirHTConfig htConfig; diff --git a/core/mac/src/pe/lim/lim_assoc_utils.c b/core/mac/src/pe/lim/lim_assoc_utils.c index a38bcd5df4da..a555f3233dd4 100644 --- a/core/mac/src/pe/lim/lim_assoc_utils.c +++ b/core/mac/src/pe/lim/lim_assoc_utils.c @@ -2767,6 +2767,9 @@ lim_add_sta_self(tpAniSirGlobal pMac, uint16_t staIdx, uint8_t updateSta, pAddStaParams->maxAmsduSize = lim_get_ht_capability(pMac, eHT_MAX_AMSDU_LENGTH, psessionEntry); + pAddStaParams->max_amsdu_num = + lim_get_ht_capability(pMac, eHT_MAX_AMSDU_NUM, + psessionEntry); pAddStaParams->fDsssCckMode40Mhz = lim_get_ht_capability(pMac, eHT_DSSS_CCK_MODE_40MHZ, psessionEntry); diff --git a/core/mac/src/pe/lim/lim_process_mlm_host_roam.c b/core/mac/src/pe/lim/lim_process_mlm_host_roam.c index 34efc2bb1df0..3f5b8352ee98 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_host_roam.c +++ b/core/mac/src/pe/lim/lim_process_mlm_host_roam.c @@ -512,6 +512,9 @@ void lim_process_sta_mlm_add_bss_rsp_ft(tpAniSirGlobal pMac, pAddStaParams->maxAmsduSize = lim_get_ht_capability(pMac, eHT_MAX_AMSDU_LENGTH, psessionEntry); + pAddStaParams->max_amsdu_num = + lim_get_ht_capability(pMac, eHT_MAX_AMSDU_NUM, + psessionEntry); pAddStaParams->fDsssCckMode40Mhz = lim_get_ht_capability(pMac, eHT_DSSS_CCK_MODE_40MHZ, psessionEntry); diff --git a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c index f2576b819706..030e1fd7ffd8 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c @@ -409,6 +409,9 @@ static void mlm_add_sta(tpAniSirGlobal mac_ctx, tpAddStaParams sta_param, sta_param->maxAmsduSize = lim_get_ht_capability(mac_ctx, eHT_MAX_AMSDU_LENGTH, session_entry); + sta_param->max_amsdu_num = + lim_get_ht_capability(mac_ctx, eHT_MAX_AMSDU_NUM, + session_entry); sta_param->fDsssCckMode40Mhz = lim_get_ht_capability(mac_ctx, eHT_DSSS_CCK_MODE_40MHZ, session_entry); diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c index e5d6cd35f742..2ae9522ce0de 100644 --- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c @@ -1596,8 +1596,7 @@ __lim_process_sme_join_req(tpAniSirGlobal mac_ctx, uint32_t *msg_buf) pe_debug("SessionId:%d New session created", session_id); } - session->isAmsduSupportInAMPDU = - sme_join_req->isAmsduSupportInAMPDU; + session->max_amsdu_num = sme_join_req->max_amsdu_num; /* * Store Session related parameters diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index c62913e4bed2..2c9a435f3a59 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -2856,6 +2856,10 @@ uint8_t lim_get_ht_capability(tpAniSirGlobal pMac, retVal = (uint8_t) macHTCapabilityInfo.maximalAMSDUsize; break; + case eHT_MAX_AMSDU_NUM: + retVal = (uint8_t) psessionEntry->max_amsdu_num; + break; + case eHT_RX_STBC: retVal = (uint8_t) psessionEntry->htConfig.ht_rx_stbc; break; diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 039b440383c9..81a9f1b76ee6 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -1246,7 +1246,7 @@ typedef struct tagCsrConfigParam { uint8_t scanCfgAgingTime; uint8_t enable_tx_ldpc; uint8_t enable_rx_ldpc; - uint8_t isAmsduSupportInAMPDU; + uint8_t max_amsdu_num; uint8_t nSelect5GHzMargin; uint8_t isCoalesingInIBSSAllowed; #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index 5222c2c613ab..095f90d943bf 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -568,7 +568,7 @@ typedef struct tagCsrConfig { * Enable/Disable heartbeat offload */ bool enableHeartBeatOffload; - uint8_t isAmsduSupportInAMPDU; + uint8_t max_amsdu_num; uint8_t nSelect5GHzMargin; uint8_t isCoalesingInIBSSAllowed; #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index a1bc6ee49157..53efb0ba0ffc 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -2678,8 +2678,8 @@ QDF_STATUS csr_change_default_config_param(tpAniSirGlobal pMac, pMac->roam.configParam.rx_ldpc_enable = pParam->enable_rx_ldpc; pMac->roam.configParam.ignore_peer_erp_info = pParam->ignore_peer_erp_info; - pMac->roam.configParam.isAmsduSupportInAMPDU = - pParam->isAmsduSupportInAMPDU; + pMac->roam.configParam.max_amsdu_num = + pParam->max_amsdu_num; pMac->roam.configParam.nSelect5GHzMargin = pParam->nSelect5GHzMargin; pMac->roam.configParam.isCoalesingInIBSSAllowed = @@ -2932,7 +2932,7 @@ QDF_STATUS csr_get_config_param(tpAniSirGlobal pMac, tCsrConfigParam *pParam) #endif pParam->enable_tx_ldpc = cfg_params->tx_ldpc_enable; pParam->enable_rx_ldpc = cfg_params->rx_ldpc_enable; - pParam->isAmsduSupportInAMPDU = cfg_params->isAmsduSupportInAMPDU; + pParam->max_amsdu_num = cfg_params->max_amsdu_num; pParam->nSelect5GHzMargin = cfg_params->nSelect5GHzMargin; pParam->isCoalesingInIBSSAllowed = cfg_params->isCoalesingInIBSSAllowed; pParam->allowDFSChannelRoam = cfg_params->allowDFSChannelRoam; @@ -14661,8 +14661,8 @@ QDF_STATUS csr_send_join_req_msg(tpAniSirGlobal pMac, uint32_t sessionId, csr_join_req->send_smps_action = pMac->roam.configParam.send_smps_action; - csr_join_req->isAmsduSupportInAMPDU = - (uint8_t) pMac->roam.configParam.isAmsduSupportInAMPDU; + csr_join_req->max_amsdu_num = + (uint8_t) pMac->roam.configParam.max_amsdu_num; if (pMac->roam.roamSession[sessionId].fWMMConnection) csr_join_req->isWMEenabled = true; diff --git a/core/wma/inc/wma_if.h b/core/wma/inc/wma_if.h index 7c4a05696063..c47581509d61 100644 --- a/core/wma/inc/wma_if.h +++ b/core/wma/inc/wma_if.h @@ -229,6 +229,7 @@ typedef struct sAniProbeRspStruct { * @atimIePresent: Peer Atim Info * @peerAtimWindowLength: peer ATIM Window length * @nss: Return the number of spatial streams supported + * @max_amsdu_num: Maximum number of MSDUs in a tx aggregate frame * * This structure contains parameter required for * add sta request of upper layer. @@ -332,6 +333,7 @@ typedef struct { tDot11fIEvendor_he_cap he_config; tDot11fIEvendor_he_op he_op; #endif + uint8_t max_amsdu_num; } tAddStaParams, *tpAddStaParams; /** diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 25e061a02ec6..9c7f205e140a 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -992,19 +992,20 @@ static void wma_process_cli_set_cmd(tp_wma_handle wma, } break; case GEN_VDEV_PARAM_AMSDU: - if (soc) { - ret = cdp_aggr_cfg(soc, vdev, 0, - privcmd->param_value); - if (ret) - WMA_LOGE("cdp_aggr_cfg set amsdu failed ret %d", - ret); - else - intr[privcmd->param_vdev_id].config. - amsdu = privcmd->param_value; - } else { - WMA_LOGE("%s:SOC context is NULL", __func__); - return; - } + /* + * Firmware currently does not support set operation + * for AMSDU. It may cause crash if the configuration + * is sent to firmware. + * Firmware enhancement will advertise a service bit + * to enable AMSDU configuration through WMI. Then + * add the WMI command to configure AMSDU parameter. + * For the older chipset that does not advertise the + * service bit, enable the following legacy code: + * ol_txrx_aggr_cfg(vdev, 0, privcmd->param_value); + * intr[privcmd->param_vdev_id].config.amsdu = + * privcmd->param_value; + */ + WMA_LOGE("SET GEN_VDEV_PARAM_AMSDU command is currently not supported"); break; case GEN_PARAM_CRASH_INJECT: if (QDF_GLOBAL_FTM_MODE == cds_get_conparam())