diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2021-03-11 02:07:21 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2021-03-11 02:07:21 +0000 |
commit | 4635dbd526422e0ade8599a825a105c5e33934f0 (patch) | |
tree | 3c60f81309b5c11d6425072393c8178ea71325d3 | |
parent | b2c5a9ce3747e299eafb97b3333f364bdf7d6ae3 (diff) | |
parent | c0975f94f04ba1bec99fc7072844c02036c9c8fc (diff) | |
download | wlan-4635dbd526422e0ade8599a825a105c5e33934f0.tar.gz |
Snap for 7199033 from c0975f94f04ba1bec99fc7072844c02036c9c8fc to sc-v2-release
Change-Id: I5938fceb8c3dcf43ff3444ecf3f8ed374ddc0af8
-rw-r--r-- | qcwcn/wifi_hal/wifi_hal.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/qcwcn/wifi_hal/wifi_hal.cpp b/qcwcn/wifi_hal/wifi_hal.cpp index d64e3b8..f071dfc 100644 --- a/qcwcn/wifi_hal/wifi_hal.cpp +++ b/qcwcn/wifi_hal/wifi_hal.cpp @@ -1879,6 +1879,24 @@ wifi_error wifi_get_ifaces(wifi_handle handle, int *num, { hal_info *info = (hal_info *)handle; + /* In case of dynamic interface add/remove, interface handles need to be + * updated so that, interface specific APIs could be instantiated. + * Reload here to get interfaces which are dynamically added. */ + + if (info->num_interfaces > 0) { + for (int i = 0; i < info->num_interfaces; i++) + free(info->interfaces[i]); + free(info->interfaces); + info->interfaces = NULL; + info->num_interfaces = 0; + } + + wifi_error ret = wifi_init_interfaces(handle); + if (ret != WIFI_SUCCESS) { + ALOGE("Failed to init interfaces while wifi_get_ifaces"); + return ret; + } + *interfaces = (wifi_interface_handle *)info->interfaces; *num = info->num_interfaces; |