drivers/scsi/lpfc/lpfc.h
Source file repositories/reference/linux-study-clean/drivers/scsi/lpfc/lpfc.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/lpfc/lpfc.h- Extension
.h- Size
- 58137 bytes
- Lines
- 1835
- 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
scsi/scsi_host.hlinux/hashtable.hlinux/ktime.hlinux/workqueue.h
Detected Declarations
struct lpfc_sli2_slimstruct perf_profstruct lpfc_dmabufstruct lpfc_nvmet_ctxbufstruct lpfc_dma_poolstruct hbq_dmabufstruct rqb_dmabufstruct lpfc_statsstruct lpfc_hbastruct lpfc_defer_flogi_accstruct lpfc_vmidstruct lpfc_vmid_contextstruct lpfc_vmid_priority_rangestruct lpfc_vmid_priority_infostruct lpfc_trunk_link_statestruct lpfc_trunk_linkstruct lpfc_cgn_paramstruct lpfc_cgn_tsstruct lpfc_cgn_infostruct lpfc_cgn_statstruct lpfc_cgn_acqe_statstruct lpfc_vportstruct hbq_sstruct unsol_rcv_ct_ctxstruct lpfc_mbox_ext_buf_ctxstruct lpfc_epd_poolstruct lpfc_ras_fwlogstruct dbg_log_entstruct lpfc_hbastruct rx_info_entrystruct lpfc_rx_info_monitorenum lpfc_polling_flagsenum discovery_stateenum hba_stateenum lpfc_hba_flagenum lpfc_fc_flagenum lpfc_load_flagenum hba_temp_stateenum intr_type_tenum nemb_typeenum mbox_typeenum dma_typeenum sta_typeenum ras_stateenum lpfc_irq_chann_modeenum lpfc_hba_bit_flagsfunction lpfc_shost_from_vportfunction lpfc_set_loopback_flag
Annotated Snippet
struct perf_prof {
uint16_t cmd_cpu[40];
uint16_t rsp_cpu[40];
uint16_t qh_cpu[40];
uint16_t wqidx[40];
};
/*
* Provide for FC4 TYPE x28 - NVME. The
* bit mask for FCP and NVME is 0x8 identically
* because they are 32 bit positions distance.
*/
#define LPFC_FC4_TYPE_BITMASK 0x00000100
/* Provide DMA memory definitions the driver uses per port instance. */
struct lpfc_dmabuf {
struct list_head list;
void *virt; /* virtual address ptr */
dma_addr_t phys; /* mapped address */
uint32_t buffer_tag; /* used for tagged queue ring */
};
struct lpfc_nvmet_ctxbuf {
struct list_head list;
struct lpfc_async_xchg_ctx *context;
struct lpfc_iocbq *iocbq;
struct lpfc_sglq *sglq;
struct work_struct defer_work;
};
struct lpfc_dma_pool {
struct lpfc_dmabuf *elements;
uint32_t max_count;
uint32_t current_count;
};
struct hbq_dmabuf {
struct lpfc_dmabuf hbuf;
struct lpfc_dmabuf dbuf;
uint16_t total_size;
uint16_t bytes_recv;
uint32_t tag;
struct lpfc_cq_event cq_event;
unsigned long time_stamp;
void *context;
};
struct rqb_dmabuf {
struct lpfc_dmabuf hbuf;
struct lpfc_dmabuf dbuf;
uint16_t total_size;
uint16_t bytes_recv;
uint16_t idx;
struct lpfc_queue *hrq; /* ptr to associated Header RQ */
struct lpfc_queue *drq; /* ptr to associated Data RQ */
};
/* Priority bit. Set value to exceed low water mark in lpfc_mem. */
#define MEM_PRI 0x100
/****************************************************************************/
/* Device VPD save area */
/****************************************************************************/
typedef struct lpfc_vpd {
uint32_t status; /* vpd status value */
uint32_t length; /* number of bytes actually returned */
struct {
uint32_t rsvd1; /* Revision numbers */
uint32_t biuRev;
uint32_t smRev;
uint32_t smFwRev;
uint32_t endecRev;
uint16_t rBit;
uint8_t fcphHigh;
uint8_t fcphLow;
uint8_t feaLevelHigh;
uint8_t feaLevelLow;
uint32_t postKernRev;
uint32_t opFwRev;
uint8_t opFwName[16];
uint32_t sli1FwRev;
uint8_t sli1FwName[16];
uint32_t sli2FwRev;
uint8_t sli2FwName[16];
} rev;
struct {
#ifdef __BIG_ENDIAN_BITFIELD
uint32_t rsvd3 :20; /* Reserved */
uint32_t rsvd2 : 3; /* Reserved */
Annotation
- Immediate include surface: `scsi/scsi_host.h`, `linux/hashtable.h`, `linux/ktime.h`, `linux/workqueue.h`.
- Detected declarations: `struct lpfc_sli2_slim`, `struct perf_prof`, `struct lpfc_dmabuf`, `struct lpfc_nvmet_ctxbuf`, `struct lpfc_dma_pool`, `struct hbq_dmabuf`, `struct rqb_dmabuf`, `struct lpfc_stats`, `struct lpfc_hba`, `struct lpfc_defer_flogi_acc`.
- 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.