From 9045e2e664cfe3b09de90c960c22c507e9512141 Mon Sep 17 00:00:00 2001 From: Manikandan Mohan Date: Mon, 26 Nov 2018 16:44:19 -0800 Subject: [PATCH] qcacld-3.0: Update for converged thermal throttle params Update qcacld driver to use converged CFG component for thermal mitigation throttle offload feature config params. Also cleanup hdd ini config based redundant entries. Change-Id: I9c94d1cd7bf9f630ed92ebe0f9f6d6233a216ee5 CRs-fixed: 2358492 --- .../core/inc/wlan_fw_offload_main.h | 28 +-- .../core/src/wlan_fw_offload_main.c | 28 ++- .../dispatcher/inc/cfg_thermal_temp.h | 205 ++++++++++++++++++ core/hdd/inc/wlan_hdd_cfg.h | 47 ---- core/hdd/src/wlan_hdd_cfg.c | 42 ---- core/hdd/src/wlan_hdd_main.c | 41 +--- core/sme/inc/sme_api.h | 14 +- core/sme/src/common/sme_api.c | 38 ++-- 8 files changed, 262 insertions(+), 181 deletions(-) diff --git a/components/fw_offload/core/inc/wlan_fw_offload_main.h b/components/fw_offload/core/inc/wlan_fw_offload_main.h index 5182a126aa3a8..07fb19fe99f64 100644 --- a/components/fw_offload/core/inc/wlan_fw_offload_main.h +++ b/components/fw_offload/core/inc/wlan_fw_offload_main.h @@ -63,26 +63,22 @@ struct wlan_fwol_coex_config { int16_t bt_interference_high_ul; }; +#define FWOL_THERMAL_LEVEL_MAX 4 +#define FWOL_THERMAL_THROTTLE_LEVEL_MAX 4 /* * struct wlan_fwol_thermal_temp - Thermal temperature config items - * @thermal_temp_min_level0: Thermal temperature minimum level 0 - * @thermal_temp_max_level0: Thermal temperature maximum level 0 - * @thermal_temp_min_level1: Thermal temperature minimum level 1 - * @thermal_temp_max_level1: Thermal temperature maximum level 1 - * @thermal_temp_min_level2: Thermal temperature minimum level 2 - * @thermal_temp_max_level2: Thermal temperature maximum level 2 - * @thermal_temp_min_level3: Thermal temperature minimum level 3 - * @thermal_temp_max_level3: Thermal temperature maximum level 3 + * @thermal_temp_min_level: Array of temperature minimum levels + * @thermal_temp_max_level: Array of temperature maximum levels + * @thermal_mitigation_enable: Control for Thermal mitigation feature + * @throttle_period: Thermal throttle period value + * @throttle_dutycycle_level: Array of throttle duty cycle levels */ struct wlan_fwol_thermal_temp { - uint16_t thermal_temp_min_level0; - uint16_t thermal_temp_max_level0; - uint16_t thermal_temp_min_level1; - uint16_t thermal_temp_max_level1; - uint16_t thermal_temp_min_level2; - uint16_t thermal_temp_max_level2; - uint16_t thermal_temp_min_level3; - uint16_t thermal_temp_max_level3; + bool thermal_mitigation_enable; + uint32_t throttle_period; + uint16_t thermal_temp_min_level[FWOL_THERMAL_LEVEL_MAX]; + uint16_t thermal_temp_max_level[FWOL_THERMAL_LEVEL_MAX]; + uint32_t throttle_dutycycle_level[FWOL_THERMAL_THROTTLE_LEVEL_MAX]; }; /** diff --git a/components/fw_offload/core/src/wlan_fw_offload_main.c b/components/fw_offload/core/src/wlan_fw_offload_main.c index f98463ea6f777..be177cf77c162 100644 --- a/components/fw_offload/core/src/wlan_fw_offload_main.c +++ b/components/fw_offload/core/src/wlan_fw_offload_main.c @@ -57,22 +57,34 @@ static void fwol_init_thermal_temp_in_cfg(struct wlan_objmgr_psoc *psoc, struct wlan_fwol_thermal_temp *thermal_temp) { - thermal_temp->thermal_temp_min_level0 = + thermal_temp->thermal_temp_min_level[0] = cfg_get(psoc, CFG_THERMAL_TEMP_MIN_LEVEL0); - thermal_temp->thermal_temp_max_level0 = + thermal_temp->thermal_temp_max_level[0] = cfg_get(psoc, CFG_THERMAL_TEMP_MAX_LEVEL0); - thermal_temp->thermal_temp_min_level1 = + thermal_temp->thermal_temp_min_level[1] = cfg_get(psoc, CFG_THERMAL_TEMP_MIN_LEVEL1); - thermal_temp->thermal_temp_max_level1 = + thermal_temp->thermal_temp_max_level[1] = cfg_get(psoc, CFG_THERMAL_TEMP_MAX_LEVEL1); - thermal_temp->thermal_temp_min_level2 = + thermal_temp->thermal_temp_min_level[2] = cfg_get(psoc, CFG_THERMAL_TEMP_MIN_LEVEL2); - thermal_temp->thermal_temp_max_level2 = + thermal_temp->thermal_temp_max_level[2] = cfg_get(psoc, CFG_THERMAL_TEMP_MAX_LEVEL2); - thermal_temp->thermal_temp_min_level3 = + thermal_temp->thermal_temp_min_level[3] = cfg_get(psoc, CFG_THERMAL_TEMP_MIN_LEVEL3); - thermal_temp->thermal_temp_max_level3 = + thermal_temp->thermal_temp_max_level[3] = cfg_get(psoc, CFG_THERMAL_TEMP_MAX_LEVEL3); + + thermal_temp->thermal_mitigation_enable = + cfg_get(psoc, CFG_THERMAL_MITIGATION_ENABLE); + thermal_temp->throttle_period = cfg_get(psoc, CFG_THROTTLE_PERIOD); + thermal_temp->throttle_dutycycle_level[0] = + cfg_get(psoc, CFG_THROTTLE_DUTY_CYCLE_LEVEL0); + thermal_temp->throttle_dutycycle_level[1]= + cfg_get(psoc, CFG_THROTTLE_DUTY_CYCLE_LEVEL1); + thermal_temp->throttle_dutycycle_level[2]= + cfg_get(psoc, CFG_THROTTLE_DUTY_CYCLE_LEVEL2); + thermal_temp->throttle_dutycycle_level[3]= + cfg_get(psoc, CFG_THROTTLE_DUTY_CYCLE_LEVEL3); } /** diff --git a/components/fw_offload/dispatcher/inc/cfg_thermal_temp.h b/components/fw_offload/dispatcher/inc/cfg_thermal_temp.h index 328546e4d99a1..54d84a02eb928 100644 --- a/components/fw_offload/dispatcher/inc/cfg_thermal_temp.h +++ b/components/fw_offload/dispatcher/inc/cfg_thermal_temp.h @@ -23,6 +23,17 @@ #ifndef __CFG_THERMAL_TEMP_H #define __CFG_THERMAL_TEMP_H +/* + * + * gThermalTempMinLevel0 - Set Thermal Temp Min Level0 + * @Min: 0 + * @Max: 1000 + * @Default: 0 + * + * Usage: External + * + * + */ #define CFG_THERMAL_TEMP_MIN_LEVEL0 CFG_INI_UINT( \ "gThermalTempMinLevel0", \ 0, \ @@ -31,6 +42,17 @@ CFG_VALUE_OR_DEFAULT, \ "Thermal Temp Min Level0") +/* + * + * gThermalTempMaxLevel0 - Set Thermal Temp Max Level0 + * @Min: 0 + * @Max: 1000 + * @Default: 90 + * + * Usage: External + * + * + */ #define CFG_THERMAL_TEMP_MAX_LEVEL0 CFG_INI_UINT( \ "gThermalTempMaxLevel0", \ 0, \ @@ -39,6 +61,17 @@ CFG_VALUE_OR_DEFAULT, \ "Thermal Temp Max Level0") +/* + * + * gThermalTempMinLevel1 - Set Thermal Temp Min Level1 + * @Min: 0 + * @Max: 1000 + * @Default: 70 + * + * Usage: External + * + * + */ #define CFG_THERMAL_TEMP_MIN_LEVEL1 CFG_INI_UINT( \ "gThermalTempMinLevel1", \ 0, \ @@ -47,6 +80,17 @@ CFG_VALUE_OR_DEFAULT, \ "Thermal Temp Min Level1") +/* + * + * gThermalTempMaxLevel1 - Set Thermal Temp Max Level1 + * @Min: 0 + * @Max: 1000 + * @Default: 110 + * + * Usage: External + * + * + */ #define CFG_THERMAL_TEMP_MAX_LEVEL1 CFG_INI_UINT( \ "gThermalTempMaxLevel1", \ 0, \ @@ -55,6 +99,17 @@ CFG_VALUE_OR_DEFAULT, \ "Thermal Temp Max Level1") +/* + * + * gThermalTempMinLevel2 - Set Thermal Temp Min Level2 + * @Min: 0 + * @Max: 1000 + * @Default: 90 + * + * Usage: External + * + * + */ #define CFG_THERMAL_TEMP_MIN_LEVEL2 CFG_INI_UINT( \ "gThermalTempMinLevel2", \ 0, \ @@ -63,6 +118,17 @@ CFG_VALUE_OR_DEFAULT, \ "Thermal Temp Min Level2") +/* + * + * gThermalTempMaxLevel2 - Set Thermal Temp Max Level2 + * @Min: 0 + * @Max: 1000 + * @Default: 125 + * + * Usage: External + * + * + */ #define CFG_THERMAL_TEMP_MAX_LEVEL2 CFG_INI_UINT( \ "gThermalTempMaxLevel2", \ 0, \ @@ -71,6 +137,17 @@ CFG_VALUE_OR_DEFAULT, \ "Thermal Temp Max Level2") +/* + * + * gThermalTempMinLevel3 - Set Thermal Temp Min Level3 + * @Min: 0 + * @Max: 1000 + * @Default: 110 + * + * Usage: External + * + * + */ #define CFG_THERMAL_TEMP_MIN_LEVEL3 CFG_INI_UINT( \ "gThermalTempMinLevel3", \ 0, \ @@ -79,6 +156,17 @@ CFG_VALUE_OR_DEFAULT, \ "Thermal Temp Min Level3") +/* + * + * gThermalTempMaxLevel3 - Set Thermal Temp Max Level3 + * @Min: 0 + * @Max: 1000 + * @Default: 0 + * + * Usage: External + * + * + */ #define CFG_THERMAL_TEMP_MAX_LEVEL3 CFG_INI_UINT( \ "gThermalTempMaxLevel3", \ 0, \ @@ -87,6 +175,117 @@ CFG_VALUE_OR_DEFAULT, \ "Thermal Temp Max Level3") +/* + * + * gThermalMitigationEnable - Set Thermal mitigation feature control + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * Usage: External + * + * + */ +#define CFG_THERMAL_MITIGATION_ENABLE CFG_INI_BOOL( \ + "gThermalMitigationEnable", \ + 0, \ + "Thermal mitigation feature control") + +/* + * + * gThrottlePeriod - Set Thermal mitigation throttle period + * @Min: 10 + * @Max: 10000 + * @Default: 4000 + * + * Usage: External + * + * + */ +#define CFG_THROTTLE_PERIOD CFG_INI_UINT( \ + "gThrottlePeriod", \ + 10, \ + 10000, \ + 4000, \ + CFG_VALUE_OR_DEFAULT, \ + "Thermal mitigation throttle period") + +/* + * + * gThrottleDutyCycleLevel0 - Set Thermal mitigation throttle duty cycle level0 + * @Min: 0 + * @Max: 0 + * @Default: 0 + * + * Usage: External + * + * + */ +#define CFG_THROTTLE_DUTY_CYCLE_LEVEL0 CFG_INI_UINT( \ + "gThrottleDutyCycleLevel0", \ + 0, \ + 0, \ + 0, \ + CFG_VALUE_OR_DEFAULT, \ + "Thermal mitigation throttle duty cycle level0") + +/* + * + * gThrottleDutyCycleLevel1 - Set Thermal mitigation throttle duty cycle level1 + * @Min: 0 + * @Max: 100 + * @Default: 50 + * + * Usage: External + * + * + */ +#define CFG_THROTTLE_DUTY_CYCLE_LEVEL1 CFG_INI_UINT( \ + "gThrottleDutyCycleLevel1", \ + 0, \ + 100, \ + 50, \ + CFG_VALUE_OR_DEFAULT, \ + "Thermal mitigation throttle duty cycle level1") + +/* + * + * gThrottleDutyCycleLevel2 - Set Thermal mitigation throttle duty cycle level2 + * @Min: 0 + * @Max: 100 + * @Default: 75 + * + * Usage: External + * + * + */ +#define CFG_THROTTLE_DUTY_CYCLE_LEVEL2 CFG_INI_UINT( \ + "gThrottleDutyCycleLevel2", \ + 0, \ + 100, \ + 75, \ + CFG_VALUE_OR_DEFAULT, \ + "Thermal mitigation throttle duty cycle level2") + +/* + * + * gThrottleDutyCycleLevel3 - Set Thermal mitigation throttle duty cycle level3 + * @Min: 0 + * @Max: 100 + * @Default: 94 + * + * Usage: External + * + * + */ +#define CFG_THROTTLE_DUTY_CYCLE_LEVEL3 CFG_INI_UINT( \ + "gThrottleDutyCycleLevel3", \ + 0, \ + 100, \ + 94, \ + CFG_VALUE_OR_DEFAULT, \ + "Thermal mitigation throttle duty cycle level3") + #define CFG_THERMAL_TEMP_ALL \ CFG(CFG_THERMAL_TEMP_MIN_LEVEL0) \ CFG(CFG_THERMAL_TEMP_MAX_LEVEL0) \ @@ -96,6 +295,12 @@ CFG(CFG_THERMAL_TEMP_MAX_LEVEL2) \ CFG(CFG_THERMAL_TEMP_MIN_LEVEL3) \ CFG(CFG_THERMAL_TEMP_MAX_LEVEL3) \ + CFG(CFG_THERMAL_MITIGATION_ENABLE) \ + CFG(CFG_THROTTLE_PERIOD) \ + CFG(CFG_THROTTLE_DUTY_CYCLE_LEVEL0) \ + CFG(CFG_THROTTLE_DUTY_CYCLE_LEVEL1) \ + CFG(CFG_THROTTLE_DUTY_CYCLE_LEVEL2) \ + CFG(CFG_THROTTLE_DUTY_CYCLE_LEVEL3) #endif diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 57c5be3305f2b..be7afd857ca5c 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -1933,47 +1933,6 @@ enum hdd_link_speed_rpt_type { #define CFG_BAD_PEER_TX_CTL_TX_LIMIT_LEVEL_IEEEAC_DEFAULT (3) #endif - -/* - * Enable/Disable Thermal Mitigation feature - * Default: Enable - */ -#define CFG_THERMAL_MIGRATION_ENABLE_NAME "gThermalMitigationEnable" -#define CFG_THERMAL_MIGRATION_ENABLE_MIN (0) -#define CFG_THERMAL_MIGRATION_ENABLE_MAX (1) -#define CFG_THERMAL_MIGRATION_ENABLE_DEFAULT (0) - -#define CFG_THROTTLE_PERIOD_NAME "gThrottlePeriod" -#define CFG_THROTTLE_PERIOD_MIN (10) -#define CFG_THROTTLE_PERIOD_MAX (10000) -#define CFG_THROTTLE_PERIOD_DEFAULT (4000) - -/* - * Configure Throttle Period Different Level Duty Cycle in percentage - * When temperature measured is greater than threshold at particular level, - * then throtling level will get increased by one level and - * will reduce TX duty by the given percentage - */ -#define CFG_THROTTLE_DUTY_CYCLE_LEVEL0_NAME "gThrottleDutyCycleLevel0" -#define CFG_THROTTLE_DUTY_CYCLE_LEVEL0_MIN (0) -#define CFG_THROTTLE_DUTY_CYCLE_LEVEL0_MAX (0) -#define CFG_THROTTLE_DUTY_CYCLE_LEVEL0_DEFAULT (0) - -#define CFG_THROTTLE_DUTY_CYCLE_LEVEL1_NAME "gThrottleDutyCycleLevel1" -#define CFG_THROTTLE_DUTY_CYCLE_LEVEL1_MIN (0) -#define CFG_THROTTLE_DUTY_CYCLE_LEVEL1_MAX (100) -#define CFG_THROTTLE_DUTY_CYCLE_LEVEL1_DEFAULT (50) - -#define CFG_THROTTLE_DUTY_CYCLE_LEVEL2_NAME "gThrottleDutyCycleLevel2" -#define CFG_THROTTLE_DUTY_CYCLE_LEVEL2_MIN (0) -#define CFG_THROTTLE_DUTY_CYCLE_LEVEL2_MAX (100) -#define CFG_THROTTLE_DUTY_CYCLE_LEVEL2_DEFAULT (75) - -#define CFG_THROTTLE_DUTY_CYCLE_LEVEL3_NAME "gThrottleDutyCycleLevel3" -#define CFG_THROTTLE_DUTY_CYCLE_LEVEL3_MIN (0) -#define CFG_THROTTLE_DUTY_CYCLE_LEVEL3_MAX (100) -#define CFG_THROTTLE_DUTY_CYCLE_LEVEL3_DEFAULT (94) - /* * * gMCAddrListEnable - Enable/Disable Multicast MAC Address List feature @@ -3631,12 +3590,6 @@ struct hdd_config { int32_t linkSpeedRssiHigh; int32_t linkSpeedRssiMid; int32_t linkSpeedRssiLow; - uint8_t thermalMitigationEnable; - uint32_t throttlePeriod; - uint32_t throttle_dutycycle_level0; - uint32_t throttle_dutycycle_level1; - uint32_t throttle_dutycycle_level2; - uint32_t throttle_dutycycle_level3; #if defined(CONFIG_HL_SUPPORT) && defined(QCA_BAD_PEER_TX_FLOW_CL) bool bad_peer_txctl_enable; uint32_t bad_peer_txctl_prd; diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index da1eb7f2538fb..fda7c18890e91 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -310,48 +310,6 @@ struct reg_table_entry g_registry_table[] = { CFG_LINK_SPEED_RSSI_LOW_MAX, NULL, 0), - REG_VARIABLE(CFG_THERMAL_MIGRATION_ENABLE_NAME, WLAN_PARAM_Integer, - struct hdd_config, thermalMitigationEnable, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_THERMAL_MIGRATION_ENABLE_DEFAULT, - CFG_THERMAL_MIGRATION_ENABLE_MIN, - CFG_THERMAL_MIGRATION_ENABLE_MAX), - - REG_VARIABLE(CFG_THROTTLE_PERIOD_NAME, WLAN_PARAM_Integer, - struct hdd_config, throttlePeriod, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_THROTTLE_PERIOD_DEFAULT, - CFG_THROTTLE_PERIOD_MIN, - CFG_THROTTLE_PERIOD_MAX), - - REG_VARIABLE(CFG_THROTTLE_DUTY_CYCLE_LEVEL0_NAME, WLAN_PARAM_Integer, - struct hdd_config, throttle_dutycycle_level0, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_THROTTLE_DUTY_CYCLE_LEVEL0_DEFAULT, - CFG_THROTTLE_DUTY_CYCLE_LEVEL0_MIN, - CFG_THROTTLE_DUTY_CYCLE_LEVEL0_MAX), - - REG_VARIABLE(CFG_THROTTLE_DUTY_CYCLE_LEVEL1_NAME, WLAN_PARAM_Integer, - struct hdd_config, throttle_dutycycle_level1, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_THROTTLE_DUTY_CYCLE_LEVEL1_DEFAULT, - CFG_THROTTLE_DUTY_CYCLE_LEVEL1_MIN, - CFG_THROTTLE_DUTY_CYCLE_LEVEL1_MAX), - - REG_VARIABLE(CFG_THROTTLE_DUTY_CYCLE_LEVEL2_NAME, WLAN_PARAM_Integer, - struct hdd_config, throttle_dutycycle_level2, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_THROTTLE_DUTY_CYCLE_LEVEL2_DEFAULT, - CFG_THROTTLE_DUTY_CYCLE_LEVEL2_MIN, - CFG_THROTTLE_DUTY_CYCLE_LEVEL2_MAX), - - REG_VARIABLE(CFG_THROTTLE_DUTY_CYCLE_LEVEL3_NAME, WLAN_PARAM_Integer, - struct hdd_config, throttle_dutycycle_level3, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_THROTTLE_DUTY_CYCLE_LEVEL3_DEFAULT, - CFG_THROTTLE_DUTY_CYCLE_LEVEL3_MIN, - CFG_THROTTLE_DUTY_CYCLE_LEVEL3_MAX), - REG_VARIABLE(CFG_ENABLE_FIRST_SCAN_2G_ONLY_NAME, WLAN_PARAM_Integer, struct hdd_config, enableFirstScan2GOnly, 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 4e37038dfbcf2..d087fc5a81179 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9944,47 +9944,10 @@ static int hdd_update_user_config(struct hdd_context *hdd_ctx) */ static int hdd_init_thermal_info(struct hdd_context *hdd_ctx) { - tSmeThermalParams thermal_param; QDF_STATUS status; - mac_handle_t mac_handle; - struct wlan_fwol_thermal_temp thermal_temp = {0}; + mac_handle_t mac_handle = hdd_ctx->mac_handle; - thermal_param.smeThermalMgmtEnabled = - hdd_ctx->config->thermalMitigationEnable; - thermal_param.smeThrottlePeriod = hdd_ctx->config->throttlePeriod; - - thermal_param.sme_throttle_duty_cycle_tbl[0] = - hdd_ctx->config->throttle_dutycycle_level0; - thermal_param.sme_throttle_duty_cycle_tbl[1] = - hdd_ctx->config->throttle_dutycycle_level1; - thermal_param.sme_throttle_duty_cycle_tbl[2] = - hdd_ctx->config->throttle_dutycycle_level2; - thermal_param.sme_throttle_duty_cycle_tbl[3] = - hdd_ctx->config->throttle_dutycycle_level3; - - status = ucfg_fwol_get_thermal_temp(hdd_ctx->psoc, &thermal_temp); - if (QDF_IS_STATUS_ERROR(status)) - return qdf_status_to_os_return(status); - - thermal_param.smeThermalLevels[0].smeMinTempThreshold = - thermal_temp.thermal_temp_min_level0; - thermal_param.smeThermalLevels[0].smeMaxTempThreshold = - thermal_temp.thermal_temp_max_level0; - thermal_param.smeThermalLevels[1].smeMinTempThreshold = - thermal_temp.thermal_temp_min_level1; - thermal_param.smeThermalLevels[1].smeMaxTempThreshold = - thermal_temp.thermal_temp_max_level1; - thermal_param.smeThermalLevels[2].smeMinTempThreshold = - thermal_temp.thermal_temp_min_level2; - thermal_param.smeThermalLevels[2].smeMaxTempThreshold = - thermal_temp.thermal_temp_max_level2; - thermal_param.smeThermalLevels[3].smeMinTempThreshold = - thermal_temp.thermal_temp_min_level3; - thermal_param.smeThermalLevels[3].smeMaxTempThreshold = - thermal_temp.thermal_temp_max_level3; - - mac_handle = hdd_ctx->mac_handle; - status = sme_init_thermal_info(mac_handle, thermal_param); + status = sme_init_thermal_info(mac_handle); if (!QDF_IS_STATUS_SUCCESS(status)) return qdf_status_to_os_return(status); diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 0e519fb1db46a..0567f13a08c28 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -188,17 +188,6 @@ typedef struct { uint16_t smeMaxTempThreshold; } tSmeThermalLevelInfo; -#define SME_MAX_THERMAL_LEVELS (4) -#define SME_MAX_THROTTLE_LEVELS (4) - -typedef struct { - /* Array of thermal levels */ - tSmeThermalLevelInfo smeThermalLevels[SME_MAX_THERMAL_LEVELS]; - uint8_t smeThermalMgmtEnabled; - uint32_t smeThrottlePeriod; - uint8_t sme_throttle_duty_cycle_tbl[SME_MAX_THROTTLE_LEVELS]; -} tSmeThermalParams; - typedef enum { SME_AC_BK = 0, SME_AC_BE = 1, @@ -1009,8 +998,7 @@ QDF_STATUS sme_roam_csa_ie_request(mac_handle_t mac_handle, int sme_set_addba_accept(mac_handle_t mac_handle, uint8_t session_id, int value); -QDF_STATUS sme_init_thermal_info(mac_handle_t mac_handle, - tSmeThermalParams thermalParam); +QDF_STATUS sme_init_thermal_info(mac_handle_t mac_handle); QDF_STATUS sme_set_thermal_level(mac_handle_t mac_handle, uint8_t level); QDF_STATUS sme_txpower_limit(mac_handle_t mac_handle, tSirTxPowerLimit *psmetx); diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 8b32930b806c3..b944e54417527 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -62,6 +62,7 @@ #include "wlan_mlme_public_struct.h" #include "wlan_mlme_main.h" #include "cfg_ucfg_api.h" +#include "wlan_fwol_ucfg_api.h" static tSelfRecoveryStats g_self_recovery_stats; @@ -10445,45 +10446,50 @@ QDF_STATUS sme_roam_csa_ie_request(mac_handle_t mac_handle, * thermalParam : thermal mitigation parameters * Return QDF_STATUS */ -QDF_STATUS sme_init_thermal_info(mac_handle_t mac_handle, tSmeThermalParams - thermalParam) +QDF_STATUS sme_init_thermal_info(mac_handle_t mac_handle) { t_thermal_mgmt *pWmaParam; struct scheduler_msg msg = {0}; struct mac_context *mac = MAC_CONTEXT(mac_handle); + struct wlan_fwol_thermal_temp thermal_temp = {0}; + QDF_STATUS status; pWmaParam = qdf_mem_malloc(sizeof(t_thermal_mgmt)); if (!pWmaParam) return QDF_STATUS_E_NOMEM; - pWmaParam->thermalMgmtEnabled = thermalParam.smeThermalMgmtEnabled; - pWmaParam->throttlePeriod = thermalParam.smeThrottlePeriod; + status = ucfg_fwol_get_thermal_temp(mac->psoc, &thermal_temp); + if (QDF_IS_STATUS_ERROR(status)) + return qdf_status_to_os_return(status); + + pWmaParam->thermalMgmtEnabled = thermal_temp.thermal_mitigation_enable; + pWmaParam->throttlePeriod = thermal_temp.throttle_period; pWmaParam->throttle_duty_cycle_tbl[0] = - thermalParam.sme_throttle_duty_cycle_tbl[0]; + thermal_temp.throttle_dutycycle_level[0]; pWmaParam->throttle_duty_cycle_tbl[1] = - thermalParam.sme_throttle_duty_cycle_tbl[1]; + thermal_temp.throttle_dutycycle_level[1]; pWmaParam->throttle_duty_cycle_tbl[2] = - thermalParam.sme_throttle_duty_cycle_tbl[2]; + thermal_temp.throttle_dutycycle_level[2]; pWmaParam->throttle_duty_cycle_tbl[3] = - thermalParam.sme_throttle_duty_cycle_tbl[3]; + thermal_temp.throttle_dutycycle_level[3]; pWmaParam->thermalLevels[0].minTempThreshold = - thermalParam.smeThermalLevels[0].smeMinTempThreshold; + thermal_temp.thermal_temp_min_level[0]; pWmaParam->thermalLevels[0].maxTempThreshold = - thermalParam.smeThermalLevels[0].smeMaxTempThreshold; + thermal_temp.thermal_temp_max_level[0]; pWmaParam->thermalLevels[1].minTempThreshold = - thermalParam.smeThermalLevels[1].smeMinTempThreshold; + thermal_temp.thermal_temp_min_level[1]; pWmaParam->thermalLevels[1].maxTempThreshold = - thermalParam.smeThermalLevels[1].smeMaxTempThreshold; + thermal_temp.thermal_temp_max_level[1]; pWmaParam->thermalLevels[2].minTempThreshold = - thermalParam.smeThermalLevels[2].smeMinTempThreshold; + thermal_temp.thermal_temp_min_level[2]; pWmaParam->thermalLevels[2].maxTempThreshold = - thermalParam.smeThermalLevels[2].smeMaxTempThreshold; + thermal_temp.thermal_temp_max_level[2]; pWmaParam->thermalLevels[3].minTempThreshold = - thermalParam.smeThermalLevels[3].smeMinTempThreshold; + thermal_temp.thermal_temp_min_level[3]; pWmaParam->thermalLevels[3].maxTempThreshold = - thermalParam.smeThermalLevels[3].smeMaxTempThreshold; + thermal_temp.thermal_temp_max_level[3]; if (QDF_STATUS_SUCCESS == sme_acquire_global_lock(&mac->sme)) { msg.type = WMA_INIT_THERMAL_INFO_CMD;