| 1 | /*************************************************************************** |
|---|
| 2 | * (c)2007-2011 Broadcom Corporation |
|---|
| 3 | * |
|---|
| 4 | * This program is the proprietary software of Broadcom Corporation and/or its licensors, |
|---|
| 5 | * and may only be used, duplicated, modified or distributed pursuant to the terms and |
|---|
| 6 | * conditions of a separate, written license agreement executed between you and Broadcom |
|---|
| 7 | * (an "Authorized License"). Except as set forth in an Authorized License, Broadcom grants |
|---|
| 8 | * no license (express or implied), right to use, or waiver of any kind with respect to the |
|---|
| 9 | * Software, and Broadcom expressly reserves all rights in and to the Software and all |
|---|
| 10 | * intellectual property rights therein. IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU |
|---|
| 11 | * HAVE NO RIGHT TO USE THIS SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY |
|---|
| 12 | * NOTIFY BROADCOM AND DISCONTINUE ALL USE OF THE SOFTWARE. |
|---|
| 13 | * |
|---|
| 14 | * Except as expressly set forth in the Authorized License, |
|---|
| 15 | * |
|---|
| 16 | * 1. This program, including its structure, sequence and organization, constitutes the valuable trade |
|---|
| 17 | * secrets of Broadcom, and you shall use all reasonable efforts to protect the confidentiality thereof, |
|---|
| 18 | * and to use this information only in connection with your use of Broadcom integrated circuit products. |
|---|
| 19 | * |
|---|
| 20 | * 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" |
|---|
| 21 | * AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, REPRESENTATIONS OR |
|---|
| 22 | * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO |
|---|
| 23 | * THE SOFTWARE. BROADCOM SPECIFICALLY DISCLAIMS ANY AND ALL IMPLIED WARRANTIES |
|---|
| 24 | * OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, |
|---|
| 25 | * LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION |
|---|
| 26 | * OR CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING OUT OF |
|---|
| 27 | * USE OR PERFORMANCE OF THE SOFTWARE. |
|---|
| 28 | * |
|---|
| 29 | * 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR ITS |
|---|
| 30 | * LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR |
|---|
| 31 | * EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO YOUR |
|---|
| 32 | * USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ADVISED OF |
|---|
| 33 | * THE POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT |
|---|
| 34 | * ACTUALLY PAID FOR THE SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE |
|---|
| 35 | * LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ESSENTIAL PURPOSE OF |
|---|
| 36 | * ANY LIMITED REMEDY. |
|---|
| 37 | * |
|---|
| 38 | * $brcm_Workfile: nexus_base_driver.h $ |
|---|
| 39 | * $brcm_Revision: 3 $ |
|---|
| 40 | * $brcm_Date: 8/2/11 2:53p $ |
|---|
| 41 | * |
|---|
| 42 | * Revision History: |
|---|
| 43 | * |
|---|
| 44 | * $brcm_Log: /nexus/base/include/nexus_base_driver.h $ |
|---|
| 45 | * |
|---|
| 46 | * 3 8/2/11 2:53p vsilyaev |
|---|
| 47 | * SW7125-1014 : Add additional scheduler threads for active standby |
|---|
| 48 | * modules |
|---|
| 49 | * |
|---|
| 50 | * 2 7/21/11 2:31p vsilyaev |
|---|
| 51 | * SW7125-1014 : Add module enable function |
|---|
| 52 | * |
|---|
| 53 | * SW7125-1014/2 8/2/11 10:09a gmohile |
|---|
| 54 | * SW7125-1014 : Add additional scheduler threads for active standby |
|---|
| 55 | * modules |
|---|
| 56 | * |
|---|
| 57 | * SW7125-1014/1 7/12/11 3:05p gmohile |
|---|
| 58 | * SW7125-1014 : Add module enable function |
|---|
| 59 | * |
|---|
| 60 | * 1 9/24/10 9:23a erickson |
|---|
| 61 | * SW7420-943: add files |
|---|
| 62 | * |
|---|
| 63 | ***************************************************************************/ |
|---|
| 64 | #ifndef NEXUS_BASE_DRIVER_H__ |
|---|
| 65 | #define NEXUS_BASE_DRIVER_H__ |
|---|
| 66 | |
|---|
| 67 | #include "nexus_base_types.h" |
|---|
| 68 | |
|---|
| 69 | #ifdef __cplusplus |
|---|
| 70 | #error Internal header file cannot be built by C++ compiler |
|---|
| 71 | #endif |
|---|
| 72 | |
|---|
| 73 | /** |
|---|
| 74 | Base API's which need to be called from platform/driver code which doesn't need or have access to nexus_base.h |
|---|
| 75 | **/ |
|---|
| 76 | |
|---|
| 77 | /** |
|---|
| 78 | Summary: |
|---|
| 79 | Enumerate registered modules |
|---|
| 80 | |
|---|
| 81 | Description: |
|---|
| 82 | This function is used to enumerate all registered nexus modules. callback |
|---|
| 83 | will be called with a pointer to the module settings used to initialize the |
|---|
| 84 | module. |
|---|
| 85 | |
|---|
| 86 | See Also: |
|---|
| 87 | NEXUS_Module_Create |
|---|
| 88 | **/ |
|---|
| 89 | void NEXUS_Module_EnumerateAll( |
|---|
| 90 | void (*callback)(void *context, NEXUS_ModuleHandle module, const char *pModuleName, const NEXUS_ModuleSettings *pSettings), |
|---|
| 91 | void *context |
|---|
| 92 | ); |
|---|
| 93 | |
|---|
| 94 | /** |
|---|
| 95 | Summary: |
|---|
| 96 | Macro to lock a module with debug tagging. |
|---|
| 97 | |
|---|
| 98 | Description: |
|---|
| 99 | |
|---|
| 100 | See Also: |
|---|
| 101 | NEXUS_LockModule |
|---|
| 102 | **/ |
|---|
| 103 | #define NEXUS_Module_Lock(module) NEXUS_Module_Lock_Tagged((module), __FILE__, __LINE__) |
|---|
| 104 | |
|---|
| 105 | /** |
|---|
| 106 | Summary: |
|---|
| 107 | Macro to try to lock a module with debug tagging. |
|---|
| 108 | |
|---|
| 109 | Description: |
|---|
| 110 | |
|---|
| 111 | See Also: |
|---|
| 112 | NEXUS_TryLockModule |
|---|
| 113 | **/ |
|---|
| 114 | #define NEXUS_Module_TryLock(module) NEXUS_Module_TryLock_Tagged((module), __FILE__, __LINE__) |
|---|
| 115 | |
|---|
| 116 | /** |
|---|
| 117 | Summary: |
|---|
| 118 | Macro to unlock a module with debug tagging. |
|---|
| 119 | |
|---|
| 120 | Description: |
|---|
| 121 | |
|---|
| 122 | See Also: |
|---|
| 123 | NEXUS_UnlockModule |
|---|
| 124 | **/ |
|---|
| 125 | #define NEXUS_Module_Unlock(module) NEXUS_Module_Unlock_Tagged((module), __FILE__, __LINE__) |
|---|
| 126 | |
|---|
| 127 | /** |
|---|
| 128 | Summary: |
|---|
| 129 | Actual function called by NEXUS_LockModule macro. |
|---|
| 130 | |
|---|
| 131 | Description: |
|---|
| 132 | |
|---|
| 133 | See Also: |
|---|
| 134 | NEXUS_LockModule |
|---|
| 135 | **/ |
|---|
| 136 | void NEXUS_Module_Lock_Tagged( |
|---|
| 137 | NEXUS_ModuleHandle module, |
|---|
| 138 | const char *pFileName, |
|---|
| 139 | unsigned lineNumber |
|---|
| 140 | ); |
|---|
| 141 | |
|---|
| 142 | /** |
|---|
| 143 | Summary: |
|---|
| 144 | Actual function called by NEXUS_TryLockModule macro. |
|---|
| 145 | |
|---|
| 146 | Description: |
|---|
| 147 | |
|---|
| 148 | See Also: |
|---|
| 149 | NEXUS_TryLockModule |
|---|
| 150 | **/ |
|---|
| 151 | bool NEXUS_Module_TryLock_Tagged( |
|---|
| 152 | NEXUS_ModuleHandle module, |
|---|
| 153 | const char *pFileName, |
|---|
| 154 | unsigned lineNumber |
|---|
| 155 | ); |
|---|
| 156 | |
|---|
| 157 | /** |
|---|
| 158 | Summary: |
|---|
| 159 | Actual function called by NEXUS_UnlockModule macro. |
|---|
| 160 | |
|---|
| 161 | Description: |
|---|
| 162 | |
|---|
| 163 | See Also: |
|---|
| 164 | NEXUS_UnlockModule |
|---|
| 165 | **/ |
|---|
| 166 | void NEXUS_Module_Unlock_Tagged( |
|---|
| 167 | NEXUS_ModuleHandle module, |
|---|
| 168 | const char *pFileName, |
|---|
| 169 | unsigned lineNumber |
|---|
| 170 | ); |
|---|
| 171 | |
|---|
| 172 | void NEXUS_Module_GetPriority( |
|---|
| 173 | NEXUS_ModuleHandle module, |
|---|
| 174 | NEXUS_ModulePriority *pPriority |
|---|
| 175 | ); |
|---|
| 176 | |
|---|
| 177 | /** |
|---|
| 178 | Summary: |
|---|
| 179 | Returns true if given module could be left active during active standby |
|---|
| 180 | **/ |
|---|
| 181 | bool NEXUS_Module_ActiveStandyCompatible( |
|---|
| 182 | NEXUS_ModuleHandle module |
|---|
| 183 | ); |
|---|
| 184 | |
|---|
| 185 | |
|---|
| 186 | /** |
|---|
| 187 | Summary: |
|---|
| 188 | Macro to enable a module with debug tagging. |
|---|
| 189 | |
|---|
| 190 | Description: |
|---|
| 191 | |
|---|
| 192 | See Also: |
|---|
| 193 | **/ |
|---|
| 194 | #define NEXUS_Module_Enable(module) NEXUS_Module_Enable_Tagged((module), __FILE__, __LINE__) |
|---|
| 195 | |
|---|
| 196 | /** |
|---|
| 197 | Summary: |
|---|
| 198 | Macro to disable a module with debug tagging. |
|---|
| 199 | |
|---|
| 200 | Description: |
|---|
| 201 | |
|---|
| 202 | See Also: |
|---|
| 203 | **/ |
|---|
| 204 | #define NEXUS_Module_Disable(module) NEXUS_Module_Disable_Tagged((module), __FILE__, __LINE__) |
|---|
| 205 | |
|---|
| 206 | /** |
|---|
| 207 | Summary: |
|---|
| 208 | Actual function called by NEXUS_Module_Enable macro. |
|---|
| 209 | |
|---|
| 210 | Description: |
|---|
| 211 | |
|---|
| 212 | See Also: |
|---|
| 213 | **/ |
|---|
| 214 | void NEXUS_Module_Enable_Tagged( |
|---|
| 215 | NEXUS_ModuleHandle module, |
|---|
| 216 | const char *pFileName, |
|---|
| 217 | unsigned lineNumber |
|---|
| 218 | ); |
|---|
| 219 | |
|---|
| 220 | /** |
|---|
| 221 | Summary: |
|---|
| 222 | Actual function called by NEXUS_Module_Disable macro. |
|---|
| 223 | |
|---|
| 224 | Description: |
|---|
| 225 | |
|---|
| 226 | See Also: |
|---|
| 227 | **/ |
|---|
| 228 | void NEXUS_Module_Disable_Tagged( |
|---|
| 229 | NEXUS_ModuleHandle module, |
|---|
| 230 | const char *pFileName, |
|---|
| 231 | unsigned lineNumber |
|---|
| 232 | ); |
|---|
| 233 | |
|---|
| 234 | #endif /* !defined NEXUS_BASE_DRIVER_H__ */ |
|---|
| 235 | |
|---|
| 236 | |
|---|