drivers/scsi/bfa/bfa_port.c
Source file repositories/reference/linux-study-clean/drivers/scsi/bfa/bfa_port.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/bfa/bfa_port.c- Extension
.c- Size
- 19857 bytes
- Lines
- 865
- 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.hbfa_defs_svc.hbfa_port.hbfi.hbfa_ioc.h
Detected Declarations
function bfa_port_stats_swapfunction bfa_port_enable_isrfunction bfa_port_disable_isrfunction bfa_port_get_stats_isrfunction bfa_port_clear_stats_isrfunction bfa_port_isrfunction bfa_port_meminfofunction bfa_port_mem_claimfunction bfa_port_enablefunction bfa_port_disablefunction bfa_port_get_statsfunction bfa_port_clear_statsfunction bfa_port_notifyfunction bfa_port_attachfunction bfa_port_set_dportenabledfunction bfa_cee_get_attr_isrfunction bfa_cee_get_stats_isrfunction bfa_cee_reset_stats_isrfunction bfa_cee_meminfofunction bfa_cee_mem_claimfunction bfa_cee_get_attrfunction bfa_cee_get_statsfunction bfa_cee_reset_statsfunction bfa_cee_isrsfunction bfa_cee_notifyfunction bfa_cee_attach
Annotated Snippet
if (port->stats_busy) {
if (port->stats_cbfn)
port->stats_cbfn(port->stats_cbarg,
BFA_STATUS_FAILED);
port->stats_cbfn = NULL;
port->stats_busy = BFA_FALSE;
}
/* Clear any enable/disable is pending */
if (port->endis_pending) {
if (port->endis_cbfn)
port->endis_cbfn(port->endis_cbarg,
BFA_STATUS_FAILED);
port->endis_cbfn = NULL;
port->endis_pending = BFA_FALSE;
}
/* clear D-port mode */
if (port->dport_enabled)
bfa_port_set_dportenabled(port, BFA_FALSE);
break;
default:
break;
}
}
/*
* bfa_port_attach()
*
*
* @param[in] port - Pointer to the Port module data structure
* ioc - Pointer to the ioc module data structure
* dev - Pointer to the device driver module data structure
* The device driver specific mbox ISR functions have
* this pointer as one of the parameters.
* trcmod -
*
* @return void
*/
void
bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc,
void *dev, struct bfa_trc_mod_s *trcmod)
{
WARN_ON(!port);
port->dev = dev;
port->ioc = ioc;
port->trcmod = trcmod;
port->stats_busy = BFA_FALSE;
port->endis_pending = BFA_FALSE;
port->stats_cbfn = NULL;
port->endis_cbfn = NULL;
port->pbc_disabled = BFA_FALSE;
port->dport_enabled = BFA_FALSE;
bfa_ioc_mbox_regisr(port->ioc, BFI_MC_PORT, bfa_port_isr, port);
bfa_q_qe_init(&port->ioc_notify);
bfa_ioc_notify_init(&port->ioc_notify, bfa_port_notify, port);
list_add_tail(&port->ioc_notify.qe, &port->ioc->notify_q);
/*
* initialize time stamp for stats reset
*/
port->stats_reset_time = ktime_get_seconds();
bfa_trc(port, 0);
}
/*
* bfa_port_set_dportenabled();
*
* Port module- set pbc disabled flag
*
* @param[in] port - Pointer to the Port module data structure
*
* @return void
*/
void
bfa_port_set_dportenabled(struct bfa_port_s *port, bfa_boolean_t enabled)
{
port->dport_enabled = enabled;
}
/*
* CEE module specific definitions
*/
/*
* bfa_cee_get_attr_isr()
Annotation
- Immediate include surface: `bfad_drv.h`, `bfa_defs_svc.h`, `bfa_port.h`, `bfi.h`, `bfa_ioc.h`.
- Detected declarations: `function bfa_port_stats_swap`, `function bfa_port_enable_isr`, `function bfa_port_disable_isr`, `function bfa_port_get_stats_isr`, `function bfa_port_clear_stats_isr`, `function bfa_port_isr`, `function bfa_port_meminfo`, `function bfa_port_mem_claim`, `function bfa_port_enable`, `function bfa_port_disable`.
- 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.