drivers/scsi/isci/registers.h

Source file repositories/reference/linux-study-clean/drivers/scsi/isci/registers.h

File Facts

System
Linux kernel
Corpus path
drivers/scsi/isci/registers.h
Extension
.h
Size
71035 bytes
Lines
1864
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

struct scu_viit_entry {
	/**
	 * This must be encoded as to the type of initiator that is being constructed
	 * for this port.
	 */
	u32 status;

	/**
	 * Virtual initiator high SAS Address
	 */
	u32 initiator_sas_address_hi;

	/**
	 * Virtual initiator low SAS Address
	 */
	u32 initiator_sas_address_lo;

	/**
	 * This must be 0
	 */
	u32 reserved;

};


/* IIT Status Defines */
#define SCU_IIT_ENTRY_ID_MASK                (0xC0000000)
#define SCU_IIT_ENTRY_ID_SHIFT               (30)

#define SCU_IIT_ENTRY_STATUS_UPDATE_MASK     (0x20000000)
#define SCU_IIT_ENTRY_STATUS_UPDATE_SHIFT    (29)

#define SCU_IIT_ENTRY_LPI_MASK               (0x00000F00)
#define SCU_IIT_ENTRY_LPI_SHIFT              (8)

#define SCU_IIT_ENTRY_STATUS_MASK            (0x000000FF)
#define SCU_IIT_ENTRY_STATUS_SHIFT           (0)

/* IIT Remote Initiator Defines */
#define SCU_IIT_ENTRY_REMOTE_TAG_MASK  (0x0000FFFF)
#define SCU_IIT_ENTRY_REMOTE_TAG_SHIFT (0)

#define SCU_IIT_ENTRY_REMOTE_RNC_MASK  (0x0FFF0000)
#define SCU_IIT_ENTRY_REMOTE_RNC_SHIFT (16)

#define SCU_IIT_ENTRY_ID_INVALID   (0 << SCU_IIT_ENTRY_ID_SHIFT)
#define SCU_IIT_ENTRY_ID_VIIT      (1 << SCU_IIT_ENTRY_ID_SHIFT)
#define SCU_IIT_ENTRY_ID_IIT       (2 << SCU_IIT_ENTRY_ID_SHIFT)
#define SCU_IIT_ENTRY_ID_VIRT_EXP  (3 << SCU_IIT_ENTRY_ID_SHIFT)

/**
 * struct scu_iit_entry - This will be implemented later when we support
 *    virtual functions
 *
 *
 */
struct scu_iit_entry {
	u32 status;
	u32 remote_initiator_sas_address_hi;
	u32 remote_initiator_sas_address_lo;
	u32 remote_initiator;

};

/* Generate a value for an SCU register */
#define SCU_GEN_VALUE(name, value) \
	(((value) << name ## _SHIFT) & (name ## _MASK))

/*
 * Generate a bit value for an SCU register
 * Make sure that the register MASK is just a single bit */
#define SCU_GEN_BIT(name) \
	SCU_GEN_VALUE(name, ((u32)1))

#define SCU_SET_BIT(name, reg_value) \
	((reg_value) | SCU_GEN_BIT(name))

#define SCU_CLEAR_BIT(name, reg_value) \
	((reg_value)$ ~(SCU_GEN_BIT(name)))

/*
 * *****************************************************************************
 * Unions for bitfield definitions of SCU Registers
 * SMU Post Context Port
 * ***************************************************************************** */
#define SMU_POST_CONTEXT_PORT_CONTEXT_INDEX_SHIFT         (0)
#define SMU_POST_CONTEXT_PORT_CONTEXT_INDEX_MASK          (0x00000FFF)
#define SMU_POST_CONTEXT_PORT_LOGICAL_PORT_INDEX_SHIFT    (12)
#define SMU_POST_CONTEXT_PORT_LOGICAL_PORT_INDEX_MASK     (0x0000F000)
#define SMU_POST_CONTEXT_PORT_PROTOCOL_ENGINE_SHIFT       (16)

Annotation

Implementation Notes