linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <pkshih@realtek.com>
To: <kvalo@codeaurora.org>
Cc: <Larry.Finger@lwfinger.net>, <linux-wireless@vger.kernel.org>
Subject: [PATCH 8/9] rtlwifi: btcoex: Add struct members to replace global varaibles
Date: Wed, 28 Mar 2018 15:27:40 +0800	[thread overview]
Message-ID: <20180328072741.23349-9-pkshih@realtek.com> (raw)
In-Reply-To: <20180328072741.23349-1-pkshih@realtek.com>

From: Ping-Ke Shih <pkshih@realtek.com>

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 <pkshih@realtek.com>
---
 .../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
 	 */
-- 
2.15.1

  parent reply	other threads:[~2018-03-28  7:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28  7:27 [PATCH 0/9] rtlwifi: btcoex: Add 8822b btcoex support pkshih
2018-03-28  7:27 ` [PATCH 1/9] rtlwifi: btcoex: Add 8822b1ant coex files pkshih
2018-04-04  2:43   ` Larry Finger
2018-04-04 12:41     ` Pkshih
2018-04-04 12:45       ` Pkshih
2018-03-28  7:27 ` [PATCH 2/9] rtlwifi: btcoex: Add 8822b2ant " pkshih
2018-03-28  7:27 ` [PATCH 3/9] rtlwifi: btcoex: Add 8822b header files to precomp.h pkshih
2018-03-28  7:27 ` [PATCH 4/9] rtlwifi: btcoex: Add 8822b routine to btc interfaces pkshih
2018-03-28  7:27 ` [PATCH 5/9] rtlwifi: btcoex: Add 8822b to Makefile pkshih
2018-03-28  7:27 ` [PATCH 6/9] rtlwifi: btcoex: remove comments that are not meaningful pkshih
2018-03-28  7:27 ` [PATCH 7/9] rtlwifi: btcoex: Add modifier const to version related variables pkshih
2018-03-28 14:35   ` Kalle Valo
2018-03-28  7:27 ` pkshih [this message]
2018-03-28  7:27 ` [PATCH 9/9] rtlwifi: btcoex: Remove global variables of chip specific context pkshih

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180328072741.23349-9-pkshih@realtek.com \
    --to=pkshih@realtek.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).