nx.h (498495dba268b20e8eadd7fe93c140c68b6cc9d2) nx.h (576d152ccc56574475faa7460d4b507e8440e9aa)
1/* SPDX-License-Identifier: GPL-2.0 */
2
3#ifndef __NX_H__
4#define __NX_H__
5
6#include <crypto/ctr.h>
7
8#define NX_NAME "nx-crypto"

--- 62 unchanged lines hidden (view full) ---

71
72 atomic_t sync_ops;
73
74 atomic_t errors;
75 atomic_t last_error;
76 atomic_t last_error_pid;
77};
78
1/* SPDX-License-Identifier: GPL-2.0 */
2
3#ifndef __NX_H__
4#define __NX_H__
5
6#include <crypto/ctr.h>
7
8#define NX_NAME "nx-crypto"

--- 62 unchanged lines hidden (view full) ---

71
72 atomic_t sync_ops;
73
74 atomic_t errors;
75 atomic_t last_error;
76 atomic_t last_error_pid;
77};
78
79struct nx_debugfs {
80 struct dentry *dfs_root;
81 struct dentry *dfs_aes_ops, *dfs_aes_bytes;
82 struct dentry *dfs_sha256_ops, *dfs_sha256_bytes;
83 struct dentry *dfs_sha512_ops, *dfs_sha512_bytes;
84 struct dentry *dfs_errors, *dfs_last_error, *dfs_last_error_pid;
85};
86
87struct nx_crypto_driver {
88 struct nx_stats stats;
89 struct nx_of of;
90 struct vio_dev *viodev;
91 struct vio_driver viodriver;
79struct nx_crypto_driver {
80 struct nx_stats stats;
81 struct nx_of of;
82 struct vio_dev *viodev;
83 struct vio_driver viodriver;
92 struct nx_debugfs dfs;
84 struct dentry *dfs_root;
93};
94
95#define NX_GCM4106_NONCE_LEN (4)
96#define NX_GCM_CTR_OFFSET (12)
97struct nx_gcm_rctx {
98 u8 iv[16];
99};
100

--- 71 unchanged lines hidden (view full) ---

172struct nx_sg *nx_walk_and_build(struct nx_sg *, unsigned int,
173 struct scatterlist *, unsigned int,
174 unsigned int *);
175
176#ifdef CONFIG_DEBUG_FS
177#define NX_DEBUGFS_INIT(drv) nx_debugfs_init(drv)
178#define NX_DEBUGFS_FINI(drv) nx_debugfs_fini(drv)
179
85};
86
87#define NX_GCM4106_NONCE_LEN (4)
88#define NX_GCM_CTR_OFFSET (12)
89struct nx_gcm_rctx {
90 u8 iv[16];
91};
92

--- 71 unchanged lines hidden (view full) ---

164struct nx_sg *nx_walk_and_build(struct nx_sg *, unsigned int,
165 struct scatterlist *, unsigned int,
166 unsigned int *);
167
168#ifdef CONFIG_DEBUG_FS
169#define NX_DEBUGFS_INIT(drv) nx_debugfs_init(drv)
170#define NX_DEBUGFS_FINI(drv) nx_debugfs_fini(drv)
171
180int nx_debugfs_init(struct nx_crypto_driver *);
172void nx_debugfs_init(struct nx_crypto_driver *);
181void nx_debugfs_fini(struct nx_crypto_driver *);
182#else
183#define NX_DEBUGFS_INIT(drv) (0)
184#define NX_DEBUGFS_FINI(drv) (0)
185#endif
186
187#define NX_PAGE_NUM(x) ((u64)(x) & 0xfffffffffffff000ULL)
188

--- 17 unchanged lines hidden ---
173void nx_debugfs_fini(struct nx_crypto_driver *);
174#else
175#define NX_DEBUGFS_INIT(drv) (0)
176#define NX_DEBUGFS_FINI(drv) (0)
177#endif
178
179#define NX_PAGE_NUM(x) ((u64)(x) & 0xfffffffffffff000ULL)
180

--- 17 unchanged lines hidden ---