diff options
author | Yu Ouyang <yuo@codeaurora.org> | 2021-08-20 17:31:08 +0800 |
---|---|---|
committer | James Mattis <jmattis@google.com> | 2021-10-27 12:43:47 -0700 |
commit | 3ce898c8242b5a4d7b915c1cf3a479b9b6b1058b (patch) | |
tree | d2cb452fdab888711d8504090ba6f355f5ba0264 | |
parent | c3e3c47551bac8f5675e470c043d9c3dd0c54b45 (diff) | |
download | wpa_supplicant_8-3ce898c8242b5a4d7b915c1cf3a479b9b6b1058b.tar.gz |
wifi: Inform framework HAPD_IFACE_DISABLED when AP iface unavailable
This change adds callback to inform framework AP interface
HAPD_IFACE_DISABLED when driver event INTERFACE_UNAVAILABLE.
Bug: 197292709
Test: Local build & manual test disable/enable Wi-Fi
Change-Id: I8b6bad1a6444737e7cdbaaedb1eb0c85a86eb240
Merged-In: I8b6bad1a6444737e7cdbaaedb1eb0c85a86eb240
-rw-r--r-- | hostapd/hidl/1.3/hostapd.cpp | 10 | ||||
-rw-r--r-- | src/ap/drv_callbacks.c | 3 |
2 files changed, 12 insertions, 1 deletions
diff --git a/hostapd/hidl/1.3/hostapd.cpp b/hostapd/hidl/1.3/hostapd.cpp index f9d26474..72efd3fe 100644 --- a/hostapd/hidl/1.3/hostapd.cpp +++ b/hostapd/hidl/1.3/hostapd.cpp @@ -919,7 +919,15 @@ V1_2::HostapdStatus Hostapd::addSingleAccessPoint( iface_hapd->own_addr); } } - }; + else if (os_strncmp(txt, AP_EVENT_DISABLED, + strlen(AP_EVENT_DISABLED)) == 0) { + // Invoke the failure callback on all registered clients. + for (const auto& callback : callbacks_) { + callback->onFailure(strlen(iface_hapd->conf->bridge) > 0 ? + iface_hapd->conf->bridge : iface_hapd->conf->iface); + } + } + }; // Setup callback iface_hapd->setup_complete_cb = onAsyncSetupCompleteCb; diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c index 53082f53..de517729 100644 --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c @@ -1673,6 +1673,9 @@ static void hostapd_event_iface_unavailable(struct hostapd_data *hapd) hostapd_switch_channel_fallback(hapd->iface, &hapd->cs_freq_params); } + + // inform framework that interface is unavailable + hostapd_disable_iface(hapd->iface); } |