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