Skip to content

Commit 8489741

Browse files
zaiboxuherbertx
authored andcommitted
crypto: hisilicon - Add debugfs for HPRE
HiSilicon HPRE engine driver uses debugfs to provide debug information, the usage can be found in /Documentation/ABI/testing/debugfs-hisi-hpre. Signed-off-by: Zaibo Xu <xuzaibo@huawei.com> Signed-off-by: Hui Tang <tanghui20@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent b492f82 commit 8489741

File tree

2 files changed

+460
-2
lines changed

2 files changed

+460
-2
lines changed

drivers/crypto/hisilicon/hpre/hpre.h

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,45 @@
99
#define HPRE_SQE_SIZE sizeof(struct hpre_sqe)
1010
#define HPRE_PF_DEF_Q_NUM 64
1111
#define HPRE_PF_DEF_Q_BASE 0
12-
#define HPRE_CLUSTERS_NUM 4
12+
13+
enum {
14+
HPRE_CLUSTER0,
15+
HPRE_CLUSTER1,
16+
HPRE_CLUSTER2,
17+
HPRE_CLUSTER3,
18+
HPRE_CLUSTERS_NUM,
19+
};
20+
21+
enum hpre_ctrl_dbgfs_file {
22+
HPRE_CURRENT_QM,
23+
HPRE_CLEAR_ENABLE,
24+
HPRE_CLUSTER_CTRL,
25+
HPRE_DEBUG_FILE_NUM,
26+
};
27+
28+
#define HPRE_DEBUGFS_FILE_NUM (HPRE_DEBUG_FILE_NUM + HPRE_CLUSTERS_NUM - 1)
29+
30+
struct hpre_debugfs_file {
31+
int index;
32+
enum hpre_ctrl_dbgfs_file type;
33+
spinlock_t lock;
34+
struct hpre_debug *debug;
35+
};
36+
37+
/*
38+
* One HPRE controller has one PF and multiple VFs, some global configurations
39+
* which PF has need this structure.
40+
* Just relevant for PF.
41+
*/
42+
struct hpre_debug {
43+
struct dentry *debug_root;
44+
struct hpre_debugfs_file files[HPRE_DEBUGFS_FILE_NUM];
45+
};
1346

1447
struct hpre {
1548
struct hisi_qm qm;
1649
struct list_head list;
50+
struct hpre_debug debug;
1751
u32 num_vfs;
1852
unsigned long status;
1953
};

0 commit comments

Comments
 (0)