diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-11-02 22:42:18 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-11-02 22:42:18 +0000 |
commit | 901e8dbc3c7390977f9dbee970ba93528c49963b (patch) | |
tree | 4b874a1cc00925b9e78571789e671dffa826454a | |
parent | da75c20016611ed66da893573ab14f3ae0740725 (diff) | |
parent | 1ce89f702faf0228507f62d20e91a026d80b67e1 (diff) | |
download | wlan-901e8dbc3c7390977f9dbee970ba93528c49963b.tar.gz |
Snap for 11041982 from 1ce89f702faf0228507f62d20e91a026d80b67e1 to mainline-wifi-releaseaml_wif_341711020aml_wif_341610000aml_wif_341510000aml_wif_341410080aml_wif_341310010android14-mainline-wifi-release
Change-Id: Ia51dd68eda50be2f1761f27c1151c4eaa1bc50f9
-rw-r--r-- | bcmdhd/wifi_hal/wifi_hal.cpp | 19 |
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"); |