xref: /openbmc/linux/drivers/net/ipa/ipa_gsi.h (revision c4c3c32d)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 
3 /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
4  * Copyright (C) 2019-2020 Linaro Ltd.
5  */
6 #ifndef _IPA_GSI_TRANS_H_
7 #define _IPA_GSI_TRANS_H_
8 
9 #include <linux/types.h>
10 
11 struct gsi;
12 struct gsi_trans;
13 struct ipa_gsi_endpoint_data;
14 
15 /**
16  * ipa_gsi_trans_complete() - GSI transaction completion callback
17  * @trans:	Transaction that has completed
18  *
19  * This called from the GSI layer to notify the IPA layer that a
20  * transaction has completed.
21  */
22 void ipa_gsi_trans_complete(struct gsi_trans *trans);
23 
24 /**
25  * ipa_gsi_trans_release() - GSI transaction release callback
26  * @trans:	Transaction whose resources should be freed
27  *
28  * This called from the GSI layer to notify the IPA layer that a
29  * transaction is about to be freed, so any resources associated
30  * with it should be released.
31  */
32 void ipa_gsi_trans_release(struct gsi_trans *trans);
33 
34 /**
35  * ipa_gsi_channel_tx_queued() - GSI queued to hardware notification
36  * @gsi:	GSI pointer
37  * @channel_id:	Channel number
38  * @count:	Number of transactions queued
39  * @byte_count:	Number of bytes to transfer represented by transactions
40  *
41  * This called from the GSI layer to notify the IPA layer that some
42  * number of transactions have been queued to hardware for execution.
43  */
44 void ipa_gsi_channel_tx_queued(struct gsi *gsi, u32 channel_id, u32 count,
45 			       u32 byte_count);
46 
47 /**
48  * ipa_gsi_channel_tx_completed() - GSI transaction completion callback
49  * @gsi:	GSI pointer
50  * @channel_id:	Channel number
51  * @count:	Number of transactions completed since last report
52  * @byte_count:	Number of bytes transferred represented by transactions
53  *
54  * This called from the GSI layer to notify the IPA layer that the hardware
55  * has reported the completion of some number of transactions.
56  */
57 void ipa_gsi_channel_tx_completed(struct gsi *gsi, u32 channel_id, u32 count,
58 				  u32 byte_count);
59 
60 /* ipa_gsi_endpoint_data_empty() - Empty endpoint config data test
61  * @data:	endpoint configuration data
62  *
63  * Determines whether an endpoint configuration data entry is empty,
64  * meaning it contains no valid configuration information and should
65  * be ignored.
66  *
67  * Return:	true if empty; false otherwise
68  */
69 bool ipa_gsi_endpoint_data_empty(const struct ipa_gsi_endpoint_data *data);
70 
71 #endif /* _IPA_GSI_TRANS_H_ */
72