From patchwork Sun Jun 18 16:12:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 9794915 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 E9F63603F5 for ; Sun, 18 Jun 2017 16:13:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBFD027FA9 for ; Sun, 18 Jun 2017 16:13:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D089627FAD; Sun, 18 Jun 2017 16:13:04 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 5A44A27FB2 for ; Sun, 18 Jun 2017 16:13:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753182AbdFRQM7 (ORCPT ); Sun, 18 Jun 2017 12:12:59 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:33424 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753150AbdFRQM5 (ORCPT ); Sun, 18 Jun 2017 12:12:57 -0400 Received: by mail-oi0-f68.google.com with SMTP id k145so7238356oih.0 for ; Sun, 18 Jun 2017 09:12:57 -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=7NAIXBIOokrsODWj2ct//zJvNbSOG2WOZwjWBr7/Vko=; b=X/C548CwHnfAZxWxmp4WWJMdLqUDense7D0D4hk7edytdse4EqQ9me2L2vmLwjagMF KvwUwPdoh/UbXr9l7pF7/RGxTGmu7Kx32dqGhNVR0MNIQMfbY7dr97sa09uslZ2rAO5r kjJMyMqLCWNjsSf9pZRyqmrPWtiGbUzu4t6y67TYL4e0VQ9KX6yLRJwpQecASPZt3685 n1/S+ej9E8BL1J3IebJuASrLIvxa8QE5xj1afrqoiLLqxpa58Y9cCxMnd5E7VtlW+pjS WdfHV41s+cdKHTsLisXXmIfu6d6cPDP6xgMWteDr69DQZXjIN283rkPd4kO0KS7m31+I oE9Q== 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=7NAIXBIOokrsODWj2ct//zJvNbSOG2WOZwjWBr7/Vko=; b=EVoI0hRGAgEEil3swtSX37r8DHNEJXkpsnKK0g6KwjzvfLTGA1IgQEcFoIlicX2jyT ROnf+KVzKIzwwSsv0F85vHFlwHON16Bsnqu+tghIyFJKCzdzdPNU13aY6Kk4rZVQ5ejp 7hDjm3nmnG0/wempqu+sPF6MZX6GEg++9qFSFyyt9c5V9kXb3LLIegyxDpL7/y18C7nY ATNuFKzwGNCveNJ0CwoGIkoaj9dvT7vBmn4NKOWfq+w/deP6jdCAtLCO+FFn1IrYPQ52 hVsS0xE2Ap2Dl1/utTi15GFd2/f7QHQ3frrwbCXfHlZ74PpG3KFnGrTmj074j28JlDZg HSGA== X-Gm-Message-State: AKS2vOy0hB5JZ4PPOPjSDD/bEY4BzJSbBSF2icUaoPUJZZIYISrryu3g asxOulzgl7XxEw== X-Received: by 10.202.226.11 with SMTP id z11mr6548460oig.209.1497802376034; Sun, 18 Jun 2017 09:12:56 -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 s41sm4473985ots.54.2017.06.18.09.12.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 18 Jun 2017 09:12:55 -0700 (PDT) From: Larry Finger To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Ping-Ke Shih , Larry Finger , Yan-Hsuan Chuang , Birming Chiu , Shaofu , Steven Ting Subject: [PATCH 02/11] rtlwifi: btcoex: set correct interface type and parameter. Date: Sun, 18 Jun 2017 11:12:40 -0500 Message-Id: <20170618161249.6146-3-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20170618161249.6146-1-Larry.Finger@lwfinger.net> References: <20170618161249.6146-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: Ping-Ke Shih This commit fixies two problems. The first one is interface types (e.g. PCI) that are used to switch antenna, and the second is to add wifi_only parameter to give correct state. Signed-off-by: Ping-Ke Shih Signed-off-by: Larry Finger Cc: Yan-Hsuan Chuang Cc: Birming Chiu Cc: Shaofu Cc: Steven Ting --- .../wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c | 18 +++++++++++++----- .../wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h | 2 +- .../net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c index f00d6e6ab69b..451039ac7b0a 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c @@ -803,8 +803,6 @@ bool exhalbtc_initlize_variables(void) halbtc_dbg_init(); - btcoexist->chip_interface = BTC_INTF_UNKNOWN; - btcoexist->btc_read_1byte = halbtc_read_1byte; btcoexist->btc_write_1byte = halbtc_write_1byte; btcoexist->btc_write_1byte_bitmask = halbtc_bitmask_write_1byte; @@ -843,6 +841,18 @@ bool exhalbtc_bind_bt_coex_withadapter(void *adapter) if (btcoexist->binded) return false; + switch (rtlpriv->rtlhal.interface) { + case INTF_PCI: + btcoexist->chip_interface = BTC_INTF_PCI; + break; + case INTF_USB: + btcoexist->chip_interface = BTC_INTF_USB; + break; + default: + btcoexist->chip_interface = BTC_INTF_UNKNOWN; + break; + } + btcoexist->binded = true; btcoexist->statistics.cnt_bind++; @@ -912,10 +922,8 @@ void exhalbtc_pre_load_firmware(struct btc_coexist *btcoexist) } } -void exhalbtc_init_hw_config(struct btc_coexist *btcoexist) +void exhalbtc_init_hw_config(struct btc_coexist *btcoexist, bool wifi_only) { - bool wifi_only = true; - if (!halbtc_is_bt_coexist_available(btcoexist)) return; diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h index 21d39973feab..f9b87c12db09 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h @@ -601,7 +601,7 @@ extern struct btc_coexist gl_bt_coexist; bool exhalbtc_initlize_variables(void); bool exhalbtc_bind_bt_coex_withadapter(void *adapter); -void exhalbtc_init_hw_config(struct btc_coexist *btcoexist); +void exhalbtc_init_hw_config(struct btc_coexist *btcoexist, bool wifi_only); void exhalbtc_init_coex_dm(struct btc_coexist *btcoexist); void exhalbtc_ips_notify(struct btc_coexist *btcoexist, u8 type); void exhalbtc_lps_notify(struct btc_coexist *btcoexist, u8 type); diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c index 7d4a94efe260..9635c1478875 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c @@ -68,7 +68,7 @@ void rtl_btc_init_hw_config(struct rtl_priv *rtlpriv) RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "%s, bt_exist is %d\n", __func__, bt_exist); - exhalbtc_init_hw_config(&gl_bt_coexist); + exhalbtc_init_hw_config(&gl_bt_coexist, !bt_exist); exhalbtc_init_coex_dm(&gl_bt_coexist); }