Add IfaceConcurrencyType and related methods for AP_BRIDGED concurrency
Add IfaceConcurrencyType to represent Iface implementations that
have different concurrency implications for the same IfaceType, such as
Bridged AP and Single AP for IWifiApIface. Add a new IWifiChip HAL API,
getAvailableModes_1_6 to return the new concurrency type combos.
Bug: 207055799
Test: 1.6/default/tests/runtests.sh
Change-Id: Iad20a3d95d54dd8b624db912fd3153c2a3372f45
diff --git a/wifi/1.6/IWifiChip.hal b/wifi/1.6/IWifiChip.hal
index 555ec91..726839d 100644
--- a/wifi/1.6/IWifiChip.hal
+++ b/wifi/1.6/IWifiChip.hal
@@ -16,6 +16,7 @@
package android.hardware.wifi@1.6;
+import @1.0::ChipModeId;
import @1.0::IWifiIface;
import @1.0::WifiStatus;
import @1.5::WifiBand;
@@ -101,6 +102,107 @@
generates (WifiStatus status, vec<WifiUsableChannel> channels);
/**
+ * Set of interface concurrency types with the maximum number of interfaces that can have
+ * one of the specified concurrency types for a given ChipConcurrencyCombination. See
+ * ChipConcurrencyCombination for examples.
+ */
+ struct ChipConcurrencyCombinationLimit {
+ // Each IfaceConcurrencyType must occur at most once.
+ vec<IfaceConcurrencyType> types;
+ uint32_t maxIfaces;
+ };
+
+ /**
+ * Set of interfaces that can operate concurrently when in a given mode. See
+ * ChipMode below.
+ *
+ * For example:
+ * [{STA} <= 2]
+ * At most two STA interfaces are supported
+ * [], [STA], [STA+STA]
+ *
+ * [{STA} <= 1, {NAN} <= 1, {AP_BRIDGED} <= 1]
+ * Any combination of STA, NAN, AP_BRIDGED
+ * [], [STA], [NAN], [AP_BRIDGED], [STA+NAN], [STA+AP_BRIDGED], [NAN+AP_BRIDGED],
+ * [STA+NAN+AP_BRIDGED]
+ *
+ * [{STA} <= 1, {NAN,P2P} <= 1]
+ * Optionally a STA and either NAN or P2P
+ * [], [STA], [STA+NAN], [STA+P2P], [NAN], [P2P]
+ * Not included [NAN+P2P], [STA+NAN+P2P]
+ *
+ * [{STA} <= 1, {STA,NAN} <= 1]
+ * Optionally a STA and either a second STA or a NAN
+ * [], [STA], [STA+NAN], [STA+STA], [NAN]
+ * Not included [STA+STA+NAN]
+ */
+ struct ChipConcurrencyCombination {
+ vec<ChipConcurrencyCombinationLimit> limits;
+ };
+
+ /**
+ * A mode that the chip can be put in. A mode defines a set of constraints on
+ * the interfaces that can exist while in that mode. Modes define a unit of
+ * configuration where all interfaces must be torn down to switch to a
+ * different mode. Some HALs may only have a single mode, but an example where
+ * multiple modes would be required is if a chip has different firmwares with
+ * different capabilities.
+ *
+ * When in a mode, it must be possible to perform any combination of creating
+ * and removing interfaces as long as at least one of the
+ * ChipConcurrencyCombinations is satisfied. This means that if a chip has two
+ * available combinations, [{STA} <= 1] and [{AP_BRIDGED} <= 1] then it is expected
+ * that exactly one STA type or one AP_BRIDGED type can be created, but it
+ * is not expected that both a STA and AP_BRIDGED type could be created. If it
+ * was then there would be a single available combination
+ * [{STA} <=1, {AP_BRIDGED} <= 1].
+ *
+ * When switching between two available combinations it is expected that
+ * interfaces only supported by the initial combination must be removed until
+ * the target combination is also satisfied. At that point new interfaces
+ * satisfying only the target combination can be added (meaning the initial
+ * combination limits will no longer satisfied). The addition of these new
+ * interfaces must not impact the existence of interfaces that satisfy both
+ * combinations.
+ *
+ * For example, a chip with available combinations:
+ * [{STA} <= 2, {NAN} <=1] and [{STA} <=1, {NAN} <= 1, {AP_BRIDGED} <= 1}]
+ * If the chip currently has 3 interfaces STA, STA and NAN and wants to add an
+ * AP_BRIDGED interface in place of one of the STAs then first one of the STA
+ * interfaces must be removed and then the AP interface can be created after
+ * the STA had been torn down. During this process the remaining STA and NAN
+ * interfaces must not be removed/recreated.
+ *
+ * If a chip does not support this kind of reconfiguration in this mode then
+ * the combinations must be separated into two separate modes. Before
+ * switching modes all interfaces must be torn down, the mode switch must be
+ * enacted and when it completes the new interfaces must be brought up.
+ */
+ struct ChipMode {
+ /**
+ * Id that can be used to put the chip in this mode.
+ */
+ ChipModeId id;
+
+ /**
+ * A list of the possible interface concurrency type combinations that the chip can have
+ * while in this mode.
+ */
+ vec<ChipConcurrencyCombination> availableCombinations;
+ };
+
+ /**
+ * Get the set of operation modes that the chip supports.
+ *
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
+ * @return modes List of modes supported by the device.
+ */
+ getAvailableModes_1_6() generates (WifiStatus status, vec<ChipMode> modes);
+
+ /**
* Retrieve the list of all the possible radio combinations supported by this
* chip.
*
diff --git a/wifi/1.6/default/tests/mock_wifi_feature_flags.h b/wifi/1.6/default/tests/mock_wifi_feature_flags.h
index fa3600a..fbe1f7a 100644
--- a/wifi/1.6/default/tests/mock_wifi_feature_flags.h
+++ b/wifi/1.6/default/tests/mock_wifi_feature_flags.h
@@ -33,7 +33,7 @@
public:
MockWifiFeatureFlags();
- MOCK_METHOD1(getChipModes, std::vector<V1_0::IWifiChip::ChipMode>(bool is_primary));
+ MOCK_METHOD1(getChipModes, std::vector<V1_6::IWifiChip::ChipMode>(bool is_primary));
MOCK_METHOD0(isApMacRandomizationDisabled, bool());
};
diff --git a/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp b/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp
index 542b180..48c0065 100644
--- a/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp
+++ b/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp
@@ -48,13 +48,13 @@
protected:
void setupV1IfaceCombination() {
// clang-format off
- const hidl_vec<V1_0::IWifiChip::ChipIfaceCombination> combinationsSta = {
- {{{{IfaceType::STA}, 1}, {{IfaceType::P2P}, 1}}}
+ const hidl_vec<IWifiChip::ChipConcurrencyCombination> combinationsSta = {
+ {{{{IfaceConcurrencyType::STA}, 1}, {{IfaceConcurrencyType::P2P}, 1}}}
};
- const hidl_vec<V1_0::IWifiChip::ChipIfaceCombination> combinationsAp = {
- {{{{IfaceType::AP}, 1}}}
+ const hidl_vec<IWifiChip::ChipConcurrencyCombination> combinationsAp = {
+ {{{{IfaceConcurrencyType::AP}, 1}}}
};
- const std::vector<V1_0::IWifiChip::ChipMode> modes = {
+ const std::vector<V1_6::IWifiChip::ChipMode> modes = {
{feature_flags::chip_mode_ids::kV1Sta, combinationsSta},
{feature_flags::chip_mode_ids::kV1Ap, combinationsAp}
};
@@ -64,13 +64,14 @@
void setupV1_AwareIfaceCombination() {
// clang-format off
- const hidl_vec<V1_0::IWifiChip::ChipIfaceCombination> combinationsSta = {
- {{{{IfaceType::STA}, 1}, {{IfaceType::P2P, IfaceType::NAN}, 1}}}
+ const hidl_vec<IWifiChip::ChipConcurrencyCombination> combinationsSta = {
+ {{{{IfaceConcurrencyType::STA}, 1},
+ {{IfaceConcurrencyType::P2P, IfaceConcurrencyType::NAN}, 1}}}
};
- const hidl_vec<V1_0::IWifiChip::ChipIfaceCombination> combinationsAp = {
- {{{{IfaceType::AP}, 1}}}
+ const hidl_vec<IWifiChip::ChipConcurrencyCombination> combinationsAp = {
+ {{{{IfaceConcurrencyType::AP}, 1}}}
};
- const std::vector<V1_0::IWifiChip::ChipMode> modes = {
+ const std::vector<V1_6::IWifiChip::ChipMode> modes = {
{feature_flags::chip_mode_ids::kV1Sta, combinationsSta},
{feature_flags::chip_mode_ids::kV1Ap, combinationsAp}
};
@@ -80,10 +81,11 @@
void setupV1_AwareDisabledApIfaceCombination() {
// clang-format off
- const hidl_vec<V1_0::IWifiChip::ChipIfaceCombination> combinationsSta = {
- {{{{IfaceType::STA}, 1}, {{IfaceType::P2P, IfaceType::NAN}, 1}}}
+ const hidl_vec<IWifiChip::ChipConcurrencyCombination> combinationsSta = {
+ {{{{IfaceConcurrencyType::STA}, 1},
+ {{IfaceConcurrencyType::P2P, IfaceConcurrencyType::NAN}, 1}}}
};
- const std::vector<V1_0::IWifiChip::ChipMode> modes = {
+ const std::vector<V1_6::IWifiChip::ChipMode> modes = {
{feature_flags::chip_mode_ids::kV1Sta, combinationsSta}
};
// clang-format on
@@ -92,11 +94,12 @@
void setupV2_AwareIfaceCombination() {
// clang-format off
- const hidl_vec<V1_0::IWifiChip::ChipIfaceCombination> combinations = {
- {{{{IfaceType::STA}, 1}, {{IfaceType::AP}, 1}}},
- {{{{IfaceType::STA}, 1}, {{IfaceType::P2P, IfaceType::NAN}, 1}}}
+ const hidl_vec<IWifiChip::ChipConcurrencyCombination> combinations = {
+ {{{{IfaceConcurrencyType::STA}, 1}, {{IfaceConcurrencyType::AP}, 1}}},
+ {{{{IfaceConcurrencyType::STA}, 1},
+ {{IfaceConcurrencyType::P2P, IfaceConcurrencyType::NAN}, 1}}}
};
- const std::vector<V1_0::IWifiChip::ChipMode> modes = {
+ const std::vector<V1_6::IWifiChip::ChipMode> modes = {
{feature_flags::chip_mode_ids::kV3, combinations}
};
// clang-format on
@@ -105,10 +108,11 @@
void setupV2_AwareDisabledApIfaceCombination() {
// clang-format off
- const hidl_vec<V1_0::IWifiChip::ChipIfaceCombination> combinations = {
- {{{{IfaceType::STA}, 1}, {{IfaceType::P2P, IfaceType::NAN}, 1}}}
+ const hidl_vec<IWifiChip::ChipConcurrencyCombination> combinations = {
+ {{{{IfaceConcurrencyType::STA}, 1},
+ {{IfaceConcurrencyType::P2P, IfaceConcurrencyType::NAN}, 1}}}
};
- const std::vector<V1_0::IWifiChip::ChipMode> modes = {
+ const std::vector<V1_6::IWifiChip::ChipMode> modes = {
{feature_flags::chip_mode_ids::kV3, combinations}
};
// clang-format on
@@ -117,10 +121,10 @@
void setup_MultiIfaceCombination() {
// clang-format off
- const hidl_vec<V1_0::IWifiChip::ChipIfaceCombination> combinations = {
- {{{{IfaceType::STA}, 3}, {{IfaceType::AP}, 1}}}
+ const hidl_vec<IWifiChip::ChipConcurrencyCombination> combinations = {
+ {{{{IfaceConcurrencyType::STA}, 3}, {{IfaceConcurrencyType::AP}, 1}}}
};
- const std::vector<V1_0::IWifiChip::ChipMode> modes = {
+ const std::vector<V1_6::IWifiChip::ChipMode> modes = {
{feature_flags::chip_mode_ids::kV3, combinations}
};
// clang-format on
@@ -128,19 +132,20 @@
}
void assertNumberOfModes(uint32_t num_modes) {
- chip_->getAvailableModes([num_modes](const WifiStatus& status,
- const std::vector<WifiChip::ChipMode>& modes) {
+ chip_->getAvailableModes_1_6([num_modes](const WifiStatus& status,
+ const std::vector<WifiChip::ChipMode>& modes) {
ASSERT_EQ(WifiStatusCode::SUCCESS, status.code);
// V2_Aware has 1 mode of operation.
ASSERT_EQ(num_modes, modes.size());
});
}
- void findModeAndConfigureForIfaceType(const IfaceType& type) {
+ void findModeAndConfigureForIfaceType(const IfaceConcurrencyType& type) {
// This should be aligned with kInvalidModeId in wifi_chip.cpp.
ChipModeId mode_id = UINT32_MAX;
- chip_->getAvailableModes([&mode_id, &type](const WifiStatus& status,
- const std::vector<WifiChip::ChipMode>& modes) {
+ chip_->getAvailableModes_1_6([&mode_id, &type](
+ const WifiStatus& status,
+ const std::vector<WifiChip::ChipMode>& modes) {
ASSERT_EQ(WifiStatusCode::SUCCESS, status.code);
for (const auto& mode : modes) {
for (const auto& combination : mode.availableCombinations) {
@@ -298,48 +303,48 @@
};
TEST_F(WifiChipV1IfaceCombinationTest, StaMode_CreateSta_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_EQ(createIface(IfaceType::STA), "wlan0");
}
TEST_F(WifiChipV1IfaceCombinationTest, StaMode_CreateP2p_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::P2P).empty());
}
TEST_F(WifiChipV1IfaceCombinationTest, StaMode_CreateNan_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_TRUE(createIface(IfaceType::NAN).empty());
}
TEST_F(WifiChipV1IfaceCombinationTest, StaMode_CreateAp_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_TRUE(createIface(IfaceType::AP).empty());
}
TEST_F(WifiChipV1IfaceCombinationTest, StaMode_CreateStaP2p_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_FALSE(createIface(IfaceType::P2P).empty());
}
TEST_F(WifiChipV1IfaceCombinationTest, ApMode_CreateAp_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_EQ(createIface(IfaceType::AP), "wlan0");
}
TEST_F(WifiChipV1IfaceCombinationTest, ApMode_CreateSta_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_TRUE(createIface(IfaceType::STA).empty());
}
TEST_F(WifiChipV1IfaceCombinationTest, ApMode_CreateP2p_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_TRUE(createIface(IfaceType::STA).empty());
}
TEST_F(WifiChipV1IfaceCombinationTest, ApMode_CreateNan_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_TRUE(createIface(IfaceType::NAN).empty());
}
@@ -357,46 +362,46 @@
};
TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateSta_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_EQ(createIface(IfaceType::STA), "wlan0");
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateP2p_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::P2P).empty());
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateNan_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::NAN).empty());
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateAp_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_TRUE(createIface(IfaceType::AP).empty());
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateStaP2p_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_FALSE(createIface(IfaceType::P2P).empty());
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateStaNan_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_FALSE(createIface(IfaceType::NAN).empty());
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateStaP2PNan_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_FALSE(createIface(IfaceType::P2P).empty());
ASSERT_TRUE(createIface(IfaceType::NAN).empty());
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateStaNan_AfterP2pRemove_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
const auto p2p_iface_name = createIface(IfaceType::P2P);
ASSERT_FALSE(p2p_iface_name.empty());
@@ -408,7 +413,7 @@
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateStaP2p_AfterNanRemove_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
const auto nan_iface_name = createIface(IfaceType::NAN);
ASSERT_FALSE(nan_iface_name.empty());
@@ -420,50 +425,50 @@
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, ApMode_CreateAp_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_EQ(createIface(IfaceType::AP), "wlan0");
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, ApMode_CreateSta_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_TRUE(createIface(IfaceType::STA).empty());
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, ApMode_CreateP2p_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_TRUE(createIface(IfaceType::STA).empty());
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, ApMode_CreateNan_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_TRUE(createIface(IfaceType::NAN).empty());
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, RttControllerFlowStaModeNoSta) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_TRUE(createRttController());
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, RttControllerFlowStaModeWithSta) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_TRUE(createRttController());
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, RttControllerFlowApToSta) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
const auto ap_iface_name = createIface(IfaceType::AP);
ASSERT_FALSE(ap_iface_name.empty());
ASSERT_FALSE(createRttController());
removeIface(IfaceType::AP, ap_iface_name);
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_TRUE(createRttController());
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, SelectTxScenarioWithOnlySta) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_EQ(createIface(IfaceType::STA), "wlan0");
EXPECT_CALL(*legacy_hal_, selectTxPowerScenario("wlan0", testing::_))
.WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS));
@@ -473,7 +478,7 @@
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, SelectTxScenarioWithOnlyAp) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_EQ(createIface(IfaceType::AP), "wlan0");
EXPECT_CALL(*legacy_hal_, selectTxPowerScenario("wlan0", testing::_))
.WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS));
@@ -496,45 +501,45 @@
};
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateSta_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_EQ(createIface(IfaceType::STA), "wlan0");
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateP2p_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::P2P).empty());
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateNan_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::NAN).empty());
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateAp_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_EQ(createIface(IfaceType::AP), "wlan1");
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaSta_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_EQ(createIface(IfaceType::STA), "wlan0");
ASSERT_TRUE(createIface(IfaceType::STA).empty());
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaAp_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_EQ(createIface(IfaceType::STA), "wlan0");
ASSERT_EQ(createIface(IfaceType::AP), "wlan1");
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateApSta_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_EQ(createIface(IfaceType::AP), "wlan1");
ASSERT_EQ(createIface(IfaceType::STA), "wlan0");
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateSta_AfterStaApRemove_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
const auto sta_iface_name = createIface(IfaceType::STA);
ASSERT_FALSE(sta_iface_name.empty());
const auto ap_iface_name = createIface(IfaceType::AP);
@@ -549,26 +554,26 @@
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaP2p_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_FALSE(createIface(IfaceType::P2P).empty());
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaNan_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_FALSE(createIface(IfaceType::NAN).empty());
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaP2PNan_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_FALSE(createIface(IfaceType::P2P).empty());
ASSERT_TRUE(createIface(IfaceType::NAN).empty());
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaNan_AfterP2pRemove_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
const auto p2p_iface_name = createIface(IfaceType::P2P);
ASSERT_FALSE(p2p_iface_name.empty());
@@ -580,7 +585,7 @@
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaP2p_AfterNanRemove_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
const auto nan_iface_name = createIface(IfaceType::NAN);
ASSERT_FALSE(nan_iface_name.empty());
@@ -592,19 +597,19 @@
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateApNan_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_FALSE(createIface(IfaceType::AP).empty());
ASSERT_TRUE(createIface(IfaceType::NAN).empty());
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateApP2p_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_FALSE(createIface(IfaceType::AP).empty());
ASSERT_TRUE(createIface(IfaceType::P2P).empty());
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, StaMode_CreateStaNan_AfterP2pRemove_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
const auto p2p_iface_name = createIface(IfaceType::P2P);
ASSERT_FALSE(p2p_iface_name.empty());
@@ -616,7 +621,7 @@
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, StaMode_CreateStaP2p_AfterNanRemove_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
const auto nan_iface_name = createIface(IfaceType::NAN);
ASSERT_FALSE(nan_iface_name.empty());
@@ -628,7 +633,7 @@
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaAp_EnsureDifferentIfaceNames) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
const auto sta_iface_name = createIface(IfaceType::STA);
const auto ap_iface_name = createIface(IfaceType::AP);
ASSERT_FALSE(sta_iface_name.empty());
@@ -637,25 +642,25 @@
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, RttControllerFlowStaModeNoSta) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_TRUE(createRttController());
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, RttControllerFlowStaModeWithSta) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_TRUE(createRttController());
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, RttControllerFlow) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_FALSE(createIface(IfaceType::AP).empty());
ASSERT_TRUE(createRttController());
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, SelectTxScenarioWithOnlySta) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_EQ(createIface(IfaceType::STA), "wlan0");
EXPECT_CALL(*legacy_hal_, selectTxPowerScenario("wlan0", testing::_))
.WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS));
@@ -665,7 +670,7 @@
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, SelectTxScenarioWithOnlyAp) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_EQ(createIface(IfaceType::AP), "wlan1");
EXPECT_CALL(*legacy_hal_, selectTxPowerScenario("wlan1", testing::_))
.WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS));
@@ -675,7 +680,7 @@
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, InvalidateAndRemoveNanOnStaRemove) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_EQ(createIface(IfaceType::STA), "wlan0");
// Create NAN iface
@@ -711,7 +716,7 @@
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, InvalidateAndRemoveRttControllerOnStaRemove) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_EQ(createIface(IfaceType::STA), "wlan0");
// Create RTT controller
@@ -735,7 +740,7 @@
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateNanWithSharedNanIface) {
property_set("wifi.aware.interface", nullptr);
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_EQ(createIface(IfaceType::STA), "wlan0");
ASSERT_EQ(createIface(IfaceType::NAN), "wlan0");
removeIface(IfaceType::NAN, "wlan0");
@@ -744,7 +749,7 @@
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateNanWithDedicatedNanIface) {
property_set("wifi.aware.interface", "aware0");
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_EQ(createIface(IfaceType::STA), "wlan0");
EXPECT_CALL(*iface_util_, ifNameToIndex("aware0")).WillOnce(testing::Return(4));
EXPECT_CALL(*iface_util_, setUpState("aware0", true)).WillOnce(testing::Return(true));
@@ -764,7 +769,7 @@
};
TEST_F(WifiChipV1_AwareDisabledApIfaceCombinationTest, StaMode_CreateSta_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_TRUE(createIface(IfaceType::AP).empty());
}
@@ -779,7 +784,7 @@
};
TEST_F(WifiChipV2_AwareDisabledApIfaceCombinationTest, CreateSta_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_TRUE(createIface(IfaceType::AP).empty());
}
@@ -794,7 +799,7 @@
};
TEST_F(WifiChip_MultiIfaceTest, Create3Sta) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_FALSE(createIface(IfaceType::STA).empty());
@@ -807,7 +812,7 @@
property_set("wifi.interface.2", "");
property_set("wifi.interface", "");
property_set("wifi.concurrent.interface", "");
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_EQ(createIface(IfaceType::STA), "wlan0");
ASSERT_EQ(createIface(IfaceType::STA), "wlan1");
ASSERT_EQ(createIface(IfaceType::STA), "wlan2");
@@ -819,7 +824,7 @@
property_set("wifi.interface.2", "test2");
property_set("wifi.interface", "bad0");
property_set("wifi.concurrent.interface", "bad1");
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_EQ(createIface(IfaceType::STA), "bad0");
ASSERT_EQ(createIface(IfaceType::STA), "bad1");
ASSERT_EQ(createIface(IfaceType::STA), "test2");
@@ -831,14 +836,14 @@
property_set("wifi.interface.2", "");
property_set("wifi.interface", "testA0");
property_set("wifi.concurrent.interface", "testA1");
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_EQ(createIface(IfaceType::STA), "testA0");
ASSERT_EQ(createIface(IfaceType::STA), "testA1");
ASSERT_EQ(createIface(IfaceType::STA), "wlan2");
}
TEST_F(WifiChip_MultiIfaceTest, CreateApStartsWithIdx1) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
// First AP will be slotted to wlan1.
ASSERT_EQ(createIface(IfaceType::AP), "wlan1");
// First STA will be slotted to wlan0.
diff --git a/wifi/1.6/default/wifi_chip.cpp b/wifi/1.6/default/wifi_chip.cpp
index 4fff770..0e2accf 100644
--- a/wifi/1.6/default/wifi_chip.cpp
+++ b/wifi/1.6/default/wifi_chip.cpp
@@ -728,6 +728,11 @@
&WifiChip::getSupportedRadioCombinationsMatrixInternal, hidl_status_cb);
}
+Return<void> WifiChip::getAvailableModes_1_6(getAvailableModes_1_6_cb hidl_status_cb) {
+ return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
+ &WifiChip::getAvailableModesInternal_1_6, hidl_status_cb);
+}
+
void WifiChip::invalidateAndRemoveAllIfaces() {
invalidateAndClearBridgedApAll();
invalidateAndClearAll(ap_ifaces_);
@@ -784,9 +789,10 @@
return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), 0};
}
-std::pair<WifiStatus, std::vector<V1_4::IWifiChip::ChipMode>>
+std::pair<WifiStatus, std::vector<V1_0::IWifiChip::ChipMode>>
WifiChip::getAvailableModesInternal() {
- return {createWifiStatus(WifiStatusCode::SUCCESS), modes_};
+ // Deprecated support -- use getAvailableModes_1_6.
+ return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}};
}
WifiStatus WifiChip::configureChipInternal(
@@ -910,7 +916,7 @@
}
std::pair<WifiStatus, sp<V1_5::IWifiApIface>> WifiChip::createApIfaceInternal() {
- if (!canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType::AP)) {
+ if (!canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType::AP)) {
return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}};
}
std::string ifname = allocateApIfaceName();
@@ -923,7 +929,7 @@
}
std::pair<WifiStatus, sp<V1_5::IWifiApIface>> WifiChip::createBridgedApIfaceInternal() {
- if (!canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType::AP)) {
+ if (!canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType::AP_BRIDGED)) {
return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}};
}
std::vector<std::string> ap_instances = allocateBridgedApInstanceNames();
@@ -1040,7 +1046,7 @@
}
std::pair<WifiStatus, sp<V1_4::IWifiNanIface>> WifiChip::createNanIfaceInternal() {
- if (!canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType::NAN)) {
+ if (!canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType::NAN)) {
return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}};
}
bool is_dedicated_iface = true;
@@ -1092,7 +1098,7 @@
}
std::pair<WifiStatus, sp<IWifiP2pIface>> WifiChip::createP2pIfaceInternal() {
- if (!canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType::P2P)) {
+ if (!canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType::P2P)) {
return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}};
}
std::string ifname = getPredefinedP2pIfaceName();
@@ -1136,7 +1142,7 @@
}
std::pair<WifiStatus, sp<V1_6::IWifiStaIface>> WifiChip::createStaIfaceInternal() {
- if (!canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType::STA)) {
+ if (!canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType::STA)) {
return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}};
}
std::string ifname = allocateStaIfaceName();
@@ -1436,7 +1442,8 @@
std::pair<WifiStatus, sp<V1_6::IWifiRttController>> WifiChip::createRttControllerInternal_1_6(
const sp<IWifiIface>& bound_iface) {
- if (sta_ifaces_.size() == 0 && !canCurrentModeSupportIfaceOfType(IfaceType::STA)) {
+ if (sta_ifaces_.size() == 0 &&
+ !canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType::STA)) {
LOG(ERROR) << "createRttControllerInternal_1_6: Chip cannot support STAs "
"(and RTT by extension)";
return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}};
@@ -1489,6 +1496,11 @@
return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_matrix};
}
+std::pair<WifiStatus, std::vector<V1_6::IWifiChip::ChipMode>>
+WifiChip::getAvailableModesInternal_1_6() {
+ return {createWifiStatus(WifiStatusCode::SUCCESS), modes_};
+}
+
WifiStatus WifiChip::handleChipConfiguration(
/* NONNULL */ std::unique_lock<std::recursive_mutex>* lock, ChipModeId mode_id) {
// If the chip is already configured in a different mode, stop
@@ -1606,7 +1618,8 @@
return createWifiStatusFromLegacyError(legacy_status);
}
-std::vector<V1_4::IWifiChip::ChipIfaceCombination> WifiChip::getCurrentModeIfaceCombinations() {
+std::vector<V1_6::IWifiChip::ChipConcurrencyCombination>
+WifiChip::getCurrentModeConcurrencyCombinations() {
if (!isValidModeId(current_mode_id_)) {
LOG(ERROR) << "Chip not configured in a mode yet";
return {};
@@ -1616,27 +1629,39 @@
return mode.availableCombinations;
}
}
- CHECK(0) << "Expected to find iface combinations for current mode!";
+ CHECK(0) << "Expected to find concurrency combinations for current mode!";
return {};
}
-// Returns a map indexed by IfaceType with the number of ifaces currently
-// created of the corresponding type.
-std::map<IfaceType, size_t> WifiChip::getCurrentIfaceCombination() {
- std::map<IfaceType, size_t> iface_counts;
- iface_counts[IfaceType::AP] = ap_ifaces_.size();
- iface_counts[IfaceType::NAN] = nan_ifaces_.size();
- iface_counts[IfaceType::P2P] = p2p_ifaces_.size();
- iface_counts[IfaceType::STA] = sta_ifaces_.size();
+// Returns a map indexed by IfaceConcurrencyType with the number of ifaces currently
+// created of the corresponding concurrency type.
+std::map<IfaceConcurrencyType, size_t> WifiChip::getCurrentConcurrencyCombination() {
+ std::map<IfaceConcurrencyType, size_t> iface_counts;
+ uint32_t num_ap = 0;
+ uint32_t num_ap_bridged = 0;
+ for (const auto& ap_iface : ap_ifaces_) {
+ std::string ap_iface_name = ap_iface->getName();
+ if (br_ifaces_ap_instances_.count(ap_iface_name) > 0 &&
+ br_ifaces_ap_instances_[ap_iface_name].size() > 1) {
+ num_ap_bridged++;
+ } else {
+ num_ap++;
+ }
+ }
+ iface_counts[IfaceConcurrencyType::AP] = num_ap;
+ iface_counts[IfaceConcurrencyType::AP_BRIDGED] = num_ap_bridged;
+ iface_counts[IfaceConcurrencyType::NAN] = nan_ifaces_.size();
+ iface_counts[IfaceConcurrencyType::P2P] = p2p_ifaces_.size();
+ iface_counts[IfaceConcurrencyType::STA] = sta_ifaces_.size();
return iface_counts;
}
-// This expands the provided iface combinations to a more parseable
+// This expands the provided concurrency combinations to a more parseable
// form. Returns a vector of available combinations possible with the number
-// of ifaces of each type in the combination.
-// This method is a port of HalDeviceManager.expandIfaceCombos() from framework.
-std::vector<std::map<IfaceType, size_t>> WifiChip::expandIfaceCombinations(
- const V1_4::IWifiChip::ChipIfaceCombination& combination) {
+// of each concurrency type in the combination.
+// This method is a port of HalDeviceManager.expandConcurrencyCombos() from framework.
+std::vector<std::map<IfaceConcurrencyType, size_t>> WifiChip::expandConcurrencyCombinations(
+ const V1_6::IWifiChip::ChipConcurrencyCombination& combination) {
uint32_t num_expanded_combos = 1;
for (const auto& limit : combination.limits) {
for (uint32_t i = 0; i < limit.maxIfaces; i++) {
@@ -1644,12 +1669,14 @@
}
}
- // Allocate the vector of expanded combos and reset all iface counts to 0
+ // Allocate the vector of expanded combos and reset all concurrency type counts to 0
// in each combo.
- std::vector<std::map<IfaceType, size_t>> expanded_combos;
+ std::vector<std::map<IfaceConcurrencyType, size_t>> expanded_combos;
expanded_combos.resize(num_expanded_combos);
for (auto& expanded_combo : expanded_combos) {
- for (const auto type : {IfaceType::AP, IfaceType::NAN, IfaceType::P2P, IfaceType::STA}) {
+ for (const auto type :
+ {IfaceConcurrencyType::AP, IfaceConcurrencyType::AP_BRIDGED, IfaceConcurrencyType::NAN,
+ IfaceConcurrencyType::P2P, IfaceConcurrencyType::STA}) {
expanded_combo[type] = 0;
}
}
@@ -1666,12 +1693,15 @@
return expanded_combos;
}
-bool WifiChip::canExpandedIfaceComboSupportIfaceOfTypeWithCurrentIfaces(
- const std::map<IfaceType, size_t>& expanded_combo, IfaceType requested_type) {
- const auto current_combo = getCurrentIfaceCombination();
+bool WifiChip::canExpandedConcurrencyComboSupportConcurrencyTypeWithCurrentTypes(
+ const std::map<IfaceConcurrencyType, size_t>& expanded_combo,
+ IfaceConcurrencyType requested_type) {
+ const auto current_combo = getCurrentConcurrencyCombination();
// Check if we have space for 1 more iface of |type| in this combo
- for (const auto type : {IfaceType::AP, IfaceType::NAN, IfaceType::P2P, IfaceType::STA}) {
+ for (const auto type :
+ {IfaceConcurrencyType::AP, IfaceConcurrencyType::AP_BRIDGED, IfaceConcurrencyType::NAN,
+ IfaceConcurrencyType::P2P, IfaceConcurrencyType::STA}) {
size_t num_ifaces_needed = current_combo.at(type);
if (type == requested_type) {
num_ifaces_needed++;
@@ -1685,21 +1715,22 @@
}
// This method does the following:
-// a) Enumerate all possible iface combos by expanding the current
-// ChipIfaceCombination.
-// b) Check if the requested iface type can be added to the current mode
-// with the iface combination that is already active.
-bool WifiChip::canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType requested_type) {
+// a) Enumerate all possible concurrency combos by expanding the current
+// ChipConcurrencyCombination.
+// b) Check if the requested concurrency type can be added to the current mode
+// with the concurrency combination that is already active.
+bool WifiChip::canCurrentModeSupportConcurrencyTypeWithCurrentTypes(
+ IfaceConcurrencyType requested_type) {
if (!isValidModeId(current_mode_id_)) {
LOG(ERROR) << "Chip not configured in a mode yet";
return false;
}
- const auto combinations = getCurrentModeIfaceCombinations();
+ const auto combinations = getCurrentModeConcurrencyCombinations();
for (const auto& combination : combinations) {
- const auto expanded_combos = expandIfaceCombinations(combination);
+ const auto expanded_combos = expandConcurrencyCombinations(combination);
for (const auto& expanded_combo : expanded_combos) {
- if (canExpandedIfaceComboSupportIfaceOfTypeWithCurrentIfaces(expanded_combo,
- requested_type)) {
+ if (canExpandedConcurrencyComboSupportConcurrencyTypeWithCurrentTypes(expanded_combo,
+ requested_type)) {
return true;
}
}
@@ -1707,15 +1738,17 @@
return false;
}
-// Note: This does not consider ifaces already active. It only checks if the
-// provided expanded iface combination can support the requested combo.
-bool WifiChip::canExpandedIfaceComboSupportIfaceCombo(
- const std::map<IfaceType, size_t>& expanded_combo,
- const std::map<IfaceType, size_t>& req_combo) {
- // Check if we have space for 1 more iface of |type| in this combo
- for (const auto type : {IfaceType::AP, IfaceType::NAN, IfaceType::P2P, IfaceType::STA}) {
+// Note: This does not consider concurrency types already active. It only checks if the
+// provided expanded concurrency combination can support the requested combo.
+bool WifiChip::canExpandedConcurrencyComboSupportConcurrencyCombo(
+ const std::map<IfaceConcurrencyType, size_t>& expanded_combo,
+ const std::map<IfaceConcurrencyType, size_t>& req_combo) {
+ // Check if we have space for 1 more |type| in this combo
+ for (const auto type :
+ {IfaceConcurrencyType::AP, IfaceConcurrencyType::AP_BRIDGED, IfaceConcurrencyType::NAN,
+ IfaceConcurrencyType::P2P, IfaceConcurrencyType::STA}) {
if (req_combo.count(type) == 0) {
- // Iface of "type" not in the req_combo.
+ // Concurrency type not in the req_combo.
continue;
}
size_t num_ifaces_needed = req_combo.at(type);
@@ -1727,21 +1760,22 @@
return true;
}
// This method does the following:
-// a) Enumerate all possible iface combos by expanding the current
-// ChipIfaceCombination.
-// b) Check if the requested iface combo can be added to the current mode.
-// Note: This does not consider ifaces already active. It only checks if the
+// a) Enumerate all possible concurrency combos by expanding the current
+// ChipConcurrencyCombination.
+// b) Check if the requested concurrency combo can be added to the current mode.
+// Note: This does not consider concurrency types already active. It only checks if the
// current mode can support the requested combo.
-bool WifiChip::canCurrentModeSupportIfaceCombo(const std::map<IfaceType, size_t>& req_combo) {
+bool WifiChip::canCurrentModeSupportConcurrencyCombo(
+ const std::map<IfaceConcurrencyType, size_t>& req_combo) {
if (!isValidModeId(current_mode_id_)) {
LOG(ERROR) << "Chip not configured in a mode yet";
return false;
}
- const auto combinations = getCurrentModeIfaceCombinations();
+ const auto combinations = getCurrentModeConcurrencyCombinations();
for (const auto& combination : combinations) {
- const auto expanded_combos = expandIfaceCombinations(combination);
+ const auto expanded_combos = expandConcurrencyCombinations(combination);
for (const auto& expanded_combo : expanded_combos) {
- if (canExpandedIfaceComboSupportIfaceCombo(expanded_combo, req_combo)) {
+ if (canExpandedConcurrencyComboSupportConcurrencyCombo(expanded_combo, req_combo)) {
return true;
}
}
@@ -1750,14 +1784,14 @@
}
// This method does the following:
-// a) Enumerate all possible iface combos by expanding the current
-// ChipIfaceCombination.
-// b) Check if the requested iface type can be added to the current mode.
-bool WifiChip::canCurrentModeSupportIfaceOfType(IfaceType requested_type) {
- // Check if we can support at least 1 iface of type.
- std::map<IfaceType, size_t> req_iface_combo;
+// a) Enumerate all possible concurrency combos by expanding the current
+// ChipConcurrencyCombination.
+// b) Check if the requested concurrency type can be added to the current mode.
+bool WifiChip::canCurrentModeSupportConcurrencyType(IfaceConcurrencyType requested_type) {
+ // Check if we can support at least 1 of the requested concurrency type.
+ std::map<IfaceConcurrencyType, size_t> req_iface_combo;
req_iface_combo[requested_type] = 1;
- return canCurrentModeSupportIfaceCombo(req_iface_combo);
+ return canCurrentModeSupportConcurrencyCombo(req_iface_combo);
}
bool WifiChip::isValidModeId(ChipModeId mode_id) {
@@ -1771,17 +1805,17 @@
bool WifiChip::isStaApConcurrencyAllowedInCurrentMode() {
// Check if we can support at least 1 STA & 1 AP concurrently.
- std::map<IfaceType, size_t> req_iface_combo;
- req_iface_combo[IfaceType::AP] = 1;
- req_iface_combo[IfaceType::STA] = 1;
- return canCurrentModeSupportIfaceCombo(req_iface_combo);
+ std::map<IfaceConcurrencyType, size_t> req_iface_combo;
+ req_iface_combo[IfaceConcurrencyType::STA] = 1;
+ req_iface_combo[IfaceConcurrencyType::AP] = 1;
+ return canCurrentModeSupportConcurrencyCombo(req_iface_combo);
}
bool WifiChip::isDualStaConcurrencyAllowedInCurrentMode() {
// Check if we can support at least 2 STA concurrently.
- std::map<IfaceType, size_t> req_iface_combo;
- req_iface_combo[IfaceType::STA] = 2;
- return canCurrentModeSupportIfaceCombo(req_iface_combo);
+ std::map<IfaceConcurrencyType, size_t> req_iface_combo;
+ req_iface_combo[IfaceConcurrencyType::STA] = 2;
+ return canCurrentModeSupportConcurrencyCombo(req_iface_combo);
}
std::string WifiChip::getFirstActiveWlanIfaceName() {
diff --git a/wifi/1.6/default/wifi_chip.h b/wifi/1.6/default/wifi_chip.h
index 13d62fb..f952a68 100644
--- a/wifi/1.6/default/wifi_chip.h
+++ b/wifi/1.6/default/wifi_chip.h
@@ -17,6 +17,11 @@
#ifndef WIFI_CHIP_H_
#define WIFI_CHIP_H_
+// HACK: NAN is a macro defined in math.h, which can be included in various
+// headers. This wifi HAL uses an enum called NAN, which does not compile when
+// the macro is defined. Undefine NAN to work around it.
+#undef NAN
+
#include <list>
#include <map>
#include <mutex>
@@ -162,6 +167,7 @@
getUsableChannels_1_6_cb _hidl_cb) override;
Return<void> getSupportedRadioCombinationsMatrix(
getSupportedRadioCombinationsMatrix_cb hidl_status_cb) override;
+ Return<void> getAvailableModes_1_6(getAvailableModes_1_6_cb hidl_status_cb) override;
private:
void invalidateAndRemoveAllIfaces();
@@ -175,7 +181,7 @@
WifiStatus registerEventCallbackInternal(
const sp<V1_0::IWifiChipEventCallback>& event_callback);
std::pair<WifiStatus, uint32_t> getCapabilitiesInternal();
- std::pair<WifiStatus, std::vector<ChipMode>> getAvailableModesInternal();
+ std::pair<WifiStatus, std::vector<V1_0::IWifiChip::ChipMode>> getAvailableModesInternal();
WifiStatus configureChipInternal(std::unique_lock<std::recursive_mutex>* lock,
ChipModeId mode_id);
std::pair<WifiStatus, uint32_t> getModeInternal();
@@ -239,17 +245,21 @@
ChipModeId mode_id);
WifiStatus registerDebugRingBufferCallback();
WifiStatus registerRadioModeChangeCallback();
- std::vector<V1_4::IWifiChip::ChipIfaceCombination> getCurrentModeIfaceCombinations();
- std::map<IfaceType, size_t> getCurrentIfaceCombination();
- std::vector<std::map<IfaceType, size_t>> expandIfaceCombinations(
- const V1_4::IWifiChip::ChipIfaceCombination& combination);
- bool canExpandedIfaceComboSupportIfaceOfTypeWithCurrentIfaces(
- const std::map<IfaceType, size_t>& expanded_combo, IfaceType requested_type);
- bool canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType requested_type);
- bool canExpandedIfaceComboSupportIfaceCombo(const std::map<IfaceType, size_t>& expanded_combo,
- const std::map<IfaceType, size_t>& req_combo);
- bool canCurrentModeSupportIfaceCombo(const std::map<IfaceType, size_t>& req_combo);
- bool canCurrentModeSupportIfaceOfType(IfaceType requested_type);
+ std::vector<V1_6::IWifiChip::ChipConcurrencyCombination>
+ getCurrentModeConcurrencyCombinations();
+ std::map<IfaceConcurrencyType, size_t> getCurrentConcurrencyCombination();
+ std::vector<std::map<IfaceConcurrencyType, size_t>> expandConcurrencyCombinations(
+ const V1_6::IWifiChip::ChipConcurrencyCombination& combination);
+ bool canExpandedConcurrencyComboSupportConcurrencyTypeWithCurrentTypes(
+ const std::map<IfaceConcurrencyType, size_t>& expanded_combo,
+ IfaceConcurrencyType requested_type);
+ bool canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType requested_type);
+ bool canExpandedConcurrencyComboSupportConcurrencyCombo(
+ const std::map<IfaceConcurrencyType, size_t>& expanded_combo,
+ const std::map<IfaceConcurrencyType, size_t>& req_combo);
+ bool canCurrentModeSupportConcurrencyCombo(
+ const std::map<IfaceConcurrencyType, size_t>& req_combo);
+ bool canCurrentModeSupportConcurrencyType(IfaceConcurrencyType requested_type);
bool isValidModeId(ChipModeId mode_id);
bool isStaApConcurrencyAllowedInCurrentMode();
bool isDualStaConcurrencyAllowedInCurrentMode();
@@ -270,6 +280,7 @@
std::pair<WifiStatus, std::vector<V1_6::WifiUsableChannel>> getUsableChannelsInternal_1_6(
WifiBand band, uint32_t ifaceModeMask, uint32_t filterMask);
std::pair<WifiStatus, WifiRadioCombinationMatrix> getSupportedRadioCombinationsMatrixInternal();
+ std::pair<WifiStatus, std::vector<V1_6::IWifiChip::ChipMode>> getAvailableModesInternal_1_6();
ChipId chip_id_;
std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal_;
@@ -285,7 +296,7 @@
// Members pertaining to chip configuration.
uint32_t current_mode_id_;
std::mutex lock_t;
- std::vector<V1_4::IWifiChip::ChipMode> modes_;
+ std::vector<V1_6::IWifiChip::ChipMode> modes_;
// The legacy ring buffer callback API has only a global callback
// registration mechanism. Use this to check if we have already
// registered a callback.
diff --git a/wifi/1.6/default/wifi_feature_flags.cpp b/wifi/1.6/default/wifi_feature_flags.cpp
index 71319e1..e80a3cd 100644
--- a/wifi/1.6/default/wifi_feature_flags.cpp
+++ b/wifi/1.6/default/wifi_feature_flags.cpp
@@ -29,8 +29,8 @@
namespace feature_flags {
using V1_0::ChipModeId;
-using V1_0::IfaceType;
using V1_0::IWifiChip;
+using V1_6::IfaceConcurrencyType;
/* The chip may either have a single mode supporting any number of combinations,
* or a fixed dual-mode (so it involves firmware loading to switch between
@@ -42,9 +42,9 @@
* WIFI_HAL_INTERFACE_COMBINATIONS := {{{STA, AP}, 1}, {{P2P, NAN}, 1}},
* WIFI_HAL_INTERFACE_COMBINATIONS += {{{STA}, 1}, {{AP}, 2}}
* What means:
- * Interface combination 1: 1 STA or AP and 1 P2P or NAN concurrent iface
+ * Interface concurrency combination 1: 1 STA or AP and 1 P2P or NAN concurrent iface
* operations.
- * Interface combination 2: 1 STA and 2 AP concurrent iface operations.
+ * Interface concurrency combination 2: 1 STA and 2 AP concurrent iface operations.
*
* For backward compatibility, the following makefile flags can be used to
* generate combinations list:
@@ -53,20 +53,20 @@
* - WIFI_HIDL_FEATURE_AWARE
* However, they are ignored if WIFI_HAL_INTERFACE_COMBINATIONS was provided.
* With WIFI_HIDL_FEATURE_DUAL_INTERFACE flag set, there is a single mode with
- * two interface combinations:
- * Interface Combination 1: Will support 1 STA and 1 P2P or NAN (optional)
+ * two concurrency combinations:
+ * Interface Concurrency Combination 1: Will support 1 STA and 1 P2P or NAN (optional)
* concurrent iface operations.
- * Interface Combination 2: Will support 1 STA and 1 AP concurrent
+ * Interface Concurrency Combination 2: Will support 1 STA and 1 AP concurrent
* iface operations.
*
* The only dual-mode configuration supported is for alternating STA and AP
* mode, that may involve firmware reloading. In such case, there are 2 separate
- * modes of operation with 1 interface combination each:
+ * modes of operation with 1 concurrency combination each:
* Mode 1 (STA mode): Will support 1 STA and 1 P2P or NAN (optional)
* concurrent iface operations.
* Mode 2 (AP mode): Will support 1 AP iface operation.
*
- * If Aware is enabled, the iface combination will be modified to support either
+ * If Aware is enabled, the concurrency combination will be modified to support either
* P2P or NAN in place of just P2P.
*/
// clang-format off
@@ -117,79 +117,87 @@
* The main point here is to simplify the syntax required by
* WIFI_HAL_INTERFACE_COMBINATIONS.
*/
-struct ChipIfaceCombination : public hidl_vec<IWifiChip::ChipIfaceCombinationLimit> {
- ChipIfaceCombination(const std::initializer_list<IWifiChip::ChipIfaceCombinationLimit> list)
+struct ChipConcurrencyCombination
+ : public hidl_vec<V1_6::IWifiChip::ChipConcurrencyCombinationLimit> {
+ ChipConcurrencyCombination(
+ const std::initializer_list<V1_6::IWifiChip::ChipConcurrencyCombinationLimit> list)
: hidl_vec(list) {}
- operator IWifiChip::ChipIfaceCombination() const { return {*this}; }
+ operator V1_6::IWifiChip::ChipConcurrencyCombination() const { return {*this}; }
- static hidl_vec<IWifiChip::ChipIfaceCombination> make_vec(
- const std::initializer_list<ChipIfaceCombination> list) {
- return hidl_vec<IWifiChip::ChipIfaceCombination>( //
+ static hidl_vec<V1_6::IWifiChip::ChipConcurrencyCombination> make_vec(
+ const std::initializer_list<ChipConcurrencyCombination> list) {
+ return hidl_vec<V1_6::IWifiChip::ChipConcurrencyCombination>( //
std::begin(list), std::end(list));
}
};
-#define STA IfaceType::STA
-#define AP IfaceType::AP
-#define P2P IfaceType::P2P
-#define NAN IfaceType::NAN
-static const std::vector<IWifiChip::ChipMode> kChipModesPrimary{
- {kMainModeId, ChipIfaceCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS})},
+#define STA IfaceConcurrencyType::STA
+#define AP IfaceConcurrencyType::AP
+#define AP_BRIDGED IfaceConcurrencyType::AP_BRIDGED
+#define P2P IfaceConcurrencyType::P2P
+#define NAN IfaceConcurrencyType::NAN
+static const std::vector<V1_6::IWifiChip::ChipMode> kChipModesPrimary{
+ {kMainModeId, ChipConcurrencyCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS})},
#ifdef WIFI_HAL_INTERFACE_COMBINATIONS_AP
{chip_mode_ids::kV1Ap,
- ChipIfaceCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS_AP})},
+ ChipConcurrencyCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS_AP})},
#endif
};
-static const std::vector<IWifiChip::ChipMode> kChipModesSecondary{
+static const std::vector<V1_6::IWifiChip::ChipMode> kChipModesSecondary{
#ifdef WIFI_HAL_INTERFACE_COMBINATIONS_SECONDARY_CHIP
{chip_mode_ids::kV3,
- ChipIfaceCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS_SECONDARY_CHIP})},
+ ChipConcurrencyCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS_SECONDARY_CHIP})},
#endif
};
constexpr char kDebugPresetInterfaceCombinationIdxProperty[] =
"persist.vendor.debug.wifi.hal.preset_interface_combination_idx";
-// List of pre-defined interface combinations that can be enabled at runtime via
+// List of pre-defined concurrency combinations that can be enabled at runtime via
// setting the property: "kDebugPresetInterfaceCombinationIdxProperty" to the
// corresponding index value.
-static const std::vector<std::pair<std::string, std::vector<IWifiChip::ChipMode>>> kDebugChipModes{
- // Legacy combination - No STA/AP concurrencies.
- // 0 - (1 AP) or (1 STA + 1 of (P2P or NAN))
- {"No STA/AP Concurrency",
- {{kMainModeId,
- ChipIfaceCombination::make_vec({{{{AP}, 1}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}},
+static const std::vector<std::pair<std::string, std::vector<V1_6::IWifiChip::ChipMode>>>
+ kDebugChipModes{// Legacy combination - No STA/AP concurrencies.
+ // 0 - (1 AP) or (1 STA + 1 of (P2P or NAN))
+ {"No STA/AP Concurrency",
+ {{kMainModeId, ChipConcurrencyCombination::make_vec(
+ {{{{AP}, 1}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}},
- // STA + AP concurrency
- // 1 - (1 STA + 1 AP) or (1 STA + 1 of (P2P or NAN))
- {"STA + AP Concurrency",
- {{kMainModeId, ChipIfaceCombination::make_vec(
- {{{{STA}, 1}, {{AP}, 1}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}},
+ // STA + AP concurrency
+ // 1 - (1 STA + 1 AP) or (1 STA + 1 of (P2P or NAN))
+ {"STA + AP Concurrency",
+ {{kMainModeId,
+ ChipConcurrencyCombination::make_vec(
+ {{{{STA}, 1}, {{AP}, 1}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}},
- // STA + STA concurrency
- // 2 - (1 STA + 1 AP) or (2 STA + 1 of (P2P or NAN))
- {"Dual STA Concurrency",
- {{kMainModeId, ChipIfaceCombination::make_vec(
- {{{{STA}, 1}, {{AP}, 1}}, {{{STA}, 2}, {{P2P, NAN}, 1}}})}}},
+ // STA + STA concurrency
+ // 2 - (1 STA + 1 AP) or (2 STA + 1 of (P2P or NAN))
+ {"Dual STA Concurrency",
+ {{kMainModeId,
+ ChipConcurrencyCombination::make_vec(
+ {{{{STA}, 1}, {{AP}, 1}}, {{{STA}, 2}, {{P2P, NAN}, 1}}})}}},
- // AP + AP + STA concurrency
- // 3 - (1 STA + 2 AP) or (1 STA + 1 of (P2P or NAN))
- {"Dual AP Concurrency",
- {{kMainModeId, ChipIfaceCombination::make_vec(
- {{{{STA}, 1}, {{AP}, 2}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}},
+ // AP + AP + STA concurrency
+ // 3 - (1 STA + 2 AP) or (1 STA + 1 of (P2P or NAN))
+ {"Dual AP Concurrency",
+ {{kMainModeId,
+ ChipConcurrencyCombination::make_vec(
+ {{{{STA}, 1}, {{AP}, 2}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}},
- // STA + STA concurrency and AP + AP + STA concurrency
- // 4 - (1 STA + 2 AP) or (2 STA + 1 of (P2P or NAN))
- {"Dual STA & Dual AP Concurrency",
- {{kMainModeId, ChipIfaceCombination::make_vec(
- {{{{STA}, 1}, {{AP}, 2}}, {{{STA}, 2}, {{P2P, NAN}, 1}}})}}},
+ // STA + STA concurrency and AP + AP + STA concurrency
+ // 4 - (1 STA + 2 AP) or (2 STA + 1 of (P2P or NAN))
+ {"Dual STA & Dual AP Concurrency",
+ {{kMainModeId,
+ ChipConcurrencyCombination::make_vec(
+ {{{{STA}, 1}, {{AP}, 2}}, {{{STA}, 2}, {{P2P, NAN}, 1}}})}}},
- // STA + STA concurrency
- // 5 - (1 STA + 1 AP (bridged or single) | P2P | NAN), or (2 STA))
- {"Dual STA or STA plus single other interface",
- {{kMainModeId,
- ChipIfaceCombination::make_vec({{{{STA}, 1}, {{P2P, NAN, AP}, 1}}, {{{STA}, 2}}})}}}};
+ // STA + STA concurrency
+ // 5 - (1 STA + 1 AP (bridged or single) | P2P | NAN), or (2 STA))
+ {"Dual STA or STA plus single other interface",
+ {{kMainModeId, ChipConcurrencyCombination::make_vec(
+ {{{{STA}, 1}, {{P2P, NAN, AP, AP_BRIDGED}, 1}},
+ {{{STA}, 2}}})}}}};
#undef STA
#undef AP
@@ -206,13 +214,13 @@
WifiFeatureFlags::WifiFeatureFlags() {}
-std::vector<IWifiChip::ChipMode> WifiFeatureFlags::getChipModesForPrimary() {
+std::vector<V1_6::IWifiChip::ChipMode> WifiFeatureFlags::getChipModesForPrimary() {
std::array<char, PROPERTY_VALUE_MAX> buffer;
auto res = property_get(kDebugPresetInterfaceCombinationIdxProperty, buffer.data(), nullptr);
- // Debug propety not set, use the device preset interface combination.
+ // Debug property not set, use the device preset concurrency combination.
if (res <= 0) return kChipModesPrimary;
- // Debug propety set, use one of the debug preset interface combination.
+ // Debug property set, use one of the debug preset concurrency combination.
unsigned long idx = std::stoul(buffer.data());
if (idx >= kDebugChipModes.size()) {
LOG(ERROR) << "Invalid index set in property: "
@@ -220,14 +228,14 @@
return kChipModesPrimary;
}
std::string name;
- std::vector<IWifiChip::ChipMode> chip_modes;
+ std::vector<V1_6::IWifiChip::ChipMode> chip_modes;
std::tie(name, chip_modes) = kDebugChipModes[idx];
LOG(INFO) << "Using debug chip mode: <" << name
<< "> set via property: " << kDebugPresetInterfaceCombinationIdxProperty;
return chip_modes;
}
-std::vector<IWifiChip::ChipMode> WifiFeatureFlags::getChipModes(bool is_primary) {
+std::vector<V1_6::IWifiChip::ChipMode> WifiFeatureFlags::getChipModes(bool is_primary) {
return (is_primary) ? getChipModesForPrimary() : kChipModesSecondary;
}
diff --git a/wifi/1.6/default/wifi_feature_flags.h b/wifi/1.6/default/wifi_feature_flags.h
index d5844d9..1635341 100644
--- a/wifi/1.6/default/wifi_feature_flags.h
+++ b/wifi/1.6/default/wifi_feature_flags.h
@@ -17,7 +17,7 @@
#ifndef WIFI_FEATURE_FLAGS_H_
#define WIFI_FEATURE_FLAGS_H_
-#include <android/hardware/wifi/1.2/IWifiChip.h>
+#include <android/hardware/wifi/1.6/IWifiChip.h>
namespace android {
namespace hardware {
@@ -42,10 +42,10 @@
WifiFeatureFlags();
virtual ~WifiFeatureFlags() = default;
- virtual std::vector<V1_0::IWifiChip::ChipMode> getChipModes(bool is_primary);
+ virtual std::vector<V1_6::IWifiChip::ChipMode> getChipModes(bool is_primary);
private:
- std::vector<V1_0::IWifiChip::ChipMode> getChipModesForPrimary();
+ std::vector<V1_6::IWifiChip::ChipMode> getChipModesForPrimary();
};
} // namespace feature_flags
diff --git a/wifi/1.6/types.hal b/wifi/1.6/types.hal
index 80fdbd1..aed37fa 100644
--- a/wifi/1.6/types.hal
+++ b/wifi/1.6/types.hal
@@ -1312,3 +1312,29 @@
*/
vec<WifiRadioCombination> radioCombinations;
};
+
+/**
+ * List of interface concurrency types, used in reporting device concurrency capabilities.
+ */
+enum IfaceConcurrencyType : uint32_t {
+ /**
+ * Concurrency type for station mode.
+ */
+ STA,
+ /**
+ * Concurrency type of single-port AP mode.
+ */
+ AP,
+ /**
+ * Concurrency type of two-port bridged AP mode.
+ */
+ AP_BRIDGED,
+ /**
+ * Concurrency type of peer-to-peer mode.
+ */
+ P2P,
+ /**
+ * Concurrency type of neighborhood area network mode.
+ */
+ NAN,
+};