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