drivers/scsi/bfa/bfa_svc.c
Source file repositories/reference/linux-study-clean/drivers/scsi/bfa/bfa_svc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/bfa/bfa_svc.c- Extension
.c- Size
- 165756 bytes
- Lines
- 6798
- 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.hbfad_im.hbfa_plog.hbfa_cs.hbfa_modules.h
Detected Declarations
struct bfa_fcport_sm_table_senum bfa_dport_test_state_efunction bfa_fcport_sm_to_statefunction plkd_validate_logrecfunction bfa_plog_addfunction bfa_plog_initfunction bfa_plog_strfunction bfa_plog_intarrfunction bfa_plog_fchdrfunction bfa_plog_fchdr_and_plfunction claim_fcxps_memfunction bfa_fcxp_meminfofunction bfa_mem_dma_seg_iterfunction bfa_fcxp_attachfunction bfa_fcxp_iocdisablefunction list_for_each_safefunction bfa_fcxp_getfunction bfa_fcxp_init_reqrspfunction bfa_fcxp_initfunction bfa_fcxp_putfunction bfa_fcxp_null_compfunction hal_fcxp_send_compfunction hal_fcxp_tx_plogfunction hal_fcxp_rx_plogfunction bfa_fcxp_qresumefunction bfa_fcxp_queuefunction bfa_fcxp_get_reqbuffunction bfa_fcxp_get_reqbuffunction bfa_fcxp_get_rspbuffunction bfa_fcxp_freefunction bfa_fcxp_sendfunction bfa_fcxp_req_rsp_alloc_waitfunction bfa_fcxp_walloc_cancelfunction bfa_fcxp_discardfunction bfa_fcxp_isrfunction bfa_fcxp_get_maxrspfunction bfa_fcxp_res_recfgfunction bfa_lps_sm_initfunction bfa_lps_sm_loginfunction bfa_lps_sm_loginwaitfunction bfa_lps_sm_onlinefunction bfa_lps_sm_online_n2n_pid_waitfunction bfa_lps_sm_logoutfunction bfa_lps_sm_logowaitfunction bfa_lps_meminfofunction bfa_lps_attachfunction bfa_lps_iocdisablefunction list_for_each_safe
Annotated Snippet
struct bfa_fcport_sm_table_s {
bfa_fcport_sm_t sm; /* state machine function */
enum bfa_port_states state; /* state machine encoding */
char *name; /* state name for display */
};
static inline enum bfa_port_states
bfa_fcport_sm_to_state(struct bfa_fcport_sm_table_s *smt, bfa_fcport_sm_t sm)
{
int i = 0;
while (smt[i].sm && smt[i].sm != sm)
i++;
return smt[i].state;
}
static struct bfa_fcport_sm_table_s hal_port_sm_table[] = {
{BFA_SM(bfa_fcport_sm_uninit), BFA_PORT_ST_UNINIT},
{BFA_SM(bfa_fcport_sm_enabling_qwait), BFA_PORT_ST_ENABLING_QWAIT},
{BFA_SM(bfa_fcport_sm_enabling), BFA_PORT_ST_ENABLING},
{BFA_SM(bfa_fcport_sm_linkdown), BFA_PORT_ST_LINKDOWN},
{BFA_SM(bfa_fcport_sm_linkup), BFA_PORT_ST_LINKUP},
{BFA_SM(bfa_fcport_sm_disabling_qwait), BFA_PORT_ST_DISABLING_QWAIT},
{BFA_SM(bfa_fcport_sm_toggling_qwait), BFA_PORT_ST_TOGGLING_QWAIT},
{BFA_SM(bfa_fcport_sm_disabling), BFA_PORT_ST_DISABLING},
{BFA_SM(bfa_fcport_sm_disabled), BFA_PORT_ST_DISABLED},
{BFA_SM(bfa_fcport_sm_stopped), BFA_PORT_ST_STOPPED},
{BFA_SM(bfa_fcport_sm_iocdown), BFA_PORT_ST_IOCDOWN},
{BFA_SM(bfa_fcport_sm_iocfail), BFA_PORT_ST_IOCDOWN},
{BFA_SM(bfa_fcport_sm_dport), BFA_PORT_ST_DPORT},
{BFA_SM(bfa_fcport_sm_ddport), BFA_PORT_ST_DDPORT},
{BFA_SM(bfa_fcport_sm_faa_misconfig), BFA_PORT_ST_FAA_MISCONFIG},
};
/*
* forward declaration for RPORT related functions
*/
static struct bfa_rport_s *bfa_rport_alloc(struct bfa_rport_mod_s *rp_mod);
static void bfa_rport_free(struct bfa_rport_s *rport);
static bfa_boolean_t bfa_rport_send_fwcreate(struct bfa_rport_s *rp);
static bfa_boolean_t bfa_rport_send_fwdelete(struct bfa_rport_s *rp);
static bfa_boolean_t bfa_rport_send_fwspeed(struct bfa_rport_s *rp);
static void __bfa_cb_rport_online(void *cbarg,
bfa_boolean_t complete);
static void __bfa_cb_rport_offline(void *cbarg,
bfa_boolean_t complete);
/*
* forward declaration for RPORT state machine
*/
static void bfa_rport_sm_uninit(struct bfa_rport_s *rp,
enum bfa_rport_event event);
static void bfa_rport_sm_created(struct bfa_rport_s *rp,
enum bfa_rport_event event);
static void bfa_rport_sm_fwcreate(struct bfa_rport_s *rp,
enum bfa_rport_event event);
static void bfa_rport_sm_online(struct bfa_rport_s *rp,
enum bfa_rport_event event);
static void bfa_rport_sm_fwdelete(struct bfa_rport_s *rp,
enum bfa_rport_event event);
static void bfa_rport_sm_offline(struct bfa_rport_s *rp,
enum bfa_rport_event event);
static void bfa_rport_sm_deleting(struct bfa_rport_s *rp,
enum bfa_rport_event event);
static void bfa_rport_sm_offline_pending(struct bfa_rport_s *rp,
enum bfa_rport_event event);
static void bfa_rport_sm_delete_pending(struct bfa_rport_s *rp,
enum bfa_rport_event event);
static void bfa_rport_sm_iocdisable(struct bfa_rport_s *rp,
enum bfa_rport_event event);
static void bfa_rport_sm_fwcreate_qfull(struct bfa_rport_s *rp,
enum bfa_rport_event event);
static void bfa_rport_sm_fwdelete_qfull(struct bfa_rport_s *rp,
enum bfa_rport_event event);
static void bfa_rport_sm_deleting_qfull(struct bfa_rport_s *rp,
enum bfa_rport_event event);
/*
* PLOG related definitions
*/
static int
plkd_validate_logrec(struct bfa_plog_rec_s *pl_rec)
{
if ((pl_rec->log_type != BFA_PL_LOG_TYPE_INT) &&
(pl_rec->log_type != BFA_PL_LOG_TYPE_STRING))
return 1;
if ((pl_rec->log_type != BFA_PL_LOG_TYPE_INT) &&
(pl_rec->log_num_ints > BFA_PL_INT_LOG_SZ))
Annotation
- Immediate include surface: `bfad_drv.h`, `bfad_im.h`, `bfa_plog.h`, `bfa_cs.h`, `bfa_modules.h`.
- Detected declarations: `struct bfa_fcport_sm_table_s`, `enum bfa_dport_test_state_e`, `function bfa_fcport_sm_to_state`, `function plkd_validate_logrec`, `function bfa_plog_add`, `function bfa_plog_init`, `function bfa_plog_str`, `function bfa_plog_intarr`, `function bfa_plog_fchdr`, `function bfa_plog_fchdr_and_pl`.
- 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.