net: wifi: rockchip: update broadcom drivers for kernel4.4
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rkwifi / bcmdhd / include / bcmdefs.h
index 8c720d0a87fd533e2deb7e5cff857872738a7160..a02499996f615388b9e4caf4cd40f59c06e57857 100755 (executable)
@@ -1,9 +1,30 @@
 /*
  * Misc system wide definitions
  *
- * $Copyright Open Broadcom Corporation$
+ * Copyright (C) 1999-2016, 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
+ * you also meet, for each linked independent module, the terms and conditions of
+ * 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.
  *
- * $Id: bcmdefs.h 474209 2014-04-30 12:16:47Z $
+ *
+ * <<Broadcom-WL-IPTag/Open:>>
+ *
+ * $Id: bcmdefs.h 601026 2015-11-20 06:53:19Z $
  */
 
 #ifndef        _bcmdefs_h_
 #undef BCM47XX_CA9
 
 #ifndef BCMFASTPATH
-#if defined(BCM47XX_CA9)
-#define BCMFASTPATH            __attribute__ ((__section__ (".text.fastpath")))
-#define BCMFASTPATH_HOST       __attribute__ ((__section__ (".text.fastpath_host")))
-#else
 #define BCMFASTPATH
 #define BCMFASTPATH_HOST
-#endif
 #endif /* BCMFASTPATH */
 
 
 #define CHIPREV(rev)   (rev)
 #endif
 
+#ifdef BCMPCIEREV
+#define PCIECOREREV(rev)       (BCMPCIEREV)
+#else
+#define PCIECOREREV(rev)       (rev)
+#endif
+
 /* Defines for DMA Address Width - Shared between OSL and HNDDMA */
 #define DMADDR_MASK_32 0x0             /* Address mask for 32-bits */
 #define DMADDR_MASK_30 0xc0000000      /* Address mask for 30-bits */
@@ -158,6 +180,10 @@ typedef dma64addr_t dmaaddr_t;
 #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)(_pa).hiaddr << 32) | ((_pa).loaddr); \
+       } while (0)
 
 #else
 typedef unsigned long dmaaddr_t;
@@ -198,11 +224,7 @@ typedef struct {
 /* add 40 bytes to allow for extra RPC header and info  */
 #define BCMEXTRAHDROOM 260
 #else /* BCM_RPC_NOCOPY || BCM_RPC_TXNOCOPY */
-#if defined(BCM47XX_CA9)
-#define BCMEXTRAHDROOM 224
-#else
 #define BCMEXTRAHDROOM 204
-#endif /* linux && BCM47XX_CA9 */
 #endif /* BCM_RPC_NOCOPY || BCM_RPC_TXNOCOPY */
 
 /* Packet alignment for most efficient SDIO (can change based on platform) */
@@ -261,8 +283,13 @@ typedef struct {
 
 /* Max. nvram variable table size */
 #ifndef MAXSZ_NVRAM_VARS
-#define        MAXSZ_NVRAM_VARS        4096
-#endif
+#ifdef LARGE_NVRAM_MAXSZ
+#define MAXSZ_NVRAM_VARS       LARGE_NVRAM_MAXSZ
+#else
+/* SROM12 changes */
+#define        MAXSZ_NVRAM_VARS        6144
+#endif /* LARGE_NVRAM_MAXSZ */
+#endif /* !MAXSZ_NVRAM_VARS */
 
 
 
@@ -283,18 +310,52 @@ typedef struct {
 #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)
+               #define BCMPCIEDEV_ENAB() (_pciedevenab)
+       #elif defined(BCMPCIEDEV_ENABLED)
+               #define BCMPCIEDEV_ENAB()       1
+       #else
+               #define BCMPCIEDEV_ENAB()       0
+       #endif
+#else
+       #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)
@@ -307,6 +368,7 @@ typedef struct {
 #else
        #define BCM_SPLITBUF_ENAB()             (0)
 #endif /* BCM_SPLITBUF */
+
 /* Max size for reclaimable NVRAM array */
 #ifdef DL_NVRAM
 #define NVRAM_ARRAY_MAXSIZE    DL_NVRAM