Linux Audio

Check our new training course

Loading...
v6.9.4
 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
 7#include <linux/types.h>
 8
 9#include "ipa_gsi.h"
10#include "gsi_trans.h"
11#include "ipa.h"
12#include "ipa_endpoint.h"
13#include "ipa_data.h"
 
 
 
14
15void ipa_gsi_trans_complete(struct gsi_trans *trans)
16{
17	struct ipa *ipa = container_of(trans->gsi, struct ipa, gsi);
18
19	ipa_endpoint_trans_complete(ipa->channel_map[trans->channel_id], trans);
20}
21
22void ipa_gsi_trans_release(struct gsi_trans *trans)
23{
24	struct ipa *ipa = container_of(trans->gsi, struct ipa, gsi);
25
26	ipa_endpoint_trans_release(ipa->channel_map[trans->channel_id], trans);
27}
28
29void ipa_gsi_channel_tx_queued(struct gsi *gsi, u32 channel_id, u32 count,
30			       u32 byte_count)
31{
32	struct ipa *ipa = container_of(gsi, struct ipa, gsi);
33	struct ipa_endpoint *endpoint;
34
35	endpoint = ipa->channel_map[channel_id];
36	if (endpoint->netdev)
37		netdev_sent_queue(endpoint->netdev, byte_count);
38}
39
40void ipa_gsi_channel_tx_completed(struct gsi *gsi, u32 channel_id, u32 count,
41				  u32 byte_count)
42{
43	struct ipa *ipa = container_of(gsi, struct ipa, gsi);
44	struct ipa_endpoint *endpoint;
45
46	endpoint = ipa->channel_map[channel_id];
47	if (endpoint->netdev)
48		netdev_completed_queue(endpoint->netdev, count, byte_count);
49}
50
51/* Indicate whether an endpoint config data entry is "empty" */
52bool ipa_gsi_endpoint_data_empty(const struct ipa_gsi_endpoint_data *data)
53{
54	return data->ee_id == GSI_EE_AP && !data->channel.tlv_count;
55}
v6.13.7
 1// SPDX-License-Identifier: GPL-2.0
 2
 3/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
 4 * Copyright (C) 2019-2024 Linaro Ltd.
 5 */
 6
 7#include <linux/types.h>
 8
 
 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"
15
16void ipa_gsi_trans_complete(struct gsi_trans *trans)
17{
18	struct ipa *ipa = container_of(trans->gsi, struct ipa, gsi);
19
20	ipa_endpoint_trans_complete(ipa->channel_map[trans->channel_id], trans);
21}
22
23void ipa_gsi_trans_release(struct gsi_trans *trans)
24{
25	struct ipa *ipa = container_of(trans->gsi, struct ipa, gsi);
26
27	ipa_endpoint_trans_release(ipa->channel_map[trans->channel_id], trans);
28}
29
30void ipa_gsi_channel_tx_queued(struct gsi *gsi, u32 channel_id, u32 count,
31			       u32 byte_count)
32{
33	struct ipa *ipa = container_of(gsi, struct ipa, gsi);
34	struct ipa_endpoint *endpoint;
35
36	endpoint = ipa->channel_map[channel_id];
37	if (endpoint->netdev)
38		netdev_sent_queue(endpoint->netdev, byte_count);
39}
40
41void ipa_gsi_channel_tx_completed(struct gsi *gsi, u32 channel_id, u32 count,
42				  u32 byte_count)
43{
44	struct ipa *ipa = container_of(gsi, struct ipa, gsi);
45	struct ipa_endpoint *endpoint;
46
47	endpoint = ipa->channel_map[channel_id];
48	if (endpoint->netdev)
49		netdev_completed_queue(endpoint->netdev, count, byte_count);
50}
51
52/* Indicate whether an endpoint config data entry is "empty" */
53bool ipa_gsi_endpoint_data_empty(const struct ipa_gsi_endpoint_data *data)
54{
55	return data->ee_id == GSI_EE_AP && !data->channel.tlv_count;
56}