summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPurushottam Kushwaha <pkushwah@codeaurora.org>2017-07-12 12:15:34 +0530
committerRashed Abdel-Tawab <rashed@linux.com>2017-10-28 18:08:18 -0700
commit45343f0e3d0eed0ba2f16400639aacffed1b2e22 (patch)
treec45bb5683e66686636c88366cf4ba846f9d372cd
parent945b9ebd6f18070c21c1131acf4f7374cc795056 (diff)
downloadandroid_hardware_interfaces-staging/lineage-15.0_rebase-android-8.0.0_r23.tar.gz
android_hardware_interfaces-staging/lineage-15.0_rebase-android-8.0.0_r23.tar.bz2
android_hardware_interfaces-staging/lineage-15.0_rebase-android-8.0.0_r23.zip
wifi: Allow STA + SAP Concurrency from wifi vendor hal service.staging/lineage-15.0_rebase-android-8.0.0_r23
This commit adds a new feature flag wifiStaSapConcurrency, to enable support of STA + SAP concurrency via wifi vendor hal. This also enhances AP combination to include STA in list of allowed combination. CRs-Fixed: 2075317 Change-Id: I8bcef59116fbe474e787a17f979f1d69d687669b
-rw-r--r--wifi/1.1/default/wifi_chip.cpp22
-rw-r--r--wifi/1.1/default/wifi_feature_flags.h3
-rw-r--r--wifi/1.1/default/wifi_legacy_hal.cpp10
3 files changed, 28 insertions, 7 deletions
diff --git a/wifi/1.1/default/wifi_chip.cpp b/wifi/1.1/default/wifi_chip.cpp
index 2f4023405..5d55914e6 100644
--- a/wifi/1.1/default/wifi_chip.cpp
+++ b/wifi/1.1/default/wifi_chip.cpp
@@ -434,8 +434,14 @@ WifiChip::getAvailableModesInternal() {
// AP mode iface combinations.
const IWifiChip::ChipIfaceCombinationLimit ap_chip_iface_combination_limit = {
{IfaceType::AP}, 1};
- const IWifiChip::ChipIfaceCombination ap_chip_iface_combination = {
- {ap_chip_iface_combination_limit}};
+ IWifiChip::ChipIfaceCombination ap_chip_iface_combination;
+ if (WifiFeatureFlags::wifiStaSapConcurrency) {
+ ap_chip_iface_combination = {
+ {ap_chip_iface_combination_limit, sta_chip_iface_combination_limit_1}};
+ } else {
+ ap_chip_iface_combination = {
+ {ap_chip_iface_combination_limit}};
+ }
const IWifiChip::ChipMode ap_chip_mode = {kApChipModeId,
{ap_chip_iface_combination}};
return {createWifiStatus(WifiStatusCode::SUCCESS),
@@ -676,7 +682,11 @@ WifiStatus WifiChip::removeP2pIfaceInternal(const std::string& ifname) {
}
std::pair<WifiStatus, sp<IWifiStaIface>> WifiChip::createStaIfaceInternal() {
- if (current_mode_id_ != kStaChipModeId || sta_iface_.get()) {
+ // Do no restrict with kStaChipModeId in case of wifiStaSapConcurrency feature.
+ // In case of wifiStaSapConcurrency, both kStaChipModeId and kApChipModeId are
+ // valid combinations to create STA interface.
+ if ((!(WifiFeatureFlags::wifiStaSapConcurrency) &&
+ current_mode_id_ != kStaChipModeId) || sta_iface_.get()) {
return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}};
}
std::string ifname = legacy_hal_.lock()->getStaIfaceName();
@@ -841,7 +851,11 @@ WifiStatus WifiChip::handleChipConfiguration(ChipModeId mode_id) {
// Currently the underlying implementation has a deadlock issue.
// We should return ERROR_NOT_SUPPORTED if chip is already configured in
// a different mode.
- if (current_mode_id_ != kInvalidModeId) {
+
+ // handleChipConfiguration assumes that initial mode is kInvalidModeId.
+ // This limitation is not applicable for wifiStaSapConcurrency feature.
+ if (!(WifiFeatureFlags::wifiStaSapConcurrency) &&
+ current_mode_id_ != kInvalidModeId) {
// TODO(b/37446050): Fix the deadlock.
return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED);
}
diff --git a/wifi/1.1/default/wifi_feature_flags.h b/wifi/1.1/default/wifi_feature_flags.h
index 5939ffbef..1449b5095 100644
--- a/wifi/1.1/default/wifi_feature_flags.h
+++ b/wifi/1.1/default/wifi_feature_flags.h
@@ -30,6 +30,9 @@ class WifiFeatureFlags {
#else
static const bool wifiHidlFeatureAware = false;
#endif // WIFI_HIDL_FEATURE_AWARE
+
+ // Feature flag to allow STA + SAP combination from wifi vendor hal service
+ static const bool wifiStaSapConcurrency = true;
};
} // namespace implementation
diff --git a/wifi/1.1/default/wifi_legacy_hal.cpp b/wifi/1.1/default/wifi_legacy_hal.cpp
index 7d683d3fe..8b68af39e 100644
--- a/wifi/1.1/default/wifi_legacy_hal.cpp
+++ b/wifi/1.1/default/wifi_legacy_hal.cpp
@@ -340,13 +340,17 @@ wifi_error WifiLegacyHal::initialize() {
}
wifi_error WifiLegacyHal::start() {
- // Ensure that we're starting in a good state.
- CHECK(global_func_table_.wifi_initialize && !global_handle_ &&
- !wlan_interface_handle_ && !awaiting_event_loop_termination_);
if (is_started_) {
LOG(DEBUG) << "Legacy HAL already started";
return WIFI_SUCCESS;
}
+ // Ensure that we're starting in a good state.
+ // In case of wifiStaSapConcurrency, if one of the interface is already active,
+ // then below check will always fail, as this check assumes that wifiLegacyHal
+ // is stopped before calling start. Since we don't need to start WifiLegacyHal
+ // move this check here and return from is_started_ check.
+ CHECK(global_func_table_.wifi_initialize && !global_handle_ &&
+ !wlan_interface_handle_ && !awaiting_event_loop_termination_);
LOG(DEBUG) << "Starting legacy HAL";
if (!iface_tool_.SetWifiUpState(true)) {
LOG(ERROR) << "Failed to set WiFi interface up";