summaryrefslogtreecommitdiff
path: root/drivers/net/ipa/gsi.c
diff options
context:
space:
mode:
authorAlex Elder <elder@linaro.org>2022-06-13 12:17:56 -0500
committerDavid S. Miller <davem@davemloft.net>2022-06-15 09:07:58 +0100
commit4e0f28e9ee4b6d690ba6d617e5d0524327d0d610 (patch)
treee2558615379c83a257ddcd2cfd8df8c4c4316d4a /drivers/net/ipa/gsi.c
parent3eeabea6c895ee9f3f155fede65904d9bd54238a (diff)
downloadlwn-4e0f28e9ee4b6d690ba6d617e5d0524327d0d610.tar.gz
lwn-4e0f28e9ee4b6d690ba6d617e5d0524327d0d610.zip
net: ipa: introduce gsi_trans_tx_committed()
Create a new function that encapsulates recording information needed for TX channel statistics when a transaction is committed. Record the accumulated length in the transaction before the call (for both RX and TX), so it can be used when updating TX statistics. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ipa/gsi.c')
-rw-r--r--drivers/net/ipa/gsi.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c
index 5b446d2a07c8..1091ac23567d 100644
--- a/drivers/net/ipa/gsi.c
+++ b/drivers/net/ipa/gsi.c
@@ -991,6 +991,17 @@ void gsi_resume(struct gsi *gsi)
enable_irq(gsi->irq);
}
+void gsi_trans_tx_committed(struct gsi_trans *trans)
+{
+ struct gsi_channel *channel = &trans->gsi->channel[trans->channel_id];
+
+ trans->trans_count = channel->trans_count;
+ trans->byte_count = channel->byte_count;
+
+ channel->trans_count++;
+ channel->byte_count += trans->len;
+}
+
void gsi_trans_tx_queued(struct gsi_trans *trans)
{
u32 channel_id = trans->channel_id;