diff mbox

[v2,1/9] rtlwifi: btcoex: add macros to check chip type

Message ID 20170605152959.27439-2-Larry.Finger@lwfinger.net (mailing list archive)
State Accepted
Commit d178b1321e494c5928cc135814bc303ec9de2282
Delegated to: Kalle Valo
Headers show

Commit Message

Larry Finger June 5, 2017, 3:29 p.m. UTC
From: Yan-Hsuan Chuang <yhchuang@realtek.com>

For some external functions that have hardware dependency, we need to
know the type of the hardware before invoking them.

Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
---
 .../realtek/rtlwifi/btcoexist/halbt_precomp.h      | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

Comments

Kalle Valo June 13, 2017, 7:03 a.m. UTC | #1
Larry Finger <Larry.Finger@lwfinger.net> wrote:

> From: Yan-Hsuan Chuang <yhchuang@realtek.com>
> 
> For some external functions that have hardware dependency, we need to
> know the type of the hardware before invoking them.
> 
> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> Cc: Ping-Ke Shih <pkshih@realtek.com>
> Cc: Birming Chiu <birming@realtek.com>
> Cc: Shaofu <shaofu@realtek.com>
> Cc: Steven Ting <steventing@realtek.com>

9 patches applied to wireless-drivers-next.git, thanks.

d178b1321e49 rtlwifi: btcoex: add macros to check chip type
753c953bae5d rtlwifi: btcoex: rename ex_halbtc*ant to ex_btc*ant
6fbbc82adfb2 rtlwifi: btcoex: settings before firmware is downloaded
86f9ab2ef4bd rtlwifi: btcoex: hook external PnP notify by chip for wifi driver
60f44100eee7 rtlwifi: btcoex: add settings before the hardware is ready
7937f02d1953 rtlwifi: btcoex: hook external functions for newer chips
0199103ea7ec rtlwifi: btcoex: bind BT coex information with wifi driver
6aafa2307414 rtlwifi: btcoex: remove unused display functions
c42ea613353c rtlwifi: btcoex: let btcoex get wifi rssi and link status
diff mbox

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbt_precomp.h b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbt_precomp.h
index 39b9a3309cfd..2ac989a4b2bb 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbt_precomp.h
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbt_precomp.h
@@ -37,6 +37,28 @@ 
 
 #include "halbtcoutsrc.h"
 
+/* Interface type */
+#define RT_PCI_INTERFACE	1
+#define RT_USB_INTERFACE	2
+#define RT_SDIO_INTERFACE	3
+#define DEV_BUS_TYPE		RT_PCI_INTERFACE
+
+/* IC type */
+#define RTL_HW_TYPE(adapter)	(rtl_hal((struct rtl_priv *)adapter)->hw_type)
+
+#define IS_NEW_GENERATION_IC(adapter)		\
+			(RTL_HW_TYPE(adapter) >= HARDWARE_TYPE_RTL8192EE)
+#define IS_HARDWARE_TYPE_8812(adapter)		\
+			(RTL_HW_TYPE(adapter) == HARDWARE_TYPE_RTL8812AE)
+#define IS_HARDWARE_TYPE_8821(adapter)		\
+			(RTL_HW_TYPE(adapter) == HARDWARE_TYPE_RTL8821AE)
+#define IS_HARDWARE_TYPE_8723A(adapter)	\
+			(RTL_HW_TYPE(adapter) == HARDWARE_TYPE_RTL8723AE)
+#define IS_HARDWARE_TYPE_8723B(adapter)	\
+			(RTL_HW_TYPE(adapter) == HARDWARE_TYPE_RTL8723BE)
+#define IS_HARDWARE_TYPE_8192E(adapter)	\
+			(RTL_HW_TYPE(adapter) == HARDWARE_TYPE_RTL8192EE)
+
 #include "halbtc8192e2ant.h"
 #include "halbtc8723b1ant.h"
 #include "halbtc8723b2ant.h"