drivers/scsi/bfa/bfa_fcs_rport.c
Source file repositories/reference/linux-study-clean/drivers/scsi/bfa/bfa_fcs_rport.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/bfa/bfa_fcs_rport.c- Extension
.c- Size
- 89082 bytes
- Lines
- 3416
- 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
struct bfa_fcs_rport_sm_table_sfunction bfa_rport_sm_to_statefunction bfa_fcs_rport_sm_uninitfunction bfa_fcs_rport_sm_plogi_sendingfunction bfa_fcs_rport_sm_plogiacc_sendingfunction bfa_fcs_rport_sm_plogi_retryfunction bfa_fcs_rport_sm_plogifunction bfa_fcs_rport_sm_fc4_fcs_onlinefunction bfa_fcs_rport_sm_hal_onlinefunction bfa_fcs_rport_sm_onlinefunction bfa_fcs_rport_sm_nsquery_sendingfunction bfa_fcs_rport_sm_nsqueryfunction bfa_fcs_rport_sm_adisc_online_sendingfunction bfa_fcs_rport_sm_adisc_onlinefunction bfa_fcs_rport_sm_adisc_offline_sendingfunction bfa_fcs_rport_sm_adisc_offlinefunction bfa_fcs_rport_sm_fc4_logorcvfunction bfa_fcs_rport_sm_fc4_logosendfunction bfa_fcs_rport_sm_fc4_offlinefunction bfa_fcs_rport_sm_hcb_offlinefunction bfa_fcs_rport_sm_hcb_logorcvfunction bfa_fcs_rport_sm_hcb_logosendfunction bfa_fcs_rport_sm_logo_sendingfunction bfa_fcs_rport_sm_offlinefunction bfa_fcs_rport_sm_nsdisc_sendingfunction bfa_fcs_rport_sm_nsdisc_retryfunction bfa_fcs_rport_sm_nsdisc_sentfunction bfa_fcs_rport_sm_fc4_off_deletefunction bfa_fcs_rport_sm_delete_pendingfunction bfa_fcs_rport_send_plogifunction bfa_fcs_rport_plogi_responsefunction bfa_fcs_rport_send_plogiaccfunction bfa_fcs_rport_send_adiscfunction bfa_fcs_rport_adisc_responsefunction bfa_fcs_rport_send_nsdiscfunction bfa_fcs_rport_gidpn_responsefunction list_for_eachfunction bfa_fcs_rport_gpnid_responsefunction bfa_fcs_rport_send_logofunction bfa_fcs_rport_send_logo_accfunction bfa_fcs_rport_timeoutfunction bfa_fcs_rport_process_prlifunction bfa_fcs_rport_process_rpscfunction bfa_fcs_rport_process_adiscfunction bfa_fcs_rport_hal_onlinefunction bfa_fcs_rport_hal_offlinefunction bfa_fcs_rport_allocfunction bfa_fcs_rport_free
Annotated Snippet
struct bfa_fcs_rport_sm_table_s {
bfa_fcs_rport_sm_t sm; /* state machine function */
enum bfa_rport_state state; /* state machine encoding */
char *name; /* state name for display */
};
static inline enum bfa_rport_state
bfa_rport_sm_to_state(struct bfa_fcs_rport_sm_table_s *smt, bfa_fcs_rport_sm_t sm)
{
int i = 0;
while (smt[i].sm && smt[i].sm != sm)
i++;
return smt[i].state;
}
static struct bfa_fcs_rport_sm_table_s rport_sm_table[] = {
{BFA_SM(bfa_fcs_rport_sm_uninit), BFA_RPORT_UNINIT},
{BFA_SM(bfa_fcs_rport_sm_plogi_sending), BFA_RPORT_PLOGI},
{BFA_SM(bfa_fcs_rport_sm_plogiacc_sending), BFA_RPORT_ONLINE},
{BFA_SM(bfa_fcs_rport_sm_plogi_retry), BFA_RPORT_PLOGI_RETRY},
{BFA_SM(bfa_fcs_rport_sm_plogi), BFA_RPORT_PLOGI},
{BFA_SM(bfa_fcs_rport_sm_fc4_fcs_online), BFA_RPORT_ONLINE},
{BFA_SM(bfa_fcs_rport_sm_hal_online), BFA_RPORT_ONLINE},
{BFA_SM(bfa_fcs_rport_sm_online), BFA_RPORT_ONLINE},
{BFA_SM(bfa_fcs_rport_sm_nsquery_sending), BFA_RPORT_NSQUERY},
{BFA_SM(bfa_fcs_rport_sm_nsquery), BFA_RPORT_NSQUERY},
{BFA_SM(bfa_fcs_rport_sm_adisc_online_sending), BFA_RPORT_ADISC},
{BFA_SM(bfa_fcs_rport_sm_adisc_online), BFA_RPORT_ADISC},
{BFA_SM(bfa_fcs_rport_sm_adisc_offline_sending), BFA_RPORT_ADISC},
{BFA_SM(bfa_fcs_rport_sm_adisc_offline), BFA_RPORT_ADISC},
{BFA_SM(bfa_fcs_rport_sm_fc4_logorcv), BFA_RPORT_LOGORCV},
{BFA_SM(bfa_fcs_rport_sm_fc4_logosend), BFA_RPORT_LOGO},
{BFA_SM(bfa_fcs_rport_sm_fc4_offline), BFA_RPORT_OFFLINE},
{BFA_SM(bfa_fcs_rport_sm_hcb_offline), BFA_RPORT_OFFLINE},
{BFA_SM(bfa_fcs_rport_sm_hcb_logorcv), BFA_RPORT_LOGORCV},
{BFA_SM(bfa_fcs_rport_sm_hcb_logosend), BFA_RPORT_LOGO},
{BFA_SM(bfa_fcs_rport_sm_logo_sending), BFA_RPORT_LOGO},
{BFA_SM(bfa_fcs_rport_sm_offline), BFA_RPORT_OFFLINE},
{BFA_SM(bfa_fcs_rport_sm_nsdisc_sending), BFA_RPORT_NSDISC},
{BFA_SM(bfa_fcs_rport_sm_nsdisc_retry), BFA_RPORT_NSDISC},
{BFA_SM(bfa_fcs_rport_sm_nsdisc_sent), BFA_RPORT_NSDISC},
};
/*
* Beginning state.
*/
static void
bfa_fcs_rport_sm_uninit(struct bfa_fcs_rport_s *rport, enum rport_event event)
{
bfa_trc(rport->fcs, rport->pwwn);
bfa_trc(rport->fcs, rport->pid);
bfa_trc(rport->fcs, event);
switch (event) {
case RPSM_EVENT_PLOGI_SEND:
bfa_sm_set_state(rport, bfa_fcs_rport_sm_plogi_sending);
rport->plogi_retries = 0;
bfa_fcs_rport_send_plogi(rport, NULL);
break;
case RPSM_EVENT_PLOGI_RCVD:
bfa_sm_set_state(rport, bfa_fcs_rport_sm_plogiacc_sending);
bfa_fcs_rport_send_plogiacc(rport, NULL);
break;
case RPSM_EVENT_PLOGI_COMP:
bfa_sm_set_state(rport, bfa_fcs_rport_sm_hal_online);
bfa_fcs_rport_hal_online(rport);
break;
case RPSM_EVENT_ADDRESS_CHANGE:
case RPSM_EVENT_ADDRESS_DISC:
bfa_sm_set_state(rport, bfa_fcs_rport_sm_nsdisc_sending);
rport->ns_retries = 0;
bfa_fcs_rport_send_nsdisc(rport, NULL);
break;
default:
bfa_sm_fault(rport->fcs, event);
}
}
/*
* PLOGI is being sent.
*/
static void
bfa_fcs_rport_sm_plogi_sending(struct bfa_fcs_rport_s *rport,
enum rport_event event)
{
bfa_trc(rport->fcs, rport->pwwn);
Annotation
- Immediate include surface: `bfad_drv.h`, `bfad_im.h`, `bfa_fcs.h`, `bfa_fcbuild.h`.
- Detected declarations: `struct bfa_fcs_rport_sm_table_s`, `function bfa_rport_sm_to_state`, `function bfa_fcs_rport_sm_uninit`, `function bfa_fcs_rport_sm_plogi_sending`, `function bfa_fcs_rport_sm_plogiacc_sending`, `function bfa_fcs_rport_sm_plogi_retry`, `function bfa_fcs_rport_sm_plogi`, `function bfa_fcs_rport_sm_fc4_fcs_online`, `function bfa_fcs_rport_sm_hal_online`, `function bfa_fcs_rport_sm_online`.
- 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.