linux/drivers/scsi/bfa/bfi.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 __BFI_H__
#define __BFI_H__

#include "bfa_defs.h"
#include "bfa_defs_svc.h"

#pragma pack(1)

/* Per dma segment max size */
#define BFI_MEM_DMA_SEG_SZ

/* Get number of dma segments required */
#define BFI_MEM_DMA_NSEGS(_num_reqs, _req_sz)

/* Get num dma reqs - that fit in a segment */
#define BFI_MEM_NREQS_SEG(_rqsz)

/* Get segment num from tag */
#define BFI_MEM_SEG_FROM_TAG(_tag, _rqsz)

/* Get dma req offset in a segment */
#define BFI_MEM_SEG_REQ_OFFSET(_tag, _sz)

/*
 * BFI FW image type
 */
#define BFI_FLASH_CHUNK_SZ
#define BFI_FLASH_CHUNK_SZ_WORDS
#define BFI_FLASH_IMAGE_SZ

/*
 * Msg header common to all msgs
 */
struct bfi_mhdr_s {};

#define bfi_fn_lpu(__fn, __lpu)
#define bfi_mhdr_2_fn(_mh)

#define bfi_h2i_set(_mh, _mc, _op, _fn_lpu)

#define bfi_i2h_set(_mh, _mc, _op, _i2htok)

/*
 * Message opcodes: 0-127 to firmware, 128-255 to host
 */
#define BFI_I2H_OPCODE_BASE
#define BFA_I2HM(_x)

/*
 ****************************************************************************
 *
 * Scatter Gather Element and Page definition
 *
 ****************************************************************************
 */

#define BFI_SGE_INLINE
#define BFI_SGE_INLINE_MAX

/*
 * SG Flags
 */
enum {};

/*
 * DMA addresses
 */
bfi_addr_u;

/*
 * Scatter Gather Element used for fast-path IO requests
 */
struct bfi_sge_s {};

/**
 * Generic DMA addr-len pair.
 */
struct bfi_alen_s {};

/*
 * Scatter Gather Page
 */
#define BFI_SGPG_DATA_SGES
#define BFI_SGPG_SGES_MAX
#define BFI_SGPG_RSVD_WD_LEN
struct bfi_sgpg_s {};

/* FCP module definitions */
#define BFI_IO_MAX
#define BFI_IOIM_SNSLEN
#define BFI_IOIM_SNSBUF_SEGS

/*
 * Large Message structure - 128 Bytes size Msgs
 */
#define BFI_LMSG_SZ
#define BFI_LMSG_PL_WSZ

struct bfi_msg_s {};

/*
 * Mailbox message structure
 */
#define BFI_MBMSG_SZ
struct bfi_mbmsg_s {};

/*
 * Supported PCI function class codes (personality)
 */
enum bfi_pcifn_class {};

/*
 * Message Classes
 */
enum bfi_mclass {};

#define BFI_IOC_MAX_CQS
#define BFI_IOC_MAX_CQS_ASIC
#define BFI_IOC_MSGLEN_MAX

/*
 *----------------------------------------------------------------------
 *				IOC
 *----------------------------------------------------------------------
 */

/*
 * Different asic generations
 */
enum bfi_asic_gen {};

enum bfi_asic_mode {};

enum bfi_ioc_h2i_msgs {};

enum bfi_ioc_i2h_msgs {};

/*
 * BFI_IOC_H2I_GETATTR_REQ message
 */
struct bfi_ioc_getattr_req_s {};

#define BFI_IOC_ATTR_UUID_SZ
struct bfi_ioc_attr_s {};

/*
 * BFI_IOC_I2H_GETATTR_REPLY message
 */
struct bfi_ioc_getattr_reply_s {};

/*
 * Firmware memory page offsets
 */
#define BFI_IOC_SMEM_PG0_CB
#define BFI_IOC_SMEM_PG0_CT

/*
 * Firmware statistic offset
 */
#define BFI_IOC_FWSTATS_OFF
#define BFI_IOC_FWSTATS_SZ

/*
 * Firmware trace offset
 */
#define BFI_IOC_TRC_OFF
#define BFI_IOC_TRC_ENTS

#define BFI_IOC_FW_SIGNATURE
#define BFA_IOC_FW_INV_SIGN
#define BFI_IOC_MD5SUM_SZ

struct bfi_ioc_fwver_s {};

struct bfi_ioc_image_hdr_s {};

enum bfi_ioc_img_ver_cmp_e {};

#define BFI_FWBOOT_DEVMODE_OFF
#define BFI_FWBOOT_TYPE_OFF
#define BFI_FWBOOT_ENV_OFF
#define BFI_FWBOOT_DEVMODE(__asic_gen, __asic_mode, __p0_mode, __p1_mode)

enum bfi_fwboot_type {};

#define BFI_FWBOOT_TYPE_NORMAL
#define BFI_FWBOOT_TYPE_MEMTEST
#define BFI_FWBOOT_ENV_OS

enum bfi_port_mode {};

struct bfi_ioc_hbeat_s {};

/*
 * IOC hardware/firmware state
 */
enum bfi_ioc_state {};

#define BFA_IOC_CB_JOIN_SH
#define BFA_IOC_CB_FWSTATE_MASK
#define BFA_IOC_CB_JOIN_MASK

#define BFI_IOC_ENDIAN_SIG

enum {};

#define BFI_ADAPTER_GETP(__prop, __adap_prop)
#define BFI_ADAPTER_SETP(__prop, __val)
#define BFI_ADAPTER_IS_PROTO(__adap_type)
#define BFI_ADAPTER_IS_TTV(__adap_type)
#define BFI_ADAPTER_IS_UNSUPP(__adap_type)
#define BFI_ADAPTER_IS_SPECIAL(__adap_type)

/*
 * BFI_IOC_H2I_ENABLE_REQ & BFI_IOC_H2I_DISABLE_REQ messages
 */
struct bfi_ioc_ctrl_req_s {};
#define bfi_ioc_enable_req_t
#define bfi_ioc_disable_req_t

/*
 * BFI_IOC_I2H_ENABLE_REPLY & BFI_IOC_I2H_DISABLE_REPLY messages
 */
struct bfi_ioc_ctrl_reply_s {};
#define bfi_ioc_enable_reply_t
#define bfi_ioc_disable_reply_t

#define BFI_IOC_MSGSZ
/*
 * H2I Messages
 */
bfi_ioc_h2i_msg_u;

/*
 * I2H Messages
 */
bfi_ioc_i2h_msg_u;


/*
 *----------------------------------------------------------------------
 *				PBC
 *----------------------------------------------------------------------
 */

#define BFI_PBC_MAX_BLUNS
#define BFI_PBC_MAX_VPORTS
#define BFI_PBC_PORT_DISABLED

/*
 * PBC boot lun configuration
 */
struct bfi_pbc_blun_s {};

/*
 * PBC virtual port configuration
 */
struct bfi_pbc_vport_s {};

/*
 * BFI pre-boot configuration information
 */
struct bfi_pbc_s {};

/*
 *----------------------------------------------------------------------
 *				MSGQ
 *----------------------------------------------------------------------
 */
#define BFI_MSGQ_FULL(_q)
#define BFI_MSGQ_EMPTY(_q)
#define BFI_MSGQ_UPDATE_CI(_q)
#define BFI_MSGQ_UPDATE_PI(_q)

/* q_depth must be power of 2 */
#define BFI_MSGQ_FREE_CNT(_q)

enum bfi_msgq_h2i_msgs_e {};

enum bfi_msgq_i2h_msgs_e {};


/* Messages(commands/responsed/AENS will have the following header */
struct bfi_msgq_mhdr_s {};

#define bfi_msgq_mhdr_set(_mh, _mc, _mid, _tok, _enet_id)

/*
 * Mailbox  for messaging interface
 *
*/
#define BFI_MSGQ_CMD_ENTRY_SIZE
#define BFI_MSGQ_RSP_ENTRY_SIZE
#define BFI_MSGQ_MSG_SIZE_MAX

struct bfi_msgq_s {};

/* BFI_ENET_MSGQ_CFG_REQ TBD init or cfg? */
struct bfi_msgq_cfg_req_s {};

/* BFI_ENET_MSGQ_CFG_RSP */
struct bfi_msgq_cfg_rsp_s {};


/* BFI_MSGQ_H2I_DOORBELL */
struct bfi_msgq_h2i_db_s {};

/* BFI_MSGQ_I2H_DOORBELL */
struct bfi_msgq_i2h_db_s {};

#pragma pack()

/* BFI port specific */
#pragma pack(1)

enum bfi_port_h2i {};

enum bfi_port_i2h {};

/*
 * Generic REQ type
 */
struct bfi_port_generic_req_s {};

/*
 * Generic RSP type
 */
struct bfi_port_generic_rsp_s {};

/*
 * BFI_PORT_H2I_GET_STATS_REQ
 */
struct bfi_port_get_stats_req_s {};

bfi_port_h2i_msg_u;

bfi_port_i2h_msg_u;

/*
 *----------------------------------------------------------------------
 *				ABLK
 *----------------------------------------------------------------------
 */
enum bfi_ablk_h2i_msgs_e {};

enum bfi_ablk_i2h_msgs_e {};

/* BFI_ABLK_H2I_QUERY */
struct bfi_ablk_h2i_query_s {};

/* BFI_ABL_H2I_ADPT_CONFIG, BFI_ABLK_H2I_PORT_CONFIG */
struct bfi_ablk_h2i_cfg_req_s {};

/*
 * BFI_ABLK_H2I_PF_CREATE, BFI_ABLK_H2I_PF_DELETE,
 */
struct bfi_ablk_h2i_pf_req_s {};

/* BFI_ABLK_H2I_OPTROM_ENABLE, BFI_ABLK_H2I_OPTROM_DISABLE */
struct bfi_ablk_h2i_optrom_s {};

/*
 * BFI_ABLK_I2H_QUERY
 * BFI_ABLK_I2H_PORT_CONFIG
 * BFI_ABLK_I2H_PF_CREATE
 * BFI_ABLK_I2H_PF_DELETE
 * BFI_ABLK_I2H_PF_UPDATE
 * BFI_ABLK_I2H_OPTROM_ENABLE
 * BFI_ABLK_I2H_OPTROM_DISABLE
 */
struct bfi_ablk_i2h_rsp_s {};


/*
 *	CEE module specific messages
 */

/* Mailbox commands from host to firmware */
enum bfi_cee_h2i_msgs_e {};

enum bfi_cee_i2h_msgs_e {};

/*
 * H2I command structure for resetting the stats
 */
struct bfi_cee_reset_stats_s {};

/*
 * Get configuration  command from host
 */
struct bfi_cee_get_req_s {};

/*
 * Reply message from firmware
 */
struct bfi_cee_get_rsp_s {};

/*
 * Reply message from firmware
 */
struct bfi_cee_stats_rsp_s {};

/* Mailbox message structures from firmware to host	*/
bfi_cee_i2h_msg_u;

/*
 * SFP related
 */

enum bfi_sfp_h2i_e {};

enum bfi_sfp_i2h_e {};

/*
 *	SFP state change notification
 */
struct bfi_sfp_scn_s {};

/*
 *	SFP state
 */
enum bfa_sfp_stat_e {};

/*
 *  SFP memory access type
 */
enum bfi_sfp_mem_e {};

struct bfi_sfp_req_s {};

struct bfi_sfp_rsp_s {};

/*
 *	FLASH module specific
 */
enum bfi_flash_h2i_msgs {};

enum bfi_flash_i2h_msgs {};

/*
 * Flash query request
 */
struct bfi_flash_query_req_s {};

/*
 * Flash erase request
 */
struct bfi_flash_erase_req_s {};

/*
 * Flash write request
 */
struct bfi_flash_write_req_s {};

/*
 * Flash read request
 */
struct bfi_flash_read_req_s {};

/*
 * Flash query response
 */
struct bfi_flash_query_rsp_s {};

/*
 * Flash read response
 */
struct bfi_flash_read_rsp_s {};

/*
 * Flash write response
 */
struct bfi_flash_write_rsp_s {};

/*
 * Flash erase response
 */
struct bfi_flash_erase_rsp_s {};

/*
 * Flash event notification
 */
struct bfi_flash_event_s {};

/*
 *----------------------------------------------------------------------
 *				DIAG
 *----------------------------------------------------------------------
 */
enum bfi_diag_h2i {};

enum bfi_diag_i2h {};

#define BFI_DIAG_MAX_SGES
#define BFI_DIAG_DMA_BUF_SZ
#define BFI_BOOT_MEMTEST_RES_ADDR
#define BFI_BOOT_MEMTEST_RES_SIG

struct bfi_diag_lb_req_s {};

struct bfi_diag_lb_rsp_s {};

struct bfi_diag_fwping_req_s {};

struct bfi_diag_fwping_rsp_s {};

/*
 * Temperature Sensor
 */
struct bfi_diag_ts_req_s {};
#define bfi_diag_ts_rsp_t

struct bfi_diag_ledtest_req_s {};

/* notify host led operation is done */
struct bfi_diag_ledtest_rsp_s {};

struct bfi_diag_portbeacon_req_s {};

/* notify host the beacon is off */
struct bfi_diag_portbeacon_rsp_s {};

struct bfi_diag_qtest_req_s {};
#define bfi_diag_qtest_rsp_t

/*
 *	D-port test
 */
enum bfi_dport_req {};

enum bfi_dport_scn {};

struct bfi_diag_dport_req_s {};

struct bfi_diag_dport_rsp_s {};

struct bfi_diag_dport_scn_teststart_s {};

struct bfi_diag_dport_scn_testcomp_s {};

struct bfi_diag_dport_scn_s {};

bfi_diag_dport_msg_u;

/*
 *	PHY module specific
 */
enum bfi_phy_h2i_msgs_e {};

enum bfi_phy_i2h_msgs_e {};

/*
 * External PHY query request
 */
struct bfi_phy_query_req_s {};

/*
 * External PHY stats request
 */
struct bfi_phy_stats_req_s {};

/*
 * External PHY write request
 */
struct bfi_phy_write_req_s {};

/*
 * External PHY read request
 */
struct bfi_phy_read_req_s {};

/*
 * External PHY query response
 */
struct bfi_phy_query_rsp_s {};

/*
 * External PHY stats response
 */
struct bfi_phy_stats_rsp_s {};

/*
 * External PHY read response
 */
struct bfi_phy_read_rsp_s {};

/*
 * External PHY write response
 */
struct bfi_phy_write_rsp_s {};

enum bfi_fru_h2i_msgs {};

enum bfi_fru_i2h_msgs {};

/*
 * FRU write request
 */
struct bfi_fru_write_req_s {};

/*
 * FRU read request
 */
struct bfi_fru_read_req_s {};

/*
 * FRU response
 */
struct bfi_fru_rsp_s {};
#pragma pack()

#endif /* __BFI_H__ */