summaryrefslogtreecommitdiffstats
path: root/wifi
diff options
context:
space:
mode:
authorJames Mattis <jmattis@google.com>2019-05-22 16:14:48 -0700
committerJames Mattis <jmattis@google.com>2019-05-22 16:26:55 -0700
commitd2e4c074659dd731c2fac443f104fdf2df339cbb (patch)
tree57489f6965ff2eda1e4de3662fe4c7dd831dda9a /wifi
parent68fa3708155b7ad64186865a12959adbf5fd12f7 (diff)
downloadandroid_hardware_interfaces-d2e4c074659dd731c2fac443f104fdf2df339cbb.tar.gz
android_hardware_interfaces-d2e4c074659dd731c2fac443f104fdf2df339cbb.tar.bz2
android_hardware_interfaces-d2e4c074659dd731c2fac443f104fdf2df339cbb.zip
Fix so that dual access points (AP) works.
Devices that only have dual AP setup without an STA were not working. A use case for this would be in a car, having a wifi hotspot active while also projecting to the car head unit from your phone. This was working but a recent change in CL a3e5b7f that forced STA to be on wlan0 and AP to start at wlan1 broke this functionality. This change is to augment the original CL to keep it's function in place while also taking into account devices that have dual AP. Bug: 132268977 Test: Manual boot of hawk device along with testing of tethering and local only hotspot. Change-Id: I8da5dd4f0baea1bf0f22d3275e356936a58fb3d1
Diffstat (limited to 'wifi')
-rw-r--r--wifi/1.3/default/wifi_chip.cpp15
-rw-r--r--wifi/1.3/default/wifi_chip.h1
2 files changed, 13 insertions, 3 deletions
diff --git a/wifi/1.3/default/wifi_chip.cpp b/wifi/1.3/default/wifi_chip.cpp
index b768959f2..7bc85e8e1 100644
--- a/wifi/1.3/default/wifi_chip.cpp
+++ b/wifi/1.3/default/wifi_chip.cpp
@@ -1435,6 +1435,13 @@ bool WifiChip::isStaApConcurrencyAllowedInCurrentMode() {
return canCurrentModeSupportIfaceCombo(req_iface_combo);
}
+bool WifiChip::isDualApAllowedInCurrentMode() {
+ // Check if we can support atleast 1 STA & 1 AP concurrently.
+ std::map<IfaceType, size_t> req_iface_combo;
+ req_iface_combo[IfaceType::AP] = 2;
+ return canCurrentModeSupportIfaceCombo(req_iface_combo);
+}
+
std::string WifiChip::getFirstActiveWlanIfaceName() {
if (sta_ifaces_.size() > 0) return sta_ifaces_[0]->getName();
if (ap_ifaces_.size() > 0) return ap_ifaces_[0]->getName();
@@ -1460,10 +1467,12 @@ 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.
+// concurrent STA and not dual AP, else start with idx 0.
std::string WifiChip::allocateApIfaceName() {
- return allocateApOrStaIfaceName(
- isStaApConcurrencyAllowedInCurrentMode() ? 1 : 0);
+ return allocateApOrStaIfaceName((isStaApConcurrencyAllowedInCurrentMode() &&
+ !isDualApAllowedInCurrentMode())
+ ? 1
+ : 0);
}
// STA iface names start with idx 0.
diff --git a/wifi/1.3/default/wifi_chip.h b/wifi/1.3/default/wifi_chip.h
index 3d12f4c9b..aaed39db9 100644
--- a/wifi/1.3/default/wifi_chip.h
+++ b/wifi/1.3/default/wifi_chip.h
@@ -237,6 +237,7 @@ class WifiChip : public V1_3::IWifiChip {
bool canCurrentModeSupportIfaceOfType(IfaceType requested_type);
bool isValidModeId(ChipModeId mode_id);
bool isStaApConcurrencyAllowedInCurrentMode();
+ bool isDualApAllowedInCurrentMode();
std::string getFirstActiveWlanIfaceName();
std::string allocateApOrStaIfaceName(uint32_t start_idx);
std::string allocateApIfaceName();