From d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Mon, 11 Dec 2023 02:45:28 +0000
Subject: [PATCH] add boot partition  size

---
 kernel/drivers/net/wireless/rockchip_wlan/cywdhd/bcmdhd/include/bcmdefs.h |  407 +++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 319 insertions(+), 88 deletions(-)

diff --git a/kernel/drivers/net/wireless/rockchip_wlan/cywdhd/bcmdhd/include/bcmdefs.h b/kernel/drivers/net/wireless/rockchip_wlan/cywdhd/bcmdhd/include/bcmdefs.h
index 6e17cf0..014c7ce 100644
--- a/kernel/drivers/net/wireless/rockchip_wlan/cywdhd/bcmdhd/include/bcmdefs.h
+++ b/kernel/drivers/net/wireless/rockchip_wlan/cywdhd/bcmdhd/include/bcmdefs.h
@@ -1,15 +1,16 @@
-/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Misc system wide definitions
  *
- * Copyright (C) 1999-2019, Broadcom Corporation
- * 
+ * Portions of this code are copyright (c) 2022 Cypress Semiconductor Corporation
+ *
+ * Copyright (C) 1999-2017, Broadcom Corporation
+ *
  *      Unless you and Broadcom execute a separate written software license
  * agreement governing use of this software, this software is licensed to you
  * under the terms of the GNU General Public License version 2 (the "GPL"),
  * available at http://www.broadcom.com/licenses/GPLv2.php, with the
  * following added to such license:
- * 
+ *
  *      As a special exception, the copyright holders of this software give you
  * permission to link this software with independent modules, and to copy and
  * distribute the resulting executable under terms of your choice, provided that
@@ -17,7 +18,7 @@
  * the license of that module.  An independent module is a module which is not
  * derived from this software.  The special exception does not apply to any
  * modifications of the software.
- * 
+ *
  *      Notwithstanding the above, under no circumstances may you combine this
  * software in any way with any other Broadcom software provided under a license
  * other than the GPL, without Broadcom's express prior written consent.
@@ -25,7 +26,7 @@
  *
  * <<Broadcom-WL-IPTag/Open:>>
  *
- * $Id: bcmdefs.h 715966 2019-05-30 02:36:59Z $
+ * $Id: bcmdefs.h 700870 2017-05-22 19:05:22Z $
  */
 
 #ifndef	_bcmdefs_h_
@@ -40,23 +41,58 @@
  * arguments or local variables.
  */
 #define BCM_REFERENCE(data)	((void)(data))
-
+#include <linux/compiler.h>
 /* Allow for suppressing unused variable warnings. */
 #ifdef __GNUC__
 #define UNUSED_VAR     __attribute__ ((unused))
 #else
 #define UNUSED_VAR
-#endif
+#endif // endif
 
+/* GNU GCC 4.6+ supports selectively turning off a warning.
+ * Define these diagnostic macros to help suppress cast-qual warning
+ * until all the work can be done to fix the casting issues.
+ */
+#if (defined(__GNUC__) && defined(STRICT_GCC_WARNINGS) && (__GNUC__ > 4 || (__GNUC__ == \
+	4 && __GNUC_MINOR__ >= 6)))
+#define GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST()              \
+	_Pragma("GCC diagnostic push")			 \
+	_Pragma("GCC diagnostic ignored \"-Wcast-qual\"")
+#define GCC_DIAGNOSTIC_POP()                             \
+	_Pragma("GCC diagnostic pop")
+#else
+#define GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST()
+#define GCC_DIAGNOSTIC_POP()
+#endif   /* Diagnostic macros not defined */
+
+/* Support clang for MACOSX compiler */
+#ifdef __clang__
+#define CLANG_DIAGNOSTIC_PUSH_SUPPRESS_CAST()              \
+	_Pragma("clang diagnostic push")			 \
+	_Pragma("clang diagnostic ignored \"-Wcast-qual\"")
+#define CLANG_DIAGNOSTIC_PUSH_SUPPRESS_FORMAT()              \
+	_Pragma("clang diagnostic push")             \
+	_Pragma("clang diagnostic ignored \"-Wformat-nonliteral\"")
+#define CLANG_DIAGNOSTIC_POP()              \
+	_Pragma("clang diagnostic pop")
+#else
+#define CLANG_DIAGNOSTIC_PUSH_SUPPRESS_CAST()
+#define CLANG_DIAGNOSTIC_PUSH_SUPPRESS_FORMAT()
+#define CLANG_DIAGNOSTIC_POP()
+#endif // endif
 /* Compile-time assert can be used in place of ASSERT if the expression evaluates
  * to a constant at compile time.
  */
+#if (__GNUC__ <= 4 && __GNUC_MINOR__ >= 4)
 #define STATIC_ASSERT(expr) { \
 	/* Make sure the expression is constant. */ \
 	typedef enum { _STATIC_ASSERT_NOT_CONSTANT = (expr) } _static_assert_e UNUSED_VAR; \
 	/* Make sure the expression is true. */ \
 	typedef char STATIC_ASSERT_FAIL[(expr) ? 1 : -1] UNUSED_VAR; \
 }
+#else
+#define STATIC_ASSERT(expr)	compiletime_assert(expr, "Compile time condition failure");
+#endif /* __GNUC__ <= 4 && __GNUC_MINOR__ >= 4 */
 
 /* Reclaiming text and data :
  * The following macros specify special linker sections that can be reclaimed
@@ -64,33 +100,173 @@
  * BCMATTACHFN is also used for detach functions (it's not worth having a BCMDETACHFN,
  * as in most cases, the attach function calls the detach function to clean up on error).
  */
+#if defined(BCM_RECLAIM)
 
-#define bcmreclaimed 		0
+extern bool bcm_reclaimed;
+extern bool bcm_attach_part_reclaimed;
+extern bool bcm_preattach_part_reclaimed;
+extern bool bcm_postattach_part_reclaimed;
+
+#define RECLAIMED()			(bcm_reclaimed)
+#define ATTACH_PART_RECLAIMED()		(bcm_attach_part_reclaimed)
+#define PREATTACH_PART_RECLAIMED()	(bcm_preattach_part_reclaimed)
+#define POSTATTACH_PART_RECLAIMED()	(bcm_postattach_part_reclaimed)
+
+#if defined(BCM_RECLAIM_ATTACH_FN_DATA)
+#define _data	__attribute__ ((__section__ (".dataini2." #_data))) _data
+#define _fn	__attribute__ ((__section__ (".textini2." #_fn), noinline)) _fn
+
+/* Relocate attach symbols to save-restore region to increase pre-reclaim heap size. */
+#define BCM_SRM_ATTACH_DATA(_data)    __attribute__ ((__section__ (".datasrm." #_data))) _data
+#define BCM_SRM_ATTACH_FN(_fn)        __attribute__ ((__section__ (".textsrm." #_fn), noinline)) _fn
+
+#ifndef PREATTACH_NORECLAIM
+#define BCMPREATTACHDATA(_data)	__attribute__ ((__section__ (".dataini3." #_data))) _data
+#define BCMPREATTACHFN(_fn)	__attribute__ ((__section__ (".textini3." #_fn), noinline)) _fn
+#else
+#define BCMPREATTACHDATA(_data)	__attribute__ ((__section__ (".dataini2." #_data))) _data
+#define BCMPREATTACHFN(_fn)	__attribute__ ((__section__ (".textini2." #_fn), noinline)) _fn
+#endif /* PREATTACH_NORECLAIM  */
+#define BCMPOSTATTACHDATA(_data)	__attribute__ ((__section__ (".dataini5." #_data))) _data
+#define BCMPOSTATTACHFN(_fn)	__attribute__ ((__section__ (".textini5." #_fn), noinline)) _fn
+#else  /* BCM_RECLAIM_ATTACH_FN_DATA  */
 #define _data	_data
 #define _fn	_fn
 #define BCMPREATTACHDATA(_data)	_data
 #define BCMPREATTACHFN(_fn)	_fn
+#define BCMPOSTATTACHDATA(_data)	_data
+#define BCMPOSTATTACHFN(_fn)	_fn
+#endif /* BCM_RECLAIM_ATTACH_FN_DATA  */
+
+#ifdef BCMDBG_SR
+/*
+ * Don't reclaim so we can compare SR ASM
+ */
+#define BCMPREATTACHDATASR(_data)	_data
+#define BCMPREATTACHFNSR(_fn)		_fn
+#define BCMATTACHDATASR(_data)		_data
+#define BCMATTACHFNSR(_fn)		_fn
+#else
+#define BCMPREATTACHDATASR(_data)	BCMPREATTACHDATA(_data)
+#define BCMPREATTACHFNSR(_fn)		BCMPREATTACHFN(_fn)
+#define BCMATTACHDATASR(_data)		_data
+#define BCMATTACHFNSR(_fn)		_fn
+#endif // endif
+
+#if defined(BCM_RECLAIM_INIT_FN_DATA)
+#define _data	__attribute__ ((__section__ (".dataini1." #_data))) _data
+#define _fn		__attribute__ ((__section__ (".textini1." #_fn), noinline)) _fn
+#define CONST
+#else /* BCM_RECLAIM_INIT_FN_DATA  */
 #define _data	_data
 #define _fn		_fn
-#define _fn	_fn
+#ifndef CONST
+#define CONST	const
+#endif // endif
+#endif /* BCM_RECLAIM_INIT_FN_DATA  */
+
+/* Non-manufacture or internal attach function/dat */
 #define	BCMNMIATTACHFN(_fn)	_fn
 #define	BCMNMIATTACHDATA(_data)	_data
-#define CONST	const
+
+#if defined(BCM_CISDUMP_NO_RECLAIM)
+#define	BCMCISDUMPATTACHFN(_fn)		_fn
+#define	BCMCISDUMPATTACHDATA(_data)	_data
+#else
+#define	BCMCISDUMPATTACHFN(_fn)		BCMNMIATTACHFN(_fn)
+#define	BCMCISDUMPATTACHDATA(_data)	BCMNMIATTACHDATA(_data)
+#endif // endif
+
+/* SROM with OTP support */
+#if defined(BCMOTPSROM)
+#define	BCMSROMATTACHFN(_fn)		_fn
+#define	BCMSROMATTACHDATA(_data)	_data
+#else
+#define	BCMSROMATTACHFN(_fn)		BCMNMIATTACHFN(_fn)
+#define	BCMSROMATTACHDATA(_data)	BCMNMIATTACHFN(_data)
+#endif	/* BCMOTPSROM */
+
+#if defined(BCM_CISDUMP_NO_RECLAIM)
+#define	BCMSROMCISDUMPATTACHFN(_fn)	_fn
+#define	BCMSROMCISDUMPATTACHDATA(_data)	_data
+#else
+#define	BCMSROMCISDUMPATTACHFN(_fn)	BCMSROMATTACHFN(_fn)
+#define	BCMSROMCISDUMPATTACHDATA(_data)	BCMSROMATTACHDATA(_data)
+#endif /* BCM_CISDUMP_NO_RECLAIM */
+
+#ifdef BCMNODOWN
+#define _fn	_fn
+#else
+#define _fn	_fn
+#endif // endif
+
+#else /* BCM_RECLAIM */
+
+#define bcm_reclaimed			(1)
+#define bcm_attach_part_reclaimed	(1)
+#define bcm_preattach_part_reclaimed	(1)
+#define bcm_postattach_part_reclaimed	(1)
+#define _data		_data
+#define _fn		_fn
+#define BCM_SRM_ATTACH_DATA(_data)	_data
+#define BCM_SRM_ATTACH_FN(_fn)		_fn
+#define BCMPREATTACHDATA(_data)		_data
+#define BCMPREATTACHFN(_fn)		_fn
+#define BCMPOSTATTACHDATA(_data)	_data
+#define BCMPOSTATTACHFN(_fn)		_fn
+#define _data		_data
+#define _fn			_fn
+#define _fn		_fn
+#define	BCMNMIATTACHFN(_fn)		_fn
+#define	BCMNMIATTACHDATA(_data)		_data
+#define	BCMSROMATTACHFN(_fn)		_fn
+#define	BCMSROMATTACHDATA(_data)	_data
+#define BCMPREATTACHFNSR(_fn)		_fn
+#define BCMPREATTACHDATASR(_data)	_data
+#define BCMATTACHFNSR(_fn)		_fn
+#define BCMATTACHDATASR(_data)		_data
+#define	BCMSROMATTACHFN(_fn)		_fn
+#define	BCMSROMATTACHDATA(_data)	_data
+#define	BCMCISDUMPATTACHFN(_fn)		_fn
+#define	BCMCISDUMPATTACHDATA(_data)	_data
+#define	BCMSROMCISDUMPATTACHFN(_fn)	_fn
+#define	BCMSROMCISDUMPATTACHDATA(_data)	_data
+#define CONST				const
+
+#define RECLAIMED()			(bcm_reclaimed)
+#define ATTACH_PART_RECLAIMED()		(bcm_attach_part_reclaimed)
+#define PREATTACH_PART_RECLAIMED()	(bcm_preattach_part_reclaimed)
+#define POSTATTACH_PART_RECLAIMED()	(bcm_postattach_part_reclaimed)
+
+#endif /* BCM_RECLAIM */
+
+#define BCMUCODEDATA(_data)		_data
+
+#if defined(BCM_DMA_CT) && !defined(BCM_DMA_CT_DISABLED)
+#define BCMUCODEFN(_fn)			_fn
+#else
+#define BCMUCODEFN(_fn)			_fn
+#endif /* BCM_DMA_CT */
 
 #if !defined STB
+#if defined(BCM47XX) && defined(__ARM_ARCH_7A__) && !defined(OEM_ANDROID)
+#define BCM47XX_CA9
+#else
 #undef BCM47XX_CA9
+#endif /* BCM47XX && __ARM_ARCH_7A__ && !OEM_ANDROID */
 #endif /* STB */
 
+/* BCMFASTPATH Related Macro defines
+*/
 #ifndef BCMFASTPATH
 #if defined(STB)
 #define BCMFASTPATH		__attribute__ ((__section__ (".text.fastpath")))
 #define BCMFASTPATH_HOST	__attribute__ ((__section__ (".text.fastpath_host")))
-#else
+#else /* mips || BCM47XX_CA9 || STB */
 #define BCMFASTPATH
 #define BCMFASTPATH_HOST
-#endif
+#endif // endif
 #endif /* BCMFASTPATH */
-
 
 /* Use the BCMRAMFN() macro to tag functions in source that must be included in RAM (excluded from
  * ROM). This should eliminate the need to manually specify these functions in the ROM config file.
@@ -98,6 +274,9 @@
  * chips.
  */
 	#define BCMRAMFN(_fn)	_fn
+
+/* Use BCMSPECSYM() macro to tag symbols going to a special output section in the binary. */
+#define BCMSPECSYM(_sym)	__attribute__ ((__section__ (".special." #_sym))) _sym
 
 #define STATIC	static
 
@@ -113,18 +292,23 @@
 
 /* Allows size optimization for single-bus image */
 #ifdef BCMBUSTYPE
-#define BUSTYPE(bus) 	(BCMBUSTYPE)
+#define BUSTYPE(bus)	(BCMBUSTYPE)
 #else
-#define BUSTYPE(bus) 	(bus)
-#endif
+#define BUSTYPE(bus)	(bus)
+#endif // endif
+
+#ifdef BCMBUSCORETYPE
+#define BUSCORETYPE(ct)		(BCMBUSCORETYPE)
+#else
+#define BUSCORETYPE(ct)		(ct)
+#endif // endif
 
 /* Allows size optimization for single-backplane image */
 #ifdef BCMCHIPTYPE
-#define CHIPTYPE(bus) 	(BCMCHIPTYPE)
+#define CHIPTYPE(bus)	(BCMCHIPTYPE)
 #else
-#define CHIPTYPE(bus) 	(bus)
-#endif
-
+#define CHIPTYPE(bus)	(bus)
+#endif // endif
 
 /* Allows size optimization for SPROM support */
 #if defined(BCMSPROMBUS)
@@ -133,26 +317,48 @@
 #define SPROMBUS	(PCMCIA_BUS)
 #else
 #define SPROMBUS	(PCI_BUS)
-#endif
+#endif // endif
 
 /* Allows size optimization for single-chip image */
 #ifdef BCMCHIPID
 #define CHIPID(chip)	(BCMCHIPID)
 #else
 #define CHIPID(chip)	(chip)
-#endif
+#endif // endif
 
 #ifdef BCMCHIPREV
 #define CHIPREV(rev)	(BCMCHIPREV)
 #else
 #define CHIPREV(rev)	(rev)
-#endif
+#endif // endif
 
 #ifdef BCMPCIEREV
 #define PCIECOREREV(rev)	(BCMPCIEREV)
 #else
 #define PCIECOREREV(rev)	(rev)
-#endif
+#endif // endif
+
+#ifdef BCMPMUREV
+#define PMUREV(rev)	(BCMPMUREV)
+#else
+#define PMUREV(rev)	(rev)
+#endif // endif
+
+#ifdef BCMCCREV
+#define CCREV(rev)	(BCMCCREV)
+#else
+#define CCREV(rev)	(rev)
+#endif // endif
+
+#ifdef BCMGCIREV
+#define GCIREV(rev)	(BCMGCIREV)
+#else
+#define GCIREV(rev)	(rev)
+#endif // endif
+
+#ifdef BCMCR4REV
+#define CR4REV		(BCMCR4REV)
+#endif // endif
 
 /* Defines for DMA Address Width - Shared between OSL and HNDDMA */
 #define DMADDR_MASK_32 0x0		/* Address mask for 32-bits */
@@ -188,6 +394,10 @@
 #define PHYSADDRHISET(_pa, _val) PHYSADDR64HISET(_pa, _val)
 #define PHYSADDRLO(_pa)  PHYSADDR64LO(_pa)
 #define PHYSADDRLOSET(_pa, _val) PHYSADDR64LOSET(_pa, _val)
+#define PHYSADDRTOULONG(_pa, _ulong) \
+	do { \
+		_ulong = ((unsigned long long)(_pa).hiaddr << 32) | ((_pa).loaddr); \
+	} while (0)
 
 #else
 typedef unsigned long dmaaddr_t;
@@ -209,14 +419,12 @@
 
 #define MAX_DMA_SEGS 8
 
-
 typedef struct {
 	void *oshdmah; /* Opaque handle for OSL to store its information */
 	uint origsize; /* Size of the virtual packet */
 	uint nsegs;
 	hnddma_seg_t segs[MAX_DMA_SEGS];
 } hnddma_seg_map_t;
-
 
 /* packet headroom necessary to accommodate the largest header in the system, (i.e TXOFF).
  * By doing, we avoid the need  to allocate an extra buffer for the header when bridging to WL.
@@ -229,20 +437,16 @@
 #define BCMEXTRAHDROOM 260
 #else /* BCM_RPC_NOCOPY || BCM_RPC_TXNOCOPY */
 #if defined(STB)
-#if defined(BCM_GMAC3)
-#define BCMEXTRAHDROOM 32 /* For FullDongle, no D11 headroom space required. */
-#else
 #define BCMEXTRAHDROOM 224
-#endif /* ! BCM_GMAC3 */
 #else
 #define BCMEXTRAHDROOM 204
-#endif 
+#endif // endif
 #endif /* BCM_RPC_NOCOPY || BCM_RPC_TXNOCOPY */
 
 /* Packet alignment for most efficient SDIO (can change based on platform) */
 #ifndef SDALIGN
 #define SDALIGN	32
-#endif
+#endif // endif
 
 /* Headroom required for dongle-to-host communication.  Packets allocated
  * locally in the dongle (e.g. for CDC ioctls or RNDIS messages) should
@@ -256,15 +460,14 @@
 
 #define BCMDONGLEOVERHEAD	(BCMDONGLEHDRSZ + BCMDONGLEPADSZ)
 
-
 #if defined(NO_BCMDBG_ASSERT)
 # undef BCMDBG_ASSERT
 # undef BCMASSERT_LOG
-#endif
+#endif // endif
 
 #if defined(BCMASSERT_LOG)
 #define BCMASSERT_SUPPORT
-#endif 
+#endif // endif
 
 /* Macros for doing definition and get/set of bitfields
  * Usage example, e.g. a three-bit field (bits 4-6):
@@ -291,28 +494,25 @@
 #else
 #define	BCMSPACE
 #define bcmspace	TRUE	/* if (bcmspace) code is retained */
-#endif
+#endif // endif
 
 /* Max. nvram variable table size */
 #ifndef MAXSZ_NVRAM_VARS
 #ifdef LARGE_NVRAM_MAXSZ
-#define MAXSZ_NVRAM_VARS	LARGE_NVRAM_MAXSZ
+#define MAXSZ_NVRAM_VARS	(LARGE_NVRAM_MAXSZ * 2)
 #else
-/* SROM12 changes */
-#define	MAXSZ_NVRAM_VARS	6144
+#define LARGE_NVRAM_MAXSZ	8192
+#define MAXSZ_NVRAM_VARS	(LARGE_NVRAM_MAXSZ * 2)
 #endif /* LARGE_NVRAM_MAXSZ */
 #endif /* !MAXSZ_NVRAM_VARS */
 
-
-
-/* WL_ENAB_RUNTIME_CHECK may be set based upon the #define below (for ROM builds). It may also
+/* ROM_ENAB_RUNTIME_CHECK may be set based upon the #define below (for ROM builds). It may also
  * be defined via makefiles (e.g. ROM auto abandon unoptimized compiles).
  */
 
-
 #ifdef BCMLFRAG /* BCMLFRAG support enab macros  */
 	extern bool _bcmlfrag;
-	#if defined(WL_ENAB_RUNTIME_CHECK) || !defined(DONGLEBUILD)
+	#if defined(ROM_ENAB_RUNTIME_CHECK) || !defined(DONGLEBUILD)
 		#define BCMLFRAG_ENAB() (_bcmlfrag)
 	#elif defined(BCMLFRAG_DISABLED)
 		#define BCMLFRAG_ENAB()	(0)
@@ -322,32 +522,10 @@
 #else
 	#define BCMLFRAG_ENAB()		(0)
 #endif /* BCMLFRAG_ENAB */
-#define	RXMODE1	1	/* descriptor split */
-#define	RXMODE2	2	/* descriptor split + classification */
-#define	RXMODE3	3	/* fifo split + classification */
-#define	RXMODE4	4	/* fifo split + classification + hdr conversion */
-
-#ifdef BCMSPLITRX /* BCMLFRAG support enab macros  */
-	extern bool _bcmsplitrx;
-	extern uint8 _bcmsplitrx_mode;
-	#if defined(WL_ENAB_RUNTIME_CHECK) || !defined(DONGLEBUILD)
-		#define BCMSPLITRX_ENAB() (_bcmsplitrx)
-		#define BCMSPLITRX_MODE() (_bcmsplitrx_mode)
-	#elif defined(BCMSPLITRX_DISABLED)
-		#define BCMSPLITRX_ENAB()	(0)
-		#define BCMSPLITRX_MODE()	(0)
-	#else
-		#define BCMSPLITRX_ENAB()	(1)
-		#define BCMSPLITRX_MODE() (_bcmsplitrx_mode)
-	#endif
-#else
-	#define BCMSPLITRX_ENAB()		(0)
-	#define BCMSPLITRX_MODE()		(0)
-#endif /* BCMSPLITRX */
 
 #ifdef BCMPCIEDEV /* BCMPCIEDEV support enab macros */
 extern bool _pciedevenab;
-	#if defined(WL_ENAB_RUNTIME_CHECK)
+	#if defined(ROM_ENAB_RUNTIME_CHECK)
 		#define BCMPCIEDEV_ENAB() (_pciedevenab)
 	#elif defined(BCMPCIEDEV_ENABLED)
 		#define BCMPCIEDEV_ENAB()	1
@@ -358,28 +536,20 @@
 	#define BCMPCIEDEV_ENAB()	0
 #endif /* BCMPCIEDEV */
 
-#define SPLIT_RXMODE1()	((BCMSPLITRX_MODE() == RXMODE1))
-#define SPLIT_RXMODE2()	((BCMSPLITRX_MODE() == RXMODE2))
-#define SPLIT_RXMODE3()	((BCMSPLITRX_MODE() == RXMODE3))
-#define SPLIT_RXMODE4()	((BCMSPLITRX_MODE() == RXMODE4))
-
-#define PKT_CLASSIFY()	(SPLIT_RXMODE2() || SPLIT_RXMODE3() || SPLIT_RXMODE4())
-#define RXFIFO_SPLIT()	(SPLIT_RXMODE3() || SPLIT_RXMODE4())
-#define HDR_CONV()	(SPLIT_RXMODE4())
-
-#define PKT_CLASSIFY_EN(x)	((PKT_CLASSIFY()) && (PKT_CLASSIFY_FIFO == (x)))
-#ifdef BCM_SPLITBUF
-	extern bool _bcmsplitbuf;
-	#if defined(WL_ENAB_RUNTIME_CHECK) || !defined(DONGLEBUILD)
-		#define BCM_SPLITBUF_ENAB() (_bcmsplitbuf)
-	#elif defined(BCM_SPLITBUF_DISABLED)
-		#define BCM_SPLITBUF_ENAB()	(0)
+#ifdef BCMRESVFRAGPOOL /* BCMRESVFRAGPOOL support enab macros */
+extern bool _resvfragpool_enab;
+	#if defined(ROM_ENAB_RUNTIME_CHECK) || !defined(DONGLEBUILD)
+		#define  BCMRESVFRAGPOOL_ENAB() (_resvfragpool_enab)
+	#elif defined(BCMRESVFRAGPOOL_ENABLED)
+		#define BCMRESVFRAGPOOL_ENAB()	1
 	#else
-		#define BCM_SPLITBUF_ENAB()	(1)
+		#define BCMRESVFRAGPOOL_ENAB()	0
 	#endif
 #else
-	#define BCM_SPLITBUF_ENAB()		(0)
-#endif	/* BCM_SPLITBUF */
+	#define BCMRESVFRAGPOOL_ENAB()	0
+#endif /* BCMPCIEDEV */
+
+	#define BCMSDIODEV_ENAB()	0
 
 /* Max size for reclaimable NVRAM array */
 #ifdef DL_NVRAM
@@ -389,6 +559,67 @@
 #endif /* DL_NVRAM */
 
 extern uint32 gFWID;
-#define SEC_ENHANCEMENT
+
+#ifdef BCMFRWDPOOLREORG /* BCMFRWDPOOLREORG support enab macros  */
+	extern bool _bcmfrwdpoolreorg;
+	#if defined(ROM_ENAB_RUNTIME_CHECK) || !defined(DONGLEBUILD)
+		#define BCMFRWDPOOLREORG_ENAB() (_bcmfrwdpoolreorg)
+	#elif defined(BCMFRWDPOOLREORG_DISABLED)
+		#define BCMFRWDPOOLREORG_ENAB()	(0)
+	#else
+		#define BCMFRWDPOOLREORG_ENAB()	(1)
+	#endif
+#else
+	#define BCMFRWDPOOLREORG_ENAB()		(0)
+#endif /* BCMFRWDPOOLREORG */
+
+#ifdef BCMPOOLRECLAIM /* BCMPOOLRECLAIM support enab macros  */
+	extern bool _bcmpoolreclaim;
+	#if defined(ROM_ENAB_RUNTIME_CHECK) || !defined(DONGLEBUILD)
+		#define BCMPOOLRECLAIM_ENAB() (_bcmpoolreclaim)
+	#elif defined(BCMPOOLRECLAIM_DISABLED)
+		#define BCMPOOLRECLAIM_ENAB()	(0)
+	#else
+		#define BCMPOOLRECLAIM_ENAB()	(1)
+	#endif
+#else
+	#define BCMPOOLRECLAIM_ENAB()		(0)
+#endif /* BCMPOOLRECLAIM */
+
+/* Chip related low power flags (lpflags) */
+
+#ifndef PAD
+#define _PADLINE(line)  pad ## line
+#define _XSTR(line)     _PADLINE(line)
+#define PAD             _XSTR(__LINE__)
+#endif // endif
+
+#ifndef FRAG_HEADROOM
+#define FRAG_HEADROOM	224	/* In absence of SFD, use default headroom of 224 */
+#endif // endif
+
+#define MODULE_DETACH(var, detach_func)\
+	if (var) { \
+		detach_func(var); \
+		(var) = NULL; \
+	}
+#define MODULE_DETACH_2(var1, var2, detach_func) detach_func(var1, var2)
+#define MODULE_DETACH_TYPECASTED(var, detach_func) detach_func(var)
+
+/* When building ROML image use runtime conditional to cause the compiler
+ * to compile everything but not to complain "defined but not used"
+ * as #ifdef would cause at the callsites.
+ * In the end functions called under if (0) {} will not be linked
+ * into the final binary if they're not called from other places either.
+ */
+#define BCM_ATTACH_REF_DECL()
+#define BCM_ATTACH_REF()	(1)
+
+/* Const in ROM else normal data in RAM */
+#if defined(ROM_ENAB_RUNTIME_CHECK)
+	#define ROMCONST	CONST
+#else
+	#define ROMCONST
+#endif // endif
 
 #endif /* _bcmdefs_h_ */

--
Gitblit v1.6.2