From ede22ef36d262345cfc664c27223ed84f3b08db9 Mon Sep 17 00:00:00 2001 From: Hareesh Kesireddy Date: Wed, 20 Apr 2022 17:34:17 +0530 Subject: [PATCH] osi: remove extra args for tx complete callback Dma phy address, virtual address and packet length can be obtained from tx swcx structure. Hence passing pointer to tx swcx is sufficient. In future, if more information from osi is needed, it can be embedded into tx swcx itself rather than adding more arguments to osd tx complete call back. Bug 3576506 Change-Id: I061ea27cd1b4d68c19f3e9d95a247505c511ce0c Signed-off-by: Hareesh Kesireddy Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2700341 Tested-by: mobile promotions Reviewed-by: mobile promotions --- include/osi_dma.h | 9 +++++++-- osi/dma/osi_dma_txrx.c | 4 +--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/include/osi_dma.h b/include/osi_dma.h index d95c51b..b80a345 100644 --- a/include/osi_dma.h +++ b/include/osi_dma.h @@ -384,6 +384,12 @@ struct osi_tx_swcx { unsigned int flags; /** Packet id of packet for which TX timestamp needed */ unsigned int pktid; + /** dma channel number for osd use */ + nveu32_t chan; + /** reserved field 1 for future use */ + nveu64_t rsvd1; + /** reserved field 2 for future use */ + nveu64_t rsvd2; }; /** @@ -491,8 +497,7 @@ struct osi_dma_priv_data; */ struct osd_dma_ops { /** DMA transmit complete callback */ - void (*transmit_complete)(void *priv, void *buffer, - nveu64_t dmaaddr, nveu32_t len, + void (*transmit_complete)(void *priv, const struct osi_tx_swcx *swcx, const struct osi_txdone_pkt_cx *txdone_pkt_cx); /** DMA receive packet callback */ diff --git a/osi/dma/osi_dma_txrx.c b/osi/dma/osi_dma_txrx.c index c48b1ee..988160e 100644 --- a/osi/dma/osi_dma_txrx.c +++ b/osi/dma/osi_dma_txrx.c @@ -656,9 +656,7 @@ int osi_process_tx_completions(struct osi_dma_priv_data *osi_dma, tx_swcx->len = 0; } osi_dma->osd_ops.transmit_complete(osi_dma->osd, - tx_swcx->buf_virt_addr, - tx_swcx->buf_phy_addr, - tx_swcx->len, + tx_swcx, txdone_pkt_cx); } else { OSI_DMA_ERR(OSI_NULL, OSI_LOG_ARG_INVALID,