aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/bcmdhd/include/bcmdefs.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/bcmdhd/include/bcmdefs.h')
-rw-r--r--drivers/net/wireless/bcmdhd/include/bcmdefs.h196
1 files changed, 196 insertions, 0 deletions
diff --git a/drivers/net/wireless/bcmdhd/include/bcmdefs.h b/drivers/net/wireless/bcmdhd/include/bcmdefs.h
new file mode 100644
index 00000000000..da1fd5e4eac
--- /dev/null
+++ b/drivers/net/wireless/bcmdhd/include/bcmdefs.h
@@ -0,0 +1,196 @@
1/*
2 * Misc system wide definitions
3 *
4 * Copyright (C) 1999-2011, 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: bcmdefs.h,v 13.68.2.8 2011-01-08 04:04:19 Exp $
25 */
26
27
28#ifndef _bcmdefs_h_
29#define _bcmdefs_h_
30
31
32
33#define bcmreclaimed 0
34#define _data _data
35#define _fn _fn
36#define _data _data
37#define _fn _fn
38#define _fn _fn
39#define CONST const
40#define BCMFASTPATH
41
42
43
44
45#define _data _data
46#define _fn _fn
47#define _fn _fn
48#define STATIC static
49
50
51#define SI_BUS 0
52#define PCI_BUS 1
53#define PCMCIA_BUS 2
54#define SDIO_BUS 3
55#define JTAG_BUS 4
56#define USB_BUS 5
57#define SPI_BUS 6
58#define RPC_BUS 7
59
60
61#ifdef BCMBUSTYPE
62#define BUSTYPE(bus) (BCMBUSTYPE)
63#else
64#define BUSTYPE(bus) (bus)
65#endif
66
67
68#ifdef BCMCHIPTYPE
69#define CHIPTYPE(bus) (BCMCHIPTYPE)
70#else
71#define CHIPTYPE(bus) (bus)
72#endif
73
74
75
76#if defined(BCMSPROMBUS)
77#define SPROMBUS (BCMSPROMBUS)
78#elif defined(SI_PCMCIA_SROM)
79#define SPROMBUS (PCMCIA_BUS)
80#else
81#define SPROMBUS (PCI_BUS)
82#endif
83
84
85#ifdef BCMCHIPID
86#define CHIPID(chip) (BCMCHIPID)
87#else
88#define CHIPID(chip) (chip)
89#endif
90
91#ifdef BCMCHIPREV
92#define CHIPREV(rev) (BCMCHIPREV)
93#else
94#define CHIPREV(rev) (rev)
95#endif
96
97
98#define DMADDR_MASK_32 0x0
99#define DMADDR_MASK_30 0xc0000000
100#define DMADDR_MASK_0 0xffffffff
101
102#define DMADDRWIDTH_30 30
103#define DMADDRWIDTH_32 32
104#define DMADDRWIDTH_63 63
105#define DMADDRWIDTH_64 64
106
107#ifdef BCMDMA64OSL
108typedef struct {
109 uint32 loaddr;
110 uint32 hiaddr;
111} dma64addr_t;
112
113typedef dma64addr_t dmaaddr_t;
114#define PHYSADDRHI(_pa) ((_pa).hiaddr)
115#define PHYSADDRHISET(_pa, _val) \
116 do { \
117 (_pa).hiaddr = (_val); \
118 } while (0)
119#define PHYSADDRLO(_pa) ((_pa).loaddr)
120#define PHYSADDRLOSET(_pa, _val) \
121 do { \
122 (_pa).loaddr = (_val); \
123 } while (0)
124
125#else
126typedef unsigned long dmaaddr_t;
127#define PHYSADDRHI(_pa) (0)
128#define PHYSADDRHISET(_pa, _val)
129#define PHYSADDRLO(_pa) ((_pa))
130#define PHYSADDRLOSET(_pa, _val) \
131 do { \
132 (_pa) = (_val); \
133 } while (0)
134#endif
135
136
137typedef struct {
138 dmaaddr_t addr;
139 uint32 length;
140} hnddma_seg_t;
141
142#define MAX_DMA_SEGS 4
143
144
145typedef struct {
146 void *oshdmah;
147 uint origsize;
148 uint nsegs;
149 hnddma_seg_t segs[MAX_DMA_SEGS];
150} hnddma_seg_map_t;
151
152
153
154
155#if defined(BCM_RPC_NOCOPY) || defined(BCM_RCP_TXNOCOPY)
156
157#define BCMEXTRAHDROOM 220
158#else
159#define BCMEXTRAHDROOM 172
160#endif
161
162
163#define BCMDONGLEHDRSZ 12
164#define BCMDONGLEPADSZ 16
165
166#define BCMDONGLEOVERHEAD (BCMDONGLEHDRSZ + BCMDONGLEPADSZ)
167
168
169#if defined(BCMASSERT_LOG)
170#define BCMASSERT_SUPPORT
171#endif
172
173
174#define BITFIELD_MASK(width) \
175 (((unsigned)1 << (width)) - 1)
176#define GFIELD(val, field) \
177 (((val) >> field ## _S) & field ## _M)
178#define SFIELD(val, field, bits) \
179 (((val) & (~(field ## _M << field ## _S))) | \
180 ((unsigned)(bits) << field ## _S))
181
182
183#ifdef BCMSMALL
184#undef BCMSPACE
185#define bcmspace FALSE
186#else
187#define BCMSPACE
188#define bcmspace TRUE
189#endif
190
191
192#define MAXSZ_NVRAM_VARS 4096
193
194#define LOCATOR_EXTERN static
195
196#endif