hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/drivers/crypto/amcc/crypto4xx_core.h
....@@ -1,18 +1,9 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /**
23 * AMCC SoC PPC4xx Crypto Driver
34 *
45 * Copyright (c) 2008 Applied Micro Circuits Corporation.
56 * All rights reserved. James Hsiao <jhsiao@amcc.com>
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License as published by
9
- * the Free Software Foundation; either version 2 of the License, or
10
- * (at your option) any later version.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
167 *
178 * This is the header file for AMCC Crypto offload Linux device driver for
189 * use with Linux CryptoAPI.
....@@ -23,8 +14,11 @@
2314 #define __CRYPTO4XX_CORE_H__
2415
2516 #include <linux/ratelimit.h>
17
+#include <linux/mutex.h>
18
+#include <linux/scatterlist.h>
2619 #include <crypto/internal/hash.h>
2720 #include <crypto/internal/aead.h>
21
+#include <crypto/internal/rng.h>
2822 #include <crypto/internal/skcipher.h>
2923 #include "crypto4xx_reg_def.h"
3024 #include "crypto4xx_sa.h"
....@@ -62,7 +56,6 @@
6256 struct pd_uinfo {
6357 struct crypto4xx_device *dev;
6458 u32 state;
65
- u32 using_sd;
6659 u32 first_gd; /* first gather discriptor
6760 used by this packet */
6861 u32 num_gd; /* number of gather discriptor
....@@ -119,6 +112,7 @@
119112 u32 irq;
120113 struct tasklet_struct tasklet;
121114 spinlock_t lock;
115
+ struct mutex rng_lock;
122116 };
123117
124118 struct crypto4xx_ctx {
....@@ -128,7 +122,7 @@
128122 __le32 iv_nonce;
129123 u32 sa_len;
130124 union {
131
- struct crypto_skcipher *cipher;
125
+ struct crypto_sync_skcipher *cipher;
132126 struct crypto_aead *aead;
133127 } sw_cipher;
134128 };
....@@ -143,6 +137,7 @@
143137 struct skcipher_alg cipher;
144138 struct ahash_alg hash;
145139 struct aead_alg aead;
140
+ struct rng_alg rng;
146141 } u;
147142 };
148143