aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/crypto/hisilicon/hpre/hpre.h
diff options
context:
space:
mode:
authorZaibo Xu <xuzaibo@huawei.com>2019-09-30 17:20:08 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2019-10-10 23:36:32 +1100
commit8489741516182d8ac57a69e9f4ca963450607351 (patch)
tree2542de1e324993293c3c2caa6026a71743eefe0c /drivers/crypto/hisilicon/hpre/hpre.h
parentDocumentation: Add debugfs doc for hisi_hpre (diff)
downloadwireguard-linux-8489741516182d8ac57a69e9f4ca963450607351.tar.xz
wireguard-linux-8489741516182d8ac57a69e9f4ca963450607351.zip
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>
Diffstat (limited to 'drivers/crypto/hisilicon/hpre/hpre.h')
-rw-r--r--drivers/crypto/hisilicon/hpre/hpre.h36
1 files changed, 35 insertions, 1 deletions
diff --git a/drivers/crypto/hisilicon/hpre/hpre.h b/drivers/crypto/hisilicon/hpre/hpre.h
index bcf825b12c73..ddf13ea9862a 100644
--- a/drivers/crypto/hisilicon/hpre/hpre.h
+++ b/drivers/crypto/hisilicon/hpre/hpre.h
@@ -9,11 +9,45 @@
#define HPRE_SQE_SIZE sizeof(struct hpre_sqe)
#define HPRE_PF_DEF_Q_NUM 64
#define HPRE_PF_DEF_Q_BASE 0
-#define HPRE_CLUSTERS_NUM 4
+
+enum {
+ HPRE_CLUSTER0,
+ HPRE_CLUSTER1,
+ HPRE_CLUSTER2,
+ HPRE_CLUSTER3,
+ HPRE_CLUSTERS_NUM,
+};
+
+enum hpre_ctrl_dbgfs_file {
+ HPRE_CURRENT_QM,
+ HPRE_CLEAR_ENABLE,
+ HPRE_CLUSTER_CTRL,
+ HPRE_DEBUG_FILE_NUM,
+};
+
+#define HPRE_DEBUGFS_FILE_NUM (HPRE_DEBUG_FILE_NUM + HPRE_CLUSTERS_NUM - 1)
+
+struct hpre_debugfs_file {
+ int index;
+ enum hpre_ctrl_dbgfs_file type;
+ spinlock_t lock;
+ struct hpre_debug *debug;
+};
+
+/*
+ * One HPRE controller has one PF and multiple VFs, some global configurations
+ * which PF has need this structure.
+ * Just relevant for PF.
+ */
+struct hpre_debug {
+ struct dentry *debug_root;
+ struct hpre_debugfs_file files[HPRE_DEBUGFS_FILE_NUM];
+};
struct hpre {
struct hisi_qm qm;
struct list_head list;
+ struct hpre_debug debug;
u32 num_vfs;
unsigned long status;
};