linux/drivers/scsi/bfa/bfad_drv.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2005-2014 Brocade Communications Systems, Inc.
 * Copyright (c) 2014- QLogic Corporation.
 * All rights reserved
 * www.qlogic.com
 *
 * Linux driver for QLogic BR-series Fibre Channel Host Bus Adapter.
 */

/*
 * Contains base driver definitions.
 */

/*
 *  bfa_drv.h Linux driver data structures.
 */

#ifndef __BFAD_DRV_H__
#define __BFAD_DRV_H__

#include <linux/types.h>
#include <linux/pci.h>
#include <linux/dma-mapping.h>
#include <linux/idr.h>
#include <linux/interrupt.h>
#include <linux/cdev.h>
#include <linux/fs.h>
#include <linux/delay.h>
#include <linux/vmalloc.h>
#include <linux/workqueue.h>
#include <linux/bitops.h>
#include <scsi/scsi.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_tcq.h>
#include <scsi/scsi_transport_fc.h>
#include <scsi/scsi_transport.h>
#include <scsi/scsi_bsg_fc.h>
#include <scsi/scsi_devinfo.h>

#include "bfa_modules.h"
#include "bfa_fcs.h"
#include "bfa_defs_fcs.h"

#include "bfa_plog.h"
#include "bfa_cs.h"

#define BFAD_DRIVER_NAME
#ifdef BFA_DRIVER_VERSION
#define BFAD_DRIVER_VERSION
#else
#define BFAD_DRIVER_VERSION
#endif

#define BFAD_PROTO_NAME
#define BFAD_IRQ_FLAGS

#ifndef FC_PORTSPEED_8GBIT
#define FC_PORTSPEED_8GBIT
#endif

/*
 * BFAD flags
 */
#define BFAD_MSIX_ON
#define BFAD_HAL_INIT_DONE
#define BFAD_DRV_INIT_DONE
#define BFAD_CFG_PPORT_DONE
#define BFAD_HAL_START_DONE
#define BFAD_PORT_ONLINE
#define BFAD_RPORT_ONLINE
#define BFAD_FCS_INIT_DONE
#define BFAD_HAL_INIT_FAIL
#define BFAD_FC4_PROBE_DONE
#define BFAD_PORT_DELETE
#define BFAD_INTX_ON
#define BFAD_EEH_BUSY
#define BFAD_EEH_PCI_CHANNEL_IO_PERM_FAILURE
/*
 * BFAD related definition
 */
#define SCSI_SCAN_DELAY
#define BFAD_STOP_TIMEOUT
#define BFAD_SUSPEND_TIMEOUT

/*
 * BFAD configuration parameter default values
 */
#define BFAD_LUN_QUEUE_DEPTH
#define BFAD_IO_MAX_SGE
#define BFAD_MIN_SECTORS
#define BFAD_MAX_SECTORS

#define bfad_isr_t

#define MAX_MSIX_ENTRY

struct bfad_msix_s {};

/*
 * Only append to the enums defined here to avoid any versioning
 * needed between trace utility and driver version
 */
enum {};

enum bfad_port_pvb_type {};

/*
 * PORT data structure
 */
struct bfad_port_s {};

/*
 * VPORT data structure
 */
struct bfad_vport_s {};

/*
 * VF data structure
 */
struct bfad_vf_s {};

struct bfad_cfg_param_s {};

bfad_tmp_buf;

/* BFAD state machine events */
enum bfad_sm_event {};

struct bfad_s;
bfad_sm_t;

/*
 * BFAD (PCI function) data structure
 */
struct bfad_s {};

/*
 * RPORT data structure
 */
struct bfad_rport_s {};

struct bfad_buf_info {};

struct bfad_fcxp {};

struct bfad_hal_comp {};

#define BFA_LOG(level, bfad, mask, fmt, arg...)

bfa_status_t	bfad_vport_create(struct bfad_s *bfad, u16 vf_id,
				  struct bfa_lport_cfg_s *port_cfg,
				  struct device *dev);
bfa_status_t	bfad_vf_create(struct bfad_s *bfad, u16 vf_id,
			       struct bfa_lport_cfg_s *port_cfg);
bfa_status_t	bfad_cfg_pport(struct bfad_s *bfad, enum bfa_lport_role role);
bfa_status_t	bfad_drv_init(struct bfad_s *bfad);
bfa_status_t	bfad_start_ops(struct bfad_s *bfad);
void		bfad_drv_start(struct bfad_s *bfad);
void		bfad_uncfg_pport(struct bfad_s *bfad);
void		bfad_stop(struct bfad_s *bfad);
void		bfad_fcs_stop(struct bfad_s *bfad);
void		bfad_remove_intr(struct bfad_s *bfad);
void		bfad_hal_mem_release(struct bfad_s *bfad);
void		bfad_hcb_comp(void *arg, bfa_status_t status);

int		bfad_setup_intr(struct bfad_s *bfad);
void		bfad_remove_intr(struct bfad_s *bfad);
void		bfad_update_hal_cfg(struct bfa_iocfc_cfg_s *bfa_cfg);
bfa_status_t	bfad_hal_mem_alloc(struct bfad_s *bfad);
void		bfad_bfa_tmo(struct timer_list *t);
void		bfad_init_timer(struct bfad_s *bfad);
int		bfad_pci_init(struct pci_dev *pdev, struct bfad_s *bfad);
void		bfad_pci_uninit(struct pci_dev *pdev, struct bfad_s *bfad);
void		bfad_drv_uninit(struct bfad_s *bfad);
int		bfad_worker(void *ptr);
void		bfad_debugfs_init(struct bfad_port_s *port);
void		bfad_debugfs_exit(struct bfad_port_s *port);

void bfad_pci_remove(struct pci_dev *pdev);
int bfad_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pid);
void bfad_rport_online_wait(struct bfad_s *bfad);
int bfad_get_linkup_delay(struct bfad_s *bfad);
int bfad_install_msix_handler(struct bfad_s *bfad);

extern struct idr bfad_im_port_index;
extern struct pci_device_id bfad_id_table[];
extern struct list_head bfad_list;
extern char	*os_name;
extern char	*os_patch;
extern char	*host_name;
extern int	num_rports;
extern int	num_ios;
extern int	num_tms;
extern int	num_fcxps;
extern int	num_ufbufs;
extern int	reqq_size;
extern int	rspq_size;
extern int	num_sgpgs;
extern int      rport_del_timeout;
extern int      bfa_lun_queue_depth;
extern int      bfa_io_max_sge;
extern int      bfa_log_level;
extern int      ioc_auto_recover;
extern int      bfa_linkup_delay;
extern int      msix_disable_cb;
extern int      msix_disable_ct;
extern int      fdmi_enable;
extern int      supported_fc4s;
extern int	pcie_max_read_reqsz;
extern int	max_xfer_size;
extern int bfa_debugfs_enable;
extern struct mutex bfad_mutex;

#endif /* __BFAD_DRV_H__ */