Add an irqlock spinlock to struct acx_device
[acx-mac80211.git] / acx_struct.h
blob6fbd03d0881d026e61c48125db8081b65ea3fa86
1 #ifndef _ACX_STRUCT_H_
2 #define _ACX_STRUCT_H_
4 /**** (legal) claimer in README
5 ** Copyright (C) 2003 ACX100 Open Source Project
6 */
8 #include "acx_debug.h"
10 /***********************************************************************
11 ** Forward declarations of types
13 typedef struct tx tx_t;
14 typedef struct acx_device acx_device_t;
15 typedef struct client client_t;
16 typedef struct rxdesc rxdesc_t;
17 typedef struct txdesc txdesc_t;
18 typedef struct rxhostdesc rxhostdesc_t;
19 typedef struct txhostdesc txhostdesc_t;
22 /***********************************************************************
23 ** Random helpers
25 #define ACX_PACKED __attribute__ ((packed))
27 /***********************************************************************
28 ** Constants
30 #define OK 0
31 #define NOT_OK 1
33 /* The supported chip models */
34 #define CHIPTYPE_ACX100 1
35 #define CHIPTYPE_ACX111 2
37 #define IS_ACX100(adev) ((adev)->chip_type == CHIPTYPE_ACX100)
38 #define IS_ACX111(adev) ((adev)->chip_type == CHIPTYPE_ACX111)
40 /* Supported interfaces */
41 #define DEVTYPE_PCI 0
42 #define DEVTYPE_USB 1
44 #if !(defined(CONFIG_ACX_MAC80211_PCI) || defined(CONFIG_ACX_MAC80211_USB))
45 #error Driver must include PCI and/or USB support. You selected neither.
46 #endif
48 #if defined(CONFIG_ACX_MAC80211_PCI)
49 #if !defined(CONFIG_ACX_MAC80211_USB)
50 #define IS_PCI(adev) 1
51 #else
52 #define IS_PCI(adev) ((adev)->dev_type == DEVTYPE_PCI)
53 #endif
54 #else
55 #define IS_PCI(adev) 0
56 #endif
58 #if defined(CONFIG_ACX_MAC80211_USB)
59 #if !defined(CONFIG_ACX_MAC80211_PCI)
60 #define IS_USB(adev) 1
61 #else
62 #define IS_USB(adev) ((adev)->dev_type == DEVTYPE_USB)
63 #endif
64 #else
65 #define IS_USB(adev) 0
66 #endif
68 /* Driver defaults */
69 #define DEFAULT_DTIM_INTERVAL 10
70 /* used to be 2048, but FreeBSD driver changed it to 4096 to work properly
71 ** in noisy wlans */
72 #define DEFAULT_MSDU_LIFETIME 4096
73 #define DEFAULT_RTS_THRESHOLD 2312 /* max. size: disable RTS mechanism */
74 #define DEFAULT_BEACON_INTERVAL 100
76 #define ACX100_BAP_DATALEN_MAX 4096
77 #define ACX100_RID_GUESSING_MAXLEN 2048 /* I'm not really sure */
78 #define ACX100_RIDDATA_MAXLEN ACX100_RID_GUESSING_MAXLEN
80 /* Support Constants */
81 /* Radio type names, found in Win98 driver's TIACXLN.INF */
82 #define RADIO_MAXIM_0D 0x0d
83 #define RADIO_RFMD_11 0x11
84 #define RADIO_RALINK_15 0x15
85 /* used in ACX111 cards (WG311v2, WL-121, ...): */
86 #define RADIO_RADIA_16 0x16
87 /* most likely *sometimes* used in ACX111 cards: */
88 #define RADIO_UNKNOWN_17 0x17
89 /* FwRad19.bin was found in a Safecom driver; must be an ACX111 radio: */
90 #define RADIO_UNKNOWN_19 0x19
91 #define RADIO_UNKNOWN_1B 0x1b /* radio in SafeCom SWLUT-54125 USB adapter; entirely unknown!! */
93 /* Controller Commands */
94 /* can be found in table cmdTable in firmware "Rev. 1.5.0" (FW150) */
95 #define ACX1xx_CMD_RESET 0x00
96 #define ACX1xx_CMD_INTERROGATE 0x01
97 #define ACX1xx_CMD_CONFIGURE 0x02
98 #define ACX1xx_CMD_ENABLE_RX 0x03
99 #define ACX1xx_CMD_ENABLE_TX 0x04
100 #define ACX1xx_CMD_DISABLE_RX 0x05
101 #define ACX1xx_CMD_DISABLE_TX 0x06
102 #define ACX1xx_CMD_FLUSH_QUEUE 0x07
103 #define ACX1xx_CMD_SCAN 0x08
104 #define ACX1xx_CMD_STOP_SCAN 0x09
105 #define ACX1xx_CMD_CONFIG_TIM 0x0a
106 #define ACX1xx_CMD_JOIN 0x0b
107 #define ACX1xx_CMD_WEP_MGMT 0x0c
108 #ifdef OLD_FIRMWARE_VERSIONS
109 #define ACX100_CMD_HALT 0x0e /* mapped to unknownCMD in FW150 */
110 #else
111 #define ACX1xx_CMD_MEM_READ 0x0d
112 #define ACX1xx_CMD_MEM_WRITE 0x0e
113 #endif
114 #define ACX1xx_CMD_SLEEP 0x0f
115 #define ACX1xx_CMD_WAKE 0x10
116 #define ACX1xx_CMD_UNKNOWN_11 0x11 /* mapped to unknownCMD in FW150 */
117 #define ACX100_CMD_INIT_MEMORY 0x12
118 #define ACX1FF_CMD_DISABLE_RADIO 0x12 /* new firmware? TNETW1450? */
119 #define ACX1xx_CMD_CONFIG_BEACON 0x13
120 #define ACX1xx_CMD_CONFIG_PROBE_RESPONSE 0x14
121 #define ACX1xx_CMD_CONFIG_NULL_DATA 0x15
122 #define ACX1xx_CMD_CONFIG_PROBE_REQUEST 0x16
123 #define ACX1xx_CMD_FCC_TEST 0x17
124 #define ACX1xx_CMD_RADIOINIT 0x18
125 #define ACX111_CMD_RADIOCALIB 0x19
126 #define ACX1FF_CMD_NOISE_HISTOGRAM 0x1c /* new firmware? TNETW1450? */
127 #define ACX1FF_CMD_RX_RESET 0x1d /* new firmware? TNETW1450? */
128 #define ACX1FF_CMD_LNA_CONTROL 0x20 /* new firmware? TNETW1450? */
129 #define ACX1FF_CMD_CONTROL_DBG_TRACE 0x21 /* new firmware? TNETW1450? */
131 /***********************************************************************
132 ** Tx/Rx buffer sizes and watermarks
134 ** This will alloc and use DMAable buffers of
135 ** WLAN_A4FR_MAXLEN_WEP_FCS * (RX_CNT + TX_CNT) bytes
136 ** RX/TX_CNT=32 -> ~150k DMA buffers
137 ** RX/TX_CNT=16 -> ~75k DMA buffers
139 ** 2005-10-10: reduced memory usage by lowering both to 16
141 #define RX_CNT 16
142 #define TX_CNT 16
144 /* we clean up txdescs when we have N free txdesc: */
145 #define TX_CLEAN_BACKLOG (TX_CNT/4)
146 #define TX_START_CLEAN (TX_CNT - TX_CLEAN_BACKLOG)
147 #define TX_EMERG_CLEAN 2
148 /* we stop queue if we have < N free txbufs: */
149 #define TX_STOP_QUEUE 3
150 /* we start queue if we have >= N free txbufs: */
151 #define TX_START_QUEUE 5
153 /***********************************************************************
154 ** Interrogate/Configure cmd constants
156 ** NB: length includes JUST the data part of the IE
157 ** (does not include size of the (type,len) pair)
159 ** TODO: seems that acx100, acx100usb, acx111 have some differences,
160 ** fix code with regard to this!
163 #define DEF_IE(name, val, len) enum { ACX##name=val, ACX##name##_LEN=len }
165 /* Information Elements: Network Parameters, Static Configuration Entities */
166 /* these are handled by real_cfgtable in firmware "Rev 1.5.0" (FW150) */
167 DEF_IE(1xx_IE_UNKNOWN_00 ,0x0000, -1); /* mapped to cfgInvalid in FW150 */
168 DEF_IE(100_IE_ACX_TIMER ,0x0001, 0x10);
169 DEF_IE(1xx_IE_POWER_MGMT ,0x0002, 0x06); /* TNETW1450: length 0x18!! */
170 DEF_IE(1xx_IE_QUEUE_CONFIG ,0x0003, 0x1c);
171 DEF_IE(100_IE_BLOCK_SIZE ,0x0004, 0x02);
172 DEF_IE(1FF_IE_SLOT_TIME ,0x0004, 0x08); /* later firmware versions only? */
173 DEF_IE(1xx_IE_MEMORY_CONFIG_OPTIONS ,0x0005, 0x14);
174 DEF_IE(1FF_IE_QUEUE_HEAD ,0x0005, 0x14 /* FIXME: length? */);
175 DEF_IE(1xx_IE_RATE_FALLBACK ,0x0006, 0x01); /* TNETW1450: length 2 */
176 DEF_IE(100_IE_WEP_OPTIONS ,0x0007, 0x03);
177 DEF_IE(111_IE_RADIO_BAND ,0x0007, -1);
178 DEF_IE(1FF_IE_TIMING_CFG ,0x0007, -1); /* later firmware versions; TNETW1450 only? */
179 DEF_IE(100_IE_SSID ,0x0008, 0x20); /* huh? */
180 DEF_IE(1xx_IE_MEMORY_MAP ,0x0008, 0x28); /* huh? TNETW1450 has length 0x40!! */
181 DEF_IE(1xx_IE_SCAN_STATUS ,0x0009, 0x04); /* mapped to cfgInvalid in FW150 */
182 DEF_IE(1xx_IE_ASSOC_ID ,0x000a, 0x02);
183 DEF_IE(1xx_IE_UNKNOWN_0B ,0x000b, -1); /* mapped to cfgInvalid in FW150 */
184 DEF_IE(1FF_IE_TX_POWER_LEVEL_TABLE ,0x000b, 0x18); /* later firmware versions; TNETW1450 only? */
185 DEF_IE(100_IE_UNKNOWN_0C ,0x000c, -1); /* very small implementation in FW150! */
186 /* ACX100 has an equivalent struct in the cmd mailbox directly after reset.
187 * 0x14c seems extremely large, will trash stack on failure (memset!)
188 * in case of small input struct --> OOPS! */
189 DEF_IE(111_IE_CONFIG_OPTIONS ,0x000c, 0x14c);
190 DEF_IE(1xx_IE_FWREV ,0x000d, 0x18);
191 DEF_IE(1xx_IE_FCS_ERROR_COUNT ,0x000e, 0x04);
192 DEF_IE(1xx_IE_MEDIUM_USAGE ,0x000f, 0x08);
193 DEF_IE(1xx_IE_RXCONFIG ,0x0010, 0x04);
194 DEF_IE(100_IE_UNKNOWN_11 ,0x0011, -1); /* NONBINARY: large implementation in FW150! link quality readings or so? */
195 DEF_IE(111_IE_QUEUE_THRESH ,0x0011, -1);
196 DEF_IE(100_IE_UNKNOWN_12 ,0x0012, -1); /* NONBINARY: VERY large implementation in FW150!! */
197 DEF_IE(111_IE_BSS_POWER_SAVE ,0x0012, /* -1 */ 2);
198 DEF_IE(1xx_IE_FIRMWARE_STATISTICS ,0x0013, 0x9c); /* TNETW1450: length 0x134!! */
199 DEF_IE(1FF_IE_RX_INTR_CONFIG ,0x0014, 0x14); /* later firmware versions, TNETW1450 only? */
200 DEF_IE(1xx_IE_FEATURE_CONFIG ,0x0015, 0x08);
201 DEF_IE(111_IE_KEY_CHOOSE ,0x0016, 0x04); /* for rekeying. really len=4?? */
202 DEF_IE(1FF_IE_MISC_CONFIG_TABLE ,0x0017, 0x04); /* later firmware versions, TNETW1450 only? */
203 DEF_IE(1FF_IE_WONE_CONFIG ,0x0018, -1); /* later firmware versions, TNETW1450 only? */
204 DEF_IE(1FF_IE_TID_CONFIG ,0x001a, 0x2c); /* later firmware versions, TNETW1450 only? */
205 DEF_IE(1FF_IE_CALIB_ASSESSMENT ,0x001e, 0x04); /* later firmware versions, TNETW1450 only? */
206 DEF_IE(1FF_IE_BEACON_FILTER_OPTIONS ,0x001f, 0x02); /* later firmware versions, TNETW1450 only? */
207 DEF_IE(1FF_IE_LOW_RSSI_THRESH_OPT ,0x0020, 0x04); /* later firmware versions, TNETW1450 only? */
208 DEF_IE(1FF_IE_NOISE_HISTOGRAM_RESULTS ,0x0021, 0x30); /* later firmware versions, TNETW1450 only? */
209 DEF_IE(1FF_IE_PACKET_DETECT_THRESH ,0x0023, 0x04); /* later firmware versions, TNETW1450 only? */
210 DEF_IE(1FF_IE_TX_CONFIG_OPTIONS ,0x0024, 0x04); /* later firmware versions, TNETW1450 only? */
211 DEF_IE(1FF_IE_CCA_THRESHOLD ,0x0025, 0x02); /* later firmware versions, TNETW1450 only? */
212 DEF_IE(1FF_IE_EVENT_MASK ,0x0026, 0x08); /* later firmware versions, TNETW1450 only? */
213 DEF_IE(1FF_IE_DTIM_PERIOD ,0x0027, 0x02); /* later firmware versions, TNETW1450 only? */
214 DEF_IE(1FF_IE_ACI_CONFIG_SET ,0x0029, 0x06); /* later firmware versions; maybe TNETW1450 only? */
215 DEF_IE(1FF_IE_EEPROM_VER ,0x0030, 0x04); /* later firmware versions; maybe TNETW1450 only? */
216 DEF_IE(1xx_IE_DOT11_STATION_ID ,0x1001, 0x06);
217 DEF_IE(100_IE_DOT11_UNKNOWN_1002 ,0x1002, -1); /* mapped to cfgInvalid in FW150 */
218 DEF_IE(111_IE_DOT11_FRAG_THRESH ,0x1002, -1); /* mapped to cfgInvalid in FW150; TNETW1450 has length 2!! */
219 DEF_IE(100_IE_DOT11_BEACON_PERIOD ,0x1003, 0x02); /* mapped to cfgInvalid in FW150 */
220 DEF_IE(1xx_IE_DOT11_DTIM_PERIOD ,0x1004, -1); /* mapped to cfgInvalid in FW150 */
221 DEF_IE(1FF_IE_DOT11_MAX_RX_LIFETIME ,0x1004, -1); /* later firmware versions; maybe TNETW1450 only? */
222 DEF_IE(1xx_IE_DOT11_SHORT_RETRY_LIMIT ,0x1005, 0x01); /* TNETW1450: length 2 */
223 DEF_IE(1xx_IE_DOT11_LONG_RETRY_LIMIT ,0x1006, 0x01); /* TNETW1450: length 2 */
224 DEF_IE(100_IE_DOT11_WEP_DEFAULT_KEY_WRITE ,0x1007, 0x20); /* configure default keys; TNETW1450 has length 0x24!! */
225 DEF_IE(1xx_IE_DOT11_MAX_XMIT_MSDU_LIFETIME ,0x1008, 0x04);
226 DEF_IE(1xx_IE_DOT11_GROUP_ADDR ,0x1009, -1);
227 DEF_IE(1xx_IE_DOT11_CURRENT_REG_DOMAIN ,0x100a, 0x02);
228 /* It's harmless to have larger struct. Use USB case always. */
229 DEF_IE(1xx_IE_DOT11_CURRENT_ANTENNA ,0x100b, 0x02); /* in fact len=1 for PCI */
230 DEF_IE(1xx_IE_DOT11_UNKNOWN_100C ,0x100c, -1); /* mapped to cfgInvalid in FW150 */
231 DEF_IE(1xx_IE_DOT11_TX_POWER_LEVEL ,0x100d, 0x01); /* TNETW1450 has length 2!! */
232 DEF_IE(1xx_IE_DOT11_CURRENT_CCA_MODE ,0x100e, 0x02); /* in fact len=1 for PCI */
233 /* USB doesn't return anything - len==0?! */
234 DEF_IE(100_IE_DOT11_ED_THRESHOLD ,0x100f, 0x04);
235 DEF_IE(1xx_IE_DOT11_WEP_DEFAULT_KEY_SET ,0x1010, 0x01); /* set default key ID; TNETW1450: length 2 */
236 DEF_IE(100_IE_DOT11_UNKNOWN_1011 ,0x1011, -1); /* mapped to cfgInvalid in FW150 */
237 DEF_IE(1FF_IE_DOT11_CURR_5GHZ_REGDOM ,0x1011, -1); /* later firmware versions; maybe TNETW1450 only? */
238 DEF_IE(100_IE_DOT11_UNKNOWN_1012 ,0x1012, -1); /* mapped to cfgInvalid in FW150 */
239 DEF_IE(100_IE_DOT11_UNKNOWN_1013 ,0x1013, -1); /* mapped to cfgInvalid in FW150 */
241 #if 0
242 /* Experimentally obtained on acx100, fw 1.9.8.b
243 ** -1 means that fw returned 'invalid IE'
244 ** 0200 FC00 nnnn... are test read contents: u16 type, u16 len, data
245 ** (AA are poison bytes marking bytes not written by fw)
247 ** Looks like acx100 fw does not update len field (thus len=256-4=FC here)
248 ** A number of IEs seem to trash type,len fields
249 ** IEs marked 'huge' return gobs of data (no poison bytes remain)
251 DEF_IE(100_IE_INVAL_00, 0x0000, -1);
252 DEF_IE(100_IE_INVAL_01, 0x0001, -1); /* IE_ACX_TIMER, len=16 on older fw */
253 DEF_IE(100_IE_POWER_MGMT, 0x0002, 4); /* 0200FC00 00040000 AAAAAAAA */
254 DEF_IE(100_IE_QUEUE_CONFIG, 0x0003, 28); /* 0300FC00 48060000 9CAD0000 0101AAAA DCB00000 E4B00000 9CAA0000 00AAAAAA */
255 DEF_IE(100_IE_BLOCK_SIZE, 0x0004, 2); /* 0400FC00 0001AAAA AAAAAAAA AAAAAAAA */
256 /* write only: */
257 DEF_IE(100_IE_MEMORY_CONFIG_OPTIONS, 0x0005, 20);
258 DEF_IE(100_IE_RATE_FALLBACK, 0x0006, 1); /* 0600FC00 00AAAAAA AAAAAAAA AAAAAAAA */
259 /* write only: */
260 DEF_IE(100_IE_WEP_OPTIONS, 0x0007, 3);
261 DEF_IE(100_IE_MEMORY_MAP, 0x0008, 40); /* huge: 0800FC00 30000000 6CA20000 70A20000... */
262 /* gives INVAL on read: */
263 DEF_IE(100_IE_SCAN_STATUS, 0x0009, -1);
264 DEF_IE(100_IE_ASSOC_ID, 0x000a, 2); /* huge: 0A00FC00 00000000 01040800 00000000... */
265 DEF_IE(100_IE_INVAL_0B, 0x000b, -1);
266 /* 'command rejected': */
267 DEF_IE(100_IE_CONFIG_OPTIONS, 0x000c, -3);
268 DEF_IE(100_IE_FWREV, 0x000d, 24); /* 0D00FC00 52657620 312E392E 382E6200 AAAAAAAA AAAAAAAA 05050201 AAAAAAAA */
269 DEF_IE(100_IE_FCS_ERROR_COUNT, 0x000e, 4);
270 DEF_IE(100_IE_MEDIUM_USAGE, 0x000f, 8); /* E41F0000 2D780300 FCC91300 AAAAAAAA */
271 DEF_IE(100_IE_RXCONFIG, 0x0010, 4); /* 1000FC00 00280000 AAAAAAAA AAAAAAAA */
272 DEF_IE(100_IE_QUEUE_THRESH, 0x0011, 12); /* 1100FC00 AAAAAAAA 00000000 00000000 */
273 DEF_IE(100_IE_BSS_POWER_SAVE, 0x0012, 1); /* 1200FC00 00AAAAAA AAAAAAAA AAAAAAAA */
274 /* read only, variable len */
275 DEF_IE(100_IE_FIRMWARE_STATISTICS, 0x0013, 256); /* 0000AC00 00000000 ... */
276 DEF_IE(100_IE_INT_CONFIG, 0x0014, 20); /* 00000000 00000000 00000000 00000000 5D74D105 00000000 AAAAAAAA AAAAAAAA */
277 DEF_IE(100_IE_FEATURE_CONFIG, 0x0015, 8); /* 1500FC00 16000000 AAAAAAAA AAAAAAAA */
278 /* returns 'invalid MAC': */
279 DEF_IE(100_IE_KEY_CHOOSE, 0x0016, -4);
280 DEF_IE(100_IE_INVAL_17, 0x0017, -1);
281 DEF_IE(100_IE_UNKNOWN_18, 0x0018, 0); /* null len?! 1800FC00 AAAAAAAA AAAAAAAA AAAAAAAA */
282 DEF_IE(100_IE_UNKNOWN_19, 0x0019, 256); /* huge: 1900FC00 9C1F00EA FEFFFFEA FEFFFFEA... */
283 DEF_IE(100_IE_INVAL_1A, 0x001A, -1);
285 DEF_IE(100_IE_DOT11_INVAL_1000, 0x1000, -1);
286 DEF_IE(100_IE_DOT11_STATION_ID, 0x1001, 6); /* huge: 0110FC00 58B10E2F 03000000 00000000... */
287 DEF_IE(100_IE_DOT11_INVAL_1002, 0x1002, -1);
288 DEF_IE(100_IE_DOT11_INVAL_1003, 0x1003, -1);
289 DEF_IE(100_IE_DOT11_INVAL_1004, 0x1004, -1);
290 DEF_IE(100_IE_DOT11_SHORT_RETRY_LIMIT, 0x1005, 1);
291 DEF_IE(100_IE_DOT11_LONG_RETRY_LIMIT, 0x1006, 1);
292 /* write only: */
293 DEF_IE(100_IE_DOT11_WEP_DEFAULT_KEY_WRITE, 0x1007, 32);
294 DEF_IE(100_IE_DOT11_MAX_XMIT_MSDU_LIFETIME, 0x1008, 4); /* huge: 0810FC00 00020000 F4010000 00000000... */
295 /* undoc but returns something */
296 DEF_IE(100_IE_DOT11_GROUP_ADDR, 0x1009, 12); /* huge: 0910FC00 00000000 00000000 00000000... */
297 DEF_IE(100_IE_DOT11_CURRENT_REG_DOMAIN, 0x100a, 1); /* 0A10FC00 30AAAAAA AAAAAAAA AAAAAAAA */
298 DEF_IE(100_IE_DOT11_CURRENT_ANTENNA, 0x100b, 1); /* 0B10FC00 8FAAAAAA AAAAAAAA AAAAAAAA */
299 DEF_IE(100_IE_DOT11_INVAL_100C, 0x100c, -1);
300 DEF_IE(100_IE_DOT11_TX_POWER_LEVEL, 0x100d, 2); /* 00000000 0100AAAA AAAAAAAA AAAAAAAA */
301 DEF_IE(100_IE_DOT11_CURRENT_CCA_MODE, 0x100e, 1); /* 0E10FC00 0DAAAAAA AAAAAAAA AAAAAAAA */
302 DEF_IE(100_IE_DOT11_ED_THRESHOLD, 0x100f, 4); /* 0F10FC00 70000000 AAAAAAAA AAAAAAAA */
303 /* set default key ID */
304 DEF_IE(100_IE_DOT11_WEP_DEFAULT_KEY_SET, 0x1010, 1); /* 1010FC00 00AAAAAA AAAAAAAA AAAAAAAA */
305 DEF_IE(100_IE_DOT11_INVAL_1011, 0x1011, -1);
306 DEF_IE(100_IE_DOT11_INVAL_1012, 0x1012, -1);
307 DEF_IE(100_IE_DOT11_INVAL_1013, 0x1013, -1);
308 DEF_IE(100_IE_DOT11_UNKNOWN_1014, 0x1014, 256); /* huge */
309 DEF_IE(100_IE_DOT11_UNKNOWN_1015, 0x1015, 256); /* huge */
310 DEF_IE(100_IE_DOT11_UNKNOWN_1016, 0x1016, 256); /* huge */
311 DEF_IE(100_IE_DOT11_UNKNOWN_1017, 0x1017, 256); /* huge */
312 DEF_IE(100_IE_DOT11_UNKNOWN_1018, 0x1018, 256); /* huge */
313 DEF_IE(100_IE_DOT11_UNKNOWN_1019, 0x1019, 256); /* huge */
314 #endif
316 #if 0
317 /* Experimentally obtained on PCI acx111 Xterasys XN-2522g, fw 1.2.1.34
318 ** -1 means that fw returned 'invalid IE'
319 ** 0400 0800 nnnn... are test read contents: u16 type, u16 len, data
320 ** (AA are poison bytes marking bytes not written by fw)
322 ** Looks like acx111 fw reports real len!
324 DEF_IE(111_IE_INVAL_00, 0x0000, -1);
325 DEF_IE(111_IE_INVAL_01, 0x0001, -1);
326 DEF_IE(111_IE_POWER_MGMT, 0x0002, 12);
327 /* write only, variable len: 12 + rxqueue_cnt*8 + txqueue_cnt*4: */
328 DEF_IE(111_IE_MEMORY_CONFIG, 0x0003, 24);
329 DEF_IE(111_IE_BLOCK_SIZE, 0x0004, 8); /* 04000800 AA00AAAA AAAAAAAA */
330 /* variable len: 8 + rxqueue_cnt*8 + txqueue_cnt*8: */
331 DEF_IE(111_IE_QUEUE_HEAD, 0x0005, 24);
332 DEF_IE(111_IE_RATE_FALLBACK, 0x0006, 1);
333 /* acx100 name:WEP_OPTIONS */
334 /* said to have len:1 (not true, actually returns 12 bytes): */
335 DEF_IE(111_IE_RADIO_BAND, 0x0007, 12); /* 07000C00 AAAA1F00 FF03AAAA AAAAAAAA */
336 DEF_IE(111_IE_MEMORY_MAP, 0x0008, 48);
337 /* said to have len:4, but gives INVAL on read: */
338 DEF_IE(111_IE_SCAN_STATUS, 0x0009, -1);
339 DEF_IE(111_IE_ASSOC_ID, 0x000a, 2);
340 /* write only, len is not known: */
341 DEF_IE(111_IE_UNKNOWN_0B, 0x000b, 0);
342 /* read only, variable len. I see 67 byte reads: */
343 DEF_IE(111_IE_CONFIG_OPTIONS, 0x000c, 67); /* 0C004300 01160500 ... */
344 DEF_IE(111_IE_FWREV, 0x000d, 24);
345 DEF_IE(111_IE_FCS_ERROR_COUNT, 0x000e, 4);
346 DEF_IE(111_IE_MEDIUM_USAGE, 0x000f, 8);
347 DEF_IE(111_IE_RXCONFIG, 0x0010, 4);
348 DEF_IE(111_IE_QUEUE_THRESH, 0x0011, 12);
349 DEF_IE(111_IE_BSS_POWER_SAVE, 0x0012, 1);
350 /* read only, variable len. I see 240 byte reads: */
351 DEF_IE(111_IE_FIRMWARE_STATISTICS, 0x0013, 240); /* 1300F000 00000000 ... */
352 /* said to have len=17. looks like fw pads it to 20: */
353 DEF_IE(111_IE_INT_CONFIG, 0x0014, 20); /* 14001400 00000000 00000000 00000000 00000000 00000000 */
354 DEF_IE(111_IE_FEATURE_CONFIG, 0x0015, 8);
355 /* said to be name:KEY_INDICATOR, len:4, but gives INVAL on read: */
356 DEF_IE(111_IE_KEY_CHOOSE, 0x0016, -1);
357 /* said to have len:4, but in fact returns 8: */
358 DEF_IE(111_IE_MAX_USB_XFR, 0x0017, 8); /* 17000800 00014000 00000000 */
359 DEF_IE(111_IE_INVAL_18, 0x0018, -1);
360 DEF_IE(111_IE_INVAL_19, 0x0019, -1);
361 /* undoc but returns something: */
362 /* huh, fw indicates len=20 but uses 4 more bytes in buffer??? */
363 DEF_IE(111_IE_UNKNOWN_1A, 0x001A, 20); /* 1A001400 AA00AAAA 0000020F FF030000 00020000 00000007 04000000 */
365 DEF_IE(111_IE_DOT11_INVAL_1000, 0x1000, -1);
366 DEF_IE(111_IE_DOT11_STATION_ID, 0x1001, 6);
367 DEF_IE(111_IE_DOT11_FRAG_THRESH, 0x1002, 2);
368 /* acx100 only? gives INVAL on read: */
369 DEF_IE(111_IE_DOT11_BEACON_PERIOD, 0x1003, -1);
370 /* said to be MAX_RECV_MSDU_LIFETIME: */
371 DEF_IE(111_IE_DOT11_DTIM_PERIOD, 0x1004, 4);
372 DEF_IE(111_IE_DOT11_SHORT_RETRY_LIMIT, 0x1005, 1);
373 DEF_IE(111_IE_DOT11_LONG_RETRY_LIMIT, 0x1006, 1);
374 /* acx100 only? gives INVAL on read: */
375 DEF_IE(111_IE_DOT11_WEP_DEFAULT_KEY_WRITE, 0x1007, -1);
376 DEF_IE(111_IE_DOT11_MAX_XMIT_MSDU_LIFETIME, 0x1008, 4);
377 /* undoc but returns something. maybe it's 2 multicast MACs to listen to? */
378 DEF_IE(111_IE_DOT11_GROUP_ADDR, 0x1009, 12); /* 09100C00 00000000 00000000 00000000 */
379 DEF_IE(111_IE_DOT11_CURRENT_REG_DOMAIN, 0x100a, 1);
380 DEF_IE(111_IE_DOT11_CURRENT_ANTENNA, 0x100b, 2);
381 DEF_IE(111_IE_DOT11_INVAL_100C, 0x100c, -1);
382 DEF_IE(111_IE_DOT11_TX_POWER_LEVEL, 0x100d, 1);
383 /* said to have len=1 but gives INVAL on read: */
384 DEF_IE(111_IE_DOT11_CURRENT_CCA_MODE, 0x100e, -1);
385 /* said to have len=4 but gives INVAL on read: */
386 DEF_IE(111_IE_DOT11_ED_THRESHOLD, 0x100f, -1);
387 /* set default key ID. write only: */
388 DEF_IE(111_IE_DOT11_WEP_DEFAULT_KEY_SET, 0x1010, 1);
389 /* undoc but returns something: */
390 DEF_IE(111_IE_DOT11_UNKNOWN_1011, 0x1011, 1); /* 11100100 20 */
391 DEF_IE(111_IE_DOT11_INVAL_1012, 0x1012, -1);
392 DEF_IE(111_IE_DOT11_INVAL_1013, 0x1013, -1);
393 #endif
396 /***********************************************************************
397 **Information Frames Structures
400 /* Used in beacon frames and the like */
401 #define DOT11RATEBYTE_1 (1*2)
402 #define DOT11RATEBYTE_2 (2*2)
403 #define DOT11RATEBYTE_5_5 (5*2+1)
404 #define DOT11RATEBYTE_11 (11*2)
405 #define DOT11RATEBYTE_22 (22*2)
406 #define DOT11RATEBYTE_6_G (6*2)
407 #define DOT11RATEBYTE_9_G (9*2)
408 #define DOT11RATEBYTE_12_G (12*2)
409 #define DOT11RATEBYTE_18_G (18*2)
410 #define DOT11RATEBYTE_24_G (24*2)
411 #define DOT11RATEBYTE_36_G (36*2)
412 #define DOT11RATEBYTE_48_G (48*2)
413 #define DOT11RATEBYTE_54_G (54*2)
414 #define DOT11RATEBYTE_BASIC 0x80 /* flags rates included in basic rate set */
417 /***********************************************************************
418 ** rxbuffer_t
420 ** This is the format of rx data returned by acx
423 /* I've hoped it's a 802.11 PHY header, but no...
424 * so far, I've seen on acx111:
425 * 0000 3a00 0000 0000 IBSS Beacons
426 * 0000 3c00 0000 0000 ESS Beacons
427 * 0000 2700 0000 0000 Probe requests
428 * --vda
430 typedef struct phy_hdr {
431 u8 unknown[4];
432 u8 acx111_unknown[4];
433 } ACX_PACKED phy_hdr_t;
435 /* seems to be a bit similar to hfa384x_rx_frame.
436 * These fields are still not quite obvious, though.
437 * Some seem to have different meanings... */
439 #define RXBUF_HDRSIZE 12
440 #define RXBUF_BYTES_RCVD(adev, rxbuf) \
441 ((le16_to_cpu((rxbuf)->mac_cnt_rcvd) & 0xfff) - (adev)->phy_header_len)
442 #define RXBUF_BYTES_USED(rxbuf) \
443 ((le16_to_cpu((rxbuf)->mac_cnt_rcvd) & 0xfff) + RXBUF_HDRSIZE)
444 /* USBism */
445 #define RXBUF_IS_TXSTAT(rxbuf) (le16_to_cpu((rxbuf)->mac_cnt_rcvd) & 0x8000)
447 mac_cnt_rcvd:
448 12 bits: length of frame from control field to first byte of FCS
449 3 bits: reserved
450 1 bit: 1 = it's a tx status info, not a rx packet (USB only)
452 mac_cnt_mblks:
453 6 bits: number of memory block used to store frame in adapter memory
454 1 bit: Traffic Indicator bit in TIM of received Beacon was set
456 mac_status: 1 byte (bitmap):
457 7 Matching BSSID
458 6 Matching SSID
459 5 BDCST Address 1 field is a broadcast
460 4 VBM received beacon frame has more than one set bit (?!)
461 3 TIM Set bit representing this station is set in TIM of received beacon
462 2 GROUP Address 1 is a multicast
463 1 ADDR1 Address 1 matches our MAC
464 0 FCSGD FSC is good
466 phy_stat_baseband: 1 byte (bitmap):
467 7 Preamble frame had a long preamble
468 6 PLCP Error CRC16 error in PLCP header
469 5 Unsup_Mod unsupported modulation
470 4 Selected Antenna antenna 1 was used to receive this frame
471 3 PBCC/CCK frame used: 1=PBCC, 0=CCK modulation
472 2 OFDM frame used OFDM modulation
473 1 TI Protection protection frame was detected
474 0 Reserved
476 phy_plcp_signal: 1 byte:
477 Receive PLCP Signal field from the Baseband Processor
479 phy_level: 1 byte:
480 receive AGC gain level (can be used to measure receive signal strength)
482 phy_snr: 1 byte:
483 estimated noise power of equalized receive signal
484 at input of FEC decoder (can be used to measure receive signal quality)
486 time: 4 bytes:
487 timestamp sampled from either the Access Manager TSF counter
488 or free-running microsecond counter when the MAC receives
489 first byte of PLCP header.
492 typedef struct rxbuffer {
493 u16 mac_cnt_rcvd; /* only 12 bits are len! (0xfff) */
494 u8 mac_cnt_mblks;
495 u8 mac_status;
496 u8 phy_stat_baseband; /* bit 0x80: used LNA (Low-Noise Amplifier) */
497 u8 phy_plcp_signal;
498 u8 phy_level; /* PHY stat */
499 u8 phy_snr; /* PHY stat */
500 u32 time; /* timestamp upon MAC rcv first byte */
501 /* 4-byte (acx100) or 8-byte (acx111) phy header will be here
502 ** if RX_CFG1_INCLUDE_PHY_HDR is in effect:
503 ** phy_hdr_t phy */
504 struct ieee80211_hdr hdr_a3;
505 /* maximally sized data part of wlan packet */
506 u8 data_a3[30 + 2312 + 4 - 24]; /*WLAN_A4FR_MAXLEN_WEP_FCS - WLAN_HDR_A3_LEN]*/
507 /* can add hdr/data_a4 if needed */
508 } ACX_PACKED rxbuffer_t;
511 /*--- Firmware statistics ----------------------------------------------------*/
513 /* define a random 100 bytes more to catch firmware versions which
514 * provide a bigger struct */
515 #define FW_STATS_FUTURE_EXTENSION 100
517 typedef struct fw_stats_tx {
518 u32 tx_desc_of;
519 } ACX_PACKED fw_stats_tx_t;
521 typedef struct fw_stats_rx {
522 u32 rx_oom;
523 u32 rx_hdr_of;
524 u32 rx_hw_stuck; /* old: u32 rx_hdr_use_next */
525 u32 rx_dropped_frame;
526 u32 rx_frame_ptr_err;
527 u32 rx_xfr_hint_trig;
528 u32 rx_aci_events; /* later versions only */
529 u32 rx_aci_resets; /* later versions only */
530 } ACX_PACKED fw_stats_rx_t;
532 typedef struct fw_stats_dma {
533 u32 rx_dma_req;
534 u32 rx_dma_err;
535 u32 tx_dma_req;
536 u32 tx_dma_err;
537 } ACX_PACKED fw_stats_dma_t;
539 typedef struct fw_stats_irq {
540 u32 cmd_cplt;
541 u32 fiq;
542 u32 rx_hdrs;
543 u32 rx_cmplt;
544 u32 rx_mem_of;
545 u32 rx_rdys;
546 u32 irqs;
547 u32 tx_procs;
548 u32 decrypt_done;
549 u32 dma_0_done;
550 u32 dma_1_done;
551 u32 tx_exch_complet;
552 u32 commands;
553 u32 rx_procs;
554 u32 hw_pm_mode_changes;
555 u32 host_acks;
556 u32 pci_pm;
557 u32 acm_wakeups;
558 } ACX_PACKED fw_stats_irq_t;
560 typedef struct fw_stats_wep {
561 u32 wep_key_count;
562 u32 wep_default_key_count;
563 u32 dot11_def_key_mib;
564 u32 wep_key_not_found;
565 u32 wep_decrypt_fail;
566 u32 wep_pkt_decrypt;
567 u32 wep_decrypt_irqs;
568 } ACX_PACKED fw_stats_wep_t;
570 typedef struct fw_stats_pwr {
571 u32 tx_start_ctr;
572 u32 no_ps_tx_too_short;
573 u32 rx_start_ctr;
574 u32 no_ps_rx_too_short;
575 u32 lppd_started;
576 u32 no_lppd_too_noisy;
577 u32 no_lppd_too_short;
578 u32 no_lppd_matching_frame;
579 } ACX_PACKED fw_stats_pwr_t;
581 typedef struct fw_stats_mic {
582 u32 mic_rx_pkts;
583 u32 mic_calc_fail;
584 } ACX_PACKED fw_stats_mic_t;
586 typedef struct fw_stats_aes {
587 u32 aes_enc_fail;
588 u32 aes_dec_fail;
589 u32 aes_enc_pkts;
590 u32 aes_dec_pkts;
591 u32 aes_enc_irq;
592 u32 aes_dec_irq;
593 } ACX_PACKED fw_stats_aes_t;
595 typedef struct fw_stats_event {
596 u32 heartbeat;
597 u32 calibration;
598 u32 rx_mismatch;
599 u32 rx_mem_empty;
600 u32 rx_pool;
601 u32 oom_late;
602 u32 phy_tx_err;
603 u32 tx_stuck;
604 } ACX_PACKED fw_stats_event_t;
606 /* mainly for size calculation only */
607 typedef struct fw_stats {
608 u16 type;
609 u16 len;
610 fw_stats_tx_t tx;
611 fw_stats_rx_t rx;
612 fw_stats_dma_t dma;
613 fw_stats_irq_t irq;
614 fw_stats_wep_t wep;
615 fw_stats_pwr_t pwr;
616 fw_stats_mic_t mic;
617 fw_stats_aes_t aes;
618 fw_stats_event_t evt;
619 u8 _padding[FW_STATS_FUTURE_EXTENSION];
620 } fw_stats_t;
622 /* Firmware version struct */
624 typedef struct fw_ver {
625 u16 cmd;
626 u16 size;
627 char fw_id[20];
628 u32 hw_id;
629 } ACX_PACKED fw_ver_t;
631 #define FW_ID_SIZE 20
634 /*--- WEP stuff --------------------------------------------------------------*/
635 #define DOT11_MAX_DEFAULT_WEP_KEYS 4
637 /* non-firmware struct, no packing necessary */
638 typedef struct wep_key {
639 size_t size; /* most often used member first */
640 u8 index;
641 u8 key[29];
642 u16 strange_filler;
643 } wep_key_t; /* size = 264 bytes (33*8) */
644 /* FIXME: We don't have size 264! Or is there 2 bytes beyond the key
645 * (strange_filler)? */
647 /* non-firmware struct, no packing necessary */
648 typedef struct key_struct {
649 u8 addr[ETH_ALEN]; /* 0x00 */
650 u16 filler1; /* 0x06 */
651 u32 filler2; /* 0x08 */
652 u32 index; /* 0x0c */
653 u16 len; /* 0x10 */
654 u8 key[29]; /* 0x12; is this long enough??? */
655 } key_struct_t; /* size = 276. FIXME: where is the remaining space?? */
658 /*--- Client (peer) info -----------------------------------------------------*/
659 /* adev->sta_list[] is used for:
660 ** accumulating and processing of scan results
661 ** keeping client info in AP mode
662 ** keeping AP info in STA mode (AP is the only one 'client')
663 ** keeping peer info in ad-hoc mode
664 ** non-firmware struct --> no packing necessary */
665 enum {
666 CLIENT_EMPTY_SLOT_0 = 0,
667 CLIENT_EXIST_1 = 1,
668 CLIENT_AUTHENTICATED_2 = 2,
669 CLIENT_ASSOCIATED_3 = 3,
670 CLIENT_JOIN_CANDIDATE = 4
672 struct client {
673 /* most frequent access first */
674 u8 used; /* misnamed, more like 'status' */
675 struct client* next;
676 unsigned long mtime; /* last time we heard it, in jiffies */
677 size_t essid_len; /* length of ESSID (without '\0') */
678 u32 sir; /* Standard IR */
679 u32 snr; /* Signal to Noise Ratio */
680 u16 aid; /* association ID */
681 u16 seq; /* from client's auth req */
682 u16 auth_alg; /* from client's auth req */
683 u16 cap_info; /* from client's assoc req */
684 u16 rate_cap; /* what client supports (all rates) */
685 u16 rate_bas; /* what client supports (basic rates) */
686 u16 rate_cfg; /* what is allowed (by iwconfig etc) */
687 u16 rate_cur; /* currently used rate mask */
688 u8 rate_100; /* currently used rate byte (acx100 only) */
689 u8 address[ETH_ALEN];
690 u8 bssid[ETH_ALEN]; /* ad-hoc hosts can have bssid != mac */
691 u8 channel;
692 u8 auth_step;
693 u8 ignore_count;
694 u8 fallback_count;
695 u8 stepup_count;
696 char essid[IW_ESSID_MAX_SIZE + 1]; /* ESSID and trailing '\0' */
697 /* FIXME: this one is too damn big */
698 char challenge_text[128]; /*WLAN_CHALLENGE_LEN*/
702 /***********************************************************************
703 ** Hardware structures
706 /* An opaque typesafe helper type
708 * Some hardware fields are actually pointers,
709 * but they have to remain u32, since using ptr instead
710 * (8 bytes on 64bit systems!) would disrupt the fixed descriptor
711 * format the acx firmware expects in the non-user area.
712 * Since we cannot cram an 8 byte ptr into 4 bytes, we need to
713 * enforce that pointed to data remains in low memory
714 * (address value needs to fit in 4 bytes) on 64bit systems.
716 * This is easy to get wrong, thus we are using a small struct
717 * and special macros to access it. Macros will check for
718 * attempts to overflow an acx_ptr with value > 0xffffffff.
720 * Attempts to use acx_ptr without macros result in compile-time errors */
722 typedef struct {
723 u32 v;
724 } ACX_PACKED acx_ptr;
726 #if ACX_DEBUG
727 #define CHECK32(n) BUG_ON(sizeof(n)>4 && (long)(n)>0xffffff00)
728 #else
729 #define CHECK32(n) ((void)0)
730 #endif
732 /* acx_ptr <-> integer conversion */
733 #define cpu2acx(n) ({ CHECK32(n); ((acx_ptr){ .v = cpu_to_le32(n) }); })
734 #define acx2cpu(a) (le32_to_cpu(a.v))
736 /* acx_ptr <-> pointer conversion */
737 #define ptr2acx(p) ({ CHECK32(p); ((acx_ptr){ .v = cpu_to_le32((u32)(long)(p)) }); })
738 #define acx2ptr(a) ((void*)le32_to_cpu(a.v))
740 /* Values for rate field (acx100 only) */
741 #define RATE100_1 10
742 #define RATE100_2 20
743 #define RATE100_5 55
744 #define RATE100_11 110
745 #define RATE100_22 220
746 /* This bit denotes use of PBCC:
747 ** (PBCC encoding is usable with 11 and 22 Mbps speeds only) */
748 #define RATE100_PBCC511 0x80
750 /* Bit values for rate111 field */
751 #define RATE111_1 0x0001 /* DBPSK */
752 #define RATE111_2 0x0002 /* DQPSK */
753 #define RATE111_5 0x0004 /* CCK or PBCC */
754 #define RATE111_6 0x0008 /* CCK-OFDM or OFDM */
755 #define RATE111_9 0x0010 /* CCK-OFDM or OFDM */
756 #define RATE111_11 0x0020 /* CCK or PBCC */
757 #define RATE111_12 0x0040 /* CCK-OFDM or OFDM */
758 #define RATE111_18 0x0080 /* CCK-OFDM or OFDM */
759 #define RATE111_22 0x0100 /* PBCC */
760 #define RATE111_24 0x0200 /* CCK-OFDM or OFDM */
761 #define RATE111_36 0x0400 /* CCK-OFDM or OFDM */
762 #define RATE111_48 0x0800 /* CCK-OFDM or OFDM */
763 #define RATE111_54 0x1000 /* CCK-OFDM or OFDM */
764 #define RATE111_RESERVED 0x2000
765 #define RATE111_PBCC511 0x4000 /* PBCC mod at 5.5 or 11Mbit (else CCK) */
766 #define RATE111_SHORTPRE 0x8000 /* short preamble */
767 /* Special 'try everything' value */
768 #define RATE111_ALL 0x1fff
769 /* These bits denote acx100 compatible settings */
770 #define RATE111_ACX100_COMPAT 0x0127
771 /* These bits denote 802.11b compatible settings */
772 #define RATE111_80211B_COMPAT 0x0027
774 /* Descriptor Ctl field bits
775 * init value is 0x8e, "idle" value is 0x82 (in idle tx descs)
777 #define DESC_CTL_SHORT_PREAMBLE 0x01 /* preamble type: 0 = long; 1 = short */
778 #define DESC_CTL_FIRSTFRAG 0x02 /* this is the 1st frag of the frame */
779 #define DESC_CTL_AUTODMA 0x04
780 #define DESC_CTL_RECLAIM 0x08 /* ready to reuse */
781 #define DESC_CTL_HOSTDONE 0x20 /* host has finished processing */
782 #define DESC_CTL_ACXDONE 0x40 /* acx has finished processing */
783 /* host owns the desc [has to be released last, AFTER modifying all other desc fields!] */
784 #define DESC_CTL_HOSTOWN 0x80
785 #define DESC_CTL_ACXDONE_HOSTOWN (DESC_CTL_ACXDONE | DESC_CTL_HOSTOWN)
787 /* Descriptor Status field
789 #define DESC_STATUS_FULL (1 << 31)
791 /* NB: some bits may be interesting for Monitor mode tx (aka Raw tx): */
792 #define DESC_CTL2_SEQ 0x01 /* don't increase sequence field */
793 #define DESC_CTL2_FCS 0x02 /* don't add the FCS */
794 #define DESC_CTL2_MORE_FRAG 0x04
795 #define DESC_CTL2_RETRY 0x08 /* don't increase retry field */
796 #define DESC_CTL2_POWER 0x10 /* don't increase power mgmt. field */
797 #define DESC_CTL2_RTS 0x20 /* do RTS/CTS magic before sending */
798 #define DESC_CTL2_WEP 0x40 /* encrypt this frame */
799 #define DESC_CTL2_DUR 0x80 /* don't increase duration field */
801 /***********************************************************************
802 ** PCI structures
805 /* Outside of "#ifdef PCI" because USB needs to know sizeof()
806 ** of txdesc and rxdesc: */
807 struct txdesc {
808 acx_ptr pNextDesc; /* pointer to next txdesc */
809 acx_ptr HostMemPtr; /* 0x04 */
810 acx_ptr AcxMemPtr; /* 0x08 */
811 u32 tx_time; /* 0x0c */
812 u16 total_length; /* 0x10 */
813 u16 Reserved; /* 0x12 */
815 /* The following 16 bytes do not change when acx100 owns the descriptor */
816 /* BUG: fw clears last byte of this area which is supposedly reserved
817 ** for driver use. amd64 blew up. We dare not use it now */
818 u32 dummy[4];
820 u8 Ctl_8; /* 0x24, 8bit value */
821 u8 Ctl2_8; /* 0x25, 8bit value */
822 u8 error; /* 0x26 */
823 u8 ack_failures; /* 0x27 */
824 u8 rts_failures; /* 0x28 */
825 u8 rts_ok; /* 0x29 */
826 union {
827 struct {
828 u8 rate; /* 0x2a */
829 u8 queue_ctrl; /* 0x2b */
830 } ACX_PACKED r1;
831 struct {
832 u16 rate111; /* 0x2a */
833 } ACX_PACKED r2;
834 } ACX_PACKED u;
835 u32 queue_info; /* 0x2c (acx100, reserved on acx111) */
836 } ACX_PACKED; /* size : 48 = 0x30 */
837 /* NB: acx111 txdesc structure is 4 byte larger */
838 /* All these 4 extra bytes are reserved. tx alloc code takes them into account */
840 struct rxdesc {
841 acx_ptr pNextDesc; /* 0x00 */
842 acx_ptr HostMemPtr; /* 0x04 */
843 acx_ptr ACXMemPtr; /* 0x08 */
844 u32 rx_time; /* 0x0c */
845 u16 total_length; /* 0x10 */
846 u16 WEP_length; /* 0x12 */
847 u32 WEP_ofs; /* 0x14 */
849 /* the following 16 bytes do not change when acx100 owns the descriptor */
850 u8 driverWorkspace[16]; /* 0x18 */
852 u8 Ctl_8;
853 u8 rate;
854 u8 error;
855 u8 SNR; /* Signal-to-Noise Ratio */
856 u8 RxLevel;
857 u8 queue_ctrl;
858 u16 unknown;
859 u32 unknown2;
860 } ACX_PACKED; /* size 52 = 0x34 */
862 #ifdef ACX_MAC80211_PCI
864 /* Register I/O offsets */
865 #define ACX100_EEPROM_ID_OFFSET 0x380
867 /* please add further ACX hardware register definitions only when
868 it turns out you need them in the driver, and please try to use
869 firmware functionality instead, since using direct I/O access instead
870 of letting the firmware do it might confuse the firmware's state
871 machine */
873 /* ***** ABSOLUTELY ALWAYS KEEP OFFSETS IN SYNC WITH THE INITIALIZATION
874 ** OF THE I/O ARRAYS!!!! (grep for '^IO_ACX') ***** */
875 enum {
876 IO_ACX_SOFT_RESET = 0,
878 IO_ACX_SLV_MEM_ADDR,
879 IO_ACX_SLV_MEM_DATA,
880 IO_ACX_SLV_MEM_CTL,
881 IO_ACX_SLV_END_CTL,
883 IO_ACX_FEMR, /* Function Event Mask */
885 IO_ACX_INT_TRIG,
886 IO_ACX_IRQ_MASK,
887 IO_ACX_IRQ_STATUS_NON_DES,
888 IO_ACX_IRQ_STATUS_CLEAR, /* CLEAR = clear on read */
889 IO_ACX_IRQ_ACK,
890 IO_ACX_HINT_TRIG,
892 IO_ACX_ENABLE,
894 IO_ACX_EEPROM_CTL,
895 IO_ACX_EEPROM_ADDR,
896 IO_ACX_EEPROM_DATA,
897 IO_ACX_EEPROM_CFG,
899 IO_ACX_PHY_ADDR,
900 IO_ACX_PHY_DATA,
901 IO_ACX_PHY_CTL,
903 IO_ACX_GPIO_OE,
905 IO_ACX_GPIO_OUT,
907 IO_ACX_CMD_MAILBOX_OFFS,
908 IO_ACX_INFO_MAILBOX_OFFS,
909 IO_ACX_EEPROM_INFORMATION,
911 IO_ACX_EE_START,
912 IO_ACX_SOR_CFG,
913 IO_ACX_ECPU_CTRL
915 /* ***** ABSOLUTELY ALWAYS KEEP OFFSETS IN SYNC WITH THE INITIALIZATION
916 ** OF THE I/O ARRAYS!!!! (grep for '^IO_ACX') ***** */
918 /* Values for IO_ACX_INT_TRIG register: */
919 /* inform hw that rxdesc in queue needs processing */
920 #define INT_TRIG_RXPRC 0x08
921 /* inform hw that txdesc in queue needs processing */
922 #define INT_TRIG_TXPRC 0x04
923 /* ack that we received info from info mailbox */
924 #define INT_TRIG_INFOACK 0x02
925 /* inform hw that we have filled command mailbox */
926 #define INT_TRIG_CMD 0x01
928 struct txhostdesc {
929 acx_ptr data_phy; /* 0x00 [u8 *] */
930 u16 data_offset; /* 0x04 */
931 u16 reserved; /* 0x06 */
932 u16 Ctl_16; /* 16bit value, endianness!! */
933 u16 length; /* 0x0a */
934 acx_ptr desc_phy_next; /* 0x0c [txhostdesc *] */
935 acx_ptr pNext; /* 0x10 [txhostdesc *] */
936 u32 Status; /* 0x14, unused on Tx */
937 /* From here on you can use this area as you want (variable length, too!) */
938 u8 *data;
939 struct ieee80211_tx_status txstatus;
940 struct sk_buff *skb;
942 } ACX_PACKED;
944 struct rxhostdesc {
945 acx_ptr data_phy; /* 0x00 [rxbuffer_t *] */
946 u16 data_offset; /* 0x04 */
947 u16 reserved; /* 0x06 */
948 u16 Ctl_16; /* 0x08; 16bit value, endianness!! */
949 u16 length; /* 0x0a */
950 acx_ptr desc_phy_next; /* 0x0c [rxhostdesc_t *] */
951 acx_ptr pNext; /* 0x10 [rxhostdesc_t *] */
952 u32 Status; /* 0x14 */
953 /* From here on you can use this area as you want (variable length, too!) */
954 rxbuffer_t *data;
955 } ACX_PACKED;
957 #endif /* ACX_PCI */
959 /***********************************************************************
960 ** USB structures and constants
962 #ifdef ACX_MAC80211_USB
964 /* Used for usb_txbuffer.desc field */
965 #define USB_TXBUF_TXDESC 0xA
966 /* Size of header (everything up to data[]) */
967 #define USB_TXBUF_HDRSIZE 14
968 typedef struct usb_txbuffer {
969 u16 desc;
970 u16 mpdu_len;
971 u8 queue_index;
972 u8 rate;
973 u32 hostdata;
974 u8 ctrl1;
975 u8 ctrl2;
976 u16 data_len;
977 /* wlan packet content is placed here: */
978 u8 data[30 + 2312 + 4]; /*WLAN_A4FR_MAXLEN_WEP_FCS]*/
979 } ACX_PACKED usb_txbuffer_t;
981 /* USB returns either rx packets (see rxbuffer) or
982 ** these "tx status" structs: */
983 typedef struct usb_txstatus {
984 u16 mac_cnt_rcvd; /* only 12 bits are len! (0xfff) */
985 u8 queue_index;
986 u8 mac_status; /* seen 0x20 on tx failure */
987 u32 hostdata;
988 u8 rate;
989 u8 ack_failures;
990 u8 rts_failures;
991 u8 rts_ok;
992 // struct ieee80211_tx_status txstatus;
993 // struct sk_buff *skb;
994 } ACX_PACKED usb_txstatus_t;
996 typedef struct usb_tx {
997 unsigned busy:1;
998 struct urb *urb;
999 acx_device_t *adev;
1000 /* actual USB bulk output data block is here: */
1001 usb_txbuffer_t bulkout;
1002 } usb_tx_t;
1004 struct usb_rx_plain {
1005 unsigned busy:1;
1006 struct urb *urb;
1007 acx_device_t *adev;
1008 rxbuffer_t bulkin;
1011 typedef struct usb_rx {
1012 unsigned busy:1;
1013 struct urb *urb;
1014 acx_device_t *adev;
1015 rxbuffer_t bulkin;
1016 /* Make entire structure 4k */
1017 u8 padding[4*1024 - sizeof(struct usb_rx_plain)];
1018 } usb_rx_t;
1019 #endif /* ACX_USB */
1022 /* Config Option structs */
1024 typedef struct co_antennas {
1025 u8 type;
1026 u8 len;
1027 u8 list[2];
1028 } ACX_PACKED co_antennas_t;
1030 typedef struct co_powerlevels {
1031 u8 type;
1032 u8 len;
1033 u16 list[8];
1034 } ACX_PACKED co_powerlevels_t;
1036 typedef struct co_datarates {
1037 u8 type;
1038 u8 len;
1039 u8 list[8];
1040 } ACX_PACKED co_datarates_t;
1042 typedef struct co_domains {
1043 u8 type;
1044 u8 len;
1045 u8 list[6];
1046 } ACX_PACKED co_domains_t;
1048 typedef struct co_product_id {
1049 u8 type;
1050 u8 len;
1051 u8 list[128];
1052 } ACX_PACKED co_product_id_t;
1054 typedef struct co_manuf_id {
1055 u8 type;
1056 u8 len;
1057 u8 list[128];
1058 } ACX_PACKED co_manuf_t;
1060 typedef struct co_fixed {
1061 char NVSv[8];
1062 /* u16 NVS_vendor_offs; ACX111-only */
1063 /* u16 unknown; ACX111-only */
1064 u8 MAC[6]; /* ACX100-only */
1065 u16 probe_delay; /* ACX100-only */
1066 u32 eof_memory;
1067 u8 dot11CCAModes;
1068 u8 dot11Diversity;
1069 u8 dot11ShortPreambleOption;
1070 u8 dot11PBCCOption;
1071 u8 dot11ChannelAgility;
1072 u8 dot11PhyType; /* FIXME: does 802.11 call it "dot11PHYType"? */
1073 u8 dot11TempType;
1074 u8 table_count;
1075 } ACX_PACKED co_fixed_t;
1077 typedef struct acx111_ie_configoption {
1078 u16 type;
1079 u16 len;
1080 /* Do not access below members directly, they are in fact variable length */
1081 co_fixed_t fixed;
1082 co_antennas_t antennas;
1083 co_powerlevels_t power_levels;
1084 co_datarates_t data_rates;
1085 co_domains_t domains;
1086 co_product_id_t product_id;
1087 co_manuf_t manufacturer;
1088 u8 _padding[4];
1089 } ACX_PACKED acx111_ie_configoption_t;
1091 /***********************************************************************
1092 ** Main acx per-device data structure
1094 #define ACX_STATE_FW_LOADED 0x01
1095 #define ACX_STATE_IFACE_UP 0x02
1097 /* MAC mode (BSS type) defines
1098 * Note that they shouldn't be redefined, since they are also used
1099 * during communication with firmware */
1100 #define ACX_MODE_0_ADHOC 0
1101 #define ACX_MODE_1_UNUSED 1
1102 #define ACX_MODE_2_STA 2
1103 #define ACX_MODE_3_AP 3
1104 /* These are our own inventions. Sending these to firmware
1105 ** makes it stop emitting beacons, which is exactly what we want
1106 ** for these modes */
1107 #define ACX_MODE_MONITOR 0xfe
1108 #define ACX_MODE_OFF 0xff
1109 /* 'Submode': identifies exact status of ADHOC/STA host */
1110 #define ACX_STATUS_0_STOPPED 0
1111 #define ACX_STATUS_1_SCANNING 1
1112 #define ACX_STATUS_2_WAIT_AUTH 2
1113 #define ACX_STATUS_3_AUTHENTICATED 3
1114 #define ACX_STATUS_4_ASSOCIATED 4
1116 /* FIXME: this should be named something like struct acx_priv (typedef'd to
1117 * acx_priv_t) */
1119 /* non-firmware struct, no packing necessary */
1120 struct acx_device {
1121 /* most frequent accesses first (dereferencing and cache line!) */
1123 /*** Locking ***/
1124 struct mutex mutex;
1125 spinlock_t spinlock;
1126 spinlock_t irqlock;
1127 #if defined(PARANOID_LOCKING) /* Lock debugging */
1128 const char *last_sem;
1129 const char *last_lock;
1130 unsigned long sem_time;
1131 unsigned long lock_time;
1132 #endif
1134 /*** Linux network device ***/
1135 //struct device *dev; /* pointer to linux netdevice */
1137 /*** Device statistics ***/
1138 struct ieee80211_low_level_stats ieee_stats; /* wireless device statistics */
1140 /*** Device statistics ***/
1141 struct net_device_stats stats; /* net device statistics */
1143 #ifdef WIRELESS_EXT
1144 // struct iw_statistics wstats; /* wireless statistics */
1145 #endif
1146 struct ieee80211_hw *ieee;
1147 struct ieee80211_hw_mode modes[2];
1148 struct ieee80211_rx_status rx_status;
1150 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
1151 struct ieee80211_vif *vif;
1152 #endif
1154 /*** Power managment ***/
1155 struct pm_dev *pm; /* PM crap */
1157 /*** Management timer ***/
1158 struct timer_list mgmt_timer;
1160 /*** Hardware identification ***/
1161 const char *chip_name;
1162 u8 dev_type;
1163 u8 chip_type;
1164 u8 form_factor;
1165 u8 radio_type;
1166 u8 eeprom_version;
1168 /*** Config retrieved from EEPROM ***/
1169 char cfgopt_NVSv[8];
1170 u16 cfgopt_NVS_vendor_offs;
1171 u8 cfgopt_MAC[6];
1172 u16 cfgopt_probe_delay;
1173 u32 cfgopt_eof_memory;
1174 u8 cfgopt_dot11CCAModes;
1175 u8 cfgopt_dot11Diversity;
1176 u8 cfgopt_dot11ShortPreambleOption;
1177 u8 cfgopt_dot11PBCCOption;
1178 u8 cfgopt_dot11ChannelAgility;
1179 u8 cfgopt_dot11PhyType;
1180 u8 cfgopt_dot11TempType;
1181 co_antennas_t cfgopt_antennas;
1182 co_powerlevels_t cfgopt_power_levels;
1183 co_datarates_t cfgopt_data_rates;
1184 co_domains_t cfgopt_domains;
1185 co_product_id_t cfgopt_product_id;
1186 co_manuf_t cfgopt_manufacturer;
1188 /*** Firmware identification ***/
1189 char firmware_version[FW_ID_SIZE+1];
1190 u32 firmware_numver;
1191 u32 firmware_id;
1192 const u16 *ie_len;
1193 const u16 *ie_len_dot11;
1195 /*** Device state ***/
1196 u16 dev_state_mask;
1197 u8 led_power; /* power LED status */
1198 u32 get_mask; /* mask of settings to fetch from the card */
1199 u32 set_mask; /* mask of settings to write to the card */
1200 u32 initialized:1;
1201 /* Barely used in USB case */
1202 u16 irq_status;
1203 int irq_savedstate;
1204 int irq_reason;
1205 u8 after_interrupt_jobs; /* mini job list for doing actions after an interrupt occurred */
1206 struct work_struct after_interrupt_task; /* our task for after interrupt actions */
1208 unsigned int irq;
1210 /*** scanning ***/
1211 u16 scan_count; /* number of times to do channel scan */
1212 u8 scan_mode; /* 0 == active, 1 == passive, 2 == background */
1213 u8 scan_rate;
1214 u16 scan_duration;
1215 u16 scan_probe_delay;
1216 #if WIRELESS_EXT > 15
1217 // struct iw_spy_data spy_data; /* FIXME: needs to be implemented! */
1218 #endif
1220 /*** Virtual interface struct ***/
1221 struct acx_interface interface;
1223 /*** Wireless network settings ***/
1224 /* copy of the device address (ifconfig hw ether) that we actually use
1225 ** for 802.11; copied over from the network device's MAC address
1226 ** (ifconfig) when it makes sense only */
1227 u8 dev_addr[MAX_ADDR_LEN];
1228 u8 bssid[ETH_ALEN]; /* the BSSID after having joined */
1229 u8 ap[ETH_ALEN]; /* The AP we want, FF:FF:FF:FF:FF:FF is any */
1230 u16 aid; /* The Association ID sent from the AP / last used AID if we're an AP */
1231 u16 mode; /* mode from iwconfig */
1232 int monitor_type; /* ARPHRD_IEEE80211 or ARPHRD_IEEE80211_PRISM */
1233 u16 status; /* 802.11 association status */
1234 u8 essid_active; /* specific ESSID active, or select any? */
1235 u8 essid_len; /* to avoid dozens of strlen() */
1236 /* INCLUDES \0 termination for easy printf - but many places
1237 ** simply want the string data memcpy'd plus a length indicator!
1238 ** Keep that in mind... */
1239 char essid[IW_ESSID_MAX_SIZE+1];
1240 /* essid we are going to use for association, in case of "essid 'any'"
1241 ** and in case of hidden ESSID (use configured ESSID then) */
1242 char essid_for_assoc[IW_ESSID_MAX_SIZE+1];
1243 char nick[IW_ESSID_MAX_SIZE+1]; /* see essid! */
1244 u8 channel;
1245 u8 reg_dom_id; /* reg domain setting */
1246 u16 reg_dom_chanmask;
1247 u16 auth_or_assoc_retries;
1248 u16 scan_retries;
1249 unsigned long scan_start; /* YES, jiffies is defined as "unsigned long" */
1252 /* MAC80211 Template Reference */
1253 struct sk_buff *beacon_cache;
1254 /* stations known to us (if we're an ap) */
1255 // client_t sta_list[32]; /* tab is larger than list, so that */
1256 // client_t *sta_hash_tab[64]; /* hash collisions are not likely */
1257 // client_t *ap_client; /* this one is our AP (STA mode only) */
1259 int dup_count;
1260 int nondup_count;
1261 unsigned long dup_msg_expiry;
1262 u16 last_seq_ctrl; /* duplicate packet detection */
1264 /* 802.11 power save mode */
1265 u8 ps_wakeup_cfg;
1266 u8 ps_listen_interval;
1267 u8 ps_options;
1268 u8 ps_hangover_period;
1269 u32 ps_enhanced_transition_time;
1270 u32 ps_beacon_rx_time;
1272 /*** PHY settings ***/
1273 u8 fallback_threshold;
1274 u8 stepup_threshold;
1275 u16 rate_basic;
1276 u16 rate_oper;
1277 u16 rate_bcast;
1278 u16 rate_bcast100;
1279 u8 rate_auto; /* false if "iwconfig rate N" (WITHOUT 'auto'!) */
1280 u8 preamble_mode; /* 0 == Long Preamble, 1 == Short, 2 == Auto */
1281 u8 preamble_cur;
1283 u8 tx_disabled;
1284 u8 tx_level_dbm;
1285 /* u8 tx_level_val; */
1286 /* u8 tx_level_auto; whether to do automatic power adjustment */
1288 unsigned long recalib_time_last_success;
1289 unsigned long recalib_time_last_attempt;
1290 int recalib_failure_count;
1291 int recalib_msg_ratelimit;
1292 int retry_errors_msg_ratelimit;
1294 unsigned long brange_time_last_state_change; /* time the power LED was last changed */
1295 u8 brange_last_state; /* last state of the LED */
1296 u8 brange_max_quality; /* maximum quality that equates to full speed */
1298 u8 sensitivity;
1299 u8 antenna; /* antenna settings */
1300 u8 ed_threshold; /* energy detect threshold */
1301 u8 cca; /* clear channel assessment */
1303 u16 rts_threshold;
1304 u16 frag_threshold;
1305 u32 short_retry;
1306 u32 long_retry;
1307 u16 msdu_lifetime;
1308 u16 listen_interval; /* given in units of beacon interval */
1309 u32 beacon_interval;
1311 u16 capabilities;
1312 u8 rate_supported_len;
1313 u8 rate_supported[13];
1315 /*** Encryption settings (WEP) ***/
1316 u32 auth_alg; /* used in transmit_authen1 */
1317 u8 wep_enabled;
1318 u8 wep_restricted;
1319 u8 wep_current_index;
1320 wep_key_t wep_keys[DOT11_MAX_DEFAULT_WEP_KEYS]; /* the default WEP keys */
1322 key_struct_t wep_key_struct[10];
1324 /*** Encryption Replacement for mac80211 ***/
1325 struct acx_key key[54];
1326 u16 security_offset;
1327 u8 default_key_idx;
1330 /*** Unknown ***/
1331 u8 dtim_interval;
1333 /*** Card Rx/Tx management ***/
1334 u16 rx_config_1;
1335 u16 rx_config_2;
1336 u16 memblocksize;
1337 unsigned int tx_free;
1338 unsigned int tx_head; /* keep as close as possible to Tx stuff below (cache line) */
1339 u16 phy_header_len;
1341 /*************************************************************************
1342 *** PCI/USB/... must be last or else hw agnostic code breaks horribly ***
1343 *************************************************************************/
1345 /* hack to let common code compile. FIXME */
1346 dma_addr_t rxhostdesc_startphy;
1348 /*** PCI stuff ***/
1349 #ifdef ACX_MAC80211_PCI
1350 /* pointers to tx buffers, tx host descriptors (in host memory)
1351 ** and tx descs in device memory */
1352 unsigned int tx_tail;
1353 u8 *txbuf_start;
1354 txhostdesc_t *txhostdesc_start;
1355 txdesc_t *txdesc_start; /* points to PCI-mapped memory */
1356 dma_addr_t txbuf_startphy;
1357 dma_addr_t txhostdesc_startphy;
1358 /* sizes of above host memory areas */
1359 unsigned int txbuf_area_size;
1360 unsigned int txhostdesc_area_size;
1362 unsigned int txdesc_size; /* size of txdesc; ACX111 = ACX100 + 4 */
1363 client_t *txc[TX_CNT];
1364 u16 txr[TX_CNT];
1366 /* same for rx */
1367 unsigned int rx_tail;
1368 rxbuffer_t *rxbuf_start;
1369 rxhostdesc_t *rxhostdesc_start;
1370 rxdesc_t *rxdesc_start;
1371 /* physical addresses of above host memory areas */
1372 dma_addr_t rxbuf_startphy;
1373 /* dma_addr_t rxhostdesc_startphy; */
1374 unsigned int rxbuf_area_size;
1375 unsigned int rxhostdesc_area_size;
1377 u8 need_radio_fw;
1378 u8 irqs_active; /* whether irq sending is activated */
1380 const u16 *io; /* points to ACX100 or ACX111 PCI I/O register address set */
1382 #ifdef CONFIG_PCI
1383 struct pci_dev *pdev;
1384 #endif
1385 #ifdef CONFIG_VLYNQ
1386 struct vlynq_device *vdev;
1387 #endif
1388 struct device *bus_dev;
1389 unsigned long membase;
1390 unsigned long membase2;
1391 void __iomem *iobase;
1392 void __iomem *iobase2;
1393 /* command interface */
1394 u8 __iomem *cmd_area;
1395 u8 __iomem *info_area;
1397 u16 irq_mask; /* interrupt types to mask out (not wanted) with many IRQs activated */
1398 u16 irq_mask_off; /* interrupt types to mask out (not wanted) with IRQs off */
1399 unsigned int irq_loops_this_jiffy;
1400 unsigned long irq_last_jiffies;
1401 #endif
1403 /*** USB stuff ***/
1404 #ifdef ACX_MAC80211_USB
1405 struct usb_device *usbdev;
1407 rxbuffer_t rxtruncbuf;
1409 usb_tx_t *usb_tx;
1410 usb_rx_t *usb_rx;
1412 int bulkinep; /* bulk-in endpoint */
1413 int bulkoutep; /* bulk-out endpoint */
1414 int rxtruncsize;
1415 #endif
1421 static inline
1422 acx_device_t * ieee2adev(struct ieee80211_hw *hw)
1424 return hw->priv;
1428 /* For use with ACX1xx_IE_RXCONFIG */
1429 /* bit description
1430 * 13 include additional header (length etc.) *required*
1431 * struct is defined in 'struct rxbuffer'
1432 * is this bit acx100 only? does acx111 always put the header,
1433 * and bit setting is irrelevant? --vda
1434 * 10 receive frames only with SSID used in last join cmd
1435 * 9 discard broadcast
1436 * 8 receive packets for multicast address 1
1437 * 7 receive packets for multicast address 0
1438 * 6 discard all multicast packets
1439 * 5 discard frames from foreign BSSID
1440 * 4 discard frames with foreign destination MAC address
1441 * 3 promiscuous mode (receive ALL frames, disable filter)
1442 * 2 include FCS
1443 * 1 include phy header
1444 * 0 ???
1446 #define RX_CFG1_INCLUDE_RXBUF_HDR 0x2000 /* ACX100 only */
1447 #define RX_CFG1_FILTER_SSID 0x0400
1448 #define RX_CFG1_FILTER_BCAST 0x0200
1449 #define RX_CFG1_RCV_MC_ADDR1 0x0100
1450 #define RX_CFG1_RCV_MC_ADDR0 0x0080
1451 #define RX_CFG1_FILTER_ALL_MULTI 0x0040
1452 #define RX_CFG1_FILTER_BSSID 0x0020
1453 #define RX_CFG1_FILTER_MAC 0x0010
1454 #define RX_CFG1_RCV_PROMISCUOUS 0x0008
1455 #define RX_CFG1_INCLUDE_FCS 0x0004
1456 #define RX_CFG1_INCLUDE_PHY_HDR (WANT_PHY_HDR ? 0x0002 : 0)
1457 /* bit description
1458 * 11 receive association requests etc.
1459 * 10 receive authentication frames
1460 * 9 receive beacon frames
1461 * 8 receive contention free packets
1462 * 7 receive control frames
1463 * 6 receive data frames
1464 * 5 receive broken frames
1465 * 4 receive management frames
1466 * 3 receive probe requests
1467 * 2 receive probe responses
1468 * 1 receive RTS/CTS/ACK frames
1469 * 0 receive other
1471 #define RX_CFG2_RCV_ASSOC_REQ 0x0800
1472 #define RX_CFG2_RCV_AUTH_FRAMES 0x0400
1473 #define RX_CFG2_RCV_BEACON_FRAMES 0x0200
1474 #define RX_CFG2_RCV_CONTENTION_FREE 0x0100
1475 #define RX_CFG2_RCV_CTRL_FRAMES 0x0080
1476 #define RX_CFG2_RCV_DATA_FRAMES 0x0040
1477 #define RX_CFG2_RCV_BROKEN_FRAMES 0x0020
1478 #define RX_CFG2_RCV_MGMT_FRAMES 0x0010
1479 #define RX_CFG2_RCV_PROBE_REQ 0x0008
1480 #define RX_CFG2_RCV_PROBE_RESP 0x0004
1481 #define RX_CFG2_RCV_ACK_FRAMES 0x0002
1482 #define RX_CFG2_RCV_OTHER 0x0001
1484 /* For use with ACX1xx_IE_FEATURE_CONFIG */
1485 #define FEATURE1_80MHZ_CLOCK 0x00000040L
1486 #define FEATURE1_4X 0x00000020L
1487 #define FEATURE1_LOW_RX 0x00000008L
1488 #define FEATURE1_EXTRA_LOW_RX 0x00000001L
1490 #define FEATURE2_SNIFFER 0x00000080L
1491 #define FEATURE2_NO_TXCRYPT 0x00000001L
1493 /*-- get and set mask values --*/
1494 #define GETSET_LED_POWER 0x00000001L
1495 #define GETSET_STATION_ID 0x00000002L
1496 #define SET_TEMPLATES 0x00000004L
1497 #define SET_STA_LIST 0x00000008L
1498 #define GETSET_TX 0x00000010L
1499 #define GETSET_RX 0x00000020L
1500 #define SET_RXCONFIG 0x00000040L
1501 #define GETSET_ANTENNA 0x00000080L
1502 #define GETSET_SENSITIVITY 0x00000100L
1503 #define GETSET_TXPOWER 0x00000200L
1504 #define GETSET_ED_THRESH 0x00000400L
1505 #define GETSET_CCA 0x00000800L
1506 #define GETSET_POWER_80211 0x00001000L
1507 #define GETSET_RETRY 0x00002000L
1508 #define GETSET_REG_DOMAIN 0x00004000L
1509 #define GETSET_CHANNEL 0x00008000L
1510 /* Used when ESSID changes etc and we need to scan for AP anew */
1511 #define GETSET_RESCAN 0x00010000L
1512 #define GETSET_MODE 0x00020000L
1513 #define GETSET_WEP 0x00040000L
1514 #define SET_WEP_OPTIONS 0x00080000L
1515 #define SET_MSDU_LIFETIME 0x00100000L
1516 #define SET_RATE_FALLBACK 0x00200000L
1518 /* keep in sync with the above */
1519 #define GETSET_ALL (0 \
1520 /* GETSET_LED_POWER */ | 0x00000001L \
1521 /* GETSET_STATION_ID */ | 0x00000002L \
1522 /* SET_TEMPLATES */ | 0x00000004L \
1523 /* SET_STA_LIST */ | 0x00000008L \
1524 /* GETSET_TX */ | 0x00000010L \
1525 /* GETSET_RX */ | 0x00000020L \
1526 /* SET_RXCONFIG */ | 0x00000040L \
1527 /* GETSET_ANTENNA */ | 0x00000080L \
1528 /* GETSET_SENSITIVITY */| 0x00000100L \
1529 /* GETSET_TXPOWER */ | 0x00000200L \
1530 /* GETSET_ED_THRESH */ | 0x00000400L \
1531 /* GETSET_CCA */ | 0x00000800L \
1532 /* GETSET_POWER_80211 */| 0x00001000L \
1533 /* GETSET_RETRY */ | 0x00002000L \
1534 /* GETSET_REG_DOMAIN */ | 0x00004000L \
1535 /* GETSET_CHANNEL */ | 0x00008000L \
1536 /* GETSET_RESCAN */ | 0x00010000L \
1537 /* GETSET_MODE */ | 0x00020000L \
1538 /* GETSET_WEP */ | 0x00040000L \
1539 /* SET_WEP_OPTIONS */ | 0x00080000L \
1540 /* SET_MSDU_LIFETIME */ | 0x00100000L \
1541 /* SET_RATE_FALLBACK */ | 0x00200000L \
1544 /***********************************************************************
1546 typedef struct acx100_ie_memblocksize {
1547 u16 type;
1548 u16 len;
1549 u16 size;
1550 } ACX_PACKED acx100_ie_memblocksize_t;
1552 typedef struct acx100_ie_queueconfig {
1553 u16 type;
1554 u16 len;
1555 u32 AreaSize;
1556 u32 RxQueueStart;
1557 u8 QueueOptions;
1558 u8 NumTxQueues;
1559 u8 NumRxDesc; /* for USB only */
1560 u8 pad1;
1561 u32 QueueEnd;
1562 u32 HostQueueEnd; /* QueueEnd2 */
1563 u32 TxQueueStart;
1564 u8 TxQueuePri;
1565 u8 NumTxDesc;
1566 u16 pad2;
1567 } ACX_PACKED acx100_ie_queueconfig_t;
1569 typedef struct acx111_ie_queueconfig {
1570 u16 type;
1571 u16 len;
1572 u32 tx_memory_block_address;
1573 u32 rx_memory_block_address;
1574 u32 rx1_queue_address;
1575 u32 reserved1;
1576 u32 tx1_queue_address;
1577 u8 tx1_attributes;
1578 u16 reserved2;
1579 u8 reserved3;
1580 } ACX_PACKED acx111_ie_queueconfig_t;
1582 typedef struct acx100_ie_memconfigoption {
1583 u16 type;
1584 u16 len;
1585 u32 DMA_config;
1586 acx_ptr pRxHostDesc;
1587 u32 rx_mem;
1588 u32 tx_mem;
1589 u16 RxBlockNum;
1590 u16 TxBlockNum;
1591 } ACX_PACKED acx100_ie_memconfigoption_t;
1593 typedef struct acx111_ie_memoryconfig {
1594 u16 type;
1595 u16 len;
1596 u16 no_of_stations;
1597 u16 memory_block_size;
1598 u8 tx_rx_memory_block_allocation;
1599 u8 count_rx_queues;
1600 u8 count_tx_queues;
1601 u8 options;
1602 u8 fragmentation;
1603 u16 reserved1;
1604 u8 reserved2;
1606 /* start of rx1 block */
1607 u8 rx_queue1_count_descs;
1608 u8 rx_queue1_reserved1;
1609 u8 rx_queue1_type; /* must be set to 7 */
1610 u8 rx_queue1_prio; /* must be set to 0 */
1611 acx_ptr rx_queue1_host_rx_start;
1612 /* end of rx1 block */
1614 /* start of tx1 block */
1615 u8 tx_queue1_count_descs;
1616 u8 tx_queue1_reserved1;
1617 u8 tx_queue1_reserved2;
1618 u8 tx_queue1_attributes;
1619 /* end of tx1 block */
1620 } ACX_PACKED acx111_ie_memoryconfig_t;
1622 typedef struct acx_ie_memmap {
1623 u16 type;
1624 u16 len;
1625 u32 CodeStart;
1626 u32 CodeEnd;
1627 u32 WEPCacheStart;
1628 u32 WEPCacheEnd;
1629 u32 PacketTemplateStart;
1630 u32 PacketTemplateEnd;
1631 u32 QueueStart;
1632 u32 QueueEnd;
1633 u32 PoolStart;
1634 u32 PoolEnd;
1635 } ACX_PACKED acx_ie_memmap_t;
1637 typedef struct acx111_ie_feature_config {
1638 u16 type;
1639 u16 len;
1640 u32 feature_options;
1641 u32 data_flow_options;
1642 } ACX_PACKED acx111_ie_feature_config_t;
1644 typedef struct acx111_ie_tx_level {
1645 u16 type;
1646 u16 len;
1647 u8 level;
1648 } ACX_PACKED acx111_ie_tx_level_t;
1650 #define PS_CFG_ENABLE 0x80
1651 #define PS_CFG_PENDING 0x40 /* status flag when entering PS */
1652 #define PS_CFG_WAKEUP_MODE_MASK 0x07
1653 #define PS_CFG_WAKEUP_BY_HOST 0x03
1654 #define PS_CFG_WAKEUP_EACH_ITVL 0x02
1655 #define PS_CFG_WAKEUP_ON_DTIM 0x01
1656 #define PS_CFG_WAKEUP_ALL_BEAC 0x00
1658 /* Enhanced PS mode: sleep until Rx Beacon w/ the STA's AID bit set
1659 ** in the TIM; newer firmwares only(?) */
1660 #define PS_OPT_ENA_ENHANCED_PS 0x04
1661 #define PS_OPT_TX_PSPOLL 0x02 /* send PSPoll frame to fetch waiting frames from AP (on frame with matching AID) */
1662 #define PS_OPT_STILL_RCV_BCASTS 0x01
1664 typedef struct acx100_ie_powersave {
1665 u16 type;
1666 u16 len;
1667 u8 wakeup_cfg;
1668 u8 listen_interval; /* for EACH_ITVL: wake up every "beacon units" interval */
1669 u8 options;
1670 u8 hangover_period; /* remaining wake time after Tx MPDU w/ PS bit, in values of 1/1024 seconds */
1671 u16 enhanced_ps_transition_time; /* rem. wake time for Enh. PS */
1672 } ACX_PACKED acx100_ie_powersave_t;
1674 typedef struct acx111_ie_powersave {
1675 u16 type;
1676 u16 len;
1677 u8 wakeup_cfg;
1678 u8 listen_interval; /* for EACH_ITVL: wake up every "beacon units" interval */
1679 u8 options;
1680 u8 hangover_period; /* remaining wake time after Tx MPDU w/ PS bit, in values of 1/1024 seconds */
1681 u32 beacon_rx_time;
1682 u32 enhanced_ps_transition_time; /* rem. wake time for Enh. PS */
1683 } ACX_PACKED acx111_ie_powersave_t;
1686 /***********************************************************************
1687 ** Commands and template structures
1691 ** SCAN command structure
1693 ** even though acx100 scan rates match RATE100 constants,
1694 ** acx111 ones do not match! Therefore we do not use RATE100 #defines */
1695 #define ACX_SCAN_RATE_1 10
1696 #define ACX_SCAN_RATE_2 20
1697 #define ACX_SCAN_RATE_5 55
1698 #define ACX_SCAN_RATE_11 110
1699 #define ACX_SCAN_RATE_22 220
1700 #define ACX_SCAN_RATE_PBCC 0x80 /* OR with this if needed */
1701 #define ACX_SCAN_OPT_ACTIVE 0x00 /* a bit mask */
1702 #define ACX_SCAN_OPT_PASSIVE 0x01
1703 /* Background scan: we go into Power Save mode (by transmitting
1704 ** NULL data frame to AP with the power mgmt bit set), do the scan,
1705 ** and then exit Power Save mode. A plus is that AP buffers frames
1706 ** for us while we do background scan. Thus we avoid frame losses.
1707 ** Background scan can be active or passive, just like normal one */
1708 #define ACX_SCAN_OPT_BACKGROUND 0x02
1709 typedef struct acx100_scan {
1710 u16 count; /* number of scans to do, 0xffff == continuous */
1711 u16 start_chan;
1712 u16 flags; /* channel list mask; 0x8000 == all channels? */
1713 u8 max_rate; /* max. probe rate */
1714 u8 options; /* bit mask, see defines above */
1715 u16 chan_duration;
1716 u16 max_probe_delay;
1717 } ACX_PACKED acx100_scan_t; /* length 0xc */
1719 #define ACX111_SCAN_RATE_6 0x0B
1720 #define ACX111_SCAN_RATE_9 0x0F
1721 #define ACX111_SCAN_RATE_12 0x0A
1722 #define ACX111_SCAN_RATE_18 0x0E
1723 #define ACX111_SCAN_RATE_24 0x09
1724 #define ACX111_SCAN_RATE_36 0x0D
1725 #define ACX111_SCAN_RATE_48 0x08
1726 #define ACX111_SCAN_RATE_54 0x0C
1727 #define ACX111_SCAN_OPT_5GHZ 0x04 /* else 2.4GHZ */
1728 #define ACX111_SCAN_MOD_SHORTPRE 0x01 /* you can combine SHORTPRE and PBCC */
1729 #define ACX111_SCAN_MOD_PBCC 0x80
1730 #define ACX111_SCAN_MOD_OFDM 0x40
1731 typedef struct acx111_scan {
1732 u16 count; /* number of scans to do */
1733 u8 channel_list_select; /* 0: scan all channels, 1: from chan_list only */
1734 u16 reserved1;
1735 u8 reserved2;
1736 u8 rate; /* rate for probe requests (if active scan) */
1737 u8 options; /* bit mask, see defines above */
1738 u16 chan_duration; /* min time to wait for reply on one channel (in TU) */
1739 /* (active scan only) (802.11 section 11.1.3.2.2) */
1740 u16 max_probe_delay; /* max time to wait for reply on one channel (active scan) */
1741 /* time to listen on a channel (passive scan) */
1742 u8 modulation;
1743 u8 channel_list[26]; /* bits 7:0 first byte: channels 8:1 */
1744 /* bits 7:0 second byte: channels 16:9 */
1745 /* 26 bytes is enough to cover 802.11a */
1746 } ACX_PACKED acx111_scan_t;
1749 ** Radio calibration command structure
1751 typedef struct acx111_cmd_radiocalib {
1752 /* 0x80000000 == automatic calibration by firmware, according to interval;
1753 * bits 0..3: select calibration methods to go through:
1754 * calib based on DC, AfeDC, Tx mismatch, Tx equilization */
1755 u32 methods;
1756 u32 interval;
1757 } ACX_PACKED acx111_cmd_radiocalib_t;
1760 ** Packet template structures
1762 ** Packet templates store contents of Beacon, Probe response, Probe request,
1763 ** Null data frame, and TIM data frame. Firmware automatically transmits
1764 ** contents of template at appropriate time:
1765 ** - Beacon: when configured as AP or Ad-hoc
1766 ** - Probe response: when configured as AP or Ad-hoc, whenever
1767 ** a Probe request frame is received
1768 ** - Probe request: when host issues SCAN command (active)
1769 ** - Null data frame: when entering 802.11 power save mode
1770 ** - TIM data: at the end of Beacon frames (if no TIM template
1771 ** is configured, then transmits default TIM)
1772 ** NB:
1773 ** - size field must be set to size of actual template
1774 ** (NOT sizeof(struct) - templates are variable in length),
1775 ** size field is not itself counted.
1776 ** - members flagged with an asterisk must be initialized with host,
1777 ** rest must be zero filled.
1778 ** - variable length fields shown only in comments */
1779 typedef struct acx_template_tim {
1780 u16 size;
1781 u8 tim_eid; /* 00 1 TIM IE ID * */
1782 u8 len; /* 01 1 Length * */
1783 u8 dtim_cnt; /* 02 1 DTIM Count */
1784 u8 dtim_period; /* 03 1 DTIM Period */
1785 u8 bitmap_ctrl; /* 04 1 Bitmap Control * (except bit0) */
1786 /* 05 n Partial Virtual Bitmap * */
1787 u8 variable[0x100 - 1-1-1-1-1];
1788 } ACX_PACKED acx_template_tim_t;
1790 typedef struct acx_template_probereq {
1791 u16 size;
1792 u16 fc; /* 00 2 fc * */
1793 u16 dur; /* 02 2 Duration */
1794 u8 da[6]; /* 04 6 Destination Address * */
1795 u8 sa[6]; /* 0A 6 Source Address * */
1796 u8 bssid[6]; /* 10 6 BSSID * */
1797 u16 seq; /* 16 2 Sequence Control */
1798 /* 18 n SSID * */
1799 /* nn n Supported Rates * */
1800 u8 variable[0x44 - 2-2-6-6-6-2];
1801 } ACX_PACKED acx_template_probereq_t;
1803 typedef struct acx_template_proberesp {
1804 u16 size;
1805 u16 fc; /* 00 2 fc * (bits [15:12] and [10:8] per 802.11 section 7.1.3.1) */
1806 u16 dur; /* 02 2 Duration */
1807 u8 da[6]; /* 04 6 Destination Address */
1808 u8 sa[6]; /* 0A 6 Source Address */
1809 u8 bssid[6]; /* 10 6 BSSID */
1810 u16 seq; /* 16 2 Sequence Control */
1811 u8 timestamp[8];/* 18 8 Timestamp */
1812 u16 beacon_interval; /* 20 2 Beacon Interval * */
1813 u16 cap; /* 22 2 Capability Information * */
1814 /* 24 n SSID * */
1815 /* nn n Supported Rates * */
1816 /* nn 1 DS Parameter Set * */
1817 u8 variable[0x54 - 2-2-6-6-6-2-8-2-2];
1818 } ACX_PACKED acx_template_proberesp_t;
1819 #define acx_template_beacon_t acx_template_proberesp_t
1820 #define acx_template_beacon acx_template_proberesp
1822 typedef struct acx_template_nullframe {
1823 u16 size;
1824 struct ieee80211_hdr hdr;
1825 } ACX_PACKED acx_template_nullframe_t;
1829 ** JOIN command structure
1831 ** as opposed to acx100, acx111 dtim interval is AFTER rates_basic111.
1832 ** NOTE: took me about an hour to get !@#$%^& packing right --> struct packing is eeeeevil... */
1833 typedef struct acx_joinbss {
1834 u8 bssid[ETH_ALEN];
1835 u16 beacon_interval;
1836 union {
1837 struct {
1838 u8 dtim_interval;
1839 u8 rates_basic;
1840 u8 rates_supported;
1841 } ACX_PACKED acx100;
1842 struct {
1843 u16 rates_basic;
1844 u8 dtim_interval;
1845 } ACX_PACKED acx111;
1846 } ACX_PACKED u;
1847 u8 genfrm_txrate; /* generated frame (bcn, proberesp, RTS, PSpoll) tx rate */
1848 u8 genfrm_mod_pre; /* generated frame modulation/preamble:
1849 ** bit7: PBCC, bit6: OFDM (else CCK/DQPSK/DBPSK)
1850 ** bit5: short pre */
1851 u8 macmode; /* BSS Type, must be one of ACX_MODE_xxx */
1852 u8 channel;
1853 u8 essid_len;
1854 char essid[IW_ESSID_MAX_SIZE];
1855 } ACX_PACKED acx_joinbss_t;
1857 #define JOINBSS_RATES_1 0x01
1858 #define JOINBSS_RATES_2 0x02
1859 #define JOINBSS_RATES_5 0x04
1860 #define JOINBSS_RATES_11 0x08
1861 #define JOINBSS_RATES_22 0x10
1863 /* Looks like missing bits are used to indicate 11g rates!
1864 ** (it follows from the fact that constants below match 1:1 to RATE111_nn)
1865 ** This was actually seen! Look at that Assoc Request sent by acx111,
1866 ** it _does_ contain 11g rates in basic set:
1867 01:30:20.070772 Beacon (xxx) [1.0* 2.0* 5.5* 11.0* 6.0* 9.0* 12.0* 18.0* 24.0* 36.0* 48.0* 54.0* Mbit] ESS CH: 1
1868 01:30:20.074425 Authentication (Open System)-1: Succesful
1869 01:30:20.076539 Authentication (Open System)-2:
1870 01:30:20.076620 Acknowledgment
1871 01:30:20.088546 Assoc Request (xxx) [1.0* 2.0* 5.5* 6.0* 9.0* 11.0* 12.0* 18.0* 24.0* 36.0* 48.0* 54.0* Mbit]
1872 01:30:20.122413 Assoc Response AID(1) :: Succesful
1873 01:30:20.122679 Acknowledgment
1874 01:30:20.173204 Beacon (xxx) [1.0* 2.0* 5.5* 11.0* 6.0* 9.0* 12.0* 18.0* 24.0* 36.0* 48.0* 54.0* Mbit] ESS CH: 1
1876 #define JOINBSS_RATES_BASIC111_1 0x0001
1877 #define JOINBSS_RATES_BASIC111_2 0x0002
1878 #define JOINBSS_RATES_BASIC111_5 0x0004
1879 #define JOINBSS_RATES_BASIC111_11 0x0020
1880 #define JOINBSS_RATES_BASIC111_22 0x0100
1883 /***********************************************************************
1885 typedef struct mem_read_write {
1886 u16 addr;
1887 u16 type; /* 0x0 int. RAM / 0xffff MAC reg. / 0x81 PHY RAM / 0x82 PHY reg.; or maybe it's actually 0x30 for MAC? Better verify it by writing and reading back and checking whether the value holds! */
1888 u32 len;
1889 u32 data;
1890 } ACX_PACKED mem_read_write_t;
1892 typedef struct firmware_image {
1893 u32 chksum;
1894 u32 size;
1895 u8 data[1]; /* the byte array of the actual firmware... */
1896 } ACX_PACKED firmware_image_t;
1898 typedef struct acx_cmd_radioinit {
1899 u32 offset;
1900 u32 len;
1901 } ACX_PACKED acx_cmd_radioinit_t;
1903 typedef struct acx100_ie_wep_options {
1904 u16 type;
1905 u16 len;
1906 u16 NumKeys; /* max # of keys */
1907 u8 WEPOption; /* 0 == decrypt default key only, 1 == override decrypt */
1908 u8 Pad; /* used only for acx111 */
1909 } ACX_PACKED acx100_ie_wep_options_t;
1911 typedef struct ie_dot11WEPDefaultKey {
1912 u16 type;
1913 u16 len;
1914 u8 action;
1915 u8 keySize;
1916 u8 defaultKeyNum;
1917 u8 key[29]; /* check this! was Key[19] */
1918 } ACX_PACKED ie_dot11WEPDefaultKey_t;
1920 typedef struct acx111WEPDefaultKey {
1921 u8 MacAddr[ETH_ALEN];
1922 u16 action; /* NOTE: this is a u16, NOT a u8!! */
1923 u16 reserved;
1924 u8 keySize;
1925 u8 type;
1926 u8 index;
1927 u8 defaultKeyNum;
1928 u8 counter[6];
1929 u8 key[32]; /* up to 32 bytes (for TKIP!) */
1930 } ACX_PACKED acx111WEPDefaultKey_t;
1932 typedef struct ie_dot11WEPDefaultKeyID {
1933 u16 type;
1934 u16 len;
1935 u8 KeyID;
1936 } ACX_PACKED ie_dot11WEPDefaultKeyID_t;
1938 typedef struct acx100_cmd_wep_mgmt {
1939 u8 MacAddr[ETH_ALEN];
1940 u16 Action;
1941 u16 KeySize;
1942 u8 Key[29]; /* 29*8 == 232bits == WEP256 */
1943 } ACX_PACKED acx100_cmd_wep_mgmt_t;
1945 typedef struct acx_ie_generic {
1946 u16 type;
1947 u16 len;
1948 union {
1949 /* Association ID IE: just a 16bit value: */
1950 u16 aid;
1951 /* generic member for quick implementation of commands */
1952 u8 bytes[32];
1953 } ACX_PACKED m;
1954 } ACX_PACKED acx_ie_generic_t;
1956 #define ACX_SEC_KEYSIZE 16
1957 /* Security algorithms. */
1958 enum {
1959 ACX_SEC_ALG,
1960 ACX_SEC_ALGO_NONE = 0, /* unencrypted, as of TX header. */
1961 ACX_SEC_ALGO_WEP,
1962 ACX_SEC_ALGO_UNKNOWN,
1963 ACX_SEC_ALGO_AES,
1964 ACX_SEC_ALGO_WEP104,
1965 ACX_SEC_ALGO_TKIP,
1967 /***********************************************************************
1969 #define CHECK_SIZEOF(type,size) { \
1970 extern void BUG_bad_size_for_##type(void); \
1971 if (sizeof(type)!=(size)) BUG_bad_size_for_##type(); \
1974 static inline void
1975 acx_struct_size_check(void)
1977 CHECK_SIZEOF(txdesc_t, 0x30);
1978 CHECK_SIZEOF(acx100_ie_memconfigoption_t, 24);
1979 CHECK_SIZEOF(acx100_ie_queueconfig_t, 0x20);
1980 CHECK_SIZEOF(acx_joinbss_t, 0x30);
1981 /* IEs need 4 bytes for (type,len) tuple */
1982 CHECK_SIZEOF(acx111_ie_configoption_t, ACX111_IE_CONFIG_OPTIONS_LEN + 4);
1986 /***********************************************************************
1987 ** Global data
1989 extern const u8 acx_bitpos2ratebyte[];
1990 extern const u8 acx_bitpos2rate100[];
1992 extern const u8 acx_reg_domain_ids[];
1993 extern const char * const acx_reg_domain_strings[];
1994 enum {
1995 acx_reg_domain_ids_len = 8
1998 //extern const struct iw_handler_def acx_ioctl_handler_def;
2000 #endif /* _ACX_STRUCT_H_ */