Add rtl8180 wireless driver
PATCH 1/1 Add rtl8180 wireless driver
This patch adds a mac80211 based wireless driver for the rtl8185 PCI wireless card.
Note that even though this driver is named rtl8180, it does not fully support the rtl8180 yet. Andrea Merello will be doing the work for that later. It supports the rtl8185 with the rtl8225z2 radio fairly well, and the rtl8225 radio code should work too.
Thanks to Jukka Ruohonen for the donating a rtl8185 card! It was very helpful for the rtl8225z2 code.
Signed-off-by Michael Wu <[email protected]>
---
drivers/net/wireless/Kconfig | 5 drivers/net/wireless/Makefile | 3 drivers/net/wireless/rtl8180.h | 138 ++++ drivers/net/wireless/rtl8180_dev.c | 1013 ++++++++++++++++++++++++++++++++ drivers/net/wireless/rtl8180_rtl8225.c | 777 +++++++++++++++++++++++++ drivers/net/wireless/rtl8180_rtl8225.h | 28 + drivers/net/wireless/rtl818x.h | 18 - 7 files changed, 1979 insertions(+), 3 deletions(-)
drivers/net/wireless/Kconfig +5 -0
@@ -546,6 +546,11 @@ config USB_ZD1201 To compile this driver as a module, choose M here: the module will be called zd1201. +config RTL8180 + tristate "Realtek 8185 PCI support" + depends on MAC80211 && PCI && WLAN_80211 && EXPERIMENTAL + select EEPROM_93CX6 + config RTL8187 tristate "Realtek 8187 USB support" depends on MAC80211 && USB && WLAN_80211 && EXPERIMENTAL
drivers/net/wireless/Makefile +3 -0
@@ -50,7 +50,10 @@ obj-$(CONFIG_PCMCIA_WL3501) += wl3501_cs.o obj-$(CONFIG_USB_ZD1201) += zd1201.o obj-$(CONFIG_LIBERTAS) += libertas/ +rtl8180-objs := rtl8180_dev.o rtl8180_rtl8225.o rtl8187-objs := rtl8187_dev.o rtl8187_rtl8225.o + +obj-$(CONFIG_RTL8180) += rtl8180.o obj-$(CONFIG_RTL8187) += rtl8187.o obj-$(CONFIG_ADM8211) += adm8211.o
drivers/net/wireless/rtl8180.h new file +138 -0
138 lines not on this page · raw message
drivers/net/wireless/rtl8180_dev.c new file +1013 -0
1,013 lines not on this page · raw message
drivers/net/wireless/rtl8180_rtl8225.c new file +777 -0
777 lines not on this page · raw message
drivers/net/wireless/rtl8180_rtl8225.h new file +28 -0
@@ -0,0 +1,28 @@ +#ifndef RTL8180_RTL8225_H +#define RTL8180_RTL8225_H + +#define RTL8225_ANAPARAM_ON 0xa0000b59 +#define RTL8225_ANAPARAM2_ON 0x860dec11 +#define RTL8225_ANAPARAM_OFF 0xa00beb59 +#define RTL8225_ANAPARAM2_OFF 0x840dec11 + +int rtl8225_is_z2 (struct ieee80211_hw *dev); + +void rtl8225_rf_init (struct ieee80211_hw *); +void rtl8225z2_rf_init (struct ieee80211_hw *); +void rtl8225_rf_stop (struct ieee80211_hw *); +void rtl8225_rf_set_channel (struct ieee80211_hw *,struct ieee80211_conf *); + +static inline void rtl8225_write_phy_ofdm (struct ieee80211_hw *dev, +u8 addr,u8 data) +{ +rtl8180_write_phy (dev, addr, data); +} + +static inline void rtl8225_write_phy_cck (struct ieee80211_hw *dev, +u8 addr,u8 data) +{ +rtl8180_write_phy (dev, addr, data |0x10000 ); +} + +#endif /* RTL8180_RTL8225_H */
drivers/net/wireless/rtl818x.h +15 -3
@@ -58,13 +58,17 @@ struct rtl818x_csr {#define RTL818X_INT_TX_FO (1 << 15)__le32 TX_CONF ;#define RTL818X_TX_CONF_LOOPBACK_MAC (1 << 17) +#define RTL818X_TX_CONF_LOOPBACK_CONT (3 << 17)#define RTL818X_TX_CONF_NO_ICV (1 << 19)#define RTL818X_TX_CONF_DISCW (1 << 20) +#define RTL818X_TX_CONF_SAT_HWPLCP (1 << 24)#define RTL818X_TX_CONF_R8180_ABCD (2 << 25)#define RTL818X_TX_CONF_R8180_F (3 << 25)#define RTL818X_TX_CONF_R8185_ABC (4 << 25)#define RTL818X_TX_CONF_R8185_D (5 << 25)#define RTL818X_TX_CONF_HWVER_MASK (7 << 25) +#define RTL818X_TX_CONF_PROBE_DTS (1 << 29) +#define RTL818X_TX_CONF_HW_SEQNUM (1 << 30)#define RTL818X_TX_CONF_CW_MIN (1 << 31)__le32 RX_CONF ;#define RTL818X_RX_CONF_MONITOR (1 << 0)
@@ -75,8 +79,12 @@ struct rtl818x_csr {#define RTL818X_RX_CONF_DATA (1 << 18)#define RTL818X_RX_CONF_CTRL (1 << 19)#define RTL818X_RX_CONF_MGMT (1 << 20) +#define RTL818X_RX_CONF_ADDR3 (1 << 21) +#define RTL818X_RX_CONF_PM (1 << 22)#define RTL818X_RX_CONF_BSSID (1 << 23)#define RTL818X_RX_CONF_RX_AUTORESETPHY (1 << 28) +#define RTL818X_RX_CONF_CSDM1 (1 << 29) +#define RTL818X_RX_CONF_CSDM2 (1 << 30)#define RTL818X_RX_CONF_ONLYERLPKT (1 << 31)__le32 INT_TIMEOUT ;__le32 TBDA ;
@@ -92,6 +100,7 @@ struct rtl818x_csr {u8 CONFIG0 ;u8 CONFIG1 ;u8 CONFIG2 ; +#define RTL818X_CONFIG2_ANTENNA_DIV (1 << 6)__le32 ANAPARAM ;u8 MSR ;#define RTL818X_MSR_NO_LINK (0 << 2)
@@ -111,7 +120,8 @@ struct rtl818x_csr {__le16 ATIM_WND ;__le16 BEACON_INTERVAL_TIME ;__le16 ATIMTR_INTERVAL ; -u8 reserved_11[4 ]; +__le16 PHY_DELAY ; +u8 reserved_11[2 ];u8 PHY [4 ];__le16 RFPinsOutput;__le16 RFPinsEnable;
@@ -149,8 +159,10 @@ struct rtl818x_csr {u8 RETRY_CTR ;u8 reserved_18[5 ];__le32 RDSAR ; -u8 reserved_19[18 ]; -u16 TALLY_CNT ; +u8 reserved_19[12 ]; +__le16 FEMR ; +u8 reserved_20[4 ]; +__le16 TALLY_CNT ;u8 TALLY_SEL ; } __attribute__((packed));