| 1 | /*************************************************************************** |
|---|
| 2 | * (c)2007-2010 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_security_init.h $ |
|---|
| 39 | * $brcm_Revision: 5 $ |
|---|
| 40 | * $brcm_Date: 12/22/10 5:48p $ |
|---|
| 41 | * |
|---|
| 42 | * Module Description: |
|---|
| 43 | * |
|---|
| 44 | * Revision History: |
|---|
| 45 | * |
|---|
| 46 | * $brcm_Log: /nexus/modules/security/7400/include/nexus_security_init.h $ |
|---|
| 47 | * |
|---|
| 48 | * 5 12/22/10 5:48p mphillip |
|---|
| 49 | * SW7422-104: Merge 40nm support to /main |
|---|
| 50 | * |
|---|
| 51 | * SW7422-104/1 12/16/10 6:14p mphillip |
|---|
| 52 | * SW7422-104: Initial support for 7422 |
|---|
| 53 | * |
|---|
| 54 | * 4 7/14/10 10:33a erickson |
|---|
| 55 | * SW7405-4621: replace nexus_base.h with nexus_types.h |
|---|
| 56 | * |
|---|
| 57 | * 3 1/18/10 7:25p mphillip |
|---|
| 58 | * SW7550-199: Add customer modes to security module initialization (for |
|---|
| 59 | * select chips only) |
|---|
| 60 | * |
|---|
| 61 | * 2 4/27/09 1:30p erickson |
|---|
| 62 | * PR53745: added NEXUS_SecurityModuleSettings.numKeySlotsForType[] |
|---|
| 63 | * |
|---|
| 64 | * 1 1/18/08 2:21p jgarrett |
|---|
| 65 | * PR 38808: Merging to main branch |
|---|
| 66 | * |
|---|
| 67 | * Nexus_Devel/3 11/30/07 11:13a erickson |
|---|
| 68 | * PR35457: api update |
|---|
| 69 | * |
|---|
| 70 | * Nexus_Devel/2 11/28/07 2:11p erickson |
|---|
| 71 | * PR35457: doc update |
|---|
| 72 | * |
|---|
| 73 | * Nexus_Devel/1 11/15/07 3:54p erickson |
|---|
| 74 | * PR37137: added Security module |
|---|
| 75 | * |
|---|
| 76 | **************************************************************************/ |
|---|
| 77 | #ifndef NEXUS_SECURITY_INIT_H__ |
|---|
| 78 | #define NEXUS_SECURITY_INIT_H__ |
|---|
| 79 | |
|---|
| 80 | #include "nexus_types.h" |
|---|
| 81 | |
|---|
| 82 | #ifdef __cplusplus |
|---|
| 83 | extern "C" { |
|---|
| 84 | #endif |
|---|
| 85 | |
|---|
| 86 | #define NEXUS_SECURITY_MAX_KEYSLOT_TYPES 8 |
|---|
| 87 | |
|---|
| 88 | /** |
|---|
| 89 | Summary: |
|---|
| 90 | Settings used to configure customer mode for the Security module. |
|---|
| 91 | |
|---|
| 92 | Description: |
|---|
| 93 | This enum describes modes available for the security system. Not all modes are supported on all chips, nor do all chips require this to be set. |
|---|
| 94 | |
|---|
| 95 | See Also: |
|---|
| 96 | NEXUS_SecurityModule_GetDefaultSettings |
|---|
| 97 | NEXUS_SecurityModule_Init |
|---|
| 98 | **/ |
|---|
| 99 | typedef enum NEXUS_SecurityCustomerMode { |
|---|
| 100 | NEXUS_SecurityCustomerMode_eGeneric, |
|---|
| 101 | NEXUS_SecurityCustomerMode_eDvs042, |
|---|
| 102 | NEXUS_SecurityCustomerMode_eDesCts, |
|---|
| 103 | NEXUS_SecurityCustomerMode_eDvbCsa |
|---|
| 104 | } NEXUS_SecurityCustomerMode; |
|---|
| 105 | |
|---|
| 106 | /** |
|---|
| 107 | Summary: |
|---|
| 108 | Settings used to configure the Security module. |
|---|
| 109 | |
|---|
| 110 | Description: |
|---|
| 111 | |
|---|
| 112 | See Also: |
|---|
| 113 | NEXUS_SecurityModule_GetDefaultSettings |
|---|
| 114 | NEXUS_SecurityModule_Init |
|---|
| 115 | **/ |
|---|
| 116 | typedef struct NEXUS_SecurityModuleSettings |
|---|
| 117 | { |
|---|
| 118 | NEXUS_SecurityCustomerMode customerMode; |
|---|
| 119 | unsigned int numKeySlotsForType[NEXUS_SECURITY_MAX_KEYSLOT_TYPES]; |
|---|
| 120 | bool enableMulti2Key; |
|---|
| 121 | } NEXUS_SecurityModuleSettings; |
|---|
| 122 | |
|---|
| 123 | /** |
|---|
| 124 | Summary: |
|---|
| 125 | Get default settings for the Security module initialization. |
|---|
| 126 | |
|---|
| 127 | Description: |
|---|
| 128 | This is required in order to make application code resilient to the addition of new structure members in the future. |
|---|
| 129 | |
|---|
| 130 | See Also: |
|---|
| 131 | NEXUS_SecurityModule_Init |
|---|
| 132 | **/ |
|---|
| 133 | void NEXUS_SecurityModule_GetDefaultSettings( |
|---|
| 134 | NEXUS_SecurityModuleSettings *pSettings /* [out] */ |
|---|
| 135 | ); |
|---|
| 136 | |
|---|
| 137 | /** |
|---|
| 138 | Summary: |
|---|
| 139 | Initialize the Security module. |
|---|
| 140 | |
|---|
| 141 | Description: |
|---|
| 142 | This is called by the NEXUS Platform when the system is initialized. |
|---|
| 143 | |
|---|
| 144 | The keyslot table can only be initialized once per power cycle of the chip, and on some chips the values of a previous initialization can be read back. NEXUS_SecurityModule_GetCurrentSettings can read that information. |
|---|
| 145 | |
|---|
| 146 | See Also: |
|---|
| 147 | NEXUS_SecurityModule_Uninit |
|---|
| 148 | NEXUS_SecurityModule_GetCurrentSettings |
|---|
| 149 | NEXUS_Security_Open - open Interface for Security |
|---|
| 150 | **/ |
|---|
| 151 | NEXUS_ModuleHandle NEXUS_SecurityModule_Init( |
|---|
| 152 | const NEXUS_SecurityModuleSettings *pSettings |
|---|
| 153 | ); |
|---|
| 154 | |
|---|
| 155 | /** |
|---|
| 156 | Summary: |
|---|
| 157 | Retrieve the current Security module settings. |
|---|
| 158 | |
|---|
| 159 | Description: |
|---|
| 160 | This function retrieves the current Security module settings. |
|---|
| 161 | |
|---|
| 162 | If the application has modified pSettings->numKeySlotsForType, or wishes to read the number of keyslots allocated per type, this returns the information. |
|---|
| 163 | |
|---|
| 164 | See Also: |
|---|
| 165 | NEXUS_SecurityModule_Init |
|---|
| 166 | **/ |
|---|
| 167 | void NEXUS_SecurityModule_GetCurrentSettings( |
|---|
| 168 | NEXUS_ModuleHandle module, |
|---|
| 169 | NEXUS_SecurityModuleSettings *pSettings |
|---|
| 170 | ); |
|---|
| 171 | |
|---|
| 172 | /** |
|---|
| 173 | Summary: |
|---|
| 174 | Uninitialize the Security module. |
|---|
| 175 | |
|---|
| 176 | Description: |
|---|
| 177 | This is called by the NEXUS Platform when the system is uninitialized. |
|---|
| 178 | |
|---|
| 179 | See Also: |
|---|
| 180 | NEXUS_SecurityModule_Init |
|---|
| 181 | **/ |
|---|
| 182 | void NEXUS_SecurityModule_Uninit(void); |
|---|
| 183 | |
|---|
| 184 | #ifdef __cplusplus |
|---|
| 185 | } |
|---|
| 186 | #endif |
|---|
| 187 | |
|---|
| 188 | #endif |
|---|