drivers/scsi/bfa/bfa_fcs.c
Source file repositories/reference/linux-study-clean/drivers/scsi/bfa/bfa_fcs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/bfa/bfa_fcs.c- Extension
.c- Size
- 39764 bytes
- Lines
- 1617
- 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_fcs.hbfa_fcbuild.h
Detected Declarations
function bfa_fcs_exit_compfunction bfa_fcs_initfunction bfa_fcs_update_cfgfunction bfa_fcs_stopfunction bfa_fcs_pbc_vport_initfunction bfa_fcs_driver_info_initfunction bfa_fcs_exitfunction bfa_fcs_fabric_sm_uninitfunction bfa_fcs_fabric_sm_createdfunction bfa_fcs_fabric_sm_linkdownfunction bfa_fcs_fabric_sm_flogifunction bfa_fcs_fabric_sm_flogi_retryfunction bfa_fcs_fabric_sm_authfunction bfa_fcs_fabric_sm_auth_failedfunction bfa_fcs_fabric_sm_loopbackfunction bfa_fcs_fabric_sm_nofabricfunction bfa_fcs_fabric_sm_onlinefunction bfa_fcs_fabric_sm_evfpfunction bfa_fcs_fabric_sm_evfp_donefunction mismatchfunction bfa_fcs_fabric_sm_deletingfunction bfa_fcs_fabric_sm_stoppingfunction bfa_fcs_fabric_sm_cleanupfunction bfa_fcs_fabric_initfunction bfa_fcs_fabric_psymb_initfunction stringfunction bfa_fcs_fabric_nsymb_initfunction bfa_cb_lps_flogi_compfunction bfa_fcs_fabric_loginfunction bfa_fcs_fabric_notify_onlinefunction list_for_each_safefunction bfa_fcs_fabric_notify_offlinefunction bfa_fcs_fabric_delayfunction bfa_fcs_fabric_stopfunction list_for_each_safefunction bfa_fcs_fabric_deletefunction list_for_each_safefunction bfa_fcs_fabric_delete_compfunction bfa_fcs_fabric_stop_compfunction bfa_fcs_fabric_modstopfunction bfa_fcs_fabric_modstartfunction bfa_fcs_fabric_link_upfunction bfa_fcs_fabric_link_downfunction bfa_fcs_fabric_addvportfunction bfa_fcs_fabric_delvportfunction bfa_fcs_fabric_vport_lookupfunction list_for_eachfunction bfa_fcs_fabric_get_switch_oui
Annotated Snippet
if (!bfa_fcport_is_linkup(fabric->fcs->bfa)) {
bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown);
break;
}
if (bfa_fcport_get_topology(bfa) ==
BFA_PORT_TOPOLOGY_LOOP) {
fabric->fab_type = BFA_FCS_FABRIC_LOOP;
fabric->bport.pid = bfa_fcport_get_myalpa(bfa);
fabric->bport.pid = bfa_hton3b(fabric->bport.pid);
bfa_sm_set_state(fabric,
bfa_fcs_fabric_sm_online);
bfa_fcs_fabric_set_opertype(fabric);
bfa_fcs_lport_online(&fabric->bport);
} else {
bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_flogi);
bfa_fcs_fabric_login(fabric);
}
break;
case BFA_FCS_FABRIC_SM_LINK_UP:
case BFA_FCS_FABRIC_SM_LINK_DOWN:
break;
case BFA_FCS_FABRIC_SM_DELETE:
bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting);
bfa_fcs_fabric_delete(fabric);
break;
default:
bfa_sm_fault(fabric->fcs, event);
}
}
/*
* Link is down, awaiting LINK UP event from port. This is also the
* first state at fabric creation.
*/
static void
bfa_fcs_fabric_sm_linkdown(struct bfa_fcs_fabric_s *fabric,
enum bfa_fcs_fabric_event event)
{
struct bfa_s *bfa = fabric->fcs->bfa;
bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
bfa_trc(fabric->fcs, event);
switch (event) {
case BFA_FCS_FABRIC_SM_LINK_UP:
if (bfa_fcport_get_topology(bfa) != BFA_PORT_TOPOLOGY_LOOP) {
bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_flogi);
bfa_fcs_fabric_login(fabric);
break;
}
fabric->fab_type = BFA_FCS_FABRIC_LOOP;
fabric->bport.pid = bfa_fcport_get_myalpa(bfa);
fabric->bport.pid = bfa_hton3b(fabric->bport.pid);
bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_online);
bfa_fcs_fabric_set_opertype(fabric);
bfa_fcs_lport_online(&fabric->bport);
break;
case BFA_FCS_FABRIC_SM_RETRY_OP:
case BFA_FCS_FABRIC_SM_LOOPBACK:
break;
case BFA_FCS_FABRIC_SM_DELETE:
bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting);
bfa_fcs_fabric_delete(fabric);
break;
case BFA_FCS_FABRIC_SM_STOP:
bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_cleanup);
bfa_fcs_fabric_stop(fabric);
break;
default:
bfa_sm_fault(fabric->fcs, event);
}
}
/*
* FLOGI is in progress, awaiting FLOGI reply.
*/
static void
bfa_fcs_fabric_sm_flogi(struct bfa_fcs_fabric_s *fabric,
enum bfa_fcs_fabric_event event)
{
bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
bfa_trc(fabric->fcs, event);
Annotation
- Immediate include surface: `bfad_drv.h`, `bfad_im.h`, `bfa_fcs.h`, `bfa_fcbuild.h`.
- Detected declarations: `function bfa_fcs_exit_comp`, `function bfa_fcs_init`, `function bfa_fcs_update_cfg`, `function bfa_fcs_stop`, `function bfa_fcs_pbc_vport_init`, `function bfa_fcs_driver_info_init`, `function bfa_fcs_exit`, `function bfa_fcs_fabric_sm_uninit`, `function bfa_fcs_fabric_sm_created`, `function bfa_fcs_fabric_sm_linkdown`.
- 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.