drivers/scsi/bfa/bfi.h
Source file repositories/reference/linux-study-clean/drivers/scsi/bfa/bfi.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/bfa/bfi.h- Extension
.h- Size
- 31070 bytes
- Lines
- 1318
- 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
bfa_defs.hbfa_defs_svc.h
Detected Declarations
struct bfi_mhdr_sstruct bfi_sge_sstruct bfi_alen_sstruct bfi_sgpg_sstruct bfi_msg_sstruct bfi_mbmsg_sstruct bfi_ioc_getattr_req_sstruct bfi_ioc_attr_sstruct bfi_ioc_getattr_reply_sstruct bfi_ioc_fwver_sstruct bfi_ioc_image_hdr_sstruct bfi_ioc_hbeat_sstruct bfi_ioc_ctrl_req_sstruct bfi_ioc_ctrl_reply_sstruct bfi_pbc_blun_sstruct bfi_pbc_vport_sstruct bfi_pbc_sstruct bfi_msgq_mhdr_sstruct bfi_msgq_sstruct bfi_msgq_cfg_req_sstruct bfi_msgq_cfg_rsp_sstruct bfi_msgq_h2i_db_sstruct bfi_msgq_i2h_db_sstruct bfi_port_generic_req_sstruct bfi_port_generic_rsp_sstruct bfi_port_get_stats_req_sstruct bfi_ablk_h2i_query_sstruct bfi_ablk_h2i_cfg_req_sstruct bfi_ablk_h2i_pf_req_sstruct bfi_ablk_h2i_optrom_sstruct bfi_ablk_i2h_rsp_sstruct bfi_cee_reset_stats_sstruct bfi_cee_get_req_sstruct bfi_cee_get_rsp_sstruct bfi_cee_stats_rsp_sstruct bfi_sfp_scn_sstruct bfi_sfp_req_sstruct bfi_sfp_rsp_sstruct bfi_flash_query_req_sstruct bfi_flash_erase_req_sstruct bfi_flash_write_req_sstruct bfi_flash_read_req_sstruct bfi_flash_query_rsp_sstruct bfi_flash_read_rsp_sstruct bfi_flash_write_rsp_sstruct bfi_flash_erase_rsp_sstruct bfi_flash_event_sstruct bfi_diag_lb_req_s
Annotated Snippet
struct bfi_mhdr_s {
u8 msg_class; /* @ref bfi_mclass_t */
u8 msg_id; /* msg opcode with in the class */
union {
struct {
u8 qid;
u8 fn_lpu; /* msg destination */
} h2i;
u16 i2htok; /* token in msgs to host */
} mtag;
};
#define bfi_fn_lpu(__fn, __lpu) ((__fn) << 1 | (__lpu))
#define bfi_mhdr_2_fn(_mh) ((_mh)->mtag.h2i.fn_lpu >> 1)
#define bfi_h2i_set(_mh, _mc, _op, _fn_lpu) do { \
(_mh).msg_class = (_mc); \
(_mh).msg_id = (_op); \
(_mh).mtag.h2i.fn_lpu = (_fn_lpu); \
} while (0)
#define bfi_i2h_set(_mh, _mc, _op, _i2htok) do { \
(_mh).msg_class = (_mc); \
(_mh).msg_id = (_op); \
(_mh).mtag.i2htok = (_i2htok); \
} while (0)
/*
* Message opcodes: 0-127 to firmware, 128-255 to host
*/
#define BFI_I2H_OPCODE_BASE 128
#define BFA_I2HM(_x) ((_x) + BFI_I2H_OPCODE_BASE)
/*
****************************************************************************
*
* Scatter Gather Element and Page definition
*
****************************************************************************
*/
#define BFI_SGE_INLINE 1
#define BFI_SGE_INLINE_MAX (BFI_SGE_INLINE + 1)
/*
* SG Flags
*/
enum {
BFI_SGE_DATA = 0, /* data address, not last */
BFI_SGE_DATA_CPL = 1, /* data addr, last in current page */
BFI_SGE_DATA_LAST = 3, /* data address, last */
BFI_SGE_LINK = 2, /* link address */
BFI_SGE_PGDLEN = 2, /* cumulative data length for page */
};
/*
* DMA addresses
*/
union bfi_addr_u {
struct {
__be32 addr_lo;
__be32 addr_hi;
} a32;
};
/*
* Scatter Gather Element used for fast-path IO requests
*/
struct bfi_sge_s {
#ifdef __BIG_ENDIAN
u32 flags:2,
rsvd:2,
sg_len:28;
#else
u32 sg_len:28,
rsvd:2,
flags:2;
#endif
union bfi_addr_u sga;
};
/**
* Generic DMA addr-len pair.
*/
struct bfi_alen_s {
union bfi_addr_u al_addr; /* DMA addr of buffer */
u32 al_len; /* length of buffer */
};
/*
Annotation
- Immediate include surface: `bfa_defs.h`, `bfa_defs_svc.h`.
- Detected declarations: `struct bfi_mhdr_s`, `struct bfi_sge_s`, `struct bfi_alen_s`, `struct bfi_sgpg_s`, `struct bfi_msg_s`, `struct bfi_mbmsg_s`, `struct bfi_ioc_getattr_req_s`, `struct bfi_ioc_attr_s`, `struct bfi_ioc_getattr_reply_s`, `struct bfi_ioc_fwver_s`.
- 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.