From patchwork Mon Jul 17 15:09:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 9845421 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 AD74760386 for ; Mon, 17 Jul 2017 15:10:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A00CD27CF9 for ; Mon, 17 Jul 2017 15:10:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9339528405; Mon, 17 Jul 2017 15:10:09 +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 28FD827CF9 for ; Mon, 17 Jul 2017 15:10:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751320AbdGQPKH (ORCPT ); Mon, 17 Jul 2017 11:10:07 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:36187 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751286AbdGQPKD (ORCPT ); Mon, 17 Jul 2017 11:10:03 -0400 Received: by mail-oi0-f66.google.com with SMTP id n2so18150404oig.3 for ; Mon, 17 Jul 2017 08:10:03 -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=wXPNcjKV/ZmiL3KlrsflKJR8w5TspNhZrHsRlihw7QE=; b=pr3k+GxH476C7qWGurz4osPB26N2VAamZ9gJOnb3dwMj7rdkWQtDtQCQBcbaKsVaKE 4zBXRy3UxAjMerSoOdp+yW4ZcHb8iUvJgHlU4B54QkWzON7ljUhLER+/QxMZmIgVcbX2 maYUbynknwWG0E9Xr6E2GBNoeg3pk0w9SIoYIYp0NcKLPsGmSuNXIhcif14nllaA/O/c zbZrL8o6NHxeMfj/M7DD61bePSL0mmQWEbEdFXa8yABAgzWhyMFSf5gIttASYU52vWL4 nefv2fuoWVMMpbmyr4ChLdXRzlIPS+stXZQ+bkrCHbq2kMyftXOmrIBLDdyOPi96ilnk 6+Mw== 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=wXPNcjKV/ZmiL3KlrsflKJR8w5TspNhZrHsRlihw7QE=; b=n9hf6k/wKPwlmFJbKkeGrjMDEwF3AAWu02Bq8QsMQKN0Y1QX/JhBbBZYsLFG7mPmfk smiDKnCNnYHvKubMhI8HAfmFQHtzrHEA9YLKV4AT/l6Xmzn57L3KFdtDCijcKvleOg3H S1RYftY+iiGsV1tAZ4F653n7xcPpU0cuH6J+zZ+mJZzuubOVnbidftBnOfbfE+8LVM+v HqiqVGwRuNF2BN+WJ/SipKBXNFEPeO+VD23z8WWyxmDXs2Q76vUYZ+Cm4O7x7KvrTM3Z VPShyY1LI6NbH16oV2B0hnRoJ30AFE4Ulah+YtFcjxVynh3j3dRgHVEAdg/8LwHx73dX cLbw== X-Gm-Message-State: AIVw1112ANXfE4wURZFkCiGjUFOkNGSRllB1nNFKpIRTX/cmEnTazggv pBmOhX4Yhi1ZKSni X-Received: by 10.202.235.12 with SMTP id j12mr11582283oih.130.1500304203322; Mon, 17 Jul 2017 08:10:03 -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 p65sm29370656oie.8.2017.07.17.08.10.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Jul 2017 08:10:02 -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 v2 01/11] rtlwifi: btcoex: Add power_on_setting routine Date: Mon, 17 Jul 2017 10:09:44 -0500 Message-Id: <20170717150954.1441-2-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20170717150954.1441-1-Larry.Finger@lwfinger.net> References: <20170717150954.1441-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 New btcoex uses it to setup antenna before wifi on. This patch also restores the content of commit f95d95a7cd55 ("rtlwifi: btcoex: rtl8723be: fix ant_sel not work"), which caused a kernel oops without this material. Signed-off-by: Ping-Ke Shih Signed-off-by: Larry Finger Cc: Yan-Hsuan Chuang Cc: Birming Chiu Cc: Shaofu Cc: Steven Ting --- v2 - Add the material in commit f95d95a7cd55, which had to be reverted. --- drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h | 1 + drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c | 6 ++++++ drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.h | 1 + drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c | 3 +++ drivers/net/wireless/realtek/rtlwifi/wifi.h | 1 + 5 files changed, 12 insertions(+) diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h index ea12b9d63a73..bc523af7ef88 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h @@ -608,6 +608,7 @@ extern struct btc_coexist gl_bt_coexist; bool exhalbtc_initlize_variables(void); bool exhalbtc_bind_bt_coex_withadapter(void *adapter); +void exhalbtc_power_on_setting(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); diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c index 4d9e33078d4f..9e3623b0423c 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c @@ -32,6 +32,7 @@ static struct rtl_btc_ops rtl_btc_operation = { .btc_init_variables = rtl_btc_init_variables, .btc_init_hal_vars = rtl_btc_init_hal_vars, + .btc_power_on_setting = rtl_btc_power_on_setting, .btc_init_hw_config = rtl_btc_init_hw_config, .btc_ips_notify = rtl_btc_ips_notify, .btc_lps_notify = rtl_btc_lps_notify, @@ -116,6 +117,11 @@ void rtl_btc_init_hal_vars(struct rtl_priv *rtlpriv) */ } +void rtl_btc_power_on_setting(struct rtl_priv *rtlpriv) +{ + exhalbtc_power_on_setting(&gl_bt_coexist); +} + void rtl_btc_init_hw_config(struct rtl_priv *rtlpriv) { u8 bt_exist; diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.h b/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.h index 40f1ce8c8a06..9becfa59407d 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.h +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.h @@ -29,6 +29,7 @@ void rtl_btc_init_variables(struct rtl_priv *rtlpriv); void rtl_btc_init_hal_vars(struct rtl_priv *rtlpriv); +void rtl_btc_power_on_setting(struct rtl_priv *rtlpriv); void rtl_btc_init_hw_config(struct rtl_priv *rtlpriv); void rtl_btc_ips_notify(struct rtl_priv *rtlpriv, u8 type); void rtl_btc_lps_notify(struct rtl_priv *rtlpriv, u8 type); diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c index 4d47b97adfed..0b9366e7acbd 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c @@ -846,6 +846,9 @@ static bool _rtl8723be_init_mac(struct ieee80211_hw *hw) return false; } + if (rtlpriv->cfg->ops->get_btc_status()) + rtlpriv->btcoexist.btc_ops->btc_power_on_setting(rtlpriv); + bytetmp = rtl_read_byte(rtlpriv, REG_MULTI_FUNC_CTRL); rtl_write_byte(rtlpriv, REG_MULTI_FUNC_CTRL, bytetmp | BIT(3)); diff --git a/drivers/net/wireless/realtek/rtlwifi/wifi.h b/drivers/net/wireless/realtek/rtlwifi/wifi.h index 71a523e342b7..6c3ff4a73d19 100644 --- a/drivers/net/wireless/realtek/rtlwifi/wifi.h +++ b/drivers/net/wireless/realtek/rtlwifi/wifi.h @@ -2550,6 +2550,7 @@ struct bt_coexist_info { struct rtl_btc_ops { void (*btc_init_variables) (struct rtl_priv *rtlpriv); void (*btc_init_hal_vars) (struct rtl_priv *rtlpriv); + void (*btc_power_on_setting)(struct rtl_priv *rtlpriv); void (*btc_init_hw_config) (struct rtl_priv *rtlpriv); void (*btc_ips_notify) (struct rtl_priv *rtlpriv, u8 type); void (*btc_lps_notify)(struct rtl_priv *rtlpriv, u8 type);