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