Ver Fonte

qcacmn: Add support for WLAN thermal mitigation

As part of new requirement WLAN subsystem needs to perform thermal
mitigation action as per the thermal state of the device. The
wifi hal sends vendor command QCA_NL80211_VENDOR_SUBCMD_THERMAL_CMD
with the thermal level parameter and wlan host performs the required
appropriate action. wlan host driver maps the thermal level to
corresponding duty cycle off percent value and duty cycle value,
send WMI_THERM_THROT_SET_CONF_CMDID cmd to FW.

Make changes to perform vendor command handling, mapping thermal level
to duty cycle value and communicating the thermal information to FW.

Change-Id: I5b455ae6483f3d5bf2fe708f40c32a55eb8b9bdb
CRs-Fixed: 2610404
Pankaj Singh há 5 anos atrás
pai
commit
a973835c45
2 ficheiros alterados com 8 adições e 4 exclusões
  1. 2 0
      wmi/inc/wmi_unified_param.h
  2. 6 4
      wmi/src/wmi_unified_tlv.c

+ 2 - 0
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];
 };
 

+ 6 - 4
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));