summaryrefslogtreecommitdiff
path: root/wifi
diff options
context:
space:
mode:
authorIsaac Chiou <isaacchiou@google.com>2022-03-16 18:47:01 +0800
committerIsaac Chiou <isaacchiou@google.com>2022-04-21 11:20:44 +0800
commit52afeb68e3d0f2166cde4b173dd890812d01ea61 (patch)
tree0447f61e5e06b27bc3563231f4efad475b3c2a91 /wifi
parent712f48c2176b4833cafb4972478939c8e8f7f04a (diff)
Add HAL APIs for TX power limits
To lower the instantaneous battery current draw of WiFi, we provide a way to allow PowerManager to enable/disable Tx power limits. In the legacy HAL, we call the API in Broadcom HAL to enable/disable WiFi TX power limits. Bug: 215193418 Test: New APIs work fine Change-Id: I1fbe71c3380514e2eba96adc5902d2028a55e006
Diffstat (limited to 'wifi')
-rw-r--r--wifi/1.6/default/wifi_legacy_hal.cpp4
-rw-r--r--wifi/1.6/default/wifi_legacy_hal.h2
-rw-r--r--wifi/1.6/default/wifi_legacy_hal_stubs.cpp1
3 files changed, 7 insertions, 0 deletions
diff --git a/wifi/1.6/default/wifi_legacy_hal.cpp b/wifi/1.6/default/wifi_legacy_hal.cpp
index bb8cf590d9..2211897cd2 100644
--- a/wifi/1.6/default/wifi_legacy_hal.cpp
+++ b/wifi/1.6/default/wifi_legacy_hal.cpp
@@ -1585,6 +1585,10 @@ wifi_error WifiLegacyHal::chreRegisterHandler(const std::string& iface_name,
return status;
}
+wifi_error WifiLegacyHal::enableWifiTxPowerLimits(const std::string& iface_name, bool enable) {
+ return global_func_table_.wifi_enable_tx_power_limits(getIfaceHandle(iface_name), enable);
+}
+
void WifiLegacyHal::invalidate() {
global_handle_ = nullptr;
iface_name_to_handle_.clear();
diff --git a/wifi/1.6/default/wifi_legacy_hal.h b/wifi/1.6/default/wifi_legacy_hal.h
index 6f42f70359..2b923b44a7 100644
--- a/wifi/1.6/default/wifi_legacy_hal.h
+++ b/wifi/1.6/default/wifi_legacy_hal.h
@@ -683,6 +683,8 @@ class WifiLegacyHal {
wifi_error chreRegisterHandler(const std::string& iface_name,
const ChreCallbackHandlers& handler);
+ wifi_error enableWifiTxPowerLimits(const std::string& iface_name, bool enable);
+
private:
// Retrieve interface handles for all the available interfaces.
wifi_error retrieveIfaceHandles();
diff --git a/wifi/1.6/default/wifi_legacy_hal_stubs.cpp b/wifi/1.6/default/wifi_legacy_hal_stubs.cpp
index 5ad22f5803..b3bd37389c 100644
--- a/wifi/1.6/default/wifi_legacy_hal_stubs.cpp
+++ b/wifi/1.6/default/wifi_legacy_hal_stubs.cpp
@@ -166,6 +166,7 @@ bool initHalFuncTableWithStubs(wifi_hal_fn* hal_fn) {
populateStubFor(&hal_fn->wifi_nan_rtt_chre_enable_request);
populateStubFor(&hal_fn->wifi_nan_rtt_chre_disable_request);
populateStubFor(&hal_fn->wifi_chre_register_handler);
+ populateStubFor(&hal_fn->wifi_enable_tx_power_limits);
return true;
}
} // namespace legacy_hal