wifi(interface): Add wifi debug ring buffer related interface
The debug ring buffers is a purely debug mechanism to let the driver
report debug info like connection events, power events, etc to the
framework.
The framework used to previously dump out the raw byte stream in
the bugreport and the vendors had some tools to parse out the data.
This is now being changed to provide the framework with the
internal ring buffer structs to ease parsing this data in framework
itself. This will eventually be used in the new wifilogd daemon.
Bug: 32221997
Test: ./hardware/interfaces/update-makefiles.sh
Change-Id: I2c90662cfa9d07ae6fc72198a286338dbaacbfc2
diff --git a/wifi/1.0/IWifiChipEventCallback.hal b/wifi/1.0/IWifiChipEventCallback.hal
index 177d42e..292b10f 100644
--- a/wifi/1.0/IWifiChipEventCallback.hal
+++ b/wifi/1.0/IWifiChipEventCallback.hal
@@ -27,4 +27,47 @@
* property of the target ChipMode.
*/
oneway onChipReconfigured(ChipModeId modeId);
+
+ /**
+ * Callbacks for reporting debug ring buffer data.
+ *
+ * The ring buffer data collection is event based:
+ * - Driver calls this callback when new records are available, the
+ * |WifiDebugRingBufferStatus| passed up to framework in the callback
+ * indicates to framework if more data is available in the ring buffer.
+ * It is not expected that driver will necessarily always empty the ring
+ * immediately as data is available, instead driver will report data
+ * every X seconds or if N bytes are available based on the parameters
+ * set via |startLoggingToDebugRingBuffer|.
+ * - In the case where a bug report has to be captured, framework will
+ * require driver to upload all data immediately. This is indicated to
+ * driver when framework calls |forceDumpToDebugRingBuffer|. The driver
+ * will start sending all available data in the indicated ring by repeatedly
+ * invoking this callback.
+ *
+ * @return status Status of the corresponding ring buffer. This should
+ * contain the name of the ring buffer on which the data is
+ * available.
+ * @return entries Vector of debug ring buffer data entries. These
+ * should be parsed based on the type of entry.
+ */
+ /** Connectivity event data callback */
+ oneway onDebugRingBufferConnectivityEventEntriesAvailable(
+ WifiDebugRingBufferStatus status,
+ vec<WifiDebugRingEntryConnectivityEvent> entries);
+
+ /** Power event data callback */
+ oneway onDebugRingBufferPowerEventEntriesAvailable(
+ WifiDebugRingBufferStatus status,
+ vec<WifiDebugRingEntryPowerEvent> entries);
+
+ /** Wakelock event data callback */
+ oneway onDebugRingBufferWakelockEventEntriesAvailable(
+ WifiDebugRingBufferStatus status,
+ vec<WifiDebugRingEntryWakelockEvent> entries);
+
+ /** Vendor data event data callback */
+ oneway onDebugRingBufferVendorDataEntriesAvailable(
+ WifiDebugRingBufferStatus status,
+ vec<WifiDebugRingEntryVendorData> entries);
};