From patchwork Mon Jun 5 15:29:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 9766365 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 7BB42603F1 for ; Mon, 5 Jun 2017 15:30:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E20127F8E for ; Mon, 5 Jun 2017 15:30:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6327C26E16; Mon, 5 Jun 2017 15:30:15 +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 D5143281E1 for ; Mon, 5 Jun 2017 15:30:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751308AbdFEPaL (ORCPT ); Mon, 5 Jun 2017 11:30:11 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:35823 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751294AbdFEPaI (ORCPT ); Mon, 5 Jun 2017 11:30:08 -0400 Received: by mail-oi0-f65.google.com with SMTP id f206so12649609oig.2 for ; Mon, 05 Jun 2017 08:30:07 -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=gRy84DRHbc5XZecqtuqdXc3vj3EA8959m2EqODEKkcA=; b=r2zO70xYl+0dZSDASxFRTuVnTqklSqKeC7cHlhsAAYRc9pMxxSJj7735lA92k4Tawy Nv6+v2LvgxV76wubT1qjrZ7kQXP4os1NgOzUOEfCijw0XqrKjyM9kQAbGwq0s0B8r0vY tEQvcTvkCqDowRovB01IUI6r7CGIKmoX1nw1B7aO3xDUbypicc+KjDynklpGY7f6N6+X A8+z3lfOciV5QXPKMl3Uuu/USfXzDRqzCj3cXaB7HYV+kR0xdYk3wB+JBVJlfes86mBF fEfNjE7e3WnL4h6BNGPFHGHx9Jckvw4WcGGXV80jQKf7R7kJH2nK9uu+9MunN95YJPLw QELA== 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=gRy84DRHbc5XZecqtuqdXc3vj3EA8959m2EqODEKkcA=; b=iMXrTEzobRSKCsTilV8ICKe27NB4+mpro+g4d6+6NNZ8d4hBiVnw4Sa44EoprsiNxI bQKDO3WXg9d5NLUx04/ggDF+PQRYeyY+5ywWnOnsnGgCN7WMt13YUOLzdT3yZuvQILmf wDqFXa5MAayR4rJE2A9mUD0a1ayIikC2mgtXLyhQRZ2azsgOMQIXC9Firi6KHVk5QEmm fnSV09vZIkJ+qLrqEtoYEYS44IXSfXQiL2rpV6xix4sSxz/t4xiv0/XIwugYcItGbsdw 09A24IZVMbVNUvoJFriWjltlSzlo5Nuai8MvTXAPiGu62Zz5ZBExOvQ9neE91AuQCQM9 Ni0w== X-Gm-Message-State: AODbwcDjyO07vYmfxpFFVwzs3cHCE6kh661p+HrnkIPs+Fl9rrJ3CvRZ d6mFw2VOcz/KNw== X-Received: by 10.157.60.119 with SMTP id j52mr12662127ote.31.1496676607158; Mon, 05 Jun 2017 08:30:07 -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 z23sm5554723otz.11.2017.06.05.08.30.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Jun 2017 08:30:06 -0700 (PDT) From: Larry Finger To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Yan-Hsuan Chuang , Larry Finger , Ping-Ke Shih , Birming Chiu , Shaofu , Steven Ting Subject: [PATCH v2 4/9] rtlwifi: btcoex: hook external PnP notify by chip for wifi driver Date: Mon, 5 Jun 2017 10:29:54 -0500 Message-Id: <20170605152959.27439-5-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170605152959.27439-1-Larry.Finger@lwfinger.net> References: <20170605152959.27439-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 Hook the chip-specific PnP notify functions for the wifi driver to notify btcoexistence. Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Larry Finger Cc: Ping-Ke Shih Cc: Birming Chiu Cc: Shaofu Cc: Steven Ting --- .../realtek/rtlwifi/btcoexist/halbtc8723b2ant.h | 1 + .../wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.h b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.h index a98b9548c3c7..ae3e450c5966 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.h +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.h @@ -196,6 +196,7 @@ void ex_btc8723b2ant_bt_info_notify(struct btc_coexist *btcoexist, void ex_btc8723b2ant_halt_notify(struct btc_coexist *btcoexist); void ex_btc8723b2ant_periodical(struct btc_coexist *btcoexist); void ex_btc8723b2ant_display_coex_info(struct btc_coexist *btcoexist); +void ex_btc8723b2ant_pnp_notify(struct btc_coexist *btcoexist, u8 pnp_state); void ex_btc8723b2ant_pre_load_firmware(struct btc_coexist *btcoexist); #endif diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c index 0cd4926c1ed7..5e6e14fd8c85 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c @@ -916,6 +916,24 @@ void exhalbtc_pnp_notify(struct btc_coexist *btcoexist, u8 pnp_state) { if (!halbtc_is_bt_coexist_available(btcoexist)) return; + + /* currently only 1ant we have to do the notification, + * once pnp is notified to sleep state, we have to leave LPS that + * we can sleep normally. + */ + + if (IS_HARDWARE_TYPE_8723B(btcoexist->adapter)) { + if (btcoexist->board_info.btdm_ant_num == 1) + ex_btc8723b1ant_pnp_notify(btcoexist, pnp_state); + else if (btcoexist->board_info.btdm_ant_num == 2) + ex_btc8723b2ant_pnp_notify(btcoexist, pnp_state); + } else if (IS_HARDWARE_TYPE_8821(btcoexist->adapter)) { + if (btcoexist->board_info.btdm_ant_num == 1) + ex_btc8821a1ant_pnp_notify(btcoexist, pnp_state); + else if (btcoexist->board_info.btdm_ant_num == 2) + ex_btc8821a2ant_pnp_notify(btcoexist, pnp_state); + } else if (IS_HARDWARE_TYPE_8192E(btcoexist->adapter)) { + } } void exhalbtc_periodical(struct btc_coexist *btcoexist)