summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-12-15 09:32:32 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-12-15 09:32:32 +0000
commit13f5fed9615d131d623faa35dcba32d8efe59168 (patch)
tree4b874a1cc00925b9e78571789e671dffa826454a
parent5d54f74499ceeb505e320f0640de31e74cab620d (diff)
parent1ce89f702faf0228507f62d20e91a026d80b67e1 (diff)
downloadwlan-aml_tz5_341510010.tar.gz
Snap for 11224086 from 1ce89f702faf0228507f62d20e91a026d80b67e1 to mainline-tzdata5-releaseaml_tz5_341510070aml_tz5_341510050aml_tz5_341510010aml_tz5_341510010
Change-Id: I51f3f7c58f2a4228efb9a5103949d7002b31bbca
-rw-r--r--bcmdhd/wifi_hal/wifi_hal.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/bcmdhd/wifi_hal/wifi_hal.cpp b/bcmdhd/wifi_hal/wifi_hal.cpp
index f746f09..f3039ca 100644
--- a/bcmdhd/wifi_hal/wifi_hal.cpp
+++ b/bcmdhd/wifi_hal/wifi_hal.cpp
@@ -608,7 +608,6 @@ static int wifi_add_membership(wifi_handle handle, const char *group)
static void internal_cleaned_up_handler(wifi_handle handle)
{
hal_info *info = getHalInfo(handle);
- wifi_cleaned_up_handler cleaned_up_handler = info->cleaned_up_handler;
ALOGI("internal clean up");
@@ -622,12 +621,6 @@ static void internal_cleaned_up_handler(wifi_handle handle)
info->event_sock = NULL;
}
- if (cleaned_up_handler) {
- ALOGI("cleanup_handler cb");
- (*cleaned_up_handler)(handle);
- } else {
- ALOGI("!! clean up handler is null!!");
- }
DestroyResponseLock();
pthread_mutex_destroy(&info->cb_lock);
free(info);
@@ -641,7 +634,7 @@ void wifi_internal_module_cleanup()
twt_deinit_handler();
}
-void wifi_cleanup(wifi_handle handle, wifi_cleaned_up_handler handler)
+void wifi_cleanup(wifi_handle handle, wifi_cleaned_up_handler cleaned_up_handler)
{
if (!handle) {
ALOGE("Handle is null");
@@ -655,8 +648,6 @@ void wifi_cleanup(wifi_handle handle, wifi_cleaned_up_handler handler)
wifi_interface_handle *ifaceHandles = NULL;
wifi_interface_handle wlan0Handle;
- info->cleaned_up_handler = handler;
-
wlan0Handle = wifi_get_wlan_interface((wifi_handle) info, ifaceHandles, numIfaceHandles);
if (wlan0Handle != NULL) {
@@ -728,6 +719,14 @@ void wifi_cleanup(wifi_handle handle, wifi_cleaned_up_handler handler)
info->clean_up = true;
+ /* global func ptr be invalidated and will not call any command from legacy hal */
+ if (cleaned_up_handler) {
+ ALOGI("cleaned_up_handler to invalidates func ptr");
+ cleaned_up_handler(handle);
+ } else {
+ ALOGI("cleaned up handler is null");
+ }
+
if (TEMP_FAILURE_RETRY(write(info->cleanup_socks[0], "Exit", 4)) < 1) {
// As a fallback set the cleanup flag to TRUE
ALOGE("could not write to the cleanup socket");