diff options
author | Michael Wu <flamingice@sourmilk.net> | 2007-05-14 01:41:02 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-07-08 22:16:36 -0400 |
commit | 605bebe23bf6ac66c0a717e663a7baa2f981294d (patch) | |
tree | c40d4aeaddd7996b8c69da6edd1c8269c60debb1 /drivers/net/wireless/rtl818x.h | |
parent | 4b914dc0493edff19ff698a18198a173a14ba9d2 (diff) |
[PATCH] Add rtl8187 wireless driver
This patch adds a mac80211 based wireless driver for the rtl8187 USB
wireless card.
Signed-off-by: Michael Wu <flamingice@sourmilk.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rtl818x.h')
-rw-r--r-- | drivers/net/wireless/rtl818x.h | 212 |
1 files changed, 212 insertions, 0 deletions
diff --git a/drivers/net/wireless/rtl818x.h b/drivers/net/wireless/rtl818x.h new file mode 100644 index 000000000000..e4ee946e1d90 --- /dev/null +++ b/drivers/net/wireless/rtl818x.h | |||
@@ -0,0 +1,212 @@ | |||
1 | #ifndef RTL818X_H | ||
2 | #define RTL818X_H | ||
3 | |||
4 | struct rtl818x_csr { | ||
5 | u8 MAC[6]; | ||
6 | u8 reserved_0[2]; | ||
7 | __le32 MAR[2]; | ||
8 | u8 RX_FIFO_COUNT; | ||
9 | u8 reserved_1; | ||
10 | u8 TX_FIFO_COUNT; | ||
11 | u8 BQREQ; | ||
12 | u8 reserved_2[4]; | ||
13 | __le32 TSFT[2]; | ||
14 | __le32 TLPDA; | ||
15 | __le32 TNPDA; | ||
16 | __le32 THPDA; | ||
17 | __le16 BRSR; | ||
18 | u8 BSSID[6]; | ||
19 | u8 RESP_RATE; | ||
20 | u8 EIFS; | ||
21 | u8 reserved_3[1]; | ||
22 | u8 CMD; | ||
23 | #define RTL818X_CMD_TX_ENABLE (1 << 2) | ||
24 | #define RTL818X_CMD_RX_ENABLE (1 << 3) | ||
25 | #define RTL818X_CMD_RESET (1 << 4) | ||
26 | u8 reserved_4[4]; | ||
27 | __le16 INT_MASK; | ||
28 | __le16 INT_STATUS; | ||
29 | #define RTL818X_INT_RX_OK (1 << 0) | ||
30 | #define RTL818X_INT_RX_ERR (1 << 1) | ||
31 | #define RTL818X_INT_TXL_OK (1 << 2) | ||
32 | #define RTL818X_INT_TXL_ERR (1 << 3) | ||
33 | #define RTL818X_INT_RX_DU (1 << 4) | ||
34 | #define RTL818X_INT_RX_FO (1 << 5) | ||
35 | #define RTL818X_INT_TXN_OK (1 << 6) | ||
36 | #define RTL818X_INT_TXN_ERR (1 << 7) | ||
37 | #define RTL818X_INT_TXH_OK (1 << 8) | ||
38 | #define RTL818X_INT_TXH_ERR (1 << 9) | ||
39 | #define RTL818X_INT_TXB_OK (1 << 10) | ||
40 | #define RTL818X_INT_TXB_ERR (1 << 11) | ||
41 | #define RTL818X_INT_ATIM (1 << 12) | ||
42 | #define RTL818X_INT_BEACON (1 << 13) | ||
43 | #define RTL818X_INT_TIME_OUT (1 << 14) | ||
44 | #define RTL818X_INT_TX_FO (1 << 15) | ||
45 | __le32 TX_CONF; | ||
46 | #define RTL818X_TX_CONF_LOOPBACK_MAC (1 << 17) | ||
47 | #define RTL818X_TX_CONF_NO_ICV (1 << 19) | ||
48 | #define RTL818X_TX_CONF_DISCW (1 << 20) | ||
49 | #define RTL818X_TX_CONF_R8180_ABCD (2 << 25) | ||
50 | #define RTL818X_TX_CONF_R8180_F (3 << 25) | ||
51 | #define RTL818X_TX_CONF_R8185_ABC (4 << 25) | ||
52 | #define RTL818X_TX_CONF_R8185_D (5 << 25) | ||
53 | #define RTL818X_TX_CONF_HWVER_MASK (7 << 25) | ||
54 | #define RTL818X_TX_CONF_CW_MIN (1 << 31) | ||
55 | __le32 RX_CONF; | ||
56 | #define RTL818X_RX_CONF_MONITOR (1 << 0) | ||
57 | #define RTL818X_RX_CONF_NICMAC (1 << 1) | ||
58 | #define RTL818X_RX_CONF_MULTICAST (1 << 2) | ||
59 | #define RTL818X_RX_CONF_BROADCAST (1 << 3) | ||
60 | #define RTL818X_RX_CONF_DATA (1 << 18) | ||
61 | #define RTL818X_RX_CONF_CTRL (1 << 19) | ||
62 | #define RTL818X_RX_CONF_MGMT (1 << 20) | ||
63 | #define RTL818X_RX_CONF_BSSID (1 << 23) | ||
64 | #define RTL818X_RX_CONF_RX_AUTORESETPHY (1 << 28) | ||
65 | #define RTL818X_RX_CONF_ONLYERLPKT (1 << 31) | ||
66 | __le32 INT_TIMEOUT; | ||
67 | __le32 TBDA; | ||
68 | u8 EEPROM_CMD; | ||
69 | #define RTL818X_EEPROM_CMD_READ (1 << 0) | ||
70 | #define RTL818X_EEPROM_CMD_WRITE (1 << 1) | ||
71 | #define RTL818X_EEPROM_CMD_CK (1 << 2) | ||
72 | #define RTL818X_EEPROM_CMD_CS (1 << 3) | ||
73 | #define RTL818X_EEPROM_CMD_NORMAL (0 << 6) | ||
74 | #define RTL818X_EEPROM_CMD_LOAD (1 << 6) | ||
75 | #define RTL818X_EEPROM_CMD_PROGRAM (2 << 6) | ||
76 | #define RTL818X_EEPROM_CMD_CONFIG (3 << 6) | ||
77 | u8 CONFIG0; | ||
78 | u8 CONFIG1; | ||
79 | u8 CONFIG2; | ||
80 | __le32 ANAPARAM; | ||
81 | u8 MSR; | ||
82 | #define RTL818X_MSR_NO_LINK (0 << 2) | ||
83 | #define RTL818X_MSR_ADHOC (1 << 2) | ||
84 | #define RTL818X_MSR_INFRA (2 << 2) | ||
85 | u8 CONFIG3; | ||
86 | #define RTL818X_CONFIG3_ANAPARAM_WRITE (1 << 6) | ||
87 | u8 CONFIG4; | ||
88 | #define RTL818X_CONFIG4_POWEROFF (1 << 6) | ||
89 | #define RTL818X_CONFIG4_VCOOFF (1 << 7) | ||
90 | u8 TESTR; | ||
91 | u8 reserved_9[2]; | ||
92 | __le16 PGSELECT; | ||
93 | __le32 ANAPARAM2; | ||
94 | u8 reserved_10[12]; | ||
95 | __le16 BEACON_INTERVAL; | ||
96 | __le16 ATIM_WND; | ||
97 | __le16 BEACON_INTERVAL_TIME; | ||
98 | __le16 ATIMTR_INTERVAL; | ||
99 | u8 reserved_11[4]; | ||
100 | u8 PHY[4]; | ||
101 | __le16 RFPinsOutput; | ||
102 | __le16 RFPinsEnable; | ||
103 | __le16 RFPinsSelect; | ||
104 | __le16 RFPinsInput; | ||
105 | __le32 RF_PARA; | ||
106 | __le32 RF_TIMING; | ||
107 | u8 GP_ENABLE; | ||
108 | u8 GPIO; | ||
109 | u8 reserved_12[10]; | ||
110 | u8 TX_AGC_CTL; | ||
111 | #define RTL818X_TX_AGC_CTL_PERPACKET_GAIN_SHIFT (1 << 0) | ||
112 | #define RTL818X_TX_AGC_CTL_PERPACKET_ANTSEL_SHIFT (1 << 1) | ||
113 | #define RTL818X_TX_AGC_CTL_FEEDBACK_ANT (1 << 2) | ||
114 | u8 TX_GAIN_CCK; | ||
115 | u8 TX_GAIN_OFDM; | ||
116 | u8 TX_ANTENNA; | ||
117 | u8 reserved_13[16]; | ||
118 | u8 WPA_CONF; | ||
119 | u8 reserved_14[3]; | ||
120 | u8 SIFS; | ||
121 | u8 DIFS; | ||
122 | u8 SLOT; | ||
123 | u8 reserved_15[5]; | ||
124 | u8 CW_CONF; | ||
125 | #define RTL818X_CW_CONF_PERPACKET_CW_SHIFT (1 << 0) | ||
126 | #define RTL818X_CW_CONF_PERPACKET_RETRY_SHIFT (1 << 1) | ||
127 | u8 CW_VAL; | ||
128 | u8 RATE_FALLBACK; | ||
129 | u8 reserved_16[25]; | ||
130 | u8 CONFIG5; | ||
131 | u8 TX_DMA_POLLING; | ||
132 | u8 reserved_17[2]; | ||
133 | __le16 CWR; | ||
134 | u8 RETRY_CTR; | ||
135 | u8 reserved_18[5]; | ||
136 | __le32 RDSAR; | ||
137 | u8 reserved_19[18]; | ||
138 | u16 TALLY_CNT; | ||
139 | u8 TALLY_SEL; | ||
140 | } __attribute__((packed)); | ||
141 | |||
142 | static const struct ieee80211_rate rtl818x_rates[] = { | ||
143 | { .rate = 10, | ||
144 | .val = 0, | ||
145 | .flags = IEEE80211_RATE_CCK }, | ||
146 | { .rate = 20, | ||
147 | .val = 1, | ||
148 | .flags = IEEE80211_RATE_CCK }, | ||
149 | { .rate = 55, | ||
150 | .val = 2, | ||
151 | .flags = IEEE80211_RATE_CCK }, | ||
152 | { .rate = 110, | ||
153 | .val = 3, | ||
154 | .flags = IEEE80211_RATE_CCK }, | ||
155 | { .rate = 60, | ||
156 | .val = 4, | ||
157 | .flags = IEEE80211_RATE_OFDM }, | ||
158 | { .rate = 90, | ||
159 | .val = 5, | ||
160 | .flags = IEEE80211_RATE_OFDM }, | ||
161 | { .rate = 120, | ||
162 | .val = 6, | ||
163 | .flags = IEEE80211_RATE_OFDM }, | ||
164 | { .rate = 180, | ||
165 | .val = 7, | ||
166 | .flags = IEEE80211_RATE_OFDM }, | ||
167 | { .rate = 240, | ||
168 | .val = 8, | ||
169 | .flags = IEEE80211_RATE_OFDM }, | ||
170 | { .rate = 360, | ||
171 | .val = 9, | ||
172 | .flags = IEEE80211_RATE_OFDM }, | ||
173 | { .rate = 480, | ||
174 | .val = 10, | ||
175 | .flags = IEEE80211_RATE_OFDM }, | ||
176 | { .rate = 540, | ||
177 | .val = 11, | ||
178 | .flags = IEEE80211_RATE_OFDM }, | ||
179 | }; | ||
180 | |||
181 | static const struct ieee80211_channel rtl818x_channels[] = { | ||
182 | { .chan = 1, | ||
183 | .freq = 2412}, | ||
184 | { .chan = 2, | ||
185 | .freq = 2417}, | ||
186 | { .chan = 3, | ||
187 | .freq = 2422}, | ||
188 | { .chan = 4, | ||
189 | .freq = 2427}, | ||
190 | { .chan = 5, | ||
191 | .freq = 2432}, | ||
192 | { .chan = 6, | ||
193 | .freq = 2437}, | ||
194 | { .chan = 7, | ||
195 | .freq = 2442}, | ||
196 | { .chan = 8, | ||
197 | .freq = 2447}, | ||
198 | { .chan = 9, | ||
199 | .freq = 2452}, | ||
200 | { .chan = 10, | ||
201 | .freq = 2457}, | ||
202 | { .chan = 11, | ||
203 | .freq = 2462}, | ||
204 | { .chan = 12, | ||
205 | .freq = 2467}, | ||
206 | { .chan = 13, | ||
207 | .freq = 2472}, | ||
208 | { .chan = 14, | ||
209 | .freq = 2484} | ||
210 | }; | ||
211 | |||
212 | #endif /* RTL818X_H */ | ||