drivers/scsi/mpt3sas/mpi/mpi2.h

Source file repositories/reference/linux-study-clean/drivers/scsi/mpt3sas/mpi/mpi2.h

File Facts

System
Linux kernel
Corpus path
drivers/scsi/mpt3sas/mpi/mpi2.h
Extension
.h
Size
50839 bytes
Lines
1308
Domain
Driver Families
Bucket
drivers/scsi
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

#ifndef MPI2_H
#define MPI2_H

/*****************************************************************************
*
*       MPI Version Definitions
*
*****************************************************************************/

#define MPI2_VERSION_MAJOR_MASK             (0xFF00)
#define MPI2_VERSION_MAJOR_SHIFT            (8)
#define MPI2_VERSION_MINOR_MASK             (0x00FF)
#define MPI2_VERSION_MINOR_SHIFT            (0)

/*major version for all MPI v2.x */
#define MPI2_VERSION_MAJOR                  (0x02)

/*minor version for MPI v2.0 compatible products */
#define MPI2_VERSION_MINOR                  (0x00)
#define MPI2_VERSION ((MPI2_VERSION_MAJOR << MPI2_VERSION_MAJOR_SHIFT) | \
					MPI2_VERSION_MINOR)
#define MPI2_VERSION_02_00                  (0x0200)

/*minor version for MPI v2.5 compatible products */
#define MPI25_VERSION_MINOR                 (0x05)
#define MPI25_VERSION ((MPI2_VERSION_MAJOR << MPI2_VERSION_MAJOR_SHIFT) | \
					MPI25_VERSION_MINOR)
#define MPI2_VERSION_02_05                  (0x0205)

/*minor version for MPI v2.6 compatible products */
#define MPI26_VERSION_MINOR		    (0x06)
#define MPI26_VERSION ((MPI2_VERSION_MAJOR << MPI2_VERSION_MAJOR_SHIFT) | \
					MPI26_VERSION_MINOR)
#define MPI2_VERSION_02_06		    (0x0206)


/* Unit and Dev versioning for this MPI header set */
#define MPI2_HEADER_VERSION_UNIT            (0x3E)
#define MPI2_HEADER_VERSION_DEV             (0x00)
#define MPI2_HEADER_VERSION_UNIT_MASK       (0xFF00)
#define MPI2_HEADER_VERSION_UNIT_SHIFT      (8)
#define MPI2_HEADER_VERSION_DEV_MASK        (0x00FF)
#define MPI2_HEADER_VERSION_DEV_SHIFT       (0)
#define MPI2_HEADER_VERSION ((MPI2_HEADER_VERSION_UNIT << 8) | \
					MPI2_HEADER_VERSION_DEV)

/*****************************************************************************
*
*       IOC State Definitions
*
*****************************************************************************/

#define MPI2_IOC_STATE_RESET               (0x00000000)
#define MPI2_IOC_STATE_READY               (0x10000000)
#define MPI2_IOC_STATE_OPERATIONAL         (0x20000000)
#define MPI2_IOC_STATE_FAULT               (0x40000000)
#define MPI2_IOC_STATE_COREDUMP            (0x50000000)

#define MPI2_IOC_STATE_MASK                (0xF0000000)
#define MPI2_IOC_STATE_SHIFT               (28)

/*Fault state range for prodcut specific codes */
#define MPI2_FAULT_PRODUCT_SPECIFIC_MIN                 (0x0000)
#define MPI2_FAULT_PRODUCT_SPECIFIC_MAX                 (0xEFFF)

/*****************************************************************************
*
*       System Interface Register Definitions
*
*****************************************************************************/

typedef struct _MPI2_SYSTEM_INTERFACE_REGS {
	U32 Doorbell;		/*0x00 */
	U32 WriteSequence;	/*0x04 */
	U32 HostDiagnostic;	/*0x08 */
	U32 Reserved1;		/*0x0C */
	U32 DiagRWData;		/*0x10 */
	U32 DiagRWAddressLow;	/*0x14 */
	U32 DiagRWAddressHigh;	/*0x18 */
	U32 Reserved2[5];	/*0x1C */
	U32 HostInterruptStatus;	/*0x30 */
	U32 HostInterruptMask;	/*0x34 */
	U32 DCRData;		/*0x38 */
	U32 DCRAddress;		/*0x3C */
	U32 Reserved3[2];	/*0x40 */
	U32 ReplyFreeHostIndex;	/*0x48 */
	U32 Reserved4[8];	/*0x4C */
	U32 ReplyPostHostIndex;	/*0x6C */
	U32 Reserved5;		/*0x70 */
	U32 HCBSize;		/*0x74 */

Annotation

Implementation Notes