linux/drivers/scsi/aacraid/aacraid.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 *	Adaptec AAC series RAID controller driver
 *	(c) Copyright 2001 Red Hat Inc.	<[email protected]>
 *
 * based on the old aacraid driver that is..
 * Adaptec aacraid device driver for Linux.
 *
 * Copyright (c) 2000-2010 Adaptec, Inc.
 *               2010-2015 PMC-Sierra, Inc. ([email protected])
 *		 2016-2017 Microsemi Corp. ([email protected])
 *
 * Module Name:
 *  aacraid.h
 *
 * Abstract: Contains all routines for control of the aacraid driver
 */

#ifndef _AACRAID_H_
#define _AACRAID_H_
#ifndef dprintk
#define dprintk(x)
#endif
/* eg: if (nblank(dprintk(x))) */
#define _nblank(x)
#define nblank(x)

#include <linux/interrupt.h>
#include <linux/completion.h>
#include <linux/pci.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_cmnd.h>

/*------------------------------------------------------------------------------
 *              D E F I N E S
 *----------------------------------------------------------------------------*/

#define AAC_MAX_MSIX
#define AAC_PCI_MSI_ENABLE

enum {};

#define AAC_INT_MODE_INTX
#define AAC_INT_MODE_MSI
#define AAC_INT_MODE_AIF
#define AAC_INT_MODE_SYNC
#define AAC_INT_MODE_MSIX

#define AAC_INT_ENABLE_TYPE1_INTX
#define AAC_INT_ENABLE_TYPE1_MSIX
#define AAC_INT_DISABLE_ALL

/* Bit definitions in IOA->Host Interrupt Register */
#define PMC_TRANSITION_TO_OPERATIONAL
#define PMC_IOARCB_TRANSFER_FAILED
#define PMC_IOA_UNIT_CHECK
#define PMC_NO_HOST_RRQ_FOR_CMD_RESPONSE
#define PMC_CRITICAL_IOA_OP_IN_PROGRESS
#define PMC_IOARRIN_LOST
#define PMC_SYSTEM_BUS_MMIO_ERROR
#define PMC_IOA_PROCESSOR_IN_ERROR_STATE
#define PMC_HOST_RRQ_VALID
#define PMC_OPERATIONAL_STATUS
#define PMC_ALLOW_MSIX_VECTOR0

#define PMC_IOA_ERROR_INTERRUPTS

#define PMC_ALL_INTERRUPT_BITS
#define PMC_GLOBAL_INT_BIT2
#define PMC_GLOBAL_INT_BIT0

#ifndef AAC_DRIVER_BUILD
#define AAC_DRIVER_BUILD
#define AAC_DRIVER_BRANCH
#endif
#define MAXIMUM_NUM_CONTAINERS

#define AAC_NUM_MGT_FIB
#define AAC_NUM_IO_FIB
#define AAC_NUM_FIB

#define AAC_MAX_LUN

#define AAC_MAX_HOSTPHYSMEMPAGES
#define AAC_MAX_32BIT_SGBCOUNT

#define AAC_DEBUG_INSTRUMENT_AIF_DELETE

#define AAC_MAX_NATIVE_TARGETS
/* Thor: 5 phys. buses: #0: empty, 1-4: 256 targets each */
#define AAC_MAX_BUSES
#define AAC_MAX_TARGETS
#define AAC_BUS_TARGET_LOOP
#define AAC_MAX_NATIVE_SIZE
#define FW_ERROR_BUFFER_SIZE
#define AAC_SA_TIMEOUT
#define AAC_ARC_TIMEOUT

#define get_bus_number(x)
#define get_target_number(x)

/* Thor AIF events */
#define SA_AIF_HOTPLUG
#define SA_AIF_HARDWARE
#define SA_AIF_PDEV_CHANGE
#define SA_AIF_LDEV_CHANGE
#define SA_AIF_BPSTAT_CHANGE
#define SA_AIF_BPCFG_CHANGE

#define HBA_MAX_SG_EMBEDDED
#define HBA_MAX_SG_SEPARATE
#define HBA_SENSE_DATA_LEN_MAX
#define HBA_REQUEST_TAG_ERROR_FLAG
#define HBA_SGL_FLAGS_EXT

struct aac_hba_sgl {};

enum {};

enum {};

enum {};

enum {};

enum {};

enum {};

struct aac_hba_cmd_req {};

/* Task Management Functions (TMF) */
#define HBA_TMF_ABORT_TASK
#define HBA_TMF_LUN_RESET

struct aac_hba_tm_req {};

struct aac_hba_reset_req {};

struct aac_hba_resp {};

struct aac_native_hba {};

#define CISS_REPORT_PHYSICAL_LUNS
#define WRITE_HOST_WELLNESS
#define CISS_IDENTIFY_PHYSICAL_DEVICE
#define BMIC_IN
#define BMIC_OUT

struct aac_ciss_phys_luns_resp {};

/*
 * Interrupts
 */
#define AAC_MAX_HRRQ

struct aac_ciss_identify_pd {} __packed;

/*
 * These macros convert from physical channels to virtual channels
 */
#define CONTAINER_CHANNEL
#define NATIVE_CHANNEL
#define CONTAINER_TO_CHANNEL(cont)
#define CONTAINER_TO_ID(cont)
#define CONTAINER_TO_LUN(cont)
#define ENCLOSURE_CHANNEL

#define PMC_DEVICE_S6
#define PMC_DEVICE_S7
#define PMC_DEVICE_S8

#define aac_phys_to_logical(x)
#define aac_logical_to_phys(x)

/*
 * These macros are for keeping track of
 * character device state.
 */
#define AAC_CHARDEV_UNREGISTERED
#define AAC_CHARDEV_NEEDS_REINIT

/* #define AAC_DETAILED_STATUS_INFO */

struct diskparm
{};


/*
 *	Firmware constants
 */

#define CT_NONE
#define CT_OK
#define FT_FILESYS
#define FT_DRIVE

/*
 *	Host side memory scatter gather list
 *	Used by the adapter for read, write, and readdirplus operations
 *	We have separate 32 and 64 bit version because even
 *	on 64 bit systems not all cards support the 64 bit version
 */
struct sgentry {};

struct user_sgentry {};

struct sgentry64 {};

struct user_sgentry64 {};

struct sgentryraw {};

struct user_sgentryraw {};

struct sge_ieee1212 {};

/*
 *	SGMAP
 *
 *	This is the SGMAP structure for all commands that use
 *	32-bit addressing.
 */

struct sgmap {};

struct user_sgmap {};

struct sgmap64 {};

struct user_sgmap64 {};

struct sgmapraw {};

struct user_sgmapraw {};

struct creation_info
{};


/*
 *	Define all the constants needed for the communication interface
 */

/*
 *	Define how many queue entries each queue will have and the total
 *	number of entries for the entire communication interface. Also define
 *	how many queues we support.
 *
 *	This has to match the controller
 */

#define NUMBER_OF_COMM_QUEUES
#define HOST_HIGH_CMD_ENTRIES
#define HOST_NORM_CMD_ENTRIES
#define ADAP_HIGH_CMD_ENTRIES
#define ADAP_NORM_CMD_ENTRIES
#define HOST_HIGH_RESP_ENTRIES
#define HOST_NORM_RESP_ENTRIES
#define ADAP_HIGH_RESP_ENTRIES
#define ADAP_NORM_RESP_ENTRIES

#define TOTAL_QUEUE_ENTRIES


/*
 *	Set the queues on a 16 byte alignment
 */

#define QUEUE_ALIGNMENT

/*
 *	The queue headers define the Communication Region queues. These
 *	are physically contiguous and accessible by both the adapter and the
 *	host. Even though all queue headers are in the same contiguous block
 *	they will be represented as individual units in the data structures.
 */

struct aac_entry {};

/*
 *	The adapter assumes the ProducerIndex and ConsumerIndex are grouped
 *	adjacently and in that order.
 */

struct aac_qhdr {};

/*
 *	Define all the events which the adapter would like to notify
 *	the host of.
 */

#define HostNormCmdQue
#define HostHighCmdQue
#define HostNormRespQue
#define HostHighRespQue
#define AdapNormRespNotFull
#define AdapHighRespNotFull
#define AdapNormCmdNotFull
#define AdapHighCmdNotFull
#define SynchCommandComplete
#define AdapInternalError

/*
 *	Define all the events the host wishes to notify the
 *	adapter of. The first four values much match the Qid the
 *	corresponding queue.
 */

#define AdapNormCmdQue
#define AdapHighCmdQue
#define AdapNormRespQue
#define AdapHighRespQue
#define HostShutdown
#define HostPowerFail
#define FatalCommError
#define HostNormRespNotFull
#define HostHighRespNotFull
#define HostNormCmdNotFull
#define HostHighCmdNotFull
#define FastIo
#define AdapPrintfDone

/*
 *	Define all the queues that the adapter and host use to communicate
 *	Number them to match the physical queue layout.
 */

enum aac_queue_types {};

/*
 *	Assign type values to the FSA communication data structures
 */

#define FIB_MAGIC
#define FIB_MAGIC2
#define FIB_MAGIC2_64

/*
 *	Define the priority levels the FSA communication routines support.
 */

#define FsaNormal

/* transport FIB header (PMC) */
struct aac_fib_xporthdr {};

#define ALIGN32

/*
 * Define the FIB. The FIB is the where all the requested data and
 * command information are put to the application on the FSA adapter.
 */

struct aac_fibhdr {};

struct hw_fib {};

/*
 *	FIB commands
 */

#define TestCommandResponse
#define TestAdapterCommand
/*
 *	Lowlevel and comm commands
 */
#define LastTestCommand
#define ReinitHostNormCommandQueue
#define ReinitHostHighCommandQueue
#define ReinitHostHighRespQueue
#define ReinitHostNormRespQueue
#define ReinitAdapNormCommandQueue
#define ReinitAdapHighCommandQueue
#define ReinitAdapHighRespQueue
#define ReinitAdapNormRespQueue
#define InterfaceShutdown
#define DmaCommandFib
#define StartProfile
#define TermProfile
#define SpeedTest
#define TakeABreakPt
#define RequestPerfData
#define SetInterruptDefTimer
#define SetInterruptDefCount
#define GetInterruptDefStatus
#define LastCommCommand
/*
 *	Filesystem commands
 */
#define NuFileSystem
#define UFS
#define HostFileSystem
#define LastFileSystemCommand
/*
 *	Container Commands
 */
#define ContainerCommand
#define ContainerCommand64
#define ContainerRawIo
#define ContainerRawIo2
/*
 *	Scsi Port commands (scsi passthrough)
 */
#define ScsiPortCommand
#define ScsiPortCommand64
/*
 *	Misc house keeping and generic adapter initiated commands
 */
#define AifRequest
#define CheckRevision
#define FsaHostShutdown
#define RequestAdapterInfo
#define IsAdapterPaused
#define SendHostTime
#define RequestSupplementAdapterInfo
#define LastMiscCommand

/*
 * Commands that will target the failover level on the FSA adapter
 */

enum fib_xfer_state {};

/*
 *	The following defines needs to be updated any time there is an
 *	incompatible change made to the aac_init structure.
 */

#define ADAPTER_INIT_STRUCT_REVISION
#define ADAPTER_INIT_STRUCT_REVISION_4
#define ADAPTER_INIT_STRUCT_REVISION_6
#define ADAPTER_INIT_STRUCT_REVISION_7
#define ADAPTER_INIT_STRUCT_REVISION_8

aac_init;

enum aac_log_level {};

#define FSAFS_NTC_GET_ADAPTER_FIB_CONTEXT
#define FSAFS_NTC_FIB_CONTEXT

struct aac_dev;
struct fib;
struct scsi_cmnd;

struct adapter_ops
{};

/*
 *	Define which interrupt handler needs to be installed
 */

struct aac_driver_ident
{};
/*
 * Some adapter firmware needs communication memory
 * below 2gig. This tells the init function to set the
 * dma mask such that fib memory will be allocated where the
 * adapter firmware can get to it.
 */
#define AAC_QUIRK_31BIT

/*
 * Some adapter firmware, when the raid card's cache is turned off, can not
 * split up scatter gathers in order to deal with the limits of the
 * underlying CHIM. This limit is 34 scatter gather elements.
 */
#define AAC_QUIRK_34SG

/*
 * This adapter is a slave (no Firmware)
 */
#define AAC_QUIRK_SLAVE

/*
 * This adapter is a master.
 */
#define AAC_QUIRK_MASTER

/*
 * Some adapter firmware perform poorly when it must split up scatter gathers
 * in order to deal with the limits of the underlying CHIM. This limit in this
 * class of adapters is 17 scatter gather elements.
 */
#define AAC_QUIRK_17SG

/*
 *	Some adapter firmware does not support 64 bit scsi passthrough
 * commands.
 */
#define AAC_QUIRK_SCSI_32

/*
 * SRC based adapters support the AifReqEvent functions
 */
#define AAC_QUIRK_SRC

/*
 *	The adapter interface specs all queues to be located in the same
 *	physically contiguous block. The host structure that defines the
 *	commuication queues will assume they are each a separate physically
 *	contiguous memory region that will support them all being one big
 *	contiguous block.
 *	There is a command and response queue for each level and direction of
 *	commuication. These regions are accessed by both the host and adapter.
 */

struct aac_queue {};

/*
 *	Message queues. The order here is important, see also the
 *	queue type ordering
 */

struct aac_queue_block
{};

/*
 *	SaP1 Message Unit Registers
 */

struct sa_drawbridge_CSR {};

#define Mailbox0
#define Mailbox1
#define Mailbox2
#define Mailbox3
#define Mailbox4
#define Mailbox5
#define Mailbox6
#define Mailbox7

#define DoorbellReg_p
#define DoorbellReg_s
#define DoorbellClrReg_p


#define DOORBELL_0
#define DOORBELL_1
#define DOORBELL_2
#define DOORBELL_3
#define DOORBELL_4
#define DOORBELL_5
#define DOORBELL_6


#define PrintfReady
#define PrintfDone

struct sa_registers {};


#define SA_INIT_NUM_MSIXVECTORS
#define SA_MINIPORT_REVISION

#define sa_readw(AEP, CSR)
#define sa_readl(AEP, CSR)
#define sa_writew(AEP, CSR, value)
#define sa_writel(AEP, CSR, value)

/*
 *	Rx Message Unit Registers
 */

struct rx_mu_registers {};

struct rx_inbound {};

#define INBOUNDDOORBELL_0
#define INBOUNDDOORBELL_1
#define INBOUNDDOORBELL_2
#define INBOUNDDOORBELL_3
#define INBOUNDDOORBELL_4
#define INBOUNDDOORBELL_5
#define INBOUNDDOORBELL_6

#define OUTBOUNDDOORBELL_0
#define OUTBOUNDDOORBELL_1
#define OUTBOUNDDOORBELL_2
#define OUTBOUNDDOORBELL_3
#define OUTBOUNDDOORBELL_4

#define InboundDoorbellReg
#define OutboundDoorbellReg

struct rx_registers {};

#define rx_readb(AEP, CSR)
#define rx_readl(AEP, CSR)
#define rx_writeb(AEP, CSR, value)
#define rx_writel(AEP, CSR, value)

/*
 *	Rkt Message Unit Registers (same as Rx, except a larger reserve region)
 */

#define rkt_mu_registers
#define rkt_inbound

struct rkt_registers {};

#define rkt_readb(AEP, CSR)
#define rkt_readl(AEP, CSR)
#define rkt_writeb(AEP, CSR, value)
#define rkt_writel(AEP, CSR, value)

/*
 * PMC SRC message unit registers
 */

#define src_inbound

struct src_mu_registers {};

struct src_registers {};

#define src_readb(AEP, CSR)
#define src_readl(AEP, CSR)
#define src_writeb(AEP, CSR, value)
#define src_writel(AEP, CSR, value)
#if defined(writeq)
#define src_writeq(AEP, CSR, value)
#endif

#define SRC_ODR_SHIFT
#define SRC_IDR_SHIFT
#define SRC_MSI_READ_MASK

fib_callback;

struct aac_fib_context {};

struct sense_data {};

struct fsa_dev_info {};

struct fib {};

#define AAC_INIT
#define AAC_RESCAN

#define AAC_DEVTYPE_RAID_MEMBER
#define AAC_DEVTYPE_ARC_RAW
#define AAC_DEVTYPE_NATIVE_RAW

#define AAC_RESCAN_DELAY

struct aac_hba_map_info {};

/*
 *	Adapter Information Block
 *
 *	This is returned by the RequestAdapterInfo block
 */

struct aac_adapter_info
{};

struct aac_supplement_adapter_info
{};
#define AAC_FEATURE_FALCON
#define AAC_FEATURE_JBOD
/* SupportedOptions2 */
#define AAC_OPTION_MU_RESET
#define AAC_OPTION_IGNORE_RESET
#define AAC_OPTION_POWER_MANAGEMENT
#define AAC_OPTION_DOORBELL_RESET
/* 4KB sector size */
#define AAC_OPTION_VARIABLE_BLOCK_SIZE
/* 240 simple volume support */
#define AAC_OPTION_SUPPORTED_240_VOLUMES
/*
 * Supports FIB dump sync command send prior to IOP_RESET
 */
#define AAC_OPTION_SUPPORTED3_IOP_RESET_FIB_DUMP
#define AAC_SIS_VERSION_V3
#define AAC_SIS_SLOT_UNKNOWN

#define GetBusInfo
struct aac_bus_info {};

struct aac_bus_info_response {};

/*
 * Battery platforms
 */
#define AAC_BAT_REQ_PRESENT
#define AAC_BAT_REQ_NOTPRESENT
#define AAC_BAT_OPT_PRESENT
#define AAC_BAT_OPT_NOTPRESENT
#define AAC_BAT_NOT_SUPPORTED
/*
 * cpu types
 */
#define AAC_CPU_SIMULATOR
#define AAC_CPU_I960
#define AAC_CPU_STRONGARM

/*
 * Supported Options
 */
#define AAC_OPT_SNAPSHOT
#define AAC_OPT_CLUSTERS
#define AAC_OPT_WRITE_CACHE
#define AAC_OPT_64BIT_DATA
#define AAC_OPT_HOST_TIME_FIB
#define AAC_OPT_RAID50
#define AAC_OPT_4GB_WINDOW
#define AAC_OPT_SCSI_UPGRADEABLE
#define AAC_OPT_SOFT_ERR_REPORT
#define AAC_OPT_SUPPORTED_RECONDITION
#define AAC_OPT_SGMAP_HOST64
#define AAC_OPT_ALARM
#define AAC_OPT_NONDASD
#define AAC_OPT_SCSI_MANAGED
#define AAC_OPT_RAID_SCSI_MODE
#define AAC_OPT_SUPPLEMENT_ADAPTER_INFO
#define AAC_OPT_NEW_COMM
#define AAC_OPT_NEW_COMM_64
#define AAC_OPT_EXTENDED
#define AAC_OPT_NATIVE_HBA
#define AAC_OPT_NEW_COMM_TYPE1
#define AAC_OPT_NEW_COMM_TYPE2
#define AAC_OPT_NEW_COMM_TYPE3
#define AAC_OPT_NEW_COMM_TYPE4

#define AAC_COMM_PRODUCER
#define AAC_COMM_MESSAGE
#define AAC_COMM_MESSAGE_TYPE1
#define AAC_COMM_MESSAGE_TYPE2
#define AAC_COMM_MESSAGE_TYPE3

#define AAC_EXTOPT_SA_FIRMWARE
#define AAC_EXTOPT_SOFT_RESET

/* MSIX context */
struct aac_msix_ctx {};

struct aac_dev
{};

#define aac_adapter_interrupt(dev)

#define aac_adapter_notify(dev, event)

#define aac_adapter_disable_int(dev)

#define aac_adapter_enable_int(dev)

#define aac_adapter_sync_cmd(dev, command, p1, p2, p3, p4, p5, p6, status, r1, r2, r3, r4)

#define aac_adapter_restart(dev, bled, reset_type)

#define aac_adapter_start(dev)

#define aac_adapter_ioremap(dev, size)

#define aac_adapter_deliver(fib)

#define aac_adapter_bounds(dev,cmd,lba)

#define aac_adapter_read(fib,cmd,lba,count)

#define aac_adapter_write(fib,cmd,lba,count,fua)

#define aac_adapter_scsi(fib,cmd)

#define aac_adapter_comm(dev,comm)

#define FIB_CONTEXT_FLAG_TIMED_OUT
#define FIB_CONTEXT_FLAG
#define FIB_CONTEXT_FLAG_WAIT
#define FIB_CONTEXT_FLAG_FASTRESP
#define FIB_CONTEXT_FLAG_NATIVE_HBA
#define FIB_CONTEXT_FLAG_NATIVE_HBA_TMF
#define FIB_CONTEXT_FLAG_SCSI_CMD
#define FIB_CONTEXT_FLAG_EH_RESET

/*
 *	Define the command values
 */

#define Null
#define GetAttributes
#define SetAttributes
#define Lookup
#define ReadLink
#define Read
#define Write
#define Create
#define MakeDirectory
#define SymbolicLink
#define MakeNode
#define Removex
#define RemoveDirectoryx
#define Rename
#define Link
#define ReadDirectory
#define ReadDirectoryPlus
#define FileSystemStatus
#define FileSystemInfo
#define PathConfigure
#define Commit
#define Mount
#define UnMount
#define Newfs
#define FsCheck
#define FsSync
#define SimReadWrite
#define SetFileSystemStatus
#define BlockRead
#define BlockWrite
#define NvramIoctl
#define FsSyncWait
#define ClearArchiveBit
#define SetAcl
#define GetAcl
#define AssignAcl
#define FaultInsertion
#define CrazyCache

#define MAX_FSACOMMAND_NUM


/*
 *	Define the status returns. These are very unixlike although
 *	most are not in fact used
 */

#define ST_OK
#define ST_PERM
#define ST_NOENT
#define ST_IO
#define ST_NXIO
#define ST_E2BIG
#define ST_MEDERR
#define ST_ACCES
#define ST_EXIST
#define ST_XDEV
#define ST_NODEV
#define ST_NOTDIR
#define ST_ISDIR
#define ST_INVAL
#define ST_FBIG
#define ST_NOSPC
#define ST_ROFS
#define ST_MLINK
#define ST_WOULDBLOCK
#define ST_NAMETOOLONG
#define ST_NOTEMPTY
#define ST_DQUOT
#define ST_STALE
#define ST_REMOTE
#define ST_NOT_READY
#define ST_BADHANDLE
#define ST_NOT_SYNC
#define ST_BAD_COOKIE
#define ST_NOTSUPP
#define ST_TOOSMALL
#define ST_SERVERFAULT
#define ST_BADTYPE
#define ST_JUKEBOX
#define ST_NOTMOUNTED
#define ST_MAINTMODE
#define ST_STALEACL

/*
 *	On writes how does the client want the data written.
 */

#define CACHE_CSTABLE
#define CACHE_UNSTABLE

/*
 *	Lets the client know at which level the data was committed on
 *	a write request
 */

#define CMFILE_SYNCH_NVRAM
#define CMDATA_SYNCH_NVRAM
#define CMFILE_SYNCH
#define CMDATA_SYNCH
#define CMUNSTABLE

#define RIO_TYPE_WRITE
#define RIO_TYPE_READ
#define RIO_SUREWRITE

#define RIO2_IO_TYPE
#define RIO2_IO_TYPE_WRITE
#define RIO2_IO_TYPE_READ
#define RIO2_IO_TYPE_VERIFY
#define RIO2_IO_ERROR
#define RIO2_IO_SUREWRITE
#define RIO2_SGL_CONFORMANT
#define RIO2_SG_FORMAT
#define RIO2_SG_FORMAT_ARC
#define RIO2_SG_FORMAT_SRL
#define RIO2_SG_FORMAT_IEEE1212

struct aac_read
{};

struct aac_read64
{};

struct aac_read_reply
{};

struct aac_write
{};

struct aac_write64
{};
struct aac_write_reply
{};

struct aac_raw_io
{};

struct aac_raw_io2 {};

#define CT_FLUSH_CACHE
struct aac_synchronize {};

struct aac_synchronize_reply {};

#define CT_POWER_MANAGEMENT
#define CT_PM_START_UNIT
#define CT_PM_STOP_UNIT
#define CT_PM_UNIT_IMMEDIATE
struct aac_power_management {};

#define CT_PAUSE_IO
#define CT_RELEASE_IO
struct aac_pause {};

struct aac_srb
{};

/*
 * This and associated data structs are used by the
 * ioctl caller and are in cpu order.
 */
struct user_aac_srb
{};

#define AAC_SENSE_BUFFERSIZE

struct aac_srb_reply
{};

struct aac_srb_unit {};

/*
 * SRB Flags
 */
#define SRB_NoDataXfer
#define SRB_DisableDisconnect
#define SRB_DisableSynchTransfer
#define SRB_BypassFrozenQueue
#define SRB_DisableAutosense
#define SRB_DataIn
#define SRB_DataOut

/*
 * SRB Functions - set in aac_srb->function
 */
#define SRBF_ExecuteScsi
#define SRBF_ClaimDevice
#define SRBF_IO_Control
#define SRBF_ReceiveEvent
#define SRBF_ReleaseQueue
#define SRBF_AttachDevice
#define SRBF_ReleaseDevice
#define SRBF_Shutdown
#define SRBF_Flush
#define SRBF_AbortCommand
#define SRBF_ReleaseRecovery
#define SRBF_ResetBus
#define SRBF_ResetDevice
#define SRBF_TerminateIO
#define SRBF_FlushQueue
#define SRBF_RemoveDevice
#define SRBF_DomainValidation

/*
 * SRB SCSI Status - set in aac_srb->scsi_status
 */
#define SRB_STATUS_PENDING
#define SRB_STATUS_SUCCESS
#define SRB_STATUS_ABORTED
#define SRB_STATUS_ABORT_FAILED
#define SRB_STATUS_ERROR
#define SRB_STATUS_BUSY
#define SRB_STATUS_INVALID_REQUEST
#define SRB_STATUS_INVALID_PATH_ID
#define SRB_STATUS_NO_DEVICE
#define SRB_STATUS_TIMEOUT
#define SRB_STATUS_SELECTION_TIMEOUT
#define SRB_STATUS_COMMAND_TIMEOUT
#define SRB_STATUS_MESSAGE_REJECTED
#define SRB_STATUS_BUS_RESET
#define SRB_STATUS_PARITY_ERROR
#define SRB_STATUS_REQUEST_SENSE_FAILED
#define SRB_STATUS_NO_HBA
#define SRB_STATUS_DATA_OVERRUN
#define SRB_STATUS_UNEXPECTED_BUS_FREE
#define SRB_STATUS_PHASE_SEQUENCE_FAILURE
#define SRB_STATUS_BAD_SRB_BLOCK_LENGTH
#define SRB_STATUS_REQUEST_FLUSHED
#define SRB_STATUS_DELAYED_RETRY
#define SRB_STATUS_INVALID_LUN
#define SRB_STATUS_INVALID_TARGET_ID
#define SRB_STATUS_BAD_FUNCTION
#define SRB_STATUS_ERROR_RECOVERY
#define SRB_STATUS_NOT_STARTED
#define SRB_STATUS_NOT_IN_USE
#define SRB_STATUS_FORCE_ABORT
#define SRB_STATUS_DOMAIN_VALIDATION_FAIL

/*
 * Object-Server / Volume-Manager Dispatch Classes
 */

#define VM_Null
#define VM_NameServe
#define VM_ContainerConfig
#define VM_Ioctl
#define VM_FilesystemIoctl
#define VM_CloseAll
#define VM_CtBlockRead
#define VM_CtBlockWrite
#define VM_SliceBlockRead
#define VM_SliceBlockWrite
#define VM_DriveBlockRead
#define VM_DriveBlockWrite
#define VM_EnclosureMgt
#define VM_Unused
#define VM_CtBlockVerify
#define VM_CtPerf
#define VM_CtBlockRead64
#define VM_CtBlockWrite64
#define VM_CtBlockVerify64
#define VM_CtHostRead64
#define VM_CtHostWrite64
#define VM_DrvErrTblLog
#define VM_NameServe64
#define VM_NameServeAllBlk

#define MAX_VMCOMMAND_NUM

/*
 *	Descriptive information (eg, vital stats)
 *	that a content manager might report.  The
 *	FileArray filesystem component is one example
 *	of a content manager.  Raw mode might be
 *	another.
 */

struct aac_fsinfo {};	/* valid iff ObjType == FT_FILESYS && !(ContentState & FSCS_NOTCLEAN) */

struct  aac_blockdevinfo {};

aac_contentinfo;

/*
 *	Query for Container Configuration Status
 */

#define CT_GET_CONFIG_STATUS
struct aac_get_config_status {};

#define CFACT_CONTINUE
#define CFACT_PAUSE
#define CFACT_ABORT
struct aac_get_config_status_resp {};

/*
 *	Accept the configuration as-is
 */

#define CT_COMMIT_CONFIG

struct aac_commit_config {};

/*
 *	Query for Container Configuration Status
 */

#define CT_GET_CONTAINER_COUNT
struct aac_get_container_count {};

struct aac_get_container_count_resp {};


/*
 *	Query for "mountable" objects, ie, objects that are typically
 *	associated with a drive letter on the client (host) side.
 */

struct aac_mntent {};

#define FSCS_NOTCLEAN
#define FSCS_READONLY
#define FSCS_HIDDEN
#define FSCS_NOT_READY

struct aac_query_mount {};

struct aac_mount {};

#define CT_READ_NAME
struct aac_get_name {};

struct aac_get_name_resp {};

#define CT_CID_TO_32BITS_UID
struct aac_get_serial {};

struct aac_get_serial_resp {};

/*
 * The following command is sent to shut down each container.
 */

struct aac_close {};

struct aac_query_disk
{};

struct aac_delete_disk {};

struct fib_ioctl
{};

struct revision
{};


/*
 *	Ugly - non Linux like ioctl coding for back compat.
 */

#define CTL_CODE(function, method)

/*
 *	Define the method codes for how buffers are passed for I/O and FS
 *	controls
 */

#define METHOD_BUFFERED
#define METHOD_NEITHER

/*
 *	Filesystem ioctls
 */

#define FSACTL_SENDFIB
#define FSACTL_SEND_RAW_SRB
#define FSACTL_DELETE_DISK
#define FSACTL_QUERY_DISK
#define FSACTL_OPEN_GET_ADAPTER_FIB
#define FSACTL_GET_NEXT_ADAPTER_FIB
#define FSACTL_CLOSE_GET_ADAPTER_FIB
#define FSACTL_MINIPORT_REV_CHECK
#define FSACTL_GET_PCI_INFO
#define FSACTL_FORCE_DELETE_DISK
#define FSACTL_GET_CONTAINERS
#define FSACTL_SEND_LARGE_FIB
#define FSACTL_RESET_IOP
#define FSACTL_GET_HBA_INFO
/* flags defined for IOP & HW SOFT RESET */
#define HW_IOP_RESET
#define HW_SOFT_RESET
#define IOP_HWSOFT_RESET
/* HW Soft Reset register offset */
#define IBW_SWR_OFFSET
#define SOFT_RESET_TIME



struct aac_common
{};

extern struct aac_common aac_config;

/*
 * This is for management ioctl purpose only.
 */
struct aac_hba_info {};

/*
 *	The following macro is used when sending and receiving FIBs. It is
 *	only used for debugging.
 */

#ifdef DBG
#define FIB_COUNTER_INCREMENT
#else
#define FIB_COUNTER_INCREMENT(counter)
#endif

/*
 *	Adapter direct commands
 *	Monitor/Kernel API
 */

#define BREAKPOINT_REQUEST
#define INIT_STRUCT_BASE_ADDRESS
#define READ_PERMANENT_PARAMETERS
#define WRITE_PERMANENT_PARAMETERS
#define HOST_CRASHING
#define SEND_SYNCHRONOUS_FIB
#define COMMAND_POST_RESULTS
#define GET_ADAPTER_PROPERTIES
#define GET_DRIVER_BUFFER_PROPERTIES
#define RCV_TEMP_READINGS
#define GET_COMM_PREFERRED_SETTINGS
#define IOP_RESET_FW_FIB_DUMP
#define DROP_IO
#define IOP_RESET
#define IOP_RESET_ALWAYS
#define RE_INIT_ADAPTER

#define IOP_SRC_RESET_MASK

/*
 *	Adapter Status Register
 *
 *  Phase Staus mailbox is 32bits:
 *	<31:16> = Phase Status
 *	<15:0>  = Phase
 *
 *	The adapter reports is present state through the phase.  Only
 *	a single phase should be ever be set.  Each phase can have multiple
 *	phase status bits to provide more detailed information about the
 *	state of the board.  Care should be taken to ensure that any phase
 *	status bits that are set when changing the phase are also valid
 *	for the new phase or be cleared out.  Adapter software (monitor,
 *	iflash, kernel) is responsible for properly maintining the phase
 *	status mailbox when it is running.
 *
 *	MONKER_API Phases
 *
 *	Phases are bit oriented.  It is NOT valid  to have multiple bits set
 */

#define SELF_TEST_FAILED
#define MONITOR_PANIC
#define KERNEL_BOOTING
#define KERNEL_UP_AND_RUNNING
#define KERNEL_PANIC
#define FLASH_UPD_PENDING
#define FLASH_UPD_SUCCESS
#define FLASH_UPD_FAILED
#define INVALID_OMR
#define FWUPD_TIMEOUT

/*
 *	Doorbell bit defines
 */

#define DoorBellSyncCmdAvailable
#define DoorBellPrintfDone
#define DoorBellAdapterNormCmdReady
#define DoorBellAdapterNormRespReady
#define DoorBellAdapterNormCmdNotFull
#define DoorBellAdapterNormRespNotFull
#define DoorBellPrintfReady
#define DoorBellAifPending

/* PMC specific outbound doorbell bits */
#define PmDoorBellResponseSent

/*
 *	For FIB communication, we need all of the following things
 *	to send back to the user.
 */

#define AifCmdEventNotify
#define AifEnConfigChange
#define AifEnContainerChange
#define AifEnDeviceFailure
#define AifEnEnclosureManagement
#define EM_DRIVE_INSERTION
#define EM_DRIVE_REMOVAL
#define EM_SES_DRIVE_INSERTION
#define EM_SES_DRIVE_REMOVAL
#define AifEnBatteryEvent
#define AifEnAddContainer
#define AifEnDeleteContainer
#define AifEnExpEvent
#define AifExeFirmwarePanic
#define AifHighPriority
#define AifEnAddJBOD
#define AifEnDeleteJBOD

#define AifBuManagerEvent
#define AifBuCacheDataLoss
#define AifBuCacheDataRecover

#define AifCmdJobProgress
#define AifJobCtrZero
#define AifJobStsSuccess
#define AifJobStsRunning
#define AifCmdAPIReport
#define AifCmdDriverNotify
#define AifDenMorphComplete
#define AifDenVolumeExtendComplete
#define AifReqJobList
#define AifReqJobsForCtr
#define AifReqJobsForScsi
#define AifReqJobReport
#define AifReqTerminateJob
#define AifReqSuspendJob
#define AifReqResumeJob
#define AifReqSendAPIReport
#define AifReqAPIJobStart
#define AifReqAPIJobUpdate
#define AifReqAPIJobFinish

/* PMC NEW COMM: Request the event data */
#define AifReqEvent
#define AifRawDeviceRemove
#define AifNativeDeviceAdd
#define AifNativeDeviceRemove


/*
 *	Adapter Initiated FIB command structures. Start with the adapter
 *	initiated FIBs that really come from the adapter, and get responded
 *	to by the host.
 */

struct aac_aifcmd {};

/**
 *	Convert capacity to cylinders
 *	accounting for the fact capacity could be a 64 bit value
 *
 */
static inline unsigned int cap_to_cyls(sector_t capacity, unsigned divisor)
{}

static inline int aac_pci_offline(struct aac_dev *dev)
{}

static inline int aac_adapter_check_health(struct aac_dev *dev)
{}


int aac_scan_host(struct aac_dev *dev);

static inline void aac_schedule_safw_scan_worker(struct aac_dev *dev)
{}

static inline void aac_schedule_src_reinit_aif_worker(struct aac_dev *dev)
{}

static inline void aac_safw_rescan_worker(struct work_struct *work)
{}

static inline void aac_cancel_rescan_worker(struct aac_dev *dev)
{}

enum aac_cmd_owner {};

struct aac_cmd_priv {};

static inline struct aac_cmd_priv *aac_priv(struct scsi_cmnd *cmd)
{}

void aac_safw_rescan_worker(struct work_struct *work);
void aac_src_reinit_aif_worker(struct work_struct *work);
int aac_acquire_irq(struct aac_dev *dev);
void aac_free_irq(struct aac_dev *dev);
int aac_setup_safw_adapter(struct aac_dev *dev);
const char *aac_driverinfo(struct Scsi_Host *);
void aac_fib_vector_assign(struct aac_dev *dev);
struct fib *aac_fib_alloc(struct aac_dev *dev);
struct fib *aac_fib_alloc_tag(struct aac_dev *dev, struct scsi_cmnd *scmd);
int aac_fib_setup(struct aac_dev *dev);
void aac_fib_map_free(struct aac_dev *dev);
void aac_fib_free(struct fib * context);
void aac_fib_init(struct fib * context);
void aac_printf(struct aac_dev *dev, u32 val);
int aac_fib_send(u16 command, struct fib * context, unsigned long size, int priority, int wait, int reply, fib_callback callback, void *ctxt);
int aac_hba_send(u8 command, struct fib *context,
		fib_callback callback, void *ctxt);
int aac_consumer_get(struct aac_dev * dev, struct aac_queue * q, struct aac_entry **entry);
void aac_consumer_free(struct aac_dev * dev, struct aac_queue * q, u32 qnum);
int aac_fib_complete(struct fib * context);
void aac_hba_callback(void *context, struct fib *fibptr);
#define fib_data(fibctx)
struct aac_dev *aac_init_adapter(struct aac_dev *dev);
void aac_src_access_devreg(struct aac_dev *dev, int mode);
void aac_set_intx_mode(struct aac_dev *dev);
int aac_get_config_status(struct aac_dev *dev, int commit_flag);
int aac_get_containers(struct aac_dev *dev);
int aac_scsi_cmd(struct scsi_cmnd *cmd);
int aac_dev_ioctl(struct aac_dev *dev, unsigned int cmd, void __user *arg);
#ifndef shost_to_class
#define shost_to_class(shost)
#endif
ssize_t aac_get_serial_number(struct device *dev, char *buf);
int aac_do_ioctl(struct aac_dev *dev, unsigned int cmd, void __user *arg);
int aac_rx_init(struct aac_dev *dev);
int aac_rkt_init(struct aac_dev *dev);
int aac_nark_init(struct aac_dev *dev);
int aac_sa_init(struct aac_dev *dev);
int aac_src_init(struct aac_dev *dev);
int aac_srcv_init(struct aac_dev *dev);
int aac_queue_get(struct aac_dev * dev, u32 * index, u32 qid, struct hw_fib * hw_fib, int wait, struct fib * fibptr, unsigned long *nonotify);
void aac_define_int_mode(struct aac_dev *dev);
unsigned int aac_response_normal(struct aac_queue * q);
unsigned int aac_command_normal(struct aac_queue * q);
unsigned int aac_intr_normal(struct aac_dev *dev, u32 Index,
			int isAif, int isFastResponse,
			struct hw_fib *aif_fib);
int aac_reset_adapter(struct aac_dev *dev, int forced, u8 reset_type);
int aac_check_health(struct aac_dev * dev);
int aac_command_thread(void *data);
int aac_close_fib_context(struct aac_dev * dev, struct aac_fib_context *fibctx);
int aac_fib_adapter_complete(struct fib * fibptr, unsigned short size);
struct aac_driver_ident* aac_get_driver_ident(int devtype);
int aac_get_adapter_info(struct aac_dev* dev);
int aac_send_shutdown(struct aac_dev *dev);
int aac_probe_container(struct aac_dev *dev, int cid);
int _aac_rx_init(struct aac_dev *dev);
int aac_rx_select_comm(struct aac_dev *dev, int comm);
int aac_rx_deliver_producer(struct fib * fib);
void aac_reinit_aif(struct aac_dev *aac, unsigned int index);

static inline int aac_is_src(struct aac_dev *dev)
{}

static inline int aac_supports_2T(struct aac_dev *dev)
{}

char * get_container_type(unsigned type);
extern int numacb;
extern char aac_driver_version[];
extern int startup_timeout;
extern int aif_timeout;
extern int expose_physicals;
extern int aac_reset_devices;
extern int aac_msi;
extern int aac_commit;
extern int update_interval;
extern int check_interval;
extern int aac_check_reset;
extern int aac_fib_dump;
#endif