/* SPDX-License-Identifier: GPL-2.0 * Marvell OcteonTX CPT driver * * Copyright (C) 2019 Marvell International Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation.
*/
/* * Maximum total number of SG buffers is 100, we divide it equally * between input and output
*/ #define OTX_CPT_MAX_SG_IN_CNT 50 #define OTX_CPT_MAX_SG_OUT_CNT 50
/* DMA mode direct or SG */ #define OTX_CPT_DMA_DIRECT_DIRECT 0 #define OTX_CPT_DMA_GATHER_SCATTER 1
struct otx_cpt_pending_queue { struct otx_cpt_pending_entry *head; /* Head of the queue */
u32 front; /* Process work from here */
u32 rear; /* Append new work here */
u32 pending_count; /* Pending requests count */
u32 qlen; /* Queue length */
spinlock_t lock; /* Queue lock */
};
struct otx_cpt_req_info { /* Kernel async request callback */ void (*callback)(int status, void *arg1, void *arg2); struct crypto_async_request *areq; /* Async request callback arg */ struct otx_cptvf_request req;/* Request information (core specific) */ union otx_cpt_ctrl_info ctrl;/* User control information */ struct otx_cpt_buf_ptr in[OTX_CPT_MAX_SG_IN_CNT]; struct otx_cpt_buf_ptr out[OTX_CPT_MAX_SG_OUT_CNT];
u8 *iv_out; /* IV to send back */
u16 rlen; /* Output length */
u8 incnt; /* Number of input buffers */
u8 outcnt; /* Number of output buffers */
u8 req_type; /* Type of request */
u8 is_enc; /* Is a request an encryption request */
u8 is_trunc_hmac;/* Is truncated hmac used */
};
if (info->dptr_baddr)
dma_unmap_single(&pdev->dev, info->dptr_baddr,
info->dma_len, DMA_BIDIRECTIONAL);
if (info->req) {
req = info->req; for (i = 0; i < req->outcnt; i++) { if (req->out[i].dma_addr)
dma_unmap_single(&pdev->dev,
req->out[i].dma_addr,
req->out[i].size,
DMA_BIDIRECTIONAL);
}
for (i = 0; i < req->incnt; i++) { if (req->in[i].dma_addr)
dma_unmap_single(&pdev->dev,
req->in[i].dma_addr,
req->in[i].size,
DMA_BIDIRECTIONAL);
}
}
kfree_sensitive(info);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.