1*53ee8cc1Swenshuai.xi /* 2*53ee8cc1Swenshuai.xi Copyright (c) NDS Limited 2010 3*53ee8cc1Swenshuai.xi 4*53ee8cc1Swenshuai.xi P R O P R I E T A R Y & C O N F I D E N T I A L 5*53ee8cc1Swenshuai.xi 6*53ee8cc1Swenshuai.xi The copyright of this code and related documentation together with 7*53ee8cc1Swenshuai.xi any other associated intellectual property rights are vested in 8*53ee8cc1Swenshuai.xi NDS Limited and may not be used except in accordance with the terms 9*53ee8cc1Swenshuai.xi of the license that you have entered into with NDS Limited. 10*53ee8cc1Swenshuai.xi Use of this material without an express license from NDS Limited 11*53ee8cc1Swenshuai.xi shall be an infringement of copyright and any other intellectual 12*53ee8cc1Swenshuai.xi property rights that may be incorporated with this material. 13*53ee8cc1Swenshuai.xi */ 14*53ee8cc1Swenshuai.xi 15*53ee8cc1Swenshuai.xi #ifndef H_NSK_282 16*53ee8cc1Swenshuai.xi #define H_NSK_282 17*53ee8cc1Swenshuai.xi 18*53ee8cc1Swenshuai.xi /** 19*53ee8cc1Swenshuai.xi * @mainpage NSK2 API - HDI CA API for NSK2 Chips 20*53ee8cc1Swenshuai.xi * 21*53ee8cc1Swenshuai.xi * @author Reuben Sumner, Julia Rabinovich, Zvika Naparstek 22*53ee8cc1Swenshuai.xi * @date 01/01/2014 23*53ee8cc1Swenshuai.xi * @version 7.00 24*53ee8cc1Swenshuai.xi * 25*53ee8cc1Swenshuai.xi * @file nsk_282.h 26*53ee8cc1Swenshuai.xi 27*53ee8cc1Swenshuai.xi * @brief NSK2 API - HDI CA API for NSK2 Chips 28*53ee8cc1Swenshuai.xi 29*53ee8cc1Swenshuai.xi * This file contains the definitions and functions of the NSK2 High Level Driver Interface 30*53ee8cc1Swenshuai.xi * 31*53ee8cc1Swenshuai.xi */ 32*53ee8cc1Swenshuai.xi 33*53ee8cc1Swenshuai.xi #include "ndstypes.h" 34*53ee8cc1Swenshuai.xi #include "nsk_3014.h" 35*53ee8cc1Swenshuai.xi 36*53ee8cc1Swenshuai.xi /** 37*53ee8cc1Swenshuai.xi * @addtogroup NSK2HDI_COMMON Common Definitions 38*53ee8cc1Swenshuai.xi * @{ 39*53ee8cc1Swenshuai.xi */ 40*53ee8cc1Swenshuai.xi /** 41*53ee8cc1Swenshuai.xi * @addtogroup NSK2HDI_TYPEDEFS Typedefs 42*53ee8cc1Swenshuai.xi * @{ 43*53ee8cc1Swenshuai.xi */ 44*53ee8cc1Swenshuai.xi typedef NDS_ULONG NSK2HDI_STATUS; /*!< @brief NSK2 interface return status */ 45*53ee8cc1Swenshuai.xi typedef void* NSK2HDI_HANDLE; /*!< @brief NSK2 device handle */ 46*53ee8cc1Swenshuai.xi typedef NDS_ULONG NSK2HDI_DEVICE_ID; /*!< @brief NSK2 device ID */ 47*53ee8cc1Swenshuai.xi 48*53ee8cc1Swenshuai.xi /** @brief The NSK2HDI_CHILD_DEVICE structure is used to get/set child device information 49*53ee8cc1Swenshuai.xi */ 50*53ee8cc1Swenshuai.xi typedef struct _NSK2HDI_CHILD_DEVICE 51*53ee8cc1Swenshuai.xi { 52*53ee8cc1Swenshuai.xi NSK2HDI_DEVICE_ID device_id; /*!< @brief Child device ID. Must be unique in the entire system*/ 53*53ee8cc1Swenshuai.xi NDS_ULONG device_type; /*!< @brief Child device type. See possible values in \ref NSK2HDI_DEVICE_TYPE. */ 54*53ee8cc1Swenshuai.xi } NSK2HDI_CHILD_DEVICE; 55*53ee8cc1Swenshuai.xi 56*53ee8cc1Swenshuai.xi /** 57*53ee8cc1Swenshuai.xi * @addtogroup NSK2HDI_STATUS Return Values 58*53ee8cc1Swenshuai.xi * @{ 59*53ee8cc1Swenshuai.xi */ 60*53ee8cc1Swenshuai.xi 61*53ee8cc1Swenshuai.xi #define NSK2HDI_STATUS_OK 0x00000000U /*!< @brief Success status*/ 62*53ee8cc1Swenshuai.xi #define NSK2HDI_STATUS_INVALID_REQUEST 0x00000001U /*!< @brief Failure status - one ore more input parameters are invalid*/ 63*53ee8cc1Swenshuai.xi #define NSK2HDI_STATUS_FAILED 0x000000FFU /*!< @brief Failure status - general error */ 64*53ee8cc1Swenshuai.xi /** @} 65*53ee8cc1Swenshuai.xi * End of NSK2HDI_STATUS group belonging 66*53ee8cc1Swenshuai.xi */ 67*53ee8cc1Swenshuai.xi 68*53ee8cc1Swenshuai.xi /** 69*53ee8cc1Swenshuai.xi * @addtogroup NSK2HDI_DEFINES Special Values 70*53ee8cc1Swenshuai.xi * @{ 71*53ee8cc1Swenshuai.xi */ 72*53ee8cc1Swenshuai.xi #define NSK2HDI_ILLEGAL_HANDLE (NSK2HDI_HANDLE)NULL /*!< @brief The valid handle value should always be different from this value */ 73*53ee8cc1Swenshuai.xi #define NSK2HDI_CHILD_DEVICE_ID_MASK 0xFF000000U /*!< @brief The mask used for creating child device IDs */ 74*53ee8cc1Swenshuai.xi #define NSK2HDI_INVALID_PID 0xFFFF 75*53ee8cc1Swenshuai.xi #define NSK2HDI_INVALID_CONNECTION 0xFFFFFFFFL 76*53ee8cc1Swenshuai.xi /** @} 77*53ee8cc1Swenshuai.xi * End of NSK2HDI_DEFINES group belonging 78*53ee8cc1Swenshuai.xi */ 79*53ee8cc1Swenshuai.xi 80*53ee8cc1Swenshuai.xi /** 81*53ee8cc1Swenshuai.xi * @addtogroup NSK2HDI_DEVICE_TYPE Device types 82*53ee8cc1Swenshuai.xi * @{ 83*53ee8cc1Swenshuai.xi */ 84*53ee8cc1Swenshuai.xi #define NSK2HDI_CA_SOC_DEVICE_TYPE 0x00000001U /*!< @brief CA SoC device */ 85*53ee8cc1Swenshuai.xi #define NSK2HDI_OTP_DEVICE_TYPE 0x00000002U /*!< @brief OTP device */ 86*53ee8cc1Swenshuai.xi #define NSK2HDI_NSK_DEVICE_TYPE 0x00000003U /*!< @brief NSK device */ 87*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_TABLE_DEVICE_TYPE 0x00000004U /*!< @brief CM Channel Table device */ 88*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_GROUP_DEVICE_TYPE 0x00000005U /*!< @brief CM Channel Group device */ 89*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_DEVICE_TYPE 0x00000006U /*!< @brief CM Channel device */ 90*53ee8cc1Swenshuai.xi #define NSK2HDI_CA_PID_PROXY_DEVICE_TYPE 0x00000007U /*!< @brief CA PID Proxy device */ 91*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MTABLE_DEVICE_TYPE 0x00000008U /*!< @brief M2M Table device */ 92*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MCHANNEL_GROUP_DEVICE_TYPE 0x00000009U /*!< @brief M2M Channel Group device */ 93*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MCHANNEL_DEVICE_TYPE 0x0000000AU /*!< @brief M2M Channel device */ 94*53ee8cc1Swenshuai.xi #define NSK2HDI_DMA_DEVICE_TYPE 0x0000000BU /*!< @brief DMA device */ 95*53ee8cc1Swenshuai.xi 96*53ee8cc1Swenshuai.xi /** @} 97*53ee8cc1Swenshuai.xi * End of NSK2HDI_DEVICE_TYPE group belonging 98*53ee8cc1Swenshuai.xi */ 99*53ee8cc1Swenshuai.xi 100*53ee8cc1Swenshuai.xi /** @brief NSK2 HDI drivers device configuration callback function 101*53ee8cc1Swenshuai.xi */ 102*53ee8cc1Swenshuai.xi typedef void HDINSK2_ENUMERATION_CHANGE_CB_FN ( NSK2HDI_HANDLE device_handle, void *cookie); 103*53ee8cc1Swenshuai.xi 104*53ee8cc1Swenshuai.xi /** @} 105*53ee8cc1Swenshuai.xi * End of NSK2HDI_TYPEDEFS group belonging 106*53ee8cc1Swenshuai.xi */ 107*53ee8cc1Swenshuai.xi /** @} 108*53ee8cc1Swenshuai.xi * End of NSK2HDI_COMMON group belonging 109*53ee8cc1Swenshuai.xi */ 110*53ee8cc1Swenshuai.xi 111*53ee8cc1Swenshuai.xi /** 112*53ee8cc1Swenshuai.xi * @addtogroup NSK2HDI_CA_DEVICES CA Devices 113*53ee8cc1Swenshuai.xi * @{ 114*53ee8cc1Swenshuai.xi */ 115*53ee8cc1Swenshuai.xi 116*53ee8cc1Swenshuai.xi 117*53ee8cc1Swenshuai.xi /** 118*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_CA_SoC CA SoC Group Device 119*53ee8cc1Swenshuai.xi ** @{ 120*53ee8cc1Swenshuai.xi */ 121*53ee8cc1Swenshuai.xi 122*53ee8cc1Swenshuai.xi /*===========================================================================*/ 123*53ee8cc1Swenshuai.xi /** @brief Creates an instance of the CA SoC Group device and returns its handle to the caller. 124*53ee8cc1Swenshuai.xi 125*53ee8cc1Swenshuai.xi @param[in] CaSoCGroup_ID - the ID of the CA SoC Group device to open as provided during the SoC device registration. 126*53ee8cc1Swenshuai.xi @param[out] CaSoCGroup_handle - pointer to the device instance handle to be returned to a caller. 127*53ee8cc1Swenshuai.xi 128*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if device instance is created successfully or 129*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 130*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if request failed. 131*53ee8cc1Swenshuai.xi */ 132*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_CaSoCGroupDevice_Open (NSK2HDI_DEVICE_ID CaSoCGroup_ID, 133*53ee8cc1Swenshuai.xi NSK2HDI_HANDLE *CaSoCGroup_handle); 134*53ee8cc1Swenshuai.xi 135*53ee8cc1Swenshuai.xi 136*53ee8cc1Swenshuai.xi /*===========================================================================*/ 137*53ee8cc1Swenshuai.xi /** @brief Destroys the specified instance of the CA SoC Group device. 138*53ee8cc1Swenshuai.xi Releases all the resources used by this device instance. 139*53ee8cc1Swenshuai.xi 140*53ee8cc1Swenshuai.xi @param[in] CaSoCGroup_handle - handle of the device instance to be destroyed. 141*53ee8cc1Swenshuai.xi 142*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the device instance was destroyed or 143*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if an invalid device handle was passed. 144*53ee8cc1Swenshuai.xi */ 145*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_CaSoCGroupDevice_Close ( NSK2HDI_HANDLE CaSoCGroup_handle); 146*53ee8cc1Swenshuai.xi 147*53ee8cc1Swenshuai.xi 148*53ee8cc1Swenshuai.xi /*===========================================================================*/ 149*53ee8cc1Swenshuai.xi /** @brief Enumerates CA SoC Group device children. Retrieves number of children and associated info for each child. 150*53ee8cc1Swenshuai.xi If child_device_num is zero, the function is used to retrieve the number of children only and the child_device parameter is ignored. 151*53ee8cc1Swenshuai.xi 152*53ee8cc1Swenshuai.xi @param[in] CaSoCGroup_handle - a handle to the opened CA SoC Group device. 153*53ee8cc1Swenshuai.xi @param[in, out] child_device_num - the number of elements in the child_device array allocated by the caller as an input,the actual number of the CA SoC Group child devices as an output 154*53ee8cc1Swenshuai.xi @param[out] child_device - array that receives the child info for the CA SoC Group child devices. 155*53ee8cc1Swenshuai.xi 156*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 157*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 158*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 159*53ee8cc1Swenshuai.xi */ 160*53ee8cc1Swenshuai.xi 161*53ee8cc1Swenshuai.xi 162*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_CaSoCGroupDevice_EnumerateChildren( NSK2HDI_HANDLE CaSoCGroup_handle, 163*53ee8cc1Swenshuai.xi NDS_ULONG *child_device_num, 164*53ee8cc1Swenshuai.xi NSK2HDI_CHILD_DEVICE *child_device); 165*53ee8cc1Swenshuai.xi 166*53ee8cc1Swenshuai.xi 167*53ee8cc1Swenshuai.xi /*===========================================================================*/ 168*53ee8cc1Swenshuai.xi /** @brief Registers the callback function for CA SoC Group device configuration changes. 169*53ee8cc1Swenshuai.xi This method can be called once during the device instance life cycle. 170*53ee8cc1Swenshuai.xi 171*53ee8cc1Swenshuai.xi @param[in] CaSoCGroup_handle - a handle to the opened CA SoC Group device. 172*53ee8cc1Swenshuai.xi @param[in] cb_routine - pointer to the #HDINSK2_ENUMERATION_CHANGE_CB_FN function. 173*53ee8cc1Swenshuai.xi @param[in] cookie - a pointer that will be returned to the caller when the cb_routine is called. 174*53ee8cc1Swenshuai.xi 175*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 176*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 177*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 178*53ee8cc1Swenshuai.xi */ 179*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_CaSoCGroupDevice_RegisterEnumerationChangeCB ( NSK2HDI_HANDLE CaSoCGroup_handle, 180*53ee8cc1Swenshuai.xi HDINSK2_ENUMERATION_CHANGE_CB_FN *cb_routine, 181*53ee8cc1Swenshuai.xi void *cookie); 182*53ee8cc1Swenshuai.xi 183*53ee8cc1Swenshuai.xi /** @} 184*53ee8cc1Swenshuai.xi * End of NSK2HDI_CA_SoC group belonging 185*53ee8cc1Swenshuai.xi */ 186*53ee8cc1Swenshuai.xi 187*53ee8cc1Swenshuai.xi 188*53ee8cc1Swenshuai.xi /** 189*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_OTP OTP Device 190*53ee8cc1Swenshuai.xi ** @{ 191*53ee8cc1Swenshuai.xi */ 192*53ee8cc1Swenshuai.xi /** 193*53ee8cc1Swenshuai.xi * @addtogroup NSK2HDI_OTP_COMMON OTP Definitions 194*53ee8cc1Swenshuai.xi * @{ 195*53ee8cc1Swenshuai.xi */ 196*53ee8cc1Swenshuai.xi 197*53ee8cc1Swenshuai.xi /** 198*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_OTP_GET_PROPERTIES_REQUEST OTP Request IDs 199*53ee8cc1Swenshuai.xi ** @{ 200*53ee8cc1Swenshuai.xi */ 201*53ee8cc1Swenshuai.xi #define NSK2HDI_OTP_READ_ALL_DESCRIPTORS_REQUEST 0x00U /*!< @brief request for reading all OTP descriptors*/ 202*53ee8cc1Swenshuai.xi #define NSK2HDI_OTP_READ_ALL_DESCRIPTORS_REQUEST_ALT 0x01U /*!< @brief request for reading all OTP descriptors*/ 203*53ee8cc1Swenshuai.xi #define NSK2HDI_OTP_READ_FULLCHIPCONFIGURATION 0x02U /*!< @brief request for reading OTP hash configuration */ 204*53ee8cc1Swenshuai.xi #define NSK2HDI_OTP_MAX_NVCOUNTER_UPDATES 0x03U /*!< @brief request for reading OTP max NV counter updates*/ 205*53ee8cc1Swenshuai.xi /** @} 206*53ee8cc1Swenshuai.xi * End of NSK2HDI_OTP_GET_PROPERTIES_REQUEST group belonging 207*53ee8cc1Swenshuai.xi */ 208*53ee8cc1Swenshuai.xi 209*53ee8cc1Swenshuai.xi /** 210*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_OTP_DESCRIPTOR_TAGS OTP Descriptor Tags 211*53ee8cc1Swenshuai.xi ** @{ 212*53ee8cc1Swenshuai.xi */ 213*53ee8cc1Swenshuai.xi #define NSK2HDI_OTP_NDS_ID_DESC_TAG 0x20U /*!< @brief NDS serialization info descriptor*/ 214*53ee8cc1Swenshuai.xi #define NSK2HDI_OTP_NDS_BULK128_0_DESC_TAG 0x21U /*!< @brief First 128 bit bulk OTP read descriptor */ 215*53ee8cc1Swenshuai.xi #define NSK2HDI_OTP_NDS_BULK128_1_DESC_TAG 0x22U /*!< @brief Second 128 bit bulk OTP read descriptor */ 216*53ee8cc1Swenshuai.xi #define NSK2HDI_OTP_NDS_BULK128_2_DESC_TAG 0x23U /*!< @brief Third 128 bit bulk OTP read descriptor */ 217*53ee8cc1Swenshuai.xi #define NSK2HDI_OTP_NDS_BULK128_3_DESC_TAG 0x24U /*!< @brief Fourth 128 bit bulk OTP read descriptor */ 218*53ee8cc1Swenshuai.xi #define NSK2HDI_OTP_NVCOUNTER_DESC_TAG 0x25U 219*53ee8cc1Swenshuai.xi /** @} 220*53ee8cc1Swenshuai.xi * End of NSK2HDI_OTP_DESCRIPTOR_TAGS group belonging 221*53ee8cc1Swenshuai.xi */ 222*53ee8cc1Swenshuai.xi /** @} 223*53ee8cc1Swenshuai.xi * End of NSK2HDI_OTP_COMMON group belonging 224*53ee8cc1Swenshuai.xi */ 225*53ee8cc1Swenshuai.xi 226*53ee8cc1Swenshuai.xi /*===========================================================================*/ 227*53ee8cc1Swenshuai.xi /** @brief Creates an instance of the OTP device and returns its handle to the caller. 228*53ee8cc1Swenshuai.xi 229*53ee8cc1Swenshuai.xi @param[in] Otp_ID - the ID of the OTP device to open as returned by #NSK2HDI_CaSoCGroupDevice_EnumerateChildren function. 230*53ee8cc1Swenshuai.xi @param[out] Otp_handle - pointer to the device instance handle to be returned to a caller. 231*53ee8cc1Swenshuai.xi 232*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if device instance is created successfully or 233*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 234*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if request failed. 235*53ee8cc1Swenshuai.xi */ 236*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_OtpDevice_Open (NSK2HDI_DEVICE_ID Otp_ID, 237*53ee8cc1Swenshuai.xi NSK2HDI_HANDLE *Otp_handle); 238*53ee8cc1Swenshuai.xi 239*53ee8cc1Swenshuai.xi 240*53ee8cc1Swenshuai.xi /*===========================================================================*/ 241*53ee8cc1Swenshuai.xi /** @brief Destroys the specified instance of the OTP device. 242*53ee8cc1Swenshuai.xi Releases all the resources used by this device instance. 243*53ee8cc1Swenshuai.xi 244*53ee8cc1Swenshuai.xi @param[in] Otp_handle - handle of the device instance to be destroyed. 245*53ee8cc1Swenshuai.xi 246*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the device instance was destroyed or 247*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if an invalid device handle was passed. 248*53ee8cc1Swenshuai.xi */ 249*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_OtpDevice_Close (NSK2HDI_HANDLE Otp_handle); 250*53ee8cc1Swenshuai.xi 251*53ee8cc1Swenshuai.xi 252*53ee8cc1Swenshuai.xi /*===========================================================================*/ 253*53ee8cc1Swenshuai.xi /** @brief Retrieves the Properties of the OTP device. 254*53ee8cc1Swenshuai.xi If desc_size is zero, the function is used to retrieve the size of the buffer to be allocated for the properties, only and the desc parameter is ignored. 255*53ee8cc1Swenshuai.xi 256*53ee8cc1Swenshuai.xi @param[in] Otp_handle - a handle to the opened OTP device. 257*53ee8cc1Swenshuai.xi @param[in] request_id - the ID of the properties retrieval request.See \ref NSK2HDI_OTP_GET_PROPERTIES_REQUEST for possible values. 258*53ee8cc1Swenshuai.xi @param[in, out] desc_size - size of the buffer allocated by the caller for the device properties. 259*53ee8cc1Swenshuai.xi @param[out] desc - pointer to the buffer receiving the descriptors with device properties. See \ref NSK2HDI_OTP_DESCRIPTOR_TAGS 260*53ee8cc1Swenshuai.xi 261*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 262*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 263*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 264*53ee8cc1Swenshuai.xi */ 265*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_OtpDevice_GetProperties( NSK2HDI_HANDLE Otp_handle, 266*53ee8cc1Swenshuai.xi NDS_ULONG request_id, 267*53ee8cc1Swenshuai.xi NDS_ULONG *desc_size, 268*53ee8cc1Swenshuai.xi NDS_UBYTE *desc); 269*53ee8cc1Swenshuai.xi 270*53ee8cc1Swenshuai.xi /** @} 271*53ee8cc1Swenshuai.xi * End of NSK2HDI_OTP group belonging 272*53ee8cc1Swenshuai.xi */ 273*53ee8cc1Swenshuai.xi 274*53ee8cc1Swenshuai.xi /** 275*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_NSK NSK Device 276*53ee8cc1Swenshuai.xi ** @{ 277*53ee8cc1Swenshuai.xi */ 278*53ee8cc1Swenshuai.xi 279*53ee8cc1Swenshuai.xi /** 280*53ee8cc1Swenshuai.xi * @addtogroup NSK2HDI_NSK_COMMON NSK Definitions 281*53ee8cc1Swenshuai.xi * @{ 282*53ee8cc1Swenshuai.xi */ 283*53ee8cc1Swenshuai.xi 284*53ee8cc1Swenshuai.xi /** @brief NSK2 HDI drivers event callback function 285*53ee8cc1Swenshuai.xi */ 286*53ee8cc1Swenshuai.xi typedef void HDINSK2_NSKEVENT_CB_FN (NSK2HDI_HANDLE Nsk_handle, 287*53ee8cc1Swenshuai.xi void *cookie, 288*53ee8cc1Swenshuai.xi NDS_ULONG reason, 289*53ee8cc1Swenshuai.xi NDS_ULONG acpuError); 290*53ee8cc1Swenshuai.xi 291*53ee8cc1Swenshuai.xi /** 292*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_INITIALIZATION_STAGE NSK Device initialization stage 293*53ee8cc1Swenshuai.xi ** @{ 294*53ee8cc1Swenshuai.xi */ 295*53ee8cc1Swenshuai.xi #define NSK2HDI_INITIALIZATION_STAGE_ONE 0x01U /*!< @brief NDS serialization info*/ 296*53ee8cc1Swenshuai.xi 297*53ee8cc1Swenshuai.xi /** @} 298*53ee8cc1Swenshuai.xi * End of NSK2HDI_INITIALIZATION_STAGE group belonging 299*53ee8cc1Swenshuai.xi */ 300*53ee8cc1Swenshuai.xi /** @} 301*53ee8cc1Swenshuai.xi * End of NSK2HDI_NSK_COMMON group belonging 302*53ee8cc1Swenshuai.xi */ 303*53ee8cc1Swenshuai.xi 304*53ee8cc1Swenshuai.xi /*===========================================================================*/ 305*53ee8cc1Swenshuai.xi /** @brief Creates an instance of the NSK device and returns its handle to the caller. 306*53ee8cc1Swenshuai.xi 307*53ee8cc1Swenshuai.xi @param[in] Nsk_ID - the ID of the NSK device to open as returned by #NSK2HDI_CaSoCGroupDevice_EnumerateChildren function. 308*53ee8cc1Swenshuai.xi @param[out] Nsk_handle - pointer to the device instance handle to be returned to a caller. 309*53ee8cc1Swenshuai.xi 310*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if device instance is created successfully or 311*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 312*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if request failed. 313*53ee8cc1Swenshuai.xi */ 314*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_NskDevice_Open (NSK2HDI_DEVICE_ID Nsk_ID, 315*53ee8cc1Swenshuai.xi NSK2HDI_HANDLE *Nsk_handle); 316*53ee8cc1Swenshuai.xi 317*53ee8cc1Swenshuai.xi /*===========================================================================*/ 318*53ee8cc1Swenshuai.xi /** @brief Destroys the specified instance of the NSK device. 319*53ee8cc1Swenshuai.xi Releases all the resources used by this device instance. 320*53ee8cc1Swenshuai.xi 321*53ee8cc1Swenshuai.xi @param[in] Nsk_handle- handle of the device instance to be destroyed. 322*53ee8cc1Swenshuai.xi 323*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 324*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 325*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 326*53ee8cc1Swenshuai.xi */ 327*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_NskDevice_Close (NSK2HDI_HANDLE Nsk_handle); 328*53ee8cc1Swenshuai.xi 329*53ee8cc1Swenshuai.xi 330*53ee8cc1Swenshuai.xi /*===========================================================================*/ 331*53ee8cc1Swenshuai.xi /** @brief Reads data from registers. 332*53ee8cc1Swenshuai.xi 333*53ee8cc1Swenshuai.xi @param[in] Nsk_handle - a handle to the opened NSK device. 334*53ee8cc1Swenshuai.xi @param[in] register_offset - the offset within the device memory map at which to start the read. 335*53ee8cc1Swenshuai.xi @param[in] data_size - number of bytes to read, must be a positive multiple of 4. 336*53ee8cc1Swenshuai.xi @param[out] data - pointer to the buffer receiving the read data. 337*53ee8cc1Swenshuai.xi 338*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 339*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 340*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 341*53ee8cc1Swenshuai.xi */ 342*53ee8cc1Swenshuai.xi 343*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_NskDevice_Read8 (NSK2HDI_HANDLE Nsk_handle, 344*53ee8cc1Swenshuai.xi NDS_ULONG register_offset, 345*53ee8cc1Swenshuai.xi NDS_ULONG data_size, 346*53ee8cc1Swenshuai.xi NDS_UBYTE *data); 347*53ee8cc1Swenshuai.xi 348*53ee8cc1Swenshuai.xi 349*53ee8cc1Swenshuai.xi /*===========================================================================*/ 350*53ee8cc1Swenshuai.xi /** @brief Writes data to the registers 351*53ee8cc1Swenshuai.xi 352*53ee8cc1Swenshuai.xi @param[in] Nsk_handle - a handle to the opened NSK device. 353*53ee8cc1Swenshuai.xi @param[in] register_offset - the offset within the device memory map at which to start the read. 354*53ee8cc1Swenshuai.xi @param[in] data_size - number of bytes to write, must be a positive multiple of 4. 355*53ee8cc1Swenshuai.xi @param[out] data - pointer to the buffer containing the data to be written. 356*53ee8cc1Swenshuai.xi 357*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 358*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 359*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 360*53ee8cc1Swenshuai.xi */ 361*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_NskDevice_Write8 (NSK2HDI_HANDLE Nsk_handle, 362*53ee8cc1Swenshuai.xi NDS_ULONG register_offset, 363*53ee8cc1Swenshuai.xi NDS_ULONG data_size, 364*53ee8cc1Swenshuai.xi const NDS_UBYTE *data); 365*53ee8cc1Swenshuai.xi 366*53ee8cc1Swenshuai.xi 367*53ee8cc1Swenshuai.xi 368*53ee8cc1Swenshuai.xi /*===========================================================================*/ 369*53ee8cc1Swenshuai.xi /** @brief Reads data from registers 370*53ee8cc1Swenshuai.xi 371*53ee8cc1Swenshuai.xi @param[in] Nsk_handle - a handle to the opened NSK device. 372*53ee8cc1Swenshuai.xi @param[in] register_offset - the offset within the device memory map at which to start the read, must be a multiple of 4. 373*53ee8cc1Swenshuai.xi @param[in] data_size - number of 32-bits words to read. 374*53ee8cc1Swenshuai.xi @param[out] data - pointer to the buffer receiving the read data. 375*53ee8cc1Swenshuai.xi 376*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 377*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 378*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 379*53ee8cc1Swenshuai.xi */ 380*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_NskDevice_Read32 (NSK2HDI_HANDLE Nsk_handle, 381*53ee8cc1Swenshuai.xi NDS_ULONG register_offset, 382*53ee8cc1Swenshuai.xi NDS_ULONG data_size, 383*53ee8cc1Swenshuai.xi NDS_ULONG *data); 384*53ee8cc1Swenshuai.xi 385*53ee8cc1Swenshuai.xi /*===========================================================================*/ 386*53ee8cc1Swenshuai.xi /** @brief Writes data to the registers 387*53ee8cc1Swenshuai.xi 388*53ee8cc1Swenshuai.xi @param[in] Nsk_handle - a handle to the opened NSK device. 389*53ee8cc1Swenshuai.xi @param[in] register_offset - the offset within the device memory map at which to start writing,must be a multiple of 4. 390*53ee8cc1Swenshuai.xi @param[in] data_size - number of bytes to write. 391*53ee8cc1Swenshuai.xi @param[out] data - pointer to the buffer containing the data to be written. 392*53ee8cc1Swenshuai.xi 393*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 394*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 395*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 396*53ee8cc1Swenshuai.xi */ 397*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_NskDevice_Write32 (NSK2HDI_HANDLE Nsk_handle, 398*53ee8cc1Swenshuai.xi NDS_ULONG register_offset, 399*53ee8cc1Swenshuai.xi NDS_ULONG data_size, 400*53ee8cc1Swenshuai.xi const NDS_ULONG *data); 401*53ee8cc1Swenshuai.xi 402*53ee8cc1Swenshuai.xi 403*53ee8cc1Swenshuai.xi /*===========================================================================*/ 404*53ee8cc1Swenshuai.xi /** @brief Executes a single command in the NSK. 405*53ee8cc1Swenshuai.xi 406*53ee8cc1Swenshuai.xi @param[in] Nsk_handle - a handle to the opened NSK device. 407*53ee8cc1Swenshuai.xi @param[in] command - data to be loaded into the NSK command register. 408*53ee8cc1Swenshuai.xi @param[in] control - data to be loaded into the NSK control register. 409*53ee8cc1Swenshuai.xi @param[in] register_offset - the offset within the device memory map at which to start data loading,must be a multiple of 4. 410*53ee8cc1Swenshuai.xi @param[in] data_size - size of the data to be loaded into the NSK registers. Must be a multiply of 4. 411*53ee8cc1Swenshuai.xi @param[in] data - buffer containing the data to be loaded into the NSK registers. 412*53ee8cc1Swenshuai.xi 413*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 414*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 415*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 416*53ee8cc1Swenshuai.xi */ 417*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_NskDevice_ExecuteCmd (NSK2HDI_HANDLE Nsk_handle, 418*53ee8cc1Swenshuai.xi NDS_ULONG command, 419*53ee8cc1Swenshuai.xi NDS_ULONG control, 420*53ee8cc1Swenshuai.xi NDS_ULONG register_offset, 421*53ee8cc1Swenshuai.xi NDS_ULONG data_size, 422*53ee8cc1Swenshuai.xi const NDS_UBYTE *data); 423*53ee8cc1Swenshuai.xi 424*53ee8cc1Swenshuai.xi 425*53ee8cc1Swenshuai.xi /*===========================================================================*/ 426*53ee8cc1Swenshuai.xi /** @brief Registers the callback function for NSK events. 427*53ee8cc1Swenshuai.xi This method can be called once during the device instance life cycle. 428*53ee8cc1Swenshuai.xi 429*53ee8cc1Swenshuai.xi @param[in] Nsk_handle - a handle to the opened NSK device. 430*53ee8cc1Swenshuai.xi @param[in] cb_routine - pointer to the #HDINSK2_NSKEVENT_CB_FN function. 431*53ee8cc1Swenshuai.xi @param[in] cookie - a pointer that will be returned to the caller when the cb_routine is called. 432*53ee8cc1Swenshuai.xi 433*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 434*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 435*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 436*53ee8cc1Swenshuai.xi */ 437*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_NskDevice_RegisterEventCB (NSK2HDI_HANDLE Nsk_handle, 438*53ee8cc1Swenshuai.xi HDINSK2_NSKEVENT_CB_FN *cb_routine, 439*53ee8cc1Swenshuai.xi void *cookie); 440*53ee8cc1Swenshuai.xi 441*53ee8cc1Swenshuai.xi 442*53ee8cc1Swenshuai.xi /*===========================================================================*/ 443*53ee8cc1Swenshuai.xi /** @brief Sends an acknowledgment signal to the NSK that the NSK chip has finished using the KTE contents. 444*53ee8cc1Swenshuai.xi 445*53ee8cc1Swenshuai.xi @param[in] Nsk_handle - a handle to the opened NSK device. 446*53ee8cc1Swenshuai.xi 447*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 448*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 449*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 450*53ee8cc1Swenshuai.xi */ 451*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_NskDevice_AcknowledgeKte(NSK2HDI_HANDLE Nsk_handle); 452*53ee8cc1Swenshuai.xi 453*53ee8cc1Swenshuai.xi /*===========================================================================*/ 454*53ee8cc1Swenshuai.xi /** @brief Called to indicate that NSK basic initialization is complete. 455*53ee8cc1Swenshuai.xi 456*53ee8cc1Swenshuai.xi @param[in] Nsk_handle - a handle to the opened NSK device. 457*53ee8cc1Swenshuai.xi @param[in] stage - initialization stage. See \ref NSK2HDI_INITIALIZATION_STAGE for possible values. 458*53ee8cc1Swenshuai.xi 459*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 460*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 461*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 462*53ee8cc1Swenshuai.xi */ 463*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_NskDevice_BasicInitializationComplete(NSK2HDI_HANDLE Nsk_handle, NDS_ULONG stage); 464*53ee8cc1Swenshuai.xi 465*53ee8cc1Swenshuai.xi /*===========================================================================*/ 466*53ee8cc1Swenshuai.xi /** @brief Called to indicate that NSK Update NV Counter. 467*53ee8cc1Swenshuai.xi 468*53ee8cc1Swenshuai.xi @param[in] Nsk_handle - a handle to the opened NSK device. 469*53ee8cc1Swenshuai.xi 470*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 471*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 472*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 473*53ee8cc1Swenshuai.xi */ 474*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_NskDevice_UpdateNvCounter(NSK2HDI_HANDLE Nsk_handle); 475*53ee8cc1Swenshuai.xi 476*53ee8cc1Swenshuai.xi /*===========================================================================*/ 477*53ee8cc1Swenshuai.xi /** @brief Called to indicate that NSK Write OTP Key. 478*53ee8cc1Swenshuai.xi 479*53ee8cc1Swenshuai.xi @param[in] Nsk_handle - a handle to the opened NSK device. 480*53ee8cc1Swenshuai.xi @param[in] desc_size - Size in bytes of the desc buffer. 481*53ee8cc1Swenshuai.xi @param[in] desc - Additional configuration information for WriteOtpKey provided in a series of descriptors. 482*53ee8cc1Swenshuai.xi 483*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 484*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 485*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 486*53ee8cc1Swenshuai.xi */ 487*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_NskDevice_WriteOtpKey(NSK2HDI_HANDLE Nsk_handle, NDS_ULONG desc_size, const NDS_UBYTE *desc); 488*53ee8cc1Swenshuai.xi 489*53ee8cc1Swenshuai.xi /*===========================================================================*/ 490*53ee8cc1Swenshuai.xi /** @brief Called to indicate that NSK Set One Shot GenInBits. 491*53ee8cc1Swenshuai.xi 492*53ee8cc1Swenshuai.xi @param[in] Nsk_handle - a handle to the opened NSK device. 493*53ee8cc1Swenshuai.xi @param[in] bits - Bit mask of bits to set. 494*53ee8cc1Swenshuai.xi 495*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 496*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 497*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 498*53ee8cc1Swenshuai.xi */ 499*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_NskDevice_SetOneShotGenInBits(NSK2HDI_HANDLE Nsk_handle, NDS_ULONG bits); 500*53ee8cc1Swenshuai.xi 501*53ee8cc1Swenshuai.xi /** @} 502*53ee8cc1Swenshuai.xi * End of NSK2HDI_NSK group belonging 503*53ee8cc1Swenshuai.xi */ 504*53ee8cc1Swenshuai.xi 505*53ee8cc1Swenshuai.xi 506*53ee8cc1Swenshuai.xi 507*53ee8cc1Swenshuai.xi /** 508*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_CM Content Module Devices 509*53ee8cc1Swenshuai.xi ** @{ 510*53ee8cc1Swenshuai.xi */ 511*53ee8cc1Swenshuai.xi /** 512*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_CMCHANNELTABLE CmChannel Table Device 513*53ee8cc1Swenshuai.xi ** @{ 514*53ee8cc1Swenshuai.xi */ 515*53ee8cc1Swenshuai.xi 516*53ee8cc1Swenshuai.xi /*===========================================================================*/ 517*53ee8cc1Swenshuai.xi /** @brief Creates an instance of the CmChannel Table device and returns its handle to the caller. 518*53ee8cc1Swenshuai.xi 519*53ee8cc1Swenshuai.xi @param[in] CmChannelTable_ID - the ID of theCmChannel Table device to open as returned by #NSK2HDI_CaSoCGroupDevice_EnumerateChildren function. 520*53ee8cc1Swenshuai.xi @param[out] CmChannelTable_handle - pointer to the device instance handle to be returned to a caller. 521*53ee8cc1Swenshuai.xi 522*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if device instance is created successfully or 523*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 524*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if request failed. 525*53ee8cc1Swenshuai.xi */ 526*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_CmChannelTableDevice_Open ( NSK2HDI_DEVICE_ID CmChannelTable_ID, 527*53ee8cc1Swenshuai.xi NSK2HDI_HANDLE *CmChannelTable_handle); 528*53ee8cc1Swenshuai.xi 529*53ee8cc1Swenshuai.xi /*===========================================================================*/ 530*53ee8cc1Swenshuai.xi /** @brief Destroys the specified instance of the CmChannel Table device. 531*53ee8cc1Swenshuai.xi Releases all the resources used by this device instance. 532*53ee8cc1Swenshuai.xi 533*53ee8cc1Swenshuai.xi @param[in] CmChannelTable_handle - handle of the device instance to be destroyed. 534*53ee8cc1Swenshuai.xi 535*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the device instance was destroyed or 536*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if an invalid device handle was passed. 537*53ee8cc1Swenshuai.xi */ 538*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_CmChannelTableDevice_Close ( NSK2HDI_HANDLE CmChannelTable_handle); 539*53ee8cc1Swenshuai.xi 540*53ee8cc1Swenshuai.xi 541*53ee8cc1Swenshuai.xi /*===========================================================================*/ 542*53ee8cc1Swenshuai.xi /** @brief Enumerates CmChannel Table device children. Retrieves number of children and associated info for each child. 543*53ee8cc1Swenshuai.xi If child_device_num is zero, the function is used to retrieve the number of children only and the child_device parameter is ignored. 544*53ee8cc1Swenshuai.xi 545*53ee8cc1Swenshuai.xi @param[in] CmChannelTable_handle - a handle to the opened CmChannel Table device. 546*53ee8cc1Swenshuai.xi @param[in, out] child_device_num - the number of elements in the child_device array allocated by the caller as an input, the actual number of the CmChannel Table child devices as an output. 547*53ee8cc1Swenshuai.xi @param[out] child_device - array that receives the child info for the CmChannel Table child devices. 548*53ee8cc1Swenshuai.xi 549*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 550*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 551*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 552*53ee8cc1Swenshuai.xi */ 553*53ee8cc1Swenshuai.xi 554*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_CmChannelTableDevice_EnumerateChildren( NSK2HDI_HANDLE CmChannelTable_handle, 555*53ee8cc1Swenshuai.xi NDS_ULONG *child_device_num, 556*53ee8cc1Swenshuai.xi NSK2HDI_CHILD_DEVICE *child_device); 557*53ee8cc1Swenshuai.xi 558*53ee8cc1Swenshuai.xi 559*53ee8cc1Swenshuai.xi /** @} 560*53ee8cc1Swenshuai.xi * End of NSK2HDI_CMCHANNELTABLE group belonging 561*53ee8cc1Swenshuai.xi */ 562*53ee8cc1Swenshuai.xi /** 563*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_CMCHANNELGROUP CmChannel Group Device 564*53ee8cc1Swenshuai.xi ** @{ 565*53ee8cc1Swenshuai.xi */ 566*53ee8cc1Swenshuai.xi /** 567*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_CMCHANNELGROUP_DEFS CmChannel Group Definitions 568*53ee8cc1Swenshuai.xi ** @{ 569*53ee8cc1Swenshuai.xi */ 570*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNELGROUP_MAX_USER_CONTEXT_LENGTH 0x08U /*!< @brief the size of the user context field */ 571*53ee8cc1Swenshuai.xi /** 572*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_CMCHANNEL_PARITY_FLAGS CmChannel Parity Flags 573*53ee8cc1Swenshuai.xi ** @{ 574*53ee8cc1Swenshuai.xi */ 575*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_CLEAR_PARITY 0x01U /*!< @brief the key can be set for the clear parity */ 576*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_EVEN_PARITY 0x02U /*!< @brief the key can be set for the even parity */ 577*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_EVEN_CLEAR_PARITY 0x04U /*!< @brief the same key can be set for the clear and even parity */ 578*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_ODD_PARITY 0x08U /*!< @brief the key can be set for the odd parity */ 579*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_ODD_CLEAR_PARITY 0x10U /*!< @brief the same key can be set for the clear and odd parity */ 580*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_ODD_EVEN_PARITY 0x20U /*!< @brief the same key can be set for the odd and even parity */ 581*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_ODD_EVEN_CLEAR_PARITY 0x40U /*!< @brief the same key can be set for the clear, odd and even parity */ 582*53ee8cc1Swenshuai.xi /** @} 583*53ee8cc1Swenshuai.xi * End of NSK2HDI_CMCHANNEL_PARITY_FLAGS group belonging 584*53ee8cc1Swenshuai.xi */ 585*53ee8cc1Swenshuai.xi /** 586*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_CMCHANNEL_SWITCH CmChannel Switch Flags 587*53ee8cc1Swenshuai.xi ** @{ 588*53ee8cc1Swenshuai.xi */ 589*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_AL_SWITCH_THRU 0x01U /*!< @brief If not set, AL switch is by-passed */ 590*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_BL_SWITCH_THRU 0x02U /*!< @brief If not set, BL switch is by-passed */ 591*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_DL_SWITCH_THRU 0x04U /*!< @brief If not set, DL switch is by-passed */ 592*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_EL_SWITCH_THRU 0x08U /*!< @brief If not set, packet is not delivered to the lower destination */ 593*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_AU_SWITCH_THRU 0x10U /*!< @brief If not set, AU switch is by-passed */ 594*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_BU_SWITCH_THRU 0x20U /*!< @brief If not set, BU switch is by-passed */ 595*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_DU_SWITCH_THRU 0x40U /*!< @brief If not set, DU switch is by-passed */ 596*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_EU_SWITCH_THRU 0x80U /*!< @brief If not set, packet is not delivered to the upper destination */ 597*53ee8cc1Swenshuai.xi /** @} 598*53ee8cc1Swenshuai.xi * End of NSK2HDI_CMCHANNEL_SWITCH group belonging 599*53ee8cc1Swenshuai.xi */ 600*53ee8cc1Swenshuai.xi 601*53ee8cc1Swenshuai.xi 602*53ee8cc1Swenshuai.xi /** @addtogroup NSK2HDI_CMCHANNEL_ALGORITHM_TYPE CmChannel Algorithm Types 603*53ee8cc1Swenshuai.xi ** @{ 604*53ee8cc1Swenshuai.xi */ 605*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_LSA_ALGORITHM_TYPE 0x01U /*!< @brief LSA algrorithm */ 606*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_ESA_ALGORITHM_TYPE 0x02U /*!< @brief ESA algrorithm */ 607*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_LDA_ALGORITHM_TYPE 0x03U /*!< @brief LDA algrorithm */ 608*53ee8cc1Swenshuai.xi /** @} 609*53ee8cc1Swenshuai.xi * End of NSK2HDI_CMCHANNEL_ALGORITHM_TYPE group belonging 610*53ee8cc1Swenshuai.xi */ 611*53ee8cc1Swenshuai.xi 612*53ee8cc1Swenshuai.xi /** 613*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_CMCHANNEL_CAPABILITY_FLAGS CmChannel Capability Flags 614*53ee8cc1Swenshuai.xi ** @{ 615*53ee8cc1Swenshuai.xi */ 616*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_IV1_CONFIGURE_CAPABILITY_FLAG 0x01U /*!< @brief if set, CmChannel may be configured with the explicit IV1 via NSK2HDI_CmChannelDevice_Configure*/ 617*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_IV2_CONFIGURE_CAPABILITY_FLAG 0x02U /*!< @brief if set, CmChannel may be configured with the explicit IV2 via NSK2HDI_CmChannelDevice_Configure*/ 618*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_IV_WRITEKEY_CAPABILITY_FLAG 0x04U /*!< @brief if set, explicit IV and/or IV2 may be loaded into CmChannel via NSK2HDI_CmChannelDevice_WriteTransportKey.*/ 619*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_NON_NSK_CAPABILITY_FLAG 0x08U /*!< @brief if set, may use CmChannel with keys and switches from non-NSK source. Not used in HDI, reserved for use in CDI. */ 620*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_NSK_CAPABILITY_FLAG 0x10U /*!< @brief if set, may use CmChannel with NSK (via NSK2HDI_CmChannel_WriteTransportKey) .if not set, may use CmChannel with keys and switches from non-NSK source. Not used in HDI, reserved for use in CDI. */ 621*53ee8cc1Swenshuai.xi /** @} 622*53ee8cc1Swenshuai.xi * End of NSK2HDI_CMCHANNEL_CAPABILITY_FLAGS group belonging 623*53ee8cc1Swenshuai.xi */ 624*53ee8cc1Swenshuai.xi 625*53ee8cc1Swenshuai.xi 626*53ee8cc1Swenshuai.xi /** 627*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_CMCHANNELGROUP_REQUEST_IDS CmChannel Group Request IDs 628*53ee8cc1Swenshuai.xi ** @{ 629*53ee8cc1Swenshuai.xi */ 630*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNELGROUP_READ_ALL_DESCRIPTORS_REQUEST 0x00U /*!< @brief ID of the request used for retrieving all CmChannelGroup properties */ 631*53ee8cc1Swenshuai.xi /** @} 632*53ee8cc1Swenshuai.xi * End of NSK2HDI_CMCHANNELGROUP_REQUEST_IDS group belonging 633*53ee8cc1Swenshuai.xi */ 634*53ee8cc1Swenshuai.xi 635*53ee8cc1Swenshuai.xi /** 636*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_CMCHANNELGROUP_DESC CmChannel Group Descriptor Tags 637*53ee8cc1Swenshuai.xi ** @{ 638*53ee8cc1Swenshuai.xi */ 639*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNELGROUP_CAPABILITY_DESC_TAG 0x01U /*!< @brief Tag of the descriptor carrying the capability flags. */ 640*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNELGROUP_ALGORITHM_RECORD_DESC_TAG 0x02U /*!< @brief Tag of the descriptor carrying the CmChannel LDA record information. There is one record per each pair of node and algorithm supported by CmChannel*/ 641*53ee8cc1Swenshuai.xi /** @} 642*53ee8cc1Swenshuai.xi * End of NSK2HDI_CMCHANNELGROUP_DESC group belonging 643*53ee8cc1Swenshuai.xi */ 644*53ee8cc1Swenshuai.xi 645*53ee8cc1Swenshuai.xi /** @} 646*53ee8cc1Swenshuai.xi * End of NSK2HDI_CMCHANNELGROUP_DEFS group belonging 647*53ee8cc1Swenshuai.xi */ 648*53ee8cc1Swenshuai.xi 649*53ee8cc1Swenshuai.xi /*===========================================================================*/ 650*53ee8cc1Swenshuai.xi /** @brief Creates an instance of the CmChannel Group device and returns its handle to the caller. 651*53ee8cc1Swenshuai.xi 652*53ee8cc1Swenshuai.xi @param[in] CmChannelGroup_ID - the ID of the CmChannel Group device to open as returned by #NSK2HDI_CmChannelTableDevice_EnumerateChildren function. 653*53ee8cc1Swenshuai.xi @param[out] CmChannelGroup_handle - pointer to the device instance handle to be returned to a caller. 654*53ee8cc1Swenshuai.xi 655*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if device instance is created successfully or 656*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 657*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if request failed. 658*53ee8cc1Swenshuai.xi */ 659*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_CmChannelGroupDevice_Open ( NSK2HDI_DEVICE_ID CmChannelGroup_ID, 660*53ee8cc1Swenshuai.xi NSK2HDI_HANDLE *CmChannelGroup_handle); 661*53ee8cc1Swenshuai.xi 662*53ee8cc1Swenshuai.xi /*===========================================================================*/ 663*53ee8cc1Swenshuai.xi /** @brief Destroys the specified instance of the CmChannel Group device. 664*53ee8cc1Swenshuai.xi Releases all the resources used by this device instance. 665*53ee8cc1Swenshuai.xi 666*53ee8cc1Swenshuai.xi @param[in] CmChannelGroup_handle - handle of the device instance to be destroyed. 667*53ee8cc1Swenshuai.xi 668*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the device instance was destroyed or 669*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if an invalid device handle was passed. 670*53ee8cc1Swenshuai.xi */ 671*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_CmChannelGroupDevice_Close ( NSK2HDI_HANDLE CmChannelGroup_handle); 672*53ee8cc1Swenshuai.xi 673*53ee8cc1Swenshuai.xi 674*53ee8cc1Swenshuai.xi /*===========================================================================*/ 675*53ee8cc1Swenshuai.xi /** @brief Retrieves the Properties of the CmChannel Group device. 676*53ee8cc1Swenshuai.xi If desc_size is zero, the function is used to retrieve the size of the buffer to be allocated for the properties, only and the desc parameter is ignored. 677*53ee8cc1Swenshuai.xi 678*53ee8cc1Swenshuai.xi @param[in] CmChannelGroup_handle - a handle to the opened CmChannel Group device. 679*53ee8cc1Swenshuai.xi @param[in] request_id - the ID of the properties retrieval request.See \ref NSK2HDI_CMCHANNELGROUP_REQUEST_IDS for possible values. 680*53ee8cc1Swenshuai.xi @param[in, out] desc_size - size of the buffer allocated by the caller for the device properties as an input, actual size of the device properties returned by the device as an output. 681*53ee8cc1Swenshuai.xi @param[out] desc - pointer to the buffer receiving the device properties. 682*53ee8cc1Swenshuai.xi 683*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 684*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 685*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 686*53ee8cc1Swenshuai.xi */ 687*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_CmChannelGroupDevice_GetProperties( NSK2HDI_HANDLE CmChannelGroup_handle, 688*53ee8cc1Swenshuai.xi NDS_ULONG request_id, 689*53ee8cc1Swenshuai.xi NDS_ULONG *desc_size, 690*53ee8cc1Swenshuai.xi NDS_UBYTE *desc); 691*53ee8cc1Swenshuai.xi 692*53ee8cc1Swenshuai.xi /** @} 693*53ee8cc1Swenshuai.xi * End of NSK2HDI_CMCHANNELGROUP group belonging 694*53ee8cc1Swenshuai.xi */ 695*53ee8cc1Swenshuai.xi 696*53ee8cc1Swenshuai.xi /** 697*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_CMCHANNEL CmChannel Device 698*53ee8cc1Swenshuai.xi ** @{ 699*53ee8cc1Swenshuai.xi */ 700*53ee8cc1Swenshuai.xi /** 701*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_CMCHANNEL_DEF Definitions 702*53ee8cc1Swenshuai.xi ** @{ 703*53ee8cc1Swenshuai.xi */ 704*53ee8cc1Swenshuai.xi 705*53ee8cc1Swenshuai.xi /** 706*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_CMCHANNEL_DESC CmChannel Descriptor Tags 707*53ee8cc1Swenshuai.xi ** @{ 708*53ee8cc1Swenshuai.xi */ 709*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_IV1_DESC_TAG 0x01U /*!< @brief IV1 for local scrambling/descrambling. */ 710*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_IV2_DESC_TAG 0x02U /*!< @brief IV2 for local scrambling/descrambling.*/ 711*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_ALGORITHM_DESC_TAG 0x03U /*!< @brief algorithm for scrambling/descrambling.*/ 712*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_IV_SIGNALING_DESC_TAG 0x04U /*!< @brief IV signaling mode.*/ 713*53ee8cc1Swenshuai.xi /** @} 714*53ee8cc1Swenshuai.xi * End of NSK2HDI_CMCHANNEL_DESC group belonging 715*53ee8cc1Swenshuai.xi */ 716*53ee8cc1Swenshuai.xi /** 717*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_CMCHANNEL_IV_SIGNALING_MODES CmChannel IV Signaling Modes 718*53ee8cc1Swenshuai.xi ** @{ 719*53ee8cc1Swenshuai.xi */ 720*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_IV_NOT_SET_MODE 0x01U /*!< @brief IV1/IV2 not configured. */ 721*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_IV_AT_CONFIG_MODE 0x02U /*!< @brief IV1/2 are defined via Configure call.*/ 722*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNEL_IV_AT_WRITEKEY_MODE 0x03U /*!< @brief IV1/2 are defined via WriteTransportKey call.*/ 723*53ee8cc1Swenshuai.xi /** @} 724*53ee8cc1Swenshuai.xi * End of NSK2HDI_CMCHANNEL_IV_SIGNALING_MODES group belonging 725*53ee8cc1Swenshuai.xi */ 726*53ee8cc1Swenshuai.xi 727*53ee8cc1Swenshuai.xi /** @} 728*53ee8cc1Swenshuai.xi * End of NSK2HDI_CMCHANNEL_DEF group belonging 729*53ee8cc1Swenshuai.xi */ 730*53ee8cc1Swenshuai.xi 731*53ee8cc1Swenshuai.xi /*===========================================================================*/ 732*53ee8cc1Swenshuai.xi /** @brief Creates an instance of the CmChannel device and returns its handle to the caller. 733*53ee8cc1Swenshuai.xi 734*53ee8cc1Swenshuai.xi @param[in] CmChannelGroup_ID - the ID of the CmChannelGroup device where the requested channel belongs to 735*53ee8cc1Swenshuai.xi @param[out] CmChannel_handle - pointer to the device instance handle to be returned to a caller. 736*53ee8cc1Swenshuai.xi 737*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if device instance is created successfully or 738*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 739*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if request failed. 740*53ee8cc1Swenshuai.xi */ 741*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_CmChannelDevice_Open ( NSK2HDI_DEVICE_ID CmChannelGroup_ID, 742*53ee8cc1Swenshuai.xi NSK2HDI_HANDLE *CmChannel_handle); 743*53ee8cc1Swenshuai.xi 744*53ee8cc1Swenshuai.xi 745*53ee8cc1Swenshuai.xi /*===========================================================================*/ 746*53ee8cc1Swenshuai.xi /** @brief Destroys the specified instance of the CmChannel device. 747*53ee8cc1Swenshuai.xi Releases all the resources used by this device instance. 748*53ee8cc1Swenshuai.xi 749*53ee8cc1Swenshuai.xi @param[in] CmChannel_handle - handle of the device instance to be destroyed. 750*53ee8cc1Swenshuai.xi 751*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the device instance was destroyed or 752*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if an invalid device handle was passed. 753*53ee8cc1Swenshuai.xi */ 754*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_CmChannelDevice_Close( NSK2HDI_HANDLE CmChannel_handle); 755*53ee8cc1Swenshuai.xi 756*53ee8cc1Swenshuai.xi 757*53ee8cc1Swenshuai.xi /*===========================================================================*/ 758*53ee8cc1Swenshuai.xi /** @brief Configures the CmChannel device. 759*53ee8cc1Swenshuai.xi 760*53ee8cc1Swenshuai.xi @param[in] CmChannel_handle - a handle to the opened CmChannel device. 761*53ee8cc1Swenshuai.xi @param[in] lda_desc_size - size of the lda descriptors buffer. 762*53ee8cc1Swenshuai.xi @param[in] lda_desc - buffer containing the descriptors configuring the local descrambler. See \ref NSK2HDI_CMCHANNEL_DESC for possible descriptors 763*53ee8cc1Swenshuai.xi @param[in] esa_desc_size - size of the esa descriptors buffer. 764*53ee8cc1Swenshuai.xi @param[in] esa_desc - buffer containing the descriptors configuring the esa descrambler. See \ref NSK2HDI_CMCHANNEL_DESC for possible descriptors 765*53ee8cc1Swenshuai.xi @param[in] lsa_desc_size - size of the lsa descriptors buffer. 766*53ee8cc1Swenshuai.xi @param[in] lsa_desc - buffer containing the descriptors configuring the local scrambler descriptors. See \ref NSK2HDI_CMCHANNEL_DESC for possible descriptors 767*53ee8cc1Swenshuai.xi 768*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 769*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 770*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 771*53ee8cc1Swenshuai.xi */ 772*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_CmChannelDevice_Configure(NSK2HDI_HANDLE CmChannel_handle, 773*53ee8cc1Swenshuai.xi NDS_ULONG lda_desc_size, 774*53ee8cc1Swenshuai.xi const NDS_UBYTE *lda_desc, 775*53ee8cc1Swenshuai.xi NDS_ULONG esa_desc_size, 776*53ee8cc1Swenshuai.xi const NDS_UBYTE *esa_desc, 777*53ee8cc1Swenshuai.xi NDS_ULONG lsa_desc_size, 778*53ee8cc1Swenshuai.xi const NDS_UBYTE *lsa_desc); 779*53ee8cc1Swenshuai.xi 780*53ee8cc1Swenshuai.xi /*===========================================================================*/ 781*53ee8cc1Swenshuai.xi /** @brief Request the NSK device to copy the keys and the control switches from the NSK KTE to the NSK chip key table. 782*53ee8cc1Swenshuai.xi 783*53ee8cc1Swenshuai.xi @param[in] CmChannel_handle - a handle to the opened CmChannel device. 784*53ee8cc1Swenshuai.xi @param[in] scb_in_out_size - the number of the entries in the scb_in and scb_out arrays. Each pair of the entries (scb_in[i], scb_out[i]) specifies the parity conversion between the incoming and outgoing packets. 785*53ee8cc1Swenshuai.xi @param[in] scb_in - array where each NDS_UBYTE entry signals input packet parity for which the key shall be written. 786*53ee8cc1Swenshuai.xi Each entry in array can be set to #NSK2HDI_CMCHANNEL_CLEAR_PARITY, #NSK2HDI_CMCHANNEL_ODD_PARITY or NSK2HDI_CMCHANNEL_EVEN_PARITY. 787*53ee8cc1Swenshuai.xi @param[in] scb_out - array where each NDS_UBYTE entry signals the output packet parity for the corresponding input parity signaled by scb_in array. 788*53ee8cc1Swenshuai.xi Each entry in array can be set to #NSK2HDI_CMCHANNEL_CLEAR_PARITY, #NSK2HDI_CMCHANNEL_ODD_PARITY or NSK2HDI_CMCHANNEL_EVEN_PARITY. 789*53ee8cc1Swenshuai.xi @param[in] lda_desc_size - size of the lda descriptors buffer. 790*53ee8cc1Swenshuai.xi @param[in] lda_desc - buffer containing the descriptors configuring the IVs for local descrambler. See \ref NSK2HDI_CMCHANNEL_DESC for possible descriptors 791*53ee8cc1Swenshuai.xi @param[in] esa_desc_size - size of the esa descriptors buffer. 792*53ee8cc1Swenshuai.xi @param[in] esa_desc - buffer containing the descriptors configuring the IVs for the esa descrambler. See \ref NSK2HDI_CMCHANNEL_DESC for possible descriptors 793*53ee8cc1Swenshuai.xi @param[in] lsa_desc_size - size of the lsa descriptors buffer. 794*53ee8cc1Swenshuai.xi @param[in] lsa_desc - buffer containing the descriptors configuring the the IVs for local scrambler descriptors. See \ref NSK2HDI_CMCHANNEL_DESC for possible descriptors 795*53ee8cc1Swenshuai.xi 796*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 797*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 798*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 799*53ee8cc1Swenshuai.xi */ 800*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_CmChannelDevice_WriteTransportKey( 801*53ee8cc1Swenshuai.xi NSK2HDI_HANDLE CmChannel_handle, 802*53ee8cc1Swenshuai.xi NDS_ULONG scb_in_out_size, 803*53ee8cc1Swenshuai.xi NDS_UBYTE *scb_in, 804*53ee8cc1Swenshuai.xi NDS_UBYTE *scb_out, 805*53ee8cc1Swenshuai.xi NDS_ULONG lda_desc_size, 806*53ee8cc1Swenshuai.xi const NDS_UBYTE *lda_desc, 807*53ee8cc1Swenshuai.xi NDS_ULONG esa_desc_size, 808*53ee8cc1Swenshuai.xi const NDS_UBYTE *esa_desc, 809*53ee8cc1Swenshuai.xi NDS_ULONG lsa_desc_size, 810*53ee8cc1Swenshuai.xi const NDS_UBYTE *lsa_desc); 811*53ee8cc1Swenshuai.xi 812*53ee8cc1Swenshuai.xi /*===========================================================================*/ 813*53ee8cc1Swenshuai.xi /** @brief Disables scrambling and descrambling for the selected CmChannel 814*53ee8cc1Swenshuai.xi 815*53ee8cc1Swenshuai.xi @param[in] CmChannel_handle - a handle to the opened CmChannel device. 816*53ee8cc1Swenshuai.xi 817*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 818*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 819*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 820*53ee8cc1Swenshuai.xi */ 821*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_CmChannelDevice_InvalidateKeys(NSK2HDI_HANDLE CmChannel_handle); 822*53ee8cc1Swenshuai.xi 823*53ee8cc1Swenshuai.xi /*===========================================================================*/ 824*53ee8cc1Swenshuai.xi /** @brief Retrieves the cookie associated with CmChannel device. 825*53ee8cc1Swenshuai.xi 826*53ee8cc1Swenshuai.xi @param[in] CmChannel_handle - a handle to the opened CmChannel device. 827*53ee8cc1Swenshuai.xi @param[out] cookie - pointer to the variable receiving the device cookie. 828*53ee8cc1Swenshuai.xi 829*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 830*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 831*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 832*53ee8cc1Swenshuai.xi */ 833*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_CmChannelDevice_GetCookie(NSK2HDI_HANDLE CmChannel_handle, 834*53ee8cc1Swenshuai.xi void **cookie); 835*53ee8cc1Swenshuai.xi 836*53ee8cc1Swenshuai.xi /** @} 837*53ee8cc1Swenshuai.xi * End of NSK2HDI_CMCHANNEL group belonging 838*53ee8cc1Swenshuai.xi */ 839*53ee8cc1Swenshuai.xi /** 840*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_CAPIDPROXY CaPIDProxy Device 841*53ee8cc1Swenshuai.xi ** @{ 842*53ee8cc1Swenshuai.xi */ 843*53ee8cc1Swenshuai.xi 844*53ee8cc1Swenshuai.xi /** 845*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_CAPIDPROXY_FLAGS CAPIDProxy Merge Mode Flags 846*53ee8cc1Swenshuai.xi ** @{ 847*53ee8cc1Swenshuai.xi */ 848*53ee8cc1Swenshuai.xi #define NSK2HDI_CAPIDPROXY_MERGED_CONTINUITY_MODE 0U /*!< @brief continuity counter shall not be modified on the merged PID */ 849*53ee8cc1Swenshuai.xi #define NSK2HDI_CAPIDPROXY_SEPARATE_CONTINUITY_MODE 1U /*!< @brief the continuity counters shall be repaced for the merged PID such that the merged PID has valid continuity counters*/ 850*53ee8cc1Swenshuai.xi /** @} 851*53ee8cc1Swenshuai.xi * End of NSK2HDI_CAPIDPROXY_FLAGS group belonging 852*53ee8cc1Swenshuai.xi */ 853*53ee8cc1Swenshuai.xi /*===========================================================================*/ 854*53ee8cc1Swenshuai.xi /** @brief Creates an instance of the CaPIDProxy device and returns its handle to the caller. 855*53ee8cc1Swenshuai.xi 856*53ee8cc1Swenshuai.xi @param[in] xconn - the associated x_connection. 857*53ee8cc1Swenshuai.xi @param[out] CaPIDProxy_handle - pointer to the device instance handle to be returned to a caller. 858*53ee8cc1Swenshuai.xi 859*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if device instance is created successfully or 860*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 861*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if request failed. 862*53ee8cc1Swenshuai.xi */ 863*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_CaPIDProxy_Open (NDS_ULONG xconn, NSK2HDI_HANDLE *CaPIDProxy_handle); 864*53ee8cc1Swenshuai.xi 865*53ee8cc1Swenshuai.xi /*===========================================================================*/ 866*53ee8cc1Swenshuai.xi /** @brief Destroys the specified instance of the CaPIDProxy device. 867*53ee8cc1Swenshuai.xi Releases all the resources used by this device instance. 868*53ee8cc1Swenshuai.xi 869*53ee8cc1Swenshuai.xi @param[in] CaPIDProxy_handle - handle of the device instance to be destroyed. 870*53ee8cc1Swenshuai.xi 871*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the device instance was destroyed or 872*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if an invalid device handle was passed. 873*53ee8cc1Swenshuai.xi */ 874*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_CaPIDProxy_Close (NSK2HDI_HANDLE CaPIDProxy_handle); 875*53ee8cc1Swenshuai.xi 876*53ee8cc1Swenshuai.xi /*===========================================================================*/ 877*53ee8cc1Swenshuai.xi /** @brief Sets the PID of the elementary stream for the CaPIDProxy device. 878*53ee8cc1Swenshuai.xi 879*53ee8cc1Swenshuai.xi @param[in] CaPIDProxy_handle - a handle to the opened CaPIDProxy device. 880*53ee8cc1Swenshuai.xi @param[in] es_pid - primary elementary stream PID. 881*53ee8cc1Swenshuai.xi 882*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 883*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 884*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 885*53ee8cc1Swenshuai.xi */ 886*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_CaPIDProxy_SetPrimaryStreamPID( NSK2HDI_HANDLE CaPIDProxy_handle, 887*53ee8cc1Swenshuai.xi NDS_USHORT es_pid); 888*53ee8cc1Swenshuai.xi 889*53ee8cc1Swenshuai.xi /*===========================================================================*/ 890*53ee8cc1Swenshuai.xi /** @brief Sets the CmChannel associated with primary elementary stream for the CaPIDProxy device. 891*53ee8cc1Swenshuai.xi 892*53ee8cc1Swenshuai.xi @param[in] CaPIDProxy_handle - a handle to the opened CaPIDProxy device. 893*53ee8cc1Swenshuai.xi @param[in] CmChannel_cookie - a cookie associated with theCmChannel device to be used with the primary stream. 894*53ee8cc1Swenshuai.xi 895*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 896*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 897*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 898*53ee8cc1Swenshuai.xi */ 899*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_CaPIDProxy_SetPrimaryStreamCmChannel(NSK2HDI_HANDLE CaPIDProxy_handle, 900*53ee8cc1Swenshuai.xi void *CmChannel_cookie); 901*53ee8cc1Swenshuai.xi 902*53ee8cc1Swenshuai.xi /*===========================================================================*/ 903*53ee8cc1Swenshuai.xi /** @brief Removes the CmChannel associated with primary elementary stream for the CaPIDProxy device. 904*53ee8cc1Swenshuai.xi 905*53ee8cc1Swenshuai.xi @param[in] CaPIDProxy_handle - a handle to the opened CaPIDProxy device. 906*53ee8cc1Swenshuai.xi 907*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 908*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 909*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 910*53ee8cc1Swenshuai.xi */ 911*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_CaPIDProxy_RemovePrimaryStreamCmChannel(NSK2HDI_HANDLE CaPIDProxy_handle); 912*53ee8cc1Swenshuai.xi 913*53ee8cc1Swenshuai.xi /*===========================================================================*/ 914*53ee8cc1Swenshuai.xi /** @brief Configures secondary elementary stream from the CaPIDProxy device. 915*53ee8cc1Swenshuai.xi 916*53ee8cc1Swenshuai.xi @param[in] CaPIDProxy_handle - a handle to the opened CaPIDProxy device. 917*53ee8cc1Swenshuai.xi @param[in] CmChannel_cookie - a cookie associated with the CmChannel device to be used with the secondary stream. 918*53ee8cc1Swenshuai.xi @param[in] es_pid - secondary elementary stream PID. 919*53ee8cc1Swenshuai.xi @param[in] merge_mode - set of flags controlling the merged stream requirements. See \ref NSK2HDI_CAPIDPROXY_FLAGS for possible values. 920*53ee8cc1Swenshuai.xi 921*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 922*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 923*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 924*53ee8cc1Swenshuai.xi */ 925*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_CaPIDProxy_SetSecondaryStream(NSK2HDI_HANDLE CaPIDProxy_handle, 926*53ee8cc1Swenshuai.xi void *CmChannel_cookie, 927*53ee8cc1Swenshuai.xi NDS_USHORT es_pid, 928*53ee8cc1Swenshuai.xi NDS_ULONG merge_mode); 929*53ee8cc1Swenshuai.xi 930*53ee8cc1Swenshuai.xi /*===========================================================================*/ 931*53ee8cc1Swenshuai.xi /** @brief Removes secondary elementary stream from the CaPIDProxy device. 932*53ee8cc1Swenshuai.xi 933*53ee8cc1Swenshuai.xi @param[in] CaPIDProxy_handle - a handle to the opened CaPIDProxy device. 934*53ee8cc1Swenshuai.xi 935*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 936*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 937*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 938*53ee8cc1Swenshuai.xi */ 939*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_CaPIDProxy_RemoveSecondaryStream(NSK2HDI_HANDLE CaPIDProxy_handle); 940*53ee8cc1Swenshuai.xi 941*53ee8cc1Swenshuai.xi 942*53ee8cc1Swenshuai.xi /** @} 943*53ee8cc1Swenshuai.xi * End of NSK2HDI_CAPIDPROXY group belonging 944*53ee8cc1Swenshuai.xi */ 945*53ee8cc1Swenshuai.xi 946*53ee8cc1Swenshuai.xi /** @} 947*53ee8cc1Swenshuai.xi * End of NSK2HDI_CM group belonging 948*53ee8cc1Swenshuai.xi */ 949*53ee8cc1Swenshuai.xi 950*53ee8cc1Swenshuai.xi /** 951*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_M2M M2M Devices 952*53ee8cc1Swenshuai.xi ** @{ 953*53ee8cc1Swenshuai.xi */ 954*53ee8cc1Swenshuai.xi /** 955*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_M2MTABLE M2MChannel Table Device 956*53ee8cc1Swenshuai.xi ** @{ 957*53ee8cc1Swenshuai.xi */ 958*53ee8cc1Swenshuai.xi 959*53ee8cc1Swenshuai.xi /*===========================================================================*/ 960*53ee8cc1Swenshuai.xi /** @brief Creates an instance of the M2MChannel Table device and returns its handle to the caller. 961*53ee8cc1Swenshuai.xi 962*53ee8cc1Swenshuai.xi @param[in] M2MTable_ID - the ID of theM2MChannel Table device to open as returned by #NSK2HDI_CaSoCGroupDevice_EnumerateChildren function. 963*53ee8cc1Swenshuai.xi @param[out] M2MTable_handle - pointer to the device instance handle to be returned to a caller. 964*53ee8cc1Swenshuai.xi 965*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if device instance is created successfully or 966*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 967*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if request failed. 968*53ee8cc1Swenshuai.xi */ 969*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_M2MTableDevice_Open ( NSK2HDI_DEVICE_ID M2MTable_ID, 970*53ee8cc1Swenshuai.xi NSK2HDI_HANDLE *M2MTable_handle); 971*53ee8cc1Swenshuai.xi 972*53ee8cc1Swenshuai.xi /*===========================================================================*/ 973*53ee8cc1Swenshuai.xi /** @brief Destroys the specified instance of the M2MChannel Table device. 974*53ee8cc1Swenshuai.xi Releases all the resources used by this device instance. 975*53ee8cc1Swenshuai.xi 976*53ee8cc1Swenshuai.xi @param[in] M2MTable_handle - handle of the device instance to be destroyed. 977*53ee8cc1Swenshuai.xi 978*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the device instance was destroyed or 979*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if an invalid device handle was passed. 980*53ee8cc1Swenshuai.xi */ 981*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_M2MTableDevice_Close ( NSK2HDI_HANDLE M2MTable_handle); 982*53ee8cc1Swenshuai.xi 983*53ee8cc1Swenshuai.xi 984*53ee8cc1Swenshuai.xi /*===========================================================================*/ 985*53ee8cc1Swenshuai.xi /** @brief Enumerates M2MChannel Table device children. Retrieves number of children and associated info for each child. 986*53ee8cc1Swenshuai.xi If child_device_num is zero, the function is used to retrieve the number of children only and the child_device parameter is ignored. 987*53ee8cc1Swenshuai.xi 988*53ee8cc1Swenshuai.xi @param[in] M2MTable_handle - a handle to the opened M2MChannel Table device. 989*53ee8cc1Swenshuai.xi @param[in, out] child_device_num - the number of elements in the child_device array allocated by the caller as an input, the actual number of the M2MChannel Table child devices as an output. 990*53ee8cc1Swenshuai.xi @param[out] child_device - array that receives the child info for the M2MChannel Table child devices. 991*53ee8cc1Swenshuai.xi 992*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 993*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 994*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 995*53ee8cc1Swenshuai.xi */ 996*53ee8cc1Swenshuai.xi 997*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_M2MTableDevice_EnumerateChildren( NSK2HDI_HANDLE M2MTable_handle, 998*53ee8cc1Swenshuai.xi NDS_ULONG *child_device_num, 999*53ee8cc1Swenshuai.xi NSK2HDI_CHILD_DEVICE *child_device); 1000*53ee8cc1Swenshuai.xi 1001*53ee8cc1Swenshuai.xi 1002*53ee8cc1Swenshuai.xi /** @} 1003*53ee8cc1Swenshuai.xi * End of NSK2HDI_M2MTABLE group belonging 1004*53ee8cc1Swenshuai.xi */ 1005*53ee8cc1Swenshuai.xi /** 1006*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_M2MCHANNELGROUP M2MChannel Group Device 1007*53ee8cc1Swenshuai.xi ** @{ 1008*53ee8cc1Swenshuai.xi */ 1009*53ee8cc1Swenshuai.xi /** 1010*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_M2MCHANNELGROUP_DEFS Definitions 1011*53ee8cc1Swenshuai.xi ** @{ 1012*53ee8cc1Swenshuai.xi */ 1013*53ee8cc1Swenshuai.xi 1014*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MCHANNEL_USER_CONTEXT_SIZE 0x08U /*!< @brief the size of the user context field */ 1015*53ee8cc1Swenshuai.xi 1016*53ee8cc1Swenshuai.xi /** 1017*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_M2MCHANNELGROUP_REQUEST_IDS M2MChannelGroup Request IDs 1018*53ee8cc1Swenshuai.xi ** @{ 1019*53ee8cc1Swenshuai.xi */ 1020*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MCHANNELGROUP_READ_ALL_DESCRIPTORS_REQUEST 0x00U /*!< @brief ID of the request used for retrieving all M2MChannelGroup properties */ 1021*53ee8cc1Swenshuai.xi /** @} 1022*53ee8cc1Swenshuai.xi * End of NSK2HDI_M2MCHANNELGROUP_REQUEST_IDS group belonging 1023*53ee8cc1Swenshuai.xi */ 1024*53ee8cc1Swenshuai.xi 1025*53ee8cc1Swenshuai.xi /** 1026*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_M2MCHANNELGROUP_DESC M2MChannelGroup Descriptor Tags 1027*53ee8cc1Swenshuai.xi ** @{ 1028*53ee8cc1Swenshuai.xi */ 1029*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MCHANNELGROUP_CAPABILITY_DESC_TAG 0x01U /*!< @brief Tag of the descriptor carrying the capability flags. */ 1030*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MCHANNELGROUP_ALGORITHM_RECORD_DESC_TAG 0x02U /*!< @brief Tag of the descriptor carrying the M2MChannel algorithm capabilities information.*/ 1031*53ee8cc1Swenshuai.xi /** @} 1032*53ee8cc1Swenshuai.xi * End of NSK2HDI_M2MCHANNELGROUP_DESC group belonging 1033*53ee8cc1Swenshuai.xi */ 1034*53ee8cc1Swenshuai.xi 1035*53ee8cc1Swenshuai.xi /** 1036*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_M2MCHANNELGROUP_CAPS M2MChannelGroup Capability Flags 1037*53ee8cc1Swenshuai.xi ** @{ 1038*53ee8cc1Swenshuai.xi */ 1039*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MCHANNELGROUP_NSK_CAPABILITY_FLAG 0x01000000U /*!< @brief Channels within the group may be used only for NSK related opeartions. */ 1040*53ee8cc1Swenshuai.xi //Jeff temp change 1041*53ee8cc1Swenshuai.xi //#define NSK2HDI_M2MCHANNELGROUP_NSK_CAPABILITY_FLAG 0x01U /*!< @brief Channels within the group may be used only for NSK related opeartions. */ 1042*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MCHANNELGROUP_NON_NSK_CAPABILITY_FLAG 0x02U /*!< @brief Channels within the group may be used only for non NSK related opeartions. */ 1043*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MCHANNELGROUP_ANY_OPERATION_ALLOWED_CAPABILITY_FLAG 0x04U /*!< @brief Channels within the group may be used with NSK2HDI_M2MCHANNEL_ANY_OPERATION. */ 1044*53ee8cc1Swenshuai.xi /** @} 1045*53ee8cc1Swenshuai.xi * End of NSK2HDI_M2MCHANNELGROUP_CAPS group belonging 1046*53ee8cc1Swenshuai.xi */ 1047*53ee8cc1Swenshuai.xi 1048*53ee8cc1Swenshuai.xi /** @} 1049*53ee8cc1Swenshuai.xi * End of NSK2HDI_M2MCHANNELGROUP_DEFS group belonging 1050*53ee8cc1Swenshuai.xi */ 1051*53ee8cc1Swenshuai.xi 1052*53ee8cc1Swenshuai.xi /*===========================================================================*/ 1053*53ee8cc1Swenshuai.xi /** @brief Creates an instance of the M2MChannel Group device and returns its handle to the caller. 1054*53ee8cc1Swenshuai.xi 1055*53ee8cc1Swenshuai.xi @param[in] M2MChannelGroup_ID - the ID of the M2MChannel Group device to open as returned by #NSK2HDI_M2MTableDevice_EnumerateChildren function. 1056*53ee8cc1Swenshuai.xi @param[out] M2MChannelGroup_handle - pointer to the device instance handle to be returned to a caller. 1057*53ee8cc1Swenshuai.xi 1058*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if device instance is created successfully or 1059*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 1060*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if request failed. 1061*53ee8cc1Swenshuai.xi */ 1062*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_M2MChannelGroupDevice_Open ( NSK2HDI_DEVICE_ID M2MChannelGroup_ID, 1063*53ee8cc1Swenshuai.xi NSK2HDI_HANDLE *M2MChannelGroup_handle); 1064*53ee8cc1Swenshuai.xi 1065*53ee8cc1Swenshuai.xi /*===========================================================================*/ 1066*53ee8cc1Swenshuai.xi /** @brief Destroys the specified instance of the M2MChannel Group device. 1067*53ee8cc1Swenshuai.xi Releases all the resources used by this device instance. 1068*53ee8cc1Swenshuai.xi 1069*53ee8cc1Swenshuai.xi @param[in] M2MChannelGroup_handle - handle of the device instance to be destroyed. 1070*53ee8cc1Swenshuai.xi 1071*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the device instance was destroyed or 1072*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if an invalid device handle was passed. 1073*53ee8cc1Swenshuai.xi */ 1074*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_M2MChannelGroupDevice_Close ( NSK2HDI_HANDLE M2MChannelGroup_handle); 1075*53ee8cc1Swenshuai.xi 1076*53ee8cc1Swenshuai.xi 1077*53ee8cc1Swenshuai.xi /*===========================================================================*/ 1078*53ee8cc1Swenshuai.xi /** @brief Retrieves the Properties of the M2MChannel Group device. 1079*53ee8cc1Swenshuai.xi If desc_size is zero, the function is used to retrieve the size of the buffer to be allocated for the properties, only and the desc parameter is ignored. 1080*53ee8cc1Swenshuai.xi 1081*53ee8cc1Swenshuai.xi @param[in] M2MChannelGroup_handle - a handle to the opened M2MChannel Group device. 1082*53ee8cc1Swenshuai.xi @param[in] request_id - the ID of the properties retrieval request.See \ref NSK2HDI_M2MCHANNELGROUP_REQUEST_IDS for possible values. 1083*53ee8cc1Swenshuai.xi @param[in, out] desc_size - size of the buffer allocated by the caller for the device properties as an input, actual size of the device properties returned by the device as an output. 1084*53ee8cc1Swenshuai.xi @param[out] desc - pointer to the buffer receiving the device properties. 1085*53ee8cc1Swenshuai.xi 1086*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 1087*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 1088*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 1089*53ee8cc1Swenshuai.xi */ 1090*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_M2MChannelGroupDevice_GetProperties( NSK2HDI_HANDLE M2MChannelGroup_handle, 1091*53ee8cc1Swenshuai.xi NDS_ULONG request_id, 1092*53ee8cc1Swenshuai.xi NDS_ULONG *desc_size, 1093*53ee8cc1Swenshuai.xi NDS_UBYTE *desc); 1094*53ee8cc1Swenshuai.xi 1095*53ee8cc1Swenshuai.xi /** @} 1096*53ee8cc1Swenshuai.xi * End of NSK2HDI_M2MCHANNELGROUP group belonging 1097*53ee8cc1Swenshuai.xi */ 1098*53ee8cc1Swenshuai.xi 1099*53ee8cc1Swenshuai.xi /** 1100*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_M2MCHANNEL M2MChannel Channel Device 1101*53ee8cc1Swenshuai.xi ** @{ 1102*53ee8cc1Swenshuai.xi */ 1103*53ee8cc1Swenshuai.xi /** @addtogroup NSK2HDI_M2MCHANNEL_OPERATION M2MChannel Operation 1104*53ee8cc1Swenshuai.xi ** @{ 1105*53ee8cc1Swenshuai.xi */ 1106*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MCHANNEL_DECRYPT_OPERATION 0x01U /*!< @brief Data chunk descrambling operation */ 1107*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MCHANNEL_ENCRYPT_OPERATION 0x02U /*!< @brief Data chunk scrambling operation */ 1108*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MCHANNEL_ANY_OPERATION 0x04U /*!< @brief Data chunk any operation */ 1109*53ee8cc1Swenshuai.xi /** @} 1110*53ee8cc1Swenshuai.xi * End of NSK2HDI_M2MCHANNEL_OPERATION group belonging 1111*53ee8cc1Swenshuai.xi */ 1112*53ee8cc1Swenshuai.xi /** 1113*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_M2MCHANNEL_DESC_TAGS M2MChannel Descriptor Tags 1114*53ee8cc1Swenshuai.xi ** @{ 1115*53ee8cc1Swenshuai.xi */ 1116*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MCHANNEL_ALGORITHM_DESC_TAG 0x01U /*!< @brief M2MChannel algrorithm descriptor */ 1117*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MCHANNEL_OPERATION_DESC_TAG 0x02U /*!< @brief M2MChannel operation. See \ref NSK2HDI_M2MCHANNEL_OPERATION for possible values */ 1118*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MCHANNEL_CLEAR_SWKEY_DESC_TAG 0x03U /*!< @brief M2MChannel Clear SW key. Can be set only for M2MChannels supporting non NSK mode */ 1119*53ee8cc1Swenshuai.xi /** @} 1120*53ee8cc1Swenshuai.xi * End of NSK2HDI_M2MCHANNEL_DESC_TAGS group belonging 1121*53ee8cc1Swenshuai.xi */ 1122*53ee8cc1Swenshuai.xi 1123*53ee8cc1Swenshuai.xi /*===========================================================================*/ 1124*53ee8cc1Swenshuai.xi /** @brief Creates an instance of the M2MChannel device and returns its handle to the caller. 1125*53ee8cc1Swenshuai.xi 1126*53ee8cc1Swenshuai.xi @param[in] M2MChannelGroup_ID - the ID of the M2MChannelGroup device where the requested channel belongs to 1127*53ee8cc1Swenshuai.xi @param[out] M2MChannel_handle - pointer to the device instance handle to be returned to a caller. 1128*53ee8cc1Swenshuai.xi 1129*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if device instance is created successfully or 1130*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 1131*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if request failed. 1132*53ee8cc1Swenshuai.xi */ 1133*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_M2MChannelDevice_Open ( NSK2HDI_DEVICE_ID M2MChannelGroup_ID, 1134*53ee8cc1Swenshuai.xi NSK2HDI_HANDLE *M2MChannel_handle); 1135*53ee8cc1Swenshuai.xi 1136*53ee8cc1Swenshuai.xi 1137*53ee8cc1Swenshuai.xi /*===========================================================================*/ 1138*53ee8cc1Swenshuai.xi /** @brief Destroys the specified instance of the M2MChannel device. 1139*53ee8cc1Swenshuai.xi Releases all the resources used by this device instance. 1140*53ee8cc1Swenshuai.xi 1141*53ee8cc1Swenshuai.xi @param[in] M2MChannel_handle - handle of the device instance to be destroyed. 1142*53ee8cc1Swenshuai.xi 1143*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the device instance was destroyed or 1144*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if an invalid device handle was passed. 1145*53ee8cc1Swenshuai.xi */ 1146*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_M2MChannelDevice_Close( NSK2HDI_HANDLE M2MChannel_handle); 1147*53ee8cc1Swenshuai.xi 1148*53ee8cc1Swenshuai.xi 1149*53ee8cc1Swenshuai.xi /*===========================================================================*/ 1150*53ee8cc1Swenshuai.xi /** @brief Configures the M2MChannel device. 1151*53ee8cc1Swenshuai.xi 1152*53ee8cc1Swenshuai.xi @param[in] M2MChannel_handle - a handle to the opened M2MChannel device. 1153*53ee8cc1Swenshuai.xi @param[in] desc_size - size of the "desc" buffer. 1154*53ee8cc1Swenshuai.xi @param[in] desc - buffer containing the descriptors configuring the local descrambler. See \ref NSK2HDI_M2MCHANNEL_DESC_TAGS for possible descriptors 1155*53ee8cc1Swenshuai.xi 1156*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 1157*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 1158*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 1159*53ee8cc1Swenshuai.xi */ 1160*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_M2MChannelDevice_Configure(NSK2HDI_HANDLE M2MChannel_handle, 1161*53ee8cc1Swenshuai.xi NDS_ULONG desc_size, 1162*53ee8cc1Swenshuai.xi const NDS_UBYTE *desc); 1163*53ee8cc1Swenshuai.xi 1164*53ee8cc1Swenshuai.xi /*===========================================================================*/ 1165*53ee8cc1Swenshuai.xi /** @brief Request the NSK device to copy the keys and the control switches from the NSK KTE to the NSK chip key table. 1166*53ee8cc1Swenshuai.xi Can be applied only to M2MChannels having the NSK capability. 1167*53ee8cc1Swenshuai.xi 1168*53ee8cc1Swenshuai.xi @param[in] M2MChannel_handle - a handle to the opened M2MChannel device. 1169*53ee8cc1Swenshuai.xi @param[in] desc_size - size of the descriptors buffer. 1170*53ee8cc1Swenshuai.xi @param[in] desc - buffer containing the descriptors. See \ref NSK2HDI_M2MCHANNEL_DESC_TAGS for possible descriptors 1171*53ee8cc1Swenshuai.xi 1172*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 1173*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 1174*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 1175*53ee8cc1Swenshuai.xi */ 1176*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_M2MChannelDevice_NSKWriteM2MKey(NSK2HDI_HANDLE M2MChannel_handle, 1177*53ee8cc1Swenshuai.xi NDS_ULONG desc_size, 1178*53ee8cc1Swenshuai.xi const NDS_UBYTE *desc); 1179*53ee8cc1Swenshuai.xi /*===========================================================================*/ 1180*53ee8cc1Swenshuai.xi /** @brief Sets the clear SW key to M2MChannel. 1181*53ee8cc1Swenshuai.xi Can be applied only to M2MChannels having the non-NSK capability 1182*53ee8cc1Swenshuai.xi 1183*53ee8cc1Swenshuai.xi @param[in] M2MChannel_handle - a handle to the opened M2MChannel device. 1184*53ee8cc1Swenshuai.xi @param[in] desc_size - size of the descriptors buffer. 1185*53ee8cc1Swenshuai.xi @param[in] desc - buffer containing the descriptors. See \ref NSK2HDI_M2MCHANNEL_DESC_TAGS for possible descriptors 1186*53ee8cc1Swenshuai.xi 1187*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 1188*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 1189*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 1190*53ee8cc1Swenshuai.xi */ 1191*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_M2MChannelDevice_WriteM2MKey(NSK2HDI_HANDLE M2MChannel_handle, 1192*53ee8cc1Swenshuai.xi NDS_ULONG desc_size, 1193*53ee8cc1Swenshuai.xi const NDS_UBYTE *desc); 1194*53ee8cc1Swenshuai.xi /*===========================================================================*/ 1195*53ee8cc1Swenshuai.xi /** @brief Retrieves the cookie associated with M2MChannel device. 1196*53ee8cc1Swenshuai.xi 1197*53ee8cc1Swenshuai.xi @param[in] M2MChannel_handle - a handle to the opened M2MChannel device. 1198*53ee8cc1Swenshuai.xi @param[out] cookie - pointer to the variable receiving the device cookie. 1199*53ee8cc1Swenshuai.xi 1200*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 1201*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 1202*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 1203*53ee8cc1Swenshuai.xi */ 1204*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_M2MChannelDevice_GetCookie(NSK2HDI_HANDLE M2MChannel_handle, 1205*53ee8cc1Swenshuai.xi void **cookie); 1206*53ee8cc1Swenshuai.xi /** @} 1207*53ee8cc1Swenshuai.xi * End of NSK2HDI_M2MCHANNEL group belonging 1208*53ee8cc1Swenshuai.xi */ 1209*53ee8cc1Swenshuai.xi 1210*53ee8cc1Swenshuai.xi /** 1211*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_DMA DMA Device 1212*53ee8cc1Swenshuai.xi ** @{ 1213*53ee8cc1Swenshuai.xi */ 1214*53ee8cc1Swenshuai.xi /** @addtogroup NSK2HDI_DMA_DEF DMA Definitions 1215*53ee8cc1Swenshuai.xi ** @{ 1216*53ee8cc1Swenshuai.xi */ 1217*53ee8cc1Swenshuai.xi #define NSK2HDI_DMA_UNLIMITED_DATA_SIZE 0xFFFFFFFFU /*!< @brief Data chunk size is unlimited */ 1218*53ee8cc1Swenshuai.xi /** @} 1219*53ee8cc1Swenshuai.xi * End of NSK2HDI_DMA_DEF group belonging 1220*53ee8cc1Swenshuai.xi */ 1221*53ee8cc1Swenshuai.xi /** 1222*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_DMA_GET_PROPERTIES_REQUEST DMA Request IDs 1223*53ee8cc1Swenshuai.xi ** @{ 1224*53ee8cc1Swenshuai.xi */ 1225*53ee8cc1Swenshuai.xi #define NSK2HDI_DMA_READ_ALL_DESCRIPTORS_REQUEST 0x00U /*!< @brief request for reading all DMA descriptors*/ 1226*53ee8cc1Swenshuai.xi /** @} 1227*53ee8cc1Swenshuai.xi * End of NSK2HDI_DMA_GET_PROPERTIES_REQUEST group belonging 1228*53ee8cc1Swenshuai.xi */ 1229*53ee8cc1Swenshuai.xi /** @addtogroup NSK2HDI_DMA_OPERATION DMA Operation 1230*53ee8cc1Swenshuai.xi ** @{ 1231*53ee8cc1Swenshuai.xi */ 1232*53ee8cc1Swenshuai.xi #define NSK2HDI_DMA_ENCRYPT_OPERATION 0x01U /*!< @brief Data chunk decrypt request */ 1233*53ee8cc1Swenshuai.xi #define NSK2HDI_DMA_DECRYPT_OPERATION 0x02U /*!< @brief Data chunk encrypt request */ 1234*53ee8cc1Swenshuai.xi /** @} 1235*53ee8cc1Swenshuai.xi * End of NSK2HDI_DMA_OPERATION group belonging 1236*53ee8cc1Swenshuai.xi */ 1237*53ee8cc1Swenshuai.xi 1238*53ee8cc1Swenshuai.xi /** @addtogroup NSK2HDI_DMA_MEMORY_TYPE Data Chunk Memory Type 1239*53ee8cc1Swenshuai.xi ** @{ 1240*53ee8cc1Swenshuai.xi */ 1241*53ee8cc1Swenshuai.xi #define NSK2HDI_DMA_CONTIGUOUS_MEMORY_TYPE 0x01U /*!< @brief Data chunk memory type is contiguous */ 1242*53ee8cc1Swenshuai.xi #define NSK2HDI_DMA_NONCONTIGUOUS_MEMORY_TYPE 0x02U /*!< @brief Data chunk memory type is non-contiguous */ 1243*53ee8cc1Swenshuai.xi /** @} 1244*53ee8cc1Swenshuai.xi * End of NSK2HDI_DMA_MEMORY_TYPE group belonging 1245*53ee8cc1Swenshuai.xi */ 1246*53ee8cc1Swenshuai.xi 1247*53ee8cc1Swenshuai.xi /** @addtogroup NSK2HDI_DMA_CAPABILITIES Device Capabilities 1248*53ee8cc1Swenshuai.xi ** @{ 1249*53ee8cc1Swenshuai.xi */ 1250*53ee8cc1Swenshuai.xi #define NSK2HDI_DMA_NON_CONTIGUOUS_MEMORY_ALLOWED_FLAG 0x01U /*!< @brief DMA device supports non-contiguous memory*/ 1251*53ee8cc1Swenshuai.xi /** @} 1252*53ee8cc1Swenshuai.xi * End of NSK2HDI_DMA_CAPABILITIES group belonging 1253*53ee8cc1Swenshuai.xi */ 1254*53ee8cc1Swenshuai.xi 1255*53ee8cc1Swenshuai.xi /** 1256*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_DMA_DESCRIPTOR_TAGS DMA Descriptor Tags 1257*53ee8cc1Swenshuai.xi ** @{ 1258*53ee8cc1Swenshuai.xi */ 1259*53ee8cc1Swenshuai.xi #define NSK2HDI_DMA_IV1_DESC_TAG 0x01U /*!< @brief Descriptor carrying IV1 */ 1260*53ee8cc1Swenshuai.xi #define NSK2HDI_DMA_IV2_DESC_TAG 0x02U /*!< @brief Descriptor carrying IV2 */ 1261*53ee8cc1Swenshuai.xi #define NSK2HDI_DMA_OPERATION_DESC_TAG 0x03U /*!< @brief DMA operation. See \ref NSK2HDI_DMA_OPERATION for possible values */ 1262*53ee8cc1Swenshuai.xi #define NSK2HDI_DMA_SRC_MEMORY_TYPE_DESC_TAG 0x04U /*!< @brief Data chunk memory type. See \ref NSK2HDI_DMA_MEMORY_TYPE for possible values */ 1263*53ee8cc1Swenshuai.xi #define NSK2HDI_DMA_DST_MEMORY_TYPE_DESC_TAG 0x05U /*!< @brief Data chunk memory type. See \ref NSK2HDI_DMA_MEMORY_TYPE for possible values */ 1264*53ee8cc1Swenshuai.xi #define NSK2HDI_DMA_CAPABILITY_DESC_TAG 0x06U /*!< @brief DMA device capability descriptor. See \ref NSK2HDI_DMA_CAPABILITIES for possible values */ 1265*53ee8cc1Swenshuai.xi /** @} 1266*53ee8cc1Swenshuai.xi * End of NSK2HDI_DMA_DESCRIPTOR_TAGS group belonging 1267*53ee8cc1Swenshuai.xi */ 1268*53ee8cc1Swenshuai.xi 1269*53ee8cc1Swenshuai.xi 1270*53ee8cc1Swenshuai.xi 1271*53ee8cc1Swenshuai.xi /*===========================================================================*/ 1272*53ee8cc1Swenshuai.xi /** @brief Creates an instance of the DMA device and returns its handle to the caller. 1273*53ee8cc1Swenshuai.xi 1274*53ee8cc1Swenshuai.xi @param[in] DMA_ID - the ID of the DMA device as returned by #NSK2HDI_M2MTableDevice_EnumerateChildren. 1275*53ee8cc1Swenshuai.xi @param[out] DMA_handle - pointer to the device instance handle to be returned to a caller. 1276*53ee8cc1Swenshuai.xi 1277*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if device instance is created successfully or 1278*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 1279*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if request failed. 1280*53ee8cc1Swenshuai.xi */ 1281*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_DMADevice_Open ( NSK2HDI_DEVICE_ID DMA_ID, 1282*53ee8cc1Swenshuai.xi NSK2HDI_HANDLE *DMA_handle); 1283*53ee8cc1Swenshuai.xi 1284*53ee8cc1Swenshuai.xi 1285*53ee8cc1Swenshuai.xi /*===========================================================================*/ 1286*53ee8cc1Swenshuai.xi /** @brief Destroys the specified instance of the M2MChannel device. 1287*53ee8cc1Swenshuai.xi Releases all the resources used by this device instance. 1288*53ee8cc1Swenshuai.xi 1289*53ee8cc1Swenshuai.xi @param[in] DMA_handle - handle of the device instance to be destroyed. 1290*53ee8cc1Swenshuai.xi 1291*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the device instance was destroyed or 1292*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if an invalid device handle was passed. 1293*53ee8cc1Swenshuai.xi */ 1294*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_DMADevice_Close( NSK2HDI_HANDLE DMA_handle); 1295*53ee8cc1Swenshuai.xi 1296*53ee8cc1Swenshuai.xi 1297*53ee8cc1Swenshuai.xi /*===========================================================================*/ 1298*53ee8cc1Swenshuai.xi /** @brief Retrieves the Properties of the DMA device. 1299*53ee8cc1Swenshuai.xi If desc_size is zero, the function is used to retrieve the size of the buffer to be allocated for the properties, only and the desc parameter is ignored. 1300*53ee8cc1Swenshuai.xi 1301*53ee8cc1Swenshuai.xi @param[in] DMA_handle - a handle to the opened DMA device. 1302*53ee8cc1Swenshuai.xi @param[in] request_id - the ID of the properties retrieval request.See \ref NSK2HDI_DMA_GET_PROPERTIES_REQUEST for possible values. 1303*53ee8cc1Swenshuai.xi @param[in, out] desc_size - size of the buffer allocated by the caller for the device properties. 1304*53ee8cc1Swenshuai.xi @param[out] desc - pointer to the buffer receiving the descriptors with device properties. See \ref NSK2HDI_DMA_DESCRIPTOR_TAGS 1305*53ee8cc1Swenshuai.xi 1306*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 1307*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 1308*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 1309*53ee8cc1Swenshuai.xi */ 1310*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_DMADevice_GetProperties( NSK2HDI_HANDLE DMA_handle, 1311*53ee8cc1Swenshuai.xi NDS_ULONG request_id, 1312*53ee8cc1Swenshuai.xi NDS_ULONG *desc_size, 1313*53ee8cc1Swenshuai.xi NDS_UBYTE *desc); 1314*53ee8cc1Swenshuai.xi 1315*53ee8cc1Swenshuai.xi /*===========================================================================*/ 1316*53ee8cc1Swenshuai.xi /** @brief Writes the data to the DMA device. 1317*53ee8cc1Swenshuai.xi 1318*53ee8cc1Swenshuai.xi @param[in] DMA_handle - a handle to the opened M2MChannel device. 1319*53ee8cc1Swenshuai.xi @param[in] M2MChannel_cookie - a pointer that is associated with M2M channel used for this DMA operation. See \ref NSK2HDI_M2MChannelDevice_GetCookie 1320*53ee8cc1Swenshuai.xi @param[in] desc_size - size of the "desc" buffer. 1321*53ee8cc1Swenshuai.xi @param[in] desc - buffer containing the descriptors configuring the local descrambler. See \ref NSK2HDI_M2MCHANNEL_DESC_TAGS for possible descriptors 1322*53ee8cc1Swenshuai.xi @param[in] data_size - size of the written data. 1323*53ee8cc1Swenshuai.xi @param[in] in_data_buffer - buffer containing the data to be processed 1324*53ee8cc1Swenshuai.xi @param[in] out_data_buffer - buffer intended for processed data 1325*53ee8cc1Swenshuai.xi 1326*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 1327*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 1328*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 1329*53ee8cc1Swenshuai.xi */ 1330*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_DMADevice_WriteData( 1331*53ee8cc1Swenshuai.xi NSK2HDI_HANDLE DMA_handle, 1332*53ee8cc1Swenshuai.xi void *M2MChannel_cookie, 1333*53ee8cc1Swenshuai.xi NDS_ULONG desc_size, 1334*53ee8cc1Swenshuai.xi const NDS_UBYTE *desc, 1335*53ee8cc1Swenshuai.xi NDS_ULONG data_size, 1336*53ee8cc1Swenshuai.xi NDS_UBYTE *in_data, 1337*53ee8cc1Swenshuai.xi NDS_UBYTE *out_data); 1338*53ee8cc1Swenshuai.xi 1339*53ee8cc1Swenshuai.xi 1340*53ee8cc1Swenshuai.xi 1341*53ee8cc1Swenshuai.xi /** @} 1342*53ee8cc1Swenshuai.xi * End of NSK2HDI_DMA group belonging 1343*53ee8cc1Swenshuai.xi */ 1344*53ee8cc1Swenshuai.xi 1345*53ee8cc1Swenshuai.xi /** @} 1346*53ee8cc1Swenshuai.xi * End of NSK2HDI_M2M group belonging 1347*53ee8cc1Swenshuai.xi */ 1348*53ee8cc1Swenshuai.xi 1349*53ee8cc1Swenshuai.xi /** 1350*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_CA_MASTER CA Master Device 1351*53ee8cc1Swenshuai.xi ** @{ 1352*53ee8cc1Swenshuai.xi */ 1353*53ee8cc1Swenshuai.xi /** 1354*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_CA_MASTER_DEFINITIONS CA Master Device Definitions 1355*53ee8cc1Swenshuai.xi ** @{ 1356*53ee8cc1Swenshuai.xi */ 1357*53ee8cc1Swenshuai.xi 1358*53ee8cc1Swenshuai.xi /** 1359*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_CA_MASTER_FUNCTIONS_ID Virtual Function IDs 1360*53ee8cc1Swenshuai.xi ** @{ 1361*53ee8cc1Swenshuai.xi */ 1362*53ee8cc1Swenshuai.xi #define NSK2HDI_CASOCGROUPDEVICE_OPEN_FUNC_ID 0x00000011U /*!< @brief ID of the registered function of the #NSK2HDI_CaSoCGroupDevice_Open type */ 1363*53ee8cc1Swenshuai.xi #define NSK2HDI_CASOCGROUPDEVICE_CLOSE_FUNC_ID 0x00000012U /*!< @brief ID of the registered function of the #NSK2HDI_CaSoCGroupDevice_Close type */ 1364*53ee8cc1Swenshuai.xi #define NSK2HDI_CASOCGROUPDEVICE_ENUMERATECHILDREN_FUNC_ID 0x00000014U /*!< @brief ID of the registered function of the #NSK2HDI_CaSoCGroupDevice_EnumerateChildren type */ 1365*53ee8cc1Swenshuai.xi #define NSK2HDI_CASOCGROUPDEVICE_REGISTERENUMERATIONCHANGECB_FUNC_ID 0x00000015U /*!< @brief ID of the registered function of the #NSK2HDI_CaSoCGroupDevice_RegisterEnumerationChangeCB type */ 1366*53ee8cc1Swenshuai.xi #define NSK2HDI_OTPDEVICE_OPEN_FUNC_ID 0x00000020U /*!< @brief ID of the registered function of the #NSK2HDI_OtpDevice_Open type */ 1367*53ee8cc1Swenshuai.xi #define NSK2HDI_OTPDEVICE_CLOSE_FUNC_ID 0x00000021U /*!< @brief ID of the registered function of the #NSK2HDI_OtpDevice_Close type */ 1368*53ee8cc1Swenshuai.xi #define NSK2HDI_OTPDEVICE_GETPROPERTIES_FUNC_ID 0x00000022U /*!< @brief ID of the registered function of the #NSK2HDI_OtpDevice_GetProperties type */ 1369*53ee8cc1Swenshuai.xi #define NSK2HDI_NSKDEVICE_OPEN_FUNC_ID 0x00000030U /*!< @brief ID of the registered function of the #NSK2HDI_NskDevice_Open type */ 1370*53ee8cc1Swenshuai.xi #define NSK2HDI_NSKDEVICE_CLOSE_FUNC_ID 0x00000031U /*!< @brief ID of the registered function of the #NSK2HDI_NskDevice_Close type */ 1371*53ee8cc1Swenshuai.xi #define NSK2HDI_NSKDEVICE_READ8_FUNC_ID 0x00000032U /*!< @brief ID of the registered function of the #NSK2HDI_NskDevice_Read8 type */ 1372*53ee8cc1Swenshuai.xi #define NSK2HDI_NSKDEVICE_WRITE8_FUNC_ID 0x00000033U /*!< @brief ID of the registered function of the #NSK2HDI_NskDevice_Write8 type */ 1373*53ee8cc1Swenshuai.xi #define NSK2HDI_NSKDEVICE_READ32_FUNC_ID 0x00000034U /*!< @brief ID of the registered function of the #NSK2HDI_NskDevice_Read32 type */ 1374*53ee8cc1Swenshuai.xi #define NSK2HDI_NSKDEVICE_WRITE32_FUNC_ID 0x00000035U /*!< @brief ID of the registered function of the #NSK2HDI_NskDevice_Write32 type */ 1375*53ee8cc1Swenshuai.xi #define NSK2HDI_NSKDEVICE_EXECUTECMD_FUNC_ID 0x00000036U /*!< @brief ID of the registered function of the #NSK2HDI_NskDevice_ExecuteCmd type */ 1376*53ee8cc1Swenshuai.xi #define NSK2HDI_NSKDEVICE_REGISTEREVENTCB_FUNC_ID 0x00000037U /*!< @brief ID of the registered function of the #NSK2HDI_NskDevice_RegisterEventCB type */ 1377*53ee8cc1Swenshuai.xi #define NSK2HDI_NSKDEVICE_ACKNOWLEDGEKTE_FUNC_ID 0x00000038U /*!< @brief ID of the registered function of the #NSK2HDI_NskDevice_AcknowledgeKte type */ 1378*53ee8cc1Swenshuai.xi #define NSK2HDI_NSKDEVICE_BASICINITIALIZATIONCOMPLETE_FUNC_ID 0x00000039U /*!< @brief ID of the registered function of the #NSK2HDI_NskDevice_BasicInitializationComplete type */ 1379*53ee8cc1Swenshuai.xi #define NSK2HDI_NSKDEVICE_UPDATENVCOUNTER_FUNC_ID 0x0000003AU /*!< @brief ID of the registered function of the #NSK2HDI_NskDevice_UpdateNvCounter type */ 1380*53ee8cc1Swenshuai.xi #define NSK2HDI_NSKDEVICE_WRITEOTPKEY_FUNC_ID 0x0000003BU /*!< @brief ID of the registered function of the #NSK2HDI_NskDevice_WriteOtpKey type */ 1381*53ee8cc1Swenshuai.xi #define NSK2HDI_NSKDEVICE_SETONESHOTGENINBITS_FUNC_ID 0x0000003CU /*!< @brief ID of the registered function of the #NSK2HDI_NskDevice_SetOneShotGenInBits type */ 1382*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNELTABLEDEVICE_OPEN_FUNC_ID 0x00000040U /*!< @brief ID of the registered function of the #NSK2HDI_CmChannelTableDevice_Open type */ 1383*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNELTABLEDEVICE_CLOSE_FUNC_ID 0x00000041U /*!< @brief ID of the registered function of the #NSK2HDI_CmChannelTableDevice_Close type */ 1384*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNELTABLEDEVICE_ENUMERATECHILDREN_FUNC_ID 0x00000042U /*!< @brief ID of the registered function of the #NSK2HDI_CmChannelTableDevice_EnumerateChildren type */ 1385*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNELGROUPDEVICE_OPEN_FUNC_ID 0x00000050U /*!< @brief ID of the registered function of the #NSK2HDI_CmChannelGroupDevice_Open type */ 1386*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNELGROUPDEVICE_CLOSE_FUNC_ID 0x00000051U /*!< @brief ID of the registered function of the #NSK2HDI_CmChannelGroupDevice_Close type */ 1387*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNELGROUPDEVICE_GETPROPERTIES_FUNC_ID 0x00000052U /*!< @brief ID of the registered function of the #NSK2HDI_CmChannelGroupDevice_GetProperties type */ 1388*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNELDEVICE_OPEN_FUNC_ID 0x00000060U /*!< @brief ID of the registered function of the #NSK2HDI_CmChannelDevice_Open type */ 1389*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNELDEVICE_CLOSE_FUNC_ID 0x00000061U /*!< @brief ID of the registered function of the #NSK2HDI_CmChannelDevice_Close type */ 1390*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNELDEVICE_CONFIGURE_FUNC_ID 0x00000062U /*!< @brief ID of the registered function of the #NSK2HDI_CmChannelDevice_Configure type */ 1391*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNELDEVICE_WRITETRANSPORTKEY_FUNC_ID 0x00000063U /*!< @brief ID of the registered function of the #NSK2HDI_CmChannelDevice_WriteTransportKey type */ 1392*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNELDEVICE_INVALIDATEKEYS_FUNC_ID 0x00000064U /*!< @brief ID of the registered function of the #NSK2HDI_CmChannelDevice_InvalidateKeys type */ 1393*53ee8cc1Swenshuai.xi #define NSK2HDI_CMCHANNELDEVICE_GETCOOKIE_FUNC_ID 0x00000065U /*!< @brief ID of the registered function of the #NSK2HDI_CmChannelDevice_GetCookie type */ 1394*53ee8cc1Swenshuai.xi #define NSK2HDI_CAPIDPROXY_OPEN_FUNC_ID 0x00000070U /*!< @brief ID of the registered function of the #NSK2HDI_CaPIDProxy_Open type */ 1395*53ee8cc1Swenshuai.xi #define NSK2HDI_CAPIDPROXY_CLOSE_FUNC_ID 0x00000071U /*!< @brief ID of the registered function of the #NSK2HDI_CaPIDProxy_Close type */ 1396*53ee8cc1Swenshuai.xi #define NSK2HDI_CAPIDPROXY_SETPRIMARYSTREAMPID_FUNC_ID 0x00000072U /*!< @brief ID of the registered function of the #NSK2HDI_CaPIDProxy_SetPrimaryStreamPID type */ 1397*53ee8cc1Swenshuai.xi #define NSK2HDI_CAPIDPROXY_SETPRIMARYSTREAMCMCHANNEL_FUNC_ID 0x00000073U /*!< @brief ID of the registered function of the #NSK2HDI_CaPIDProxy_SetPrimaryStreamCmChannel type */ 1398*53ee8cc1Swenshuai.xi #define NSK2HDI_CAPIDPROXY_REMOVEPRIMARYSTREAMCMCHANNEL_FUNC_ID 0x00000074U /*!< @brief ID of the registered function of the #NSK2HDI_CaPIDProxy_RemovePrimaryStreamCmChannel type */ 1399*53ee8cc1Swenshuai.xi #define NSK2HDI_CAPIDPROXY_SETSECONDARYSTREAM_FUNC_ID 0x00000075U /*!< @brief ID of the registered function of the #NSK2HDI_CaPIDProxy_SetSecondaryStream type */ 1400*53ee8cc1Swenshuai.xi #define NSK2HDI_CAPIDPROXY_REMOVESECONDARYSTREAM_FUNC_ID 0x00000076U /*!< @brief ID of the registered function of the #NSK2HDI_CaPIDProxy_RemoveSecondaryStream type */ 1401*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MTABLEDEVICE_OPEN_FUNC_ID 0x00000080U /*!< @brief ID of the registered function of the #NSK2HDI_M2MTableDevice_Open type */ 1402*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MTABLEDEVICE_CLOSE_FUNC_ID 0x00000081U /*!< @brief ID of the registered function of the #NSK2HDI_M2MTableDevice_Close type */ 1403*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MTABLEDEVICE_ENUMERATECHILDREN_FUNC_ID 0x00000082U /*!< @brief ID of the registered function of the #NSK2HDI_M2MTableDevice_EnumerateChildren type */ 1404*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MCHANNELGROUPDEVICE_OPEN_FUNC_ID 0x00000090U /*!< @brief ID of the registered function of the #NSK2HDI_M2MChannelGroupDevice_Open type */ 1405*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MCHANNELGROUPDEVICE_CLOSE_FUNC_ID 0x00000091U /*!< @brief ID of the registered function of the #NSK2HDI_M2MChannelGroupDevice_Close type */ 1406*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MCHANNELGROUPDEVICE_GETPROPERTIES_FUNC_ID 0x00000092U /*!< @brief ID of the registered function of the #NSK2HDI_M2MChannelGroupDevice_GetProperties type */ 1407*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MCHANNELDEVICE_OPEN_FUNC_ID 0x000000A0U /*!< @brief ID of the registered function of the #NSK2HDI_M2MChannelDevice_Open type */ 1408*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MCHANNELDEVICE_CLOSE_FUNC_ID 0x000000A1U /*!< @brief ID of the registered function of the #NSK2HDI_M2MChannelDevice_Close type */ 1409*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MCHANNELDEVICE_CONFIGURE_FUNC_ID 0x000000A2U /*!< @brief ID of the registered function of the #NSK2HDI_M2MChannelDevice_Configure type */ 1410*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MCHANNELDEVICE_WRITETM2MKEY_FUNC_ID 0x000000A3U /*!< @brief ID of the registered function of the #NSK2HDI_M2MChannelDevice_WriteM2MKey type */ 1411*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MCHANNELDEVICE_NSKWRITETM2MKEY_FUNC_ID 0x000000A4U /*!< @brief ID of the registered function of the #NSK2HDI_M2MChannelDevice_NSKWriteM2MKey type */ 1412*53ee8cc1Swenshuai.xi #define NSK2HDI_M2MCHANNELDEVICE_GETCOOKIE_FUNC_ID 0x000000A5U /*!< @brief ID of the registered function of the #NSK2HDI_M2MChannelDevice_GetCookie type */ 1413*53ee8cc1Swenshuai.xi #define NSK2HDI_DMADEVICE_OPEN_FUNC_ID 0x000000B0U /*!< @brief ID of the registered function of the #NSK2HDI_DMADevice_Open type */ 1414*53ee8cc1Swenshuai.xi #define NSK2HDI_DMADEVICE_CLOSE_FUNC_ID 0x000000B1U /*!< @brief ID of the registered function of the #NSK2HDI_DMADevice_Close type */ 1415*53ee8cc1Swenshuai.xi #define NSK2HDI_DMADEVICE_GETPROPERTIES_FUNC_ID 0x000000B2U /*!< @brief ID of the registered function of the #NSK2HDI_DMADevice_GetProperties type */ 1416*53ee8cc1Swenshuai.xi #define NSK2HDI_DMADEVICE_WRITEDATA_FUNC_ID 0x000000B3U /*!< @brief ID of the registered function of the #NSK2HDI_DMADevice_WriteData type */ 1417*53ee8cc1Swenshuai.xi /** @} 1418*53ee8cc1Swenshuai.xi * End of NSK2HDI_CA_MASTER_FUNCTIONS_ID group belonging 1419*53ee8cc1Swenshuai.xi */ 1420*53ee8cc1Swenshuai.xi 1421*53ee8cc1Swenshuai.xi /** 1422*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_CA_MASTER_VFUNCTION Virtual Function 1423*53ee8cc1Swenshuai.xi ** @{ 1424*53ee8cc1Swenshuai.xi */ 1425*53ee8cc1Swenshuai.xi /** @brief The virtual function typedef */ 1426*53ee8cc1Swenshuai.xi typedef NSK2HDI_STATUS NSK2HDI_VFUNCTION(void); 1427*53ee8cc1Swenshuai.xi 1428*53ee8cc1Swenshuai.xi /** @brief The NSK2HDI_VFUNCTION_ITEM structure used for defining the specific virtual function 1429*53ee8cc1Swenshuai.xi exposed by registered device or one of its sub-devices and the associated ID 1430*53ee8cc1Swenshuai.xi */ 1431*53ee8cc1Swenshuai.xi typedef struct _NSK2HDI_VFUNCTION 1432*53ee8cc1Swenshuai.xi { 1433*53ee8cc1Swenshuai.xi NDS_ULONG id; /*!< @brief ID of the registered function. See \ref NSK2HDI_CA_MASTER_FUNCTIONS_ID for possible values */ 1434*53ee8cc1Swenshuai.xi NSK2HDI_VFUNCTION *func; /*!< @brief pointer to registered function.*/ 1435*53ee8cc1Swenshuai.xi }NSK2HDI_VFUNCTION_ITEM; 1436*53ee8cc1Swenshuai.xi /** @} 1437*53ee8cc1Swenshuai.xi * End of NSK2HDI_CA_MASTER_VFUNCTION group belonging 1438*53ee8cc1Swenshuai.xi */ 1439*53ee8cc1Swenshuai.xi 1440*53ee8cc1Swenshuai.xi /** 1441*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_CA_MASTER_VTABLE Virtual Function Table 1442*53ee8cc1Swenshuai.xi ** @{ 1443*53ee8cc1Swenshuai.xi */ 1444*53ee8cc1Swenshuai.xi /** @brief The NSK2HDI_VTABLE structure used for setting the virtual table 1445*53ee8cc1Swenshuai.xi with the functions exposed by registered device and its sub-devices 1446*53ee8cc1Swenshuai.xi */ 1447*53ee8cc1Swenshuai.xi typedef struct _NSK2HDI_VTABLE 1448*53ee8cc1Swenshuai.xi { 1449*53ee8cc1Swenshuai.xi NDS_ULONG version; /*!< @brief version of the structure. Must be set to zero.*/ 1450*53ee8cc1Swenshuai.xi NDS_ULONG num_vfunctions; /*!< @brief number of the exposed functions*/ 1451*53ee8cc1Swenshuai.xi NSK2HDI_VFUNCTION_ITEM *vfunction; /*!< @brief pointer to the list of the exposed function items*/ 1452*53ee8cc1Swenshuai.xi }NSK2HDI_VTABLE; 1453*53ee8cc1Swenshuai.xi 1454*53ee8cc1Swenshuai.xi /** @} 1455*53ee8cc1Swenshuai.xi * End of NSK2HDI_CA_MASTER_VTABLE group belonging 1456*53ee8cc1Swenshuai.xi */ 1457*53ee8cc1Swenshuai.xi /** @} 1458*53ee8cc1Swenshuai.xi * End of NSK2HDI_CA_MASTER_DEFINITIONS group belonging 1459*53ee8cc1Swenshuai.xi */ 1460*53ee8cc1Swenshuai.xi 1461*53ee8cc1Swenshuai.xi 1462*53ee8cc1Swenshuai.xi /*===========================================================================*/ 1463*53ee8cc1Swenshuai.xi /** @brief DRIVER calls Verifier in order to register a new root device. 1464*53ee8cc1Swenshuai.xi The root device mast be already initialized before this call. 1465*53ee8cc1Swenshuai.xi 1466*53ee8cc1Swenshuai.xi @param[in] device_type - the type of the registering device 1467*53ee8cc1Swenshuai.xi @param[in] vtable - virtual table with the functions exposed by the child device 1468*53ee8cc1Swenshuai.xi @param[out] root_device_id - the id assigned to the registered root device. 1469*53ee8cc1Swenshuai.xi @param[out] registration_handle - register device instance handle allocated by the drivers 1470*53ee8cc1Swenshuai.xi 1471*53ee8cc1Swenshuai.xi The root_device_ID allocated by the Verifier for the SoC device should be used as a base 1472*53ee8cc1Swenshuai.xi for all device IDs returned by the drivers during via the enumeration functions from the provided vtable. 1473*53ee8cc1Swenshuai.xi The IDs assigned by the drivers should meet the following criteria: 1474*53ee8cc1Swenshuai.xi root_device_id & NSK2HDI_CHILD_DEVICE_ID_MASK = child_device_id & NSK2HDI_CHILD_DEVICE_ID_MASK 1475*53ee8cc1Swenshuai.xi where the value of root_device_id meets the following criteria: 1476*53ee8cc1Swenshuai.xi root_device_id & NSK2HDI_CHILD_DEVICE_ID_MASK = root_device_id 1477*53ee8cc1Swenshuai.xi 1478*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 1479*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 1480*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 1481*53ee8cc1Swenshuai.xi */ 1482*53ee8cc1Swenshuai.xi NSK2HDI_STATUS NSK2HDI_CaMasterDevice_RegisterRootDevice (NDS_ULONG device_type, 1483*53ee8cc1Swenshuai.xi NSK2HDI_VTABLE *vtable, 1484*53ee8cc1Swenshuai.xi NSK2HDI_DEVICE_ID *root_device_id, 1485*53ee8cc1Swenshuai.xi NSK2HDI_HANDLE *registration_handle); 1486*53ee8cc1Swenshuai.xi 1487*53ee8cc1Swenshuai.xi /*===========================================================================*/ 1488*53ee8cc1Swenshuai.xi /** @brief Unregisters the registered child device. 1489*53ee8cc1Swenshuai.xi 1490*53ee8cc1Swenshuai.xi @param[in] registration_handle - the handle of the previously registered child device. 1491*53ee8cc1Swenshuai.xi 1492*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 1493*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 1494*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 1495*53ee8cc1Swenshuai.xi */ 1496*53ee8cc1Swenshuai.xi NSK2HDI_STATUS NSK2HDI_CaMasterDevice_UnregisterRootDevice (NSK2HDI_HANDLE registration_handle); 1497*53ee8cc1Swenshuai.xi 1498*53ee8cc1Swenshuai.xi 1499*53ee8cc1Swenshuai.xi /** @} 1500*53ee8cc1Swenshuai.xi * End of NSK2HDI_CA_MASTER group belonging 1501*53ee8cc1Swenshuai.xi */ 1502*53ee8cc1Swenshuai.xi 1503*53ee8cc1Swenshuai.xi /***********************************************************************************************************/ 1504*53ee8cc1Swenshuai.xi /***********************************************************************************************************/ 1505*53ee8cc1Swenshuai.xi /******************************** HAL ***********************************************/ 1506*53ee8cc1Swenshuai.xi /***********************************************************************************************************/ 1507*53ee8cc1Swenshuai.xi /***********************************************************************************************************/ 1508*53ee8cc1Swenshuai.xi /** 1509*53ee8cc1Swenshuai.xi ** @addtogroup NSK2HDI_NSK_HAL NSK HAL API 1510*53ee8cc1Swenshuai.xi ** @{ 1511*53ee8cc1Swenshuai.xi */ 1512*53ee8cc1Swenshuai.xi 1513*53ee8cc1Swenshuai.xi /** 1514*53ee8cc1Swenshuai.xi * @addtogroup NSK2HDI_HAL_COMMON Definitions 1515*53ee8cc1Swenshuai.xi * @{ 1516*53ee8cc1Swenshuai.xi */ 1517*53ee8cc1Swenshuai.xi /** @brief NSK2 HAL drivers event callback function 1518*53ee8cc1Swenshuai.xi */ 1519*53ee8cc1Swenshuai.xi typedef void HALNSK2_NSKEVENT_CB_FN (NSK2HDI_HANDLE Nsk_handle, 1520*53ee8cc1Swenshuai.xi void *cookie); 1521*53ee8cc1Swenshuai.xi 1522*53ee8cc1Swenshuai.xi /** @} 1523*53ee8cc1Swenshuai.xi * End of NSK2HDI_HAL_COMMON group belonging 1524*53ee8cc1Swenshuai.xi */ 1525*53ee8cc1Swenshuai.xi 1526*53ee8cc1Swenshuai.xi /*===========================================================================*/ 1527*53ee8cc1Swenshuai.xi /** @brief Creates an instance of the HAL NSK device and returns its handle to the caller. 1528*53ee8cc1Swenshuai.xi 1529*53ee8cc1Swenshuai.xi @param[in] Nsk_ID - HAL device instance identifier of the NSK device to be opened . 1530*53ee8cc1Swenshuai.xi @param[out] Nsk_handle - pointer to the device instance handle to be returned to a caller. 1531*53ee8cc1Swenshuai.xi 1532*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 1533*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 1534*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 1535*53ee8cc1Swenshuai.xi */ 1536*53ee8cc1Swenshuai.xi NSK2HDI_STATUS NSK2HAL_NskDevice_Open (NSK2HDI_DEVICE_ID Nsk_ID, 1537*53ee8cc1Swenshuai.xi NSK2HDI_HANDLE *Nsk_handle); 1538*53ee8cc1Swenshuai.xi 1539*53ee8cc1Swenshuai.xi 1540*53ee8cc1Swenshuai.xi /*===========================================================================*/ 1541*53ee8cc1Swenshuai.xi /** @brief Destroys the specified instance of the NSK device. 1542*53ee8cc1Swenshuai.xi Releases all the resources used by this device instance. 1543*53ee8cc1Swenshuai.xi 1544*53ee8cc1Swenshuai.xi @param[in] Nsk_handle - handle of the device instance to be destroyed. 1545*53ee8cc1Swenshuai.xi 1546*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 1547*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 1548*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 1549*53ee8cc1Swenshuai.xi */ 1550*53ee8cc1Swenshuai.xi NSK2HDI_STATUS NSK2HAL_NskDevice_Close (NSK2HDI_HANDLE Nsk_handle); 1551*53ee8cc1Swenshuai.xi 1552*53ee8cc1Swenshuai.xi 1553*53ee8cc1Swenshuai.xi /*===========================================================================*/ 1554*53ee8cc1Swenshuai.xi /** @brief Reads data from registers 1555*53ee8cc1Swenshuai.xi 1556*53ee8cc1Swenshuai.xi @param[in] Nsk_handle - a handle to the opened NSK device. 1557*53ee8cc1Swenshuai.xi @param[in] register_offset - the offset within the device memory map at which to start the read. 1558*53ee8cc1Swenshuai.xi @param[in] data_size - number of bytes to read, must be a positive multiple of 4. 1559*53ee8cc1Swenshuai.xi @param[out] data - pointer to the buffer receiving the read data. 1560*53ee8cc1Swenshuai.xi 1561*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 1562*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 1563*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 1564*53ee8cc1Swenshuai.xi */ 1565*53ee8cc1Swenshuai.xi NSK2HDI_STATUS NSK2HAL_NskDevice_Read8 (NSK2HDI_HANDLE Nsk_handle, 1566*53ee8cc1Swenshuai.xi NDS_ULONG register_offset, 1567*53ee8cc1Swenshuai.xi NDS_ULONG data_size, 1568*53ee8cc1Swenshuai.xi NDS_UBYTE *data); 1569*53ee8cc1Swenshuai.xi 1570*53ee8cc1Swenshuai.xi 1571*53ee8cc1Swenshuai.xi /*===========================================================================*/ 1572*53ee8cc1Swenshuai.xi /** @brief Writes data to the registers 1573*53ee8cc1Swenshuai.xi 1574*53ee8cc1Swenshuai.xi @param[in] Nsk_handle - a handle to the opened NSK device. 1575*53ee8cc1Swenshuai.xi @param[in] register_offset - the offset within the device memory map at which to start the read. 1576*53ee8cc1Swenshuai.xi @param[in] data_size - number of bytes to write, must be a positive multiple of 4. 1577*53ee8cc1Swenshuai.xi @param[out] data - pointer to the buffer containing the data to be written. 1578*53ee8cc1Swenshuai.xi 1579*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 1580*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 1581*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 1582*53ee8cc1Swenshuai.xi */ 1583*53ee8cc1Swenshuai.xi 1584*53ee8cc1Swenshuai.xi NSK2HDI_STATUS NSK2HAL_NskDevice_Write8 (NSK2HDI_HANDLE Nsk_handle, 1585*53ee8cc1Swenshuai.xi NDS_ULONG register_offset, 1586*53ee8cc1Swenshuai.xi NDS_ULONG data_size, 1587*53ee8cc1Swenshuai.xi const NDS_UBYTE *data); 1588*53ee8cc1Swenshuai.xi 1589*53ee8cc1Swenshuai.xi 1590*53ee8cc1Swenshuai.xi /*===========================================================================*/ 1591*53ee8cc1Swenshuai.xi /** @brief Reads data from registers 1592*53ee8cc1Swenshuai.xi 1593*53ee8cc1Swenshuai.xi @param[in] Nsk_handle - a handle to the opened NSK device. 1594*53ee8cc1Swenshuai.xi @param[in] register_offset - the offset within the device memory map at which to start the read, must be a multiple of 4. 1595*53ee8cc1Swenshuai.xi @param[in] data_size - number of 32-bits words to read. 1596*53ee8cc1Swenshuai.xi @param[out] data - pointer to the buffer receiving the read data. 1597*53ee8cc1Swenshuai.xi 1598*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 1599*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 1600*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 1601*53ee8cc1Swenshuai.xi */ 1602*53ee8cc1Swenshuai.xi NSK2HDI_STATUS NSK2HAL_NskDevice_Read32 (NSK2HDI_HANDLE Nsk_handle, 1603*53ee8cc1Swenshuai.xi NDS_ULONG register_offset, 1604*53ee8cc1Swenshuai.xi NDS_ULONG data_size, 1605*53ee8cc1Swenshuai.xi NDS_ULONG *data); 1606*53ee8cc1Swenshuai.xi 1607*53ee8cc1Swenshuai.xi /*===========================================================================*/ 1608*53ee8cc1Swenshuai.xi /** @brief Writes data to the registers 1609*53ee8cc1Swenshuai.xi 1610*53ee8cc1Swenshuai.xi @param[in] Nsk_handle - a handle to the opened NSK device. 1611*53ee8cc1Swenshuai.xi @param[in] register_offset - the offset within the device memory map at which to start writing,must be a multiple of 4. 1612*53ee8cc1Swenshuai.xi @param[in] data_size - number of bytes to write. 1613*53ee8cc1Swenshuai.xi @param[out] data - pointer to the buffer containing the data to be written. 1614*53ee8cc1Swenshuai.xi 1615*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 1616*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 1617*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 1618*53ee8cc1Swenshuai.xi */ 1619*53ee8cc1Swenshuai.xi NSK2HDI_STATUS NSK2HAL_NskDevice_Write32 (NSK2HDI_HANDLE Nsk_handle, 1620*53ee8cc1Swenshuai.xi NDS_ULONG register_offset, 1621*53ee8cc1Swenshuai.xi NDS_ULONG data_size, 1622*53ee8cc1Swenshuai.xi const NDS_ULONG *data); 1623*53ee8cc1Swenshuai.xi 1624*53ee8cc1Swenshuai.xi 1625*53ee8cc1Swenshuai.xi 1626*53ee8cc1Swenshuai.xi /*===========================================================================*/ 1627*53ee8cc1Swenshuai.xi /** @brief Registers the callback function for NSK events. 1628*53ee8cc1Swenshuai.xi This method can be called once during the device instance life cycle. 1629*53ee8cc1Swenshuai.xi 1630*53ee8cc1Swenshuai.xi @param[in] Nsk_handle - a handle to the opened NSK device. 1631*53ee8cc1Swenshuai.xi @param[in] cb_routine - pointer to the #HALNSK2_NSKEVENT_CB_FN function. 1632*53ee8cc1Swenshuai.xi @param[in] cookie - a pointer that will be returned to the caller when the cb_routine is called. 1633*53ee8cc1Swenshuai.xi 1634*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 1635*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 1636*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 1637*53ee8cc1Swenshuai.xi */ 1638*53ee8cc1Swenshuai.xi NSK2HDI_STATUS NSK2HAL_NskDevice_RegisterEventCB (NSK2HDI_HANDLE Nsk_handle, 1639*53ee8cc1Swenshuai.xi HALNSK2_NSKEVENT_CB_FN *cb_routine, 1640*53ee8cc1Swenshuai.xi void *cookie); 1641*53ee8cc1Swenshuai.xi 1642*53ee8cc1Swenshuai.xi 1643*53ee8cc1Swenshuai.xi /*===========================================================================*/ 1644*53ee8cc1Swenshuai.xi /** @brief Sends an acknowledgment signal to the NSK that the NSK chip has finished using the KTE contents. 1645*53ee8cc1Swenshuai.xi 1646*53ee8cc1Swenshuai.xi @param[in] Nsk_handle - a handle to the opened NSK device. 1647*53ee8cc1Swenshuai.xi 1648*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 1649*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 1650*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 1651*53ee8cc1Swenshuai.xi */ 1652*53ee8cc1Swenshuai.xi NSK2HDI_STATUS NSK2HAL_NskDevice_AcknowledgeKte(NSK2HDI_HANDLE Nsk_handle); 1653*53ee8cc1Swenshuai.xi 1654*53ee8cc1Swenshuai.xi /*===========================================================================*/ 1655*53ee8cc1Swenshuai.xi /** @brief Called to indicate that NSK basic initialization is complete. 1656*53ee8cc1Swenshuai.xi 1657*53ee8cc1Swenshuai.xi @param[in] Nsk_handle - a handle to the opened NSK device. 1658*53ee8cc1Swenshuai.xi @param[in] stage - initialization stage. See \ref NSK2HDI_INITIALIZATION_STAGE for possible values. 1659*53ee8cc1Swenshuai.xi 1660*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_OK if the operation completed successfully or 1661*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_INVALID_REQUEST if one or more parameters are invalid or 1662*53ee8cc1Swenshuai.xi @retval #NSK2HDI_STATUS_FAILED if the operation failed. 1663*53ee8cc1Swenshuai.xi */ 1664*53ee8cc1Swenshuai.xi NSK2HDI_STATUS NSK2HAL_NskDevice_BasicInitializationComplete(NSK2HDI_HANDLE Nsk_handle, NDS_ULONG stage); 1665*53ee8cc1Swenshuai.xi 1666*53ee8cc1Swenshuai.xi 1667*53ee8cc1Swenshuai.xi /** @} 1668*53ee8cc1Swenshuai.xi * End of NSK2HDI_NSK_HAL group belonging 1669*53ee8cc1Swenshuai.xi */ 1670*53ee8cc1Swenshuai.xi 1671*53ee8cc1Swenshuai.xi /** @} 1672*53ee8cc1Swenshuai.xi * End of NSK2HDI_CA_DEVICES group belonging 1673*53ee8cc1Swenshuai.xi */ 1674*53ee8cc1Swenshuai.xi 1675*53ee8cc1Swenshuai.xi 1676*53ee8cc1Swenshuai.xi #endif /*H_NSK_282*/ 1677