Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
rtl8180.h
Go to the documentation of this file.
1 #ifndef RTL8180_H
2 #define RTL8180_H
3 
4 #include "rtl818x.h"
5 
6 #define MAX_RX_SIZE IEEE80211_MAX_RTS_THRESHOLD
7 
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)
12 
13 #define BB_ANTATTEN_CHAN14 0x0C
14 #define BB_ANTENNA_B 0x40
15 
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
20 
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)
26 
34  u8 cw;
39 } __packed;
40 
44  union {
47  };
48 } __packed;
49 
53  unsigned int idx;
54  unsigned int entries;
56 };
57 
58 struct rtl8180_vif {
59  struct ieee80211_hw *dev;
60 
61  /* beaconing */
64 };
65 
66 struct rtl8180_priv {
67  /* common between rtl818x drivers */
69  const struct rtl818x_rf_ops *rf;
70  struct ieee80211_vif *vif;
71 
72  /* rtl8180 driver specific */
76  unsigned int rx_idx;
77  struct sk_buff *rx_buf[32];
80  struct ieee80211_rate rates[12];
82  struct pci_dev *pdev;
84 
85  int r8185;
89 
90  /* sequence # */
92 };
93 
95 void rtl8180_set_anaparam(struct rtl8180_priv *priv, u32 anaparam);
96 
97 static inline u8 rtl818x_ioread8(struct rtl8180_priv *priv, u8 __iomem *addr)
98 {
99  return ioread8(addr);
100 }
101 
102 static inline u16 rtl818x_ioread16(struct rtl8180_priv *priv, __le16 __iomem *addr)
103 {
104  return ioread16(addr);
105 }
106 
107 static inline u32 rtl818x_ioread32(struct rtl8180_priv *priv, __le32 __iomem *addr)
108 {
109  return ioread32(addr);
110 }
111 
112 static inline void rtl818x_iowrite8(struct rtl8180_priv *priv,
113  u8 __iomem *addr, u8 val)
114 {
115  iowrite8(val, addr);
116 }
117 
118 static inline void rtl818x_iowrite16(struct rtl8180_priv *priv,
120 {
121  iowrite16(val, addr);
122 }
123 
124 static inline void rtl818x_iowrite32(struct rtl8180_priv *priv,
126 {
127  iowrite32(val, addr);
128 }
129 
130 #endif /* RTL8180_H */