summaryrefslogtreecommitdiffstats
path: root/wifi
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2016-12-14 18:02:56 -0800
committerRoshan Pius <rpius@google.com>2016-12-16 13:06:39 -0800
commitadc87cbab9208ce05db58cbb2e6391b06f28ac0a (patch)
tree8ae48a21379aeb3843be66f2a0caed38f3e55473 /wifi
parent203cb031df35ebfe647e93b6b0d9634602693668 (diff)
downloadplatform_hardware_interfaces-adc87cbab9208ce05db58cbb2e6391b06f28ac0a.tar.gz
platform_hardware_interfaces-adc87cbab9208ce05db58cbb2e6391b06f28ac0a.tar.bz2
platform_hardware_interfaces-adc87cbab9208ce05db58cbb2e6391b06f28ac0a.zip
WifiLegacyHal: Add missing ring buffer callback dereg
Still figuring out how to send this data over the HIDL callback. Adding this missing wrapper in legacy hal for now. Bug:33638159 Test: Compiles Change-Id: Ifce06a796d54e10c582b9896425899a45162a45f
Diffstat (limited to 'wifi')
-rw-r--r--wifi/1.0/default/wifi_legacy_hal.cpp14
-rw-r--r--wifi/1.0/default/wifi_legacy_hal.h1
2 files changed, 14 insertions, 1 deletions
diff --git a/wifi/1.0/default/wifi_legacy_hal.cpp b/wifi/1.0/default/wifi_legacy_hal.cpp
index 678ebb1a31..d65052e639 100644
--- a/wifi/1.0/default/wifi_legacy_hal.cpp
+++ b/wifi/1.0/default/wifi_legacy_hal.cpp
@@ -741,8 +741,20 @@ wifi_error WifiLegacyHal::registerRingBufferCallbackHandler(
on_user_data_callback(ring_name, buffer_vector, *status);
}
};
- return global_func_table_.wifi_set_log_handler(
+ wifi_error status = global_func_table_.wifi_set_log_handler(
0, wlan_interface_handle_, {onRingBufferData});
+ if (status != WIFI_SUCCESS) {
+ on_ring_buffer_data_internal_callback = nullptr;
+ }
+ return status;
+}
+
+wifi_error WifiLegacyHal::deregisterRingBufferCallbackHandler() {
+ if (!on_ring_buffer_data_internal_callback) {
+ return WIFI_ERROR_NOT_AVAILABLE;
+ }
+ on_ring_buffer_data_internal_callback = nullptr;
+ return global_func_table_.wifi_reset_log_handler(0, wlan_interface_handle_);
}
std::pair<wifi_error, std::vector<wifi_ring_buffer_status>>
diff --git a/wifi/1.0/default/wifi_legacy_hal.h b/wifi/1.0/default/wifi_legacy_hal.h
index c846fc8da1..b5853147ab 100644
--- a/wifi/1.0/default/wifi_legacy_hal.h
+++ b/wifi/1.0/default/wifi_legacy_hal.h
@@ -192,6 +192,7 @@ class WifiLegacyHal {
std::pair<wifi_error, WakeReasonStats> getWakeReasonStats();
wifi_error registerRingBufferCallbackHandler(
const on_ring_buffer_data_callback& on_data_callback);
+ wifi_error deregisterRingBufferCallbackHandler();
std::pair<wifi_error, std::vector<wifi_ring_buffer_status>>
getRingBuffersStatus();
wifi_error startRingBufferLogging(const std::string& ring_name,