[ALM:11223391] Enable wifi sar mechanism
&&&%%%comment:Enable wifi sar mechanism
&&&%%%bug number:11223391
&&&%%%product name:sm7225_r_fp4
&&&%%%root cause:Coding
&&&%%%Bug category:T2M
&&&%%%Module_Impact:wifi
&&&%%%Test_Suggestion:.
&&&%%%Solution:.
&&&%%%Test_Report:need more test
&&&%%%VAL Can Test:No
diff --git a/qcwcn/wifi_hal/wificonfig.cpp b/qcwcn/wifi_hal/wificonfig.cpp
index 0afa1cd..96e52dd 100644
--- a/qcwcn/wifi_hal/wificonfig.cpp
+++ b/qcwcn/wifi_hal/wificonfig.cpp
@@ -398,6 +398,9 @@
wifi_handle wifiHandle = getWifiHandle(handle);
u32 bdf_file = 0;
+ /* The set(0~4) we will read in bdwlan.bin */
+ u32 set_sar_number = 1;
+ u32 chip_mimo_number = 2;
ALOGV("%s : power scenario:%d", __FUNCTION__, scenario);
wifiConfigCommand = new WiFiConfigCommand(
@@ -435,19 +438,25 @@
switch (scenario) {
case WIFI_POWER_SCENARIO_VOICE_CALL:
case WIFI_POWER_SCENARIO_ON_HEAD_CELL_OFF:
- bdf_file = QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_BDF0;
+ // bdf_file = QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_BDF0;
+ bdf_file = QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_NONE;
+ set_sar_number = 1;
break;
case WIFI_POWER_SCENARIO_ON_HEAD_CELL_ON:
- bdf_file = QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_BDF1;
+ // bdf_file = QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_BDF1;
+ bdf_file = QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_V2_0;
+ set_sar_number = 0;
break;
case WIFI_POWER_SCENARIO_ON_BODY_CELL_OFF:
bdf_file = QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_BDF2;
+ set_sar_number = 3;
break;
case WIFI_POWER_SCENARIO_ON_BODY_CELL_ON:
bdf_file = QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_BDF3;
+ set_sar_number = 2;
break;
default:
@@ -456,9 +465,19 @@
goto cleanup;
}
+ wifiConfigCommand->put_u32(QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_NUM_SPECS, chip_mimo_number);
+ struct nlattr *nlData_spec, *nlData_spec_attr;
+ nlData_spec = wifiConfigCommand->attr_start(QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC);
+ for (int i = 0; i < chip_mimo_number; i++) {
+ nlData_spec_attr = wifiConfigCommand->attr_start(QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_POWER_LIMIT_INDEX);
+ wifiConfigCommand->put_u32(QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_POWER_LIMIT_INDEX, set_sar_number);
+ wifiConfigCommand->put_u32(QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_CHAIN, i);
+ wifiConfigCommand->attr_end(nlData_spec_attr);
+ }
+ wifiConfigCommand->attr_end(nlData_spec);
if (wifiConfigCommand->put_u32(
QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SAR_ENABLE,
- bdf_file)) {
+ QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_V2_0)) {
ALOGE("failed to put SAR_ENABLE");
goto cleanup;
}