-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
soc: qcom: ipa: IPA interface to GSI
This patch provides interface functions supplied by the IPA layer that are called from the GSI layer. One function is called when a GSI transaction has completed. The others allow the GSI layer to inform the IPA layer when the hardware has been told it has new TREs to execute, and when the hardware has indicated transactions have completed. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
- Loading branch information
Alex Elder
authored and
David S. Miller
committed
Mar 9, 2020
1 parent
650d160
commit c3f398b
Showing
2 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
|
||
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. | ||
* Copyright (C) 2019-2020 Linaro Ltd. | ||
*/ | ||
|
||
#include <linux/types.h> | ||
|
||
#include "gsi_trans.h" | ||
#include "ipa.h" | ||
#include "ipa_endpoint.h" | ||
#include "ipa_data.h" | ||
|
||
void ipa_gsi_trans_complete(struct gsi_trans *trans) | ||
{ | ||
struct ipa *ipa = container_of(trans->gsi, struct ipa, gsi); | ||
|
||
ipa_endpoint_trans_complete(ipa->channel_map[trans->channel_id], trans); | ||
} | ||
|
||
void ipa_gsi_trans_release(struct gsi_trans *trans) | ||
{ | ||
struct ipa *ipa = container_of(trans->gsi, struct ipa, gsi); | ||
|
||
ipa_endpoint_trans_release(ipa->channel_map[trans->channel_id], trans); | ||
} | ||
|
||
void ipa_gsi_channel_tx_queued(struct gsi *gsi, u32 channel_id, u32 count, | ||
u32 byte_count) | ||
{ | ||
struct ipa *ipa = container_of(gsi, struct ipa, gsi); | ||
struct ipa_endpoint *endpoint; | ||
|
||
endpoint = ipa->channel_map[channel_id]; | ||
if (endpoint->netdev) | ||
netdev_sent_queue(endpoint->netdev, byte_count); | ||
} | ||
|
||
void ipa_gsi_channel_tx_completed(struct gsi *gsi, u32 channel_id, u32 count, | ||
u32 byte_count) | ||
{ | ||
struct ipa *ipa = container_of(gsi, struct ipa, gsi); | ||
struct ipa_endpoint *endpoint; | ||
|
||
endpoint = ipa->channel_map[channel_id]; | ||
if (endpoint->netdev) | ||
netdev_completed_queue(endpoint->netdev, count, byte_count); | ||
} | ||
|
||
/* Indicate whether an endpoint config data entry is "empty" */ | ||
bool ipa_gsi_endpoint_data_empty(const struct ipa_gsi_endpoint_data *data) | ||
{ | ||
return data->ee_id == GSI_EE_AP && !data->channel.tlv_count; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
|
||
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. | ||
* Copyright (C) 2019-2020 Linaro Ltd. | ||
*/ | ||
#ifndef _IPA_GSI_TRANS_H_ | ||
#define _IPA_GSI_TRANS_H_ | ||
|
||
#include <linux/types.h> | ||
|
||
struct gsi_trans; | ||
|
||
/** | ||
* ipa_gsi_trans_complete() - GSI transaction completion callback | ||
* @trans: Transaction that has completed | ||
* | ||
* This called from the GSI layer to notify the IPA layer that a | ||
* transaction has completed. | ||
*/ | ||
void ipa_gsi_trans_complete(struct gsi_trans *trans); | ||
|
||
/** | ||
* ipa_gsi_trans_release() - GSI transaction release callback | ||
* @trans: Transaction whose resources should be freed | ||
* | ||
* This called from the GSI layer to notify the IPA layer that a | ||
* transaction is about to be freed, so any resources associated | ||
* with it should be released. | ||
*/ | ||
void ipa_gsi_trans_release(struct gsi_trans *trans); | ||
|
||
/** | ||
* ipa_gsi_channel_tx_queued() - GSI queued to hardware notification | ||
* @gsi: GSI pointer | ||
* @channel_id: Channel number | ||
* @count: Number of transactions queued | ||
* @byte_count: Number of bytes to transfer represented by transactions | ||
* | ||
* This called from the GSI layer to notify the IPA layer that some | ||
* number of transactions have been queued to hardware for execution. | ||
*/ | ||
void ipa_gsi_channel_tx_queued(struct gsi *gsi, u32 channel_id, u32 count, | ||
u32 byte_count); | ||
/** | ||
* ipa_gsi_trans_complete() - GSI transaction completion callback | ||
ipa_gsi_channel_tx_completed() | ||
* @gsi: GSI pointer | ||
* @channel_id: Channel number | ||
* @count: Number of transactions completed since last report | ||
* @byte_count: Number of bytes transferred represented by transactions | ||
* | ||
* This called from the GSI layer to notify the IPA layer that the hardware | ||
* has reported the completion of some number of transactions. | ||
*/ | ||
void ipa_gsi_channel_tx_completed(struct gsi *gsi, u32 channel_id, u32 count, | ||
u32 byte_count); | ||
|
||
bool ipa_gsi_endpoint_data_empty(const struct ipa_gsi_endpoint_data *data); | ||
|
||
#endif /* _IPA_GSI_TRANS_H_ */ |