wifi(interface): Add wifi host debug wake up reason stats
These stats are used to determine if the device is being woken up
frequently by the wlan chipset. The stats structure describe all the
various resons for which the host was woken up by the wlan chipset
(firmware).
Bug: 32221997
Test: ./hardware/interfaces/update-makefiles.sh
Change-Id: Id52915348fef0283affcd834c6f1db5055e54ace
diff --git a/wifi/1.0/IWifiChip.hal b/wifi/1.0/IWifiChip.hal
index 487a5ae..3c085c3 100644
--- a/wifi/1.0/IWifiChip.hal
+++ b/wifi/1.0/IWifiChip.hal
@@ -159,6 +159,10 @@
* This mostly contains firmware event logs.
*/
DEBUG_RING_BUFFER_VENDOR_DATA_SUPPORTED = 1 << 5,
+ /**
+ * Host wake reasons stats collection.
+ */
+ DEBUG_HOST_WAKE_REASON_STATS = 1 << 6,
};
/**
@@ -558,4 +562,22 @@
* |WifiStatusCode.UNKNOWN|
*/
forceDumpToDebugRingBuffer(string ringName) generates (WifiStatus status);
+
+ /**
+ * API to retrieve the wifi wake up reason stats for debugging.
+ * The driver is expected to start maintaining these stats once the chip
+ * is configured using |configureChip|. These stats must be reset whenever
+ * the chip is reconfigured or the HAL is stopped.
+ *
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
+ * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
+ * |WifiStatusCode.NOT_AVAILABLE|,
+ * |WifiStatusCode.UNKNOWN|
+ * @return stats Instance of |WifiDebugHostWakeReasonStats|.
+ */
+ getDebugHostWakeReasonStats()
+ generates (WifiStatus status, WifiDebugHostWakeReasonStats stats);
};