2 * Misc system wide definitions
4 * Copyright (C) 1999-2011, Broadcom Corporation
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:
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.
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.
24 * $Id: bcmdefs.h 279282 2011-08-23 22:44:02Z $
34 #define BCM_REFERENCE(data) ((void)(data))
38 #define bcmreclaimed 0
41 #define BCMPREATTACHDATA(_data) _data
42 #define BCMPREATTACHFN(_fn) _fn
46 #define BCMNMIATTACHFN(_fn) _fn
47 #define BCMNMIATTACHDATA(_data) _data
48 #define BCMOVERLAY0DATA(_sym) _sym
49 #define BCMOVERLAY0FN(_fn) _fn
50 #define BCMOVERLAY1DATA(_sym) _sym
51 #define BCMOVERLAY1FN(_fn) _fn
52 #define BCMOVERLAYERRFN(_fn) _fn
60 #define BCMROMDAT_NAME(_data) _data
64 #define BCMROMDAT_ARYSIZ(data) ARRAYSIZE(data)
65 #define BCMROMDAT_SIZEOF(data) sizeof(data)
66 #define BCMROMDAT_APATCH(data)
67 #define BCMROMDAT_SPATCH(data)
71 #define OVERLAY_INLINE
72 #define OSTATIC static
73 #define BCMOVERLAYDATA(_ovly, _sym) _sym
74 #define BCMOVERLAYFN(_ovly, _fn) _fn
75 #define BCMOVERLAYERRFN(_fn) _fn
76 #define BCMROMOVERLAYDATA(_ovly, _data) _data
77 #define BCMROMOVERLAYFN(_ovly, _fn) _fn
78 #define BCMATTACHOVERLAYDATA(_ovly, _sym) _sym
79 #define BCMATTACHOVERLAYFN(_ovly, _fn) _fn
80 #define BCMINITOVERLAYDATA(_ovly, _sym) _sym
81 #define BCMINITOVERLAYFN(_ovly, _fn) _fn
82 #define BCMUNINITOVERLAYFN(_ovly, _fn) _fn
97 #define BUSTYPE(bus) (BCMBUSTYPE)
99 #define BUSTYPE(bus) (bus)
104 #define CHIPTYPE(bus) (BCMCHIPTYPE)
106 #define CHIPTYPE(bus) (bus)
111 #if defined(BCMSPROMBUS)
112 #define SPROMBUS (BCMSPROMBUS)
113 #elif defined(SI_PCMCIA_SROM)
114 #define SPROMBUS (PCMCIA_BUS)
116 #define SPROMBUS (PCI_BUS)
121 #define CHIPID(chip) (BCMCHIPID)
123 #define CHIPID(chip) (chip)
127 #define CHIPREV(rev) (BCMCHIPREV)
129 #define CHIPREV(rev) (rev)
133 #define DMADDR_MASK_32 0x0
134 #define DMADDR_MASK_30 0xc0000000
135 #define DMADDR_MASK_0 0xffffffff
137 #define DMADDRWIDTH_30 30
138 #define DMADDRWIDTH_32 32
139 #define DMADDRWIDTH_63 63
140 #define DMADDRWIDTH_64 64
148 typedef dma64addr_t dmaaddr_t;
149 #define PHYSADDRHI(_pa) ((_pa).hiaddr)
150 #define PHYSADDRHISET(_pa, _val) \
152 (_pa).hiaddr = (_val); \
154 #define PHYSADDRLO(_pa) ((_pa).loaddr)
155 #define PHYSADDRLOSET(_pa, _val) \
157 (_pa).loaddr = (_val); \
161 typedef unsigned long dmaaddr_t;
162 #define PHYSADDRHI(_pa) (0)
163 #define PHYSADDRHISET(_pa, _val)
164 #define PHYSADDRLO(_pa) ((_pa))
165 #define PHYSADDRLOSET(_pa, _val) \
177 #define MAX_DMA_SEGS 4
184 hnddma_seg_t segs[MAX_DMA_SEGS];
190 #if defined(BCM_RPC_NOCOPY) || defined(BCM_RCP_TXNOCOPY)
192 #define BCMEXTRAHDROOM 220
194 #define BCMEXTRAHDROOM 172
198 #define BCMDONGLEHDRSZ 12
199 #define BCMDONGLEPADSZ 16
201 #define BCMDONGLEOVERHEAD (BCMDONGLEHDRSZ + BCMDONGLEPADSZ)
204 #if defined(BCMASSERT_LOG)
205 #define BCMASSERT_SUPPORT
209 #define BITFIELD_MASK(width) \
210 (((unsigned)1 << (width)) - 1)
211 #define GFIELD(val, field) \
212 (((val) >> field ## _S) & field ## _M)
213 #define SFIELD(val, field, bits) \
214 (((val) & (~(field ## _M << field ## _S))) | \
215 ((unsigned)(bits) << field ## _S))
220 #define bcmspace FALSE
223 #define bcmspace TRUE
227 #define MAXSZ_NVRAM_VARS 4096
229 #define LOCATOR_EXTERN static