drivers/scsi/aacraid/aachba.c
Source file repositories/reference/linux-study-clean/drivers/scsi/aacraid/aachba.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/aacraid/aachba.c- Extension
.c- Size
- 115947 bytes
- Lines
- 4163
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/init.hlinux/types.hlinux/pci.hlinux/spinlock.hlinux/slab.hlinux/completion.hlinux/blkdev.hlinux/uaccess.hlinux/module.hlinux/unaligned.hscsi/scsi.hscsi/scsi_cmnd.hscsi/scsi_device.hscsi/scsi_host.haacraid.h
Detected Declarations
struct inquiry_datastruct tvpd_id_descriptor_type_1struct tvpd_id_descriptor_type_2struct teu64idstruct tvpd_id_descriptor_type_3struct tvpd_page83struct scsi_inqstruct aac_srb_status_infofunction aac_valid_contextfunction aac_get_config_statusfunction aac_expose_phy_devicefunction aac_get_containersfunction aac_scsi_donefunction get_container_name_callbackfunction aac_get_container_namefunction aac_probe_container_callback2function _aac_probe_container2function _aac_probe_container1function _aac_probe_containerfunction aac_probe_container_callback1function aac_probe_container_scsi_donefunction aac_probe_containerfunction inqstrcpyfunction get_container_typefunction setinqstrfunction build_vpd83_type3function get_container_serial_callbackfunction aac_get_container_serialfunction setinqserialfunction set_sensefunction aac_bounds_32function aac_bounds_64function aac_read_raw_iofunction aac_read_block64function aac_read_blockfunction aac_write_raw_iofunction aac_write_block64function aac_write_blockfunction aac_scsi_commonfunction aac_scsi_64function aac_scsi_32function aac_scsi_32_64function aac_adapter_hbafunction aac_send_safw_bmic_cmdfunction aac_set_safw_target_qdfunction aac_issue_safw_bmic_identifyfunction aac_free_safw_ciss_lunsfunction aac_get_safw_ciss_luns
Annotated Snippet
struct inquiry_data {
u8 inqd_pdt; /* Peripheral qualifier | Peripheral Device Type */
u8 inqd_dtq; /* RMB | Device Type Qualifier */
u8 inqd_ver; /* ISO version | ECMA version | ANSI-approved version */
u8 inqd_rdf; /* AENC | TrmIOP | Response data format */
u8 inqd_len; /* Additional length (n-4) */
u8 inqd_pad1[2];/* Reserved - must be zero */
u8 inqd_pad2; /* RelAdr | WBus32 | WBus16 | Sync | Linked |Reserved| CmdQue | SftRe */
u8 inqd_vid[8]; /* Vendor ID */
u8 inqd_pid[16];/* Product ID */
u8 inqd_prl[4]; /* Product Revision Level */
};
/* Added for VPD 0x83 */
struct tvpd_id_descriptor_type_1 {
u8 codeset:4; /* VPD_CODE_SET */
u8 reserved:4;
u8 identifiertype:4; /* VPD_IDENTIFIER_TYPE */
u8 reserved2:4;
u8 reserved3;
u8 identifierlength;
u8 venid[8];
u8 productid[16];
u8 serialnumber[8]; /* SN in ASCII */
};
struct tvpd_id_descriptor_type_2 {
u8 codeset:4; /* VPD_CODE_SET */
u8 reserved:4;
u8 identifiertype:4; /* VPD_IDENTIFIER_TYPE */
u8 reserved2:4;
u8 reserved3;
u8 identifierlength;
struct teu64id {
u32 Serial;
/* The serial number supposed to be 40 bits,
* bit we only support 32, so make the last byte zero. */
u8 reserved;
u8 venid[3];
} eu64id;
};
struct tvpd_id_descriptor_type_3 {
u8 codeset : 4; /* VPD_CODE_SET */
u8 reserved : 4;
u8 identifiertype : 4; /* VPD_IDENTIFIER_TYPE */
u8 reserved2 : 4;
u8 reserved3;
u8 identifierlength;
u8 Identifier[16];
};
struct tvpd_page83 {
u8 DeviceType:5;
u8 DeviceTypeQualifier:3;
u8 PageCode;
u8 reserved;
u8 PageLength;
struct tvpd_id_descriptor_type_1 type1;
struct tvpd_id_descriptor_type_2 type2;
struct tvpd_id_descriptor_type_3 type3;
};
/*
* M O D U L E G L O B A L S
*/
static long aac_build_sg(struct scsi_cmnd *scsicmd, struct sgmap *sgmap);
static long aac_build_sg64(struct scsi_cmnd *scsicmd, struct sgmap64 *psg);
static long aac_build_sgraw(struct scsi_cmnd *scsicmd, struct sgmapraw *psg);
static long aac_build_sgraw2(struct scsi_cmnd *scsicmd,
struct aac_raw_io2 *rio2, int sg_max);
static long aac_build_sghba(struct scsi_cmnd *scsicmd,
struct aac_hba_cmd_req *hbacmd,
int sg_max, u64 sg_address);
static int aac_convert_sgraw2(struct aac_raw_io2 *rio2,
int pages, int nseg, int nseg_new);
static void aac_probe_container_scsi_done(struct scsi_cmnd *scsi_cmnd);
static int aac_send_srb_fib(struct scsi_cmnd* scsicmd);
static int aac_send_hba_fib(struct scsi_cmnd *scsicmd);
#ifdef AAC_DETAILED_STATUS_INFO
static char *aac_get_status_string(u32 status);
#endif
/*
* Non dasd selection is handled entirely in aachba now
*/
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/init.h`, `linux/types.h`, `linux/pci.h`, `linux/spinlock.h`, `linux/slab.h`, `linux/completion.h`, `linux/blkdev.h`.
- Detected declarations: `struct inquiry_data`, `struct tvpd_id_descriptor_type_1`, `struct tvpd_id_descriptor_type_2`, `struct teu64id`, `struct tvpd_id_descriptor_type_3`, `struct tvpd_page83`, `struct scsi_inq`, `struct aac_srb_status_info`, `function aac_valid_context`, `function aac_get_config_status`.
- Atlas domain: Driver Families / drivers/scsi.
- Implementation status: source implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- 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.