From patchwork Mon Jun 5 15:29:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 9766363 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 326E060393 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 2469426E16 for ; Mon, 5 Jun 2017 15:30:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1968928372; 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 9501827F8E for ; Mon, 5 Jun 2017 15:30:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751303AbdFEPaI (ORCPT ); Mon, 5 Jun 2017 11:30:08 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:35814 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751284AbdFEPaH (ORCPT ); Mon, 5 Jun 2017 11:30:07 -0400 Received: by mail-oi0-f67.google.com with SMTP id f206so12649541oig.2 for ; Mon, 05 Jun 2017 08:30:06 -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=9vvmFSS2vPX8jO8OWJ2hU1zbR1QdphAVJ2DoCCpM4g0=; b=R/EFcszHLRxqzBNanqmM98mtioGo9NABP5WRtYDy3B+IIicCnAtYjwo2ybKLeJ0jiA STQfz1zHVT2sPnaLVpmS1uqeUuTcD6MTp2I8Xmw7aSdtVeS6JfAd13fPL4kTGck3PpsM ACohR83FX6e1oJTx6ymnSwRZ4s2oTzNgzJK/9jRBp1jDDGdIAzpKTH/FOYg88zY9Ai27 8hhF/dg1MQKryh/65+Q/vdX2hoWUkSC+e6CbP/kuZ7fehcw++6N+CE462vYRhZo+MSDO Z9gRFg2ceoqurlw/KgcARQSrbo8nzIKYyhmCwxysdPYkYRJtLwfBOwsFkIvH3owci3on /yUw== 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=9vvmFSS2vPX8jO8OWJ2hU1zbR1QdphAVJ2DoCCpM4g0=; b=gS6f8lSxzbQkYDvrHSbGVo8E9EEUkhCWYbrFeCHC+hoJWWzF+Vpsu0by19s80TCjo6 sgKq4NL/m2OoW+yEZp++6dBNCk46j4uEmerl1dzupXt/7swzA/dfEEL2TSJiUC7c/abl 5K1eM1yHjoG8BZFEdBB04tX9Oue/HjitT+iGpw+o3bai+5VIY0PdCum2T7hAv29VERw4 iqMki4oPj0tRH6mRvDfunS/B+kDa5qYnUmZ66KsTuVbZJcwN/Z2YJthi4yNSisuC22lf /PNRrTPBBm7fsnbzcZmNR8wt3UCroMJlaeLuREgQUehOFF2haRtX95huejBoWeoEIYVg oXRw== X-Gm-Message-State: AKS2vOx7eLybUN0nrOT+vWi/IVuqCTTPoEj0GlsIO15rBRkwcYxE+V9l A9EtptnPnm2AGw== X-Received: by 10.157.8.239 with SMTP id 102mr13297509otf.114.1496676606026; Mon, 05 Jun 2017 08:30:06 -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.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Jun 2017 08:30:05 -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 3/9] rtlwifi: btcoex: settings before firmware is downloaded Date: Mon, 5 Jun 2017 10:29:53 -0500 Message-Id: <20170605152959.27439-4-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 The btcoex is sometimes unstable because there are some unexpected behaviors before the firmware has been downloaded successfully. Therefore we force the antenna path settings to avoid this, then let the firmware control the btcoexistence when the firmware is ready. Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Larry Finger Cc: Ping-Ke Shih Cc: Birming Chiu Cc: Shaofu Cc: Steven Ting --- .../wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.h | 1 + .../wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.h | 2 ++ .../net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c | 13 +++++++++++++ .../net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h | 1 + 4 files changed, 17 insertions(+) diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.h b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.h index 50726beaeead..a98b9548c3c7 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.h +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.h @@ -196,5 +196,6 @@ 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_pre_load_firmware(struct btc_coexist *btcoexist); #endif diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.h b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.h index 1d6e3e9abd91..a839d5574422 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.h +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.h @@ -228,3 +228,5 @@ void ex_btc8821a2ant_display_coex_info( struct btc_coexist *btcoexist ); +void ex_btc8821a2ant_pnp_notify(struct btc_coexist *btcoexist, u8 pnp_state); +void ex_btc8821a2ant_pre_load_firmware(struct btc_coexist *btcoexist); diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c index f13000612913..0cd4926c1ed7 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c @@ -690,6 +690,19 @@ bool exhalbtc_initlize_variables(struct rtl_priv *adapter) return true; } +void exhalbtc_pre_load_firmware(struct btc_coexist *btcoexist) +{ + if (!halbtc_is_bt_coexist_available(btcoexist)) + return; + + btcoexist->statistics.cnt_pre_load_firmware++; + + if (IS_HARDWARE_TYPE_8723B(btcoexist->adapter)) { + if (btcoexist->board_info.btdm_ant_num == 2) + ex_btc8723b2ant_pre_load_firmware(btcoexist); + } +} + void exhalbtc_init_hw_config(struct btc_coexist *btcoexist) { struct rtl_priv *rtlpriv = btcoexist->adapter; diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h index c5c360e011a9..eca0e5a78ada 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h @@ -486,6 +486,7 @@ struct btc_statistics { u32 cnt_coex_dm_switch; u32 cnt_stack_operation_notify; u32 cnt_dbg_ctrl; + u32 cnt_pre_load_firmware; }; struct btc_bt_link_info {