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 */
114 dma_addr_t rx_ring_dma;
116 struct sk_buff *rx_buf[32];
117 struct rtl8180_tx_ring tx_ring[RTL818X_NR_TX_QUEUES];
118 struct ieee80211_channel channels[14];
119 struct ieee80211_rate rates[12];
120 struct ieee80211_supported_band band;
121 struct ieee80211_tx_queue_params queue_param[4];
122 struct pci_dev *pdev;
128 RTL818X_CHIP_FAMILY_RTL8180,
129 RTL818X_CHIP_FAMILY_RTL8185,
130 RTL818X_CHIP_FAMILY_RTL8187SE,
135 u8 mac_addr[ETH_ALEN];
140 u8 thermal_meter_val;
142 u8 antenna_diversity_en;
143 u8 antenna_diversity_default;
148 void rtl8180_write_phy(struct ieee80211_hw *dev, u8 addr, u32 data);
149 void rtl8180_set_anaparam(struct rtl8180_priv *priv, u32 anaparam);
150 void rtl8180_set_anaparam2(struct rtl8180_priv *priv, u32 anaparam2);
152 static inline u8 rtl818x_ioread8(struct rtl8180_priv *priv, u8 __iomem *addr)
154 return ioread8(addr);
157 static inline u16 rtl818x_ioread16(struct rtl8180_priv *priv, __le16 __iomem *addr)
159 return ioread16(addr);
162 static inline u32 rtl818x_ioread32(struct rtl8180_priv *priv, __le32 __iomem *addr)
164 return ioread32(addr);
167 static inline void rtl818x_iowrite8(struct rtl8180_priv *priv,
168 u8 __iomem *addr, u8 val)
173 static inline void rtl818x_iowrite16(struct rtl8180_priv *priv,
174 __le16 __iomem *addr, u16 val)
176 iowrite16(val, addr);
179 static inline void rtl818x_iowrite32(struct rtl8180_priv *priv,
180 __le32 __iomem *addr, u32 val)
182 iowrite32(val, addr);
185 #endif /* RTL8180_H */