diff mbox

[04/10] rtlwifi: btcoex: add scan_notify within ips_notify if RFON

Message ID 20180119064551.10084-5-pkshih@realtek.com (mailing list archive)
State Accepted
Commit ee373844849cdc69f18607311c56179f5be1be69
Delegated to: Kalle Valo
Headers show

Commit Message

Ping-Ke Shih Jan. 19, 2018, 6:45 a.m. UTC
From: Ping-Ke Shih <pkshih@realtek.com>

Three steps of connection procedure are scan, enter/leave IPS, auth.
There is no scan between leaving IPS and sending auth, but btcoex use scan
as an important clue that indicates user is going to connect. So add scan
notifications in ips_notify to correct btcoex's state.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Larry Finger Jan. 22, 2018, 7 p.m. UTC | #1
On 01/19/2018 12:45 AM, pkshih@realtek.com wrote:
> From: Ping-Ke Shih <pkshih@realtek.com>
> 
> Three steps of connection procedure are scan, enter/leave IPS, auth.
> There is no scan between leaving IPS and sending auth, but btcoex use scan
> as an important clue that indicates user is going to connect. So add scan
> notifications in ips_notify to correct btcoex's state.
> 
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>

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

> ---
>   drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c
> index bbc9517260b3..0111ab9e7b05 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c
> @@ -212,6 +212,14 @@ void rtl_btc_ips_notify(struct rtl_priv *rtlpriv, u8 type)
>   		return;
>   
>   	exhalbtc_ips_notify(btcoexist, type);
> +
> +	if (type == ERFON) {
> +		/* In some situation, it doesn't scan after leaving IPS, and
> +		 * this will cause btcoex in wrong state.
> +		 */
> +		exhalbtc_scan_notify(btcoexist, 1);
> +		exhalbtc_scan_notify(btcoexist, 0);
> +	}
>   }
>   
>   void rtl_btc_lps_notify(struct rtl_priv *rtlpriv, u8 type)
>
diff mbox

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c
index bbc9517260b3..0111ab9e7b05 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c
@@ -212,6 +212,14 @@  void rtl_btc_ips_notify(struct rtl_priv *rtlpriv, u8 type)
 		return;
 
 	exhalbtc_ips_notify(btcoexist, type);
+
+	if (type == ERFON) {
+		/* In some situation, it doesn't scan after leaving IPS, and
+		 * this will cause btcoex in wrong state.
+		 */
+		exhalbtc_scan_notify(btcoexist, 1);
+		exhalbtc_scan_notify(btcoexist, 0);
+	}
 }
 
 void rtl_btc_lps_notify(struct rtl_priv *rtlpriv, u8 type)