Wifi: Handle subsystem restart notification
This commit adds the logic to handle a notification of a wifi subsystem
restart to trigger the callback to the framework for self recovery.
Bug: 159367026
Test: force a firmware restart and make sure Wifi is recovered.
Change-Id: If6b5863d1d7473917088ec5be1910fa0db5dd6ae
diff --git a/wifi/1.4/default/wifi_legacy_hal.h b/wifi/1.4/default/wifi_legacy_hal.h
index 9964460..2d4c594 100644
--- a/wifi/1.4/default/wifi_legacy_hal.h
+++ b/wifi/1.4/default/wifi_legacy_hal.h
@@ -142,6 +142,9 @@
using on_error_alert_callback =
std::function<void(int32_t, const std::vector<uint8_t>&)>;
+// Callback for subsystem restart
+using on_subsystem_restart_callback = std::function<void(const std::string&)>;
+
// Struct for the mac info from the legacy HAL. This is a cleaner version
// of the |wifi_mac_info| & |wifi_iface_info|.
typedef struct {
@@ -277,6 +280,8 @@
const on_ring_buffer_data_callback& on_data_callback);
wifi_error deregisterRingBufferCallbackHandler(
const std::string& iface_name);
+ wifi_error registerSubsystemRestartCallbackHandler(
+ const on_subsystem_restart_callback& on_restart_callback);
std::pair<wifi_error, std::vector<wifi_ring_buffer_status>>
getRingBuffersStatus(const std::string& iface_name);
wifi_error startRingBufferLogging(const std::string& iface_name,