hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/drivers/crypto/talitos.h
....@@ -1,31 +1,8 @@
1
+/* SPDX-License-Identifier: BSD-3-Clause */
12 /*
23 * Freescale SEC (talitos) device register and descriptor header defines
34 *
45 * Copyright (c) 2006-2011 Freescale Semiconductor, Inc.
5
- *
6
- * Redistribution and use in source and binary forms, with or without
7
- * modification, are permitted provided that the following conditions
8
- * are met:
9
- *
10
- * 1. Redistributions of source code must retain the above copyright
11
- * notice, this list of conditions and the following disclaimer.
12
- * 2. Redistributions in binary form must reproduce the above copyright
13
- * notice, this list of conditions and the following disclaimer in the
14
- * documentation and/or other materials provided with the distribution.
15
- * 3. The name of the author may not be used to endorse or promote products
16
- * derived from this software without specific prior written permission.
17
- *
18
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
- *
296 */
307
318 #define TALITOS_TIMEOUT 100000
....@@ -69,7 +46,6 @@
6946 * talitos_edesc - s/w-extended descriptor
7047 * @src_nents: number of segments in input scatterlist
7148 * @dst_nents: number of segments in output scatterlist
72
- * @icv_ool: whether ICV is out-of-line
7349 * @iv_dma: dma address of iv for checking continuity and link table
7450 * @dma_len: length of dma mapped link_tbl space
7551 * @dma_link_tbl: bus physical address of link_tbl/buf
....@@ -84,7 +60,6 @@
8460 struct talitos_edesc {
8561 int src_nents;
8662 int dst_nents;
87
- bool icv_ool;
8863 dma_addr_t iv_dma;
8964 int dma_len;
9065 dma_addr_t dma_link_tbl;
....@@ -180,12 +155,6 @@
180155 bool rng_registered;
181156 };
182157
183
-extern int talitos_submit(struct device *dev, int ch, struct talitos_desc *desc,
184
- void (*callback)(struct device *dev,
185
- struct talitos_desc *desc,
186
- void *context, int error),
187
- void *context);
188
-
189158 /* .features flag */
190159 #define TALITOS_FTR_SRC_LINK_TBL_LEN_INCLUDES_EXTENT 0x00000001
191160 #define TALITOS_FTR_HW_AUTH_CHECK 0x00000002
....@@ -200,13 +169,11 @@
200169 */
201170 static inline bool has_ftr_sec1(struct talitos_private *priv)
202171 {
203
-#if defined(CONFIG_CRYPTO_DEV_TALITOS1) && defined(CONFIG_CRYPTO_DEV_TALITOS2)
204
- return priv->features & TALITOS_FTR_SEC1 ? true : false;
205
-#elif defined(CONFIG_CRYPTO_DEV_TALITOS1)
206
- return true;
207
-#else
208
- return false;
209
-#endif
172
+ if (IS_ENABLED(CONFIG_CRYPTO_DEV_TALITOS1) &&
173
+ IS_ENABLED(CONFIG_CRYPTO_DEV_TALITOS2))
174
+ return priv->features & TALITOS_FTR_SEC1;
175
+
176
+ return IS_ENABLED(CONFIG_CRYPTO_DEV_TALITOS1);
210177 }
211178
212179 /*