linux/drivers/scsi/bfa/bfa.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.
 */
#ifndef __BFA_H__
#define __BFA_H__

#include "bfad_drv.h"
#include "bfa_cs.h"
#include "bfa_plog.h"
#include "bfa_defs_svc.h"
#include "bfi.h"
#include "bfa_ioc.h"

struct bfa_s;

bfa_isr_func_t;

/*
 * Interrupt message handlers
 */
void bfa_isr_unhandled(struct bfa_s *bfa, struct bfi_msg_s *m);

/*
 * Request and response queue related defines
 */
#define BFA_REQQ_NELEMS_MIN
#define BFA_RSPQ_NELEMS_MIN

#define bfa_reqq_pi(__bfa, __reqq)
#define bfa_reqq_ci(__bfa, __reqq)

#define bfa_reqq_full(__bfa, __reqq)

#define bfa_reqq_next(__bfa, __reqq)

#define bfa_reqq_produce(__bfa, __reqq, __mh)

#define bfa_rspq_pi(__bfa, __rspq)

#define bfa_rspq_ci(__bfa, __rspq)
#define bfa_rspq_elem(__bfa, __rspq, __ci)

#define CQ_INCR(__index, __size)

/*
 * Circular queue usage assignments
 */
enum {};

static inline void
bfa_reqq_winit(struct bfa_reqq_wait_s *wqe, void (*qresume) (void *cbarg),
	       void *cbarg)
{}

#define bfa_reqq(__bfa, __reqq)

/*
 * static inline void
 * bfa_reqq_wait(struct bfa_s *bfa, int reqq, struct bfa_reqq_wait_s *wqe)
 */
#define bfa_reqq_wait(__bfa, __reqq, __wqe)

#define bfa_reqq_wcancel(__wqe)

#define bfa_cb_queue(__bfa, __hcb_qe, __cbfn, __cbarg)

#define bfa_cb_dequeue(__hcb_qe)

#define bfa_cb_queue_once(__bfa, __hcb_qe, __cbfn, __cbarg)

#define bfa_cb_queue_status(__bfa, __hcb_qe, __status)

#define bfa_cb_queue_done(__hcb_qe)


/*
 * PCI devices supported by the current BFA
 */
struct bfa_pciid_s {};

extern char     bfa_version[];

struct bfa_iocfc_regs_s {};

/*
 * MSIX vector handlers
 */
#define BFA_MSIX_MAX_VECTORS
bfa_msix_handler_t;
struct bfa_msix_s {};

/*
 * Chip specific interfaces
 */
struct bfa_hwif_s {};
bfa_cb_iocfc_t;

struct bfa_faa_cbfn_s {};

#define BFA_FAA_ENABLED
#define BFA_FAA_DISABLED

/*
 *	FAA attributes
 */
struct bfa_faa_attr_s {};

struct bfa_faa_args_s {};

/*
 * IOCFC state machine definitions/declarations
 */
enum iocfc_event {};

struct bfa_iocfc_s;
bfa_iocfs_fsm_t;

struct bfa_iocfc_s {};

#define BFA_MEM_IOC_DMA(_bfa)
#define BFA_MEM_IOCFC_DMA(_bfa)
#define BFA_MEM_REQQ_DMA(_bfa, _qno)
#define BFA_MEM_RSPQ_DMA(_bfa, _qno)
#define BFA_MEM_IOCFC_KVA(_bfa)

#define bfa_fn_lpu(__bfa)
#define bfa_msix_init(__bfa, __nvecs)
#define bfa_msix_ctrl_install(__bfa)
#define bfa_msix_queue_install(__bfa)
#define bfa_msix_uninstall(__bfa)
#define bfa_isr_rspq_ack(__bfa, __queue, __ci)
#define bfa_isr_reqq_ack(__bfa, __queue)
#define bfa_isr_mode_set(__bfa, __msix)
#define bfa_msix_getvecs(__bfa, __vecmap, __nvecs, __maxvec)
#define bfa_msix_get_rme_range(__bfa, __start, __end)
#define bfa_msix(__bfa, __vec)

/*
 * FC specific IOC functions.
 */
void bfa_iocfc_meminfo(struct bfa_iocfc_cfg_s *cfg,
			struct bfa_meminfo_s *meminfo,
			struct bfa_s *bfa);
void bfa_iocfc_attach(struct bfa_s *bfa, void *bfad,
		      struct bfa_iocfc_cfg_s *cfg,
		      struct bfa_pcidev_s *pcidev);
void bfa_iocfc_init(struct bfa_s *bfa);
void bfa_iocfc_start(struct bfa_s *bfa);
void bfa_iocfc_stop(struct bfa_s *bfa);
void bfa_iocfc_isr(void *bfa, struct bfi_mbmsg_s *msg);
void bfa_iocfc_set_snsbase(struct bfa_s *bfa, int seg_no, u64 snsbase_pa);
bfa_boolean_t bfa_iocfc_is_operational(struct bfa_s *bfa);
void bfa_iocfc_reset_queues(struct bfa_s *bfa);

void bfa_msix_all(struct bfa_s *bfa, int vec);
void bfa_msix_reqq(struct bfa_s *bfa, int vec);
void bfa_msix_rspq(struct bfa_s *bfa, int vec);
void bfa_msix_lpu_err(struct bfa_s *bfa, int vec);

void bfa_hwcb_reginit(struct bfa_s *bfa);
void bfa_hwcb_rspq_ack(struct bfa_s *bfa, int rspq, u32 ci);
void bfa_hwcb_msix_init(struct bfa_s *bfa, int nvecs);
void bfa_hwcb_msix_ctrl_install(struct bfa_s *bfa);
void bfa_hwcb_msix_queue_install(struct bfa_s *bfa);
void bfa_hwcb_msix_uninstall(struct bfa_s *bfa);
void bfa_hwcb_isr_mode_set(struct bfa_s *bfa, bfa_boolean_t msix);
void bfa_hwcb_msix_getvecs(struct bfa_s *bfa, u32 *vecmap, u32 *nvecs,
			   u32 *maxvec);
void bfa_hwcb_msix_get_rme_range(struct bfa_s *bfa, u32 *start,
				 u32 *end);
void bfa_hwct_reginit(struct bfa_s *bfa);
void bfa_hwct2_reginit(struct bfa_s *bfa);
void bfa_hwct_reqq_ack(struct bfa_s *bfa, int rspq);
void bfa_hwct_rspq_ack(struct bfa_s *bfa, int rspq, u32 ci);
void bfa_hwct2_rspq_ack(struct bfa_s *bfa, int rspq, u32 ci);
void bfa_hwct_msix_init(struct bfa_s *bfa, int nvecs);
void bfa_hwct_msix_ctrl_install(struct bfa_s *bfa);
void bfa_hwct_msix_queue_install(struct bfa_s *bfa);
void bfa_hwct_msix_uninstall(struct bfa_s *bfa);
void bfa_hwct_isr_mode_set(struct bfa_s *bfa, bfa_boolean_t msix);
void bfa_hwct_msix_getvecs(struct bfa_s *bfa, u32 *vecmap, u32 *nvecs,
			   u32 *maxvec);
void bfa_hwct_msix_get_rme_range(struct bfa_s *bfa, u32 *start,
				 u32 *end);
void bfa_iocfc_get_bootwwns(struct bfa_s *bfa, u8 *nwwns, wwn_t *wwns);
int bfa_iocfc_get_pbc_vports(struct bfa_s *bfa,
				struct bfi_pbc_vport_s *pbc_vport);


/*
 *----------------------------------------------------------------------
 *		BFA public interfaces
 *----------------------------------------------------------------------
 */
#define bfa_stats(_mod, _stats)
#define bfa_ioc_get_stats(__bfa, __ioc_stats)
#define bfa_ioc_clear_stats(__bfa)
#define bfa_get_nports(__bfa)
#define bfa_get_adapter_manufacturer(__bfa, __manufacturer)
#define bfa_get_adapter_model(__bfa, __model)
#define bfa_get_adapter_serial_num(__bfa, __serial_num)
#define bfa_get_adapter_fw_ver(__bfa, __fw_ver)
#define bfa_get_adapter_optrom_ver(__bfa, __optrom_ver)
#define bfa_get_pci_chip_rev(__bfa, __chip_rev)
#define bfa_get_ioc_state(__bfa)
#define bfa_get_type(__bfa)
#define bfa_get_mac(__bfa)
#define bfa_get_mfg_mac(__bfa)
#define bfa_get_fw_clock_res(__bfa)

/*
 * lun mask macros return NULL when min cfg is enabled and there is
 * no memory allocated for lunmask.
 */
#define bfa_get_lun_mask(__bfa)

#define bfa_get_lun_mask_list(_bfa)

#define bfa_get_lun_mask_status(_bfa)

void bfa_get_pciids(struct bfa_pciid_s **pciids, int *npciids);
void bfa_cfg_get_default(struct bfa_iocfc_cfg_s *cfg);
void bfa_cfg_get_min(struct bfa_iocfc_cfg_s *cfg);
void bfa_cfg_get_meminfo(struct bfa_iocfc_cfg_s *cfg,
			struct bfa_meminfo_s *meminfo,
			struct bfa_s *bfa);
void bfa_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
		struct bfa_meminfo_s *meminfo,
		struct bfa_pcidev_s *pcidev);
void bfa_detach(struct bfa_s *bfa);
void bfa_cb_init(void *bfad, bfa_status_t status);
void bfa_cb_updateq(void *bfad, bfa_status_t status);

bfa_boolean_t bfa_intx(struct bfa_s *bfa);
void bfa_isr_enable(struct bfa_s *bfa);
void bfa_isr_disable(struct bfa_s *bfa);

void bfa_comp_deq(struct bfa_s *bfa, struct list_head *comp_q);
void bfa_comp_process(struct bfa_s *bfa, struct list_head *comp_q);
void bfa_comp_free(struct bfa_s *bfa, struct list_head *comp_q);

bfa_cb_ioc_t;
void bfa_iocfc_get_attr(struct bfa_s *bfa, struct bfa_iocfc_attr_s *attr);


bfa_status_t bfa_iocfc_israttr_set(struct bfa_s *bfa,
				   struct bfa_iocfc_intr_attr_s *attr);

void bfa_iocfc_enable(struct bfa_s *bfa);
void bfa_iocfc_disable(struct bfa_s *bfa);
#define bfa_timer_start(_bfa, _timer, _timercb, _arg, _timeout)

struct bfa_cb_pending_q_s {};

/* Common macros to operate on pending stats/attr apis */
#define bfa_pending_q_init(__qe, __cbfn, __cbarg, __data)

#define bfa_pending_q_init_status(__qe, __cbfn, __cbarg, __data)

#endif /* __BFA_H__ */