Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / drivers / net / ipa / ipa_gsi.c
blobcb654c7b549815c0c99772287fe3227d899d7dd0
1 // SPDX-License-Identifier: GPL-2.0
3 /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
4 * Copyright (C) 2019-2024 Linaro Ltd.
5 */
7 #include <linux/types.h>
9 #include "gsi_trans.h"
10 #include "ipa.h"
11 #include "ipa_data.h"
12 #include "ipa_endpoint.h"
13 #include "ipa_gsi.h"
14 #include "ipa_version.h"
16 void ipa_gsi_trans_complete(struct gsi_trans *trans)
18 struct ipa *ipa = container_of(trans->gsi, struct ipa, gsi);
20 ipa_endpoint_trans_complete(ipa->channel_map[trans->channel_id], trans);
23 void ipa_gsi_trans_release(struct gsi_trans *trans)
25 struct ipa *ipa = container_of(trans->gsi, struct ipa, gsi);
27 ipa_endpoint_trans_release(ipa->channel_map[trans->channel_id], trans);
30 void ipa_gsi_channel_tx_queued(struct gsi *gsi, u32 channel_id, u32 count,
31 u32 byte_count)
33 struct ipa *ipa = container_of(gsi, struct ipa, gsi);
34 struct ipa_endpoint *endpoint;
36 endpoint = ipa->channel_map[channel_id];
37 if (endpoint->netdev)
38 netdev_sent_queue(endpoint->netdev, byte_count);
41 void ipa_gsi_channel_tx_completed(struct gsi *gsi, u32 channel_id, u32 count,
42 u32 byte_count)
44 struct ipa *ipa = container_of(gsi, struct ipa, gsi);
45 struct ipa_endpoint *endpoint;
47 endpoint = ipa->channel_map[channel_id];
48 if (endpoint->netdev)
49 netdev_completed_queue(endpoint->netdev, count, byte_count);
52 /* Indicate whether an endpoint config data entry is "empty" */
53 bool ipa_gsi_endpoint_data_empty(const struct ipa_gsi_endpoint_data *data)
55 return data->ee_id == GSI_EE_AP && !data->channel.tlv_count;