drivers/scsi/bfa/bfa_cs.h
Source file repositories/reference/linux-study-clean/drivers/scsi/bfa/bfa_cs.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/bfa/bfa_cs.h- Extension
.h- Size
- 7062 bytes
- Lines
- 316
- 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
bfad_drv.h
Detected Declarations
struct bfa_trc_sstruct bfa_trc_mod_sstruct bfa_sm_table_sstruct bfa_wc_sfunction filefunction bfa_trc_stopfunction bfa_q_is_on_q_funcfunction bfa_wc_upfunction bfa_wc_downfunction bfa_wc_initfunction bfa_wc_waitfunction wwn2strfunction fcid2str
Annotated Snippet
struct bfa_trc_s {
#ifdef __BIG_ENDIAN
u16 fileno;
u16 line;
#else
u16 line;
u16 fileno;
#endif
u32 timestamp;
union {
struct {
u32 rsvd;
u32 u32;
} u32;
u64 u64;
} data;
};
struct bfa_trc_mod_s {
u32 head;
u32 tail;
u32 ntrc;
u32 stopped;
u32 ticks;
u32 rsvd[3];
struct bfa_trc_s trc[BFA_TRC_MAX];
};
enum {
BFA_TRC_HAL = 1, /* BFA modules */
BFA_TRC_FCS = 2, /* BFA FCS modules */
BFA_TRC_LDRV = 3, /* Linux driver modules */
BFA_TRC_CNA = 4, /* Common modules */
};
#define BFA_TRC_MOD_SH 10
#define BFA_TRC_MOD(__mod) ((BFA_TRC_ ## __mod) << BFA_TRC_MOD_SH)
/*
* Define a new tracing file (module). Module should match one defined above.
*/
#define BFA_TRC_FILE(__mod, __submod) \
static int __trc_fileno = ((BFA_TRC_ ## __mod ## _ ## __submod) | \
BFA_TRC_MOD(__mod))
#define bfa_trc32(_trcp, _data) \
__bfa_trc((_trcp)->trcmod, __trc_fileno, __LINE__, (u32)_data)
#define bfa_trc(_trcp, _data) \
__bfa_trc((_trcp)->trcmod, __trc_fileno, __LINE__, (u64)_data)
static inline void
bfa_trc_init(struct bfa_trc_mod_s *trcm)
{
trcm->head = trcm->tail = trcm->stopped = 0;
trcm->ntrc = BFA_TRC_MAX;
}
static inline void
bfa_trc_stop(struct bfa_trc_mod_s *trcm)
{
trcm->stopped = 1;
}
void
__bfa_trc(struct bfa_trc_mod_s *trcm, int fileno, int line, u64 data);
void
__bfa_trc32(struct bfa_trc_mod_s *trcm, int fileno, int line, u32 data);
#define bfa_sm_fault(__mod, __event) do { \
bfa_trc(__mod, (((u32)0xDEAD << 16) | __event)); \
printk(KERN_ERR "Assertion failure: %s:%d: %d", \
__FILE__, __LINE__, (__event)); \
} while (0)
/* BFA queue definitions */
#define bfa_q_first(_q) ((void *)(((struct list_head *) (_q))->next))
#define bfa_q_next(_qe) (((struct list_head *) (_qe))->next)
#define bfa_q_prev(_qe) (((struct list_head *) (_qe))->prev)
/*
* bfa_q_qe_init - to initialize a queue element
*/
#define bfa_q_qe_init(_qe) { \
bfa_q_next(_qe) = (struct list_head *) NULL; \
bfa_q_prev(_qe) = (struct list_head *) NULL; \
}
/*
* bfa_q_deq - dequeue an element from head of the queue
Annotation
- Immediate include surface: `bfad_drv.h`.
- Detected declarations: `struct bfa_trc_s`, `struct bfa_trc_mod_s`, `struct bfa_sm_table_s`, `struct bfa_wc_s`, `function file`, `function bfa_trc_stop`, `function bfa_q_is_on_q_func`, `function bfa_wc_up`, `function bfa_wc_down`, `function bfa_wc_init`.
- 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.