summaryrefslogtreecommitdiff
path: root/wifi/1.6/default/wifi_chip.cpp
diff options
context:
space:
mode:
authorSunil Ravi <sunilravi@google.com>2022-01-24 10:39:56 -0800
committerSunil Ravi <sunilravi@google.com>2022-01-26 23:18:37 -0800
commitef97d23f885d61bb85fa4d9e95633d7b4faf5e5f (patch)
treed29fe5ca4167eff07cd4b2285b07ac50a2f126c7 /wifi/1.6/default/wifi_chip.cpp
parent1aab61da7bc00e259e20ef4d7b39dbcc9d816a86 (diff)
wifi: Get the supported radio combinations matrix
Added API to get the supported radio combinations of the chip. This is mainly to check if the chip is capable of multi band simultaneous operation. For Example in case of a chip which has two radios, where one radio is capable of 2.4GHz 2X2 only and another radio which is capable of either 5GHz or 6GHz 2X2, number of possible radio combinations in this case are 5 and possible combinations are: {{{2G 2X2}}, //Standalone 2G {{5G 2X2}}, //Standalone 5G {{6G 2X2}}, //Standalone 6G {{2G 2X2}, {5G 2X2}}, //2G+5G DBS {{2G 2X2}, {6G 2X2}}} //2G+6G DBS Bug: 208877624 Test: vts test Change-Id: I4c90f80002ca138133a575bca80dfdef2a593ab2
Diffstat (limited to 'wifi/1.6/default/wifi_chip.cpp')
-rw-r--r--wifi/1.6/default/wifi_chip.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/wifi/1.6/default/wifi_chip.cpp b/wifi/1.6/default/wifi_chip.cpp
index a1857246a7..4fff770dd2 100644
--- a/wifi/1.6/default/wifi_chip.cpp
+++ b/wifi/1.6/default/wifi_chip.cpp
@@ -722,6 +722,12 @@ Return<void> WifiChip::getUsableChannels_1_6(
filterMask);
}
+Return<void> WifiChip::getSupportedRadioCombinationsMatrix(
+ getSupportedRadioCombinationsMatrix_cb hidl_status_cb) {
+ return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
+ &WifiChip::getSupportedRadioCombinationsMatrixInternal, hidl_status_cb);
+}
+
void WifiChip::invalidateAndRemoveAllIfaces() {
invalidateAndClearBridgedApAll();
invalidateAndClearAll(ap_ifaces_);
@@ -1461,6 +1467,28 @@ std::pair<WifiStatus, std::vector<V1_6::WifiUsableChannel>> WifiChip::getUsableC
return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_usable_channels};
}
+std::pair<WifiStatus, V1_6::WifiRadioCombinationMatrix>
+WifiChip::getSupportedRadioCombinationsMatrixInternal() {
+ legacy_hal::wifi_error legacy_status;
+ legacy_hal::wifi_radio_combination_matrix* legacy_matrix;
+
+ std::tie(legacy_status, legacy_matrix) =
+ legacy_hal_.lock()->getSupportedRadioCombinationsMatrix();
+ if (legacy_status != legacy_hal::WIFI_SUCCESS) {
+ LOG(ERROR) << "Failed to get SupportedRadioCombinations matrix from legacy HAL: "
+ << legacyErrorToString(legacy_status);
+ return {createWifiStatusFromLegacyError(legacy_status), {}};
+ }
+
+ V1_6::WifiRadioCombinationMatrix hidl_matrix;
+ if (!hidl_struct_util::convertLegacyRadioCombinationsMatrixToHidl(legacy_matrix,
+ &hidl_matrix)) {
+ LOG(ERROR) << "Failed convertLegacyRadioCombinationsMatrixToHidl() ";
+ return {createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS), {}};
+ }
+ return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_matrix};
+}
+
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