dm writecache: add cond_resched to loop in persistent_memory_claim()
[linux/fpc-iii.git] / drivers / net / ipa / ipa_gsi.c
blobdc4a5c2196aeeb8b431ab3840db67afd5292722c
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.
5 */
7 #include <linux/types.h>
9 #include "gsi_trans.h"
10 #include "ipa.h"
11 #include "ipa_endpoint.h"
12 #include "ipa_data.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,
29 u32 byte_count)
31 struct ipa *ipa = container_of(gsi, struct ipa, gsi);
32 struct ipa_endpoint *endpoint;
34 endpoint = ipa->channel_map[channel_id];
35 if (endpoint->netdev)
36 netdev_sent_queue(endpoint->netdev, byte_count);
39 void ipa_gsi_channel_tx_completed(struct gsi *gsi, u32 channel_id, u32 count,
40 u32 byte_count)
42 struct ipa *ipa = container_of(gsi, struct ipa, gsi);
43 struct ipa_endpoint *endpoint;
45 endpoint = ipa->channel_map[channel_id];
46 if (endpoint->netdev)
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;