RDK Documentation (Open Sourced RDK Components)
mfrApi.h
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2016 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 
21 
22 /**
23 * @defgroup iarmmgrs
24 * @{
25 * @defgroup mfr
26 * @{
27 **/
28 
29 
30 #ifndef __MFR_API_H__
31 #define __MFR_API_H__
32 /*-----------------------------------------------------------------*/
33 /*-------------------------------------------------------------------
34  Include Files
35 -------------------------------------------------------------------*/
36 #include "mfrTypes.h"
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 typedef unsigned long VL_MFR_DEVICE_HANDLE_t;
42 
43 typedef enum _VL_MFR_API_RESULT
44 { // ENUM additions are allowed. Insertions, deletions and value changes are not allowed.
45  VL_MFR_API_RESULT_SUCCESS = 0,
46  VL_MFR_API_RESULT_FAILED = 1,
47  VL_MFR_API_RESULT_NOT_EXISTING = 6,
48  VL_MFR_API_RESULT_NULL_PARAM = 7,
49  VL_MFR_API_RESULT_OUT_OF_RANGE = 9,
50  VL_MFR_API_RESULT_OPEN_FAILED = 10,
51  VL_MFR_API_RESULT_READ_FAILED = 11,
52  VL_MFR_API_RESULT_WRITE_FAILED = 12,
53  VL_MFR_API_RESULT_MALLOC_FAILED = 13,
54  VL_MFR_API_RESULT_DECRYPTION_FAILED = 15,
55  VL_MFR_API_RESULT_NULL_KEY = 16,
56  VL_MFR_API_RESULT_INVALID_KEY_LENGTH = 17,
57  VL_MFR_API_RESULT_INVALID_BUFFER_LENGTH = 18,
58  VL_MFR_API_RESULT_SIZE_MISMATCH = 19,
59 
60 }VL_MFR_API_RESULT;
61 
62 
63 typedef enum _VL_PLATFORM_VERSION_TYPE
64 { // ENUM additions are allowed. Insertions, deletions and value changes are not allowed.
65  VL_PLATFORM_VERSION_TYPE_BOARD_VERSION = 0,
66  VL_PLATFORM_VERSION_TYPE_BOARD_SERIAL_NO = 1,
67  VL_PLATFORM_VERSION_TYPE_CM_CHIP_VERSION = 2,
68  VL_PLATFORM_VERSION_TYPE_DECODER_SW_VERSION = 7,
69  VL_PLATFORM_VERSION_TYPE_OS_KERNEL_VERSION = 8,
70  VL_PLATFORM_VERSION_TYPE_MFR_LIB_VERSION = 11,
71  VL_PLATFORM_VERSION_TYPE_FRONT_PANEL_VERSION = 12,
72  VL_PLATFORM_VERSION_TYPE_SOFTWARE_IMAGE_VERSION = 14,
73  VL_PLATFORM_VERSION_TYPE_OCHD_VERSION = 16,
74  VL_PLATFORM_VERSION_TYPE_OCAP_VERSION = 18,
75  VL_PLATFORM_VERSION_TYPE_BOOT_ROM_VERSION = 20,
76  VL_PLATFORM_VERSION_TYPE_MODEL_NUMBER = 22,
77  VL_PLATFORM_VERSION_TYPE_MODEL_SERIAL_NO = 23,
78  VL_PLATFORM_VERSION_TYPE_VENDOR_NAME = 24,
79  VL_PLATFORM_VERSION_TYPE_VENDOR_SERIAL_NO = 25,
80  VL_PLATFORM_VERSION_TYPE_MANUFACTURE_DATE = 26,
81 } VL_PLATFORM_VERSION_TYPE;
82 
83 
84 typedef enum _VL_NORMAL_NVRAM_DATA_TYPE
85 { // ENUM additions are allowed. Insertions, deletions and value changes are not allowed.
86 
87  VL_NORMAL_NVRAM_DATA_BOOT_IMAGE_NAME = 0x70000001,// max: 256 bytes : typically 128 bytes : name of current monolithic image
88  VL_NORMAL_NVRAM_DATA_BOOT_FIRMWARE_IMAGE_NAME = 0x70000010,// max: 256 bytes : typically 128 bytes : name of current firmware image name
89  VL_NORMAL_NVRAM_DATA_BOOT_APPLICATION_IMAGE_NAME = 0x70000011,// max: 256 bytes : typically 128 bytes : name of current application image name
90  VL_NORMAL_NVRAM_DATA_BOOT_DATA_IMAGE_NAME = 0x70000012,// max: 256 bytes : typically 128 bytes : name of current data image name
91 
92  VL_NORMAL_NVRAM_DATA_CACP_AuthStatus = 0x70000100,// max: 16 bytes : typically 1 bytes :
93  VL_NORMAL_NVRAM_DATA_CACP_HostId = 0x70000101,// max: 16 bytes : typically 5 bytes :
94  VL_NORMAL_NVRAM_DATA_COM_DWNLD_CO_SIGN_NAME = 0x70000211,// max: 256 bytes : typically 128 bytes : Co-Signer Name of the device
95  VL_NORMAL_NVRAM_DATA_COM_DWNL_VEN_ID = 0x70000212,// max: 16 bytes : typically 3 bytes : Vendor Id of the device which
96  VL_NORMAL_NVRAM_DATA_COM_DWNL_HW_ID = 0x70000213,// max: 16 bytes : typically 4 bytes : Hardware ID of the dvice which
97  //VL_NORMAL_NVRAM_DATA_COM_DWNL_CODE_FILE_NAME = 0x70000214,// max: 256 bytes : typically 128 bytes : Current running Code file name of the device, identical to VL_NORMAL_NVRAM_DATA_BOOT_IMAGE_NAME, (not used)
98  VL_NORMAL_NVRAM_DATA_COM_DWNL_MFR_CODE_ACC_STR_TIME = 0x70000215,// max: 32 bytes : typically 12 bytes : Manufacturer Code Access Start Time Register
99  VL_NORMAL_NVRAM_DATA_COM_DWNL_CO_SIGN_CODE_ACC_STR_TIME = 0x70000216,// max: 32 bytes : typically 12 bytes : Co-Signer Code Access Start Time Register
100  VL_NORMAL_NVRAM_DATA_COM_DWNL_MFR_CVC_ACC_STR_TIME = 0x70000217,// max: 32 bytes : typically 12 bytes : Manufacturer CVC Access Start Time Register
101  VL_NORMAL_NVRAM_DATA_COM_DWNL_CO_SIGN_CVC_ACC_STR_TIME = 0x70000218,// max: 32 bytes : typically 12 bytes : Co-Signer CVC Start Time Register
102  VL_NORMAL_NVRAM_DATA_COM_DWNLD_MGR_STATUS = 0x70000219,// max: 16 bytes : typically 4 bytes : This is the code image down load status maintained by the Common Download Manager
103  VL_NORMAL_NVRAM_DATA_CDL_MFR_CODE_ACC_UPG_STR_TIME = 0x7000021C,// max: 32 bytes : typically 12 bytes : Manufacturer Code Access Start Time Register
104  VL_NORMAL_NVRAM_DATA_CDL_CO_SIGN_CODE_ACC_UPG_STR_TIME = 0x7000021D,// max: 32 bytes : typically 12 bytes : Co-Signer Code Access Start Time Register
105 
106  VL_NORMAL_NVRAM_DATA_CDL_FW_MFR_CODE_ACC_UPG_STR_TIME = 0x70000300,// max: 32 bytes : typically 12 bytes : Manufacturer Code Access Start Time Register
107  VL_NORMAL_NVRAM_DATA_CDL_FW_CO_SIGN_CODE_ACC_UPG_STR_TIME = 0x70000301,// max: 32 bytes : typically 12 bytes : Co-Signer Code Access Start Time Register
108  VL_NORMAL_NVRAM_DATA_CDL_APP_MFR_CODE_ACC_UPG_STR_TIME = 0x70000302,// max: 32 bytes : typically 12 bytes : Manufacturer Code Access Start Time Register
109  VL_NORMAL_NVRAM_DATA_CDL_APP_CO_SIGN_CODE_ACC_UPG_STR_TIME = 0x70000303,// max: 32 bytes : typically 12 bytes : Co-Signer Code Access Start Time Register
110  VL_NORMAL_NVRAM_DATA_CDL_DATA_MFR_CODE_ACC_UPG_STR_TIME = 0x70000304,// max: 32 bytes : typically 12 bytes : Manufacturer Code Access Start Time Register
111  VL_NORMAL_NVRAM_DATA_CDL_DATA_CO_SIGN_CODE_ACC_UPG_STR_TIME = 0x70000305,// max: 32 bytes : typically 12 bytes : Co-Signer Code Access Start Time Register
112 
113  VL_NORMAL_NVRAM_DATA_CDL_FW_MFR_CODE_ACC_BOOT_STR_TIME = 0x70000320,// max: 32 bytes : typically 12 bytes : Manufacturer Code Access Start Time Register
114  VL_NORMAL_NVRAM_DATA_CDL_FW_CO_SIGN_CODE_ACC_BOOT_STR_TIME = 0x70000321,// max: 32 bytes : typically 12 bytes : Co-Signer Code Access Start Time Register
115  VL_NORMAL_NVRAM_DATA_CDL_APP_MFR_CODE_ACC_BOOT_STR_TIME = 0x70000322,// max: 32 bytes : typically 12 bytes : Manufacturer Code Access Start Time Register
116  VL_NORMAL_NVRAM_DATA_CDL_APP_CO_SIGN_CODE_ACC_BOOT_STR_TIME = 0x70000323,// max: 32 bytes : typically 12 bytes : Co-Signer Code Access Start Time Register
117  VL_NORMAL_NVRAM_DATA_CDL_DATA_MFR_CODE_ACC_BOOT_STR_TIME = 0x70000324,// max: 32 bytes : typically 12 bytes : Manufacturer Code Access Start Time Register
118  VL_NORMAL_NVRAM_DATA_CDL_DATA_CO_SIGN_CODE_ACC_BOOT_STR_TIME= 0x70000325,// max: 32 bytes : typically 12 bytes : Co-Signer Code Access Start Time Register
119 
120  VL_NORMAL_NVRAM_DATA_IEEE1394_DTCP_KEY_TYPE = 0x70000500,// max: 16 bytes : typically 1 bytes : DTCP key type
121  VL_NORMAL_NVRAM_DATA_IEEE1394_DTCP_KEY_STATUS = 0x70000501,// max: 16 bytes : typically 1 bytes : DTCP key status
122 
123 }VL_NORMAL_NVRAM_DATA_TYPE;
124 
125 
126 
127 typedef enum _VL_SECURE_NVRAM_DATA_TYPE
128 { // ENUM additions are allowed. Insertions, deletions and value changes are not allowed.
129  // Certificates and Keys for Cable Card Conditional Access and Copy Protection
130  VL_SECURE_NVRAM_DATA_CACP_HOST_ROOT_CERT = 0x100,// max: 2048 bytes : typically 1024 bytes : Cable Labs Root certificate
131  VL_SECURE_NVRAM_DATA_CACP_HOST_MFR_CA_CERT = 0x101,// max: 2048 bytes : typically 1024 bytes : Cable Labs Manufacturer CA Certificate
132  VL_SECURE_NVRAM_DATA_CACP_HOST_DEV_CERT = 0x102,// max: 2048 bytes : typically 1024 bytes : Host Device Certificate
133  VL_SECURE_NVRAM_DATA_CACP_HOST_DEV_PRIVATE_KEY = 0x103,// max: 2048 bytes : typically 1024 bytes : Host Device Private Key
134  VL_SECURE_NVRAM_DATA_CACP_DH_B_G1 = 0x104,// max: 256 bytes : typically 128 bytes : Diffie-Hellman base ( g )
135  VL_SECURE_NVRAM_DATA_CACP_DH_P_N1 = 0x105,// max: 256 bytes : typically 128 bytes : Diffie-Hellman prime ( n )
136  VL_SECURE_NVRAM_DATA_CACP_DHKey = 0x106,// max: 256 bytes : typically 128 bytes :
137  VL_SECURE_NVRAM_DATA_CACP_AuthKeyH = 0x107,// max: 64 bytes : typically 20 bytes :
138  //Cable Labs Code Verification Certificates for Common Download
139  VL_SECURE_NVRAM_DATA_COM_DWNLD_CL_CODE_VER_ROOT_CA = 0x200,// max: 2048 bytes : typically 1024 bytes : Cable Labs Code Verification Root CA
140  VL_SECURE_NVRAM_DATA_COM_DWNLD_CL_CVC_CA = 0x201,// max: 2048 bytes : typically 1024 bytes : Cable Labs CVC CA
141  VL_SECURE_NVRAM_DATA_COM_DWNLD_MFR_CVC = 0x202,// max: 2048 bytes : typically 1024 bytes : Manufacturer CVC
142 
143  //Common Download ( code image download NV data)
144  VL_SECURE_NVRAM_DATA_COM_DWNLD_CVC_CA_PUB_KEY = 0x219,// max: 2048 bytes : typically 1024 bytes : CVC CA public Key stored by the host device
145 
146  //Cable Labs Application Code verification Certificates
147  //VL_SECURE_NVRAM_DATA_COM_DWNLD_CL_CODE_VER_ROOT_CA = 0x300,// max: 2048 bytes : typically 1024 bytes : Cable Labs Code Verification Root CA same as above 0x100
148  VL_SECURE_NVRAM_DATA_APP_CL_APP_CVC_CA = 0x301,// max: 2048 bytes : typically 1024 bytes : Cable Labs Application CVC CA
149  VL_SECURE_NVRAM_DATA_APP_MAN_CVC = 0x302,// max: 2048 bytes : typically 1024 bytes : Cable Labs Application Manufacturer CVCs
150 
151  VL_SECURE_NVRAM_DATA_SERIAL_NUMBER = 0x400,// max: 32 bytes : typically 16 bytes :
152 
153  //Ieee1394 DTCP certificates and Keys
154  VL_SECURE_NVRAM_DATA_IEEE1394_DTCP_CERT_KEYS = 0x500,// max: 2048 bytes : typically 1024 bytes : DTCP keys for 1394 CP
155  VL_SECURE_NVRAM_DATA_IEEE1394_DTCP_SRM = 0x501,// max: 4096 bytes : typically 1024 bytes : DTCP SRM
156  VL_SECURE_NVRAM_DATA_IEEE1394_DTCP_SEED = 0x502,// max: 64 bytes : typically 24 bytes : DTCP SEED
157 
158  // VL certificates and Keys
159  VL_SECURE_NVRAM_DATA_VL_CERT_KEYS = 0x600,// max: 1024 bytes : typically 512 bytes : VividLogic certificates
160 
161 }VL_SECURE_NVRAM_DATA_TYPE;
162 
163 
164 typedef enum _VL_STACK_2_MFR_EVENT_TYPE
165 { // ENUM additions are allowed. Insertions, deletions and value changes are not allowed.
166 
167  VL_STACK_2_MFR_EVENT_SET_UPGRADE_TO_IMAGE = 0x20000100,
168  VL_STACK_2_MFR_EVENT_SET_REBOOT_WITH_UPGRADED_IMAGE = 0x20000101,
169  VL_STACK_2_MFR_EVENT_SET_UPGRADE_IMAGE_NAME = 0x20000102,
170  VL_STACK_2_MFR_EVENT_SET_UPGRADE_SUCCEEDED = 0x20000103,
171  VL_STACK_2_MFR_EVENT_SET_UPGRADE_FAILED = 0x20000104,
172 
173  VL_STACK_2_MFR_EVENT_get_CONFIG_PATH = 0x20000200,
174  VL_STACK_2_MFR_EVENT_get_SNMP_ENTERPRISE_ID = 0x20000201,
175 
176  VL_STACK_2_MFR_EVENT_get_CALL_DFAST2 = 0x20000301,
177 
178  VL_STACK_2_MFR_EVENT_get_PREVIOUS_BOOT_IMAGE_NAME = 0x20000400,
179  VL_STACK_2_MFR_EVENT_get_CURRENT_BOOT_IMAGE_NAME = 0x20000401,
180  VL_STACK_2_MFR_EVENT_get_UPGRADE_IMAGE_NAME = 0x20000402,
181  VL_STACK_2_MFR_EVENT_get_UPGRADE_STATUS = 0x20000403,
182 
183  VL_STACK_2_MFR_EVENT_SET_CARD_TYPE = 0x20000700,
184  VL_STACK_2_MFR_EVENT_SET_FIRMWARE_VERSION_INFO = 0x20000701,
185 
186 } VL_STACK_2_MFR_EVENT_TYPE;
187 
188 /*
189 struct VL_NVRAM_DATA
190 nSize is the size of the data read from the NVRAM.
191 pData is the data buffer of the data read from the NVRAM.
192 */
193 typedef struct _VL_NVRAM_DATA
194 { // STRUCT member additions are allowed. Insertions, deletions, datatype and name changes are not allowed.
195  unsigned long nActualBytes;
196  int nBytes;
197  unsigned char * pData;
199 
200 int MFR_Init (void);
201 int MFR_Shutdown (void);
202 
203 
204 VL_MFR_API_RESULT HAL_MFR_get_version ( VL_MFR_DEVICE_HANDLE_t hMFRHandle, VL_PLATFORM_VERSION_TYPE eVersionType, char ** ppString);
205 
206 VL_MFR_API_RESULT HAL_MFR_read_normal_nvram ( VL_MFR_DEVICE_HANDLE_t hMFRHandle, VL_NORMAL_NVRAM_DATA_TYPE eType, VL_NVRAM_DATA * pNvRamData);
207 VL_MFR_API_RESULT HAL_MFR_write_normal_nvram( VL_MFR_DEVICE_HANDLE_t hMFRHandle, VL_NORMAL_NVRAM_DATA_TYPE eType, const VL_NVRAM_DATA * pNvRamData);
208 
209 VL_MFR_API_RESULT HAL_MFR_read_secure_nvram ( VL_MFR_DEVICE_HANDLE_t hMFRHandle, VL_SECURE_NVRAM_DATA_TYPE eType, VL_NVRAM_DATA * pNvRamData);
210 VL_MFR_API_RESULT HAL_MFR_write_secure_nvram( VL_MFR_DEVICE_HANDLE_t hMFRHandle, VL_SECURE_NVRAM_DATA_TYPE eType, const VL_NVRAM_DATA * pNvRamData);
211 
212 VL_MFR_API_RESULT HAL_MFR_set_mfr_data( VL_MFR_DEVICE_HANDLE_t hMFRHandle, VL_STACK_2_MFR_EVENT_TYPE eEvent, void * _pvData);
213 VL_MFR_API_RESULT HAL_MFR_get_mfr_data( VL_MFR_DEVICE_HANDLE_t hMFRHandle, VL_STACK_2_MFR_EVENT_TYPE eEvent, void * _pvData);
214 /*-----------------------------------------------------------------*/
215 #ifdef __cplusplus
216 }
217 #endif
218 /*-----------------------------------------------------------------*/
219 #endif //__MFR_API_H__
220 /*-----------------------------------------------------------------*/
221 
222 
223 /** @} */
224 /** @} */
_VL_NVRAM_DATA
Definition: mfrApi.h:193