diff options
| author | nakul kachhwaha <nkachhwa@codeaurora.org> | 2018-01-30 12:20:08 +0530 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-03-06 05:28:05 -0800 |
| commit | 585dab398f390d20f9c7ff8adebbc4a16cc81ab0 (patch) | |
| tree | 3659191c2044da0c074430180ce7f702980bf40a | |
| parent | 4dc9275c4677b73708cb169aadd53dbcfb54ac34 (diff) | |
qcacld-2.0: Support for DPD Runtime Re-Calibration
INI and WMA/WMI command implementation from host
side for DPD Recalibration at Runtime.
Change-Id: I1dfe1f87d270d1a8c4b355d88bf5255fd30ac992
CRs-Fixed: 2189930
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_cfg.h | 56 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg.c | 37 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_main.c | 25 | ||||
| -rw-r--r-- | CORE/MAC/inc/sirApi.h | 8 | ||||
| -rw-r--r-- | CORE/MAC/src/include/sirParams.h | 3 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.c | 112 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.h | 11 | ||||
| -rw-r--r-- | CORE/SME/inc/sme_Api.h | 16 | ||||
| -rw-r--r-- | CORE/SME/src/sme_common/sme_Api.c | 51 | ||||
| -rw-r--r-- | CORE/WDA/inc/wlan_qct_wda.h | 1 |
10 files changed, 317 insertions, 3 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h index 8265db1e5f2c..f9fb2c40839b 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg.h +++ b/CORE/HDD/inc/wlan_hdd_cfg.h @@ -2395,6 +2395,57 @@ typedef enum #endif /* FEATURE_WLAN_THERMAL_SHUTDOWN */ /* + * <ini> + * gDPDRecalibEnable - Enable/Disable Runtime DPD Recaliberation feature + * The parameter ‘enable’ in WMI is used to enable + * feature and debug log. Set bit0 to enable feature, + * set bit1 is to enable FW log to host, and set bit2 is + * to enable UART output. + * + * @Min: 0 + * @Max: 7 + * @Default: 1 + * + * This ini is used to enable/disable DPD Recaliberation feature + * + * Usage: Internal + * + * </ini> + */ + +#define CFG_DPD_RECALIB_ENABLE_NAME "gDPDRecalibEnable" +#define CFG_DPD_RECALIB_ENABLE_MIN ( 0 ) +#define CFG_DPD_RECALIB_ENABLE_MAX ( 7 ) +#define CFG_DPD_RECALIB_ENABLE_DEFAULT ( 1 ) + +/*Thermal thresholds: DPD will be triggered + when current temperature above this threshold */ + +/* Delta degree C above first DPD cal after chip is on. Unit: degree C. */ +#define CFG_DPD_RECALIB_DELTA_DEGREE_HIGH_NAME "gDPDRecalibDeltaDegreeHigh" +#define CFG_DPD_RECALIB_DELTA_DEGREE_HIGH_MIN ( 10 ) +#define CFG_DPD_RECALIB_DELTA_DEGREE_HIGH_MAX ( 60 ) +#define CFG_DPD_RECALIB_DELTA_DEGREE_HIGH_DEFAULT ( 35 ) + +/* Delta degree C above first DPD cal after chip is on. Unit: degree C. */ +#define CFG_DPD_RECALIB_DELTA_DEGREE_LOW_NAME "gDPDRecalibDeltaDegreeLow" +#define CFG_DPD_RECALIB_DELTA_DEGREE_LOW_MIN ( 10 ) +#define CFG_DPD_RECALIB_DELTA_DEGREE_LOW_MAX ( 60 ) +#define CFG_DPD_RECALIB_DELTA_DEGREE_LOW_DEFAULT ( 25 ) + +/* Cold down time between two DPD re-cal. Unit: ms*/ +#define CFG_DPD_RECALIB_COOLING_TIME_NAME "gDPDRecalibCoolingTime" +#define CFG_DPD_RECALIB_COOLING_TIME_MIN ( 0 ) +#define CFG_DPD_RECALIB_COOLING_TIME_MAX ( 5 ) +#define CFG_DPD_RECALIB_COOLING_TIME_DEFAULT ( 1 ) + +/* Max duration for dpd re-cal. Unit: ms */ +#define CFG_DPD_RECALIB_DURATION_MAX_NAME "gDPDRecalibDurationMax" +#define CFG_DPD_RECALIB_DURATION_MAX_MIN ( 30 ) +#define CFG_DPD_RECALIB_DURATION_MAX_MAX ( 180 ) +#define CFG_DPD_RECALIB_DURATION_MAX_DEFAULT ( 120 ) + +/* * Enable/Disable Modulated DTIM feature * Default: Disable */ @@ -5970,6 +6021,11 @@ struct hdd_config { uint32_t sap_ch_switch_with_csa; #endif//#ifdef WLAN_FEATURE_SAP_TO_FOLLOW_STA_CHAN + uint32_t dpd_recalib_enabled; + uint32_t dpd_recalib_delta_degreehigh; + uint32_t dpd_recalib_delta_degreelow; + uint32_t dpd_recalib_cooling_time; + uint32_t dpd_recalib_duration_max; }; typedef struct hdd_config hdd_config_t; diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c index e27bb047586d..3d3aae5ad367 100644 --- a/CORE/HDD/src/wlan_hdd_cfg.c +++ b/CORE/HDD/src/wlan_hdd_cfg.c @@ -3401,6 +3401,43 @@ REG_TABLE_ENTRY g_registry_table[] = CFG_THERMAL_SAMPLE_RATE_MAX), #endif /* FEATURE_WLAN_THERMAL_SHUTDOWN */ + /* Runtime DPD Recaliberation INI Parameters BEGINS */ + REG_VARIABLE( CFG_DPD_RECALIB_ENABLE_NAME, WLAN_PARAM_Integer, + hdd_config_t, dpd_recalib_enabled, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_DPD_RECALIB_ENABLE_DEFAULT, + CFG_DPD_RECALIB_ENABLE_MIN, + CFG_DPD_RECALIB_ENABLE_MAX), + + REG_VARIABLE( CFG_DPD_RECALIB_DELTA_DEGREE_HIGH_NAME, WLAN_PARAM_Integer, + hdd_config_t, dpd_recalib_delta_degreehigh, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_DPD_RECALIB_DELTA_DEGREE_HIGH_DEFAULT, + CFG_DPD_RECALIB_DELTA_DEGREE_HIGH_MIN, + CFG_DPD_RECALIB_DELTA_DEGREE_HIGH_MAX), + + REG_VARIABLE( CFG_DPD_RECALIB_DELTA_DEGREE_LOW_NAME, WLAN_PARAM_Integer, + hdd_config_t, dpd_recalib_delta_degreelow, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_DPD_RECALIB_DELTA_DEGREE_LOW_DEFAULT, + CFG_DPD_RECALIB_DELTA_DEGREE_LOW_MIN, + CFG_DPD_RECALIB_DELTA_DEGREE_LOW_MAX), + + REG_VARIABLE( CFG_DPD_RECALIB_COOLING_TIME_NAME, WLAN_PARAM_Integer, + hdd_config_t, dpd_recalib_cooling_time, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_DPD_RECALIB_COOLING_TIME_DEFAULT, + CFG_DPD_RECALIB_COOLING_TIME_MIN, + CFG_DPD_RECALIB_COOLING_TIME_MAX), + + REG_VARIABLE( CFG_DPD_RECALIB_DURATION_MAX_NAME, WLAN_PARAM_Integer, + hdd_config_t, dpd_recalib_duration_max, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_DPD_RECALIB_DURATION_MAX_DEFAULT, + CFG_DPD_RECALIB_DURATION_MAX_MIN, + CFG_DPD_RECALIB_DURATION_MAX_MAX), + /* DPD Runtime Recaliberation INI Parameters END */ + REG_VARIABLE( CFG_SET_TXPOWER_LIMIT2G_NAME , WLAN_PARAM_Integer, hdd_config_t, TxPower2g, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index 6eec97672bd7..fcabd53751d6 100644 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -16256,6 +16256,21 @@ static int hdd_initialize_mac_address(hdd_context_t *hdd_ctx) return 0; } +static void hdd_get_DPD_Recaliberation_ini_param(tSmeDPDRecalParams *pDPDParam, + hdd_context_t *pHddCtx) +{ + pDPDParam->enable = + pHddCtx->cfg_ini->dpd_recalib_enabled; + pDPDParam->delta_degreeHigh = + pHddCtx->cfg_ini->dpd_recalib_delta_degreehigh; + pDPDParam->delta_degreeLow = + pHddCtx->cfg_ini->dpd_recalib_delta_degreelow; + pDPDParam->cooling_time = + pHddCtx->cfg_ini->dpd_recalib_cooling_time; + pDPDParam->dpd_dur_max = + pHddCtx->cfg_ini->dpd_recalib_duration_max; +} + #ifdef FEATURE_WLAN_THERMAL_SHUTDOWN static VOS_STATUS hdd_init_thermal_ctx(hdd_context_t *pHddCtx) { @@ -16325,6 +16340,7 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) struct wiphy *wiphy; unsigned long rc; tSmeThermalParams thermalParam; + tSmeDPDRecalParams DPDParam; tSirTxPowerLimit *hddtxlimit; #ifdef FEATURE_WLAN_CH_AVOID #ifdef CONFIG_CNSS @@ -17292,6 +17308,15 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) "%s: Error while initializing thermal information", __func__); } + /* Runtime DPD Recaliberation config*/ + hdd_get_DPD_Recaliberation_ini_param(&DPDParam, pHddCtx); + + if (eHAL_STATUS_SUCCESS != sme_InitDPDRecalInfo(pHddCtx->hHal, DPDParam)) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + "%s: Error while initializing Runtime DPD Recaliberation information", __func__); + } + /* Plug in set thermal level callback */ sme_add_set_thermal_level_callback(pHddCtx->hHal, (tSmeSetThermalLevelCallback)hdd_set_thermal_level_cb); diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h index a0a7d53c3874..0e958d093f65 100644 --- a/CORE/MAC/inc/sirApi.h +++ b/CORE/MAC/inc/sirApi.h @@ -5320,6 +5320,14 @@ typedef struct{ } t_thermal_mgmt, *tp_thermal_mgmt; +typedef struct{ + u_int32_t dpd_enable; + u_int32_t dpd_delta_degreeHigh; + u_int32_t dpd_delta_degreeLow; + u_int32_t dpd_cooling_time; + u_int32_t dpd_duration_max; +} t_dpd_recal_mgmt, *tp_dpd_recal_mgmt; + typedef struct sSirTxPowerLimit { /* Thermal limits for 2g and 5g */ diff --git a/CORE/MAC/src/include/sirParams.h b/CORE/MAC/src/include/sirParams.h index 4bf2841f0242..fb06a65400a7 100644 --- a/CORE/MAC/src/include/sirParams.h +++ b/CORE/MAC/src/include/sirParams.h @@ -797,8 +797,9 @@ typedef struct sSirMbMsgP2p #define SIR_HAL_PEER_FLUSH_PENDING (SIR_HAL_ITC_MSG_TYPES_BEGIN + 375) #define SIR_HAL_SET_AC_TXQ_OPTIMIZE (SIR_HAL_ITC_MSG_TYPES_BEGIN + 376) - #define SIR_HAL_MNT_FILTER_TYPE_CMD (SIR_HAL_ITC_MSG_TYPES_BEGIN + 377) + +#define SIR_HAL_INIT_DPD_RECAL_INFO_CMD (SIR_HAL_ITC_MSG_TYPES_BEGIN + 378) #define SIR_HAL_MSG_TYPES_END (SIR_HAL_MSG_TYPES_BEGIN + 0x1FF) // CFG message types diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index 6660e04fa8bb..64e5f9ca7a8b 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -455,7 +455,8 @@ void wma_process_roam_synch_fail(WMA_HANDLE handle, static VOS_STATUS wma_set_thermal_mgmt(tp_wma_handle wma_handle, t_thermal_cmd_params thermal_info); - +static VOS_STATUS wma_set_dpd_recal_mgmt(tp_wma_handle wma_handle, + t_dpd_recal_cmd_params recal_info); #ifdef FEATURE_WLAN_CH_AVOID VOS_STATUS wma_process_ch_avoid_update_req(tp_wma_handle wma_handle, tSirChAvoidUpdateReq *ch_avoid_update_req); @@ -29181,6 +29182,57 @@ VOS_STATUS wma_process_init_thermal_info(tp_wma_handle wma, return VOS_STATUS_SUCCESS; } +/* function : wma_process_init_dpd_recal_info + * Description : This function initializes the dpd recaliberation in WMA, + sends down the initial high/low temperature limits to the firmware. + * Args : + wma : Pointer to WMA handle + * pDPDRecalParams: Pointer to DPD Recal parameters + * Returns : + * VOS_STATUS_SUCCESS for success otherwise failure + */ +VOS_STATUS wma_process_init_dpd_recal_info(tp_wma_handle wma, + t_dpd_recal_mgmt *pDPDRecalParams) +{ + t_dpd_recal_cmd_params dpd_recal_params; + + if (NULL == wma || NULL == pDPDRecalParams) { + WMA_LOGE("DPD Recal Invalid input"); + return VOS_STATUS_E_FAILURE; + } + + wma->dpd_recal_info.dpd_enable = pDPDRecalParams->dpd_enable; + wma->dpd_recal_info.dpd_delta_degreeHigh = pDPDRecalParams->dpd_delta_degreeHigh; + wma->dpd_recal_info.dpd_delta_degreeLow = pDPDRecalParams->dpd_delta_degreeLow; + wma->dpd_recal_info.dpd_cooling_time = pDPDRecalParams->dpd_cooling_time; + wma->dpd_recal_info.dpd_duration_max = pDPDRecalParams->dpd_duration_max; + if (wma->dpd_recal_info.dpd_enable) + { + /* Get the temperature thresholds to set in firmware */ + dpd_recal_params.enable = wma->dpd_recal_info.dpd_enable; + dpd_recal_params.delta_degreeHigh = wma->dpd_recal_info.dpd_delta_degreeHigh; + dpd_recal_params.delta_degreeLow = wma->dpd_recal_info.dpd_delta_degreeLow; + dpd_recal_params.cooling_time = wma->dpd_recal_info.dpd_cooling_time; + dpd_recal_params.dpd_dur_max = wma->dpd_recal_info.dpd_duration_max; + + WMA_LOGE("DPD Recal sending the following to firmware: delta_degreeLow %d " + "delta_degreehigh %d enable %d cooling_time %d " + "dpd_max_duration %d ", + dpd_recal_params.delta_degreeLow, + dpd_recal_params.delta_degreeHigh, + dpd_recal_params.enable, + dpd_recal_params.cooling_time, + dpd_recal_params.dpd_dur_max); + + if(VOS_STATUS_SUCCESS != wma_set_dpd_recal_mgmt(wma, dpd_recal_params)) + { + WMA_LOGE("Could not send thermal mgmt command to the firmware!"); + } + }else + WMA_LOGE("Runtime DPD Recaliberation not enable!"); + + return VOS_STATUS_SUCCESS; +} static void wma_set_thermal_level_ind(u_int8_t level) { @@ -34218,6 +34270,9 @@ VOS_STATUS wma_mc_process_msg(v_VOID_t *vos_context, vos_msg_t *msg) wma_process_init_thermal_info(wma_handle, (t_thermal_mgmt *)msg->bodyptr); vos_mem_free(msg->bodyptr); break; + case WDA_INIT_DPD_RECAL_INFO_CMD: + wma_process_init_dpd_recal_info(wma_handle, (t_dpd_recal_mgmt *)msg->bodyptr); + break; case WDA_SET_THERMAL_LEVEL: wma_process_set_thermal_level(wma_handle, msg->bodyval); @@ -35570,6 +35625,61 @@ static VOS_STATUS wma_set_thermal_mgmt(tp_wma_handle wma_handle, return eHAL_STATUS_SUCCESS; } +/* function : wma_set_dpd_recal_mgmt + * Description : This function sends the runtime DPD recaliberation params to the firmware + * Args : + wma_handle : Pointer to WMA handle + * dpd_recal_info : DPD recaliberation data + * Returns : + * VOS_STATUS_SUCCESS for success otherwise failure + */ +static VOS_STATUS wma_set_dpd_recal_mgmt(tp_wma_handle wma_handle, + t_dpd_recal_cmd_params recal_info) +{ + wmi_runtime_dpd_recal_cmd_fixed_param *cmd = NULL; + wmi_buf_t buf = NULL; + int status = 0; + u_int32_t len = 0; + + len = sizeof(*cmd); + + buf = wmi_buf_alloc(wma_handle->wmi_handle, len); + if (!buf) { + WMA_LOGE("Failed to allocate buffer to send set key cmd"); + return eHAL_STATUS_FAILURE; + } + + cmd = (wmi_runtime_dpd_recal_cmd_fixed_param *) wmi_buf_data (buf); + + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_runtime_dpd_recal_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN(wmi_runtime_dpd_recal_cmd_fixed_param)); + + cmd->enable = recal_info.enable; + cmd->dlt_tmpt_c_l = recal_info.delta_degreeLow; + cmd->dlt_tmpt_c_h = recal_info.delta_degreeHigh; + cmd->cooling_time_ms = recal_info.cooling_time; + cmd->dpd_dur_max_ms = recal_info.dpd_dur_max; + + WMA_LOGE("Sending DPD Recal cmd: low temp %d, high temp %d, enabled %d " + "cooling_time %d, dpd_dur_max %d", + cmd->dlt_tmpt_c_l, + cmd->dlt_tmpt_c_h, + cmd->enable,cmd->cooling_time_ms, + cmd->dpd_dur_max_ms); + + status = wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len, + WMI_RUNTIME_DPD_RECAL_CMDID); + if (status) { + wmi_buf_free(buf); + WMA_LOGE("%s:Failed to send dpd runtime recal command", __func__); + return eHAL_STATUS_FAILURE; + } + + return eHAL_STATUS_SUCCESS; +} + + /* function : wma_thermal_mgmt_get_level * Description : This function returns the thermal(throttle) level given the temperature * Args : diff --git a/CORE/SERVICES/WMA/wma.h b/CORE/SERVICES/WMA/wma.h index b5eb6d6466e3..2e1910df7756 100644 --- a/CORE/SERVICES/WMA/wma.h +++ b/CORE/SERVICES/WMA/wma.h @@ -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. * @@ -954,6 +954,7 @@ typedef struct wma_handle { tSirAddonPsReq psSetting; bool sub_20_support; bool get_one_peer_info; + t_dpd_recal_mgmt dpd_recal_info; }t_wma_handle, *tp_wma_handle; struct wma_target_cap { @@ -1412,6 +1413,14 @@ typedef struct { u_int8_t thermalEnable; } t_thermal_cmd_params, *tp_thermal_cmd_params; +typedef struct { + u_int8_t enable; + u_int32_t delta_degreeHigh; + u_int32_t delta_degreeLow; + u_int32_t cooling_time; //time in ms + u_int32_t dpd_dur_max; //time in ms +} t_dpd_recal_cmd_params, *tp_dpd_recal_cmd_params; + /* Powersave Related */ /* Default InActivity Time is 200 ms */ #define POWERSAVE_DEFAULT_INACTIVITY_TIME 200 diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h index 3383f348ebc5..530c9ff144e1 100644 --- a/CORE/SME/inc/sme_Api.h +++ b/CORE/SME/inc/sme_Api.h @@ -257,6 +257,14 @@ typedef struct { } tSmeThermalParams; +typedef struct { + u_int32_t enable; + u_int32_t delta_degreeHigh; + u_int32_t delta_degreeLow; + u_int32_t cooling_time; + u_int32_t dpd_dur_max; +} tSmeDPDRecalParams; + #ifdef WLAN_FEATURE_APFIND struct sme_ap_find_request_req{ u_int16_t request_data_len; @@ -3825,6 +3833,14 @@ eHalStatus sme_RoamCsaIeRequest(tHalHandle hHal, tCsrBssid bssid, eHalStatus sme_InitThermalInfo( tHalHandle hHal, tSmeThermalParams thermalParam ); /* --------------------------------------------------------------------------- \fn sme_InitThermalInfo + \brief SME API to initialize the thermal mitigation parameters + \param hHal + \param thermalParam : thermal mitigation parameters + \- return eHalStatus + -------------------------------------------------------------------------*/ +eHalStatus sme_InitDPDRecalInfo( tHalHandle hHal, tSmeDPDRecalParams thermalParam ); +/* --------------------------------------------------------------------------- + \fn sme_InitThermalInfo \brief SME API to set the thermal mitigation level \param hHal \param level : thermal mitigation level diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index 3912b33e259d..c5841a4d8a8d 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -15366,6 +15366,57 @@ eHalStatus sme_InitThermalInfo( tHalHandle hHal, return eHAL_STATUS_FAILURE; } +/* --------------------------------------------------------------------------- + \fn sme_InitDPDRecalInfo + \brief SME API to initialize the Runtime DPD Recaliberation parameters + \param hHal + \param DPDParam : DPD Recal parameters + \- return eHalStatus + -------------------------------------------------------------------------*/ +eHalStatus sme_InitDPDRecalInfo( tHalHandle hHal, + tSmeDPDRecalParams DPDParam ) +{ + t_dpd_recal_mgmt * pWdaParam; + vos_msg_t msg; + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + + pWdaParam = (t_dpd_recal_mgmt *)vos_mem_malloc(sizeof(t_dpd_recal_mgmt)); + if (NULL == pWdaParam) + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + "%s: could not allocate t_dpd_recal_mgmt", __func__); + return eHAL_STATUS_E_MALLOC_FAILED; + } + + vos_mem_zero((void*)pWdaParam, sizeof(t_dpd_recal_mgmt)); + pWdaParam->dpd_enable = DPDParam.enable; + pWdaParam->dpd_delta_degreeHigh = DPDParam.delta_degreeHigh; + pWdaParam->dpd_delta_degreeLow = DPDParam.delta_degreeLow; + pWdaParam->dpd_cooling_time = DPDParam.cooling_time; + pWdaParam->dpd_duration_max = DPDParam.dpd_dur_max; + + if (eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock(&pMac->sme)) + { + msg.type = WDA_INIT_DPD_RECAL_INFO_CMD; + msg.bodyptr = pWdaParam; + + if (!VOS_IS_STATUS_SUCCESS( + vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) + { + VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + "%s: Not able to post WDA_INIT_DPD_RECAL_INFO_CMD to WDA!", + __func__); + vos_mem_free(pWdaParam); + sme_ReleaseGlobalLock(&pMac->sme); + return eHAL_STATUS_FAILURE; + } + sme_ReleaseGlobalLock(&pMac->sme); + return eHAL_STATUS_SUCCESS; + } + vos_mem_free(pWdaParam); + return eHAL_STATUS_FAILURE; +} + /* * Plug in set thermal level callback */ diff --git a/CORE/WDA/inc/wlan_qct_wda.h b/CORE/WDA/inc/wlan_qct_wda.h index 8f016c57fc91..38914e161b37 100644 --- a/CORE/WDA/inc/wlan_qct_wda.h +++ b/CORE/WDA/inc/wlan_qct_wda.h @@ -924,6 +924,7 @@ tSirRetStatus uMacPostCtrlMsg(void* pSirGlobal, tSirMbMsg* pMb); #define WDA_RATE_UPDATE_IND SIR_HAL_RATE_UPDATE_IND #define WDA_INIT_THERMAL_INFO_CMD SIR_HAL_INIT_THERMAL_INFO_CMD +#define WDA_INIT_DPD_RECAL_INFO_CMD SIR_HAL_INIT_DPD_RECAL_INFO_CMD #define WDA_SET_THERMAL_LEVEL SIR_HAL_SET_THERMAL_LEVEL #define WDA_RMC_ENABLE_IND SIR_HAL_RMC_ENABLE_IND |
