rtlwifi: btcoex: extend get_wifi_bw to support bandwidth 80M
The rtlwifi newer ICs support 80M bandwidth in 5G band, so extend get_wifi_bw() to know bandwidth 80M that helps btcoex to make correct decisions. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
ba9797b2a7
commit
66d0f9deba
|
@ -95,21 +95,6 @@ static bool is_any_client_connect_to_ap(struct btc_coexist *btcoexist)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool halbtc_is_bt40(struct rtl_priv *adapter)
|
|
||||||
{
|
|
||||||
struct rtl_priv *rtlpriv = adapter;
|
|
||||||
struct rtl_phy *rtlphy = &(rtlpriv->phy);
|
|
||||||
bool is_ht40 = true;
|
|
||||||
enum ht_channel_width bw = rtlphy->current_chan_bw;
|
|
||||||
|
|
||||||
if (bw == HT_CHANNEL_WIDTH_20)
|
|
||||||
is_ht40 = false;
|
|
||||||
else if (bw == HT_CHANNEL_WIDTH_20_40)
|
|
||||||
is_ht40 = true;
|
|
||||||
|
|
||||||
return is_ht40;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool halbtc_legacy(struct rtl_priv *adapter)
|
static bool halbtc_legacy(struct rtl_priv *adapter)
|
||||||
{
|
{
|
||||||
struct rtl_priv *rtlpriv = adapter;
|
struct rtl_priv *rtlpriv = adapter;
|
||||||
|
@ -135,18 +120,26 @@ bool halbtc_is_wifi_uplink(struct rtl_priv *adapter)
|
||||||
|
|
||||||
static u32 halbtc_get_wifi_bw(struct btc_coexist *btcoexist)
|
static u32 halbtc_get_wifi_bw(struct btc_coexist *btcoexist)
|
||||||
{
|
{
|
||||||
struct rtl_priv *rtlpriv =
|
struct rtl_priv *rtlpriv = btcoexist->adapter;
|
||||||
(struct rtl_priv *)btcoexist->adapter;
|
struct rtl_phy *rtlphy = &rtlpriv->phy;
|
||||||
u32 wifi_bw = BTC_WIFI_BW_HT20;
|
u32 wifi_bw = BTC_WIFI_BW_HT20;
|
||||||
|
|
||||||
if (halbtc_is_bt40(rtlpriv)) {
|
if (halbtc_legacy(rtlpriv)) {
|
||||||
wifi_bw = BTC_WIFI_BW_HT40;
|
|
||||||
} else {
|
|
||||||
if (halbtc_legacy(rtlpriv))
|
|
||||||
wifi_bw = BTC_WIFI_BW_LEGACY;
|
wifi_bw = BTC_WIFI_BW_LEGACY;
|
||||||
else
|
} else {
|
||||||
|
switch (rtlphy->current_chan_bw) {
|
||||||
|
case HT_CHANNEL_WIDTH_20:
|
||||||
wifi_bw = BTC_WIFI_BW_HT20;
|
wifi_bw = BTC_WIFI_BW_HT20;
|
||||||
|
break;
|
||||||
|
case HT_CHANNEL_WIDTH_20_40:
|
||||||
|
wifi_bw = BTC_WIFI_BW_HT40;
|
||||||
|
break;
|
||||||
|
case HT_CHANNEL_WIDTH_80:
|
||||||
|
wifi_bw = BTC_WIFI_BW_HT80;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return wifi_bw;
|
return wifi_bw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -190,6 +190,7 @@ enum btc_wifi_bw_mode {
|
||||||
BTC_WIFI_BW_LEGACY = 0x0,
|
BTC_WIFI_BW_LEGACY = 0x0,
|
||||||
BTC_WIFI_BW_HT20 = 0x1,
|
BTC_WIFI_BW_HT20 = 0x1,
|
||||||
BTC_WIFI_BW_HT40 = 0x2,
|
BTC_WIFI_BW_HT40 = 0x2,
|
||||||
|
BTC_WIFI_BW_HT80 = 0x3,
|
||||||
BTC_WIFI_BW_MAX
|
BTC_WIFI_BW_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue