summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKumar Anand <kumaranand@google.com>2020-01-07 22:12:23 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-01-07 22:12:23 +0000
commitc97ac315ebec1d73520ef8b9c78bb7e79e8f1677 (patch)
tree0bec7b9a616031689c6d58da2e29a8e306c83a81
parent05ac8776ea0ab8871c9e2497d0608462390f8117 (diff)
parent3f3fa98701a6ccec0f0676a8d131a760fbe796e9 (diff)
downloadlibhardware_legacy-c97ac315ebec1d73520ef8b9c78bb7e79e8f1677.tar.gz
Merge "Wifi: Vendor Hal Thermal Mitigation API"
-rw-r--r--include/hardware_legacy/wifi_hal.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/include/hardware_legacy/wifi_hal.h b/include/hardware_legacy/wifi_hal.h
index fc78852..c99a915 100644
--- a/include/hardware_legacy/wifi_hal.h
+++ b/include/hardware_legacy/wifi_hal.h
@@ -55,6 +55,16 @@ typedef enum {
WIFI_LATENCY_MODE_LOW = 1,
} wifi_latency_mode;
+/* Wifi Thermal mitigation levels */
+typedef enum {
+ WIFI_MITIGATION_NONE = 0,
+ WIFI_MITIGATION_LIGHT = 1,
+ WIFI_MITIGATION_MODERATE = 2,
+ WIFI_MITIGATION_SEVERE = 3,
+ WIFI_MITIGATION_CRITICAL = 4,
+ WIFI_MITIGATION_EMERGENCY = 5,
+} wifi_thermal_mode;
+
/*
* enum wlan_mac_band - Band information corresponding to the WLAN MAC.
*/
@@ -229,6 +239,38 @@ wifi_error wifi_select_tx_power_scenario(wifi_interface_handle handle, wifi_powe
wifi_error wifi_reset_tx_power_scenario(wifi_interface_handle handle);
wifi_error wifi_set_latency_mode(wifi_interface_handle handle, wifi_latency_mode mode);
+/**
+ * Wifi HAL Thermal Mitigation API
+ *
+ * wifi_interface_handle : WLAN Interface (e.g. wlan0 or wlan1) that should be
+ * throttled. If the interface handle is null, then the throttling should be
+ * applied to all the concurrent active interfaces (e.g. wlan0 + wlan1).
+ * Note: The implementation and the action mapping to each mode is chip
+ * specific. Mitigation will be active until Wifi is turned off or
+ * WIFI_MITIGATION_NONE mode is sent
+ *
+ * mode: Thermal mitigation mode
+ * WIFI_MITIGATION_NONE : Clear all Wifi thermal mitigation actions
+ * WIFI_MITIGATION_LIGHT : Light Throttling where UX is not impacted
+ * WIFI_MITIGATION_MODERATE : Moderate throttling where UX not largely impacted
+ * WIFI_MITIGATION_SEVERE : Severe throttling where UX is largely impacted
+ * WIFI_MITIGATION_CRITICAL : Platform has done everything to reduce power
+ * WIFI_MITIGATION_EMERGENCY: Key components in platform are shutting down
+ *
+ * completion_window
+ * Deadline (in milliseconds) to complete this request, value 0 implies apply
+ * immediately.
+ *
+ * Return
+ * WIFI_ERROR_NOT_SUPPORTED : Chip does not support thermal mitigation
+ * WIFI_ERROR_BUSY : Mitigation is supported, but retry later
+ * WIFI_ERROR_NONE : Mitigation has been applied successfully
+ */
+wifi_error wifi_set_thermal_mitigation_mode(wifi_interface_handle handle,
+ wifi_thermal_mode mode,
+ u32 completion_window);
+
+
typedef struct rx_data_cnt_details_t {
int rx_unicast_cnt; /*Total rx unicast packet which woke up host */
int rx_multicast_cnt; /*Total rx multicast packet which woke up host */
@@ -480,6 +522,10 @@ typedef struct {
iface, wifi_radio_mode_change_handler eh);
wifi_error (*wifi_set_latency_mode)(wifi_interface_handle iface,
wifi_latency_mode mode);
+ wifi_error (*wifi_set_thermal_mitigation_mode)(wifi_interface_handle handle,
+ wifi_thermal_mode mode,
+ u32 completion_window);
+
} wifi_hal_fn;
wifi_error init_wifi_vendor_hal_func_table(wifi_hal_fn *fn);
#ifdef __cplusplus