Intel EP80579 Security Camera User Manual


 
Security Software—Programming Model
Intel
®
EP80579 Software for Security Applications on Intel
®
QuickAssist Technology
PG August 2009
44 Order Number: 320183-004US
10.3.2 Data Buffer Models
Data buffers that are passed across the API interface in one of the following formats:
Flat Buffers represent a single region of physically contiguous memory, and are
described in Section 10.3.2.1, “Flat Buffers” on page 44.
Scatter Gather Lists are essentially an array of flat buffers, for cases where the
memory is not all physically contiguous. These are described in Section 10.3.2.2,
“Scatter Gather Lists” on page 44.
10.3.2.1 Flat Buffers
Flat buffers are represented by the type CpaFlatBuffer, defined in the file cpa.h. It
consists of two fields:
data pointer which points to the start address of the data or payload. This is a
virtual address. The data to which this points is required to be in contiguous
physical memory.
length of this buffer
For additional details, see Section 12.4.1, “Flat Buffers” on page 64.
10.3.2.2 Scatter Gather Lists
A scatter gather list is defined by the type CpaBufferList, also defined in the file cpa.h.
The buffer list contains four fields, as follows:
number of buffers in the list
pointer to an unbounded array of flat buffers
user data: an opaque field and is not read or modified internally by the API
pointer to meta data required by the API: The meta data is required for internal use
by the API. The memory for this buffer needs to be allocated by the client as
contiguous data. The size of this meta data buffer is obtained by calling the
appropriate GetMetaSize function.
For additional details, see Section 12.4.2, “Buffer List” on page 65.
10.3.3 Synchronous and Asynchronous Support
The Cryptographic API may be called in either asynchronous or synchronous modes.
10.3.3.1 Asynchronous Operation
The caller specifies asynchronous mode by supplying a callback function to the API.
Control returns to the client once the request message has been sent to the SSU; the
function does not block. The callback is invoked in a bottom half context (on Linux, this
is a tasklet) when the SSU completes the operation.
This mode is preferred for optimal performance.
10.3.3.2 Synchronous Operation
The caller specifies synchronous mode by not supplying a callback function pointer; a
NULL function pointer is passed. Once the request message has been sent to the SSU,
the thread of execution blocks pending receipt of the response, or a timeout. Once a
response is received from the SSU, it is processed, and the calling thread is unblocked
and resumes processing.