diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index 24de579fc0..c105bb331b 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -2865,6 +2865,7 @@ typedef struct { * @enable: Enable/Disable Thermal mitigation * @dc: DC * @dc_per_event: DC per event + * @num_thermal_conf: Number of thermal configurations to be sent * @tt_level_config: TT level config params */ struct thermal_mitigation_params { @@ -2872,6 +2873,7 @@ struct thermal_mitigation_params { uint32_t enable; uint32_t dc; uint32_t dc_per_event; + uint8_t num_thermal_conf; tt_level_config levelconf[THERMAL_LEVELS]; }; diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 0babe37c46..ba6316f1a9 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -6562,7 +6562,8 @@ static QDF_STATUS send_thermal_mitigation_param_cmd_tlv( int i; len = sizeof(*tt_conf) + WMI_TLV_HDR_SIZE + - THERMAL_LEVELS * sizeof(wmi_therm_throt_level_config_info); + param->num_thermal_conf * + sizeof(wmi_therm_throt_level_config_info); buf = wmi_buf_alloc(wmi_handle, len); if (!buf) @@ -6581,15 +6582,16 @@ static QDF_STATUS send_thermal_mitigation_param_cmd_tlv( tt_conf->enable = param->enable; tt_conf->dc = param->dc; tt_conf->dc_per_event = param->dc_per_event; - tt_conf->therm_throt_levels = THERMAL_LEVELS; + tt_conf->therm_throt_levels = param->num_thermal_conf; buf_ptr = (uint8_t *) ++tt_conf; /* init TLV params */ WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, - (THERMAL_LEVELS * sizeof(wmi_therm_throt_level_config_info))); + (param->num_thermal_conf * + sizeof(wmi_therm_throt_level_config_info))); lvl_conf = (wmi_therm_throt_level_config_info *) (buf_ptr + WMI_TLV_HDR_SIZE); - for (i = 0; i < THERMAL_LEVELS; i++) { + for (i = 0; i < param->num_thermal_conf; i++) { WMITLV_SET_HDR(&lvl_conf->tlv_header, WMITLV_TAG_STRUC_wmi_therm_throt_level_config_info, WMITLV_GET_STRUCT_TLVLEN(wmi_therm_throt_level_config_info));