Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

Commit

Permalink
Merge a4c2a16 on remote branch
Browse files Browse the repository at this point in the history
Change-Id: I084065bce4fe2ca2e5cd94a0e4041326d6a0f7b8
  • Loading branch information
Linux Build Service Account committed Aug 27, 2019
2 parents bd16fbc + a4c2a16 commit 2568904
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
3 changes: 3 additions & 0 deletions wmi/inc/wmi_unified_param.h
Original file line number Diff line number Diff line change
Expand Up @@ -3964,12 +3964,14 @@ 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 {
uint32_t enable;
uint32_t dc;
uint32_t dc_per_event;
uint8_t num_thermal_conf;
tt_level_config levelconf[THERMAL_LEVELS];
};

Expand Down Expand Up @@ -5311,6 +5313,7 @@ typedef enum {
wmi_sar_get_limits_event_id,
wmi_roam_scan_stats_event_id,
wmi_wlan_sar2_result_event_id,
wmi_roam_pmkid_request_event_id,
wmi_events_max,
} wmi_conv_event_id;

Expand Down
77 changes: 77 additions & 0 deletions wmi/src/wmi_unified_tlv.c
Original file line number Diff line number Diff line change
Expand Up @@ -15110,6 +15110,77 @@ static QDF_STATUS send_btm_config_cmd_tlv(wmi_unified_t wmi_handle,
return QDF_STATUS_SUCCESS;
}

#ifdef FW_THERMAL_THROTTLE_SUPPORT
/**
* send_thermal_mitigation_param_cmd_tlv() - configure thermal mitigation params
* @wmi_handle: handle to WMI.
* @param: pointer to hold thermal mitigation param
*
* Return: QDF_STATUS_SUCCESS on success and appropriate error on failure.
*/
static QDF_STATUS send_thermal_mitigation_param_cmd_tlv(
wmi_unified_t wmi_handle,
struct thermal_mitigation_params *param)
{
wmi_therm_throt_config_request_fixed_param *tt_conf;
wmi_therm_throt_level_config_info *lvl_conf = NULL;
wmi_buf_t buf = NULL;
uint8_t *buf_ptr = NULL;
QDF_STATUS error;
size_t len;
int i;

len = sizeof(*tt_conf) + WMI_TLV_HDR_SIZE +
param->num_thermal_conf *
sizeof(wmi_therm_throt_level_config_info);

buf = wmi_buf_alloc(wmi_handle, len);
if (!buf)
return QDF_STATUS_E_NOMEM;

tt_conf = (wmi_therm_throt_config_request_fixed_param *)
wmi_buf_data(buf);

/* init fixed params */
WMITLV_SET_HDR(
tt_conf,
WMITLV_TAG_STRUC_wmi_therm_throt_config_request_fixed_param,
WMITLV_GET_STRUCT_TLVLEN(
wmi_therm_throt_config_request_fixed_param));

tt_conf->enable = param->enable;
tt_conf->dc = param->dc;
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,
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 < 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));
lvl_conf->dc_off_percent = param->levelconf[i].dcoffpercent;
lvl_conf++;
}

error = wmi_unified_cmd_send(wmi_handle, buf, len,
WMI_THERM_THROT_SET_CONF_CMDID);
if (QDF_IS_STATUS_ERROR(error)) {
wmi_buf_free(buf);
WMI_LOGE("Failed to send WMI_THERM_THROT_SET_CONF_CMDID cmd");
}

return error;
}
#endif

struct wmi_ops tlv_ops = {
.send_vdev_create_cmd = send_vdev_create_cmd_tlv,
.send_vdev_delete_cmd = send_vdev_delete_cmd_tlv,
Expand Down Expand Up @@ -15413,6 +15484,10 @@ struct wmi_ops tlv_ops = {
.send_offload_11k_cmd = send_offload_11k_cmd_tlv,
.send_invoke_neighbor_report_cmd = send_invoke_neighbor_report_cmd_tlv,
.send_btm_config = send_btm_config_cmd_tlv,
#ifdef FW_THERMAL_THROTTLE_SUPPORT
.send_thermal_mitigation_param_cmd =
send_thermal_mitigation_param_cmd_tlv,
#endif
};

#ifdef WMI_TLV_AND_NON_TLV_SUPPORT
Expand Down Expand Up @@ -15761,6 +15836,8 @@ static void populate_tlv_events_id(uint32_t *event_ids)
event_ids[wmi_sar_get_limits_event_id] = WMI_SAR_GET_LIMITS_EVENTID;
event_ids[wmi_roam_scan_stats_event_id] = WMI_ROAM_SCAN_STATS_EVENTID;
event_ids[wmi_wlan_sar2_result_event_id] = WMI_SAR2_RESULT_EVENTID;
event_ids[wmi_roam_pmkid_request_event_id] =
WMI_ROAM_PMKID_REQUEST_EVENTID;
}

/**
Expand Down

0 comments on commit 2568904

Please sign in to comment.