drivers/scsi/megaraid.h
Source file repositories/reference/linux-study-clean/drivers/scsi/megaraid.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/megaraid.h- Extension
.h- Size
- 27719 bytes
- Lines
- 1023
- 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
linux/spinlock.hlinux/mutex.hscsi/scsi_cmnd.h
Detected Declarations
struct mbox_outstruct mbox_instruct notifystruct uioctl_tstruct mcontrollerstruct private_bios_datastruct megaraid_cmd_privstruct scsi_cmd_and_privstruct mega_hbasfunction megaraid_to_scsi_cmd
Annotated Snippet
struct mbox_out {
/* 0x0 */ u8 cmd;
/* 0x1 */ u8 cmdid;
/* 0x2 */ u16 numsectors;
/* 0x4 */ u32 lba;
/* 0x8 */ u32 xferaddr;
/* 0xC */ u8 logdrv;
/* 0xD */ u8 numsgelements;
/* 0xE */ u8 resvd;
} __attribute__ ((packed));
struct mbox_in {
/* 0xF */ volatile u8 busy;
/* 0x10 */ volatile u8 numstatus;
/* 0x11 */ volatile u8 status;
/* 0x12 */ volatile u8 completed[MAX_FIRMWARE_STATUS];
volatile u8 poll;
volatile u8 ack;
} __attribute__ ((packed));
typedef struct {
struct mbox_out m_out;
struct mbox_in m_in;
} __attribute__ ((packed)) mbox_t;
typedef struct {
u32 xfer_segment_lo;
u32 xfer_segment_hi;
mbox_t mbox;
} __attribute__ ((packed)) mbox64_t;
/*
* Passthru definitions
*/
#define MAX_REQ_SENSE_LEN 0x20
typedef struct {
u8 timeout:3; /* 0=6sec/1=60sec/2=10min/3=3hrs */
u8 ars:1;
u8 reserved:3;
u8 islogical:1;
u8 logdrv; /* if islogical == 1 */
u8 channel; /* if islogical == 0 */
u8 target; /* if islogical == 0 */
u8 queuetag; /* unused */
u8 queueaction; /* unused */
u8 cdb[MAX_CDB_LEN];
u8 cdblen;
u8 reqsenselen;
u8 reqsensearea[MAX_REQ_SENSE_LEN];
u8 numsgelements;
u8 scsistatus;
u32 dataxferaddr;
u32 dataxferlen;
} __attribute__ ((packed)) mega_passthru;
/*
* Extended passthru: support CDB > 10 bytes
*/
typedef struct {
u8 timeout:3; /* 0=6sec/1=60sec/2=10min/3=3hrs */
u8 ars:1;
u8 rsvd1:1;
u8 cd_rom:1;
u8 rsvd2:1;
u8 islogical:1;
u8 logdrv; /* if islogical == 1 */
u8 channel; /* if islogical == 0 */
u8 target; /* if islogical == 0 */
u8 queuetag; /* unused */
u8 queueaction; /* unused */
u8 cdblen;
u8 rsvd3;
u8 cdb[MAX_EXT_CDB_LEN];
u8 numsgelements;
u8 status;
u8 reqsenselen;
u8 reqsensearea[MAX_REQ_SENSE_LEN];
u8 rsvd4;
u32 dataxferaddr;
u32 dataxferlen;
} __attribute__ ((packed)) mega_ext_passthru;
typedef struct {
u64 address;
u32 length;
} __attribute__ ((packed)) mega_sgl64;
Annotation
- Immediate include surface: `linux/spinlock.h`, `linux/mutex.h`, `scsi/scsi_cmnd.h`.
- Detected declarations: `struct mbox_out`, `struct mbox_in`, `struct notify`, `struct uioctl_t`, `struct mcontroller`, `struct private_bios_data`, `struct megaraid_cmd_priv`, `struct scsi_cmd_and_priv`, `struct mega_hbas`, `function megaraid_to_scsi_cmd`.
- 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.