6 #define MAX_RX_SIZE IEEE80211_MAX_RTS_THRESHOLD
8 #define RF_PARAM_ANALOGPHY (1 << 0)
9 #define RF_PARAM_ANTBDEFAULT (1 << 1)
10 #define RF_PARAM_CARRIERSENSE1 (1 << 2)
11 #define RF_PARAM_CARRIERSENSE2 (1 << 3)
13 #define BB_ANTATTEN_CHAN14 0x0C
14 #define BB_ANTENNA_B 0x40
16 #define BB_HOST_BANG (1 << 30)
17 #define BB_HOST_BANG_EN (1 << 2)
18 #define BB_HOST_BANG_CLK (1 << 1)
19 #define BB_HOST_BANG_DATA 1
21 #define ANAPARAM_TXDACOFF_SHIFT 27
22 #define ANAPARAM_PWR0_SHIFT 28
23 #define ANAPARAM_PWR0_MASK (0x07 << ANAPARAM_PWR0_SHIFT)
24 #define ANAPARAM_PWR1_SHIFT 20
25 #define ANAPARAM_PWR1_MASK (0x7F << ANAPARAM_PWR1_SHIFT)
27 /* rtl8180/rtl8185 have 3 queue + beacon queue.
28 * mac80211 can use just one, + beacon = 2 tot.
30 #define RTL8180_NR_TX_QUEUES 2
32 struct rtl8180_tx_desc {
46 struct rtl8180_rx_desc {
55 struct rtl8180_tx_ring {
56 struct rtl8180_tx_desc *desc;
60 struct sk_buff_head queue;
64 struct ieee80211_hw *dev;
67 struct delayed_work beacon_work;
72 /* common between rtl818x drivers */
73 struct rtl818x_csr __iomem *map;
74 const struct rtl818x_rf_ops *rf;
75 struct ieee80211_vif *vif;
77 /* rtl8180 driver specific */
79 struct rtl8180_rx_desc *rx_ring;
80 dma_addr_t rx_ring_dma;
82 struct sk_buff *rx_buf[32];
83 struct rtl8180_tx_ring tx_ring[RTL8180_NR_TX_QUEUES];
84 struct ieee80211_channel channels[14];
85 struct ieee80211_rate rates[12];
86 struct ieee80211_supported_band band;
93 RTL818X_CHIP_FAMILY_RTL8180,
94 RTL818X_CHIP_FAMILY_RTL8185,
99 u8 mac_addr[ETH_ALEN];
105 void rtl8180_write_phy(struct ieee80211_hw *dev, u8 addr, u32 data);
106 void rtl8180_set_anaparam(struct rtl8180_priv *priv, u32 anaparam);
108 static inline u8 rtl818x_ioread8(struct rtl8180_priv *priv, u8 __iomem *addr)
110 return ioread8(addr);
113 static inline u16 rtl818x_ioread16(struct rtl8180_priv *priv, __le16 __iomem *addr)
115 return ioread16(addr);
118 static inline u32 rtl818x_ioread32(struct rtl8180_priv *priv, __le32 __iomem *addr)
120 return ioread32(addr);
123 static inline void rtl818x_iowrite8(struct rtl8180_priv *priv,
124 u8 __iomem *addr, u8 val)
129 static inline void rtl818x_iowrite16(struct rtl8180_priv *priv,
130 __le16 __iomem *addr, u16 val)
132 iowrite16(val, addr);
135 static inline void rtl818x_iowrite32(struct rtl8180_priv *priv,
136 __le32 __iomem *addr, u32 val)
138 iowrite32(val, addr);
141 #endif /* RTL8180_H */