diff options
author | Sungjoon Park <sungjoon.park@broadcom.corp-partner.google.com> | 2022-11-02 18:03:55 +0900 |
---|---|---|
committer | Isaac Chiou <isaacchiou@google.com> | 2022-11-02 09:10:54 +0000 |
commit | defee0887b3aabd53022fc8109290b6f26805ba3 (patch) | |
tree | 494666a368ff1d271043eb1c66311f56d8ee5fa3 | |
parent | fed627ea259c92de1a58be53551e87187b941192 (diff) | |
download | bcm4389-defee0887b3aabd53022fc8109290b6f26805ba3.tar.gz |
bcmdhd: Change sarmode casting to uint8
If sarconfig.info using the 128 for sarmode, it converted to -128 because sarmode is defined as int8.
[83705.872631] [22:29:04.445244][cfg80211][wlan] wl_get_sar_config_info :scenario=16, sar=16, airplane=1
[83705.872661] [22:29:04.445275][cfg80211][wlan] wl_get_sar_config_info :scenario=17, sar=-128, airplane=0
[83705.872693] [22:29:04.445306][cfg80211][wlan] wl_get_sar_config_info :scenario=18, sar=-128, airplane=1
[83705.872724] [22:29:04.445337][cfg80211][wlan] wl_get_sar_config_info :scenario=19, sar=32, airplane=1
This is the reason why 17/18 shows failure.
[83758.954682] [22:29:57.527283][cfg80211][wlan] wl_cfgvendor_tx_power_scenario :found scenario with new config
[83758.954993] [22:29:57.527608][cfg80211][wlan] wl_cfgvendor_tx_power_scenario : SAR: sar_mode -128 airplane_mode 0
[83759.015288] [22:29:57.587901][cfg80211][wlan] wl_cfgvendor_tx_power_scenario : SAR: Failed to set sar_enable - error (-29)
(-29) means out of range error.
To fix this issue, change the sarmode casting to uint8.
With this change, "halutil -sar enable 17/18" is working properly.
[Hal command]
raven:/ # halutil -sar enable 17
found interface wlan0
successfully initialized HAL; wlan0 = 0xb400007a07895110
starting wifi event loop
Success to execute sar test command
cleaning up HAL
raven:/ # halutil -sar enable 18
found interface wlan0
successfully initialized HAL; wlan0 = 0xb4000075ab49c610
starting wifi event loop
Success to execute sar test command
cleaning up HAL
raven:/ #
[Driver log]
[ 124.513889] [22:49:22.095632][cfg80211][wlan] wl_cfgvendor_tx_power_scenario : SAR: tx_power_mode 17 SUCCESS
[ 128.022727] [22:49:25.604480][cfg80211][wlan] wl_cfgvendor_tx_power_scenario : SAR: tx_power_mode 18 SUCCESS
Bug: 256802132
Test: Verified with Pixel device
Change-Id: I7702cce4ad1292c4d95f5fd075ad4ff1e650e2ca
Signed-off-by: Sungjoon Park <sungjoon.park@broadcom.corp-partner.google.com>
-rw-r--r-- | wl_cfg80211.c | 3 | ||||
-rw-r--r-- | wl_cfg80211.h | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/wl_cfg80211.c b/wl_cfg80211.c index 7688602..fd763ea 100644 --- a/wl_cfg80211.c +++ b/wl_cfg80211.c @@ -24843,7 +24843,8 @@ static void wl_get_sar_config_info(struct bcm_cfg80211 *cfg) int ret = BCME_OK; char *buf = NULL, *ptr = NULL, *cptr = NULL; int filelen = 0, buflen = 0, offset = 0, num, len, i; - int8 scenario, sarmode, airplanemode; + int8 scenario, airplanemode; + uint8 sarmode; if (cfg == NULL) { WL_ERR(("cfg is null\n")); diff --git a/wl_cfg80211.h b/wl_cfg80211.h index 87a39e6..83308b2 100644 --- a/wl_cfg80211.h +++ b/wl_cfg80211.h @@ -1808,7 +1808,7 @@ typedef enum { #define SAR_CONFIG_SCENARIO_COUNT 100 typedef struct wl_sar_config_info { int8 scenario; - int8 sar_tx_power_val; + uint8 sar_tx_power_val; int8 airplane_mode; } wl_sar_config_info_t; #endif /* WL_SAR_TX_POWER && WL_SAR_TX_POWER_CONFIG */ |