diff options
| author | Padma, Santhosh Kumar <skpadma@qti.qualcomm.com> | 2016-03-16 13:01:08 +0530 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2016-03-24 13:35:27 +0530 |
| commit | fd53b653b2281eefe27485dcf830e332940f9318 (patch) | |
| tree | bae85b95b1b59c6e812eb665927581c274da04ea | |
| parent | 802d0b04c914a063cfc067179feb1779c38f5576 (diff) | |
qcacld-2.0: Set Tx/Rx aggregation size
Add changes to set Tx/Rx aggregation size. Also, add ini parameters
for Tx/Rx aggregation sizes.
Change-Id: Ia5811bf7cf7081989fde5c8cdcca84b42120b90c
CRs-Fixed: 990161
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_cfg.h | 20 | ||||
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_cfg80211.h | 6 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg.c | 18 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg80211.c | 29 | ||||
| -rw-r--r-- | CORE/MAC/inc/sirApi.h | 14 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c | 2 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.c | 77 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.h | 3 | ||||
| -rw-r--r-- | CORE/SME/inc/csrApi.h | 2 | ||||
| -rw-r--r-- | CORE/SME/inc/csrInternal.h | 2 | ||||
| -rw-r--r-- | CORE/SME/src/csr/csrApiRoam.c | 6 | ||||
| -rw-r--r-- | CORE/WDA/inc/legacy/halMsgApi.h | 2 |
12 files changed, 181 insertions, 0 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h index b085f29c0fe2..bdbc04f47d73 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg.h +++ b/CORE/HDD/inc/wlan_hdd_cfg.h @@ -3439,6 +3439,24 @@ enum dot11p_mode { #define CFG_SELF_GEN_FRM_PWR_DEFAULT (0) /* + * gTxAggregationSize gives an option to configure Tx aggregation size + * in no of MPDUs. This can be useful in debugging throughput issues + */ +#define CFG_TX_AGGREGATION_SIZE "gTxAggregationSize" +#define CFG_TX_AGGREGATION_SIZE_MIN (0) +#define CFG_TX_AGGREGATION_SIZE_MAX (64) +#define CFG_TX_AGGREGATION_SIZE_DEFAULT (64) + +/* + * gRxAggregationSize gives an option to configure Rx aggregation size + * in no of MPDUs. This can be useful in debugging throughput issues + */ +#define CFG_RX_AGGREGATION_SIZE "gRxAggregationSize" +#define CFG_RX_AGGREGATION_SIZE_MIN (1) +#define CFG_RX_AGGREGATION_SIZE_MAX (64) +#define CFG_RX_AGGREGATION_SIZE_DEFAULT (64) + +/* * fine timing measurement capability information * * <----- fine_time_meas_cap (in bits) -----> @@ -4436,6 +4454,8 @@ struct hdd_config { #endif bool goptimize_chan_avoid_event; bool g_use_otpmac; + uint32_t tx_aggregation_size; + uint32_t rx_aggregation_size; }; typedef struct hdd_config hdd_config_t; diff --git a/CORE/HDD/inc/wlan_hdd_cfg80211.h b/CORE/HDD/inc/wlan_hdd_cfg80211.h index ff89ac4e5cff..f3c2655d7921 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg80211.h +++ b/CORE/HDD/inc/wlan_hdd_cfg80211.h @@ -1545,6 +1545,10 @@ enum qca_wlan_vendor_acs_hw_mode { * @QCA_WLAN_VENDOR_ATTR_CONFIG_STATS_AVG_FACTOR: stats avg. factor * @QCA_WLAN_VENDOR_ATTR_CONFIG_GUARD_TIME: guard time * @QCA_WLAN_VENDOR_ATTR_CONFIG_TX_RATE: configure max tx rate + * @QCA_WLAN_VENDOR_ATTR_CONFIG_TX_MPDU_AGGREGATION: + * Tx aggregation size (8-bit unsigned value) + * @QCA_WLAN_VENDOR_ATTR_CONFIG_RX_MPDU_AGGREGATION: + * Rx aggregation size (8-bit unsigned value) * @QCA_WLAN_VENDOR_ATTR_CONFIG_LAST: last config * @QCA_WLAN_VENDOR_ATTR_CONFIG_MAX: max config */ @@ -1557,6 +1561,8 @@ enum qca_wlan_vendor_config { QCA_WLAN_VENDOR_ATTR_CONFIG_TX_RATE, QCA_WLAN_VENDOR_ATTR_CONFIG_PENALIZE_AFTER_NCONS_BEACON_MISS, QCA_WLAN_VENDOR_ATTR_CONFIG_CHANNEL_AVOIDANCE_IND, + QCA_WLAN_VENDOR_ATTR_CONFIG_TX_MPDU_AGGREGATION, + QCA_WLAN_VENDOR_ATTR_CONFIG_RX_MPDU_AGGREGATION, /* keep last */ QCA_WLAN_VENDOR_ATTR_CONFIG_LAST, QCA_WLAN_VENDOR_ATTR_CONFIG_MAX = diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c index d6a2c7ff1bdb..9a5ded4d4f7a 100644 --- a/CORE/HDD/src/wlan_hdd_cfg.c +++ b/CORE/HDD/src/wlan_hdd_cfg.c @@ -4430,6 +4430,20 @@ REG_TABLE_ENTRY g_registry_table[] = CFG_USE_OTP_MAC_DEFAULT, CFG_USE_OTP_MAC_MIN, CFG_USE_OTP_MAC_MAX), + + REG_VARIABLE(CFG_TX_AGGREGATION_SIZE, WLAN_PARAM_Integer, + hdd_config_t, tx_aggregation_size, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_TX_AGGREGATION_SIZE_DEFAULT, + CFG_TX_AGGREGATION_SIZE_MIN, + CFG_TX_AGGREGATION_SIZE_MAX), + + REG_VARIABLE(CFG_RX_AGGREGATION_SIZE, WLAN_PARAM_Integer, + hdd_config_t, rx_aggregation_size, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_RX_AGGREGATION_SIZE_DEFAULT, + CFG_RX_AGGREGATION_SIZE_MIN, + CFG_RX_AGGREGATION_SIZE_MAX), }; @@ -7084,6 +7098,10 @@ VOS_STATUS hdd_set_sme_config( hdd_context_t *pHddCtx ) pConfig->enable_fatal_event; smeConfig->csrConfig.sendDeauthBeforeCon = pConfig->sendDeauthBeforeCon; smeConfig->csrConfig.ignorePeerErpInfo = pConfig->ignorePeerErpInfo; + smeConfig->csrConfig.tx_aggregation_size = + pHddCtx->cfg_ini->tx_aggregation_size; + smeConfig->csrConfig.rx_aggregation_size = + pHddCtx->cfg_ini->rx_aggregation_size; halStatus = sme_UpdateConfig( pHddCtx->hHal, smeConfig); if ( !HAL_STATUS_SUCCESS( halStatus ) ) { diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index dee53af9b395..812ee12468c3 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -8291,6 +8291,8 @@ wlan_hdd_wifi_config_policy[QCA_WLAN_VENDOR_ATTR_CONFIG_MAX [QCA_WLAN_VENDOR_ATTR_CONFIG_GUARD_TIME] = {.type = NLA_U32 }, [QCA_WLAN_VENDOR_ATTR_CONFIG_TX_RATE] = {.type = NLA_U16 }, [QCA_WLAN_VENDOR_ATTR_CONFIG_CHANNEL_AVOIDANCE_IND] = {.type = NLA_U8 }, + [QCA_WLAN_VENDOR_ATTR_CONFIG_TX_MPDU_AGGREGATION] = {.type = NLA_U8 }, + [QCA_WLAN_VENDOR_ATTR_CONFIG_RX_MPDU_AGGREGATION] = {.type = NLA_U8 }, }; /** @@ -8378,6 +8380,8 @@ static int __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, u32 guard_time; u32 ftm_capab; eHalStatus status; + struct sir_set_tx_rx_aggregation_size request; + VOS_STATUS vos_status; if (VOS_FTM_MODE == hdd_get_conparam()) { hddLog(LOGE, FL("Command not allowed in FTM mode")); @@ -8459,6 +8463,31 @@ static int __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, hddLog(LOG1, "set_value: %d", set_value); ret_val = hdd_enable_disable_ca_event(pHddCtx, set_value); } + + if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_TX_MPDU_AGGREGATION] || + tb[QCA_WLAN_VENDOR_ATTR_CONFIG_RX_MPDU_AGGREGATION]) { + /* if one is specified, both must be specified */ + if (!tb[QCA_WLAN_VENDOR_ATTR_CONFIG_TX_MPDU_AGGREGATION] || + !tb[QCA_WLAN_VENDOR_ATTR_CONFIG_RX_MPDU_AGGREGATION]) { + hddLog(LOGE, + FL("Both TX and RX MPDU Aggregation required")); + return -EINVAL; + } + + request.tx_aggregation_size = nla_get_u8( + tb[QCA_WLAN_VENDOR_ATTR_CONFIG_TX_MPDU_AGGREGATION]); + request.rx_aggregation_size = nla_get_u8( + tb[QCA_WLAN_VENDOR_ATTR_CONFIG_RX_MPDU_AGGREGATION]); + request.vdev_id = pAdapter->sessionId; + + vos_status = wma_set_tx_rx_aggregation_size(&request); + if (vos_status != VOS_STATUS_SUCCESS) { + hddLog(LOGE, + FL("failed to set aggregation sizes(err=%d)"), + vos_status); + ret_val = -EPERM; + } + } return ret_val; } diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h index c99198e82e56..512cee29cd4b 100644 --- a/CORE/MAC/inc/sirApi.h +++ b/CORE/MAC/inc/sirApi.h @@ -3476,6 +3476,8 @@ typedef struct sSirSmeAddStaSelfReq tANI_U16 pkt_err_disconn_th; uint8_t nss_2g; uint8_t nss_5g; + uint32_t tx_aggregation_size; + uint32_t rx_aggregation_size; }tSirSmeAddStaSelfReq, *tpSirSmeAddStaSelfReq; typedef struct sSirSmeDelStaSelfReq @@ -7303,4 +7305,16 @@ struct sme_ndp_peer_ind { #endif /* WLAN_FEATURE_NAN_DATAPATH */ +/** + * struct sir_set_tx_rx_aggregation_size - sets tx rx aggregation size + * @vdev_id: vdev id of the session + * @tx_aggregation_size: Tx aggregation size + * @rx_aggregation_size: Rx aggregation size + */ +struct sir_set_tx_rx_aggregation_size { + uint8_t vdev_id; + uint32_t tx_aggregation_size; + uint32_t rx_aggregation_size; +}; + #endif /* __SIR_API_H */ diff --git a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c index 70bf4630475d..fa3c12059f18 100644 --- a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c +++ b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c @@ -5350,6 +5350,8 @@ __limProcessSmeAddStaSelfReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) pAddStaSelfParams->pkt_err_disconn_th = pSmeReq->pkt_err_disconn_th; pAddStaSelfParams->nss_2g = pSmeReq->nss_2g; pAddStaSelfParams->nss_5g = pSmeReq->nss_5g; + pAddStaSelfParams->tx_aggregation_size = pSmeReq->tx_aggregation_size; + pAddStaSelfParams->rx_aggregation_size = pSmeReq->rx_aggregation_size; msg.type = SIR_HAL_ADD_STA_SELF_REQ; msg.reserved = 0; diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index 7cc616d5c95c..38da35975c04 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -8218,6 +8218,7 @@ static ol_txrx_vdev_handle wma_vdev_attach(tp_wma_handle wma_handle, int ret; tSirMacHTCapabilityInfo *phtCapInfo; u_int8_t vdev_id; + struct sir_set_tx_rx_aggregation_size tx_rx_aggregation_size; if (NULL == mac) { WMA_LOGE("%s: Failed to get mac",__func__); @@ -8295,6 +8296,17 @@ static ol_txrx_vdev_handle wma_vdev_attach(tp_wma_handle wma_handle, vos_mem_copy(wma_handle->interfaces[self_sta_req->sessionId].addr, self_sta_req->selfMacAddr, sizeof(wma_handle->interfaces[self_sta_req->sessionId].addr)); + + tx_rx_aggregation_size.tx_aggregation_size = + self_sta_req->tx_aggregation_size; + tx_rx_aggregation_size.rx_aggregation_size = + self_sta_req->rx_aggregation_size; + tx_rx_aggregation_size.vdev_id = self_sta_req->sessionId; + + status = wma_set_tx_rx_aggregation_size(&tx_rx_aggregation_size); + if (status != VOS_STATUS_SUCCESS) + WMA_LOGE("failed to set aggregation sizes(err=%d)", status); + switch (self_sta_req->type) { case WMI_VDEV_TYPE_STA: if(wlan_cfgGetInt(mac, WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD, @@ -28914,6 +28926,71 @@ VOS_STATUS wma_enable_disable_caevent_ind(tp_wma_handle wma, return VOS_STATUS_SUCCESS; } +/** + * wma_set_tx_rx_aggregation_size() - sets tx rx aggregation sizes + * @tx_rx_aggregation_size: aggregation size parameters + * + * This function sets tx rx aggregation sizes + * + * Return: VOS_STATUS_SUCCESS on success, error number otherwise + */ +VOS_STATUS wma_set_tx_rx_aggregation_size + (struct sir_set_tx_rx_aggregation_size *tx_rx_aggregation_size) +{ + tp_wma_handle wma_handle; + wmi_vdev_set_custom_aggr_size_cmd_fixed_param *cmd; + int32_t len; + wmi_buf_t buf; + u_int8_t *buf_ptr; + int ret; + + wma_handle = vos_get_context(VOS_MODULE_ID_WDA, + vos_get_global_context(VOS_MODULE_ID_WDA, NULL)); + + if (!tx_rx_aggregation_size) { + WMA_LOGE("%s: invalid pointer", __func__); + return VOS_STATUS_E_INVAL; + } + + if (!wma_handle) { + WMA_LOGE("%s: WMA context is invald!", __func__); + return VOS_STATUS_E_INVAL; + } + + len = sizeof(*cmd); + buf = wmi_buf_alloc(wma_handle->wmi_handle, len); + + if (!buf) { + WMA_LOGE("%s: Failed allocate wmi buffer", __func__); + return VOS_STATUS_E_NOMEM; + } + + buf_ptr = (u_int8_t *) wmi_buf_data(buf); + cmd = (wmi_vdev_set_custom_aggr_size_cmd_fixed_param *) buf_ptr; + + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_vdev_set_custom_aggr_size_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN(wmi_vdev_set_custom_aggr_size_cmd_fixed_param)); + + cmd->vdev_id = tx_rx_aggregation_size->vdev_id; + cmd->tx_aggr_size = tx_rx_aggregation_size->tx_aggregation_size; + cmd->rx_aggr_size = tx_rx_aggregation_size->rx_aggregation_size; + + WMA_LOGI("tx aggr: %d rx aggr: %d vdev: %d", + cmd->tx_aggr_size, cmd->rx_aggr_size, cmd->vdev_id); + + ret = wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len, + WMI_VDEV_SET_CUSTOM_AGGR_SIZE_CMDID); + if (ret) { + WMA_LOGE("%s: Failed to send aggregation size command", + __func__); + wmi_buf_free(buf); + return VOS_STATUS_E_FAILURE; + } + + return VOS_STATUS_SUCCESS; +} + /* * function : wma_mc_process_msg * Description : diff --git a/CORE/SERVICES/WMA/wma.h b/CORE/SERVICES/WMA/wma.h index 3330de06eb25..017ce29aade9 100644 --- a/CORE/SERVICES/WMA/wma.h +++ b/CORE/SERVICES/WMA/wma.h @@ -1720,6 +1720,9 @@ int wma_crash_inject(tp_wma_handle wma_handle, uint32_t type, uint32_t wma_get_vht_ch_width(void); VOS_STATUS wma_get_wakelock_stats(struct sir_wake_lock_stats *wake_lock_stats); +VOS_STATUS wma_set_tx_rx_aggregation_size + (struct sir_set_tx_rx_aggregation_size *tx_rx_aggregation_size); + /** * wma_find_vdev_by_id() - Find vdev handle for given vdev id. * @wma: WMA handle diff --git a/CORE/SME/inc/csrApi.h b/CORE/SME/inc/csrApi.h index 5c5dd9dc777b..f24238abaa8d 100644 --- a/CORE/SME/inc/csrApi.h +++ b/CORE/SME/inc/csrApi.h @@ -1318,6 +1318,8 @@ typedef struct tagCsrConfigParam v_U16_t pkt_err_disconn_th; int8_t first_scan_bucket_threshold; bool enable_fatal_event; + uint32_t tx_aggregation_size; + uint32_t rx_aggregation_size; }tCsrConfigParam; //Tush diff --git a/CORE/SME/inc/csrInternal.h b/CORE/SME/inc/csrInternal.h index dd248846f107..229dfba2bde1 100644 --- a/CORE/SME/inc/csrInternal.h +++ b/CORE/SME/inc/csrInternal.h @@ -711,6 +711,8 @@ typedef struct tagCsrConfig bool ignore_peer_ht_opmode; v_U16_t pkt_err_disconn_th; bool enable_fatal_event; + uint32_t tx_aggregation_size; + uint32_t rx_aggregation_size; }tCsrConfig; typedef struct tagCsrChannelPowerInfo diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c index eae6643af784..8d9f26f22d53 100644 --- a/CORE/SME/src/csr/csrApiRoam.c +++ b/CORE/SME/src/csr/csrApiRoam.c @@ -2036,6 +2036,10 @@ eHalStatus csrChangeDefaultConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pPa pParam->sendDeauthBeforeCon; pMac->roam.configParam.enable_fatal_event = pParam->enable_fatal_event; + pMac->roam.configParam.tx_aggregation_size = + pParam->tx_aggregation_size; + pMac->roam.configParam.rx_aggregation_size = + pParam->rx_aggregation_size; } return status; @@ -15470,6 +15474,8 @@ eHalStatus csrSendMBAddSelfStaReqMsg( tpAniSirGlobal pMac, pMsg->pkt_err_disconn_th = pMac->roam.configParam.pkt_err_disconn_th; pMsg->nss_2g = nss_2g; pMsg->nss_5g = nss_5g; + pMsg->tx_aggregation_size = pMac->roam.configParam.tx_aggregation_size; + pMsg->rx_aggregation_size = pMac->roam.configParam.rx_aggregation_size; smsLog( pMac, LOG1, FL("selfMac="MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pMsg->selfMacAddr)); status = palSendMBMessage(pMac->hHdd, pMsg); diff --git a/CORE/WDA/inc/legacy/halMsgApi.h b/CORE/WDA/inc/legacy/halMsgApi.h index 89ccfd6b0828..ad3e66726674 100644 --- a/CORE/WDA/inc/legacy/halMsgApi.h +++ b/CORE/WDA/inc/legacy/halMsgApi.h @@ -1436,6 +1436,8 @@ typedef struct sAddStaSelfParams tANI_U16 pkt_err_disconn_th; uint8_t nss_2g; uint8_t nss_5g; + uint32_t tx_aggregation_size; + uint32_t rx_aggregation_size; }tAddStaSelfParams, *tpAddStaSelfParams; /** |
