diff options
| author | Yun Park <yunp@qca.qualcomm.com> | 2015-05-20 08:53:28 -0700 |
|---|---|---|
| committer | AnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com> | 2015-05-21 16:14:31 +0530 |
| commit | d2b18c6e65476241d32e9a962febbb879cfda3c8 (patch) | |
| tree | 692e4b444cfed7e0246f85384c28658e95583cc7 | |
| parent | c23f77a935e4a804f079db44469eee0326f4b0df (diff) | |
qcacld: IPA uC: Change IPA data path to SW path for Thermal throttling
This change is to switch data path to SW path when TM level is > 0, to
control Tx flow using thermal mitigation duty cycle
And restore the original data path whenever TM level == 0.
Change-Id: I087b68bb874d9b436903975238f8d2745f8e68ea
CRs-Fixed: 838655
| -rwxr-xr-x | CORE/HDD/src/wlan_hdd_main.c | 20 | ||||
| -rw-r--r-- | CORE/MAC/inc/wniApi.h | 1 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.c | 22 | ||||
| -rw-r--r-- | CORE/SME/inc/smeInternal.h | 1 | ||||
| -rw-r--r-- | CORE/SME/inc/sme_Api.h | 4 | ||||
| -rw-r--r-- | CORE/SME/src/sme_common/sme_Api.c | 20 |
6 files changed, 66 insertions, 2 deletions
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index 2d890cdac1ed..c85a18c842d7 100755 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -1352,6 +1352,22 @@ hdd_checkandupdate_dfssetting(hdd_adapter_t *pAdapter, char *country_code) } +#ifdef IPA_UC_STA_OFFLOAD +static void hdd_set_thermal_level_cb(hdd_context_t *pHddCtx, u_int8_t level) +{ + /* Change IPA to SW path when throttle level greater than 0 */ + if (level > THROTTLE_LEVEL_0) + hdd_ipa_send_mcc_scc_msg(pHddCtx, TRUE); + else + /* restore original concurrency mode */ + hdd_ipa_send_mcc_scc_msg(pHddCtx, pHddCtx->mcc_mode); +} +#else +static void hdd_set_thermal_level_cb(hdd_context_t *pHddCtx, u_int8_t level) +{ +} +#endif + /**--------------------------------------------------------------------------- \brief hdd_setIbssPowerSaveParams - update IBSS Power Save params to WMA. @@ -12069,6 +12085,10 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) "%s: Error while initializing thermal information", __func__); } + /* Plug in set thermal level callback */ + sme_add_set_thermal_level_callback(pHddCtx->hHal, + (tSmeSetThermalLevelCallback)hdd_set_thermal_level_cb); + /* SAR power limit */ hddtxlimit = vos_mem_malloc(sizeof(tSirTxPowerLimit)); if (!hddtxlimit) diff --git a/CORE/MAC/inc/wniApi.h b/CORE/MAC/inc/wniApi.h index 89896b527d73..ac9d3e6fa365 100644 --- a/CORE/MAC/inc/wniApi.h +++ b/CORE/MAC/inc/wniApi.h @@ -384,6 +384,7 @@ enum eWniMsgTypes eWNI_SME_EPNO_NETWORK_FOUND_IND, #endif eWNI_SME_FW_STATUS_IND, + eWNI_SME_SET_THERMAL_LEVEL_IND, eWNI_SME_OCB_SET_CONFIG_RSP, eWNI_SME_OCB_GET_TSF_TIMER_RSP, diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index d8983bd64fc3..d7a1433694ea 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -22023,6 +22023,22 @@ VOS_STATUS wma_process_init_thermal_info(tp_wma_handle wma, } +static void wma_set_thermal_level_ind(u_int8_t level) +{ + VOS_STATUS vos_status = VOS_STATUS_SUCCESS; + vos_msg_t sme_msg = {0}; + + WMA_LOGI(FL("Thermal level: %d"), level); + + sme_msg.type = eWNI_SME_SET_THERMAL_LEVEL_IND; + sme_msg.bodyptr = NULL; + sme_msg.bodyval = level; + + vos_status = vos_mq_post_message(VOS_MODULE_ID_SME, &sme_msg); + if (!VOS_IS_STATUS_SUCCESS(vos_status)) + WMA_LOGE(FL("Fail to post set temperaturml level ind msg")); +} + /* function : wma_process_set_thermal_level * Description : This function set the new thermal throttle level in the txrx module and sends down the corresponding temperature @@ -22076,6 +22092,9 @@ VOS_STATUS wma_process_set_thermal_level(tp_wma_handle wma, ol_tx_throttle_set_level(curr_pdev, thermal_level); + /* Send SME SET_THERMAL_LEVEL_IND message */ + wma_set_thermal_level_ind(thermal_level); + return VOS_STATUS_SUCCESS; } @@ -26419,6 +26438,9 @@ static int wma_thermal_mgmt_evt_handler(void *handle, u_int8_t *event, /* Inform txrx */ ol_tx_throttle_set_level(curr_pdev, thermal_level); + /* Send SME SET_THERMAL_LEVEL_IND message */ + wma_set_thermal_level_ind(thermal_level); + /* Get the temperature thresholds to set in firmware */ thermal_params.minTemp = wma->thermal_mgmt_info.thermalLevels[thermal_level].minTempThreshold; diff --git a/CORE/SME/inc/smeInternal.h b/CORE/SME/inc/smeInternal.h index 110bfdd8b91a..41648e885bdb 100644 --- a/CORE/SME/inc/smeInternal.h +++ b/CORE/SME/inc/smeInternal.h @@ -207,6 +207,7 @@ typedef struct tagSmeStruct #ifdef WLAN_FEATURE_MEMDUMP void (*fw_dump_callback)(void *context, struct fw_dump_rsp *rsp); #endif + void (*set_thermal_level_cb)(void *hdd_context, uint8_t level); } tSmeStruct, *tpSmeStruct; diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h index 733580fb399e..a261e309c78b 100644 --- a/CORE/SME/inc/sme_Api.h +++ b/CORE/SME/inc/sme_Api.h @@ -4308,4 +4308,8 @@ eHalStatus sme_update_nss(tHalHandle h_hal, uint8_t nss); uint8_t sme_is_any_session_in_connected_state(tHalHandle h_hal); +typedef void ( *tSmeSetThermalLevelCallback)(void *pContext, u_int8_t level); +void sme_add_set_thermal_level_callback(tHalHandle hHal, + tSmeSetThermalLevelCallback callback); + #endif //#if !defined( __SME_API_H ) diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index 047bd7d533c6..792925cf491c 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -2850,7 +2850,6 @@ eHalStatus sme_ProcessMsg(tHalHandle hHal, vos_msg_t* pMsg) vos_mem_free(pMsg->bodyptr); break; #endif - case eWNI_SME_DFS_RADAR_FOUND: case eWNI_SME_DFS_CSAIE_TX_COMPLETE_IND: { @@ -3053,6 +3052,12 @@ eHalStatus sme_ProcessMsg(tHalHandle hHal, vos_msg_t* pMsg) case eWNI_SME_FW_DUMP_IND: sme_process_fw_mem_dump_rsp(pMac, pMsg); break; + case eWNI_SME_SET_THERMAL_LEVEL_IND: + if (pMac->sme.set_thermal_level_cb) + { + pMac->sme.set_thermal_level_cb(pMac->hHdd, pMsg->bodyval); + } + break; default: if ( ( pMsg->type >= eWNI_SME_MSG_TYPES_BEGIN ) @@ -13904,8 +13909,19 @@ eHalStatus sme_InitThermalInfo( tHalHandle hHal, return eHAL_STATUS_FAILURE; } +/* + * Plug in set thermal level callback + */ +void sme_add_set_thermal_level_callback(tHalHandle hHal, + tSmeSetThermalLevelCallback callback) +{ + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + + pMac->sme.set_thermal_level_cb = callback; +} + /* --------------------------------------------------------------------------- - \fn sme_InitThermalInfo + \fn sme_SetThermalLevel \brief SME API to set the thermal mitigation level \param hHal \param level : thermal mitigation level |
