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 /* rtl8187SE have 6 queues + beacon queues
33 * mac80211 can use 4 QoS data queue, + beacon = 5 tot
35 #define RTL8187SE_NR_TX_QUEUES 5
37 /* for array static allocation, it is the max of above */
38 #define RTL818X_NR_TX_QUEUES 5
40 struct rtl8180_tx_desc {
49 __le16 frame_duration;
57 /* rsvd for 8180/8185.
58 * valid for 8187se but we dont use it
61 /* all rsvd for 8180/8185 */
66 struct rtl818x_rx_cmd_desc {
72 struct rtl8180_rx_desc {
79 struct rtl8187se_rx_desc {
87 struct rtl8180_tx_ring {
88 struct rtl8180_tx_desc *desc;
92 struct sk_buff_head queue;
96 struct ieee80211_hw *dev;
99 struct delayed_work beacon_work;
103 struct rtl8180_priv {
104 /* common between rtl818x drivers */
105 struct rtl818x_csr __iomem *map;
106 const struct rtl818x_rf_ops *rf;
107 struct ieee80211_vif *vif;
109 /* rtl8180 driver specific */
113 dma_addr_t rx_ring_dma;
115 struct sk_buff *rx_buf[32];
116 struct rtl8180_tx_ring tx_ring[RTL818X_NR_TX_QUEUES];
117 struct ieee80211_channel channels[14];
118 struct ieee80211_rate rates[12];
119 struct ieee80211_supported_band band;
120 struct pci_dev *pdev;
126 RTL818X_CHIP_FAMILY_RTL8180,
127 RTL818X_CHIP_FAMILY_RTL8185,
128 RTL818X_CHIP_FAMILY_RTL8187SE,
133 u8 mac_addr[ETH_ALEN];
139 void rtl8180_write_phy(struct ieee80211_hw *dev, u8 addr, u32 data);
140 void rtl8180_set_anaparam(struct rtl8180_priv *priv, u32 anaparam);
142 static inline u8 rtl818x_ioread8(struct rtl8180_priv *priv, u8 __iomem *addr)
144 return ioread8(addr);
147 static inline u16 rtl818x_ioread16(struct rtl8180_priv *priv, __le16 __iomem *addr)
149 return ioread16(addr);
152 static inline u32 rtl818x_ioread32(struct rtl8180_priv *priv, __le32 __iomem *addr)
154 return ioread32(addr);
157 static inline void rtl818x_iowrite8(struct rtl8180_priv *priv,
158 u8 __iomem *addr, u8 val)
163 static inline void rtl818x_iowrite16(struct rtl8180_priv *priv,
164 __le16 __iomem *addr, u16 val)
166 iowrite16(val, addr);
169 static inline void rtl818x_iowrite32(struct rtl8180_priv *priv,
170 __le32 __iomem *addr, u32 val)
172 iowrite32(val, addr);
175 #endif /* RTL8180_H */