drivers/scsi/be2iscsi/be_main.h
Source file repositories/reference/linux-study-clean/drivers/scsi/be2iscsi/be_main.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/be2iscsi/be_main.h- Extension
.h- Size
- 28964 bytes
- Lines
- 1030
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/pci.hlinux/if_ether.hlinux/in.hlinux/ctype.hlinux/module.hscsi/scsi.hscsi/scsi_cmnd.hscsi/scsi_device.hscsi/scsi_host.hscsi/iscsi_proto.hscsi/libiscsi.hscsi/scsi_transport_iscsi.hbe.h
Detected Declarations
struct be_bus_address32struct be_bus_address64struct be_bus_addressstruct mem_arraystruct be_mem_descriptorstruct sgl_handlestruct hba_parametersstruct hwi_wrb_contextstruct ulp_cid_infostruct beiscsi_hbastruct boot_structstruct beiscsi_sessionstruct beiscsi_connstruct pdu_data_outstruct amap_pdu_data_outstruct be_cmd_bhsstruct beiscsi_io_taskstruct be_nonio_bhsstruct be_status_bhsstruct iscsi_sgestruct amap_iscsi_sgestruct beiscsi_offload_paramsstruct amap_beiscsi_offload_paramsstruct hd_async_handlestruct hd_async_entrystruct cri_wait_queuestruct hd_async_buf_contextstruct hd_async_contextstruct i_t_dpdu_cqestruct amap_i_t_dpdu_cqestruct amap_i_t_dpdu_cqe_v2struct be_eq_entrystruct amap_eq_entrystruct cq_dbstruct amap_cq_dbstruct iscsi_wrbstruct amap_iscsi_wrbstruct amap_iscsi_wrb_v2struct pdu_nop_outstruct amap_pdu_nop_outstruct pdu_basestruct amap_pdu_basestruct iscsi_target_context_update_wrbstruct amap_iscsi_target_context_update_wrbstruct amap_iscsi_target_context_update_wrb_v2struct be_ringstruct hwi_controllerstruct wrb_handle
Annotated Snippet
struct be_bus_address32 {
unsigned int address_lo;
unsigned int address_hi;
};
struct be_bus_address64 {
unsigned long long address;
};
struct be_bus_address {
union {
struct be_bus_address32 a32;
struct be_bus_address64 a64;
} u;
};
struct mem_array {
struct be_bus_address bus_address; /* Bus address of location */
void *virtual_address; /* virtual address to the location */
unsigned int size; /* Size required by memory block */
};
struct be_mem_descriptor {
unsigned int size_in_bytes; /* Size required by memory block */
unsigned int num_elements;
struct mem_array *mem_array;
};
struct sgl_handle {
unsigned int sgl_index;
unsigned int type;
unsigned int cid;
struct iscsi_task *task;
struct iscsi_sge *pfrag;
};
struct hba_parameters {
unsigned int ios_per_ctrl;
unsigned int cxns_per_ctrl;
unsigned int icds_per_ctrl;
unsigned int num_sge_per_io;
unsigned int defpdu_hdr_sz;
unsigned int defpdu_data_sz;
unsigned int num_cq_entries;
unsigned int num_eq_entries;
unsigned int wrbs_per_cxn;
unsigned int hwi_ws_sz;
};
#define BEISCSI_GET_ULP_FROM_CRI(phwi_ctrlr, cri) \
(phwi_ctrlr->wrb_context[cri].ulp_num)
struct hwi_wrb_context {
spinlock_t wrb_lock;
struct wrb_handle **pwrb_handle_base;
struct wrb_handle **pwrb_handle_basestd;
struct iscsi_wrb *plast_wrb;
unsigned short alloc_index;
unsigned short free_index;
unsigned short wrb_handles_available;
unsigned short cid;
uint8_t ulp_num; /* ULP to which CID binded */
uint32_t doorbell_offset;
};
struct ulp_cid_info {
unsigned short *cid_array;
unsigned short avlbl_cids;
unsigned short cid_alloc;
unsigned short cid_free;
};
#include "be.h"
#define chip_be2(phba) (phba->generation == BE_GEN2)
#define chip_be3_r(phba) (phba->generation == BE_GEN3)
#define is_chip_be2_be3r(phba) (chip_be3_r(phba) || (chip_be2(phba)))
#define BEISCSI_ULP0 0
#define BEISCSI_ULP1 1
#define BEISCSI_ULP_COUNT 2
#define BEISCSI_ULP0_LOADED 0x01
#define BEISCSI_ULP1_LOADED 0x02
#define BEISCSI_ULP_AVLBL_CID(phba, ulp_num) \
(((struct ulp_cid_info *)phba->cid_array_info[ulp_num])->avlbl_cids)
#define BEISCSI_ULP0_AVLBL_CID(phba) \
BEISCSI_ULP_AVLBL_CID(phba, BEISCSI_ULP0)
#define BEISCSI_ULP1_AVLBL_CID(phba) \
BEISCSI_ULP_AVLBL_CID(phba, BEISCSI_ULP1)
struct beiscsi_hba {
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/pci.h`, `linux/if_ether.h`, `linux/in.h`, `linux/ctype.h`, `linux/module.h`, `scsi/scsi.h`, `scsi/scsi_cmnd.h`.
- Detected declarations: `struct be_bus_address32`, `struct be_bus_address64`, `struct be_bus_address`, `struct mem_array`, `struct be_mem_descriptor`, `struct sgl_handle`, `struct hba_parameters`, `struct hwi_wrb_context`, `struct ulp_cid_info`, `struct beiscsi_hba`.
- Atlas domain: Driver Families / drivers/scsi.
- Implementation status: source implementation candidate.
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.