mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
wifi: Two AP instances use the same interface name
When device supports two AP interfaces (i.e. {AP, 2}. not a bridged case),
the AP interface name might be observed from the getPredefinedApIfaceNames.
Check if the interface name is used or not when creating a new interface.
Bug: 244387442
Test: Manual test by commands
adb shell cmd wifi start-softap tetheredAp open -b 2
adb shell cmd wifi start-lohs lohs open -b 5
Change-Id: I59b3796895ee09452a9650c4dc138ad9e143282e
This commit is contained in:
@@ -1926,9 +1926,10 @@ uint32_t WifiChip::startIdxOfApIface() {
|
||||
// concurrent STA and not dual AP, else start with idx 0.
|
||||
std::string WifiChip::allocateApIfaceName() {
|
||||
// Check if we have a dedicated iface for AP.
|
||||
std::vector<std::string> ifnames = getPredefinedApIfaceNames(false);
|
||||
if (!ifnames.empty()) {
|
||||
return ifnames[0];
|
||||
std::vector<std::string> ifnames = getPredefinedApIfaceNames(true);
|
||||
for (auto const& ifname : ifnames) {
|
||||
if (findUsingName(ap_ifaces_, ifname)) continue;
|
||||
return ifname;
|
||||
}
|
||||
return allocateApOrStaIfaceName(IfaceType::AP, startIdxOfApIface());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user