From patchwork Wed Mar 28 07:27:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping-Ke Shih X-Patchwork-Id: 10312341 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 29BEC60212 for ; Wed, 28 Mar 2018 07:28:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1366C28CF4 for ; Wed, 28 Mar 2018 07:28:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0837E29F12; Wed, 28 Mar 2018 07:28:47 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 7A4EB28CF4 for ; Wed, 28 Mar 2018 07:28:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752246AbeC1H2i (ORCPT ); Wed, 28 Mar 2018 03:28:38 -0400 Received: from rtits2.realtek.com ([211.75.126.72]:47361 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752828AbeC1H17 (ORCPT ); Wed, 28 Mar 2018 03:27:59 -0400 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.62 with qID w2S7RoTX030648, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtitcasv01.realtek.com.tw [172.21.6.18]) by rtits2.realtek.com.tw (8.15.2/2.57/5.78) with ESMTP id w2S7RoTX030648; Wed, 28 Mar 2018 15:27:50 +0800 Received: from localhost.localdomain (172.21.69.140) by RTITCASV01.realtek.com.tw (172.21.6.18) with Microsoft SMTP Server id 14.3.294.0; Wed, 28 Mar 2018 15:27:50 +0800 From: To: CC: , Subject: [PATCH 8/9] rtlwifi: btcoex: Add struct members to replace global varaibles Date: Wed, 28 Mar 2018 15:27:40 +0800 Message-ID: <20180328072741.23349-9-pkshih@realtek.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180328072741.23349-1-pkshih@realtek.com> References: <20180328072741.23349-1-pkshih@realtek.com> MIME-Version: 1.0 X-Originating-IP: [172.21.69.140] 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 Chip specific context plays as global variables that will not support multiple devices simultaneously. This patch adds 'union' fields to hold the variables, and next patch will remove all of them. To use the declaration of fields in halbtcoutsrc.h, I move the including order in header file halbt_precomp.h, and declare two struct terms for chip specific header files. Signed-off-by: Ping-Ke Shih --- .../realtek/rtlwifi/btcoexist/halbt_precomp.h | 6 +++++- .../realtek/rtlwifi/btcoexist/halbtcoutsrc.h | 24 ++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbt_precomp.h b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbt_precomp.h index 858318fd3d63..e21222b48c2c 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbt_precomp.h +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbt_precomp.h @@ -35,7 +35,6 @@ #include "../ps.h" #include "../pci.h" -#include "halbtcoutsrc.h" /* Interface type */ #define RT_PCI_INTERFACE 1 @@ -43,6 +42,9 @@ #define RT_SDIO_INTERFACE 3 #define DEV_BUS_TYPE RT_PCI_INTERFACE +struct btc_coexist; +struct wifi_only_cfg; + #include "halbtc8192e2ant.h" #include "halbtc8723b1ant.h" #include "halbtc8723b2ant.h" @@ -52,6 +54,8 @@ #include "halbtc8822b2ant.h" #include "halbtc8822bwifionly.h" +#include "halbtcoutsrc.h" + #define GetDefaultAdapter(padapter) padapter #define BIT0 0x00000001 diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h index 9eae87d19120..46355ce32f1b 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h @@ -693,6 +693,30 @@ struct btc_coexist { enum btc_chip_interface chip_interface; struct btc_bt_link_info bt_link_info; + /* context for each chip */ + union { + struct coex_dm_8192e_2ant coex_dm_8192e_2ant; + struct coex_dm_8723b_1ant coex_dm_8723b_1ant; + struct coex_dm_8723b_2ant coex_dm_8723b_2ant; + struct coex_dm_8821a_1ant coex_dm_8821a_1ant; + struct coex_dm_8821a_2ant coex_dm_8821a_2ant; + struct coex_dm_8822b_1ant coex_dm_8822b_1ant; + struct coex_dm_8822b_2ant coex_dm_8822b_2ant; + }; + union { + struct coex_sta_8192e_2ant coex_sta_8192e_2ant; + struct coex_sta_8723b_1ant coex_sta_8723b_1ant; + struct coex_sta_8723b_2ant coex_sta_8723b_2ant; + struct coex_sta_8821a_1ant coex_sta_8821a_1ant; + struct coex_sta_8821a_2ant coex_sta_8821a_2ant; + struct coex_sta_8822b_1ant coex_sta_8822b_1ant; + struct coex_sta_8822b_2ant coex_sta_8822b_2ant; + }; + union { + struct rfe_type_8822b_1ant rfe_type_8822b_1ant; + struct rfe_type_8822b_2ant rfe_type_8822b_2ant; + }; + /* boolean variables to replace BT_AUTO_REPORT_ONLY_XXXXY_ZANT * configuration parameters */