.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
---|
1 | 2 | /** |
---|
2 | 3 | * AMCC SoC PPC4xx Crypto Driver |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (c) 2008 Applied Micro Circuits Corporation. |
---|
5 | 6 | * 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. |
---|
16 | 7 | * |
---|
17 | 8 | * This is the header file for AMCC Crypto offload Linux device driver for |
---|
18 | 9 | * use with Linux CryptoAPI. |
---|
.. | .. |
---|
23 | 14 | #define __CRYPTO4XX_CORE_H__ |
---|
24 | 15 | |
---|
25 | 16 | #include <linux/ratelimit.h> |
---|
| 17 | +#include <linux/mutex.h> |
---|
| 18 | +#include <linux/scatterlist.h> |
---|
26 | 19 | #include <crypto/internal/hash.h> |
---|
27 | 20 | #include <crypto/internal/aead.h> |
---|
| 21 | +#include <crypto/internal/rng.h> |
---|
28 | 22 | #include <crypto/internal/skcipher.h> |
---|
29 | 23 | #include "crypto4xx_reg_def.h" |
---|
30 | 24 | #include "crypto4xx_sa.h" |
---|
.. | .. |
---|
62 | 56 | struct pd_uinfo { |
---|
63 | 57 | struct crypto4xx_device *dev; |
---|
64 | 58 | u32 state; |
---|
65 | | - u32 using_sd; |
---|
66 | 59 | u32 first_gd; /* first gather discriptor |
---|
67 | 60 | used by this packet */ |
---|
68 | 61 | u32 num_gd; /* number of gather discriptor |
---|
.. | .. |
---|
119 | 112 | u32 irq; |
---|
120 | 113 | struct tasklet_struct tasklet; |
---|
121 | 114 | spinlock_t lock; |
---|
| 115 | + struct mutex rng_lock; |
---|
122 | 116 | }; |
---|
123 | 117 | |
---|
124 | 118 | struct crypto4xx_ctx { |
---|
.. | .. |
---|
128 | 122 | __le32 iv_nonce; |
---|
129 | 123 | u32 sa_len; |
---|
130 | 124 | union { |
---|
131 | | - struct crypto_skcipher *cipher; |
---|
| 125 | + struct crypto_sync_skcipher *cipher; |
---|
132 | 126 | struct crypto_aead *aead; |
---|
133 | 127 | } sw_cipher; |
---|
134 | 128 | }; |
---|
.. | .. |
---|
143 | 137 | struct skcipher_alg cipher; |
---|
144 | 138 | struct ahash_alg hash; |
---|
145 | 139 | struct aead_alg aead; |
---|
| 140 | + struct rng_alg rng; |
---|
146 | 141 | } u; |
---|
147 | 142 | }; |
---|
148 | 143 | |
---|