aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/bcm4329/include
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/bcm4329/include')
-rw-r--r--drivers/net/wireless/bcm4329/include/Makefile21
-rw-r--r--drivers/net/wireless/bcm4329/include/aidmp.h368
-rw-r--r--drivers/net/wireless/bcm4329/include/bcmcdc.h100
-rw-r--r--drivers/net/wireless/bcm4329/include/bcmdefs.h114
-rw-r--r--drivers/net/wireless/bcm4329/include/bcmdevs.h124
-rw-r--r--drivers/net/wireless/bcm4329/include/bcmendian.h205
-rw-r--r--drivers/net/wireless/bcm4329/include/bcmpcispi.h205
-rw-r--r--drivers/net/wireless/bcm4329/include/bcmperf.h36
-rw-r--r--drivers/net/wireless/bcm4329/include/bcmsdbus.h117
-rw-r--r--drivers/net/wireless/bcm4329/include/bcmsdh.h208
-rw-r--r--drivers/net/wireless/bcm4329/include/bcmsdh_sdmmc.h122
-rw-r--r--drivers/net/wireless/bcm4329/include/bcmsdpcm.h263
-rw-r--r--drivers/net/wireless/bcm4329/include/bcmsdspi.h131
-rw-r--r--drivers/net/wireless/bcm4329/include/bcmsdstd.h223
-rw-r--r--drivers/net/wireless/bcm4329/include/bcmspi.h36
-rw-r--r--drivers/net/wireless/bcm4329/include/bcmspibrcm.h134
-rw-r--r--drivers/net/wireless/bcm4329/include/bcmutils.h637
-rw-r--r--drivers/net/wireless/bcm4329/include/bcmwifi.h154
-rw-r--r--drivers/net/wireless/bcm4329/include/dhdioctl.h123
-rw-r--r--drivers/net/wireless/bcm4329/include/epivers.h48
-rw-r--r--drivers/net/wireless/bcm4329/include/hndpmu.h34
-rw-r--r--drivers/net/wireless/bcm4329/include/hndrte_armtrap.h88
-rw-r--r--drivers/net/wireless/bcm4329/include/hndrte_cons.h63
-rw-r--r--drivers/net/wireless/bcm4329/include/hndsoc.h195
-rw-r--r--drivers/net/wireless/bcm4329/include/linux_osl.h322
-rw-r--r--drivers/net/wireless/bcm4329/include/linuxver.h447
-rw-r--r--drivers/net/wireless/bcm4329/include/miniopt.h77
-rw-r--r--drivers/net/wireless/bcm4329/include/msgtrace.h72
-rw-r--r--drivers/net/wireless/bcm4329/include/osl.h55
-rw-r--r--drivers/net/wireless/bcm4329/include/packed_section_end.h54
-rw-r--r--drivers/net/wireless/bcm4329/include/packed_section_start.h61
-rw-r--r--drivers/net/wireless/bcm4329/include/pcicfg.h52
-rw-r--r--drivers/net/wireless/bcm4329/include/proto/802.11.h1433
-rw-r--r--drivers/net/wireless/bcm4329/include/proto/802.11e.h131
-rw-r--r--drivers/net/wireless/bcm4329/include/proto/802.1d.h49
-rw-r--r--drivers/net/wireless/bcm4329/include/proto/bcmeth.h83
-rw-r--r--drivers/net/wireless/bcm4329/include/proto/bcmevent.h212
-rw-r--r--drivers/net/wireless/bcm4329/include/proto/bcmip.h157
-rw-r--r--drivers/net/wireless/bcm4329/include/proto/eapol.h172
-rw-r--r--drivers/net/wireless/bcm4329/include/proto/ethernet.h148
-rw-r--r--drivers/net/wireless/bcm4329/include/proto/sdspi.h71
-rw-r--r--drivers/net/wireless/bcm4329/include/proto/vlan.h63
-rw-r--r--drivers/net/wireless/bcm4329/include/proto/wpa.h159
-rw-r--r--drivers/net/wireless/bcm4329/include/sbchipc.h1026
-rw-r--r--drivers/net/wireless/bcm4329/include/sbconfig.h276
-rw-r--r--drivers/net/wireless/bcm4329/include/sbhnddma.h294
-rw-r--r--drivers/net/wireless/bcm4329/include/sbpcmcia.h109
-rw-r--r--drivers/net/wireless/bcm4329/include/sbsdio.h166
-rw-r--r--drivers/net/wireless/bcm4329/include/sbsdpcmdev.h288
-rw-r--r--drivers/net/wireless/bcm4329/include/sbsocram.h150
-rw-r--r--drivers/net/wireless/bcm4329/include/sdio.h566
-rw-r--r--drivers/net/wireless/bcm4329/include/sdioh.h299
-rw-r--r--drivers/net/wireless/bcm4329/include/sdiovar.h58
-rw-r--r--drivers/net/wireless/bcm4329/include/siutils.h235
-rw-r--r--drivers/net/wireless/bcm4329/include/spid.h153
-rw-r--r--drivers/net/wireless/bcm4329/include/trxhdr.h46
-rw-r--r--drivers/net/wireless/bcm4329/include/typedefs.h303
-rw-r--r--drivers/net/wireless/bcm4329/include/wlioctl.h1673
58 files changed, 13209 insertions, 0 deletions
diff --git a/drivers/net/wireless/bcm4329/include/Makefile b/drivers/net/wireless/bcm4329/include/Makefile
new file mode 100644
index 00000000000..439ead14a0e
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/Makefile
@@ -0,0 +1,21 @@
1#
2# include/Makefile
3#
4# Copyright 2005, Broadcom, Inc.
5#
6# $Id: Makefile,v 13.5 2005/02/17 19:11:31 Exp $
7#
8
9SRCBASE = ..
10
11TARGETS = epivers.h
12
13
14all release:
15 bash epivers.sh
16
17clean:
18 rm -rf ${TARGETS} *.prev
19
20
21.PHONY: all release clean
diff --git a/drivers/net/wireless/bcm4329/include/aidmp.h b/drivers/net/wireless/bcm4329/include/aidmp.h
new file mode 100644
index 00000000000..a927e5dae58
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/aidmp.h
@@ -0,0 +1,368 @@
1/*
2 * Broadcom AMBA Interconnect definitions.
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: aidmp.h,v 13.2.10.1 2008/05/07 20:32:12 Exp $
25 */
26
27
28#ifndef _AIDMP_H
29#define _AIDMP_H
30
31
32#define MFGID_ARM 0x43b
33#define MFGID_BRCM 0x4bf
34#define MFGID_MIPS 0x4a7
35
36
37#define CC_SIM 0
38#define CC_EROM 1
39#define CC_CORESIGHT 9
40#define CC_VERIF 0xb
41#define CC_OPTIMO 0xd
42#define CC_GEN 0xe
43#define CC_PRIMECELL 0xf
44
45
46#define ER_EROMENTRY 0x000
47#define ER_REMAPCONTROL 0xe00
48#define ER_REMAPSELECT 0xe04
49#define ER_MASTERSELECT 0xe10
50#define ER_ITCR 0xf00
51#define ER_ITIP 0xf04
52
53
54#define ER_TAG 0xe
55#define ER_TAG1 0x6
56#define ER_VALID 1
57#define ER_CI 0
58#define ER_MP 2
59#define ER_ADD 4
60#define ER_END 0xe
61#define ER_BAD 0xffffffff
62
63
64#define CIA_MFG_MASK 0xfff00000
65#define CIA_MFG_SHIFT 20
66#define CIA_CID_MASK 0x000fff00
67#define CIA_CID_SHIFT 8
68#define CIA_CCL_MASK 0x000000f0
69#define CIA_CCL_SHIFT 4
70
71
72#define CIB_REV_MASK 0xff000000
73#define CIB_REV_SHIFT 24
74#define CIB_NSW_MASK 0x00f80000
75#define CIB_NSW_SHIFT 19
76#define CIB_NMW_MASK 0x0007c000
77#define CIB_NMW_SHIFT 14
78#define CIB_NSP_MASK 0x00003e00
79#define CIB_NSP_SHIFT 9
80#define CIB_NMP_MASK 0x000001f0
81#define CIB_NMP_SHIFT 4
82
83
84#define MPD_MUI_MASK 0x0000ff00
85#define MPD_MUI_SHIFT 8
86#define MPD_MP_MASK 0x000000f0
87#define MPD_MP_SHIFT 4
88
89
90#define AD_ADDR_MASK 0xfffff000
91#define AD_SP_MASK 0x00000f00
92#define AD_SP_SHIFT 8
93#define AD_ST_MASK 0x000000c0
94#define AD_ST_SHIFT 6
95#define AD_ST_SLAVE 0x00000000
96#define AD_ST_BRIDGE 0x00000040
97#define AD_ST_SWRAP 0x00000080
98#define AD_ST_MWRAP 0x000000c0
99#define AD_SZ_MASK 0x00000030
100#define AD_SZ_SHIFT 4
101#define AD_SZ_4K 0x00000000
102#define AD_SZ_8K 0x00000010
103#define AD_SZ_16K 0x00000020
104#define AD_SZ_SZD 0x00000030
105#define AD_AG32 0x00000008
106#define AD_ADDR_ALIGN 0x00000fff
107#define AD_SZ_BASE 0x00001000
108
109
110#define SD_SZ_MASK 0xfffff000
111#define SD_SG32 0x00000008
112#define SD_SZ_ALIGN 0x00000fff
113
114
115#ifndef _LANGUAGE_ASSEMBLY
116
117typedef volatile struct _aidmp {
118 uint32 oobselina30;
119 uint32 oobselina74;
120 uint32 PAD[6];
121 uint32 oobselinb30;
122 uint32 oobselinb74;
123 uint32 PAD[6];
124 uint32 oobselinc30;
125 uint32 oobselinc74;
126 uint32 PAD[6];
127 uint32 oobselind30;
128 uint32 oobselind74;
129 uint32 PAD[38];
130 uint32 oobselouta30;
131 uint32 oobselouta74;
132 uint32 PAD[6];
133 uint32 oobseloutb30;
134 uint32 oobseloutb74;
135 uint32 PAD[6];
136 uint32 oobseloutc30;
137 uint32 oobseloutc74;
138 uint32 PAD[6];
139 uint32 oobseloutd30;
140 uint32 oobseloutd74;
141 uint32 PAD[38];
142 uint32 oobsynca;
143 uint32 oobseloutaen;
144 uint32 PAD[6];
145 uint32 oobsyncb;
146 uint32 oobseloutben;
147 uint32 PAD[6];
148 uint32 oobsyncc;
149 uint32 oobseloutcen;
150 uint32 PAD[6];
151 uint32 oobsyncd;
152 uint32 oobseloutden;
153 uint32 PAD[38];
154 uint32 oobaextwidth;
155 uint32 oobainwidth;
156 uint32 oobaoutwidth;
157 uint32 PAD[5];
158 uint32 oobbextwidth;
159 uint32 oobbinwidth;
160 uint32 oobboutwidth;
161 uint32 PAD[5];
162 uint32 oobcextwidth;
163 uint32 oobcinwidth;
164 uint32 oobcoutwidth;
165 uint32 PAD[5];
166 uint32 oobdextwidth;
167 uint32 oobdinwidth;
168 uint32 oobdoutwidth;
169 uint32 PAD[37];
170 uint32 ioctrlset;
171 uint32 ioctrlclear;
172 uint32 ioctrl;
173 uint32 PAD[61];
174 uint32 iostatus;
175 uint32 PAD[127];
176 uint32 ioctrlwidth;
177 uint32 iostatuswidth;
178 uint32 PAD[62];
179 uint32 resetctrl;
180 uint32 resetstatus;
181 uint32 resetreadid;
182 uint32 resetwriteid;
183 uint32 PAD[60];
184 uint32 errlogctrl;
185 uint32 errlogdone;
186 uint32 errlogstatus;
187 uint32 errlogaddrlo;
188 uint32 errlogaddrhi;
189 uint32 errlogid;
190 uint32 errloguser;
191 uint32 errlogflags;
192 uint32 PAD[56];
193 uint32 intstatus;
194 uint32 PAD[127];
195 uint32 config;
196 uint32 PAD[63];
197 uint32 itcr;
198 uint32 PAD[3];
199 uint32 itipooba;
200 uint32 itipoobb;
201 uint32 itipoobc;
202 uint32 itipoobd;
203 uint32 PAD[4];
204 uint32 itipoobaout;
205 uint32 itipoobbout;
206 uint32 itipoobcout;
207 uint32 itipoobdout;
208 uint32 PAD[4];
209 uint32 itopooba;
210 uint32 itopoobb;
211 uint32 itopoobc;
212 uint32 itopoobd;
213 uint32 PAD[4];
214 uint32 itopoobain;
215 uint32 itopoobbin;
216 uint32 itopoobcin;
217 uint32 itopoobdin;
218 uint32 PAD[4];
219 uint32 itopreset;
220 uint32 PAD[15];
221 uint32 peripherialid4;
222 uint32 peripherialid5;
223 uint32 peripherialid6;
224 uint32 peripherialid7;
225 uint32 peripherialid0;
226 uint32 peripherialid1;
227 uint32 peripherialid2;
228 uint32 peripherialid3;
229 uint32 componentid0;
230 uint32 componentid1;
231 uint32 componentid2;
232 uint32 componentid3;
233} aidmp_t;
234
235#endif
236
237
238#define OOB_BUSCONFIG 0x020
239#define OOB_STATUSA 0x100
240#define OOB_STATUSB 0x104
241#define OOB_STATUSC 0x108
242#define OOB_STATUSD 0x10c
243#define OOB_ENABLEA0 0x200
244#define OOB_ENABLEA1 0x204
245#define OOB_ENABLEA2 0x208
246#define OOB_ENABLEA3 0x20c
247#define OOB_ENABLEB0 0x280
248#define OOB_ENABLEB1 0x284
249#define OOB_ENABLEB2 0x288
250#define OOB_ENABLEB3 0x28c
251#define OOB_ENABLEC0 0x300
252#define OOB_ENABLEC1 0x304
253#define OOB_ENABLEC2 0x308
254#define OOB_ENABLEC3 0x30c
255#define OOB_ENABLED0 0x380
256#define OOB_ENABLED1 0x384
257#define OOB_ENABLED2 0x388
258#define OOB_ENABLED3 0x38c
259#define OOB_ITCR 0xf00
260#define OOB_ITIPOOBA 0xf10
261#define OOB_ITIPOOBB 0xf14
262#define OOB_ITIPOOBC 0xf18
263#define OOB_ITIPOOBD 0xf1c
264#define OOB_ITOPOOBA 0xf30
265#define OOB_ITOPOOBB 0xf34
266#define OOB_ITOPOOBC 0xf38
267#define OOB_ITOPOOBD 0xf3c
268
269
270#define AI_OOBSELINA30 0x000
271#define AI_OOBSELINA74 0x004
272#define AI_OOBSELINB30 0x020
273#define AI_OOBSELINB74 0x024
274#define AI_OOBSELINC30 0x040
275#define AI_OOBSELINC74 0x044
276#define AI_OOBSELIND30 0x060
277#define AI_OOBSELIND74 0x064
278#define AI_OOBSELOUTA30 0x100
279#define AI_OOBSELOUTA74 0x104
280#define AI_OOBSELOUTB30 0x120
281#define AI_OOBSELOUTB74 0x124
282#define AI_OOBSELOUTC30 0x140
283#define AI_OOBSELOUTC74 0x144
284#define AI_OOBSELOUTD30 0x160
285#define AI_OOBSELOUTD74 0x164
286#define AI_OOBSYNCA 0x200
287#define AI_OOBSELOUTAEN 0x204
288#define AI_OOBSYNCB 0x220
289#define AI_OOBSELOUTBEN 0x224
290#define AI_OOBSYNCC 0x240
291#define AI_OOBSELOUTCEN 0x244
292#define AI_OOBSYNCD 0x260
293#define AI_OOBSELOUTDEN 0x264
294#define AI_OOBAEXTWIDTH 0x300
295#define AI_OOBAINWIDTH 0x304
296#define AI_OOBAOUTWIDTH 0x308
297#define AI_OOBBEXTWIDTH 0x320
298#define AI_OOBBINWIDTH 0x324
299#define AI_OOBBOUTWIDTH 0x328
300#define AI_OOBCEXTWIDTH 0x340
301#define AI_OOBCINWIDTH 0x344
302#define AI_OOBCOUTWIDTH 0x348
303#define AI_OOBDEXTWIDTH 0x360
304#define AI_OOBDINWIDTH 0x364
305#define AI_OOBDOUTWIDTH 0x368
306#define AI_IOCTRLSET 0x400
307#define AI_IOCTRLCLEAR 0x404
308#define AI_IOCTRL 0x408
309#define AI_IOSTATUS 0x500
310#define AI_IOCTRLWIDTH 0x700
311#define AI_IOSTATUSWIDTH 0x704
312#define AI_RESETCTRL 0x800
313#define AI_RESETSTATUS 0x804
314#define AI_RESETREADID 0x808
315#define AI_RESETWRITEID 0x80c
316#define AI_ERRLOGCTRL 0xa00
317#define AI_ERRLOGDONE 0xa04
318#define AI_ERRLOGSTATUS 0xa08
319#define AI_ERRLOGADDRLO 0xa0c
320#define AI_ERRLOGADDRHI 0xa10
321#define AI_ERRLOGID 0xa14
322#define AI_ERRLOGUSER 0xa18
323#define AI_ERRLOGFLAGS 0xa1c
324#define AI_INTSTATUS 0xa00
325#define AI_CONFIG 0xe00
326#define AI_ITCR 0xf00
327#define AI_ITIPOOBA 0xf10
328#define AI_ITIPOOBB 0xf14
329#define AI_ITIPOOBC 0xf18
330#define AI_ITIPOOBD 0xf1c
331#define AI_ITIPOOBAOUT 0xf30
332#define AI_ITIPOOBBOUT 0xf34
333#define AI_ITIPOOBCOUT 0xf38
334#define AI_ITIPOOBDOUT 0xf3c
335#define AI_ITOPOOBA 0xf50
336#define AI_ITOPOOBB 0xf54
337#define AI_ITOPOOBC 0xf58
338#define AI_ITOPOOBD 0xf5c
339#define AI_ITOPOOBAIN 0xf70
340#define AI_ITOPOOBBIN 0xf74
341#define AI_ITOPOOBCIN 0xf78
342#define AI_ITOPOOBDIN 0xf7c
343#define AI_ITOPRESET 0xf90
344#define AI_PERIPHERIALID4 0xfd0
345#define AI_PERIPHERIALID5 0xfd4
346#define AI_PERIPHERIALID6 0xfd8
347#define AI_PERIPHERIALID7 0xfdc
348#define AI_PERIPHERIALID0 0xfe0
349#define AI_PERIPHERIALID1 0xfe4
350#define AI_PERIPHERIALID2 0xfe8
351#define AI_PERIPHERIALID3 0xfec
352#define AI_COMPONENTID0 0xff0
353#define AI_COMPONENTID1 0xff4
354#define AI_COMPONENTID2 0xff8
355#define AI_COMPONENTID3 0xffc
356
357
358#define AIRC_RESET 1
359
360
361#define AICFG_OOB 0x00000020
362#define AICFG_IOS 0x00000010
363#define AICFG_IOC 0x00000008
364#define AICFG_TO 0x00000004
365#define AICFG_ERRL 0x00000002
366#define AICFG_RST 0x00000001
367
368#endif
diff --git a/drivers/net/wireless/bcm4329/include/bcmcdc.h b/drivers/net/wireless/bcm4329/include/bcmcdc.h
new file mode 100644
index 00000000000..c2a860beab2
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/bcmcdc.h
@@ -0,0 +1,100 @@
1/*
2 * CDC network driver ioctl/indication encoding
3 * Broadcom 802.11abg Networking Device Driver
4 *
5 * Definitions subject to change without notice.
6 *
7 * Copyright (C) 1999-2010, Broadcom Corporation
8 *
9 * Unless you and Broadcom execute a separate written software license
10 * agreement governing use of this software, this software is licensed to you
11 * under the terms of the GNU General Public License version 2 (the "GPL"),
12 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
13 * following added to such license:
14 *
15 * As a special exception, the copyright holders of this software give you
16 * permission to link this software with independent modules, and to copy and
17 * distribute the resulting executable under terms of your choice, provided that
18 * you also meet, for each linked independent module, the terms and conditions of
19 * the license of that module. An independent module is a module which is not
20 * derived from this software. The special exception does not apply to any
21 * modifications of the software.
22 *
23 * Notwithstanding the above, under no circumstances may you combine this
24 * software in any way with any other Broadcom software provided under a license
25 * other than the GPL, without Broadcom's express prior written consent.
26 *
27 * $Id: bcmcdc.h,v 13.14.16.3.16.4 2009/04/12 16:58:45 Exp $
28 */
29#include <proto/ethernet.h>
30
31typedef struct cdc_ioctl {
32 uint32 cmd; /* ioctl command value */
33 uint32 len; /* lower 16: output buflen; upper 16: input buflen (excludes header) */
34 uint32 flags; /* flag defns given below */
35 uint32 status; /* status code returned from the device */
36} cdc_ioctl_t;
37
38/* Max valid buffer size that can be sent to the dongle */
39#define CDC_MAX_MSG_SIZE ETHER_MAX_LEN
40
41/* len field is divided into input and output buffer lengths */
42#define CDCL_IOC_OUTLEN_MASK 0x0000FFFF /* maximum or expected response length, */
43 /* excluding IOCTL header */
44#define CDCL_IOC_OUTLEN_SHIFT 0
45#define CDCL_IOC_INLEN_MASK 0xFFFF0000 /* input buffer length, excluding IOCTL header */
46#define CDCL_IOC_INLEN_SHIFT 16
47
48/* CDC flag definitions */
49#define CDCF_IOC_ERROR 0x01 /* 0=success, 1=ioctl cmd failed */
50#define CDCF_IOC_SET 0x02 /* 0=get, 1=set cmd */
51#define CDCF_IOC_IF_MASK 0xF000 /* I/F index */
52#define CDCF_IOC_IF_SHIFT 12
53#define CDCF_IOC_ID_MASK 0xFFFF0000 /* used to uniquely id an ioctl req/resp pairing */
54#define CDCF_IOC_ID_SHIFT 16 /* # of bits of shift for ID Mask */
55
56#define CDC_IOC_IF_IDX(flags) (((flags) & CDCF_IOC_IF_MASK) >> CDCF_IOC_IF_SHIFT)
57#define CDC_IOC_ID(flags) (((flags) & CDCF_IOC_ID_MASK) >> CDCF_IOC_ID_SHIFT)
58
59#define CDC_GET_IF_IDX(hdr) \
60 ((int)((((hdr)->flags) & CDCF_IOC_IF_MASK) >> CDCF_IOC_IF_SHIFT))
61#define CDC_SET_IF_IDX(hdr, idx) \
62 ((hdr)->flags = (((hdr)->flags & ~CDCF_IOC_IF_MASK) | ((idx) << CDCF_IOC_IF_SHIFT)))
63
64/*
65 * BDC header
66 *
67 * The BDC header is used on data packets to convey priority across USB.
68 */
69
70#define BDC_HEADER_LEN 4
71
72#define BDC_PROTO_VER 1 /* Protocol version */
73
74#define BDC_FLAG_VER_MASK 0xf0 /* Protocol version mask */
75#define BDC_FLAG_VER_SHIFT 4 /* Protocol version shift */
76
77#define BDC_FLAG__UNUSED 0x03 /* Unassigned */
78#define BDC_FLAG_SUM_GOOD 0x04 /* Dongle has verified good RX checksums */
79#define BDC_FLAG_SUM_NEEDED 0x08 /* Dongle needs to do TX checksums */
80
81#define BDC_PRIORITY_MASK 0x7
82
83#define BDC_FLAG2_FC_FLAG 0x10 /* flag to indicate if pkt contains */
84 /* FLOW CONTROL info only */
85#define BDC_PRIORITY_FC_SHIFT 4 /* flow control info shift */
86
87#define BDC_FLAG2_IF_MASK 0x0f /* APSTA: interface on which the packet was received */
88#define BDC_FLAG2_IF_SHIFT 0
89
90#define BDC_GET_IF_IDX(hdr) \
91 ((int)((((hdr)->flags2) & BDC_FLAG2_IF_MASK) >> BDC_FLAG2_IF_SHIFT))
92#define BDC_SET_IF_IDX(hdr, idx) \
93 ((hdr)->flags2 = (((hdr)->flags2 & ~BDC_FLAG2_IF_MASK) | ((idx) << BDC_FLAG2_IF_SHIFT)))
94
95struct bdc_header {
96 uint8 flags; /* Flags */
97 uint8 priority; /* 802.1d Priority 0:2 bits, 4:7 flow control info for usb */
98 uint8 flags2;
99 uint8 rssi;
100};
diff --git a/drivers/net/wireless/bcm4329/include/bcmdefs.h b/drivers/net/wireless/bcm4329/include/bcmdefs.h
new file mode 100644
index 00000000000..f4e99461971
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/bcmdefs.h
@@ -0,0 +1,114 @@
1/*
2 * Misc system wide definitions
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 * $Id: bcmdefs.h,v 13.38.4.10.2.7.6.11 2010/02/01 05:51:55 Exp $
24 */
25
26
27#ifndef _bcmdefs_h_
28#define _bcmdefs_h_
29
30#define STATIC static
31
32#define SI_BUS 0
33#define PCI_BUS 1
34#define PCMCIA_BUS 2
35#define SDIO_BUS 3
36#define JTAG_BUS 4
37#define USB_BUS 5
38#define SPI_BUS 6
39
40
41#ifdef BCMBUSTYPE
42#define BUSTYPE(bus) (BCMBUSTYPE)
43#else
44#define BUSTYPE(bus) (bus)
45#endif
46
47
48#ifdef BCMCHIPTYPE
49#define CHIPTYPE(bus) (BCMCHIPTYPE)
50#else
51#define CHIPTYPE(bus) (bus)
52#endif
53
54
55
56#if defined(BCMSPROMBUS)
57#define SPROMBUS (BCMSPROMBUS)
58#elif defined(SI_PCMCIA_SROM)
59#define SPROMBUS (PCMCIA_BUS)
60#else
61#define SPROMBUS (PCI_BUS)
62#endif
63
64
65#ifdef BCMCHIPID
66#define CHIPID(chip) (BCMCHIPID)
67#else
68#define CHIPID(chip) (chip)
69#endif
70
71
72#define DMADDR_MASK_32 0x0
73#define DMADDR_MASK_30 0xc0000000
74#define DMADDR_MASK_0 0xffffffff
75
76#define DMADDRWIDTH_30 30
77#define DMADDRWIDTH_32 32
78#define DMADDRWIDTH_63 63
79#define DMADDRWIDTH_64 64
80
81
82#define BCMEXTRAHDROOM 164
83
84
85#define BCMDONGLEHDRSZ 12
86#define BCMDONGLEPADSZ 16
87
88#define BCMDONGLEOVERHEAD (BCMDONGLEHDRSZ + BCMDONGLEPADSZ)
89
90
91
92#define BITFIELD_MASK(width) \
93 (((unsigned)1 << (width)) - 1)
94#define GFIELD(val, field) \
95 (((val) >> field ## _S) & field ## _M)
96#define SFIELD(val, field, bits) \
97 (((val) & (~(field ## _M << field ## _S))) | \
98 ((unsigned)(bits) << field ## _S))
99
100
101#ifdef BCMSMALL
102#undef BCMSPACE
103#define bcmspace FALSE
104#else
105#define BCMSPACE
106#define bcmspace TRUE
107#endif
108
109
110#define MAXSZ_NVRAM_VARS 4096
111
112#define LOCATOR_EXTERN static
113
114#endif
diff --git a/drivers/net/wireless/bcm4329/include/bcmdevs.h b/drivers/net/wireless/bcm4329/include/bcmdevs.h
new file mode 100644
index 00000000000..14853f17795
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/bcmdevs.h
@@ -0,0 +1,124 @@
1/*
2 * Broadcom device-specific manifest constants.
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: bcmdevs.h,v 13.172.4.5.4.10.2.36 2010/05/25 08:33:44 Exp $
25 */
26
27
28#ifndef _BCMDEVS_H
29#define _BCMDEVS_H
30
31
32#define VENDOR_EPIGRAM 0xfeda
33#define VENDOR_BROADCOM 0x14e4
34#define VENDOR_SI_IMAGE 0x1095
35#define VENDOR_TI 0x104c
36#define VENDOR_RICOH 0x1180
37#define VENDOR_JMICRON 0x197b
38
39
40#define VENDOR_BROADCOM_PCMCIA 0x02d0
41
42
43#define VENDOR_BROADCOM_SDIO 0x00BF
44
45
46#define BCM_DNGL_VID 0xa5c
47#define BCM_DNGL_BL_PID_4320 0xbd11
48#define BCM_DNGL_BL_PID_4328 0xbd12
49#define BCM_DNGL_BL_PID_4322 0xbd13
50#define BCM_DNGL_BL_PID_4325 0xbd14
51#define BCM_DNGL_BL_PID_4315 0xbd15
52#define BCM_DNGL_BL_PID_4319 0xbd16
53#define BCM_DNGL_BDC_PID 0xbdc
54
55#define BCM4325_D11DUAL_ID 0x431b
56#define BCM4325_D11G_ID 0x431c
57#define BCM4325_D11A_ID 0x431d
58#define BCM4329_D11NDUAL_ID 0x432e
59#define BCM4329_D11N2G_ID 0x432f
60#define BCM4329_D11N5G_ID 0x4330
61#define BCM4336_D11N_ID 0x4343
62#define BCM4315_D11DUAL_ID 0x4334
63#define BCM4315_D11G_ID 0x4335
64#define BCM4315_D11A_ID 0x4336
65#define BCM4319_D11N_ID 0x4337
66#define BCM4319_D11N2G_ID 0x4338
67#define BCM4319_D11N5G_ID 0x4339
68
69
70#define SDIOH_FPGA_ID 0x43f2
71#define SPIH_FPGA_ID 0x43f5
72#define BCM4710_DEVICE_ID 0x4710
73#define BCM27XX_SDIOH_ID 0x2702
74#define PCIXX21_FLASHMEDIA0_ID 0x8033
75#define PCIXX21_SDIOH0_ID 0x8034
76#define PCIXX21_FLASHMEDIA_ID 0x803b
77#define PCIXX21_SDIOH_ID 0x803c
78#define R5C822_SDIOH_ID 0x0822
79#define JMICRON_SDIOH_ID 0x2381
80
81
82#define BCM4306_CHIP_ID 0x4306
83#define BCM4311_CHIP_ID 0x4311
84#define BCM4312_CHIP_ID 0x4312
85#define BCM4315_CHIP_ID 0x4315
86#define BCM4318_CHIP_ID 0x4318
87#define BCM4319_CHIP_ID 0x4319
88#define BCM4320_CHIP_ID 0x4320
89#define BCM4321_CHIP_ID 0x4321
90#define BCM4322_CHIP_ID 0x4322
91#define BCM4325_CHIP_ID 0x4325
92#define BCM4328_CHIP_ID 0x4328
93#define BCM4329_CHIP_ID 0x4329
94#define BCM4336_CHIP_ID 0x4336
95#define BCM4402_CHIP_ID 0x4402
96#define BCM4704_CHIP_ID 0x4704
97#define BCM4710_CHIP_ID 0x4710
98#define BCM4712_CHIP_ID 0x4712
99#define BCM4785_CHIP_ID 0x4785
100#define BCM5350_CHIP_ID 0x5350
101#define BCM5352_CHIP_ID 0x5352
102#define BCM5354_CHIP_ID 0x5354
103#define BCM5365_CHIP_ID 0x5365
104
105
106
107#define BCM4303_PKG_ID 2
108#define BCM4309_PKG_ID 1
109#define BCM4712LARGE_PKG_ID 0
110#define BCM4712SMALL_PKG_ID 1
111#define BCM4712MID_PKG_ID 2
112#define BCM4328USBD11G_PKG_ID 2
113#define BCM4328USBDUAL_PKG_ID 3
114#define BCM4328SDIOD11G_PKG_ID 4
115#define BCM4328SDIODUAL_PKG_ID 5
116#define BCM4329_289PIN_PKG_ID 0
117#define BCM4329_182PIN_PKG_ID 1
118#define BCM5354E_PKG_ID 1
119#define HDLSIM5350_PKG_ID 1
120#define HDLSIM_PKG_ID 14
121#define HWSIM_PKG_ID 15
122
123
124#endif
diff --git a/drivers/net/wireless/bcm4329/include/bcmendian.h b/drivers/net/wireless/bcm4329/include/bcmendian.h
new file mode 100644
index 00000000000..ae468383aa7
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/bcmendian.h
@@ -0,0 +1,205 @@
1/*
2 * Byte order utilities
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: bcmendian.h,v 1.31.302.1.16.1 2009/02/03 18:34:31 Exp $
25 *
26 * This file by default provides proper behavior on little-endian architectures.
27 * On big-endian architectures, IL_BIGENDIAN should be defined.
28 */
29
30
31#ifndef _BCMENDIAN_H_
32#define _BCMENDIAN_H_
33
34#include <typedefs.h>
35
36
37#define BCMSWAP16(val) \
38 ((uint16)((((uint16)(val) & (uint16)0x00ffU) << 8) | \
39 (((uint16)(val) & (uint16)0xff00U) >> 8)))
40
41
42#define BCMSWAP32(val) \
43 ((uint32)((((uint32)(val) & (uint32)0x000000ffU) << 24) | \
44 (((uint32)(val) & (uint32)0x0000ff00U) << 8) | \
45 (((uint32)(val) & (uint32)0x00ff0000U) >> 8) | \
46 (((uint32)(val) & (uint32)0xff000000U) >> 24)))
47
48
49#define BCMSWAP32BY16(val) \
50 ((uint32)((((uint32)(val) & (uint32)0x0000ffffU) << 16) | \
51 (((uint32)(val) & (uint32)0xffff0000U) >> 16)))
52
53
54static INLINE uint16
55bcmswap16(uint16 val)
56{
57 return BCMSWAP16(val);
58}
59
60static INLINE uint32
61bcmswap32(uint32 val)
62{
63 return BCMSWAP32(val);
64}
65
66static INLINE uint32
67bcmswap32by16(uint32 val)
68{
69 return BCMSWAP32BY16(val);
70}
71
72
73
74
75static INLINE void
76bcmswap16_buf(uint16 *buf, uint len)
77{
78 len = len / 2;
79
80 while (len--) {
81 *buf = bcmswap16(*buf);
82 buf++;
83 }
84}
85
86#ifndef hton16
87#ifndef IL_BIGENDIAN
88#define HTON16(i) BCMSWAP16(i)
89#define HTON32(i) BCMSWAP32(i)
90#define hton16(i) bcmswap16(i)
91#define hton32(i) bcmswap32(i)
92#define ntoh16(i) bcmswap16(i)
93#define ntoh32(i) bcmswap32(i)
94#define HTOL16(i) (i)
95#define HTOL32(i) (i)
96#define ltoh16(i) (i)
97#define ltoh32(i) (i)
98#define htol16(i) (i)
99#define htol32(i) (i)
100#else
101#define HTON16(i) (i)
102#define HTON32(i) (i)
103#define hton16(i) (i)
104#define hton32(i) (i)
105#define ntoh16(i) (i)
106#define ntoh32(i) (i)
107#define HTOL16(i) BCMSWAP16(i)
108#define HTOL32(i) BCMSWAP32(i)
109#define ltoh16(i) bcmswap16(i)
110#define ltoh32(i) bcmswap32(i)
111#define htol16(i) bcmswap16(i)
112#define htol32(i) bcmswap32(i)
113#endif
114#endif
115
116#ifndef IL_BIGENDIAN
117#define ltoh16_buf(buf, i)
118#define htol16_buf(buf, i)
119#else
120#define ltoh16_buf(buf, i) bcmswap16_buf((uint16 *)buf, i)
121#define htol16_buf(buf, i) bcmswap16_buf((uint16 *)buf, i)
122#endif
123
124
125static INLINE void
126htol16_ua_store(uint16 val, uint8 *bytes)
127{
128 bytes[0] = val & 0xff;
129 bytes[1] = val >> 8;
130}
131
132
133static INLINE void
134htol32_ua_store(uint32 val, uint8 *bytes)
135{
136 bytes[0] = val & 0xff;
137 bytes[1] = (val >> 8) & 0xff;
138 bytes[2] = (val >> 16) & 0xff;
139 bytes[3] = val >> 24;
140}
141
142
143static INLINE void
144hton16_ua_store(uint16 val, uint8 *bytes)
145{
146 bytes[0] = val >> 8;
147 bytes[1] = val & 0xff;
148}
149
150
151static INLINE void
152hton32_ua_store(uint32 val, uint8 *bytes)
153{
154 bytes[0] = val >> 24;
155 bytes[1] = (val >> 16) & 0xff;
156 bytes[2] = (val >> 8) & 0xff;
157 bytes[3] = val & 0xff;
158}
159
160#define _LTOH16_UA(cp) ((cp)[0] | ((cp)[1] << 8))
161#define _LTOH32_UA(cp) ((cp)[0] | ((cp)[1] << 8) | ((cp)[2] << 16) | ((cp)[3] << 24))
162#define _NTOH16_UA(cp) (((cp)[0] << 8) | (cp)[1])
163#define _NTOH32_UA(cp) (((cp)[0] << 24) | ((cp)[1] << 16) | ((cp)[2] << 8) | (cp)[3])
164
165
166static INLINE uint16
167ltoh16_ua(const void *bytes)
168{
169 return _LTOH16_UA((const uint8 *)bytes);
170}
171
172
173static INLINE uint32
174ltoh32_ua(const void *bytes)
175{
176 return _LTOH32_UA((const uint8 *)bytes);
177}
178
179
180static INLINE uint16
181ntoh16_ua(const void *bytes)
182{
183 return _NTOH16_UA((const uint8 *)bytes);
184}
185
186
187static INLINE uint32
188ntoh32_ua(const void *bytes)
189{
190 return _NTOH32_UA((const uint8 *)bytes);
191}
192
193#define ltoh_ua(ptr) \
194 (sizeof(*(ptr)) == sizeof(uint8) ? *(const uint8 *)ptr : \
195 sizeof(*(ptr)) == sizeof(uint16) ? _LTOH16_UA((const uint8 *)ptr) : \
196 sizeof(*(ptr)) == sizeof(uint32) ? _LTOH32_UA((const uint8 *)ptr) : \
197 0xfeedf00d)
198
199#define ntoh_ua(ptr) \
200 (sizeof(*(ptr)) == sizeof(uint8) ? *(const uint8 *)ptr : \
201 sizeof(*(ptr)) == sizeof(uint16) ? _NTOH16_UA((const uint8 *)ptr) : \
202 sizeof(*(ptr)) == sizeof(uint32) ? _NTOH32_UA((const uint8 *)ptr) : \
203 0xfeedf00d)
204
205#endif
diff --git a/drivers/net/wireless/bcm4329/include/bcmpcispi.h b/drivers/net/wireless/bcm4329/include/bcmpcispi.h
new file mode 100644
index 00000000000..7d98fb7cbdc
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/bcmpcispi.h
@@ -0,0 +1,205 @@
1/*
2 * Broadcom PCI-SPI Host Controller Register Definitions
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: bcmpcispi.h,v 13.11.8.3 2008/07/09 21:23:29 Exp $
25 */
26
27/* cpp contortions to concatenate w/arg prescan */
28#ifndef PAD
29#define _PADLINE(line) pad ## line
30#define _XSTR(line) _PADLINE(line)
31#define PAD _XSTR(__LINE__)
32#endif /* PAD */
33
34/*
35+---------------------------------------------------------------------------+
36| |
37| 7 6 5 4 3 2 1 0 |
38| 0x0000 SPI_CTRL SPIE SPE 0 MSTR CPOL CPHA SPR1 SPR0 |
39| 0x0004 SPI_STAT SPIF WCOL ST1 ST0 WFFUL WFEMP RFFUL RFEMP |
40| 0x0008 SPI_DATA Bits 31:0, data to send out on MOSI |
41| 0x000C SPI_EXT ICNT1 ICNT0 BSWAP *HSMODE ESPR1 ESPR0 |
42| 0x0020 GPIO_OE 0=input, 1=output PWR_OE CS_OE |
43| 0x0024 GPIO_DATA CARD:1=missing, 0=present CARD PWR_DAT CS_DAT |
44| 0x0040 INT_EDGE 0=level, 1=edge DEV_E SPI_E |
45| 0x0044 INT_POL 1=active high, 0=active low DEV_P SPI_P |
46| 0x0048 INTMASK DEV SPI |
47| 0x004C INTSTATUS DEV SPI |
48| 0x0060 HEXDISP Reset value: 0x14e443f5. In hexdisp mode, value |
49| shows on the Raggedstone1 4-digit 7-segment display. |
50| 0x0064 CURRENT_MA Low 16 bits indicate card current consumption in mA |
51| 0x006C DISP_SEL Display mode (0=hexdisp, 1=current) DSP |
52| 0x00C0 PLL_CTL bit31=ext_clk, remainder unused. |
53| 0x00C4 PLL_STAT LOCK |
54| 0x00C8 CLK_FREQ |
55| 0x00CC CLK_CNT |
56| |
57| *Notes: HSMODE is not implemented, never set this bit! |
58| BSWAP is available in rev >= 8 |
59| |
60+---------------------------------------------------------------------------+
61*/
62
63typedef volatile struct {
64 uint32 spih_ctrl; /* 0x00 SPI Control Register */
65 uint32 spih_stat; /* 0x04 SPI Status Register */
66 uint32 spih_data; /* 0x08 SPI Data Register, 32-bits wide */
67 uint32 spih_ext; /* 0x0C SPI Extension Register */
68 uint32 PAD[4]; /* 0x10-0x1F PADDING */
69
70 uint32 spih_gpio_ctrl; /* 0x20 SPI GPIO Control Register */
71 uint32 spih_gpio_data; /* 0x24 SPI GPIO Data Register */
72 uint32 PAD[6]; /* 0x28-0x3F PADDING */
73
74 uint32 spih_int_edge; /* 0x40 SPI Interrupt Edge Register (0=Level, 1=Edge) */
75 uint32 spih_int_pol; /* 0x44 SPI Interrupt Polarity Register (0=Active Low, */
76 /* 1=Active High) */
77 uint32 spih_int_mask; /* 0x48 SPI Interrupt Mask */
78 uint32 spih_int_status; /* 0x4C SPI Interrupt Status */
79 uint32 PAD[4]; /* 0x50-0x5F PADDING */
80
81 uint32 spih_hex_disp; /* 0x60 SPI 4-digit hex display value */
82 uint32 spih_current_ma; /* 0x64 SPI SD card current consumption in mA */
83 uint32 PAD[1]; /* 0x68 PADDING */
84 uint32 spih_disp_sel; /* 0x6c SPI 4-digit hex display mode select (1=current) */
85 uint32 PAD[4]; /* 0x70-0x7F PADDING */
86 uint32 PAD[8]; /* 0x80-0x9F PADDING */
87 uint32 PAD[8]; /* 0xA0-0xBF PADDING */
88 uint32 spih_pll_ctrl; /* 0xC0 PLL Control Register */
89 uint32 spih_pll_status; /* 0xC4 PLL Status Register */
90 uint32 spih_xtal_freq; /* 0xC8 External Clock Frequency in units of 10000Hz */
91 uint32 spih_clk_count; /* 0xCC External Clock Count Register */
92
93} spih_regs_t;
94
95typedef volatile struct {
96 uint32 cfg_space[0x40]; /* 0x000-0x0FF PCI Configuration Space (Read Only) */
97 uint32 P_IMG_CTRL0; /* 0x100 PCI Image0 Control Register */
98
99 uint32 P_BA0; /* 0x104 32 R/W PCI Image0 Base Address register */
100 uint32 P_AM0; /* 0x108 32 R/W PCI Image0 Address Mask register */
101 uint32 P_TA0; /* 0x10C 32 R/W PCI Image0 Translation Address register */
102 uint32 P_IMG_CTRL1; /* 0x110 32 R/W PCI Image1 Control register */
103 uint32 P_BA1; /* 0x114 32 R/W PCI Image1 Base Address register */
104 uint32 P_AM1; /* 0x118 32 R/W PCI Image1 Address Mask register */
105 uint32 P_TA1; /* 0x11C 32 R/W PCI Image1 Translation Address register */
106 uint32 P_IMG_CTRL2; /* 0x120 32 R/W PCI Image2 Control register */
107 uint32 P_BA2; /* 0x124 32 R/W PCI Image2 Base Address register */
108 uint32 P_AM2; /* 0x128 32 R/W PCI Image2 Address Mask register */
109 uint32 P_TA2; /* 0x12C 32 R/W PCI Image2 Translation Address register */
110 uint32 P_IMG_CTRL3; /* 0x130 32 R/W PCI Image3 Control register */
111 uint32 P_BA3; /* 0x134 32 R/W PCI Image3 Base Address register */
112 uint32 P_AM3; /* 0x138 32 R/W PCI Image3 Address Mask register */
113 uint32 P_TA3; /* 0x13C 32 R/W PCI Image3 Translation Address register */
114 uint32 P_IMG_CTRL4; /* 0x140 32 R/W PCI Image4 Control register */
115 uint32 P_BA4; /* 0x144 32 R/W PCI Image4 Base Address register */
116 uint32 P_AM4; /* 0x148 32 R/W PCI Image4 Address Mask register */
117 uint32 P_TA4; /* 0x14C 32 R/W PCI Image4 Translation Address register */
118 uint32 P_IMG_CTRL5; /* 0x150 32 R/W PCI Image5 Control register */
119 uint32 P_BA5; /* 0x154 32 R/W PCI Image5 Base Address register */
120 uint32 P_AM5; /* 0x158 32 R/W PCI Image5 Address Mask register */
121 uint32 P_TA5; /* 0x15C 32 R/W PCI Image5 Translation Address register */
122 uint32 P_ERR_CS; /* 0x160 32 R/W PCI Error Control and Status register */
123 uint32 P_ERR_ADDR; /* 0x164 32 R PCI Erroneous Address register */
124 uint32 P_ERR_DATA; /* 0x168 32 R PCI Erroneous Data register */
125
126 uint32 PAD[5]; /* 0x16C-0x17F PADDING */
127
128 uint32 WB_CONF_SPC_BAR; /* 0x180 32 R WISHBONE Configuration Space Base Address */
129 uint32 W_IMG_CTRL1; /* 0x184 32 R/W WISHBONE Image1 Control register */
130 uint32 W_BA1; /* 0x188 32 R/W WISHBONE Image1 Base Address register */
131 uint32 W_AM1; /* 0x18C 32 R/W WISHBONE Image1 Address Mask register */
132 uint32 W_TA1; /* 0x190 32 R/W WISHBONE Image1 Translation Address reg */
133 uint32 W_IMG_CTRL2; /* 0x194 32 R/W WISHBONE Image2 Control register */
134 uint32 W_BA2; /* 0x198 32 R/W WISHBONE Image2 Base Address register */
135 uint32 W_AM2; /* 0x19C 32 R/W WISHBONE Image2 Address Mask register */
136 uint32 W_TA2; /* 0x1A0 32 R/W WISHBONE Image2 Translation Address reg */
137 uint32 W_IMG_CTRL3; /* 0x1A4 32 R/W WISHBONE Image3 Control register */
138 uint32 W_BA3; /* 0x1A8 32 R/W WISHBONE Image3 Base Address register */
139 uint32 W_AM3; /* 0x1AC 32 R/W WISHBONE Image3 Address Mask register */
140 uint32 W_TA3; /* 0x1B0 32 R/W WISHBONE Image3 Translation Address reg */
141 uint32 W_IMG_CTRL4; /* 0x1B4 32 R/W WISHBONE Image4 Control register */
142 uint32 W_BA4; /* 0x1B8 32 R/W WISHBONE Image4 Base Address register */
143 uint32 W_AM4; /* 0x1BC 32 R/W WISHBONE Image4 Address Mask register */
144 uint32 W_TA4; /* 0x1C0 32 R/W WISHBONE Image4 Translation Address reg */
145 uint32 W_IMG_CTRL5; /* 0x1C4 32 R/W WISHBONE Image5 Control register */
146 uint32 W_BA5; /* 0x1C8 32 R/W WISHBONE Image5 Base Address register */
147 uint32 W_AM5; /* 0x1CC 32 R/W WISHBONE Image5 Address Mask register */
148 uint32 W_TA5; /* 0x1D0 32 R/W WISHBONE Image5 Translation Address reg */
149 uint32 W_ERR_CS; /* 0x1D4 32 R/W WISHBONE Error Control and Status reg */
150 uint32 W_ERR_ADDR; /* 0x1D8 32 R WISHBONE Erroneous Address register */
151 uint32 W_ERR_DATA; /* 0x1DC 32 R WISHBONE Erroneous Data register */
152 uint32 CNF_ADDR; /* 0x1E0 32 R/W Configuration Cycle register */
153 uint32 CNF_DATA; /* 0x1E4 32 R/W Configuration Cycle Generation Data reg */
154
155 uint32 INT_ACK; /* 0x1E8 32 R Interrupt Acknowledge register */
156 uint32 ICR; /* 0x1EC 32 R/W Interrupt Control register */
157 uint32 ISR; /* 0x1F0 32 R/W Interrupt Status register */
158} spih_pciregs_t;
159
160/*
161 * PCI Core interrupt enable and status bit definitions.
162 */
163
164/* PCI Core ICR Register bit definitions */
165#define PCI_INT_PROP_EN (1 << 0) /* Interrupt Propagation Enable */
166#define PCI_WB_ERR_INT_EN (1 << 1) /* Wishbone Error Interrupt Enable */
167#define PCI_PCI_ERR_INT_EN (1 << 2) /* PCI Error Interrupt Enable */
168#define PCI_PAR_ERR_INT_EN (1 << 3) /* Parity Error Interrupt Enable */
169#define PCI_SYS_ERR_INT_EN (1 << 4) /* System Error Interrupt Enable */
170#define PCI_SOFTWARE_RESET (1U << 31) /* Software reset of the PCI Core. */
171
172
173/* PCI Core ISR Register bit definitions */
174#define PCI_INT_PROP_ST (1 << 0) /* Interrupt Propagation Status */
175#define PCI_WB_ERR_INT_ST (1 << 1) /* Wishbone Error Interrupt Status */
176#define PCI_PCI_ERR_INT_ST (1 << 2) /* PCI Error Interrupt Status */
177#define PCI_PAR_ERR_INT_ST (1 << 3) /* Parity Error Interrupt Status */
178#define PCI_SYS_ERR_INT_ST (1 << 4) /* System Error Interrupt Status */
179
180
181/* Registers on the Wishbone bus */
182#define SPIH_CTLR_INTR (1 << 0) /* SPI Host Controller Core Interrupt */
183#define SPIH_DEV_INTR (1 << 1) /* SPI Device Interrupt */
184#define SPIH_WFIFO_INTR (1 << 2) /* SPI Tx FIFO Empty Intr (FPGA Rev >= 8) */
185
186/* GPIO Bit definitions */
187#define SPIH_CS (1 << 0) /* SPI Chip Select (active low) */
188#define SPIH_SLOT_POWER (1 << 1) /* SD Card Slot Power Enable */
189#define SPIH_CARD_DETECT (1 << 2) /* SD Card Detect */
190
191/* SPI Status Register Bit definitions */
192#define SPIH_STATE_MASK 0x30 /* SPI Transfer State Machine state mask */
193#define SPIH_STATE_SHIFT 4 /* SPI Transfer State Machine state shift */
194#define SPIH_WFFULL (1 << 3) /* SPI Write FIFO Full */
195#define SPIH_WFEMPTY (1 << 2) /* SPI Write FIFO Empty */
196#define SPIH_RFFULL (1 << 1) /* SPI Read FIFO Full */
197#define SPIH_RFEMPTY (1 << 0) /* SPI Read FIFO Empty */
198
199#define SPIH_EXT_CLK (1U << 31) /* Use External Clock as PLL Clock source. */
200
201#define SPIH_PLL_NO_CLK (1 << 1) /* Set to 1 if the PLL's input clock is lost. */
202#define SPIH_PLL_LOCKED (1 << 3) /* Set to 1 when the PLL is locked. */
203
204/* Spin bit loop bound check */
205#define SPI_SPIN_BOUND 0xf4240 /* 1 million */
diff --git a/drivers/net/wireless/bcm4329/include/bcmperf.h b/drivers/net/wireless/bcm4329/include/bcmperf.h
new file mode 100644
index 00000000000..2a78784e85d
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/bcmperf.h
@@ -0,0 +1,36 @@
1/*
2 * Performance counters software interface.
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: bcmperf.h,v 13.5 2007/09/14 22:00:59 Exp $
25 */
26/* essai */
27#ifndef _BCMPERF_H_
28#define _BCMPERF_H_
29/* get cache hits and misses */
30#define BCMPERF_ENABLE_INSTRCOUNT()
31#define BCMPERF_ENABLE_ICACHE_MISS()
32#define BCMPERF_ENABLE_ICACHE_HIT()
33#define BCMPERF_GETICACHE_MISS(x) ((x) = 0)
34#define BCMPERF_GETICACHE_HIT(x) ((x) = 0)
35#define BCMPERF_GETINSTRCOUNT(x) ((x) = 0)
36#endif /* _BCMPERF_H_ */
diff --git a/drivers/net/wireless/bcm4329/include/bcmsdbus.h b/drivers/net/wireless/bcm4329/include/bcmsdbus.h
new file mode 100644
index 00000000000..b7b67bc6624
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/bcmsdbus.h
@@ -0,0 +1,117 @@
1/*
2 * Definitions for API from sdio common code (bcmsdh) to individual
3 * host controller drivers.
4 *
5 * Copyright (C) 1999-2010, Broadcom Corporation
6 *
7 * Unless you and Broadcom execute a separate written software license
8 * agreement governing use of this software, this software is licensed to you
9 * under the terms of the GNU General Public License version 2 (the "GPL"),
10 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
11 * following added to such license:
12 *
13 * As a special exception, the copyright holders of this software give you
14 * permission to link this software with independent modules, and to copy and
15 * distribute the resulting executable under terms of your choice, provided that
16 * you also meet, for each linked independent module, the terms and conditions of
17 * the license of that module. An independent module is a module which is not
18 * derived from this software. The special exception does not apply to any
19 * modifications of the software.
20 *
21 * Notwithstanding the above, under no circumstances may you combine this
22 * software in any way with any other Broadcom software provided under a license
23 * other than the GPL, without Broadcom's express prior written consent.
24 *
25 * $Id: bcmsdbus.h,v 13.11.14.2.6.6 2009/10/27 17:20:28 Exp $
26 */
27
28#ifndef _sdio_api_h_
29#define _sdio_api_h_
30
31
32#define SDIOH_API_RC_SUCCESS (0x00)
33#define SDIOH_API_RC_FAIL (0x01)
34#define SDIOH_API_SUCCESS(status) (status == 0)
35
36#define SDIOH_READ 0 /* Read request */
37#define SDIOH_WRITE 1 /* Write request */
38
39#define SDIOH_DATA_FIX 0 /* Fixed addressing */
40#define SDIOH_DATA_INC 1 /* Incremental addressing */
41
42#define SDIOH_CMD_TYPE_NORMAL 0 /* Normal command */
43#define SDIOH_CMD_TYPE_APPEND 1 /* Append command */
44#define SDIOH_CMD_TYPE_CUTTHRU 2 /* Cut-through command */
45
46#define SDIOH_DATA_PIO 0 /* PIO mode */
47#define SDIOH_DATA_DMA 1 /* DMA mode */
48
49
50typedef int SDIOH_API_RC;
51
52/* SDio Host structure */
53typedef struct sdioh_info sdioh_info_t;
54
55/* callback function, taking one arg */
56typedef void (*sdioh_cb_fn_t)(void *);
57
58/* attach, return handler on success, NULL if failed.
59 * The handler shall be provided by all subsequent calls. No local cache
60 * cfghdl points to the starting address of pci device mapped memory
61 */
62extern sdioh_info_t * sdioh_attach(osl_t *osh, void *cfghdl, uint irq);
63extern SDIOH_API_RC sdioh_detach(osl_t *osh, sdioh_info_t *si);
64extern SDIOH_API_RC sdioh_interrupt_register(sdioh_info_t *si, sdioh_cb_fn_t fn, void *argh);
65extern SDIOH_API_RC sdioh_interrupt_deregister(sdioh_info_t *si);
66
67/* query whether SD interrupt is enabled or not */
68extern SDIOH_API_RC sdioh_interrupt_query(sdioh_info_t *si, bool *onoff);
69
70/* enable or disable SD interrupt */
71extern SDIOH_API_RC sdioh_interrupt_set(sdioh_info_t *si, bool enable_disable);
72
73#if defined(DHD_DEBUG)
74extern bool sdioh_interrupt_pending(sdioh_info_t *si);
75#endif
76
77/* read or write one byte using cmd52 */
78extern SDIOH_API_RC sdioh_request_byte(sdioh_info_t *si, uint rw, uint fnc, uint addr, uint8 *byte);
79
80/* read or write 2/4 bytes using cmd53 */
81extern SDIOH_API_RC sdioh_request_word(sdioh_info_t *si, uint cmd_type, uint rw, uint fnc,
82 uint addr, uint32 *word, uint nbyte);
83
84/* read or write any buffer using cmd53 */
85extern SDIOH_API_RC sdioh_request_buffer(sdioh_info_t *si, uint pio_dma, uint fix_inc,
86 uint rw, uint fnc_num, uint32 addr, uint regwidth, uint32 buflen, uint8 *buffer,
87 void *pkt);
88
89/* get cis data */
90extern SDIOH_API_RC sdioh_cis_read(sdioh_info_t *si, uint fuc, uint8 *cis, uint32 length);
91
92extern SDIOH_API_RC sdioh_cfg_read(sdioh_info_t *si, uint fuc, uint32 addr, uint8 *data);
93extern SDIOH_API_RC sdioh_cfg_write(sdioh_info_t *si, uint fuc, uint32 addr, uint8 *data);
94
95/* query number of io functions */
96extern uint sdioh_query_iofnum(sdioh_info_t *si);
97
98/* handle iovars */
99extern int sdioh_iovar_op(sdioh_info_t *si, const char *name,
100 void *params, int plen, void *arg, int len, bool set);
101
102/* Issue abort to the specified function and clear controller as needed */
103extern int sdioh_abort(sdioh_info_t *si, uint fnc);
104
105/* Start and Stop SDIO without re-enumerating the SD card. */
106extern int sdioh_start(sdioh_info_t *si, int stage);
107extern int sdioh_stop(sdioh_info_t *si);
108
109/* Reset and re-initialize the device */
110extern int sdioh_sdio_reset(sdioh_info_t *si);
111
112/* Helper function */
113void *bcmsdh_get_sdioh(bcmsdh_info_t *sdh);
114
115
116
117#endif /* _sdio_api_h_ */
diff --git a/drivers/net/wireless/bcm4329/include/bcmsdh.h b/drivers/net/wireless/bcm4329/include/bcmsdh.h
new file mode 100644
index 00000000000..caf0b9988aa
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/bcmsdh.h
@@ -0,0 +1,208 @@
1/*
2 * SDIO host client driver interface of Broadcom HNBU
3 * export functions to client drivers
4 * abstract OS and BUS specific details of SDIO
5 *
6 * Copyright (C) 1999-2010, Broadcom Corporation
7 *
8 * Unless you and Broadcom execute a separate written software license
9 * agreement governing use of this software, this software is licensed to you
10 * under the terms of the GNU General Public License version 2 (the "GPL"),
11 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
12 * following added to such license:
13 *
14 * As a special exception, the copyright holders of this software give you
15 * permission to link this software with independent modules, and to copy and
16 * distribute the resulting executable under terms of your choice, provided that
17 * you also meet, for each linked independent module, the terms and conditions of
18 * the license of that module. An independent module is a module which is not
19 * derived from this software. The special exception does not apply to any
20 * modifications of the software.
21 *
22 * Notwithstanding the above, under no circumstances may you combine this
23 * software in any way with any other Broadcom software provided under a license
24 * other than the GPL, without Broadcom's express prior written consent.
25 *
26 * $Id: bcmsdh.h,v 13.35.14.7.6.8 2009/10/14 04:22:25 Exp $
27 */
28
29#ifndef _bcmsdh_h_
30#define _bcmsdh_h_
31
32#define BCMSDH_ERROR_VAL 0x0001 /* Error */
33#define BCMSDH_INFO_VAL 0x0002 /* Info */
34extern const uint bcmsdh_msglevel;
35
36#define BCMSDH_ERROR(x)
37#define BCMSDH_INFO(x)
38
39/* forward declarations */
40typedef struct bcmsdh_info bcmsdh_info_t;
41typedef void (*bcmsdh_cb_fn_t)(void *);
42
43/* Attach and build an interface to the underlying SD host driver.
44 * - Allocates resources (structs, arrays, mem, OS handles, etc) needed by bcmsdh.
45 * - Returns the bcmsdh handle and virtual address base for register access.
46 * The returned handle should be used in all subsequent calls, but the bcmsh
47 * implementation may maintain a single "default" handle (e.g. the first or
48 * most recent one) to enable single-instance implementations to pass NULL.
49 */
50extern bcmsdh_info_t *bcmsdh_attach(osl_t *osh, void *cfghdl, void **regsva, uint irq);
51
52/* Detach - freeup resources allocated in attach */
53extern int bcmsdh_detach(osl_t *osh, void *sdh);
54
55/* Query if SD device interrupts are enabled */
56extern bool bcmsdh_intr_query(void *sdh);
57
58/* Enable/disable SD interrupt */
59extern int bcmsdh_intr_enable(void *sdh);
60extern int bcmsdh_intr_disable(void *sdh);
61
62/* Register/deregister device interrupt handler. */
63extern int bcmsdh_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh);
64extern int bcmsdh_intr_dereg(void *sdh);
65
66#if defined(DHD_DEBUG)
67/* Query pending interrupt status from the host controller */
68extern bool bcmsdh_intr_pending(void *sdh);
69#endif
70
71#ifdef BCMLXSDMMC
72extern int bcmsdh_claim_host_and_lock(void *sdh);
73extern int bcmsdh_release_host_and_unlock(void *sdh);
74#endif /* BCMLXSDMMC */
75
76/* Register a callback to be called if and when bcmsdh detects
77 * device removal. No-op in the case of non-removable/hardwired devices.
78 */
79extern int bcmsdh_devremove_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh);
80
81/* Access SDIO address space (e.g. CCCR) using CMD52 (single-byte interface).
82 * fn: function number
83 * addr: unmodified SDIO-space address
84 * data: data byte to write
85 * err: pointer to error code (or NULL)
86 */
87extern uint8 bcmsdh_cfg_read(void *sdh, uint func, uint32 addr, int *err);
88extern void bcmsdh_cfg_write(void *sdh, uint func, uint32 addr, uint8 data, int *err);
89
90/* Read/Write 4bytes from/to cfg space */
91extern uint32 bcmsdh_cfg_read_word(void *sdh, uint fnc_num, uint32 addr, int *err);
92extern void bcmsdh_cfg_write_word(void *sdh, uint fnc_num, uint32 addr, uint32 data, int *err);
93
94/* Read CIS content for specified function.
95 * fn: function whose CIS is being requested (0 is common CIS)
96 * cis: pointer to memory location to place results
97 * length: number of bytes to read
98 * Internally, this routine uses the values from the cis base regs (0x9-0xB)
99 * to form an SDIO-space address to read the data from.
100 */
101extern int bcmsdh_cis_read(void *sdh, uint func, uint8 *cis, uint length);
102
103/* Synchronous access to device (client) core registers via CMD53 to F1.
104 * addr: backplane address (i.e. >= regsva from attach)
105 * size: register width in bytes (2 or 4)
106 * data: data for register write
107 */
108extern uint32 bcmsdh_reg_read(void *sdh, uint32 addr, uint size);
109extern uint32 bcmsdh_reg_write(void *sdh, uint32 addr, uint size, uint32 data);
110
111/* Indicate if last reg read/write failed */
112extern bool bcmsdh_regfail(void *sdh);
113
114/* Buffer transfer to/from device (client) core via cmd53.
115 * fn: function number
116 * addr: backplane address (i.e. >= regsva from attach)
117 * flags: backplane width, address increment, sync/async
118 * buf: pointer to memory data buffer
119 * nbytes: number of bytes to transfer to/from buf
120 * pkt: pointer to packet associated with buf (if any)
121 * complete: callback function for command completion (async only)
122 * handle: handle for completion callback (first arg in callback)
123 * Returns 0 or error code.
124 * NOTE: Async operation is not currently supported.
125 */
126typedef void (*bcmsdh_cmplt_fn_t)(void *handle, int status, bool sync_waiting);
127extern int bcmsdh_send_buf(void *sdh, uint32 addr, uint fn, uint flags,
128 uint8 *buf, uint nbytes, void *pkt,
129 bcmsdh_cmplt_fn_t complete, void *handle);
130extern int bcmsdh_recv_buf(void *sdh, uint32 addr, uint fn, uint flags,
131 uint8 *buf, uint nbytes, void *pkt,
132 bcmsdh_cmplt_fn_t complete, void *handle);
133
134/* Flags bits */
135#define SDIO_REQ_4BYTE 0x1 /* Four-byte target (backplane) width (vs. two-byte) */
136#define SDIO_REQ_FIXED 0x2 /* Fixed address (FIFO) (vs. incrementing address) */
137#define SDIO_REQ_ASYNC 0x4 /* Async request (vs. sync request) */
138
139/* Pending (non-error) return code */
140#define BCME_PENDING 1
141
142/* Read/write to memory block (F1, no FIFO) via CMD53 (sync only).
143 * rw: read or write (0/1)
144 * addr: direct SDIO address
145 * buf: pointer to memory data buffer
146 * nbytes: number of bytes to transfer to/from buf
147 * Returns 0 or error code.
148 */
149extern int bcmsdh_rwdata(void *sdh, uint rw, uint32 addr, uint8 *buf, uint nbytes);
150
151/* Issue an abort to the specified function */
152extern int bcmsdh_abort(void *sdh, uint fn);
153
154/* Start SDIO Host Controller communication */
155extern int bcmsdh_start(void *sdh, int stage);
156
157/* Stop SDIO Host Controller communication */
158extern int bcmsdh_stop(void *sdh);
159
160/* Returns the "Device ID" of target device on the SDIO bus. */
161extern int bcmsdh_query_device(void *sdh);
162
163/* Returns the number of IO functions reported by the device */
164extern uint bcmsdh_query_iofnum(void *sdh);
165
166/* Miscellaneous knob tweaker. */
167extern int bcmsdh_iovar_op(void *sdh, const char *name,
168 void *params, int plen, void *arg, int len, bool set);
169
170/* Reset and reinitialize the device */
171extern int bcmsdh_reset(bcmsdh_info_t *sdh);
172
173/* helper functions */
174
175extern void *bcmsdh_get_sdioh(bcmsdh_info_t *sdh);
176
177/* callback functions */
178typedef struct {
179 /* attach to device */
180 void *(*attach)(uint16 vend_id, uint16 dev_id, uint16 bus, uint16 slot,
181 uint16 func, uint bustype, void * regsva, osl_t * osh,
182 void * param, void *dev);
183 /* detach from device */
184 void (*detach)(void *ch);
185} bcmsdh_driver_t;
186
187/* platform specific/high level functions */
188extern int bcmsdh_register(bcmsdh_driver_t *driver);
189extern void bcmsdh_unregister(void);
190extern bool bcmsdh_chipmatch(uint16 vendor, uint16 device);
191extern void bcmsdh_device_remove(void * sdh);
192
193#if defined(OOB_INTR_ONLY)
194extern int bcmsdh_register_oob_intr(void * dhdp);
195extern void bcmsdh_unregister_oob_intr(void);
196extern void bcmsdh_oob_intr_set(bool enable);
197#endif /* defined(OOB_INTR_ONLY) */
198/* Function to pass device-status bits to DHD. */
199extern uint32 bcmsdh_get_dstatus(void *sdh);
200
201/* Function to return current window addr */
202extern uint32 bcmsdh_cur_sbwad(void *sdh);
203
204/* Function to pass chipid and rev to lower layers for controlling pr's */
205extern void bcmsdh_chipinfo(void *sdh, uint32 chip, uint32 chiprev);
206
207
208#endif /* _bcmsdh_h_ */
diff --git a/drivers/net/wireless/bcm4329/include/bcmsdh_sdmmc.h b/drivers/net/wireless/bcm4329/include/bcmsdh_sdmmc.h
new file mode 100644
index 00000000000..4e6d1b5bd94
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/bcmsdh_sdmmc.h
@@ -0,0 +1,122 @@
1/*
2 * BCMSDH Function Driver for the native SDIO/MMC driver in the Linux Kernel
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: bcmsdh_sdmmc.h,v 13.1.2.1.8.7 2009/10/27 18:22:52 Exp $
25 */
26
27#ifndef __BCMSDH_SDMMC_H__
28#define __BCMSDH_SDMMC_H__
29
30#define sd_err(x)
31#define sd_trace(x)
32#define sd_info(x)
33#define sd_debug(x)
34#define sd_data(x)
35#define sd_ctrl(x)
36
37#define sd_sync_dma(sd, read, nbytes)
38#define sd_init_dma(sd)
39#define sd_ack_intr(sd)
40#define sd_wakeup(sd);
41
42/* Allocate/init/free per-OS private data */
43extern int sdioh_sdmmc_osinit(sdioh_info_t *sd);
44extern void sdioh_sdmmc_osfree(sdioh_info_t *sd);
45
46#define sd_log(x)
47
48#define SDIOH_ASSERT(exp) \
49 do { if (!(exp)) \
50 printf("!!!ASSERT fail: file %s lines %d", __FILE__, __LINE__); \
51 } while (0)
52
53#define BLOCK_SIZE_4318 64
54#define BLOCK_SIZE_4328 512
55
56/* internal return code */
57#define SUCCESS 0
58#define ERROR 1
59
60/* private bus modes */
61#define SDIOH_MODE_SD4 2
62#define CLIENT_INTR 0x100 /* Get rid of this! */
63
64struct sdioh_info {
65 osl_t *osh; /* osh handler */
66 bool client_intr_enabled; /* interrupt connnected flag */
67 bool intr_handler_valid; /* client driver interrupt handler valid */
68 sdioh_cb_fn_t intr_handler; /* registered interrupt handler */
69 void *intr_handler_arg; /* argument to call interrupt handler */
70 uint16 intmask; /* Current active interrupts */
71 void *sdos_info; /* Pointer to per-OS private data */
72
73 uint irq; /* Client irq */
74 int intrcount; /* Client interrupts */
75
76 bool sd_use_dma; /* DMA on CMD53 */
77 bool sd_blockmode; /* sd_blockmode == FALSE => 64 Byte Cmd 53s. */
78 /* Must be on for sd_multiblock to be effective */
79 bool use_client_ints; /* If this is false, make sure to restore */
80 int sd_mode; /* SD1/SD4/SPI */
81 int client_block_size[SDIOD_MAX_IOFUNCS]; /* Blocksize */
82 uint8 num_funcs; /* Supported funcs on client */
83 uint32 com_cis_ptr;
84 uint32 func_cis_ptr[SDIOD_MAX_IOFUNCS];
85 uint max_dma_len;
86 uint max_dma_descriptors; /* DMA Descriptors supported by this controller. */
87// SDDMA_DESCRIPTOR SGList[32]; /* Scatter/Gather DMA List */
88};
89
90/************************************************************
91 * Internal interfaces: per-port references into bcmsdh_sdmmc.c
92 */
93
94/* Global message bits */
95extern uint sd_msglevel;
96
97/* OS-independent interrupt handler */
98extern bool check_client_intr(sdioh_info_t *sd);
99
100/* Core interrupt enable/disable of device interrupts */
101extern void sdioh_sdmmc_devintr_on(sdioh_info_t *sd);
102extern void sdioh_sdmmc_devintr_off(sdioh_info_t *sd);
103
104
105/**************************************************************
106 * Internal interfaces: bcmsdh_sdmmc.c references to per-port code
107 */
108
109/* Register mapping routines */
110extern uint32 *sdioh_sdmmc_reg_map(osl_t *osh, int32 addr, int size);
111extern void sdioh_sdmmc_reg_unmap(osl_t *osh, int32 addr, int size);
112
113/* Interrupt (de)registration routines */
114extern int sdioh_sdmmc_register_irq(sdioh_info_t *sd, uint irq);
115extern void sdioh_sdmmc_free_irq(uint irq, sdioh_info_t *sd);
116
117typedef struct _BCMSDH_SDMMC_INSTANCE {
118 sdioh_info_t *sd;
119 struct sdio_func *func[SDIOD_MAX_IOFUNCS];
120} BCMSDH_SDMMC_INSTANCE, *PBCMSDH_SDMMC_INSTANCE;
121
122#endif /* __BCMSDH_SDMMC_H__ */
diff --git a/drivers/net/wireless/bcm4329/include/bcmsdpcm.h b/drivers/net/wireless/bcm4329/include/bcmsdpcm.h
new file mode 100644
index 00000000000..77aca4500ad
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/bcmsdpcm.h
@@ -0,0 +1,263 @@
1/*
2 * Broadcom SDIO/PCMCIA
3 * Software-specific definitions shared between device and host side
4 *
5 * Copyright (C) 1999-2010, Broadcom Corporation
6 *
7 * Unless you and Broadcom execute a separate written software license
8 * agreement governing use of this software, this software is licensed to you
9 * under the terms of the GNU General Public License version 2 (the "GPL"),
10 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
11 * following added to such license:
12 *
13 * As a special exception, the copyright holders of this software give you
14 * permission to link this software with independent modules, and to copy and
15 * distribute the resulting executable under terms of your choice, provided that
16 * you also meet, for each linked independent module, the terms and conditions of
17 * the license of that module. An independent module is a module which is not
18 * derived from this software. The special exception does not apply to any
19 * modifications of the software.
20 *
21 * Notwithstanding the above, under no circumstances may you combine this
22 * software in any way with any other Broadcom software provided under a license
23 * other than the GPL, without Broadcom's express prior written consent.
24 *
25 * $Id: bcmsdpcm.h,v 1.1.2.4 2010/07/02 01:15:46 Exp $
26 */
27
28#ifndef _bcmsdpcm_h_
29#define _bcmsdpcm_h_
30
31/*
32 * Software allocation of To SB Mailbox resources
33 */
34
35/* intstatus bits */
36#define I_SMB_NAK I_SMB_SW0 /* To SB Mailbox Frame NAK */
37#define I_SMB_INT_ACK I_SMB_SW1 /* To SB Mailbox Host Interrupt ACK */
38#define I_SMB_USE_OOB I_SMB_SW2 /* To SB Mailbox Use OOB Wakeup */
39#define I_SMB_DEV_INT I_SMB_SW3 /* To SB Mailbox Miscellaneous Interrupt */
40
41/* tosbmailbox bits corresponding to intstatus bits */
42#define SMB_NAK (1 << 0) /* To SB Mailbox Frame NAK */
43#define SMB_INT_ACK (1 << 1) /* To SB Mailbox Host Interrupt ACK */
44#define SMB_USE_OOB (1 << 2) /* To SB Mailbox Use OOB Wakeup */
45#define SMB_DEV_INT (1 << 3) /* To SB Mailbox Miscellaneous Interrupt */
46#define SMB_MASK 0x0000000f /* To SB Mailbox Mask */
47
48/* tosbmailboxdata */
49#define SMB_DATA_VERSION_MASK 0x00ff0000 /* host protocol version (sent with F2 enable) */
50#define SMB_DATA_VERSION_SHIFT 16 /* host protocol version (sent with F2 enable) */
51
52/*
53 * Software allocation of To Host Mailbox resources
54 */
55
56/* intstatus bits */
57#define I_HMB_FC_STATE I_HMB_SW0 /* To Host Mailbox Flow Control State */
58#define I_HMB_FC_CHANGE I_HMB_SW1 /* To Host Mailbox Flow Control State Changed */
59#define I_HMB_FRAME_IND I_HMB_SW2 /* To Host Mailbox Frame Indication */
60#define I_HMB_HOST_INT I_HMB_SW3 /* To Host Mailbox Miscellaneous Interrupt */
61
62/* tohostmailbox bits corresponding to intstatus bits */
63#define HMB_FC_ON (1 << 0) /* To Host Mailbox Flow Control State */
64#define HMB_FC_CHANGE (1 << 1) /* To Host Mailbox Flow Control State Changed */
65#define HMB_FRAME_IND (1 << 2) /* To Host Mailbox Frame Indication */
66#define HMB_HOST_INT (1 << 3) /* To Host Mailbox Miscellaneous Interrupt */
67#define HMB_MASK 0x0000000f /* To Host Mailbox Mask */
68
69/* tohostmailboxdata */
70#define HMB_DATA_NAKHANDLED 1 /* we're ready to retransmit NAK'd frame to host */
71#define HMB_DATA_DEVREADY 2 /* we're ready to to talk to host after enable */
72#define HMB_DATA_FC 4 /* per prio flowcontrol update flag to host */
73#define HMB_DATA_FWREADY 8 /* firmware is ready for protocol activity */
74
75#define HMB_DATA_FCDATA_MASK 0xff000000 /* per prio flowcontrol data */
76#define HMB_DATA_FCDATA_SHIFT 24 /* per prio flowcontrol data */
77
78#define HMB_DATA_VERSION_MASK 0x00ff0000 /* device protocol version (with devready) */
79#define HMB_DATA_VERSION_SHIFT 16 /* device protocol version (with devready) */
80
81/*
82 * Software-defined protocol header
83 */
84
85/* Current protocol version */
86#define SDPCM_PROT_VERSION 4
87
88/* SW frame header */
89#define SDPCM_SEQUENCE_MASK 0x000000ff /* Sequence Number Mask */
90#define SDPCM_PACKET_SEQUENCE(p) (((uint8 *)p)[0] & 0xff) /* p starts w/SW Header */
91
92#define SDPCM_CHANNEL_MASK 0x00000f00 /* Channel Number Mask */
93#define SDPCM_CHANNEL_SHIFT 8 /* Channel Number Shift */
94#define SDPCM_PACKET_CHANNEL(p) (((uint8 *)p)[1] & 0x0f) /* p starts w/SW Header */
95
96#define SDPCM_FLAGS_MASK 0x0000f000 /* Mask of flag bits */
97#define SDPCM_FLAGS_SHIFT 12 /* Flag bits shift */
98#define SDPCM_PACKET_FLAGS(p) ((((uint8 *)p)[1] & 0xf0) >> 4) /* p starts w/SW Header */
99
100/* Next Read Len: lookahead length of next frame, in 16-byte units (rounded up) */
101#define SDPCM_NEXTLEN_MASK 0x00ff0000 /* Next Read Len Mask */
102#define SDPCM_NEXTLEN_SHIFT 16 /* Next Read Len Shift */
103#define SDPCM_NEXTLEN_VALUE(p) ((((uint8 *)p)[2] & 0xff) << 4) /* p starts w/SW Header */
104#define SDPCM_NEXTLEN_OFFSET 2
105
106/* Data Offset from SOF (HW Tag, SW Tag, Pad) */
107#define SDPCM_DOFFSET_OFFSET 3 /* Data Offset */
108#define SDPCM_DOFFSET_VALUE(p) (((uint8 *)p)[SDPCM_DOFFSET_OFFSET] & 0xff)
109#define SDPCM_DOFFSET_MASK 0xff000000
110#define SDPCM_DOFFSET_SHIFT 24
111
112#define SDPCM_FCMASK_OFFSET 4 /* Flow control */
113#define SDPCM_FCMASK_VALUE(p) (((uint8 *)p)[SDPCM_FCMASK_OFFSET ] & 0xff)
114#define SDPCM_WINDOW_OFFSET 5 /* Credit based fc */
115#define SDPCM_WINDOW_VALUE(p) (((uint8 *)p)[SDPCM_WINDOW_OFFSET] & 0xff)
116#define SDPCM_VERSION_OFFSET 6 /* Version # */
117#define SDPCM_VERSION_VALUE(p) (((uint8 *)p)[SDPCM_VERSION_OFFSET] & 0xff)
118#define SDPCM_UNUSED_OFFSET 7 /* Spare */
119#define SDPCM_UNUSED_VALUE(p) (((uint8 *)p)[SDPCM_UNUSED_OFFSET] & 0xff)
120
121#define SDPCM_SWHEADER_LEN 8 /* SW header is 64 bits */
122
123/* logical channel numbers */
124#define SDPCM_CONTROL_CHANNEL 0 /* Control Request/Response Channel Id */
125#define SDPCM_EVENT_CHANNEL 1 /* Asyc Event Indication Channel Id */
126#define SDPCM_DATA_CHANNEL 2 /* Data Xmit/Recv Channel Id */
127#define SDPCM_GLOM_CHANNEL 3 /* For coalesced packets (superframes) */
128#define SDPCM_TEST_CHANNEL 15 /* Reserved for test/debug packets */
129#define SDPCM_MAX_CHANNEL 15
130
131#define SDPCM_SEQUENCE_WRAP 256 /* wrap-around val for eight-bit frame seq number */
132
133#define SDPCM_FLAG_RESVD0 0x01
134#define SDPCM_FLAG_RESVD1 0x02
135#define SDPCM_FLAG_GSPI_TXENAB 0x04
136#define SDPCM_FLAG_GLOMDESC 0x08 /* Superframe descriptor mask */
137
138/* For GLOM_CHANNEL frames, use a flag to indicate descriptor frame */
139#define SDPCM_GLOMDESC_FLAG (SDPCM_FLAG_GLOMDESC << SDPCM_FLAGS_SHIFT)
140
141#define SDPCM_GLOMDESC(p) (((uint8 *)p)[1] & 0x80)
142
143/* For TEST_CHANNEL packets, define another 4-byte header */
144#define SDPCM_TEST_HDRLEN 4 /* Generally: Cmd(1), Ext(1), Len(2);
145 * Semantics of Ext byte depend on command.
146 * Len is current or requested frame length, not
147 * including test header; sent little-endian.
148 */
149#define SDPCM_TEST_DISCARD 0x01 /* Receiver discards. Ext is a pattern id. */
150#define SDPCM_TEST_ECHOREQ 0x02 /* Echo request. Ext is a pattern id. */
151#define SDPCM_TEST_ECHORSP 0x03 /* Echo response. Ext is a pattern id. */
152#define SDPCM_TEST_BURST 0x04 /* Receiver to send a burst. Ext is a frame count */
153#define SDPCM_TEST_SEND 0x05 /* Receiver sets send mode. Ext is boolean on/off */
154
155/* Handy macro for filling in datagen packets with a pattern */
156#define SDPCM_TEST_FILL(byteno, id) ((uint8)(id + byteno))
157
158/*
159 * Software counters (first part matches hardware counters)
160 */
161
162typedef volatile struct {
163 uint32 cmd52rd; /* Cmd52RdCount, SDIO: cmd52 reads */
164 uint32 cmd52wr; /* Cmd52WrCount, SDIO: cmd52 writes */
165 uint32 cmd53rd; /* Cmd53RdCount, SDIO: cmd53 reads */
166 uint32 cmd53wr; /* Cmd53WrCount, SDIO: cmd53 writes */
167 uint32 abort; /* AbortCount, SDIO: aborts */
168 uint32 datacrcerror; /* DataCrcErrorCount, SDIO: frames w/CRC error */
169 uint32 rdoutofsync; /* RdOutOfSyncCount, SDIO/PCMCIA: Rd Frm out of sync */
170 uint32 wroutofsync; /* RdOutOfSyncCount, SDIO/PCMCIA: Wr Frm out of sync */
171 uint32 writebusy; /* WriteBusyCount, SDIO: device asserted "busy" */
172 uint32 readwait; /* ReadWaitCount, SDIO: no data ready for a read cmd */
173 uint32 readterm; /* ReadTermCount, SDIO: read frame termination cmds */
174 uint32 writeterm; /* WriteTermCount, SDIO: write frames termination cmds */
175 uint32 rxdescuflo; /* receive descriptor underflows */
176 uint32 rxfifooflo; /* receive fifo overflows */
177 uint32 txfifouflo; /* transmit fifo underflows */
178 uint32 runt; /* runt (too short) frames recv'd from bus */
179 uint32 badlen; /* frame's rxh len does not match its hw tag len */
180 uint32 badcksum; /* frame's hw tag chksum doesn't agree with len value */
181 uint32 seqbreak; /* break in sequence # space from one rx frame to the next */
182 uint32 rxfcrc; /* frame rx header indicates crc error */
183 uint32 rxfwoos; /* frame rx header indicates write out of sync */
184 uint32 rxfwft; /* frame rx header indicates write frame termination */
185 uint32 rxfabort; /* frame rx header indicates frame aborted */
186 uint32 woosint; /* write out of sync interrupt */
187 uint32 roosint; /* read out of sync interrupt */
188 uint32 rftermint; /* read frame terminate interrupt */
189 uint32 wftermint; /* write frame terminate interrupt */
190} sdpcmd_cnt_t;
191
192/*
193 * Register Access Macros
194 */
195
196#define SDIODREV_IS(var, val) ((var) == (val))
197#define SDIODREV_GE(var, val) ((var) >= (val))
198#define SDIODREV_GT(var, val) ((var) > (val))
199#define SDIODREV_LT(var, val) ((var) < (val))
200#define SDIODREV_LE(var, val) ((var) <= (val))
201
202#define SDIODDMAREG32(h, dir, chnl) \
203 ((dir) == DMA_TX ? \
204 (void *)(uintptr)&((h)->regs->dma.sdiod32.dma32regs[chnl].xmt) : \
205 (void *)(uintptr)&((h)->regs->dma.sdiod32.dma32regs[chnl].rcv))
206
207#define SDIODDMAREG64(h, dir, chnl) \
208 ((dir) == DMA_TX ? \
209 (void *)(uintptr)&((h)->regs->dma.sdiod64.dma64regs[chnl].xmt) : \
210 (void *)(uintptr)&((h)->regs->dma.sdiod64.dma64regs[chnl].rcv))
211
212#define SDIODDMAREG(h, dir, chnl) \
213 (SDIODREV_LT((h)->corerev, 1) ? \
214 SDIODDMAREG32((h), (dir), (chnl)) : \
215 SDIODDMAREG64((h), (dir), (chnl)))
216
217#define PCMDDMAREG(h, dir, chnl) \
218 ((dir) == DMA_TX ? \
219 (void *)(uintptr)&((h)->regs->dma.pcm32.dmaregs.xmt) : \
220 (void *)(uintptr)&((h)->regs->dma.pcm32.dmaregs.rcv))
221
222#define SDPCMDMAREG(h, dir, chnl, coreid) \
223 ((coreid) == SDIOD_CORE_ID ? \
224 SDIODDMAREG(h, dir, chnl) : \
225 PCMDDMAREG(h, dir, chnl))
226
227#define SDIODFIFOREG(h, corerev) \
228 (SDIODREV_LT((corerev), 1) ? \
229 ((dma32diag_t *)(uintptr)&((h)->regs->dma.sdiod32.dmafifo)) : \
230 ((dma32diag_t *)(uintptr)&((h)->regs->dma.sdiod64.dmafifo)))
231
232#define PCMDFIFOREG(h) \
233 ((dma32diag_t *)(uintptr)&((h)->regs->dma.pcm32.dmafifo))
234
235#define SDPCMFIFOREG(h, coreid, corerev) \
236 ((coreid) == SDIOD_CORE_ID ? \
237 SDIODFIFOREG(h, corerev) : \
238 PCMDFIFOREG(h))
239
240/*
241 * Shared structure between dongle and the host
242 * The structure contains pointers to trap or assert information shared with the host
243 */
244#define SDPCM_SHARED_VERSION 0x0002
245#define SDPCM_SHARED_VERSION_MASK 0x00FF
246#define SDPCM_SHARED_ASSERT_BUILT 0x0100
247#define SDPCM_SHARED_ASSERT 0x0200
248#define SDPCM_SHARED_TRAP 0x0400
249
250typedef struct {
251 uint32 flags;
252 uint32 trap_addr;
253 uint32 assert_exp_addr;
254 uint32 assert_file_addr;
255 uint32 assert_line;
256 uint32 console_addr; /* Address of hndrte_cons_t */
257 uint32 msgtrace_addr;
258 uint8 tag[32];
259} sdpcm_shared_t;
260
261extern sdpcm_shared_t sdpcm_shared;
262
263#endif /* _bcmsdpcm_h_ */
diff --git a/drivers/net/wireless/bcm4329/include/bcmsdspi.h b/drivers/net/wireless/bcm4329/include/bcmsdspi.h
new file mode 100644
index 00000000000..eaae10d8bf1
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/bcmsdspi.h
@@ -0,0 +1,131 @@
1/*
2 * SD-SPI Protocol Conversion - BCMSDH->SPI Translation Layer
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: bcmsdspi.h,v 13.8.10.2 2008/06/30 21:09:40 Exp $
25 */
26
27/* global msglevel for debug messages - bitvals come from sdiovar.h */
28
29#define sd_err(x)
30#define sd_trace(x)
31#define sd_info(x)
32#define sd_debug(x)
33#define sd_data(x)
34#define sd_ctrl(x)
35
36#define sd_log(x)
37
38#define SDIOH_ASSERT(exp) \
39 do { if (!(exp)) \
40 printf("!!!ASSERT fail: file %s lines %d", __FILE__, __LINE__); \
41 } while (0)
42
43#define BLOCK_SIZE_4318 64
44#define BLOCK_SIZE_4328 512
45
46/* internal return code */
47#define SUCCESS 0
48#undef ERROR
49#define ERROR 1
50
51/* private bus modes */
52#define SDIOH_MODE_SPI 0
53
54#define USE_BLOCKMODE 0x2 /* Block mode can be single block or multi */
55#define USE_MULTIBLOCK 0x4
56
57struct sdioh_info {
58 uint cfg_bar; /* pci cfg address for bar */
59 uint32 caps; /* cached value of capabilities reg */
60 uint bar0; /* BAR0 for PCI Device */
61 osl_t *osh; /* osh handler */
62 void *controller; /* Pointer to SPI Controller's private data struct */
63
64 uint lockcount; /* nest count of sdspi_lock() calls */
65 bool client_intr_enabled; /* interrupt connnected flag */
66 bool intr_handler_valid; /* client driver interrupt handler valid */
67 sdioh_cb_fn_t intr_handler; /* registered interrupt handler */
68 void *intr_handler_arg; /* argument to call interrupt handler */
69 bool initialized; /* card initialized */
70 uint32 target_dev; /* Target device ID */
71 uint32 intmask; /* Current active interrupts */
72 void *sdos_info; /* Pointer to per-OS private data */
73
74 uint32 controller_type; /* Host controller type */
75 uint8 version; /* Host Controller Spec Compliance Version */
76 uint irq; /* Client irq */
77 uint32 intrcount; /* Client interrupts */
78 uint32 local_intrcount; /* Controller interrupts */
79 bool host_init_done; /* Controller initted */
80 bool card_init_done; /* Client SDIO interface initted */
81 bool polled_mode; /* polling for command completion */
82
83 bool sd_use_dma; /* DMA on CMD53 */
84 bool sd_blockmode; /* sd_blockmode == FALSE => 64 Byte Cmd 53s. */
85 /* Must be on for sd_multiblock to be effective */
86 bool use_client_ints; /* If this is false, make sure to restore */
87 bool got_hcint; /* Host Controller interrupt. */
88 /* polling hack in wl_linux.c:wl_timer() */
89 int adapter_slot; /* Maybe dealing with multiple slots/controllers */
90 int sd_mode; /* SD1/SD4/SPI */
91 int client_block_size[SDIOD_MAX_IOFUNCS]; /* Blocksize */
92 uint32 data_xfer_count; /* Current register transfer size */
93 uint32 cmd53_wr_data; /* Used to pass CMD53 write data */
94 uint32 card_response; /* Used to pass back response status byte */
95 uint32 card_rsp_data; /* Used to pass back response data word */
96 uint16 card_rca; /* Current Address */
97 uint8 num_funcs; /* Supported funcs on client */
98 uint32 com_cis_ptr;
99 uint32 func_cis_ptr[SDIOD_MAX_IOFUNCS];
100 void *dma_buf;
101 ulong dma_phys;
102 int r_cnt; /* rx count */
103 int t_cnt; /* tx_count */
104};
105
106/************************************************************
107 * Internal interfaces: per-port references into bcmsdspi.c
108 */
109
110/* Global message bits */
111extern uint sd_msglevel;
112
113/**************************************************************
114 * Internal interfaces: bcmsdspi.c references to per-port code
115 */
116
117/* Register mapping routines */
118extern uint32 *spi_reg_map(osl_t *osh, uintptr addr, int size);
119extern void spi_reg_unmap(osl_t *osh, uintptr addr, int size);
120
121/* Interrupt (de)registration routines */
122extern int spi_register_irq(sdioh_info_t *sd, uint irq);
123extern void spi_free_irq(uint irq, sdioh_info_t *sd);
124
125/* OS-specific interrupt wrappers (atomic interrupt enable/disable) */
126extern void spi_lock(sdioh_info_t *sd);
127extern void spi_unlock(sdioh_info_t *sd);
128
129/* Allocate/init/free per-OS private data */
130extern int spi_osinit(sdioh_info_t *sd);
131extern void spi_osfree(sdioh_info_t *sd);
diff --git a/drivers/net/wireless/bcm4329/include/bcmsdstd.h b/drivers/net/wireless/bcm4329/include/bcmsdstd.h
new file mode 100644
index 00000000000..974b3d41698
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/bcmsdstd.h
@@ -0,0 +1,223 @@
1/*
2 * 'Standard' SDIO HOST CONTROLLER driver
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: bcmsdstd.h,v 13.16.18.1.16.3 2009/12/10 01:09:23 Exp $
25 */
26
27/* global msglevel for debug messages - bitvals come from sdiovar.h */
28
29#define sd_err(x) do { if (sd_msglevel & SDH_ERROR_VAL) printf x; } while (0)
30#define sd_trace(x)
31#define sd_info(x)
32#define sd_debug(x)
33#define sd_data(x)
34#define sd_ctrl(x)
35#define sd_dma(x)
36
37#define sd_sync_dma(sd, read, nbytes)
38#define sd_init_dma(sd)
39#define sd_ack_intr(sd)
40#define sd_wakeup(sd);
41/* Allocate/init/free per-OS private data */
42extern int sdstd_osinit(sdioh_info_t *sd);
43extern void sdstd_osfree(sdioh_info_t *sd);
44
45#define sd_log(x)
46
47#define SDIOH_ASSERT(exp) \
48 do { if (!(exp)) \
49 printf("!!!ASSERT fail: file %s lines %d", __FILE__, __LINE__); \
50 } while (0)
51
52#define BLOCK_SIZE_4318 64
53#define BLOCK_SIZE_4328 512
54
55/* internal return code */
56#define SUCCESS 0
57#define ERROR 1
58
59/* private bus modes */
60#define SDIOH_MODE_SPI 0
61#define SDIOH_MODE_SD1 1
62#define SDIOH_MODE_SD4 2
63
64#define MAX_SLOTS 6 /* For PCI: Only 6 BAR entries => 6 slots */
65#define SDIOH_REG_WINSZ 0x100 /* Number of registers in Standard Host Controller */
66
67#define SDIOH_TYPE_ARASAN_HDK 1
68#define SDIOH_TYPE_BCM27XX 2
69#define SDIOH_TYPE_TI_PCIXX21 4 /* TI PCIxx21 Standard Host Controller */
70#define SDIOH_TYPE_RICOH_R5C822 5 /* Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter */
71#define SDIOH_TYPE_JMICRON 6 /* JMicron Standard SDIO Host Controller */
72
73/* For linux, allow yielding for dongle */
74#define BCMSDYIELD
75
76/* Expected card status value for CMD7 */
77#define SDIOH_CMD7_EXP_STATUS 0x00001E00
78
79#define RETRIES_LARGE 100000
80#define RETRIES_SMALL 100
81
82
83#define USE_BLOCKMODE 0x2 /* Block mode can be single block or multi */
84#define USE_MULTIBLOCK 0x4
85
86#define USE_FIFO 0x8 /* Fifo vs non-fifo */
87
88#define CLIENT_INTR 0x100 /* Get rid of this! */
89
90
91struct sdioh_info {
92 uint cfg_bar; /* pci cfg address for bar */
93 uint32 caps; /* cached value of capabilities reg */
94 uint32 curr_caps; /* max current capabilities reg */
95
96 osl_t *osh; /* osh handler */
97 volatile char *mem_space; /* pci device memory va */
98 uint lockcount; /* nest count of sdstd_lock() calls */
99 bool client_intr_enabled; /* interrupt connnected flag */
100 bool intr_handler_valid; /* client driver interrupt handler valid */
101 sdioh_cb_fn_t intr_handler; /* registered interrupt handler */
102 void *intr_handler_arg; /* argument to call interrupt handler */
103 bool initialized; /* card initialized */
104 uint target_dev; /* Target device ID */
105 uint16 intmask; /* Current active interrupts */
106 void *sdos_info; /* Pointer to per-OS private data */
107
108 uint32 controller_type; /* Host controller type */
109 uint8 version; /* Host Controller Spec Compliance Version */
110 uint irq; /* Client irq */
111 int intrcount; /* Client interrupts */
112 int local_intrcount; /* Controller interrupts */
113 bool host_init_done; /* Controller initted */
114 bool card_init_done; /* Client SDIO interface initted */
115 bool polled_mode; /* polling for command completion */
116
117 bool sd_blockmode; /* sd_blockmode == FALSE => 64 Byte Cmd 53s. */
118 /* Must be on for sd_multiblock to be effective */
119 bool use_client_ints; /* If this is false, make sure to restore */
120 /* polling hack in wl_linux.c:wl_timer() */
121 int adapter_slot; /* Maybe dealing with multiple slots/controllers */
122 int sd_mode; /* SD1/SD4/SPI */
123 int client_block_size[SDIOD_MAX_IOFUNCS]; /* Blocksize */
124 uint32 data_xfer_count; /* Current transfer */
125 uint16 card_rca; /* Current Address */
126 int8 sd_dma_mode; /* DMA Mode (PIO, SDMA, ... ADMA2) on CMD53 */
127 uint8 num_funcs; /* Supported funcs on client */
128 uint32 com_cis_ptr;
129 uint32 func_cis_ptr[SDIOD_MAX_IOFUNCS];
130 void *dma_buf; /* DMA Buffer virtual address */
131 ulong dma_phys; /* DMA Buffer physical address */
132 void *adma2_dscr_buf; /* ADMA2 Descriptor Buffer virtual address */
133 ulong adma2_dscr_phys; /* ADMA2 Descriptor Buffer physical address */
134
135 /* adjustments needed to make the dma align properly */
136 void *dma_start_buf;
137 ulong dma_start_phys;
138 uint alloced_dma_size;
139 void *adma2_dscr_start_buf;
140 ulong adma2_dscr_start_phys;
141 uint alloced_adma2_dscr_size;
142
143 int r_cnt; /* rx count */
144 int t_cnt; /* tx_count */
145 bool got_hcint; /* local interrupt flag */
146 uint16 last_intrstatus; /* to cache intrstatus */
147};
148
149#define DMA_MODE_NONE 0
150#define DMA_MODE_SDMA 1
151#define DMA_MODE_ADMA1 2
152#define DMA_MODE_ADMA2 3
153#define DMA_MODE_ADMA2_64 4
154#define DMA_MODE_AUTO -1
155
156#define USE_DMA(sd) ((bool)((sd->sd_dma_mode > 0) ? TRUE : FALSE))
157
158/* SDIO Host Control Register DMA Mode Definitions */
159#define SDIOH_SDMA_MODE 0
160#define SDIOH_ADMA1_MODE 1
161#define SDIOH_ADMA2_MODE 2
162#define SDIOH_ADMA2_64_MODE 3
163
164#define ADMA2_ATTRIBUTE_VALID (1 << 0) /* ADMA Descriptor line valid */
165#define ADMA2_ATTRIBUTE_END (1 << 1) /* End of Descriptor */
166#define ADMA2_ATTRIBUTE_INT (1 << 2) /* Interrupt when line is done */
167#define ADMA2_ATTRIBUTE_ACT_NOP (0 << 4) /* Skip current line, go to next. */
168#define ADMA2_ATTRIBUTE_ACT_RSV (1 << 4) /* Same as NOP */
169#define ADMA1_ATTRIBUTE_ACT_SET (1 << 4) /* ADMA1 Only - set transfer length */
170#define ADMA2_ATTRIBUTE_ACT_TRAN (2 << 4) /* Transfer Data of one descriptor line. */
171#define ADMA2_ATTRIBUTE_ACT_LINK (3 << 4) /* Link Descriptor */
172
173/* ADMA2 Descriptor Table Entry for 32-bit Address */
174typedef struct adma2_dscr_32b {
175 uint32 len_attr;
176 uint32 phys_addr;
177} adma2_dscr_32b_t;
178
179/* ADMA1 Descriptor Table Entry */
180typedef struct adma1_dscr {
181 uint32 phys_addr_attr;
182} adma1_dscr_t;
183
184/************************************************************
185 * Internal interfaces: per-port references into bcmsdstd.c
186 */
187
188/* Global message bits */
189extern uint sd_msglevel;
190
191/* OS-independent interrupt handler */
192extern bool check_client_intr(sdioh_info_t *sd);
193
194/* Core interrupt enable/disable of device interrupts */
195extern void sdstd_devintr_on(sdioh_info_t *sd);
196extern void sdstd_devintr_off(sdioh_info_t *sd);
197
198/* Enable/disable interrupts for local controller events */
199extern void sdstd_intrs_on(sdioh_info_t *sd, uint16 norm, uint16 err);
200extern void sdstd_intrs_off(sdioh_info_t *sd, uint16 norm, uint16 err);
201
202/* Wait for specified interrupt and error bits to be set */
203extern void sdstd_spinbits(sdioh_info_t *sd, uint16 norm, uint16 err);
204
205
206/**************************************************************
207 * Internal interfaces: bcmsdstd.c references to per-port code
208 */
209
210/* Register mapping routines */
211extern uint32 *sdstd_reg_map(osl_t *osh, int32 addr, int size);
212extern void sdstd_reg_unmap(osl_t *osh, int32 addr, int size);
213
214/* Interrupt (de)registration routines */
215extern int sdstd_register_irq(sdioh_info_t *sd, uint irq);
216extern void sdstd_free_irq(uint irq, sdioh_info_t *sd);
217
218/* OS-specific interrupt wrappers (atomic interrupt enable/disable) */
219extern void sdstd_lock(sdioh_info_t *sd);
220extern void sdstd_unlock(sdioh_info_t *sd);
221
222/* OS-specific wait-for-interrupt-or-status */
223extern uint16 sdstd_waitbits(sdioh_info_t *sd, uint16 norm, uint16 err, bool yield);
diff --git a/drivers/net/wireless/bcm4329/include/bcmspi.h b/drivers/net/wireless/bcm4329/include/bcmspi.h
new file mode 100644
index 00000000000..2e2bc935716
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/bcmspi.h
@@ -0,0 +1,36 @@
1/*
2 * Broadcom SPI Low-Level Hardware Driver API
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: bcmspi.h,v 13.3.10.2 2008/06/30 21:09:40 Exp $
25 */
26
27extern void spi_devintr_off(sdioh_info_t *sd);
28extern void spi_devintr_on(sdioh_info_t *sd);
29extern bool spi_start_clock(sdioh_info_t *sd, uint16 new_sd_divisor);
30extern bool spi_controller_highspeed_mode(sdioh_info_t *sd, bool hsmode);
31extern bool spi_check_client_intr(sdioh_info_t *sd, int *is_dev_intr);
32extern bool spi_hw_attach(sdioh_info_t *sd);
33extern bool spi_hw_detach(sdioh_info_t *sd);
34extern void spi_sendrecv(sdioh_info_t *sd, uint8 *msg_out, uint8 *msg_in, int msglen);
35extern void spi_spinbits(sdioh_info_t *sd);
36extern void spi_waitbits(sdioh_info_t *sd, bool yield);
diff --git a/drivers/net/wireless/bcm4329/include/bcmspibrcm.h b/drivers/net/wireless/bcm4329/include/bcmspibrcm.h
new file mode 100644
index 00000000000..9dce878d11e
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/bcmspibrcm.h
@@ -0,0 +1,134 @@
1/*
2 * SD-SPI Protocol Conversion - BCMSDH->gSPI Translation Layer
3 *
4 * Copyright (C) 2010, Broadcom Corporation
5 * All Rights Reserved.
6 *
7 * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation;
8 * the contents of this file may not be disclosed to third parties, copied
9 * or duplicated in any form, in whole or in part, without the prior
10 * written permission of Broadcom Corporation.
11 *
12 * $Id: bcmspibrcm.h,v 1.4.4.1.4.3.6.1 2008/09/27 17:03:25 Exp $
13 */
14
15/* global msglevel for debug messages - bitvals come from sdiovar.h */
16
17#define sd_err(x)
18#define sd_trace(x)
19#define sd_info(x)
20#define sd_debug(x)
21#define sd_data(x)
22#define sd_ctrl(x)
23
24#define sd_log(x)
25
26#define SDIOH_ASSERT(exp) \
27 do { if (!(exp)) \
28 printf("!!!ASSERT fail: file %s lines %d", __FILE__, __LINE__); \
29 } while (0)
30
31#define BLOCK_SIZE_F1 64
32#define BLOCK_SIZE_F2 2048
33#define BLOCK_SIZE_F3 2048
34
35/* internal return code */
36#define SUCCESS 0
37#undef ERROR
38#define ERROR 1
39#define ERROR_UF 2
40#define ERROR_OF 3
41
42/* private bus modes */
43#define SDIOH_MODE_SPI 0
44
45#define USE_BLOCKMODE 0x2 /* Block mode can be single block or multi */
46#define USE_MULTIBLOCK 0x4
47
48struct sdioh_info {
49 uint cfg_bar; /* pci cfg address for bar */
50 uint32 caps; /* cached value of capabilities reg */
51 void *bar0; /* BAR0 for PCI Device */
52 osl_t *osh; /* osh handler */
53 void *controller; /* Pointer to SPI Controller's private data struct */
54
55 uint lockcount; /* nest count of spi_lock() calls */
56 bool client_intr_enabled; /* interrupt connnected flag */
57 bool intr_handler_valid; /* client driver interrupt handler valid */
58 sdioh_cb_fn_t intr_handler; /* registered interrupt handler */
59 void *intr_handler_arg; /* argument to call interrupt handler */
60 bool initialized; /* card initialized */
61 uint32 target_dev; /* Target device ID */
62 uint32 intmask; /* Current active interrupts */
63 void *sdos_info; /* Pointer to per-OS private data */
64
65 uint32 controller_type; /* Host controller type */
66 uint8 version; /* Host Controller Spec Compliance Version */
67 uint irq; /* Client irq */
68 uint32 intrcount; /* Client interrupts */
69 uint32 local_intrcount; /* Controller interrupts */
70 bool host_init_done; /* Controller initted */
71 bool card_init_done; /* Client SDIO interface initted */
72 bool polled_mode; /* polling for command completion */
73
74 bool sd_use_dma; /* DMA on CMD53 */
75 bool sd_blockmode; /* sd_blockmode == FALSE => 64 Byte Cmd 53s. */
76 /* Must be on for sd_multiblock to be effective */
77 bool use_client_ints; /* If this is false, make sure to restore */
78 /* polling hack in wl_linux.c:wl_timer() */
79 int adapter_slot; /* Maybe dealing with multiple slots/controllers */
80 int sd_mode; /* SD1/SD4/SPI */
81 int client_block_size[SPI_MAX_IOFUNCS]; /* Blocksize */
82 uint32 data_xfer_count; /* Current transfer */
83 uint16 card_rca; /* Current Address */
84 uint8 num_funcs; /* Supported funcs on client */
85 uint32 card_dstatus; /* 32bit device status */
86 uint32 com_cis_ptr;
87 uint32 func_cis_ptr[SPI_MAX_IOFUNCS];
88 void *dma_buf;
89 ulong dma_phys;
90 int r_cnt; /* rx count */
91 int t_cnt; /* tx_count */
92 uint32 wordlen; /* host processor 16/32bits */
93 uint32 prev_fun;
94 uint32 chip;
95 uint32 chiprev;
96 bool resp_delay_all;
97 bool dwordmode;
98
99 struct spierrstats_t spierrstats;
100};
101
102/************************************************************
103 * Internal interfaces: per-port references into bcmspibrcm.c
104 */
105
106/* Global message bits */
107extern uint sd_msglevel;
108
109/**************************************************************
110 * Internal interfaces: bcmspibrcm.c references to per-port code
111 */
112
113/* Interrupt (de)registration routines */
114extern int spi_register_irq(sdioh_info_t *sd, uint irq);
115extern void spi_free_irq(uint irq, sdioh_info_t *sd);
116
117/* OS-specific interrupt wrappers (atomic interrupt enable/disable) */
118extern void spi_lock(sdioh_info_t *sd);
119extern void spi_unlock(sdioh_info_t *sd);
120
121/* Allocate/init/free per-OS private data */
122extern int spi_osinit(sdioh_info_t *sd);
123extern void spi_osfree(sdioh_info_t *sd);
124
125#define SPI_RW_FLAG_M BITFIELD_MASK(1) /* Bit [31] - R/W Command Bit */
126#define SPI_RW_FLAG_S 31
127#define SPI_ACCESS_M BITFIELD_MASK(1) /* Bit [30] - Fixed/Incr Access */
128#define SPI_ACCESS_S 30
129#define SPI_FUNCTION_M BITFIELD_MASK(2) /* Bit [29:28] - Function Number */
130#define SPI_FUNCTION_S 28
131#define SPI_REG_ADDR_M BITFIELD_MASK(17) /* Bit [27:11] - Address */
132#define SPI_REG_ADDR_S 11
133#define SPI_LEN_M BITFIELD_MASK(11) /* Bit [10:0] - Packet length */
134#define SPI_LEN_S 0
diff --git a/drivers/net/wireless/bcm4329/include/bcmutils.h b/drivers/net/wireless/bcm4329/include/bcmutils.h
new file mode 100644
index 00000000000..f85ed351d66
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/bcmutils.h
@@ -0,0 +1,637 @@
1/*
2 * Misc useful os-independent macros and functions.
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 * $Id: bcmutils.h,v 13.184.4.6.2.1.18.25 2010/04/26 06:05:24 Exp $
24 */
25
26
27#ifndef _bcmutils_h_
28#define _bcmutils_h_
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34
35#define _BCM_U 0x01
36#define _BCM_L 0x02
37#define _BCM_D 0x04
38#define _BCM_C 0x08
39#define _BCM_P 0x10
40#define _BCM_S 0x20
41#define _BCM_X 0x40
42#define _BCM_SP 0x80
43
44extern const unsigned char bcm_ctype[];
45#define bcm_ismask(x) (bcm_ctype[(int)(unsigned char)(x)])
46
47#define bcm_isalnum(c) ((bcm_ismask(c)&(_BCM_U|_BCM_L|_BCM_D)) != 0)
48#define bcm_isalpha(c) ((bcm_ismask(c)&(_BCM_U|_BCM_L)) != 0)
49#define bcm_iscntrl(c) ((bcm_ismask(c)&(_BCM_C)) != 0)
50#define bcm_isdigit(c) ((bcm_ismask(c)&(_BCM_D)) != 0)
51#define bcm_isgraph(c) ((bcm_ismask(c)&(_BCM_P|_BCM_U|_BCM_L|_BCM_D)) != 0)
52#define bcm_islower(c) ((bcm_ismask(c)&(_BCM_L)) != 0)
53#define bcm_isprint(c) ((bcm_ismask(c)&(_BCM_P|_BCM_U|_BCM_L|_BCM_D|_BCM_SP)) != 0)
54#define bcm_ispunct(c) ((bcm_ismask(c)&(_BCM_P)) != 0)
55#define bcm_isspace(c) ((bcm_ismask(c)&(_BCM_S)) != 0)
56#define bcm_isupper(c) ((bcm_ismask(c)&(_BCM_U)) != 0)
57#define bcm_isxdigit(c) ((bcm_ismask(c)&(_BCM_D|_BCM_X)) != 0)
58#define bcm_tolower(c) (bcm_isupper((c)) ? ((c) + 'a' - 'A') : (c))
59#define bcm_toupper(c) (bcm_islower((c)) ? ((c) + 'A' - 'a') : (c))
60
61
62
63struct bcmstrbuf {
64 char *buf;
65 unsigned int size;
66 char *origbuf;
67 unsigned int origsize;
68};
69
70
71#ifdef BCMDRIVER
72#include <osl.h>
73
74#define GPIO_PIN_NOTDEFINED 0x20
75
76
77#define SPINWAIT(exp, us) { \
78 uint countdown = (us) + 9; \
79 while ((exp) && (countdown >= 10)) {\
80 OSL_DELAY(10); \
81 countdown -= 10; \
82 } \
83}
84
85
86
87#ifndef PKTQ_LEN_DEFAULT
88#define PKTQ_LEN_DEFAULT 128
89#endif
90#ifndef PKTQ_MAX_PREC
91#define PKTQ_MAX_PREC 16
92#endif
93
94typedef struct pktq_prec {
95 void *head;
96 void *tail;
97 uint16 len;
98 uint16 max;
99} pktq_prec_t;
100
101
102
103struct pktq {
104 uint16 num_prec;
105 uint16 hi_prec;
106 uint16 max;
107 uint16 len;
108
109 struct pktq_prec q[PKTQ_MAX_PREC];
110};
111
112
113struct spktq {
114 uint16 num_prec;
115 uint16 hi_prec;
116 uint16 max;
117 uint16 len;
118
119 struct pktq_prec q[1];
120};
121
122#define PKTQ_PREC_ITER(pq, prec) for (prec = (pq)->num_prec - 1; prec >= 0; prec--)
123
124
125
126
127struct ether_addr;
128
129extern int ether_isbcast(const void *ea);
130extern int ether_isnulladdr(const void *ea);
131
132
133
134#define pktq_psetmax(pq, prec, _max) ((pq)->q[prec].max = (_max))
135#define pktq_plen(pq, prec) ((pq)->q[prec].len)
136#define pktq_pavail(pq, prec) ((pq)->q[prec].max - (pq)->q[prec].len)
137#define pktq_pfull(pq, prec) ((pq)->q[prec].len >= (pq)->q[prec].max)
138#define pktq_pempty(pq, prec) ((pq)->q[prec].len == 0)
139
140#define pktq_ppeek(pq, prec) ((pq)->q[prec].head)
141#define pktq_ppeek_tail(pq, prec) ((pq)->q[prec].tail)
142
143extern void *pktq_penq(struct pktq *pq, int prec, void *p);
144extern void *pktq_penq_head(struct pktq *pq, int prec, void *p);
145extern void *pktq_pdeq(struct pktq *pq, int prec);
146extern void *pktq_pdeq_tail(struct pktq *pq, int prec);
147
148extern bool pktq_pdel(struct pktq *pq, void *p, int prec);
149
150
151extern void pktq_pflush(osl_t *osh, struct pktq *pq, int prec, bool dir);
152
153extern void pktq_flush(osl_t *osh, struct pktq *pq, bool dir);
154
155
156
157extern int pktq_mlen(struct pktq *pq, uint prec_bmp);
158extern void *pktq_mdeq(struct pktq *pq, uint prec_bmp, int *prec_out);
159
160
161
162#define pktq_len(pq) ((int)(pq)->len)
163#define pktq_max(pq) ((int)(pq)->max)
164#define pktq_avail(pq) ((int)((pq)->max - (pq)->len))
165#define pktq_full(pq) ((pq)->len >= (pq)->max)
166#define pktq_empty(pq) ((pq)->len == 0)
167
168
169#define pktenq(pq, p) pktq_penq(((struct pktq *)pq), 0, (p))
170#define pktenq_head(pq, p) pktq_penq_head(((struct pktq *)pq), 0, (p))
171#define pktdeq(pq) pktq_pdeq(((struct pktq *)pq), 0)
172#define pktdeq_tail(pq) pktq_pdeq_tail(((struct pktq *)pq), 0)
173#define pktqinit(pq, len) pktq_init(((struct pktq *)pq), 1, len)
174
175extern void pktq_init(struct pktq *pq, int num_prec, int max_len);
176
177extern void *pktq_deq(struct pktq *pq, int *prec_out);
178extern void *pktq_deq_tail(struct pktq *pq, int *prec_out);
179extern void *pktq_peek(struct pktq *pq, int *prec_out);
180extern void *pktq_peek_tail(struct pktq *pq, int *prec_out);
181
182
183
184extern uint pktcopy(osl_t *osh, void *p, uint offset, int len, uchar *buf);
185extern uint pktfrombuf(osl_t *osh, void *p, uint offset, int len, uchar *buf);
186extern uint pkttotlen(osl_t *osh, void *p);
187extern void *pktlast(osl_t *osh, void *p);
188extern uint pktsegcnt(osl_t *osh, void *p);
189
190
191extern uint pktsetprio(void *pkt, bool update_vtag);
192#define PKTPRIO_VDSCP 0x100
193#define PKTPRIO_VLAN 0x200
194#define PKTPRIO_UPD 0x400
195#define PKTPRIO_DSCP 0x800
196
197
198extern int bcm_atoi(char *s);
199extern ulong bcm_strtoul(char *cp, char **endp, uint base);
200extern char *bcmstrstr(char *haystack, char *needle);
201extern char *bcmstrcat(char *dest, const char *src);
202extern char *bcmstrncat(char *dest, const char *src, uint size);
203extern ulong wchar2ascii(char *abuf, ushort *wbuf, ushort wbuflen, ulong abuflen);
204char* bcmstrtok(char **string, const char *delimiters, char *tokdelim);
205int bcmstricmp(const char *s1, const char *s2);
206int bcmstrnicmp(const char* s1, const char* s2, int cnt);
207
208
209
210extern char *bcm_ether_ntoa(const struct ether_addr *ea, char *buf);
211extern int bcm_ether_atoe(char *p, struct ether_addr *ea);
212
213
214struct ipv4_addr;
215extern char *bcm_ip_ntoa(struct ipv4_addr *ia, char *buf);
216
217
218extern void bcm_mdelay(uint ms);
219
220extern char *getvar(char *vars, const char *name);
221extern int getintvar(char *vars, const char *name);
222extern uint getgpiopin(char *vars, char *pin_name, uint def_pin);
223#define bcm_perf_enable()
224#define bcmstats(fmt)
225#define bcmlog(fmt, a1, a2)
226#define bcmdumplog(buf, size) *buf = '\0'
227#define bcmdumplogent(buf, idx) -1
228
229#define bcmtslog(tstamp, fmt, a1, a2)
230#define bcmprinttslogs()
231#define bcmprinttstamp(us)
232
233
234
235
236typedef struct bcm_iovar {
237 const char *name;
238 uint16 varid;
239 uint16 flags;
240 uint16 type;
241 uint16 minlen;
242} bcm_iovar_t;
243
244
245
246
247#define IOV_GET 0
248#define IOV_SET 1
249
250
251#define IOV_GVAL(id) ((id)*2)
252#define IOV_SVAL(id) (((id)*2)+IOV_SET)
253#define IOV_ISSET(actionid) ((actionid & IOV_SET) == IOV_SET)
254
255
256
257extern const bcm_iovar_t *bcm_iovar_lookup(const bcm_iovar_t *table, const char *name);
258extern int bcm_iovar_lencheck(const bcm_iovar_t *table, void *arg, int len, bool set);
259
260#endif
261
262
263#define IOVT_VOID 0
264#define IOVT_BOOL 1
265#define IOVT_INT8 2
266#define IOVT_UINT8 3
267#define IOVT_INT16 4
268#define IOVT_UINT16 5
269#define IOVT_INT32 6
270#define IOVT_UINT32 7
271#define IOVT_BUFFER 8
272#define BCM_IOVT_VALID(type) (((unsigned int)(type)) <= IOVT_BUFFER)
273
274
275#define BCM_IOV_TYPE_INIT { \
276 "void", \
277 "bool", \
278 "int8", \
279 "uint8", \
280 "int16", \
281 "uint16", \
282 "int32", \
283 "uint32", \
284 "buffer", \
285 "" }
286
287#define BCM_IOVT_IS_INT(type) (\
288 (type == IOVT_BOOL) || \
289 (type == IOVT_INT8) || \
290 (type == IOVT_UINT8) || \
291 (type == IOVT_INT16) || \
292 (type == IOVT_UINT16) || \
293 (type == IOVT_INT32) || \
294 (type == IOVT_UINT32))
295
296
297
298#define BCME_STRLEN 64
299#define VALID_BCMERROR(e) ((e <= 0) && (e >= BCME_LAST))
300
301
302
303
304#define BCME_OK 0
305#define BCME_ERROR -1
306#define BCME_BADARG -2
307#define BCME_BADOPTION -3
308#define BCME_NOTUP -4
309#define BCME_NOTDOWN -5
310#define BCME_NOTAP -6
311#define BCME_NOTSTA -7
312#define BCME_BADKEYIDX -8
313#define BCME_RADIOOFF -9
314#define BCME_NOTBANDLOCKED -10
315#define BCME_NOCLK -11
316#define BCME_BADRATESET -12
317#define BCME_BADBAND -13
318#define BCME_BUFTOOSHORT -14
319#define BCME_BUFTOOLONG -15
320#define BCME_BUSY -16
321#define BCME_NOTASSOCIATED -17
322#define BCME_BADSSIDLEN -18
323#define BCME_OUTOFRANGECHAN -19
324#define BCME_BADCHAN -20
325#define BCME_BADADDR -21
326#define BCME_NORESOURCE -22
327#define BCME_UNSUPPORTED -23
328#define BCME_BADLEN -24
329#define BCME_NOTREADY -25
330#define BCME_EPERM -26
331#define BCME_NOMEM -27
332#define BCME_ASSOCIATED -28
333#define BCME_RANGE -29
334#define BCME_NOTFOUND -30
335#define BCME_WME_NOT_ENABLED -31
336#define BCME_TSPEC_NOTFOUND -32
337#define BCME_ACM_NOTSUPPORTED -33
338#define BCME_NOT_WME_ASSOCIATION -34
339#define BCME_SDIO_ERROR -35
340#define BCME_DONGLE_DOWN -36
341#define BCME_VERSION -37
342#define BCME_TXFAIL -38
343#define BCME_RXFAIL -39
344#define BCME_NODEVICE -40
345#define BCME_UNFINISHED -41
346#define BCME_LAST BCME_UNFINISHED
347
348
349#define BCMERRSTRINGTABLE { \
350 "OK", \
351 "Undefined error", \
352 "Bad Argument", \
353 "Bad Option", \
354 "Not up", \
355 "Not down", \
356 "Not AP", \
357 "Not STA", \
358 "Bad Key Index", \
359 "Radio Off", \
360 "Not band locked", \
361 "No clock", \
362 "Bad Rate valueset", \
363 "Bad Band", \
364 "Buffer too short", \
365 "Buffer too long", \
366 "Busy", \
367 "Not Associated", \
368 "Bad SSID len", \
369 "Out of Range Channel", \
370 "Bad Channel", \
371 "Bad Address", \
372 "Not Enough Resources", \
373 "Unsupported", \
374 "Bad length", \
375 "Not Ready", \
376 "Not Permitted", \
377 "No Memory", \
378 "Associated", \
379 "Not In Range", \
380 "Not Found", \
381 "WME Not Enabled", \
382 "TSPEC Not Found", \
383 "ACM Not Supported", \
384 "Not WME Association", \
385 "SDIO Bus Error", \
386 "Dongle Not Accessible", \
387 "Incorrect version", \
388 "TX Failure", \
389 "RX Failure", \
390 "Device Not Present", \
391 "Command not finished", \
392}
393
394#ifndef ABS
395#define ABS(a) (((a) < 0)?-(a):(a))
396#endif
397
398#ifndef MIN
399#define MIN(a, b) (((a) < (b))?(a):(b))
400#endif
401
402#ifndef MAX
403#define MAX(a, b) (((a) > (b))?(a):(b))
404#endif
405
406#define CEIL(x, y) (((x) + ((y)-1)) / (y))
407#define ROUNDUP(x, y) ((((x)+((y)-1))/(y))*(y))
408#define ISALIGNED(a, x) (((a) & ((x)-1)) == 0)
409#define ALIGN_ADDR(addr, boundary) (void *)(((uintptr)(addr) + (boundary) - 1) \
410 & ~((boundary) - 1))
411#define ISPOWEROF2(x) ((((x)-1)&(x)) == 0)
412#define VALID_MASK(mask) !((mask) & ((mask) + 1))
413#ifndef OFFSETOF
414#define OFFSETOF(type, member) ((uint)(uintptr)&((type *)0)->member)
415#endif
416#ifndef ARRAYSIZE
417#define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
418#endif
419
420
421#ifndef setbit
422#ifndef NBBY
423#define NBBY 8
424#endif
425#define setbit(a, i) (((uint8 *)a)[(i)/NBBY] |= 1<<((i)%NBBY))
426#define clrbit(a, i) (((uint8 *)a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
427#define isset(a, i) (((const uint8 *)a)[(i)/NBBY] & (1<<((i)%NBBY)))
428#define isclr(a, i) ((((const uint8 *)a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
429#endif
430
431#define NBITS(type) (sizeof(type) * 8)
432#define NBITVAL(nbits) (1 << (nbits))
433#define MAXBITVAL(nbits) ((1 << (nbits)) - 1)
434#define NBITMASK(nbits) MAXBITVAL(nbits)
435#define MAXNBVAL(nbyte) MAXBITVAL((nbyte) * 8)
436
437
438#define MUX(pred, true, false) ((pred) ? (true) : (false))
439
440
441#define MODDEC(x, bound) MUX((x) == 0, (bound) - 1, (x) - 1)
442#define MODINC(x, bound) MUX((x) == (bound) - 1, 0, (x) + 1)
443
444
445#define MODDEC_POW2(x, bound) (((x) - 1) & ((bound) - 1))
446#define MODINC_POW2(x, bound) (((x) + 1) & ((bound) - 1))
447
448
449#define MODADD(x, y, bound) \
450 MUX((x) + (y) >= (bound), (x) + (y) - (bound), (x) + (y))
451#define MODSUB(x, y, bound) \
452 MUX(((int)(x)) - ((int)(y)) < 0, (x) - (y) + (bound), (x) - (y))
453
454
455#define MODADD_POW2(x, y, bound) (((x) + (y)) & ((bound) - 1))
456#define MODSUB_POW2(x, y, bound) (((x) - (y)) & ((bound) - 1))
457
458
459#define CRC8_INIT_VALUE 0xff
460#define CRC8_GOOD_VALUE 0x9f
461#define CRC16_INIT_VALUE 0xffff
462#define CRC16_GOOD_VALUE 0xf0b8
463#define CRC32_INIT_VALUE 0xffffffff
464#define CRC32_GOOD_VALUE 0xdebb20e3
465
466
467typedef struct bcm_bit_desc {
468 uint32 bit;
469 const char* name;
470} bcm_bit_desc_t;
471
472
473typedef struct bcm_tlv {
474 uint8 id;
475 uint8 len;
476 uint8 data[1];
477} bcm_tlv_t;
478
479
480#define bcm_valid_tlv(elt, buflen) ((buflen) >= 2 && (int)(buflen) >= (int)(2 + (elt)->len))
481
482
483#define ETHER_ADDR_STR_LEN 18
484
485
486#ifdef IL_BIGENDIAN
487static INLINE uint32
488load32_ua(uint8 *a)
489{
490 return ((a[0] << 24) | (a[1] << 16) | (a[2] << 8) | a[3]);
491}
492
493static INLINE void
494store32_ua(uint8 *a, uint32 v)
495{
496 a[0] = (v >> 24) & 0xff;
497 a[1] = (v >> 16) & 0xff;
498 a[2] = (v >> 8) & 0xff;
499 a[3] = v & 0xff;
500}
501
502static INLINE uint16
503load16_ua(uint8 *a)
504{
505 return ((a[0] << 8) | a[1]);
506}
507
508static INLINE void
509store16_ua(uint8 *a, uint16 v)
510{
511 a[0] = (v >> 8) & 0xff;
512 a[1] = v & 0xff;
513}
514
515#else
516
517static INLINE uint32
518load32_ua(uint8 *a)
519{
520 return ((a[3] << 24) | (a[2] << 16) | (a[1] << 8) | a[0]);
521}
522
523static INLINE void
524store32_ua(uint8 *a, uint32 v)
525{
526 a[3] = (v >> 24) & 0xff;
527 a[2] = (v >> 16) & 0xff;
528 a[1] = (v >> 8) & 0xff;
529 a[0] = v & 0xff;
530}
531
532static INLINE uint16
533load16_ua(uint8 *a)
534{
535 return ((a[1] << 8) | a[0]);
536}
537
538static INLINE void
539store16_ua(uint8 *a, uint16 v)
540{
541 a[1] = (v >> 8) & 0xff;
542 a[0] = v & 0xff;
543}
544
545#endif
546
547
548
549static INLINE void
550xor_128bit_block(const uint8 *src1, const uint8 *src2, uint8 *dst)
551{
552 if (
553#ifdef __i386__
554 1 ||
555#endif
556 (((uintptr)src1 | (uintptr)src2 | (uintptr)dst) & 3) == 0) {
557
558
559 ((uint32 *)dst)[0] = ((uint32 *)src1)[0] ^ ((uint32 *)src2)[0];
560 ((uint32 *)dst)[1] = ((uint32 *)src1)[1] ^ ((uint32 *)src2)[1];
561 ((uint32 *)dst)[2] = ((uint32 *)src1)[2] ^ ((uint32 *)src2)[2];
562 ((uint32 *)dst)[3] = ((uint32 *)src1)[3] ^ ((uint32 *)src2)[3];
563 } else {
564
565 int k;
566 for (k = 0; k < 16; k++)
567 dst[k] = src1[k] ^ src2[k];
568 }
569}
570
571
572
573extern uint8 hndcrc8(uint8 *p, uint nbytes, uint8 crc);
574extern uint16 hndcrc16(uint8 *p, uint nbytes, uint16 crc);
575extern uint32 hndcrc32(uint8 *p, uint nbytes, uint32 crc);
576
577#if defined(DHD_DEBUG) || defined(WLMSG_PRHDRS) || defined(WLMSG_PRPKT) || \
578 defined(WLMSG_ASSOC)
579extern int bcm_format_flags(const bcm_bit_desc_t *bd, uint32 flags, char* buf, int len);
580extern int bcm_format_hex(char *str, const void *bytes, int len);
581extern void prhex(const char *msg, uchar *buf, uint len);
582#endif
583extern char *bcm_brev_str(uint32 brev, char *buf);
584extern void printbig(char *buf);
585
586
587extern bcm_tlv_t *bcm_next_tlv(bcm_tlv_t *elt, int *buflen);
588extern bcm_tlv_t *bcm_parse_tlvs(void *buf, int buflen, uint key);
589extern bcm_tlv_t *bcm_parse_ordered_tlvs(void *buf, int buflen, uint key);
590
591
592extern const char *bcmerrorstr(int bcmerror);
593
594
595typedef uint32 mbool;
596#define mboolset(mb, bit) ((mb) |= (bit))
597#define mboolclr(mb, bit) ((mb) &= ~(bit))
598#define mboolisset(mb, bit) (((mb) & (bit)) != 0)
599#define mboolmaskset(mb, mask, val) ((mb) = (((mb) & ~(mask)) | (val)))
600
601
602extern uint16 bcm_qdbm_to_mw(uint8 qdbm);
603extern uint8 bcm_mw_to_qdbm(uint16 mw);
604
605
606struct fielddesc {
607 const char *nameandfmt;
608 uint32 offset;
609 uint32 len;
610};
611
612extern void bcm_binit(struct bcmstrbuf *b, char *buf, uint size);
613extern int bcm_bprintf(struct bcmstrbuf *b, const char *fmt, ...);
614extern void bcm_inc_bytes(uchar *num, int num_bytes, uint8 amount);
615extern int bcm_cmp_bytes(uchar *arg1, uchar *arg2, uint8 nbytes);
616extern void bcm_print_bytes(char *name, const uchar *cdata, int len);
617
618typedef uint32 (*bcmutl_rdreg_rtn)(void *arg0, uint arg1, uint32 offset);
619extern uint bcmdumpfields(bcmutl_rdreg_rtn func_ptr, void *arg0, uint arg1, struct fielddesc *str,
620 char *buf, uint32 bufsize);
621
622extern uint bcm_mkiovar(char *name, char *data, uint datalen, char *buf, uint len);
623extern uint bcm_bitcount(uint8 *bitmap, uint bytelength);
624
625#if defined(WLTINYDUMP) || defined(WLMSG_INFORM) || defined(WLMSG_ASSOC) || \
626 defined(WLMSG_PRPKT) || defined(WLMSG_WSEC)
627extern int bcm_format_ssid(char* buf, const uchar ssid[], uint ssid_len);
628#endif
629
630
631#define SSID_FMT_BUF_LEN ((4 * DOT11_MAX_SSID_LEN) + 1)
632
633#ifdef __cplusplus
634 }
635#endif
636
637#endif
diff --git a/drivers/net/wireless/bcm4329/include/bcmwifi.h b/drivers/net/wireless/bcm4329/include/bcmwifi.h
new file mode 100644
index 00000000000..038aedcdb3c
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/bcmwifi.h
@@ -0,0 +1,154 @@
1/*
2 * Misc utility routines for WL and Apps
3 * This header file housing the define and function prototype use by
4 * both the wl driver, tools & Apps.
5 *
6 * Copyright (C) 1999-2010, Broadcom Corporation
7 *
8 * Unless you and Broadcom execute a separate written software license
9 * agreement governing use of this software, this software is licensed to you
10 * under the terms of the GNU General Public License version 2 (the "GPL"),
11 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
12 * following added to such license:
13 *
14 * As a special exception, the copyright holders of this software give you
15 * permission to link this software with independent modules, and to copy and
16 * distribute the resulting executable under terms of your choice, provided that
17 * you also meet, for each linked independent module, the terms and conditions of
18 * the license of that module. An independent module is a module which is not
19 * derived from this software. The special exception does not apply to any
20 * modifications of the software.
21 *
22 * Notwithstanding the above, under no circumstances may you combine this
23 * software in any way with any other Broadcom software provided under a license
24 * other than the GPL, without Broadcom's express prior written consent.
25 * $Id: bcmwifi.h,v 1.15.30.4 2010/03/10 20:10:52 Exp $
26 */
27
28
29#ifndef _bcmwifi_h_
30#define _bcmwifi_h_
31
32
33
34typedef uint16 chanspec_t;
35
36
37#define CH_UPPER_SB 0x01
38#define CH_LOWER_SB 0x02
39#define CH_EWA_VALID 0x04
40#define CH_20MHZ_APART 4
41#define CH_10MHZ_APART 2
42#define CH_5MHZ_APART 1
43#define CH_MAX_2G_CHANNEL 14
44#define WLC_MAX_2G_CHANNEL CH_MAX_2G_CHANNEL
45#define MAXCHANNEL 224
46
47#define WL_CHANSPEC_CHAN_MASK 0x00ff
48#define WL_CHANSPEC_CHAN_SHIFT 0
49
50#define WL_CHANSPEC_CTL_SB_MASK 0x0300
51#define WL_CHANSPEC_CTL_SB_SHIFT 8
52#define WL_CHANSPEC_CTL_SB_LOWER 0x0100
53#define WL_CHANSPEC_CTL_SB_UPPER 0x0200
54#define WL_CHANSPEC_CTL_SB_NONE 0x0300
55
56#define WL_CHANSPEC_BW_MASK 0x0C00
57#define WL_CHANSPEC_BW_SHIFT 10
58#define WL_CHANSPEC_BW_10 0x0400
59#define WL_CHANSPEC_BW_20 0x0800
60#define WL_CHANSPEC_BW_40 0x0C00
61
62#define WL_CHANSPEC_BAND_MASK 0xf000
63#define WL_CHANSPEC_BAND_SHIFT 12
64#define WL_CHANSPEC_BAND_5G 0x1000
65#define WL_CHANSPEC_BAND_2G 0x2000
66#define INVCHANSPEC 255
67
68
69#define WF_CHAN_FACTOR_2_4_G 4814
70#define WF_CHAN_FACTOR_5_G 10000
71#define WF_CHAN_FACTOR_4_G 8000
72
73
74#define LOWER_20_SB(channel) ((channel > CH_10MHZ_APART) ? (channel - CH_10MHZ_APART) : 0)
75#define UPPER_20_SB(channel) ((channel < (MAXCHANNEL - CH_10MHZ_APART)) ? \
76 (channel + CH_10MHZ_APART) : 0)
77#define CHSPEC_WLCBANDUNIT(chspec) (CHSPEC_IS5G(chspec) ? BAND_5G_INDEX : BAND_2G_INDEX)
78#define CH20MHZ_CHSPEC(channel) (chanspec_t)((chanspec_t)(channel) | WL_CHANSPEC_BW_20 | \
79 WL_CHANSPEC_CTL_SB_NONE | (((channel) <= CH_MAX_2G_CHANNEL) ? \
80 WL_CHANSPEC_BAND_2G : WL_CHANSPEC_BAND_5G))
81#define NEXT_20MHZ_CHAN(channel) ((channel < (MAXCHANNEL - CH_20MHZ_APART)) ? \
82 (channel + CH_20MHZ_APART) : 0)
83#define CH40MHZ_CHSPEC(channel, ctlsb) (chanspec_t) \
84 ((channel) | (ctlsb) | WL_CHANSPEC_BW_40 | \
85 ((channel) <= CH_MAX_2G_CHANNEL ? WL_CHANSPEC_BAND_2G : \
86 WL_CHANSPEC_BAND_5G))
87#define CHSPEC_CHANNEL(chspec) ((uint8)(chspec & WL_CHANSPEC_CHAN_MASK))
88#define CHSPEC_BAND(chspec) (chspec & WL_CHANSPEC_BAND_MASK)
89
90#ifdef WL20MHZ_ONLY
91
92#define CHSPEC_CTL_SB(chspec) WL_CHANSPEC_CTL_SB_NONE
93#define CHSPEC_BW(chspec) WL_CHANSPEC_BW_20
94#define CHSPEC_IS10(chspec) 0
95#define CHSPEC_IS20(chspec) 1
96#ifndef CHSPEC_IS40
97#define CHSPEC_IS40(chspec) 0
98#endif
99
100#else
101
102#define CHSPEC_CTL_SB(chspec) (chspec & WL_CHANSPEC_CTL_SB_MASK)
103#define CHSPEC_BW(chspec) (chspec & WL_CHANSPEC_BW_MASK)
104#define CHSPEC_IS10(chspec) ((chspec & WL_CHANSPEC_BW_MASK) == WL_CHANSPEC_BW_10)
105#define CHSPEC_IS20(chspec) ((chspec & WL_CHANSPEC_BW_MASK) == WL_CHANSPEC_BW_20)
106#ifndef CHSPEC_IS40
107#define CHSPEC_IS40(chspec) (((chspec) & WL_CHANSPEC_BW_MASK) == WL_CHANSPEC_BW_40)
108#endif
109
110#endif
111
112#define CHSPEC_IS5G(chspec) ((chspec & WL_CHANSPEC_BAND_MASK) == WL_CHANSPEC_BAND_5G)
113#define CHSPEC_IS2G(chspec) ((chspec & WL_CHANSPEC_BAND_MASK) == WL_CHANSPEC_BAND_2G)
114#define CHSPEC_SB_NONE(chspec) ((chspec & WL_CHANSPEC_CTL_SB_MASK) == WL_CHANSPEC_CTL_SB_NONE)
115#define CHSPEC_SB_UPPER(chspec) ((chspec & WL_CHANSPEC_CTL_SB_MASK) == WL_CHANSPEC_CTL_SB_UPPER)
116#define CHSPEC_SB_LOWER(chspec) ((chspec & WL_CHANSPEC_CTL_SB_MASK) == WL_CHANSPEC_CTL_SB_LOWER)
117#define CHSPEC_CTL_CHAN(chspec) ((CHSPEC_SB_LOWER(chspec)) ? \
118 (LOWER_20_SB(((chspec) & WL_CHANSPEC_CHAN_MASK))) : \
119 (UPPER_20_SB(((chspec) & WL_CHANSPEC_CHAN_MASK))))
120
121#define CHSPEC2WLC_BAND(chspec) (CHSPEC_IS5G((chspec))? WLC_BAND_5G: WLC_BAND_2G)
122
123#define CHANSPEC_STR_LEN 8
124
125
126#define WLC_MAXRATE 108
127#define WLC_RATE_1M 2
128#define WLC_RATE_2M 4
129#define WLC_RATE_5M5 11
130#define WLC_RATE_11M 22
131#define WLC_RATE_6M 12
132#define WLC_RATE_9M 18
133#define WLC_RATE_12M 24
134#define WLC_RATE_18M 36
135#define WLC_RATE_24M 48
136#define WLC_RATE_36M 72
137#define WLC_RATE_48M 96
138#define WLC_RATE_54M 108
139
140#define WLC_2G_25MHZ_OFFSET 5
141
142
143extern char * wf_chspec_ntoa(chanspec_t chspec, char *buf);
144
145
146extern chanspec_t wf_chspec_aton(char *a);
147
148
149extern int wf_mhz2channel(uint freq, uint start_factor);
150
151
152extern int wf_channel2mhz(uint channel, uint start_factor);
153
154#endif
diff --git a/drivers/net/wireless/bcm4329/include/dhdioctl.h b/drivers/net/wireless/bcm4329/include/dhdioctl.h
new file mode 100644
index 00000000000..980a1430100
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/dhdioctl.h
@@ -0,0 +1,123 @@
1/*
2 * Definitions for ioctls to access DHD iovars.
3 * Based on wlioctl.h (for Broadcom 802.11abg driver).
4 * (Moves towards generic ioctls for BCM drivers/iovars.)
5 *
6 * Definitions subject to change without notice.
7 *
8 * Copyright (C) 1999-2010, Broadcom Corporation
9 *
10 * Unless you and Broadcom execute a separate written software license
11 * agreement governing use of this software, this software is licensed to you
12 * under the terms of the GNU General Public License version 2 (the "GPL"),
13 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
14 * following added to such license:
15 *
16 * As a special exception, the copyright holders of this software give you
17 * permission to link this software with independent modules, and to copy and
18 * distribute the resulting executable under terms of your choice, provided that
19 * you also meet, for each linked independent module, the terms and conditions of
20 * the license of that module. An independent module is a module which is not
21 * derived from this software. The special exception does not apply to any
22 * modifications of the software.
23 *
24 * Notwithstanding the above, under no circumstances may you combine this
25 * software in any way with any other Broadcom software provided under a license
26 * other than the GPL, without Broadcom's express prior written consent.
27 *
28 * $Id: dhdioctl.h,v 13.7.8.1.4.1.16.5 2010/05/21 21:49:38 Exp $
29 */
30
31#ifndef _dhdioctl_h_
32#define _dhdioctl_h_
33
34#include <typedefs.h>
35
36
37/* require default structure packing */
38#define BWL_DEFAULT_PACKING
39#include <packed_section_start.h>
40
41
42/* Linux network driver ioctl encoding */
43typedef struct dhd_ioctl {
44 uint cmd; /* common ioctl definition */
45 void *buf; /* pointer to user buffer */
46 uint len; /* length of user buffer */
47 bool set; /* get or set request (optional) */
48 uint used; /* bytes read or written (optional) */
49 uint needed; /* bytes needed (optional) */
50 uint driver; /* to identify target driver */
51} dhd_ioctl_t;
52
53/* per-driver magic numbers */
54#define DHD_IOCTL_MAGIC 0x00444944
55
56/* bump this number if you change the ioctl interface */
57#define DHD_IOCTL_VERSION 1
58
59#define DHD_IOCTL_MAXLEN 8192 /* max length ioctl buffer required */
60#define DHD_IOCTL_SMLEN 256 /* "small" length ioctl buffer required */
61
62/* common ioctl definitions */
63#define DHD_GET_MAGIC 0
64#define DHD_GET_VERSION 1
65#define DHD_GET_VAR 2
66#define DHD_SET_VAR 3
67
68/* message levels */
69#define DHD_ERROR_VAL 0x0001
70#define DHD_TRACE_VAL 0x0002
71#define DHD_INFO_VAL 0x0004
72#define DHD_DATA_VAL 0x0008
73#define DHD_CTL_VAL 0x0010
74#define DHD_TIMER_VAL 0x0020
75#define DHD_HDRS_VAL 0x0040
76#define DHD_BYTES_VAL 0x0080
77#define DHD_INTR_VAL 0x0100
78#define DHD_LOG_VAL 0x0200
79#define DHD_GLOM_VAL 0x0400
80#define DHD_EVENT_VAL 0x0800
81#define DHD_BTA_VAL 0x1000
82#define DHD_ISCAN_VAL 0x2000
83
84#ifdef SDTEST
85/* For pktgen iovar */
86typedef struct dhd_pktgen {
87 uint version; /* To allow structure change tracking */
88 uint freq; /* Max ticks between tx/rx attempts */
89 uint count; /* Test packets to send/rcv each attempt */
90 uint print; /* Print counts every <print> attempts */
91 uint total; /* Total packets (or bursts) */
92 uint minlen; /* Minimum length of packets to send */
93 uint maxlen; /* Maximum length of packets to send */
94 uint numsent; /* Count of test packets sent */
95 uint numrcvd; /* Count of test packets received */
96 uint numfail; /* Count of test send failures */
97 uint mode; /* Test mode (type of test packets) */
98 uint stop; /* Stop after this many tx failures */
99} dhd_pktgen_t;
100
101/* Version in case structure changes */
102#define DHD_PKTGEN_VERSION 2
103
104/* Type of test packets to use */
105#define DHD_PKTGEN_ECHO 1 /* Send echo requests */
106#define DHD_PKTGEN_SEND 2 /* Send discard packets */
107#define DHD_PKTGEN_RXBURST 3 /* Request dongle send N packets */
108#define DHD_PKTGEN_RECV 4 /* Continuous rx from continuous tx dongle */
109#endif /* SDTEST */
110
111/* Enter idle immediately (no timeout) */
112#define DHD_IDLE_IMMEDIATE (-1)
113
114/* Values for idleclock iovar: other values are the sd_divisor to use when idle */
115#define DHD_IDLE_ACTIVE 0 /* Do not request any SD clock change when idle */
116#define DHD_IDLE_STOP (-1) /* Request SD clock be stopped (and use SD1 mode) */
117
118
119/* require default structure packing */
120#include <packed_section_end.h>
121
122
123#endif /* _dhdioctl_h_ */
diff --git a/drivers/net/wireless/bcm4329/include/epivers.h b/drivers/net/wireless/bcm4329/include/epivers.h
new file mode 100644
index 00000000000..cd66a9501cb
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/epivers.h
@@ -0,0 +1,48 @@
1/*
2 * Copyright (C) 1999-2010, Broadcom Corporation
3 *
4 * Unless you and Broadcom execute a separate written software license
5 * agreement governing use of this software, this software is licensed to you
6 * under the terms of the GNU General Public License version 2 (the "GPL"),
7 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
8 * following added to such license:
9 *
10 * As a special exception, the copyright holders of this software give you
11 * permission to link this software with independent modules, and to copy and
12 * distribute the resulting executable under terms of your choice, provided that
13 * you also meet, for each linked independent module, the terms and conditions of
14 * the license of that module. An independent module is a module which is not
15 * derived from this software. The special exception does not apply to any
16 * modifications of the software.
17 *
18 * Notwithstanding the above, under no circumstances may you combine this
19 * software in any way with any other Broadcom software provided under a license
20 * other than the GPL, without Broadcom's express prior written consent.
21 *
22 * $Id: epivers.h.in,v 13.25 2005/10/28 18:35:33 Exp $
23 *
24*/
25
26
27#ifndef _epivers_h_
28#define _epivers_h_
29
30#define EPI_MAJOR_VERSION 4
31
32#define EPI_MINOR_VERSION 218
33
34#define EPI_RC_NUMBER 248
35
36#define EPI_INCREMENTAL_NUMBER 23
37
38#define EPI_BUILD_NUMBER 0
39
40#define EPI_VERSION 4, 218, 248, 23
41
42#define EPI_VERSION_NUM 0x04daf817
43
44
45#define EPI_VERSION_STR "4.218.248.23"
46#define EPI_ROUTER_VERSION_STR "4.219.248.23"
47
48#endif
diff --git a/drivers/net/wireless/bcm4329/include/hndpmu.h b/drivers/net/wireless/bcm4329/include/hndpmu.h
new file mode 100644
index 00000000000..e829b3df2d0
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/hndpmu.h
@@ -0,0 +1,34 @@
1/*
2 * HND SiliconBackplane PMU support.
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: hndpmu.h,v 13.14.4.3.4.3.8.7 2010/04/09 13:20:51 Exp $
25 */
26
27#ifndef _hndpmu_h_
28#define _hndpmu_h_
29
30
31extern void si_pmu_otp_power(si_t *sih, osl_t *osh, bool on);
32extern void si_sdiod_drive_strength_init(si_t *sih, osl_t *osh, uint32 drivestrength);
33
34#endif /* _hndpmu_h_ */
diff --git a/drivers/net/wireless/bcm4329/include/hndrte_armtrap.h b/drivers/net/wireless/bcm4329/include/hndrte_armtrap.h
new file mode 100644
index 00000000000..ca3281b6d90
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/hndrte_armtrap.h
@@ -0,0 +1,88 @@
1/*
2 * HNDRTE arm trap handling.
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: hndrte_armtrap.h,v 13.3.196.2 2010/07/15 19:06:11 Exp $
25 */
26
27#ifndef _hndrte_armtrap_h
28#define _hndrte_armtrap_h
29
30
31/* ARM trap handling */
32
33/* Trap types defined by ARM (see arminc.h) */
34
35/* Trap locations in lo memory */
36#define TRAP_STRIDE 4
37#define FIRST_TRAP TR_RST
38#define LAST_TRAP (TR_FIQ * TRAP_STRIDE)
39
40#if defined(__ARM_ARCH_4T__)
41#define MAX_TRAP_TYPE (TR_FIQ + 1)
42#elif defined(__ARM_ARCH_7M__)
43#define MAX_TRAP_TYPE (TR_ISR + ARMCM3_NUMINTS)
44#endif /* __ARM_ARCH_7M__ */
45
46/* The trap structure is defined here as offsets for assembly */
47#define TR_TYPE 0x00
48#define TR_EPC 0x04
49#define TR_CPSR 0x08
50#define TR_SPSR 0x0c
51#define TR_REGS 0x10
52#define TR_REG(n) (TR_REGS + (n) * 4)
53#define TR_SP TR_REG(13)
54#define TR_LR TR_REG(14)
55#define TR_PC TR_REG(15)
56
57#define TRAP_T_SIZE 80
58
59#ifndef _LANGUAGE_ASSEMBLY
60
61#include <typedefs.h>
62
63typedef struct _trap_struct {
64 uint32 type;
65 uint32 epc;
66 uint32 cpsr;
67 uint32 spsr;
68 uint32 r0;
69 uint32 r1;
70 uint32 r2;
71 uint32 r3;
72 uint32 r4;
73 uint32 r5;
74 uint32 r6;
75 uint32 r7;
76 uint32 r8;
77 uint32 r9;
78 uint32 r10;
79 uint32 r11;
80 uint32 r12;
81 uint32 r13;
82 uint32 r14;
83 uint32 pc;
84} trap_t;
85
86#endif /* !_LANGUAGE_ASSEMBLY */
87
88#endif /* _hndrte_armtrap_h */
diff --git a/drivers/net/wireless/bcm4329/include/hndrte_cons.h b/drivers/net/wireless/bcm4329/include/hndrte_cons.h
new file mode 100644
index 00000000000..a42417478a1
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/hndrte_cons.h
@@ -0,0 +1,63 @@
1/*
2 * Console support for hndrte.
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: hndrte_cons.h,v 13.1.2.4 2010/07/15 19:06:11 Exp $
25 */
26
27#include <typedefs.h>
28
29#define CBUF_LEN (128)
30
31#define LOG_BUF_LEN 1024
32
33typedef struct {
34 uint32 buf; /* Can't be pointer on (64-bit) hosts */
35 uint buf_size;
36 uint idx;
37 char *_buf_compat; /* Redundant pointer for backward compat. */
38} hndrte_log_t;
39
40typedef struct {
41 /* Virtual UART
42 * When there is no UART (e.g. Quickturn), the host should write a complete
43 * input line directly into cbuf and then write the length into vcons_in.
44 * This may also be used when there is a real UART (at risk of conflicting with
45 * the real UART). vcons_out is currently unused.
46 */
47 volatile uint vcons_in;
48 volatile uint vcons_out;
49
50 /* Output (logging) buffer
51 * Console output is written to a ring buffer log_buf at index log_idx.
52 * The host may read the output when it sees log_idx advance.
53 * Output will be lost if the output wraps around faster than the host polls.
54 */
55 hndrte_log_t log;
56
57 /* Console input line buffer
58 * Characters are read one at a time into cbuf until <CR> is received, then
59 * the buffer is processed as a command line. Also used for virtual UART.
60 */
61 uint cbuf_idx;
62 char cbuf[CBUF_LEN];
63} hndrte_cons_t;
diff --git a/drivers/net/wireless/bcm4329/include/hndsoc.h b/drivers/net/wireless/bcm4329/include/hndsoc.h
new file mode 100644
index 00000000000..35424175f55
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/hndsoc.h
@@ -0,0 +1,195 @@
1/*
2 * Broadcom HND chip & on-chip-interconnect-related definitions.
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: hndsoc.h,v 13.3.10.3 2008/08/06 03:43:25 Exp $
25 */
26
27#ifndef _HNDSOC_H
28#define _HNDSOC_H
29
30/* Include the soci specific files */
31#include <sbconfig.h>
32#include <aidmp.h>
33
34/*
35 * SOC Interconnect Address Map.
36 * All regions may not exist on all chips.
37 */
38#define SI_SDRAM_BASE 0x00000000 /* Physical SDRAM */
39#define SI_PCI_MEM 0x08000000 /* Host Mode sb2pcitranslation0 (64 MB) */
40#define SI_PCI_MEM_SZ (64 * 1024 * 1024)
41#define SI_PCI_CFG 0x0c000000 /* Host Mode sb2pcitranslation1 (64 MB) */
42#define SI_SDRAM_SWAPPED 0x10000000 /* Byteswapped Physical SDRAM */
43
44#define SI_ENUM_BASE 0x18000000 /* Enumeration space base */
45#define SI_CORE_SIZE 0x1000 /* each core gets 4Kbytes for registers */
46#ifndef SI_MAXCORES
47#define SI_MAXCORES 16 /* Max cores (this is arbitrary, for software
48 * convenience and could be changed if we
49 * make any larger chips
50 */
51#endif
52
53#define SI_FASTRAM 0x19000000 /* On-chip RAM on chips that also have DDR */
54
55#define SI_FLASH2 0x1c000000 /* Flash Region 2 (region 1 shadowed here) */
56#define SI_FLASH2_SZ 0x02000000 /* Size of Flash Region 2 */
57#define SI_ARMCM3_ROM 0x1e000000 /* ARM Cortex-M3 ROM */
58#define SI_FLASH1 0x1fc00000 /* MIPS Flash Region 1 */
59#define SI_FLASH1_SZ 0x00400000 /* MIPS Size of Flash Region 1 */
60#define SI_ARM7S_ROM 0x20000000 /* ARM7TDMI-S ROM */
61#define SI_ARMCM3_SRAM2 0x60000000 /* ARM Cortex-M3 SRAM Region 2 */
62#define SI_ARM7S_SRAM2 0x80000000 /* ARM7TDMI-S SRAM Region 2 */
63#define SI_ARM_FLASH1 0xffff0000 /* ARM Flash Region 1 */
64#define SI_ARM_FLASH1_SZ 0x00010000 /* ARM Size of Flash Region 1 */
65
66#define SI_PCI_DMA 0x40000000 /* Client Mode sb2pcitranslation2 (1 GB) */
67#define SI_PCI_DMA2 0x80000000 /* Client Mode sb2pcitranslation2 (1 GB) */
68#define SI_PCI_DMA_SZ 0x40000000 /* Client Mode sb2pcitranslation2 size in bytes */
69#define SI_PCIE_DMA_L32 0x00000000 /* PCIE Client Mode sb2pcitranslation2
70 * (2 ZettaBytes), low 32 bits
71 */
72#define SI_PCIE_DMA_H32 0x80000000 /* PCIE Client Mode sb2pcitranslation2
73 * (2 ZettaBytes), high 32 bits
74 */
75
76/* core codes */
77#define NODEV_CORE_ID 0x700 /* Invalid coreid */
78#define CC_CORE_ID 0x800 /* chipcommon core */
79#define ILINE20_CORE_ID 0x801 /* iline20 core */
80#define SRAM_CORE_ID 0x802 /* sram core */
81#define SDRAM_CORE_ID 0x803 /* sdram core */
82#define PCI_CORE_ID 0x804 /* pci core */
83#define MIPS_CORE_ID 0x805 /* mips core */
84#define ENET_CORE_ID 0x806 /* enet mac core */
85#define CODEC_CORE_ID 0x807 /* v90 codec core */
86#define USB_CORE_ID 0x808 /* usb 1.1 host/device core */
87#define ADSL_CORE_ID 0x809 /* ADSL core */
88#define ILINE100_CORE_ID 0x80a /* iline100 core */
89#define IPSEC_CORE_ID 0x80b /* ipsec core */
90#define UTOPIA_CORE_ID 0x80c /* utopia core */
91#define PCMCIA_CORE_ID 0x80d /* pcmcia core */
92#define SOCRAM_CORE_ID 0x80e /* internal memory core */
93#define MEMC_CORE_ID 0x80f /* memc sdram core */
94#define OFDM_CORE_ID 0x810 /* OFDM phy core */
95#define EXTIF_CORE_ID 0x811 /* external interface core */
96#define D11_CORE_ID 0x812 /* 802.11 MAC core */
97#define APHY_CORE_ID 0x813 /* 802.11a phy core */
98#define BPHY_CORE_ID 0x814 /* 802.11b phy core */
99#define GPHY_CORE_ID 0x815 /* 802.11g phy core */
100#define MIPS33_CORE_ID 0x816 /* mips3302 core */
101#define USB11H_CORE_ID 0x817 /* usb 1.1 host core */
102#define USB11D_CORE_ID 0x818 /* usb 1.1 device core */
103#define USB20H_CORE_ID 0x819 /* usb 2.0 host core */
104#define USB20D_CORE_ID 0x81a /* usb 2.0 device core */
105#define SDIOH_CORE_ID 0x81b /* sdio host core */
106#define ROBO_CORE_ID 0x81c /* roboswitch core */
107#define ATA100_CORE_ID 0x81d /* parallel ATA core */
108#define SATAXOR_CORE_ID 0x81e /* serial ATA & XOR DMA core */
109#define GIGETH_CORE_ID 0x81f /* gigabit ethernet core */
110#define PCIE_CORE_ID 0x820 /* pci express core */
111#define NPHY_CORE_ID 0x821 /* 802.11n 2x2 phy core */
112#define SRAMC_CORE_ID 0x822 /* SRAM controller core */
113#define MINIMAC_CORE_ID 0x823 /* MINI MAC/phy core */
114#define ARM11_CORE_ID 0x824 /* ARM 1176 core */
115#define ARM7S_CORE_ID 0x825 /* ARM7tdmi-s core */
116#define LPPHY_CORE_ID 0x826 /* 802.11a/b/g phy core */
117#define PMU_CORE_ID 0x827 /* PMU core */
118#define SSNPHY_CORE_ID 0x828 /* 802.11n single-stream phy core */
119#define SDIOD_CORE_ID 0x829 /* SDIO device core */
120#define ARMCM3_CORE_ID 0x82a /* ARM Cortex M3 core */
121#define QNPHY_CORE_ID 0x82b /* 802.11n 4x4 phy core */
122#define MIPS74K_CORE_ID 0x82c /* mips 74k core */
123#define GMAC_CORE_ID 0x82d /* Gigabit MAC core */
124#define DMEMC_CORE_ID 0x82e /* DDR1/2 memory controller core */
125#define PCIERC_CORE_ID 0x82f /* PCIE Root Complex core */
126#define OCP_CORE_ID 0x830 /* OCP2OCP bridge core */
127#define SC_CORE_ID 0x831 /* shared common core */
128#define AHB_CORE_ID 0x832 /* OCP2AHB bridge core */
129#define SPIH_CORE_ID 0x833 /* SPI host core */
130#define I2S_CORE_ID 0x834 /* I2S core */
131#define OOB_ROUTER_CORE_ID 0x367 /* OOB router core ID */
132#define DEF_AI_COMP 0xfff /* Default component, in ai chips it maps all
133 * unused address ranges
134 */
135
136/* There are TWO constants on all HND chips: SI_ENUM_BASE above,
137 * and chipcommon being the first core:
138 */
139#define SI_CC_IDX 0
140
141/* SOC Interconnect types (aka chip types) */
142#define SOCI_SB 0
143#define SOCI_AI 1
144
145/* Common core control flags */
146#define SICF_BIST_EN 0x8000
147#define SICF_PME_EN 0x4000
148#define SICF_CORE_BITS 0x3ffc
149#define SICF_FGC 0x0002
150#define SICF_CLOCK_EN 0x0001
151
152/* Common core status flags */
153#define SISF_BIST_DONE 0x8000
154#define SISF_BIST_ERROR 0x4000
155#define SISF_GATED_CLK 0x2000
156#define SISF_DMA64 0x1000
157#define SISF_CORE_BITS 0x0fff
158
159/* A register that is common to all cores to
160 * communicate w/PMU regarding clock control.
161 */
162#define SI_CLK_CTL_ST 0x1e0 /* clock control and status */
163
164/* clk_ctl_st register */
165#define CCS_FORCEALP 0x00000001 /* force ALP request */
166#define CCS_FORCEHT 0x00000002 /* force HT request */
167#define CCS_FORCEILP 0x00000004 /* force ILP request */
168#define CCS_ALPAREQ 0x00000008 /* ALP Avail Request */
169#define CCS_HTAREQ 0x00000010 /* HT Avail Request */
170#define CCS_FORCEHWREQOFF 0x00000020 /* Force HW Clock Request Off */
171#define CCS_ALPAVAIL 0x00010000 /* ALP is available */
172#define CCS_HTAVAIL 0x00020000 /* HT is available */
173#define CCS0_HTAVAIL 0x00010000 /* HT avail in chipc and pcmcia on 4328a0 */
174#define CCS0_ALPAVAIL 0x00020000 /* ALP avail in chipc and pcmcia on 4328a0 */
175
176/* Not really related to SOC Interconnect, but a couple of software
177 * conventions for the use the flash space:
178 */
179
180/* Minumum amount of flash we support */
181#define FLASH_MIN 0x00020000 /* Minimum flash size */
182
183/* A boot/binary may have an embedded block that describes its size */
184#define BISZ_OFFSET 0x3e0 /* At this offset into the binary */
185#define BISZ_MAGIC 0x4249535a /* Marked with this value: 'BISZ' */
186#define BISZ_MAGIC_IDX 0 /* Word 0: magic */
187#define BISZ_TXTST_IDX 1 /* 1: text start */
188#define BISZ_TXTEND_IDX 2 /* 2: text end */
189#define BISZ_DATAST_IDX 3 /* 3: data start */
190#define BISZ_DATAEND_IDX 4 /* 4: data end */
191#define BISZ_BSSST_IDX 5 /* 5: bss start */
192#define BISZ_BSSEND_IDX 6 /* 6: bss end */
193#define BISZ_SIZE 7 /* descriptor size in 32-bit intergers */
194
195#endif /* _HNDSOC_H */
diff --git a/drivers/net/wireless/bcm4329/include/linux_osl.h b/drivers/net/wireless/bcm4329/include/linux_osl.h
new file mode 100644
index 00000000000..b059c2adb17
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/linux_osl.h
@@ -0,0 +1,322 @@
1/*
2 * Linux OS Independent Layer
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: linux_osl.h,v 13.131.30.8 2010/04/26 05:42:18 Exp $
25 */
26
27
28#ifndef _linux_osl_h_
29#define _linux_osl_h_
30
31#include <typedefs.h>
32
33
34#include <linuxver.h>
35
36
37#ifdef __GNUC__
38#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
39#if GCC_VERSION > 30100
40#define ASSERT(exp) do {} while (0)
41#else
42
43#define ASSERT(exp)
44#endif
45#endif
46
47
48#define OSL_DELAY(usec) osl_delay(usec)
49extern void osl_delay(uint usec);
50
51
52
53#define OSL_PCMCIA_READ_ATTR(osh, offset, buf, size) \
54 osl_pcmcia_read_attr((osh), (offset), (buf), (size))
55#define OSL_PCMCIA_WRITE_ATTR(osh, offset, buf, size) \
56 osl_pcmcia_write_attr((osh), (offset), (buf), (size))
57extern void osl_pcmcia_read_attr(osl_t *osh, uint offset, void *buf, int size);
58extern void osl_pcmcia_write_attr(osl_t *osh, uint offset, void *buf, int size);
59
60
61#define OSL_PCI_READ_CONFIG(osh, offset, size) \
62 osl_pci_read_config((osh), (offset), (size))
63#define OSL_PCI_WRITE_CONFIG(osh, offset, size, val) \
64 osl_pci_write_config((osh), (offset), (size), (val))
65extern uint32 osl_pci_read_config(osl_t *osh, uint offset, uint size);
66extern void osl_pci_write_config(osl_t *osh, uint offset, uint size, uint val);
67
68
69#define OSL_PCI_BUS(osh) osl_pci_bus(osh)
70#define OSL_PCI_SLOT(osh) osl_pci_slot(osh)
71extern uint osl_pci_bus(osl_t *osh);
72extern uint osl_pci_slot(osl_t *osh);
73
74
75typedef struct {
76 bool pkttag;
77 uint pktalloced;
78 bool mmbus;
79 pktfree_cb_fn_t tx_fn;
80 void *tx_ctx;
81} osl_pubinfo_t;
82
83
84extern osl_t *osl_attach(void *pdev, uint bustype, bool pkttag);
85extern void osl_detach(osl_t *osh);
86
87#define PKTFREESETCB(osh, _tx_fn, _tx_ctx) \
88 do { \
89 ((osl_pubinfo_t*)osh)->tx_fn = _tx_fn; \
90 ((osl_pubinfo_t*)osh)->tx_ctx = _tx_ctx; \
91 } while (0)
92
93
94#define BUS_SWAP32(v) (v)
95
96
97#define MALLOC(osh, size) osl_malloc((osh), (size))
98#define MFREE(osh, addr, size) osl_mfree((osh), (addr), (size))
99#define MALLOCED(osh) osl_malloced((osh))
100
101
102#define MALLOC_FAILED(osh) osl_malloc_failed((osh))
103
104extern void *osl_malloc(osl_t *osh, uint size);
105extern void osl_mfree(osl_t *osh, void *addr, uint size);
106extern uint osl_malloced(osl_t *osh);
107extern uint osl_malloc_failed(osl_t *osh);
108
109
110#define DMA_CONSISTENT_ALIGN PAGE_SIZE
111#define DMA_ALLOC_CONSISTENT(osh, size, pap, dmah, alignbits) \
112 osl_dma_alloc_consistent((osh), (size), (pap))
113#define DMA_FREE_CONSISTENT(osh, va, size, pa, dmah) \
114 osl_dma_free_consistent((osh), (void*)(va), (size), (pa))
115extern void *osl_dma_alloc_consistent(osl_t *osh, uint size, ulong *pap);
116extern void osl_dma_free_consistent(osl_t *osh, void *va, uint size, ulong pa);
117
118
119#define DMA_TX 1
120#define DMA_RX 2
121
122
123#define DMA_MAP(osh, va, size, direction, p, dmah) \
124 osl_dma_map((osh), (va), (size), (direction))
125#define DMA_UNMAP(osh, pa, size, direction, p, dmah) \
126 osl_dma_unmap((osh), (pa), (size), (direction))
127extern uint osl_dma_map(osl_t *osh, void *va, uint size, int direction);
128extern void osl_dma_unmap(osl_t *osh, uint pa, uint size, int direction);
129
130
131#define OSL_DMADDRWIDTH(osh, addrwidth) do {} while (0)
132
133
134#include <bcmsdh.h>
135#define OSL_WRITE_REG(osh, r, v) (bcmsdh_reg_write(NULL, (uintptr)(r), sizeof(*(r)), (v)))
136#define OSL_READ_REG(osh, r) (bcmsdh_reg_read(NULL, (uintptr)(r), sizeof(*(r))))
137
138#define SELECT_BUS_WRITE(osh, mmap_op, bus_op) if (((osl_pubinfo_t*)(osh))->mmbus) \
139 mmap_op else bus_op
140#define SELECT_BUS_READ(osh, mmap_op, bus_op) (((osl_pubinfo_t*)(osh))->mmbus) ? \
141 mmap_op : bus_op
142
143
144
145
146#ifndef printf
147#define printf(fmt, args...) printk(fmt, ## args)
148#endif
149#include <linux/kernel.h>
150#include <linux/string.h>
151
152
153#ifndef IL_BIGENDIAN
154#define R_REG(osh, r) (\
155 SELECT_BUS_READ(osh, sizeof(*(r)) == sizeof(uint8) ? readb((volatile uint8*)(r)) : \
156 sizeof(*(r)) == sizeof(uint16) ? readw((volatile uint16*)(r)) : \
157 readl((volatile uint32*)(r)), OSL_READ_REG(osh, r)) \
158)
159#define W_REG(osh, r, v) do { \
160 SELECT_BUS_WRITE(osh, \
161 switch (sizeof(*(r))) { \
162 case sizeof(uint8): writeb((uint8)(v), (volatile uint8*)(r)); break; \
163 case sizeof(uint16): writew((uint16)(v), (volatile uint16*)(r)); break; \
164 case sizeof(uint32): writel((uint32)(v), (volatile uint32*)(r)); break; \
165 }, \
166 (OSL_WRITE_REG(osh, r, v))); \
167 } while (0)
168#else
169#define R_REG(osh, r) (\
170 SELECT_BUS_READ(osh, \
171 ({ \
172 __typeof(*(r)) __osl_v; \
173 switch (sizeof(*(r))) { \
174 case sizeof(uint8): __osl_v = \
175 readb((volatile uint8*)((uintptr)(r)^3)); break; \
176 case sizeof(uint16): __osl_v = \
177 readw((volatile uint16*)((uintptr)(r)^2)); break; \
178 case sizeof(uint32): __osl_v = \
179 readl((volatile uint32*)(r)); break; \
180 } \
181 __osl_v; \
182 }), \
183 OSL_READ_REG(osh, r)) \
184)
185#define W_REG(osh, r, v) do { \
186 SELECT_BUS_WRITE(osh, \
187 switch (sizeof(*(r))) { \
188 case sizeof(uint8): writeb((uint8)(v), \
189 (volatile uint8*)((uintptr)(r)^3)); break; \
190 case sizeof(uint16): writew((uint16)(v), \
191 (volatile uint16*)((uintptr)(r)^2)); break; \
192 case sizeof(uint32): writel((uint32)(v), \
193 (volatile uint32*)(r)); break; \
194 }, \
195 (OSL_WRITE_REG(osh, r, v))); \
196 } while (0)
197#endif
198
199#define AND_REG(osh, r, v) W_REG(osh, (r), R_REG(osh, r) & (v))
200#define OR_REG(osh, r, v) W_REG(osh, (r), R_REG(osh, r) | (v))
201
202
203#define bcopy(src, dst, len) memcpy((dst), (src), (len))
204#define bcmp(b1, b2, len) memcmp((b1), (b2), (len))
205#define bzero(b, len) memset((b), '\0', (len))
206
207
208#define OSL_UNCACHED(va) ((void*)va)
209
210
211#if defined(__i386__)
212#define OSL_GETCYCLES(x) rdtscl((x))
213#else
214#define OSL_GETCYCLES(x) ((x) = 0)
215#endif
216
217
218#define BUSPROBE(val, addr) ({ (val) = R_REG(NULL, (addr)); 0; })
219
220
221#if !defined(CONFIG_MMC_MSM7X00A)
222#define REG_MAP(pa, size) ioremap_nocache((unsigned long)(pa), (unsigned long)(size))
223#else
224#define REG_MAP(pa, size) (void *)(0)
225#endif
226#define REG_UNMAP(va) iounmap((va))
227
228
229#define R_SM(r) *(r)
230#define W_SM(r, v) (*(r) = (v))
231#define BZERO_SM(r, len) memset((r), '\0', (len))
232
233
234#define PKTGET(osh, len, send) osl_pktget((osh), (len))
235#define PKTFREE(osh, skb, send) osl_pktfree((osh), (skb), (send))
236#ifdef DHD_USE_STATIC_BUF
237#define PKTGET_STATIC(osh, len, send) osl_pktget_static((osh), (len))
238#define PKTFREE_STATIC(osh, skb, send) osl_pktfree_static((osh), (skb), (send))
239#endif
240#define PKTDATA(osh, skb) (((struct sk_buff*)(skb))->data)
241#define PKTLEN(osh, skb) (((struct sk_buff*)(skb))->len)
242#define PKTHEADROOM(osh, skb) (PKTDATA(osh, skb)-(((struct sk_buff*)(skb))->head))
243#define PKTTAILROOM(osh, skb) ((((struct sk_buff*)(skb))->end)-(((struct sk_buff*)(skb))->tail))
244#define PKTNEXT(osh, skb) (((struct sk_buff*)(skb))->next)
245#define PKTSETNEXT(osh, skb, x) (((struct sk_buff*)(skb))->next = (struct sk_buff*)(x))
246#define PKTSETLEN(osh, skb, len) __skb_trim((struct sk_buff*)(skb), (len))
247#define PKTPUSH(osh, skb, bytes) skb_push((struct sk_buff*)(skb), (bytes))
248#define PKTPULL(osh, skb, bytes) skb_pull((struct sk_buff*)(skb), (bytes))
249#define PKTDUP(osh, skb) osl_pktdup((osh), (skb))
250#define PKTTAG(skb) ((void*)(((struct sk_buff*)(skb))->cb))
251#define PKTALLOCED(osh) ((osl_pubinfo_t *)(osh))->pktalloced
252#define PKTSETPOOL(osh, skb, x, y) do {} while (0)
253#define PKTPOOL(osh, skb) FALSE
254#define PKTPOOLLEN(osh, pktp) (0)
255#define PKTPOOLAVAIL(osh, pktp) (0)
256#define PKTPOOLADD(osh, pktp, p) BCME_ERROR
257#define PKTPOOLGET(osh, pktp) NULL
258#define PKTLIST_DUMP(osh, buf)
259
260extern void *osl_pktget(osl_t *osh, uint len);
261extern void osl_pktfree(osl_t *osh, void *skb, bool send);
262extern void *osl_pktget_static(osl_t *osh, uint len);
263extern void osl_pktfree_static(osl_t *osh, void *skb, bool send);
264extern void *osl_pktdup(osl_t *osh, void *skb);
265
266
267
268static INLINE void *
269osl_pkt_frmnative(osl_pubinfo_t *osh, struct sk_buff *skb)
270{
271 struct sk_buff *nskb;
272
273 if (osh->pkttag)
274 bzero((void*)skb->cb, OSL_PKTTAG_SZ);
275
276
277 for (nskb = skb; nskb; nskb = nskb->next) {
278 osh->pktalloced++;
279 }
280
281 return (void *)skb;
282}
283#define PKTFRMNATIVE(osh, skb) osl_pkt_frmnative(((osl_pubinfo_t *)osh), (struct sk_buff*)(skb))
284
285
286static INLINE struct sk_buff *
287osl_pkt_tonative(osl_pubinfo_t *osh, void *pkt)
288{
289 struct sk_buff *nskb;
290
291 if (osh->pkttag)
292 bzero(((struct sk_buff*)pkt)->cb, OSL_PKTTAG_SZ);
293
294
295 for (nskb = (struct sk_buff *)pkt; nskb; nskb = nskb->next) {
296 osh->pktalloced--;
297 }
298
299 return (struct sk_buff *)pkt;
300}
301#define PKTTONATIVE(osh, pkt) osl_pkt_tonative((osl_pubinfo_t *)(osh), (pkt))
302
303#define PKTLINK(skb) (((struct sk_buff*)(skb))->prev)
304#define PKTSETLINK(skb, x) (((struct sk_buff*)(skb))->prev = (struct sk_buff*)(x))
305#define PKTPRIO(skb) (((struct sk_buff*)(skb))->priority)
306#define PKTSETPRIO(skb, x) (((struct sk_buff*)(skb))->priority = (x))
307#define PKTSUMNEEDED(skb) (((struct sk_buff*)(skb))->ip_summed == CHECKSUM_HW)
308#define PKTSETSUMGOOD(skb, x) (((struct sk_buff*)(skb))->ip_summed = \
309 ((x) ? CHECKSUM_UNNECESSARY : CHECKSUM_NONE))
310
311#define PKTSHARED(skb) (((struct sk_buff*)(skb))->cloned)
312
313
314#define OSL_ERROR(bcmerror) osl_error(bcmerror)
315extern int osl_error(int bcmerror);
316
317
318#define PKTBUFSZ 2048
319
320
321#define OSL_SYSUPTIME() ((uint32)jiffies * (1000 / HZ))
322#endif
diff --git a/drivers/net/wireless/bcm4329/include/linuxver.h b/drivers/net/wireless/bcm4329/include/linuxver.h
new file mode 100644
index 00000000000..6ed22658a72
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/linuxver.h
@@ -0,0 +1,447 @@
1/*
2 * Linux-specific abstractions to gain some independence from linux kernel versions.
3 * Pave over some 2.2 versus 2.4 versus 2.6 kernel differences.
4 *
5 * Copyright (C) 1999-2010, Broadcom Corporation
6 *
7 * Unless you and Broadcom execute a separate written software license
8 * agreement governing use of this software, this software is licensed to you
9 * under the terms of the GNU General Public License version 2 (the "GPL"),
10 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
11 * following added to such license:
12 *
13 * As a special exception, the copyright holders of this software give you
14 * permission to link this software with independent modules, and to copy and
15 * distribute the resulting executable under terms of your choice, provided that
16 * you also meet, for each linked independent module, the terms and conditions of
17 * the license of that module. An independent module is a module which is not
18 * derived from this software. The special exception does not apply to any
19 * modifications of the software.
20 *
21 * Notwithstanding the above, under no circumstances may you combine this
22 * software in any way with any other Broadcom software provided under a license
23 * other than the GPL, without Broadcom's express prior written consent.
24 *
25 * $Id: linuxver.h,v 13.38.8.1.8.6 2010/04/29 05:00:46 Exp $
26 */
27
28
29#ifndef _linuxver_h_
30#define _linuxver_h_
31
32#include <linux/version.h>
33#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0))
34#include <linux/config.h>
35#elif (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33))
36#include <linux/autoconf.h>
37#endif
38#include <linux/module.h>
39
40#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 0))
41
42#ifdef __UNDEF_NO_VERSION__
43#undef __NO_VERSION__
44#else
45#define __NO_VERSION__
46#endif
47#endif
48
49#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
50#define module_param(_name_, _type_, _perm_) MODULE_PARM(_name_, "i")
51#define module_param_string(_name_, _string_, _size_, _perm_) \
52 MODULE_PARM(_string_, "c" __MODULE_STRING(_size_))
53#endif
54
55
56#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 9))
57#include <linux/malloc.h>
58#else
59#include <linux/slab.h>
60#endif
61
62#include <linux/types.h>
63#include <linux/init.h>
64#include <linux/mm.h>
65#include <linux/string.h>
66#include <linux/pci.h>
67#include <linux/interrupt.h>
68#include <linux/netdevice.h>
69#include <linux/semaphore.h>
70#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28))
71#undef IP_TOS
72#endif
73#include <asm/io.h>
74
75#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 41))
76#include <linux/workqueue.h>
77#else
78#include <linux/tqueue.h>
79#ifndef work_struct
80#define work_struct tq_struct
81#endif
82#ifndef INIT_WORK
83#define INIT_WORK(_work, _func, _data) INIT_TQUEUE((_work), (_func), (_data))
84#endif
85#ifndef schedule_work
86#define schedule_work(_work) schedule_task((_work))
87#endif
88#ifndef flush_scheduled_work
89#define flush_scheduled_work() flush_scheduled_tasks()
90#endif
91#endif
92
93#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
94#define MY_INIT_WORK(_work, _func, _data) INIT_WORK(_work, _func)
95#else
96#define MY_INIT_WORK(_work, _func, _data) INIT_WORK(_work, _func, _data)
97typedef void (*work_func_t)(void *work);
98#endif
99
100#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0))
101
102#ifndef IRQ_NONE
103typedef void irqreturn_t;
104#define IRQ_NONE
105#define IRQ_HANDLED
106#define IRQ_RETVAL(x)
107#endif
108#else
109typedef irqreturn_t(*FN_ISR) (int irq, void *dev_id, struct pt_regs *ptregs);
110#endif
111
112#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
113#define IRQF_SHARED SA_SHIRQ
114#endif
115
116#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 17)
117#ifdef CONFIG_NET_RADIO
118#define CONFIG_WIRELESS_EXT
119#endif
120#endif
121
122#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 67)
123#ifndef SANDGATE2G
124#define MOD_INC_USE_COUNT
125#endif
126#endif
127
128
129#ifndef __exit
130#define __exit
131#endif
132#ifndef __devexit
133#define __devexit
134#endif
135#ifndef __devinit
136#define __devinit __init
137#endif
138#ifndef __devinitdata
139#define __devinitdata
140#endif
141#ifndef __devexit_p
142#define __devexit_p(x) x
143#endif
144
145#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0))
146
147#define pci_get_drvdata(dev) (dev)->sysdata
148#define pci_set_drvdata(dev, value) (dev)->sysdata = (value)
149
150
151
152struct pci_device_id {
153 unsigned int vendor, device;
154 unsigned int subvendor, subdevice;
155 unsigned int class, class_mask;
156 unsigned long driver_data;
157};
158
159struct pci_driver {
160 struct list_head node;
161 char *name;
162 const struct pci_device_id *id_table;
163 int (*probe)(struct pci_dev *dev,
164 const struct pci_device_id *id);
165 void (*remove)(struct pci_dev *dev);
166 void (*suspend)(struct pci_dev *dev);
167 void (*resume)(struct pci_dev *dev);
168};
169
170#define MODULE_DEVICE_TABLE(type, name)
171#define PCI_ANY_ID (~0)
172
173
174#define pci_module_init pci_register_driver
175extern int pci_register_driver(struct pci_driver *drv);
176extern void pci_unregister_driver(struct pci_driver *drv);
177
178#endif
179
180#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18))
181#define pci_module_init pci_register_driver
182#endif
183
184#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 18))
185#ifdef MODULE
186#define module_init(x) int init_module(void) { return x(); }
187#define module_exit(x) void cleanup_module(void) { x(); }
188#else
189#define module_init(x) __initcall(x);
190#define module_exit(x) __exitcall(x);
191#endif
192#endif
193
194#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 48))
195#define list_for_each(pos, head) \
196 for (pos = (head)->next; pos != (head); pos = pos->next)
197#endif
198
199#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 13))
200#define pci_resource_start(dev, bar) ((dev)->base_address[(bar)])
201#elif (LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 44))
202#define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start)
203#endif
204
205#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 23))
206#define pci_enable_device(dev) do { } while (0)
207#endif
208
209#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 14))
210#define net_device device
211#endif
212
213#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 42))
214
215
216
217#ifndef PCI_DMA_TODEVICE
218#define PCI_DMA_TODEVICE 1
219#define PCI_DMA_FROMDEVICE 2
220#endif
221
222typedef u32 dma_addr_t;
223
224
225static inline int get_order(unsigned long size)
226{
227 int order;
228
229 size = (size-1) >> (PAGE_SHIFT-1);
230 order = -1;
231 do {
232 size >>= 1;
233 order++;
234 } while (size);
235 return order;
236}
237
238static inline void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
239 dma_addr_t *dma_handle)
240{
241 void *ret;
242 int gfp = GFP_ATOMIC | GFP_DMA;
243
244 ret = (void *)__get_free_pages(gfp, get_order(size));
245
246 if (ret != NULL) {
247 memset(ret, 0, size);
248 *dma_handle = virt_to_bus(ret);
249 }
250 return ret;
251}
252static inline void pci_free_consistent(struct pci_dev *hwdev, size_t size,
253 void *vaddr, dma_addr_t dma_handle)
254{
255 free_pages((unsigned long)vaddr, get_order(size));
256}
257#define pci_map_single(cookie, address, size, dir) virt_to_bus(address)
258#define pci_unmap_single(cookie, address, size, dir)
259
260#endif
261
262#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 43))
263
264#define dev_kfree_skb_any(a) dev_kfree_skb(a)
265#define netif_down(dev) do { (dev)->start = 0; } while (0)
266
267
268#ifndef _COMPAT_NETDEVICE_H
269
270
271
272#define dev_kfree_skb_irq(a) dev_kfree_skb(a)
273#define netif_wake_queue(dev) \
274 do { clear_bit(0, &(dev)->tbusy); mark_bh(NET_BH); } while (0)
275#define netif_stop_queue(dev) set_bit(0, &(dev)->tbusy)
276
277static inline void netif_start_queue(struct net_device *dev)
278{
279 dev->tbusy = 0;
280 dev->interrupt = 0;
281 dev->start = 1;
282}
283
284#define netif_queue_stopped(dev) (dev)->tbusy
285#define netif_running(dev) (dev)->start
286
287#endif
288
289#define netif_device_attach(dev) netif_start_queue(dev)
290#define netif_device_detach(dev) netif_stop_queue(dev)
291
292
293#define tasklet_struct tq_struct
294static inline void tasklet_schedule(struct tasklet_struct *tasklet)
295{
296 queue_task(tasklet, &tq_immediate);
297 mark_bh(IMMEDIATE_BH);
298}
299
300static inline void tasklet_init(struct tasklet_struct *tasklet,
301 void (*func)(unsigned long),
302 unsigned long data)
303{
304 tasklet->next = NULL;
305 tasklet->sync = 0;
306 tasklet->routine = (void (*)(void *))func;
307 tasklet->data = (void *)data;
308}
309#define tasklet_kill(tasklet) { do {} while (0); }
310
311
312#define del_timer_sync(timer) del_timer(timer)
313
314#else
315
316#define netif_down(dev)
317
318#endif
319
320#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 3))
321
322
323#define PREPARE_TQUEUE(_tq, _routine, _data) \
324 do { \
325 (_tq)->routine = _routine; \
326 (_tq)->data = _data; \
327 } while (0)
328
329
330#define INIT_TQUEUE(_tq, _routine, _data) \
331 do { \
332 INIT_LIST_HEAD(&(_tq)->list); \
333 (_tq)->sync = 0; \
334 PREPARE_TQUEUE((_tq), (_routine), (_data)); \
335 } while (0)
336
337#endif
338
339#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 6))
340
341
342
343static inline int
344pci_save_state(struct pci_dev *dev, u32 *buffer)
345{
346 int i;
347 if (buffer) {
348 for (i = 0; i < 16; i++)
349 pci_read_config_dword(dev, i * 4, &buffer[i]);
350 }
351 return 0;
352}
353
354static inline int
355pci_restore_state(struct pci_dev *dev, u32 *buffer)
356{
357 int i;
358
359 if (buffer) {
360 for (i = 0; i < 16; i++)
361 pci_write_config_dword(dev, i * 4, buffer[i]);
362 }
363
364 else {
365 for (i = 0; i < 6; i ++)
366 pci_write_config_dword(dev,
367 PCI_BASE_ADDRESS_0 + (i * 4),
368 pci_resource_start(dev, i));
369 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
370 }
371 return 0;
372}
373
374#endif
375
376
377#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 19))
378#define read_c0_count() read_32bit_cp0_register(CP0_COUNT)
379#endif
380
381
382#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24))
383#ifndef SET_MODULE_OWNER
384#define SET_MODULE_OWNER(dev) do {} while (0)
385#define OLD_MOD_INC_USE_COUNT MOD_INC_USE_COUNT
386#define OLD_MOD_DEC_USE_COUNT MOD_DEC_USE_COUNT
387#else
388#define OLD_MOD_INC_USE_COUNT do {} while (0)
389#define OLD_MOD_DEC_USE_COUNT do {} while (0)
390#endif
391#else
392#ifndef SET_MODULE_OWNER
393#define SET_MODULE_OWNER(dev) do {} while (0)
394#endif
395#ifndef MOD_INC_USE_COUNT
396#define MOD_INC_USE_COUNT do {} while (0)
397#endif
398#ifndef MOD_DEC_USE_COUNT
399#define MOD_DEC_USE_COUNT do {} while (0)
400#endif
401#define OLD_MOD_INC_USE_COUNT MOD_INC_USE_COUNT
402#define OLD_MOD_DEC_USE_COUNT MOD_DEC_USE_COUNT
403#endif
404
405#ifndef SET_NETDEV_DEV
406#define SET_NETDEV_DEV(net, pdev) do {} while (0)
407#endif
408
409#ifndef HAVE_FREE_NETDEV
410#define free_netdev(dev) kfree(dev)
411#endif
412
413#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0))
414
415#define af_packet_priv data
416#endif
417
418
419#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
420#define DRV_SUSPEND_STATE_TYPE pm_message_t
421#else
422#define DRV_SUSPEND_STATE_TYPE uint32
423#endif
424
425#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
426#define CHECKSUM_HW CHECKSUM_PARTIAL
427#endif
428
429#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27))
430#define KILL_PROC(pid, sig) \
431{ \
432 struct task_struct *tsk; \
433 tsk = pid_task(find_vpid(pid), PIDTYPE_PID); \
434 if (tsk) send_sig(sig, tsk, 1); \
435}
436#else
437#define KILL_PROC(pid, sig) \
438{ \
439 kill_proc(pid, sig, 1); \
440}
441#endif
442
443#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0))
444#define netdev_priv(dev) dev->priv
445#endif
446
447#endif
diff --git a/drivers/net/wireless/bcm4329/include/miniopt.h b/drivers/net/wireless/bcm4329/include/miniopt.h
new file mode 100644
index 00000000000..3667fb1e215
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/miniopt.h
@@ -0,0 +1,77 @@
1/*
2 * Command line options parser.
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 * $Id: miniopt.h,v 1.1.6.2 2009/01/14 23:52:48 Exp $
24 */
25
26
27#ifndef MINI_OPT_H
28#define MINI_OPT_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34/* ---- Include Files ---------------------------------------------------- */
35/* ---- Constants and Types ---------------------------------------------- */
36
37#define MINIOPT_MAXKEY 128 /* Max options */
38typedef struct miniopt {
39
40 /* These are persistent after miniopt_init() */
41 const char* name; /* name for prompt in error strings */
42 const char* flags; /* option chars that take no args */
43 bool longflags; /* long options may be flags */
44 bool opt_end; /* at end of options (passed a "--") */
45
46 /* These are per-call to miniopt() */
47
48 int consumed; /* number of argv entries cosumed in
49 * the most recent call to miniopt()
50 */
51 bool positional;
52 bool good_int; /* 'val' member is the result of a sucessful
53 * strtol conversion of the option value
54 */
55 char opt;
56 char key[MINIOPT_MAXKEY];
57 char* valstr; /* positional param, or value for the option,
58 * or null if the option had
59 * no accompanying value
60 */
61 uint uval; /* strtol translation of valstr */
62 int val; /* strtol translation of valstr */
63} miniopt_t;
64
65void miniopt_init(miniopt_t *t, const char* name, const char* flags, bool longflags);
66int miniopt(miniopt_t *t, char **argv);
67
68
69/* ---- Variable Externs ------------------------------------------------- */
70/* ---- Function Prototypes ---------------------------------------------- */
71
72
73#ifdef __cplusplus
74 }
75#endif
76
77#endif /* MINI_OPT_H */
diff --git a/drivers/net/wireless/bcm4329/include/msgtrace.h b/drivers/net/wireless/bcm4329/include/msgtrace.h
new file mode 100644
index 00000000000..1479086dba3
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/msgtrace.h
@@ -0,0 +1,72 @@
1/*
2 * Trace messages sent over HBUS
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: msgtrace.h,v 1.1.2.4 2009/01/27 04:09:40 Exp $
25 */
26
27#ifndef _MSGTRACE_H
28#define _MSGTRACE_H
29
30#ifndef _TYPEDEFS_H_
31#include <typedefs.h>
32#endif
33
34
35/* This marks the start of a packed structure section. */
36#include <packed_section_start.h>
37
38#define MSGTRACE_VERSION 1
39
40/* Message trace header */
41typedef BWL_PRE_PACKED_STRUCT struct msgtrace_hdr {
42 uint8 version;
43 uint8 spare;
44 uint16 len; /* Len of the trace */
45 uint32 seqnum; /* Sequence number of message. Useful if the messsage has been lost
46 * because of DMA error or a bus reset (ex: SDIO Func2)
47 */
48 uint32 discarded_bytes; /* Number of discarded bytes because of trace overflow */
49 uint32 discarded_printf; /* Number of discarded printf because of trace overflow */
50} BWL_POST_PACKED_STRUCT msgtrace_hdr_t;
51
52#define MSGTRACE_HDRLEN sizeof(msgtrace_hdr_t)
53
54/* The hbus driver generates traces when sending a trace message. This causes endless traces.
55 * This flag must be set to TRUE in any hbus traces. The flag is reset in the function msgtrace_put.
56 * This prevents endless traces but generates hasardous lost of traces only in bus device code.
57 * It is recommendat to set this flag in macro SD_TRACE but not in SD_ERROR for avoiding missing
58 * hbus error traces. hbus error trace should not generates endless traces.
59 */
60extern bool msgtrace_hbus_trace;
61
62typedef void (*msgtrace_func_send_t)(void *hdl1, void *hdl2, uint8 *hdr,
63 uint16 hdrlen, uint8 *buf, uint16 buflen);
64
65extern void msgtrace_sent(void);
66extern void msgtrace_put(char *buf, int count);
67extern void msgtrace_init(void *hdl1, void *hdl2, msgtrace_func_send_t func_send);
68
69/* This marks the end of a packed structure section. */
70#include <packed_section_end.h>
71
72#endif /* _MSGTRACE_H */
diff --git a/drivers/net/wireless/bcm4329/include/osl.h b/drivers/net/wireless/bcm4329/include/osl.h
new file mode 100644
index 00000000000..5599e536eee
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/osl.h
@@ -0,0 +1,55 @@
1/*
2 * OS Abstraction Layer
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 * $Id: osl.h,v 13.37.32.1 2008/11/20 00:51:15 Exp $
24 */
25
26
27#ifndef _osl_h_
28#define _osl_h_
29
30
31typedef struct osl_info osl_t;
32typedef struct osl_dmainfo osldma_t;
33
34#define OSL_PKTTAG_SZ 32
35
36
37typedef void (*pktfree_cb_fn_t)(void *ctx, void *pkt, unsigned int status);
38
39#include <linux_osl.h>
40
41
42
43
44#define SET_REG(osh, r, mask, val) W_REG((osh), (r), ((R_REG((osh), r) & ~(mask)) | (val)))
45
46#ifndef AND_REG
47#define AND_REG(osh, r, v) W_REG(osh, (r), R_REG(osh, r) & (v))
48#endif
49
50#ifndef OR_REG
51#define OR_REG(osh, r, v) W_REG(osh, (r), R_REG(osh, r) | (v))
52#endif
53
54
55#endif
diff --git a/drivers/net/wireless/bcm4329/include/packed_section_end.h b/drivers/net/wireless/bcm4329/include/packed_section_end.h
new file mode 100644
index 00000000000..5b61c18fcd0
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/packed_section_end.h
@@ -0,0 +1,54 @@
1/*
2 * Declare directives for structure packing. No padding will be provided
3 * between the members of packed structures, and therefore, there is no
4 * guarantee that structure members will be aligned.
5 *
6 * Declaring packed structures is compiler specific. In order to handle all
7 * cases, packed structures should be delared as:
8 *
9 * #include <packed_section_start.h>
10 *
11 * typedef BWL_PRE_PACKED_STRUCT struct foobar_t {
12 * some_struct_members;
13 * } BWL_POST_PACKED_STRUCT foobar_t;
14 *
15 * #include <packed_section_end.h>
16 *
17 *
18 * Copyright (C) 1999-2010, Broadcom Corporation
19 *
20 * Unless you and Broadcom execute a separate written software license
21 * agreement governing use of this software, this software is licensed to you
22 * under the terms of the GNU General Public License version 2 (the "GPL"),
23 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
24 * following added to such license:
25 *
26 * As a special exception, the copyright holders of this software give you
27 * permission to link this software with independent modules, and to copy and
28 * distribute the resulting executable under terms of your choice, provided that
29 * you also meet, for each linked independent module, the terms and conditions of
30 * the license of that module. An independent module is a module which is not
31 * derived from this software. The special exception does not apply to any
32 * modifications of the software.
33 *
34 * Notwithstanding the above, under no circumstances may you combine this
35 * software in any way with any other Broadcom software provided under a license
36 * other than the GPL, without Broadcom's express prior written consent.
37 * $Id: packed_section_end.h,v 1.1.6.3 2008/12/10 00:27:54 Exp $
38 */
39
40
41
42
43#ifdef BWL_PACKED_SECTION
44 #undef BWL_PACKED_SECTION
45#else
46 #error "BWL_PACKED_SECTION is NOT defined!"
47#endif
48
49
50
51
52
53#undef BWL_PRE_PACKED_STRUCT
54#undef BWL_POST_PACKED_STRUCT
diff --git a/drivers/net/wireless/bcm4329/include/packed_section_start.h b/drivers/net/wireless/bcm4329/include/packed_section_start.h
new file mode 100644
index 00000000000..cb93aa64079
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/packed_section_start.h
@@ -0,0 +1,61 @@
1/*
2 * Declare directives for structure packing. No padding will be provided
3 * between the members of packed structures, and therefore, there is no
4 * guarantee that structure members will be aligned.
5 *
6 * Declaring packed structures is compiler specific. In order to handle all
7 * cases, packed structures should be delared as:
8 *
9 * #include <packed_section_start.h>
10 *
11 * typedef BWL_PRE_PACKED_STRUCT struct foobar_t {
12 * some_struct_members;
13 * } BWL_POST_PACKED_STRUCT foobar_t;
14 *
15 * #include <packed_section_end.h>
16 *
17 *
18 * Copyright (C) 1999-2010, Broadcom Corporation
19 *
20 * Unless you and Broadcom execute a separate written software license
21 * agreement governing use of this software, this software is licensed to you
22 * under the terms of the GNU General Public License version 2 (the "GPL"),
23 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
24 * following added to such license:
25 *
26 * As a special exception, the copyright holders of this software give you
27 * permission to link this software with independent modules, and to copy and
28 * distribute the resulting executable under terms of your choice, provided that
29 * you also meet, for each linked independent module, the terms and conditions of
30 * the license of that module. An independent module is a module which is not
31 * derived from this software. The special exception does not apply to any
32 * modifications of the software.
33 *
34 * Notwithstanding the above, under no circumstances may you combine this
35 * software in any way with any other Broadcom software provided under a license
36 * other than the GPL, without Broadcom's express prior written consent.
37 * $Id: packed_section_start.h,v 1.1.6.3 2008/12/10 00:27:54 Exp $
38 */
39
40
41
42
43#ifdef BWL_PACKED_SECTION
44 #error "BWL_PACKED_SECTION is already defined!"
45#else
46 #define BWL_PACKED_SECTION
47#endif
48
49
50
51
52
53#if defined(__GNUC__)
54 #define BWL_PRE_PACKED_STRUCT
55 #define BWL_POST_PACKED_STRUCT __attribute__((packed))
56#elif defined(__CC_ARM)
57 #define BWL_PRE_PACKED_STRUCT __packed
58 #define BWL_POST_PACKED_STRUCT
59#else
60 #error "Unknown compiler!"
61#endif
diff --git a/drivers/net/wireless/bcm4329/include/pcicfg.h b/drivers/net/wireless/bcm4329/include/pcicfg.h
new file mode 100644
index 00000000000..898962c942a
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/pcicfg.h
@@ -0,0 +1,52 @@
1/*
2 * pcicfg.h: PCI configuration constants and structures.
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: pcicfg.h,v 1.41.12.3 2008/06/26 22:49:41 Exp $
25 */
26
27
28#ifndef _h_pcicfg_
29#define _h_pcicfg_
30
31
32#define PCI_CFG_VID 0
33#define PCI_CFG_CMD 4
34#define PCI_CFG_REV 8
35#define PCI_CFG_BAR0 0x10
36#define PCI_CFG_BAR1 0x14
37#define PCI_BAR0_WIN 0x80
38#define PCI_INT_STATUS 0x90
39#define PCI_INT_MASK 0x94
40
41#define PCIE_EXTCFG_OFFSET 0x100
42#define PCI_BAR0_PCIREGS_OFFSET (6 * 1024)
43#define PCI_BAR0_PCISBR_OFFSET (4 * 1024)
44
45#define PCI_BAR0_WINSZ (16 * 1024)
46
47
48#define PCI_16KB0_PCIREGS_OFFSET (8 * 1024)
49#define PCI_16KB0_CCREGS_OFFSET (12 * 1024)
50#define PCI_16KBB0_WINSZ (16 * 1024)
51
52#endif
diff --git a/drivers/net/wireless/bcm4329/include/proto/802.11.h b/drivers/net/wireless/bcm4329/include/proto/802.11.h
new file mode 100644
index 00000000000..fd26317361d
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/proto/802.11.h
@@ -0,0 +1,1433 @@
1/*
2 * Copyright (C) 1999-2010, Broadcom Corporation
3 *
4 * Unless you and Broadcom execute a separate written software license
5 * agreement governing use of this software, this software is licensed to you
6 * under the terms of the GNU General Public License version 2 (the "GPL"),
7 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
8 * following added to such license:
9 *
10 * As a special exception, the copyright holders of this software give you
11 * permission to link this software with independent modules, and to copy and
12 * distribute the resulting executable under terms of your choice, provided that
13 * you also meet, for each linked independent module, the terms and conditions of
14 * the license of that module. An independent module is a module which is not
15 * derived from this software. The special exception does not apply to any
16 * modifications of the software.
17 *
18 * Notwithstanding the above, under no circumstances may you combine this
19 * software in any way with any other Broadcom software provided under a license
20 * other than the GPL, without Broadcom's express prior written consent.
21 *
22 * Fundamental types and constants relating to 802.11
23 *
24 * $Id: 802.11.h,v 9.219.4.1.4.5.6.11 2010/02/09 13:23:26 Exp $
25 */
26
27
28#ifndef _802_11_H_
29#define _802_11_H_
30
31#ifndef _TYPEDEFS_H_
32#include <typedefs.h>
33#endif
34
35#ifndef _NET_ETHERNET_H_
36#include <proto/ethernet.h>
37#endif
38
39#include <proto/wpa.h>
40
41
42#include <packed_section_start.h>
43
44
45#define DOT11_TU_TO_US 1024
46
47
48#define DOT11_A3_HDR_LEN 24
49#define DOT11_A4_HDR_LEN 30
50#define DOT11_MAC_HDR_LEN DOT11_A3_HDR_LEN
51#define DOT11_FCS_LEN 4
52#define DOT11_ICV_LEN 4
53#define DOT11_ICV_AES_LEN 8
54#define DOT11_QOS_LEN 2
55#define DOT11_HTC_LEN 4
56
57#define DOT11_KEY_INDEX_SHIFT 6
58#define DOT11_IV_LEN 4
59#define DOT11_IV_TKIP_LEN 8
60#define DOT11_IV_AES_OCB_LEN 4
61#define DOT11_IV_AES_CCM_LEN 8
62#define DOT11_IV_MAX_LEN 8
63
64
65#define DOT11_MAX_MPDU_BODY_LEN 2304
66
67#define DOT11_MAX_MPDU_LEN (DOT11_A4_HDR_LEN + \
68 DOT11_QOS_LEN + \
69 DOT11_IV_AES_CCM_LEN + \
70 DOT11_MAX_MPDU_BODY_LEN + \
71 DOT11_ICV_LEN + \
72 DOT11_FCS_LEN)
73
74#define DOT11_MAX_SSID_LEN 32
75
76
77#define DOT11_DEFAULT_RTS_LEN 2347
78#define DOT11_MAX_RTS_LEN 2347
79
80
81#define DOT11_MIN_FRAG_LEN 256
82#define DOT11_MAX_FRAG_LEN 2346
83#define DOT11_DEFAULT_FRAG_LEN 2346
84
85
86#define DOT11_MIN_BEACON_PERIOD 1
87#define DOT11_MAX_BEACON_PERIOD 0xFFFF
88
89
90#define DOT11_MIN_DTIM_PERIOD 1
91#define DOT11_MAX_DTIM_PERIOD 0xFF
92
93
94#define DOT11_LLC_SNAP_HDR_LEN 8
95#define DOT11_OUI_LEN 3
96BWL_PRE_PACKED_STRUCT struct dot11_llc_snap_header {
97 uint8 dsap;
98 uint8 ssap;
99 uint8 ctl;
100 uint8 oui[DOT11_OUI_LEN];
101 uint16 type;
102} BWL_POST_PACKED_STRUCT;
103
104
105#define RFC1042_HDR_LEN (ETHER_HDR_LEN + DOT11_LLC_SNAP_HDR_LEN)
106
107
108
109BWL_PRE_PACKED_STRUCT struct dot11_header {
110 uint16 fc;
111 uint16 durid;
112 struct ether_addr a1;
113 struct ether_addr a2;
114 struct ether_addr a3;
115 uint16 seq;
116 struct ether_addr a4;
117} BWL_POST_PACKED_STRUCT;
118
119
120
121BWL_PRE_PACKED_STRUCT struct dot11_rts_frame {
122 uint16 fc;
123 uint16 durid;
124 struct ether_addr ra;
125 struct ether_addr ta;
126} BWL_POST_PACKED_STRUCT;
127#define DOT11_RTS_LEN 16
128
129BWL_PRE_PACKED_STRUCT struct dot11_cts_frame {
130 uint16 fc;
131 uint16 durid;
132 struct ether_addr ra;
133} BWL_POST_PACKED_STRUCT;
134#define DOT11_CTS_LEN 10
135
136BWL_PRE_PACKED_STRUCT struct dot11_ack_frame {
137 uint16 fc;
138 uint16 durid;
139 struct ether_addr ra;
140} BWL_POST_PACKED_STRUCT;
141#define DOT11_ACK_LEN 10
142
143BWL_PRE_PACKED_STRUCT struct dot11_ps_poll_frame {
144 uint16 fc;
145 uint16 durid;
146 struct ether_addr bssid;
147 struct ether_addr ta;
148} BWL_POST_PACKED_STRUCT;
149#define DOT11_PS_POLL_LEN 16
150
151BWL_PRE_PACKED_STRUCT struct dot11_cf_end_frame {
152 uint16 fc;
153 uint16 durid;
154 struct ether_addr ra;
155 struct ether_addr bssid;
156} BWL_POST_PACKED_STRUCT;
157#define DOT11_CS_END_LEN 16
158
159BWL_PRE_PACKED_STRUCT struct dot11_action_wifi_vendor_specific {
160 uint8 category;
161 uint8 OUI[3];
162 uint8 type;
163 uint8 subtype;
164 uint8 data[1040];
165 struct dot11_action_wifi_vendor_specific* next_node;
166} BWL_POST_PACKED_STRUCT;
167
168typedef struct dot11_action_wifi_vendor_specific dot11_action_wifi_vendor_specific_t;
169
170#define DOT11_BA_CTL_POLICY_NORMAL 0x0000
171#define DOT11_BA_CTL_POLICY_NOACK 0x0001
172#define DOT11_BA_CTL_POLICY_MASK 0x0001
173
174#define DOT11_BA_CTL_MTID 0x0002
175#define DOT11_BA_CTL_COMPRESSED 0x0004
176
177#define DOT11_BA_CTL_NUMMSDU_MASK 0x0FC0
178#define DOT11_BA_CTL_NUMMSDU_SHIFT 6
179
180#define DOT11_BA_CTL_TID_MASK 0xF000
181#define DOT11_BA_CTL_TID_SHIFT 12
182
183
184BWL_PRE_PACKED_STRUCT struct dot11_ctl_header {
185 uint16 fc;
186 uint16 durid;
187 struct ether_addr ra;
188 struct ether_addr ta;
189} BWL_POST_PACKED_STRUCT;
190#define DOT11_CTL_HDR_LEN 16
191
192
193BWL_PRE_PACKED_STRUCT struct dot11_bar {
194 uint16 bar_control;
195 uint16 seqnum;
196} BWL_POST_PACKED_STRUCT;
197#define DOT11_BAR_LEN 4
198
199#define DOT11_BA_BITMAP_LEN 128
200#define DOT11_BA_CMP_BITMAP_LEN 8
201
202BWL_PRE_PACKED_STRUCT struct dot11_ba {
203 uint16 ba_control;
204 uint16 seqnum;
205 uint8 bitmap[DOT11_BA_BITMAP_LEN];
206} BWL_POST_PACKED_STRUCT;
207#define DOT11_BA_LEN 4
208
209
210BWL_PRE_PACKED_STRUCT struct dot11_management_header {
211 uint16 fc;
212 uint16 durid;
213 struct ether_addr da;
214 struct ether_addr sa;
215 struct ether_addr bssid;
216 uint16 seq;
217} BWL_POST_PACKED_STRUCT;
218#define DOT11_MGMT_HDR_LEN 24
219
220
221
222BWL_PRE_PACKED_STRUCT struct dot11_bcn_prb {
223 uint32 timestamp[2];
224 uint16 beacon_interval;
225 uint16 capability;
226} BWL_POST_PACKED_STRUCT;
227#define DOT11_BCN_PRB_LEN 12
228
229BWL_PRE_PACKED_STRUCT struct dot11_auth {
230 uint16 alg;
231 uint16 seq;
232 uint16 status;
233} BWL_POST_PACKED_STRUCT;
234#define DOT11_AUTH_FIXED_LEN 6
235
236BWL_PRE_PACKED_STRUCT struct dot11_assoc_req {
237 uint16 capability;
238 uint16 listen;
239} BWL_POST_PACKED_STRUCT;
240#define DOT11_ASSOC_REQ_FIXED_LEN 4
241
242BWL_PRE_PACKED_STRUCT struct dot11_reassoc_req {
243 uint16 capability;
244 uint16 listen;
245 struct ether_addr ap;
246} BWL_POST_PACKED_STRUCT;
247#define DOT11_REASSOC_REQ_FIXED_LEN 10
248
249BWL_PRE_PACKED_STRUCT struct dot11_assoc_resp {
250 uint16 capability;
251 uint16 status;
252 uint16 aid;
253} BWL_POST_PACKED_STRUCT;
254#define DOT11_ASSOC_RESP_FIXED_LEN 6
255
256BWL_PRE_PACKED_STRUCT struct dot11_action_measure {
257 uint8 category;
258 uint8 action;
259 uint8 token;
260 uint8 data[1];
261} BWL_POST_PACKED_STRUCT;
262#define DOT11_ACTION_MEASURE_LEN 3
263
264BWL_PRE_PACKED_STRUCT struct dot11_action_ht_ch_width {
265 uint8 category;
266 uint8 action;
267 uint8 ch_width;
268} BWL_POST_PACKED_STRUCT;
269
270BWL_PRE_PACKED_STRUCT struct dot11_action_ht_mimops {
271 uint8 category;
272 uint8 action;
273 uint8 control;
274} BWL_POST_PACKED_STRUCT;
275
276#define SM_PWRSAVE_ENABLE 1
277#define SM_PWRSAVE_MODE 2
278
279
280BWL_PRE_PACKED_STRUCT struct dot11_power_cnst {
281 uint8 id;
282 uint8 len;
283 uint8 power;
284} BWL_POST_PACKED_STRUCT;
285typedef struct dot11_power_cnst dot11_power_cnst_t;
286
287BWL_PRE_PACKED_STRUCT struct dot11_power_cap {
288 uint8 min;
289 uint8 max;
290} BWL_POST_PACKED_STRUCT;
291typedef struct dot11_power_cap dot11_power_cap_t;
292
293BWL_PRE_PACKED_STRUCT struct dot11_tpc_rep {
294 uint8 id;
295 uint8 len;
296 uint8 tx_pwr;
297 uint8 margin;
298} BWL_POST_PACKED_STRUCT;
299typedef struct dot11_tpc_rep dot11_tpc_rep_t;
300#define DOT11_MNG_IE_TPC_REPORT_LEN 2
301
302BWL_PRE_PACKED_STRUCT struct dot11_supp_channels {
303 uint8 id;
304 uint8 len;
305 uint8 first_channel;
306 uint8 num_channels;
307} BWL_POST_PACKED_STRUCT;
308typedef struct dot11_supp_channels dot11_supp_channels_t;
309
310
311BWL_PRE_PACKED_STRUCT struct dot11_extch {
312 uint8 id;
313 uint8 len;
314 uint8 extch;
315} BWL_POST_PACKED_STRUCT;
316typedef struct dot11_extch dot11_extch_ie_t;
317
318BWL_PRE_PACKED_STRUCT struct dot11_brcm_extch {
319 uint8 id;
320 uint8 len;
321 uint8 oui[3];
322 uint8 type;
323 uint8 extch;
324} BWL_POST_PACKED_STRUCT;
325typedef struct dot11_brcm_extch dot11_brcm_extch_ie_t;
326
327#define BRCM_EXTCH_IE_LEN 5
328#define BRCM_EXTCH_IE_TYPE 53
329#define DOT11_EXTCH_IE_LEN 1
330#define DOT11_EXT_CH_MASK 0x03
331#define DOT11_EXT_CH_UPPER 0x01
332#define DOT11_EXT_CH_LOWER 0x03
333#define DOT11_EXT_CH_NONE 0x00
334
335BWL_PRE_PACKED_STRUCT struct dot11_action_frmhdr {
336 uint8 category;
337 uint8 action;
338 uint8 data[1];
339} BWL_POST_PACKED_STRUCT;
340#define DOT11_ACTION_FRMHDR_LEN 2
341
342
343BWL_PRE_PACKED_STRUCT struct dot11_channel_switch {
344 uint8 id;
345 uint8 len;
346 uint8 mode;
347 uint8 channel;
348 uint8 count;
349} BWL_POST_PACKED_STRUCT;
350typedef struct dot11_channel_switch dot11_chan_switch_ie_t;
351
352#define DOT11_SWITCH_IE_LEN 3
353
354#define DOT11_CSA_MODE_ADVISORY 0
355#define DOT11_CSA_MODE_NO_TX 1
356
357BWL_PRE_PACKED_STRUCT struct dot11_action_switch_channel {
358 uint8 category;
359 uint8 action;
360 dot11_chan_switch_ie_t chan_switch_ie;
361 dot11_brcm_extch_ie_t extch_ie;
362} BWL_POST_PACKED_STRUCT;
363
364BWL_PRE_PACKED_STRUCT struct dot11_csa_body {
365 uint8 mode;
366 uint8 reg;
367 uint8 channel;
368 uint8 count;
369} BWL_POST_PACKED_STRUCT;
370
371
372BWL_PRE_PACKED_STRUCT struct dot11_ext_csa {
373 uint8 id;
374 uint8 len;
375 struct dot11_csa_body b;
376} BWL_POST_PACKED_STRUCT;
377
378BWL_PRE_PACKED_STRUCT struct dot11y_action_ext_csa {
379 uint8 category;
380 uint8 action;
381 struct dot11_csa_body b;
382} BWL_POST_PACKED_STRUCT;
383typedef struct dot11_ext_csa dot11_ext_csa_ie_t;
384#define DOT11_EXT_CSA_IE_LEN 4
385
386BWL_PRE_PACKED_STRUCT struct dot11_action_ext_csa {
387 uint8 category;
388 uint8 action;
389 dot11_ext_csa_ie_t chan_switch_ie;
390} BWL_POST_PACKED_STRUCT;
391
392BWL_PRE_PACKED_STRUCT struct dot11_obss_coex {
393 uint8 id;
394 uint8 len;
395 uint8 info;
396} BWL_POST_PACKED_STRUCT;
397typedef struct dot11_obss_coex dot11_obss_coex_t;
398#define DOT11_OBSS_COEXINFO_LEN 1
399
400#define DOT11_OBSS_COEX_INFO_REQ 0x01
401#define DOT11_OBSS_COEX_40MHZ_INTOLERANT 0x02
402#define DOT11_OBSS_COEX_20MHZ_WIDTH_REQ 0x04
403
404BWL_PRE_PACKED_STRUCT struct dot11_obss_chanlist {
405 uint8 id;
406 uint8 len;
407 uint8 regclass;
408 uint8 chanlist[1];
409} BWL_POST_PACKED_STRUCT;
410typedef struct dot11_obss_chanlist dot11_obss_chanlist_t;
411#define DOT11_OBSS_CHANLIST_FIXED_LEN 1
412
413BWL_PRE_PACKED_STRUCT struct dot11_extcap_ie {
414 uint8 id;
415 uint8 len;
416 uint8 cap;
417} BWL_POST_PACKED_STRUCT;
418typedef struct dot11_extcap_ie dot11_extcap_ie_t;
419#define DOT11_EXTCAP_LEN 1
420
421
422
423#define DOT11_MEASURE_TYPE_BASIC 0
424#define DOT11_MEASURE_TYPE_CCA 1
425#define DOT11_MEASURE_TYPE_RPI 2
426
427
428#define DOT11_MEASURE_MODE_ENABLE (1<<1)
429#define DOT11_MEASURE_MODE_REQUEST (1<<2)
430#define DOT11_MEASURE_MODE_REPORT (1<<3)
431
432#define DOT11_MEASURE_MODE_LATE (1<<0)
433#define DOT11_MEASURE_MODE_INCAPABLE (1<<1)
434#define DOT11_MEASURE_MODE_REFUSED (1<<2)
435
436#define DOT11_MEASURE_BASIC_MAP_BSS ((uint8)(1<<0))
437#define DOT11_MEASURE_BASIC_MAP_OFDM ((uint8)(1<<1))
438#define DOT11_MEASURE_BASIC_MAP_UKNOWN ((uint8)(1<<2))
439#define DOT11_MEASURE_BASIC_MAP_RADAR ((uint8)(1<<3))
440#define DOT11_MEASURE_BASIC_MAP_UNMEAS ((uint8)(1<<4))
441
442BWL_PRE_PACKED_STRUCT struct dot11_meas_req {
443 uint8 id;
444 uint8 len;
445 uint8 token;
446 uint8 mode;
447 uint8 type;
448 uint8 channel;
449 uint8 start_time[8];
450 uint16 duration;
451} BWL_POST_PACKED_STRUCT;
452typedef struct dot11_meas_req dot11_meas_req_t;
453#define DOT11_MNG_IE_MREQ_LEN 14
454
455#define DOT11_MNG_IE_MREQ_FIXED_LEN 3
456
457BWL_PRE_PACKED_STRUCT struct dot11_meas_rep {
458 uint8 id;
459 uint8 len;
460 uint8 token;
461 uint8 mode;
462 uint8 type;
463 BWL_PRE_PACKED_STRUCT union
464 {
465 BWL_PRE_PACKED_STRUCT struct {
466 uint8 channel;
467 uint8 start_time[8];
468 uint16 duration;
469 uint8 map;
470 } BWL_POST_PACKED_STRUCT basic;
471 uint8 data[1];
472 } BWL_POST_PACKED_STRUCT rep;
473} BWL_POST_PACKED_STRUCT;
474typedef struct dot11_meas_rep dot11_meas_rep_t;
475
476
477#define DOT11_MNG_IE_MREP_FIXED_LEN 3
478
479BWL_PRE_PACKED_STRUCT struct dot11_meas_rep_basic {
480 uint8 channel;
481 uint8 start_time[8];
482 uint16 duration;
483 uint8 map;
484} BWL_POST_PACKED_STRUCT;
485typedef struct dot11_meas_rep_basic dot11_meas_rep_basic_t;
486#define DOT11_MEASURE_BASIC_REP_LEN 12
487
488BWL_PRE_PACKED_STRUCT struct dot11_quiet {
489 uint8 id;
490 uint8 len;
491 uint8 count;
492 uint8 period;
493 uint16 duration;
494 uint16 offset;
495} BWL_POST_PACKED_STRUCT;
496typedef struct dot11_quiet dot11_quiet_t;
497
498BWL_PRE_PACKED_STRUCT struct chan_map_tuple {
499 uint8 channel;
500 uint8 map;
501} BWL_POST_PACKED_STRUCT;
502typedef struct chan_map_tuple chan_map_tuple_t;
503
504BWL_PRE_PACKED_STRUCT struct dot11_ibss_dfs {
505 uint8 id;
506 uint8 len;
507 uint8 eaddr[ETHER_ADDR_LEN];
508 uint8 interval;
509 chan_map_tuple_t map[1];
510} BWL_POST_PACKED_STRUCT;
511typedef struct dot11_ibss_dfs dot11_ibss_dfs_t;
512
513
514#define WME_OUI "\x00\x50\xf2"
515#define WME_VER 1
516#define WME_TYPE 2
517#define WME_SUBTYPE_IE 0
518#define WME_SUBTYPE_PARAM_IE 1
519#define WME_SUBTYPE_TSPEC 2
520
521
522#define AC_BE 0
523#define AC_BK 1
524#define AC_VI 2
525#define AC_VO 3
526#define AC_COUNT 4
527
528typedef uint8 ac_bitmap_t;
529
530#define AC_BITMAP_NONE 0x0
531#define AC_BITMAP_ALL 0xf
532#define AC_BITMAP_TST(ab, ac) (((ab) & (1 << (ac))) != 0)
533#define AC_BITMAP_SET(ab, ac) (((ab) |= (1 << (ac))))
534#define AC_BITMAP_RESET(ab, ac) (((ab) &= ~(1 << (ac))))
535
536
537BWL_PRE_PACKED_STRUCT struct wme_ie {
538 uint8 oui[3];
539 uint8 type;
540 uint8 subtype;
541 uint8 version;
542 uint8 qosinfo;
543} BWL_POST_PACKED_STRUCT;
544typedef struct wme_ie wme_ie_t;
545#define WME_IE_LEN 7
546
547BWL_PRE_PACKED_STRUCT struct edcf_acparam {
548 uint8 ACI;
549 uint8 ECW;
550 uint16 TXOP;
551} BWL_POST_PACKED_STRUCT;
552typedef struct edcf_acparam edcf_acparam_t;
553
554
555BWL_PRE_PACKED_STRUCT struct wme_param_ie {
556 uint8 oui[3];
557 uint8 type;
558 uint8 subtype;
559 uint8 version;
560 uint8 qosinfo;
561 uint8 rsvd;
562 edcf_acparam_t acparam[AC_COUNT];
563} BWL_POST_PACKED_STRUCT;
564typedef struct wme_param_ie wme_param_ie_t;
565#define WME_PARAM_IE_LEN 24
566
567
568#define WME_QI_AP_APSD_MASK 0x80
569#define WME_QI_AP_APSD_SHIFT 7
570#define WME_QI_AP_COUNT_MASK 0x0f
571#define WME_QI_AP_COUNT_SHIFT 0
572
573
574#define WME_QI_STA_MAXSPLEN_MASK 0x60
575#define WME_QI_STA_MAXSPLEN_SHIFT 5
576#define WME_QI_STA_APSD_ALL_MASK 0xf
577#define WME_QI_STA_APSD_ALL_SHIFT 0
578#define WME_QI_STA_APSD_BE_MASK 0x8
579#define WME_QI_STA_APSD_BE_SHIFT 3
580#define WME_QI_STA_APSD_BK_MASK 0x4
581#define WME_QI_STA_APSD_BK_SHIFT 2
582#define WME_QI_STA_APSD_VI_MASK 0x2
583#define WME_QI_STA_APSD_VI_SHIFT 1
584#define WME_QI_STA_APSD_VO_MASK 0x1
585#define WME_QI_STA_APSD_VO_SHIFT 0
586
587
588#define EDCF_AIFSN_MIN 1
589#define EDCF_AIFSN_MAX 15
590#define EDCF_AIFSN_MASK 0x0f
591#define EDCF_ACM_MASK 0x10
592#define EDCF_ACI_MASK 0x60
593#define EDCF_ACI_SHIFT 5
594#define EDCF_AIFSN_SHIFT 12
595
596
597#define EDCF_ECW_MIN 0
598#define EDCF_ECW_MAX 15
599#define EDCF_ECW2CW(exp) ((1 << (exp)) - 1)
600#define EDCF_ECWMIN_MASK 0x0f
601#define EDCF_ECWMAX_MASK 0xf0
602#define EDCF_ECWMAX_SHIFT 4
603
604
605#define EDCF_TXOP_MIN 0
606#define EDCF_TXOP_MAX 65535
607#define EDCF_TXOP2USEC(txop) ((txop) << 5)
608
609
610#define NON_EDCF_AC_BE_ACI_STA 0x02
611
612
613#define EDCF_AC_BE_ACI_STA 0x03
614#define EDCF_AC_BE_ECW_STA 0xA4
615#define EDCF_AC_BE_TXOP_STA 0x0000
616#define EDCF_AC_BK_ACI_STA 0x27
617#define EDCF_AC_BK_ECW_STA 0xA4
618#define EDCF_AC_BK_TXOP_STA 0x0000
619#define EDCF_AC_VI_ACI_STA 0x42
620#define EDCF_AC_VI_ECW_STA 0x43
621#define EDCF_AC_VI_TXOP_STA 0x005e
622#define EDCF_AC_VO_ACI_STA 0x62
623#define EDCF_AC_VO_ECW_STA 0x32
624#define EDCF_AC_VO_TXOP_STA 0x002f
625
626
627#define EDCF_AC_BE_ACI_AP 0x03
628#define EDCF_AC_BE_ECW_AP 0x64
629#define EDCF_AC_BE_TXOP_AP 0x0000
630#define EDCF_AC_BK_ACI_AP 0x27
631#define EDCF_AC_BK_ECW_AP 0xA4
632#define EDCF_AC_BK_TXOP_AP 0x0000
633#define EDCF_AC_VI_ACI_AP 0x41
634#define EDCF_AC_VI_ECW_AP 0x43
635#define EDCF_AC_VI_TXOP_AP 0x005e
636#define EDCF_AC_VO_ACI_AP 0x61
637#define EDCF_AC_VO_ECW_AP 0x32
638#define EDCF_AC_VO_TXOP_AP 0x002f
639
640
641BWL_PRE_PACKED_STRUCT struct edca_param_ie {
642 uint8 qosinfo;
643 uint8 rsvd;
644 edcf_acparam_t acparam[AC_COUNT];
645} BWL_POST_PACKED_STRUCT;
646typedef struct edca_param_ie edca_param_ie_t;
647#define EDCA_PARAM_IE_LEN 18
648
649
650BWL_PRE_PACKED_STRUCT struct qos_cap_ie {
651 uint8 qosinfo;
652} BWL_POST_PACKED_STRUCT;
653typedef struct qos_cap_ie qos_cap_ie_t;
654
655BWL_PRE_PACKED_STRUCT struct dot11_qbss_load_ie {
656 uint8 id;
657 uint8 length;
658 uint16 station_count;
659 uint8 channel_utilization;
660 uint16 aac;
661} BWL_POST_PACKED_STRUCT;
662typedef struct dot11_qbss_load_ie dot11_qbss_load_ie_t;
663
664
665#define FIXED_MSDU_SIZE 0x8000
666#define MSDU_SIZE_MASK 0x7fff
667
668
669
670#define INTEGER_SHIFT 13
671#define FRACTION_MASK 0x1FFF
672
673
674BWL_PRE_PACKED_STRUCT struct dot11_management_notification {
675 uint8 category;
676 uint8 action;
677 uint8 token;
678 uint8 status;
679 uint8 data[1];
680} BWL_POST_PACKED_STRUCT;
681#define DOT11_MGMT_NOTIFICATION_LEN 4
682
683
684#define WME_ADDTS_REQUEST 0
685#define WME_ADDTS_RESPONSE 1
686#define WME_DELTS_REQUEST 2
687
688
689#define WME_ADMISSION_ACCEPTED 0
690#define WME_INVALID_PARAMETERS 1
691#define WME_ADMISSION_REFUSED 3
692
693
694#define BCN_PRB_SSID(body) ((char*)(body) + DOT11_BCN_PRB_LEN)
695
696
697#define DOT11_OPEN_SYSTEM 0
698#define DOT11_SHARED_KEY 1
699
700#define DOT11_OPEN_SHARED 2
701#define DOT11_CHALLENGE_LEN 128
702
703
704#define FC_PVER_MASK 0x3
705#define FC_PVER_SHIFT 0
706#define FC_TYPE_MASK 0xC
707#define FC_TYPE_SHIFT 2
708#define FC_SUBTYPE_MASK 0xF0
709#define FC_SUBTYPE_SHIFT 4
710#define FC_TODS 0x100
711#define FC_TODS_SHIFT 8
712#define FC_FROMDS 0x200
713#define FC_FROMDS_SHIFT 9
714#define FC_MOREFRAG 0x400
715#define FC_MOREFRAG_SHIFT 10
716#define FC_RETRY 0x800
717#define FC_RETRY_SHIFT 11
718#define FC_PM 0x1000
719#define FC_PM_SHIFT 12
720#define FC_MOREDATA 0x2000
721#define FC_MOREDATA_SHIFT 13
722#define FC_WEP 0x4000
723#define FC_WEP_SHIFT 14
724#define FC_ORDER 0x8000
725#define FC_ORDER_SHIFT 15
726
727
728#define SEQNUM_SHIFT 4
729#define SEQNUM_MAX 0x1000
730#define FRAGNUM_MASK 0xF
731
732
733
734
735#define FC_TYPE_MNG 0
736#define FC_TYPE_CTL 1
737#define FC_TYPE_DATA 2
738
739
740#define FC_SUBTYPE_ASSOC_REQ 0
741#define FC_SUBTYPE_ASSOC_RESP 1
742#define FC_SUBTYPE_REASSOC_REQ 2
743#define FC_SUBTYPE_REASSOC_RESP 3
744#define FC_SUBTYPE_PROBE_REQ 4
745#define FC_SUBTYPE_PROBE_RESP 5
746#define FC_SUBTYPE_BEACON 8
747#define FC_SUBTYPE_ATIM 9
748#define FC_SUBTYPE_DISASSOC 10
749#define FC_SUBTYPE_AUTH 11
750#define FC_SUBTYPE_DEAUTH 12
751#define FC_SUBTYPE_ACTION 13
752#define FC_SUBTYPE_ACTION_NOACK 14
753
754
755#define FC_SUBTYPE_CTL_WRAPPER 7
756#define FC_SUBTYPE_BLOCKACK_REQ 8
757#define FC_SUBTYPE_BLOCKACK 9
758#define FC_SUBTYPE_PS_POLL 10
759#define FC_SUBTYPE_RTS 11
760#define FC_SUBTYPE_CTS 12
761#define FC_SUBTYPE_ACK 13
762#define FC_SUBTYPE_CF_END 14
763#define FC_SUBTYPE_CF_END_ACK 15
764
765
766#define FC_SUBTYPE_DATA 0
767#define FC_SUBTYPE_DATA_CF_ACK 1
768#define FC_SUBTYPE_DATA_CF_POLL 2
769#define FC_SUBTYPE_DATA_CF_ACK_POLL 3
770#define FC_SUBTYPE_NULL 4
771#define FC_SUBTYPE_CF_ACK 5
772#define FC_SUBTYPE_CF_POLL 6
773#define FC_SUBTYPE_CF_ACK_POLL 7
774#define FC_SUBTYPE_QOS_DATA 8
775#define FC_SUBTYPE_QOS_DATA_CF_ACK 9
776#define FC_SUBTYPE_QOS_DATA_CF_POLL 10
777#define FC_SUBTYPE_QOS_DATA_CF_ACK_POLL 11
778#define FC_SUBTYPE_QOS_NULL 12
779#define FC_SUBTYPE_QOS_CF_POLL 14
780#define FC_SUBTYPE_QOS_CF_ACK_POLL 15
781
782
783#define FC_SUBTYPE_ANY_QOS(s) (((s) & 8) != 0)
784#define FC_SUBTYPE_ANY_NULL(s) (((s) & 4) != 0)
785#define FC_SUBTYPE_ANY_CF_POLL(s) (((s) & 2) != 0)
786#define FC_SUBTYPE_ANY_CF_ACK(s) (((s) & 1) != 0)
787
788
789#define FC_KIND_MASK (FC_TYPE_MASK | FC_SUBTYPE_MASK)
790
791#define FC_KIND(t, s) (((t) << FC_TYPE_SHIFT) | ((s) << FC_SUBTYPE_SHIFT))
792
793#define FC_SUBTYPE(fc) (((fc) & FC_SUBTYPE_MASK) >> FC_SUBTYPE_SHIFT)
794#define FC_TYPE(fc) (((fc) & FC_TYPE_MASK) >> FC_TYPE_SHIFT)
795
796#define FC_ASSOC_REQ FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ASSOC_REQ)
797#define FC_ASSOC_RESP FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ASSOC_RESP)
798#define FC_REASSOC_REQ FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_REASSOC_REQ)
799#define FC_REASSOC_RESP FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_REASSOC_RESP)
800#define FC_PROBE_REQ FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_PROBE_REQ)
801#define FC_PROBE_RESP FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_PROBE_RESP)
802#define FC_BEACON FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_BEACON)
803#define FC_DISASSOC FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_DISASSOC)
804#define FC_AUTH FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_AUTH)
805#define FC_DEAUTH FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_DEAUTH)
806#define FC_ACTION FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ACTION)
807#define FC_ACTION_NOACK FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_ACTION_NOACK)
808
809#define FC_CTL_WRAPPER FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CTL_WRAPPER)
810#define FC_BLOCKACK_REQ FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_BLOCKACK_REQ)
811#define FC_BLOCKACK FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_BLOCKACK)
812#define FC_PS_POLL FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_PS_POLL)
813#define FC_RTS FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_RTS)
814#define FC_CTS FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CTS)
815#define FC_ACK FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_ACK)
816#define FC_CF_END FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CF_END)
817#define FC_CF_END_ACK FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CF_END_ACK)
818
819#define FC_DATA FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_DATA)
820#define FC_NULL_DATA FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_NULL)
821#define FC_DATA_CF_ACK FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_DATA_CF_ACK)
822#define FC_QOS_DATA FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_QOS_DATA)
823#define FC_QOS_NULL FC_KIND(FC_TYPE_DATA, FC_SUBTYPE_QOS_NULL)
824
825
826
827
828#define QOS_PRIO_SHIFT 0
829#define QOS_PRIO_MASK 0x0007
830#define QOS_PRIO(qos) (((qos) & QOS_PRIO_MASK) >> QOS_PRIO_SHIFT)
831
832
833#define QOS_TID_SHIFT 0
834#define QOS_TID_MASK 0x000f
835#define QOS_TID(qos) (((qos) & QOS_TID_MASK) >> QOS_TID_SHIFT)
836
837
838#define QOS_EOSP_SHIFT 4
839#define QOS_EOSP_MASK 0x0010
840#define QOS_EOSP(qos) (((qos) & QOS_EOSP_MASK) >> QOS_EOSP_SHIFT)
841
842
843#define QOS_ACK_NORMAL_ACK 0
844#define QOS_ACK_NO_ACK 1
845#define QOS_ACK_NO_EXP_ACK 2
846#define QOS_ACK_BLOCK_ACK 3
847#define QOS_ACK_SHIFT 5
848#define QOS_ACK_MASK 0x0060
849#define QOS_ACK(qos) (((qos) & QOS_ACK_MASK) >> QOS_ACK_SHIFT)
850
851
852#define QOS_AMSDU_SHIFT 7
853#define QOS_AMSDU_MASK 0x0080
854
855
856
857
858
859
860#define DOT11_MNG_AUTH_ALGO_LEN 2
861#define DOT11_MNG_AUTH_SEQ_LEN 2
862#define DOT11_MNG_BEACON_INT_LEN 2
863#define DOT11_MNG_CAP_LEN 2
864#define DOT11_MNG_AP_ADDR_LEN 6
865#define DOT11_MNG_LISTEN_INT_LEN 2
866#define DOT11_MNG_REASON_LEN 2
867#define DOT11_MNG_AID_LEN 2
868#define DOT11_MNG_STATUS_LEN 2
869#define DOT11_MNG_TIMESTAMP_LEN 8
870
871
872#define DOT11_AID_MASK 0x3fff
873
874
875#define DOT11_RC_RESERVED 0
876#define DOT11_RC_UNSPECIFIED 1
877#define DOT11_RC_AUTH_INVAL 2
878#define DOT11_RC_DEAUTH_LEAVING 3
879#define DOT11_RC_INACTIVITY 4
880#define DOT11_RC_BUSY 5
881#define DOT11_RC_INVAL_CLASS_2 6
882#define DOT11_RC_INVAL_CLASS_3 7
883#define DOT11_RC_DISASSOC_LEAVING 8
884#define DOT11_RC_NOT_AUTH 9
885#define DOT11_RC_BAD_PC 10
886#define DOT11_RC_BAD_CHANNELS 11
887
888
889
890#define DOT11_RC_UNSPECIFIED_QOS 32
891#define DOT11_RC_INSUFFCIENT_BW 33
892#define DOT11_RC_EXCESSIVE_FRAMES 34
893#define DOT11_RC_TX_OUTSIDE_TXOP 35
894#define DOT11_RC_LEAVING_QBSS 36
895#define DOT11_RC_BAD_MECHANISM 37
896#define DOT11_RC_SETUP_NEEDED 38
897#define DOT11_RC_TIMEOUT 39
898
899#define DOT11_RC_MAX 23
900
901
902#define DOT11_SC_SUCCESS 0
903#define DOT11_SC_FAILURE 1
904#define DOT11_SC_CAP_MISMATCH 10
905#define DOT11_SC_REASSOC_FAIL 11
906#define DOT11_SC_ASSOC_FAIL 12
907#define DOT11_SC_AUTH_MISMATCH 13
908#define DOT11_SC_AUTH_SEQ 14
909#define DOT11_SC_AUTH_CHALLENGE_FAIL 15
910#define DOT11_SC_AUTH_TIMEOUT 16
911#define DOT11_SC_ASSOC_BUSY_FAIL 17
912#define DOT11_SC_ASSOC_RATE_MISMATCH 18
913#define DOT11_SC_ASSOC_SHORT_REQUIRED 19
914#define DOT11_SC_ASSOC_PBCC_REQUIRED 20
915#define DOT11_SC_ASSOC_AGILITY_REQUIRED 21
916#define DOT11_SC_ASSOC_SPECTRUM_REQUIRED 22
917#define DOT11_SC_ASSOC_BAD_POWER_CAP 23
918#define DOT11_SC_ASSOC_BAD_SUP_CHANNELS 24
919#define DOT11_SC_ASSOC_SHORTSLOT_REQUIRED 25
920#define DOT11_SC_ASSOC_ERPBCC_REQUIRED 26
921#define DOT11_SC_ASSOC_DSSOFDM_REQUIRED 27
922
923#define DOT11_SC_DECLINED 37
924#define DOT11_SC_INVALID_PARAMS 38
925
926
927#define DOT11_MNG_DS_PARAM_LEN 1
928#define DOT11_MNG_IBSS_PARAM_LEN 2
929
930
931#define DOT11_MNG_TIM_FIXED_LEN 3
932#define DOT11_MNG_TIM_DTIM_COUNT 0
933#define DOT11_MNG_TIM_DTIM_PERIOD 1
934#define DOT11_MNG_TIM_BITMAP_CTL 2
935#define DOT11_MNG_TIM_PVB 3
936
937
938#define TLV_TAG_OFF 0
939#define TLV_LEN_OFF 1
940#define TLV_HDR_LEN 2
941#define TLV_BODY_OFF 2
942
943
944#define DOT11_MNG_SSID_ID 0
945#define DOT11_MNG_RATES_ID 1
946#define DOT11_MNG_FH_PARMS_ID 2
947#define DOT11_MNG_DS_PARMS_ID 3
948#define DOT11_MNG_CF_PARMS_ID 4
949#define DOT11_MNG_TIM_ID 5
950#define DOT11_MNG_IBSS_PARMS_ID 6
951#define DOT11_MNG_COUNTRY_ID 7
952#define DOT11_MNG_HOPPING_PARMS_ID 8
953#define DOT11_MNG_HOPPING_TABLE_ID 9
954#define DOT11_MNG_REQUEST_ID 10
955#define DOT11_MNG_QBSS_LOAD_ID 11
956#define DOT11_MNG_EDCA_PARAM_ID 12
957#define DOT11_MNG_CHALLENGE_ID 16
958#define DOT11_MNG_PWR_CONSTRAINT_ID 32
959#define DOT11_MNG_PWR_CAP_ID 33
960#define DOT11_MNG_TPC_REQUEST_ID 34
961#define DOT11_MNG_TPC_REPORT_ID 35
962#define DOT11_MNG_SUPP_CHANNELS_ID 36
963#define DOT11_MNG_CHANNEL_SWITCH_ID 37
964#define DOT11_MNG_MEASURE_REQUEST_ID 38
965#define DOT11_MNG_MEASURE_REPORT_ID 39
966#define DOT11_MNG_QUIET_ID 40
967#define DOT11_MNG_IBSS_DFS_ID 41
968#define DOT11_MNG_ERP_ID 42
969#define DOT11_MNG_TS_DELAY_ID 43
970#define DOT11_MNG_HT_CAP 45
971#define DOT11_MNG_QOS_CAP_ID 46
972#define DOT11_MNG_NONERP_ID 47
973#define DOT11_MNG_RSN_ID 48
974#define DOT11_MNG_EXT_RATES_ID 50
975#define DOT11_MNG_REGCLASS_ID 59
976#define DOT11_MNG_EXT_CSA_ID 60
977#define DOT11_MNG_HT_ADD 61
978#define DOT11_MNG_EXT_CHANNEL_OFFSET 62
979#define DOT11_MNG_WAPI_ID 68
980#define DOT11_MNG_HT_BSS_COEXINFO_ID 72
981#define DOT11_MNG_HT_BSS_CHANNEL_REPORT_ID 73
982#define DOT11_MNG_HT_OBSS_ID 74
983#define DOT11_MNG_EXT_CAP 127
984#define DOT11_MNG_WPA_ID 221
985#define DOT11_MNG_PROPR_ID 221
986
987
988#define DOT11_RATE_BASIC 0x80
989#define DOT11_RATE_MASK 0x7F
990
991
992#define DOT11_MNG_ERP_LEN 1
993#define DOT11_MNG_NONERP_PRESENT 0x01
994#define DOT11_MNG_USE_PROTECTION 0x02
995#define DOT11_MNG_BARKER_PREAMBLE 0x04
996
997#define DOT11_MGN_TS_DELAY_LEN 4
998#define TS_DELAY_FIELD_SIZE 4
999
1000
1001#define DOT11_CAP_ESS 0x0001
1002#define DOT11_CAP_IBSS 0x0002
1003#define DOT11_CAP_POLLABLE 0x0004
1004#define DOT11_CAP_POLL_RQ 0x0008
1005#define DOT11_CAP_PRIVACY 0x0010
1006#define DOT11_CAP_SHORT 0x0020
1007#define DOT11_CAP_PBCC 0x0040
1008#define DOT11_CAP_AGILITY 0x0080
1009#define DOT11_CAP_SPECTRUM 0x0100
1010#define DOT11_CAP_SHORTSLOT 0x0400
1011#define DOT11_CAP_CCK_OFDM 0x2000
1012
1013
1014#define DOT11_OBSS_COEX_MNG_SUPPORT 0x01
1015
1016
1017#define DOT11_ACTION_HDR_LEN 2
1018#define DOT11_ACTION_CAT_ERR_MASK 0x80
1019#define DOT11_ACTION_CAT_MASK 0x7F
1020#define DOT11_ACTION_CAT_SPECT_MNG 0
1021#define DOT11_ACTION_CAT_BLOCKACK 3
1022#define DOT11_ACTION_CAT_PUBLIC 4
1023#define DOT11_ACTION_CAT_HT 7
1024#define DOT11_ACTION_CAT_VS 127
1025#define DOT11_ACTION_NOTIFICATION 0x11
1026
1027#define DOT11_ACTION_ID_M_REQ 0
1028#define DOT11_ACTION_ID_M_REP 1
1029#define DOT11_ACTION_ID_TPC_REQ 2
1030#define DOT11_ACTION_ID_TPC_REP 3
1031#define DOT11_ACTION_ID_CHANNEL_SWITCH 4
1032#define DOT11_ACTION_ID_EXT_CSA 5
1033
1034
1035#define DOT11_ACTION_ID_HT_CH_WIDTH 0
1036#define DOT11_ACTION_ID_HT_MIMO_PS 1
1037
1038
1039#define DOT11_PUB_ACTION_BSS_COEX_MNG 0
1040#define DOT11_PUB_ACTION_CHANNEL_SWITCH 4
1041
1042
1043#define DOT11_BA_ACTION_ADDBA_REQ 0
1044#define DOT11_BA_ACTION_ADDBA_RESP 1
1045#define DOT11_BA_ACTION_DELBA 2
1046
1047
1048#define DOT11_ADDBA_PARAM_AMSDU_SUP 0x0001
1049#define DOT11_ADDBA_PARAM_POLICY_MASK 0x0002
1050#define DOT11_ADDBA_PARAM_POLICY_SHIFT 1
1051#define DOT11_ADDBA_PARAM_TID_MASK 0x003c
1052#define DOT11_ADDBA_PARAM_TID_SHIFT 2
1053#define DOT11_ADDBA_PARAM_BSIZE_MASK 0xffc0
1054#define DOT11_ADDBA_PARAM_BSIZE_SHIFT 6
1055
1056#define DOT11_ADDBA_POLICY_DELAYED 0
1057#define DOT11_ADDBA_POLICY_IMMEDIATE 1
1058
1059BWL_PRE_PACKED_STRUCT struct dot11_addba_req {
1060 uint8 category;
1061 uint8 action;
1062 uint8 token;
1063 uint16 addba_param_set;
1064 uint16 timeout;
1065 uint16 start_seqnum;
1066} BWL_POST_PACKED_STRUCT;
1067typedef struct dot11_addba_req dot11_addba_req_t;
1068#define DOT11_ADDBA_REQ_LEN 9
1069
1070BWL_PRE_PACKED_STRUCT struct dot11_addba_resp {
1071 uint8 category;
1072 uint8 action;
1073 uint8 token;
1074 uint16 status;
1075 uint16 addba_param_set;
1076 uint16 timeout;
1077} BWL_POST_PACKED_STRUCT;
1078typedef struct dot11_addba_resp dot11_addba_resp_t;
1079#define DOT11_ADDBA_RESP_LEN 9
1080
1081
1082#define DOT11_DELBA_PARAM_INIT_MASK 0x0800
1083#define DOT11_DELBA_PARAM_INIT_SHIFT 11
1084#define DOT11_DELBA_PARAM_TID_MASK 0xf000
1085#define DOT11_DELBA_PARAM_TID_SHIFT 12
1086
1087BWL_PRE_PACKED_STRUCT struct dot11_delba {
1088 uint8 category;
1089 uint8 action;
1090 uint16 delba_param_set;
1091 uint16 reason;
1092} BWL_POST_PACKED_STRUCT;
1093typedef struct dot11_delba dot11_delba_t;
1094#define DOT11_DELBA_LEN 6
1095
1096
1097#define DOT11_BSSTYPE_INFRASTRUCTURE 0
1098#define DOT11_BSSTYPE_INDEPENDENT 1
1099#define DOT11_BSSTYPE_ANY 2
1100#define DOT11_SCANTYPE_ACTIVE 0
1101#define DOT11_SCANTYPE_PASSIVE 1
1102
1103
1104#define PREN_PREAMBLE 24
1105#define PREN_MM_EXT 8
1106#define PREN_PREAMBLE_EXT 4
1107
1108
1109#define NPHY_RIFS_TIME 2
1110
1111
1112#define APHY_SLOT_TIME 9
1113#define APHY_SIFS_TIME 16
1114#define APHY_DIFS_TIME (APHY_SIFS_TIME + (2 * APHY_SLOT_TIME))
1115#define APHY_PREAMBLE_TIME 16
1116#define APHY_SIGNAL_TIME 4
1117#define APHY_SYMBOL_TIME 4
1118#define APHY_SERVICE_NBITS 16
1119#define APHY_TAIL_NBITS 6
1120#define APHY_CWMIN 15
1121
1122
1123#define BPHY_SLOT_TIME 20
1124#define BPHY_SIFS_TIME 10
1125#define BPHY_DIFS_TIME 50
1126#define BPHY_PLCP_TIME 192
1127#define BPHY_PLCP_SHORT_TIME 96
1128#define BPHY_CWMIN 31
1129
1130
1131#define DOT11_OFDM_SIGNAL_EXTENSION 6
1132
1133#define PHY_CWMAX 1023
1134
1135#define DOT11_MAXNUMFRAGS 16
1136
1137
1138typedef struct d11cnt {
1139 uint32 txfrag;
1140 uint32 txmulti;
1141 uint32 txfail;
1142 uint32 txretry;
1143 uint32 txretrie;
1144 uint32 rxdup;
1145 uint32 txrts;
1146 uint32 txnocts;
1147 uint32 txnoack;
1148 uint32 rxfrag;
1149 uint32 rxmulti;
1150 uint32 rxcrc;
1151 uint32 txfrmsnt;
1152 uint32 rxundec;
1153} d11cnt_t;
1154
1155
1156#define BRCM_PROP_OUI "\x00\x90\x4C"
1157
1158
1159
1160
1161BWL_PRE_PACKED_STRUCT struct brcm_prop_ie_s {
1162 uint8 id;
1163 uint8 len;
1164 uint8 oui[3];
1165 uint8 type;
1166 uint16 cap;
1167} BWL_POST_PACKED_STRUCT;
1168typedef struct brcm_prop_ie_s brcm_prop_ie_t;
1169
1170#define BRCM_PROP_IE_LEN 6
1171
1172#define DPT_IE_TYPE 2
1173
1174
1175#define BRCM_OUI "\x00\x10\x18"
1176
1177
1178BWL_PRE_PACKED_STRUCT struct brcm_ie {
1179 uint8 id;
1180 uint8 len;
1181 uint8 oui[3];
1182 uint8 ver;
1183 uint8 assoc;
1184 uint8 flags;
1185 uint8 flags1;
1186 uint16 amsdu_mtu_pref;
1187} BWL_POST_PACKED_STRUCT;
1188typedef struct brcm_ie brcm_ie_t;
1189#define BRCM_IE_LEN 11
1190#define BRCM_IE_VER 2
1191#define BRCM_IE_LEGACY_AES_VER 1
1192
1193
1194#ifdef WLAFTERBURNER
1195#define BRF_ABCAP 0x1
1196#define BRF_ABRQRD 0x2
1197#define BRF_ABCOUNTER_MASK 0xf0
1198#define BRF_ABCOUNTER_SHIFT 4
1199#endif
1200#define BRF_LZWDS 0x4
1201#define BRF_BLOCKACK 0x8
1202
1203
1204#define BRF1_AMSDU 0x1
1205#define BRF1_WMEPS 0x4
1206#define BRF1_PSOFIX 0x8
1207
1208#ifdef WLAFTERBURNER
1209#define AB_WDS_TIMEOUT_MAX 15
1210#define AB_WDS_TIMEOUT_MIN 1
1211#endif
1212
1213#define AB_GUARDCOUNT 10
1214
1215#define MCSSET_LEN 16
1216#define MAX_MCS_NUM (128)
1217
1218BWL_PRE_PACKED_STRUCT struct ht_cap_ie {
1219 uint16 cap;
1220 uint8 params;
1221 uint8 supp_mcs[MCSSET_LEN];
1222 uint16 ext_htcap;
1223 uint32 txbf_cap;
1224 uint8 as_cap;
1225} BWL_POST_PACKED_STRUCT;
1226typedef struct ht_cap_ie ht_cap_ie_t;
1227
1228
1229
1230BWL_PRE_PACKED_STRUCT struct ht_prop_cap_ie {
1231 uint8 id;
1232 uint8 len;
1233 uint8 oui[3];
1234 uint8 type;
1235 ht_cap_ie_t cap_ie;
1236} BWL_POST_PACKED_STRUCT;
1237typedef struct ht_prop_cap_ie ht_prop_cap_ie_t;
1238#define HT_PROP_IE_OVERHEAD 4
1239#define HT_CAP_IE_LEN 26
1240#define HT_CAP_IE_TYPE 51
1241
1242#define HT_CAP_LDPC_CODING 0x0001
1243#define HT_CAP_40MHZ 0x0002
1244#define HT_CAP_MIMO_PS_MASK 0x000C
1245#define HT_CAP_MIMO_PS_SHIFT 0x0002
1246#define HT_CAP_MIMO_PS_OFF 0x0003
1247#define HT_CAP_MIMO_PS_RTS 0x0001
1248#define HT_CAP_MIMO_PS_ON 0x0000
1249#define HT_CAP_GF 0x0010
1250#define HT_CAP_SHORT_GI_20 0x0020
1251#define HT_CAP_SHORT_GI_40 0x0040
1252#define HT_CAP_TX_STBC 0x0080
1253#define HT_CAP_RX_STBC_MASK 0x0300
1254#define HT_CAP_RX_STBC_SHIFT 8
1255#define HT_CAP_DELAYED_BA 0x0400
1256#define HT_CAP_MAX_AMSDU 0x0800
1257#define HT_CAP_DSSS_CCK 0x1000
1258#define HT_CAP_PSMP 0x2000
1259#define HT_CAP_40MHZ_INTOLERANT 0x4000
1260#define HT_CAP_LSIG_TXOP 0x8000
1261
1262#define HT_CAP_RX_STBC_NO 0x0
1263#define HT_CAP_RX_STBC_ONE_STREAM 0x1
1264#define HT_CAP_RX_STBC_TWO_STREAM 0x2
1265#define HT_CAP_RX_STBC_THREE_STREAM 0x3
1266
1267#define HT_MAX_AMSDU 7935
1268#define HT_MIN_AMSDU 3835
1269
1270#define HT_PARAMS_RX_FACTOR_MASK 0x03
1271#define HT_PARAMS_DENSITY_MASK 0x1C
1272#define HT_PARAMS_DENSITY_SHIFT 2
1273
1274
1275#define AMPDU_MAX_MPDU_DENSITY 7
1276#define AMPDU_RX_FACTOR_64K 3
1277#define AMPDU_RX_FACTOR_BASE 8*1024
1278#define AMPDU_DELIMITER_LEN 4
1279
1280#define HT_CAP_EXT_PCO 0x0001
1281#define HT_CAP_EXT_PCO_TTIME_MASK 0x0006
1282#define HT_CAP_EXT_PCO_TTIME_SHIFT 1
1283#define HT_CAP_EXT_MCS_FEEDBACK_MASK 0x0300
1284#define HT_CAP_EXT_MCS_FEEDBACK_SHIFT 8
1285#define HT_CAP_EXT_HTC 0x0400
1286#define HT_CAP_EXT_RD_RESP 0x0800
1287
1288BWL_PRE_PACKED_STRUCT struct ht_add_ie {
1289 uint8 ctl_ch;
1290 uint8 byte1;
1291 uint16 opmode;
1292 uint16 misc_bits;
1293 uint8 basic_mcs[MCSSET_LEN];
1294} BWL_POST_PACKED_STRUCT;
1295typedef struct ht_add_ie ht_add_ie_t;
1296
1297
1298
1299BWL_PRE_PACKED_STRUCT struct ht_prop_add_ie {
1300 uint8 id;
1301 uint8 len;
1302 uint8 oui[3];
1303 uint8 type;
1304 ht_add_ie_t add_ie;
1305} BWL_POST_PACKED_STRUCT;
1306typedef struct ht_prop_add_ie ht_prop_add_ie_t;
1307
1308#define HT_ADD_IE_LEN 22
1309#define HT_ADD_IE_TYPE 52
1310
1311
1312#define HT_BW_ANY 0x04
1313#define HT_RIFS_PERMITTED 0x08
1314
1315
1316#define HT_OPMODE_MASK 0x0003
1317#define HT_OPMODE_SHIFT 0
1318#define HT_OPMODE_PURE 0x0000
1319#define HT_OPMODE_OPTIONAL 0x0001
1320#define HT_OPMODE_HT20IN40 0x0002
1321#define HT_OPMODE_MIXED 0x0003
1322#define HT_OPMODE_NONGF 0x0004
1323#define DOT11N_TXBURST 0x0008
1324#define DOT11N_OBSS_NONHT 0x0010
1325
1326
1327#define HT_BASIC_STBC_MCS 0x007f
1328#define HT_DUAL_STBC_PROT 0x0080
1329#define HT_SECOND_BCN 0x0100
1330#define HT_LSIG_TXOP 0x0200
1331#define HT_PCO_ACTIVE 0x0400
1332#define HT_PCO_PHASE 0x0800
1333#define HT_DUALCTS_PROTECTION 0x0080
1334
1335
1336#define DOT11N_2G_TXBURST_LIMIT 6160
1337#define DOT11N_5G_TXBURST_LIMIT 3080
1338
1339
1340#define GET_HT_OPMODE(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) \
1341 >> HT_OPMODE_SHIFT)
1342#define HT_MIXEDMODE_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) \
1343 == HT_OPMODE_MIXED)
1344#define HT_HT20_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) \
1345 == HT_OPMODE_HT20IN40)
1346#define HT_OPTIONAL_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_MASK) \
1347 == HT_OPMODE_OPTIONAL)
1348#define HT_USE_PROTECTION(add_ie) (HT_HT20_PRESENT((add_ie)) || \
1349 HT_MIXEDMODE_PRESENT((add_ie)))
1350#define HT_NONGF_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & HT_OPMODE_NONGF) \
1351 == HT_OPMODE_NONGF)
1352#define DOT11N_TXBURST_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & DOT11N_TXBURST) \
1353 == DOT11N_TXBURST)
1354#define DOT11N_OBSS_NONHT_PRESENT(add_ie) ((ltoh16_ua(&add_ie->opmode) & DOT11N_OBSS_NONHT) \
1355 == DOT11N_OBSS_NONHT)
1356
1357BWL_PRE_PACKED_STRUCT struct obss_params {
1358 uint16 passive_dwell;
1359 uint16 active_dwell;
1360 uint16 bss_widthscan_interval;
1361 uint16 passive_total;
1362 uint16 active_total;
1363 uint16 chanwidth_transition_dly;
1364 uint16 activity_threshold;
1365} BWL_POST_PACKED_STRUCT;
1366typedef struct obss_params obss_params_t;
1367
1368BWL_PRE_PACKED_STRUCT struct dot11_obss_ie {
1369 uint8 id;
1370 uint8 len;
1371 obss_params_t obss_params;
1372} BWL_POST_PACKED_STRUCT;
1373typedef struct dot11_obss_ie dot11_obss_ie_t;
1374#define DOT11_OBSS_SCAN_IE_LEN sizeof(obss_params_t)
1375
1376
1377BWL_PRE_PACKED_STRUCT struct vndr_ie {
1378 uchar id;
1379 uchar len;
1380 uchar oui [3];
1381 uchar data [1];
1382} BWL_POST_PACKED_STRUCT;
1383typedef struct vndr_ie vndr_ie_t;
1384
1385#define VNDR_IE_HDR_LEN 2
1386#define VNDR_IE_MIN_LEN 3
1387#define VNDR_IE_MAX_LEN 256
1388
1389
1390#define WPA_VERSION 1
1391#define WPA_OUI "\x00\x50\xF2"
1392
1393#define WPA2_VERSION 1
1394#define WPA2_VERSION_LEN 2
1395#define WPA2_OUI "\x00\x0F\xAC"
1396
1397#define WPA_OUI_LEN 3
1398
1399
1400#define RSN_AKM_NONE 0
1401#define RSN_AKM_UNSPECIFIED 1
1402#define RSN_AKM_PSK 2
1403
1404
1405#define DOT11_MAX_DEFAULT_KEYS 4
1406#define DOT11_MAX_KEY_SIZE 32
1407#define DOT11_MAX_IV_SIZE 16
1408#define DOT11_EXT_IV_FLAG (1<<5)
1409#define DOT11_WPA_KEY_RSC_LEN 8
1410
1411#define WEP1_KEY_SIZE 5
1412#define WEP1_KEY_HEX_SIZE 10
1413#define WEP128_KEY_SIZE 13
1414#define WEP128_KEY_HEX_SIZE 26
1415#define TKIP_MIC_SIZE 8
1416#define TKIP_EOM_SIZE 7
1417#define TKIP_EOM_FLAG 0x5a
1418#define TKIP_KEY_SIZE 32
1419#define TKIP_MIC_AUTH_TX 16
1420#define TKIP_MIC_AUTH_RX 24
1421#define TKIP_MIC_SUP_RX TKIP_MIC_AUTH_TX
1422#define TKIP_MIC_SUP_TX TKIP_MIC_AUTH_RX
1423#define AES_KEY_SIZE 16
1424#define AES_MIC_SIZE 8
1425
1426#define SMS4_KEY_LEN 16
1427#define SMS4_WPI_CBC_MAC_LEN 16
1428
1429
1430#include <packed_section_end.h>
1431
1432
1433#endif
diff --git a/drivers/net/wireless/bcm4329/include/proto/802.11e.h b/drivers/net/wireless/bcm4329/include/proto/802.11e.h
new file mode 100644
index 00000000000..1dd6f45b1ed
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/proto/802.11e.h
@@ -0,0 +1,131 @@
1/*
2 * 802.11e protocol header file
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: 802.11e.h,v 1.5.56.1 2008/11/20 00:51:18 Exp $
25 */
26
27#ifndef _802_11e_H_
28#define _802_11e_H_
29
30#ifndef _TYPEDEFS_H_
31#include <typedefs.h>
32#endif
33
34/* This marks the start of a packed structure section. */
35#include <packed_section_start.h>
36
37
38/* WME Traffic Specification (TSPEC) element */
39#define WME_TSPEC_HDR_LEN 2 /* WME TSPEC header length */
40#define WME_TSPEC_BODY_OFF 2 /* WME TSPEC body offset */
41
42#define WME_CATEGORY_CODE_OFFSET 0 /* WME Category code offset */
43#define WME_ACTION_CODE_OFFSET 1 /* WME Action code offset */
44#define WME_TOKEN_CODE_OFFSET 2 /* WME Token code offset */
45#define WME_STATUS_CODE_OFFSET 3 /* WME Status code offset */
46
47BWL_PRE_PACKED_STRUCT struct tsinfo {
48 uint8 octets[3];
49} BWL_POST_PACKED_STRUCT;
50
51typedef struct tsinfo tsinfo_t;
52
53/* 802.11e TSPEC IE */
54typedef BWL_PRE_PACKED_STRUCT struct tspec {
55 uint8 oui[DOT11_OUI_LEN]; /* WME_OUI */
56 uint8 type; /* WME_TYPE */
57 uint8 subtype; /* WME_SUBTYPE_TSPEC */
58 uint8 version; /* WME_VERSION */
59 tsinfo_t tsinfo; /* TS Info bit field */
60 uint16 nom_msdu_size; /* (Nominal or fixed) MSDU Size (bytes) */
61 uint16 max_msdu_size; /* Maximum MSDU Size (bytes) */
62 uint32 min_srv_interval; /* Minimum Service Interval (us) */
63 uint32 max_srv_interval; /* Maximum Service Interval (us) */
64 uint32 inactivity_interval; /* Inactivity Interval (us) */
65 uint32 suspension_interval; /* Suspension Interval (us) */
66 uint32 srv_start_time; /* Service Start Time (us) */
67 uint32 min_data_rate; /* Minimum Data Rate (bps) */
68 uint32 mean_data_rate; /* Mean Data Rate (bps) */
69 uint32 peak_data_rate; /* Peak Data Rate (bps) */
70 uint32 max_burst_size; /* Maximum Burst Size (bytes) */
71 uint32 delay_bound; /* Delay Bound (us) */
72 uint32 min_phy_rate; /* Minimum PHY Rate (bps) */
73 uint16 surplus_bw; /* Surplus Bandwidth Allowance (range 1.0-8.0) */
74 uint16 medium_time; /* Medium Time (32 us/s periods) */
75} BWL_POST_PACKED_STRUCT tspec_t;
76
77#define WME_TSPEC_LEN (sizeof(tspec_t)) /* not including 2-bytes of header */
78
79/* ts_info */
80/* 802.1D priority is duplicated - bits 13-11 AND bits 3-1 */
81#define TS_INFO_TID_SHIFT 1 /* TS info. TID shift */
82#define TS_INFO_TID_MASK (0xf << TS_INFO_TID_SHIFT) /* TS info. TID mask */
83#define TS_INFO_CONTENTION_SHIFT 7 /* TS info. contention shift */
84#define TS_INFO_CONTENTION_MASK (0x1 << TS_INFO_CONTENTION_SHIFT) /* TS info. contention mask */
85#define TS_INFO_DIRECTION_SHIFT 5 /* TS info. direction shift */
86#define TS_INFO_DIRECTION_MASK (0x3 << TS_INFO_DIRECTION_SHIFT) /* TS info. direction mask */
87#define TS_INFO_PSB_SHIFT 2 /* TS info. PSB bit Shift */
88#define TS_INFO_PSB_MASK (1 << TS_INFO_PSB_SHIFT) /* TS info. PSB mask */
89#define TS_INFO_UPLINK (0 << TS_INFO_DIRECTION_SHIFT) /* TS info. uplink */
90#define TS_INFO_DOWNLINK (1 << TS_INFO_DIRECTION_SHIFT) /* TS info. downlink */
91#define TS_INFO_BIDIRECTIONAL (3 << TS_INFO_DIRECTION_SHIFT) /* TS info. bidirectional */
92#define TS_INFO_USER_PRIO_SHIFT 3 /* TS info. user priority shift */
93/* TS info. user priority mask */
94#define TS_INFO_USER_PRIO_MASK (0x7 << TS_INFO_USER_PRIO_SHIFT)
95
96/* Macro to get/set bit(s) field in TSINFO */
97#define WLC_CAC_GET_TID(pt) ((((pt).octets[0]) & TS_INFO_TID_MASK) >> TS_INFO_TID_SHIFT)
98#define WLC_CAC_GET_DIR(pt) ((((pt).octets[0]) & \
99 TS_INFO_DIRECTION_MASK) >> TS_INFO_DIRECTION_SHIFT)
100#define WLC_CAC_GET_PSB(pt) ((((pt).octets[1]) & TS_INFO_PSB_MASK) >> TS_INFO_PSB_SHIFT)
101#define WLC_CAC_GET_USER_PRIO(pt) ((((pt).octets[1]) & \
102 TS_INFO_USER_PRIO_MASK) >> TS_INFO_USER_PRIO_SHIFT)
103
104#define WLC_CAC_SET_TID(pt, id) ((((pt).octets[0]) & (~TS_INFO_TID_MASK)) | \
105 ((id) << TS_INFO_TID_SHIFT))
106#define WLC_CAC_SET_USER_PRIO(pt, prio) ((((pt).octets[0]) & (~TS_INFO_USER_PRIO_MASK)) | \
107 ((prio) << TS_INFO_USER_PRIO_SHIFT))
108
109/* 802.11e QBSS Load IE */
110#define QBSS_LOAD_IE_LEN 5 /* QBSS Load IE length */
111#define QBSS_LOAD_AAC_OFF 3 /* AAC offset in IE */
112
113#define CAC_ADDTS_RESP_TIMEOUT 300 /* default ADDTS response timeout in ms */
114
115/* 802.11e ADDTS status code */
116#define DOT11E_STATUS_ADMISSION_ACCEPTED 0 /* TSPEC Admission accepted status */
117#define DOT11E_STATUS_ADDTS_INVALID_PARAM 1 /* TSPEC invalid parameter status */
118#define DOT11E_STATUS_ADDTS_REFUSED_NSBW 3 /* ADDTS refused (non-sufficient BW) */
119#define DOT11E_STATUS_ADDTS_REFUSED_AWHILE 47 /* ADDTS refused but could retry later */
120
121/* 802.11e DELTS status code */
122#define DOT11E_STATUS_QSTA_LEAVE_QBSS 36 /* STA leave QBSS */
123#define DOT11E_STATUS_END_TS 37 /* END TS */
124#define DOT11E_STATUS_UNKNOWN_TS 38 /* UNKNOWN TS */
125#define DOT11E_STATUS_QSTA_REQ_TIMEOUT 39 /* STA ADDTS request timeout */
126
127
128/* This marks the end of a packed structure section. */
129#include <packed_section_end.h>
130
131#endif /* _802_11e_CAC_H_ */
diff --git a/drivers/net/wireless/bcm4329/include/proto/802.1d.h b/drivers/net/wireless/bcm4329/include/proto/802.1d.h
new file mode 100644
index 00000000000..45c728bc297
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/proto/802.1d.h
@@ -0,0 +1,49 @@
1/*
2 * Copyright (C) 1999-2010, Broadcom Corporation
3 *
4 * Unless you and Broadcom execute a separate written software license
5 * agreement governing use of this software, this software is licensed to you
6 * under the terms of the GNU General Public License version 2 (the "GPL"),
7 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
8 * following added to such license:
9 *
10 * As a special exception, the copyright holders of this software give you
11 * permission to link this software with independent modules, and to copy and
12 * distribute the resulting executable under terms of your choice, provided that
13 * you also meet, for each linked independent module, the terms and conditions of
14 * the license of that module. An independent module is a module which is not
15 * derived from this software. The special exception does not apply to any
16 * modifications of the software.
17 *
18 * Notwithstanding the above, under no circumstances may you combine this
19 * software in any way with any other Broadcom software provided under a license
20 * other than the GPL, without Broadcom's express prior written consent.
21 *
22 * Fundamental types and constants relating to 802.1D
23 *
24 * $Id: 802.1d.h,v 9.3 2007/04/10 21:33:06 Exp $
25 */
26
27
28#ifndef _802_1_D_
29#define _802_1_D_
30
31
32#define PRIO_8021D_NONE 2
33#define PRIO_8021D_BK 1
34#define PRIO_8021D_BE 0
35#define PRIO_8021D_EE 3
36#define PRIO_8021D_CL 4
37#define PRIO_8021D_VI 5
38#define PRIO_8021D_VO 6
39#define PRIO_8021D_NC 7
40#define MAXPRIO 7
41#define NUMPRIO (MAXPRIO + 1)
42
43#define ALLPRIO -1
44
45
46#define PRIO2PREC(prio) \
47 (((prio) == PRIO_8021D_NONE || (prio) == PRIO_8021D_BE) ? ((prio^2)) : (prio))
48
49#endif
diff --git a/drivers/net/wireless/bcm4329/include/proto/bcmeth.h b/drivers/net/wireless/bcm4329/include/proto/bcmeth.h
new file mode 100644
index 00000000000..fdb5a2a5648
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/proto/bcmeth.h
@@ -0,0 +1,83 @@
1/*
2 * Broadcom Ethernettype protocol definitions
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: bcmeth.h,v 9.9.46.1 2008/11/20 00:51:20 Exp $
25 */
26
27
28
29
30#ifndef _BCMETH_H_
31#define _BCMETH_H_
32
33#ifndef _TYPEDEFS_H_
34#include <typedefs.h>
35#endif
36
37
38#include <packed_section_start.h>
39
40
41
42
43
44
45
46#define BCMILCP_SUBTYPE_RATE 1
47#define BCMILCP_SUBTYPE_LINK 2
48#define BCMILCP_SUBTYPE_CSA 3
49#define BCMILCP_SUBTYPE_LARQ 4
50#define BCMILCP_SUBTYPE_VENDOR 5
51#define BCMILCP_SUBTYPE_FLH 17
52
53#define BCMILCP_SUBTYPE_VENDOR_LONG 32769
54#define BCMILCP_SUBTYPE_CERT 32770
55#define BCMILCP_SUBTYPE_SES 32771
56
57
58#define BCMILCP_BCM_SUBTYPE_RESERVED 0
59#define BCMILCP_BCM_SUBTYPE_EVENT 1
60#define BCMILCP_BCM_SUBTYPE_SES 2
61
62
63#define BCMILCP_BCM_SUBTYPE_DPT 4
64
65#define BCMILCP_BCM_SUBTYPEHDR_MINLENGTH 8
66#define BCMILCP_BCM_SUBTYPEHDR_VERSION 0
67
68
69typedef BWL_PRE_PACKED_STRUCT struct bcmeth_hdr
70{
71 uint16 subtype;
72 uint16 length;
73 uint8 version;
74 uint8 oui[3];
75
76 uint16 usr_subtype;
77} BWL_POST_PACKED_STRUCT bcmeth_hdr_t;
78
79
80
81#include <packed_section_end.h>
82
83#endif
diff --git a/drivers/net/wireless/bcm4329/include/proto/bcmevent.h b/drivers/net/wireless/bcm4329/include/proto/bcmevent.h
new file mode 100644
index 00000000000..1f8ecb14d97
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/proto/bcmevent.h
@@ -0,0 +1,212 @@
1/*
2 * Broadcom Event protocol definitions
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 *
25 * Dependencies: proto/bcmeth.h
26 *
27 * $Id: bcmevent.h,v 9.34.4.1.20.16.64.1 2010/11/08 21:57:03 Exp $
28 *
29 */
30
31
32
33
34#ifndef _BCMEVENT_H_
35#define _BCMEVENT_H_
36
37#ifndef _TYPEDEFS_H_
38#include <typedefs.h>
39#endif
40
41
42#include <packed_section_start.h>
43
44#define BCM_EVENT_MSG_VERSION 1
45#define BCM_MSG_IFNAME_MAX 16
46
47
48#define WLC_EVENT_MSG_LINK 0x01
49#define WLC_EVENT_MSG_FLUSHTXQ 0x02
50#define WLC_EVENT_MSG_GROUP 0x04
51
52
53typedef BWL_PRE_PACKED_STRUCT struct
54{
55 uint16 version;
56 uint16 flags;
57 uint32 event_type;
58 uint32 status;
59 uint32 reason;
60 uint32 auth_type;
61 uint32 datalen;
62 struct ether_addr addr;
63 char ifname[BCM_MSG_IFNAME_MAX];
64} BWL_POST_PACKED_STRUCT wl_event_msg_t;
65
66
67typedef BWL_PRE_PACKED_STRUCT struct bcm_event {
68 struct ether_header eth;
69 bcmeth_hdr_t bcm_hdr;
70 wl_event_msg_t event;
71
72} BWL_POST_PACKED_STRUCT bcm_event_t;
73
74#define BCM_MSG_LEN (sizeof(bcm_event_t) - sizeof(bcmeth_hdr_t) - sizeof(struct ether_header))
75
76
77#define WLC_E_SET_SSID 0
78#define WLC_E_JOIN 1
79#define WLC_E_START 2
80#define WLC_E_AUTH 3
81#define WLC_E_AUTH_IND 4
82#define WLC_E_DEAUTH 5
83#define WLC_E_DEAUTH_IND 6
84#define WLC_E_ASSOC 7
85#define WLC_E_ASSOC_IND 8
86#define WLC_E_REASSOC 9
87#define WLC_E_REASSOC_IND 10
88#define WLC_E_DISASSOC 11
89#define WLC_E_DISASSOC_IND 12
90#define WLC_E_QUIET_START 13
91#define WLC_E_QUIET_END 14
92#define WLC_E_BEACON_RX 15
93#define WLC_E_LINK 16
94#define WLC_E_MIC_ERROR 17
95#define WLC_E_NDIS_LINK 18
96#define WLC_E_ROAM 19
97#define WLC_E_TXFAIL 20
98#define WLC_E_PMKID_CACHE 21
99#define WLC_E_RETROGRADE_TSF 22
100#define WLC_E_PRUNE 23
101#define WLC_E_AUTOAUTH 24
102#define WLC_E_EAPOL_MSG 25
103#define WLC_E_SCAN_COMPLETE 26
104#define WLC_E_ADDTS_IND 27
105#define WLC_E_DELTS_IND 28
106#define WLC_E_BCNSENT_IND 29
107#define WLC_E_BCNRX_MSG 30
108#define WLC_E_BCNLOST_MSG 31
109#define WLC_E_ROAM_PREP 32
110#define WLC_E_PFN_NET_FOUND 33
111#define WLC_E_PFN_NET_LOST 34
112#define WLC_E_RESET_COMPLETE 35
113#define WLC_E_JOIN_START 36
114#define WLC_E_ROAM_START 37
115#define WLC_E_ASSOC_START 38
116#define WLC_E_IBSS_ASSOC 39
117#define WLC_E_RADIO 40
118#define WLC_E_PSM_WATCHDOG 41
119#define WLC_E_PROBREQ_MSG 44
120#define WLC_E_SCAN_CONFIRM_IND 45
121#define WLC_E_PSK_SUP 46
122#define WLC_E_COUNTRY_CODE_CHANGED 47
123#define WLC_E_EXCEEDED_MEDIUM_TIME 48
124#define WLC_E_ICV_ERROR 49
125#define WLC_E_UNICAST_DECODE_ERROR 50
126#define WLC_E_MULTICAST_DECODE_ERROR 51
127#define WLC_E_TRACE 52
128#define WLC_E_IF 54
129#define WLC_E_RSSI 56
130#define WLC_E_PFN_SCAN_COMPLETE 57
131#define WLC_E_ACTION_FRAME 58
132#define WLC_E_ACTION_FRAME_COMPLETE 59
133
134#define WLC_E_ESCAN_RESULT 69
135#define WLC_E_WAKE_EVENT 70
136#define WLC_E_RELOAD 71
137#define WLC_E_LAST 72
138
139
140
141#define WLC_E_STATUS_SUCCESS 0
142#define WLC_E_STATUS_FAIL 1
143#define WLC_E_STATUS_TIMEOUT 2
144#define WLC_E_STATUS_NO_NETWORKS 3
145#define WLC_E_STATUS_ABORT 4
146#define WLC_E_STATUS_NO_ACK 5
147#define WLC_E_STATUS_UNSOLICITED 6
148#define WLC_E_STATUS_ATTEMPT 7
149#define WLC_E_STATUS_PARTIAL 8
150#define WLC_E_STATUS_NEWSCAN 9
151#define WLC_E_STATUS_NEWASSOC 10
152#define WLC_E_STATUS_11HQUIET 11
153#define WLC_E_STATUS_SUPPRESS 12
154#define WLC_E_STATUS_NOCHANS 13
155#define WLC_E_STATUS_CCXFASTRM 14
156#define WLC_E_STATUS_CS_ABORT 15
157
158
159#define WLC_E_REASON_INITIAL_ASSOC 0
160#define WLC_E_REASON_LOW_RSSI 1
161#define WLC_E_REASON_DEAUTH 2
162#define WLC_E_REASON_DISASSOC 3
163#define WLC_E_REASON_BCNS_LOST 4
164#define WLC_E_REASON_FAST_ROAM_FAILED 5
165#define WLC_E_REASON_DIRECTED_ROAM 6
166#define WLC_E_REASON_TSPEC_REJECTED 7
167#define WLC_E_REASON_BETTER_AP 8
168
169
170#define WLC_E_PRUNE_ENCR_MISMATCH 1
171#define WLC_E_PRUNE_BCAST_BSSID 2
172#define WLC_E_PRUNE_MAC_DENY 3
173#define WLC_E_PRUNE_MAC_NA 4
174#define WLC_E_PRUNE_REG_PASSV 5
175#define WLC_E_PRUNE_SPCT_MGMT 6
176#define WLC_E_PRUNE_RADAR 7
177#define WLC_E_RSN_MISMATCH 8
178#define WLC_E_PRUNE_NO_COMMON_RATES 9
179#define WLC_E_PRUNE_BASIC_RATES 10
180#define WLC_E_PRUNE_CIPHER_NA 12
181#define WLC_E_PRUNE_KNOWN_STA 13
182#define WLC_E_PRUNE_WDS_PEER 15
183#define WLC_E_PRUNE_QBSS_LOAD 16
184#define WLC_E_PRUNE_HOME_AP 17
185
186
187#define WLC_E_SUP_OTHER 0
188#define WLC_E_SUP_DECRYPT_KEY_DATA 1
189#define WLC_E_SUP_BAD_UCAST_WEP128 2
190#define WLC_E_SUP_BAD_UCAST_WEP40 3
191#define WLC_E_SUP_UNSUP_KEY_LEN 4
192#define WLC_E_SUP_PW_KEY_CIPHER 5
193#define WLC_E_SUP_MSG3_TOO_MANY_IE 6
194#define WLC_E_SUP_MSG3_IE_MISMATCH 7
195#define WLC_E_SUP_NO_INSTALL_FLAG 8
196#define WLC_E_SUP_MSG3_NO_GTK 9
197#define WLC_E_SUP_GRP_KEY_CIPHER 10
198#define WLC_E_SUP_GRP_MSG1_NO_GTK 11
199#define WLC_E_SUP_GTK_DECRYPT_FAIL 12
200#define WLC_E_SUP_SEND_FAIL 13
201#define WLC_E_SUP_DEAUTH 14
202#define WLC_E_SUP_WPA_PSK_TMO 15
203
204
205#define WLC_E_IF_ADD 1
206#define WLC_E_IF_DEL 2
207
208#define WLC_E_RELOAD_STATUS1 1
209
210#include <packed_section_end.h>
211
212#endif
diff --git a/drivers/net/wireless/bcm4329/include/proto/bcmip.h b/drivers/net/wireless/bcm4329/include/proto/bcmip.h
new file mode 100644
index 00000000000..9d2fd6fba48
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/proto/bcmip.h
@@ -0,0 +1,157 @@
1/*
2 * Copyright (C) 1999-2010, Broadcom Corporation
3 *
4 * Unless you and Broadcom execute a separate written software license
5 * agreement governing use of this software, this software is licensed to you
6 * under the terms of the GNU General Public License version 2 (the "GPL"),
7 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
8 * following added to such license:
9 *
10 * As a special exception, the copyright holders of this software give you
11 * permission to link this software with independent modules, and to copy and
12 * distribute the resulting executable under terms of your choice, provided that
13 * you also meet, for each linked independent module, the terms and conditions of
14 * the license of that module. An independent module is a module which is not
15 * derived from this software. The special exception does not apply to any
16 * modifications of the software.
17 *
18 * Notwithstanding the above, under no circumstances may you combine this
19 * software in any way with any other Broadcom software provided under a license
20 * other than the GPL, without Broadcom's express prior written consent.
21 *
22 * Fundamental constants relating to IP Protocol
23 *
24 * $Id: bcmip.h,v 9.16.186.4 2009/01/27 04:25:25 Exp $
25 */
26
27
28#ifndef _bcmip_h_
29#define _bcmip_h_
30
31#ifndef _TYPEDEFS_H_
32#include <typedefs.h>
33#endif
34
35
36#include <packed_section_start.h>
37
38
39
40#define IP_VER_OFFSET 0x0
41#define IP_VER_MASK 0xf0
42#define IP_VER_SHIFT 4
43#define IP_VER_4 4
44#define IP_VER_6 6
45
46#define IP_VER(ip_body) \
47 ((((uint8 *)(ip_body))[IP_VER_OFFSET] & IP_VER_MASK) >> IP_VER_SHIFT)
48
49#define IP_PROT_ICMP 0x1
50#define IP_PROT_TCP 0x6
51#define IP_PROT_UDP 0x11
52
53
54#define IPV4_VER_HL_OFFSET 0
55#define IPV4_TOS_OFFSET 1
56#define IPV4_PKTLEN_OFFSET 2
57#define IPV4_PKTFLAG_OFFSET 6
58#define IPV4_PROT_OFFSET 9
59#define IPV4_CHKSUM_OFFSET 10
60#define IPV4_SRC_IP_OFFSET 12
61#define IPV4_DEST_IP_OFFSET 16
62#define IPV4_OPTIONS_OFFSET 20
63
64
65#define IPV4_VER_MASK 0xf0
66#define IPV4_VER_SHIFT 4
67
68#define IPV4_HLEN_MASK 0x0f
69#define IPV4_HLEN(ipv4_body) (4 * (((uint8 *)(ipv4_body))[IPV4_VER_HL_OFFSET] & IPV4_HLEN_MASK))
70
71#define IPV4_ADDR_LEN 4
72
73#define IPV4_ADDR_NULL(a) ((((uint8 *)(a))[0] | ((uint8 *)(a))[1] | \
74 ((uint8 *)(a))[2] | ((uint8 *)(a))[3]) == 0)
75
76#define IPV4_ADDR_BCAST(a) ((((uint8 *)(a))[0] & ((uint8 *)(a))[1] & \
77 ((uint8 *)(a))[2] & ((uint8 *)(a))[3]) == 0xff)
78
79#define IPV4_TOS_DSCP_MASK 0xfc
80#define IPV4_TOS_DSCP_SHIFT 2
81
82#define IPV4_TOS(ipv4_body) (((uint8 *)(ipv4_body))[IPV4_TOS_OFFSET])
83
84#define IPV4_TOS_PREC_MASK 0xe0
85#define IPV4_TOS_PREC_SHIFT 5
86
87#define IPV4_TOS_LOWDELAY 0x10
88#define IPV4_TOS_THROUGHPUT 0x8
89#define IPV4_TOS_RELIABILITY 0x4
90
91#define IPV4_PROT(ipv4_body) (((uint8 *)(ipv4_body))[IPV4_PROT_OFFSET])
92
93#define IPV4_FRAG_RESV 0x8000
94#define IPV4_FRAG_DONT 0x4000
95#define IPV4_FRAG_MORE 0x2000
96#define IPV4_FRAG_OFFSET_MASK 0x1fff
97
98#define IPV4_ADDR_STR_LEN 16
99
100
101BWL_PRE_PACKED_STRUCT struct ipv4_addr {
102 uint8 addr[IPV4_ADDR_LEN];
103} BWL_POST_PACKED_STRUCT;
104
105BWL_PRE_PACKED_STRUCT struct ipv4_hdr {
106 uint8 version_ihl;
107 uint8 tos;
108 uint16 tot_len;
109 uint16 id;
110 uint16 frag;
111 uint8 ttl;
112 uint8 prot;
113 uint16 hdr_chksum;
114 uint8 src_ip[IPV4_ADDR_LEN];
115 uint8 dst_ip[IPV4_ADDR_LEN];
116} BWL_POST_PACKED_STRUCT;
117
118
119#define IPV6_PAYLOAD_LEN_OFFSET 4
120#define IPV6_NEXT_HDR_OFFSET 6
121#define IPV6_HOP_LIMIT_OFFSET 7
122#define IPV6_SRC_IP_OFFSET 8
123#define IPV6_DEST_IP_OFFSET 24
124
125
126#define IPV6_TRAFFIC_CLASS(ipv6_body) \
127 (((((uint8 *)(ipv6_body))[0] & 0x0f) << 4) | \
128 ((((uint8 *)(ipv6_body))[1] & 0xf0) >> 4))
129
130#define IPV6_FLOW_LABEL(ipv6_body) \
131 (((((uint8 *)(ipv6_body))[1] & 0x0f) << 16) | \
132 (((uint8 *)(ipv6_body))[2] << 8) | \
133 (((uint8 *)(ipv6_body))[3]))
134
135#define IPV6_PAYLOAD_LEN(ipv6_body) \
136 ((((uint8 *)(ipv6_body))[IPV6_PAYLOAD_LEN_OFFSET + 0] << 8) | \
137 ((uint8 *)(ipv6_body))[IPV6_PAYLOAD_LEN_OFFSET + 1])
138
139#define IPV6_NEXT_HDR(ipv6_body) \
140 (((uint8 *)(ipv6_body))[IPV6_NEXT_HDR_OFFSET])
141
142#define IPV6_PROT(ipv6_body) IPV6_NEXT_HDR(ipv6_body)
143
144#define IPV6_ADDR_LEN 16
145
146
147#ifndef IP_TOS
148#define IP_TOS(ip_body) \
149 (IP_VER(ip_body) == IP_VER_4 ? IPV4_TOS(ip_body) : \
150 IP_VER(ip_body) == IP_VER_6 ? IPV6_TRAFFIC_CLASS(ip_body) : 0)
151#endif
152
153
154
155#include <packed_section_end.h>
156
157#endif
diff --git a/drivers/net/wireless/bcm4329/include/proto/eapol.h b/drivers/net/wireless/bcm4329/include/proto/eapol.h
new file mode 100644
index 00000000000..95e76ff18c6
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/proto/eapol.h
@@ -0,0 +1,172 @@
1/*
2 * 802.1x EAPOL definitions
3 *
4 * See
5 * IEEE Std 802.1X-2001
6 * IEEE 802.1X RADIUS Usage Guidelines
7 *
8 * Copyright (C) 2002 Broadcom Corporation
9 *
10 * $Id: eapol.h,v 9.18.260.1.2.1.6.6 2009/04/08 05:00:08 Exp $
11 */
12
13#ifndef _eapol_h_
14#define _eapol_h_
15
16#ifndef _TYPEDEFS_H_
17#include <typedefs.h>
18#endif
19
20/* This marks the start of a packed structure section. */
21#include <packed_section_start.h>
22
23#define AKW_BLOCK_LEN 8 /* The only def we need here */
24
25/* EAPOL for 802.3/Ethernet */
26typedef struct {
27 struct ether_header eth; /* 802.3/Ethernet header */
28 unsigned char version; /* EAPOL protocol version */
29 unsigned char type; /* EAPOL type */
30 unsigned short length; /* Length of body */
31 unsigned char body[1]; /* Body (optional) */
32} eapol_header_t;
33
34#define EAPOL_HEADER_LEN 18
35
36/* EAPOL version */
37#define WPA2_EAPOL_VERSION 2
38#define WPA_EAPOL_VERSION 1
39#define LEAP_EAPOL_VERSION 1
40#define SES_EAPOL_VERSION 1
41
42/* EAPOL types */
43#define EAP_PACKET 0
44#define EAPOL_START 1
45#define EAPOL_LOGOFF 2
46#define EAPOL_KEY 3
47#define EAPOL_ASF 4
48
49/* EAPOL-Key types */
50#define EAPOL_RC4_KEY 1
51#define EAPOL_WPA2_KEY 2 /* 802.11i/WPA2 */
52#define EAPOL_WPA_KEY 254 /* WPA */
53
54/* RC4 EAPOL-Key header field sizes */
55#define EAPOL_KEY_REPLAY_LEN 8
56#define EAPOL_KEY_IV_LEN 16
57#define EAPOL_KEY_SIG_LEN 16
58
59/* RC4 EAPOL-Key */
60typedef BWL_PRE_PACKED_STRUCT struct {
61 unsigned char type; /* Key Descriptor Type */
62 unsigned short length; /* Key Length (unaligned) */
63 unsigned char replay[EAPOL_KEY_REPLAY_LEN]; /* Replay Counter */
64 unsigned char iv[EAPOL_KEY_IV_LEN]; /* Key IV */
65 unsigned char index; /* Key Flags & Index */
66 unsigned char signature[EAPOL_KEY_SIG_LEN]; /* Key Signature */
67 unsigned char key[1]; /* Key (optional) */
68} BWL_POST_PACKED_STRUCT eapol_key_header_t;
69
70#define EAPOL_KEY_HEADER_LEN 44
71
72/* RC4 EAPOL-Key flags */
73#define EAPOL_KEY_FLAGS_MASK 0x80
74#define EAPOL_KEY_BROADCAST 0
75#define EAPOL_KEY_UNICAST 0x80
76
77/* RC4 EAPOL-Key index */
78#define EAPOL_KEY_INDEX_MASK 0x7f
79
80/* WPA/802.11i/WPA2 EAPOL-Key header field sizes */
81#define EAPOL_WPA_KEY_REPLAY_LEN 8
82#define EAPOL_WPA_KEY_NONCE_LEN 32
83#define EAPOL_WPA_KEY_IV_LEN 16
84#define EAPOL_WPA_KEY_ID_LEN 8
85#define EAPOL_WPA_KEY_RSC_LEN 8
86#define EAPOL_WPA_KEY_MIC_LEN 16
87#define EAPOL_WPA_KEY_DATA_LEN (EAPOL_WPA_MAX_KEY_SIZE + AKW_BLOCK_LEN)
88#define EAPOL_WPA_MAX_KEY_SIZE 32
89
90/* WPA EAPOL-Key */
91typedef BWL_PRE_PACKED_STRUCT struct {
92 unsigned char type; /* Key Descriptor Type */
93 unsigned short key_info; /* Key Information (unaligned) */
94 unsigned short key_len; /* Key Length (unaligned) */
95 unsigned char replay[EAPOL_WPA_KEY_REPLAY_LEN]; /* Replay Counter */
96 unsigned char nonce[EAPOL_WPA_KEY_NONCE_LEN]; /* Nonce */
97 unsigned char iv[EAPOL_WPA_KEY_IV_LEN]; /* Key IV */
98 unsigned char rsc[EAPOL_WPA_KEY_RSC_LEN]; /* Key RSC */
99 unsigned char id[EAPOL_WPA_KEY_ID_LEN]; /* WPA:Key ID, 802.11i/WPA2: Reserved */
100 unsigned char mic[EAPOL_WPA_KEY_MIC_LEN]; /* Key MIC */
101 unsigned short data_len; /* Key Data Length */
102 unsigned char data[EAPOL_WPA_KEY_DATA_LEN]; /* Key data */
103} BWL_POST_PACKED_STRUCT eapol_wpa_key_header_t;
104
105#define EAPOL_WPA_KEY_LEN 95
106
107/* WPA/802.11i/WPA2 KEY KEY_INFO bits */
108#define WPA_KEY_DESC_V1 0x01
109#define WPA_KEY_DESC_V2 0x02
110#define WPA_KEY_PAIRWISE 0x08
111#define WPA_KEY_INSTALL 0x40
112#define WPA_KEY_ACK 0x80
113#define WPA_KEY_MIC 0x100
114#define WPA_KEY_SECURE 0x200
115#define WPA_KEY_ERROR 0x400
116#define WPA_KEY_REQ 0x800
117
118/* WPA-only KEY KEY_INFO bits */
119#define WPA_KEY_INDEX_0 0x00
120#define WPA_KEY_INDEX_1 0x10
121#define WPA_KEY_INDEX_2 0x20
122#define WPA_KEY_INDEX_3 0x30
123#define WPA_KEY_INDEX_MASK 0x30
124#define WPA_KEY_INDEX_SHIFT 0x04
125
126/* 802.11i/WPA2-only KEY KEY_INFO bits */
127#define WPA_KEY_ENCRYPTED_DATA 0x1000
128
129/* Key Data encapsulation */
130typedef BWL_PRE_PACKED_STRUCT struct {
131 uint8 type;
132 uint8 length;
133 uint8 oui[3];
134 uint8 subtype;
135 uint8 data[1];
136} BWL_POST_PACKED_STRUCT eapol_wpa2_encap_data_t;
137
138#define EAPOL_WPA2_ENCAP_DATA_HDR_LEN 6
139
140#define WPA2_KEY_DATA_SUBTYPE_GTK 1
141#define WPA2_KEY_DATA_SUBTYPE_STAKEY 2
142#define WPA2_KEY_DATA_SUBTYPE_MAC 3
143#define WPA2_KEY_DATA_SUBTYPE_PMKID 4
144
145/* GTK encapsulation */
146typedef BWL_PRE_PACKED_STRUCT struct {
147 uint8 flags;
148 uint8 reserved;
149 uint8 gtk[EAPOL_WPA_MAX_KEY_SIZE];
150} BWL_POST_PACKED_STRUCT eapol_wpa2_key_gtk_encap_t;
151
152#define EAPOL_WPA2_KEY_GTK_ENCAP_HDR_LEN 2
153
154#define WPA2_GTK_INDEX_MASK 0x03
155#define WPA2_GTK_INDEX_SHIFT 0x00
156
157#define WPA2_GTK_TRANSMIT 0x04
158
159/* STAKey encapsulation */
160typedef BWL_PRE_PACKED_STRUCT struct {
161 uint8 reserved[2];
162 uint8 mac[ETHER_ADDR_LEN];
163 uint8 stakey[EAPOL_WPA_MAX_KEY_SIZE];
164} BWL_POST_PACKED_STRUCT eapol_wpa2_key_stakey_encap_t;
165
166#define WPA2_KEY_DATA_PAD 0xdd
167
168
169/* This marks the end of a packed structure section. */
170#include <packed_section_end.h>
171
172#endif /* _eapol_h_ */
diff --git a/drivers/net/wireless/bcm4329/include/proto/ethernet.h b/drivers/net/wireless/bcm4329/include/proto/ethernet.h
new file mode 100644
index 00000000000..9ad2ea0c70f
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/proto/ethernet.h
@@ -0,0 +1,148 @@
1/*
2 * From FreeBSD 2.2.7: Fundamental constants relating to ethernet.
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: ethernet.h,v 9.45.56.5 2010/02/22 22:04:36 Exp $
25 */
26
27
28#ifndef _NET_ETHERNET_H_
29#define _NET_ETHERNET_H_
30
31#ifndef _TYPEDEFS_H_
32#include "typedefs.h"
33#endif
34
35
36#include <packed_section_start.h>
37
38
39
40#define ETHER_ADDR_LEN 6
41
42
43#define ETHER_TYPE_LEN 2
44
45
46#define ETHER_CRC_LEN 4
47
48
49#define ETHER_HDR_LEN (ETHER_ADDR_LEN * 2 + ETHER_TYPE_LEN)
50
51
52#define ETHER_MIN_LEN 64
53
54
55#define ETHER_MIN_DATA 46
56
57
58#define ETHER_MAX_LEN 1518
59
60
61#define ETHER_MAX_DATA 1500
62
63
64#define ETHER_TYPE_MIN 0x0600
65#define ETHER_TYPE_IP 0x0800
66#define ETHER_TYPE_ARP 0x0806
67#define ETHER_TYPE_8021Q 0x8100
68#define ETHER_TYPE_BRCM 0x886c
69#define ETHER_TYPE_802_1X 0x888e
70#define ETHER_TYPE_WAI 0x88b4
71#ifdef BCMWPA2
72#define ETHER_TYPE_802_1X_PREAUTH 0x88c7
73#endif
74
75
76#define ETHER_BRCM_SUBTYPE_LEN 4
77#define ETHER_BRCM_CRAM 1
78
79
80#define ETHER_DEST_OFFSET (0 * ETHER_ADDR_LEN)
81#define ETHER_SRC_OFFSET (1 * ETHER_ADDR_LEN)
82#define ETHER_TYPE_OFFSET (2 * ETHER_ADDR_LEN)
83
84
85#define ETHER_IS_VALID_LEN(foo) \
86 ((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN)
87
88
89#ifndef __INCif_etherh
90
91BWL_PRE_PACKED_STRUCT struct ether_header {
92 uint8 ether_dhost[ETHER_ADDR_LEN];
93 uint8 ether_shost[ETHER_ADDR_LEN];
94 uint16 ether_type;
95} BWL_POST_PACKED_STRUCT;
96
97
98BWL_PRE_PACKED_STRUCT struct ether_addr {
99 uint8 octet[ETHER_ADDR_LEN];
100} BWL_POST_PACKED_STRUCT;
101#endif
102
103
104#define ETHER_SET_LOCALADDR(ea) (((uint8 *)(ea))[0] = (((uint8 *)(ea))[0] | 2))
105#define ETHER_IS_LOCALADDR(ea) (((uint8 *)(ea))[0] & 2)
106#define ETHER_CLR_LOCALADDR(ea) (((uint8 *)(ea))[0] = (((uint8 *)(ea))[0] & 0xd))
107#define ETHER_TOGGLE_LOCALADDR(ea) (((uint8 *)(ea))[0] = (((uint8 *)(ea))[0] ^ 2))
108
109
110#define ETHER_SET_UNICAST(ea) (((uint8 *)(ea))[0] = (((uint8 *)(ea))[0] & ~1))
111
112
113#define ETHER_ISMULTI(ea) (((const uint8 *)(ea))[0] & 1)
114
115
116
117#define ether_cmp(a, b) (!(((short*)a)[0] == ((short*)b)[0]) | \
118 !(((short*)a)[1] == ((short*)b)[1]) | \
119 !(((short*)a)[2] == ((short*)b)[2]))
120
121
122#define ether_copy(s, d) { \
123 ((short*)d)[0] = ((short*)s)[0]; \
124 ((short*)d)[1] = ((short*)s)[1]; \
125 ((short*)d)[2] = ((short*)s)[2]; }
126
127
128static const struct ether_addr ether_bcast = {{255, 255, 255, 255, 255, 255}};
129static const struct ether_addr ether_null = {{0, 0, 0, 0, 0, 0}};
130
131#define ETHER_ISBCAST(ea) ((((uint8 *)(ea))[0] & \
132 ((uint8 *)(ea))[1] & \
133 ((uint8 *)(ea))[2] & \
134 ((uint8 *)(ea))[3] & \
135 ((uint8 *)(ea))[4] & \
136 ((uint8 *)(ea))[5]) == 0xff)
137#define ETHER_ISNULLADDR(ea) ((((uint8 *)(ea))[0] | \
138 ((uint8 *)(ea))[1] | \
139 ((uint8 *)(ea))[2] | \
140 ((uint8 *)(ea))[3] | \
141 ((uint8 *)(ea))[4] | \
142 ((uint8 *)(ea))[5]) == 0)
143
144
145
146#include <packed_section_end.h>
147
148#endif
diff --git a/drivers/net/wireless/bcm4329/include/proto/sdspi.h b/drivers/net/wireless/bcm4329/include/proto/sdspi.h
new file mode 100644
index 00000000000..7739e68a244
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/proto/sdspi.h
@@ -0,0 +1,71 @@
1/*
2 * SD-SPI Protocol Standard
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: sdspi.h,v 9.1.20.1 2008/05/06 22:59:19 Exp $
25 */
26
27#define SPI_START_M BITFIELD_MASK(1) /* Bit [31] - Start Bit */
28#define SPI_START_S 31
29#define SPI_DIR_M BITFIELD_MASK(1) /* Bit [30] - Direction */
30#define SPI_DIR_S 30
31#define SPI_CMD_INDEX_M BITFIELD_MASK(6) /* Bits [29:24] - Command number */
32#define SPI_CMD_INDEX_S 24
33#define SPI_RW_M BITFIELD_MASK(1) /* Bit [23] - Read=0, Write=1 */
34#define SPI_RW_S 23
35#define SPI_FUNC_M BITFIELD_MASK(3) /* Bits [22:20] - Function Number */
36#define SPI_FUNC_S 20
37#define SPI_RAW_M BITFIELD_MASK(1) /* Bit [19] - Read After Wr */
38#define SPI_RAW_S 19
39#define SPI_STUFF_M BITFIELD_MASK(1) /* Bit [18] - Stuff bit */
40#define SPI_STUFF_S 18
41#define SPI_BLKMODE_M BITFIELD_MASK(1) /* Bit [19] - Blockmode 1=blk */
42#define SPI_BLKMODE_S 19
43#define SPI_OPCODE_M BITFIELD_MASK(1) /* Bit [18] - OP Code */
44#define SPI_OPCODE_S 18
45#define SPI_ADDR_M BITFIELD_MASK(17) /* Bits [17:1] - Address */
46#define SPI_ADDR_S 1
47#define SPI_STUFF0_M BITFIELD_MASK(1) /* Bit [0] - Stuff bit */
48#define SPI_STUFF0_S 0
49
50#define SPI_RSP_START_M BITFIELD_MASK(1) /* Bit [7] - Start Bit (always 0) */
51#define SPI_RSP_START_S 7
52#define SPI_RSP_PARAM_ERR_M BITFIELD_MASK(1) /* Bit [6] - Parameter Error */
53#define SPI_RSP_PARAM_ERR_S 6
54#define SPI_RSP_RFU5_M BITFIELD_MASK(1) /* Bit [5] - RFU (Always 0) */
55#define SPI_RSP_RFU5_S 5
56#define SPI_RSP_FUNC_ERR_M BITFIELD_MASK(1) /* Bit [4] - Function number error */
57#define SPI_RSP_FUNC_ERR_S 4
58#define SPI_RSP_CRC_ERR_M BITFIELD_MASK(1) /* Bit [3] - COM CRC Error */
59#define SPI_RSP_CRC_ERR_S 3
60#define SPI_RSP_ILL_CMD_M BITFIELD_MASK(1) /* Bit [2] - Illegal Command error */
61#define SPI_RSP_ILL_CMD_S 2
62#define SPI_RSP_RFU1_M BITFIELD_MASK(1) /* Bit [1] - RFU (Always 0) */
63#define SPI_RSP_RFU1_S 1
64#define SPI_RSP_IDLE_M BITFIELD_MASK(1) /* Bit [0] - In idle state */
65#define SPI_RSP_IDLE_S 0
66
67/* SD-SPI Protocol Definitions */
68#define SDSPI_COMMAND_LEN 6 /* Number of bytes in an SD command */
69#define SDSPI_START_BLOCK 0xFE /* SD Start Block Token */
70#define SDSPI_IDLE_PAD 0xFF /* SD-SPI idle value for MOSI */
71#define SDSPI_START_BIT_MASK 0x80
diff --git a/drivers/net/wireless/bcm4329/include/proto/vlan.h b/drivers/net/wireless/bcm4329/include/proto/vlan.h
new file mode 100644
index 00000000000..670bc44c6bd
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/proto/vlan.h
@@ -0,0 +1,63 @@
1/*
2 * 802.1Q VLAN protocol definitions
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: vlan.h,v 9.4.196.2 2008/12/07 21:19:20 Exp $
25 */
26
27
28#ifndef _vlan_h_
29#define _vlan_h_
30
31#ifndef _TYPEDEFS_H_
32#include <typedefs.h>
33#endif
34
35
36#include <packed_section_start.h>
37
38#define VLAN_VID_MASK 0xfff
39#define VLAN_CFI_SHIFT 12
40#define VLAN_PRI_SHIFT 13
41
42#define VLAN_PRI_MASK 7
43
44#define VLAN_TAG_LEN 4
45#define VLAN_TAG_OFFSET (2 * ETHER_ADDR_LEN)
46
47#define VLAN_TPID 0x8100
48
49struct ethervlan_header {
50 uint8 ether_dhost[ETHER_ADDR_LEN];
51 uint8 ether_shost[ETHER_ADDR_LEN];
52 uint16 vlan_type;
53 uint16 vlan_tag;
54 uint16 ether_type;
55};
56
57#define ETHERVLAN_HDR_LEN (ETHER_HDR_LEN + VLAN_TAG_LEN)
58
59
60
61#include <packed_section_end.h>
62
63#endif
diff --git a/drivers/net/wireless/bcm4329/include/proto/wpa.h b/drivers/net/wireless/bcm4329/include/proto/wpa.h
new file mode 100644
index 00000000000..f5d0cd53977
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/proto/wpa.h
@@ -0,0 +1,159 @@
1/*
2 * Fundamental types and constants relating to WPA
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: wpa.h,v 1.16.166.1.20.1 2008/11/20 00:51:31 Exp $
25 */
26
27
28#ifndef _proto_wpa_h_
29#define _proto_wpa_h_
30
31#include <typedefs.h>
32#include <proto/ethernet.h>
33
34
35
36#include <packed_section_start.h>
37
38
39
40
41#define DOT11_RC_INVALID_WPA_IE 13
42#define DOT11_RC_MIC_FAILURE 14
43#define DOT11_RC_4WH_TIMEOUT 15
44#define DOT11_RC_GTK_UPDATE_TIMEOUT 16
45#define DOT11_RC_WPA_IE_MISMATCH 17
46#define DOT11_RC_INVALID_MC_CIPHER 18
47#define DOT11_RC_INVALID_UC_CIPHER 19
48#define DOT11_RC_INVALID_AKMP 20
49#define DOT11_RC_BAD_WPA_VERSION 21
50#define DOT11_RC_INVALID_WPA_CAP 22
51#define DOT11_RC_8021X_AUTH_FAIL 23
52
53#define WPA2_PMKID_LEN 16
54
55
56typedef BWL_PRE_PACKED_STRUCT struct
57{
58 uint8 tag;
59 uint8 length;
60 uint8 oui[3];
61 uint8 oui_type;
62 BWL_PRE_PACKED_STRUCT struct {
63 uint8 low;
64 uint8 high;
65 } BWL_POST_PACKED_STRUCT version;
66} BWL_POST_PACKED_STRUCT wpa_ie_fixed_t;
67#define WPA_IE_OUITYPE_LEN 4
68#define WPA_IE_FIXED_LEN 8
69#define WPA_IE_TAG_FIXED_LEN 6
70
71typedef BWL_PRE_PACKED_STRUCT struct {
72 uint8 tag;
73 uint8 length;
74 BWL_PRE_PACKED_STRUCT struct {
75 uint8 low;
76 uint8 high;
77 } BWL_POST_PACKED_STRUCT version;
78} BWL_POST_PACKED_STRUCT wpa_rsn_ie_fixed_t;
79#define WPA_RSN_IE_FIXED_LEN 4
80#define WPA_RSN_IE_TAG_FIXED_LEN 2
81typedef uint8 wpa_pmkid_t[WPA2_PMKID_LEN];
82
83
84typedef BWL_PRE_PACKED_STRUCT struct
85{
86 uint8 oui[3];
87 uint8 type;
88} BWL_POST_PACKED_STRUCT wpa_suite_t, wpa_suite_mcast_t;
89#define WPA_SUITE_LEN 4
90
91
92typedef BWL_PRE_PACKED_STRUCT struct
93{
94 BWL_PRE_PACKED_STRUCT struct {
95 uint8 low;
96 uint8 high;
97 } BWL_POST_PACKED_STRUCT count;
98 wpa_suite_t list[1];
99} BWL_POST_PACKED_STRUCT wpa_suite_ucast_t, wpa_suite_auth_key_mgmt_t;
100#define WPA_IE_SUITE_COUNT_LEN 2
101typedef BWL_PRE_PACKED_STRUCT struct
102{
103 BWL_PRE_PACKED_STRUCT struct {
104 uint8 low;
105 uint8 high;
106 } BWL_POST_PACKED_STRUCT count;
107 wpa_pmkid_t list[1];
108} BWL_POST_PACKED_STRUCT wpa_pmkid_list_t;
109
110
111#define WPA_CIPHER_NONE 0
112#define WPA_CIPHER_WEP_40 1
113#define WPA_CIPHER_TKIP 2
114#define WPA_CIPHER_AES_OCB 3
115#define WPA_CIPHER_AES_CCM 4
116#define WPA_CIPHER_WEP_104 5
117
118#define IS_WPA_CIPHER(cipher) ((cipher) == WPA_CIPHER_NONE || \
119 (cipher) == WPA_CIPHER_WEP_40 || \
120 (cipher) == WPA_CIPHER_WEP_104 || \
121 (cipher) == WPA_CIPHER_TKIP || \
122 (cipher) == WPA_CIPHER_AES_OCB || \
123 (cipher) == WPA_CIPHER_AES_CCM)
124
125
126#define WPA_TKIP_CM_DETECT 60
127#define WPA_TKIP_CM_BLOCK 60
128
129
130#define RSN_CAP_LEN 2
131
132
133#define RSN_CAP_PREAUTH 0x0001
134#define RSN_CAP_NOPAIRWISE 0x0002
135#define RSN_CAP_PTK_REPLAY_CNTR_MASK 0x000C
136#define RSN_CAP_PTK_REPLAY_CNTR_SHIFT 2
137#define RSN_CAP_GTK_REPLAY_CNTR_MASK 0x0030
138#define RSN_CAP_GTK_REPLAY_CNTR_SHIFT 4
139#define RSN_CAP_1_REPLAY_CNTR 0
140#define RSN_CAP_2_REPLAY_CNTRS 1
141#define RSN_CAP_4_REPLAY_CNTRS 2
142#define RSN_CAP_16_REPLAY_CNTRS 3
143
144
145#define WPA_CAP_4_REPLAY_CNTRS RSN_CAP_4_REPLAY_CNTRS
146#define WPA_CAP_16_REPLAY_CNTRS RSN_CAP_16_REPLAY_CNTRS
147#define WPA_CAP_REPLAY_CNTR_SHIFT RSN_CAP_PTK_REPLAY_CNTR_SHIFT
148#define WPA_CAP_REPLAY_CNTR_MASK RSN_CAP_PTK_REPLAY_CNTR_MASK
149
150
151#define WPA_CAP_LEN RSN_CAP_LEN
152
153#define WPA_CAP_WPA2_PREAUTH RSN_CAP_PREAUTH
154
155
156
157#include <packed_section_end.h>
158
159#endif
diff --git a/drivers/net/wireless/bcm4329/include/sbchipc.h b/drivers/net/wireless/bcm4329/include/sbchipc.h
new file mode 100644
index 00000000000..39e5c8d6aed
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/sbchipc.h
@@ -0,0 +1,1026 @@
1/*
2 * SiliconBackplane Chipcommon core hardware definitions.
3 *
4 * The chipcommon core provides chip identification, SB control,
5 * jtag, 0/1/2 uarts, clock frequency control, a watchdog interrupt timer,
6 * gpio interface, extbus, and support for serial and parallel flashes.
7 *
8 * $Id: sbchipc.h,v 13.103.2.5.4.5.2.9 2009/07/03 14:23:21 Exp $
9 *
10 * Copyright (C) 1999-2010, Broadcom Corporation
11 *
12 * Unless you and Broadcom execute a separate written software license
13 * agreement governing use of this software, this software is licensed to you
14 * under the terms of the GNU General Public License version 2 (the "GPL"),
15 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
16 * following added to such license:
17 *
18 * As a special exception, the copyright holders of this software give you
19 * permission to link this software with independent modules, and to copy and
20 * distribute the resulting executable under terms of your choice, provided that
21 * you also meet, for each linked independent module, the terms and conditions of
22 * the license of that module. An independent module is a module which is not
23 * derived from this software. The special exception does not apply to any
24 * modifications of the software.
25 *
26 * Notwithstanding the above, under no circumstances may you combine this
27 * software in any way with any other Broadcom software provided under a license
28 * other than the GPL, without Broadcom's express prior written consent.
29 */
30
31
32#ifndef _SBCHIPC_H
33#define _SBCHIPC_H
34
35#ifndef _LANGUAGE_ASSEMBLY
36
37
38#ifndef PAD
39#define _PADLINE(line) pad ## line
40#define _XSTR(line) _PADLINE(line)
41#define PAD _XSTR(__LINE__)
42#endif
43
44typedef volatile struct {
45 uint32 chipid;
46 uint32 capabilities;
47 uint32 corecontrol;
48 uint32 bist;
49
50
51 uint32 otpstatus;
52 uint32 otpcontrol;
53 uint32 otpprog;
54 uint32 PAD;
55
56
57 uint32 intstatus;
58 uint32 intmask;
59 uint32 chipcontrol;
60 uint32 chipstatus;
61
62
63 uint32 jtagcmd;
64 uint32 jtagir;
65 uint32 jtagdr;
66 uint32 jtagctrl;
67
68
69 uint32 flashcontrol;
70 uint32 flashaddress;
71 uint32 flashdata;
72 uint32 PAD[1];
73
74
75 uint32 broadcastaddress;
76 uint32 broadcastdata;
77
78
79 uint32 gpiopullup;
80 uint32 gpiopulldown;
81 uint32 gpioin;
82 uint32 gpioout;
83 uint32 gpioouten;
84 uint32 gpiocontrol;
85 uint32 gpiointpolarity;
86 uint32 gpiointmask;
87
88
89 uint32 gpioevent;
90 uint32 gpioeventintmask;
91
92
93 uint32 watchdog;
94
95
96 uint32 gpioeventintpolarity;
97
98
99 uint32 gpiotimerval;
100 uint32 gpiotimeroutmask;
101
102
103 uint32 clockcontrol_n;
104 uint32 clockcontrol_sb;
105 uint32 clockcontrol_pci;
106 uint32 clockcontrol_m2;
107 uint32 clockcontrol_m3;
108 uint32 clkdiv;
109 uint32 PAD[2];
110
111
112 uint32 pll_on_delay;
113 uint32 fref_sel_delay;
114 uint32 slow_clk_ctl;
115 uint32 PAD[1];
116
117
118 uint32 system_clk_ctl;
119 uint32 clkstatestretch;
120 uint32 PAD[13];
121
122
123 uint32 eromptr;
124
125
126 uint32 pcmcia_config;
127 uint32 pcmcia_memwait;
128 uint32 pcmcia_attrwait;
129 uint32 pcmcia_iowait;
130 uint32 ide_config;
131 uint32 ide_memwait;
132 uint32 ide_attrwait;
133 uint32 ide_iowait;
134 uint32 prog_config;
135 uint32 prog_waitcount;
136 uint32 flash_config;
137 uint32 flash_waitcount;
138 uint32 PAD[4];
139 uint32 PAD[40];
140
141
142
143 uint32 clk_ctl_st;
144 uint32 hw_war;
145 uint32 PAD[70];
146
147
148 uint8 uart0data;
149 uint8 uart0imr;
150 uint8 uart0fcr;
151 uint8 uart0lcr;
152 uint8 uart0mcr;
153 uint8 uart0lsr;
154 uint8 uart0msr;
155 uint8 uart0scratch;
156 uint8 PAD[248];
157
158 uint8 uart1data;
159 uint8 uart1imr;
160 uint8 uart1fcr;
161 uint8 uart1lcr;
162 uint8 uart1mcr;
163 uint8 uart1lsr;
164 uint8 uart1msr;
165 uint8 uart1scratch;
166 uint32 PAD[126];
167
168
169 uint32 pmucontrol;
170 uint32 pmucapabilities;
171 uint32 pmustatus;
172 uint32 res_state;
173 uint32 res_pending;
174 uint32 pmutimer;
175 uint32 min_res_mask;
176 uint32 max_res_mask;
177 uint32 res_table_sel;
178 uint32 res_dep_mask;
179 uint32 res_updn_timer;
180 uint32 res_timer;
181 uint32 clkstretch;
182 uint32 pmuwatchdog;
183 uint32 gpiosel;
184 uint32 gpioenable;
185 uint32 res_req_timer_sel;
186 uint32 res_req_timer;
187 uint32 res_req_mask;
188 uint32 PAD;
189 uint32 chipcontrol_addr;
190 uint32 chipcontrol_data;
191 uint32 regcontrol_addr;
192 uint32 regcontrol_data;
193 uint32 pllcontrol_addr;
194 uint32 pllcontrol_data;
195 uint32 PAD[102];
196 uint16 otp[768];
197} chipcregs_t;
198
199#endif
200
201#define CC_CHIPID 0
202#define CC_CAPABILITIES 4
203#define CC_OTPST 0x10
204#define CC_CHIPST 0x2c
205#define CC_JTAGCMD 0x30
206#define CC_JTAGIR 0x34
207#define CC_JTAGDR 0x38
208#define CC_JTAGCTRL 0x3c
209#define CC_WATCHDOG 0x80
210#define CC_CLKC_N 0x90
211#define CC_CLKC_M0 0x94
212#define CC_CLKC_M1 0x98
213#define CC_CLKC_M2 0x9c
214#define CC_CLKC_M3 0xa0
215#define CC_CLKDIV 0xa4
216#define CC_SYS_CLK_CTL 0xc0
217#define CC_CLK_CTL_ST SI_CLK_CTL_ST
218#define CC_EROMPTR 0xfc
219#define PMU_CTL 0x600
220#define PMU_CAP 0x604
221#define PMU_ST 0x608
222#define PMU_RES_STATE 0x60c
223#define PMU_TIMER 0x614
224#define PMU_MIN_RES_MASK 0x618
225#define PMU_MAX_RES_MASK 0x61c
226#define PMU_REG_CONTROL_ADDR 0x658
227#define PMU_REG_CONTROL_DATA 0x65C
228#define PMU_PLL_CONTROL_ADDR 0x660
229#define PMU_PLL_CONTROL_DATA 0x664
230#define CC_OTP 0x800
231
232
233#define CID_ID_MASK 0x0000ffff
234#define CID_REV_MASK 0x000f0000
235#define CID_REV_SHIFT 16
236#define CID_PKG_MASK 0x00f00000
237#define CID_PKG_SHIFT 20
238#define CID_CC_MASK 0x0f000000
239#define CID_CC_SHIFT 24
240#define CID_TYPE_MASK 0xf0000000
241#define CID_TYPE_SHIFT 28
242
243
244#define CC_CAP_UARTS_MASK 0x00000003
245#define CC_CAP_MIPSEB 0x00000004
246#define CC_CAP_UCLKSEL 0x00000018
247#define CC_CAP_UINTCLK 0x00000008
248#define CC_CAP_UARTGPIO 0x00000020
249#define CC_CAP_EXTBUS_MASK 0x000000c0
250#define CC_CAP_EXTBUS_NONE 0x00000000
251#define CC_CAP_EXTBUS_FULL 0x00000040
252#define CC_CAP_EXTBUS_PROG 0x00000080
253#define CC_CAP_FLASH_MASK 0x00000700
254#define CC_CAP_PLL_MASK 0x00038000
255#define CC_CAP_PWR_CTL 0x00040000
256#define CC_CAP_OTPSIZE 0x00380000
257#define CC_CAP_OTPSIZE_SHIFT 19
258#define CC_CAP_OTPSIZE_BASE 5
259#define CC_CAP_JTAGP 0x00400000
260#define CC_CAP_ROM 0x00800000
261#define CC_CAP_BKPLN64 0x08000000
262#define CC_CAP_PMU 0x10000000
263#define CC_CAP_ECI 0x20000000
264
265
266#define PLL_NONE 0x00000000
267#define PLL_TYPE1 0x00010000
268#define PLL_TYPE2 0x00020000
269#define PLL_TYPE3 0x00030000
270#define PLL_TYPE4 0x00008000
271#define PLL_TYPE5 0x00018000
272#define PLL_TYPE6 0x00028000
273#define PLL_TYPE7 0x00038000
274
275
276#define ILP_CLOCK 32000
277
278
279#define ALP_CLOCK 20000000
280
281
282#define HT_CLOCK 80000000
283
284
285#define CC_UARTCLKO 0x00000001
286#define CC_SE 0x00000002
287#define CC_UARTCLKEN 0x00000008
288
289
290#define CHIPCTRL_4321A0_DEFAULT 0x3a4
291#define CHIPCTRL_4321A1_DEFAULT 0x0a4
292#define CHIPCTRL_4321_PLL_DOWN 0x800000
293
294
295#define OTPS_OL_MASK 0x000000ff
296#define OTPS_OL_MFG 0x00000001
297#define OTPS_OL_OR1 0x00000002
298#define OTPS_OL_OR2 0x00000004
299#define OTPS_OL_GU 0x00000008
300#define OTPS_GUP_MASK 0x00000f00
301#define OTPS_GUP_SHIFT 8
302#define OTPS_GUP_HW 0x00000100
303#define OTPS_GUP_SW 0x00000200
304#define OTPS_GUP_CI 0x00000400
305#define OTPS_GUP_FUSE 0x00000800
306#define OTPS_READY 0x00001000
307#define OTPS_RV(x) (1 << (16 + (x)))
308#define OTPS_RV_MASK 0x0fff0000
309
310
311#define OTPC_PROGSEL 0x00000001
312#define OTPC_PCOUNT_MASK 0x0000000e
313#define OTPC_PCOUNT_SHIFT 1
314#define OTPC_VSEL_MASK 0x000000f0
315#define OTPC_VSEL_SHIFT 4
316#define OTPC_TMM_MASK 0x00000700
317#define OTPC_TMM_SHIFT 8
318#define OTPC_ODM 0x00000800
319#define OTPC_PROGEN 0x80000000
320
321
322#define OTPP_COL_MASK 0x000000ff
323#define OTPP_COL_SHIFT 0
324#define OTPP_ROW_MASK 0x0000ff00
325#define OTPP_ROW_SHIFT 8
326#define OTPP_OC_MASK 0x0f000000
327#define OTPP_OC_SHIFT 24
328#define OTPP_READERR 0x10000000
329#define OTPP_VALUE_MASK 0x20000000
330#define OTPP_VALUE_SHIFT 29
331#define OTPP_START_BUSY 0x80000000
332
333
334#define OTPPOC_READ 0
335#define OTPPOC_BIT_PROG 1
336#define OTPPOC_VERIFY 3
337#define OTPPOC_INIT 4
338#define OTPPOC_SET 5
339#define OTPPOC_RESET 6
340#define OTPPOC_OCST 7
341#define OTPPOC_ROW_LOCK 8
342#define OTPPOC_PRESCN_TEST 9
343
344
345#define JCMD_START 0x80000000
346#define JCMD_BUSY 0x80000000
347#define JCMD_STATE_MASK 0x60000000
348#define JCMD_STATE_TLR 0x00000000
349#define JCMD_STATE_PIR 0x20000000
350#define JCMD_STATE_PDR 0x40000000
351#define JCMD_STATE_RTI 0x60000000
352#define JCMD0_ACC_MASK 0x0000f000
353#define JCMD0_ACC_IRDR 0x00000000
354#define JCMD0_ACC_DR 0x00001000
355#define JCMD0_ACC_IR 0x00002000
356#define JCMD0_ACC_RESET 0x00003000
357#define JCMD0_ACC_IRPDR 0x00004000
358#define JCMD0_ACC_PDR 0x00005000
359#define JCMD0_IRW_MASK 0x00000f00
360#define JCMD_ACC_MASK 0x000f0000
361#define JCMD_ACC_IRDR 0x00000000
362#define JCMD_ACC_DR 0x00010000
363#define JCMD_ACC_IR 0x00020000
364#define JCMD_ACC_RESET 0x00030000
365#define JCMD_ACC_IRPDR 0x00040000
366#define JCMD_ACC_PDR 0x00050000
367#define JCMD_ACC_PIR 0x00060000
368#define JCMD_ACC_IRDR_I 0x00070000
369#define JCMD_ACC_DR_I 0x00080000
370#define JCMD_IRW_MASK 0x00001f00
371#define JCMD_IRW_SHIFT 8
372#define JCMD_DRW_MASK 0x0000003f
373
374
375#define JCTRL_FORCE_CLK 4
376#define JCTRL_EXT_EN 2
377#define JCTRL_EN 1
378
379
380#define CLKD_SFLASH 0x0f000000
381#define CLKD_SFLASH_SHIFT 24
382#define CLKD_OTP 0x000f0000
383#define CLKD_OTP_SHIFT 16
384#define CLKD_JTAG 0x00000f00
385#define CLKD_JTAG_SHIFT 8
386#define CLKD_UART 0x000000ff
387
388
389#define CI_GPIO 0x00000001
390#define CI_EI 0x00000002
391#define CI_TEMP 0x00000004
392#define CI_SIRQ 0x00000008
393#define CI_ECI 0x00000010
394#define CI_PMU 0x00000020
395#define CI_UART 0x00000040
396#define CI_WDRESET 0x80000000
397
398
399#define SCC_SS_MASK 0x00000007
400#define SCC_SS_LPO 0x00000000
401#define SCC_SS_XTAL 0x00000001
402#define SCC_SS_PCI 0x00000002
403#define SCC_LF 0x00000200
404#define SCC_LP 0x00000400
405#define SCC_FS 0x00000800
406#define SCC_IP 0x00001000
407#define SCC_XC 0x00002000
408#define SCC_XP 0x00004000
409#define SCC_CD_MASK 0xffff0000
410#define SCC_CD_SHIFT 16
411
412
413#define SYCC_IE 0x00000001
414#define SYCC_AE 0x00000002
415#define SYCC_FP 0x00000004
416#define SYCC_AR 0x00000008
417#define SYCC_HR 0x00000010
418#define SYCC_CD_MASK 0xffff0000
419#define SYCC_CD_SHIFT 16
420
421
422#define CF_EN 0x00000001
423#define CF_EM_MASK 0x0000000e
424#define CF_EM_SHIFT 1
425#define CF_EM_FLASH 0
426#define CF_EM_SYNC 2
427#define CF_EM_PCMCIA 4
428#define CF_DS 0x00000010
429#define CF_BS 0x00000020
430#define CF_CD_MASK 0x000000c0
431#define CF_CD_SHIFT 6
432#define CF_CD_DIV2 0x00000000
433#define CF_CD_DIV3 0x00000040
434#define CF_CD_DIV4 0x00000080
435#define CF_CE 0x00000100
436#define CF_SB 0x00000200
437
438
439#define PM_W0_MASK 0x0000003f
440#define PM_W1_MASK 0x00001f00
441#define PM_W1_SHIFT 8
442#define PM_W2_MASK 0x001f0000
443#define PM_W2_SHIFT 16
444#define PM_W3_MASK 0x1f000000
445#define PM_W3_SHIFT 24
446
447
448#define PA_W0_MASK 0x0000003f
449#define PA_W1_MASK 0x00001f00
450#define PA_W1_SHIFT 8
451#define PA_W2_MASK 0x001f0000
452#define PA_W2_SHIFT 16
453#define PA_W3_MASK 0x1f000000
454#define PA_W3_SHIFT 24
455
456
457#define PI_W0_MASK 0x0000003f
458#define PI_W1_MASK 0x00001f00
459#define PI_W1_SHIFT 8
460#define PI_W2_MASK 0x001f0000
461#define PI_W2_SHIFT 16
462#define PI_W3_MASK 0x1f000000
463#define PI_W3_SHIFT 24
464
465
466#define PW_W0_MASK 0x0000001f
467#define PW_W1_MASK 0x00001f00
468#define PW_W1_SHIFT 8
469#define PW_W2_MASK 0x001f0000
470#define PW_W2_SHIFT 16
471#define PW_W3_MASK 0x1f000000
472#define PW_W3_SHIFT 24
473
474#define PW_W0 0x0000000c
475#define PW_W1 0x00000a00
476#define PW_W2 0x00020000
477#define PW_W3 0x01000000
478
479
480#define FW_W0_MASK 0x0000003f
481#define FW_W1_MASK 0x00001f00
482#define FW_W1_SHIFT 8
483#define FW_W2_MASK 0x001f0000
484#define FW_W2_SHIFT 16
485#define FW_W3_MASK 0x1f000000
486#define FW_W3_SHIFT 24
487
488
489#define WATCHDOG_CLOCK 48000000
490#define WATCHDOG_CLOCK_5354 32000
491
492
493#define PCTL_ILP_DIV_MASK 0xffff0000
494#define PCTL_ILP_DIV_SHIFT 16
495#define PCTL_PLL_PLLCTL_UPD 0x00000400
496#define PCTL_NOILP_ON_WAIT 0x00000200
497#define PCTL_HT_REQ_EN 0x00000100
498#define PCTL_ALP_REQ_EN 0x00000080
499#define PCTL_XTALFREQ_MASK 0x0000007c
500#define PCTL_XTALFREQ_SHIFT 2
501#define PCTL_ILP_DIV_EN 0x00000002
502#define PCTL_LPO_SEL 0x00000001
503
504
505#define CSTRETCH_HT 0xffff0000
506#define CSTRETCH_ALP 0x0000ffff
507
508
509#define GPIO_ONTIME_SHIFT 16
510
511
512#define CN_N1_MASK 0x3f
513#define CN_N2_MASK 0x3f00
514#define CN_N2_SHIFT 8
515#define CN_PLLC_MASK 0xf0000
516#define CN_PLLC_SHIFT 16
517
518
519#define CC_M1_MASK 0x3f
520#define CC_M2_MASK 0x3f00
521#define CC_M2_SHIFT 8
522#define CC_M3_MASK 0x3f0000
523#define CC_M3_SHIFT 16
524#define CC_MC_MASK 0x1f000000
525#define CC_MC_SHIFT 24
526
527
528#define CC_F6_2 0x02
529#define CC_F6_3 0x03
530#define CC_F6_4 0x05
531#define CC_F6_5 0x09
532#define CC_F6_6 0x11
533#define CC_F6_7 0x21
534
535#define CC_F5_BIAS 5
536
537#define CC_MC_BYPASS 0x08
538#define CC_MC_M1 0x04
539#define CC_MC_M1M2 0x02
540#define CC_MC_M1M2M3 0x01
541#define CC_MC_M1M3 0x11
542
543
544#define CC_T2_BIAS 2
545#define CC_T2M2_BIAS 3
546
547#define CC_T2MC_M1BYP 1
548#define CC_T2MC_M2BYP 2
549#define CC_T2MC_M3BYP 4
550
551
552#define CC_T6_MMASK 1
553#define CC_T6_M0 120000000
554#define CC_T6_M1 100000000
555#define SB2MIPS_T6(sb) (2 * (sb))
556
557
558#define CC_CLOCK_BASE1 24000000
559#define CC_CLOCK_BASE2 12500000
560
561
562#define CLKC_5350_N 0x0311
563#define CLKC_5350_M 0x04020009
564
565
566#define FLASH_NONE 0x000
567#define SFLASH_ST 0x100
568#define SFLASH_AT 0x200
569#define PFLASH 0x700
570
571
572#define CC_CFG_EN 0x0001
573#define CC_CFG_EM_MASK 0x000e
574#define CC_CFG_EM_ASYNC 0x0000
575#define CC_CFG_EM_SYNC 0x0002
576#define CC_CFG_EM_PCMCIA 0x0004
577#define CC_CFG_EM_IDE 0x0006
578#define CC_CFG_DS 0x0010
579#define CC_CFG_CD_MASK 0x00e0
580#define CC_CFG_CE 0x0100
581#define CC_CFG_SB 0x0200
582#define CC_CFG_IS 0x0400
583
584
585#define CC_EB_BASE 0x1a000000
586#define CC_EB_PCMCIA_MEM 0x1a000000
587#define CC_EB_PCMCIA_IO 0x1a200000
588#define CC_EB_PCMCIA_CFG 0x1a400000
589#define CC_EB_IDE 0x1a800000
590#define CC_EB_PCMCIA1_MEM 0x1a800000
591#define CC_EB_PCMCIA1_IO 0x1aa00000
592#define CC_EB_PCMCIA1_CFG 0x1ac00000
593#define CC_EB_PROGIF 0x1b000000
594
595
596
597#define SFLASH_OPCODE 0x000000ff
598#define SFLASH_ACTION 0x00000700
599#define SFLASH_CS_ACTIVE 0x00001000
600#define SFLASH_START 0x80000000
601#define SFLASH_BUSY SFLASH_START
602
603
604#define SFLASH_ACT_OPONLY 0x0000
605#define SFLASH_ACT_OP1D 0x0100
606#define SFLASH_ACT_OP3A 0x0200
607#define SFLASH_ACT_OP3A1D 0x0300
608#define SFLASH_ACT_OP3A4D 0x0400
609#define SFLASH_ACT_OP3A4X4D 0x0500
610#define SFLASH_ACT_OP3A1X4D 0x0700
611
612
613#define SFLASH_ST_WREN 0x0006
614#define SFLASH_ST_WRDIS 0x0004
615#define SFLASH_ST_RDSR 0x0105
616#define SFLASH_ST_WRSR 0x0101
617#define SFLASH_ST_READ 0x0303
618#define SFLASH_ST_PP 0x0302
619#define SFLASH_ST_SE 0x02d8
620#define SFLASH_ST_BE 0x00c7
621#define SFLASH_ST_DP 0x00b9
622#define SFLASH_ST_RES 0x03ab
623#define SFLASH_ST_CSA 0x1000
624
625
626#define SFLASH_ST_WIP 0x01
627#define SFLASH_ST_WEL 0x02
628#define SFLASH_ST_BP_MASK 0x1c
629#define SFLASH_ST_BP_SHIFT 2
630#define SFLASH_ST_SRWD 0x80
631
632
633#define SFLASH_AT_READ 0x07e8
634#define SFLASH_AT_PAGE_READ 0x07d2
635#define SFLASH_AT_BUF1_READ
636#define SFLASH_AT_BUF2_READ
637#define SFLASH_AT_STATUS 0x01d7
638#define SFLASH_AT_BUF1_WRITE 0x0384
639#define SFLASH_AT_BUF2_WRITE 0x0387
640#define SFLASH_AT_BUF1_ERASE_PROGRAM 0x0283
641#define SFLASH_AT_BUF2_ERASE_PROGRAM 0x0286
642#define SFLASH_AT_BUF1_PROGRAM 0x0288
643#define SFLASH_AT_BUF2_PROGRAM 0x0289
644#define SFLASH_AT_PAGE_ERASE 0x0281
645#define SFLASH_AT_BLOCK_ERASE 0x0250
646#define SFLASH_AT_BUF1_WRITE_ERASE_PROGRAM 0x0382
647#define SFLASH_AT_BUF2_WRITE_ERASE_PROGRAM 0x0385
648#define SFLASH_AT_BUF1_LOAD 0x0253
649#define SFLASH_AT_BUF2_LOAD 0x0255
650#define SFLASH_AT_BUF1_COMPARE 0x0260
651#define SFLASH_AT_BUF2_COMPARE 0x0261
652#define SFLASH_AT_BUF1_REPROGRAM 0x0258
653#define SFLASH_AT_BUF2_REPROGRAM 0x0259
654
655
656#define SFLASH_AT_READY 0x80
657#define SFLASH_AT_MISMATCH 0x40
658#define SFLASH_AT_ID_MASK 0x38
659#define SFLASH_AT_ID_SHIFT 3
660
661
662
663#define UART_RX 0
664#define UART_TX 0
665#define UART_DLL 0
666#define UART_IER 1
667#define UART_DLM 1
668#define UART_IIR 2
669#define UART_FCR 2
670#define UART_LCR 3
671#define UART_MCR 4
672#define UART_LSR 5
673#define UART_MSR 6
674#define UART_SCR 7
675#define UART_LCR_DLAB 0x80
676#define UART_LCR_WLEN8 0x03
677#define UART_MCR_OUT2 0x08
678#define UART_MCR_LOOP 0x10
679#define UART_LSR_RX_FIFO 0x80
680#define UART_LSR_TDHR 0x40
681#define UART_LSR_THRE 0x20
682#define UART_LSR_BREAK 0x10
683#define UART_LSR_FRAMING 0x08
684#define UART_LSR_PARITY 0x04
685#define UART_LSR_OVERRUN 0x02
686#define UART_LSR_RXRDY 0x01
687#define UART_FCR_FIFO_ENABLE 1
688
689
690#define UART_IIR_FIFO_MASK 0xc0
691#define UART_IIR_INT_MASK 0xf
692#define UART_IIR_MDM_CHG 0x0
693#define UART_IIR_NOINT 0x1
694#define UART_IIR_THRE 0x2
695#define UART_IIR_RCVD_DATA 0x4
696#define UART_IIR_RCVR_STATUS 0x6
697#define UART_IIR_CHAR_TIME 0xc
698
699
700#define UART_IER_EDSSI 8
701#define UART_IER_ELSI 4
702#define UART_IER_ETBEI 2
703#define UART_IER_ERBFI 1
704
705
706#define PST_INTPEND 0x0040
707#define PST_SBCLKST 0x0030
708#define PST_SBCLKST_ILP 0x0010
709#define PST_SBCLKST_ALP 0x0020
710#define PST_SBCLKST_HT 0x0030
711#define PST_ALPAVAIL 0x0008
712#define PST_HTAVAIL 0x0004
713#define PST_RESINIT 0x0003
714
715
716#define PCAP_REV_MASK 0x000000ff
717#define PCAP_RC_MASK 0x00001f00
718#define PCAP_RC_SHIFT 8
719#define PCAP_TC_MASK 0x0001e000
720#define PCAP_TC_SHIFT 13
721#define PCAP_PC_MASK 0x001e0000
722#define PCAP_PC_SHIFT 17
723#define PCAP_VC_MASK 0x01e00000
724#define PCAP_VC_SHIFT 21
725#define PCAP_CC_MASK 0x1e000000
726#define PCAP_CC_SHIFT 25
727#define PCAP5_PC_MASK 0x003e0000
728#define PCAP5_PC_SHIFT 17
729#define PCAP5_VC_MASK 0x07c00000
730#define PCAP5_VC_SHIFT 22
731#define PCAP5_CC_MASK 0xf8000000
732#define PCAP5_CC_SHIFT 27
733
734
735
736#define PRRT_TIME_MASK 0x03ff
737#define PRRT_INTEN 0x0400
738#define PRRT_REQ_ACTIVE 0x0800
739#define PRRT_ALP_REQ 0x1000
740#define PRRT_HT_REQ 0x2000
741
742
743#define PMURES_BIT(bit) (1 << (bit))
744
745
746#define PMURES_MAX_RESNUM 30
747
748
749
750
751#define PMU0_PLL0_PLLCTL0 0
752#define PMU0_PLL0_PC0_PDIV_MASK 1
753#define PMU0_PLL0_PC0_PDIV_FREQ 25000
754#define PMU0_PLL0_PC0_DIV_ARM_MASK 0x00000038
755#define PMU0_PLL0_PC0_DIV_ARM_SHIFT 3
756#define PMU0_PLL0_PC0_DIV_ARM_BASE 8
757
758
759#define PMU0_PLL0_PC0_DIV_ARM_110MHZ 0
760#define PMU0_PLL0_PC0_DIV_ARM_97_7MHZ 1
761#define PMU0_PLL0_PC0_DIV_ARM_88MHZ 2
762#define PMU0_PLL0_PC0_DIV_ARM_80MHZ 3
763#define PMU0_PLL0_PC0_DIV_ARM_73_3MHZ 4
764#define PMU0_PLL0_PC0_DIV_ARM_67_7MHZ 5
765#define PMU0_PLL0_PC0_DIV_ARM_62_9MHZ 6
766#define PMU0_PLL0_PC0_DIV_ARM_58_6MHZ 7
767
768
769#define PMU0_PLL0_PLLCTL1 1
770#define PMU0_PLL0_PC1_WILD_INT_MASK 0xf0000000
771#define PMU0_PLL0_PC1_WILD_INT_SHIFT 28
772#define PMU0_PLL0_PC1_WILD_FRAC_MASK 0x0fffff00
773#define PMU0_PLL0_PC1_WILD_FRAC_SHIFT 8
774#define PMU0_PLL0_PC1_STOP_MOD 0x00000040
775
776
777#define PMU0_PLL0_PLLCTL2 2
778#define PMU0_PLL0_PC2_WILD_INT_MASK 0xf
779#define PMU0_PLL0_PC2_WILD_INT_SHIFT 4
780
781
782#define RES4328_EXT_SWITCHER_PWM 0
783#define RES4328_BB_SWITCHER_PWM 1
784#define RES4328_BB_SWITCHER_BURST 2
785#define RES4328_BB_EXT_SWITCHER_BURST 3
786#define RES4328_ILP_REQUEST 4
787#define RES4328_RADIO_SWITCHER_PWM 5
788#define RES4328_RADIO_SWITCHER_BURST 6
789#define RES4328_ROM_SWITCH 7
790#define RES4328_PA_REF_LDO 8
791#define RES4328_RADIO_LDO 9
792#define RES4328_AFE_LDO 10
793#define RES4328_PLL_LDO 11
794#define RES4328_BG_FILTBYP 12
795#define RES4328_TX_FILTBYP 13
796#define RES4328_RX_FILTBYP 14
797#define RES4328_XTAL_PU 15
798#define RES4328_XTAL_EN 16
799#define RES4328_BB_PLL_FILTBYP 17
800#define RES4328_RF_PLL_FILTBYP 18
801#define RES4328_BB_PLL_PU 19
802
803#define RES5354_EXT_SWITCHER_PWM 0
804#define RES5354_BB_SWITCHER_PWM 1
805#define RES5354_BB_SWITCHER_BURST 2
806#define RES5354_BB_EXT_SWITCHER_BURST 3
807#define RES5354_ILP_REQUEST 4
808#define RES5354_RADIO_SWITCHER_PWM 5
809#define RES5354_RADIO_SWITCHER_BURST 6
810#define RES5354_ROM_SWITCH 7
811#define RES5354_PA_REF_LDO 8
812#define RES5354_RADIO_LDO 9
813#define RES5354_AFE_LDO 10
814#define RES5354_PLL_LDO 11
815#define RES5354_BG_FILTBYP 12
816#define RES5354_TX_FILTBYP 13
817#define RES5354_RX_FILTBYP 14
818#define RES5354_XTAL_PU 15
819#define RES5354_XTAL_EN 16
820#define RES5354_BB_PLL_FILTBYP 17
821#define RES5354_RF_PLL_FILTBYP 18
822#define RES5354_BB_PLL_PU 19
823
824
825
826#define DOT11MAC_880MHZ_CLK_DIVISOR_SHIFT 8
827#define DOT11MAC_880MHZ_CLK_DIVISOR_MASK (0xFF << DOT11MAC_880MHZ_CLK_DIVISOR_SHIFT)
828#define DOT11MAC_880MHZ_CLK_DIVISOR_VAL (0xE << DOT11MAC_880MHZ_CLK_DIVISOR_SHIFT)
829
830
831#define PMU2_PHY_PLL_PLLCTL 4
832#define PMU2_SI_PLL_PLLCTL 10
833
834
835#define RES4325_BUCK_BOOST_BURST 0
836#define RES4325_CBUCK_BURST 1
837#define RES4325_CBUCK_PWM 2
838#define RES4325_CLDO_CBUCK_BURST 3
839#define RES4325_CLDO_CBUCK_PWM 4
840#define RES4325_BUCK_BOOST_PWM 5
841#define RES4325_ILP_REQUEST 6
842#define RES4325_ABUCK_BURST 7
843#define RES4325_ABUCK_PWM 8
844#define RES4325_LNLDO1_PU 9
845#define RES4325_OTP_PU 10
846#define RES4325_LNLDO3_PU 11
847#define RES4325_LNLDO4_PU 12
848#define RES4325_XTAL_PU 13
849#define RES4325_ALP_AVAIL 14
850#define RES4325_RX_PWRSW_PU 15
851#define RES4325_TX_PWRSW_PU 16
852#define RES4325_RFPLL_PWRSW_PU 17
853#define RES4325_LOGEN_PWRSW_PU 18
854#define RES4325_AFE_PWRSW_PU 19
855#define RES4325_BBPLL_PWRSW_PU 20
856#define RES4325_HT_AVAIL 21
857
858
859#define RES4325B0_CBUCK_LPOM 1
860#define RES4325B0_CBUCK_BURST 2
861#define RES4325B0_CBUCK_PWM 3
862#define RES4325B0_CLDO_PU 4
863
864
865#define RES4325C1_OTP_PWRSW_PU 10
866#define RES4325C1_LNLDO2_PU 12
867
868
869#define CST4325_SPROM_OTP_SEL_MASK 0x00000003
870#define CST4325_DEFCIS_SEL 0
871#define CST4325_SPROM_SEL 1
872#define CST4325_OTP_SEL 2
873#define CST4325_OTP_PWRDN 3
874#define CST4325_SDIO_USB_MODE_MASK 0x00000004
875#define CST4325_SDIO_USB_MODE_SHIFT 2
876#define CST4325_RCAL_VALID_MASK 0x00000008
877#define CST4325_RCAL_VALID_SHIFT 3
878#define CST4325_RCAL_VALUE_MASK 0x000001f0
879#define CST4325_RCAL_VALUE_SHIFT 4
880#define CST4325_PMUTOP_2B_MASK 0x00000200
881#define CST4325_PMUTOP_2B_SHIFT 9
882
883#define RES4329_RESERVED0 0
884#define RES4329_CBUCK_LPOM 1
885#define RES4329_CBUCK_BURST 2
886#define RES4329_CBUCK_PWM 3
887#define RES4329_CLDO_PU 4
888#define RES4329_PALDO_PU 5
889#define RES4329_ILP_REQUEST 6
890#define RES4329_RESERVED7 7
891#define RES4329_RESERVED8 8
892#define RES4329_LNLDO1_PU 9
893#define RES4329_OTP_PU 10
894#define RES4329_RESERVED11 11
895#define RES4329_LNLDO2_PU 12
896#define RES4329_XTAL_PU 13
897#define RES4329_ALP_AVAIL 14
898#define RES4329_RX_PWRSW_PU 15
899#define RES4329_TX_PWRSW_PU 16
900#define RES4329_RFPLL_PWRSW_PU 17
901#define RES4329_LOGEN_PWRSW_PU 18
902#define RES4329_AFE_PWRSW_PU 19
903#define RES4329_BBPLL_PWRSW_PU 20
904#define RES4329_HT_AVAIL 21
905
906#define CST4329_SPROM_OTP_SEL_MASK 0x00000003
907#define CST4329_DEFCIS_SEL 0
908#define CST4329_SPROM_SEL 1
909#define CST4329_OTP_SEL 2
910#define CST4329_OTP_PWRDN 3
911#define CST4329_SPI_SDIO_MODE_MASK 0x00000004
912#define CST4329_SPI_SDIO_MODE_SHIFT 2
913
914
915#define RES4312_SWITCHER_BURST 0
916#define RES4312_SWITCHER_PWM 1
917#define RES4312_PA_REF_LDO 2
918#define RES4312_CORE_LDO_BURST 3
919#define RES4312_CORE_LDO_PWM 4
920#define RES4312_RADIO_LDO 5
921#define RES4312_ILP_REQUEST 6
922#define RES4312_BG_FILTBYP 7
923#define RES4312_TX_FILTBYP 8
924#define RES4312_RX_FILTBYP 9
925#define RES4312_XTAL_PU 10
926#define RES4312_ALP_AVAIL 11
927#define RES4312_BB_PLL_FILTBYP 12
928#define RES4312_RF_PLL_FILTBYP 13
929#define RES4312_HT_AVAIL 14
930
931#define RES4322_RF_LDO 0
932#define RES4322_ILP_REQUEST 1
933#define RES4322_XTAL_PU 2
934#define RES4322_ALP_AVAIL 3
935#define RES4322_SI_PLL_ON 4
936#define RES4322_HT_SI_AVAIL 5
937#define RES4322_PHY_PLL_ON 6
938#define RES4322_HT_PHY_AVAIL 7
939#define RES4322_OTP_PU 8
940
941
942#define CST4322_XTAL_FREQ_20_40MHZ 0x00000020
943#define CST4322_SPROM_OTP_SEL_MASK 0x000000c0
944#define CST4322_SPROM_OTP_SEL_SHIFT 6
945#define CST4322_NO_SPROM_OTP 0
946#define CST4322_SPROM_PRESENT 1
947#define CST4322_OTP_PRESENT 2
948#define CST4322_PCI_OR_USB 0x00000100
949#define CST4322_BOOT_MASK 0x00000600
950#define CST4322_BOOT_SHIFT 9
951#define CST4322_BOOT_FROM_SRAM 0
952#define CST4322_BOOT_FROM_ROM 1
953#define CST4322_BOOT_FROM_FLASH 2
954#define CST4322_BOOT_FROM_INVALID 3
955#define CST4322_ILP_DIV_EN 0x00000800
956#define CST4322_FLASH_TYPE_MASK 0x00001000
957#define CST4322_FLASH_TYPE_SHIFT 12
958#define CST4322_FLASH_TYPE_SHIFT_ST 0
959#define CST4322_FLASH_TYPE_SHIFT_ATMEL 1
960#define CST4322_ARM_TAP_SEL 0x00002000
961#define CST4322_RES_INIT_MODE_MASK 0x0000c000
962#define CST4322_RES_INIT_MODE_SHIFT 14
963#define CST4322_RES_INIT_MODE_ILPAVAIL 0
964#define CST4322_RES_INIT_MODE_ILPREQ 1
965#define CST4322_RES_INIT_MODE_ALPAVAIL 2
966#define CST4322_RES_INIT_MODE_HTAVAIL 3
967#define CST4322_PCIPLLCLK_GATING 0x00010000
968#define CST4322_CLK_SWITCH_PCI_TO_ALP 0x00020000
969#define CST4322_PCI_CARDBUS_MODE 0x00040000
970
971#define RES4315_CBUCK_LPOM 1
972#define RES4315_CBUCK_BURST 2
973#define RES4315_CBUCK_PWM 3
974#define RES4315_CLDO_PU 4
975#define RES4315_PALDO_PU 5
976#define RES4315_ILP_REQUEST 6
977#define RES4315_LNLDO1_PU 9
978#define RES4315_OTP_PU 10
979#define RES4315_LNLDO2_PU 12
980#define RES4315_XTAL_PU 13
981#define RES4315_ALP_AVAIL 14
982#define RES4315_RX_PWRSW_PU 15
983#define RES4315_TX_PWRSW_PU 16
984#define RES4315_RFPLL_PWRSW_PU 17
985#define RES4315_LOGEN_PWRSW_PU 18
986#define RES4315_AFE_PWRSW_PU 19
987#define RES4315_BBPLL_PWRSW_PU 20
988#define RES4315_HT_AVAIL 21
989
990#define CST4315_SPROM_OTP_SEL_MASK 0x00000003
991#define CST4315_DEFCIS_SEL 0x00000000
992#define CST4315_SPROM_SEL 0x00000001
993#define CST4315_OTP_SEL 0x00000002
994#define CST4315_OTP_PWRDN 0x00000003
995#define CST4315_SDIO_MODE 0x00000004
996#define CST4315_RCAL_VALID 0x00000008
997#define CST4315_RCAL_VALUE_MASK 0x000001f0
998#define CST4315_RCAL_VALUE_SHIFT 4
999#define CST4315_PALDO_EXTPNP 0x00000200
1000#define CST4315_CBUCK_MODE_MASK 0x00000c00
1001#define CST4315_CBUCK_MODE_BURST 0x00000400
1002#define CST4315_CBUCK_MODE_LPBURST 0x00000c00
1003
1004#define PMU_MAX_TRANSITION_DLY 15000
1005
1006
1007#define PMURES_UP_TRANSITION 2
1008
1009
1010
1011
1012
1013#define ECI_BW_20 0x0
1014#define ECI_BW_25 0x1
1015#define ECI_BW_30 0x2
1016#define ECI_BW_35 0x3
1017#define ECI_BW_40 0x4
1018#define ECI_BW_45 0x5
1019#define ECI_BW_50 0x6
1020#define ECI_BW_ALL 0x7
1021
1022
1023#define WLAN_NUM_ANT1 TXANT_0
1024#define WLAN_NUM_ANT2 TXANT_1
1025
1026#endif
diff --git a/drivers/net/wireless/bcm4329/include/sbconfig.h b/drivers/net/wireless/bcm4329/include/sbconfig.h
new file mode 100644
index 00000000000..da18ccbe9ab
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/sbconfig.h
@@ -0,0 +1,276 @@
1/*
2 * Broadcom SiliconBackplane hardware register definitions.
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: sbconfig.h,v 13.67.30.1 2008/05/07 20:17:27 Exp $
25 */
26
27
28#ifndef _SBCONFIG_H
29#define _SBCONFIG_H
30
31
32#ifndef PAD
33#define _PADLINE(line) pad ## line
34#define _XSTR(line) _PADLINE(line)
35#define PAD _XSTR(__LINE__)
36#endif
37
38
39#define SB_BUS_SIZE 0x10000
40#define SB_BUS_BASE(b) (SI_ENUM_BASE + (b) * SB_BUS_SIZE)
41#define SB_BUS_MAXCORES (SB_BUS_SIZE / SI_CORE_SIZE)
42
43
44#define SBCONFIGOFF 0xf00
45#define SBCONFIGSIZE 256
46
47#define SBIPSFLAG 0x08
48#define SBTPSFLAG 0x18
49#define SBTMERRLOGA 0x48
50#define SBTMERRLOG 0x50
51#define SBADMATCH3 0x60
52#define SBADMATCH2 0x68
53#define SBADMATCH1 0x70
54#define SBIMSTATE 0x90
55#define SBINTVEC 0x94
56#define SBTMSTATELOW 0x98
57#define SBTMSTATEHIGH 0x9c
58#define SBBWA0 0xa0
59#define SBIMCONFIGLOW 0xa8
60#define SBIMCONFIGHIGH 0xac
61#define SBADMATCH0 0xb0
62#define SBTMCONFIGLOW 0xb8
63#define SBTMCONFIGHIGH 0xbc
64#define SBBCONFIG 0xc0
65#define SBBSTATE 0xc8
66#define SBACTCNFG 0xd8
67#define SBFLAGST 0xe8
68#define SBIDLOW 0xf8
69#define SBIDHIGH 0xfc
70
71
72
73#define SBIMERRLOGA 0xea8
74#define SBIMERRLOG 0xeb0
75#define SBTMPORTCONNID0 0xed8
76#define SBTMPORTLOCK0 0xef8
77
78#ifndef _LANGUAGE_ASSEMBLY
79
80typedef volatile struct _sbconfig {
81 uint32 PAD[2];
82 uint32 sbipsflag;
83 uint32 PAD[3];
84 uint32 sbtpsflag;
85 uint32 PAD[11];
86 uint32 sbtmerrloga;
87 uint32 PAD;
88 uint32 sbtmerrlog;
89 uint32 PAD[3];
90 uint32 sbadmatch3;
91 uint32 PAD;
92 uint32 sbadmatch2;
93 uint32 PAD;
94 uint32 sbadmatch1;
95 uint32 PAD[7];
96 uint32 sbimstate;
97 uint32 sbintvec;
98 uint32 sbtmstatelow;
99 uint32 sbtmstatehigh;
100 uint32 sbbwa0;
101 uint32 PAD;
102 uint32 sbimconfiglow;
103 uint32 sbimconfighigh;
104 uint32 sbadmatch0;
105 uint32 PAD;
106 uint32 sbtmconfiglow;
107 uint32 sbtmconfighigh;
108 uint32 sbbconfig;
109 uint32 PAD;
110 uint32 sbbstate;
111 uint32 PAD[3];
112 uint32 sbactcnfg;
113 uint32 PAD[3];
114 uint32 sbflagst;
115 uint32 PAD[3];
116 uint32 sbidlow;
117 uint32 sbidhigh;
118} sbconfig_t;
119
120#endif
121
122
123#define SBIPS_INT1_MASK 0x3f
124#define SBIPS_INT1_SHIFT 0
125#define SBIPS_INT2_MASK 0x3f00
126#define SBIPS_INT2_SHIFT 8
127#define SBIPS_INT3_MASK 0x3f0000
128#define SBIPS_INT3_SHIFT 16
129#define SBIPS_INT4_MASK 0x3f000000
130#define SBIPS_INT4_SHIFT 24
131
132
133#define SBTPS_NUM0_MASK 0x3f
134#define SBTPS_F0EN0 0x40
135
136
137#define SBTMEL_CM 0x00000007
138#define SBTMEL_CI 0x0000ff00
139#define SBTMEL_EC 0x0f000000
140#define SBTMEL_ME 0x80000000
141
142
143#define SBIM_PC 0xf
144#define SBIM_AP_MASK 0x30
145#define SBIM_AP_BOTH 0x00
146#define SBIM_AP_TS 0x10
147#define SBIM_AP_TK 0x20
148#define SBIM_AP_RSV 0x30
149#define SBIM_IBE 0x20000
150#define SBIM_TO 0x40000
151#define SBIM_BY 0x01800000
152#define SBIM_RJ 0x02000000
153
154
155#define SBTML_RESET 0x0001
156#define SBTML_REJ_MASK 0x0006
157#define SBTML_REJ 0x0002
158#define SBTML_TMPREJ 0x0004
159
160#define SBTML_SICF_SHIFT 16
161
162
163#define SBTMH_SERR 0x0001
164#define SBTMH_INT 0x0002
165#define SBTMH_BUSY 0x0004
166#define SBTMH_TO 0x0020
167
168#define SBTMH_SISF_SHIFT 16
169
170
171#define SBBWA_TAB0_MASK 0xffff
172#define SBBWA_TAB1_MASK 0xffff
173#define SBBWA_TAB1_SHIFT 16
174
175
176#define SBIMCL_STO_MASK 0x7
177#define SBIMCL_RTO_MASK 0x70
178#define SBIMCL_RTO_SHIFT 4
179#define SBIMCL_CID_MASK 0xff0000
180#define SBIMCL_CID_SHIFT 16
181
182
183#define SBIMCH_IEM_MASK 0xc
184#define SBIMCH_TEM_MASK 0x30
185#define SBIMCH_TEM_SHIFT 4
186#define SBIMCH_BEM_MASK 0xc0
187#define SBIMCH_BEM_SHIFT 6
188
189
190#define SBAM_TYPE_MASK 0x3
191#define SBAM_AD64 0x4
192#define SBAM_ADINT0_MASK 0xf8
193#define SBAM_ADINT0_SHIFT 3
194#define SBAM_ADINT1_MASK 0x1f8
195#define SBAM_ADINT1_SHIFT 3
196#define SBAM_ADINT2_MASK 0x1f8
197#define SBAM_ADINT2_SHIFT 3
198#define SBAM_ADEN 0x400
199#define SBAM_ADNEG 0x800
200#define SBAM_BASE0_MASK 0xffffff00
201#define SBAM_BASE0_SHIFT 8
202#define SBAM_BASE1_MASK 0xfffff000
203#define SBAM_BASE1_SHIFT 12
204#define SBAM_BASE2_MASK 0xffff0000
205#define SBAM_BASE2_SHIFT 16
206
207
208#define SBTMCL_CD_MASK 0xff
209#define SBTMCL_CO_MASK 0xf800
210#define SBTMCL_CO_SHIFT 11
211#define SBTMCL_IF_MASK 0xfc0000
212#define SBTMCL_IF_SHIFT 18
213#define SBTMCL_IM_MASK 0x3000000
214#define SBTMCL_IM_SHIFT 24
215
216
217#define SBTMCH_BM_MASK 0x3
218#define SBTMCH_RM_MASK 0x3
219#define SBTMCH_RM_SHIFT 2
220#define SBTMCH_SM_MASK 0x30
221#define SBTMCH_SM_SHIFT 4
222#define SBTMCH_EM_MASK 0x300
223#define SBTMCH_EM_SHIFT 8
224#define SBTMCH_IM_MASK 0xc00
225#define SBTMCH_IM_SHIFT 10
226
227
228#define SBBC_LAT_MASK 0x3
229#define SBBC_MAX0_MASK 0xf0000
230#define SBBC_MAX0_SHIFT 16
231#define SBBC_MAX1_MASK 0xf00000
232#define SBBC_MAX1_SHIFT 20
233
234
235#define SBBS_SRD 0x1
236#define SBBS_HRD 0x2
237
238
239#define SBIDL_CS_MASK 0x3
240#define SBIDL_AR_MASK 0x38
241#define SBIDL_AR_SHIFT 3
242#define SBIDL_SYNCH 0x40
243#define SBIDL_INIT 0x80
244#define SBIDL_MINLAT_MASK 0xf00
245#define SBIDL_MINLAT_SHIFT 8
246#define SBIDL_MAXLAT 0xf000
247#define SBIDL_MAXLAT_SHIFT 12
248#define SBIDL_FIRST 0x10000
249#define SBIDL_CW_MASK 0xc0000
250#define SBIDL_CW_SHIFT 18
251#define SBIDL_TP_MASK 0xf00000
252#define SBIDL_TP_SHIFT 20
253#define SBIDL_IP_MASK 0xf000000
254#define SBIDL_IP_SHIFT 24
255#define SBIDL_RV_MASK 0xf0000000
256#define SBIDL_RV_SHIFT 28
257#define SBIDL_RV_2_2 0x00000000
258#define SBIDL_RV_2_3 0x10000000
259
260
261#define SBIDH_RC_MASK 0x000f
262#define SBIDH_RCE_MASK 0x7000
263#define SBIDH_RCE_SHIFT 8
264#define SBCOREREV(sbidh) \
265 ((((sbidh) & SBIDH_RCE_MASK) >> SBIDH_RCE_SHIFT) | ((sbidh) & SBIDH_RC_MASK))
266#define SBIDH_CC_MASK 0x8ff0
267#define SBIDH_CC_SHIFT 4
268#define SBIDH_VC_MASK 0xffff0000
269#define SBIDH_VC_SHIFT 16
270
271#define SB_COMMIT 0xfd8
272
273
274#define SB_VEND_BCM 0x4243
275
276#endif
diff --git a/drivers/net/wireless/bcm4329/include/sbhnddma.h b/drivers/net/wireless/bcm4329/include/sbhnddma.h
new file mode 100644
index 00000000000..7681395f5b3
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/sbhnddma.h
@@ -0,0 +1,294 @@
1/*
2 * Generic Broadcom Home Networking Division (HND) DMA engine HW interface
3 * This supports the following chips: BCM42xx, 44xx, 47xx .
4 *
5 * Copyright (C) 1999-2010, Broadcom Corporation
6 *
7 * Unless you and Broadcom execute a separate written software license
8 * agreement governing use of this software, this software is licensed to you
9 * under the terms of the GNU General Public License version 2 (the "GPL"),
10 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
11 * following added to such license:
12 *
13 * As a special exception, the copyright holders of this software give you
14 * permission to link this software with independent modules, and to copy and
15 * distribute the resulting executable under terms of your choice, provided that
16 * you also meet, for each linked independent module, the terms and conditions of
17 * the license of that module. An independent module is a module which is not
18 * derived from this software. The special exception does not apply to any
19 * modifications of the software.
20 *
21 * Notwithstanding the above, under no circumstances may you combine this
22 * software in any way with any other Broadcom software provided under a license
23 * other than the GPL, without Broadcom's express prior written consent.
24 *
25 * $Id: sbhnddma.h,v 13.11.250.5.16.1 2009/07/21 14:04:51 Exp $
26 */
27
28
29#ifndef _sbhnddma_h_
30#define _sbhnddma_h_
31
32
33
34
35
36
37
38typedef volatile struct {
39 uint32 control;
40 uint32 addr;
41 uint32 ptr;
42 uint32 status;
43} dma32regs_t;
44
45typedef volatile struct {
46 dma32regs_t xmt;
47 dma32regs_t rcv;
48} dma32regp_t;
49
50typedef volatile struct {
51 uint32 fifoaddr;
52 uint32 fifodatalow;
53 uint32 fifodatahigh;
54 uint32 pad;
55} dma32diag_t;
56
57
58typedef volatile struct {
59 uint32 ctrl;
60 uint32 addr;
61} dma32dd_t;
62
63
64#define D32RINGALIGN_BITS 12
65#define D32MAXRINGSZ (1 << D32RINGALIGN_BITS)
66#define D32RINGALIGN (1 << D32RINGALIGN_BITS)
67#define D32MAXDD (D32MAXRINGSZ / sizeof (dma32dd_t))
68
69
70#define XC_XE ((uint32)1 << 0)
71#define XC_SE ((uint32)1 << 1)
72#define XC_LE ((uint32)1 << 2)
73#define XC_FL ((uint32)1 << 4)
74#define XC_PD ((uint32)1 << 11)
75#define XC_AE ((uint32)3 << 16)
76#define XC_AE_SHIFT 16
77
78
79#define XP_LD_MASK 0xfff
80
81
82#define XS_CD_MASK 0x0fff
83#define XS_XS_MASK 0xf000
84#define XS_XS_SHIFT 12
85#define XS_XS_DISABLED 0x0000
86#define XS_XS_ACTIVE 0x1000
87#define XS_XS_IDLE 0x2000
88#define XS_XS_STOPPED 0x3000
89#define XS_XS_SUSP 0x4000
90#define XS_XE_MASK 0xf0000
91#define XS_XE_SHIFT 16
92#define XS_XE_NOERR 0x00000
93#define XS_XE_DPE 0x10000
94#define XS_XE_DFU 0x20000
95#define XS_XE_BEBR 0x30000
96#define XS_XE_BEDA 0x40000
97#define XS_AD_MASK 0xfff00000
98#define XS_AD_SHIFT 20
99
100
101#define RC_RE ((uint32)1 << 0)
102#define RC_RO_MASK 0xfe
103#define RC_RO_SHIFT 1
104#define RC_FM ((uint32)1 << 8)
105#define RC_SH ((uint32)1 << 9)
106#define RC_OC ((uint32)1 << 10)
107#define RC_PD ((uint32)1 << 11)
108#define RC_AE ((uint32)3 << 16)
109#define RC_AE_SHIFT 16
110
111
112#define RP_LD_MASK 0xfff
113
114
115#define RS_CD_MASK 0x0fff
116#define RS_RS_MASK 0xf000
117#define RS_RS_SHIFT 12
118#define RS_RS_DISABLED 0x0000
119#define RS_RS_ACTIVE 0x1000
120#define RS_RS_IDLE 0x2000
121#define RS_RS_STOPPED 0x3000
122#define RS_RE_MASK 0xf0000
123#define RS_RE_SHIFT 16
124#define RS_RE_NOERR 0x00000
125#define RS_RE_DPE 0x10000
126#define RS_RE_DFO 0x20000
127#define RS_RE_BEBW 0x30000
128#define RS_RE_BEDA 0x40000
129#define RS_AD_MASK 0xfff00000
130#define RS_AD_SHIFT 20
131
132
133#define FA_OFF_MASK 0xffff
134#define FA_SEL_MASK 0xf0000
135#define FA_SEL_SHIFT 16
136#define FA_SEL_XDD 0x00000
137#define FA_SEL_XDP 0x10000
138#define FA_SEL_RDD 0x40000
139#define FA_SEL_RDP 0x50000
140#define FA_SEL_XFD 0x80000
141#define FA_SEL_XFP 0x90000
142#define FA_SEL_RFD 0xc0000
143#define FA_SEL_RFP 0xd0000
144#define FA_SEL_RSD 0xe0000
145#define FA_SEL_RSP 0xf0000
146
147
148#define CTRL_BC_MASK 0x1fff
149#define CTRL_AE ((uint32)3 << 16)
150#define CTRL_AE_SHIFT 16
151#define CTRL_EOT ((uint32)1 << 28)
152#define CTRL_IOC ((uint32)1 << 29)
153#define CTRL_EOF ((uint32)1 << 30)
154#define CTRL_SOF ((uint32)1 << 31)
155
156
157#define CTRL_CORE_MASK 0x0ff00000
158
159
160
161
162typedef volatile struct {
163 uint32 control;
164 uint32 ptr;
165 uint32 addrlow;
166 uint32 addrhigh;
167 uint32 status0;
168 uint32 status1;
169} dma64regs_t;
170
171typedef volatile struct {
172 dma64regs_t tx;
173 dma64regs_t rx;
174} dma64regp_t;
175
176typedef volatile struct {
177 uint32 fifoaddr;
178 uint32 fifodatalow;
179 uint32 fifodatahigh;
180 uint32 pad;
181} dma64diag_t;
182
183
184typedef volatile struct {
185 uint32 ctrl1;
186 uint32 ctrl2;
187 uint32 addrlow;
188 uint32 addrhigh;
189} dma64dd_t;
190
191
192#define D64RINGALIGN_BITS 13
193#define D64MAXRINGSZ (1 << D64RINGALIGN_BITS)
194#define D64RINGALIGN (1 << D64RINGALIGN_BITS)
195#define D64MAXDD (D64MAXRINGSZ / sizeof (dma64dd_t))
196
197
198#define D64_XC_XE 0x00000001
199#define D64_XC_SE 0x00000002
200#define D64_XC_LE 0x00000004
201#define D64_XC_FL 0x00000010
202#define D64_XC_PD 0x00000800
203#define D64_XC_AE 0x00030000
204#define D64_XC_AE_SHIFT 16
205
206
207#define D64_XP_LD_MASK 0x00000fff
208
209
210#define D64_XS0_CD_MASK 0x00001fff
211#define D64_XS0_XS_MASK 0xf0000000
212#define D64_XS0_XS_SHIFT 28
213#define D64_XS0_XS_DISABLED 0x00000000
214#define D64_XS0_XS_ACTIVE 0x10000000
215#define D64_XS0_XS_IDLE 0x20000000
216#define D64_XS0_XS_STOPPED 0x30000000
217#define D64_XS0_XS_SUSP 0x40000000
218
219#define D64_XS1_AD_MASK 0x0001ffff
220#define D64_XS1_XE_MASK 0xf0000000
221#define D64_XS1_XE_SHIFT 28
222#define D64_XS1_XE_NOERR 0x00000000
223#define D64_XS1_XE_DPE 0x10000000
224#define D64_XS1_XE_DFU 0x20000000
225#define D64_XS1_XE_DTE 0x30000000
226#define D64_XS1_XE_DESRE 0x40000000
227#define D64_XS1_XE_COREE 0x50000000
228
229
230#define D64_RC_RE 0x00000001
231#define D64_RC_RO_MASK 0x000000fe
232#define D64_RC_RO_SHIFT 1
233#define D64_RC_FM 0x00000100
234#define D64_RC_SH 0x00000200
235#define D64_RC_OC 0x00000400
236#define D64_RC_PD 0x00000800
237#define D64_RC_AE 0x00030000
238#define D64_RC_AE_SHIFT 16
239
240
241#define D64_RP_LD_MASK 0x00000fff
242
243
244#define D64_RS0_CD_MASK 0x00001fff
245#define D64_RS0_RS_MASK 0xf0000000
246#define D64_RS0_RS_SHIFT 28
247#define D64_RS0_RS_DISABLED 0x00000000
248#define D64_RS0_RS_ACTIVE 0x10000000
249#define D64_RS0_RS_IDLE 0x20000000
250#define D64_RS0_RS_STOPPED 0x30000000
251#define D64_RS0_RS_SUSP 0x40000000
252
253#define D64_RS1_AD_MASK 0x0001ffff
254#define D64_RS1_RE_MASK 0xf0000000
255#define D64_RS1_RE_SHIFT 28
256#define D64_RS1_RE_NOERR 0x00000000
257#define D64_RS1_RE_DPO 0x10000000
258#define D64_RS1_RE_DFU 0x20000000
259#define D64_RS1_RE_DTE 0x30000000
260#define D64_RS1_RE_DESRE 0x40000000
261#define D64_RS1_RE_COREE 0x50000000
262
263
264#define D64_FA_OFF_MASK 0xffff
265#define D64_FA_SEL_MASK 0xf0000
266#define D64_FA_SEL_SHIFT 16
267#define D64_FA_SEL_XDD 0x00000
268#define D64_FA_SEL_XDP 0x10000
269#define D64_FA_SEL_RDD 0x40000
270#define D64_FA_SEL_RDP 0x50000
271#define D64_FA_SEL_XFD 0x80000
272#define D64_FA_SEL_XFP 0x90000
273#define D64_FA_SEL_RFD 0xc0000
274#define D64_FA_SEL_RFP 0xd0000
275#define D64_FA_SEL_RSD 0xe0000
276#define D64_FA_SEL_RSP 0xf0000
277
278
279#define D64_CTRL1_EOT ((uint32)1 << 28)
280#define D64_CTRL1_IOC ((uint32)1 << 29)
281#define D64_CTRL1_EOF ((uint32)1 << 30)
282#define D64_CTRL1_SOF ((uint32)1 << 31)
283
284
285#define D64_CTRL2_BC_MASK 0x00007fff
286#define D64_CTRL2_AE 0x00030000
287#define D64_CTRL2_AE_SHIFT 16
288#define D64_CTRL2_PARITY 0x00040000
289
290
291#define D64_CTRL_CORE_MASK 0x0ff00000
292
293
294#endif
diff --git a/drivers/net/wireless/bcm4329/include/sbpcmcia.h b/drivers/net/wireless/bcm4329/include/sbpcmcia.h
new file mode 100644
index 00000000000..d6d80334258
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/sbpcmcia.h
@@ -0,0 +1,109 @@
1/*
2 * BCM43XX Sonics SiliconBackplane PCMCIA core hardware definitions.
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: sbpcmcia.h,v 13.31.4.1.2.3.8.7 2009/06/22 05:14:24 Exp $
25 */
26
27
28#ifndef _SBPCMCIA_H
29#define _SBPCMCIA_H
30
31
32
33
34#define PCMCIA_FCR (0x700 / 2)
35
36#define FCR0_OFF 0
37#define FCR1_OFF (0x40 / 2)
38#define FCR2_OFF (0x80 / 2)
39#define FCR3_OFF (0xc0 / 2)
40
41#define PCMCIA_FCR0 (0x700 / 2)
42#define PCMCIA_FCR1 (0x740 / 2)
43#define PCMCIA_FCR2 (0x780 / 2)
44#define PCMCIA_FCR3 (0x7c0 / 2)
45
46
47
48#define PCMCIA_COR 0
49
50#define COR_RST 0x80
51#define COR_LEV 0x40
52#define COR_IRQEN 0x04
53#define COR_BLREN 0x01
54#define COR_FUNEN 0x01
55
56
57#define PCICIA_FCSR (2 / 2)
58#define PCICIA_PRR (4 / 2)
59#define PCICIA_SCR (6 / 2)
60#define PCICIA_ESR (8 / 2)
61
62
63#define PCM_MEMOFF 0x0000
64#define F0_MEMOFF 0x1000
65#define F1_MEMOFF 0x2000
66#define F2_MEMOFF 0x3000
67#define F3_MEMOFF 0x4000
68
69
70#define MEM_ADDR0 (0x728 / 2)
71#define MEM_ADDR1 (0x72a / 2)
72#define MEM_ADDR2 (0x72c / 2)
73
74
75#define PCMCIA_ADDR0 (0x072e / 2)
76#define PCMCIA_ADDR1 (0x0730 / 2)
77#define PCMCIA_ADDR2 (0x0732 / 2)
78
79#define MEM_SEG (0x0734 / 2)
80#define SROM_CS (0x0736 / 2)
81#define SROM_DATAL (0x0738 / 2)
82#define SROM_DATAH (0x073a / 2)
83#define SROM_ADDRL (0x073c / 2)
84#define SROM_ADDRH (0x073e / 2)
85#define SROM_INFO2 (0x0772 / 2)
86#define SROM_INFO (0x07be / 2)
87
88
89#define SROM_IDLE 0
90#define SROM_WRITE 1
91#define SROM_READ 2
92#define SROM_WEN 4
93#define SROM_WDS 7
94#define SROM_DONE 8
95
96
97#define SRI_SZ_MASK 0x03
98#define SRI_BLANK 0x04
99#define SRI_OTP 0x80
100
101
102
103#define SBTML_INT_ACK 0x40000
104#define SBTML_INT_EN 0x20000
105
106
107#define SBTMH_INT_STATUS 0x40000
108
109#endif
diff --git a/drivers/net/wireless/bcm4329/include/sbsdio.h b/drivers/net/wireless/bcm4329/include/sbsdio.h
new file mode 100644
index 00000000000..75aaf4d88f7
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/sbsdio.h
@@ -0,0 +1,166 @@
1/*
2 * SDIO device core hardware definitions.
3 * sdio is a portion of the pcmcia core in core rev 3 - rev 8
4 *
5 * SDIO core support 1bit, 4 bit SDIO mode as well as SPI mode.
6 *
7 * Copyright (C) 1999-2010, Broadcom Corporation
8 *
9 * Unless you and Broadcom execute a separate written software license
10 * agreement governing use of this software, this software is licensed to you
11 * under the terms of the GNU General Public License version 2 (the "GPL"),
12 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
13 * following added to such license:
14 *
15 * As a special exception, the copyright holders of this software give you
16 * permission to link this software with independent modules, and to copy and
17 * distribute the resulting executable under terms of your choice, provided that
18 * you also meet, for each linked independent module, the terms and conditions of
19 * the license of that module. An independent module is a module which is not
20 * derived from this software. The special exception does not apply to any
21 * modifications of the software.
22 *
23 * Notwithstanding the above, under no circumstances may you combine this
24 * software in any way with any other Broadcom software provided under a license
25 * other than the GPL, without Broadcom's express prior written consent.
26 *
27 * $Id: sbsdio.h,v 13.29.4.1.22.3 2009/03/11 20:26:57 Exp $
28 */
29
30#ifndef _SBSDIO_H
31#define _SBSDIO_H
32
33#define SBSDIO_NUM_FUNCTION 3 /* as of sdiod rev 0, supports 3 functions */
34
35/* function 1 miscellaneous registers */
36#define SBSDIO_SPROM_CS 0x10000 /* sprom command and status */
37#define SBSDIO_SPROM_INFO 0x10001 /* sprom info register */
38#define SBSDIO_SPROM_DATA_LOW 0x10002 /* sprom indirect access data byte 0 */
39#define SBSDIO_SPROM_DATA_HIGH 0x10003 /* sprom indirect access data byte 1 */
40#define SBSDIO_SPROM_ADDR_LOW 0x10004 /* sprom indirect access addr byte 0 */
41#define SBSDIO_SPROM_ADDR_HIGH 0x10005 /* sprom indirect access addr byte 0 */
42#define SBSDIO_CHIP_CTRL_DATA 0x10006 /* xtal_pu (gpio) output */
43#define SBSDIO_CHIP_CTRL_EN 0x10007 /* xtal_pu (gpio) enable */
44#define SBSDIO_WATERMARK 0x10008 /* rev < 7, watermark for sdio device */
45#define SBSDIO_DEVICE_CTL 0x10009 /* control busy signal generation */
46
47/* registers introduced in rev 8, some content (mask/bits) defs in sbsdpcmdev.h */
48#define SBSDIO_FUNC1_SBADDRLOW 0x1000A /* SB Address Window Low (b15) */
49#define SBSDIO_FUNC1_SBADDRMID 0x1000B /* SB Address Window Mid (b23:b16) */
50#define SBSDIO_FUNC1_SBADDRHIGH 0x1000C /* SB Address Window High (b31:b24) */
51#define SBSDIO_FUNC1_FRAMECTRL 0x1000D /* Frame Control (frame term/abort) */
52#define SBSDIO_FUNC1_CHIPCLKCSR 0x1000E /* ChipClockCSR (ALP/HT ctl/status) */
53#define SBSDIO_FUNC1_SDIOPULLUP 0x1000F /* SdioPullUp (on cmd, d0-d2) */
54#define SBSDIO_FUNC1_WFRAMEBCLO 0x10019 /* Write Frame Byte Count Low */
55#define SBSDIO_FUNC1_WFRAMEBCHI 0x1001A /* Write Frame Byte Count High */
56#define SBSDIO_FUNC1_RFRAMEBCLO 0x1001B /* Read Frame Byte Count Low */
57#define SBSDIO_FUNC1_RFRAMEBCHI 0x1001C /* Read Frame Byte Count High */
58
59#define SBSDIO_FUNC1_MISC_REG_START 0x10000 /* f1 misc register start */
60#define SBSDIO_FUNC1_MISC_REG_LIMIT 0x1001C /* f1 misc register end */
61
62/* SBSDIO_SPROM_CS */
63#define SBSDIO_SPROM_IDLE 0
64#define SBSDIO_SPROM_WRITE 1
65#define SBSDIO_SPROM_READ 2
66#define SBSDIO_SPROM_WEN 4
67#define SBSDIO_SPROM_WDS 7
68#define SBSDIO_SPROM_DONE 8
69
70/* SBSDIO_SPROM_INFO */
71#define SROM_SZ_MASK 0x03 /* SROM size, 1: 4k, 2: 16k */
72#define SROM_BLANK 0x04 /* depreciated in corerev 6 */
73#define SROM_OTP 0x80 /* OTP present */
74
75/* SBSDIO_CHIP_CTRL */
76#define SBSDIO_CHIP_CTRL_XTAL 0x01 /* or'd with onchip xtal_pu,
77 * 1: power on oscillator
78 * (for 4318 only)
79 */
80/* SBSDIO_WATERMARK */
81#define SBSDIO_WATERMARK_MASK 0x7f /* number of words - 1 for sd device
82 * to wait before sending data to host
83 */
84
85/* SBSDIO_DEVICE_CTL */
86#define SBSDIO_DEVCTL_SETBUSY 0x01 /* 1: device will assert busy signal when
87 * receiving CMD53
88 */
89#define SBSDIO_DEVCTL_SPI_INTR_SYNC 0x02 /* 1: assertion of sdio interrupt is
90 * synchronous to the sdio clock
91 */
92#define SBSDIO_DEVCTL_CA_INT_ONLY 0x04 /* 1: mask all interrupts to host
93 * except the chipActive (rev 8)
94 */
95#define SBSDIO_DEVCTL_PADS_ISO 0x08 /* 1: isolate internal sdio signals, put
96 * external pads in tri-state; requires
97 * sdio bus power cycle to clear (rev 9)
98 */
99#define SBSDIO_DEVCTL_SB_RST_CTL 0x30 /* Force SD->SB reset mapping (rev 11) */
100#define SBSDIO_DEVCTL_RST_CORECTL 0x00 /* Determined by CoreControl bit */
101#define SBSDIO_DEVCTL_RST_BPRESET 0x10 /* Force backplane reset */
102#define SBSDIO_DEVCTL_RST_NOBPRESET 0x20 /* Force no backplane reset */
103
104
105/* SBSDIO_FUNC1_CHIPCLKCSR */
106#define SBSDIO_FORCE_ALP 0x01 /* Force ALP request to backplane */
107#define SBSDIO_FORCE_HT 0x02 /* Force HT request to backplane */
108#define SBSDIO_FORCE_ILP 0x04 /* Force ILP request to backplane */
109#define SBSDIO_ALP_AVAIL_REQ 0x08 /* Make ALP ready (power up xtal) */
110#define SBSDIO_HT_AVAIL_REQ 0x10 /* Make HT ready (power up PLL) */
111#define SBSDIO_FORCE_HW_CLKREQ_OFF 0x20 /* Squelch clock requests from HW */
112#define SBSDIO_ALP_AVAIL 0x40 /* Status: ALP is ready */
113#define SBSDIO_HT_AVAIL 0x80 /* Status: HT is ready */
114/* In rev8, actual avail bits followed original docs */
115#define SBSDIO_Rev8_HT_AVAIL 0x40
116#define SBSDIO_Rev8_ALP_AVAIL 0x80
117
118#define SBSDIO_AVBITS (SBSDIO_HT_AVAIL | SBSDIO_ALP_AVAIL)
119#define SBSDIO_ALPAV(regval) ((regval) & SBSDIO_AVBITS)
120#define SBSDIO_HTAV(regval) (((regval) & SBSDIO_AVBITS) == SBSDIO_AVBITS)
121#define SBSDIO_ALPONLY(regval) (SBSDIO_ALPAV(regval) && !SBSDIO_HTAV(regval))
122#define SBSDIO_CLKAV(regval, alponly) (SBSDIO_ALPAV(regval) && \
123 (alponly ? 1 : SBSDIO_HTAV(regval)))
124
125/* SBSDIO_FUNC1_SDIOPULLUP */
126#define SBSDIO_PULLUP_D0 0x01 /* Enable D0/MISO pullup */
127#define SBSDIO_PULLUP_D1 0x02 /* Enable D1/INT# pullup */
128#define SBSDIO_PULLUP_D2 0x04 /* Enable D2 pullup */
129#define SBSDIO_PULLUP_CMD 0x08 /* Enable CMD/MOSI pullup */
130#define SBSDIO_PULLUP_ALL 0x0f /* All valid bits */
131
132/* function 1 OCP space */
133#define SBSDIO_SB_OFT_ADDR_MASK 0x07FFF /* sb offset addr is <= 15 bits, 32k */
134#define SBSDIO_SB_OFT_ADDR_LIMIT 0x08000
135#define SBSDIO_SB_ACCESS_2_4B_FLAG 0x08000 /* with b15, maps to 32-bit SB access */
136
137/* some duplication with sbsdpcmdev.h here */
138/* valid bits in SBSDIO_FUNC1_SBADDRxxx regs */
139#define SBSDIO_SBADDRLOW_MASK 0x80 /* Valid bits in SBADDRLOW */
140#define SBSDIO_SBADDRMID_MASK 0xff /* Valid bits in SBADDRMID */
141#define SBSDIO_SBADDRHIGH_MASK 0xffU /* Valid bits in SBADDRHIGH */
142#define SBSDIO_SBWINDOW_MASK 0xffff8000 /* Address bits from SBADDR regs */
143
144/* direct(mapped) cis space */
145#define SBSDIO_CIS_BASE_COMMON 0x1000 /* MAPPED common CIS address */
146#define SBSDIO_CIS_SIZE_LIMIT 0x200 /* maximum bytes in one CIS */
147#define SBSDIO_OTP_CIS_SIZE_LIMIT 0x078 /* maximum bytes OTP CIS */
148
149#define SBSDIO_CIS_OFT_ADDR_MASK 0x1FFFF /* cis offset addr is < 17 bits */
150
151#define SBSDIO_CIS_MANFID_TUPLE_LEN 6 /* manfid tuple length, include tuple,
152 * link bytes
153 */
154
155/* indirect cis access (in sprom) */
156#define SBSDIO_SPROM_CIS_OFFSET 0x8 /* 8 control bytes first, CIS starts from
157 * 8th byte
158 */
159
160#define SBSDIO_BYTEMODE_DATALEN_MAX 64 /* sdio byte mode: maximum length of one
161 * data comamnd
162 */
163
164#define SBSDIO_CORE_ADDR_MASK 0x1FFFF /* sdio core function one address mask */
165
166#endif /* _SBSDIO_H */
diff --git a/drivers/net/wireless/bcm4329/include/sbsdpcmdev.h b/drivers/net/wireless/bcm4329/include/sbsdpcmdev.h
new file mode 100644
index 00000000000..7c7c7e4de0f
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/sbsdpcmdev.h
@@ -0,0 +1,288 @@
1/*
2 * Broadcom SiliconBackplane SDIO/PCMCIA hardware-specific device core support
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: sbsdpcmdev.h,v 13.29.4.1.4.6.6.2 2008/12/31 21:16:51 Exp $
25 */
26
27#ifndef _sbsdpcmdev_h_
28#define _sbsdpcmdev_h_
29
30/* cpp contortions to concatenate w/arg prescan */
31#ifndef PAD
32#define _PADLINE(line) pad ## line
33#define _XSTR(line) _PADLINE(line)
34#define PAD _XSTR(__LINE__)
35#endif /* PAD */
36
37
38typedef volatile struct {
39 dma64regs_t xmt; /* dma tx */
40 uint32 PAD[2];
41 dma64regs_t rcv; /* dma rx */
42 uint32 PAD[2];
43} dma64p_t;
44
45/* dma64 sdiod corerev >= 1 */
46typedef volatile struct {
47 dma64p_t dma64regs[2];
48 dma64diag_t dmafifo; /* DMA Diagnostic Regs, 0x280-0x28c */
49 uint32 PAD[92];
50} sdiodma64_t;
51
52/* dma32 sdiod corerev == 0 */
53typedef volatile struct {
54 dma32regp_t dma32regs[2]; /* dma tx & rx, 0x200-0x23c */
55 dma32diag_t dmafifo; /* DMA Diagnostic Regs, 0x240-0x24c */
56 uint32 PAD[108];
57} sdiodma32_t;
58
59/* dma32 regs for pcmcia core */
60typedef volatile struct {
61 dma32regp_t dmaregs; /* DMA Regs, 0x200-0x21c, rev8 */
62 dma32diag_t dmafifo; /* DMA Diagnostic Regs, 0x220-0x22c */
63 uint32 PAD[116];
64} pcmdma32_t;
65
66/* core registers */
67typedef volatile struct {
68 uint32 corecontrol; /* CoreControl, 0x000, rev8 */
69 uint32 corestatus; /* CoreStatus, 0x004, rev8 */
70 uint32 PAD[1];
71 uint32 biststatus; /* BistStatus, 0x00c, rev8 */
72
73 /* PCMCIA access */
74 uint16 pcmciamesportaladdr; /* PcmciaMesPortalAddr, 0x010, rev8 */
75 uint16 PAD[1];
76 uint16 pcmciamesportalmask; /* PcmciaMesPortalMask, 0x014, rev8 */
77 uint16 PAD[1];
78 uint16 pcmciawrframebc; /* PcmciaWrFrameBC, 0x018, rev8 */
79 uint16 PAD[1];
80 uint16 pcmciaunderflowtimer; /* PcmciaUnderflowTimer, 0x01c, rev8 */
81 uint16 PAD[1];
82
83 /* interrupt */
84 uint32 intstatus; /* IntStatus, 0x020, rev8 */
85 uint32 hostintmask; /* IntHostMask, 0x024, rev8 */
86 uint32 intmask; /* IntSbMask, 0x028, rev8 */
87 uint32 sbintstatus; /* SBIntStatus, 0x02c, rev8 */
88 uint32 sbintmask; /* SBIntMask, 0x030, rev8 */
89 uint32 PAD[3];
90 uint32 tosbmailbox; /* ToSBMailbox, 0x040, rev8 */
91 uint32 tohostmailbox; /* ToHostMailbox, 0x044, rev8 */
92 uint32 tosbmailboxdata; /* ToSbMailboxData, 0x048, rev8 */
93 uint32 tohostmailboxdata; /* ToHostMailboxData, 0x04c, rev8 */
94
95 /* synchronized access to registers in SDIO clock domain */
96 uint32 sdioaccess; /* SdioAccess, 0x050, rev8 */
97 uint32 PAD[3];
98
99 /* PCMCIA frame control */
100 uint8 pcmciaframectrl; /* pcmciaFrameCtrl, 0x060, rev8 */
101 uint8 PAD[3];
102 uint8 pcmciawatermark; /* pcmciaWaterMark, 0x064, rev8 */
103 uint8 PAD[155];
104
105 /* interrupt batching control */
106 uint32 intrcvlazy; /* IntRcvLazy, 0x100, rev8 */
107 uint32 PAD[3];
108
109 /* counters */
110 uint32 cmd52rd; /* Cmd52RdCount, 0x110, rev8, SDIO: cmd52 reads */
111 uint32 cmd52wr; /* Cmd52WrCount, 0x114, rev8, SDIO: cmd52 writes */
112 uint32 cmd53rd; /* Cmd53RdCount, 0x118, rev8, SDIO: cmd53 reads */
113 uint32 cmd53wr; /* Cmd53WrCount, 0x11c, rev8, SDIO: cmd53 writes */
114 uint32 abort; /* AbortCount, 0x120, rev8, SDIO: aborts */
115 uint32 datacrcerror; /* DataCrcErrorCount, 0x124, rev8, SDIO: frames w/bad CRC */
116 uint32 rdoutofsync; /* RdOutOfSyncCount, 0x128, rev8, SDIO/PCMCIA: Rd Frm OOS */
117 uint32 wroutofsync; /* RdOutOfSyncCount, 0x12c, rev8, SDIO/PCMCIA: Wr Frm OOS */
118 uint32 writebusy; /* WriteBusyCount, 0x130, rev8, SDIO: dev asserted "busy" */
119 uint32 readwait; /* ReadWaitCount, 0x134, rev8, SDIO: read: no data avail */
120 uint32 readterm; /* ReadTermCount, 0x138, rev8, SDIO: rd frm terminates */
121 uint32 writeterm; /* WriteTermCount, 0x13c, rev8, SDIO: wr frm terminates */
122 uint32 PAD[40];
123 uint32 clockctlstatus; /* ClockCtlStatus, 0x1e0, rev8 */
124 uint32 PAD[7];
125
126 /* DMA engines */
127 volatile union {
128 pcmdma32_t pcm32;
129 sdiodma32_t sdiod32;
130 sdiodma64_t sdiod64;
131 } dma;
132
133 /* SDIO/PCMCIA CIS region */
134 char cis[512]; /* 512 byte CIS, 0x400-0x5ff, rev6 */
135
136 /* PCMCIA function control registers */
137 char pcmciafcr[256]; /* PCMCIA FCR, 0x600-6ff, rev6 */
138 uint16 PAD[55];
139
140 /* PCMCIA backplane access */
141 uint16 backplanecsr; /* BackplaneCSR, 0x76E, rev6 */
142 uint16 backplaneaddr0; /* BackplaneAddr0, 0x770, rev6 */
143 uint16 backplaneaddr1; /* BackplaneAddr1, 0x772, rev6 */
144 uint16 backplaneaddr2; /* BackplaneAddr2, 0x774, rev6 */
145 uint16 backplaneaddr3; /* BackplaneAddr3, 0x776, rev6 */
146 uint16 backplanedata0; /* BackplaneData0, 0x778, rev6 */
147 uint16 backplanedata1; /* BackplaneData1, 0x77a, rev6 */
148 uint16 backplanedata2; /* BackplaneData2, 0x77c, rev6 */
149 uint16 backplanedata3; /* BackplaneData3, 0x77e, rev6 */
150 uint16 PAD[31];
151
152 /* sprom "size" & "blank" info */
153 uint16 spromstatus; /* SPROMStatus, 0x7BE, rev2 */
154 uint32 PAD[464];
155
156 /* Sonics SiliconBackplane registers */
157 sbconfig_t sbconfig; /* SbConfig Regs, 0xf00-0xfff, rev8 */
158} sdpcmd_regs_t;
159
160/* corecontrol */
161#define CC_CISRDY (1 << 0) /* CIS Ready */
162#define CC_BPRESEN (1 << 1) /* CCCR RES signal causes backplane reset */
163#define CC_F2RDY (1 << 2) /* set CCCR IOR2 bit */
164#define CC_CLRPADSISO (1 << 3) /* clear SDIO pads isolation bit (rev 11) */
165
166/* corestatus */
167#define CS_PCMCIAMODE (1 << 0) /* Device Mode; 0=SDIO, 1=PCMCIA */
168#define CS_SMARTDEV (1 << 1) /* 1=smartDev enabled */
169#define CS_F2ENABLED (1 << 2) /* 1=host has enabled the device */
170
171#define PCMCIA_MES_PA_MASK 0x7fff /* PCMCIA Message Portal Address Mask */
172#define PCMCIA_MES_PM_MASK 0x7fff /* PCMCIA Message Portal Mask Mask */
173#define PCMCIA_WFBC_MASK 0xffff /* PCMCIA Write Frame Byte Count Mask */
174#define PCMCIA_UT_MASK 0x07ff /* PCMCIA Underflow Timer Mask */
175
176/* intstatus */
177#define I_SMB_SW0 (1 << 0) /* To SB Mail S/W interrupt 0 */
178#define I_SMB_SW1 (1 << 1) /* To SB Mail S/W interrupt 1 */
179#define I_SMB_SW2 (1 << 2) /* To SB Mail S/W interrupt 2 */
180#define I_SMB_SW3 (1 << 3) /* To SB Mail S/W interrupt 3 */
181#define I_SMB_SW_MASK 0x0000000f /* To SB Mail S/W interrupts mask */
182#define I_SMB_SW_SHIFT 0 /* To SB Mail S/W interrupts shift */
183#define I_HMB_SW0 (1 << 4) /* To Host Mail S/W interrupt 0 */
184#define I_HMB_SW1 (1 << 5) /* To Host Mail S/W interrupt 1 */
185#define I_HMB_SW2 (1 << 6) /* To Host Mail S/W interrupt 2 */
186#define I_HMB_SW3 (1 << 7) /* To Host Mail S/W interrupt 3 */
187#define I_HMB_SW_MASK 0x000000f0 /* To Host Mail S/W interrupts mask */
188#define I_HMB_SW_SHIFT 4 /* To Host Mail S/W interrupts shift */
189#define I_WR_OOSYNC (1 << 8) /* Write Frame Out Of Sync */
190#define I_RD_OOSYNC (1 << 9) /* Read Frame Out Of Sync */
191#define I_PC (1 << 10) /* descriptor error */
192#define I_PD (1 << 11) /* data error */
193#define I_DE (1 << 12) /* Descriptor protocol Error */
194#define I_RU (1 << 13) /* Receive descriptor Underflow */
195#define I_RO (1 << 14) /* Receive fifo Overflow */
196#define I_XU (1 << 15) /* Transmit fifo Underflow */
197#define I_RI (1 << 16) /* Receive Interrupt */
198#define I_BUSPWR (1 << 17) /* SDIO Bus Power Change (rev 9) */
199#define I_XI (1 << 24) /* Transmit Interrupt */
200#define I_RF_TERM (1 << 25) /* Read Frame Terminate */
201#define I_WF_TERM (1 << 26) /* Write Frame Terminate */
202#define I_PCMCIA_XU (1 << 27) /* PCMCIA Transmit FIFO Underflow */
203#define I_SBINT (1 << 28) /* sbintstatus Interrupt */
204#define I_CHIPACTIVE (1 << 29) /* chip transitioned from doze to active state */
205#define I_SRESET (1 << 30) /* CCCR RES interrupt */
206#define I_IOE2 (1U << 31) /* CCCR IOE2 Bit Changed */
207#define I_ERRORS (I_PC | I_PD | I_DE | I_RU | I_RO | I_XU) /* DMA Errors */
208#define I_DMA (I_RI | I_XI | I_ERRORS)
209
210/* sbintstatus */
211#define I_SB_SERR (1 << 8) /* Backplane SError (write) */
212#define I_SB_RESPERR (1 << 9) /* Backplane Response Error (read) */
213#define I_SB_SPROMERR (1 << 10) /* Error accessing the sprom */
214
215/* sdioaccess */
216#define SDA_DATA_MASK 0x000000ff /* Read/Write Data Mask */
217#define SDA_ADDR_MASK 0x000fff00 /* Read/Write Address Mask */
218#define SDA_ADDR_SHIFT 8 /* Read/Write Address Shift */
219#define SDA_WRITE 0x01000000 /* Write bit */
220#define SDA_READ 0x00000000 /* Write bit cleared for Read */
221#define SDA_BUSY 0x80000000 /* Busy bit */
222
223/* sdioaccess-accessible register address spaces */
224#define SDA_CCCR_SPACE 0x000 /* sdioAccess CCCR register space */
225#define SDA_F1_FBR_SPACE 0x100 /* sdioAccess F1 FBR register space */
226#define SDA_F2_FBR_SPACE 0x200 /* sdioAccess F2 FBR register space */
227#define SDA_F1_REG_SPACE 0x300 /* sdioAccess F1 core-specific register space */
228
229/* SDA_F1_REG_SPACE sdioaccess-accessible F1 reg space register offsets */
230#define SDA_CHIPCONTROLDATA 0x006 /* ChipControlData */
231#define SDA_CHIPCONTROLENAB 0x007 /* ChipControlEnable */
232#define SDA_F2WATERMARK 0x008 /* Function 2 Watermark */
233#define SDA_DEVICECONTROL 0x009 /* DeviceControl */
234#define SDA_SBADDRLOW 0x00a /* SbAddrLow */
235#define SDA_SBADDRMID 0x00b /* SbAddrMid */
236#define SDA_SBADDRHIGH 0x00c /* SbAddrHigh */
237#define SDA_FRAMECTRL 0x00d /* FrameCtrl */
238#define SDA_CHIPCLOCKCSR 0x00e /* ChipClockCSR */
239#define SDA_SDIOPULLUP 0x00f /* SdioPullUp */
240#define SDA_SDIOWRFRAMEBCLOW 0x019 /* SdioWrFrameBCLow */
241#define SDA_SDIOWRFRAMEBCHIGH 0x01a /* SdioWrFrameBCHigh */
242#define SDA_SDIORDFRAMEBCLOW 0x01b /* SdioRdFrameBCLow */
243#define SDA_SDIORDFRAMEBCHIGH 0x01c /* SdioRdFrameBCHigh */
244
245/* SDA_F2WATERMARK */
246#define SDA_F2WATERMARK_MASK 0x7f /* F2Watermark Mask */
247
248/* SDA_SBADDRLOW */
249#define SDA_SBADDRLOW_MASK 0x80 /* SbAddrLow Mask */
250
251/* SDA_SBADDRMID */
252#define SDA_SBADDRMID_MASK 0xff /* SbAddrMid Mask */
253
254/* SDA_SBADDRHIGH */
255#define SDA_SBADDRHIGH_MASK 0xff /* SbAddrHigh Mask */
256
257/* SDA_FRAMECTRL */
258#define SFC_RF_TERM (1 << 0) /* Read Frame Terminate */
259#define SFC_WF_TERM (1 << 1) /* Write Frame Terminate */
260#define SFC_CRC4WOOS (1 << 2) /* HW reports CRC error for write out of sync */
261#define SFC_ABORTALL (1 << 3) /* Abort cancels all in-progress frames */
262
263/* pcmciaframectrl */
264#define PFC_RF_TERM (1 << 0) /* Read Frame Terminate */
265#define PFC_WF_TERM (1 << 1) /* Write Frame Terminate */
266
267/* intrcvlazy */
268#define IRL_TO_MASK 0x00ffffff /* timeout */
269#define IRL_FC_MASK 0xff000000 /* frame count */
270#define IRL_FC_SHIFT 24 /* frame count */
271
272/* rx header */
273typedef volatile struct {
274 uint16 len;
275 uint16 flags;
276} sdpcmd_rxh_t;
277
278/* rx header flags */
279#define RXF_CRC 0x0001 /* CRC error detected */
280#define RXF_WOOS 0x0002 /* write frame out of sync */
281#define RXF_WF_TERM 0x0004 /* write frame terminated */
282#define RXF_ABORT 0x0008 /* write frame aborted */
283#define RXF_DISCARD (RXF_CRC | RXF_WOOS | RXF_WF_TERM | RXF_ABORT) /* bad frame */
284
285/* HW frame tag */
286#define SDPCM_FRAMETAG_LEN 4 /* HW frametag: 2 bytes len, 2 bytes check val */
287
288#endif /* _sbsdpcmdev_h_ */
diff --git a/drivers/net/wireless/bcm4329/include/sbsocram.h b/drivers/net/wireless/bcm4329/include/sbsocram.h
new file mode 100644
index 00000000000..5ede0b66d97
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/sbsocram.h
@@ -0,0 +1,150 @@
1/*
2 * BCM47XX Sonics SiliconBackplane embedded ram core
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: sbsocram.h,v 13.9.162.2 2008/12/12 14:13:27 Exp $
25 */
26
27
28#ifndef _SBSOCRAM_H
29#define _SBSOCRAM_H
30
31#ifndef _LANGUAGE_ASSEMBLY
32
33
34#ifndef PAD
35#define _PADLINE(line) pad ## line
36#define _XSTR(line) _PADLINE(line)
37#define PAD _XSTR(__LINE__)
38#endif
39
40
41typedef volatile struct sbsocramregs {
42 uint32 coreinfo;
43 uint32 bwalloc;
44 uint32 extracoreinfo;
45 uint32 biststat;
46 uint32 bankidx;
47 uint32 standbyctrl;
48
49 uint32 errlogstatus;
50 uint32 errlogaddr;
51
52 uint32 cambankidx;
53 uint32 cambankstandbyctrl;
54 uint32 cambankpatchctrl;
55 uint32 cambankpatchtblbaseaddr;
56 uint32 cambankcmdreg;
57 uint32 cambankdatareg;
58 uint32 cambankmaskreg;
59 uint32 PAD[17];
60 uint32 extmemconfig;
61 uint32 extmemparitycsr;
62 uint32 extmemparityerrdata;
63 uint32 extmemparityerrcnt;
64 uint32 extmemwrctrlandsize;
65 uint32 PAD[84];
66 uint32 workaround;
67 uint32 pwrctl;
68} sbsocramregs_t;
69
70#endif
71
72
73#define SR_COREINFO 0x00
74#define SR_BWALLOC 0x04
75#define SR_BISTSTAT 0x0c
76#define SR_BANKINDEX 0x10
77#define SR_BANKSTBYCTL 0x14
78#define SR_PWRCTL 0x1e8
79
80
81#define SRCI_PT_MASK 0x00070000
82#define SRCI_PT_SHIFT 16
83
84#define SRCI_PT_OCP_OCP 0
85#define SRCI_PT_AXI_OCP 1
86#define SRCI_PT_ARM7AHB_OCP 2
87#define SRCI_PT_CM3AHB_OCP 3
88#define SRCI_PT_AXI_AXI 4
89#define SRCI_PT_AHB_AXI 5
90
91#define SRCI_LSS_MASK 0x00f00000
92#define SRCI_LSS_SHIFT 20
93#define SRCI_LRS_MASK 0x0f000000
94#define SRCI_LRS_SHIFT 24
95
96
97#define SRCI_MS0_MASK 0xf
98#define SR_MS0_BASE 16
99
100
101#define SRCI_ROMNB_MASK 0xf000
102#define SRCI_ROMNB_SHIFT 12
103#define SRCI_ROMBSZ_MASK 0xf00
104#define SRCI_ROMBSZ_SHIFT 8
105#define SRCI_SRNB_MASK 0xf0
106#define SRCI_SRNB_SHIFT 4
107#define SRCI_SRBSZ_MASK 0xf
108#define SRCI_SRBSZ_SHIFT 0
109
110#define SR_BSZ_BASE 14
111
112
113#define SRSC_SBYOVR_MASK 0x80000000
114#define SRSC_SBYOVR_SHIFT 31
115#define SRSC_SBYOVRVAL_MASK 0x60000000
116#define SRSC_SBYOVRVAL_SHIFT 29
117#define SRSC_SBYEN_MASK 0x01000000
118#define SRSC_SBYEN_SHIFT 24
119
120
121#define SRPC_PMU_STBYDIS_MASK 0x00000010
122#define SRPC_PMU_STBYDIS_SHIFT 4
123#define SRPC_STBYOVRVAL_MASK 0x00000008
124#define SRPC_STBYOVRVAL_SHIFT 3
125#define SRPC_STBYOVR_MASK 0x00000007
126#define SRPC_STBYOVR_SHIFT 0
127
128
129#define SRECC_NUM_BANKS_MASK 0x000000F0
130#define SRECC_NUM_BANKS_SHIFT 4
131#define SRECC_BANKSIZE_MASK 0x0000000F
132#define SRECC_BANKSIZE_SHIFT 0
133
134#define SRECC_BANKSIZE(value) (1 << (value))
135
136
137#define SRCBPC_PATCHENABLE 0x80000000
138
139#define SRP_ADDRESS 0x0001FFFC
140#define SRP_VALID 0x8000
141
142
143#define SRCMD_WRITE 0x00020000
144#define SRCMD_READ 0x00010000
145#define SRCMD_DONE 0x80000000
146
147#define SRCMD_DONE_DLY 1000
148
149
150#endif
diff --git a/drivers/net/wireless/bcm4329/include/sdio.h b/drivers/net/wireless/bcm4329/include/sdio.h
new file mode 100644
index 00000000000..280cb845fb0
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/sdio.h
@@ -0,0 +1,566 @@
1/*
2 * SDIO spec header file
3 * Protocol and standard (common) device definitions
4 *
5 * Copyright (C) 1999-2010, Broadcom Corporation
6 *
7 * Unless you and Broadcom execute a separate written software license
8 * agreement governing use of this software, this software is licensed to you
9 * under the terms of the GNU General Public License version 2 (the "GPL"),
10 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
11 * following added to such license:
12 *
13 * As a special exception, the copyright holders of this software give you
14 * permission to link this software with independent modules, and to copy and
15 * distribute the resulting executable under terms of your choice, provided that
16 * you also meet, for each linked independent module, the terms and conditions of
17 * the license of that module. An independent module is a module which is not
18 * derived from this software. The special exception does not apply to any
19 * modifications of the software.
20 *
21 * Notwithstanding the above, under no circumstances may you combine this
22 * software in any way with any other Broadcom software provided under a license
23 * other than the GPL, without Broadcom's express prior written consent.
24 *
25 * $Id: sdio.h,v 13.24.4.1.4.1.16.1 2009/08/12 01:08:02 Exp $
26 */
27
28#ifndef _SDIO_H
29#define _SDIO_H
30
31
32/* CCCR structure for function 0 */
33typedef volatile struct {
34 uint8 cccr_sdio_rev; /* RO, cccr and sdio revision */
35 uint8 sd_rev; /* RO, sd spec revision */
36 uint8 io_en; /* I/O enable */
37 uint8 io_rdy; /* I/O ready reg */
38 uint8 intr_ctl; /* Master and per function interrupt enable control */
39 uint8 intr_status; /* RO, interrupt pending status */
40 uint8 io_abort; /* read/write abort or reset all functions */
41 uint8 bus_inter; /* bus interface control */
42 uint8 capability; /* RO, card capability */
43
44 uint8 cis_base_low; /* 0x9 RO, common CIS base address, LSB */
45 uint8 cis_base_mid;
46 uint8 cis_base_high; /* 0xB RO, common CIS base address, MSB */
47
48 /* suspend/resume registers */
49 uint8 bus_suspend; /* 0xC */
50 uint8 func_select; /* 0xD */
51 uint8 exec_flag; /* 0xE */
52 uint8 ready_flag; /* 0xF */
53
54 uint8 fn0_blk_size[2]; /* 0x10(LSB), 0x11(MSB) */
55
56 uint8 power_control; /* 0x12 (SDIO version 1.10) */
57
58 uint8 speed_control; /* 0x13 */
59} sdio_regs_t;
60
61/* SDIO Device CCCR offsets */
62#define SDIOD_CCCR_REV 0x00
63#define SDIOD_CCCR_SDREV 0x01
64#define SDIOD_CCCR_IOEN 0x02
65#define SDIOD_CCCR_IORDY 0x03
66#define SDIOD_CCCR_INTEN 0x04
67#define SDIOD_CCCR_INTPEND 0x05
68#define SDIOD_CCCR_IOABORT 0x06
69#define SDIOD_CCCR_BICTRL 0x07
70#define SDIOD_CCCR_CAPABLITIES 0x08
71#define SDIOD_CCCR_CISPTR_0 0x09
72#define SDIOD_CCCR_CISPTR_1 0x0A
73#define SDIOD_CCCR_CISPTR_2 0x0B
74#define SDIOD_CCCR_BUSSUSP 0x0C
75#define SDIOD_CCCR_FUNCSEL 0x0D
76#define SDIOD_CCCR_EXECFLAGS 0x0E
77#define SDIOD_CCCR_RDYFLAGS 0x0F
78#define SDIOD_CCCR_BLKSIZE_0 0x10
79#define SDIOD_CCCR_BLKSIZE_1 0x11
80#define SDIOD_CCCR_POWER_CONTROL 0x12
81#define SDIOD_CCCR_SPEED_CONTROL 0x13
82
83/* Broadcom extensions (corerev >= 1) */
84#define SDIOD_CCCR_BRCM_SEPINT 0xf2
85
86/* cccr_sdio_rev */
87#define SDIO_REV_SDIOID_MASK 0xf0 /* SDIO spec revision number */
88#define SDIO_REV_CCCRID_MASK 0x0f /* CCCR format version number */
89
90/* sd_rev */
91#define SD_REV_PHY_MASK 0x0f /* SD format version number */
92
93/* io_en */
94#define SDIO_FUNC_ENABLE_1 0x02 /* function 1 I/O enable */
95#define SDIO_FUNC_ENABLE_2 0x04 /* function 2 I/O enable */
96
97/* io_rdys */
98#define SDIO_FUNC_READY_1 0x02 /* function 1 I/O ready */
99#define SDIO_FUNC_READY_2 0x04 /* function 2 I/O ready */
100
101/* intr_ctl */
102#define INTR_CTL_MASTER_EN 0x1 /* interrupt enable master */
103#define INTR_CTL_FUNC1_EN 0x2 /* interrupt enable for function 1 */
104#define INTR_CTL_FUNC2_EN 0x4 /* interrupt enable for function 2 */
105
106/* intr_status */
107#define INTR_STATUS_FUNC1 0x2 /* interrupt pending for function 1 */
108#define INTR_STATUS_FUNC2 0x4 /* interrupt pending for function 2 */
109
110/* io_abort */
111#define IO_ABORT_RESET_ALL 0x08 /* I/O card reset */
112#define IO_ABORT_FUNC_MASK 0x07 /* abort selction: function x */
113
114/* bus_inter */
115#define BUS_CARD_DETECT_DIS 0x80 /* Card Detect disable */
116#define BUS_SPI_CONT_INTR_CAP 0x40 /* support continuous SPI interrupt */
117#define BUS_SPI_CONT_INTR_EN 0x20 /* continuous SPI interrupt enable */
118#define BUS_SD_DATA_WIDTH_MASK 0x03 /* bus width mask */
119#define BUS_SD_DATA_WIDTH_4BIT 0x02 /* bus width 4-bit mode */
120#define BUS_SD_DATA_WIDTH_1BIT 0x00 /* bus width 1-bit mode */
121
122/* capability */
123#define SDIO_CAP_4BLS 0x80 /* 4-bit support for low speed card */
124#define SDIO_CAP_LSC 0x40 /* low speed card */
125#define SDIO_CAP_E4MI 0x20 /* enable interrupt between block of data in 4-bit mode */
126#define SDIO_CAP_S4MI 0x10 /* support interrupt between block of data in 4-bit mode */
127#define SDIO_CAP_SBS 0x08 /* support suspend/resume */
128#define SDIO_CAP_SRW 0x04 /* support read wait */
129#define SDIO_CAP_SMB 0x02 /* support multi-block transfer */
130#define SDIO_CAP_SDC 0x01 /* Support Direct commands during multi-byte transfer */
131
132/* power_control */
133#define SDIO_POWER_SMPC 0x01 /* supports master power control (RO) */
134#define SDIO_POWER_EMPC 0x02 /* enable master power control (allow > 200mA) (RW) */
135
136/* speed_control (control device entry into high-speed clocking mode) */
137#define SDIO_SPEED_SHS 0x01 /* supports high-speed [clocking] mode (RO) */
138#define SDIO_SPEED_EHS 0x02 /* enable high-speed [clocking] mode (RW) */
139
140/* brcm sepint */
141#define SDIO_SEPINT_MASK 0x01 /* route sdpcmdev intr onto separate pad (chip-specific) */
142#define SDIO_SEPINT_OE 0x02 /* 1 asserts output enable for above pad */
143#define SDIO_SEPINT_ACT_HI 0x04 /* use active high interrupt level instead of active low */
144
145/* FBR structure for function 1-7, FBR addresses and register offsets */
146typedef volatile struct {
147 uint8 devctr; /* device interface, CSA control */
148 uint8 ext_dev; /* extended standard I/O device type code */
149 uint8 pwr_sel; /* power selection support */
150 uint8 PAD[6]; /* reserved */
151
152 uint8 cis_low; /* CIS LSB */
153 uint8 cis_mid;
154 uint8 cis_high; /* CIS MSB */
155 uint8 csa_low; /* code storage area, LSB */
156 uint8 csa_mid;
157 uint8 csa_high; /* code storage area, MSB */
158 uint8 csa_dat_win; /* data access window to function */
159
160 uint8 fnx_blk_size[2]; /* block size, little endian */
161} sdio_fbr_t;
162
163/* Maximum number of I/O funcs */
164#define SDIOD_MAX_IOFUNCS 7
165
166/* SDIO Device FBR Start Address */
167#define SDIOD_FBR_STARTADDR 0x100
168
169/* SDIO Device FBR Size */
170#define SDIOD_FBR_SIZE 0x100
171
172/* Macro to calculate FBR register base */
173#define SDIOD_FBR_BASE(n) ((n) * 0x100)
174
175/* Function register offsets */
176#define SDIOD_FBR_DEVCTR 0x00 /* basic info for function */
177#define SDIOD_FBR_EXT_DEV 0x01 /* extended I/O device code */
178#define SDIOD_FBR_PWR_SEL 0x02 /* power selection bits */
179
180/* SDIO Function CIS ptr offset */
181#define SDIOD_FBR_CISPTR_0 0x09
182#define SDIOD_FBR_CISPTR_1 0x0A
183#define SDIOD_FBR_CISPTR_2 0x0B
184
185/* Code Storage Area pointer */
186#define SDIOD_FBR_CSA_ADDR_0 0x0C
187#define SDIOD_FBR_CSA_ADDR_1 0x0D
188#define SDIOD_FBR_CSA_ADDR_2 0x0E
189#define SDIOD_FBR_CSA_DATA 0x0F
190
191/* SDIO Function I/O Block Size */
192#define SDIOD_FBR_BLKSIZE_0 0x10
193#define SDIOD_FBR_BLKSIZE_1 0x11
194
195/* devctr */
196#define SDIOD_FBR_DEVCTR_DIC 0x0f /* device interface code */
197#define SDIOD_FBR_DECVTR_CSA 0x40 /* CSA support flag */
198#define SDIOD_FBR_DEVCTR_CSA_EN 0x80 /* CSA enabled */
199/* interface codes */
200#define SDIOD_DIC_NONE 0 /* SDIO standard interface is not supported */
201#define SDIOD_DIC_UART 1
202#define SDIOD_DIC_BLUETOOTH_A 2
203#define SDIOD_DIC_BLUETOOTH_B 3
204#define SDIOD_DIC_GPS 4
205#define SDIOD_DIC_CAMERA 5
206#define SDIOD_DIC_PHS 6
207#define SDIOD_DIC_WLAN 7
208#define SDIOD_DIC_EXT 0xf /* extended device interface, read ext_dev register */
209
210/* pwr_sel */
211#define SDIOD_PWR_SEL_SPS 0x01 /* supports power selection */
212#define SDIOD_PWR_SEL_EPS 0x02 /* enable power selection (low-current mode) */
213
214/* misc defines */
215#define SDIO_FUNC_0 0
216#define SDIO_FUNC_1 1
217#define SDIO_FUNC_2 2
218#define SDIO_FUNC_3 3
219#define SDIO_FUNC_4 4
220#define SDIO_FUNC_5 5
221#define SDIO_FUNC_6 6
222#define SDIO_FUNC_7 7
223
224#define SD_CARD_TYPE_UNKNOWN 0 /* bad type or unrecognized */
225#define SD_CARD_TYPE_IO 1 /* IO only card */
226#define SD_CARD_TYPE_MEMORY 2 /* memory only card */
227#define SD_CARD_TYPE_COMBO 3 /* IO and memory combo card */
228
229#define SDIO_MAX_BLOCK_SIZE 2048 /* maximum block size for block mode operation */
230#define SDIO_MIN_BLOCK_SIZE 1 /* minimum block size for block mode operation */
231
232/* Card registers: status bit position */
233#define CARDREG_STATUS_BIT_OUTOFRANGE 31
234#define CARDREG_STATUS_BIT_COMCRCERROR 23
235#define CARDREG_STATUS_BIT_ILLEGALCOMMAND 22
236#define CARDREG_STATUS_BIT_ERROR 19
237#define CARDREG_STATUS_BIT_IOCURRENTSTATE3 12
238#define CARDREG_STATUS_BIT_IOCURRENTSTATE2 11
239#define CARDREG_STATUS_BIT_IOCURRENTSTATE1 10
240#define CARDREG_STATUS_BIT_IOCURRENTSTATE0 9
241#define CARDREG_STATUS_BIT_FUN_NUM_ERROR 4
242
243
244
245#define SD_CMD_GO_IDLE_STATE 0 /* mandatory for SDIO */
246#define SD_CMD_SEND_OPCOND 1
247#define SD_CMD_MMC_SET_RCA 3
248#define SD_CMD_IO_SEND_OP_COND 5 /* mandatory for SDIO */
249#define SD_CMD_SELECT_DESELECT_CARD 7
250#define SD_CMD_SEND_CSD 9
251#define SD_CMD_SEND_CID 10
252#define SD_CMD_STOP_TRANSMISSION 12
253#define SD_CMD_SEND_STATUS 13
254#define SD_CMD_GO_INACTIVE_STATE 15
255#define SD_CMD_SET_BLOCKLEN 16
256#define SD_CMD_READ_SINGLE_BLOCK 17
257#define SD_CMD_READ_MULTIPLE_BLOCK 18
258#define SD_CMD_WRITE_BLOCK 24
259#define SD_CMD_WRITE_MULTIPLE_BLOCK 25
260#define SD_CMD_PROGRAM_CSD 27
261#define SD_CMD_SET_WRITE_PROT 28
262#define SD_CMD_CLR_WRITE_PROT 29
263#define SD_CMD_SEND_WRITE_PROT 30
264#define SD_CMD_ERASE_WR_BLK_START 32
265#define SD_CMD_ERASE_WR_BLK_END 33
266#define SD_CMD_ERASE 38
267#define SD_CMD_LOCK_UNLOCK 42
268#define SD_CMD_IO_RW_DIRECT 52 /* mandatory for SDIO */
269#define SD_CMD_IO_RW_EXTENDED 53 /* mandatory for SDIO */
270#define SD_CMD_APP_CMD 55
271#define SD_CMD_GEN_CMD 56
272#define SD_CMD_READ_OCR 58
273#define SD_CMD_CRC_ON_OFF 59 /* mandatory for SDIO */
274#define SD_ACMD_SD_STATUS 13
275#define SD_ACMD_SEND_NUM_WR_BLOCKS 22
276#define SD_ACMD_SET_WR_BLOCK_ERASE_CNT 23
277#define SD_ACMD_SD_SEND_OP_COND 41
278#define SD_ACMD_SET_CLR_CARD_DETECT 42
279#define SD_ACMD_SEND_SCR 51
280
281/* argument for SD_CMD_IO_RW_DIRECT and SD_CMD_IO_RW_EXTENDED */
282#define SD_IO_OP_READ 0 /* Read_Write: Read */
283#define SD_IO_OP_WRITE 1 /* Read_Write: Write */
284#define SD_IO_RW_NORMAL 0 /* no RAW */
285#define SD_IO_RW_RAW 1 /* RAW */
286#define SD_IO_BYTE_MODE 0 /* Byte Mode */
287#define SD_IO_BLOCK_MODE 1 /* BlockMode */
288#define SD_IO_FIXED_ADDRESS 0 /* fix Address */
289#define SD_IO_INCREMENT_ADDRESS 1 /* IncrementAddress */
290
291/* build SD_CMD_IO_RW_DIRECT Argument */
292#define SDIO_IO_RW_DIRECT_ARG(rw, raw, func, addr, data) \
293 ((((rw) & 1) << 31) | (((func) & 0x7) << 28) | (((raw) & 1) << 27) | \
294 (((addr) & 0x1FFFF) << 9) | ((data) & 0xFF))
295
296/* build SD_CMD_IO_RW_EXTENDED Argument */
297#define SDIO_IO_RW_EXTENDED_ARG(rw, blk, func, addr, inc_addr, count) \
298 ((((rw) & 1) << 31) | (((func) & 0x7) << 28) | (((blk) & 1) << 27) | \
299 (((inc_addr) & 1) << 26) | (((addr) & 0x1FFFF) << 9) | ((count) & 0x1FF))
300
301/* SDIO response parameters */
302#define SD_RSP_NO_NONE 0
303#define SD_RSP_NO_1 1
304#define SD_RSP_NO_2 2
305#define SD_RSP_NO_3 3
306#define SD_RSP_NO_4 4
307#define SD_RSP_NO_5 5
308#define SD_RSP_NO_6 6
309
310 /* Modified R6 response (to CMD3) */
311#define SD_RSP_MR6_COM_CRC_ERROR 0x8000
312#define SD_RSP_MR6_ILLEGAL_COMMAND 0x4000
313#define SD_RSP_MR6_ERROR 0x2000
314
315 /* Modified R1 in R4 Response (to CMD5) */
316#define SD_RSP_MR1_SBIT 0x80
317#define SD_RSP_MR1_PARAMETER_ERROR 0x40
318#define SD_RSP_MR1_RFU5 0x20
319#define SD_RSP_MR1_FUNC_NUM_ERROR 0x10
320#define SD_RSP_MR1_COM_CRC_ERROR 0x08
321#define SD_RSP_MR1_ILLEGAL_COMMAND 0x04
322#define SD_RSP_MR1_RFU1 0x02
323#define SD_RSP_MR1_IDLE_STATE 0x01
324
325 /* R5 response (to CMD52 and CMD53) */
326#define SD_RSP_R5_COM_CRC_ERROR 0x80
327#define SD_RSP_R5_ILLEGAL_COMMAND 0x40
328#define SD_RSP_R5_IO_CURRENTSTATE1 0x20
329#define SD_RSP_R5_IO_CURRENTSTATE0 0x10
330#define SD_RSP_R5_ERROR 0x08
331#define SD_RSP_R5_RFU 0x04
332#define SD_RSP_R5_FUNC_NUM_ERROR 0x02
333#define SD_RSP_R5_OUT_OF_RANGE 0x01
334
335#define SD_RSP_R5_ERRBITS 0xCB
336
337
338/* ------------------------------------------------
339 * SDIO Commands and responses
340 *
341 * I/O only commands are:
342 * CMD0, CMD3, CMD5, CMD7, CMD15, CMD52, CMD53
343 * ------------------------------------------------
344 */
345
346/* SDIO Commands */
347#define SDIOH_CMD_0 0
348#define SDIOH_CMD_3 3
349#define SDIOH_CMD_5 5
350#define SDIOH_CMD_7 7
351#define SDIOH_CMD_15 15
352#define SDIOH_CMD_52 52
353#define SDIOH_CMD_53 53
354#define SDIOH_CMD_59 59
355
356/* SDIO Command Responses */
357#define SDIOH_RSP_NONE 0
358#define SDIOH_RSP_R1 1
359#define SDIOH_RSP_R2 2
360#define SDIOH_RSP_R3 3
361#define SDIOH_RSP_R4 4
362#define SDIOH_RSP_R5 5
363#define SDIOH_RSP_R6 6
364
365/*
366 * SDIO Response Error flags
367 */
368#define SDIOH_RSP5_ERROR_FLAGS 0xCB
369
370/* ------------------------------------------------
371 * SDIO Command structures. I/O only commands are:
372 *
373 * CMD0, CMD3, CMD5, CMD7, CMD15, CMD52, CMD53
374 * ------------------------------------------------
375 */
376
377#define CMD5_OCR_M BITFIELD_MASK(24)
378#define CMD5_OCR_S 0
379
380#define CMD7_RCA_M BITFIELD_MASK(16)
381#define CMD7_RCA_S 16
382
383#define CMD_15_RCA_M BITFIELD_MASK(16)
384#define CMD_15_RCA_S 16
385
386#define CMD52_DATA_M BITFIELD_MASK(8) /* Bits [7:0] - Write Data/Stuff bits of CMD52
387 */
388#define CMD52_DATA_S 0
389#define CMD52_REG_ADDR_M BITFIELD_MASK(17) /* Bits [25:9] - register address */
390#define CMD52_REG_ADDR_S 9
391#define CMD52_RAW_M BITFIELD_MASK(1) /* Bit 27 - Read after Write flag */
392#define CMD52_RAW_S 27
393#define CMD52_FUNCTION_M BITFIELD_MASK(3) /* Bits [30:28] - Function number */
394#define CMD52_FUNCTION_S 28
395#define CMD52_RW_FLAG_M BITFIELD_MASK(1) /* Bit 31 - R/W flag */
396#define CMD52_RW_FLAG_S 31
397
398
399#define CMD53_BYTE_BLK_CNT_M BITFIELD_MASK(9) /* Bits [8:0] - Byte/Block Count of CMD53 */
400#define CMD53_BYTE_BLK_CNT_S 0
401#define CMD53_REG_ADDR_M BITFIELD_MASK(17) /* Bits [25:9] - register address */
402#define CMD53_REG_ADDR_S 9
403#define CMD53_OP_CODE_M BITFIELD_MASK(1) /* Bit 26 - R/W Operation Code */
404#define CMD53_OP_CODE_S 26
405#define CMD53_BLK_MODE_M BITFIELD_MASK(1) /* Bit 27 - Block Mode */
406#define CMD53_BLK_MODE_S 27
407#define CMD53_FUNCTION_M BITFIELD_MASK(3) /* Bits [30:28] - Function number */
408#define CMD53_FUNCTION_S 28
409#define CMD53_RW_FLAG_M BITFIELD_MASK(1) /* Bit 31 - R/W flag */
410#define CMD53_RW_FLAG_S 31
411
412/* ------------------------------------------------------
413 * SDIO Command Response structures for SD1 and SD4 modes
414 * -----------------------------------------------------
415 */
416#define RSP4_IO_OCR_M BITFIELD_MASK(24) /* Bits [23:0] - Card's OCR Bits [23:0] */
417#define RSP4_IO_OCR_S 0
418#define RSP4_STUFF_M BITFIELD_MASK(3) /* Bits [26:24] - Stuff bits */
419#define RSP4_STUFF_S 24
420#define RSP4_MEM_PRESENT_M BITFIELD_MASK(1) /* Bit 27 - Memory present */
421#define RSP4_MEM_PRESENT_S 27
422#define RSP4_NUM_FUNCS_M BITFIELD_MASK(3) /* Bits [30:28] - Number of I/O funcs */
423#define RSP4_NUM_FUNCS_S 28
424#define RSP4_CARD_READY_M BITFIELD_MASK(1) /* Bit 31 - SDIO card ready */
425#define RSP4_CARD_READY_S 31
426
427#define RSP6_STATUS_M BITFIELD_MASK(16) /* Bits [15:0] - Card status bits [19,22,23,12:0]
428 */
429#define RSP6_STATUS_S 0
430#define RSP6_IO_RCA_M BITFIELD_MASK(16) /* Bits [31:16] - RCA bits[31-16] */
431#define RSP6_IO_RCA_S 16
432
433#define RSP1_AKE_SEQ_ERROR_M BITFIELD_MASK(1) /* Bit 3 - Authentication seq error */
434#define RSP1_AKE_SEQ_ERROR_S 3
435#define RSP1_APP_CMD_M BITFIELD_MASK(1) /* Bit 5 - Card expects ACMD */
436#define RSP1_APP_CMD_S 5
437#define RSP1_READY_FOR_DATA_M BITFIELD_MASK(1) /* Bit 8 - Ready for data (buff empty) */
438#define RSP1_READY_FOR_DATA_S 8
439#define RSP1_CURR_STATE_M BITFIELD_MASK(4) /* Bits [12:9] - State of card
440 * when Cmd was received
441 */
442#define RSP1_CURR_STATE_S 9
443#define RSP1_EARSE_RESET_M BITFIELD_MASK(1) /* Bit 13 - Erase seq cleared */
444#define RSP1_EARSE_RESET_S 13
445#define RSP1_CARD_ECC_DISABLE_M BITFIELD_MASK(1) /* Bit 14 - Card ECC disabled */
446#define RSP1_CARD_ECC_DISABLE_S 14
447#define RSP1_WP_ERASE_SKIP_M BITFIELD_MASK(1) /* Bit 15 - Partial blocks erased due to W/P */
448#define RSP1_WP_ERASE_SKIP_S 15
449#define RSP1_CID_CSD_OVERW_M BITFIELD_MASK(1) /* Bit 16 - Illegal write to CID or R/O bits
450 * of CSD
451 */
452#define RSP1_CID_CSD_OVERW_S 16
453#define RSP1_ERROR_M BITFIELD_MASK(1) /* Bit 19 - General/Unknown error */
454#define RSP1_ERROR_S 19
455#define RSP1_CC_ERROR_M BITFIELD_MASK(1) /* Bit 20 - Internal Card Control error */
456#define RSP1_CC_ERROR_S 20
457#define RSP1_CARD_ECC_FAILED_M BITFIELD_MASK(1) /* Bit 21 - Card internal ECC failed
458 * to correct data
459 */
460#define RSP1_CARD_ECC_FAILED_S 21
461#define RSP1_ILLEGAL_CMD_M BITFIELD_MASK(1) /* Bit 22 - Cmd not legal for the card state */
462#define RSP1_ILLEGAL_CMD_S 22
463#define RSP1_COM_CRC_ERROR_M BITFIELD_MASK(1) /* Bit 23 - CRC check of previous command failed
464 */
465#define RSP1_COM_CRC_ERROR_S 23
466#define RSP1_LOCK_UNLOCK_FAIL_M BITFIELD_MASK(1) /* Bit 24 - Card lock-unlock Cmd Seq error */
467#define RSP1_LOCK_UNLOCK_FAIL_S 24
468#define RSP1_CARD_LOCKED_M BITFIELD_MASK(1) /* Bit 25 - Card locked by the host */
469#define RSP1_CARD_LOCKED_S 25
470#define RSP1_WP_VIOLATION_M BITFIELD_MASK(1) /* Bit 26 - Attempt to program
471 * write-protected blocks
472 */
473#define RSP1_WP_VIOLATION_S 26
474#define RSP1_ERASE_PARAM_M BITFIELD_MASK(1) /* Bit 27 - Invalid erase blocks */
475#define RSP1_ERASE_PARAM_S 27
476#define RSP1_ERASE_SEQ_ERR_M BITFIELD_MASK(1) /* Bit 28 - Erase Cmd seq error */
477#define RSP1_ERASE_SEQ_ERR_S 28
478#define RSP1_BLK_LEN_ERR_M BITFIELD_MASK(1) /* Bit 29 - Block length error */
479#define RSP1_BLK_LEN_ERR_S 29
480#define RSP1_ADDR_ERR_M BITFIELD_MASK(1) /* Bit 30 - Misaligned address */
481#define RSP1_ADDR_ERR_S 30
482#define RSP1_OUT_OF_RANGE_M BITFIELD_MASK(1) /* Bit 31 - Cmd arg was out of range */
483#define RSP1_OUT_OF_RANGE_S 31
484
485
486#define RSP5_DATA_M BITFIELD_MASK(8) /* Bits [0:7] - data */
487#define RSP5_DATA_S 0
488#define RSP5_FLAGS_M BITFIELD_MASK(8) /* Bit [15:8] - Rsp flags */
489#define RSP5_FLAGS_S 8
490#define RSP5_STUFF_M BITFIELD_MASK(16) /* Bits [31:16] - Stuff bits */
491#define RSP5_STUFF_S 16
492
493/* ----------------------------------------------
494 * SDIO Command Response structures for SPI mode
495 * ----------------------------------------------
496 */
497#define SPIRSP4_IO_OCR_M BITFIELD_MASK(16) /* Bits [15:0] - Card's OCR Bits [23:8] */
498#define SPIRSP4_IO_OCR_S 0
499#define SPIRSP4_STUFF_M BITFIELD_MASK(3) /* Bits [18:16] - Stuff bits */
500#define SPIRSP4_STUFF_S 16
501#define SPIRSP4_MEM_PRESENT_M BITFIELD_MASK(1) /* Bit 19 - Memory present */
502#define SPIRSP4_MEM_PRESENT_S 19
503#define SPIRSP4_NUM_FUNCS_M BITFIELD_MASK(3) /* Bits [22:20] - Number of I/O funcs */
504#define SPIRSP4_NUM_FUNCS_S 20
505#define SPIRSP4_CARD_READY_M BITFIELD_MASK(1) /* Bit 23 - SDIO card ready */
506#define SPIRSP4_CARD_READY_S 23
507#define SPIRSP4_IDLE_STATE_M BITFIELD_MASK(1) /* Bit 24 - idle state */
508#define SPIRSP4_IDLE_STATE_S 24
509#define SPIRSP4_ILLEGAL_CMD_M BITFIELD_MASK(1) /* Bit 26 - Illegal Cmd error */
510#define SPIRSP4_ILLEGAL_CMD_S 26
511#define SPIRSP4_COM_CRC_ERROR_M BITFIELD_MASK(1) /* Bit 27 - COM CRC error */
512#define SPIRSP4_COM_CRC_ERROR_S 27
513#define SPIRSP4_FUNC_NUM_ERROR_M BITFIELD_MASK(1) /* Bit 28 - Function number error
514 */
515#define SPIRSP4_FUNC_NUM_ERROR_S 28
516#define SPIRSP4_PARAM_ERROR_M BITFIELD_MASK(1) /* Bit 30 - Parameter Error Bit */
517#define SPIRSP4_PARAM_ERROR_S 30
518#define SPIRSP4_START_BIT_M BITFIELD_MASK(1) /* Bit 31 - Start Bit */
519#define SPIRSP4_START_BIT_S 31
520
521#define SPIRSP5_DATA_M BITFIELD_MASK(8) /* Bits [23:16] - R/W Data */
522#define SPIRSP5_DATA_S 16
523#define SPIRSP5_IDLE_STATE_M BITFIELD_MASK(1) /* Bit 24 - Idle state */
524#define SPIRSP5_IDLE_STATE_S 24
525#define SPIRSP5_ILLEGAL_CMD_M BITFIELD_MASK(1) /* Bit 26 - Illegal Cmd error */
526#define SPIRSP5_ILLEGAL_CMD_S 26
527#define SPIRSP5_COM_CRC_ERROR_M BITFIELD_MASK(1) /* Bit 27 - COM CRC error */
528#define SPIRSP5_COM_CRC_ERROR_S 27
529#define SPIRSP5_FUNC_NUM_ERROR_M BITFIELD_MASK(1) /* Bit 28 - Function number error
530 */
531#define SPIRSP5_FUNC_NUM_ERROR_S 28
532#define SPIRSP5_PARAM_ERROR_M BITFIELD_MASK(1) /* Bit 30 - Parameter Error Bit */
533#define SPIRSP5_PARAM_ERROR_S 30
534#define SPIRSP5_START_BIT_M BITFIELD_MASK(1) /* Bit 31 - Start Bit */
535#define SPIRSP5_START_BIT_S 31
536
537/* RSP6 card status format; Pg 68 Physical Layer spec v 1.10 */
538#define RSP6STAT_AKE_SEQ_ERROR_M BITFIELD_MASK(1) /* Bit 3 - Authentication seq error
539 */
540#define RSP6STAT_AKE_SEQ_ERROR_S 3
541#define RSP6STAT_APP_CMD_M BITFIELD_MASK(1) /* Bit 5 - Card expects ACMD */
542#define RSP6STAT_APP_CMD_S 5
543#define RSP6STAT_READY_FOR_DATA_M BITFIELD_MASK(1) /* Bit 8 - Ready for data
544 * (buff empty)
545 */
546#define RSP6STAT_READY_FOR_DATA_S 8
547#define RSP6STAT_CURR_STATE_M BITFIELD_MASK(4) /* Bits [12:9] - Card state at
548 * Cmd reception
549 */
550#define RSP6STAT_CURR_STATE_S 9
551#define RSP6STAT_ERROR_M BITFIELD_MASK(1) /* Bit 13 - General/Unknown error Bit 19
552 */
553#define RSP6STAT_ERROR_S 13
554#define RSP6STAT_ILLEGAL_CMD_M BITFIELD_MASK(1) /* Bit 14 - Illegal cmd for
555 * card state Bit 22
556 */
557#define RSP6STAT_ILLEGAL_CMD_S 14
558#define RSP6STAT_COM_CRC_ERROR_M BITFIELD_MASK(1) /* Bit 15 - CRC previous command
559 * failed Bit 23
560 */
561#define RSP6STAT_COM_CRC_ERROR_S 15
562
563#define SDIOH_XFER_TYPE_READ SD_IO_OP_READ
564#define SDIOH_XFER_TYPE_WRITE SD_IO_OP_WRITE
565
566#endif /* _SDIO_H */
diff --git a/drivers/net/wireless/bcm4329/include/sdioh.h b/drivers/net/wireless/bcm4329/include/sdioh.h
new file mode 100644
index 00000000000..8123452eac2
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/sdioh.h
@@ -0,0 +1,299 @@
1/*
2 * SDIO Host Controller Spec header file
3 * Register map and definitions for the Standard Host Controller
4 *
5 * Copyright (C) 1999-2010, Broadcom Corporation
6 *
7 * Unless you and Broadcom execute a separate written software license
8 * agreement governing use of this software, this software is licensed to you
9 * under the terms of the GNU General Public License version 2 (the "GPL"),
10 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
11 * following added to such license:
12 *
13 * As a special exception, the copyright holders of this software give you
14 * permission to link this software with independent modules, and to copy and
15 * distribute the resulting executable under terms of your choice, provided that
16 * you also meet, for each linked independent module, the terms and conditions of
17 * the license of that module. An independent module is a module which is not
18 * derived from this software. The special exception does not apply to any
19 * modifications of the software.
20 *
21 * Notwithstanding the above, under no circumstances may you combine this
22 * software in any way with any other Broadcom software provided under a license
23 * other than the GPL, without Broadcom's express prior written consent.
24 *
25 * $Id: sdioh.h,v 13.13.18.1.16.3 2009/12/08 22:34:21 Exp $
26 */
27
28#ifndef _SDIOH_H
29#define _SDIOH_H
30
31#define SD_SysAddr 0x000
32#define SD_BlockSize 0x004
33#define SD_BlockCount 0x006
34#define SD_Arg0 0x008
35#define SD_Arg1 0x00A
36#define SD_TransferMode 0x00C
37#define SD_Command 0x00E
38#define SD_Response0 0x010
39#define SD_Response1 0x012
40#define SD_Response2 0x014
41#define SD_Response3 0x016
42#define SD_Response4 0x018
43#define SD_Response5 0x01A
44#define SD_Response6 0x01C
45#define SD_Response7 0x01E
46#define SD_BufferDataPort0 0x020
47#define SD_BufferDataPort1 0x022
48#define SD_PresentState 0x024
49#define SD_HostCntrl 0x028
50#define SD_PwrCntrl 0x029
51#define SD_BlockGapCntrl 0x02A
52#define SD_WakeupCntrl 0x02B
53#define SD_ClockCntrl 0x02C
54#define SD_TimeoutCntrl 0x02E
55#define SD_SoftwareReset 0x02F
56#define SD_IntrStatus 0x030
57#define SD_ErrorIntrStatus 0x032
58#define SD_IntrStatusEnable 0x034
59#define SD_ErrorIntrStatusEnable 0x036
60#define SD_IntrSignalEnable 0x038
61#define SD_ErrorIntrSignalEnable 0x03A
62#define SD_CMD12ErrorStatus 0x03C
63#define SD_Capabilities 0x040
64#define SD_Capabilities_Reserved 0x044
65#define SD_MaxCurCap 0x048
66#define SD_MaxCurCap_Reserved 0x04C
67#define SD_ADMA_SysAddr 0x58
68#define SD_SlotInterruptStatus 0x0FC
69#define SD_HostControllerVersion 0x0FE
70
71/* SD specific registers in PCI config space */
72#define SD_SlotInfo 0x40
73
74/* SD_Capabilities reg (0x040) */
75#define CAP_TO_CLKFREQ_M BITFIELD_MASK(6)
76#define CAP_TO_CLKFREQ_S 0
77#define CAP_TO_CLKUNIT_M BITFIELD_MASK(1)
78#define CAP_TO_CLKUNIT_S 7
79#define CAP_BASECLK_M BITFIELD_MASK(6)
80#define CAP_BASECLK_S 8
81#define CAP_MAXBLOCK_M BITFIELD_MASK(2)
82#define CAP_MAXBLOCK_S 16
83#define CAP_ADMA2_M BITFIELD_MASK(1)
84#define CAP_ADMA2_S 19
85#define CAP_ADMA1_M BITFIELD_MASK(1)
86#define CAP_ADMA1_S 20
87#define CAP_HIGHSPEED_M BITFIELD_MASK(1)
88#define CAP_HIGHSPEED_S 21
89#define CAP_DMA_M BITFIELD_MASK(1)
90#define CAP_DMA_S 22
91#define CAP_SUSPEND_M BITFIELD_MASK(1)
92#define CAP_SUSPEND_S 23
93#define CAP_VOLT_3_3_M BITFIELD_MASK(1)
94#define CAP_VOLT_3_3_S 24
95#define CAP_VOLT_3_0_M BITFIELD_MASK(1)
96#define CAP_VOLT_3_0_S 25
97#define CAP_VOLT_1_8_M BITFIELD_MASK(1)
98#define CAP_VOLT_1_8_S 26
99#define CAP_64BIT_HOST_M BITFIELD_MASK(1)
100#define CAP_64BIT_HOST_S 28
101
102/* SD_MaxCurCap reg (0x048) */
103#define CAP_CURR_3_3_M BITFIELD_MASK(8)
104#define CAP_CURR_3_3_S 0
105#define CAP_CURR_3_0_M BITFIELD_MASK(8)
106#define CAP_CURR_3_0_S 8
107#define CAP_CURR_1_8_M BITFIELD_MASK(8)
108#define CAP_CURR_1_8_S 16
109
110/* SD_SysAddr: Offset 0x0000, Size 4 bytes */
111
112/* SD_BlockSize: Offset 0x004, Size 2 bytes */
113#define BLKSZ_BLKSZ_M BITFIELD_MASK(12)
114#define BLKSZ_BLKSZ_S 0
115#define BLKSZ_BNDRY_M BITFIELD_MASK(3)
116#define BLKSZ_BNDRY_S 12
117
118/* SD_BlockCount: Offset 0x006, size 2 bytes */
119
120/* SD_Arg0: Offset 0x008, size = 4 bytes */
121/* SD_TransferMode Offset 0x00C, size = 2 bytes */
122#define XFER_DMA_ENABLE_M BITFIELD_MASK(1)
123#define XFER_DMA_ENABLE_S 0
124#define XFER_BLK_COUNT_EN_M BITFIELD_MASK(1)
125#define XFER_BLK_COUNT_EN_S 1
126#define XFER_CMD_12_EN_M BITFIELD_MASK(1)
127#define XFER_CMD_12_EN_S 2
128#define XFER_DATA_DIRECTION_M BITFIELD_MASK(1)
129#define XFER_DATA_DIRECTION_S 4
130#define XFER_MULTI_BLOCK_M BITFIELD_MASK(1)
131#define XFER_MULTI_BLOCK_S 5
132
133/* SD_Command: Offset 0x00E, size = 2 bytes */
134/* resp_type field */
135#define RESP_TYPE_NONE 0
136#define RESP_TYPE_136 1
137#define RESP_TYPE_48 2
138#define RESP_TYPE_48_BUSY 3
139/* type field */
140#define CMD_TYPE_NORMAL 0
141#define CMD_TYPE_SUSPEND 1
142#define CMD_TYPE_RESUME 2
143#define CMD_TYPE_ABORT 3
144
145#define CMD_RESP_TYPE_M BITFIELD_MASK(2) /* Bits [0-1] - Response type */
146#define CMD_RESP_TYPE_S 0
147#define CMD_CRC_EN_M BITFIELD_MASK(1) /* Bit 3 - CRC enable */
148#define CMD_CRC_EN_S 3
149#define CMD_INDEX_EN_M BITFIELD_MASK(1) /* Bit 4 - Enable index checking */
150#define CMD_INDEX_EN_S 4
151#define CMD_DATA_EN_M BITFIELD_MASK(1) /* Bit 5 - Using DAT line */
152#define CMD_DATA_EN_S 5
153#define CMD_TYPE_M BITFIELD_MASK(2) /* Bit [6-7] - Normal, abort, resume, etc
154 */
155#define CMD_TYPE_S 6
156#define CMD_INDEX_M BITFIELD_MASK(6) /* Bits [8-13] - Command number */
157#define CMD_INDEX_S 8
158
159/* SD_BufferDataPort0 : Offset 0x020, size = 2 or 4 bytes */
160/* SD_BufferDataPort1 : Offset 0x022, size = 2 bytes */
161/* SD_PresentState : Offset 0x024, size = 4 bytes */
162#define PRES_CMD_INHIBIT_M BITFIELD_MASK(1) /* Bit 0 May use CMD */
163#define PRES_CMD_INHIBIT_S 0
164#define PRES_DAT_INHIBIT_M BITFIELD_MASK(1) /* Bit 1 May use DAT */
165#define PRES_DAT_INHIBIT_S 1
166#define PRES_DAT_BUSY_M BITFIELD_MASK(1) /* Bit 2 DAT is busy */
167#define PRES_DAT_BUSY_S 2
168#define PRES_PRESENT_RSVD_M BITFIELD_MASK(5) /* Bit [3-7] rsvd */
169#define PRES_PRESENT_RSVD_S 3
170#define PRES_WRITE_ACTIVE_M BITFIELD_MASK(1) /* Bit 8 Write is active */
171#define PRES_WRITE_ACTIVE_S 8
172#define PRES_READ_ACTIVE_M BITFIELD_MASK(1) /* Bit 9 Read is active */
173#define PRES_READ_ACTIVE_S 9
174#define PRES_WRITE_DATA_RDY_M BITFIELD_MASK(1) /* Bit 10 Write buf is avail */
175#define PRES_WRITE_DATA_RDY_S 10
176#define PRES_READ_DATA_RDY_M BITFIELD_MASK(1) /* Bit 11 Read buf data avail */
177#define PRES_READ_DATA_RDY_S 11
178#define PRES_CARD_PRESENT_M BITFIELD_MASK(1) /* Bit 16 Card present - debounced */
179#define PRES_CARD_PRESENT_S 16
180#define PRES_CARD_STABLE_M BITFIELD_MASK(1) /* Bit 17 Debugging */
181#define PRES_CARD_STABLE_S 17
182#define PRES_CARD_PRESENT_RAW_M BITFIELD_MASK(1) /* Bit 18 Not debounced */
183#define PRES_CARD_PRESENT_RAW_S 18
184#define PRES_WRITE_ENABLED_M BITFIELD_MASK(1) /* Bit 19 Write protected? */
185#define PRES_WRITE_ENABLED_S 19
186#define PRES_DAT_SIGNAL_M BITFIELD_MASK(4) /* Bit [20-23] Debugging */
187#define PRES_DAT_SIGNAL_S 20
188#define PRES_CMD_SIGNAL_M BITFIELD_MASK(1) /* Bit 24 Debugging */
189#define PRES_CMD_SIGNAL_S 24
190
191/* SD_HostCntrl: Offset 0x028, size = 1 bytes */
192#define HOST_LED_M BITFIELD_MASK(1) /* Bit 0 LED On/Off */
193#define HOST_LED_S 0
194#define HOST_DATA_WIDTH_M BITFIELD_MASK(1) /* Bit 1 4 bit enable */
195#define HOST_DATA_WIDTH_S 1
196#define HOST_HI_SPEED_EN_M BITFIELD_MASK(1) /* Bit 2 High speed vs low speed */
197#define HOST_DMA_SEL_S 3
198#define HOST_DMA_SEL_M BITFIELD_MASK(2) /* Bit 4:3 DMA Select */
199#define HOST_HI_SPEED_EN_S 2
200
201/* misc defines */
202#define SD1_MODE 0x1 /* SD Host Cntrlr Spec */
203#define SD4_MODE 0x2 /* SD Host Cntrlr Spec */
204
205/* SD_PwrCntrl: Offset 0x029, size = 1 bytes */
206#define PWR_BUS_EN_M BITFIELD_MASK(1) /* Bit 0 Power the bus */
207#define PWR_BUS_EN_S 0
208#define PWR_VOLTS_M BITFIELD_MASK(3) /* Bit [1-3] Voltage Select */
209#define PWR_VOLTS_S 1
210
211/* SD_SoftwareReset: Offset 0x02F, size = 1 byte */
212#define SW_RESET_ALL_M BITFIELD_MASK(1) /* Bit 0 Reset All */
213#define SW_RESET_ALL_S 0
214#define SW_RESET_CMD_M BITFIELD_MASK(1) /* Bit 1 CMD Line Reset */
215#define SW_RESET_CMD_S 1
216#define SW_RESET_DAT_M BITFIELD_MASK(1) /* Bit 2 DAT Line Reset */
217#define SW_RESET_DAT_S 2
218
219/* SD_IntrStatus: Offset 0x030, size = 2 bytes */
220/* Defs also serve SD_IntrStatusEnable and SD_IntrSignalEnable */
221#define INTSTAT_CMD_COMPLETE_M BITFIELD_MASK(1) /* Bit 0 */
222#define INTSTAT_CMD_COMPLETE_S 0
223#define INTSTAT_XFER_COMPLETE_M BITFIELD_MASK(1)
224#define INTSTAT_XFER_COMPLETE_S 1
225#define INTSTAT_BLOCK_GAP_EVENT_M BITFIELD_MASK(1)
226#define INTSTAT_BLOCK_GAP_EVENT_S 2
227#define INTSTAT_DMA_INT_M BITFIELD_MASK(1)
228#define INTSTAT_DMA_INT_S 3
229#define INTSTAT_BUF_WRITE_READY_M BITFIELD_MASK(1)
230#define INTSTAT_BUF_WRITE_READY_S 4
231#define INTSTAT_BUF_READ_READY_M BITFIELD_MASK(1)
232#define INTSTAT_BUF_READ_READY_S 5
233#define INTSTAT_CARD_INSERTION_M BITFIELD_MASK(1)
234#define INTSTAT_CARD_INSERTION_S 6
235#define INTSTAT_CARD_REMOVAL_M BITFIELD_MASK(1)
236#define INTSTAT_CARD_REMOVAL_S 7
237#define INTSTAT_CARD_INT_M BITFIELD_MASK(1)
238#define INTSTAT_CARD_INT_S 8
239#define INTSTAT_ERROR_INT_M BITFIELD_MASK(1) /* Bit 15 */
240#define INTSTAT_ERROR_INT_S 15
241
242/* SD_ErrorIntrStatus: Offset 0x032, size = 2 bytes */
243/* Defs also serve SD_ErrorIntrStatusEnable and SD_ErrorIntrSignalEnable */
244#define ERRINT_CMD_TIMEOUT_M BITFIELD_MASK(1)
245#define ERRINT_CMD_TIMEOUT_S 0
246#define ERRINT_CMD_CRC_M BITFIELD_MASK(1)
247#define ERRINT_CMD_CRC_S 1
248#define ERRINT_CMD_ENDBIT_M BITFIELD_MASK(1)
249#define ERRINT_CMD_ENDBIT_S 2
250#define ERRINT_CMD_INDEX_M BITFIELD_MASK(1)
251#define ERRINT_CMD_INDEX_S 3
252#define ERRINT_DATA_TIMEOUT_M BITFIELD_MASK(1)
253#define ERRINT_DATA_TIMEOUT_S 4
254#define ERRINT_DATA_CRC_M BITFIELD_MASK(1)
255#define ERRINT_DATA_CRC_S 5
256#define ERRINT_DATA_ENDBIT_M BITFIELD_MASK(1)
257#define ERRINT_DATA_ENDBIT_S 6
258#define ERRINT_CURRENT_LIMIT_M BITFIELD_MASK(1)
259#define ERRINT_CURRENT_LIMIT_S 7
260#define ERRINT_AUTO_CMD12_M BITFIELD_MASK(1)
261#define ERRINT_AUTO_CMD12_S 8
262#define ERRINT_VENDOR_M BITFIELD_MASK(4)
263#define ERRINT_VENDOR_S 12
264
265/* Also provide definitions in "normal" form to allow combined masks */
266#define ERRINT_CMD_TIMEOUT_BIT 0x0001
267#define ERRINT_CMD_CRC_BIT 0x0002
268#define ERRINT_CMD_ENDBIT_BIT 0x0004
269#define ERRINT_CMD_INDEX_BIT 0x0008
270#define ERRINT_DATA_TIMEOUT_BIT 0x0010
271#define ERRINT_DATA_CRC_BIT 0x0020
272#define ERRINT_DATA_ENDBIT_BIT 0x0040
273#define ERRINT_CURRENT_LIMIT_BIT 0x0080
274#define ERRINT_AUTO_CMD12_BIT 0x0100
275
276/* Masks to select CMD vs. DATA errors */
277#define ERRINT_CMD_ERRS (ERRINT_CMD_TIMEOUT_BIT | ERRINT_CMD_CRC_BIT |\
278 ERRINT_CMD_ENDBIT_BIT | ERRINT_CMD_INDEX_BIT)
279#define ERRINT_DATA_ERRS (ERRINT_DATA_TIMEOUT_BIT | ERRINT_DATA_CRC_BIT |\
280 ERRINT_DATA_ENDBIT_BIT)
281#define ERRINT_TRANSFER_ERRS (ERRINT_CMD_ERRS | ERRINT_DATA_ERRS)
282
283/* SD_WakeupCntr_BlockGapCntrl : Offset 0x02A , size = bytes */
284/* SD_ClockCntrl : Offset 0x02C , size = bytes */
285/* SD_SoftwareReset_TimeoutCntrl : Offset 0x02E , size = bytes */
286/* SD_IntrStatus : Offset 0x030 , size = bytes */
287/* SD_ErrorIntrStatus : Offset 0x032 , size = bytes */
288/* SD_IntrStatusEnable : Offset 0x034 , size = bytes */
289/* SD_ErrorIntrStatusEnable : Offset 0x036 , size = bytes */
290/* SD_IntrSignalEnable : Offset 0x038 , size = bytes */
291/* SD_ErrorIntrSignalEnable : Offset 0x03A , size = bytes */
292/* SD_CMD12ErrorStatus : Offset 0x03C , size = bytes */
293/* SD_Capabilities : Offset 0x040 , size = bytes */
294/* SD_MaxCurCap : Offset 0x048 , size = bytes */
295/* SD_MaxCurCap_Reserved: Offset 0x04C , size = bytes */
296/* SD_SlotInterruptStatus: Offset 0x0FC , size = bytes */
297/* SD_HostControllerVersion : Offset 0x0FE , size = bytes */
298
299#endif /* _SDIOH_H */
diff --git a/drivers/net/wireless/bcm4329/include/sdiovar.h b/drivers/net/wireless/bcm4329/include/sdiovar.h
new file mode 100644
index 00000000000..0179d4cb96d
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/sdiovar.h
@@ -0,0 +1,58 @@
1/*
2 * Structure used by apps whose drivers access SDIO drivers.
3 * Pulled out separately so dhdu and wlu can both use it.
4 *
5 * Copyright (C) 1999-2010, Broadcom Corporation
6 *
7 * Unless you and Broadcom execute a separate written software license
8 * agreement governing use of this software, this software is licensed to you
9 * under the terms of the GNU General Public License version 2 (the "GPL"),
10 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
11 * following added to such license:
12 *
13 * As a special exception, the copyright holders of this software give you
14 * permission to link this software with independent modules, and to copy and
15 * distribute the resulting executable under terms of your choice, provided that
16 * you also meet, for each linked independent module, the terms and conditions of
17 * the license of that module. An independent module is a module which is not
18 * derived from this software. The special exception does not apply to any
19 * modifications of the software.
20 *
21 * Notwithstanding the above, under no circumstances may you combine this
22 * software in any way with any other Broadcom software provided under a license
23 * other than the GPL, without Broadcom's express prior written consent.
24 *
25 * $Id: sdiovar.h,v 13.5.14.2.16.2 2009/12/08 22:34:21 Exp $
26 */
27
28#ifndef _sdiovar_h_
29#define _sdiovar_h_
30
31#include <typedefs.h>
32
33/* require default structure packing */
34#define BWL_DEFAULT_PACKING
35#include <packed_section_start.h>
36
37typedef struct sdreg {
38 int func;
39 int offset;
40 int value;
41} sdreg_t;
42
43/* Common msglevel constants */
44#define SDH_ERROR_VAL 0x0001 /* Error */
45#define SDH_TRACE_VAL 0x0002 /* Trace */
46#define SDH_INFO_VAL 0x0004 /* Info */
47#define SDH_DEBUG_VAL 0x0008 /* Debug */
48#define SDH_DATA_VAL 0x0010 /* Data */
49#define SDH_CTRL_VAL 0x0020 /* Control Regs */
50#define SDH_LOG_VAL 0x0040 /* Enable bcmlog */
51#define SDH_DMA_VAL 0x0080 /* DMA */
52
53#define NUM_PREV_TRANSACTIONS 16
54
55
56#include <packed_section_end.h>
57
58#endif /* _sdiovar_h_ */
diff --git a/drivers/net/wireless/bcm4329/include/siutils.h b/drivers/net/wireless/bcm4329/include/siutils.h
new file mode 100644
index 00000000000..cb9f1407b73
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/siutils.h
@@ -0,0 +1,235 @@
1/*
2 * Misc utility routines for accessing the SOC Interconnects
3 * of Broadcom HNBU chips.
4 *
5 * Copyright (C) 1999-2010, Broadcom Corporation
6 *
7 * Unless you and Broadcom execute a separate written software license
8 * agreement governing use of this software, this software is licensed to you
9 * under the terms of the GNU General Public License version 2 (the "GPL"),
10 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
11 * following added to such license:
12 *
13 * As a special exception, the copyright holders of this software give you
14 * permission to link this software with independent modules, and to copy and
15 * distribute the resulting executable under terms of your choice, provided that
16 * you also meet, for each linked independent module, the terms and conditions of
17 * the license of that module. An independent module is a module which is not
18 * derived from this software. The special exception does not apply to any
19 * modifications of the software.
20 *
21 * Notwithstanding the above, under no circumstances may you combine this
22 * software in any way with any other Broadcom software provided under a license
23 * other than the GPL, without Broadcom's express prior written consent.
24 *
25 * $Id: siutils.h,v 13.197.4.2.4.3.8.16 2010/06/23 21:36:05 Exp $
26 */
27
28
29#ifndef _siutils_h_
30#define _siutils_h_
31
32
33struct si_pub {
34 uint socitype;
35
36 uint bustype;
37 uint buscoretype;
38 uint buscorerev;
39 uint buscoreidx;
40 int ccrev;
41 uint32 cccaps;
42 int pmurev;
43 uint32 pmucaps;
44 uint boardtype;
45 uint boardvendor;
46 uint boardflags;
47 uint chip;
48 uint chiprev;
49 uint chippkg;
50 uint32 chipst;
51 bool issim;
52 uint socirev;
53 bool pci_pr32414;
54};
55
56#if defined(WLC_HIGH) && !defined(WLC_LOW)
57typedef struct si_pub si_t;
58#else
59typedef const struct si_pub si_t;
60#endif
61
62
63#define SI_OSH NULL
64
65
66#define XTAL 0x1
67#define PLL 0x2
68
69
70#define CLK_FAST 0
71#define CLK_DYNAMIC 2
72
73
74#define GPIO_DRV_PRIORITY 0
75#define GPIO_APP_PRIORITY 1
76#define GPIO_HI_PRIORITY 2
77
78
79#define GPIO_PULLUP 0
80#define GPIO_PULLDN 1
81
82
83#define GPIO_REGEVT 0
84#define GPIO_REGEVT_INTMSK 1
85#define GPIO_REGEVT_INTPOL 2
86
87
88#define SI_DEVPATH_BUFSZ 16
89
90
91#define SI_DOATTACH 1
92#define SI_PCIDOWN 2
93#define SI_PCIUP 3
94
95#define ISSIM_ENAB(sih) 0
96
97
98#if defined(BCMPMUCTL)
99#define PMUCTL_ENAB(sih) (BCMPMUCTL)
100#else
101#define PMUCTL_ENAB(sih) ((sih)->cccaps & CC_CAP_PMU)
102#endif
103
104
105#if defined(BCMPMUCTL) && BCMPMUCTL
106#define CCCTL_ENAB(sih) (0)
107#define CCPLL_ENAB(sih) (0)
108#else
109#define CCCTL_ENAB(sih) ((sih)->cccaps & CC_CAP_PWR_CTL)
110#define CCPLL_ENAB(sih) ((sih)->cccaps & CC_CAP_PLL_MASK)
111#endif
112
113typedef void (*gpio_handler_t)(uint32 stat, void *arg);
114
115
116
117extern si_t *si_attach(uint pcidev, osl_t *osh, void *regs, uint bustype,
118 void *sdh, char **vars, uint *varsz);
119extern si_t *si_kattach(osl_t *osh);
120extern void si_detach(si_t *sih);
121extern bool si_pci_war16165(si_t *sih);
122
123extern uint si_corelist(si_t *sih, uint coreid[]);
124extern uint si_coreid(si_t *sih);
125extern uint si_flag(si_t *sih);
126extern uint si_intflag(si_t *sih);
127extern uint si_coreidx(si_t *sih);
128extern uint si_coreunit(si_t *sih);
129extern uint si_corevendor(si_t *sih);
130extern uint si_corerev(si_t *sih);
131extern void *si_osh(si_t *sih);
132extern void si_setosh(si_t *sih, osl_t *osh);
133extern uint si_corereg(si_t *sih, uint coreidx, uint regoff, uint mask, uint val);
134extern void *si_coreregs(si_t *sih);
135extern void si_write_wrapperreg(si_t *sih, uint32 offset, uint32 val);
136extern uint32 si_core_cflags(si_t *sih, uint32 mask, uint32 val);
137extern void si_core_cflags_wo(si_t *sih, uint32 mask, uint32 val);
138extern uint32 si_core_sflags(si_t *sih, uint32 mask, uint32 val);
139extern bool si_iscoreup(si_t *sih);
140extern uint si_findcoreidx(si_t *sih, uint coreid, uint coreunit);
141extern void *si_setcoreidx(si_t *sih, uint coreidx);
142extern void *si_setcore(si_t *sih, uint coreid, uint coreunit);
143extern void *si_switch_core(si_t *sih, uint coreid, uint *origidx, uint *intr_val);
144extern void si_restore_core(si_t *sih, uint coreid, uint intr_val);
145extern int si_numaddrspaces(si_t *sih);
146extern uint32 si_addrspace(si_t *sih, uint asidx);
147extern uint32 si_addrspacesize(si_t *sih, uint asidx);
148extern int si_corebist(si_t *sih);
149extern void si_core_reset(si_t *sih, uint32 bits, uint32 resetbits);
150extern void si_core_tofixup(si_t *sih);
151extern void si_core_disable(si_t *sih, uint32 bits);
152extern uint32 si_clock_rate(uint32 pll_type, uint32 n, uint32 m);
153extern uint32 si_clock(si_t *sih);
154extern void si_clock_pmu_spuravoid(si_t *sih, bool spuravoid);
155extern uint32 si_alp_clock(si_t *sih);
156extern uint32 si_ilp_clock(si_t *sih);
157extern void si_pci_setup(si_t *sih, uint coremask);
158extern void si_pcmcia_init(si_t *sih);
159extern void si_setint(si_t *sih, int siflag);
160extern bool si_backplane64(si_t *sih);
161extern void si_register_intr_callback(si_t *sih, void *intrsoff_fn, void *intrsrestore_fn,
162 void *intrsenabled_fn, void *intr_arg);
163extern void si_deregister_intr_callback(si_t *sih);
164extern void si_clkctl_init(si_t *sih);
165extern uint16 si_clkctl_fast_pwrup_delay(si_t *sih);
166extern bool si_clkctl_cc(si_t *sih, uint mode);
167extern int si_clkctl_xtal(si_t *sih, uint what, bool on);
168extern uint32 si_gpiotimerval(si_t *sih, uint32 mask, uint32 val);
169extern bool si_backplane64(si_t *sih);
170extern void si_btcgpiowar(si_t *sih);
171extern bool si_deviceremoved(si_t *sih);
172extern uint32 si_socram_size(si_t *sih);
173
174extern void si_watchdog(si_t *sih, uint ticks);
175extern void si_watchdog_ms(si_t *sih, uint32 ms);
176extern void *si_gpiosetcore(si_t *sih);
177extern uint32 si_gpiocontrol(si_t *sih, uint32 mask, uint32 val, uint8 priority);
178extern uint32 si_gpioouten(si_t *sih, uint32 mask, uint32 val, uint8 priority);
179extern uint32 si_gpioout(si_t *sih, uint32 mask, uint32 val, uint8 priority);
180extern uint32 si_gpioin(si_t *sih);
181extern uint32 si_gpiointpolarity(si_t *sih, uint32 mask, uint32 val, uint8 priority);
182extern uint32 si_gpiointmask(si_t *sih, uint32 mask, uint32 val, uint8 priority);
183extern uint32 si_gpioled(si_t *sih, uint32 mask, uint32 val);
184extern uint32 si_gpioreserve(si_t *sih, uint32 gpio_num, uint8 priority);
185extern uint32 si_gpiorelease(si_t *sih, uint32 gpio_num, uint8 priority);
186extern uint32 si_gpiopull(si_t *sih, bool updown, uint32 mask, uint32 val);
187extern uint32 si_gpioevent(si_t *sih, uint regtype, uint32 mask, uint32 val);
188extern uint32 si_gpio_int_enable(si_t *sih, bool enable);
189
190
191extern void *si_gpio_handler_register(si_t *sih, uint32 e, bool lev, gpio_handler_t cb, void *arg);
192extern void si_gpio_handler_unregister(si_t *sih, void* gpioh);
193extern void si_gpio_handler_process(si_t *sih);
194
195
196extern bool si_pci_pmecap(si_t *sih);
197struct osl_info;
198extern bool si_pci_fastpmecap(struct osl_info *osh);
199extern bool si_pci_pmeclr(si_t *sih);
200extern void si_pci_pmeen(si_t *sih);
201extern uint si_pcie_readreg(void *sih, uint addrtype, uint offset);
202
203extern void si_sdio_init(si_t *sih);
204
205extern uint16 si_d11_devid(si_t *sih);
206extern int si_corepciid(si_t *sih, uint func, uint16 *pcivendor, uint16 *pcidevice,
207 uint8 *pciclass, uint8 *pcisubclass, uint8 *pciprogif, uint8 *pciheader);
208
209#define si_eci_init(sih) (0)
210#define si_eci_notify_bt(sih, type, val, interrupt) (0)
211
212
213
214extern int si_devpath(si_t *sih, char *path, int size);
215
216extern char *si_getdevpathvar(si_t *sih, const char *name);
217extern int si_getdevpathintvar(si_t *sih, const char *name);
218
219
220extern uint8 si_pcieclkreq(si_t *sih, uint32 mask, uint32 val);
221extern void si_war42780_clkreq(si_t *sih, bool clkreq);
222extern void si_pci_sleep(si_t *sih);
223extern void si_pci_down(si_t *sih);
224extern void si_pci_up(si_t *sih);
225extern void si_pcie_war_ovr_disable(si_t *sih);
226extern void si_pcie_extendL1timer(si_t *sih, bool extend);
227extern int si_pci_fixcfg(si_t *sih);
228
229
230
231
232
233
234
235#endif
diff --git a/drivers/net/wireless/bcm4329/include/spid.h b/drivers/net/wireless/bcm4329/include/spid.h
new file mode 100644
index 00000000000..c740296de9a
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/spid.h
@@ -0,0 +1,153 @@
1/*
2 * SPI device spec header file
3 *
4 * Copyright (C) 2010, Broadcom Corporation
5 * All Rights Reserved.
6 *
7 * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation;
8 * the contents of this file may not be disclosed to third parties, copied
9 * or duplicated in any form, in whole or in part, without the prior
10 * written permission of Broadcom Corporation.
11 *
12 * $Id: spid.h,v 1.7.10.1.16.3 2009/04/09 19:23:14 Exp $
13 */
14
15#ifndef _SPI_H
16#define _SPI_H
17
18/*
19 * Brcm SPI Device Register Map.
20 *
21 */
22
23typedef volatile struct {
24 uint8 config; /* 0x00, len, endian, clock, speed, polarity, wakeup */
25 uint8 response_delay; /* 0x01, read response delay in bytes (corerev < 3) */
26 uint8 status_enable; /* 0x02, status-enable, intr with status, response_delay
27 * function selection, command/data error check
28 */
29 uint8 reset_bp; /* 0x03, reset on wlan/bt backplane reset (corerev >= 1) */
30 uint16 intr_reg; /* 0x04, Intr status register */
31 uint16 intr_en_reg; /* 0x06, Intr mask register */
32 uint32 status_reg; /* 0x08, RO, Status bits of last spi transfer */
33 uint16 f1_info_reg; /* 0x0c, RO, enabled, ready for data transfer, blocksize */
34 uint16 f2_info_reg; /* 0x0e, RO, enabled, ready for data transfer, blocksize */
35 uint16 f3_info_reg; /* 0x10, RO, enabled, ready for data transfer, blocksize */
36 uint32 test_read; /* 0x14, RO 0xfeedbead signature */
37 uint32 test_rw; /* 0x18, RW */
38 uint8 resp_delay_f0; /* 0x1c, read resp delay bytes for F0 (corerev >= 3) */
39 uint8 resp_delay_f1; /* 0x1d, read resp delay bytes for F1 (corerev >= 3) */
40 uint8 resp_delay_f2; /* 0x1e, read resp delay bytes for F2 (corerev >= 3) */
41 uint8 resp_delay_f3; /* 0x1f, read resp delay bytes for F3 (corerev >= 3) */
42} spi_regs_t;
43
44/* SPI device register offsets */
45#define SPID_CONFIG 0x00
46#define SPID_RESPONSE_DELAY 0x01
47#define SPID_STATUS_ENABLE 0x02
48#define SPID_RESET_BP 0x03 /* (corerev >= 1) */
49#define SPID_INTR_REG 0x04 /* 16 bits - Interrupt status */
50#define SPID_INTR_EN_REG 0x06 /* 16 bits - Interrupt mask */
51#define SPID_STATUS_REG 0x08 /* 32 bits */
52#define SPID_F1_INFO_REG 0x0C /* 16 bits */
53#define SPID_F2_INFO_REG 0x0E /* 16 bits */
54#define SPID_F3_INFO_REG 0x10 /* 16 bits */
55#define SPID_TEST_READ 0x14 /* 32 bits */
56#define SPID_TEST_RW 0x18 /* 32 bits */
57#define SPID_RESP_DELAY_F0 0x1c /* 8 bits (corerev >= 3) */
58#define SPID_RESP_DELAY_F1 0x1d /* 8 bits (corerev >= 3) */
59#define SPID_RESP_DELAY_F2 0x1e /* 8 bits (corerev >= 3) */
60#define SPID_RESP_DELAY_F3 0x1f /* 8 bits (corerev >= 3) */
61
62/* Bit masks for SPID_CONFIG device register */
63#define WORD_LENGTH_32 0x1 /* 0/1 16/32 bit word length */
64#define ENDIAN_BIG 0x2 /* 0/1 Little/Big Endian */
65#define CLOCK_PHASE 0x4 /* 0/1 clock phase delay */
66#define CLOCK_POLARITY 0x8 /* 0/1 Idle state clock polarity is low/high */
67#define HIGH_SPEED_MODE 0x10 /* 1/0 High Speed mode / Normal mode */
68#define INTR_POLARITY 0x20 /* 1/0 Interrupt active polarity is high/low */
69#define WAKE_UP 0x80 /* 0/1 Wake-up command from Host to WLAN */
70
71/* Bit mask for SPID_RESPONSE_DELAY device register */
72#define RESPONSE_DELAY_MASK 0xFF /* Configurable rd response delay in multiples of 8 bits */
73
74/* Bit mask for SPID_STATUS_ENABLE device register */
75#define STATUS_ENABLE 0x1 /* 1/0 Status sent/not sent to host after read/write */
76#define INTR_WITH_STATUS 0x2 /* 0/1 Do-not / do-interrupt if status is sent */
77#define RESP_DELAY_ALL 0x4 /* Applicability of resp delay to F1 or all func's read */
78#define DWORD_PKT_LEN_EN 0x8 /* Packet len denoted in dwords instead of bytes */
79#define CMD_ERR_CHK_EN 0x20 /* Command error check enable */
80#define DATA_ERR_CHK_EN 0x40 /* Data error check enable */
81
82/* Bit mask for SPID_RESET_BP device register */
83#define RESET_ON_WLAN_BP_RESET 0x4 /* enable reset for WLAN backplane */
84#define RESET_ON_BT_BP_RESET 0x8 /* enable reset for BT backplane */
85#define RESET_SPI 0x80 /* reset the above enabled logic */
86
87/* Bit mask for SPID_INTR_REG device register */
88#define DATA_UNAVAILABLE 0x0001 /* Requested data not available; Clear by writing a "1" */
89#define F2_F3_FIFO_RD_UNDERFLOW 0x0002
90#define F2_F3_FIFO_WR_OVERFLOW 0x0004
91#define COMMAND_ERROR 0x0008 /* Cleared by writing 1 */
92#define DATA_ERROR 0x0010 /* Cleared by writing 1 */
93#define F2_PACKET_AVAILABLE 0x0020
94#define F3_PACKET_AVAILABLE 0x0040
95#define F1_OVERFLOW 0x0080 /* Due to last write. Bkplane has pending write requests */
96#define MISC_INTR0 0x0100
97#define MISC_INTR1 0x0200
98#define MISC_INTR2 0x0400
99#define MISC_INTR3 0x0800
100#define MISC_INTR4 0x1000
101#define F1_INTR 0x2000
102#define F2_INTR 0x4000
103#define F3_INTR 0x8000
104
105/* Bit mask for 32bit SPID_STATUS_REG device register */
106#define STATUS_DATA_NOT_AVAILABLE 0x00000001
107#define STATUS_UNDERFLOW 0x00000002
108#define STATUS_OVERFLOW 0x00000004
109#define STATUS_F2_INTR 0x00000008
110#define STATUS_F3_INTR 0x00000010
111#define STATUS_F2_RX_READY 0x00000020
112#define STATUS_F3_RX_READY 0x00000040
113#define STATUS_HOST_CMD_DATA_ERR 0x00000080
114#define STATUS_F2_PKT_AVAILABLE 0x00000100
115#define STATUS_F2_PKT_LEN_MASK 0x000FFE00
116#define STATUS_F2_PKT_LEN_SHIFT 9
117#define STATUS_F3_PKT_AVAILABLE 0x00100000
118#define STATUS_F3_PKT_LEN_MASK 0xFFE00000
119#define STATUS_F3_PKT_LEN_SHIFT 21
120
121/* Bit mask for 16 bits SPID_F1_INFO_REG device register */
122#define F1_ENABLED 0x0001
123#define F1_RDY_FOR_DATA_TRANSFER 0x0002
124#define F1_MAX_PKT_SIZE 0x01FC
125
126/* Bit mask for 16 bits SPID_F2_INFO_REG device register */
127#define F2_ENABLED 0x0001
128#define F2_RDY_FOR_DATA_TRANSFER 0x0002
129#define F2_MAX_PKT_SIZE 0x3FFC
130
131/* Bit mask for 16 bits SPID_F3_INFO_REG device register */
132#define F3_ENABLED 0x0001
133#define F3_RDY_FOR_DATA_TRANSFER 0x0002
134#define F3_MAX_PKT_SIZE 0x3FFC
135
136/* Bit mask for 32 bits SPID_TEST_READ device register read in 16bit LE mode */
137#define TEST_RO_DATA_32BIT_LE 0xFEEDBEAD
138
139/* Maximum number of I/O funcs */
140#define SPI_MAX_IOFUNCS 4
141
142#define SPI_MAX_PKT_LEN (2048*4)
143
144/* Misc defines */
145#define SPI_FUNC_0 0
146#define SPI_FUNC_1 1
147#define SPI_FUNC_2 2
148#define SPI_FUNC_3 3
149
150#define WAIT_F2RXFIFORDY 100
151#define WAIT_F2RXFIFORDY_DELAY 20
152
153#endif /* _SPI_H */
diff --git a/drivers/net/wireless/bcm4329/include/trxhdr.h b/drivers/net/wireless/bcm4329/include/trxhdr.h
new file mode 100644
index 00000000000..8f5eed9410e
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/trxhdr.h
@@ -0,0 +1,46 @@
1/*
2 * TRX image file header format.
3 *
4 * Copyright (C) 1999-2010, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 * $Id: trxhdr.h,v 13.11.310.1 2008/08/17 12:58:58 Exp $
25 */
26
27#include <typedefs.h>
28
29#define TRX_MAGIC 0x30524448 /* "HDR0" */
30#define TRX_VERSION 1 /* Version 1 */
31#define TRX_MAX_LEN 0x3A0000 /* Max length */
32#define TRX_NO_HEADER 1 /* Do not write TRX header */
33#define TRX_GZ_FILES 0x2 /* Contains up to TRX_MAX_OFFSET individual gzip files */
34#define TRX_MAX_OFFSET 3 /* Max number of individual files */
35#define TRX_UNCOMP_IMAGE 0x20 /* Trx contains uncompressed rtecdc.bin image */
36
37struct trx_header {
38 uint32 magic; /* "HDR0" */
39 uint32 len; /* Length of file including header */
40 uint32 crc32; /* 32-bit CRC from flag_version to end of file */
41 uint32 flag_version; /* 0:15 flags, 16:31 version */
42 uint32 offsets[TRX_MAX_OFFSET]; /* Offsets of partitions from start of header */
43};
44
45/* Compatibility */
46typedef struct trx_header TRXHDR, *PTRXHDR;
diff --git a/drivers/net/wireless/bcm4329/include/typedefs.h b/drivers/net/wireless/bcm4329/include/typedefs.h
new file mode 100644
index 00000000000..4d9dd761ed6
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/typedefs.h
@@ -0,0 +1,303 @@
1/*
2 * Copyright (C) 1999-2010, Broadcom Corporation
3 *
4 * Unless you and Broadcom execute a separate written software license
5 * agreement governing use of this software, this software is licensed to you
6 * under the terms of the GNU General Public License version 2 (the "GPL"),
7 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
8 * following added to such license:
9 *
10 * As a special exception, the copyright holders of this software give you
11 * permission to link this software with independent modules, and to copy and
12 * distribute the resulting executable under terms of your choice, provided that
13 * you also meet, for each linked independent module, the terms and conditions of
14 * the license of that module. An independent module is a module which is not
15 * derived from this software. The special exception does not apply to any
16 * modifications of the software.
17 *
18 * Notwithstanding the above, under no circumstances may you combine this
19 * software in any way with any other Broadcom software provided under a license
20 * other than the GPL, without Broadcom's express prior written consent.
21 * $Id: typedefs.h,v 1.85.34.1.2.5 2009/01/27 04:09:40 Exp $
22 */
23
24
25#ifndef _TYPEDEFS_H_
26#define _TYPEDEFS_H_
27
28#ifdef SITE_TYPEDEFS
29
30
31
32#include "site_typedefs.h"
33
34#else
35
36
37
38#ifdef __cplusplus
39
40#define TYPEDEF_BOOL
41#ifndef FALSE
42#define FALSE false
43#endif
44#ifndef TRUE
45#define TRUE true
46#endif
47
48#else
49
50
51#endif
52
53#if defined(__x86_64__)
54#define TYPEDEF_UINTPTR
55typedef unsigned long long int uintptr;
56#endif
57
58
59
60
61#if defined(TARGETOS_nucleus)
62
63#include <stddef.h>
64
65
66#define TYPEDEF_FLOAT_T
67#endif
68
69#if defined(_NEED_SIZE_T_)
70typedef long unsigned int size_t;
71#endif
72
73#ifdef __DJGPP__
74typedef long unsigned int size_t;
75#endif
76
77
78
79
80
81#define TYPEDEF_UINT
82#ifndef TARGETENV_android
83#define TYPEDEF_USHORT
84#define TYPEDEF_ULONG
85#endif
86#ifdef __KERNEL__
87#include <linux/version.h>
88#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19))
89#define TYPEDEF_BOOL
90#endif
91#endif
92
93
94
95
96
97#if defined(__GNUC__) && defined(__STRICT_ANSI__)
98#define TYPEDEF_INT64
99#define TYPEDEF_UINT64
100#endif
101
102
103#if defined(__ICL)
104
105#define TYPEDEF_INT64
106
107#if defined(__STDC__)
108#define TYPEDEF_UINT64
109#endif
110
111#endif
112
113#if !defined(__DJGPP__) && !defined(TARGETOS_nucleus)
114
115
116#if defined(__KERNEL__)
117
118#include <linux/types.h>
119
120#else
121
122
123#include <sys/types.h>
124
125#endif
126
127#endif
128
129
130
131
132#define USE_TYPEDEF_DEFAULTS
133
134#endif
135
136
137
138
139#ifdef USE_TYPEDEF_DEFAULTS
140#undef USE_TYPEDEF_DEFAULTS
141
142#ifndef TYPEDEF_BOOL
143typedef unsigned char bool;
144#endif
145
146
147
148#ifndef TYPEDEF_UCHAR
149typedef unsigned char uchar;
150#endif
151
152#ifndef TYPEDEF_USHORT
153typedef unsigned short ushort;
154#endif
155
156#ifndef TYPEDEF_UINT
157typedef unsigned int uint;
158#endif
159
160#ifndef TYPEDEF_ULONG
161typedef unsigned long ulong;
162#endif
163
164
165
166#ifndef TYPEDEF_UINT8
167typedef unsigned char uint8;
168#endif
169
170#ifndef TYPEDEF_UINT16
171typedef unsigned short uint16;
172#endif
173
174#ifndef TYPEDEF_UINT32
175typedef unsigned int uint32;
176#endif
177
178#ifndef TYPEDEF_UINT64
179typedef unsigned long long uint64;
180#endif
181
182#ifndef TYPEDEF_UINTPTR
183typedef unsigned int uintptr;
184#endif
185
186#ifndef TYPEDEF_INT8
187typedef signed char int8;
188#endif
189
190#ifndef TYPEDEF_INT16
191typedef signed short int16;
192#endif
193
194#ifndef TYPEDEF_INT32
195typedef signed int int32;
196#endif
197
198#ifndef TYPEDEF_INT64
199typedef signed long long int64;
200#endif
201
202
203
204#ifndef TYPEDEF_FLOAT32
205typedef float float32;
206#endif
207
208#ifndef TYPEDEF_FLOAT64
209typedef double float64;
210#endif
211
212
213
214#ifndef TYPEDEF_FLOAT_T
215
216#if defined(FLOAT32)
217typedef float32 float_t;
218#else
219typedef float64 float_t;
220#endif
221
222#endif
223
224
225
226#ifndef FALSE
227#define FALSE 0
228#endif
229
230#ifndef TRUE
231#define TRUE 1
232#endif
233
234#ifndef NULL
235#define NULL 0
236#endif
237
238#ifndef OFF
239#define OFF 0
240#endif
241
242#ifndef ON
243#define ON 1
244#endif
245
246#define AUTO (-1)
247
248
249
250#ifndef PTRSZ
251#define PTRSZ sizeof(char*)
252#endif
253
254
255
256#if defined(__GNUC__)
257 #define BWL_COMPILER_GNU
258#elif defined(__CC_ARM)
259 #define BWL_COMPILER_ARMCC
260#else
261 #error "Unknown compiler!"
262#endif
263
264
265#ifndef INLINE
266 #if defined(BWL_COMPILER_MICROSOFT)
267 #define INLINE __inline
268 #elif defined(BWL_COMPILER_GNU)
269 #define INLINE __inline__
270 #elif defined(BWL_COMPILER_ARMCC)
271 #define INLINE __inline
272 #else
273 #define INLINE
274 #endif
275#endif
276
277#undef TYPEDEF_BOOL
278#undef TYPEDEF_UCHAR
279#undef TYPEDEF_USHORT
280#undef TYPEDEF_UINT
281#undef TYPEDEF_ULONG
282#undef TYPEDEF_UINT8
283#undef TYPEDEF_UINT16
284#undef TYPEDEF_UINT32
285#undef TYPEDEF_UINT64
286#undef TYPEDEF_UINTPTR
287#undef TYPEDEF_INT8
288#undef TYPEDEF_INT16
289#undef TYPEDEF_INT32
290#undef TYPEDEF_INT64
291#undef TYPEDEF_FLOAT32
292#undef TYPEDEF_FLOAT64
293#undef TYPEDEF_FLOAT_T
294
295#endif
296
297
298#define UNUSED_PARAMETER(x) (void)(x)
299
300
301#include <bcmdefs.h>
302
303#endif
diff --git a/drivers/net/wireless/bcm4329/include/wlioctl.h b/drivers/net/wireless/bcm4329/include/wlioctl.h
new file mode 100644
index 00000000000..00c61f10782
--- /dev/null
+++ b/drivers/net/wireless/bcm4329/include/wlioctl.h
@@ -0,0 +1,1673 @@
1/*
2 * Custom OID/ioctl definitions for
3 * Broadcom 802.11abg Networking Device Driver
4 *
5 * Definitions subject to change without notice.
6 *
7 * Copyright (C) 1999-2010, Broadcom Corporation
8 *
9 * Unless you and Broadcom execute a separate written software license
10 * agreement governing use of this software, this software is licensed to you
11 * under the terms of the GNU General Public License version 2 (the "GPL"),
12 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
13 * following added to such license:
14 *
15 * As a special exception, the copyright holders of this software give you
16 * permission to link this software with independent modules, and to copy and
17 * distribute the resulting executable under terms of your choice, provided that
18 * you also meet, for each linked independent module, the terms and conditions of
19 * the license of that module. An independent module is a module which is not
20 * derived from this software. The special exception does not apply to any
21 * modifications of the software.
22 *
23 * Notwithstanding the above, under no circumstances may you combine this
24 * software in any way with any other Broadcom software provided under a license
25 * other than the GPL, without Broadcom's express prior written consent.
26 *
27 * $Id: wlioctl.h,v 1.601.4.15.2.14.2.62.4.3 2011/02/09 23:31:02 Exp $
28 */
29
30
31#ifndef _wlioctl_h_
32#define _wlioctl_h_
33
34#include <typedefs.h>
35#include <proto/ethernet.h>
36#include <proto/bcmeth.h>
37#include <proto/bcmevent.h>
38#include <proto/802.11.h>
39#include <bcmwifi.h>
40
41
42
43#define ACTION_FRAME_SIZE 1040
44
45typedef struct wl_action_frame {
46 struct ether_addr da;
47 uint16 len;
48 uint32 packetId;
49 uint8 data[ACTION_FRAME_SIZE];
50} wl_action_frame_t;
51
52#define WL_WIFI_ACTION_FRAME_SIZE sizeof(struct wl_action_frame)
53
54
55#define BWL_DEFAULT_PACKING
56#include <packed_section_start.h>
57
58#define RWL_ACTION_WIFI_CATEGORY 127
59#define RWL_WIFI_OUI_BYTE1 0x90
60#define RWL_WIFI_OUI_BYTE2 0x4C
61#define RWL_WIFI_OUI_BYTE3 0x0F
62#define RWL_WIFI_ACTION_FRAME_SIZE sizeof(struct dot11_action_wifi_vendor_specific)
63#define RWL_WIFI_DEFAULT 0x00
64#define RWL_WIFI_FIND_MY_PEER 0x09
65#define RWL_WIFI_FOUND_PEER 0x0A
66#define RWL_ACTION_WIFI_FRAG_TYPE 0x55
67
68typedef struct ssid_info
69{
70 uint8 ssid_len;
71 uint8 ssid[32];
72} ssid_info_t;
73
74typedef struct cnt_rx
75{
76 uint32 cnt_rxundec;
77 uint32 cnt_rxframe;
78} cnt_rx_t;
79
80
81
82#define RWL_REF_MAC_ADDRESS_OFFSET 17
83#define RWL_DUT_MAC_ADDRESS_OFFSET 23
84#define RWL_WIFI_CLIENT_CHANNEL_OFFSET 50
85#define RWL_WIFI_SERVER_CHANNEL_OFFSET 51
86
87
88
89
90
91#define WL_BSS_INFO_VERSION 108
92
93
94typedef struct wl_bss_info {
95 uint32 version;
96 uint32 length;
97 struct ether_addr BSSID;
98 uint16 beacon_period;
99 uint16 capability;
100 uint8 SSID_len;
101 uint8 SSID[32];
102 struct {
103 uint count;
104 uint8 rates[16];
105 } rateset;
106 chanspec_t chanspec;
107 uint16 atim_window;
108 uint8 dtim_period;
109 int16 RSSI;
110 int8 phy_noise;
111
112 uint8 n_cap;
113 uint32 nbss_cap;
114 uint8 ctl_ch;
115 uint32 reserved32[1];
116 uint8 flags;
117 uint8 reserved[3];
118 uint8 basic_mcs[MCSSET_LEN];
119
120 uint16 ie_offset;
121 uint32 ie_length;
122
123
124} wl_bss_info_t;
125
126typedef struct wlc_ssid {
127 uint32 SSID_len;
128 uchar SSID[32];
129} wlc_ssid_t;
130
131
132#define WL_BSSTYPE_INFRA 1
133#define WL_BSSTYPE_INDEP 0
134#define WL_BSSTYPE_ANY 2
135
136
137#define WL_SCANFLAGS_PASSIVE 0x01
138#define WL_SCANFLAGS_PROHIBITED 0x04
139
140typedef struct wl_scan_params {
141 wlc_ssid_t ssid;
142 struct ether_addr bssid;
143 int8 bss_type;
144 int8 scan_type;
145 int32 nprobes;
146 int32 active_time;
147 int32 passive_time;
148 int32 home_time;
149 int32 channel_num;
150 uint16 channel_list[1];
151} wl_scan_params_t;
152
153#define WL_SCAN_PARAMS_FIXED_SIZE 64
154
155
156#define WL_SCAN_PARAMS_COUNT_MASK 0x0000ffff
157#define WL_SCAN_PARAMS_NSSID_SHIFT 16
158
159#define WL_SCAN_ACTION_START 1
160#define WL_SCAN_ACTION_CONTINUE 2
161#define WL_SCAN_ACTION_ABORT 3
162
163#define ISCAN_REQ_VERSION 1
164
165
166typedef struct wl_iscan_params {
167 uint32 version;
168 uint16 action;
169 uint16 scan_duration;
170 wl_scan_params_t params;
171} wl_iscan_params_t;
172
173#define WL_ISCAN_PARAMS_FIXED_SIZE (OFFSETOF(wl_iscan_params_t, params) + sizeof(wlc_ssid_t))
174
175typedef struct wl_scan_results {
176 uint32 buflen;
177 uint32 version;
178 uint32 count;
179 wl_bss_info_t bss_info[1];
180} wl_scan_results_t;
181
182#define WL_SCAN_RESULTS_FIXED_SIZE 12
183
184
185#define WL_SCAN_RESULTS_SUCCESS 0
186#define WL_SCAN_RESULTS_PARTIAL 1
187#define WL_SCAN_RESULTS_PENDING 2
188#define WL_SCAN_RESULTS_ABORTED 3
189#define WL_SCAN_RESULTS_NO_MEM 4
190
191#define ESCAN_REQ_VERSION 1
192
193typedef struct wl_escan_params {
194 uint32 version;
195 uint16 action;
196 uint16 sync_id;
197 wl_scan_params_t params;
198} wl_escan_params_t;
199
200#define WL_ESCAN_PARAMS_FIXED_SIZE (OFFSETOF(wl_escan_params_t, params) + sizeof(wlc_ssid_t))
201
202typedef struct wl_escan_result {
203 uint32 buflen;
204 uint32 version;
205 uint16 sync_id;
206 uint16 bss_count;
207 wl_bss_info_t bss_info[1];
208} wl_escan_result_t;
209
210#define WL_ESCAN_RESULTS_FIXED_SIZE (sizeof(wl_escan_result_t) - sizeof(wl_bss_info_t))
211
212
213typedef struct wl_iscan_results {
214 uint32 status;
215 wl_scan_results_t results;
216} wl_iscan_results_t;
217
218#define WL_ISCAN_RESULTS_FIXED_SIZE \
219 (WL_SCAN_RESULTS_FIXED_SIZE + OFFSETOF(wl_iscan_results_t, results))
220
221#define WL_NUMRATES 16
222typedef struct wl_rateset {
223 uint32 count;
224 uint8 rates[WL_NUMRATES];
225} wl_rateset_t;
226
227
228typedef struct wl_uint32_list {
229
230 uint32 count;
231
232 uint32 element[1];
233} wl_uint32_list_t;
234
235
236typedef struct wl_assoc_params {
237 struct ether_addr bssid;
238 uint16 bssid_cnt;
239 int32 chanspec_num;
240 chanspec_t chanspec_list[1];
241} wl_assoc_params_t;
242#define WL_ASSOC_PARAMS_FIXED_SIZE (sizeof(wl_assoc_params_t) - sizeof(chanspec_t))
243
244
245typedef wl_assoc_params_t wl_reassoc_params_t;
246#define WL_REASSOC_PARAMS_FIXED_SIZE WL_ASSOC_PARAMS_FIXED_SIZE
247
248
249typedef struct wl_join_params {
250 wlc_ssid_t ssid;
251 wl_assoc_params_t params;
252} wl_join_params_t;
253#define WL_JOIN_PARAMS_FIXED_SIZE (sizeof(wl_join_params_t) - sizeof(chanspec_t))
254
255#define WLC_CNTRY_BUF_SZ 4
256
257typedef struct wl_country {
258 char country_abbrev[WLC_CNTRY_BUF_SZ];
259 int32 rev;
260 char ccode[WLC_CNTRY_BUF_SZ];
261} wl_country_t;
262
263typedef enum sup_auth_status {
264
265 WLC_SUP_DISCONNECTED = 0,
266 WLC_SUP_CONNECTING,
267 WLC_SUP_IDREQUIRED,
268 WLC_SUP_AUTHENTICATING,
269 WLC_SUP_AUTHENTICATED,
270 WLC_SUP_KEYXCHANGE,
271 WLC_SUP_KEYED,
272 WLC_SUP_TIMEOUT,
273 WLC_SUP_LAST_BASIC_STATE,
274
275
276 WLC_SUP_KEYXCHANGE_WAIT_M1 = WLC_SUP_AUTHENTICATED,
277
278 WLC_SUP_KEYXCHANGE_PREP_M2 = WLC_SUP_KEYXCHANGE,
279
280 WLC_SUP_KEYXCHANGE_WAIT_M3 = WLC_SUP_LAST_BASIC_STATE,
281
282 WLC_SUP_KEYXCHANGE_PREP_M4,
283 WLC_SUP_KEYXCHANGE_WAIT_G1,
284 WLC_SUP_KEYXCHANGE_PREP_G2
285} sup_auth_status_t;
286
287
288#define CRYPTO_ALGO_OFF 0
289#define CRYPTO_ALGO_WEP1 1
290#define CRYPTO_ALGO_TKIP 2
291#define CRYPTO_ALGO_WEP128 3
292#define CRYPTO_ALGO_AES_CCM 4
293#define CRYPTO_ALGO_AES_OCB_MSDU 5
294#define CRYPTO_ALGO_AES_OCB_MPDU 6
295#define CRYPTO_ALGO_NALG 7
296#define CRYPTO_ALGO_SMS4 11
297
298#define WSEC_GEN_MIC_ERROR 0x0001
299#define WSEC_GEN_REPLAY 0x0002
300#define WSEC_GEN_ICV_ERROR 0x0004
301
302#define WL_SOFT_KEY (1 << 0)
303#define WL_PRIMARY_KEY (1 << 1)
304#define WL_KF_RES_4 (1 << 4)
305#define WL_KF_RES_5 (1 << 5)
306#define WL_IBSS_PEER_GROUP_KEY (1 << 6)
307
308typedef struct wl_wsec_key {
309 uint32 index;
310 uint32 len;
311 uint8 data[DOT11_MAX_KEY_SIZE];
312 uint32 pad_1[18];
313 uint32 algo;
314 uint32 flags;
315 uint32 pad_2[2];
316 int pad_3;
317 int iv_initialized;
318 int pad_4;
319
320 struct {
321 uint32 hi;
322 uint16 lo;
323 } rxiv;
324 uint32 pad_5[2];
325 struct ether_addr ea;
326} wl_wsec_key_t;
327
328#define WSEC_MIN_PSK_LEN 8
329#define WSEC_MAX_PSK_LEN 64
330
331
332#define WSEC_PASSPHRASE (1<<0)
333
334
335typedef struct {
336 ushort key_len;
337 ushort flags;
338 uint8 key[WSEC_MAX_PSK_LEN];
339} wsec_pmk_t;
340
341
342#define WEP_ENABLED 0x0001
343#define TKIP_ENABLED 0x0002
344#define AES_ENABLED 0x0004
345#define WSEC_SWFLAG 0x0008
346#define SES_OW_ENABLED 0x0040
347#define SMS4_ENABLED 0x0100
348
349
350#define WPA_AUTH_DISABLED 0x0000
351#define WPA_AUTH_NONE 0x0001
352#define WPA_AUTH_UNSPECIFIED 0x0002
353#define WPA_AUTH_PSK 0x0004
354
355#define WPA2_AUTH_UNSPECIFIED 0x0040
356#define WPA2_AUTH_PSK 0x0080
357#define BRCM_AUTH_PSK 0x0100
358#define BRCM_AUTH_DPT 0x0200
359#define WPA_AUTH_WAPI 0x0400
360
361#define WPA_AUTH_PFN_ANY 0xffffffff
362
363
364#define MAXPMKID 16
365
366typedef struct _pmkid {
367 struct ether_addr BSSID;
368 uint8 PMKID[WPA2_PMKID_LEN];
369} pmkid_t;
370
371typedef struct _pmkid_list {
372 uint32 npmkid;
373 pmkid_t pmkid[1];
374} pmkid_list_t;
375
376typedef struct _pmkid_cand {
377 struct ether_addr BSSID;
378 uint8 preauth;
379} pmkid_cand_t;
380
381typedef struct _pmkid_cand_list {
382 uint32 npmkid_cand;
383 pmkid_cand_t pmkid_cand[1];
384} pmkid_cand_list_t;
385
386
387
388
389typedef struct {
390 uint32 val;
391 struct ether_addr ea;
392} scb_val_t;
393
394
395
396typedef struct channel_info {
397 int hw_channel;
398 int target_channel;
399 int scan_channel;
400} channel_info_t;
401
402
403struct maclist {
404 uint count;
405 struct ether_addr ea[1];
406};
407
408
409typedef struct get_pktcnt {
410 uint rx_good_pkt;
411 uint rx_bad_pkt;
412 uint tx_good_pkt;
413 uint tx_bad_pkt;
414 uint rx_ocast_good_pkt;
415} get_pktcnt_t;
416
417
418typedef struct wl_ioctl {
419 uint cmd;
420 void *buf;
421 uint len;
422 uint8 set;
423 uint used;
424 uint needed;
425} wl_ioctl_t;
426
427
428
429#define WLC_IOCTL_MAGIC 0x14e46c77
430
431
432#define WLC_IOCTL_VERSION 1
433
434#define WLC_IOCTL_MAXLEN 8192
435#define WLC_IOCTL_SMLEN 256
436#define WLC_IOCTL_MEDLEN 1536
437
438
439
440#define WLC_GET_MAGIC 0
441#define WLC_GET_VERSION 1
442#define WLC_UP 2
443#define WLC_DOWN 3
444#define WLC_GET_LOOP 4
445#define WLC_SET_LOOP 5
446#define WLC_DUMP 6
447#define WLC_GET_MSGLEVEL 7
448#define WLC_SET_MSGLEVEL 8
449#define WLC_GET_PROMISC 9
450#define WLC_SET_PROMISC 10
451
452#define WLC_GET_RATE 12
453
454#define WLC_GET_INSTANCE 14
455
456
457
458
459#define WLC_GET_INFRA 19
460#define WLC_SET_INFRA 20
461#define WLC_GET_AUTH 21
462#define WLC_SET_AUTH 22
463#define WLC_GET_BSSID 23
464#define WLC_SET_BSSID 24
465#define WLC_GET_SSID 25
466#define WLC_SET_SSID 26
467#define WLC_RESTART 27
468
469#define WLC_GET_CHANNEL 29
470#define WLC_SET_CHANNEL 30
471#define WLC_GET_SRL 31
472#define WLC_SET_SRL 32
473#define WLC_GET_LRL 33
474#define WLC_SET_LRL 34
475#define WLC_GET_PLCPHDR 35
476#define WLC_SET_PLCPHDR 36
477#define WLC_GET_RADIO 37
478#define WLC_SET_RADIO 38
479#define WLC_GET_PHYTYPE 39
480#define WLC_DUMP_RATE 40
481#define WLC_SET_RATE_PARAMS 41
482
483
484#define WLC_GET_KEY 44
485#define WLC_SET_KEY 45
486#define WLC_GET_REGULATORY 46
487#define WLC_SET_REGULATORY 47
488#define WLC_GET_PASSIVE_SCAN 48
489#define WLC_SET_PASSIVE_SCAN 49
490#define WLC_SCAN 50
491#define WLC_SCAN_RESULTS 51
492#define WLC_DISASSOC 52
493#define WLC_REASSOC 53
494#define WLC_GET_ROAM_TRIGGER 54
495#define WLC_SET_ROAM_TRIGGER 55
496#define WLC_GET_ROAM_DELTA 56
497#define WLC_SET_ROAM_DELTA 57
498#define WLC_GET_ROAM_SCAN_PERIOD 58
499#define WLC_SET_ROAM_SCAN_PERIOD 59
500#define WLC_EVM 60
501#define WLC_GET_TXANT 61
502#define WLC_SET_TXANT 62
503#define WLC_GET_ANTDIV 63
504#define WLC_SET_ANTDIV 64
505
506
507#define WLC_GET_CLOSED 67
508#define WLC_SET_CLOSED 68
509#define WLC_GET_MACLIST 69
510#define WLC_SET_MACLIST 70
511#define WLC_GET_RATESET 71
512#define WLC_SET_RATESET 72
513
514#define WLC_LONGTRAIN 74
515#define WLC_GET_BCNPRD 75
516#define WLC_SET_BCNPRD 76
517#define WLC_GET_DTIMPRD 77
518#define WLC_SET_DTIMPRD 78
519#define WLC_GET_SROM 79
520#define WLC_SET_SROM 80
521#define WLC_GET_WEP_RESTRICT 81
522#define WLC_SET_WEP_RESTRICT 82
523#define WLC_GET_COUNTRY 83
524#define WLC_SET_COUNTRY 84
525#define WLC_GET_PM 85
526#define WLC_SET_PM 86
527#define WLC_GET_WAKE 87
528#define WLC_SET_WAKE 88
529
530#define WLC_GET_FORCELINK 90
531#define WLC_SET_FORCELINK 91
532#define WLC_FREQ_ACCURACY 92
533#define WLC_CARRIER_SUPPRESS 93
534#define WLC_GET_PHYREG 94
535#define WLC_SET_PHYREG 95
536#define WLC_GET_RADIOREG 96
537#define WLC_SET_RADIOREG 97
538#define WLC_GET_REVINFO 98
539#define WLC_GET_UCANTDIV 99
540#define WLC_SET_UCANTDIV 100
541#define WLC_R_REG 101
542#define WLC_W_REG 102
543
544
545#define WLC_GET_MACMODE 105
546#define WLC_SET_MACMODE 106
547#define WLC_GET_MONITOR 107
548#define WLC_SET_MONITOR 108
549#define WLC_GET_GMODE 109
550#define WLC_SET_GMODE 110
551#define WLC_GET_LEGACY_ERP 111
552#define WLC_SET_LEGACY_ERP 112
553#define WLC_GET_RX_ANT 113
554#define WLC_GET_CURR_RATESET 114
555#define WLC_GET_SCANSUPPRESS 115
556#define WLC_SET_SCANSUPPRESS 116
557#define WLC_GET_AP 117
558#define WLC_SET_AP 118
559#define WLC_GET_EAP_RESTRICT 119
560#define WLC_SET_EAP_RESTRICT 120
561#define WLC_SCB_AUTHORIZE 121
562#define WLC_SCB_DEAUTHORIZE 122
563#define WLC_GET_WDSLIST 123
564#define WLC_SET_WDSLIST 124
565#define WLC_GET_ATIM 125
566#define WLC_SET_ATIM 126
567#define WLC_GET_RSSI 127
568#define WLC_GET_PHYANTDIV 128
569#define WLC_SET_PHYANTDIV 129
570#define WLC_AP_RX_ONLY 130
571#define WLC_GET_TX_PATH_PWR 131
572#define WLC_SET_TX_PATH_PWR 132
573#define WLC_GET_WSEC 133
574#define WLC_SET_WSEC 134
575#define WLC_GET_PHY_NOISE 135
576#define WLC_GET_BSS_INFO 136
577#define WLC_GET_PKTCNTS 137
578#define WLC_GET_LAZYWDS 138
579#define WLC_SET_LAZYWDS 139
580#define WLC_GET_BANDLIST 140
581#define WLC_GET_BAND 141
582#define WLC_SET_BAND 142
583#define WLC_SCB_DEAUTHENTICATE 143
584#define WLC_GET_SHORTSLOT 144
585#define WLC_GET_SHORTSLOT_OVERRIDE 145
586#define WLC_SET_SHORTSLOT_OVERRIDE 146
587#define WLC_GET_SHORTSLOT_RESTRICT 147
588#define WLC_SET_SHORTSLOT_RESTRICT 148
589#define WLC_GET_GMODE_PROTECTION 149
590#define WLC_GET_GMODE_PROTECTION_OVERRIDE 150
591#define WLC_SET_GMODE_PROTECTION_OVERRIDE 151
592#define WLC_UPGRADE 152
593
594
595#define WLC_GET_IGNORE_BCNS 155
596#define WLC_SET_IGNORE_BCNS 156
597#define WLC_GET_SCB_TIMEOUT 157
598#define WLC_SET_SCB_TIMEOUT 158
599#define WLC_GET_ASSOCLIST 159
600#define WLC_GET_CLK 160
601#define WLC_SET_CLK 161
602#define WLC_GET_UP 162
603#define WLC_OUT 163
604#define WLC_GET_WPA_AUTH 164
605#define WLC_SET_WPA_AUTH 165
606#define WLC_GET_UCFLAGS 166
607#define WLC_SET_UCFLAGS 167
608#define WLC_GET_PWRIDX 168
609#define WLC_SET_PWRIDX 169
610#define WLC_GET_TSSI 170
611#define WLC_GET_SUP_RATESET_OVERRIDE 171
612#define WLC_SET_SUP_RATESET_OVERRIDE 172
613
614
615
616
617
618#define WLC_GET_PROTECTION_CONTROL 178
619#define WLC_SET_PROTECTION_CONTROL 179
620#define WLC_GET_PHYLIST 180
621#define WLC_ENCRYPT_STRENGTH 181
622#define WLC_DECRYPT_STATUS 182
623#define WLC_GET_KEY_SEQ 183
624#define WLC_GET_SCAN_CHANNEL_TIME 184
625#define WLC_SET_SCAN_CHANNEL_TIME 185
626#define WLC_GET_SCAN_UNASSOC_TIME 186
627#define WLC_SET_SCAN_UNASSOC_TIME 187
628#define WLC_GET_SCAN_HOME_TIME 188
629#define WLC_SET_SCAN_HOME_TIME 189
630#define WLC_GET_SCAN_NPROBES 190
631#define WLC_SET_SCAN_NPROBES 191
632#define WLC_GET_PRB_RESP_TIMEOUT 192
633#define WLC_SET_PRB_RESP_TIMEOUT 193
634#define WLC_GET_ATTEN 194
635#define WLC_SET_ATTEN 195
636#define WLC_GET_SHMEM 196
637#define WLC_SET_SHMEM 197
638
639
640#define WLC_SET_WSEC_TEST 200
641#define WLC_SCB_DEAUTHENTICATE_FOR_REASON 201
642#define WLC_TKIP_COUNTERMEASURES 202
643#define WLC_GET_PIOMODE 203
644#define WLC_SET_PIOMODE 204
645#define WLC_SET_ASSOC_PREFER 205
646#define WLC_GET_ASSOC_PREFER 206
647#define WLC_SET_ROAM_PREFER 207
648#define WLC_GET_ROAM_PREFER 208
649#define WLC_SET_LED 209
650#define WLC_GET_LED 210
651#define WLC_GET_INTERFERENCE_MODE 211
652#define WLC_SET_INTERFERENCE_MODE 212
653#define WLC_GET_CHANNEL_QA 213
654#define WLC_START_CHANNEL_QA 214
655#define WLC_GET_CHANNEL_SEL 215
656#define WLC_START_CHANNEL_SEL 216
657#define WLC_GET_VALID_CHANNELS 217
658#define WLC_GET_FAKEFRAG 218
659#define WLC_SET_FAKEFRAG 219
660#define WLC_GET_PWROUT_PERCENTAGE 220
661#define WLC_SET_PWROUT_PERCENTAGE 221
662#define WLC_SET_BAD_FRAME_PREEMPT 222
663#define WLC_GET_BAD_FRAME_PREEMPT 223
664#define WLC_SET_LEAP_LIST 224
665#define WLC_GET_LEAP_LIST 225
666#define WLC_GET_CWMIN 226
667#define WLC_SET_CWMIN 227
668#define WLC_GET_CWMAX 228
669#define WLC_SET_CWMAX 229
670#define WLC_GET_WET 230
671#define WLC_SET_WET 231
672#define WLC_GET_PUB 232
673
674
675#define WLC_GET_KEY_PRIMARY 235
676#define WLC_SET_KEY_PRIMARY 236
677
678#define WLC_GET_ACI_ARGS 238
679#define WLC_SET_ACI_ARGS 239
680#define WLC_UNSET_CALLBACK 240
681#define WLC_SET_CALLBACK 241
682#define WLC_GET_RADAR 242
683#define WLC_SET_RADAR 243
684#define WLC_SET_SPECT_MANAGMENT 244
685#define WLC_GET_SPECT_MANAGMENT 245
686#define WLC_WDS_GET_REMOTE_HWADDR 246
687#define WLC_WDS_GET_WPA_SUP 247
688#define WLC_SET_CS_SCAN_TIMER 248
689#define WLC_GET_CS_SCAN_TIMER 249
690#define WLC_MEASURE_REQUEST 250
691#define WLC_INIT 251
692#define WLC_SEND_QUIET 252
693#define WLC_KEEPALIVE 253
694#define WLC_SEND_PWR_CONSTRAINT 254
695#define WLC_UPGRADE_STATUS 255
696#define WLC_CURRENT_PWR 256
697#define WLC_GET_SCAN_PASSIVE_TIME 257
698#define WLC_SET_SCAN_PASSIVE_TIME 258
699#define WLC_LEGACY_LINK_BEHAVIOR 259
700#define WLC_GET_CHANNELS_IN_COUNTRY 260
701#define WLC_GET_COUNTRY_LIST 261
702#define WLC_GET_VAR 262
703#define WLC_SET_VAR 263
704#define WLC_NVRAM_GET 264
705#define WLC_NVRAM_SET 265
706#define WLC_NVRAM_DUMP 266
707#define WLC_REBOOT 267
708#define WLC_SET_WSEC_PMK 268
709#define WLC_GET_AUTH_MODE 269
710#define WLC_SET_AUTH_MODE 270
711#define WLC_GET_WAKEENTRY 271
712#define WLC_SET_WAKEENTRY 272
713#define WLC_NDCONFIG_ITEM 273
714#define WLC_NVOTPW 274
715#define WLC_OTPW 275
716#define WLC_IOV_BLOCK_GET 276
717#define WLC_IOV_MODULES_GET 277
718#define WLC_SOFT_RESET 278
719#define WLC_GET_ALLOW_MODE 279
720#define WLC_SET_ALLOW_MODE 280
721#define WLC_GET_DESIRED_BSSID 281
722#define WLC_SET_DESIRED_BSSID 282
723#define WLC_DISASSOC_MYAP 283
724#define WLC_GET_NBANDS 284
725#define WLC_GET_BANDSTATES 285
726#define WLC_GET_WLC_BSS_INFO 286
727#define WLC_GET_ASSOC_INFO 287
728#define WLC_GET_OID_PHY 288
729#define WLC_SET_OID_PHY 289
730#define WLC_SET_ASSOC_TIME 290
731#define WLC_GET_DESIRED_SSID 291
732#define WLC_GET_CHANSPEC 292
733#define WLC_GET_ASSOC_STATE 293
734#define WLC_SET_PHY_STATE 294
735#define WLC_GET_SCAN_PENDING 295
736#define WLC_GET_SCANREQ_PENDING 296
737#define WLC_GET_PREV_ROAM_REASON 297
738#define WLC_SET_PREV_ROAM_REASON 298
739#define WLC_GET_BANDSTATES_PI 299
740#define WLC_GET_PHY_STATE 300
741#define WLC_GET_BSS_WPA_RSN 301
742#define WLC_GET_BSS_WPA2_RSN 302
743#define WLC_GET_BSS_BCN_TS 303
744#define WLC_GET_INT_DISASSOC 304
745#define WLC_SET_NUM_PEERS 305
746#define WLC_GET_NUM_BSS 306
747#define WLC_LAST 307
748
749
750
751#define WL_RADIO_SW_DISABLE (1<<0)
752#define WL_RADIO_HW_DISABLE (1<<1)
753#define WL_RADIO_MPC_DISABLE (1<<2)
754#define WL_RADIO_COUNTRY_DISABLE (1<<3)
755
756
757#define WL_TXPWR_OVERRIDE (1U<<31)
758
759#define WL_PHY_PAVARS_LEN 6
760
761
762#define WL_DIAG_INTERRUPT 1
763#define WL_DIAG_LOOPBACK 2
764#define WL_DIAG_MEMORY 3
765#define WL_DIAG_LED 4
766#define WL_DIAG_REG 5
767#define WL_DIAG_SROM 6
768#define WL_DIAG_DMA 7
769
770#define WL_DIAGERR_SUCCESS 0
771#define WL_DIAGERR_FAIL_TO_RUN 1
772#define WL_DIAGERR_NOT_SUPPORTED 2
773#define WL_DIAGERR_INTERRUPT_FAIL 3
774#define WL_DIAGERR_LOOPBACK_FAIL 4
775#define WL_DIAGERR_SROM_FAIL 5
776#define WL_DIAGERR_SROM_BADCRC 6
777#define WL_DIAGERR_REG_FAIL 7
778#define WL_DIAGERR_MEMORY_FAIL 8
779#define WL_DIAGERR_NOMEM 9
780#define WL_DIAGERR_DMA_FAIL 10
781
782#define WL_DIAGERR_MEMORY_TIMEOUT 11
783#define WL_DIAGERR_MEMORY_BADPATTERN 12
784
785
786#define WLC_BAND_AUTO 0
787#define WLC_BAND_5G 1
788#define WLC_BAND_2G 2
789#define WLC_BAND_ALL 3
790
791
792#define WL_CHAN_FREQ_RANGE_2G 0
793#define WL_CHAN_FREQ_RANGE_5GL 1
794#define WL_CHAN_FREQ_RANGE_5GM 2
795#define WL_CHAN_FREQ_RANGE_5GH 3
796
797
798#define WLC_PHY_TYPE_A 0
799#define WLC_PHY_TYPE_B 1
800#define WLC_PHY_TYPE_G 2
801#define WLC_PHY_TYPE_N 4
802#define WLC_PHY_TYPE_LP 5
803#define WLC_PHY_TYPE_SSN 6
804#define WLC_PHY_TYPE_NULL 0xf
805
806
807#define WLC_MACMODE_DISABLED 0
808#define WLC_MACMODE_DENY 1
809#define WLC_MACMODE_ALLOW 2
810
811
812#define GMODE_LEGACY_B 0
813#define GMODE_AUTO 1
814#define GMODE_ONLY 2
815#define GMODE_B_DEFERRED 3
816#define GMODE_PERFORMANCE 4
817#define GMODE_LRS 5
818#define GMODE_MAX 6
819
820
821#define WLC_PLCP_AUTO -1
822#define WLC_PLCP_SHORT 0
823#define WLC_PLCP_LONG 1
824
825
826#define WLC_PROTECTION_AUTO -1
827#define WLC_PROTECTION_OFF 0
828#define WLC_PROTECTION_ON 1
829#define WLC_PROTECTION_MMHDR_ONLY 2
830#define WLC_PROTECTION_CTS_ONLY 3
831
832
833#define WLC_PROTECTION_CTL_OFF 0
834#define WLC_PROTECTION_CTL_LOCAL 1
835#define WLC_PROTECTION_CTL_OVERLAP 2
836
837
838#define WLC_N_PROTECTION_OFF 0
839#define WLC_N_PROTECTION_OPTIONAL 1
840#define WLC_N_PROTECTION_20IN40 2
841#define WLC_N_PROTECTION_MIXEDMODE 3
842
843
844#define WLC_N_PREAMBLE_MIXEDMODE 0
845#define WLC_N_PREAMBLE_GF 1
846
847
848#define WLC_N_BW_20ALL 0
849#define WLC_N_BW_40ALL 1
850#define WLC_N_BW_20IN2G_40IN5G 2
851
852
853#define WLC_N_TXRX_CHAIN0 0
854#define WLC_N_TXRX_CHAIN1 1
855
856
857#define WLC_N_SGI_20 0x01
858#define WLC_N_SGI_40 0x02
859
860
861#define PM_OFF 0
862#define PM_MAX 1
863#define PM_FAST 2
864
865#define LISTEN_INTERVAL 10
866
867#define INTERFERE_NONE 0
868#define NON_WLAN 1
869#define WLAN_MANUAL 2
870#define WLAN_AUTO 3
871#define AUTO_ACTIVE (1 << 7)
872
873typedef struct wl_aci_args {
874 int enter_aci_thresh;
875 int exit_aci_thresh;
876 int usec_spin;
877 int glitch_delay;
878 uint16 nphy_adcpwr_enter_thresh;
879 uint16 nphy_adcpwr_exit_thresh;
880 uint16 nphy_repeat_ctr;
881 uint16 nphy_num_samples;
882 uint16 nphy_undetect_window_sz;
883 uint16 nphy_b_energy_lo_aci;
884 uint16 nphy_b_energy_md_aci;
885 uint16 nphy_b_energy_hi_aci;
886} wl_aci_args_t;
887
888#define WL_ACI_ARGS_LEGACY_LENGTH 16
889
890
891
892#define WL_ERROR_VAL 0x00000001
893#define WL_TRACE_VAL 0x00000002
894#define WL_PRHDRS_VAL 0x00000004
895#define WL_PRPKT_VAL 0x00000008
896#define WL_INFORM_VAL 0x00000010
897#define WL_TMP_VAL 0x00000020
898#define WL_OID_VAL 0x00000040
899#define WL_RATE_VAL 0x00000080
900#define WL_ASSOC_VAL 0x00000100
901#define WL_PRUSR_VAL 0x00000200
902#define WL_PS_VAL 0x00000400
903#define WL_TXPWR_VAL 0x00000800
904#define WL_PORT_VAL 0x00001000
905#define WL_DUAL_VAL 0x00002000
906#define WL_WSEC_VAL 0x00004000
907#define WL_WSEC_DUMP_VAL 0x00008000
908#define WL_LOG_VAL 0x00010000
909#define WL_NRSSI_VAL 0x00020000
910#define WL_LOFT_VAL 0x00040000
911#define WL_REGULATORY_VAL 0x00080000
912#define WL_PHYCAL_VAL 0x00100000
913#define WL_RADAR_VAL 0x00200000
914#define WL_MPC_VAL 0x00400000
915#define WL_APSTA_VAL 0x00800000
916#define WL_DFS_VAL 0x01000000
917#define WL_BA_VAL 0x02000000
918#define WL_MBSS_VAL 0x04000000
919#define WL_CAC_VAL 0x08000000
920#define WL_AMSDU_VAL 0x10000000
921#define WL_AMPDU_VAL 0x20000000
922#define WL_FFPLD_VAL 0x40000000
923
924
925#define WL_DPT_VAL 0x00000001
926#define WL_SCAN_VAL 0x00000002
927#define WL_WOWL_VAL 0x00000004
928#define WL_COEX_VAL 0x00000008
929#define WL_RTDC_VAL 0x00000010
930#define WL_BTA_VAL 0x00000040
931
932
933#define WL_LED_NUMGPIO 16
934
935
936#define WL_LED_OFF 0
937#define WL_LED_ON 1
938#define WL_LED_ACTIVITY 2
939#define WL_LED_RADIO 3
940#define WL_LED_ARADIO 4
941#define WL_LED_BRADIO 5
942#define WL_LED_BGMODE 6
943#define WL_LED_WI1 7
944#define WL_LED_WI2 8
945#define WL_LED_WI3 9
946#define WL_LED_ASSOC 10
947#define WL_LED_INACTIVE 11
948#define WL_LED_ASSOCACT 12
949#define WL_LED_NUMBEHAVIOR 13
950
951
952#define WL_LED_BEH_MASK 0x7f
953#define WL_LED_AL_MASK 0x80
954
955
956#define WL_NUMCHANNELS 64
957#define WL_NUMCHANSPECS 100
958
959
960#define WL_WDS_WPA_ROLE_AUTH 0
961#define WL_WDS_WPA_ROLE_SUP 1
962#define WL_WDS_WPA_ROLE_AUTO 255
963
964
965#define WL_EVENTING_MASK_LEN 16
966
967
968#define VNDR_IE_CMD_LEN 4
969
970
971#define VNDR_IE_BEACON_FLAG 0x1
972#define VNDR_IE_PRBRSP_FLAG 0x2
973#define VNDR_IE_ASSOCRSP_FLAG 0x4
974#define VNDR_IE_AUTHRSP_FLAG 0x8
975#define VNDR_IE_PRBREQ_FLAG 0x10
976#define VNDR_IE_ASSOCREQ_FLAG 0x20
977#define VNDR_IE_CUSTOM_FLAG 0x100
978
979#define VNDR_IE_INFO_HDR_LEN (sizeof(uint32))
980
981typedef struct {
982 uint32 pktflag;
983 vndr_ie_t vndr_ie_data;
984} vndr_ie_info_t;
985
986typedef struct {
987 int iecount;
988 vndr_ie_info_t vndr_ie_list[1];
989} vndr_ie_buf_t;
990
991typedef struct {
992 char cmd[VNDR_IE_CMD_LEN];
993 vndr_ie_buf_t vndr_ie_buffer;
994} vndr_ie_setbuf_t;
995
996
997
998
999#define WL_JOIN_PREF_RSSI 1
1000#define WL_JOIN_PREF_WPA 2
1001#define WL_JOIN_PREF_BAND 3
1002
1003
1004#define WLJP_BAND_ASSOC_PREF 255
1005
1006
1007#define WL_WPA_ACP_MCS_ANY "\x00\x00\x00\x00"
1008
1009struct tsinfo_arg {
1010 uint8 octets[3];
1011};
1012
1013
1014#define NFIFO 6
1015
1016#define WL_CNT_T_VERSION 5
1017#define WL_CNT_EXT_T_VERSION 1
1018
1019typedef struct {
1020 uint16 version;
1021 uint16 length;
1022
1023
1024 uint32 txframe;
1025 uint32 txbyte;
1026 uint32 txretrans;
1027 uint32 txerror;
1028 uint32 txctl;
1029 uint32 txprshort;
1030 uint32 txserr;
1031 uint32 txnobuf;
1032 uint32 txnoassoc;
1033 uint32 txrunt;
1034 uint32 txchit;
1035 uint32 txcmiss;
1036
1037
1038 uint32 txuflo;
1039 uint32 txphyerr;
1040 uint32 txphycrs;
1041
1042
1043 uint32 rxframe;
1044 uint32 rxbyte;
1045 uint32 rxerror;
1046 uint32 rxctl;
1047 uint32 rxnobuf;
1048 uint32 rxnondata;
1049 uint32 rxbadds;
1050 uint32 rxbadcm;
1051 uint32 rxfragerr;
1052 uint32 rxrunt;
1053 uint32 rxgiant;
1054 uint32 rxnoscb;
1055 uint32 rxbadproto;
1056 uint32 rxbadsrcmac;
1057 uint32 rxbadda;
1058 uint32 rxfilter;
1059
1060
1061 uint32 rxoflo;
1062 uint32 rxuflo[NFIFO];
1063
1064 uint32 d11cnt_txrts_off;
1065 uint32 d11cnt_rxcrc_off;
1066 uint32 d11cnt_txnocts_off;
1067
1068
1069 uint32 dmade;
1070 uint32 dmada;
1071 uint32 dmape;
1072 uint32 reset;
1073 uint32 tbtt;
1074 uint32 txdmawar;
1075 uint32 pkt_callback_reg_fail;
1076
1077
1078 uint32 txallfrm;
1079 uint32 txrtsfrm;
1080 uint32 txctsfrm;
1081 uint32 txackfrm;
1082 uint32 txdnlfrm;
1083 uint32 txbcnfrm;
1084 uint32 txfunfl[8];
1085 uint32 txtplunfl;
1086 uint32 txphyerror;
1087 uint32 rxfrmtoolong;
1088 uint32 rxfrmtooshrt;
1089 uint32 rxinvmachdr;
1090 uint32 rxbadfcs;
1091 uint32 rxbadplcp;
1092 uint32 rxcrsglitch;
1093 uint32 rxstrt;
1094 uint32 rxdfrmucastmbss;
1095 uint32 rxmfrmucastmbss;
1096 uint32 rxcfrmucast;
1097 uint32 rxrtsucast;
1098 uint32 rxctsucast;
1099 uint32 rxackucast;
1100 uint32 rxdfrmocast;
1101 uint32 rxmfrmocast;
1102 uint32 rxcfrmocast;
1103 uint32 rxrtsocast;
1104 uint32 rxctsocast;
1105 uint32 rxdfrmmcast;
1106 uint32 rxmfrmmcast;
1107 uint32 rxcfrmmcast;
1108 uint32 rxbeaconmbss;
1109 uint32 rxdfrmucastobss;
1110 uint32 rxbeaconobss;
1111 uint32 rxrsptmout;
1112 uint32 bcntxcancl;
1113 uint32 rxf0ovfl;
1114 uint32 rxf1ovfl;
1115 uint32 rxf2ovfl;
1116 uint32 txsfovfl;
1117 uint32 pmqovfl;
1118 uint32 rxcgprqfrm;
1119 uint32 rxcgprsqovfl;
1120 uint32 txcgprsfail;
1121 uint32 txcgprssuc;
1122 uint32 prs_timeout;
1123 uint32 rxnack;
1124 uint32 frmscons;
1125 uint32 txnack;
1126 uint32 txglitch_nack;
1127 uint32 txburst;
1128
1129
1130 uint32 txfrag;
1131 uint32 txmulti;
1132 uint32 txfail;
1133 uint32 txretry;
1134 uint32 txretrie;
1135 uint32 rxdup;
1136 uint32 txrts;
1137 uint32 txnocts;
1138 uint32 txnoack;
1139 uint32 rxfrag;
1140 uint32 rxmulti;
1141 uint32 rxcrc;
1142 uint32 txfrmsnt;
1143 uint32 rxundec;
1144
1145
1146 uint32 tkipmicfaill;
1147 uint32 tkipcntrmsr;
1148 uint32 tkipreplay;
1149 uint32 ccmpfmterr;
1150 uint32 ccmpreplay;
1151 uint32 ccmpundec;
1152 uint32 fourwayfail;
1153 uint32 wepundec;
1154 uint32 wepicverr;
1155 uint32 decsuccess;
1156 uint32 tkipicverr;
1157 uint32 wepexcluded;
1158
1159 uint32 txchanrej;
1160 uint32 psmwds;
1161 uint32 phywatchdog;
1162
1163
1164 uint32 prq_entries_handled;
1165 uint32 prq_undirected_entries;
1166 uint32 prq_bad_entries;
1167 uint32 atim_suppress_count;
1168 uint32 bcn_template_not_ready;
1169 uint32 bcn_template_not_ready_done;
1170 uint32 late_tbtt_dpc;
1171
1172
1173 uint32 rx1mbps;
1174 uint32 rx2mbps;
1175 uint32 rx5mbps5;
1176 uint32 rx6mbps;
1177 uint32 rx9mbps;
1178 uint32 rx11mbps;
1179 uint32 rx12mbps;
1180 uint32 rx18mbps;
1181 uint32 rx24mbps;
1182 uint32 rx36mbps;
1183 uint32 rx48mbps;
1184 uint32 rx54mbps;
1185 uint32 rx108mbps;
1186 uint32 rx162mbps;
1187 uint32 rx216mbps;
1188 uint32 rx270mbps;
1189 uint32 rx324mbps;
1190 uint32 rx378mbps;
1191 uint32 rx432mbps;
1192 uint32 rx486mbps;
1193 uint32 rx540mbps;
1194
1195 uint32 pktengrxducast;
1196 uint32 pktengrxdmcast;
1197} wl_cnt_t;
1198
1199typedef struct {
1200 uint16 version;
1201 uint16 length;
1202
1203 uint32 rxampdu_sgi;
1204 uint32 rxampdu_stbc;
1205 uint32 rxmpdu_sgi;
1206 uint32 rxmpdu_stbc;
1207 uint32 rxmcs0_40M;
1208 uint32 rxmcs1_40M;
1209 uint32 rxmcs2_40M;
1210 uint32 rxmcs3_40M;
1211 uint32 rxmcs4_40M;
1212 uint32 rxmcs5_40M;
1213 uint32 rxmcs6_40M;
1214 uint32 rxmcs7_40M;
1215 uint32 rxmcs32_40M;
1216
1217 uint32 txfrmsnt_20Mlo;
1218 uint32 txfrmsnt_20Mup;
1219 uint32 txfrmsnt_40M;
1220
1221 uint32 rx_20ul;
1222} wl_cnt_ext_t;
1223
1224#define WL_RXDIV_STATS_T_VERSION 1
1225typedef struct {
1226 uint16 version;
1227 uint16 length;
1228
1229 uint32 rxant[4];
1230} wl_rxdiv_stats_t;
1231
1232#define WL_DELTA_STATS_T_VERSION 1
1233
1234typedef struct {
1235 uint16 version;
1236 uint16 length;
1237
1238
1239 uint32 txframe;
1240 uint32 txbyte;
1241 uint32 txretrans;
1242 uint32 txfail;
1243
1244
1245 uint32 rxframe;
1246 uint32 rxbyte;
1247
1248
1249 uint32 rx1mbps;
1250 uint32 rx2mbps;
1251 uint32 rx5mbps5;
1252 uint32 rx6mbps;
1253 uint32 rx9mbps;
1254 uint32 rx11mbps;
1255 uint32 rx12mbps;
1256 uint32 rx18mbps;
1257 uint32 rx24mbps;
1258 uint32 rx36mbps;
1259 uint32 rx48mbps;
1260 uint32 rx54mbps;
1261 uint32 rx108mbps;
1262 uint32 rx162mbps;
1263 uint32 rx216mbps;
1264 uint32 rx270mbps;
1265 uint32 rx324mbps;
1266 uint32 rx378mbps;
1267 uint32 rx432mbps;
1268 uint32 rx486mbps;
1269 uint32 rx540mbps;
1270} wl_delta_stats_t;
1271
1272#define WL_WME_CNT_VERSION 1
1273
1274typedef struct {
1275 uint32 packets;
1276 uint32 bytes;
1277} wl_traffic_stats_t;
1278
1279typedef struct {
1280 uint16 version;
1281 uint16 length;
1282
1283 wl_traffic_stats_t tx[AC_COUNT];
1284 wl_traffic_stats_t tx_failed[AC_COUNT];
1285 wl_traffic_stats_t rx[AC_COUNT];
1286 wl_traffic_stats_t rx_failed[AC_COUNT];
1287
1288 wl_traffic_stats_t forward[AC_COUNT];
1289
1290 wl_traffic_stats_t tx_expired[AC_COUNT];
1291
1292} wl_wme_cnt_t;
1293
1294
1295
1296#define WLC_ROAM_TRIGGER_DEFAULT 0
1297#define WLC_ROAM_TRIGGER_BANDWIDTH 1
1298#define WLC_ROAM_TRIGGER_DISTANCE 2
1299#define WLC_ROAM_TRIGGER_MAX_VALUE 2
1300
1301
1302enum {
1303 PFN_LIST_ORDER,
1304 PFN_RSSI
1305};
1306
1307enum {
1308 DISABLE,
1309 ENABLE
1310};
1311
1312#define SORT_CRITERIA_BIT 0
1313#define AUTO_NET_SWITCH_BIT 1
1314#define ENABLE_BKGRD_SCAN_BIT 2
1315#define IMMEDIATE_SCAN_BIT 3
1316#define AUTO_CONNECT_BIT 4
1317#define ENABLE_BD_SCAN_BIT 5
1318#define ENABLE_ADAPTSCAN_BIT 6
1319
1320#define SORT_CRITERIA_MASK 0x01
1321#define AUTO_NET_SWITCH_MASK 0x02
1322#define ENABLE_BKGRD_SCAN_MASK 0x04
1323#define IMMEDIATE_SCAN_MASK 0x08
1324#define AUTO_CONNECT_MASK 0x10
1325#define ENABLE_BD_SCAN_MASK 0x20
1326#define ENABLE_ADAPTSCAN_MASK 0x40
1327
1328#define PFN_VERSION 1
1329
1330#define MAX_PFN_LIST_COUNT 16
1331
1332
1333typedef struct wl_pfn_param {
1334 int32 version;
1335 int32 scan_freq;
1336 int32 lost_network_timeout;
1337 int16 flags;
1338 int16 rssi_margin;
1339 int32 repeat_scan;
1340 int32 max_freq_adjust;
1341} wl_pfn_param_t;
1342
1343typedef struct wl_pfn {
1344 wlc_ssid_t ssid;
1345 int32 bss_type;
1346 int32 infra;
1347 int32 auth;
1348 uint32 wpa_auth;
1349 int32 wsec;
1350} wl_pfn_t;
1351
1352#define PNO_SCAN_MAX_FW 508*1000
1353#define PNO_SCAN_MAX_FW_SEC PNO_SCAN_MAX_FW/1000
1354#define PNO_SCAN_MIN_FW_SEC 10
1355
1356
1357#define TOE_TX_CSUM_OL 0x00000001
1358#define TOE_RX_CSUM_OL 0x00000002
1359
1360
1361#define TOE_ERRTEST_TX_CSUM 0x00000001
1362#define TOE_ERRTEST_RX_CSUM 0x00000002
1363#define TOE_ERRTEST_RX_CSUM2 0x00000004
1364
1365struct toe_ol_stats_t {
1366
1367 uint32 tx_summed;
1368
1369
1370 uint32 tx_iph_fill;
1371 uint32 tx_tcp_fill;
1372 uint32 tx_udp_fill;
1373 uint32 tx_icmp_fill;
1374
1375
1376 uint32 rx_iph_good;
1377 uint32 rx_iph_bad;
1378 uint32 rx_tcp_good;
1379 uint32 rx_tcp_bad;
1380 uint32 rx_udp_good;
1381 uint32 rx_udp_bad;
1382 uint32 rx_icmp_good;
1383 uint32 rx_icmp_bad;
1384
1385
1386 uint32 tx_tcp_errinj;
1387 uint32 tx_udp_errinj;
1388 uint32 tx_icmp_errinj;
1389
1390
1391 uint32 rx_tcp_errinj;
1392 uint32 rx_udp_errinj;
1393 uint32 rx_icmp_errinj;
1394};
1395
1396
1397#define ARP_OL_AGENT 0x00000001
1398#define ARP_OL_SNOOP 0x00000002
1399#define ARP_OL_HOST_AUTO_REPLY 0x00000004
1400#define ARP_OL_PEER_AUTO_REPLY 0x00000008
1401
1402
1403#define ARP_ERRTEST_REPLY_PEER 0x1
1404#define ARP_ERRTEST_REPLY_HOST 0x2
1405
1406#define ARP_MULTIHOMING_MAX 8
1407
1408
1409struct arp_ol_stats_t {
1410 uint32 host_ip_entries;
1411 uint32 host_ip_overflow;
1412
1413 uint32 arp_table_entries;
1414 uint32 arp_table_overflow;
1415
1416 uint32 host_request;
1417 uint32 host_reply;
1418 uint32 host_service;
1419
1420 uint32 peer_request;
1421 uint32 peer_request_drop;
1422 uint32 peer_reply;
1423 uint32 peer_reply_drop;
1424 uint32 peer_service;
1425};
1426
1427
1428
1429
1430
1431typedef struct wl_keep_alive_pkt {
1432 uint32 period_msec;
1433 uint16 len_bytes;
1434 uint8 data[1];
1435} wl_keep_alive_pkt_t;
1436
1437#define WL_KEEP_ALIVE_FIXED_LEN OFFSETOF(wl_keep_alive_pkt_t, data)
1438
1439
1440
1441
1442
1443typedef enum wl_pkt_filter_type {
1444 WL_PKT_FILTER_TYPE_PATTERN_MATCH
1445} wl_pkt_filter_type_t;
1446
1447#define WL_PKT_FILTER_TYPE wl_pkt_filter_type_t
1448
1449
1450typedef struct wl_pkt_filter_pattern {
1451 uint32 offset;
1452 uint32 size_bytes;
1453 uint8 mask_and_pattern[1];
1454} wl_pkt_filter_pattern_t;
1455
1456
1457typedef struct wl_pkt_filter {
1458 uint32 id;
1459 uint32 type;
1460 uint32 negate_match;
1461 union {
1462 wl_pkt_filter_pattern_t pattern;
1463 } u;
1464} wl_pkt_filter_t;
1465
1466#define WL_PKT_FILTER_FIXED_LEN OFFSETOF(wl_pkt_filter_t, u)
1467#define WL_PKT_FILTER_PATTERN_FIXED_LEN OFFSETOF(wl_pkt_filter_pattern_t, mask_and_pattern)
1468
1469
1470typedef struct wl_pkt_filter_enable {
1471 uint32 id;
1472 uint32 enable;
1473} wl_pkt_filter_enable_t;
1474
1475
1476typedef struct wl_pkt_filter_list {
1477 uint32 num;
1478 wl_pkt_filter_t filter[1];
1479} wl_pkt_filter_list_t;
1480
1481#define WL_PKT_FILTER_LIST_FIXED_LEN OFFSETOF(wl_pkt_filter_list_t, filter)
1482
1483
1484typedef struct wl_pkt_filter_stats {
1485 uint32 num_pkts_matched;
1486 uint32 num_pkts_forwarded;
1487 uint32 num_pkts_discarded;
1488} wl_pkt_filter_stats_t;
1489
1490
1491typedef struct wl_seq_cmd_ioctl {
1492 uint32 cmd;
1493 uint32 len;
1494} wl_seq_cmd_ioctl_t;
1495
1496#define WL_SEQ_CMD_ALIGN_BYTES 4
1497
1498
1499#define WL_SEQ_CMDS_GET_IOCTL_FILTER(cmd) \
1500 (((cmd) == WLC_GET_MAGIC) || \
1501 ((cmd) == WLC_GET_VERSION) || \
1502 ((cmd) == WLC_GET_AP) || \
1503 ((cmd) == WLC_GET_INSTANCE))
1504
1505
1506
1507#define WL_PKTENG_PER_TX_START 0x01
1508#define WL_PKTENG_PER_TX_STOP 0x02
1509#define WL_PKTENG_PER_RX_START 0x04
1510#define WL_PKTENG_PER_RX_WITH_ACK_START 0x05
1511#define WL_PKTENG_PER_TX_WITH_ACK_START 0x06
1512#define WL_PKTENG_PER_RX_STOP 0x08
1513#define WL_PKTENG_PER_MASK 0xff
1514
1515#define WL_PKTENG_SYNCHRONOUS 0x100
1516
1517typedef struct wl_pkteng {
1518 uint32 flags;
1519 uint32 delay;
1520 uint32 nframes;
1521 uint32 length;
1522 uint8 seqno;
1523 struct ether_addr dest;
1524 struct ether_addr src;
1525} wl_pkteng_t;
1526
1527#define NUM_80211b_RATES 4
1528#define NUM_80211ag_RATES 8
1529#define NUM_80211n_RATES 32
1530#define NUM_80211_RATES (NUM_80211b_RATES+NUM_80211ag_RATES+NUM_80211n_RATES)
1531typedef struct wl_pkteng_stats {
1532 uint32 lostfrmcnt;
1533 int32 rssi;
1534 int32 snr;
1535 uint16 rxpktcnt[NUM_80211_RATES+1];
1536} wl_pkteng_stats_t;
1537
1538#define WL_WOWL_MAGIC (1 << 0)
1539#define WL_WOWL_NET (1 << 1)
1540#define WL_WOWL_DIS (1 << 2)
1541#define WL_WOWL_RETR (1 << 3)
1542#define WL_WOWL_BCN (1 << 4)
1543#define WL_WOWL_TST (1 << 5)
1544#define WL_WOWL_BCAST (1 << 15)
1545
1546#define MAGIC_PKT_MINLEN 102
1547
1548typedef struct {
1549 uint masksize;
1550 uint offset;
1551 uint patternoffset;
1552 uint patternsize;
1553
1554
1555} wl_wowl_pattern_t;
1556
1557typedef struct {
1558 uint count;
1559 wl_wowl_pattern_t pattern[1];
1560} wl_wowl_pattern_list_t;
1561
1562typedef struct {
1563 uint8 pci_wakeind;
1564 uint16 ucode_wakeind;
1565} wl_wowl_wakeind_t;
1566
1567
1568typedef struct wl_txrate_class {
1569 uint8 init_rate;
1570 uint8 min_rate;
1571 uint8 max_rate;
1572} wl_txrate_class_t;
1573
1574
1575
1576
1577#define WLC_OBSS_SCAN_PASSIVE_DWELL_DEFAULT 100
1578#define WLC_OBSS_SCAN_PASSIVE_DWELL_MIN 5
1579#define WLC_OBSS_SCAN_PASSIVE_DWELL_MAX 1000
1580#define WLC_OBSS_SCAN_ACTIVE_DWELL_DEFAULT 20
1581#define WLC_OBSS_SCAN_ACTIVE_DWELL_MIN 10
1582#define WLC_OBSS_SCAN_ACTIVE_DWELL_MAX 1000
1583#define WLC_OBSS_SCAN_WIDTHSCAN_INTERVAL_DEFAULT 300
1584#define WLC_OBSS_SCAN_WIDTHSCAN_INTERVAL_MIN 10
1585#define WLC_OBSS_SCAN_WIDTHSCAN_INTERVAL_MAX 900
1586#define WLC_OBSS_SCAN_CHANWIDTH_TRANSITION_DLY_DEFAULT 5
1587#define WLC_OBSS_SCAN_CHANWIDTH_TRANSITION_DLY_MIN 5
1588#define WLC_OBSS_SCAN_CHANWIDTH_TRANSITION_DLY_MAX 100
1589#define WLC_OBSS_SCAN_PASSIVE_TOTAL_PER_CHANNEL_DEFAULT 200
1590#define WLC_OBSS_SCAN_PASSIVE_TOTAL_PER_CHANNEL_MIN 200
1591#define WLC_OBSS_SCAN_PASSIVE_TOTAL_PER_CHANNEL_MAX 10000
1592#define WLC_OBSS_SCAN_ACTIVE_TOTAL_PER_CHANNEL_DEFAULT 20
1593#define WLC_OBSS_SCAN_ACTIVE_TOTAL_PER_CHANNEL_MIN 20
1594#define WLC_OBSS_SCAN_ACTIVE_TOTAL_PER_CHANNEL_MAX 10000
1595#define WLC_OBSS_SCAN_ACTIVITY_THRESHOLD_DEFAULT 25
1596#define WLC_OBSS_SCAN_ACTIVITY_THRESHOLD_MIN 0
1597#define WLC_OBSS_SCAN_ACTIVITY_THRESHOLD_MAX 100
1598
1599
1600typedef struct wl_obss_scan_arg {
1601 int16 passive_dwell;
1602 int16 active_dwell;
1603 int16 bss_widthscan_interval;
1604 int16 passive_total;
1605 int16 active_total;
1606 int16 chanwidth_transition_delay;
1607 int16 activity_threshold;
1608} wl_obss_scan_arg_t;
1609#define WL_OBSS_SCAN_PARAM_LEN sizeof(wl_obss_scan_arg_t)
1610#define WL_MIN_NUM_OBSS_SCAN_ARG 7
1611
1612#define WL_COEX_INFO_MASK 0x07
1613#define WL_COEX_INFO_REQ 0x01
1614#define WL_COEX_40MHZ_INTOLERANT 0x02
1615#define WL_COEX_WIDTH20 0x04
1616
1617typedef struct wl_action_obss_coex_req {
1618 uint8 info;
1619 uint8 num;
1620 uint8 ch_list[1];
1621} wl_action_obss_coex_req_t;
1622
1623
1624#define MAX_RSSI_LEVELS 8
1625
1626
1627typedef struct wl_rssi_event {
1628
1629 uint32 rate_limit_msec;
1630
1631 uint8 num_rssi_levels;
1632
1633 int8 rssi_levels[MAX_RSSI_LEVELS];
1634} wl_rssi_event_t;
1635
1636
1637
1638#define WLFEATURE_DISABLE_11N 0x00000001
1639#define WLFEATURE_DISABLE_11N_STBC_TX 0x00000002
1640#define WLFEATURE_DISABLE_11N_STBC_RX 0x00000004
1641#define WLFEATURE_DISABLE_11N_SGI_TX 0x00000008
1642#define WLFEATURE_DISABLE_11N_SGI_RX 0x00000010
1643#define WLFEATURE_DISABLE_11N_AMPDU_TX 0x00000020
1644#define WLFEATURE_DISABLE_11N_AMPDU_RX 0x00000040
1645#define WLFEATURE_DISABLE_11N_GF 0x00000080
1646
1647
1648
1649#include <packed_section_end.h>
1650
1651
1652#include <packed_section_start.h>
1653
1654
1655typedef BWL_PRE_PACKED_STRUCT struct sta_prbreq_wps_ie_hdr {
1656 struct ether_addr staAddr;
1657 uint16 ieLen;
1658} BWL_POST_PACKED_STRUCT sta_prbreq_wps_ie_hdr_t;
1659
1660typedef BWL_PRE_PACKED_STRUCT struct sta_prbreq_wps_ie_data {
1661 sta_prbreq_wps_ie_hdr_t hdr;
1662 uint8 ieData[1];
1663} BWL_POST_PACKED_STRUCT sta_prbreq_wps_ie_data_t;
1664
1665typedef BWL_PRE_PACKED_STRUCT struct sta_prbreq_wps_ie_list {
1666 uint32 totLen;
1667 uint8 ieDataList[1];
1668} BWL_POST_PACKED_STRUCT sta_prbreq_wps_ie_list_t;
1669
1670
1671#include <packed_section_end.h>
1672
1673#endif