drivers/scsi/bfa/bfa_svc.h
Source file repositories/reference/linux-study-clean/drivers/scsi/bfa/bfa_svc.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/bfa/bfa_svc.h- Extension
.h- Size
- 28338 bytes
- Lines
- 825
- 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_cs.hbfi_ms.h
Detected Declarations
struct bfa_sgpg_wqe_sstruct bfa_sgpg_sstruct bfa_sgpg_mod_sstruct bfa_fcxp_mod_sstruct bfa_fcxp_req_info_sstruct bfa_fcxp_rsp_info_sstruct bfa_fcxp_sstruct bfa_fcxp_wqe_sstruct bfa_rport_mod_sstruct bfa_rport_info_sstruct bfa_rport_sstruct bfa_rport_sstruct bfa_uf_sstruct bfa_uf_buf_sstruct bfa_uf_mod_sstruct bfa_lps_sstruct bfa_lps_sstruct bfa_lps_mod_sstruct bfa_fcport_ln_sstruct bfa_fcport_ln_sstruct bfa_fcport_trunk_sstruct bfa_fcport_sstruct bfa_fcport_sstruct bfa_fcdiag_qtest_sstruct bfa_fcdiag_lb_sstruct bfa_dport_sstruct bfa_dport_sstruct bfa_fcdiag_senum bfa_rport_eventenum bfa_lps_eventenum bfa_fcport_ln_sm_eventenum bfa_fcport_sm_eventenum bfa_dport_sm_eventfunction bfa_uf_get_frmbuffunction bfa_uf_get_frmlen
Annotated Snippet
struct bfa_sgpg_wqe_s {
struct list_head qe; /* queue sg page element */
int nsgpg; /* pages to be allocated */
int nsgpg_total; /* total pages required */
void (*cbfn) (void *cbarg); /* callback function */
void *cbarg; /* callback arg */
struct list_head sgpg_q; /* queue of alloced sgpgs */
};
struct bfa_sgpg_s {
struct list_head qe; /* queue sg page element */
struct bfi_sgpg_s *sgpg; /* va of SG page */
union bfi_addr_u sgpg_pa; /* pa of SG page */
};
/*
* Given number of SG elements, BFA_SGPG_NPAGE() returns the number of
* SG pages required.
*/
#define BFA_SGPG_NPAGE(_nsges) (((_nsges) / BFI_SGPG_DATA_SGES) + 1)
/* Max SGPG dma segs required */
#define BFA_SGPG_DMA_SEGS \
BFI_MEM_DMA_NSEGS(BFA_SGPG_MAX, (uint32_t)sizeof(struct bfi_sgpg_s))
struct bfa_sgpg_mod_s {
struct bfa_s *bfa;
int num_sgpgs; /* number of SG pages */
int free_sgpgs; /* number of free SG pages */
struct list_head sgpg_q; /* queue of free SG pages */
struct list_head sgpg_wait_q; /* wait queue for SG pages */
struct bfa_mem_dma_s dma_seg[BFA_SGPG_DMA_SEGS];
struct bfa_mem_kva_s kva_seg;
};
#define BFA_SGPG_MOD(__bfa) (&(__bfa)->modules.sgpg_mod)
#define BFA_MEM_SGPG_KVA(__bfa) (&(BFA_SGPG_MOD(__bfa)->kva_seg))
bfa_status_t bfa_sgpg_malloc(struct bfa_s *bfa, struct list_head *sgpg_q,
int nsgpgs);
void bfa_sgpg_mfree(struct bfa_s *bfa, struct list_head *sgpg_q, int nsgpgs);
void bfa_sgpg_winit(struct bfa_sgpg_wqe_s *wqe,
void (*cbfn) (void *cbarg), void *cbarg);
void bfa_sgpg_wait(struct bfa_s *bfa, struct bfa_sgpg_wqe_s *wqe, int nsgpgs);
void bfa_sgpg_wcancel(struct bfa_s *bfa, struct bfa_sgpg_wqe_s *wqe);
/*
* FCXP related defines
*/
#define BFA_FCXP_MIN (1)
#define BFA_FCXP_MAX (256)
#define BFA_FCXP_MAX_IBUF_SZ (2 * 1024 + 256)
#define BFA_FCXP_MAX_LBUF_SZ (4 * 1024 + 256)
/* Max FCXP dma segs required */
#define BFA_FCXP_DMA_SEGS \
BFI_MEM_DMA_NSEGS(BFA_FCXP_MAX, \
(u32)BFA_FCXP_MAX_IBUF_SZ + BFA_FCXP_MAX_LBUF_SZ)
struct bfa_fcxp_mod_s {
struct bfa_s *bfa; /* backpointer to BFA */
struct bfa_fcxp_s *fcxp_list; /* array of FCXPs */
u16 num_fcxps; /* max num FCXP requests */
struct list_head fcxp_req_free_q; /* free FCXPs used for sending req */
struct list_head fcxp_rsp_free_q; /* free FCXPs used for sending req */
struct list_head fcxp_active_q; /* active FCXPs */
struct list_head req_wait_q; /* wait queue for free req_fcxp */
struct list_head rsp_wait_q; /* wait queue for free rsp_fcxp */
struct list_head fcxp_req_unused_q; /* unused req_fcxps */
struct list_head fcxp_rsp_unused_q; /* unused rsp_fcxps */
u32 req_pld_sz;
u32 rsp_pld_sz;
struct bfa_mem_dma_s dma_seg[BFA_FCXP_DMA_SEGS];
struct bfa_mem_kva_s kva_seg;
};
#define BFA_FCXP_MOD(__bfa) (&(__bfa)->modules.fcxp_mod)
#define BFA_FCXP_FROM_TAG(__mod, __tag) (&(__mod)->fcxp_list[__tag])
#define BFA_MEM_FCXP_KVA(__bfa) (&(BFA_FCXP_MOD(__bfa)->kva_seg))
typedef void (*fcxp_send_cb_t) (struct bfa_s *ioc, struct bfa_fcxp_s *fcxp,
void *cb_arg, bfa_status_t req_status,
u32 rsp_len, u32 resid_len,
struct fchs_s *rsp_fchs);
typedef u64 (*bfa_fcxp_get_sgaddr_t) (void *bfad_fcxp, int sgeid);
typedef u32 (*bfa_fcxp_get_sglen_t) (void *bfad_fcxp, int sgeid);
typedef void (*bfa_cb_fcxp_send_t) (void *bfad_fcxp, struct bfa_fcxp_s *fcxp,
void *cbarg, enum bfa_status req_status,
u32 rsp_len, u32 resid_len,
Annotation
- Immediate include surface: `bfa_cs.h`, `bfi_ms.h`.
- Detected declarations: `struct bfa_sgpg_wqe_s`, `struct bfa_sgpg_s`, `struct bfa_sgpg_mod_s`, `struct bfa_fcxp_mod_s`, `struct bfa_fcxp_req_info_s`, `struct bfa_fcxp_rsp_info_s`, `struct bfa_fcxp_s`, `struct bfa_fcxp_wqe_s`, `struct bfa_rport_mod_s`, `struct bfa_rport_info_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.