diff options
author | Roshan Pius <rpius@google.com> | 2016-11-18 01:12:14 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-11-18 01:12:14 +0000 |
commit | 344aad48764adca23c050a41517a931372ec0406 (patch) | |
tree | ef8b1e394c8d5fb27cb508fc3fe65b2cf5fa5fb4 | |
parent | 4e6ce9734302393b1a61c7ee28bcd7a5ca71799a (diff) | |
parent | 6ce7173a9bab425b9760d880b3ebed46d2cd6a2b (diff) |
driver_tool: query if firmware mode changd is needed
am: 6ce7173a9b
Change-Id: Ia9b827f1d3efc96bc21978b0bf635a97eae75f13
-rw-r--r-- | libwifi_hal/driver_tool.cpp | 4 | ||||
-rw-r--r-- | libwifi_hal/include/wifi_hal/driver_tool.h | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/libwifi_hal/driver_tool.cpp b/libwifi_hal/driver_tool.cpp index c05c00080..3089ee0a4 100644 --- a/libwifi_hal/driver_tool.cpp +++ b/libwifi_hal/driver_tool.cpp @@ -56,6 +56,10 @@ bool DriverTool::IsDriverLoaded() { return ::wifi_unload_driver() != 0; } +bool DriverTool::IsFirmwareModeChangeNeeded(int mode) { + return (wifi_get_fw_path(mode) != nullptr); +} + bool DriverTool::ChangeFirmwareMode(int mode) { const char* fwpath = wifi_get_fw_path(mode); if (!fwpath) { diff --git a/libwifi_hal/include/wifi_hal/driver_tool.h b/libwifi_hal/include/wifi_hal/driver_tool.h index e0941c0f9..a27641bd9 100644 --- a/libwifi_hal/include/wifi_hal/driver_tool.h +++ b/libwifi_hal/include/wifi_hal/driver_tool.h @@ -40,6 +40,12 @@ class DriverTool { virtual bool UnloadDriver(); virtual bool IsDriverLoaded(); + // Check if we need to invoke |ChangeFirmwareMode| to configure + // the firmware for the provided mode. + // |mode| is one of the kFirmwareMode* constants defined above. + // Returns true if needed, and false otherwise. + virtual bool IsFirmwareModeChangeNeeded(int mode); + // Change the firmware mode. // |mode| is one of the kFirmwareMode* constants defined above. // Returns true on success, and false otherwise. |