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