drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c- Extension
.c- Size
- 46857 bytes
- Lines
- 1911
- 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.
- 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/netdevice.hlinux/delay.hlinux/slab.hlinux/if_vlan.hnet/checksum.hnetxen_nic.hnetxen_nic_hw.h
Detected Declarations
struct crb_addr_pairfunction crb_addr_transform_setupfunction netxen_release_rx_buffersfunction netxen_release_tx_buffersfunction netxen_free_sw_resourcesfunction netxen_alloc_sw_resourcesfunction netxen_decode_crb_addrfunction netxen_wait_rom_donefunction do_rom_fast_readfunction do_rom_fast_read_wordsfunction netxen_rom_fast_read_wordsfunction netxen_rom_fast_readfunction netxen_pinit_from_romfunction netxen_nic_validate_headerfunction netxen_nic_validate_bootldfunction netxen_nic_validate_fwfunction netxen_nic_validate_product_offsfunction netxen_nic_validate_unified_romimagefunction nx_get_bootld_offsfunction nx_get_fw_offsfunction nx_get_fw_sizefunction nx_get_fw_versionfunction nx_get_bios_versionfunction netxen_need_fw_resetfunction netxen_check_flash_fw_compatibilityfunction netxen_load_firmwarefunction netxen_validate_firmwarefunction NX_IS_REVISION_P3function NX_IS_REVISION_P2function nx_get_next_fwtypefunction netxen_p3_has_mnfunction netxen_request_firmwarefunction netxen_release_firmwarefunction netxen_init_dummy_dmafunction netxen_free_dummy_dmafunction netxen_phantom_initfunction netxen_receive_peg_readyfunction netxen_init_firmwarefunction netxen_handle_linkeventfunction netxen_handle_fw_messagefunction netxen_alloc_rx_skbfunction netxen_process_rcvfunction netxen_process_lrofunction netxen_process_rcv_ringfunction netxen_process_cmd_ringfunction netxen_post_rx_buffersfunction netxen_post_rx_buffers_nodbfunction netxen_nic_clear_stats
Annotated Snippet
struct crb_addr_pair {
u32 addr;
u32 data;
};
#define NETXEN_MAX_CRB_XFORM 60
static unsigned int crb_addr_xform[NETXEN_MAX_CRB_XFORM];
#define NETXEN_ADDR_ERROR (0xffffffff)
#define crb_addr_transform(name) \
crb_addr_xform[NETXEN_HW_PX_MAP_CRB_##name] = \
NETXEN_HW_CRB_HUB_AGT_ADR_##name << 20
#define NETXEN_NIC_XDMA_RESET 0x8000ff
static void
netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter,
struct nx_host_rds_ring *rds_ring);
static int netxen_p3_has_mn(struct netxen_adapter *adapter);
static void crb_addr_transform_setup(void)
{
crb_addr_transform(XDMA);
crb_addr_transform(TIMR);
crb_addr_transform(SRE);
crb_addr_transform(SQN3);
crb_addr_transform(SQN2);
crb_addr_transform(SQN1);
crb_addr_transform(SQN0);
crb_addr_transform(SQS3);
crb_addr_transform(SQS2);
crb_addr_transform(SQS1);
crb_addr_transform(SQS0);
crb_addr_transform(RPMX7);
crb_addr_transform(RPMX6);
crb_addr_transform(RPMX5);
crb_addr_transform(RPMX4);
crb_addr_transform(RPMX3);
crb_addr_transform(RPMX2);
crb_addr_transform(RPMX1);
crb_addr_transform(RPMX0);
crb_addr_transform(ROMUSB);
crb_addr_transform(SN);
crb_addr_transform(QMN);
crb_addr_transform(QMS);
crb_addr_transform(PGNI);
crb_addr_transform(PGND);
crb_addr_transform(PGN3);
crb_addr_transform(PGN2);
crb_addr_transform(PGN1);
crb_addr_transform(PGN0);
crb_addr_transform(PGSI);
crb_addr_transform(PGSD);
crb_addr_transform(PGS3);
crb_addr_transform(PGS2);
crb_addr_transform(PGS1);
crb_addr_transform(PGS0);
crb_addr_transform(PS);
crb_addr_transform(PH);
crb_addr_transform(NIU);
crb_addr_transform(I2Q);
crb_addr_transform(EG);
crb_addr_transform(MN);
crb_addr_transform(MS);
crb_addr_transform(CAS2);
crb_addr_transform(CAS1);
crb_addr_transform(CAS0);
crb_addr_transform(CAM);
crb_addr_transform(C2C1);
crb_addr_transform(C2C0);
crb_addr_transform(SMB);
crb_addr_transform(OCM0);
crb_addr_transform(I2C0);
}
void netxen_release_rx_buffers(struct netxen_adapter *adapter)
{
struct netxen_recv_context *recv_ctx;
struct nx_host_rds_ring *rds_ring;
struct netxen_rx_buffer *rx_buf;
int i, ring;
recv_ctx = &adapter->recv_ctx;
for (ring = 0; ring < adapter->max_rds_rings; ring++) {
rds_ring = &recv_ctx->rds_rings[ring];
for (i = 0; i < rds_ring->num_desc; ++i) {
rx_buf = &(rds_ring->rx_buf_arr[i]);
if (rx_buf->state == NETXEN_BUFFER_FREE)
continue;
dma_unmap_single(&adapter->pdev->dev, rx_buf->dma,
Annotation
- Immediate include surface: `linux/netdevice.h`, `linux/delay.h`, `linux/slab.h`, `linux/if_vlan.h`, `net/checksum.h`, `netxen_nic.h`, `netxen_nic_hw.h`.
- Detected declarations: `struct crb_addr_pair`, `function crb_addr_transform_setup`, `function netxen_release_rx_buffers`, `function netxen_release_tx_buffers`, `function netxen_free_sw_resources`, `function netxen_alloc_sw_resources`, `function netxen_decode_crb_addr`, `function netxen_wait_rom_done`, `function do_rom_fast_read`, `function do_rom_fast_read_words`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source 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.