Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 540002f8 authored by Utkarsh Bhatnagar's avatar Utkarsh Bhatnagar Committed by Madan Koyyalamudi
Browse files

qcacmn: Add support for Thermal Stats Events

Add support for extracting Thermal Stats Events
from thermal event TLV for FW event
WMI_THERM_THROT_STATS_EVENTID.
Also, added support for FW Cmd to request for
Thermal Stats: WMI_REQUEST_THERMAL_STATS_CMDID

Change-Id: I2bc80d082bda45e2255371bcb0c31d35d9806525
CRs-Fixed: 3016845
parent ce92e8c7
Loading
Loading
Loading
Loading
+25 −1
Original line number Diff line number Diff line
/* Copyright (c) 2020, The Linux Foundation. All rights reserved.
/* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
@@ -33,4 +33,28 @@ enum thermal_throttle_level {
	 THERMAL_UNKNOWN,
};

enum thermal_stats_request_type {
	thermal_stats_none = 0,
	thermal_stats_init,
	thermal_stats_req,
	thermal_stats_clear,
	thermal_stats_current_all_sensors_temp,
};

/**
 * thermal_throt_level_stats - thermal throttle info from Target
 * @start_temp_level: Start temperature range to capture thermal stats
 * @end_temp_level: End temperature range to capture thermal stats
 * @total_time_ms_lo: Start time for every thermal stats level in msec
 * @total_time_ms_hi: End time for every thermal stats level in msec
 * @num_entry: Thermal stats counter for every time temp level for this range
 */
struct thermal_throt_level_stats {
	uint32_t start_temp_level;
	uint32_t end_temp_level;
	uint32_t total_time_ms_lo;
	uint32_t total_time_ms_hi;
	uint32_t num_entry;
};

#endif /* _WLAN_THERMAL_PUBLIC_STRUCT_H_ */
+5 −0
Original line number Diff line number Diff line
@@ -2967,6 +2967,9 @@ wmi_extract_chan_stats(wmi_unified_t wmi_handle, void *evt_buf,
 * @evt_buf: Pointer to event buffer
 * @temp: Pointer to hold extracted temperature
 * @level: Pointer to hold extracted level in host enum
 * @therm_throt_levels: Pointer to hold extracted number of level in thermal
 *                      stats
 * @tt_lvl_stats_event: Pointer to hold extracted thermal stats for each level
 * @pdev_id: Pointer to hold extracted pdev_id
 *
 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
@@ -2974,6 +2977,8 @@ wmi_extract_chan_stats(wmi_unified_t wmi_handle, void *evt_buf,
QDF_STATUS wmi_extract_thermal_stats(wmi_unified_t wmi_handle, void *evt_buf,
				     uint32_t *temp,
				     enum thermal_throttle_level *level,
				     uint32_t *therm_throt_levels,
				     struct thermal_throt_level_stats *tt_stats,
				     uint32_t *pdev_id);

/**
+17 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
@@ -87,4 +87,20 @@ wmi_unified_send_dscp_tip_map_cmd(struct wmi_unified *wmi_handle,
}
#endif /* WLAN_SEND_DSCP_UP_MAP_TO_FW */

/**
 * wmi_unified_send_get_thermal_stats_cmd() - Send WMI get thermal stats req
 * @wmi_handle: wmi handle
 * @req_type: Request type
 * @temp_offset: temperature offset for setting the range for thermal stats

 * Send WMI get thermal stats req command to firmware.
 *
 * Return: QDF_STATUS
 */
#ifdef THERMAL_STATS_SUPPORT
QDF_STATUS
wmi_unified_send_get_thermal_stats_cmd(struct wmi_unified *wmi_handle,
				       enum thermal_stats_request_type req_type,
				       uint8_t temp_offset);
#endif /* THERMAL_STATS_SUPPORT */
#endif /* _WMI_UNIFIED_FWOL_API_H_ */
+3 −0
Original line number Diff line number Diff line
@@ -5257,6 +5257,9 @@ typedef enum {
#ifdef FEATURE_WLAN_TDLS
	wmi_service_tdls_ax_support,
#endif
#endif
#ifdef THERMAL_STATS_SUPPORT
	wmi_service_thermal_stats_temp_range_supported,
#endif
	wmi_services_max,
} wmi_conv_service_ids;
+10 −1
Original line number Diff line number Diff line
@@ -1796,7 +1796,10 @@ QDF_STATUS (*extract_mib_stats)(wmi_unified_t wmi_handle, void *evt_buf,
#endif

QDF_STATUS (*extract_thermal_stats)(wmi_unified_t wmi_handle, void *evt_buf,
	uint32_t *temp, enum thermal_throttle_level *level, uint32_t *pdev_id);
	    uint32_t *temp, enum thermal_throttle_level *level,
	    uint32_t *therm_throt_levels,
	    struct thermal_throt_level_stats *tt_temp_range_stats_event,
	    uint32_t *pdev_id);

QDF_STATUS (*extract_thermal_level_stats)(wmi_unified_t wmi_handle,
		void *evt_buf, uint8_t idx, uint32_t *levelcount,
@@ -2416,6 +2419,12 @@ QDF_STATUS (*send_dscp_tid_map_cmd)(wmi_unified_t wmi_handle,
				     uint32_t *dscp_to_tid_map);
#endif

#ifdef THERMAL_STATS_SUPPORT
QDF_STATUS (*send_get_thermal_stats_cmd)(wmi_unified_t wmi_handle,
					 enum thermal_stats_request_type req,
					 uint8_t temp_offset);
#endif /* THERMAL_STATS_SUPPORT */

QDF_STATUS (*send_pdev_get_pn_cmd)(wmi_unified_t wmi_handle,
				   struct peer_request_pn_param *pn_params);
QDF_STATUS (*extract_get_pn_data)(wmi_unified_t wmi_handle,
Loading