xref: /wlan-driver/qca-wifi-host-cmn/umac/thermal/dispatcher/inc/wlan_thermal_public_struct.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
2  * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 /**
18  * DOC: declare the thermal public structure
19  */
20 #ifndef _WLAN_THERMAL_PUBLIC_STRUCT_H_
21 #define _WLAN_THERMAL_PUBLIC_STRUCT_H_
22 
23 /**
24  * enum thermal_throttle_level - firmware offload throttle level
25  * @THERMAL_FULLPERF: no any throttling
26  * @THERMAL_MITIGATION: throttling tx to do mitigation
27  * @THERMAL_SHUTOFF: shut off the tx completely
28  * @THERMAL_SHUTDOWN_TARGET: target will be shutdown entirely
29  * @THERMAL_UNKNOWN: unknown level from target.
30  */
31 enum thermal_throttle_level {
32 	 THERMAL_FULLPERF,
33 	 THERMAL_MITIGATION,
34 	 THERMAL_SHUTOFF,
35 	 THERMAL_SHUTDOWN_TARGET,
36 	 THERMAL_UNKNOWN,
37 };
38 
39 enum thermal_stats_request_type {
40 	thermal_stats_none = 0,
41 	thermal_stats_init,
42 	thermal_stats_req,
43 	thermal_stats_clear,
44 	thermal_stats_current_all_sensors_temp,
45 };
46 
47 /**
48  * struct thermal_throt_level_stats - thermal throttle info from Target
49  * @start_temp_level: Start temperature range to capture thermal stats
50  * @end_temp_level: End temperature range to capture thermal stats
51  * @total_time_ms_lo: Start time for every thermal stats level in msec
52  * @total_time_ms_hi: End time for every thermal stats level in msec
53  * @num_entry: Thermal stats counter for every time temp level for this range
54  */
55 struct thermal_throt_level_stats {
56 	uint32_t start_temp_level;
57 	uint32_t end_temp_level;
58 	uint32_t total_time_ms_lo;
59 	uint32_t total_time_ms_hi;
60 	uint32_t num_entry;
61 };
62 
63 #endif /* _WLAN_THERMAL_PUBLIC_STRUCT_H_ */
64