rtlwifi: btcoex: 21a 2ant: add pnp notidy to avoid LPS/IPS mismatch
authorYan-Hsuan Chuang <yhchuang@realtek.com>
Thu, 11 May 2017 19:01:14 +0000 (14:01 -0500)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 18 May 2017 14:07:29 +0000 (17:07 +0300)
When driver is going to sleep, it does not leave LPS/IPS, thus the
BTCoex may have mismatch when driver wakes up. To avoid that, BTCoex
needs to clear the IPS/LPS state when it receives a pnp notify, then
it can properly set up the hw when driver wakes up.

Routine ex_btc8821a2ant_pnp_notify() restored.

Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Pkshih <pkshih@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c

index 9aa140a46d46f72527a7d388d0f24d22e7a7d909..ca7649dca35232f701d4c52320b2e35a1cbeace6 100644 (file)
@@ -4147,6 +4147,24 @@ void ex_btc8821a2ant_halt_notify(struct btc_coexist *btcoexist)
        ex_btc8821a2ant_media_status_notify(btcoexist, BTC_MEDIA_DISCONNECT);
 }
 
+void ex_btc8821a2ant_pnp_notify(struct btc_coexist *btcoexist, u8 pnp_state)
+{
+       struct rtl_priv *rtlpriv = btcoexist->adapter;
+
+       RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD, "[BTCoex], Pnp notify\n");
+
+       if (pnp_state == BTC_WIFI_PNP_SLEEP) {
+               RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
+                        "[BTCoex], Pnp notify to SLEEP\n");
+       } else if (pnp_state == BTC_WIFI_PNP_WAKE_UP) {
+               RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
+                        "[BTCoex], Pnp notify to WAKE UP\n");
+               ex_btc8821a2ant_init_hwconfig(btcoexist);
+               btc8821a2ant_init_coex_dm(btcoexist);
+               btc8821a2ant_query_bt_info(btcoexist);
+       }
+}
+
 void ex_btc8821a2ant_periodical(struct btc_coexist *btcoexist)
 {
        struct rtl_priv *rtlpriv = btcoexist->adapter;