Merge tag 'regmap-fix-v5.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux/fpc-iii.git] / drivers / crypto / qat / qat_common / adf_transport_internal.h
blob501bcf0f1809afb34be0633cf0edd4c63d7ee608
1 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only) */
2 /* Copyright(c) 2014 - 2020 Intel Corporation */
3 #ifndef ADF_TRANSPORT_INTRN_H
4 #define ADF_TRANSPORT_INTRN_H
6 #include <linux/interrupt.h>
7 #include <linux/spinlock_types.h>
8 #include "adf_transport.h"
10 struct adf_etr_ring_debug_entry {
11 char ring_name[ADF_CFG_MAX_KEY_LEN_IN_BYTES];
12 struct dentry *debug;
15 struct adf_etr_ring_data {
16 void *base_addr;
17 atomic_t *inflights;
18 adf_callback_fn callback;
19 struct adf_etr_bank_data *bank;
20 dma_addr_t dma_addr;
21 struct adf_etr_ring_debug_entry *ring_debug;
22 spinlock_t lock; /* protects ring data struct */
23 u16 head;
24 u16 tail;
25 u8 ring_number;
26 u8 ring_size;
27 u8 msg_size;
30 struct adf_etr_bank_data {
31 struct adf_etr_ring_data *rings;
32 struct tasklet_struct resp_handler;
33 void __iomem *csr_addr;
34 u32 irq_coalesc_timer;
35 u32 bank_number;
36 u16 ring_mask;
37 u16 irq_mask;
38 spinlock_t lock; /* protects bank data struct */
39 struct adf_accel_dev *accel_dev;
40 struct dentry *bank_debug_dir;
41 struct dentry *bank_debug_cfg;
44 struct adf_etr_data {
45 struct adf_etr_bank_data *banks;
46 struct dentry *debug;
49 void adf_response_handler(uintptr_t bank_addr);
50 #ifdef CONFIG_DEBUG_FS
51 #include <linux/debugfs.h>
52 int adf_bank_debugfs_add(struct adf_etr_bank_data *bank);
53 void adf_bank_debugfs_rm(struct adf_etr_bank_data *bank);
54 int adf_ring_debugfs_add(struct adf_etr_ring_data *ring, const char *name);
55 void adf_ring_debugfs_rm(struct adf_etr_ring_data *ring);
56 #else
57 static inline int adf_bank_debugfs_add(struct adf_etr_bank_data *bank)
59 return 0;
62 #define adf_bank_debugfs_rm(bank) do {} while (0)
64 static inline int adf_ring_debugfs_add(struct adf_etr_ring_data *ring,
65 const char *name)
67 return 0;
70 #define adf_ring_debugfs_rm(ring) do {} while (0)
71 #endif
72 #endif