Commit 58438d9a authored by Ping-Ke Shih's avatar Ping-Ke Shih Committed by Kalle Valo

rtlwifi: move IS_HARDWARE_TYPE_xxx checker to wifi.h

Use rtlpriv instead of rtlhal as argument, so driver and btcoex use
the same definitions.
Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent e7c52861
...@@ -43,22 +43,6 @@ ...@@ -43,22 +43,6 @@
#define RT_SDIO_INTERFACE 3 #define RT_SDIO_INTERFACE 3
#define DEV_BUS_TYPE RT_PCI_INTERFACE #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 "halbtc8192e2ant.h"
#include "halbtc8723b1ant.h" #include "halbtc8723b1ant.h"
#include "halbtc8723b2ant.h" #include "halbtc8723b2ant.h"
......
...@@ -352,11 +352,10 @@ u32 rtl92c_get_txdma_status(struct ieee80211_hw *hw) ...@@ -352,11 +352,10 @@ u32 rtl92c_get_txdma_status(struct ieee80211_hw *hw)
void rtl92c_enable_interrupt(struct ieee80211_hw *hw) void rtl92c_enable_interrupt(struct ieee80211_hw *hw)
{ {
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw)); struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
if (IS_HARDWARE_TYPE_8192CE(rtlhal)) { if (IS_HARDWARE_TYPE_8192CE(rtlpriv)) {
rtl_write_dword(rtlpriv, REG_HIMR, rtlpci->irq_mask[0] & rtl_write_dword(rtlpriv, REG_HIMR, rtlpci->irq_mask[0] &
0xFFFFFFFF); 0xFFFFFFFF);
rtl_write_dword(rtlpriv, REG_HIMRE, rtlpci->irq_mask[1] & rtl_write_dword(rtlpriv, REG_HIMRE, rtlpci->irq_mask[1] &
......
...@@ -314,35 +314,29 @@ enum hardware_type { ...@@ -314,35 +314,29 @@ enum hardware_type {
HARDWARE_TYPE_RTL8192EE, HARDWARE_TYPE_RTL8192EE,
HARDWARE_TYPE_RTL8821AE, HARDWARE_TYPE_RTL8821AE,
HARDWARE_TYPE_RTL8812AE, HARDWARE_TYPE_RTL8812AE,
HARDWARE_TYPE_RTL8822BE,
/* keep it last */ /* keep it last */
HARDWARE_TYPE_NUM HARDWARE_TYPE_NUM
}; };
#define IS_HARDWARE_TYPE_8192SU(rtlhal) \ #define RTL_HW_TYPE(rtlpriv) (rtl_hal((struct rtl_priv *)rtlpriv)->hw_type)
(rtlhal->hw_type == HARDWARE_TYPE_RTL8192SU) #define IS_NEW_GENERATION_IC(rtlpriv) \
#define IS_HARDWARE_TYPE_8192SE(rtlhal) \ (RTL_HW_TYPE(rtlpriv) >= HARDWARE_TYPE_RTL8192EE)
(rtlhal->hw_type == HARDWARE_TYPE_RTL8192SE) #define IS_HARDWARE_TYPE_8192CE(rtlpriv) \
#define IS_HARDWARE_TYPE_8192CE(rtlhal) \ (RTL_HW_TYPE(rtlpriv) == HARDWARE_TYPE_RTL8192CE)
(rtlhal->hw_type == HARDWARE_TYPE_RTL8192CE) #define IS_HARDWARE_TYPE_8812(rtlpriv) \
#define IS_HARDWARE_TYPE_8192CU(rtlhal) \ (RTL_HW_TYPE(rtlpriv) == HARDWARE_TYPE_RTL8812AE)
(rtlhal->hw_type == HARDWARE_TYPE_RTL8192CU) #define IS_HARDWARE_TYPE_8821(rtlpriv) \
#define IS_HARDWARE_TYPE_8192DE(rtlhal) \ (RTL_HW_TYPE(rtlpriv) == HARDWARE_TYPE_RTL8821AE)
(rtlhal->hw_type == HARDWARE_TYPE_RTL8192DE) #define IS_HARDWARE_TYPE_8723A(rtlpriv) \
#define IS_HARDWARE_TYPE_8192DU(rtlhal) \ (RTL_HW_TYPE(rtlpriv) == HARDWARE_TYPE_RTL8723AE)
(rtlhal->hw_type == HARDWARE_TYPE_RTL8192DU) #define IS_HARDWARE_TYPE_8723B(rtlpriv) \
#define IS_HARDWARE_TYPE_8723E(rtlhal) \ (RTL_HW_TYPE(rtlpriv) == HARDWARE_TYPE_RTL8723BE)
(rtlhal->hw_type == HARDWARE_TYPE_RTL8723E) #define IS_HARDWARE_TYPE_8192E(rtlpriv) \
#define IS_HARDWARE_TYPE_8723U(rtlhal) \ (RTL_HW_TYPE(rtlpriv) == HARDWARE_TYPE_RTL8192EE)
(rtlhal->hw_type == HARDWARE_TYPE_RTL8723U) #define IS_HARDWARE_TYPE_8822B(rtlpriv) \
#define IS_HARDWARE_TYPE_8192S(rtlhal) \ (RTL_HW_TYPE(rtlpriv) == HARDWARE_TYPE_RTL8822BE)
(IS_HARDWARE_TYPE_8192SE(rtlhal) || IS_HARDWARE_TYPE_8192SU(rtlhal))
#define IS_HARDWARE_TYPE_8192C(rtlhal) \
(IS_HARDWARE_TYPE_8192CE(rtlhal) || IS_HARDWARE_TYPE_8192CU(rtlhal))
#define IS_HARDWARE_TYPE_8192D(rtlhal) \
(IS_HARDWARE_TYPE_8192DE(rtlhal) || IS_HARDWARE_TYPE_8192DU(rtlhal))
#define IS_HARDWARE_TYPE_8723(rtlhal) \
(IS_HARDWARE_TYPE_8723E(rtlhal) || IS_HARDWARE_TYPE_8723U(rtlhal))
#define RX_HAL_IS_CCK_RATE(rxmcs) \ #define RX_HAL_IS_CCK_RATE(rxmcs) \
((rxmcs) == DESC_RATE1M || \ ((rxmcs) == DESC_RATE1M || \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment