| 1 | /* |
| 2 | * Misc system wide definitions |
| 3 | * |
| 4 | * Copyright 2006, Broadcom Corporation |
| 5 | * All Rights Reserved. |
| 6 | * |
| 7 | * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY |
| 8 | * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM |
| 9 | * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS |
| 10 | * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE. |
| 11 | */ |
| 12 | |
| 13 | #ifndef _bcmdefs_h_ |
| 14 | #define _bcmdefs_h_ |
| 15 | |
| 16 | /* |
| 17 | * One doesn't need to include this file explicitly, gets included automatically if |
| 18 | * typedefs.h is included. |
| 19 | */ |
| 20 | |
| 21 | /* Reclaiming text and data : |
| 22 | * The following macros specify special linker sections that can be reclaimed |
| 23 | * after a system is considered 'up'. |
| 24 | */ |
| 25 | #if defined(__GNUC__) && defined(BCMRECLAIM) |
| 26 | extern bool bcmreclaimed; |
| 27 | #define BCMINITDATA(_data) __attribute__ ((__section__ (".dataini." #_data))) _data |
| 28 | #define BCMINITFN(_fn) __attribute__ ((__section__ (".textini." #_fn))) _fn |
| 29 | #else /* #if defined(__GNUC__) && defined(BCMRECLAIM) */ |
| 30 | #define BCMINITDATA(_data) _data |
| 31 | #define BCMINITFN(_fn) _fn |
| 32 | #define bcmreclaimed 0 |
| 33 | #endif /* #if defined(__GNUC__) && defined(BCMRECLAIM) */ |
| 34 | |
| 35 | /* Reclaim uninit functions if BCMNODOWN is defined */ |
| 36 | /* and if they are not already removed by -gc-sections */ |
| 37 | #ifdef BCMNODOWN |
| 38 | #define BCMUNINITFN(_fn) BCMINITFN(_fn) |
| 39 | #else |
| 40 | #define BCMUNINITFN(_fn) _fn |
| 41 | #endif |
| 42 | |
| 43 | #ifdef BCMRECLAIM |
| 44 | #define CONST |
| 45 | #else |
| 46 | #define CONST const |
| 47 | #endif /* BCMRECLAIM */ |
| 48 | |
| 49 | /* Compatibility with old-style BCMRECLAIM */ |
| 50 | #define BCMINIT(_id) _id |
| 51 | |
| 52 | |
| 53 | /* Put some library data/code into ROM to reduce RAM requirements */ |
| 54 | #if defined(__GNUC__) && defined(BCMROMOFFLOAD) |
| 55 | #define BCMROMDATA(_data) __attribute__ ((__section__ (".datarom." #_data))) _data |
| 56 | #define BCMROMFN(_fn) __attribute__ ((__section__ (".textrom." #_fn))) _fn |
| 57 | #else |
| 58 | #define BCMROMDATA(_data) _data |
| 59 | #define BCMROMFN(_fn) _fn |
| 60 | #endif |
| 61 | |
| 62 | /* Bus types */ |
| 63 | #define SB_BUS 0 /* Silicon Backplane */ |
| 64 | #define PCI_BUS 1 /* PCI target */ |
| 65 | #define PCMCIA_BUS 2 /* PCMCIA target */ |
| 66 | #define SDIO_BUS 3 /* SDIO target */ |
| 67 | #define JTAG_BUS 4 /* JTAG */ |
| 68 | #define NO_BUS 0xFF /* Bus that does not support R/W REG */ |
| 69 | |
| 70 | /* Allows optimization for single-bus support */ |
| 71 | #ifdef BCMBUSTYPE |
| 72 | #define BUSTYPE(bus) (BCMBUSTYPE) |
| 73 | #else |
| 74 | #define BUSTYPE(bus) (bus) |
| 75 | #endif |
| 76 | |
| 77 | /* Defines for DMA Address Width - Shared between OSL and HNDDMA */ |
| 78 | #define DMADDR_MASK_32 0x0 /* Address mask for 32-bits */ |
| 79 | #define DMADDR_MASK_30 0xc0000000 /* Address mask for 30-bits */ |
| 80 | #define DMADDR_MASK_0 0xffffffff /* Address mask for 0-bits (hi-part) */ |
| 81 | |
| 82 | #define DMADDRWIDTH_30 30 /* 30-bit addressing capability */ |
| 83 | #define DMADDRWIDTH_32 32 /* 32-bit addressing capability */ |
| 84 | #define DMADDRWIDTH_63 63 /* 64-bit addressing capability */ |
| 85 | #define DMADDRWIDTH_64 64 /* 64-bit addressing capability */ |
| 86 | |
| 87 | /* packet headroom necessary to accomodate the largest header in the system, (i.e TXOFF). |
| 88 | * By doing, we avoid the need to allocate an extra buffer for the header when bridging to WL. |
| 89 | * There is a compile time check in wlc.c which ensure that this value is at least as big |
| 90 | * as TXOFF. This value is used in dma_rxfill (hnddma.c). |
| 91 | */ |
| 92 | #define BCMEXTRAHDROOM 160 |
| 93 | |
| 94 | /* Headroom required for dongle-to-host communication. Packets allocated |
| 95 | * locally in the dongle (e.g. for CDC ioctls or RNDIS messages) should |
| 96 | * leave this much room in front for low-level message headers which may |
| 97 | * be needed to get across the dongle bus to the host. (These messages |
| 98 | * don't go over the network, so room for the full WL header above would |
| 99 | * be a waste.) |
| 100 | */ |
| 101 | #define BCMDONGLEHDRSZ 8 |
| 102 | |
| 103 | |
| 104 | |
| 105 | #endif /* _bcmdefs_h_ */ |
| 106 | |