diff options
Diffstat (limited to 'drivers/net/wireless/realtek/rtlwifi/pci.h')
-rw-r--r-- | drivers/net/wireless/realtek/rtlwifi/pci.h | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.h b/drivers/net/wireless/realtek/rtlwifi/pci.h index 1af92b34979d..e7d070e8da2d 100644 --- a/drivers/net/wireless/realtek/rtlwifi/pci.h +++ b/drivers/net/wireless/realtek/rtlwifi/pci.h | |||
@@ -27,10 +27,9 @@ | |||
27 | #define __RTL_PCI_H__ | 27 | #define __RTL_PCI_H__ |
28 | 28 | ||
29 | #include <linux/pci.h> | 29 | #include <linux/pci.h> |
30 | /* | 30 | /* 1: MSDU packet queue, |
31 | 1: MSDU packet queue, | 31 | * 2: Rx Command Queue |
32 | 2: Rx Command Queue | 32 | */ |
33 | */ | ||
34 | #define RTL_PCI_RX_MPDU_QUEUE 0 | 33 | #define RTL_PCI_RX_MPDU_QUEUE 0 |
35 | #define RTL_PCI_RX_CMD_QUEUE 1 | 34 | #define RTL_PCI_RX_CMD_QUEUE 1 |
36 | #define RTL_PCI_MAX_RX_QUEUE 2 | 35 | #define RTL_PCI_MAX_RX_QUEUE 2 |
@@ -40,6 +39,7 @@ | |||
40 | 39 | ||
41 | #define RT_TXDESC_NUM 128 | 40 | #define RT_TXDESC_NUM 128 |
42 | #define TX_DESC_NUM_92E 512 | 41 | #define TX_DESC_NUM_92E 512 |
42 | #define TX_DESC_NUM_8822B 512 | ||
43 | #define RT_TXDESC_NUM_BE_QUEUE 256 | 43 | #define RT_TXDESC_NUM_BE_QUEUE 256 |
44 | 44 | ||
45 | #define BK_QUEUE 0 | 45 | #define BK_QUEUE 0 |
@@ -51,6 +51,7 @@ | |||
51 | #define MGNT_QUEUE 6 | 51 | #define MGNT_QUEUE 6 |
52 | #define HIGH_QUEUE 7 | 52 | #define HIGH_QUEUE 7 |
53 | #define HCCA_QUEUE 8 | 53 | #define HCCA_QUEUE 8 |
54 | #define H2C_QUEUE TXCMD_QUEUE /* In 8822B */ | ||
54 | 55 | ||
55 | #define RTL_PCI_DEVICE(vend, dev, cfg) \ | 56 | #define RTL_PCI_DEVICE(vend, dev, cfg) \ |
56 | .vendor = (vend), \ | 57 | .vendor = (vend), \ |
@@ -108,6 +109,7 @@ | |||
108 | #define RTL_PCI_8192EE_DID 0x818B /*8192ee*/ | 109 | #define RTL_PCI_8192EE_DID 0x818B /*8192ee*/ |
109 | #define RTL_PCI_8821AE_DID 0x8821 /*8821ae*/ | 110 | #define RTL_PCI_8821AE_DID 0x8821 /*8821ae*/ |
110 | #define RTL_PCI_8812AE_DID 0x8812 /*8812ae*/ | 111 | #define RTL_PCI_8812AE_DID 0x8812 /*8812ae*/ |
112 | #define RTL_PCI_8822BE_DID 0xB822 /*8822be*/ | ||
111 | 113 | ||
112 | /*8192 support 16 pages of IO registers*/ | 114 | /*8192 support 16 pages of IO registers*/ |
113 | #define RTL_MEM_MAPPED_IO_RANGE_8190PCI 0x1000 | 115 | #define RTL_MEM_MAPPED_IO_RANGE_8190PCI 0x1000 |
@@ -209,7 +211,7 @@ struct rtl_pci { | |||
209 | 211 | ||
210 | /*irq */ | 212 | /*irq */ |
211 | u8 irq_alloc; | 213 | u8 irq_alloc; |
212 | u32 irq_mask[2]; | 214 | u32 irq_mask[4]; /* 0-1: normal, 2: unused, 3: h2c */ |
213 | u32 sys_irq_mask; | 215 | u32 sys_irq_mask; |
214 | 216 | ||
215 | /*Bcn control register setting */ | 217 | /*Bcn control register setting */ |
@@ -223,8 +225,9 @@ struct rtl_pci { | |||
223 | u8 const_hostpci_aspm_setting; | 225 | u8 const_hostpci_aspm_setting; |
224 | /*pci-e device */ | 226 | /*pci-e device */ |
225 | u8 const_devicepci_aspm_setting; | 227 | u8 const_devicepci_aspm_setting; |
226 | /*If it supports ASPM, Offset[560h] = 0x40, | 228 | /* If it supports ASPM, Offset[560h] = 0x40, |
227 | otherwise Offset[560h] = 0x00. */ | 229 | * otherwise Offset[560h] = 0x00. |
230 | */ | ||
228 | bool support_aspm; | 231 | bool support_aspm; |
229 | bool support_backdoor; | 232 | bool support_backdoor; |
230 | 233 | ||
@@ -279,7 +282,7 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw); | |||
279 | extern const struct rtl_intf_ops rtl_pci_ops; | 282 | extern const struct rtl_intf_ops rtl_pci_ops; |
280 | 283 | ||
281 | int rtl_pci_probe(struct pci_dev *pdev, | 284 | int rtl_pci_probe(struct pci_dev *pdev, |
282 | const struct pci_device_id *id); | 285 | const struct pci_device_id *id); |
283 | void rtl_pci_disconnect(struct pci_dev *pdev); | 286 | void rtl_pci_disconnect(struct pci_dev *pdev); |
284 | #ifdef CONFIG_PM_SLEEP | 287 | #ifdef CONFIG_PM_SLEEP |
285 | int rtl_pci_suspend(struct device *dev); | 288 | int rtl_pci_suspend(struct device *dev); |
@@ -287,34 +290,34 @@ int rtl_pci_resume(struct device *dev); | |||
287 | #endif /* CONFIG_PM_SLEEP */ | 290 | #endif /* CONFIG_PM_SLEEP */ |
288 | static inline u8 pci_read8_sync(struct rtl_priv *rtlpriv, u32 addr) | 291 | static inline u8 pci_read8_sync(struct rtl_priv *rtlpriv, u32 addr) |
289 | { | 292 | { |
290 | return readb((u8 __iomem *) rtlpriv->io.pci_mem_start + addr); | 293 | return readb((u8 __iomem *)rtlpriv->io.pci_mem_start + addr); |
291 | } | 294 | } |
292 | 295 | ||
293 | static inline u16 pci_read16_sync(struct rtl_priv *rtlpriv, u32 addr) | 296 | static inline u16 pci_read16_sync(struct rtl_priv *rtlpriv, u32 addr) |
294 | { | 297 | { |
295 | return readw((u8 __iomem *) rtlpriv->io.pci_mem_start + addr); | 298 | return readw((u8 __iomem *)rtlpriv->io.pci_mem_start + addr); |
296 | } | 299 | } |
297 | 300 | ||
298 | static inline u32 pci_read32_sync(struct rtl_priv *rtlpriv, u32 addr) | 301 | static inline u32 pci_read32_sync(struct rtl_priv *rtlpriv, u32 addr) |
299 | { | 302 | { |
300 | return readl((u8 __iomem *) rtlpriv->io.pci_mem_start + addr); | 303 | return readl((u8 __iomem *)rtlpriv->io.pci_mem_start + addr); |
301 | } | 304 | } |
302 | 305 | ||
303 | static inline void pci_write8_async(struct rtl_priv *rtlpriv, u32 addr, u8 val) | 306 | static inline void pci_write8_async(struct rtl_priv *rtlpriv, u32 addr, u8 val) |
304 | { | 307 | { |
305 | writeb(val, (u8 __iomem *) rtlpriv->io.pci_mem_start + addr); | 308 | writeb(val, (u8 __iomem *)rtlpriv->io.pci_mem_start + addr); |
306 | } | 309 | } |
307 | 310 | ||
308 | static inline void pci_write16_async(struct rtl_priv *rtlpriv, | 311 | static inline void pci_write16_async(struct rtl_priv *rtlpriv, |
309 | u32 addr, u16 val) | 312 | u32 addr, u16 val) |
310 | { | 313 | { |
311 | writew(val, (u8 __iomem *) rtlpriv->io.pci_mem_start + addr); | 314 | writew(val, (u8 __iomem *)rtlpriv->io.pci_mem_start + addr); |
312 | } | 315 | } |
313 | 316 | ||
314 | static inline void pci_write32_async(struct rtl_priv *rtlpriv, | 317 | static inline void pci_write32_async(struct rtl_priv *rtlpriv, |
315 | u32 addr, u32 val) | 318 | u32 addr, u32 val) |
316 | { | 319 | { |
317 | writel(val, (u8 __iomem *) rtlpriv->io.pci_mem_start + addr); | 320 | writel(val, (u8 __iomem *)rtlpriv->io.pci_mem_start + addr); |
318 | } | 321 | } |
319 | 322 | ||
320 | static inline u16 calc_fifo_space(u16 rp, u16 wp) | 323 | static inline u16 calc_fifo_space(u16 rp, u16 wp) |