SEC 2.0 Reference Device Driver User’s Guide, Rev. 0
Freescale Semiconductor
PRELIMINARY—SUBJECT TO CHANGE WITHOUT NOTICE
7
User Interface
/* in callback function notifAes */
if (aesdynReq.status != 0) {
printf ("Error detected by HW 0x%x\n", aesdynReq.status) ;
.
.
}
3.3 Global Definitions
3.3.1 I/O Control Codes
The I/O control code is the second argument in the
ioctl
function. Definitions of these control codes are defined
in
Sec2.h
.
Internally, these values are used in conjunction with a base index to create the I/O control codes. The macro for this
base index is defined by
SEC2_IOCTL_INDEX
and has a value of 0x0800.
3.3.2 Channel Definitions
The
NUM_CHANNELS
definition is used to specify the number of channels implemented in the
SEC2
device. If not
specified, it will be set to a value of 4 as a default.
Table 2. Second and Third Arguments in the
ioctl
Function
I/O Control Code (Second
Argument in
ioctl
Function)
Third Argument in
ioctl
Function
SEC2_PROC_REQ
Pointer to user's request structure
SEC2_GET_STATUS
Pointer to a
STATUS_REQ
SEC2_MALLOC
Pointer to be assigned to a block of kernel memory for holding
caller data to be operated upon
SEC2_FREE
Pointer to free a block originally allocated by
SEC2_MALLOC
SEC2_COPYFROM
Pointer to type
MALLOC_REQ
, which will hold information
about a user buffer that will be copied from user memory space
to kernel memory space allocated by
SEC2_MALLOC
SEC2_COPYTO
Pointer to type
MALLOC_REQ
, which will hold information
about a user buffer that will be copied from kernel memory
space allocated by
SEC2_MALLOC
back to a user's buffer.