SEC 2.0 Reference Device Driver User's Guide
Table Of Contents
- SEC 2.0 Reference Device Driver User’s Guide
- 1 Overview
- 2 Device Driver Components
- 3 User Interface
- 4 Individual Request Type Descriptions
- 4.1 Random Number Requests
- 4.2 DES Requests
- 4.3 ARC4 Requests
- 4.4 Hash Requests
- 4.5 HMAC Requests
- 4.6 AES Requests
- 4.7 Integer Public Key Requests
- 4.8 ECC Public Key Requests
- 4.9 IPSec Requests
- 4.10 802.11 Protocol Requests
- 4.11 SRTP Protocol Requests
- 5 Sample Code
- 6 Linux Environment
- 7 VxWorks Environment
- 8 Porting

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.