1 // SPDX-License-Identifier: GPL-2.0
3 /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
4 * Copyright (C) 2019-2020 Linaro Ltd.
7 #include <linux/types.h>
11 #include "ipa_endpoint.h"
14 void ipa_gsi_trans_complete(struct gsi_trans
*trans
)
16 struct ipa
*ipa
= container_of(trans
->gsi
, struct ipa
, gsi
);
18 ipa_endpoint_trans_complete(ipa
->channel_map
[trans
->channel_id
], trans
);
21 void ipa_gsi_trans_release(struct gsi_trans
*trans
)
23 struct ipa
*ipa
= container_of(trans
->gsi
, struct ipa
, gsi
);
25 ipa_endpoint_trans_release(ipa
->channel_map
[trans
->channel_id
], trans
);
28 void ipa_gsi_channel_tx_queued(struct gsi
*gsi
, u32 channel_id
, u32 count
,
31 struct ipa
*ipa
= container_of(gsi
, struct ipa
, gsi
);
32 struct ipa_endpoint
*endpoint
;
34 endpoint
= ipa
->channel_map
[channel_id
];
36 netdev_sent_queue(endpoint
->netdev
, byte_count
);
39 void ipa_gsi_channel_tx_completed(struct gsi
*gsi
, u32 channel_id
, u32 count
,
42 struct ipa
*ipa
= container_of(gsi
, struct ipa
, gsi
);
43 struct ipa_endpoint
*endpoint
;
45 endpoint
= ipa
->channel_map
[channel_id
];
47 netdev_completed_queue(endpoint
->netdev
, count
, byte_count
);
50 /* Indicate whether an endpoint config data entry is "empty" */
51 bool ipa_gsi_endpoint_data_empty(const struct ipa_gsi_endpoint_data
*data
)
53 return data
->ee_id
== GSI_EE_AP
&& !data
->channel
.tlv_count
;