drivers/scsi/smartpqi/smartpqi.h
Source file repositories/reference/linux-study-clean/drivers/scsi/smartpqi/smartpqi.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/smartpqi/smartpqi.h- Extension
.h- Size
- 47566 bytes
- Lines
- 1719
- 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/io-64-nonatomic-lo-hi.hscsi/scsi_host.hlinux/bsg-lib.h
Detected Declarations
struct pqi_device_registersstruct pqi_ctrl_registersstruct pqi_sg_descriptorstruct pqi_iu_headerstruct pqi_general_admin_requeststruct pqi_general_admin_responsestruct pqi_iu_layer_descriptorstruct pqi_device_capabilitystruct pqi_raid_path_requeststruct pqi_aio_path_requeststruct pqi_aio_r1_path_requeststruct pqi_aio_r56_path_requeststruct pqi_io_responsestruct pqi_general_management_requeststruct pqi_event_descriptorstruct pqi_event_configstruct pqi_event_responsestruct pqi_event_acknowledge_requeststruct pqi_task_management_requeststruct pqi_task_management_responsestruct pqi_vendor_general_requeststruct pqi_vendor_general_responsestruct pqi_host_memorystruct pqi_host_memory_descriptorstruct pqi_aio_error_infostruct pqi_raid_error_infostruct pqi_admin_queues_alignedstruct pqi_admin_queuesstruct pqi_queue_groupstruct pqi_event_queuestruct pqi_encryption_infostruct pqi_config_tablestruct pqi_config_table_section_headerstruct pqi_config_table_general_infostruct pqi_config_table_firmware_featuresstruct pqi_config_table_debugstruct pqi_config_table_heartbeatstruct pqi_config_table_soft_resetstruct report_lun_headerstruct report_log_lunstruct report_log_lun_liststruct report_phys_lun_8byte_wwidstruct report_phys_lun_16byte_wwidstruct report_phys_lun_8byte_wwid_liststruct report_phys_lun_16byte_wwid_liststruct raid_map_disk_datastruct raid_mapstruct pqi_scsi_dev_raid_map_data
Annotated Snippet
struct pqi_device_registers {
__le64 signature;
u8 function_and_status_code;
u8 reserved[7];
u8 max_admin_iq_elements;
u8 max_admin_oq_elements;
u8 admin_iq_element_length; /* in 16-byte units */
u8 admin_oq_element_length; /* in 16-byte units */
__le16 max_reset_timeout; /* in 100-millisecond units */
u8 reserved1[2];
__le32 legacy_intx_status;
__le32 legacy_intx_mask_set;
__le32 legacy_intx_mask_clear;
u8 reserved2[28];
__le32 device_status;
u8 reserved3[4];
__le64 admin_iq_pi_offset;
__le64 admin_oq_ci_offset;
__le64 admin_iq_element_array_addr;
__le64 admin_oq_element_array_addr;
__le64 admin_iq_ci_addr;
__le64 admin_oq_pi_addr;
u8 admin_iq_num_elements;
u8 admin_oq_num_elements;
__le16 admin_queue_int_msg_num;
u8 reserved4[4];
__le32 device_error;
u8 reserved5[4];
__le64 error_details;
__le32 device_reset;
__le32 power_action;
u8 reserved6[104];
};
/*
* controller registers
*
* These are defined by the Microchip implementation.
*
* Some registers (those named sis_*) are only used when in
* legacy SIS mode before we transition the controller into
* PQI mode. There are a number of other SIS mode registers,
* but we don't use them, so only the SIS registers that we
* care about are defined here. The offsets mentioned in the
* comments are the offsets from the PCIe BAR 0.
*/
struct pqi_ctrl_registers {
u8 reserved[0x20];
__le32 sis_host_to_ctrl_doorbell; /* 20h */
u8 reserved1[0x34 - (0x20 + sizeof(__le32))];
__le32 sis_interrupt_mask; /* 34h */
u8 reserved2[0x9c - (0x34 + sizeof(__le32))];
__le32 sis_ctrl_to_host_doorbell; /* 9Ch */
u8 reserved3[0xa0 - (0x9c + sizeof(__le32))];
__le32 sis_ctrl_to_host_doorbell_clear; /* A0h */
u8 reserved4[0xb0 - (0xa0 + sizeof(__le32))];
__le32 sis_driver_scratch; /* B0h */
__le32 sis_product_identifier; /* B4h */
u8 reserved5[0xbc - (0xb4 + sizeof(__le32))];
__le32 sis_firmware_status; /* BCh */
u8 reserved6[0xcc - (0xbc + sizeof(__le32))];
__le32 sis_ctrl_shutdown_reason_code; /* CCh */
u8 reserved7[0x1000 - (0xcc + sizeof(__le32))];
__le32 sis_mailbox[8]; /* 1000h */
u8 reserved8[0x4000 - (0x1000 + (sizeof(__le32) * 8))];
/*
* The PQI spec states that the PQI registers should be at
* offset 0 from the PCIe BAR 0. However, we can't map
* them at offset 0 because that would break compatibility
* with the SIS registers. So we map them at offset 4000h.
*/
struct pqi_device_registers pqi_registers; /* 4000h */
};
#define PQI_DEVICE_REGISTERS_OFFSET 0x4000
/* shutdown reasons for taking the controller offline */
enum pqi_ctrl_shutdown_reason {
PQI_IQ_NOT_DRAINED_TIMEOUT = 1,
PQI_LUN_RESET_TIMEOUT = 2,
PQI_IO_PENDING_POST_LUN_RESET_TIMEOUT = 3,
PQI_NO_HEARTBEAT = 4,
PQI_FIRMWARE_KERNEL_NOT_UP = 5,
PQI_OFA_RESPONSE_TIMEOUT = 6,
PQI_INVALID_REQ_ID = 7,
PQI_UNMATCHED_REQ_ID = 8,
PQI_IO_PI_OUT_OF_RANGE = 9,
PQI_EVENT_PI_OUT_OF_RANGE = 10,
PQI_UNEXPECTED_IU_TYPE = 11
};
Annotation
- Immediate include surface: `linux/io-64-nonatomic-lo-hi.h`, `scsi/scsi_host.h`, `linux/bsg-lib.h`.
- Detected declarations: `struct pqi_device_registers`, `struct pqi_ctrl_registers`, `struct pqi_sg_descriptor`, `struct pqi_iu_header`, `struct pqi_general_admin_request`, `struct pqi_general_admin_response`, `struct pqi_iu_layer_descriptor`, `struct pqi_device_capability`, `struct pqi_raid_path_request`, `struct pqi_aio_path_request`.
- 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.