| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /** |
|---|
| 2 | 3 | * debugfs routines supporting the Power 7+ Nest Accelerators driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2011-2012 International Business Machines Inc. |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 8 | | - * the Free Software Foundation; version 2 only. |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 11 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 13 | | - * GNU General Public License for more details. |
|---|
| 14 | | - * |
|---|
| 15 | | - * You should have received a copy of the GNU General Public License |
|---|
| 16 | | - * along with this program; if not, write to the Free Software |
|---|
| 17 | | - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|---|
| 18 | 6 | * |
|---|
| 19 | 7 | * Author: Kent Yoder <yoder1@us.ibm.com> |
|---|
| 20 | 8 | */ |
|---|
| .. | .. |
|---|
| 42 | 30 | * Documentation/ABI/testing/debugfs-pfo-nx-crypto |
|---|
| 43 | 31 | */ |
|---|
| 44 | 32 | |
|---|
| 45 | | -int nx_debugfs_init(struct nx_crypto_driver *drv) |
|---|
| 33 | +void nx_debugfs_init(struct nx_crypto_driver *drv) |
|---|
| 46 | 34 | { |
|---|
| 47 | | - struct nx_debugfs *dfs = &drv->dfs; |
|---|
| 35 | + struct dentry *root; |
|---|
| 48 | 36 | |
|---|
| 49 | | - dfs->dfs_root = debugfs_create_dir(NX_NAME, NULL); |
|---|
| 37 | + root = debugfs_create_dir(NX_NAME, NULL); |
|---|
| 38 | + drv->dfs_root = root; |
|---|
| 50 | 39 | |
|---|
| 51 | | - dfs->dfs_aes_ops = |
|---|
| 52 | | - debugfs_create_u32("aes_ops", |
|---|
| 53 | | - S_IRUSR | S_IRGRP | S_IROTH, |
|---|
| 54 | | - dfs->dfs_root, (u32 *)&drv->stats.aes_ops); |
|---|
| 55 | | - dfs->dfs_sha256_ops = |
|---|
| 56 | | - debugfs_create_u32("sha256_ops", |
|---|
| 57 | | - S_IRUSR | S_IRGRP | S_IROTH, |
|---|
| 58 | | - dfs->dfs_root, |
|---|
| 59 | | - (u32 *)&drv->stats.sha256_ops); |
|---|
| 60 | | - dfs->dfs_sha512_ops = |
|---|
| 61 | | - debugfs_create_u32("sha512_ops", |
|---|
| 62 | | - S_IRUSR | S_IRGRP | S_IROTH, |
|---|
| 63 | | - dfs->dfs_root, |
|---|
| 64 | | - (u32 *)&drv->stats.sha512_ops); |
|---|
| 65 | | - dfs->dfs_aes_bytes = |
|---|
| 66 | | - debugfs_create_u64("aes_bytes", |
|---|
| 67 | | - S_IRUSR | S_IRGRP | S_IROTH, |
|---|
| 68 | | - dfs->dfs_root, |
|---|
| 69 | | - (u64 *)&drv->stats.aes_bytes); |
|---|
| 70 | | - dfs->dfs_sha256_bytes = |
|---|
| 71 | | - debugfs_create_u64("sha256_bytes", |
|---|
| 72 | | - S_IRUSR | S_IRGRP | S_IROTH, |
|---|
| 73 | | - dfs->dfs_root, |
|---|
| 74 | | - (u64 *)&drv->stats.sha256_bytes); |
|---|
| 75 | | - dfs->dfs_sha512_bytes = |
|---|
| 76 | | - debugfs_create_u64("sha512_bytes", |
|---|
| 77 | | - S_IRUSR | S_IRGRP | S_IROTH, |
|---|
| 78 | | - dfs->dfs_root, |
|---|
| 79 | | - (u64 *)&drv->stats.sha512_bytes); |
|---|
| 80 | | - dfs->dfs_errors = |
|---|
| 81 | | - debugfs_create_u32("errors", |
|---|
| 82 | | - S_IRUSR | S_IRGRP | S_IROTH, |
|---|
| 83 | | - dfs->dfs_root, (u32 *)&drv->stats.errors); |
|---|
| 84 | | - dfs->dfs_last_error = |
|---|
| 85 | | - debugfs_create_u32("last_error", |
|---|
| 86 | | - S_IRUSR | S_IRGRP | S_IROTH, |
|---|
| 87 | | - dfs->dfs_root, |
|---|
| 88 | | - (u32 *)&drv->stats.last_error); |
|---|
| 89 | | - dfs->dfs_last_error_pid = |
|---|
| 90 | | - debugfs_create_u32("last_error_pid", |
|---|
| 91 | | - S_IRUSR | S_IRGRP | S_IROTH, |
|---|
| 92 | | - dfs->dfs_root, |
|---|
| 93 | | - (u32 *)&drv->stats.last_error_pid); |
|---|
| 94 | | - return 0; |
|---|
| 40 | + debugfs_create_u32("aes_ops", S_IRUSR | S_IRGRP | S_IROTH, |
|---|
| 41 | + root, &drv->stats.aes_ops.counter); |
|---|
| 42 | + debugfs_create_u32("sha256_ops", S_IRUSR | S_IRGRP | S_IROTH, |
|---|
| 43 | + root, &drv->stats.sha256_ops.counter); |
|---|
| 44 | + debugfs_create_u32("sha512_ops", S_IRUSR | S_IRGRP | S_IROTH, |
|---|
| 45 | + root, &drv->stats.sha512_ops.counter); |
|---|
| 46 | + debugfs_create_u64("aes_bytes", S_IRUSR | S_IRGRP | S_IROTH, |
|---|
| 47 | + root, &drv->stats.aes_bytes.counter); |
|---|
| 48 | + debugfs_create_u64("sha256_bytes", S_IRUSR | S_IRGRP | S_IROTH, |
|---|
| 49 | + root, &drv->stats.sha256_bytes.counter); |
|---|
| 50 | + debugfs_create_u64("sha512_bytes", S_IRUSR | S_IRGRP | S_IROTH, |
|---|
| 51 | + root, &drv->stats.sha512_bytes.counter); |
|---|
| 52 | + debugfs_create_u32("errors", S_IRUSR | S_IRGRP | S_IROTH, |
|---|
| 53 | + root, &drv->stats.errors.counter); |
|---|
| 54 | + debugfs_create_u32("last_error", S_IRUSR | S_IRGRP | S_IROTH, |
|---|
| 55 | + root, &drv->stats.last_error.counter); |
|---|
| 56 | + debugfs_create_u32("last_error_pid", S_IRUSR | S_IRGRP | S_IROTH, |
|---|
| 57 | + root, &drv->stats.last_error_pid.counter); |
|---|
| 95 | 58 | } |
|---|
| 96 | 59 | |
|---|
| 97 | 60 | void |
|---|
| 98 | 61 | nx_debugfs_fini(struct nx_crypto_driver *drv) |
|---|
| 99 | 62 | { |
|---|
| 100 | | - debugfs_remove_recursive(drv->dfs.dfs_root); |
|---|
| 63 | + debugfs_remove_recursive(drv->dfs_root); |
|---|
| 101 | 64 | } |
|---|
| 102 | 65 | |
|---|
| 103 | 66 | #endif |
|---|