drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c- Extension
.c- Size
- 14814 bytes
- Lines
- 628
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/kernel.hlinux/errno.hlinux/interrupt.hlinux/pci.hlinux/netdevice.hlinux/rtnetlink.hlinux/bitops.hlinux/irq.hasm/byteorder.hlinux/bitmap.hlinux/auxiliary_bus.hnet/netdev_lock.hlinux/bnxt/hsi.hlinux/bnxt/ulp.hbnxt.hbnxt_hwrm.h
Detected Declarations
struct bnxt_aux_devicefunction bnxt_auxdev_set_statefunction bnxt_auxdev_is_initfunction bnxt_auxdev_is_activefunction bnxt_fill_msix_vecsfunction bnxt_get_ulp_msix_numfunction bnxt_set_ulp_msix_numfunction bnxt_get_ulp_msix_num_in_usefunction bnxt_get_ulp_stat_ctxsfunction bnxt_set_ulp_stat_ctxsfunction bnxt_get_ulp_stat_ctxs_in_usefunction bnxt_set_dflt_ulp_stat_ctxsfunction bnxt_register_devfunction bnxt_unregister_devfunction bnxt_set_dflt_ulp_msixfunction bnxt_send_msgfunction bnxt_ulp_stopfunction bnxt_ulp_startfunction bnxt_ulp_irq_stopfunction bnxt_ulp_irq_restartfunction bnxt_ulp_async_eventsfunction bnxt_register_async_eventsfunction bnxt_aux_devices_uninitfunction bnxt_aux_dev_releasefunction bnxt_aux_devices_delfunction bnxt_set_edev_infofunction bnxt_aux_devices_addfunction bnxt_aux_devices_initfunction bnxt_auxdev_id_allocfunction bnxt_auxdev_id_freeexport bnxt_register_devexport bnxt_unregister_devexport bnxt_send_msgexport bnxt_register_async_events
Annotated Snippet
struct bnxt_aux_device {
const char *name;
};
static void bnxt_auxdev_set_state(struct bnxt *bp, int idx, int state)
{
bp->auxdev_state[idx] = state;
}
static bool bnxt_auxdev_is_init(struct bnxt *bp, int idx)
{
return (bp->auxdev_state[idx] == BNXT_ADEV_STATE_INIT);
}
static bool bnxt_auxdev_is_active(struct bnxt *bp, int idx)
{
return (bp->auxdev_state[idx] == BNXT_ADEV_STATE_ADD);
}
static struct bnxt_aux_device bnxt_aux_devices[__BNXT_AUXDEV_MAX] = {{
.name = "rdma",
}, {
.name = "fwctl",
}};
static void bnxt_fill_msix_vecs(struct bnxt *bp, struct bnxt_msix_entry *ent)
{
struct bnxt_en_dev *edev = bp->edev[BNXT_AUXDEV_RDMA];
int num_msix, i;
if (!edev->ulp_tbl->msix_requested) {
netdev_warn(bp->dev, "Requested MSI-X vectors insufficient\n");
return;
}
num_msix = edev->ulp_tbl->msix_requested;
for (i = 0; i < num_msix; i++) {
ent[i].vector = bp->irq_tbl[i].vector;
ent[i].ring_idx = i;
if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS)
ent[i].db_offset = bp->db_offset;
else
ent[i].db_offset = i * 0x80;
}
}
int bnxt_get_ulp_msix_num(struct bnxt *bp)
{
struct bnxt_en_dev *edev = bp->edev[BNXT_AUXDEV_RDMA];
if (edev)
return edev->ulp_num_msix_vec;
return 0;
}
void bnxt_set_ulp_msix_num(struct bnxt *bp, int num)
{
struct bnxt_en_dev *edev = bp->edev[BNXT_AUXDEV_RDMA];
if (edev)
edev->ulp_num_msix_vec = num;
}
int bnxt_get_ulp_msix_num_in_use(struct bnxt *bp)
{
struct bnxt_en_dev *edev = bp->edev[BNXT_AUXDEV_RDMA];
if (bnxt_ulp_registered(edev))
return edev->ulp_num_msix_vec;
return 0;
}
int bnxt_get_ulp_stat_ctxs(struct bnxt *bp)
{
struct bnxt_en_dev *edev = bp->edev[BNXT_AUXDEV_RDMA];
if (edev)
return edev->ulp_num_ctxs;
return 0;
}
void bnxt_set_ulp_stat_ctxs(struct bnxt *bp, int num_ulp_ctx)
{
struct bnxt_en_dev *edev = bp->edev[BNXT_AUXDEV_RDMA];
if (edev)
edev->ulp_num_ctxs = num_ulp_ctx;
}
int bnxt_get_ulp_stat_ctxs_in_use(struct bnxt *bp)
{
Annotation
- Immediate include surface: `linux/module.h`, `linux/kernel.h`, `linux/errno.h`, `linux/interrupt.h`, `linux/pci.h`, `linux/netdevice.h`, `linux/rtnetlink.h`, `linux/bitops.h`.
- Detected declarations: `struct bnxt_aux_device`, `function bnxt_auxdev_set_state`, `function bnxt_auxdev_is_init`, `function bnxt_auxdev_is_active`, `function bnxt_fill_msix_vecs`, `function bnxt_get_ulp_msix_num`, `function bnxt_set_ulp_msix_num`, `function bnxt_get_ulp_msix_num_in_use`, `function bnxt_get_ulp_stat_ctxs`, `function bnxt_set_ulp_stat_ctxs`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- 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.