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