nexmon – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 /***************************************************************************
2 * *
3 * ########### ########### ########## ########## *
4 * ############ ############ ############ ############ *
5 * ## ## ## ## ## ## ## *
6 * ## ## ## ## ## ## ## *
7 * ########### #### ###### ## ## ## ## ###### *
8 * ########### #### # ## ## ## ## # # *
9 * ## ## ###### ## ## ## ## # # *
10 * ## ## # ## ## ## ## # # *
11 * ############ ##### ###### ## ## ## ##### ###### *
12 * ########### ########### ## ## ## ########## *
13 * *
14 * S E C U R E M O B I L E N E T W O R K I N G *
15 * *
16 * This file is part of NexMon. *
17 * *
18 * Copyright (c) 2016 NexMon Team *
19 * *
20 * NexMon is free software: you can redistribute it and/or modify *
21 * it under the terms of the GNU General Public License as published by *
22 * the Free Software Foundation, either version 3 of the License, or *
23 * (at your option) any later version. *
24 * *
25 * NexMon is distributed in the hope that it will be useful, *
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
28 * GNU General Public License for more details. *
29 * *
30 * You should have received a copy of the GNU General Public License *
31 * along with NexMon. If not, see <http://www.gnu.org/licenses/>. *
32 * *
33 **************************************************************************/
34  
35 #include <types.h>
36 #include <bcmcdc.h>
37  
38 /* Most of these structs are taken from the bcm4339 includes file and might currently be wrong */
39  
40 struct wlc_hw_info {
41 struct wlc_info *wlc; /* 0x00 */
42 int PAD; /* 0x04 */
43 int PAD; /* 0x08 */
44 int PAD; /* 0x0c */
45 int PAD; /* 0x10 */
46 struct dma_info *di[6]; /* 0x14 - only 4 bytes */
47 int PAD; // 0x2c
48 int PAD; // 0x30
49 int PAD; // 0x34
50 int PAD; // 0x38
51 int PAD; // 0x3c
52 int PAD; // 0x40
53 int PAD; // 0x44
54 int PAD; // 0x48
55 int PAD; // 0x4c
56 int PAD; // 0x50
57 int PAD; // 0x54
58 int PAD; // 0x58
59 int PAD; // 0x5c
60 int PAD; // 0x60
61 int PAD; // 0x64
62 int PAD; // 0x68
63 int PAD; // 0x6c
64 int PAD; // 0x70
65 char PAD; // 0x74
66 char PAD; // 0x75
67 char ucode_loaded; /* 0x76 */
68 char PAD; /* 0x77 */
69 int PAD; /* 0x78 */
70 int sih; /* 0x7c */
71 int vars; /* 0x80 */
72 int vars_size; /* 0x84 */
73 struct d11regs* regs; /* 0x88 */
74 int physhim; /* 0x8c */
75 int phy_sh; /* 0x90 */
76 struct wlc_hwband *band; /* 0x94 */
77 int PAD; // 0x98
78 int PAD; // 0x9c
79 int PAD; // 0xa0
80 int PAD; // 0xa4
81 int PAD; // 0xa8
82 char up; // 0xac verified wl_dpc
83 char PAD;
84 char PAD;
85 char PAD;
86 int PAD; // 0xb0
87 int PAD; // 0xb4
88 int PAD; // 0xb8
89 int PAD; // 0xbc
90 int PAD; // 0xc0
91 int PAD; // 0xc4
92 int PAD; // 0xc8
93 int PAD; // 0xcc
94 int PAD; // 0xd0
95 int PAD; // 0xd4
96 int PAD; // 0xd8
97 int PAD; // 0xdc
98 int PAD; // 0xe0
99 int PAD; // 0xe4
100 int PAD; // 0xe8
101 int PAD; // 0xec
102 int PAD; // 0xf0
103 int PAD; // 0xf4
104 int PAD; // 0xf8
105 int PAD; // 0xfc
106 };
107  
108 struct wl_rxsts {
109 uint32 pkterror; /* error flags per pkt */
110 uint32 phytype; /* 802.11 A/B/G ... */
111 uint16 chanspec; /* channel spec */
112 uint16 datarate; /* rate in 500kbps (0 for HT frame) */
113 uint8 mcs; /* MCS for HT frame */
114 uint8 htflags; /* HT modulation flags */
115 uint8 PAD;
116 uint8 PAD;
117 uint32 antenna; /* antenna pkts received on */
118 uint32 pktlength; /* pkt length minus bcm phy hdr */
119 uint32 mactime; /* time stamp from mac, count per 1us */
120 uint32 sq; /* signal quality */
121 int32 signal; /* in dBm */
122 int32 noise; /* in dBm */
123 uint32 preamble; /* Unknown, short, long */
124 uint32 encoding; /* Unknown, CCK, PBCC, OFDM, HT */
125 uint32 nfrmtype; /* special 802.11n frames(AMPDU, AMSDU) */
126 void *wlif; /* wl interface */
127 } __attribute__((packed));
128  
129 /* status per error RX pkt */
130 #define WL_RXS_CRC_ERROR 0x00000001 /* CRC Error in packet */
131 #define WL_RXS_RUNT_ERROR 0x00000002 /* Runt packet */
132 #define WL_RXS_ALIGN_ERROR 0x00000004 /* Misaligned packet */
133 #define WL_RXS_OVERSIZE_ERROR 0x00000008 /* packet bigger than RX_LENGTH (usually 1518) */
134 #define WL_RXS_WEP_ICV_ERROR 0x00000010 /* Integrity Check Value error */
135 #define WL_RXS_WEP_ENCRYPTED 0x00000020 /* Encrypted with WEP */
136 #define WL_RXS_PLCP_SHORT 0x00000040 /* Short PLCP error */
137 #define WL_RXS_DECRYPT_ERR 0x00000080 /* Decryption error */
138 #define WL_RXS_OTHER_ERR 0x80000000 /* Other errors */
139  
140 /* phy type */
141 #define WL_RXS_PHY_A 0x00000000 /* A phy type */
142 #define WL_RXS_PHY_B 0x00000001 /* B phy type */
143 #define WL_RXS_PHY_G 0x00000002 /* G phy type */
144 #define WL_RXS_PHY_N 0x00000004 /* N phy type */
145  
146 /* encoding */
147 #define WL_RXS_ENCODING_UNKNOWN 0x00000000
148 #define WL_RXS_ENCODING_DSSS_CCK 0x00000001 /* DSSS/CCK encoding (1, 2, 5.5, 11) */
149 #define WL_RXS_ENCODING_OFDM 0x00000002 /* OFDM encoding */
150 #define WL_RXS_ENCODING_HT 0x00000003 /* HT encoding */
151 #define WL_RXS_ENCODING_AC 0x00000004 /* HT encoding */
152  
153 /* preamble */
154 #define WL_RXS_UNUSED_STUB 0x0 /* stub to match with wlc_ethereal.h */
155 #define WL_RXS_PREAMBLE_SHORT 0x00000001 /* Short preamble */
156 #define WL_RXS_PREAMBLE_LONG 0x00000002 /* Long preamble */
157 #define WL_RXS_PREAMBLE_HT_MM 0x00000003 /* HT mixed mode preamble */
158 #define WL_RXS_PREAMBLE_HT_GF 0x00000004 /* HT green field preamble */
159  
160 /* htflags */
161 #define WL_RXS_HTF_40 0x01
162 #define WL_RXS_HTF_20L 0x02
163 #define WL_RXS_HTF_20U 0x04
164 #define WL_RXS_HTF_SGI 0x08
165 #define WL_RXS_HTF_STBC_MASK 0x30
166 #define WL_RXS_HTF_STBC_SHIFT 4
167 #define WL_RXS_HTF_LDPC 0x40
168  
169 #define WL_RXS_NFRM_AMPDU_FIRST 0x00000001 /* first MPDU in A-MPDU */
170 #define WL_RXS_NFRM_AMPDU_SUB 0x00000002 /* subsequent MPDU(s) in A-MPDU */
171 #define WL_RXS_NFRM_AMSDU_FIRST 0x00000004 /* first MSDU in A-MSDU */
172 #define WL_RXS_NFRM_AMSDU_SUB 0x00000008 /* subsequent MSDU(s) in A-MSDU */
173  
174 struct osl_info {
175 unsigned int pktalloced;
176 int PAD[1];
177 void *callback_when_dropped;
178 unsigned int bustype;
179 } __attribute__((packed));
180  
181 typedef struct sk_buff {
182 int field0; /* 0x00 */
183 int field4; /* 0x04 */
184 void *data; /* 0x08 */
185 short len; /* 0x0C */
186 short fieldE; // 0x0E
187 int field10; // 0x10
188 unsigned short next; // 0x14
189 unsigned short prev; // 0x16
190 unsigned short prev2; // 0x18
191 unsigned short prev3; // 0x1A
192 int PAD; // 0x1C
193 char byte20; // 0x20
194 char PAD; // 0x21
195 char PAD; // 0x22
196 char byte23; // 0x23
197 int PAD; // 0x24
198 int PAD; // 0x28
199 int dword2C; // 0x2C
200 } __attribute__((packed)) sk_buff;
201  
202 #define HNDRTE_DEV_NAME_MAX 16
203  
204 typedef struct hndrte_dev {
205 char name[HNDRTE_DEV_NAME_MAX];
206 struct hndrte_devfuncs *funcs;
207 uint32 devid;
208 void *softc; /* Software context */
209 uint32 flags; /* RTEDEVFLAG_XXXX */
210 struct hndrte_dev *next;
211 struct hndrte_dev *chained;
212 void *pdev;
213 } hndrte_dev;
214  
215 struct hndrte_devfuncs {
216 void *(*probe)(struct hndrte_dev *dev, void *regs, uint bus,
217 uint16 device, uint coreid, uint unit);
218 int (*open)(struct hndrte_dev *dev);
219 int (*close)(struct hndrte_dev *dev);
220 int (*xmit)(struct hndrte_dev *src, struct hndrte_dev *dev, void *lb);
221 int (*recv)(struct hndrte_dev *src, struct hndrte_dev *dev, void *pkt);
222 int (*ioctl)(struct hndrte_dev *dev, uint32 cmd, void *buffer, int len,
223 int *used, int *needed, int set);
224 void (*txflowcontrol) (struct hndrte_dev *dev, bool state, int prio);
225 void (*poll)(struct hndrte_dev *dev);
226 int (*xmit_ctl)(struct hndrte_dev *src, struct hndrte_dev *dev, void *lb);
227 int (*xmit2)(struct hndrte_dev *src, struct hndrte_dev *dev, void *lb, int8 ch);
228 };
229  
230 struct tunables {
231 char gap[62];
232 short somebnd; // @ 0x38
233 short rxbnd; // @ 0x40
234 };
235  
236 struct wlc_hwband {
237 int bandtype; /* 0x00 */
238 int bandunit; /* 0x04 */
239 char mhfs; /* 0x05 */
240 char PAD[10]; /* 0x06 */
241 char bandhw_stf_ss_mode; /* 0x13 */
242 short CWmin; /* 0x14 */
243 short CWmax; /* 0x16 */
244 int core_flags; /* 0x18 */
245 short phytype; /* 0x1C */
246 short phyrev; /* 0x1E */
247 short radioid; /* 0x20 */
248 short radiorev; /* 0x22 */
249 void *pi; /* 0x24 */
250 char abgphy_encore; /* 0x25 */
251 };
252  
253 /**
254 * Name might be inaccurate
255 */
256 struct device {
257 char name[16];
258 void *init_function;
259 int PAD;
260 void *some_device_info;
261 int PAD;
262 int PAD;
263 struct device *bound_device;
264 };
265  
266 /**
267 * Name might be inaccurate
268 */
269 struct wl_info {
270 int unit;
271 struct wlc_pub *pub;
272 struct wlc_info *wlc;
273 struct wlc_hw_info *wlc_hw;
274 struct hndrte_dev *dev; // 0x10
275 };
276  
277 /**
278 * Name might be inaccurate
279 */
280 struct sdiox_info {
281 int unit;
282 void *something;
283 void *sdio; // sdio_info struct
284 void *osh;
285 void *device_address;
286 } __attribute__((packed));
287  
288 struct wlcband {
289 int bandtype; /* 0x000 */
290 int bandunit; /* 0x004 */
291 short phytype; /* 0x008 */
292 short phyrev; /* 0x00A */
293 short radioid; /* 0x00C */
294 short radiorev; /* 0x00E */
295 void *pi; /* 0x010 */
296 char abgphy_encore; /* 0x014 */
297 char gmode; /* 0x015 */
298 char PAD; /* 0x016 */
299 char PAD; /* 0x017 */
300 void *hwrs_scb; /* 0x018 */
301 int defrateset; /* 0x01C */
302 int rspec_override; /* 0x020 */
303 int mrspec_override; /* 0x024 */
304 char band_stf_ss_mode; /* 0x028 */
305 char band_stf_stbc_tx; /* 0x029 */
306 int hw_rateset; /* 0x030 */
307 char basic_rate; /* 0x034 */
308 } __attribute__((packed));
309  
310 struct wlc_info {
311 struct wlc_pub *pub; /* 0x000 */
312 struct osl_info *osh; /* 0x004 */
313 void *wl; /* 0x008 */
314 volatile struct d11regs *regs; /* 0x00C */
315 struct wlc_hw_info *hw; /* 0x010 */
316 int PAD; /* 0x014 */
317 int PAD; /* 0x018 */
318 void *core; /* 0x01C */
319 struct wlcband *band; /* 0x020 verified */
320 int PAD; /* 0x024 */
321 struct wlcband *bandstate[2]; /* 0x028 */
322 int PAD; /* 0x030 */
323 int PAD; /* 0x034 */
324 int PAD; /* 0x038 */
325 int PAD; /* 0x03C */
326 int PAD; /* 0x040 */
327 int PAD; /* 0x044 */
328 int PAD; /* 0x048 */
329 int PAD; /* 0x04C */
330 int PAD; /* 0x050 */
331 int PAD; /* 0x054 */
332 int PAD; /* 0x058 */
333 int PAD; /* 0x05C */
334 int PAD; /* 0x060 */
335 int PAD; /* 0x064 */
336 int PAD; /* 0x068 */
337 int PAD; /* 0x06C */
338 int PAD; /* 0x070 */
339 int PAD; /* 0x074 */
340 int PAD; /* 0x078 */
341 int PAD; /* 0x07C */
342 int PAD; /* 0x080 */
343 int PAD; /* 0x084 */
344 int PAD; /* 0x088 */
345 int PAD; /* 0x08C */
346 int PAD; /* 0x090 */
347 int PAD; /* 0x094 */
348 int PAD; /* 0x098 */
349 int PAD; /* 0x09C */
350 int PAD; /* 0x0A0 */
351 int PAD; /* 0x0A4 */
352 int PAD; /* 0x0A8 */
353 int PAD; /* 0x0AC */
354 int PAD; /* 0x0B0 */
355 int PAD; /* 0x0B4 */
356 int PAD; /* 0x0B8 */
357 int PAD; /* 0x0BC */
358 int PAD; /* 0x0C0 */
359 int PAD; /* 0x0C4 */
360 int PAD; /* 0x0C8 */
361 int PAD; /* 0x0CC */
362 int PAD; /* 0x0D0 */
363 int PAD; /* 0x0D4 */
364 int PAD; /* 0x0D8 */
365 int PAD; /* 0x0DC */
366 int PAD; /* 0x0E0 */
367 int PAD; /* 0x0E4 */
368 int PAD; /* 0x0E8 */
369 int PAD; /* 0x0EC */
370 int PAD; /* 0x0F0 */
371 int PAD; /* 0x0F4 */
372 int PAD; /* 0x0F8 */
373 int PAD; /* 0x0FC */
374 int PAD; /* 0x100 */
375 int PAD; /* 0x104 */
376 int PAD; /* 0x108 */
377 int PAD; /* 0x10C */
378 int PAD; /* 0x110 */
379 int PAD; /* 0x114 */
380 int PAD; /* 0x118 */
381 int PAD; /* 0x11C */
382 int PAD; /* 0x120 */
383 int PAD; /* 0x124 */
384 int PAD; /* 0x128 */
385 int PAD; /* 0x12C */
386 int PAD; /* 0x130 */
387 int PAD; /* 0x134 */
388 int PAD; /* 0x138 */
389 int PAD; /* 0x13C */
390 int PAD; /* 0x140 */
391 int PAD; /* 0x144 */
392 int PAD; /* 0x148 */
393 int PAD; /* 0x14C */
394 int PAD; /* 0x150 */
395 int PAD; /* 0x154 */
396 int PAD; /* 0x158 */
397 void *cmi; /* 0x15C */
398 int PAD; /* 0x160 */
399 int PAD; /* 0x164 */
400 int PAD; /* 0x168 */
401 int PAD; /* 0x16C */
402 int PAD; /* 0x170 */
403 int PAD; /* 0x174 */
404 int PAD; /* 0x178 */
405 int PAD; /* 0x17C */
406 int PAD; /* 0x180 */
407 int PAD; /* 0x184 */
408 int PAD; /* 0x188 */
409 int PAD; /* 0x18C */
410 int PAD; /* 0x190 */
411 int PAD; /* 0x194 */
412 int PAD; /* 0x198 */
413 int PAD; /* 0x19C */
414 int PAD; /* 0x1A0 */
415 int PAD; /* 0x1A4 */
416 int PAD; /* 0x1A8 */
417 int PAD; /* 0x1AC */
418 int PAD; /* 0x1B0 */
419 int PAD; /* 0x1B4 */
420 int PAD; /* 0x1B8 */
421 int PAD; /* 0x1BC */
422 int PAD; /* 0x1C0 */
423 int PAD; /* 0x1C4 */
424 short PAD; /* 0x1C8 */
425 char bandlocked; /* 0x1CA */
426 char field_1CB; /* 0x1CB */
427 int PAD; /* 0x1CC */
428 int PAD; /* 0x1D0 */
429 int PAD; /* 0x1D4 */
430 int PAD; /* 0x1D8 */
431 int PAD; /* 0x1DC */
432 int PAD; /* 0x1E0 */
433 int PAD; /* 0x1E4 */
434 int PAD; /* 0x1E8 */
435 int PAD; /* 0x1EC */
436 int PAD; /* 0x1F0 */
437 int PAD; /* 0x1F4 */
438 int PAD; /* 0x1F8 */
439 int PAD; /* 0x1FC */
440 int PAD; /* 0x200 */
441 int PAD; /* 0x204 */
442 int PAD; /* 0x208 */
443 int monitor; /* 0x20C */
444 int bcnmisc_ibss; /* 0x210 */
445 int bcnmisc_scan; /* 0x214 */
446 int bcnmisc_monitor; /* 0x218 */
447 int PAD; /* 0x21C */
448 int PAD; /* 0x220 */
449 int PAD; /* 0x224 */
450 short PAD; /* 0x228 */
451 short wme_dp; /* 0x22A */
452 int PAD; /* 0x22C */
453 int PAD; /* 0x230 */
454 int PAD; /* 0x234 */
455 int PAD; /* 0x238 */
456 int PAD; /* 0x23C */
457 int PAD; /* 0x240 */
458 int PAD; /* 0x244 */
459 int PAD; /* 0x248 */
460 unsigned short tx_prec_map; /* 0x24C */
461 short PAD; /* 0x24E */
462 int PAD; /* 0x250 */
463 int PAD; /* 0x254 */
464 int PAD; /* 0x258 */
465 int PAD; /* 0x25C */
466 int PAD; /* 0x260 */
467 int PAD; /* 0x264 */
468 int PAD; /* 0x268 */
469 int PAD; /* 0x26C */
470 int PAD; /* 0x270 */
471 int PAD; /* 0x274 */
472 int PAD; /* 0x278 */
473 int PAD; /* 0x27C */
474 int PAD; /* 0x280 */
475 int PAD; /* 0x284 */
476 int PAD; /* 0x288 */
477 int PAD; /* 0x28C */
478 int PAD; /* 0x290 */
479 int PAD; /* 0x294 */
480 int PAD; /* 0x298 */
481 int PAD; /* 0x29C */
482 int PAD; /* 0x2A0 */
483 int PAD; /* 0x2A4 */
484 int PAD; /* 0x2A8 */
485 int PAD; /* 0x2AC */
486 int PAD; /* 0x2B0 */
487 int PAD; /* 0x2B4 */
488 int PAD; /* 0x2B8 */
489 int PAD; /* 0x2BC */
490 int PAD; /* 0x2C0 */
491 int PAD; /* 0x2C4 */
492 int PAD; /* 0x2C8 */
493 int PAD; /* 0x2CC */
494 int PAD; /* 0x2D0 */
495 int PAD; /* 0x2D4 */
496 int PAD; /* 0x2D8 */
497 int PAD; /* 0x2DC */
498 int PAD; /* 0x2E0 */
499 int PAD; /* 0x2E4 */
500 int PAD; /* 0x2E8 */
501 int PAD; /* 0x2EC */
502 int PAD; /* 0x2F0 */
503 int PAD; /* 0x2F4 */
504 int PAD; /* 0x2F8 */
505 int PAD; /* 0x2FC */
506 int PAD; /* 0X300 */
507 int PAD; /* 0X304 */
508 int PAD; /* 0X308 */
509 int PAD; /* 0X30C */
510 int PAD; /* 0X310 */
511 int PAD; /* 0X314 */
512 int PAD; /* 0X318 */
513 int PAD; /* 0X31C */
514 int PAD; /* 0X320 */
515 int PAD; /* 0X324 */
516 int PAD; /* 0X328 */
517 int PAD; /* 0X32C */
518 int PAD; /* 0X330 */
519 int PAD; /* 0X334 */
520 int PAD; /* 0X338 */
521 void *scan_results; /* 0X33C */
522 int PAD; /* 0X340 */
523 void *custom_scan_results; /* 0X344 */
524 int PAD; /* 0X348 */
525 int PAD; /* 0X34C */
526 int PAD; /* 0X350 */
527 int PAD; /* 0X354 */
528 int PAD; /* 0X358 */
529 int PAD; /* 0X35C */
530 int PAD; /* 0X360 */
531 short *field_364; /* 0X364 */
532 int PAD; /* 0X368 */
533 int PAD; /* 0X36C */
534 int PAD; /* 0X370 */
535 int PAD; /* 0X374 */
536 int PAD; /* 0X378 */
537 int PAD; /* 0X37C */
538 int PAD; /* 0X380 */
539 int PAD; /* 0X384 */
540 int PAD; /* 0X388 */
541 int PAD; /* 0X38C */
542 int PAD; /* 0X390 */
543 int PAD; /* 0X394 */
544 int PAD; /* 0X398 */
545 int PAD; /* 0X39C */
546 int PAD; /* 0X3A0 */
547 int PAD; /* 0X3A4 */
548 int PAD; /* 0X3A8 */
549 int PAD; /* 0X3AC */
550 int PAD; /* 0X3B0 */
551 int PAD; /* 0X3B4 */
552 int PAD; /* 0X3B8 */
553 int PAD; /* 0X3BC */
554 int PAD; /* 0X3C0 */
555 int PAD; /* 0X3C4 */
556 int PAD; /* 0X3C8 */
557 int PAD; /* 0X3CC */
558 int PAD; /* 0X3D0 */
559 int PAD; /* 0X3D4 */
560 int PAD; /* 0X3D8 */
561 int PAD; /* 0X3DC */
562 int PAD; /* 0X3E0 */
563 int PAD; /* 0X3E4 */
564 int PAD; /* 0X3E8 */
565 int PAD; /* 0X3EC */
566 int PAD; /* 0X3F0 */
567 int PAD; /* 0X3F4 */
568 int PAD; /* 0X3F8 */
569 int PAD; /* 0X3FC */
570 int PAD; /* 0X400 */
571 int PAD; /* 0X404 */
572 int PAD; /* 0X408 */
573 int PAD; /* 0X40C */
574 int PAD; /* 0X410 */
575 int PAD; /* 0X414 */
576 int PAD; /* 0X418 */
577 int PAD; /* 0X41C */
578 int PAD; /* 0X420 */
579 int PAD; /* 0X424 */
580 int PAD; /* 0X428 */
581 int PAD; /* 0X42C */
582 int PAD; /* 0X430 */
583 int PAD; /* 0X434 */
584 int PAD; /* 0X438 */
585 int PAD; /* 0X43C */
586 int PAD; /* 0X440 */
587 int PAD; /* 0X444 */
588 int PAD; /* 0X448 */
589 int PAD; /* 0X44C */
590 int PAD; /* 0X450 */
591 int PAD; /* 0X454 */
592 int PAD; /* 0X458 */
593 int PAD; /* 0X45C */
594 int PAD; /* 0X460 */
595 int PAD; /* 0X464 */
596 int PAD; /* 0X468 */
597 int PAD; /* 0X46C */
598 int PAD; /* 0X470 */
599 int PAD; /* 0X474 */
600 int PAD; /* 0X478 */
601 int PAD; /* 0X47C */
602 int PAD; /* 0X480 */
603 int PAD; /* 0X484 */
604 int PAD; /* 0X488 */
605 int PAD; /* 0X48C */
606 int PAD; /* 0X490 */
607 int PAD; /* 0X494 */
608 int PAD; /* 0X498 */
609 int PAD; /* 0X49C */
610 int PAD; /* 0X4A0 */
611 int PAD; /* 0X4A4 */
612 int PAD; /* 0X4A8 */
613 int PAD; /* 0X4AC */
614 int PAD; /* 0X4B0 */
615 int PAD; /* 0X4B4 */
616 int PAD; /* 0X4B8 */
617 int PAD; /* 0X4BC */
618 int PAD; /* 0X4C0 */
619 int PAD; /* 0X4C4 */
620 int PAD; /* 0X4C8 */
621 int PAD; /* 0X4CC */
622 int PAD; /* 0X4D0 */
623 int PAD; /* 0X4D4 */
624 int PAD; /* 0X4D8 */
625 int PAD; /* 0X4DC */
626 int PAD; /* 0X4E0 */
627 int PAD; /* 0X4E4 */
628 int PAD; /* 0X4E8 */
629 int PAD; /* 0X4EC */
630 int PAD; /* 0X4F0 */
631 int PAD; /* 0X4F4 */
632 int PAD; /* 0X4F8 */
633 int PAD; /* 0X4FC */
634 int PAD; /* 0X500 */
635 int PAD; /* 0X504 */
636 int PAD; /* 0X508 */
637 int PAD; /* 0X50C */
638 short some_chanspec; /* 0X510 */
639 short PAD; /* 0X512 */
640 int PAD; /* 0X514 */
641 int PAD; /* 0X518 */
642 int PAD; /* 0X51C */
643 int PAD; /* 0X520 */
644 int PAD; /* 0X524 */
645 int PAD; /* 0X528 */
646 int PAD; /* 0X52C */
647 int PAD; /* 0X530 */
648 int PAD; /* 0X534 */
649 int PAD; /* 0X538 */
650 int PAD; /* 0X53C */
651 int PAD; /* 0X540 */
652 int PAD; /* 0X544 */
653 int PAD; /* 0X548 */
654 int PAD; /* 0X54C */
655 int PAD; /* 0X550 */
656 int PAD; /* 0X554 */
657 int PAD; /* 0X558 */
658 int PAD; /* 0X55C */
659 int PAD; /* 0X560 */
660 int PAD; /* 0X564 */
661 int PAD; /* 0X568 */
662 int PAD; /* 0X56C */
663 int PAD; /* 0X570 */
664 int PAD; /* 0X574 */
665 int PAD; /* 0X578 */
666 int PAD; /* 0X57C */
667 int PAD; /* 0X580 */
668 int PAD; /* 0X584 */
669 int PAD; /* 0X588 */
670 int PAD; /* 0X58C */
671 int PAD; /* 0X590 */
672 int PAD; /* 0X594 */
673 int PAD; /* 0X598 */
674 int PAD; /* 0X59C */
675 int PAD; /* 0X5A0 */
676 int PAD; /* 0X5A4 */
677 int PAD; /* 0X5A8 */
678 int PAD; /* 0X5AC */
679 int PAD; /* 0X5B0 */
680 int PAD; /* 0X5B4 */
681 int PAD; /* 0X5B8 */
682 int PAD; /* 0X5BC */
683 int PAD; /* 0X5C0 */
684 int PAD; /* 0X5C4 */
685 int PAD; /* 0X5C8 */
686 int PAD; /* 0X5CC */
687 void *active_queue; /* 0X5D0 verified */
688 int PAD; /* 0X5D4 */ //active_queue duplicate
689 int PAD; /* 0X5D8 */
690 int PAD; /* 0X5DC */
691 int PAD; /* 0X5E0 */
692 int PAD; /* 0X5E4 */
693 int PAD; /* 0X5E8 */
694 int PAD; /* 0X5EC */
695 int PAD; /* 0X5F0 */
696 int PAD; /* 0X5F4 */
697 int PAD; /* 0X5F8 */
698 int PAD; /* 0X5FC */
699 };
700  
701 struct wlc_pub {
702 struct wlc_info *wlc; /* 0x000 */
703 int PAD; /* 0x004 */
704 int PAD; /* 0x008 */
705 int PAD; /* 0x00C */
706 int PAD; /* 0x010 */
707 void *osh; /* 0x014 */
708 int PAD; /* 0x018 */
709 int PAD; /* 0x01C */
710 int PAD; /* 0x020 */
711 char up_maybe; /* 0x024 */
712 char field_25; /* 0x025 */
713 char field_26; /* 0x026 */
714 char field_27; /* 0x027 */
715 struct tunables *tunables; /* 0x028 */
716 int PAD; /* 0x02C */
717 int field_30; /* 0x030 */
718 int PAD; /* 0x034 */
719 int PAD; /* 0x038 */
720 int PAD; /* 0x03C */
721 int PAD; /* 0x040 */
722 char PAD; /* 0x044 */
723 char PAD; /* 0x045 */
724 char field_46; /* 0x046 */
725 char PAD; /* 0x047 */
726 int PAD; /* 0x048 */
727 char associated; /* 0x04C */
728 char PAD; /* 0x04D */
729 char PAD; /* 0x04E */
730 char PAD; /* 0x04F */
731 int PAD; /* 0x050 */
732 char gap2[147];
733 char is_amsdu; // @ 0xe7
734 } __attribute__((packed));
735  
736 struct wlc_bsscfg {
737 void *wlc; /* 0x000 */
738 char associated; /* 0x004 */
739 char PAD; /* 0x005 */
740 char PAD; /* 0x006 */
741 char PAD; /* 0x007 */
742 int PAD; /* 0x008 */
743 int PAD; /* 0x00C */
744 int PAD; /* 0x010 */
745 int PAD; /* 0x014 */
746 int PAD; /* 0x018 */
747 int PAD; /* 0x01C */
748 int PAD; /* 0x020 */
749 int PAD; /* 0x024 */
750 int PAD; /* 0x028 */
751 int PAD; /* 0x02C */
752 int PAD; /* 0x030 */
753 int PAD; /* 0x034 */
754 int PAD; /* 0x038 */
755 int PAD; /* 0x03C */
756 int PAD; /* 0x040 */
757 int PAD; /* 0x044 */
758 int PAD; /* 0x048 */
759 int PAD; /* 0x04C */
760 int PAD; /* 0x050 */
761 int PAD; /* 0x054 */
762 int PAD; /* 0x058 */
763 int PAD; /* 0x05C */
764 int PAD; /* 0x060 */
765 int PAD; /* 0x064 */
766 int PAD; /* 0x068 */
767 int PAD; /* 0x06C */
768 int PAD; /* 0x070 */
769 int PAD; /* 0x074 */
770 int PAD; /* 0x078 */
771 int PAD; /* 0x07C */
772 int PAD; /* 0x080 */
773 int PAD; /* 0x084 */
774 int PAD; /* 0x088 */
775 int PAD; /* 0x08C */
776 int PAD; /* 0x090 */
777 int PAD; /* 0x094 */
778 int PAD; /* 0x098 */
779 int PAD; /* 0x09C */
780 int PAD; /* 0x0A0 */
781 int PAD; /* 0x0A4 */
782 int PAD; /* 0x0A8 */
783 int PAD; /* 0x0AC */
784 int PAD; /* 0x0B0 */
785 int PAD; /* 0x0B4 */
786 int PAD; /* 0x0B8 */
787 int PAD; /* 0x0BC */
788 int PAD; /* 0x0C0 */
789 int PAD; /* 0x0C4 */
790 int PAD; /* 0x0C8 */
791 int PAD; /* 0x0CC */
792 int PAD; /* 0x0D0 */
793 int PAD; /* 0x0D4 */
794 int PAD; /* 0x0D8 */
795 int PAD; /* 0x0DC */
796 int PAD; /* 0x0E0 */
797 int PAD; /* 0x0E4 */
798 int PAD; /* 0x0E8 */
799 int PAD; /* 0x0EC */
800 int PAD; /* 0x0F0 */
801 int PAD; /* 0x0F4 */
802 int PAD; /* 0x0F8 */
803 int PAD; /* 0x0FC */
804 int PAD; /* 0x100 */
805 int PAD; /* 0x104 */
806 int PAD; /* 0x108 */
807 int PAD; /* 0x10C */
808 int PAD; /* 0x110 */
809 int PAD; /* 0x114 */
810 int PAD; /* 0x118 */
811 int PAD; /* 0x11C */
812 int PAD; /* 0x120 */
813 int PAD; /* 0x124 */
814 int PAD; /* 0x128 */
815 int PAD; /* 0x12C */
816 int PAD; /* 0x130 */
817 int PAD; /* 0x134 */
818 int PAD; /* 0x138 */
819 int PAD; /* 0x13C */
820 int PAD; /* 0x140 */
821 int PAD; /* 0x144 */
822 int PAD; /* 0x148 */
823 int PAD; /* 0x14C */
824 int PAD; /* 0x150 */
825 int PAD; /* 0x154 */
826 int PAD; /* 0x158 */
827 int PAD; /* 0x15C */
828 int PAD; /* 0x160 */
829 int PAD; /* 0x164 */
830 int PAD; /* 0x168 */
831 int PAD; /* 0x16C */
832 int PAD; /* 0x170 */
833 int PAD; /* 0x174 */
834 int PAD; /* 0x178 */
835 int PAD; /* 0x17C */
836 int PAD; /* 0x180 */
837 int PAD; /* 0x184 */
838 int PAD; /* 0x188 */
839 int PAD; /* 0x18C */
840 int PAD; /* 0x190 */
841 int PAD; /* 0x194 */
842 int PAD; /* 0x198 */
843 int PAD; /* 0x19C */
844 int PAD; /* 0x1A0 */
845 int PAD; /* 0x1A4 */
846 int PAD; /* 0x1A8 */
847 int PAD; /* 0x1AC */
848 int PAD; /* 0x1B0 */
849 int PAD; /* 0x1B4 */
850 int PAD; /* 0x1B8 */
851 int PAD; /* 0x1BC */
852 int PAD; /* 0x1C0 */
853 int PAD; /* 0x1C4 */
854 int PAD; /* 0x1C8 */
855 int PAD; /* 0x1CC */
856 int PAD; /* 0x1D0 */
857 int PAD; /* 0x1D4 */
858 int PAD; /* 0x1D8 */
859 int PAD; /* 0x1DC */
860 int PAD; /* 0x1E0 */
861 int PAD; /* 0x1E4 */
862 int PAD; /* 0x1E8 */
863 int PAD; /* 0x1EC */
864 int PAD; /* 0x1F0 */
865 int PAD; /* 0x1F4 */
866 int PAD; /* 0x1F8 */
867 int PAD; /* 0x1FC */
868 int PAD; /* 0x200 */
869 int PAD; /* 0x204 */
870 int PAD; /* 0x208 */
871 int PAD; /* 0x20C */
872 int PAD; /* 0x210 */
873 int PAD; /* 0x214 */
874 int PAD; /* 0x218 */
875 int PAD; /* 0x21C */
876 int PAD; /* 0x220 */
877 int PAD; /* 0x224 */
878 int PAD; /* 0x228 */
879 int PAD; /* 0x22C */
880 int PAD; /* 0x230 */
881 int PAD; /* 0x234 */
882 int PAD; /* 0x238 */
883 int PAD; /* 0x23C */
884 int PAD; /* 0x240 */
885 int PAD; /* 0x244 */
886 int PAD; /* 0x248 */
887 int PAD; /* 0x24C */
888 int PAD; /* 0x250 */
889 int PAD; /* 0x254 */
890 int PAD; /* 0x258 */
891 int PAD; /* 0x25C */
892 int PAD; /* 0x260 */
893 int PAD; /* 0x264 */
894 int PAD; /* 0x268 */
895 int PAD; /* 0x26C */
896 int PAD; /* 0x270 */
897 int PAD; /* 0x274 */
898 int PAD; /* 0x278 */
899 int PAD; /* 0x27C */
900 int PAD; /* 0x280 */
901 int PAD; /* 0x284 */
902 int PAD; /* 0x288 */
903 int PAD; /* 0x28C */
904 int PAD; /* 0x290 */
905 int PAD; /* 0x294 */
906 int PAD; /* 0x298 */
907 int PAD; /* 0x29C */
908 int PAD; /* 0x2A0 */
909 int PAD; /* 0x2A4 */
910 int PAD; /* 0x2A8 */
911 int PAD; /* 0x2AC */
912 int PAD; /* 0x2B0 */
913 int PAD; /* 0x2B4 */
914 int PAD; /* 0x2B8 */
915 int PAD; /* 0x2BC */
916 int PAD; /* 0x2C0 */
917 int PAD; /* 0x2C4 */
918 int PAD; /* 0x2C8 */
919 int PAD; /* 0x2CC */
920 int PAD; /* 0x2D0 */
921 int PAD; /* 0x2D4 */
922 int PAD; /* 0x2D8 */
923 int PAD; /* 0x2DC */
924 int PAD; /* 0x2E0 */
925 int PAD; /* 0x2E4 */
926 int PAD; /* 0x2E8 */
927 int PAD; /* 0x2EC */
928 int PAD; /* 0x2F0 */
929 int PAD; /* 0x2F4 */
930 int PAD; /* 0x2F8 */
931 int PAD; /* 0x2FC */
932 int PAD; /* 0X300 */
933 int PAD; /* 0X304 */
934 int PAD; /* 0X308 */
935 int PAD; /* 0X30C */
936 int PAD; /* 0X310 */
937 int PAD; /* 0X314 */
938 int PAD; /* 0X318 */
939 int PAD; /* 0X31C */
940 int PAD; /* 0X320 */
941 int PAD; /* 0X324 */
942 int PAD; /* 0X328 */
943 int PAD; /* 0X32C */
944 int PAD; /* 0X330 */
945 int PAD; /* 0X334 */
946 int PAD; /* 0X338 */
947 int PAD; /* 0X33C */
948 int PAD; /* 0X340 */
949 int PAD; /* 0X344 */
950 int PAD; /* 0X348 */
951 int PAD; /* 0X34C */
952 int PAD; /* 0X350 */
953 int PAD; /* 0X354 */
954 int PAD; /* 0X358 */
955 int PAD; /* 0X35C */
956 int PAD; /* 0X360 */
957 int PAD; /* 0X364 */
958 int PAD; /* 0X368 */
959 int PAD; /* 0X36C */
960 int PAD; /* 0X370 */
961 int PAD; /* 0X374 */
962 int PAD; /* 0X378 */
963 int PAD; /* 0X37C */
964 int PAD; /* 0X380 */
965 int PAD; /* 0X384 */
966 int PAD; /* 0X388 */
967 int PAD; /* 0X38C */
968 int PAD; /* 0X390 */
969 int PAD; /* 0X394 */
970 int PAD; /* 0X398 */
971 int PAD; /* 0X39C */
972 int PAD; /* 0X3A0 */
973 int PAD; /* 0X3A4 */
974 int PAD; /* 0X3A8 */
975 int PAD; /* 0X3AC */
976 int PAD; /* 0X3B0 */
977 int PAD; /* 0X3B4 */
978 int PAD; /* 0X3B8 */
979 int PAD; /* 0X3BC */
980 int PAD; /* 0X3C0 */
981 int PAD; /* 0X3C4 */
982 int PAD; /* 0X3C8 */
983 int PAD; /* 0X3CC */
984 int PAD; /* 0X3D0 */
985 int PAD; /* 0X3D4 */
986 int PAD; /* 0X3D8 */
987 int PAD; /* 0X3DC */
988 int PAD; /* 0X3E0 */
989 int PAD; /* 0X3E4 */
990 int PAD; /* 0X3E8 */
991 int PAD; /* 0X3EC */
992 int PAD; /* 0X3F0 */
993 int PAD; /* 0X3F4 */
994 int PAD; /* 0X3F8 */
995 int PAD; /* 0X3FC */
996 int PAD; /* 0X400 */
997 int PAD; /* 0X404 */
998 int PAD; /* 0X408 */
999 int PAD; /* 0X40C */
1000 int PAD; /* 0X410 */
1001 int PAD; /* 0X414 */
1002 int PAD; /* 0X418 */
1003 int PAD; /* 0X41C */
1004 int PAD; /* 0X420 */
1005 int PAD; /* 0X424 */
1006 int PAD; /* 0X428 */
1007 int PAD; /* 0X42C */
1008 int PAD; /* 0X430 */
1009 int PAD; /* 0X434 */
1010 int PAD; /* 0X438 */
1011 int PAD; /* 0X43C */
1012 int PAD; /* 0X440 */
1013 int PAD; /* 0X444 */
1014 int PAD; /* 0X448 */
1015 int PAD; /* 0X44C */
1016 int PAD; /* 0X450 */
1017 int PAD; /* 0X454 */
1018 int PAD; /* 0X458 */
1019 int PAD; /* 0X45C */
1020 int PAD; /* 0X460 */
1021 int PAD; /* 0X464 */
1022 int PAD; /* 0X468 */
1023 int PAD; /* 0X46C */
1024 int PAD; /* 0X470 */
1025 int PAD; /* 0X474 */
1026 int PAD; /* 0X478 */
1027 int PAD; /* 0X47C */
1028 int PAD; /* 0X480 */
1029 int PAD; /* 0X484 */
1030 int PAD; /* 0X488 */
1031 int PAD; /* 0X48C */
1032 int PAD; /* 0X490 */
1033 int PAD; /* 0X494 */
1034 int PAD; /* 0X498 */
1035 int PAD; /* 0X49C */
1036 int PAD; /* 0X4A0 */
1037 int PAD; /* 0X4A4 */
1038 int PAD; /* 0X4A8 */
1039 int PAD; /* 0X4AC */
1040 int PAD; /* 0X4B0 */
1041 int PAD; /* 0X4B4 */
1042 int PAD; /* 0X4B8 */
1043 int PAD; /* 0X4BC */
1044 int PAD; /* 0X4C0 */
1045 int PAD; /* 0X4C4 */
1046 int PAD; /* 0X4C8 */
1047 int PAD; /* 0X4CC */
1048 int PAD; /* 0X4D0 */
1049 int PAD; /* 0X4D4 */
1050 int PAD; /* 0X4D8 */
1051 int PAD; /* 0X4DC */
1052 int PAD; /* 0X4E0 */
1053 int PAD; /* 0X4E4 */
1054 int PAD; /* 0X4E8 */
1055 int PAD; /* 0X4EC */
1056 int PAD; /* 0X4F0 */
1057 int PAD; /* 0X4F4 */
1058 int PAD; /* 0X4F8 */
1059 int PAD; /* 0X4FC */
1060 int PAD; /* 0X500 */
1061 int PAD; /* 0X504 */
1062 int PAD; /* 0X508 */
1063 int PAD; /* 0X50C */
1064 int PAD; /* 0X510 */
1065 int PAD; /* 0X514 */
1066 int PAD; /* 0X518 */
1067 int PAD; /* 0X51C */
1068 int PAD; /* 0X520 */
1069 int PAD; /* 0X524 */
1070 int PAD; /* 0X528 */
1071 int PAD; /* 0X52C */
1072 int PAD; /* 0X530 */
1073 int PAD; /* 0X534 */
1074 int PAD; /* 0X538 */
1075 int PAD; /* 0X53C */
1076 int PAD; /* 0X540 */
1077 short PAD; /* 0X544 */
1078 short field_546; /* 0X546 */
1079 int PAD; /* 0X548 */
1080 int PAD; /* 0X54C */
1081 int PAD; /* 0X550 */
1082 int PAD; /* 0X554 */
1083 int PAD; /* 0X558 */
1084 int PAD; /* 0X55C */
1085 int PAD; /* 0X560 */
1086 int PAD; /* 0X564 */
1087 int PAD; /* 0X568 */
1088 int PAD; /* 0X56C */
1089 int PAD; /* 0X570 */
1090 int PAD; /* 0X574 */
1091 int PAD; /* 0X578 */
1092 int PAD; /* 0X57C */
1093 int PAD; /* 0X580 */
1094 int PAD; /* 0X584 */
1095 } __attribute__((packed));
1096  
1097 struct hnddma_pub {
1098 void *di_fn; /* DMA function pointers */
1099 unsigned int txavail; /* # free tx descriptors */
1100 unsigned int dmactrlflags; /* dma control flags */
1101 /* rx error counters */
1102 unsigned int rxgiants; /* rx giant frames */
1103 unsigned int rxnobuf; /* rx out of dma descriptors */
1104 /* tx error counters */
1105 unsigned int txnobuf; /* tx out of dma descriptors */
1106 } __attribute__((packed));
1107  
1108 struct dma_info {
1109 struct hnddma_pub hnddma; /* exported structure */
1110 int msg_level; /* message level pointer */
1111 int something;
1112 char name[8]; /* callers name for diag msgs */
1113 void *osh;
1114 void *sih;
1115 bool dma64; /* this dma engine is operating in 64-bit mode */
1116 bool addrext; /* this dma engine supports DmaExtendedAddrChanges */
1117 char gap2[2];
1118 void *txregs; /* 64-bit dma tx engine registers */
1119 void *rxregs; /* 64-bit dma rx engine registers */
1120 void *txd; /* pointer to dma64 tx descriptor ring */
1121 void *rxd; /* pointer to dma64 rx descriptor ring */
1122 short dmadesc_align; /* alignment requirement for dma descriptors */
1123 short ntxd; /* # tx descriptors tunable */
1124 short txin; /* index of next descriptor to reclaim */
1125 short txout; /* index of next descriptor to post */
1126 void **txp; /* pointer to parallel array of pointers to packets */
1127 void *tx_dmah; /* DMA MAP meta-data handle */
1128 int txp_dmah;
1129 int txdpa; /* Aligned physical address of descriptor ring */
1130 int txdpaorig; /* Original physical address of descriptor ring */
1131 short txdalign; /* #bytes added to alloc'd mem to align txd */
1132 int txdalloc; /* #bytes allocated for the ring */
1133 int xmtptrbase; /* When using unaligned descriptors, the ptr register
1134 * is not just an index, it needs all 13 bits to be
1135 * an offset from the addr register.
1136 */
1137 short PAD;
1138 short nrxd;
1139 short rxin;
1140 short rxout;
1141 short PAD;
1142 void **rxp;
1143 int PAD;
1144 int PAD;
1145 int rxdpa;
1146 short rxdalign;
1147 short PAD;
1148 int PAD;
1149 int PAD;
1150 int PAD;
1151 int rxbufsize; /* rx buffer size in bytes, not including the extra headroom */
1152 int rxextrahdrroom; /* extra rx headroom. */
1153  
1154 } __attribute__((packed));
1155  
1156 struct intctrlregs {
1157 unsigned int intstatus;
1158 unsigned int intmask;
1159 };
1160  
1161 /* read: 32-bit register that can be read as 32-bit or as 2 16-bit
1162 * write: only low 16b-it half can be written
1163 */
1164 union pmqreg {
1165 unsigned int pmqhostdata; /* read only! */
1166 struct {
1167 unsigned short pmqctrlstatus; /* read/write */
1168 unsigned short PAD;
1169 } w;
1170 };
1171  
1172 /* dma registers per channel(xmt or rcv) */
1173 struct dma64regs {
1174 unsigned int control; /* enable, et al */
1175 unsigned int ptr; /* last descriptor posted to chip */
1176 unsigned int addrlow; /* desc ring base address low 32-bits (8K aligned) */
1177 unsigned int addrhigh; /* desc ring base address bits 63:32 (8K aligned) */
1178 unsigned int status0; /* current descriptor, xmt state */
1179 unsigned int status1; /* active descriptor, xmt error */
1180 };
1181  
1182 /* 4byte-wide pio register set per channel(xmt or rcv) */
1183 struct pio4regs {
1184 unsigned int fifocontrol;
1185 unsigned int fifodata;
1186 };
1187  
1188 struct fifo64 {
1189 struct dma64regs dmaxmt; /* dma tx */
1190 struct pio4regs piotx; /* pio tx */
1191 struct dma64regs dmarcv; /* dma rx */
1192 struct pio4regs piorx; /* pio rx */
1193 };
1194  
1195 struct dma32diag { /* diag access */
1196 unsigned int fifoaddr; /* diag address */
1197 unsigned int fifodatalow; /* low 32bits of data */
1198 unsigned int fifodatahigh; /* high 32bits of data */
1199 unsigned int pad; /* reserved */
1200 };
1201  
1202 /*
1203 * Host Interface Registers
1204 */
1205 struct d11regs {
1206 /* Device Control ("semi-standard host registers") */
1207 unsigned int PAD[3]; /* 0x0 - 0x8 */
1208 unsigned int biststatus; /* 0xC */
1209 unsigned int biststatus2; /* 0x10 */
1210 unsigned int PAD; /* 0x14 */
1211 unsigned int gptimer; /* 0x18 */
1212 unsigned int usectimer; /* 0x1c *//* for corerev >= 26 */
1213  
1214 /* Interrupt Control *//* 0x20 */
1215 struct intctrlregs intctrlregs[8];
1216  
1217 unsigned int PAD[40]; /* 0x60 - 0xFC */
1218  
1219 unsigned int intrcvlazy[4]; /* 0x100 - 0x10C */
1220  
1221 unsigned int PAD[4]; /* 0x110 - 0x11c */
1222  
1223 unsigned int maccontrol; /* 0x120 */
1224 unsigned int maccommand; /* 0x124 */
1225 unsigned int macintstatus; /* 0x128 */
1226 unsigned int macintmask; /* 0x12C */
1227  
1228 /* Transmit Template Access */
1229 unsigned int tplatewrptr; /* 0x130 */
1230 unsigned int tplatewrdata; /* 0x134 */
1231 unsigned int PAD[2]; /* 0x138 - 0x13C */
1232  
1233 /* PMQ registers */
1234 union pmqreg pmqreg; /* 0x140 */
1235 unsigned int pmqpatl; /* 0x144 */
1236 unsigned int pmqpath; /* 0x148 */
1237 unsigned int PAD; /* 0x14C */
1238  
1239 unsigned int chnstatus; /* 0x150 */
1240 unsigned int psmdebug; /* 0x154 */
1241 unsigned int phydebug; /* 0x158 */
1242 unsigned int machwcap; /* 0x15C */
1243  
1244 /* Extended Internal Objects */
1245 unsigned int objaddr; /* 0x160 */
1246 unsigned int objdata; /* 0x164 */
1247 unsigned int PAD[2]; /* 0x168 - 0x16c */
1248  
1249 unsigned int frmtxstatus; /* 0x170 */
1250 unsigned int frmtxstatus2; /* 0x174 */
1251 unsigned int PAD[2]; /* 0x178 - 0x17c */
1252  
1253 /* TSF host access */
1254 unsigned int tsf_timerlow; /* 0x180 */
1255 unsigned int tsf_timerhigh; /* 0x184 */
1256 unsigned int tsf_cfprep; /* 0x188 */
1257 unsigned int tsf_cfpstart; /* 0x18c */
1258 unsigned int tsf_cfpmaxdur32; /* 0x190 */
1259 unsigned int PAD[3]; /* 0x194 - 0x19c */
1260  
1261 unsigned int maccontrol1; /* 0x1a0 */
1262 unsigned int machwcap1; /* 0x1a4 */
1263 unsigned int PAD[14]; /* 0x1a8 - 0x1dc */
1264  
1265 /* Clock control and hardware workarounds*/
1266 unsigned int clk_ctl_st; /* 0x1e0 */
1267 unsigned int hw_war;
1268 unsigned int d11_phypllctl; /* the phypll request/avail bits are
1269 * moved to clk_ctl_st
1270 */
1271 unsigned int PAD[5]; /* 0x1ec - 0x1fc */
1272  
1273 /* 0x200-0x37F dma/pio registers */
1274 struct fifo64 fifo64regs[6];
1275  
1276 /* FIFO diagnostic port access */
1277 struct dma32diag dmafifo; /* 0x380 - 0x38C */
1278  
1279 unsigned int aggfifocnt; /* 0x390 */
1280 unsigned int aggfifodata; /* 0x394 */
1281 unsigned int PAD[16]; /* 0x398 - 0x3d4 */
1282 unsigned short radioregaddr; /* 0x3d8 */
1283 unsigned short radioregdata; /* 0x3da */
1284  
1285 /*
1286 * time delay between the change on rf disable input and
1287 * radio shutdown
1288 */
1289 unsigned int rfdisabledly; /* 0x3DC */
1290  
1291 /* PHY register access */
1292 unsigned short phyversion; /* 0x3e0 - 0x0 */
1293 unsigned short phybbconfig; /* 0x3e2 - 0x1 */
1294 unsigned short phyadcbias; /* 0x3e4 - 0x2 Bphy only */
1295 unsigned short phyanacore; /* 0x3e6 - 0x3 pwwrdwn on aphy */
1296 unsigned short phyrxstatus0; /* 0x3e8 - 0x4 */
1297 unsigned short phyrxstatus1; /* 0x3ea - 0x5 */
1298 unsigned short phycrsth; /* 0x3ec - 0x6 */
1299 unsigned short phytxerror; /* 0x3ee - 0x7 */
1300 unsigned short phychannel; /* 0x3f0 - 0x8 */
1301 unsigned short PAD[1]; /* 0x3f2 - 0x9 */
1302 unsigned short phytest; /* 0x3f4 - 0xa */
1303 unsigned short phy4waddr; /* 0x3f6 - 0xb */
1304 unsigned short phy4wdatahi; /* 0x3f8 - 0xc */
1305 unsigned short phy4wdatalo; /* 0x3fa - 0xd */
1306 unsigned short phyregaddr; /* 0x3fc - 0xe */
1307 unsigned short phyregdata; /* 0x3fe - 0xf */
1308  
1309 /* IHR *//* 0x400 - 0x7FE */
1310  
1311 /* RXE Block */
1312 unsigned short PAD; /* SPR_RXE_0x00 0x400 */
1313 unsigned short PAD; /* SPR_RXE_Copy_Offset 0x402 */
1314 unsigned short PAD; /* SPR_RXE_Copy_Length 0x404 */
1315 unsigned short rcv_fifo_ctl; /* SPR_RXE_FIFOCTL0 0x406 */
1316 unsigned short PAD; /* SPR_RXE_FIFOCTL1 0x408 */
1317 unsigned short rcv_frm_cnt; /* SPR_Received_Frame_Count 0x40a */
1318 unsigned short PAD; /* SPR_RXE_0x0c 0x40c */
1319 unsigned short PAD; /* SPR_RXE_RXHDR_OFFSET 0x40e */
1320 unsigned short PAD; /* SPR_RXE_RXHDR_LEN 0x410 */
1321 unsigned short PAD; /* SPR_RXE_PHYRXSTAT0 0x412 */
1322 unsigned short rssi; /* SPR_RXE_PHYRXSTAT1 0x414 */
1323 unsigned short PAD; /* SPR_RXE_0x16 0x416 */
1324 unsigned short PAD; /* SPR_RXE_FRAMELEN 0x418 */
1325 unsigned short PAD; /* SPR_RXE_0x1a 0x41a */
1326 unsigned short PAD; /* SPR_RXE_ENCODING 0x41c */
1327 unsigned short PAD; /* SPR_RXE_0x1e 0x41e */
1328 unsigned short rcm_ctl; /* SPR_RCM_Control 0x420 */
1329 unsigned short rcm_mat_data; /* SPR_RCM_Match_Data 0x422 */
1330 unsigned short rcm_mat_mask; /* SPR_RCM_Match_Mask 0x424 */
1331 unsigned short rcm_mat_dly; /* SPR_RCM_Match_Delay 0x426 */
1332 unsigned short rcm_cond_mask_l; /* SPR_RCM_Condition_Mask_Low 0x428 */
1333 unsigned short rcm_cond_mask_h; /* SPR_RCM_Condition_Mask_High 0x42A */
1334 unsigned short rcm_cond_dly; /* SPR_RCM_Condition_Delay 0x42C */
1335 unsigned short PAD; /* SPR_RXE_0x2e 0x42E */
1336 unsigned short ext_ihr_addr; /* SPR_Ext_IHR_Address 0x430 */
1337 unsigned short ext_ihr_data; /* SPR_Ext_IHR_Data 0x432 */
1338 unsigned short rxe_phyrs_2; /* SPR_RXE_PHYRXSTAT2 0x434 */
1339 unsigned short rxe_phyrs_3; /* SPR_RXE_PHYRXSTAT3 0x436 */
1340 unsigned short phy_mode; /* SPR_PHY_Mode 0x438 */
1341 unsigned short rcmta_ctl; /* SPR_RCM_TA_Control 0x43a */
1342 unsigned short rcmta_size; /* SPR_RCM_TA_Size 0x43c */
1343 unsigned short rcmta_addr0; /* SPR_RCM_TA_Address_0 0x43e */
1344 unsigned short rcmta_addr1; /* SPR_RCM_TA_Address_1 0x440 */
1345 unsigned short rcmta_addr2; /* SPR_RCM_TA_Address_2 0x442 */
1346 unsigned short PAD[30]; /* SPR_RXE_0x44 ... 0x7e 0x444 */
1347  
1348  
1349 /* PSM Block *//* 0x480 - 0x500 */
1350  
1351 unsigned short PAD; /* SPR_MAC_MAX_NAP 0x480 */
1352 unsigned short psm_maccontrol_h; /* SPR_MAC_CTLHI 0x482 */
1353 unsigned short psm_macintstatus_l; /* SPR_MAC_IRQLO 0x484 */
1354 unsigned short psm_macintstatus_h; /* SPR_MAC_IRQHI 0x486 */
1355 unsigned short psm_macintmask_l; /* SPR_MAC_IRQMASKLO 0x488 */
1356 unsigned short psm_macintmask_h; /* SPR_MAC_IRQMASKHI 0x48A */
1357 unsigned short psm_0x0c; /* SPR_PSM_0x0c 0x48C */
1358 unsigned short psm_maccommand; /* SPR_MAC_CMD 0x48E */
1359 unsigned short psm_brc; /* SPR_BRC 0x490 */
1360 unsigned short psm_phy_hdr_param; /* SPR_PHY_HDR_Parameter 0x492 */
1361 unsigned short psm_postcard; /* SPR_Postcard 0x494 */
1362 unsigned short psm_pcard_loc_l; /* SPR_Postcard_Location_Low 0x496 */
1363 unsigned short psm_pcard_loc_h; /* SPR_Postcard_Location_High 0x498 */
1364 unsigned short psm_gpio_in; /* SPR_GPIO_IN 0x49A */
1365 unsigned short psm_gpio_out; /* SPR_GPIO_OUT 0x49C */
1366 unsigned short psm_gpio_oe; /* SPR_GPIO_OUTEN 0x49E */
1367  
1368 unsigned short psm_bred_0; /* SPR_BRED0 0x4A0 */
1369 unsigned short psm_bred_1; /* SPR_BRED1 0x4A2 */
1370 unsigned short psm_bred_2; /* SPR_BRED2 0x4A4 */
1371 unsigned short psm_bred_3; /* SPR_BRED3 0x4A6 */
1372 unsigned short psm_brcl_0; /* SPR_BRCL0 0x4A8 */
1373 unsigned short psm_brcl_1; /* SPR_BRCL1 0x4AA */
1374 unsigned short psm_brcl_2; /* SPR_BRCL2 0x4AC */
1375 unsigned short psm_brcl_3; /* SPR_BRCL3 0x4AE */
1376 unsigned short psm_brpo_0; /* SPR_BRPO0 0x4B0 */
1377 unsigned short psm_brpo_1; /* SPR_BRPO1 0x4B2 */
1378 unsigned short psm_brpo_2; /* SPR_BRPO2 0x4B4 */
1379 unsigned short psm_brpo_3; /* SPR_BRPO3 0x4B6 */
1380 unsigned short psm_brwk_0; /* SPR_BRWK0 0x4B8 */
1381 unsigned short psm_brwk_1; /* SPR_BRWK1 0x4BA */
1382 unsigned short psm_brwk_2; /* SPR_BRWK2 0x4BC */
1383 unsigned short psm_brwk_3; /* SPR_BRWK3 0x4BE */
1384  
1385 unsigned short psm_base_0; /* SPR_BASE0 - Offset Register 0 0x4C0 */
1386 unsigned short psm_base_1; /* SPR_BASE1 - Offset Register 1 0x4C2 */
1387 unsigned short psm_base_2; /* SPR_BASE2 - Offset Register 2 0x4C4 */
1388 unsigned short psm_base_3; /* SPR_BASE3 - Offset Register 3 0x4C6 */
1389 unsigned short psm_base_4; /* SPR_BASE4 - Offset Register 4 0x4C8 */
1390 unsigned short psm_base_5; /* SPR_BASE5 - Offset Register 5 0x4CA */
1391 unsigned short psm_base_6; /* SPR_BASE6 - Do not use (broken) 0x4CC */
1392 unsigned short psm_ihr_err; /* SPR_PSM_0x4e 0x4CE */
1393 unsigned short psm_pc_reg_0; /* SPR_PC0 - Link Register 0 0x4D0 */
1394 unsigned short psm_pc_reg_1; /* SPR_PC1 - Link Register 1 0x4D2 */
1395 unsigned short psm_pc_reg_2; /* SPR_PC2 - Link Register 2 0x4D4 */
1396 unsigned short psm_pc_reg_3; /* SPR_PC2 - Link Register 6 0x4D6 */
1397 unsigned short psm_brc_1; /* SPR_PSM_COND - PSM external condition bits 0x4D8 */
1398 unsigned short PAD; /* SPR_PSM_0x5a ... 0x7e 0x4DA */
1399 unsigned short PAD; /* SPR_PSM_0x5c 0x4DC */
1400 unsigned short PAD; /* SPR_PSM_0x5e 0x4DE */
1401 unsigned short PAD; /* SPR_PSM_0x60 0x4E0 */
1402 unsigned short PAD; /* SPR_PSM_0x62 0x4E2 */
1403 unsigned short PAD; /* SPR_PSM_0x64 0x4E4 */
1404 unsigned short PAD; /* SPR_PSM_0x66 0x4E6 */
1405 unsigned short PAD; /* SPR_PSM_0x68 0x4E8 */
1406 unsigned short PAD; /* SPR_PSM_0x6a 0x4EA */
1407 unsigned short PAD; /* SPR_PSM_0x6c 0x4EC */
1408 unsigned short PAD; /* SPR_PSM_0x6e 0x4EE */
1409 unsigned short psm_corectlsts; /* SPR_PSM_0x70 0x4F0 *//* Corerev >= 13 */
1410 unsigned short PAD; /* SPR_PSM_0x72 0x4F2 */
1411 unsigned short PAD; /* SPR_PSM_0x74 0x4F4 */
1412 unsigned short PAD; /* SPR_PSM_0x76 0x4F6 */
1413 unsigned short PAD; /* SPR_PSM_0x78 0x4F8 */
1414 unsigned short PAD; /* SPR_PSM_0x7a 0x4FA */
1415 unsigned short PAD; /* SPR_PSM_0x7c 0x4FC */
1416 unsigned short PAD; /* SPR_PSM_0x7e 0x4FE */
1417  
1418 /* TXE0 Block *//* 0x500 - 0x580 */
1419 unsigned short txe_ctl; /* SPR_TXE0_CTL 0x500 */
1420 unsigned short txe_aux; /* SPR_TXE0_AUX 0x502 */
1421 unsigned short txe_ts_loc; /* SPR_TXE0_TS_LOC 0x504 */
1422 unsigned short txe_time_out; /* SPR_TXE0_TIMEOUT 0x506 */
1423 unsigned short txe_wm_0; /* SPR_TXE0_WM0 0x508 */
1424 unsigned short txe_wm_1; /* SPR_TXE0_WM1 0x50A */
1425 unsigned short txe_phyctl; /* SPR_TXE0_PHY_CTL 0x50C */
1426 unsigned short txe_status; /* SPR_TXE0_STATUS 0x50E */
1427 unsigned short txe_mmplcp0; /* SPR_TXE0_0x10 0x510 */
1428 unsigned short txe_mmplcp1; /* SPR_TXE0_0x12 0x512 */
1429 unsigned short txe_phyctl1; /* SPR_TXE0_0x14 0x514 */
1430  
1431 unsigned short PAD; /* SPR_TXE0_0x16 0x516 */
1432 unsigned short PAD; /* SPR_TX_STATUS0 0x518 */
1433 unsigned short PAD; /* SPR_TX_STATUS1 0x51a */
1434 unsigned short PAD; /* SPR_TX_STATUS2 0x51c */
1435 unsigned short PAD; /* SPR_TX_STATUS3 0x51e */
1436  
1437 /* Transmit control */
1438 unsigned short xmtfifodef; /* SPR_TXE0_FIFO_Def 0x520 */
1439 unsigned short xmtfifo_frame_cnt; /* SPR_TXE0_0x22 0x522 *//* Corerev >= 16 */
1440 unsigned short xmtfifo_byte_cnt; /* SPR_TXE0_0x24 0x524 *//* Corerev >= 16 */
1441 unsigned short xmtfifo_head; /* SPR_TXE0_0x26 0x526 *//* Corerev >= 16 */
1442 unsigned short xmtfifo_rd_ptr; /* SPR_TXE0_0x28 0x528 *//* Corerev >= 16 */
1443 unsigned short xmtfifo_wr_ptr; /* SPR_TXE0_0x2a 0x52A *//* Corerev >= 16 */
1444 unsigned short xmtfifodef1; /* SPR_TXE0_0x2c 0x52C *//* Corerev >= 16 */
1445  
1446 unsigned short PAD; /* SPR_TXE0_0x2e 0x52E */
1447 unsigned short PAD; /* SPR_TXE0_0x30 0x530 */
1448 unsigned short PAD; /* SPR_TXE0_0x32 0x532 */
1449 unsigned short PAD; /* SPR_TXE0_0x34 0x534 */
1450 unsigned short PAD; /* SPR_TXE0_0x36 0x536 */
1451 unsigned short PAD; /* SPR_TXE0_0x38 0x538 */
1452 unsigned short PAD; /* SPR_TXE0_0x3a 0x53A */
1453 unsigned short PAD; /* SPR_TXE0_0x3c 0x53C */
1454 unsigned short PAD; /* SPR_TXE0_0x3e 0x53E */
1455  
1456 unsigned short xmtfifocmd; /* SPR_TXE0_FIFO_CMD 0x540 */
1457 unsigned short xmtfifoflush; /* SPR_TXE0_FIFO_FLUSH 0x542 */
1458 unsigned short xmtfifothresh; /* SPR_TXE0_FIFO_THRES 0x544 */
1459 unsigned short xmtfifordy; /* SPR_TXE0_FIFO_RDY 0x546 */
1460 unsigned short xmtfifoprirdy; /* SPR_TXE0_FIFO_PRI_RDY 0x548 */
1461 unsigned short xmtfiforqpri; /* SPR_TXE0_FIFO_RQ_PRI 0x54A */
1462 unsigned short xmttplatetxptr; /* SPR_TXE0_Template_TX_Pointer 0x54C */
1463 unsigned short PAD; /* SPR_TXE0_0x4e 0x54E */
1464 unsigned short xmttplateptr; /* SPR_TXE0_Template_Pointer 0x550 */
1465 unsigned short smpl_clct_strptr; /* SPR_TXE0_0x52 0x552 *//* Corerev >= 22 */
1466 unsigned short smpl_clct_stpptr; /* SPR_TXE0_0x54 0x554 *//* Corerev >= 22 */
1467 unsigned short smpl_clct_curptr; /* SPR_TXE0_0x56 0x556 *//* Corerev >= 22 */
1468 unsigned short PAD; /* SPR_TXE0_0x58 0x558 */
1469 unsigned short PAD; /* SPR_TXE0_0x5a 0x55A */
1470 unsigned short PAD; /* SPR_TXE0_0x5c 0x55C */
1471 unsigned short PAD; /* SPR_TXE0_0x5e 0x55E */
1472 unsigned short xmttplatedatalo; /* SPR_TXE0_Template_Data_Low 0x560 */
1473 unsigned short xmttplatedatahi; /* SPR_TXE0_Template_Data_High 0x562 */
1474  
1475 unsigned short PAD; /* SPR_TXE0_0x64 0x564 */
1476 unsigned short PAD; /* SPR_TXE0_0x66 0x566 */
1477  
1478 unsigned short xmtsel; /* SPR_TXE0_SELECT 0x568 */
1479 unsigned short xmttxcnt; /* 0x56A */
1480 unsigned short xmttxshmaddr; /* 0x56C */
1481  
1482 unsigned short PAD[0x09]; /* 0x56E - 0x57E */
1483  
1484 /* TXE1 Block */
1485 unsigned short PAD[0x40]; /* 0x580 - 0x5FE */
1486  
1487 /* TSF Block */
1488 unsigned short PAD[0X02]; /* 0x600 - 0x602 */
1489 unsigned short tsf_cfpstrt_l; /* 0x604 */
1490 unsigned short tsf_cfpstrt_h; /* 0x606 */
1491 unsigned short PAD[0X05]; /* 0x608 - 0x610 */
1492 unsigned short tsf_cfppretbtt; /* 0x612 */
1493 unsigned short PAD[0XD]; /* 0x614 - 0x62C */
1494 unsigned short tsf_clk_frac_l; /* 0x62E */
1495 unsigned short tsf_clk_frac_h; /* 0x630 */
1496 unsigned short PAD[0X14]; /* 0x632 - 0x658 */
1497 unsigned short tsf_random; /* 0x65A */
1498 unsigned short PAD[0x05]; /* 0x65C - 0x664 */
1499 /* GPTimer 2 registers */
1500 unsigned short tsf_gpt2_stat; /* 0x666 */
1501 unsigned short tsf_gpt2_ctr_l; /* 0x668 */
1502 unsigned short tsf_gpt2_ctr_h; /* 0x66A */
1503 unsigned short tsf_gpt2_val_l; /* 0x66C */
1504 unsigned short tsf_gpt2_val_h; /* 0x66E */
1505 unsigned short tsf_gptall_stat; /* 0x670 */
1506 unsigned short PAD[0x07]; /* 0x672 - 0x67E */
1507  
1508 /* IFS Block */
1509 unsigned short ifs_sifs_rx_tx_tx; /* 0x680 */
1510 unsigned short ifs_sifs_nav_tx; /* 0x682 */
1511 unsigned short ifs_slot; /* 0x684 */
1512 unsigned short PAD; /* 0x686 */
1513 unsigned short ifs_ctl; /* 0x688 */
1514 unsigned short PAD[0x3]; /* 0x68a - 0x68F */
1515 unsigned short ifsstat; /* 0x690 */
1516 unsigned short ifsmedbusyctl; /* 0x692 */
1517 unsigned short iftxdur; /* 0x694 */
1518 unsigned short PAD[0x3]; /* 0x696 - 0x69b */
1519 /* EDCF support in dot11macs */
1520 unsigned short ifs_aifsn; /* 0x69c */
1521 unsigned short ifs_ctl1; /* 0x69e */
1522  
1523 /* slow clock registers */
1524 unsigned short scc_ctl; /* 0x6a0 */
1525 unsigned short scc_timer_l; /* 0x6a2 */
1526 unsigned short scc_timer_h; /* 0x6a4 */
1527 unsigned short scc_frac; /* 0x6a6 */
1528 unsigned short scc_fastpwrup_dly; /* 0x6a8 */
1529 unsigned short scc_per; /* 0x6aa */
1530 unsigned short scc_per_frac; /* 0x6ac */
1531 unsigned short scc_cal_timer_l; /* 0x6ae */
1532 unsigned short scc_cal_timer_h; /* 0x6b0 */
1533 unsigned short PAD; /* 0x6b2 */
1534  
1535 unsigned short PAD[0x26];
1536  
1537 /* NAV Block */
1538 unsigned short nav_ctl; /* 0x700 */
1539 unsigned short navstat; /* 0x702 */
1540 unsigned short PAD[0x3e]; /* 0x702 - 0x77E */
1541  
1542 /* WEP/PMQ Block *//* 0x780 - 0x7FE */
1543 unsigned short PAD[0x20]; /* 0x780 - 0x7BE */
1544  
1545 unsigned short wepctl; /* 0x7C0 */
1546 unsigned short wepivloc; /* 0x7C2 */
1547 unsigned short wepivkey; /* 0x7C4 */
1548 unsigned short wepwkey; /* 0x7C6 */
1549  
1550 unsigned short PAD[4]; /* 0x7C8 - 0x7CE */
1551 unsigned short pcmctl; /* 0X7D0 */
1552 unsigned short pcmstat; /* 0X7D2 */
1553 unsigned short PAD[6]; /* 0x7D4 - 0x7DE */
1554  
1555 unsigned short pmqctl; /* 0x7E0 */
1556 unsigned short pmqstatus; /* 0x7E2 */
1557 unsigned short pmqpat0; /* 0x7E4 */
1558 unsigned short pmqpat1; /* 0x7E6 */
1559 unsigned short pmqpat2; /* 0x7E8 */
1560  
1561 unsigned short pmqdat; /* 0x7EA */
1562 unsigned short pmqdator; /* 0x7EC */
1563 unsigned short pmqhst; /* 0x7EE */
1564 unsigned short pmqpath0; /* 0x7F0 */
1565 unsigned short pmqpath1; /* 0x7F2 */
1566 unsigned short pmqpath2; /* 0x7F4 */
1567 unsigned short pmqdath; /* 0x7F6 */
1568  
1569 unsigned short PAD[0x04]; /* 0x7F8 - 0x7FE */
1570  
1571 /* SHM *//* 0x800 - 0xEFE */
1572 unsigned short PAD[0x380]; /* 0x800 - 0xEFE */
1573 } __attribute__((packed));
1574  
1575 typedef void (*to_fun_t)(void *arg);
1576  
1577 typedef struct _ctimeout {
1578 struct _ctimeout *next;
1579 uint32 ms;
1580 to_fun_t fun;
1581 void *arg;
1582 bool expired;
1583 } ctimeout_t;
1584  
1585 struct hndrte_timer
1586 {
1587 uint32 *context; /* first field so address of context is timer struct ptr */
1588 void *data;
1589 void (*mainfn)(struct hndrte_timer *);
1590 void (*auxfn)(void *context);
1591 ctimeout_t t;
1592 int interval;
1593 int set;
1594 int periodic;
1595 bool _freedone;
1596 } __attribute__((packed));
1597  
1598 /*== maccontrol register ==*/
1599 #define MCTL_GMODE (1U << 31)
1600 #define MCTL_DISCARD_PMQ (1 << 30)
1601 #define MCTL_WAKE (1 << 26)
1602 #define MCTL_HPS (1 << 25)
1603 #define MCTL_PROMISC (1 << 24)
1604 #define MCTL_KEEPBADFCS (1 << 23)
1605 #define MCTL_KEEPCONTROL (1 << 22)
1606 #define MCTL_PHYLOCK (1 << 21)
1607 #define MCTL_BCNS_PROMISC (1 << 20)
1608 #define MCTL_LOCK_RADIO (1 << 19)
1609 #define MCTL_AP (1 << 18)
1610 #define MCTL_INFRA (1 << 17)
1611 #define MCTL_BIGEND (1 << 16)
1612 #define MCTL_GPOUT_SEL_MASK (3 << 14)
1613 #define MCTL_GPOUT_SEL_SHIFT 14
1614 #define MCTL_EN_PSMDBG (1 << 13)
1615 #define MCTL_IHR_EN (1 << 10)
1616 #define MCTL_SHM_UPPER (1 << 9)
1617 #define MCTL_SHM_EN (1 << 8)
1618 #define MCTL_PSM_JMP_0 (1 << 2)
1619 #define MCTL_PSM_RUN (1 << 1)
1620 #define MCTL_EN_MAC (1 << 0)
1621  
1622 struct ethernet_header {
1623 uint8 dst[6];
1624 uint8 src[6];
1625 uint16 type;
1626 } __attribute__((packed));
1627  
1628 struct ipv6_header {
1629 uint32 version_traffic_class_flow_label;
1630 uint16 payload_length;
1631 uint8 next_header;
1632 uint8 hop_limit;
1633 uint8 src_ip[16];
1634 uint8 dst_ip[16];
1635 } __attribute__((packed));
1636  
1637 struct ip_header {
1638 uint8 version_ihl;
1639 uint8 dscp_ecn;
1640 uint16 total_length;
1641 uint16 identification;
1642 uint16 flags_fragment_offset;
1643 uint8 ttl;
1644 uint8 protocol;
1645 uint16 header_checksum;
1646 union {
1647 uint32 integer;
1648 uint8 array[4];
1649 } src_ip;
1650 union {
1651 uint32 integer;
1652 uint8 array[4];
1653 } dst_ip;
1654 } __attribute__((packed));
1655  
1656 struct udp_header {
1657 uint16 src_port;
1658 uint16 dst_port;
1659 union {
1660 uint16 length; /* UDP: length of UDP header and payload */
1661 uint16 checksum_coverage; /* UDPLITE: checksum_coverage */
1662 } len_chk_cov;
1663 uint16 checksum;
1664 } __attribute__((packed));
1665  
1666 struct ethernet_ip_udp_header {
1667 struct ethernet_header ethernet;
1668 struct ip_header ip;
1669 struct udp_header udp;
1670 } __attribute__((packed));
1671  
1672 struct ethernet_ipv6_udp_header {
1673 struct ethernet_header ethernet;
1674 struct ipv6_header ipv6;
1675 struct udp_header udp;
1676 uint8 payload[1];
1677 } __attribute__((packed));
1678  
1679 struct nexmon_header {
1680 uint32 hooked_fct;
1681 uint32 args[3];
1682 uint8 payload[1];
1683 } __attribute__((packed));
1684