wifi(implementation): Dual interface support
Add support for concurrent interfaces in the WifiLegacyHal class:
a) Removed the hardcoded "wlan0" interface handle in WifiLegacyHal.
b) Modified all the interface specific functions to accept the |iface_name|
argument on which the operation needs to be performed.
Each IWifiIface object will hold the name of the underlying network
interface (wlan0, wlan1 or p2p0) which it is representing.
All IWifiChip operations which needs an iface name will continue to use
the default "wlan0".
Bug: 65671875
Test: Device boots up and connects to wifi networks.
Test: Will send for regression tests.
Change-Id: I9bd9c2a9ba33ac1ea5677fc5d7c261d8eac08e1d
diff --git a/wifi/1.2/default/wifi_ap_iface.cpp b/wifi/1.2/default/wifi_ap_iface.cpp
index 347ffc6..3da2d66 100644
--- a/wifi/1.2/default/wifi_ap_iface.cpp
+++ b/wifi/1.2/default/wifi_ap_iface.cpp
@@ -85,7 +85,7 @@
WifiStatus WifiApIface::setCountryCodeInternal(
const std::array<int8_t, 2>& code) {
legacy_hal::wifi_error legacy_status =
- legacy_hal_.lock()->setCountryCode(code);
+ legacy_hal_.lock()->setCountryCode(ifname_, code);
return createWifiStatusFromLegacyError(legacy_status);
}
@@ -96,7 +96,7 @@
std::vector<uint32_t> valid_frequencies;
std::tie(legacy_status, valid_frequencies) =
legacy_hal_.lock()->getValidFrequenciesForBand(
- hidl_struct_util::convertHidlWifiBandToLegacy(band));
+ ifname_, hidl_struct_util::convertHidlWifiBandToLegacy(band));
return {createWifiStatusFromLegacyError(legacy_status), valid_frequencies};
}
} // namespace implementation