drivers/scsi/qla4xxx/ql4_def.h
Source file repositories/reference/linux-study-clean/drivers/scsi/qla4xxx/ql4_def.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/qla4xxx/ql4_def.h- Extension
.h- Size
- 28555 bytes
- Lines
- 1085
- 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.
- 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/module.hlinux/list.hlinux/pci.hlinux/dma-mapping.hlinux/sched.hlinux/slab.hlinux/dmapool.hlinux/mempool.hlinux/spinlock.hlinux/workqueue.hlinux/delay.hlinux/interrupt.hlinux/mutex.hlinux/bsg-lib.hlinux/vmalloc.hnet/tcp.hscsi/scsi.hscsi/scsi_host.hscsi/scsi_device.hscsi/scsi_cmnd.hscsi/scsi_transport.hscsi/scsi_transport_iscsi.hscsi/scsi_bsg_iscsi.hscsi/scsi_netlink.hscsi/libiscsi.hql4_dbg.hql4_nx.hql4_fw.hql4_nvram.h
Detected Declarations
struct qla4xxx_cmd_privstruct srbstruct mrbstruct aenstruct ql4_aen_logstruct ddb_entrystruct qla_ddb_indexstruct ql4_tuple_ddbstruct qla4_work_evtstruct ql82xx_hw_datastruct qla4_8xxx_legacy_intr_setstruct isp_operationsstruct ql4_mdump_size_tablestruct ipaddress_configstruct ql4_chap_formatstruct ip_address_formatstruct ql4_conn_infostruct ql4_boot_session_infostruct ql4_boot_tgt_infostruct scsi_qla_hoststruct ql4_task_datastruct qla_endpointstruct qla_connenum qla4_work_typefunction Copyrightfunction is_ipv4_enabledfunction is_ipv6_enabledfunction is_qla4010function is_qla4022function is_qla4032function is_qla40XXfunction is_qla8022function is_qla8032function is_qla8042function is_qla80XXfunction is_aer_supportedfunction adapter_upfunction to_qla_hostfunction isp_semaphorefunction isp_nvramfunction isp_ext_hw_conffunction isp_port_statusfunction isp_port_ctrlfunction isp_port_error_statusfunction isp_gp_outfunction eeprom_ext_hw_conf_offsetfunction ql4xxx_lock_flashfunction ql4xxx_unlock_flash
Annotated Snippet
struct qla4xxx_cmd_priv {
struct srb *srb;
};
static inline struct qla4xxx_cmd_priv *qla4xxx_cmd_priv(struct scsi_cmnd *cmd)
{
return scsi_cmd_priv(cmd);
}
/*
* SCSI Request Block structure (srb) that is associated with each scsi_cmnd.
*/
struct srb {
struct list_head list; /* (8) */
struct scsi_qla_host *ha; /* HA the SP is queued on */
struct ddb_entry *ddb;
uint16_t flags; /* (1) Status flags. */
#define SRB_DMA_VALID BIT_3 /* DMA Buffer mapped. */
#define SRB_GOT_SENSE BIT_4 /* sense data received. */
uint8_t state; /* (1) Status flags. */
#define SRB_NO_QUEUE_STATE 0 /* Request is in between states */
#define SRB_FREE_STATE 1
#define SRB_ACTIVE_STATE 3
#define SRB_ACTIVE_TIMEOUT_STATE 4
#define SRB_SUSPENDED_STATE 7 /* Request in suspended state */
struct scsi_cmnd *cmd; /* (4) SCSI command block */
dma_addr_t dma_handle; /* (4) for unmap of single transfers */
struct kref srb_ref; /* reference count for this srb */
uint8_t err_id; /* error id */
#define SRB_ERR_PORT 1 /* Request failed because "port down" */
#define SRB_ERR_LOOP 2 /* Request failed because "loop down" */
#define SRB_ERR_DEVICE 3 /* Request failed because "device error" */
#define SRB_ERR_OTHER 4
uint16_t reserved;
uint16_t iocb_tov;
uint16_t iocb_cnt; /* Number of used iocbs */
uint16_t cc_stat;
/* Used for extended sense / status continuation */
uint8_t *req_sense_ptr;
uint16_t req_sense_len;
uint16_t reserved2;
};
/* Mailbox request block structure */
struct mrb {
struct scsi_qla_host *ha;
struct mbox_cmd_iocb *mbox;
uint32_t mbox_cmd;
uint16_t iocb_cnt; /* Number of used iocbs */
uint32_t pid;
};
/*
* Asynchronous Event Queue structure
*/
struct aen {
uint32_t mbox_sts[MBOX_AEN_REG_COUNT];
};
struct ql4_aen_log {
int count;
struct aen entry[MAX_AEN_ENTRIES];
};
/*
* Device Database (DDB) structure
*/
struct ddb_entry {
struct scsi_qla_host *ha;
struct iscsi_cls_session *sess;
struct iscsi_cls_conn *conn;
uint16_t fw_ddb_index; /* DDB firmware index */
uint32_t fw_ddb_device_state; /* F/W Device State -- see ql4_fw.h */
uint16_t ddb_type;
#define FLASH_DDB 0x01
struct dev_db_entry fw_ddb_entry;
int (*unblock_sess)(struct iscsi_cls_session *cls_session);
int (*ddb_change)(struct scsi_qla_host *ha, uint32_t fw_ddb_index,
struct ddb_entry *ddb_entry, uint32_t state);
/* Driver Re-login */
unsigned long flags; /* DDB Flags */
#define DDB_CONN_CLOSE_FAILURE 0 /* 0x00000001 */
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/init.h`, `linux/types.h`, `linux/module.h`, `linux/list.h`, `linux/pci.h`, `linux/dma-mapping.h`, `linux/sched.h`.
- Detected declarations: `struct qla4xxx_cmd_priv`, `struct srb`, `struct mrb`, `struct aen`, `struct ql4_aen_log`, `struct ddb_entry`, `struct qla_ddb_index`, `struct ql4_tuple_ddb`, `struct qla4_work_evt`, `struct ql82xx_hw_data`.
- 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.