From patchwork Thu Apr 6 20:19:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 9668375 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 B248D60365 for ; Thu, 6 Apr 2017 20:20:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5D22285D3 for ; Thu, 6 Apr 2017 20:20:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CAAC0285D6; Thu, 6 Apr 2017 20:20:40 +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 6C719285D3 for ; Thu, 6 Apr 2017 20:20:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755535AbdDFUUj (ORCPT ); Thu, 6 Apr 2017 16:20:39 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:35579 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754719AbdDFUUI (ORCPT ); Thu, 6 Apr 2017 16:20:08 -0400 Received: by mail-oi0-f68.google.com with SMTP id d2so8884668oig.2 for ; Thu, 06 Apr 2017 13:20:08 -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=//PhHmR5r4Ar2he2CWNYz3W9MAUcEo87QcHR37Pa810=; b=QfG3HlQAiLKLq2XXoc0dqPcIccbKlto2jNCf/0A91bhGjWeRgF3Mv/8P07zp2e2B6n jDnhc5iGunhUJdVCvc0zzx4c8wef9vSIyIIczLGICIxlBZl8rd5BA2ly4ZerwPPQfjKu 1BBPC0MYB6qp36ivfaJnBgkzgEU4wITKPAMKrBtjB3SdzzmK1P+116SqFRLJ3gAYI8pb nmrHTtZUCqiOZiuLYk9C5mosntis2XgB9vbTfzfq9QVXFrvCnWRZYjgiqQNuJeTcv5eJ MbuotXtoQbXNhqS7Y2ta3VkP4lPWsVD/zlf28b7CAGC+urXeq8KLzUtRgprPUAanFcU8 LefA== 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=//PhHmR5r4Ar2he2CWNYz3W9MAUcEo87QcHR37Pa810=; b=aQ8qllcg6mCiGWYd53x5IwFMJ4+xQK+QemxGw2QCiDqlTg2fOnTfoHuesJdHXp46fY we6QonUSm8CsC/REoZFXDqB3z8TpzYNP+YuCofk2NQE5gTg3LI+CiF/NjN1EVjwHEsD4 w+LhSj4YbkU5N/bObRIZNlLlgtspAWdYTtfkrOgi98aaUVAZPsy14uY7jYYK/I8ao90L zCNSJzEqO7vmX22WVUP35KAtmUb+748udKVlqvI8JiuAH/oobB9HaCh8Ars5Z0M2MEjx 72tujvPvAxW1L9RNkxTvwaksjccmeLsNgOw8Sx2DhaaxS1UZYf1ZAj8WWisyQNRSG/TG 1AjQ== X-Gm-Message-State: AFeK/H2kNUpMzummo4E2qqEADxJob7rt7OPgwKA+lQBuGnTiZLTVhEnAxpoSFiCwd/NElg== X-Received: by 10.202.226.81 with SMTP id z78mr17289095oig.62.1491510007523; Thu, 06 Apr 2017 13:20:07 -0700 (PDT) Received: from linux-4v1g.suse (cpe-24-31-249-175.kc.res.rr.com. [24.31.249.175]) by smtp.gmail.com with ESMTPSA id j88sm1116558otc.22.2017.04.06.13.20.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Apr 2017 13:20:07 -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 05/11] rtlwifi: btcoex: 23b 2ant: wifi is not actually off in mp mode Date: Thu, 6 Apr 2017 15:19:52 -0500 Message-Id: <20170406201958.25642-6-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170406201958.25642-1-Larry.Finger@lwfinger.net> References: <20170406201958.25642-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 In mp mode, the wifi will not turn off and still has control of the PTA, so the driver needs to distinguish whether it is mp mode or not Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Larry Finger Cc: Pkshih Cc: Birming Chiu Cc: Shaofu Cc: Steven Ting --- .../net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c | 10 ++++++++++ drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h | 1 + 2 files changed, 11 insertions(+) diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c index 93dbbc507ba1..70f21059ddc3 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c @@ -3606,6 +3606,7 @@ static void btc8723b2ant_run_coexist_mechanism(struct btc_coexist *btcoexist) static void btc8723b2ant_wifioff_hwcfg(struct btc_coexist *btcoexist) { + bool is_in_mp_mode = false; u8 h2c_parameter[2] = {0}; u32 fw_ver = 0; @@ -3623,6 +3624,15 @@ static void btc8723b2ant_wifioff_hwcfg(struct btc_coexist *btcoexist) } else { btcoexist->btc_write_1byte(btcoexist, 0x765, 0x18); } + + btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_IS_IN_MP_MODE, + &is_in_mp_mode); + if (!is_in_mp_mode) + /* BT select s0/s1 is controlled by BT */ + btcoexist->btc_write_1byte_bitmask(btcoexist, 0x67, 0x20, 0x0); + else + /* BT select s0/s1 is controlled by WiFi */ + btcoexist->btc_write_1byte_bitmask(btcoexist, 0x67, 0x20, 0x1); } /********************************************************************* diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h index 022658cafbca..0b90e7f0b722 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h @@ -205,6 +205,7 @@ enum btc_get_type { BTC_GET_BL_WIFI_ENABLE_ENCRYPTION, BTC_GET_BL_WIFI_UNDER_B_MODE, BTC_GET_BL_EXT_SWITCH, + BTC_GET_BL_WIFI_IS_IN_MP_MODE, /* type s4Byte */ BTC_GET_S4_WIFI_RSSI,