summaryrefslogtreecommitdiff
path: root/wifi/1.4/default/wifi_chip.cpp
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-05-02 01:04:08 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-05-02 01:04:08 +0000
commitbc62c155a90d19f8ed14434badd8bc60fc45a9bc (patch)
treed1b67b1adc0372aeb82962d2f32b1bcb972132dd /wifi/1.4/default/wifi_chip.cpp
parent62499d302bdd1ae9bb13eaaa7c28869d26f572c4 (diff)
parenta3f9fae5719b6dafa5cfe7d250c0ed9c0422f9f3 (diff)
Snap for 6453963 from a3f9fae5719b6dafa5cfe7d250c0ed9c0422f9f3 to rvc-release
Change-Id: I585585820c574263047291d3f2a0f12d4eececb9
Diffstat (limited to 'wifi/1.4/default/wifi_chip.cpp')
-rw-r--r--wifi/1.4/default/wifi_chip.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/wifi/1.4/default/wifi_chip.cpp b/wifi/1.4/default/wifi_chip.cpp
index 23dd13be66..61912a53e0 100644
--- a/wifi/1.4/default/wifi_chip.cpp
+++ b/wifi/1.4/default/wifi_chip.cpp
@@ -101,6 +101,16 @@ std::string getWlanIfaceName(unsigned idx) {
return "wlan" + std::to_string(idx);
}
+// Returns the dedicated iface name if one is defined.
+std::string getApIfaceName() {
+ std::array<char, PROPERTY_VALUE_MAX> buffer;
+ if (property_get("ro.vendor.wifi.sap.interface", buffer.data(), nullptr) ==
+ 0) {
+ return {};
+ }
+ return buffer.data();
+}
+
std::string getP2pIfaceName() {
std::array<char, PROPERTY_VALUE_MAX> buffer;
property_get("wifi.direct.interface", buffer.data(), "p2p0");
@@ -1582,6 +1592,11 @@ std::string WifiChip::allocateApOrStaIfaceName(uint32_t start_idx) {
// AP iface names start with idx 1 for modes supporting
// 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::string ifname = getApIfaceName();
+ if (!ifname.empty()) {
+ return ifname;
+ }
return allocateApOrStaIfaceName((isStaApConcurrencyAllowedInCurrentMode() &&
!isDualApAllowedInCurrentMode())
? 1