summaryrefslogtreecommitdiff
path: root/wifi/1.5/default/wifi_feature_flags.cpp
diff options
context:
space:
mode:
authorJimmy Chen <jimmycmchen@google.com>2019-12-23 17:50:39 +0200
committerJimmy Chen <jimmycmchen@google.com>2020-08-11 14:58:07 +0800
commit2dddd79e1645ea7d2ec41991bd00d6bfe4170ec7 (patch)
tree457d80b18e435d83d7cd4fdf3dea657468598348 /wifi/1.5/default/wifi_feature_flags.cpp
parent7a82ad8c6acffb91750bea53c46a41f82c740950 (diff)
Wifi: support multiple WIFI chips
The WIFI HAL API has support for multiple WIFI chips (IWifiChip instances) however the implementation is hard-coded to support only a single WIFI chip. This change reworks the implementation so multiple WIFI chips will be supported. Support for multiple chips is based on the concept that each chip is represented by its own vendor HAL library. The implementation will look for descriptor files for vendor HAL libraries under /vendor/etc/wifi/vendor_hals. It will parse descriptors, dynamically load vendor HAL libraries and create WifiLegacyHal and WifiChip objects for each loaded vendor HAL library. One of the descriptors should be marked with "primary" flag. The implementation will create the first WifiChip object for this library. Typically it is the one providing the best WIFI functionality, which was previously used as the only WIFI chip. Additional support is added inside WifiChip and WifiLegacyHal for getting available chip modes and concurrency combinations from the vendor HAL if available, and allowing the chip to override network interface name when creating interfaces. The mechanism for getting chip capabilities is improved to allow getting chip-global capabilities, which are independent of any created interfaces. For example, if the framework needs to start a SoftAP on the 60GHz band, it needs to find a chip which supports this band, but before creating any interface on the chip. The new mechanism allows this. Bug: 146922967 Test: atest VtsHalWifiV1_0TargetTest VtsHalWifiNanV1_0TargetTest VtsHalWifiApV1_0TargetTest \ VtsHalWifiV1_1TargetTest \ VtsHalWifiV1_2TargetTest VtsHalWifiNanV1_2TargetTest \ VtsHalWifiV1_3TargetTest \ VtsHalWifiApV1_4TargetTest VtsHalWifiNanV1_4TargetTest VtsHalWifiRttV1_4TargetTest Change-Id: Ibdff93ea56aff186d4b5361ac77f6f448a0dfd45
Diffstat (limited to 'wifi/1.5/default/wifi_feature_flags.cpp')
-rw-r--r--wifi/1.5/default/wifi_feature_flags.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/wifi/1.5/default/wifi_feature_flags.cpp b/wifi/1.5/default/wifi_feature_flags.cpp
index 151d473e46..9f91bd7dc4 100644
--- a/wifi/1.5/default/wifi_feature_flags.cpp
+++ b/wifi/1.5/default/wifi_feature_flags.cpp
@@ -139,6 +139,13 @@ static const std::vector<IWifiChip::ChipMode> kChipModes{
ChipIfaceCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS_AP})},
#endif
};
+
+static const std::vector<IWifiChip::ChipMode> kChipModesSecondary{
+#ifdef WIFI_HAL_INTERFACE_COMBINATIONS_SECONDARY_CHIP
+ {chip_mode_ids::kV3, ChipIfaceCombination::make_vec(
+ {WIFI_HAL_INTERFACE_COMBINATIONS_SECONDARY_CHIP})},
+#endif
+};
#undef STA
#undef AP
#undef P2P
@@ -154,8 +161,9 @@ static const std::vector<IWifiChip::ChipMode> kChipModes{
WifiFeatureFlags::WifiFeatureFlags() {}
-std::vector<IWifiChip::ChipMode> WifiFeatureFlags::getChipModes() {
- return kChipModes;
+std::vector<IWifiChip::ChipMode> WifiFeatureFlags::getChipModes(
+ bool is_primary) {
+ return (is_primary) ? kChipModes : kChipModesSecondary;
}
} // namespace feature_flags