diff options
author | Steven Laver <lavers@google.com> | 2020-05-04 22:18:20 -0700 |
---|---|---|
committer | Steven Laver <lavers@google.com> | 2020-05-06 11:48:56 -0700 |
commit | 19a172e0208b6d3dcbcdb793107550a6837f79be (patch) | |
tree | 1646968c9627def5f7144bedca21f1ff51900546 /wifi/1.4/default/wifi_chip.cpp | |
parent | c7b41816dfb92b9f104439a19c78abc4f68971e0 (diff) | |
parent | 7d054ed1deae08cb23eb54c063c12772e96831fd (diff) |
Merge RP1A.200504.002
Change-Id: I1c488a4fc4dee824e058a48b606499840cf5a35b
Diffstat (limited to 'wifi/1.4/default/wifi_chip.cpp')
-rw-r--r-- | wifi/1.4/default/wifi_chip.cpp | 15 |
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 2fa0cb833c..b667b664e0 100644 --- a/wifi/1.4/default/wifi_chip.cpp +++ b/wifi/1.4/default/wifi_chip.cpp @@ -102,6 +102,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"); @@ -1623,6 +1633,11 @@ std::string WifiChip::allocateApOrStaIfaceName(uint32_t start_idx) { // AP iface names start with idx 1 for modes supporting // concurrent STA, 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() ? 1 : 0); } |