drivers/net/ethernet/brocade/bna/bfa_ioc.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/brocade/bna/bfa_ioc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/brocade/bna/bfa_ioc.c- Extension
.c- Size
- 79160 bytes
- Lines
- 3378
- Domain
- Driver Families
- Bucket
- drivers/net
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
bfa_ioc.hbfi_reg.hbfa_defs.h
Detected Declarations
enum ioc_eventenum iocpf_eventenum bfa_iocpf_stateenum bfa_flash_cmdenum bfa_flash_errfunction bfa_ioc_sm_uninit_entryfunction bfa_ioc_sm_reset_entryfunction bfa_ioc_sm_resetfunction bfa_ioc_sm_enabling_entryfunction bfa_ioc_sm_enablingfunction bfa_ioc_sm_getattr_entryfunction bfa_ioc_sm_getattrfunction bfa_ioc_sm_op_entryfunction bfa_ioc_sm_opfunction bfa_ioc_sm_disabling_entryfunction bfa_ioc_sm_disablingfunction bfa_ioc_sm_disabled_entryfunction bfa_ioc_sm_disabledfunction bfa_ioc_sm_fail_retry_entryfunction bfa_ioc_sm_fail_entryfunction bfa_ioc_sm_hwfail_entryfunction bfa_iocpf_sm_reset_entryfunction bfa_iocpf_sm_resetfunction bfa_iocpf_sm_fwcheck_entryfunction bfa_iocpf_sm_fwcheckfunction bfa_iocpf_sm_mismatch_entryfunction bfa_iocpf_sm_mismatchfunction bfa_iocpf_sm_semwait_entryfunction bfa_iocpf_sm_semwaitfunction bfa_iocpf_sm_hwinit_entryfunction bfa_iocpf_sm_hwinitfunction bfa_iocpf_sm_enabling_entryfunction bfa_iocpf_sm_enablingfunction bfa_iocpf_sm_ready_entryfunction bfa_iocpf_sm_readyfunction bfa_iocpf_sm_disabling_entryfunction bfa_iocpf_sm_disablingfunction bfa_iocpf_sm_disabling_sync_entryfunction bfa_iocpf_sm_disabling_syncfunction bfa_iocpf_sm_disabled_entryfunction bfa_iocpf_sm_disabledfunction bfa_iocpf_sm_initfail_sync_entryfunction bfa_iocpf_sm_initfail_syncfunction bfa_iocpf_sm_initfail_entryfunction bfa_iocpf_sm_fail_sync_entryfunction bfa_iocpf_sm_fail_syncfunction bfa_iocpf_sm_fail_entryfunction bfa_ioc_event_notify
Annotated Snippet
if (bfa_ioc_firmware_lock(ioc)) {
if (bfa_ioc_sync_start(ioc)) {
bfa_ioc_sync_join(ioc);
bfa_fsm_set_state(iocpf, bfa_iocpf_sm_hwinit);
} else {
bfa_ioc_firmware_unlock(ioc);
bfa_nw_ioc_hw_sem_release(ioc);
mod_timer(&ioc->sem_timer, jiffies +
msecs_to_jiffies(BFA_IOC_HWSEM_TOV));
}
} else {
bfa_nw_ioc_hw_sem_release(ioc);
bfa_fsm_set_state(iocpf, bfa_iocpf_sm_mismatch);
}
break;
case IOCPF_E_SEM_ERROR:
bfa_fsm_set_state(iocpf, bfa_iocpf_sm_fail);
bfa_ioc_pf_hwfailed(ioc);
break;
case IOCPF_E_DISABLE:
bfa_ioc_hw_sem_get_cancel(ioc);
bfa_fsm_set_state(iocpf, bfa_iocpf_sm_reset);
bfa_ioc_pf_disabled(ioc);
break;
case IOCPF_E_STOP:
bfa_ioc_hw_sem_get_cancel(ioc);
bfa_fsm_set_state(iocpf, bfa_iocpf_sm_reset);
break;
default:
bfa_sm_fault(event);
}
}
/* Notify enable completion callback */
static void
bfa_iocpf_sm_mismatch_entry(struct bfa_iocpf *iocpf)
{
/* Call only the first time sm enters fwmismatch state. */
if (!iocpf->fw_mismatch_notified)
bfa_ioc_pf_fwmismatch(iocpf->ioc);
iocpf->fw_mismatch_notified = true;
mod_timer(&(iocpf->ioc)->iocpf_timer, jiffies +
msecs_to_jiffies(BFA_IOC_TOV));
}
/* Awaiting firmware version match. */
static void
bfa_iocpf_sm_mismatch(struct bfa_iocpf *iocpf, enum iocpf_event event)
{
struct bfa_ioc *ioc = iocpf->ioc;
switch (event) {
case IOCPF_E_TIMEOUT:
bfa_fsm_set_state(iocpf, bfa_iocpf_sm_fwcheck);
break;
case IOCPF_E_DISABLE:
timer_delete(&ioc->iocpf_timer);
bfa_fsm_set_state(iocpf, bfa_iocpf_sm_reset);
bfa_ioc_pf_disabled(ioc);
break;
case IOCPF_E_STOP:
timer_delete(&ioc->iocpf_timer);
bfa_fsm_set_state(iocpf, bfa_iocpf_sm_reset);
break;
default:
bfa_sm_fault(event);
}
}
/* Request for semaphore. */
static void
bfa_iocpf_sm_semwait_entry(struct bfa_iocpf *iocpf)
{
bfa_ioc_hw_sem_get(iocpf->ioc);
}
/* Awaiting semaphore for h/w initialzation. */
static void
bfa_iocpf_sm_semwait(struct bfa_iocpf *iocpf, enum iocpf_event event)
{
struct bfa_ioc *ioc = iocpf->ioc;
Annotation
- Immediate include surface: `bfa_ioc.h`, `bfi_reg.h`, `bfa_defs.h`.
- Detected declarations: `enum ioc_event`, `enum iocpf_event`, `enum bfa_iocpf_state`, `enum bfa_flash_cmd`, `enum bfa_flash_err`, `function bfa_ioc_sm_uninit_entry`, `function bfa_ioc_sm_reset_entry`, `function bfa_ioc_sm_reset`, `function bfa_ioc_sm_enabling_entry`, `function bfa_ioc_sm_enabling`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.