linux/drivers/scsi/qla4xxx/ql4_def.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * QLogic iSCSI HBA Driver
 * Copyright (c)  2003-2013 QLogic Corporation
 */

#ifndef __QL4_DEF_H
#define __QL4_DEF_H

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/list.h>
#include <linux/pci.h>
#include <linux/dma-mapping.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/dmapool.h>
#include <linux/mempool.h>
#include <linux/spinlock.h>
#include <linux/workqueue.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/mutex.h>
#include <linux/bsg-lib.h>
#include <linux/vmalloc.h>

#include <net/tcp.h>
#include <scsi/scsi.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_transport.h>
#include <scsi/scsi_transport_iscsi.h>
#include <scsi/scsi_bsg_iscsi.h>
#include <scsi/scsi_netlink.h>
#include <scsi/libiscsi.h>

#include "ql4_dbg.h"
#include "ql4_nx.h"
#include "ql4_fw.h"
#include "ql4_nvram.h"
#include "ql4_83xx.h"

#ifndef PCI_DEVICE_ID_QLOGIC_ISP4010
#define PCI_DEVICE_ID_QLOGIC_ISP4010
#endif

#ifndef PCI_DEVICE_ID_QLOGIC_ISP4022
#define PCI_DEVICE_ID_QLOGIC_ISP4022
#endif

#ifndef PCI_DEVICE_ID_QLOGIC_ISP4032
#define PCI_DEVICE_ID_QLOGIC_ISP4032
#endif

#ifndef PCI_DEVICE_ID_QLOGIC_ISP8022
#define PCI_DEVICE_ID_QLOGIC_ISP8022
#endif

#ifndef PCI_DEVICE_ID_QLOGIC_ISP8324
#define PCI_DEVICE_ID_QLOGIC_ISP8324
#endif

#ifndef PCI_DEVICE_ID_QLOGIC_ISP8042
#define PCI_DEVICE_ID_QLOGIC_ISP8042
#endif

#define ISP4XXX_PCI_FN_1
#define ISP4XXX_PCI_FN_2

#define QLA_SUCCESS
#define QLA_ERROR
#define STATUS(status)

/*
 * Data bit definitions
 */
#define BIT_0
#define BIT_1
#define BIT_2
#define BIT_3
#define BIT_4
#define BIT_5
#define BIT_6
#define BIT_7
#define BIT_8
#define BIT_9
#define BIT_10
#define BIT_11
#define BIT_12
#define BIT_13
#define BIT_14
#define BIT_15
#define BIT_16
#define BIT_17
#define BIT_18
#define BIT_19
#define BIT_20
#define BIT_21
#define BIT_22
#define BIT_23
#define BIT_24
#define BIT_25
#define BIT_26
#define BIT_27
#define BIT_28
#define BIT_29
#define BIT_30
#define BIT_31

/**
 * Macros to help code, maintain, etc.
 **/
#define ql4_printk(level, ha, format, arg...)


/*
 * Host adapter default definitions
 ***********************************/
#define MAX_HBAS
#define MAX_BUSES
#define MAX_TARGETS
#define MAX_LUNS
#define MAX_AEN_ENTRIES
#define MAX_DDB_ENTRIES
#define MAX_PDU_ENTRIES
#define INVALID_ENTRY
#define MAX_CMDS_TO_RISC
#define MAX_SRBS
#define MBOX_AEN_REG_COUNT
#define MAX_INIT_RETRIES

/*
 * Buffer sizes
 */
#define REQUEST_QUEUE_DEPTH
#define RESPONSE_QUEUE_DEPTH
#define QUEUE_SIZE
#define DMA_BUFFER_SIZE
#define IOCB_HIWAT_CUSHION

/*
 * Misc
 */
#define MAC_ADDR_LEN
#define IP_ADDR_LEN
#define IPv6_ADDR_LEN
#define DRIVER_NAME

#define MAX_LINKED_CMDS_PER_LUN
#define MAX_REQS_SERVICED_PER_INTR

#define ISCSI_IPADDR_SIZE
#define ISCSI_ALIAS_SIZE
#define ISCSI_NAME_SIZE

#define QL4_SESS_RECOVERY_TMO
						/* recovery timeout */

#define LSDW(x)
#define MSDW(x)

#define DEV_DB_NON_PERSISTENT
#define DEV_DB_PERSISTENT

#define QL4_ISP_REG_DISCONNECT

#define COPY_ISID(dst_isid, src_isid)

#define SET_BITVAL(o, n, v)

#define OP_STATE(o, f, p)

/*
 * Retry & Timeout Values
 */
#define MBOX_TOV
#define SOFT_RESET_TOV
#define RESET_INTR_TOV
#define SEMAPHORE_TOV
#define ADAPTER_INIT_TOV
#define ADAPTER_RESET_TOV
#define EXTEND_CMD_TOV
#define WAIT_CMD_TOV
#define EH_WAIT_CMD_TOV
#define FIRMWARE_UP_TOV
#define RESET_FIRMWARE_TOV
#define LOGOUT_TOV
#define IOCB_TOV_MARGIN
#define RELOGIN_TOV
#define ISNS_DEREG_TOV
#define HBA_ONLINE_TOV
#define DISABLE_ACB_TOV
#define IP_CONFIG_TOV
#define LOGIN_TOV
#define BOOT_LOGIN_RESP_TOV

#define MAX_RESET_HA_RETRIES
#define FW_ALIVE_WAIT_TOV
#define IDC_EXTEND_TOV
#define IDC_COMP_TOV
#define LINK_UP_COMP_TOV

/*
 * Note: the data structure below does not have a struct iscsi_cmd member since
 * the qla4xxx driver does not use libiscsi for SCSI I/O.
 */
struct qla4xxx_cmd_priv {};

static inline struct qla4xxx_cmd_priv *qla4xxx_cmd_priv(struct scsi_cmnd *cmd)
{}

/*
 * SCSI Request Block structure (srb) that is associated with each scsi_cmnd.
 */
struct srb {};

/* Mailbox request block structure */
struct mrb {};

/*
 * Asynchronous Event Queue structure
 */
struct aen {};

struct ql4_aen_log {};

/*
 * Device Database (DDB) structure
 */
struct ddb_entry {};

struct qla_ddb_index {};

#define DDB_IPADDR_LEN

struct ql4_tuple_ddb {};

/*
 * DDB states.
 */
#define DDB_STATE_DEAD
#define DDB_STATE_ONLINE
#define DDB_STATE_MISSING

/*
 * DDB flags.
 */
#define DF_RELOGIN
#define DF_BOOT_TGT
#define DF_ISNS_DISCOVERED
#define DF_FO_MASKED
#define DF_DISABLE_RELOGIN

enum qla4_work_type {};

struct qla4_work_evt {};

struct ql82xx_hw_data {};

struct qla4_8xxx_legacy_intr_set {};

/* MSI-X Support */
#define QLA_MSIX_ENTRIES

/*
 * ISP Operations
 */
struct isp_operations {};

struct ql4_mdump_size_table {};

/*qla4xxx ipaddress configuration details */
struct ipaddress_config {};

#define QL4_CHAP_MAX_NAME_LEN
#define QL4_CHAP_MAX_SECRET_LEN
#define LOCAL_CHAP
#define BIDI_CHAP

struct ql4_chap_format {};

struct ip_address_format {};

struct	ql4_conn_info {};

struct ql4_boot_session_info {};

struct ql4_boot_tgt_info {};

/*
 * Linux Host Adapter structure
 */
struct scsi_qla_host {};

struct ql4_task_data {};

struct qla_endpoint {};

struct qla_conn {};

static inline int is_ipv4_enabled(struct scsi_qla_host *ha)
{}

static inline int is_ipv6_enabled(struct scsi_qla_host *ha)
{}

static inline int is_qla4010(struct scsi_qla_host *ha)
{}

static inline int is_qla4022(struct scsi_qla_host *ha)
{}

static inline int is_qla4032(struct scsi_qla_host *ha)
{}

static inline int is_qla40XX(struct scsi_qla_host *ha)
{}

static inline int is_qla8022(struct scsi_qla_host *ha)
{}

static inline int is_qla8032(struct scsi_qla_host *ha)
{}

static inline int is_qla8042(struct scsi_qla_host *ha)
{}

static inline int is_qla80XX(struct scsi_qla_host *ha)
{}

static inline int is_aer_supported(struct scsi_qla_host *ha)
{}

static inline int adapter_up(struct scsi_qla_host *ha)
{}

static inline struct scsi_qla_host* to_qla_host(struct Scsi_Host *shost)
{}

static inline void __iomem* isp_semaphore(struct scsi_qla_host *ha)
{}

static inline void __iomem* isp_nvram(struct scsi_qla_host *ha)
{}

static inline void __iomem* isp_ext_hw_conf(struct scsi_qla_host *ha)
{}

static inline void __iomem* isp_port_status(struct scsi_qla_host *ha)
{}

static inline void __iomem* isp_port_ctrl(struct scsi_qla_host *ha)
{}

static inline void __iomem* isp_port_error_status(struct scsi_qla_host *ha)
{}

static inline void __iomem * isp_gp_out(struct scsi_qla_host *ha)
{}

static inline int eeprom_ext_hw_conf_offset(struct scsi_qla_host *ha)
{}

int ql4xxx_sem_spinlock(struct scsi_qla_host * ha, u32 sem_mask, u32 sem_bits);
void ql4xxx_sem_unlock(struct scsi_qla_host * ha, u32 sem_mask);
int ql4xxx_sem_lock(struct scsi_qla_host * ha, u32 sem_mask, u32 sem_bits);

static inline int ql4xxx_lock_flash(struct scsi_qla_host *a)
{}

static inline void ql4xxx_unlock_flash(struct scsi_qla_host *a)
{}

static inline int ql4xxx_lock_nvram(struct scsi_qla_host *a)
{}

static inline void ql4xxx_unlock_nvram(struct scsi_qla_host *a)
{}

static inline int ql4xxx_lock_drvr(struct scsi_qla_host *a)
{}

static inline void ql4xxx_unlock_drvr(struct scsi_qla_host *a)
{}

static inline int ql4xxx_reset_active(struct scsi_qla_host *ha)
{}

static inline int qla4_8xxx_rd_direct(struct scsi_qla_host *ha,
				      const uint32_t crb_reg)
{}

static inline void qla4_8xxx_wr_direct(struct scsi_qla_host *ha,
				       const uint32_t crb_reg,
				       const uint32_t value)
{}

/*---------------------------------------------------------------------------*/

/* Defines for qla4xxx_initialize_adapter() and qla4xxx_recover_adapter() */

#define INIT_ADAPTER
#define RESET_ADAPTER

#define PRESERVE_DDB_LIST
#define REBUILD_DDB_LIST

/* Defines for process_aen() */
#define PROCESS_ALL_AENS
#define FLUSH_DDB_CHANGED_AENS

/* Defines for udev events */
#define QL4_UEVENT_CODE_FW_DUMP

#endif	/*_QLA4XXX_H */