diff mbox

[v2,09/15] rtlwifi: btcoex: add assoc type v2 to connection notify

Message ID 20180306012554.3108-10-pkshih@realtek.com (mailing list archive)
State Accepted
Commit 0843e98a3b9a373f63465fcfbcac31108fd6c3a3
Delegated to: Kalle Valo
Headers show

Commit Message

Ping-Ke Shih March 6, 2018, 1:25 a.m. UTC
From: Ping-Ke Shih <pkshih@realtek.com>

In connection notify v1, btcoex only need to know start/end association,
and it will discriminate 2G and 5G band in v2.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 .../net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c  | 14 +++++++++++---
 .../net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h  |  2 ++
 2 files changed, 13 insertions(+), 3 deletions(-)

Comments

Larry Finger March 20, 2018, 4:01 a.m. UTC | #1
On 03/05/2018 07:25 PM, pkshih@realtek.com wrote:
> From: Ping-Ke Shih <pkshih@realtek.com>
> 
> In connection notify v1, btcoex only need to know start/end association,
> and it will discriminate 2G and 5G band in v2.
> 
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

> ---
>   .../net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c  | 14 +++++++++++---
>   .../net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h  |  2 ++
>   2 files changed, 13 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
> index 0f664a0490a7..05300b466d34 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
> @@ -1610,7 +1610,8 @@ void exhalbtc_scan_notify_wifi_only(struct wifi_only_cfg *wifionly_cfg,
>   
>   void exhalbtc_connect_notify(struct btc_coexist *btcoexist, u8 action)
>   {
> -	u8 asso_type;
> +	u8 asso_type, asso_type_v2;
> +	bool wifi_under_5g;
>   
>   	if (!halbtc_is_bt_coexist_available(btcoexist))
>   		return;
> @@ -1618,10 +1619,17 @@ void exhalbtc_connect_notify(struct btc_coexist *btcoexist, u8 action)
>   	if (btcoexist->manual_control)
>   		return;
>   
> -	if (action)
> +	btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_UNDER_5G, &wifi_under_5g);
> +
> +	if (action) {
>   		asso_type = BTC_ASSOCIATE_START;
> -	else
> +		asso_type_v2 = wifi_under_5g ? BTC_ASSOCIATE_5G_START :
> +					       BTC_ASSOCIATE_START;
> +	} else {
>   		asso_type = BTC_ASSOCIATE_FINISH;
> +		asso_type_v2 = wifi_under_5g ? BTC_ASSOCIATE_5G_FINISH :
> +					       BTC_ASSOCIATE_FINISH;
> +	}
>   
>   	halbtc_leave_low_power(btcoexist);
>   
> diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h
> index ad80ec05975e..0a7b09305bc3 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h
> +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h
> @@ -401,6 +401,8 @@ enum btc_notify_type_switchband {
>   enum btc_notify_type_associate {
>   	BTC_ASSOCIATE_FINISH = 0x0,
>   	BTC_ASSOCIATE_START = 0x1,
> +	BTC_ASSOCIATE_5G_FINISH = 0x2,
> +	BTC_ASSOCIATE_5G_START = 0x3,
>   	BTC_ASSOCIATE_MAX
>   };
>   
>
diff mbox

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
index 0f664a0490a7..05300b466d34 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
@@ -1610,7 +1610,8 @@  void exhalbtc_scan_notify_wifi_only(struct wifi_only_cfg *wifionly_cfg,
 
 void exhalbtc_connect_notify(struct btc_coexist *btcoexist, u8 action)
 {
-	u8 asso_type;
+	u8 asso_type, asso_type_v2;
+	bool wifi_under_5g;
 
 	if (!halbtc_is_bt_coexist_available(btcoexist))
 		return;
@@ -1618,10 +1619,17 @@  void exhalbtc_connect_notify(struct btc_coexist *btcoexist, u8 action)
 	if (btcoexist->manual_control)
 		return;
 
-	if (action)
+	btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_UNDER_5G, &wifi_under_5g);
+
+	if (action) {
 		asso_type = BTC_ASSOCIATE_START;
-	else
+		asso_type_v2 = wifi_under_5g ? BTC_ASSOCIATE_5G_START :
+					       BTC_ASSOCIATE_START;
+	} else {
 		asso_type = BTC_ASSOCIATE_FINISH;
+		asso_type_v2 = wifi_under_5g ? BTC_ASSOCIATE_5G_FINISH :
+					       BTC_ASSOCIATE_FINISH;
+	}
 
 	halbtc_leave_low_power(btcoexist);
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h
index ad80ec05975e..0a7b09305bc3 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h
@@ -401,6 +401,8 @@  enum btc_notify_type_switchband {
 enum btc_notify_type_associate {
 	BTC_ASSOCIATE_FINISH = 0x0,
 	BTC_ASSOCIATE_START = 0x1,
+	BTC_ASSOCIATE_5G_FINISH = 0x2,
+	BTC_ASSOCIATE_5G_START = 0x3,
 	BTC_ASSOCIATE_MAX
 };