forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/net/wireless/rockchip_wlan/cywdhd/bcmdhd/include/bcmdefs.h
....@@ -1,15 +1,16 @@
1
-/* SPDX-License-Identifier: GPL-2.0 */
21 /*
32 * Misc system wide definitions
43 *
5
- * Copyright (C) 1999-2019, Broadcom Corporation
6
- *
4
+ * Portions of this code are copyright (c) 2022 Cypress Semiconductor Corporation
5
+ *
6
+ * Copyright (C) 1999-2017, Broadcom Corporation
7
+ *
78 * Unless you and Broadcom execute a separate written software license
89 * agreement governing use of this software, this software is licensed to you
910 * under the terms of the GNU General Public License version 2 (the "GPL"),
1011 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
1112 * following added to such license:
12
- *
13
+ *
1314 * As a special exception, the copyright holders of this software give you
1415 * permission to link this software with independent modules, and to copy and
1516 * distribute the resulting executable under terms of your choice, provided that
....@@ -17,7 +18,7 @@
1718 * the license of that module. An independent module is a module which is not
1819 * derived from this software. The special exception does not apply to any
1920 * modifications of the software.
20
- *
21
+ *
2122 * Notwithstanding the above, under no circumstances may you combine this
2223 * software in any way with any other Broadcom software provided under a license
2324 * other than the GPL, without Broadcom's express prior written consent.
....@@ -25,7 +26,7 @@
2526 *
2627 * <<Broadcom-WL-IPTag/Open:>>
2728 *
28
- * $Id: bcmdefs.h 715966 2019-05-30 02:36:59Z $
29
+ * $Id: bcmdefs.h 700870 2017-05-22 19:05:22Z $
2930 */
3031
3132 #ifndef _bcmdefs_h_
....@@ -40,23 +41,58 @@
4041 * arguments or local variables.
4142 */
4243 #define BCM_REFERENCE(data) ((void)(data))
43
-
44
+#include <linux/compiler.h>
4445 /* Allow for suppressing unused variable warnings. */
4546 #ifdef __GNUC__
4647 #define UNUSED_VAR __attribute__ ((unused))
4748 #else
4849 #define UNUSED_VAR
49
-#endif
50
+#endif // endif
5051
52
+/* GNU GCC 4.6+ supports selectively turning off a warning.
53
+ * Define these diagnostic macros to help suppress cast-qual warning
54
+ * until all the work can be done to fix the casting issues.
55
+ */
56
+#if (defined(__GNUC__) && defined(STRICT_GCC_WARNINGS) && (__GNUC__ > 4 || (__GNUC__ == \
57
+ 4 && __GNUC_MINOR__ >= 6)))
58
+#define GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST() \
59
+ _Pragma("GCC diagnostic push") \
60
+ _Pragma("GCC diagnostic ignored \"-Wcast-qual\"")
61
+#define GCC_DIAGNOSTIC_POP() \
62
+ _Pragma("GCC diagnostic pop")
63
+#else
64
+#define GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST()
65
+#define GCC_DIAGNOSTIC_POP()
66
+#endif /* Diagnostic macros not defined */
67
+
68
+/* Support clang for MACOSX compiler */
69
+#ifdef __clang__
70
+#define CLANG_DIAGNOSTIC_PUSH_SUPPRESS_CAST() \
71
+ _Pragma("clang diagnostic push") \
72
+ _Pragma("clang diagnostic ignored \"-Wcast-qual\"")
73
+#define CLANG_DIAGNOSTIC_PUSH_SUPPRESS_FORMAT() \
74
+ _Pragma("clang diagnostic push") \
75
+ _Pragma("clang diagnostic ignored \"-Wformat-nonliteral\"")
76
+#define CLANG_DIAGNOSTIC_POP() \
77
+ _Pragma("clang diagnostic pop")
78
+#else
79
+#define CLANG_DIAGNOSTIC_PUSH_SUPPRESS_CAST()
80
+#define CLANG_DIAGNOSTIC_PUSH_SUPPRESS_FORMAT()
81
+#define CLANG_DIAGNOSTIC_POP()
82
+#endif // endif
5183 /* Compile-time assert can be used in place of ASSERT if the expression evaluates
5284 * to a constant at compile time.
5385 */
86
+#if (__GNUC__ <= 4 && __GNUC_MINOR__ >= 4)
5487 #define STATIC_ASSERT(expr) { \
5588 /* Make sure the expression is constant. */ \
5689 typedef enum { _STATIC_ASSERT_NOT_CONSTANT = (expr) } _static_assert_e UNUSED_VAR; \
5790 /* Make sure the expression is true. */ \
5891 typedef char STATIC_ASSERT_FAIL[(expr) ? 1 : -1] UNUSED_VAR; \
5992 }
93
+#else
94
+#define STATIC_ASSERT(expr) compiletime_assert(expr, "Compile time condition failure");
95
+#endif /* __GNUC__ <= 4 && __GNUC_MINOR__ >= 4 */
6096
6197 /* Reclaiming text and data :
6298 * The following macros specify special linker sections that can be reclaimed
....@@ -64,33 +100,173 @@
64100 * BCMATTACHFN is also used for detach functions (it's not worth having a BCMDETACHFN,
65101 * as in most cases, the attach function calls the detach function to clean up on error).
66102 */
103
+#if defined(BCM_RECLAIM)
67104
68
-#define bcmreclaimed 0
105
+extern bool bcm_reclaimed;
106
+extern bool bcm_attach_part_reclaimed;
107
+extern bool bcm_preattach_part_reclaimed;
108
+extern bool bcm_postattach_part_reclaimed;
109
+
110
+#define RECLAIMED() (bcm_reclaimed)
111
+#define ATTACH_PART_RECLAIMED() (bcm_attach_part_reclaimed)
112
+#define PREATTACH_PART_RECLAIMED() (bcm_preattach_part_reclaimed)
113
+#define POSTATTACH_PART_RECLAIMED() (bcm_postattach_part_reclaimed)
114
+
115
+#if defined(BCM_RECLAIM_ATTACH_FN_DATA)
116
+#define _data __attribute__ ((__section__ (".dataini2." #_data))) _data
117
+#define _fn __attribute__ ((__section__ (".textini2." #_fn), noinline)) _fn
118
+
119
+/* Relocate attach symbols to save-restore region to increase pre-reclaim heap size. */
120
+#define BCM_SRM_ATTACH_DATA(_data) __attribute__ ((__section__ (".datasrm." #_data))) _data
121
+#define BCM_SRM_ATTACH_FN(_fn) __attribute__ ((__section__ (".textsrm." #_fn), noinline)) _fn
122
+
123
+#ifndef PREATTACH_NORECLAIM
124
+#define BCMPREATTACHDATA(_data) __attribute__ ((__section__ (".dataini3." #_data))) _data
125
+#define BCMPREATTACHFN(_fn) __attribute__ ((__section__ (".textini3." #_fn), noinline)) _fn
126
+#else
127
+#define BCMPREATTACHDATA(_data) __attribute__ ((__section__ (".dataini2." #_data))) _data
128
+#define BCMPREATTACHFN(_fn) __attribute__ ((__section__ (".textini2." #_fn), noinline)) _fn
129
+#endif /* PREATTACH_NORECLAIM */
130
+#define BCMPOSTATTACHDATA(_data) __attribute__ ((__section__ (".dataini5." #_data))) _data
131
+#define BCMPOSTATTACHFN(_fn) __attribute__ ((__section__ (".textini5." #_fn), noinline)) _fn
132
+#else /* BCM_RECLAIM_ATTACH_FN_DATA */
69133 #define _data _data
70134 #define _fn _fn
71135 #define BCMPREATTACHDATA(_data) _data
72136 #define BCMPREATTACHFN(_fn) _fn
137
+#define BCMPOSTATTACHDATA(_data) _data
138
+#define BCMPOSTATTACHFN(_fn) _fn
139
+#endif /* BCM_RECLAIM_ATTACH_FN_DATA */
140
+
141
+#ifdef BCMDBG_SR
142
+/*
143
+ * Don't reclaim so we can compare SR ASM
144
+ */
145
+#define BCMPREATTACHDATASR(_data) _data
146
+#define BCMPREATTACHFNSR(_fn) _fn
147
+#define BCMATTACHDATASR(_data) _data
148
+#define BCMATTACHFNSR(_fn) _fn
149
+#else
150
+#define BCMPREATTACHDATASR(_data) BCMPREATTACHDATA(_data)
151
+#define BCMPREATTACHFNSR(_fn) BCMPREATTACHFN(_fn)
152
+#define BCMATTACHDATASR(_data) _data
153
+#define BCMATTACHFNSR(_fn) _fn
154
+#endif // endif
155
+
156
+#if defined(BCM_RECLAIM_INIT_FN_DATA)
157
+#define _data __attribute__ ((__section__ (".dataini1." #_data))) _data
158
+#define _fn __attribute__ ((__section__ (".textini1." #_fn), noinline)) _fn
159
+#define CONST
160
+#else /* BCM_RECLAIM_INIT_FN_DATA */
73161 #define _data _data
74162 #define _fn _fn
75
-#define _fn _fn
163
+#ifndef CONST
164
+#define CONST const
165
+#endif // endif
166
+#endif /* BCM_RECLAIM_INIT_FN_DATA */
167
+
168
+/* Non-manufacture or internal attach function/dat */
76169 #define BCMNMIATTACHFN(_fn) _fn
77170 #define BCMNMIATTACHDATA(_data) _data
78
-#define CONST const
171
+
172
+#if defined(BCM_CISDUMP_NO_RECLAIM)
173
+#define BCMCISDUMPATTACHFN(_fn) _fn
174
+#define BCMCISDUMPATTACHDATA(_data) _data
175
+#else
176
+#define BCMCISDUMPATTACHFN(_fn) BCMNMIATTACHFN(_fn)
177
+#define BCMCISDUMPATTACHDATA(_data) BCMNMIATTACHDATA(_data)
178
+#endif // endif
179
+
180
+/* SROM with OTP support */
181
+#if defined(BCMOTPSROM)
182
+#define BCMSROMATTACHFN(_fn) _fn
183
+#define BCMSROMATTACHDATA(_data) _data
184
+#else
185
+#define BCMSROMATTACHFN(_fn) BCMNMIATTACHFN(_fn)
186
+#define BCMSROMATTACHDATA(_data) BCMNMIATTACHFN(_data)
187
+#endif /* BCMOTPSROM */
188
+
189
+#if defined(BCM_CISDUMP_NO_RECLAIM)
190
+#define BCMSROMCISDUMPATTACHFN(_fn) _fn
191
+#define BCMSROMCISDUMPATTACHDATA(_data) _data
192
+#else
193
+#define BCMSROMCISDUMPATTACHFN(_fn) BCMSROMATTACHFN(_fn)
194
+#define BCMSROMCISDUMPATTACHDATA(_data) BCMSROMATTACHDATA(_data)
195
+#endif /* BCM_CISDUMP_NO_RECLAIM */
196
+
197
+#ifdef BCMNODOWN
198
+#define _fn _fn
199
+#else
200
+#define _fn _fn
201
+#endif // endif
202
+
203
+#else /* BCM_RECLAIM */
204
+
205
+#define bcm_reclaimed (1)
206
+#define bcm_attach_part_reclaimed (1)
207
+#define bcm_preattach_part_reclaimed (1)
208
+#define bcm_postattach_part_reclaimed (1)
209
+#define _data _data
210
+#define _fn _fn
211
+#define BCM_SRM_ATTACH_DATA(_data) _data
212
+#define BCM_SRM_ATTACH_FN(_fn) _fn
213
+#define BCMPREATTACHDATA(_data) _data
214
+#define BCMPREATTACHFN(_fn) _fn
215
+#define BCMPOSTATTACHDATA(_data) _data
216
+#define BCMPOSTATTACHFN(_fn) _fn
217
+#define _data _data
218
+#define _fn _fn
219
+#define _fn _fn
220
+#define BCMNMIATTACHFN(_fn) _fn
221
+#define BCMNMIATTACHDATA(_data) _data
222
+#define BCMSROMATTACHFN(_fn) _fn
223
+#define BCMSROMATTACHDATA(_data) _data
224
+#define BCMPREATTACHFNSR(_fn) _fn
225
+#define BCMPREATTACHDATASR(_data) _data
226
+#define BCMATTACHFNSR(_fn) _fn
227
+#define BCMATTACHDATASR(_data) _data
228
+#define BCMSROMATTACHFN(_fn) _fn
229
+#define BCMSROMATTACHDATA(_data) _data
230
+#define BCMCISDUMPATTACHFN(_fn) _fn
231
+#define BCMCISDUMPATTACHDATA(_data) _data
232
+#define BCMSROMCISDUMPATTACHFN(_fn) _fn
233
+#define BCMSROMCISDUMPATTACHDATA(_data) _data
234
+#define CONST const
235
+
236
+#define RECLAIMED() (bcm_reclaimed)
237
+#define ATTACH_PART_RECLAIMED() (bcm_attach_part_reclaimed)
238
+#define PREATTACH_PART_RECLAIMED() (bcm_preattach_part_reclaimed)
239
+#define POSTATTACH_PART_RECLAIMED() (bcm_postattach_part_reclaimed)
240
+
241
+#endif /* BCM_RECLAIM */
242
+
243
+#define BCMUCODEDATA(_data) _data
244
+
245
+#if defined(BCM_DMA_CT) && !defined(BCM_DMA_CT_DISABLED)
246
+#define BCMUCODEFN(_fn) _fn
247
+#else
248
+#define BCMUCODEFN(_fn) _fn
249
+#endif /* BCM_DMA_CT */
79250
80251 #if !defined STB
252
+#if defined(BCM47XX) && defined(__ARM_ARCH_7A__) && !defined(OEM_ANDROID)
253
+#define BCM47XX_CA9
254
+#else
81255 #undef BCM47XX_CA9
256
+#endif /* BCM47XX && __ARM_ARCH_7A__ && !OEM_ANDROID */
82257 #endif /* STB */
83258
259
+/* BCMFASTPATH Related Macro defines
260
+*/
84261 #ifndef BCMFASTPATH
85262 #if defined(STB)
86263 #define BCMFASTPATH __attribute__ ((__section__ (".text.fastpath")))
87264 #define BCMFASTPATH_HOST __attribute__ ((__section__ (".text.fastpath_host")))
88
-#else
265
+#else /* mips || BCM47XX_CA9 || STB */
89266 #define BCMFASTPATH
90267 #define BCMFASTPATH_HOST
91
-#endif
268
+#endif // endif
92269 #endif /* BCMFASTPATH */
93
-
94270
95271 /* Use the BCMRAMFN() macro to tag functions in source that must be included in RAM (excluded from
96272 * ROM). This should eliminate the need to manually specify these functions in the ROM config file.
....@@ -98,6 +274,9 @@
98274 * chips.
99275 */
100276 #define BCMRAMFN(_fn) _fn
277
+
278
+/* Use BCMSPECSYM() macro to tag symbols going to a special output section in the binary. */
279
+#define BCMSPECSYM(_sym) __attribute__ ((__section__ (".special." #_sym))) _sym
101280
102281 #define STATIC static
103282
....@@ -113,18 +292,23 @@
113292
114293 /* Allows size optimization for single-bus image */
115294 #ifdef BCMBUSTYPE
116
-#define BUSTYPE(bus) (BCMBUSTYPE)
295
+#define BUSTYPE(bus) (BCMBUSTYPE)
117296 #else
118
-#define BUSTYPE(bus) (bus)
119
-#endif
297
+#define BUSTYPE(bus) (bus)
298
+#endif // endif
299
+
300
+#ifdef BCMBUSCORETYPE
301
+#define BUSCORETYPE(ct) (BCMBUSCORETYPE)
302
+#else
303
+#define BUSCORETYPE(ct) (ct)
304
+#endif // endif
120305
121306 /* Allows size optimization for single-backplane image */
122307 #ifdef BCMCHIPTYPE
123
-#define CHIPTYPE(bus) (BCMCHIPTYPE)
308
+#define CHIPTYPE(bus) (BCMCHIPTYPE)
124309 #else
125
-#define CHIPTYPE(bus) (bus)
126
-#endif
127
-
310
+#define CHIPTYPE(bus) (bus)
311
+#endif // endif
128312
129313 /* Allows size optimization for SPROM support */
130314 #if defined(BCMSPROMBUS)
....@@ -133,26 +317,48 @@
133317 #define SPROMBUS (PCMCIA_BUS)
134318 #else
135319 #define SPROMBUS (PCI_BUS)
136
-#endif
320
+#endif // endif
137321
138322 /* Allows size optimization for single-chip image */
139323 #ifdef BCMCHIPID
140324 #define CHIPID(chip) (BCMCHIPID)
141325 #else
142326 #define CHIPID(chip) (chip)
143
-#endif
327
+#endif // endif
144328
145329 #ifdef BCMCHIPREV
146330 #define CHIPREV(rev) (BCMCHIPREV)
147331 #else
148332 #define CHIPREV(rev) (rev)
149
-#endif
333
+#endif // endif
150334
151335 #ifdef BCMPCIEREV
152336 #define PCIECOREREV(rev) (BCMPCIEREV)
153337 #else
154338 #define PCIECOREREV(rev) (rev)
155
-#endif
339
+#endif // endif
340
+
341
+#ifdef BCMPMUREV
342
+#define PMUREV(rev) (BCMPMUREV)
343
+#else
344
+#define PMUREV(rev) (rev)
345
+#endif // endif
346
+
347
+#ifdef BCMCCREV
348
+#define CCREV(rev) (BCMCCREV)
349
+#else
350
+#define CCREV(rev) (rev)
351
+#endif // endif
352
+
353
+#ifdef BCMGCIREV
354
+#define GCIREV(rev) (BCMGCIREV)
355
+#else
356
+#define GCIREV(rev) (rev)
357
+#endif // endif
358
+
359
+#ifdef BCMCR4REV
360
+#define CR4REV (BCMCR4REV)
361
+#endif // endif
156362
157363 /* Defines for DMA Address Width - Shared between OSL and HNDDMA */
158364 #define DMADDR_MASK_32 0x0 /* Address mask for 32-bits */
....@@ -188,6 +394,10 @@
188394 #define PHYSADDRHISET(_pa, _val) PHYSADDR64HISET(_pa, _val)
189395 #define PHYSADDRLO(_pa) PHYSADDR64LO(_pa)
190396 #define PHYSADDRLOSET(_pa, _val) PHYSADDR64LOSET(_pa, _val)
397
+#define PHYSADDRTOULONG(_pa, _ulong) \
398
+ do { \
399
+ _ulong = ((unsigned long long)(_pa).hiaddr << 32) | ((_pa).loaddr); \
400
+ } while (0)
191401
192402 #else
193403 typedef unsigned long dmaaddr_t;
....@@ -209,14 +419,12 @@
209419
210420 #define MAX_DMA_SEGS 8
211421
212
-
213422 typedef struct {
214423 void *oshdmah; /* Opaque handle for OSL to store its information */
215424 uint origsize; /* Size of the virtual packet */
216425 uint nsegs;
217426 hnddma_seg_t segs[MAX_DMA_SEGS];
218427 } hnddma_seg_map_t;
219
-
220428
221429 /* packet headroom necessary to accommodate the largest header in the system, (i.e TXOFF).
222430 * By doing, we avoid the need to allocate an extra buffer for the header when bridging to WL.
....@@ -229,20 +437,16 @@
229437 #define BCMEXTRAHDROOM 260
230438 #else /* BCM_RPC_NOCOPY || BCM_RPC_TXNOCOPY */
231439 #if defined(STB)
232
-#if defined(BCM_GMAC3)
233
-#define BCMEXTRAHDROOM 32 /* For FullDongle, no D11 headroom space required. */
234
-#else
235440 #define BCMEXTRAHDROOM 224
236
-#endif /* ! BCM_GMAC3 */
237441 #else
238442 #define BCMEXTRAHDROOM 204
239
-#endif
443
+#endif // endif
240444 #endif /* BCM_RPC_NOCOPY || BCM_RPC_TXNOCOPY */
241445
242446 /* Packet alignment for most efficient SDIO (can change based on platform) */
243447 #ifndef SDALIGN
244448 #define SDALIGN 32
245
-#endif
449
+#endif // endif
246450
247451 /* Headroom required for dongle-to-host communication. Packets allocated
248452 * locally in the dongle (e.g. for CDC ioctls or RNDIS messages) should
....@@ -256,15 +460,14 @@
256460
257461 #define BCMDONGLEOVERHEAD (BCMDONGLEHDRSZ + BCMDONGLEPADSZ)
258462
259
-
260463 #if defined(NO_BCMDBG_ASSERT)
261464 # undef BCMDBG_ASSERT
262465 # undef BCMASSERT_LOG
263
-#endif
466
+#endif // endif
264467
265468 #if defined(BCMASSERT_LOG)
266469 #define BCMASSERT_SUPPORT
267
-#endif
470
+#endif // endif
268471
269472 /* Macros for doing definition and get/set of bitfields
270473 * Usage example, e.g. a three-bit field (bits 4-6):
....@@ -291,28 +494,25 @@
291494 #else
292495 #define BCMSPACE
293496 #define bcmspace TRUE /* if (bcmspace) code is retained */
294
-#endif
497
+#endif // endif
295498
296499 /* Max. nvram variable table size */
297500 #ifndef MAXSZ_NVRAM_VARS
298501 #ifdef LARGE_NVRAM_MAXSZ
299
-#define MAXSZ_NVRAM_VARS LARGE_NVRAM_MAXSZ
502
+#define MAXSZ_NVRAM_VARS (LARGE_NVRAM_MAXSZ * 2)
300503 #else
301
-/* SROM12 changes */
302
-#define MAXSZ_NVRAM_VARS 6144
504
+#define LARGE_NVRAM_MAXSZ 8192
505
+#define MAXSZ_NVRAM_VARS (LARGE_NVRAM_MAXSZ * 2)
303506 #endif /* LARGE_NVRAM_MAXSZ */
304507 #endif /* !MAXSZ_NVRAM_VARS */
305508
306
-
307
-
308
-/* WL_ENAB_RUNTIME_CHECK may be set based upon the #define below (for ROM builds). It may also
509
+/* ROM_ENAB_RUNTIME_CHECK may be set based upon the #define below (for ROM builds). It may also
309510 * be defined via makefiles (e.g. ROM auto abandon unoptimized compiles).
310511 */
311512
312
-
313513 #ifdef BCMLFRAG /* BCMLFRAG support enab macros */
314514 extern bool _bcmlfrag;
315
- #if defined(WL_ENAB_RUNTIME_CHECK) || !defined(DONGLEBUILD)
515
+ #if defined(ROM_ENAB_RUNTIME_CHECK) || !defined(DONGLEBUILD)
316516 #define BCMLFRAG_ENAB() (_bcmlfrag)
317517 #elif defined(BCMLFRAG_DISABLED)
318518 #define BCMLFRAG_ENAB() (0)
....@@ -322,32 +522,10 @@
322522 #else
323523 #define BCMLFRAG_ENAB() (0)
324524 #endif /* BCMLFRAG_ENAB */
325
-#define RXMODE1 1 /* descriptor split */
326
-#define RXMODE2 2 /* descriptor split + classification */
327
-#define RXMODE3 3 /* fifo split + classification */
328
-#define RXMODE4 4 /* fifo split + classification + hdr conversion */
329
-
330
-#ifdef BCMSPLITRX /* BCMLFRAG support enab macros */
331
- extern bool _bcmsplitrx;
332
- extern uint8 _bcmsplitrx_mode;
333
- #if defined(WL_ENAB_RUNTIME_CHECK) || !defined(DONGLEBUILD)
334
- #define BCMSPLITRX_ENAB() (_bcmsplitrx)
335
- #define BCMSPLITRX_MODE() (_bcmsplitrx_mode)
336
- #elif defined(BCMSPLITRX_DISABLED)
337
- #define BCMSPLITRX_ENAB() (0)
338
- #define BCMSPLITRX_MODE() (0)
339
- #else
340
- #define BCMSPLITRX_ENAB() (1)
341
- #define BCMSPLITRX_MODE() (_bcmsplitrx_mode)
342
- #endif
343
-#else
344
- #define BCMSPLITRX_ENAB() (0)
345
- #define BCMSPLITRX_MODE() (0)
346
-#endif /* BCMSPLITRX */
347525
348526 #ifdef BCMPCIEDEV /* BCMPCIEDEV support enab macros */
349527 extern bool _pciedevenab;
350
- #if defined(WL_ENAB_RUNTIME_CHECK)
528
+ #if defined(ROM_ENAB_RUNTIME_CHECK)
351529 #define BCMPCIEDEV_ENAB() (_pciedevenab)
352530 #elif defined(BCMPCIEDEV_ENABLED)
353531 #define BCMPCIEDEV_ENAB() 1
....@@ -358,28 +536,20 @@
358536 #define BCMPCIEDEV_ENAB() 0
359537 #endif /* BCMPCIEDEV */
360538
361
-#define SPLIT_RXMODE1() ((BCMSPLITRX_MODE() == RXMODE1))
362
-#define SPLIT_RXMODE2() ((BCMSPLITRX_MODE() == RXMODE2))
363
-#define SPLIT_RXMODE3() ((BCMSPLITRX_MODE() == RXMODE3))
364
-#define SPLIT_RXMODE4() ((BCMSPLITRX_MODE() == RXMODE4))
365
-
366
-#define PKT_CLASSIFY() (SPLIT_RXMODE2() || SPLIT_RXMODE3() || SPLIT_RXMODE4())
367
-#define RXFIFO_SPLIT() (SPLIT_RXMODE3() || SPLIT_RXMODE4())
368
-#define HDR_CONV() (SPLIT_RXMODE4())
369
-
370
-#define PKT_CLASSIFY_EN(x) ((PKT_CLASSIFY()) && (PKT_CLASSIFY_FIFO == (x)))
371
-#ifdef BCM_SPLITBUF
372
- extern bool _bcmsplitbuf;
373
- #if defined(WL_ENAB_RUNTIME_CHECK) || !defined(DONGLEBUILD)
374
- #define BCM_SPLITBUF_ENAB() (_bcmsplitbuf)
375
- #elif defined(BCM_SPLITBUF_DISABLED)
376
- #define BCM_SPLITBUF_ENAB() (0)
539
+#ifdef BCMRESVFRAGPOOL /* BCMRESVFRAGPOOL support enab macros */
540
+extern bool _resvfragpool_enab;
541
+ #if defined(ROM_ENAB_RUNTIME_CHECK) || !defined(DONGLEBUILD)
542
+ #define BCMRESVFRAGPOOL_ENAB() (_resvfragpool_enab)
543
+ #elif defined(BCMRESVFRAGPOOL_ENABLED)
544
+ #define BCMRESVFRAGPOOL_ENAB() 1
377545 #else
378
- #define BCM_SPLITBUF_ENAB() (1)
546
+ #define BCMRESVFRAGPOOL_ENAB() 0
379547 #endif
380548 #else
381
- #define BCM_SPLITBUF_ENAB() (0)
382
-#endif /* BCM_SPLITBUF */
549
+ #define BCMRESVFRAGPOOL_ENAB() 0
550
+#endif /* BCMPCIEDEV */
551
+
552
+ #define BCMSDIODEV_ENAB() 0
383553
384554 /* Max size for reclaimable NVRAM array */
385555 #ifdef DL_NVRAM
....@@ -389,6 +559,67 @@
389559 #endif /* DL_NVRAM */
390560
391561 extern uint32 gFWID;
392
-#define SEC_ENHANCEMENT
562
+
563
+#ifdef BCMFRWDPOOLREORG /* BCMFRWDPOOLREORG support enab macros */
564
+ extern bool _bcmfrwdpoolreorg;
565
+ #if defined(ROM_ENAB_RUNTIME_CHECK) || !defined(DONGLEBUILD)
566
+ #define BCMFRWDPOOLREORG_ENAB() (_bcmfrwdpoolreorg)
567
+ #elif defined(BCMFRWDPOOLREORG_DISABLED)
568
+ #define BCMFRWDPOOLREORG_ENAB() (0)
569
+ #else
570
+ #define BCMFRWDPOOLREORG_ENAB() (1)
571
+ #endif
572
+#else
573
+ #define BCMFRWDPOOLREORG_ENAB() (0)
574
+#endif /* BCMFRWDPOOLREORG */
575
+
576
+#ifdef BCMPOOLRECLAIM /* BCMPOOLRECLAIM support enab macros */
577
+ extern bool _bcmpoolreclaim;
578
+ #if defined(ROM_ENAB_RUNTIME_CHECK) || !defined(DONGLEBUILD)
579
+ #define BCMPOOLRECLAIM_ENAB() (_bcmpoolreclaim)
580
+ #elif defined(BCMPOOLRECLAIM_DISABLED)
581
+ #define BCMPOOLRECLAIM_ENAB() (0)
582
+ #else
583
+ #define BCMPOOLRECLAIM_ENAB() (1)
584
+ #endif
585
+#else
586
+ #define BCMPOOLRECLAIM_ENAB() (0)
587
+#endif /* BCMPOOLRECLAIM */
588
+
589
+/* Chip related low power flags (lpflags) */
590
+
591
+#ifndef PAD
592
+#define _PADLINE(line) pad ## line
593
+#define _XSTR(line) _PADLINE(line)
594
+#define PAD _XSTR(__LINE__)
595
+#endif // endif
596
+
597
+#ifndef FRAG_HEADROOM
598
+#define FRAG_HEADROOM 224 /* In absence of SFD, use default headroom of 224 */
599
+#endif // endif
600
+
601
+#define MODULE_DETACH(var, detach_func)\
602
+ if (var) { \
603
+ detach_func(var); \
604
+ (var) = NULL; \
605
+ }
606
+#define MODULE_DETACH_2(var1, var2, detach_func) detach_func(var1, var2)
607
+#define MODULE_DETACH_TYPECASTED(var, detach_func) detach_func(var)
608
+
609
+/* When building ROML image use runtime conditional to cause the compiler
610
+ * to compile everything but not to complain "defined but not used"
611
+ * as #ifdef would cause at the callsites.
612
+ * In the end functions called under if (0) {} will not be linked
613
+ * into the final binary if they're not called from other places either.
614
+ */
615
+#define BCM_ATTACH_REF_DECL()
616
+#define BCM_ATTACH_REF() (1)
617
+
618
+/* Const in ROM else normal data in RAM */
619
+#if defined(ROM_ENAB_RUNTIME_CHECK)
620
+ #define ROMCONST CONST
621
+#else
622
+ #define ROMCONST
623
+#endif // endif
393624
394625 #endif /* _bcmdefs_h_ */