File Index
Files and directories
Sign in
FILE

dma.h

File preview with syntax highlighting.

linux-6.19.14/drivers/crypto/qce/dma.h C
 1/* SPDX-License-Identifier: GPL-2.0-only */
 2/*
 3 * Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
 4 */
 5
 6#ifndef _DMA_H_
 7#define _DMA_H_
 8
 9#include <linux/dmaengine.h>
10
11/* maximum data transfer block size between BAM and CE */
12#define QCE_BAM_BURST_SIZE		64
13
14#define QCE_AUTHIV_REGS_CNT		16
15#define QCE_AUTH_BYTECOUNT_REGS_CNT	4
16#define QCE_CNTRIV_REGS_CNT		4
17
18struct qce_result_dump {
19	u32 auth_iv[QCE_AUTHIV_REGS_CNT];
20	u32 auth_byte_count[QCE_AUTH_BYTECOUNT_REGS_CNT];
21	u32 encr_cntr_iv[QCE_CNTRIV_REGS_CNT];
22	u32 status;
23	u32 status2;
24};
25
26#define QCE_IGNORE_BUF_SZ	(2 * QCE_BAM_BURST_SIZE)
27#define QCE_RESULT_BUF_SZ	\
28		ALIGN(sizeof(struct qce_result_dump), QCE_BAM_BURST_SIZE)
29
30struct qce_dma_data {
31	struct dma_chan *txchan;
32	struct dma_chan *rxchan;
33	struct qce_result_dump *result_buf;
34	void *ignore_buf;
35};
36
37int devm_qce_dma_request(struct device *dev, struct qce_dma_data *dma);
38int qce_dma_prep_sgs(struct qce_dma_data *dma, struct scatterlist *sg_in,
39		     int in_ents, struct scatterlist *sg_out, int out_ents,
40		     dma_async_tx_callback cb, void *cb_param);
41void qce_dma_issue_pending(struct qce_dma_data *dma);
42int qce_dma_terminate_all(struct qce_dma_data *dma);
43struct scatterlist *
44qce_sgtable_add(struct sg_table *sgt, struct scatterlist *sg_add,
45		unsigned int max_len);
46
47#endif /* _DMA_H_ */
~/ Read-only file preview.