summaryrefslogtreecommitdiff
path: root/wifi/1.1/default/hidl_struct_util.cpp
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2017-07-25 08:48:08 -0700
committerRoshan Pius <rpius@google.com>2017-07-27 14:05:03 -0700
commit735ff4319775f5a7b4470ece8e260d4794e608f3 (patch)
treea804c770694b8ed4f7d4694e2fb5cc1e4fc17dad /wifi/1.1/default/hidl_struct_util.cpp
parent5614b96de5d3e0a292dc65a9f569e433f315f27c (diff)
wifi(hidl): Modify the SAR power levels interface
Modifying the interface used to lower the tx power level for meeting SAR requirements based on recommendation from the nexus hardware team. The previous interface passed in a single power value in dBm for meeting SAR requirements. However, the SAR requirements are more complex than that. Based on the connection mode (802.11 a,b,g,n,ac) and the number of streams that are active (MIMO), the SAR power levels are very different. Using the previous interface would mean that we will have to use the lowest power level among all the connection modes to meet the SAR requirements. This would however result in us lowering the power much more than needed (~2 dBm) for many connection modes. Instead, we're switching to a more generic interface where the framework informs the wifi chip that we're entering a special tx power mode scenario (today, there is only 1 for voice call). The chip can then lookup the extensive table of power levels for different connection modes which are pre-populated by the OEM's in the BDF file to set the power level (depending on the scenario framework sends and the active connection mode). Bug: 62437848 Test: Manual tests Change-Id: I5ee3f0d2c130958dbeb352e3b5ad9407f432624f
Diffstat (limited to 'wifi/1.1/default/hidl_struct_util.cpp')
-rw-r--r--wifi/1.1/default/hidl_struct_util.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/wifi/1.1/default/hidl_struct_util.cpp b/wifi/1.1/default/hidl_struct_util.cpp
index 6b93b9ef15..c53cdc596d 100644
--- a/wifi/1.1/default/hidl_struct_util.cpp
+++ b/wifi/1.1/default/hidl_struct_util.cpp
@@ -17,9 +17,6 @@
#include <android-base/logging.h>
#include <utils/SystemClock.h>
-#include <android/hardware/wifi/1.0/IWifiChip.h>
-#include <android/hardware/wifi/1.1/IWifiChip.h>
-
#include "hidl_struct_util.h"
namespace android {
@@ -260,6 +257,15 @@ bool convertLegacyWakeReasonStatsToHidl(
return true;
}
+legacy_hal::wifi_power_scenario convertHidlTxPowerScenarioToLegacy(
+ V1_1::IWifiChip::TxPowerScenario hidl_scenario) {
+ switch (hidl_scenario) {
+ case V1_1::IWifiChip::TxPowerScenario::VOICE_CALL:
+ return legacy_hal::WIFI_POWER_SCENARIO_VOICE_CALL;
+ };
+ CHECK(false);
+}
+
bool convertLegacyFeaturesToHidlStaCapabilities(
uint32_t legacy_feature_set,
uint32_t legacy_logger_feature_set,