From patchwork Fri May 5 16:17:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 9713907 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3F9F360387 for ; Fri, 5 May 2017 16:17:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 394AC28691 for ; Fri, 5 May 2017 16:17:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2BBF0286A0; Fri, 5 May 2017 16:17:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B133D286A0 for ; Fri, 5 May 2017 16:17:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750946AbdEEQRo (ORCPT ); Fri, 5 May 2017 12:17:44 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:34775 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750796AbdEEQR0 (ORCPT ); Fri, 5 May 2017 12:17:26 -0400 Received: by mail-io0-f194.google.com with SMTP id 12so2446060iol.1 for ; Fri, 05 May 2017 09:17:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=3bTGb7hpfg5G5V7e9ihlRtC0gPU42F3fO5bxpEtjk7o=; b=jbJrQ+eoCvRmhLB3TccEhi0iYYUDewBHq0TW9nn364qSyhUKkTII7iRTHZvWWX1W3J 5nCaWBemMcQyinFr2emo8zRILUgj9y55Qd7CxMjEDCB/0SpLNjwrplWWdPQM6s6SGX6E s2RvF50ICUz1zMDq01kitegqwZEcNH5ysZURXQ5DI5BEoaqOK35ROZm2OL1jfbj2Iowr 66MAl6/oF4w7OituzHa3AU7oszmqqimRUwRfxIRKjFa1i6QEQSt6x2a6melRZedi+CX9 1cd2yJE/yFDvGE+vRm6xWJ7u/BPKQ1s4XxGPxiYMvE1Pg7F/ie38YTXb1akNbXLxKl0Q qL3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=3bTGb7hpfg5G5V7e9ihlRtC0gPU42F3fO5bxpEtjk7o=; b=drgi7DbvTdVrqSjyXIoEW8URAxUpI7JCtqaP8z2ESQLW0ToRgFNiC+Kq3TkbSTrW6s gyWiTLUqHHEi4EsyG8iVFxiy7d01MKHWyZRrWNf0yyBWj3n7sbcg7fPn/y54kkggvP6C Rl1bGW8UgWbkrKcosSRo1EtFoNy5bIxyU7zv9uZc3hhQgD0F5fXrxmPhzK9YiiZA5U+Q lS7ypZ4UfS1F7HQWJjmZa7bu5jBGCzeA+VnIeYuLqdPFzSMPBQcyAeEgb4CQiHwR++r7 nZUsC7kIh/OrSEP8PF46bv3DnhCf/JK6+poxUqx8WsuZAaRjy1VyQAbRK6M9fDAxXKwk 1gAg== X-Gm-Message-State: AN3rC/7otXK7hyE/yMKqdZ7UQg1EAaRNxzvDQDZj8aAqaJszPEv6oPbn Z6IFID2vi8i82YXw X-Received: by 10.157.1.97 with SMTP id 88mr17005285otu.66.1494001045211; Fri, 05 May 2017 09:17:25 -0700 (PDT) Received: from localhost.localdomain (cpe-24-31-249-175.kc.res.rr.com. [24.31.249.175]) by smtp.gmail.com with ESMTPSA id u51sm2742666otu.54.2017.05.05.09.17.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 May 2017 09:17:24 -0700 (PDT) From: Larry Finger To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Yan-Hsuan Chuang , Larry Finger , Pkshih , Birming Chiu , Shaofu , Steven Ting Subject: [PATCH v2 05/10] rtlwifi: btcoex: 21a 2ant: add pnp notidy to avoid LPS/IPS mismatch Date: Fri, 5 May 2017 11:17:07 -0500 Message-Id: <20170505161712.8685-6-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170505161712.8685-1-Larry.Finger@lwfinger.net> References: <20170505161712.8685-1-Larry.Finger@lwfinger.net> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Yan-Hsuan Chuang 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 Signed-off-by: Larry Finger Cc: Pkshih Cc: Birming Chiu Cc: Shaofu Cc: Steven Ting --- v2 - resubmit after removal of BT_AUTO_REPORT_XXXX symbols. --- .../realtek/rtlwifi/btcoexist/halbtc8821a2ant.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c index 9aa140a46d46..ca7649dca352 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c @@ -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;