hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/crypto/caam/qi.h
....@@ -3,7 +3,7 @@
33 * Public definitions for the CAAM/QI (Queue Interface) backend.
44 *
55 * Copyright 2013-2016 Freescale Semiconductor, Inc.
6
- * Copyright 2016-2017 NXP
6
+ * Copyright 2016-2017, 2020 NXP
77 */
88
99 #ifndef __QI_H__
....@@ -13,32 +13,6 @@
1313 #include "compat.h"
1414 #include "desc.h"
1515 #include "desc_constr.h"
16
-
17
-/*
18
- * CAAM hardware constructs a job descriptor which points to a shared descriptor
19
- * (as pointed by context_a of to-CAAM FQ).
20
- * When the job descriptor is executed by DECO, the whole job descriptor
21
- * together with shared descriptor gets loaded in DECO buffer, which is
22
- * 64 words (each 32-bit) long.
23
- *
24
- * The job descriptor constructed by CAAM hardware has the following layout:
25
- *
26
- * HEADER (1 word)
27
- * Shdesc ptr (1 or 2 words)
28
- * SEQ_OUT_PTR (1 word)
29
- * Out ptr (1 or 2 words)
30
- * Out length (1 word)
31
- * SEQ_IN_PTR (1 word)
32
- * In ptr (1 or 2 words)
33
- * In length (1 word)
34
- *
35
- * The shdesc ptr is used to fetch shared descriptor contents into DECO buffer.
36
- *
37
- * Apart from shdesc contents, the total number of words that get loaded in DECO
38
- * buffer are '8' or '11'. The remaining words in DECO buffer can be used for
39
- * storing shared descriptor.
40
- */
41
-#define MAX_SDLEN ((CAAM_DESC_BYTES_MAX - DESC_JOB_IO_LEN) / CAAM_CMD_SZ)
4216
4317 /* Length of a single buffer in the QI driver memory cache */
4418 #define CAAM_QI_MEMCACHE_SIZE 768
....@@ -62,7 +36,6 @@
6236 enum optype {
6337 ENCRYPT,
6438 DECRYPT,
65
- GIVENCRYPT,
6639 NUM_OP
6740 };
6841
....@@ -79,6 +52,7 @@
7952 * @context_a: shared descriptor dma address
8053 * @req_fq: to-CAAM request frame queue
8154 * @rsp_fq: from-CAAM response frame queue
55
+ * @refcnt: reference counter incremented for each frame enqueued in to-CAAM FQ
8256 * @cpu: cpu on which to receive CAAM response
8357 * @op_type: operation type
8458 * @qidev: device pointer for CAAM/QI backend
....@@ -89,6 +63,7 @@
8963 dma_addr_t context_a;
9064 struct qman_fq *req_fq;
9165 struct qman_fq *rsp_fq;
66
+ refcount_t refcnt;
9267 int cpu;
9368 enum optype op_type;
9469 struct device *qidev;
....@@ -174,7 +149,6 @@
174149 void caam_drv_ctx_rel(struct caam_drv_ctx *drv_ctx);
175150
176151 int caam_qi_init(struct platform_device *pdev);
177
-void caam_qi_shutdown(struct device *dev);
178152
179153 /**
180154 * qi_cache_alloc - Allocate buffers from CAAM-QI cache