wifi(implementation): Set/Reset TX power limit

Hookup the HIDL method calls to the respective newly added legacy
HAL functions for setting/resetting TX power limits for SAR
requirements.

Bug: 62437848
Test: VTS test fails because of a bug in Qcom implementation. Working
with Qcom to fix their implementation.
Change-Id: Ia619f5558e44d44fd77d037e72dfc1f6863b51e0
diff --git a/wifi/1.1/default/wifi_chip.cpp b/wifi/1.1/default/wifi_chip.cpp
index 87985c0..2beac26 100644
--- a/wifi/1.1/default/wifi_chip.cpp
+++ b/wifi/1.1/default/wifi_chip.cpp
@@ -387,7 +387,13 @@
 
 std::pair<WifiStatus, uint32_t> WifiChip::getCapabilitiesInternal() {
   legacy_hal::wifi_error legacy_status;
+  uint32_t legacy_feature_set;
   uint32_t legacy_logger_feature_set;
+  std::tie(legacy_status, legacy_feature_set) =
+      legacy_hal_.lock()->getSupportedFeatureSet();
+  if (legacy_status != legacy_hal::WIFI_SUCCESS) {
+    return {createWifiStatusFromLegacyError(legacy_status), 0};
+  }
   std::tie(legacy_status, legacy_logger_feature_set) =
       legacy_hal_.lock()->getLoggerSupportedFeatureSet();
   if (legacy_status != legacy_hal::WIFI_SUCCESS) {
@@ -395,7 +401,7 @@
   }
   uint32_t hidl_caps;
   if (!hidl_struct_util::convertLegacyFeaturesToHidlChipCapabilities(
-          legacy_logger_feature_set, &hidl_caps)) {
+          legacy_feature_set, legacy_logger_feature_set, &hidl_caps)) {
     return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), 0};
   }
   return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_caps};
@@ -818,16 +824,14 @@
   return createWifiStatusFromLegacyError(legacy_status);
 }
 
-WifiStatus WifiChip::setTxPowerLimitInternal(int32_t /* powerInDbm */) {
-  // TODO(b/62437848): Implement this method once we are ready with the
-  // header changes in legacy HAL.
-  return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED);
+WifiStatus WifiChip::setTxPowerLimitInternal(int32_t powerInDbm) {
+  auto legacy_status = legacy_hal_.lock()->setTxPowerLimit(powerInDbm);
+  return createWifiStatusFromLegacyError(legacy_status);
 }
 
 WifiStatus WifiChip::resetTxPowerLimitInternal() {
-  // TODO(b/62437848): Implement this method once we are ready with the
-  // header changes in legacy HAL.
-  return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED);
+  auto legacy_status = legacy_hal_.lock()->resetTxPowerLimit();
+  return createWifiStatusFromLegacyError(legacy_status);
 }
 
 WifiStatus WifiChip::handleChipConfiguration(ChipModeId mode_id) {