From 5a46c958e28858eaadb7a19b86ef1f7e6b486cad Mon Sep 17 00:00:00 2001 From: lesl Date: Mon, 14 Dec 2020 17:14:12 +0800 Subject: [PATCH] wifi: Fix bridged interface property and allociation 1. The concurrent property name over the limitation. Rename the property name. 2. When allocate bridged iface name, it needs to increase the idx to avoid two ifaces use the same name. Bug: 162686273 Test: atest -c VtsHalWifiApV1_0TargetTest Test: atest -c VtsHalWifiApV1_4TargetTest Test: atest -c VtsHalWifiApV1_5TargetTest Change-Id: I388cdd812bd0448c03ad5ae982547629c1e5eff9 --- wifi/1.5/default/wifi_chip.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wifi/1.5/default/wifi_chip.cpp b/wifi/1.5/default/wifi_chip.cpp index 1b0353b353..95478a419d 100644 --- a/wifi/1.5/default/wifi_chip.cpp +++ b/wifi/1.5/default/wifi_chip.cpp @@ -116,8 +116,8 @@ std::vector getPredefinedApIfaceNames(bool is_bridged) { ifnames.push_back(buffer.data()); if (is_bridged) { buffer.fill(0); - if (property_get("ro.vendor.wifi.sap.concurrent.interface", - buffer.data(), nullptr) == 0) { + if (property_get("ro.vendor.wifi.sap.concurrent.iface", buffer.data(), + nullptr) == 0) { return ifnames; } ifnames.push_back(buffer.data()); @@ -1841,8 +1841,8 @@ std::vector WifiChip::allocateBridgedApInstanceNames() { } else { int num_ifaces_need_to_allocate = 2 - instances.size(); for (int i = 0; i < num_ifaces_need_to_allocate; i++) { - std::string instance_name = - allocateApOrStaIfaceName(IfaceType::AP, startIdxOfApIface()); + std::string instance_name = allocateApOrStaIfaceName( + IfaceType::AP, startIdxOfApIface() + i); if (!instance_name.empty()) { instances.push_back(instance_name); }