drivers/scsi/megaraid/megaraid_sas_fusion.h
Source file repositories/reference/linux-study-clean/drivers/scsi/megaraid/megaraid_sas_fusion.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/megaraid/megaraid_sas_fusion.h- Extension
.h- Size
- 42708 bytes
- Lines
- 1404
- 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.
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
struct RAID_CONTEXTstruct RAID_CONTEXT_G35struct MPI25_IEEE_SGE_CHAIN64struct MPI2_SGE_SIMPLE_UNIONstruct MPI2_SCSI_IO_CDB_EEDP32struct MPI2_SGE_CHAIN_UNIONstruct MPI2_IEEE_SGE_SIMPLE32struct MPI2_IEEE_SGE_CHAIN32struct MPI2_IEEE_SGE_SIMPLE64struct MPI2_IEEE_SGE_CHAIN64struct MPI2_SCSI_TASK_MANAGE_REQUESTstruct MPI2_SCSI_TASK_MANAGE_REPLYstruct MR_TM_REQUESTstruct MR_TM_REPLYstruct MR_TASK_MANAGE_REQUESTstruct MPI2_RAID_SCSI_IO_REQUESTstruct MEGASAS_RAID_MFA_IO_REQUEST_DESCRIPTORstruct MPI2_DEFAULT_REQUEST_DESCRIPTORstruct MPI2_HIGH_PRIORITY_REQUEST_DESCRIPTORstruct MPI2_SCSI_IO_REQUEST_DESCRIPTORstruct MPI2_SCSI_TARGET_REQUEST_DESCRIPTORstruct MPI2_RAID_ACCEL_REQUEST_DESCRIPTORstruct MPI2_DEFAULT_REPLY_DESCRIPTORstruct MPI2_ADDRESS_REPLY_DESCRIPTORstruct MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTORstruct MPI2_TARGETASSIST_SUCCESS_REPLY_DESCRIPTORstruct MPI2_TARGET_COMMAND_BUFFER_REPLY_DESCRIPTORstruct MPI2_RAID_ACCELERATOR_SUCCESS_REPLY_DESCRIPTORstruct MPI2_IOC_INIT_REQUESTstruct MR_DEV_HANDLE_INFOstruct MR_ARRAY_INFOstruct MR_QUAD_ELEMENTstruct MR_SPAN_INFOstruct MR_LD_SPANstruct MR_SPAN_BLOCK_INFOstruct MR_CPU_AFFINITY_MASKstruct MR_IO_AFFINITYstruct MR_LD_RAIDstruct MR_LD_SPAN_MAPstruct MR_FW_RAID_MAPstruct IO_REQUEST_INFOstruct MR_LD_TARGET_SYNCstruct MR_RAID_MAP_DESC_TABLEstruct MR_FW_RAID_MAP_DYNAMICstruct megasas_register_setstruct megasas_instancestruct megasas_cmd_fusionstruct LD_LOAD_BALANCE_INFO
Annotated Snippet
struct RAID_CONTEXT {
#if defined(__BIG_ENDIAN_BITFIELD)
u8 nseg:4;
u8 type:4;
#else
u8 type:4;
u8 nseg:4;
#endif
u8 resvd0;
__le16 timeout_value;
u8 reg_lock_flags;
u8 resvd1;
__le16 virtual_disk_tgt_id;
__le64 reg_lock_row_lba;
__le32 reg_lock_length;
__le16 next_lmid;
u8 ex_status;
u8 status;
u8 raid_flags;
u8 num_sge;
__le16 config_seq_num;
u8 span_arm;
u8 priority;
u8 num_sge_ext;
u8 resvd2;
};
/*
* Raid Context structure which describes ventura MegaRAID specific
* IO Paramenters ,This resides at offset 0x60 where the SGL normally
* starts in MPT IO Frames
*/
struct RAID_CONTEXT_G35 {
#define RAID_CONTEXT_NSEG_MASK 0x00F0
#define RAID_CONTEXT_NSEG_SHIFT 4
#define RAID_CONTEXT_TYPE_MASK 0x000F
#define RAID_CONTEXT_TYPE_SHIFT 0
u16 nseg_type;
u16 timeout_value; /* 0x02 -0x03 */
u16 routing_flags; // 0x04 -0x05 routing flags
u16 virtual_disk_tgt_id; /* 0x06 -0x07 */
__le64 reg_lock_row_lba; /* 0x08 - 0x0F */
u32 reg_lock_length; /* 0x10 - 0x13 */
union { // flow specific
u16 rmw_op_index; /* 0x14 - 0x15, R5/6 RMW: rmw operation index*/
u16 peer_smid; /* 0x14 - 0x15, R1 Write: peer smid*/
u16 r56_arm_map; /* 0x14 - 0x15, Unused [15], LogArm[14:10], P-Arm[9:5], Q-Arm[4:0] */
} flow_specific;
u8 ex_status; /* 0x16 : OUT */
u8 status; /* 0x17 status */
u8 raid_flags; /* 0x18 resvd[7:6], ioSubType[5:4],
* resvd[3:1], preferredCpu[0]
*/
u8 span_arm; /* 0x1C span[7:5], arm[4:0] */
u16 config_seq_num; /* 0x1A -0x1B */
union {
/*
* Bit format:
* ---------------------------------
* | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
* ---------------------------------
* Byte0 | numSGE[7]- numSGE[0] |
* ---------------------------------
* Byte1 |SD | resvd | numSGE 8-11 |
* --------------------------------
*/
#define NUM_SGE_MASK_LOWER 0xFF
#define NUM_SGE_MASK_UPPER 0x0F
#define NUM_SGE_SHIFT_UPPER 8
#define STREAM_DETECT_SHIFT 7
#define STREAM_DETECT_MASK 0x80
struct {
#if defined(__BIG_ENDIAN_BITFIELD) /* 0x1C - 0x1D */
u16 stream_detected:1;
u16 reserved:3;
u16 num_sge:12;
#else
u16 num_sge:12;
u16 reserved:3;
u16 stream_detected:1;
#endif
} bits;
u8 bytes[2];
} u;
u8 resvd2[2]; /* 0x1E-0x1F */
};
#define MR_RAID_CTX_ROUTINGFLAGS_SLD_SHIFT 1
Annotation
- Detected declarations: `struct RAID_CONTEXT`, `struct RAID_CONTEXT_G35`, `struct MPI25_IEEE_SGE_CHAIN64`, `struct MPI2_SGE_SIMPLE_UNION`, `struct MPI2_SCSI_IO_CDB_EEDP32`, `struct MPI2_SGE_CHAIN_UNION`, `struct MPI2_IEEE_SGE_SIMPLE32`, `struct MPI2_IEEE_SGE_CHAIN32`, `struct MPI2_IEEE_SGE_SIMPLE64`, `struct MPI2_IEEE_SGE_CHAIN64`.
- Atlas domain: Driver Families / drivers/scsi.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.