xref: /freebsd/sys/dev/qat/qat_api/qat_direct/include/icp_adf_transport_dp.h (revision 71625ec9ad2a9bc8c09784fbd23b759830e0ee5f)
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /* Copyright(c) 2007-2022 Intel Corporation */
3 /*****************************************************************************
4  * @file icp_adf_transport_dp.h
5  *
6  * @description
7  *      File contains Public API definitions for ADF transport for data plane.
8  *
9  *****************************************************************************/
10 #ifndef ICP_ADF_TRANSPORT_DP_H
11 #define ICP_ADF_TRANSPORT_DP_H
12 
13 #include "cpa.h"
14 #include "icp_adf_transport.h"
15 
16 /*
17  * icp_adf_getQueueMemory
18  * Data plane support function - returns the pointer to next message on the ring
19  * or NULL if there is not enough space.
20  */
21 extern void icp_adf_getQueueMemory(icp_comms_trans_handle trans_handle,
22 				   Cpa32U numberRequests,
23 				   void **pCurrentQatMsg);
24 /*
25  * icp_adf_getSingleQueueAddr
26  * Data plane support function - returns the pointer to next message on the ring
27  * or NULL if there is not enough space - it also updates the shadow tail copy.
28  */
29 extern void icp_adf_getSingleQueueAddr(icp_comms_trans_handle trans_handle,
30 				       void **pCurrentQatMsg);
31 
32 /*
33  * icp_adf_getQueueNext
34  * Data plane support function - increments the tail pointer and returns
35  * the pointer to next message on the ring.
36  */
37 extern void icp_adf_getQueueNext(icp_comms_trans_handle trans_handle,
38 				 void **pCurrentQatMsg);
39 
40 /*
41  * icp_adf_updateQueueTail
42  * Data plane support function - Writes the tail shadow copy to the device.
43  */
44 extern void icp_adf_updateQueueTail(icp_comms_trans_handle trans_handle);
45 
46 /*
47  * icp_adf_isRingEmpty
48  * Data plane support function - check if the ring is empty
49  */
50 extern CpaBoolean icp_adf_isRingEmpty(icp_comms_trans_handle trans_handle);
51 
52 /*
53  * icp_adf_pollQueue
54  * Data plane support function - Poll messages from the queue.
55  */
56 extern CpaStatus icp_adf_pollQueue(icp_comms_trans_handle trans_handle,
57 				   Cpa32U response_quota);
58 
59 /*
60  * icp_adf_queueDataToSend
61  * LAC lite support function - Indicates if there is data on the ring to be
62  * send. This should only be called on request rings. If the function returns
63  * true then it is ok to call icp_adf_updateQueueTail() function on this ring.
64  */
65 extern CpaBoolean icp_adf_queueDataToSend(icp_comms_trans_handle trans_hnd);
66 
67 /*
68  * icp_adf_dp_getInflightRequests
69  * Retrieve in flight requests from the transport handle.
70  * Data plane API - no locks.
71  *
72  * Returns:
73  *   CPA_STATUS_SUCCESS   on success
74  *   CPA_STATUS_FAIL      on failure
75  */
76 extern CpaStatus
77 icp_adf_dp_getInflightRequests(icp_comms_trans_handle trans_handle,
78 			       Cpa32U *maxInflightRequests,
79 			       Cpa32U *numInflightRequests);
80 
81 #endif /* ICP_ADF_TRANSPORT_DP_H */
82