Commit 838dd0d3 authored by Ping-Ke Shih's avatar Ping-Ke Shih Committed by Kalle Valo

rtlwifi: Update some cases in btc_get function -- roam, 5G, AP mode, and return value.

Return value may be false in some situations.
Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 1024b316
...@@ -381,6 +381,7 @@ static bool halbtc_get(void *void_btcoexist, u8 get_type, void *out_buf) ...@@ -381,6 +381,7 @@ static bool halbtc_get(void *void_btcoexist, u8 get_type, void *out_buf)
u32 *u32_tmp = (u32 *)out_buf; u32 *u32_tmp = (u32 *)out_buf;
u8 *u8_tmp = (u8 *)out_buf; u8 *u8_tmp = (u8 *)out_buf;
bool tmp = false; bool tmp = false;
bool ret = true;
if (!halbtc_is_bt_coexist_available(btcoexist)) if (!halbtc_is_bt_coexist_available(btcoexist))
return false; return false;
...@@ -388,9 +389,11 @@ static bool halbtc_get(void *void_btcoexist, u8 get_type, void *out_buf) ...@@ -388,9 +389,11 @@ static bool halbtc_get(void *void_btcoexist, u8 get_type, void *out_buf)
switch (get_type) { switch (get_type) {
case BTC_GET_BL_HS_OPERATION: case BTC_GET_BL_HS_OPERATION:
*bool_tmp = false; *bool_tmp = false;
ret = false;
break; break;
case BTC_GET_BL_HS_CONNECTING: case BTC_GET_BL_HS_CONNECTING:
*bool_tmp = false; *bool_tmp = false;
ret = false;
break; break;
case BTC_GET_BL_WIFI_CONNECTED: case BTC_GET_BL_WIFI_CONNECTED:
if (rtlpriv->mac80211.opmode == NL80211_IFTYPE_STATION && if (rtlpriv->mac80211.opmode == NL80211_IFTYPE_STATION &&
...@@ -429,11 +432,16 @@ static bool halbtc_get(void *void_btcoexist, u8 get_type, void *out_buf) ...@@ -429,11 +432,16 @@ static bool halbtc_get(void *void_btcoexist, u8 get_type, void *out_buf)
*bool_tmp = false; *bool_tmp = false;
break; break;
case BTC_GET_BL_WIFI_UNDER_5G: case BTC_GET_BL_WIFI_UNDER_5G:
/* TODO */ if (rtlhal->current_bandtype == BAND_ON_5G)
*bool_tmp = false; *bool_tmp = true;
else
*bool_tmp = false;
break; break;
case BTC_GET_BL_WIFI_AP_MODE_ENABLE: case BTC_GET_BL_WIFI_AP_MODE_ENABLE:
*bool_tmp = false; if (mac->opmode == NL80211_IFTYPE_AP)
*bool_tmp = true;
else
*bool_tmp = false;
break; break;
case BTC_GET_BL_WIFI_ENABLE_ENCRYPTION: case BTC_GET_BL_WIFI_ENABLE_ENCRYPTION:
if (NO_ENCRYPTION == rtlpriv->sec.pairwise_enc_algorithm) if (NO_ENCRYPTION == rtlpriv->sec.pairwise_enc_algorithm)
...@@ -460,8 +468,8 @@ static bool halbtc_get(void *void_btcoexist, u8 get_type, void *out_buf) ...@@ -460,8 +468,8 @@ static bool halbtc_get(void *void_btcoexist, u8 get_type, void *out_buf)
*s32_tmp = halbtc_get_wifi_rssi(rtlpriv); *s32_tmp = halbtc_get_wifi_rssi(rtlpriv);
break; break;
case BTC_GET_S4_HS_RSSI: case BTC_GET_S4_HS_RSSI:
/* TODO */ *s32_tmp = 0;
*s32_tmp = halbtc_get_wifi_rssi(rtlpriv); ret = false;
break; break;
case BTC_GET_U4_WIFI_BW: case BTC_GET_U4_WIFI_BW:
*u32_tmp = halbtc_get_wifi_bw(btcoexist); *u32_tmp = halbtc_get_wifi_bw(btcoexist);
...@@ -491,7 +499,8 @@ static bool halbtc_get(void *void_btcoexist, u8 get_type, void *out_buf) ...@@ -491,7 +499,8 @@ static bool halbtc_get(void *void_btcoexist, u8 get_type, void *out_buf)
*u8_tmp = halbtc_get_wifi_central_chnl(btcoexist); *u8_tmp = halbtc_get_wifi_central_chnl(btcoexist);
break; break;
case BTC_GET_U1_WIFI_HS_CHNL: case BTC_GET_U1_WIFI_HS_CHNL:
*u8_tmp = 1; *u8_tmp = 0;
ret = false;
break; break;
case BTC_GET_U1_AP_NUM: case BTC_GET_U1_AP_NUM:
/* driver do not know AP num, /* driver do not know AP num,
...@@ -512,10 +521,11 @@ static bool halbtc_get(void *void_btcoexist, u8 get_type, void *out_buf) ...@@ -512,10 +521,11 @@ static bool halbtc_get(void *void_btcoexist, u8 get_type, void *out_buf)
break; break;
default: default:
ret = false;
break; break;
} }
return true; return ret;
} }
static bool halbtc_set(void *void_btcoexist, u8 set_type, void *in_buf) static bool halbtc_set(void *void_btcoexist, u8 set_type, void *in_buf)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment