2020-05-27 16:21:28 +01:00
/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only) */
/* Copyright(c) 2014 - 2020 Intel Corporation */
2014-06-05 13:42:58 -07:00
# ifndef ADF_TRANSPORT_INTRN_H
# define ADF_TRANSPORT_INTRN_H
# include <linux/interrupt.h>
# include <linux/spinlock_types.h>
# include "adf_transport.h"
struct adf_etr_ring_debug_entry {
char ring_name [ ADF_CFG_MAX_KEY_LEN_IN_BYTES ] ;
struct dentry * debug ;
} ;
struct adf_etr_ring_data {
void * base_addr ;
atomic_t * inflights ;
adf_callback_fn callback ;
struct adf_etr_bank_data * bank ;
dma_addr_t dma_addr ;
2020-06-03 18:33:46 +01:00
struct adf_etr_ring_debug_entry * ring_debug ;
spinlock_t lock ; /* protects ring data struct */
2020-06-03 18:33:44 +01:00
u16 head ;
u16 tail ;
u8 ring_number ;
u8 ring_size ;
u8 msg_size ;
2020-06-03 18:33:46 +01:00
} ;
2014-06-05 13:42:58 -07:00
struct adf_etr_bank_data {
2020-10-12 21:38:19 +01:00
struct adf_etr_ring_data * rings ;
2014-09-10 14:07:31 -07:00
struct tasklet_struct resp_handler ;
2014-06-05 13:42:58 -07:00
void __iomem * csr_addr ;
2020-06-03 18:33:44 +01:00
u32 irq_coalesc_timer ;
2020-06-03 18:33:46 +01:00
u32 bank_number ;
2020-06-03 18:33:44 +01:00
u16 ring_mask ;
u16 irq_mask ;
2014-06-05 13:42:58 -07:00
spinlock_t lock ; /* protects bank data struct */
2020-06-03 18:33:46 +01:00
struct adf_accel_dev * accel_dev ;
2014-06-05 13:42:58 -07:00
struct dentry * bank_debug_dir ;
struct dentry * bank_debug_cfg ;
2020-06-03 18:33:46 +01:00
} ;
2014-06-05 13:42:58 -07:00
struct adf_etr_data {
struct adf_etr_bank_data * banks ;
struct dentry * debug ;
} ;
2015-12-04 16:56:28 -08:00
void adf_response_handler ( uintptr_t bank_addr ) ;
2014-06-05 13:42:58 -07:00
# ifdef CONFIG_DEBUG_FS
# include <linux/debugfs.h>
int adf_bank_debugfs_add ( struct adf_etr_bank_data * bank ) ;
void adf_bank_debugfs_rm ( struct adf_etr_bank_data * bank ) ;
int adf_ring_debugfs_add ( struct adf_etr_ring_data * ring , const char * name ) ;
void adf_ring_debugfs_rm ( struct adf_etr_ring_data * ring ) ;
# else
static inline int adf_bank_debugfs_add ( struct adf_etr_bank_data * bank )
{
return 0 ;
}
2014-07-25 15:55:15 -07:00
2014-06-05 13:42:58 -07:00
# define adf_bank_debugfs_rm(bank) do {} while (0)
2014-07-25 15:55:15 -07:00
2014-06-05 13:42:58 -07:00
static inline int adf_ring_debugfs_add ( struct adf_etr_ring_data * ring ,
const char * name )
{
return 0 ;
}
2014-07-25 15:55:15 -07:00
2014-06-05 13:42:58 -07:00
# define adf_ring_debugfs_rm(ring) do {} while (0)
# endif
# endif