1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /* Copyright(c) 2007-2022 Intel Corporation */
3 /* $FreeBSD$ */
4 /**
5  *****************************************************************************
6  * @file icp_buffer_desc.h
7  *
8  * @defgroup icp_BufferDesc Buffer descriptor for LAC
9  *
10  * @ingroup LacCommon
11  *
12  * @description
13  *      This file contains details of the hardware buffer descriptors used to
14  *      communicate with the QAT.
15  *
16  *****************************************************************************/
17 #ifndef ICP_BUFFER_DESC_H
18 #define ICP_BUFFER_DESC_H
19 
20 #include "cpa.h"
21 
22 typedef Cpa64U icp_qat_addr_width_t; // hi32 first, lo32 second
23 
24 // Alignement constraint of the buffer list.
25 #define ICP_DESCRIPTOR_ALIGNMENT_BYTES 8
26 
27 /**
28  *****************************************************************************
29  * @ingroup icp_BufferDesc
30  *      Buffer descriptors for FlatBuffers - used in communications with
31  *      the QAT.
32  *
33  * @description
34  *      A QAT friendly buffer descriptor.
35  *      All buffer descriptor described in this structure are physcial
36  *      and are 64 bit wide.
37  *
38  *      Updates in the CpaFlatBuffer should be also reflected in this
39  *      structure
40  *
41  *****************************************************************************/
42 typedef struct icp_flat_buffer_desc_s {
43 	Cpa32U dataLenInBytes;
44 	Cpa32U reserved;
45 	icp_qat_addr_width_t phyBuffer;
46 	/**< The client will allocate memory for this using API function calls
47 	  *  and the access layer will fill it and the QAT will read it.
48 	  */
49 } icp_flat_buffer_desc_t;
50 
51 /**
52  *****************************************************************************
53  * @ingroup icp_BufferDesc
54  *      Buffer descriptors for BuffersLists - used in communications with
55  *      the QAT.
56  *
57  * @description
58  *      A QAT friendly buffer descriptor.
59  *      All buffer descriptor described in this structure are physcial
60  *      and are 64 bit wide.
61  *
62  *      Updates in the CpaBufferList should be also reflected in this structure
63  *
64  *****************************************************************************/
65 typedef struct icp_buffer_list_desc_s {
66 	Cpa64U resrvd;
67 	Cpa32U numBuffers;
68 	Cpa32U reserved;
69 	icp_flat_buffer_desc_t phyBuffers[];
70 	/**< Unbounded array of physical buffer pointers, these point to the
71 	  *  FlatBufferDescs. The client will allocate memory for this using
72 	  *  API function calls and the access layer will fill it and the QAT
73 	  *  will read it.
74 	  */
75 } icp_buffer_list_desc_t;
76 
77 #endif /* ICP_BUFFER_DESC_H */
78