#ifndef _PCI_AACREG_H_
#define _PCI_AACREG_H_
#define AAC_MAX_CONTAINERS 64
#define AAC_BLOCK_SIZE 512
#define AAC_HOST_NORM_CMD_ENTRIES 8
#define AAC_HOST_HIGH_CMD_ENTRIES 4
#define AAC_ADAP_NORM_CMD_ENTRIES 512
#define AAC_ADAP_HIGH_CMD_ENTRIES 4
#define AAC_HOST_NORM_RESP_ENTRIES 512
#define AAC_HOST_HIGH_RESP_ENTRIES 4
#define AAC_ADAP_NORM_RESP_ENTRIES 8
#define AAC_ADAP_HIGH_RESP_ENTRIES 4
#define AAC_TOTALQ_LENGTH \
(AAC_HOST_HIGH_CMD_ENTRIES + AAC_HOST_NORM_CMD_ENTRIES + \
AAC_ADAP_HIGH_CMD_ENTRIES + AAC_ADAP_NORM_CMD_ENTRIES + \
AAC_HOST_HIGH_RESP_ENTRIES + AAC_HOST_NORM_RESP_ENTRIES + \
AAC_ADAP_HIGH_RESP_ENTRIES + AAC_ADAP_NORM_RESP_ENTRIES)
#define AAC_QUEUE_COUNT 8
#define AAC_QUEUE_ALIGN 16
struct aac_queue_entry {
u_int32_t aq_fib_size;
u_int32_t aq_fib_addr;
} __packed;
#define AAC_PRODUCER_INDEX 0
#define AAC_CONSUMER_INDEX 1
struct aac_queue_table {
u_int32_t qt_qindex[AAC_QUEUE_COUNT][2];
struct aac_queue_entry qt_HostNormCmdQueue[AAC_HOST_NORM_CMD_ENTRIES];
struct aac_queue_entry qt_HostHighCmdQueue[AAC_HOST_HIGH_CMD_ENTRIES];
struct aac_queue_entry qt_AdapNormCmdQueue[AAC_ADAP_NORM_CMD_ENTRIES];
struct aac_queue_entry qt_AdapHighCmdQueue[AAC_ADAP_HIGH_CMD_ENTRIES];
struct aac_queue_entry
qt_HostNormRespQueue[AAC_HOST_NORM_RESP_ENTRIES];
struct aac_queue_entry
qt_HostHighRespQueue[AAC_HOST_HIGH_RESP_ENTRIES];
struct aac_queue_entry
qt_AdapNormRespQueue[AAC_ADAP_NORM_RESP_ENTRIES];
struct aac_queue_entry
qt_AdapHighRespQueue[AAC_ADAP_HIGH_RESP_ENTRIES];
} __packed;
struct aac_adapter_init {
u_int32_t InitStructRevision;
u_int32_t MiniPortRevision;
u_int32_t FilesystemRevision;
u_int32_t CommHeaderAddress;
u_int32_t FastIoCommAreaAddress;
u_int32_t AdapterFibsPhysicalAddress;
u_int32_t AdapterFibsVirtualAddress;
u_int32_t AdapterFibsSize;
u_int32_t AdapterFibAlign;
u_int32_t PrintfBufferAddress;
u_int32_t PrintfBufferSize;
u_int32_t HostPhysMemPages;
u_int32_t HostElapsedSeconds;
u_int32_t InitFlags;
u_int32_t MaxIoCommands;
u_int32_t MaxIoSize;
u_int32_t MaxFibSize;
} __packed;
#define AAC_INIT_STRUCT_REVISION 3
#define AAC_INIT_STRUCT_REVISION_4 4
#define AAC_INIT_STRUCT_MINIPORT_REVISION 1
#define AAC_INITFLAGS_NEW_COMM_SUPPORTED 1
#define AAC_PAGE_SIZE 4096
#define CT_NONE 0
#define CT_VOLUME 1
#define CT_MIRROR 2
#define CT_STRIPE 3
#define CT_RAID5 4
#define CT_SSRW 5
#define CT_SSRO 6
#define CT_MORPH 7
#define CT_PASSTHRU 8
#define CT_RAID4 9
#define CT_RAID10 10
#define CT_RAID00 11
#define CT_VOLUME_OF_MIRRORS 12
#define CT_PSEUDO_RAID3 13
#define CT_RAID50 14
#define CT_RAID5D 15
#define CT_RAID5D0 16
#define CT_RAID1E 17
#define CT_RAID6 18
#define CT_RAID60 19
#define FT_REG 1
#define FT_DIR 2
#define FT_BLK 3
#define FT_CHR 4
#define FT_LNK 5
#define FT_SOCK 6
#define FT_FIFO 7
#define FT_FILESYS 8
#define FT_DRIVE 9
#define FT_SLICE 10
#define FT_PARTITION 11
#define FT_VOLUME 12
#define FT_STRIPE 13
#define FT_MIRROR 14
#define FT_RAID5 15
#define FT_DATABASE 16
struct aac_sg_entryraw {
u_int32_t Next;
u_int32_t Prev;
u_int64_t SgAddress;
u_int32_t SgByteCount;
u_int32_t Flags;
} __packed;
struct aac_sg_tableraw {
u_int32_t SgCount;
struct aac_sg_entryraw SgEntryRaw[0];
} __packed;
struct aac_sg_entry {
u_int32_t SgAddress;
u_int32_t SgByteCount;
} __packed;
struct aac_sg_table {
u_int32_t SgCount;
struct aac_sg_entry SgEntry[0];
} __packed;
struct aac_sg_entry64 {
u_int64_t SgAddress;
u_int32_t SgByteCount;
} __packed;
struct aac_sg_table64 {
u_int32_t SgCount;
struct aac_sg_entry64 SgEntry64[0];
} __packed;
struct aac_container_creation {
u_int8_t ViaBuildNumber;
u_int8_t MicroSecond;
u_int8_t Via;
u_int8_t YearsSince1900;
u_int32_t Month:4;
u_int32_t Day:6;
u_int32_t Hour:6;
u_int32_t Minute:6;
u_int32_t Second:6;
u_int64_t ViaAdapterSerialNumber;
} __packed;
typedef enum {
RevApplication = 1,
RevDkiCli,
RevNetService,
RevApi,
RevFileSysDriver,
RevMiniportDriver,
RevAdapterSW,
RevMonitor,
RevRemoteApi,
} RevComponent;
struct FsaRevision {
union {
struct {
u_int8_t dash;
u_int8_t type;
u_int8_t minor;
u_int8_t major;
} comp;
u_int32_t ul;
} external;
u_int32_t buildNumber;
} __packed;
#define CPU_NTSIM 1
#define CPU_I960 2
#define CPU_ARM 3
#define CPU_SPARC 4
#define CPU_POWERPC 5
#define CPU_ALPHA 6
#define CPU_P7 7
#define CPU_I960_RX 8
#define CPU__last 9
#define CPUI960_JX 1
#define CPUI960_CX 2
#define CPUI960_HX 3
#define CPUI960_RX 4
#define CPUARM_SA110 5
#define CPUARM_xxx 6
#define CPUPPC_603e 7
#define CPUPPC_xxx 8
#define CPUI80303 9
#define CPU_XSCALE_80321 10
#define CPU_MIPS_4KC 11
#define CPU_MIPS_5KC 12
#define CPUSUBTYPE__last 13
#define PLAT_NTSIM 1
#define PLAT_V3ADU 2
#define PLAT_CYCLONE 3
#define PLAT_CYCLONE_HD 4
#define PLAT_BATBOARD 5
#define PLAT_BATBOARD_HD 6
#define PLAT_YOLO 7
#define PLAT_COBRA 8
#define PLAT_ANAHEIM 9
#define PLAT_JALAPENO 10
#define PLAT_QUEENS 11
#define PLAT_JALAPENO_DELL 12
#define PLAT_POBLANO 13
#define PLAT_POBLANO_OPAL 14
#define PLAT_POBLANO_SL0 15
#define PLAT_POBLANO_SL1 16
#define PLAT_POBLANO_SL2 17
#define PLAT_POBLANO_XXX 18
#define PLAT_JALAPENO_P2 19
#define PLAT_HABANERO 20
#define PLAT_VULCAN 21
#define PLAT_CRUSADER 22
#define PLAT_LANCER 23
#define PLAT_HARRIER 24
#define PLAT_TERMINATOR 25
#define PLAT_SKYHAWK 26
#define PLAT_CORSAIR 27
#define PLAT_JAGUAR 28
#define PLAT_SATAHAWK 29
#define PLAT_SATANATOR 30
#define PLAT_PROWLER 31
#define PLAT_BLACKBIRD 32
#define PLAT_SABREEXPRESS 33
#define PLAT_INTRUDER 34
#define PLAT__last 35
#define OEM_FLAVOR_ADAPTEC 1
#define OEM_FLAVOR_DELL 2
#define OEM_FLAVOR_HP 3
#define OEM_FLAVOR_IBM 4
#define OEM_FLAVOR_CPQ 5
#define OEM_FLAVOR_FSC 6
#define OEM_FLAVOR_DWS 7
#define OEM_FLAVOR_BRAND_Z 8
#define OEM_FLAVOR_LEGEND 9
#define OEM_FLAVOR_HITACHI 10
#define OEM_FLAVOR_ESG 11
#define OEM_FLAVOR_ICP 12
#define OEM_FLAVOR_SCM 13
#define OEM_FLAVOR__last 14
#define PLATFORM_BAT_REQ_PRESENT 1
#define PLATFORM_BAT_REQ_NOTPRESENT 2
#define PLATFORM_BAT_OPT_PRESENT 3
#define PLATFORM_BAT_OPT_NOTPRESENT 4
#define PLATFORM_BAT_NOT_SUPPORTED 5
#define AAC_SUPPORTED_SNAPSHOT 0x01
#define AAC_SUPPORTED_CLUSTERS 0x02
#define AAC_SUPPORTED_WRITE_CACHE 0x04
#define AAC_SUPPORTED_64BIT_DATA 0x08
#define AAC_SUPPORTED_HOST_TIME_FIB 0x10
#define AAC_SUPPORTED_RAID50 0x20
#define AAC_SUPPORTED_4GB_WINDOW 0x40
#define AAC_SUPPORTED_SCSI_UPGRADEABLE 0x80
#define AAC_SUPPORTED_SOFT_ERR_REPORT 0x100
#define AAC_SUPPORTED_NOT_RECONDITION 0x200
#define AAC_SUPPORTED_SGMAP_HOST64 0x400
#define AAC_SUPPORTED_ALARM 0x800
#define AAC_SUPPORTED_NONDASD 0x1000
#define AAC_SUPPORTED_SCSI_MANAGED 0x2000
#define AAC_SUPPORTED_RAID_SCSI_MODE 0x4000
#define AAC_SUPPORTED_SUPPLEMENT_ADAPTER_INFO 0x10000
#define AAC_SUPPORTED_NEW_COMM 0x20000
#define AAC_SUPPORTED_64BIT_ARRAYSIZE 0x40000
#define AAC_SUPPORTED_HEAT_SENSOR 0x80000
struct aac_adapter_info {
u_int32_t PlatformBase;
u_int32_t CpuArchitecture;
u_int32_t CpuVariant;
u_int32_t ClockSpeed;
u_int32_t ExecutionMem;
u_int32_t BufferMem;
u_int32_t TotalMem;
struct FsaRevision KernelRevision;
struct FsaRevision MonitorRevision;
struct FsaRevision HardwareRevision;
struct FsaRevision BIOSRevision;
u_int32_t ClusteringEnabled;
u_int32_t ClusterChannelMask;
u_int64_t SerialNumber;
u_int32_t batteryPlatform;
u_int32_t SupportedOptions;
u_int32_t OemVariant;
} __packed;
#define AAC_MONKER_BREAKPOINT 0x04
#define AAC_MONKER_INITSTRUCT 0x05
#define AAC_MONKER_SYNCFIB 0x0c
#define AAC_MONKER_GETKERNVER 0x11
#define AAC_MONKER_POSTRESULTS 0x14
#define AAC_MONKER_GETINFO 0x19
#define AAC_MONKER_GETDRVPROP 0x23
#define AAC_MONKER_RCVTEMP 0x25
#define AAC_MONKER_GETCOMMPREF 0x26
#define AAC_MONKER_REINIT 0xee
#define ST_OK 0
#define ST_PERM 1
#define ST_NOENT 2
#define ST_IO 5
#define ST_NXIO 6
#define ST_E2BIG 7
#define ST_ACCES 13
#define ST_EXIST 17
#define ST_XDEV 18
#define ST_NODEV 19
#define ST_NOTDIR 20
#define ST_ISDIR 21
#define ST_INVAL 22
#define ST_FBIG 27
#define ST_NOSPC 28
#define ST_ROFS 30
#define ST_MLINK 31
#define ST_WOULDBLOCK 35
#define ST_NAMETOOLONG 63
#define ST_NOTEMPTY 66
#define ST_DQUOT 69
#define ST_STALE 70
#define ST_REMOTE 71
#define ST_BADHANDLE 10001
#define ST_NOT_SYNC 10002
#define ST_BAD_COOKIE 10003
#define ST_NOTSUPP 10004
#define ST_TOOSMALL 10005
#define ST_SERVERFAULT 10006
#define ST_BADTYPE 10007
#define ST_JUKEBOX 10008
#define ST_NOTMOUNTED 10009
#define ST_MAINTMODE 10010
#define ST_STALEACL 10011
#define VM_Null 0
#define VM_NameServe 1
#define VM_ContainerConfig 2
#define VM_Ioctl 3
#define VM_FilesystemIoctl 4
#define VM_CloseAll 5
#define VM_CtBlockRead 6
#define VM_CtBlockWrite 7
#define VM_SliceBlockRead 8
#define VM_SliceBlockWrite 9
#define VM_DriveBlockRead 10
#define VM_DriveBlockWrite 11
#define VM_EnclosureMgt 12
#define VM_Unused 13
#define VM_CtBlockVerify 14
#define VM_CtPerf 15
#define VM_CtBlockRead64 16
#define VM_CtBlockWrite64 17
#define VM_CtBlockVerify64 18
#define VM_CtHostRead64 19
#define VM_CtHostWrite64 20
#define VM_DrvErrTblLog 21
#define VM_NameServe64 22
struct aac_mntobj {
u_int32_t ObjectId;
char FileSystemName[16];
struct aac_container_creation CreateInfo;
u_int32_t Capacity;
u_int32_t VolType;
u_int32_t ObjType;
u_int32_t ContentState;
#define AAC_FSCS_READONLY 0x0002
union {
u_int32_t pad[8];
} ObjExtension;
u_int32_t AlterEgoId;
u_int32_t CapacityHigh;
} __packed;
struct aac_mntinfo {
u_int32_t Command;
u_int32_t MntType;
u_int32_t MntCount;
} __packed;
struct aac_mntinforesponse {
u_int32_t Status;
u_int32_t MntType;
u_int32_t MntRespCount;
struct aac_mntobj MntTable[1];
} __packed;
struct aac_closecommand {
u_int32_t Command;
u_int32_t ContainerId;
} __packed;
#define CT_GET_SCSI_METHOD 64
struct aac_ctcfg {
u_int32_t Command;
u_int32_t cmd;
u_int32_t param;
} __packed;
struct aac_ctcfg_resp {
u_int32_t Status;
u_int32_t resp;
u_int32_t param;
} __packed;
#define AAC_SCSI_MAX_PORTS 10
#define AAC_BUS_NO_EXIST 0
#define AAC_BUS_VALID 1
#define AAC_BUS_FAULTED 2
#define AAC_BUS_DISABLED 3
#define GetBusInfo 0x9
struct aac_getbusinf {
u_int32_t ProbeComplete;
u_int32_t BusCount;
u_int32_t TargetsPerBus;
u_int8_t InitiatorBusId[AAC_SCSI_MAX_PORTS];
u_int8_t BusValid[AAC_SCSI_MAX_PORTS];
} __packed;
struct aac_vmioctl {
u_int32_t Command;
u_int32_t ObjType;
u_int32_t MethId;
u_int32_t ObjId;
u_int32_t IoctlCmd;
u_int32_t IoctlBuf[1];
} __packed;
struct aac_vmi_businf_resp {
u_int32_t Status;
u_int32_t ObjType;
u_int32_t MethId;
u_int32_t ObjId;
u_int32_t IoctlCmd;
struct aac_getbusinf BusInf;
} __packed;
#if 0
#define AAC_BTL_TO_HANDLE(b, t, l) \
(((b & 0x3f) << 7) | ((l & 0x7) << 4) | (t & 0xf))
#else
#define AAC_BTL_TO_HANDLE(b, t, l) \
((((u_int32_t)b & 0x0f) << 24) | \
(((u_int32_t)l & 0xff) << 16) | \
((u_int32_t)t & 0xffff))
#endif
#define GetDeviceProbeInfo 0x5
struct aac_vmi_devinfo_resp {
u_int32_t Status;
u_int32_t ObjType;
u_int32_t MethId;
u_int32_t ObjId;
u_int32_t IoctlCmd;
u_int8_t VendorId[8];
u_int8_t ProductId[16];
u_int8_t ProductRev[4];
u_int32_t Inquiry7;
u_int32_t align1;
u_int32_t Inquiry0;
u_int32_t align2;
u_int32_t Inquiry1;
u_int32_t align3;
u_int32_t reserved[2];
u_int8_t VendorSpecific[20];
u_int32_t Smart:1;
u_int32_t AAC_Managed:1;
u_int32_t align4;
u_int32_t reserved2:6;
u_int32_t Bus;
u_int32_t Target;
u_int32_t Lun;
u_int32_t ultraEnable:1,
disconnectEnable:1,
fast20EnabledW:1,
scamDevice:1,
scamTolerant:1,
setForSync:1,
setForWide:1,
syncDevice:1,
wideDevice:1,
reserved1:7,
ScsiRate:8,
ScsiOffset:8;
};
#define ResetBus 0x16
struct aac_resetbus {
u_int32_t BusNumber;
};
#define CSTABLE 1
#define CUNSTABLE 2
#define CMFILE_SYNC_NVRAM 1
#define CMDATA_SYNC_NVRAM 2
#define CMFILE_SYNC 3
#define CMDATA_SYNC 4
#define CMUNSTABLE 5
struct aac_blockread {
u_int32_t Command;
u_int32_t ContainerId;
u_int32_t BlockNumber;
u_int32_t ByteCount;
struct aac_sg_table SgMap;
} __packed;
struct aac_blockread64 {
u_int32_t Command;
u_int16_t ContainerId;
u_int16_t SectorCount;
u_int32_t BlockNumber;
u_int16_t Pad;
u_int16_t Flags;
struct aac_sg_table64 SgMap64;
} __packed;
struct aac_blockread_response {
u_int32_t Status;
u_int32_t ByteCount;
} __packed;
struct aac_blockwrite {
u_int32_t Command;
u_int32_t ContainerId;
u_int32_t BlockNumber;
u_int32_t ByteCount;
u_int32_t Stable;
struct aac_sg_table SgMap;
} __packed;
struct aac_blockwrite64 {
u_int32_t Command;
u_int16_t ContainerId;
u_int16_t SectorCount;
u_int32_t BlockNumber;
u_int16_t Pad;
u_int16_t Flags;
struct aac_sg_table64 SgMap64;
} __packed;
struct aac_blockwrite_response {
u_int32_t Status;
u_int32_t ByteCount;
u_int32_t Committed;
} __packed;
struct aac_raw_io {
u_int64_t BlockNumber;
u_int32_t ByteCount;
u_int16_t ContainerId;
u_int16_t Flags;
u_int16_t BpTotal;
u_int16_t BpComplete;
struct aac_sg_tableraw SgMapRaw;
} __packed;
struct aac_close_command {
u_int32_t Command;
u_int32_t ContainerId;
} __packed;
struct aac_srb32 {
u_int32_t function;
u_int32_t bus;
u_int32_t target;
u_int32_t lun;
u_int32_t timeout;
u_int32_t flags;
u_int32_t data_len;
u_int32_t retry_limit;
u_int32_t cdb_len;
u_int8_t cdb[16];
struct aac_sg_table sg_map32;
};
#define AAC_SRB_FUNC_EXECUTE_SCSI 0x00
#define AAC_SRB_FUNC_CLAIM_DEVICE 0x01
#define AAC_SRB_FUNC_IO_CONTROL 0x02
#define AAC_SRB_FUNC_RECEIVE_EVENT 0x03
#define AAC_SRB_FUNC_RELEASE_QUEUE 0x04
#define AAC_SRB_FUNC_ATTACH_DEVICE 0x05
#define AAC_SRB_FUNC_RELEASE_DEVICE 0x06
#define AAC_SRB_FUNC_SHUTDOWN 0x07
#define AAC_SRB_FUNC_FLUSH 0x08
#define AAC_SRB_FUNC_ABORT_COMMAND 0x10
#define AAC_SRB_FUNC_RELEASE_RECOVERY 0x11
#define AAC_SRB_FUNC_RESET_BUS 0x12
#define AAC_SRB_FUNC_RESET_DEVICE 0x13
#define AAC_SRB_FUNC_TERMINATE_IO 0x14
#define AAC_SRB_FUNC_FLUSH_QUEUE 0x15
#define AAC_SRB_FUNC_REMOVE_DEVICE 0x16
#define AAC_SRB_FUNC_DOMAIN_VALIDATION 0x17
#define AAC_SRB_FLAGS_NO_DATA_XFER 0x0000
#define AAC_SRB_FLAGS_DISABLE_DISCONNECT 0x0004
#define AAC_SRB_FLAGS_DISABLE_SYNC_TRANSFER 0x0008
#define AAC_SRB_FLAGS_BYPASS_FROZEN_QUEUE 0x0010
#define AAC_SRB_FLAGS_DISABLE_AUTOSENSE 0x0020
#define AAC_SRB_FLAGS_DATA_IN 0x0040
#define AAC_SRB_FLAGS_DATA_OUT 0x0080
#define AAC_SRB_FLAGS_UNSPECIFIED_DIRECTION \
(AAC_SRB_FLAGS_DATA_IN | AAC_SRB_FLAGS_DATA_OUT)
#define AAC_HOST_SENSE_DATA_MAX 30
struct aac_srb_response {
u_int32_t fib_status;
u_int32_t srb_status;
u_int32_t scsi_status;
u_int32_t data_len;
u_int32_t sense_len;
u_int8_t sense[AAC_HOST_SENSE_DATA_MAX];
};
#define AAC_SRB_STS_PENDING 0x00
#define AAC_SRB_STS_SUCCESS 0x01
#define AAC_SRB_STS_ABORTED 0x02
#define AAC_SRB_STS_ABORT_FAILED 0x03
#define AAC_SRB_STS_ERROR 0x04
#define AAC_SRB_STS_BUSY 0x05
#define AAC_SRB_STS_INVALID_REQUEST 0x06
#define AAC_SRB_STS_INVALID_PATH_ID 0x07
#define AAC_SRB_STS_NO_DEVICE 0x08
#define AAC_SRB_STS_TIMEOUT 0x09
#define AAC_SRB_STS_SELECTION_TIMEOUT 0x0a
#define AAC_SRB_STS_COMMAND_TIMEOUT 0x0b
#define AAC_SRB_STS_MESSAGE_REJECTED 0x0d
#define AAC_SRB_STS_BUS_RESET 0x0e
#define AAC_SRB_STS_PARITY_ERROR 0x0f
#define AAC_SRB_STS_REQUEST_SENSE_FAILED 0x10
#define AAC_SRB_STS_NO_HBA 0x11
#define AAC_SRB_STS_DATA_OVERRUN 0x12
#define AAC_SRB_STS_UNEXPECTED_BUS_FREE 0x13
#define AAC_SRB_STS_PHASE_SEQUENCE_FAILURE 0x14
#define AAC_SRB_STS_BAD_SRB_BLOCK_LENGTH 0x15
#define AAC_SRB_STS_REQUEST_FLUSHED 0x16
#define AAC_SRB_STS_INVALID_LUN 0x20
#define AAC_SRB_STS_INVALID_TARGET_ID 0x21
#define AAC_SRB_STS_BAD_FUNCTION 0x22
#define AAC_SRB_STS_ERROR_RECOVER 0x23
#define AAC_FA_DOORBELL0_CLEAR 0x00
#define AAC_FA_DOORBELL1_CLEAR 0x02
#define AAC_FA_DOORBELL0 0x04
#define AAC_FA_DOORBELL1 0x06
#define AAC_FA_MASK0_CLEAR 0x08
#define AAC_FA_MASK1_CLEAR 0x0a
#define AAC_FA_MASK0 0x0c
#define AAC_FA_MASK1 0x0e
#define AAC_FA_MAILBOX 0x10
#define AAC_FA_FWSTATUS 0x2c
#define AAC_FA_INTSRC 0x900
#define AAC_FA_HACK(sc) (void)AAC_GETREG4(sc, AAC_FA_INTSRC)
#define AAC_REGSIZE 0x100
#define AAC_SA_DOORBELL0_CLEAR 0x98
#define AAC_SA_DOORBELL0_SET 0x9c
#define AAC_SA_DOORBELL0 0x9c
#define AAC_SA_MASK0_CLEAR 0xa0
#define AAC_SA_MASK0_SET 0xa4
#define AAC_SA_DOORBELL1_CLEAR 0x9a
#define AAC_SA_DOORBELL1_SET 0x9e
#define AAC_SA_MASK1_CLEAR 0xa2
#define AAC_SA_MASK1_SET 0xa6
#define AAC_SA_MAILBOX 0xa8
#define AAC_SA_FWSTATUS 0xc4
#define AAC_RX_IDBR 0x20
#define AAC_RX_IISR 0x24
#define AAC_RX_IIMR 0x28
#define AAC_RX_ODBR 0x2c
#define AAC_RX_OISR 0x30
#define AAC_RX_OIMR 0x34
#define AAC_RX_IQUE 0x40
#define AAC_RX_OQUE 0x44
#define AAC_RX_MAILBOX 0x50
#define AAC_RX_FWSTATUS 0x6c
#define AAC_RKT_IDBR 0x20
#define AAC_RKT_IISR 0x24
#define AAC_RKT_IIMR 0x28
#define AAC_RKT_ODBR 0x2c
#define AAC_RKT_OISR 0x30
#define AAC_RKT_OIMR 0x34
#define AAC_RKT_IQUE 0x40
#define AAC_RKT_OQUE 0x44
#define AAC_RKT_MAILBOX 0x1000
#define AAC_RKT_FWSTATUS 0x101c
#define AAC_DB_SYNC_COMMAND (1<<0)
#define AAC_DB_COMMAND_READY (1<<1)
#define AAC_DB_RESPONSE_READY (1<<2)
#define AAC_DB_COMMAND_NOT_FULL (1<<3)
#define AAC_DB_RESPONSE_NOT_FULL (1<<4)
#define AAC_DB_PRINTF (1<<5)
#define AAC_PRINTF_DONE (1<<5)
#define AAC_DB_INTERRUPTS \
(AAC_DB_COMMAND_READY | AAC_DB_RESPONSE_READY | AAC_DB_PRINTF)
#define AAC_DB_INT_NEW_COMM 0x08
#define AAC_HOST_NORM_CMD_QUEUE 0
#define AAC_HOST_HIGH_CMD_QUEUE 1
#define AAC_ADAP_NORM_CMD_QUEUE 2
#define AAC_ADAP_HIGH_CMD_QUEUE 3
#define AAC_HOST_NORM_RESP_QUEUE 4
#define AAC_HOST_HIGH_RESP_QUEUE 5
#define AAC_ADAP_NORM_RESP_QUEUE 6
#define AAC_ADAP_HIGH_RESP_QUEUE 7
struct aac_fib_list_entry {
u_int32_t Flink;
u_int32_t Blink;
} __packed;
struct aac_fib_header {
u_int32_t XferState;
u_int16_t Command;
u_int8_t StructType;
u_int8_t Flags;
u_int16_t Size;
u_int16_t SenderSize;
u_int32_t SenderFibAddress;
u_int32_t ReceiverFibAddress;
u_int32_t SenderData;
union {
struct {
u_int32_t ReceiverTimeStart;
u_int32_t ReceiverTimeDone;
} _s;
struct aac_fib_list_entry FibLinks;
} _u;
} __packed;
#define AAC_FIB_DATASIZE (512 - sizeof(struct aac_fib_header))
struct aac_fib {
struct aac_fib_header Header;
u_int8_t data[AAC_FIB_DATASIZE];
} __packed;
#define TestCommandResponse 1
#define TestAdapterCommand 2
#define LastTestCommand 100
#define ReinitHostNormCommandQueue 101
#define ReinitHostHighCommandQueue 102
#define ReinitHostHighRespQueue 103
#define ReinitHostNormRespQueue 104
#define ReinitAdapNormCommandQueue 105
#define ReinitAdapHighCommandQueue 107
#define ReinitAdapHighRespQueue 108
#define ReinitAdapNormRespQueue 109
#define InterfaceShutdown 110
#define DmaCommandFib 120
#define StartProfile 121
#define TermProfile 122
#define SpeedTest 123
#define TakeABreakPt 124
#define RequestPerfData 125
#define SetInterruptDefTimer 126
#define SetInterruptDefCount 127
#define GetInterruptDefStatus 128
#define LastCommCommand 129
#define NuFileSystem 300
#define UFS 301
#define HostFileSystem 302
#define LastFileSystemCommand 303
#define ContainerCommand 500
#define ContainerCommand64 501
#define RawIo 502
#define ClusterCommand 550
#define ScsiPortCommand 600
#define ScsiPortCommandU64 601
#define SataPortCommandU64 602
#define SasSmpPassThrough 603
#define SasRequestPhyInfo 612
#define AifRequest 700
#define CheckRevision 701
#define FsaHostShutdown 702
#define RequestAdapterInfo 703
#define IsAdapterPaused 704
#define SendHostTime 705
#define RequestSupplementAdapterInfo 706
#define LastMiscCommand 707
#define OnLineDiagnostic 800
#define FduAdapterTest 801
#define RequestCompatibilityId 802
#define AdapterEnvironmentInfo 803
#define NvsramEventLog 900
#define ResetNvsramEventLogPointers 901
#define EnableEventLog 902
#define DisableEventLog 903
#define EncryptedKeyTransportFIB 904
#define KeyableFeaturesFIB 905
#define AAC_FIBTYPE_TFIB 1
#define AAC_FIBTYPE_TQE 2
#define AAC_FIBTYPE_TCTPERF 3
#define AAC_FIBSTATE_HOSTOWNED (1<<0)
#define AAC_FIBSTATE_ADAPTEROWNED (1<<1)
#define AAC_FIBSTATE_INITIALISED (1<<2)
#define AAC_FIBSTATE_EMPTY (1<<3)
#define AAC_FIBSTATE_FROMPOOL (1<<4)
#define AAC_FIBSTATE_FROMHOST (1<<5)
#define AAC_FIBSTATE_FROMADAP (1<<6)
#define AAC_FIBSTATE_REXPECTED (1<<7)
#define AAC_FIBSTATE_RNOTEXPECTED (1<<8)
#define AAC_FIBSTATE_DONEADAP (1<<9)
#define AAC_FIBSTATE_DONEHOST (1<<10)
#define AAC_FIBSTATE_HIGH (1<<11)
#define AAC_FIBSTATE_NORM (1<<12)
#define AAC_FIBSTATE_ASYNC (1<<13)
#define AAC_FIBSTATE_ASYNCIO (1<<13)
#define AAC_FIBSTATE_PAGEFILEIO (1<<14)
#define AAC_FIBSTATE_SHUTDOWN (1<<15)
#define AAC_FIBSTATE_LAZYWRITE (1<<16)
#define AAC_FIBSTATE_ADAPMICROFIB (1<<17)
#define AAC_FIBSTATE_BIOSFIB (1<<18)
#define AAC_FIBSTATE_FAST_RESPONSE (1<<19)
#define AAC_FIBSTATE_APIFIB (1<<20)
#define AAC_ERROR_NORMAL 0x00
#define AAC_ERROR_PENDING 0x01
#define AAC_ERROR_FATAL 0x02
#define AAC_ERROR_INVALID_QUEUE 0x03
#define AAC_ERROR_NOENTRIES 0x04
#define AAC_ERROR_SENDFAILED 0x05
#define AAC_ERROR_INVALID_QUEUE_PRIORITY 0x06
#define AAC_ERROR_FIB_ALLOCATION_FAILED 0x07
#define AAC_ERROR_FIB_DEALLOCATION_FAILED 0x08
#define AAC_SELF_TEST_FAILED 0x00000004
#define AAC_MONITOR_PANIC 0x00000020
#define AAC_UP_AND_RUNNING 0x00000080
#define AAC_KERNEL_PANIC 0x00000100
#define AAC_NFILESYS 24
typedef enum {
NVSTATUS_DISABLED = 0,
NVSTATUS_ENABLED,
NVSTATUS_ERROR,
NVSTATUS_BATTERY,
NVSTATUS_UNKNOWN
} AAC_NVSTATUS;
typedef enum {
NVBATTSTATUS_NONE = 0,
NVBATTSTATUS_LOW,
NVBATTSTATUS_OK,
NVBATTSTATUS_RECONDITIONING
} AAC_NVBATTSTATUS;
typedef enum {
NVBATT_TRANSITION_NONE = 0,
NVBATT_TRANSITION_LOW,
NVBATT_TRANSITION_OK
} AAC_NVBATT_TRANSITION;
struct aac_nvramdevinfo {
u_int32_t NV_Enabled;
u_int32_t NV_Error;
u_int32_t NV_NDirty;
u_int32_t NV_NActive;
} __packed;
struct aac_nvraminfo {
AAC_NVSTATUS NV_Status;
AAC_NVBATTSTATUS NV_BattStatus;
u_int32_t NV_Size;
u_int32_t NV_BufSize;
u_int32_t NV_NBufs;
u_int32_t NV_NDirty;
u_int32_t NV_NClean;
u_int32_t NV_NActive;
u_int32_t NV_NBrokered;
struct aac_nvramdevinfo NV_DevInfo[AAC_NFILESYS];
u_int32_t NV_BattNeedsReconditioning;
u_int32_t NV_TotalSize;
} __packed;
typedef enum {
AifJobStsSuccess = 1,
AifJobStsFinished,
AifJobStsAborted,
AifJobStsFailed,
AifJobStsLastReportMarker = 100,
AifJobStsSuspended,
AifJobStsRunning
} AAC_AifJobStatus;
typedef enum {
AifJobScsiMin = 1,
AifJobScsiZero,
AifJobScsiVerify,
AifJobScsiExercise,
AifJobScsiVerifyRepair,
AifJobScsiWritePattern,
AifJobScsiMax = 99,
AifJobCtrMin,
AifJobCtrZero,
AifJobCtrCopy,
AifJobCtrCreateMirror,
AifJobCtrMergeMirror,
AifJobCtrScrubMirror,
AifJobCtrRebuildRaid5,
AifJobCtrScrubRaid5,
AifJobCtrMorph,
AifJobCtrPartCopy,
AifJobCtrRebuildMirror,
AifJobCtrCrazyCache,
AifJobCtrCopyback,
AifJobCtrCompactRaid5D,
AifJobCtrExpandRaid5D,
AifJobCtrRebuildRaid6,
AifJobCtrScrubRaid6,
AifJobCtrSSBackup,
AifJobCtrMax = 199,
AifJobFsMin,
AifJobFsCreate,
AifJobFsVerify,
AifJobFsExtend,
AifJobFsMax = 299,
AifJobApiFormatNTFS,
AifJobApiFormatFAT,
AifJobApiUpdateSnapshot,
AifJobApiFormatFAT32,
AifJobApiMax = 399,
AifJobCtlContinuousCtrVerify,
AifJobCtlMax = 499
} AAC_AifJobType;
struct aac_AifContainers {
u_int32_t src;
u_int32_t dst;
} __packed;
union aac_AifJobClient {
struct aac_AifContainers container;
int32_t scsi_dh;
};
struct aac_AifJobDesc {
u_int32_t jobID;
AAC_AifJobType type;
union aac_AifJobClient client;
} __packed;
struct aac_AifJobProgressReport {
struct aac_AifJobDesc jd;
AAC_AifJobStatus status;
u_int32_t finalTick;
u_int32_t currentTick;
u_int32_t jobSpecificData1;
u_int32_t jobSpecificData2;
} __packed;
typedef enum {
AifEnGeneric = 1,
AifEnTaskComplete,
AifEnConfigChange,
AifEnContainerChange,
AifEnDeviceFailure,
AifEnMirrorFailover,
AifEnContainerEvent,
AifEnFileSystemChange,
AifEnConfigPause,
AifEnConfigResume,
AifEnFailoverChange,
AifEnRAID5RebuildDone,
AifEnEnclosureManagement,
AifEnBatteryEvent,
AifEnAddContainer,
AifEnDeleteContainer,
AifEnSMARTEvent,
AifEnBatteryNeedsRecond,
AifEnClusterEvent,
AifEnDiskSetEvent,
AifDriverNotifyStart=199,
AifDenMorphComplete,
AifDenVolumeExtendComplete
} AAC_AifEventNotifyType;
struct aac_AifEnsGeneric {
char text[132];
} __packed;
struct aac_AifEnsDeviceFailure {
u_int32_t deviceHandle;
} __packed;
struct aac_AifEnsMirrorFailover {
u_int32_t container;
u_int32_t failedSlice;
u_int32_t creatingSlice;
} __packed;
struct aac_AifEnsContainerChange {
u_int32_t container[2];
} __packed;
struct aac_AifEnsContainerEvent {
u_int32_t container;
u_int32_t eventType;
} __packed;
struct aac_AifEnsEnclosureEvent {
u_int32_t empID;
u_int32_t unitID;
u_int32_t eventType;
} __packed;
struct aac_AifEnsBatteryEvent {
AAC_NVBATT_TRANSITION transition_type;
AAC_NVBATTSTATUS current_state;
AAC_NVBATTSTATUS prior_state;
} __packed;
struct aac_AifEnsDiskSetEvent {
u_int32_t eventType;
u_int64_t DsNum;
u_int64_t CreatorId;
} __packed;
typedef enum {
CLUSTER_NULL_EVENT = 0,
CLUSTER_PARTNER_NAME_EVENT,
CLUSTER_PARTNER_NULL_NAME_EVENT
} AAC_ClusterAifEvent;
struct aac_AifEnsClusterEvent {
AAC_ClusterAifEvent eventType;
} __packed;
struct aac_AifEventNotify {
AAC_AifEventNotifyType type;
union {
struct aac_AifEnsGeneric EG;
struct aac_AifEnsDeviceFailure EDF;
struct aac_AifEnsMirrorFailover EMF;
struct aac_AifEnsContainerChange ECC;
struct aac_AifEnsContainerEvent ECE;
struct aac_AifEnsEnclosureEvent EEE;
struct aac_AifEnsBatteryEvent EBE;
struct aac_AifEnsDiskSetEvent EDS;
struct aac_AifEnsClusterEvent ECLE;
} data;
} __packed;
#define AAC_AIF_REPORT_MAX_SIZE 64
typedef enum {
AifCmdEventNotify = 1,
AifCmdJobProgress,
AifCmdAPIReport,
AifCmdDriverNotify,
AifReqJobList = 100,
AifReqJobsForCtr,
AifReqJobsForScsi,
AifReqJobReport,
AifReqTerminateJob,
AifReqSuspendJob,
AifReqResumeJob,
AifReqSendAPIReport,
AifReqAPIJobStart,
AifReqAPIJobUpdate,
AifReqAPIJobFinish
} AAC_AifCommand;
struct aac_aif_command {
AAC_AifCommand command;
u_int32_t seqNumber;
union {
struct aac_AifEventNotify EN;
struct aac_AifJobProgressReport PR[1];
u_int8_t AR[AAC_AIF_REPORT_MAX_SIZE];
u_int8_t data[AAC_FIB_DATASIZE - 8];
} data;
} __packed;
#endif