drivers/net/ethernet/brocade/bna/bfi.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/brocade/bna/bfi.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/brocade/bna/bfi.h- Extension
.h- Size
- 14523 bytes
- Lines
- 552
- Domain
- Driver Families
- Bucket
- drivers/net
- 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.h
Detected Declarations
struct bfi_mhdrstruct bfi_alenstruct bfi_mbmsgstruct bfi_ioc_getattr_reqstruct bfi_ioc_attrstruct bfi_ioc_getattr_replystruct bfi_ioc_fwverstruct bfi_ioc_image_hdrstruct bfi_ioc_hbeatstruct bfi_ioc_ctrl_reqstruct bfi_ioc_ctrl_replystruct bfi_msgq_mhdrstruct bfi_msgqstruct bfi_msgq_cfg_reqstruct bfi_msgq_cfg_rspstruct bfi_msgq_h2i_dbstruct bfi_msgq_i2h_dbstruct bfi_msgq_h2i_cmdq_copy_rspstruct bfi_msgq_i2h_cmdq_copy_reqstruct bfi_flash_query_reqstruct bfi_flash_write_reqstruct bfi_flash_read_reqstruct bfi_flash_query_rspstruct bfi_flash_read_rspstruct bfi_flash_write_rspenum bfi_pcifn_classenum bfi_mclassenum bfi_asic_genenum bfi_asic_modeenum bfi_ioc_h2i_msgsenum bfi_ioc_i2h_msgsenum bfi_ioc_img_ver_cmpenum bfi_fwboot_typeenum bfi_port_modeenum bfi_ioc_stateenum bfi_msgq_h2i_msgsenum bfi_msgq_i2h_msgsenum bfi_flash_h2i_msgsenum bfi_flash_i2h_msgs
Annotated Snippet
struct bfi_mhdr {
u8 msg_class; /*!< @ref enum bfi_mclass */
u8 msg_id; /*!< msg opcode with in the class */
union {
struct {
u8 qid;
u8 fn_lpu; /*!< msg destination */
} __packed h2i;
u16 i2htok; /*!< token in msgs to host */
} __packed mtag;
} __packed;
#define bfi_fn_lpu(__fn, __lpu) ((__fn) << 1 | (__lpu))
#define bfi_mhdr_2_fn(_mh) ((_mh)->mtag.h2i.fn_lpu >> 1)
#define bfi_mhdr_2_qid(_mh) ((_mh)->mtag.h2i.qid)
#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
*
****************************************************************************
*/
/* DMA addresses */
union bfi_addr_u {
struct {
u32 addr_lo;
u32 addr_hi;
} __packed a32;
} __packed;
/* Generic DMA addr-len pair. */
struct bfi_alen {
union bfi_addr_u al_addr; /* DMA addr of buffer */
u32 al_len; /* length of buffer */
} __packed;
/*
* Large Message structure - 128 Bytes size Msgs
*/
#define BFI_LMSG_SZ 128
#define BFI_LMSG_PL_WSZ \
((BFI_LMSG_SZ - sizeof(struct bfi_mhdr)) / 4)
/* Mailbox message structure */
#define BFI_MBMSG_SZ 7
struct bfi_mbmsg {
struct bfi_mhdr mh;
u32 pl[BFI_MBMSG_SZ];
} __packed;
/* Supported PCI function class codes (personality) */
enum bfi_pcifn_class {
BFI_PCIFN_CLASS_FC = 0x0c04,
BFI_PCIFN_CLASS_ETH = 0x0200,
};
/* Message Classes */
enum bfi_mclass {
BFI_MC_IOC = 1, /*!< IO Controller (IOC) */
BFI_MC_DIAG = 2, /*!< Diagnostic Msgs */
BFI_MC_FLASH = 3, /*!< Flash message class */
BFI_MC_CEE = 4, /*!< CEE */
BFI_MC_FCPORT = 5, /*!< FC port */
BFI_MC_IOCFC = 6, /*!< FC - IO Controller (IOC) */
BFI_MC_LL = 7, /*!< Link Layer */
BFI_MC_UF = 8, /*!< Unsolicited frame receive */
BFI_MC_FCXP = 9, /*!< FC Transport */
BFI_MC_LPS = 10, /*!< lport fc login services */
BFI_MC_RPORT = 11, /*!< Remote port */
BFI_MC_ITNIM = 12, /*!< I-T nexus (Initiator mode) */
BFI_MC_IOIM_READ = 13, /*!< read IO (Initiator mode) */
Annotation
- Immediate include surface: `bfa_defs.h`.
- Detected declarations: `struct bfi_mhdr`, `struct bfi_alen`, `struct bfi_mbmsg`, `struct bfi_ioc_getattr_req`, `struct bfi_ioc_attr`, `struct bfi_ioc_getattr_reply`, `struct bfi_ioc_fwver`, `struct bfi_ioc_image_hdr`, `struct bfi_ioc_hbeat`, `struct bfi_ioc_ctrl_req`.
- Atlas domain: Driver Families / drivers/net.
- 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.