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
];
15 struct adf_etr_ring_data
{
18 adf_callback_fn callback
;
19 struct adf_etr_bank_data
*bank
;
21 struct adf_etr_ring_debug_entry
*ring_debug
;
22 spinlock_t lock
; /* protects ring data struct */
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
;
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
;
45 struct adf_etr_bank_data
*banks
;
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
);
57 static inline int adf_bank_debugfs_add(struct adf_etr_bank_data
*bank
)
62 #define adf_bank_debugfs_rm(bank) do {} while (0)
64 static inline int adf_ring_debugfs_add(struct adf_etr_ring_data
*ring
,
70 #define adf_ring_debugfs_rm(ring) do {} while (0)