DevLsiLogicSCSI.h revision c58f1213e628a545081c70e26c6b67a841cff880
/* $Id$ */
/** @file
* VBox storage devices: LsiLogic LSI53c1030 SCSI controller - Defines and structures.
*/
/*
* Copyright (C) 2006-2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#ifndef __DEVLSILOGICSCSI_H__
#define __DEVLSILOGICSCSI_H__
/*
* Custom fixed I/O ports for BIOS controller access. Note that these should
* not be in the ISA range (below 400h) to avoid conflicts with ISA device
* probing. Addresses in the 300h-340h range should be especially avoided.
*/
#define LSILOGIC_BIOS_IO_PORT 0x434
#define LSILOGIC_SAS_BIOS_IO_PORT 0x438
#define LSILOGICSCSI_REQUEST_QUEUE_DEPTH_DEFAULT 256
#define LSILOGICSCSI_REPLY_QUEUE_DEPTH_DEFAULT 256
#define LSILOGICSCSI_MAXIMUM_CHAIN_DEPTH 3
#define LSILOGIC_NR_OF_ALLOWED_BIGGER_LISTS 100
/** Equal for all devices */
#define LSILOGICSCSI_PCI_VENDOR_ID (0x1000)
/** SPI SCSI controller (LSI53C1030) */
#define LSILOGICSCSI_PCI_SPI_CTRLNAME "LSI53C1030"
#define LSILOGICSCSI_PCI_SPI_DEVICE_ID (0x0030)
#define LSILOGICSCSI_PCI_SPI_REVISION_ID (0x00)
#define LSILOGICSCSI_PCI_SPI_CLASS_CODE (0x01)
#define LSILOGICSCSI_PCI_SPI_SUBSYSTEM_VENDOR_ID (0x1000)
#define LSILOGICSCSI_PCI_SPI_SUBSYSTEM_ID (0x8000)
#define LSILOGICSCSI_PCI_SPI_PORTS_MAX 1
#define LSILOGICSCSI_PCI_SPI_BUSES_MAX 1
#define LSILOGICSCSI_PCI_SPI_DEVICES_PER_BUS_MAX 16
#define LSILOGICSCSI_PCI_SPI_DEVICES_MAX (LSILOGICSCSI_PCI_SPI_BUSES_MAX*LSILOGICSCSI_PCI_SPI_DEVICES_PER_BUS_MAX)
/** SAS SCSI controller (SAS1068 PCI-X Fusion-MPT SAS) */
#define LSILOGICSCSI_PCI_SAS_CTRLNAME "SAS1068"
#define LSILOGICSCSI_PCI_SAS_DEVICE_ID (0x0054)
#define LSILOGICSCSI_PCI_SAS_REVISION_ID (0x00)
#define LSILOGICSCSI_PCI_SAS_CLASS_CODE (0x00)
#define LSILOGICSCSI_PCI_SAS_SUBSYSTEM_VENDOR_ID (0x1000)
#define LSILOGICSCSI_PCI_SAS_SUBSYSTEM_ID (0x8000)
#define LSILOGICSCSI_PCI_SAS_PORTS_MAX 256
#define LSILOGICSCSI_PCI_SAS_PORTS_DEFAULT 8
#define LSILOGICSCSI_PCI_SAS_DEVICES_MAX (LSILOGICSCSI_PCI_SAS_PORTS_MAX * LSILOGICSCSI_PCI_SAS_DEVICES_PER_PORT_MAX)
/**
* A SAS address.
*/
#pragma pack(1)
typedef union SASADDRESS
{
/** 64bit view. */
/** 32bit view. */
/** 16bit view. */
/** Byte view. */
} SASADDRESS, *PSASADDRESS;
#pragma pack()
/**
* Possible device types we support.
*/
typedef enum LSILOGICCTRLTYPE
{
/** SPI SCSI controller (PCI dev id 0x0030) */
/** SAS SCSI controller (PCI dev id 0x0054) */
/** 32bit hack */
LSILOGICCTRLTYPE_32BIT_HACK = 0x7fffffff
/**
* A simple SG element for a 64bit address.
*/
#pragma pack(1)
typedef struct MptSGEntrySimple64
{
/** Length of the buffer this entry describes. */
unsigned u24Length: 24;
/** Flag whether this element is the end of the list. */
unsigned fEndOfList: 1;
/** Flag whether the address is 32bit or 64bits wide. */
unsigned f64BitAddress: 1;
/** Flag whether this buffer contains data to be transferred or is the destination. */
unsigned fBufferContainsData: 1;
/** Flag whether this is a local address or a system address. */
unsigned fLocalAddress: 1;
/** Element type. */
unsigned u2ElementType: 2;
/** Flag whether this is the last element of the buffer. */
unsigned fEndOfBuffer: 1;
/** Flag whether this is the last element of the current segment. */
unsigned fLastElement: 1;
/** Lower 32bits of the address of the data buffer. */
unsigned u32DataBufferAddressLow: 32;
/** Upper 32bits of the address of the data buffer. */
unsigned u32DataBufferAddressHigh: 32;
#pragma pack()
/**
* A simple SG element for a 32bit address.
*/
#pragma pack(1)
typedef struct MptSGEntrySimple32
{
/** Length of the buffer this entry describes. */
unsigned u24Length: 24;
/** Flag whether this element is the end of the list. */
unsigned fEndOfList: 1;
/** Flag whether the address is 32bit or 64bits wide. */
unsigned f64BitAddress: 1;
/** Flag whether this buffer contains data to be transferred or is the destination. */
unsigned fBufferContainsData: 1;
/** Flag whether this is a local address or a system address. */
unsigned fLocalAddress: 1;
/** Element type. */
unsigned u2ElementType: 2;
/** Flag whether this is the last element of the buffer. */
unsigned fEndOfBuffer: 1;
/** Flag whether this is the last element of the current segment. */
unsigned fLastElement: 1;
/** Lower 32bits of the address of the data buffer. */
unsigned u32DataBufferAddressLow: 32;
#pragma pack()
/**
* A chain SG element.
*/
#pragma pack(1)
typedef struct MptSGEntryChain
{
/** Size of the segment. */
unsigned u16Length: 16;
/** Offset in 32bit words of the next chain element in the segment
* identified by this element. */
unsigned u8NextChainOffset: 8;
/** Reserved. */
unsigned fReserved0: 1;
/** Flag whether the address is 32bit or 64bits wide. */
unsigned f64BitAddress: 1;
/** Reserved. */
unsigned fReserved1: 1;
/** Flag whether this is a local address or a system address. */
unsigned fLocalAddress: 1;
/** Element type. */
unsigned u2ElementType: 2;
/** Flag whether this is the last element of the buffer. */
unsigned u2Reserved2: 2;
/** Lower 32bits of the address of the data buffer. */
unsigned u32SegmentAddressLow: 32;
/** Upper 32bits of the address of the data buffer. */
unsigned u32SegmentAddressHigh: 32;
#pragma pack()
typedef union MptSGEntryUnion
{
/**
* MPT Fusion message header - Common for all message frames.
* This is filled in by the guest.
*/
#pragma pack(1)
typedef struct MptMessageHdr
{
/** Function dependent data. */
/** Chain offset. */
/** The function code. */
/** Function dependent data. */
/** Message flags. */
/** Message context - Unique ID from the guest unmodified by the device. */
#pragma pack()
/** Defined function codes found in the message header. */
#define MPT_MESSAGE_HDR_FUNCTION_SCSI_IO_REQUEST (0x00)
#define MPT_MESSAGE_HDR_FUNCTION_SCSI_TASK_MGMT (0x01)
#define MPT_MESSAGE_HDR_FUNCTION_IOC_INIT (0x02)
#define MPT_MESSAGE_HDR_FUNCTION_IOC_FACTS (0x03)
#define MPT_MESSAGE_HDR_FUNCTION_CONFIG (0x04)
#define MPT_MESSAGE_HDR_FUNCTION_PORT_FACTS (0x05)
#define MPT_MESSAGE_HDR_FUNCTION_PORT_ENABLE (0x06)
#define MPT_MESSAGE_HDR_FUNCTION_EVENT_NOTIFICATION (0x07)
#define MPT_MESSAGE_HDR_FUNCTION_EVENT_ACK (0x08)
#define MPT_MESSAGE_HDR_FUNCTION_FW_DOWNLOAD (0x09)
#define MPT_MESSAGE_HDR_FUNCTION_TARGET_CMD_BUFFER_POST (0x0A)
#define MPT_MESSAGE_HDR_FUNCTION_TARGET_ASSIST (0x0B)
#define MPT_MESSAGE_HDR_FUNCTION_TARGET_STATUS_SEND (0x0C)
#define MPT_MESSAGE_HDR_FUNCTION_TARGET_MODE_ABORT (0x0D)
#define MPT_MESSAGE_HDR_FUNCTION_FW_UPLOAD (0x12)
#ifdef DEBUG
/**
* Function names
*/
static const char * const g_apszMPTFunctionNames[] =
{
"SCSI I/O Request",
"SCSI Task Management",
"IOC Init",
"IOC Facts",
"Config",
"Port Facts",
"Port Enable",
"Event Notification",
"Event Ack",
"Firmware Download"
};
#endif
/**
* Default reply message.
* Send from the device to the guest upon completion of a request.
*/
#pragma pack(1)
typedef struct MptDefaultReplyMessage
{
/** Function dependent data. */
/** Length of the message in 32bit DWords. */
/** Function which completed. */
/** Function dependent. */
/** Message flags. */
/** Message context given in the request. */
/** Function dependent status code. */
/** Status of the IOC. */
/** Additional log info. */
#pragma pack()
/**
* IO controller init request.
*/
#pragma pack(1)
typedef struct MptIOCInitRequest
{
/** Which system send this init request. */
/** Reserved */
/** Chain offset in the SG list. */
/** Function to execute. */
/** Flags */
/** Maximum number of devices the driver can handle. */
/** Maximum number of buses the driver can handle. */
/** Message flags. */
/** Message context ID. */
/** Reply frame size. */
/** Reserved */
/** Upper 32bit part of the 64bit address the message frames are in.
* That means all frames must be in the same 4GB segment. */
/** Upper 32bit of the sense buffer. */
#pragma pack()
/**
* IO controller init reply.
*/
#pragma pack(1)
typedef struct MptIOCInitReply
{
/** Which subsystem send this init request. */
/** Reserved */
/** Message length */
/** Function. */
/** Flags */
/** Maximum number of devices the driver can handle. */
/** Maximum number of busses the driver can handle. */
/** Message flags. */
/** Message context ID */
/** Reserved */
/** IO controller status. */
/** IO controller log information. */
#pragma pack()
/**
* IO controller facts request.
*/
#pragma pack(1)
typedef struct MptIOCFactsRequest
{
/** Reserved. */
/** Chain offset in SG list. */
/** Function number. */
/** Reserved */
/** Message flags. */
/** Message context ID. */
#pragma pack()
/**
* IO controller facts reply.
*/
#pragma pack(1)
typedef struct MptIOCFactsReply
{
/** Message version. */
/** Message length. */
/** Function number. */
/** Reserved */
/** IO controller number */
/** Message flags. */
/** Message context ID. */
/** IO controller exceptions */
/** IO controller status. */
/** IO controller log information. */
/** Maximum chain depth. */
/** The current value of the WhoInit field. */
/** Block size. */
/** Flags. */
/** Depth of the reply queue. */
/** Size of a request frame. */
/** Reserved */
/** Product ID. */
/** Current value of the high 32bit MFA address. */
/** Global credits - Number of entries allocated to queues */
/** Number of ports on the IO controller */
/** Event state. */
/** Current value of the high 32bit sense buffer address. */
/** Current reply frame size. */
/** Maximum number of devices. */
/** Maximum number of buses. */
/** Size of the firmware image. */
/** Reserved. */
/** Firmware version */
#pragma pack()
/**
* Port facts request
*/
#pragma pack(1)
typedef struct MptPortFactsRequest
{
/** Reserved */
/** Message length. */
/** Function number. */
/** Reserved */
/** Port number to get facts for. */
/** Message flags. */
/** Message context ID. */
#pragma pack()
/**
* Port facts reply.
*/
#pragma pack(1)
typedef struct MptPortFactsReply
{
/** Reserved. */
/** Message length. */
/** Function number. */
/** Reserved */
/** Port number the facts are for. */
/** Message flags. */
/** Message context ID. */
/** Reserved. */
/** IO controller status. */
/** IO controller log information. */
/** Reserved */
/** Port type */
/** Maximum number of devices on this port. */
/** SCSI ID of this port on the attached bus. */
/** Protocol flags. */
/** Maximum number of target command buffers which can be posted to this port at a time. */
/** Maximum number of LAN buckets. */
/** Reserved. */
/** Reserved. */
#pragma pack()
/**
* Port Enable request.
*/
#pragma pack(1)
typedef struct MptPortEnableRequest
{
/** Reserved. */
/** Message length. */
/** Function number. */
/** Reserved. */
/** Port number to enable. */
/** Message flags. */
/** Message context ID. */
#pragma pack()
/**
* Port enable reply.
*/
#pragma pack(1)
typedef struct MptPortEnableReply
{
/** Reserved. */
/** Message length. */
/** Function number. */
/** Reserved */
/** Port number which was enabled. */
/** Message flags. */
/** Message context ID. */
/** Reserved. */
/** IO controller status */
/** IO controller log information. */
#pragma pack()
/**
* Event notification request.
*/
#pragma pack(1)
typedef struct MptEventNotificationRequest
{
/** Switch - Turns event notification on and off. */
/** Reserved. */
/** Chain offset. */
/** Function number. */
/** Reserved. */
/** Message flags. */
/** Message context ID. */
#pragma pack()
/**
* Event notification reply.
*/
#pragma pack(1)
typedef struct MptEventNotificationReply
{
/** Event data length. */
/** Message length. */
/** Function number. */
/** Reserved. */
/** Ack required. */
/** Message flags. */
/** Message context ID. */
/** Reserved. */
/** IO controller status. */
/** IO controller log information. */
/** Notification event. */
/** Event context. */
/** Event data. */
#pragma pack()
#define MPT_EVENT_EVENT_CHANGE (0x0000000a)
/**
* FW download request.
*/
#pragma pack(1)
typedef struct MptFWDownloadRequest
{
/** Switch - Turns event notification on and off. */
/** Reserved. */
/** Chain offset. */
/** Function number. */
/** Reserved. */
/** Message flags. */
/** Message context ID. */
#pragma pack()
/**
* FW download reply.
*/
#pragma pack(1)
typedef struct MptFWDownloadReply
{
/** Reserved. */
/** Message length. */
/** Function number. */
/** Reserved. */
/** Message flags. */
/** Message context ID. */
/** Reserved. */
/** IO controller status. */
/** IO controller log information. */
#pragma pack()
/**
* FW upload request.
*/
#pragma pack(1)
typedef struct MptFWUploadRequest
{
/** Requested image type. */
/** Reserved. */
/** Chain offset. */
/** Function number. */
/** Reserved. */
/** Message flags. */
/** Message context ID. */
#pragma pack()
/**
* FW upload reply.
*/
#pragma pack(1)
typedef struct MptFWUploadReply
{
/** Image type. */
/** Reserved. */
/** Message length. */
/** Function number. */
/** Reserved. */
/** Message flags. */
/** Message context ID. */
/** Reserved. */
/** IO controller status. */
/** IO controller log information. */
/** Uploaded image size. */
#pragma pack()
/**
* SCSI IO Request
*/
#pragma pack(1)
typedef struct MptSCSIIORequest
{
/** Target ID */
/** Bus number */
/** Chain offset */
/** Function number. */
/** CDB length. */
/** Sense buffer length. */
/** Reserved */
/** Message flags. */
/** Message context ID. */
/** LUN */
/** Control values. */
/** The CDB. */
/** Data length. */
/** Sense buffer low 32bit address. */
#pragma pack()
#define MPT_SCSIIO_REQUEST_CONTROL_TXDIR_NONE (0x0)
#define MPT_SCSIIO_REQUEST_CONTROL_TXDIR_WRITE (0x1)
#define MPT_SCSIIO_REQUEST_CONTROL_TXDIR_READ (0x2)
/**
* SCSI IO error reply.
*/
#pragma pack(1)
typedef struct MptSCSIIOErrorReply
{
/** Target ID */
/** Bus number */
/** Message length. */
/** Function number. */
/** CDB length */
/** Sense buffer length */
/** Reserved */
/** Message flags */
/** Message context ID */
/** SCSI status. */
/** SCSI state */
/** IO controller status */
/** IO controller log information */
/** Transfer count */
/** Sense count */
/** Response information */
#pragma pack()
#define MPT_SCSI_IO_ERROR_SCSI_STATE_AUTOSENSE_VALID (0x01)
#define MPT_SCSI_IO_ERROR_SCSI_STATE_TERMINATED (0x08)
/**
* IOC status codes specific to the SCSI I/O error reply.
*/
#define MPT_SCSI_IO_ERROR_IOCSTATUS_INVALID_BUS (0x0041)
#define MPT_SCSI_IO_ERROR_IOCSTATUS_INVALID_TARGETID (0x0042)
#define MPT_SCSI_IO_ERROR_IOCSTATUS_DEVICE_NOT_THERE (0x0043)
/**
* SCSI task management request.
*/
#pragma pack(1)
typedef struct MptSCSITaskManagementRequest
{
/** Target ID */
/** Bus number */
/** Chain offset */
/** Function number */
/** Reserved */
/** Task type */
/** Reserved */
/** Message flags */
/** Message context ID */
/** LUN */
/** Reserved */
/** Task message context ID. */
#pragma pack()
/**
* SCSI task management reply.
*/
#pragma pack(1)
typedef struct MptSCSITaskManagementReply
{
/** Target ID */
/** Bus number */
/** Message length */
/** Function number */
/** Reserved */
/** Task type */
/** Reserved */
/** Message flags */
/** Message context ID */
/** Reserved */
/** IO controller status */
/** IO controller log information */
/** Termination count */
#pragma pack()
/**
* Page address for SAS expander page types.
*/
#pragma pack(1)
typedef union MptConfigurationPageAddressSASExpander
{
struct
{
} Form0And2;
struct
{
} Form1;
#pragma pack()
/**
* Page address for SAS device page types.
*/
#pragma pack(1)
typedef union MptConfigurationPageAddressSASDevice
{
struct
{
} Form0And2;
struct
{
} Form1;
#pragma pack()
/**
* Page address for SAS PHY page types.
*/
#pragma pack(1)
typedef union MptConfigurationPageAddressSASPHY
{
struct
{
} Form0;
struct
{
} Form1;
#pragma pack()
/**
* Page address for SAS Enclosure page types.
*/
#pragma pack(1)
typedef struct MptConfigurationPageAddressSASEnclosure
{
#pragma pack()
/**
* Union of all possible address types.
*/
#pragma pack(1)
typedef union MptConfigurationPageAddress
{
/** 32bit view. */
struct
{
/** Port number to get the configuration page for. */
/** Reserved. */
struct
{
/** Target ID to get the configuration page for. */
/** Bus number to get the configuration page for. */
/** Reserved. */
#pragma pack()
/**
* Configuration request
*/
#pragma pack(1)
typedef struct MptConfigurationRequest
{
/** Action code. */
/** Reserved. */
/** Chain offset. */
/** Function number. */
/** Extended page length. */
/** Extended page type */
/** Message flags. */
/** Message context ID. */
/** Reserved. */
/** Version number of the page. */
/** Length of the page in 32bit Dwords. */
/** Page number to access. */
/** Type of the page being accessed. */
/** Page type dependent address. */
/** Simple SG element describing the buffer. */
#pragma pack()
/** Possible action codes. */
#define MPT_CONFIGURATION_REQUEST_ACTION_HEADER (0x00)
#define MPT_CONFIGURATION_REQUEST_ACTION_READ_CURRENT (0x01)
#define MPT_CONFIGURATION_REQUEST_ACTION_WRITE_CURRENT (0x02)
#define MPT_CONFIGURATION_REQUEST_ACTION_DEFAULT (0x03)
#define MPT_CONFIGURATION_REQUEST_ACTION_WRITE_NVRAM (0x04)
#define MPT_CONFIGURATION_REQUEST_ACTION_READ_DEFAULT (0x05)
#define MPT_CONFIGURATION_REQUEST_ACTION_READ_NVRAM (0x06)
/** Page type codes. */
#define MPT_CONFIGURATION_REQUEST_PAGE_TYPE_IO_UNIT (0x00)
#define MPT_CONFIGURATION_REQUEST_PAGE_TYPE_IOC (0x01)
#define MPT_CONFIGURATION_REQUEST_PAGE_TYPE_BIOS (0x02)
#define MPT_CONFIGURATION_REQUEST_PAGE_TYPE_SCSI_PORT (0x03)
#define MPT_CONFIGURATION_REQUEST_PAGE_TYPE_EXTENDED (0x0F)
/**
* Configuration reply.
*/
#pragma pack(1)
typedef struct MptConfigurationReply
{
/** Action code. */
/** Reserved. */
/** Message length. */
/** Function number. */
/** Extended page length. */
/** Extended page type */
/** Message flags. */
/** Message context ID. */
/** Reserved. */
/** I/O controller status. */
/** I/O controller log information. */
/** Version number of the page. */
/** Length of the page in 32bit Dwords. */
/** Page number to access. */
/** Type of the page being accessed. */
#pragma pack()
/** Additional I/O controller status codes for the configuration reply. */
#define MPT_IOCSTATUS_CONFIG_INVALID_ACTION (0x0020)
#define MPT_IOCSTATUS_CONFIG_INVALID_TYPE (0x0021)
#define MPT_IOCSTATUS_CONFIG_INVALID_PAGE (0x0022)
#define MPT_IOCSTATUS_CONFIG_INVALID_DATA (0x0023)
#define MPT_IOCSTATUS_CONFIG_NO_DEFAULTS (0x0024)
#define MPT_IOCSTATUS_CONFIG_CANT_COMMIT (0x0025)
/**
* Union of all possible request messages.
*/
typedef union MptRequestUnion
{
/**
* Union of all possible reply messages.
*/
typedef union MptReplyUnion
{
/** 16bit view. */
/**
* Configuration Page attributes.
*/
#define MPT_CONFIGURATION_PAGE_ATTRIBUTE_READONLY (0x00)
#define MPT_CONFIGURATION_PAGE_ATTRIBUTE_CHANGEABLE (0x10)
#define MPT_CONFIGURATION_PAGE_ATTRIBUTE_PERSISTENT (0x20)
#define MPT_CONFIGURATION_PAGE_ATTRIBUTE_PERSISTENT_READONLY (0x30)
/**
* Configuration Page types.
*/
#define MPT_CONFIGURATION_PAGE_TYPE_IO_UNIT (0x00)
#define MPT_CONFIGURATION_PAGE_TYPE_IOC (0x01)
#define MPT_CONFIGURATION_PAGE_TYPE_BIOS (0x02)
#define MPT_CONFIGURATION_PAGE_TYPE_SCSI_SPI_PORT (0x03)
#define MPT_CONFIGURATION_PAGE_TYPE_SCSI_SPI_DEVICE (0x04)
#define MPT_CONFIGURATION_PAGE_TYPE_MANUFACTURING (0x09)
#define MPT_CONFIGURATION_PAGE_TYPE_EXTENDED (0x0F)
/**
* Extented page types.
*/
#define MPT_CONFIGURATION_PAGE_TYPE_EXTENDED_SASIOUNIT (0x10)
#define MPT_CONFIGURATION_PAGE_TYPE_EXTENDED_SASEXPANDER (0x11)
#define MPT_CONFIGURATION_PAGE_TYPE_EXTENDED_SASDEVICE (0x12)
#define MPT_CONFIGURATION_PAGE_TYPE_EXTENDED_SASPHYS (0x13)
#define MPT_CONFIGURATION_PAGE_TYPE_EXTENDED_LOG (0x14)
#define MPT_CONFIGURATION_PAGE_TYPE_EXTENDED_ENCLOSURE (0x15)
/**
* Configuration Page header - Common to all pages.
*/
#pragma pack(1)
typedef struct MptConfigurationPageHeader
{
/** Version of the page. */
/** The length of the page in 32bit D-Words. */
/** Number of the page. */
/** Type of the page. */
#pragma pack()
/**
* Extended configuration page header - Common to all extended pages.
*/
#pragma pack(1)
typedef struct MptExtendedConfigurationPageHeader
{
/** Version of the page. */
/** Reserved. */
/** Number of the page. */
/** Type of the page. */
/** Extended page length. */
/** Extended page type. */
/** Reserved */
#pragma pack()
/**
* Manufacturing page 0. - Readonly.
*/
#pragma pack(1)
typedef struct MptConfigurationPageManufacturing0
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Name of the chip. */
/** Chip revision. */
/** Board name. */
/** Board assembly. */
/** Board tracer number. */
} fields;
} u;
#pragma pack()
/**
* Manufacturing page 1. - Readonly Persistent.
*/
#pragma pack(1)
typedef struct MptConfigurationPageManufacturing1
{
/** Union */
union
{
/** Byte view */
/** Field view */
struct
{
/** The omnipresent header. */
/** VPD info - don't know what belongs here so all zero. */
} fields;
} u;
#pragma pack()
/**
* Manufacturing page 2. - Readonly.
*/
#pragma pack(1)
typedef struct MptConfigurationPageManufacturing2
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** PCI Device ID. */
/** PCI Revision ID. */
/** Reserved. */
/** Hardware specific settings... */
} fields;
} u;
#pragma pack()
/**
* Manufacturing page 3. - Readonly.
*/
#pragma pack(1)
typedef struct MptConfigurationPageManufacturing3
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** PCI Device ID. */
/** PCI Revision ID. */
/** Reserved. */
/** Chip specific settings... */
} fields;
} u;
#pragma pack()
/**
* Manufacturing page 4. - Readonly.
*/
#pragma pack(1)
typedef struct MptConfigurationPageManufacturing4
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Reserved. */
/** InfoOffset0. */
/** Info size. */
/** InfoOffset1. */
/** Info size. */
/** Size of the inquiry data. */
/** Reserved. */
/** Inquiry data. */
/** IS volume settings. */
/** IME volume settings. */
/** IM volume settings. */
} fields;
} u;
#pragma pack()
/**
* Manufacturing page 5 - Readonly.
*/
#pragma pack(1)
typedef struct MptConfigurationPageManufacturing5
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Base WWID. */
/** Flags */
/** Number of ForceWWID fields in this page. */
/** Reserved */
/** Reserved */
/** ForceWWID entries Maximum of 8 because the SAS controller doesn't has more */
} fields;
} u;
#pragma pack()
/**
* Manufacturing page 6 - Readonly.
*/
#pragma pack(1)
typedef struct MptConfigurationPageManufacturing6
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Product specific data - 0 for now */
} fields;
} u;
#pragma pack()
/**
* Manufacutring page 7 - PHY element.
*/
#pragma pack(1)
typedef struct MptConfigurationPageManufacturing7PHY
{
/** Pinout */
/** Connector name */
/** Location */
/** reserved */
/** Slot */
#pragma pack()
/**
* Manufacturing page 7 - Readonly.
*/
#pragma pack(1)
typedef struct MptConfigurationPageManufacturing7
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Reserved */
/** Flags */
/** Enclosure name */
/** Number of PHYs */
/** Reserved */
/** PHY list for the SAS controller - variable depending on the number of ports */
} fields;
} u;
#pragma pack()
AssertCompileSize(MptConfigurationPageManufacturing7, 36+sizeof(MptConfigurationPageManufacturing7PHY));
#define LSILOGICSCSI_MANUFACTURING7_GET_SIZE(ports) (sizeof(MptConfigurationPageManufacturing7) + ((ports) - 1) * sizeof(MptConfigurationPageManufacturing7PHY))
/** Flags for the flags field */
/** Flags for the pinout field */
#define LSILOGICSCSI_MANUFACTURING7_PINOUT_UNKNOWN RT_BIT(0)
/** Flags for the location field */
#define LSILOGICSCSI_MANUFACTURING7_LOCATION_UNKNOWN 0x01
#define LSILOGICSCSI_MANUFACTURING7_LOCATION_INTERNAL 0x02
#define LSILOGICSCSI_MANUFACTURING7_LOCATION_EXTERNAL 0x04
#define LSILOGICSCSI_MANUFACTURING7_LOCATION_SWITCHABLE 0x08
#define LSILOGICSCSI_MANUFACTURING7_LOCATION_AUTO 0x10
#define LSILOGICSCSI_MANUFACTURING7_LOCATION_NOT_PRESENT 0x20
#define LSILOGICSCSI_MANUFACTURING7_LOCATION_NOT_CONNECTED 0x80
/**
* Manufacturing page 8 - Readonly.
*/
#pragma pack(1)
typedef struct MptConfigurationPageManufacturing8
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Product specific information */
} fields;
} u;
#pragma pack()
/**
* Manufacturing page 9 - Readonly.
*/
#pragma pack(1)
typedef struct MptConfigurationPageManufacturing9
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Product specific information */
} fields;
} u;
#pragma pack()
/**
* Manufacturing page 10 - Readonly.
*/
#pragma pack(1)
typedef struct MptConfigurationPageManufacturing10
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Product specific information */
} fields;
} u;
#pragma pack()
/**
* IO Unit page 0. - Readonly.
*/
#pragma pack(1)
typedef struct MptConfigurationPageIOUnit0
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** A unique identifier. */
} fields;
} u;
#pragma pack()
/**
*/
#pragma pack(1)
typedef struct MptConfigurationPageIOUnit1
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Flag whether this is a single function PCI device. */
unsigned fSingleFunction: 1;
/** Flag whether all possible paths to a device are mapped. */
unsigned fAllPathsMapped: 1;
/** Reserved. */
unsigned u4Reserved: 4;
/** Flag whether all RAID functionality is disabled. */
unsigned fIntegratedRAIDDisabled: 1;
/** Flag whether 32bit PCI accesses are forced. */
unsigned f32BitAccessForced: 1;
/** Reserved. */
unsigned abReserved: 24;
} fields;
} u;
#pragma pack()
/**
* Adapter Ordering.
*/
#pragma pack(1)
typedef struct MptConfigurationPageIOUnit2AdapterOrdering
{
/** PCI bus number. */
unsigned u8PCIBusNumber: 8;
/** PCI device and function number. */
unsigned u8PCIDevFn: 8;
/** Flag whether the adapter is embedded. */
unsigned fAdapterEmbedded: 1;
/** Flag whether the adapter is enabled. */
unsigned fAdapterEnabled: 1;
/** Reserved. */
unsigned u6Reserved: 6;
/** Reserved. */
unsigned u8Reserved: 8;
#pragma pack()
/**
*/
#pragma pack(1)
typedef struct MptConfigurationPageIOUnit2
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Reserved. */
unsigned fReserved: 1;
/** Flag whether Pause on error is enabled. */
unsigned fPauseOnError: 1;
/** Flag whether verbose mode is enabled. */
unsigned fVerboseModeEnabled: 1;
/** Set to disable color video. */
unsigned fDisableColorVideo: 1;
/** Flag whether int 40h is hooked. */
unsigned fNotHookInt40h: 1;
/** Reserved. */
unsigned u3Reserved: 3;
/** Reserved. */
unsigned abReserved: 24;
/** BIOS version. */
/** Adapter ordering. */
} fields;
} u;
#pragma pack()
/*
*/
#pragma pack(1)
typedef struct MptConfigurationPageIOUnit3
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Number of GPIO values. */
/** Reserved. */
} fields;
} u;
#pragma pack()
/*
* IO Unit page 4. - Readonly for everyone except the BIOS.
*/
#pragma pack(1)
typedef struct MptConfigurationPageIOUnit4
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Reserved */
/** SG entry describing the Firmware location. */
} fields;
} u;
#pragma pack()
/**
* IOC page 0. - Readonly
*/
#pragma pack(1)
typedef struct MptConfigurationPageIOC0
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Total amount of NV memory in bytes. */
/** Number of free bytes in the NV store. */
/** PCI vendor ID. */
/** PCI device ID. */
/** PCI revision ID. */
/** Reserved. */
/** PCI class code. */
/** Subsystem vendor Id. */
/** Subsystem Id. */
} fields;
} u;
#pragma pack()
/**
*/
#pragma pack(1)
typedef struct MptConfigurationPageIOC1
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Flag whether reply coalescing is enabled. */
unsigned fReplyCoalescingEnabled: 1;
/** Reserved. */
unsigned u31Reserved: 31;
/** Coalescing Timeout in microseconds. */
unsigned u32CoalescingTimeout: 32;
/** Coalescing depth. */
unsigned u8CoalescingDepth: 8;
/** Reserved. */
unsigned u8Reserved0: 8;
unsigned u8Reserved1: 8;
unsigned u8Reserved2: 8;
} fields;
} u;
#pragma pack()
/**
* IOC page 2. - Readonly
*/
#pragma pack(1)
typedef struct MptConfigurationPageIOC2
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Flag whether striping is supported. */
unsigned fStripingSupported: 1;
/** Flag whether enhanced mirroring is supported. */
unsigned fEnhancedMirroringSupported: 1;
/** Flag whether mirroring is supported. */
unsigned fMirroringSupported: 1;
/** Reserved. */
unsigned u26Reserved: 26;
/** Flag whether SES is supported. */
unsigned fSESSupported: 1;
/** Flag whether SAF-TE is supported. */
unsigned fSAFTESupported: 1;
/** Flag whether cross channel volumes are supported. */
unsigned fCrossChannelVolumesSupported: 1;
/** Number of active integrated RAID volumes. */
unsigned u8NumActiveVolumes: 8;
/** Maximum number of integrated RAID volumes supported. */
unsigned u8MaxVolumes: 8;
/** Number of active integrated RAID physical disks. */
unsigned u8NumActivePhysDisks: 8;
/** Maximum number of integrated RAID physical disks supported. */
unsigned u8MaxPhysDisks: 8;
/** RAID volumes... - not supported. */
} fields;
} u;
#pragma pack()
/**
* IOC page 3. - Readonly
*/
#pragma pack(1)
typedef struct MptConfigurationPageIOC3
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Number of active integrated RAID physical disks. */
/** Reserved. */
} fields;
} u;
#pragma pack()
/**
*/
#pragma pack(1)
typedef struct MptConfigurationPageIOC4
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Number of SEP entries in this page. */
/** Maximum number of SEp entries supported. */
/** Reserved. */
/** SEP entries... - not supported. */
} fields;
} u;
#pragma pack()
/**
*/
#pragma pack(1)
typedef struct MptConfigurationPageIOC6
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
} fields;
} u;
#pragma pack()
/**
*/
#pragma pack(1)
typedef struct MptConfigurationPageBIOS1
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** BIOS options */
/** IOC settings */
/** Reserved */
/** Device settings */
/** Number of devices */
/** Expander spinup */
/** Reserved */
/** I/O timeout of block devices without removable media */
/** I/O timeout sequential */
/** I/O timeout other */
/** I/O timeout of block devices with removable media */
} fields;
} u;
#pragma pack()
#define LSILOGICSCSI_BIOS1_IOCSETTINGS_ADAPTER_SUPPORT_SET(x) ((x) << 4)
#define LSILOGICSCSI_BIOS1_IOCSETTINGS_ADAPTER_SUPPORT_BOT 0x03
#define LSILOGICSCSI_BIOS1_IOCSETTINGS_REMOVABLE_MEDIA_SET(x) ((x) << 6)
#define LSILOGICSCSI_BIOS1_EXPANDERSPINUP_SPINUP_DELAY_SET(x) ((x) & 0x0F)
#define LSILOGICSCSI_BIOS1_EXPANDERSPINUP_SPINUP_DELAY_GET(x) ((x) & 0x0F)
/**
*/
#pragma pack(1)
typedef struct MptConfigurationPageBIOS2
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Reserved */
/** Format of the boot device field. */
/** Previous format of the boot device field. */
/** Reserved */
/** Boot device fields - dependent on the format */
union
{
/** Device for AdapterNumber:Bus:Target:LUN */
struct
{
/** Target ID */
/** Bus */
/** Adapter Number */
/** Reserved */
/** Reserved */
/** LUN */
/** Reserved */
/** Device for PCIAddress:Bus:Target:LUN */
struct
{
/** Target ID */
/** Bus */
/** Adapter Number */
/** Reserved */
/** LUN */
/** Reserved */
/** Device for PCISlotNo:Bus:Target:LUN */
struct
{
/** Target ID */
/** Bus */
/** PCI Slot Number */
/** Reserved */
/** LUN */
/** Reserved */
/** Device for FC channel world wide name */
struct
{
/** World wide port name low */
/** World wide port name high */
/** Reserved */
/** LUN */
/** Reserved */
/** Device for FC channel world wide name */
struct
{
/** SAS address */
/** Reserved */
/** LUN */
/** Reserved */
struct
{
/** Enclosure logical ID */
/** Reserved */
/** LUN */
/** Reserved */
} BootDevice;
} fields;
} u;
#pragma pack()
#define LSILOGICSCSI_BIOS2_BOOT_DEVICE_FORM_SET(x) ((x) & 0x0F)
#define LSILOGICSCSI_BIOS2_BOOT_DEVICE_FORM_FIRST 0x0
#define LSILOGICSCSI_BIOS2_BOOT_DEVICE_FORM_FC_WWN 0x4
#define LSILOGICSCSI_BIOS2_BOOT_DEVICE_FORM_SAS_WWN 0x5
/**
*/
#pragma pack(1)
typedef struct MptConfigurationPageBIOS4
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Reassignment Base WWID */
} fields;
} u;
#pragma pack()
/**
* SCSI-SPI port page 0. - Readonly
*/
#pragma pack(1)
typedef struct MptConfigurationPageSCSISPIPort0
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Flag whether this port is information unit transfers capable. */
unsigned fInformationUnitTransfersCapable: 1;
/** Flag whether the port is DT (Dual Transfer) capable. */
unsigned fDTCapable: 1;
/** Flag whether the port is QAS (Quick Arbitrate and Select) capable. */
unsigned fQASCapable: 1;
/** Reserved. */
unsigned u5Reserved1: 5;
/** Minimum Synchronous transfer period. */
unsigned u8MinimumSynchronousTransferPeriod: 8;
/** Maximum synchronous offset. */
unsigned u8MaximumSynchronousOffset: 8;
/** Reserved. */
unsigned u5Reserved2: 5;
/** Flag whether indicating the width of the bus - 0 narrow and 1 for wide. */
unsigned fWide: 1;
/** Reserved */
unsigned fReserved: 1;
/** Flag whether the port is AIP (Asynchronous Information Protection) capable. */
unsigned fAIPCapable: 1;
/** Signaling Type. */
unsigned u2SignalingType: 2;
/** Reserved. */
unsigned u30Reserved: 30;
} fields;
} u;
#pragma pack()
/**
*/
#pragma pack(1)
typedef struct MptConfigurationPageSCSISPIPort1
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** The SCSI ID of the port. */
/** Reserved. */
/** Port response IDs Bit mask field. */
/** Value for the on BUS timer. */
} fields;
} u;
#pragma pack()
/**
* Device settings for one device.
*/
#pragma pack(1)
typedef struct MptDeviceSettings
{
/** Timeout for I/O in seconds. */
unsigned u8Timeout: 8;
/** Minimum synchronous factor. */
unsigned u8SyncFactor: 8;
/** Flag whether disconnect is enabled. */
unsigned fDisconnectEnable: 1;
/** Flag whether Scan ID is enabled. */
unsigned fScanIDEnable: 1;
/** Flag whether Scan LUNs is enabled. */
unsigned fScanLUNEnable: 1;
/** Flag whether tagged queuing is enabled. */
unsigned fTaggedQueuingEnabled: 1;
/** Flag whether wide is enabled. */
unsigned fWideDisable: 1;
/** Flag whether this device is bootable. */
unsigned fBootChoice: 1;
/** Reserved. */
unsigned u10Reserved: 10;
#pragma pack()
/**
*/
#pragma pack(1)
typedef struct MptConfigurationPageSCSISPIPort2
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Flag indicating the bus scan order. */
unsigned fBusScanOrderHighToLow: 1;
/** Reserved. */
unsigned fReserved: 1;
/** Flag whether SCSI Bus resets are avoided. */
unsigned fAvoidSCSIBusResets: 1;
/** Flag whether alternate CHS is used. */
unsigned fAlternateCHS: 1;
/** Flag whether termination is disabled. */
unsigned fTerminationDisabled: 1;
/** Reserved. */
unsigned u27Reserved: 27;
/** Host SCSI ID. */
unsigned u4HostSCSIID: 4;
/** Initialize HBA. */
unsigned u2InitializeHBA: 2;
/** Removeable media setting. */
unsigned u2RemovableMediaSetting: 2;
/** Spinup delay. */
unsigned u4SpinupDelay: 4;
/** Negotiating settings. */
unsigned u2NegotitatingSettings: 2;
/** Reserved. */
unsigned u18Reserved: 18;
/** Device Settings. */
} fields;
} u;
#pragma pack()
/**
* SCSI-SPI device page 0. - Readonly
*/
#pragma pack(1)
typedef struct MptConfigurationPageSCSISPIDevice0
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Negotiated Parameters. */
/** Information Units enabled. */
unsigned fInformationUnitsEnabled: 1;
/** Dual Transfers Enabled. */
unsigned fDTEnabled: 1;
/** QAS enabled. */
unsigned fQASEnabled: 1;
/** Reserved. */
unsigned u5Reserved1: 5;
/** Synchronous Transfer period. */
unsigned u8NegotiatedSynchronousTransferPeriod: 8;
/** Synchronous offset. */
unsigned u8NegotiatedSynchronousOffset: 8;
/** Reserved. */
unsigned u5Reserved2: 5;
/** Width - 0 for narrow and 1 for wide. */
unsigned fWide: 1;
/** Reserved. */
unsigned fReserved: 1;
/** AIP enabled. */
unsigned fAIPEnabled: 1;
/** Flag whether negotiation occurred. */
unsigned fNegotationOccured: 1;
/** Flag whether a SDTR message was rejected. */
unsigned fSDTRRejected: 1;
/** Flag whether a WDTR message was rejected. */
unsigned fWDTRRejected: 1;
/** Flag whether a PPR message was rejected. */
unsigned fPPRRejected: 1;
/** Reserved. */
unsigned u28Reserved: 28;
} fields;
} u;
#pragma pack()
/**
*/
#pragma pack(1)
typedef struct MptConfigurationPageSCSISPIDevice1
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Requested Parameters. */
/** Information Units enable. */
bool fInformationUnitsEnable: 1;
/** Dual Transfers Enable. */
bool fDTEnable: 1;
/** QAS enable. */
bool fQASEnable: 1;
/** Reserved. */
unsigned u5Reserved1: 5;
/** Synchronous Transfer period. */
unsigned u8NegotiatedSynchronousTransferPeriod: 8;
/** Synchronous offset. */
unsigned u8NegotiatedSynchronousOffset: 8;
/** Reserved. */
unsigned u5Reserved2: 5;
/** Width - 0 for narrow and 1 for wide. */
bool fWide: 1;
/** Reserved. */
bool fReserved1: 1;
/** AIP enable. */
bool fAIPEnable: 1;
/** Reserved. */
bool fReserved2: 1;
/** WDTR disallowed. */
bool fWDTRDisallowed: 1;
/** SDTR disallowed. */
bool fSDTRDisallowed: 1;
/** Reserved. */
unsigned u29Reserved: 29;
} fields;
} u;
#pragma pack()
/**
*/
#pragma pack(1)
typedef struct MptConfigurationPageSCSISPIDevice2
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Reserved. */
unsigned u4Reserved: 4;
/** ISI enable. */
unsigned fISIEnable: 1;
/** Secondary driver enable. */
unsigned fSecondaryDriverEnable: 1;
/** Reserved. */
unsigned fReserved: 1;
/** Slew create controller. */
unsigned u3SlewRateControler: 3;
/** Primary drive strength controller. */
unsigned u3PrimaryDriveStrengthControl: 3;
/** Secondary drive strength controller. */
unsigned u3SecondaryDriveStrengthControl: 3;
/** Reserved. */
unsigned u12Reserved: 12;
/** XCLKH_ST. */
unsigned fXCLKH_ST: 1;
/** XCLKS_ST. */
unsigned fXCLKS_ST: 1;
/** XCLKH_DT. */
unsigned fXCLKH_DT: 1;
/** XCLKS_DT. */
unsigned fXCLKS_DT: 1;
/** Parity pipe select. */
unsigned u2ParityPipeSelect: 2;
/** Reserved. */
unsigned u30Reserved: 30;
/** Data bit pipeline select. */
unsigned u32DataPipelineSelect: 32;
} fields;
} u;
#pragma pack()
/**
* SCSI-SPI device page 3 (Revision G). - Readonly
*/
#pragma pack(1)
typedef struct MptConfigurationPageSCSISPIDevice3
{
/** Union. */
union
{
/** Byte view. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Number of times the IOC rejected a message because it doesn't support the operation. */
/** Number of times the SCSI bus entered an invalid operation state. */
/** Number of parity errors. */
/** Reserved. */
} fields;
} u;
#pragma pack()
/**
* PHY entry for the SAS I/O unit page 0
*/
#pragma pack(1)
typedef struct MptConfigurationPageSASIOUnit0PHY
{
/** Port number */
/** Port flags */
/** Phy flags */
/** negotiated link rate */
/** Controller phy device info */
/** Attached device handle */
/** Controller device handle */
/** Discovery status */
#pragma pack()
/**
* SAS I/O Unit page 0 - Readonly
*/
#pragma pack(1)
typedef struct MptConfigurationPageSASIOUnit0
{
/** Union. */
union
{
/** Byte view - variable. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Nvdata version default */
/** Nvdata version persistent */
/** Number of physical ports */
/** Reserved */
/** Content for each physical port - variable depending on the amount of ports. */
} fields;
} u;
#pragma pack()
AssertCompileSize(MptConfigurationPageSASIOUnit0, 8+2+2+1+3+sizeof(MptConfigurationPageSASIOUnit0PHY));
#define LSILOGICSCSI_SASIOUNIT0_GET_SIZE(ports) (sizeof(MptConfigurationPageSASIOUnit0) + ((ports) - 1) * sizeof(MptConfigurationPageSASIOUnit0PHY))
#define LSILOGICSCSI_SASIOUNIT0_PHY_RX_INVERTED RT_BIT(0)
#define LSILOGICSCSI_SASIOUNIT0_NEGOTIATED_RATE_SET(x) ((x) & 0x0F)
#define LSILOGICSCSI_SASIOUNIT0_NEGOTIATED_RATE_GET(x) ((x) & 0x0F)
#define LSILOGICSCSI_SASIOUNIT0_NEGOTIATED_RATE_UNKNOWN 0x00
#define LSILOGICSCSI_SASIOUNIT0_NEGOTIATED_RATE_DISABLED 0x01
#define LSILOGICSCSI_SASIOUNIT0_NEGOTIATED_RATE_FAILED 0x02
#define LSILOGICSCSI_SASIOUNIT0_NEGOTIATED_RATE_SATA_OOB 0x03
#define LSILOGICSCSI_SASIOUNIT0_NEGOTIATED_RATE_15GB 0x08
#define LSILOGICSCSI_SASIOUNIT0_NEGOTIATED_RATE_30GB 0x09
#define LSILOGICSCSI_SASIOUNIT0_DEVICE_TYPE_SET(x) ((x) & 0x3)
#define LSILOGICSCSI_SASIOUNIT0_DEVICE_TYPE_NO 0x0
#define LSILOGICSCSI_SASIOUNIT0_DEVICE_TYPE_END 0x1
/**
* PHY entry for the SAS I/O unit page 1
*/
#pragma pack(1)
typedef struct MptConfigurationPageSASIOUnit1PHY
{
/** Port number */
/** Port flags */
/** Phy flags */
/** Max link rate */
/** Controller phy device info */
/** Maximum target port connect time */
/** Reserved */
#pragma pack()
/**
*/
#pragma pack(1)
typedef struct MptConfigurationPageSASIOUnit1
{
/** Union. */
union
{
/** Byte view - variable. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Control flags */
/** maximum number of SATA targets */
/** additional control flags */
/** Reserved */
/** Number of PHYs */
/** maximum SATA queue depth */
/** Delay for reporting missing devices. */
/** I/O device missing delay */
/** Content for each physical port - variable depending on the number of ports */
} fields;
} u;
#pragma pack()
#define LSILOGICSCSI_SASIOUNIT1_GET_SIZE(ports) (sizeof(MptConfigurationPageSASIOUnit1) + ((ports) - 1) * sizeof(MptConfigurationPageSASIOUnit1PHY))
#define LSILOGICSCSI_SASIOUNIT1_CONTROL_DEVICE_SUPPORT_SAS 0x01
#define LSILOGICSCSI_SASIOUNIT1_CONTROL_DEVICE_SUPPORT_SATA 0x02
#define LSILOGICSCSI_SASIOUNIT1_MISSING_DEVICE_DELAY_SET(x) ((x) & 0x7F)
#define LSILOGICSCSI_SASIOUNIT1_MISSING_DEVICE_DELAY_GET(x) ((x) & 0x7F)
#define LSILOGICSCSI_SASIOUNIT1_PHY_RX_INVERT RT_BIT(0)
#define LSILOGICSCSI_SASIOUNIT1_LINK_RATE_MIN_SET(x) ((x) & 0x0F)
#define LSILOGICSCSI_SASIOUNIT1_LINK_RATE_MIN_GET(x) ((x) & 0x0F)
#define LSILOGICSCSI_SASIOUNIT1_LINK_RATE_15GB 0x8
#define LSILOGICSCSI_SASIOUNIT1_LINK_RATE_30GB 0x9
#define LSILOGICSCSI_SASIOUNIT1_CTL_PHY_DEVICE_TYPE_SET(x) ((x) & 0x3)
#define LSILOGICSCSI_SASIOUNIT1_CTL_PHY_DEVICE_TYPE_GET(x) ((x) & 0x3)
#define LSILOGICSCSI_SASIOUNIT1_CTL_PHY_DEVICE_TYPE_NO 0x0
#define LSILOGICSCSI_SASIOUNIT1_CTL_PHY_DEVICE_TYPE_END 0x1
/**
*/
#pragma pack(1)
typedef struct MptConfigurationPageSASIOUnit2
{
/** Union. */
union
{
/** Byte view - variable. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Device numbers per enclosure */
/** Boot device wait time */
/** Reserved */
/** Maximum number of persistent Bus and target ID mappings */
/** Number of persistent IDs used */
/** Status */
/** Flags */
/** Maximum number of physical mapped IDs */
} fields;
} u;
#pragma pack()
/**
*/
#pragma pack(1)
typedef struct MptConfigurationPageSASIOUnit3
{
/** Union. */
union
{
/** Byte view - variable. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Reserved */
} fields;
} u;
#pragma pack()
/**
* SAS PHY page 0 - Readonly
*/
#pragma pack(1)
typedef struct MptConfigurationPageSASPHY0
{
/** Union. */
union
{
/** Byte view - variable. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Owner dev handle. */
/** Reserved */
/** SAS address */
/** Attached device handle */
/** Attached phy identifier */
/** Reserved */
/** Attached device information */
/** Programmed link rate */
/** Hardware link rate */
/** Change count */
/** Flags */
/** Phy information */
} fields;
} u;
#pragma pack()
#define LSILOGICSCSI_SASPHY0_DEV_INFO_DEVICE_TYPE_SET(x) ((x) & 0x3)
#define LSILOGICSCSI_SASPHY0_DEV_INFO_DEVICE_TYPE_GET(x) ((x) & 0x3)
#define LSILOGICSCSI_SASPHY0_DEV_INFO_DEVICE_TYPE_NO 0x0
#define LSILOGICSCSI_SASPHY0_DEV_INFO_DEVICE_TYPE_END 0x1
/**
* SAS PHY page 1 - Readonly
*/
#pragma pack(1)
typedef struct MptConfigurationPageSASPHY1
{
/** Union. */
union
{
/** Byte view - variable. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Reserved */
} fields;
} u;
#pragma pack()
/**
* SAS Device page 0 - Readonly
*/
#pragma pack(1)
typedef struct MptConfigurationPageSASDevice0
{
/** Union. */
union
{
/** Byte view - variable. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Slot number */
/** Enclosure handle. */
/** SAS address */
/** Parent device handle */
/** Phy number */
/** Access status */
/** Device handle */
/** Target ID */
/** Bus */
/** Device info */
/** Flags */
/** Physical port */
/** Reserved */
} fields;
} u;
#pragma pack()
#define LSILOGICSCSI_SASDEVICE0_STATUS_NO_ERRORS (0x00)
#define LSILOGICSCSI_SASDEVICE0_DEV_INFO_DEVICE_TYPE_SET(x) ((x) & 0x3)
#define LSILOGICSCSI_SASDEVICE0_DEV_INFO_DEVICE_TYPE_GET(x) ((x) & 0x3)
#define LSILOGICSCSI_SASDEVICE0_DEV_INFO_DEVICE_TYPE_NO 0x0
#define LSILOGICSCSI_SASDEVICE0_DEV_INFO_DEVICE_TYPE_END 0x1
#define LSILOGICSCSI_SASDEVICE0_FLAGS_DEVICE_PRESENT (RT_BIT(0))
/**
* SAS Device page 1 - Readonly
*/
#pragma pack(1)
typedef struct MptConfigurationPageSASDevice1
{
/** Union. */
union
{
/** Byte view - variable. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Reserved */
/** SAS address */
/** Reserved */
/** Device handle */
/** Target ID */
/** Bus */
/** Initial REgister device FIS */
} fields;
} u;
#pragma pack()
/**
*/
#pragma pack(1)
typedef struct MptConfigurationPageSASDevice2
{
/** Union. */
union
{
/** Byte view - variable. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Physical identifier */
/** Enclosure mapping */
} fields;
} u;
#pragma pack()
/**
* A device entitiy containing all pages.
*/
typedef struct MptSASDevice
{
/** Pointer to the next device if any. */
struct MptSASDevice *pNext;
/** Pointer to the previous device if any. */
struct MptSASDevice *pPrev;
/**
* SAS Expander page 0 - Readonly
*/
#pragma pack(1)
typedef struct MptConfigurationPageSASExpander0
{
/** Union. */
union
{
/** Byte view - variable. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Physical port */
/** Reserved */
/** Enclosure handle */
/** SAS address */
/** Discovery status */
/** Device handle. */
/** Parent device handle */
/** Expander change count */
/** Expander route indexes */
/** Number of PHys in this expander */
/** SAS level */
/** Flags */
/** Reserved */
} fields;
} u;
#pragma pack()
/**
* SAS Expander page 1 - Readonly
*/
#pragma pack(1)
typedef struct MptConfigurationPageSASExpander1
{
/** Union. */
union
{
/** Byte view - variable. */
/** Field view. */
struct
{
/** The omnipresent header. */
/** Physical port */
/** Reserved */
/** Number of PHYs */
/** Number of the Phy the information in this page is for. */
/** Number of routing table entries */
/** Programmed link rate */
/** Hardware link rate */
/** Attached device handle */
/** Phy information */
/** Attached device information */
/** Owner device handle. */
/** Change count */
/** Negotiated link rate */
/** Phy identifier */
/** Attached phy identifier */
/** Reserved */
/** Discovery information */
/** Reserved */
} fields;
} u;
#pragma pack()
/**
* Structure of all supported pages for the SCSI SPI controller.
* Used to load the device state from older versions.
*/
typedef struct MptConfigurationPagesSupported_SSM_V2
{
struct
{
struct
{
struct
{
typedef struct MptConfigurationPagesSpi
{
struct
{
struct
{
struct
{
typedef struct MptPHY
{
#pragma pack(1)
typedef struct MptConfigurationPagesSas
{
/** Size of the manufacturing page 7 */
/** Pointer to the manufacturing page 7 */
/** Size of the I/O unit page 0 */
/** Pointer to the I/O unit page 0 */
/** Size of the I/O unit page 1 */
/** Pointer to the I/O unit page 1 */
/** I/O unit page 2 */
/** I/O unit page 3 */
/** Number of PHYs in the array. */
/** Pointer to an array of per PHYS pages. */
/** Number of devices detected. */
/** Pointer to the first SAS device. */
/** Pointer to the last SAS device. */
#pragma pack()
/**
* Structure of all supported pages for both controllers.
*/
typedef struct MptConfigurationPagesSupported
{
/* BIOS page 0 is not described */
/* BIOS page 3 is not described */
/** Controller dependent data. */
union
{
} u;
/**
* Initializes a page header.
*/
/**
* Initializes a extended page header.
*/
/**
* Possible SG element types.
*/
enum MPTSGENTRYTYPE
{
MPTSGENTRYTYPE_SIMPLE = 0x01,
MPTSGENTRYTYPE_CHAIN = 0x03
};
/**
* Register interface.
*/
/**
* Defined states that the SCSI controller can have.
*/
typedef enum LSILOGICSTATE
{
/** Reset state. */
LSILOGICSTATE_RESET = 0x00,
/** Ready state. */
LSILOGICSTATE_READY = 0x01,
/** Operational state. */
LSILOGICSTATE_OPERATIONAL = 0x02,
/** Fault state. */
LSILOGICSTATE_FAULT = 0x04,
/** 32bit size hack */
LSILOGICSTATE_32BIT_HACK = 0x7fffffff
/**
* Which entity needs to initialize the controller
* to get into the operational state.
*/
typedef enum LSILOGICWHOINIT
{
/** Not initialized. */
LSILOGICWHOINIT_NOT_INITIALIZED = 0x00,
/** System BIOS. */
LSILOGICWHOINIT_SYSTEM_BIOS = 0x01,
/** ROM Bios. */
LSILOGICWHOINIT_ROM_BIOS = 0x02,
/** PCI Peer. */
LSILOGICWHOINIT_PCI_PEER = 0x03,
/** Host driver. */
LSILOGICWHOINIT_HOST_DRIVER = 0x04,
/** Manufacturing. */
LSILOGICWHOINIT_MANUFACTURING = 0x05,
/** 32bit size hack. */
LSILOGICWHOINIT_32BIT_HACK = 0x7fffffff
/**
* IOC status codes.
*/
#define LSILOGIC_IOCSTATUS_SUCCESS 0x0000
#define LSILOGIC_IOCSTATUS_INVALID_FUNCTION 0x0001
#define LSILOGIC_IOCSTATUS_BUSY 0x0002
#define LSILOGIC_IOCSTATUS_INVALID_SGL 0x0003
#define LSILOGIC_IOCSTATUS_INTERNAL_ERROR 0x0004
#define LSILOGIC_IOCSTATUS_RESERVED 0x0005
#define LSILOGIC_IOCSTATUS_INSUFFICIENT_RESOURCES 0x0006
#define LSILOGIC_IOCSTATUS_INVALID_FIELD 0x0007
#define LSILOGIC_IOCSTATUS_INVALID_STATE 0x0008
#define LSILOGIC_IOCSTATUS_OP_STATE_NOT_SUPPOTED 0x0009
/**
* Size of the I/O and MMIO space.
*/
#define LSILOGIC_PCI_SPACE_IO_SIZE 256
/**
* Doorbell register - Used to get the status of the controller and
* initialise it.
*/
#define LSILOGIC_REG_DOORBELL 0x00
/**
* Functions which can be passed through the system doorbell.
*/
#define LSILOGIC_DOORBELL_FUNCTION_IOC_MSG_UNIT_RESET 0x40
#define LSILOGIC_DOORBELL_FUNCTION_IO_UNIT_RESET 0x41
#define LSILOGIC_DOORBELL_FUNCTION_HANDSHAKE 0x42
#define LSILOGIC_DOORBELL_FUNCTION_REPLY_FRAME_REMOVAL 0x43
/**
* Write sequence register for the diagnostic register.
*/
#define LSILOGIC_REG_WRITE_SEQUENCE 0x04
/**
* Diagnostic register - used to reset the controller.
*/
#define LSILOGIC_REG_HOST_DIAGNOSTIC 0x08
# define LSILOGIC_REG_HOST_DIAGNOSTIC_DIAG_MEM_ENABLE (RT_BIT(0))
#define LSILOGIC_REG_TEST_BASE_ADDRESS 0x0c
#define LSILOGIC_REG_DIAG_RW_DATA 0x10
#define LSILOGIC_REG_DIAG_RW_ADDRESS 0x14
/**
* Interrupt status register.
*/
#define LSILOGIC_REG_HOST_INTR_STATUS 0x30
# define LSILOGIC_REG_HOST_INTR_STATUS_SYSTEM_DOORBELL (RT_BIT(0))
/**
* Interrupt mask register.
*/
#define LSILOGIC_REG_HOST_INTR_MASK 0x34
# define LSILOGIC_REG_HOST_INTR_MASK_DOORBELL RT_BIT(0)
/**
* Queue registers.
*/
#define LSILOGIC_REG_REQUEST_QUEUE 0x40
#define LSILOGIC_REG_REPLY_QUEUE 0x44
#endif /* __DEVLSILOGICSCSI_H__ */