From patchwork Fri Jun 2 21:27:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 9763521 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 E7A6B60360 for ; Fri, 2 Jun 2017 21:28:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D865A28599 for ; Fri, 2 Jun 2017 21:28:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB6C2285D9; Fri, 2 Jun 2017 21:28:08 +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=-4.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID, URIBL_BLACK 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 B712628599 for ; Fri, 2 Jun 2017 21:28:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751184AbdFBV2G (ORCPT ); Fri, 2 Jun 2017 17:28:06 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:35340 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750971AbdFBV2F (ORCPT ); Fri, 2 Jun 2017 17:28:05 -0400 Received: by mail-oi0-f65.google.com with SMTP id f206so3956155oig.2 for ; Fri, 02 Jun 2017 14:28:04 -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=HSGeEw+boruYR7AQpOMrfRiTWnVpBaf99P8xk3rTgtrDP/eYFEaVY4MJR8vaNbvZMK u9MCzbEb+tVLkb/1MmxcRdWugyu/duvOu5BdxJvyCbzKyPFX2//ROUceAqRIwJjoGZE1 tQEVgxW2ed95oTY2cMynOhVS0QzCRMPEi+dW+tXsDyoAZ5sgdmZAFqcZ8Mixl5nRhecU uzsq3xL45kmN6Dq18L/+ReuTBurAbRC4MWm4SbXeRygQhfb+4gohP8dld0gChEVo03+U VkP9k/twduDYPrBOBA9hRppgBDuyQSaYZhLE1ndINIscrqQvvUt5Cz29xOMJZ6miobAo OxCw== 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=DbzyvbXe+ueewmbhvBateMml1bCBc1/TrawPjZHIoM+Kmd6N16wUS2RIU+Bojddp6/ D0DKJUTB4dJRF5EBF/rZO7/UukZ8UfLqxRM3UwSyKChhBMdZfDi1nYgrxJpEZWmfnZE8 W8OS2pEUJBPfTiWm/6A83blJufMU5VGu/wCQwQvgbFjhKW9YwA1Up8GaZwmcc7qnpNbq vHnq1pMOs5oTh6R++l2mBjXAq726Op6FWeXEPIKXPDnxZRfAwJeaF4uURgdRBeEOs/zO osq6GOXWBaF2hpsxuhox8nm8cv9mb4xM9dt59oH21szbAJ3hMvXDuFF4S67PENPsM6bJ llvA== X-Gm-Message-State: AODbwcBuMJiy3Xo5b3ph5lgmtLYLkHjzFXGzhmAso18s7rJhjWzJm+Kh hY6b7TQG9YQ1rVA7 X-Received: by 10.157.42.79 with SMTP id t73mr5562040ota.34.1496438884344; Fri, 02 Jun 2017 14:28:04 -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 z23sm1577041otz.11.2017.06.02.14.28.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 02 Jun 2017 14:28:03 -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 3/9] rtlwifi: btcoex: settings before firmware is downloaded Date: Fri, 2 Jun 2017 16:27:42 -0500 Message-Id: <20170602212748.23857-4-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170602212748.23857-1-Larry.Finger@lwfinger.net> References: <20170602212748.23857-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 {