drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c- Extension
.c- Size
- 31647 bytes
- Lines
- 1303
- 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
qlcnic.hqlcnic_hw.h
Detected Declarations
struct crb_addr_pairfunction crb_addr_transform_setupfunction qlcnic_release_rx_buffersfunction qlcnic_reset_rx_buffers_listfunction qlcnic_release_tx_buffersfunction qlcnic_free_sw_resourcesfunction qlcnic_alloc_sw_resourcesfunction qlcnic_decode_crb_addrfunction qlcnic_wait_rom_donefunction do_rom_fast_readfunction do_rom_fast_read_wordsfunction qlcnic_rom_fast_read_wordsfunction qlcnic_rom_fast_readfunction qlcnic_pinit_from_romfunction qlcnic_rom_fast_readfunction qlcnic_cmd_peg_readyfunction qlcnic_receive_peg_readyfunction qlcnic_check_fw_statusfunction qlcnic_setup_idc_paramfunction qlcnic_get_flt_entryfunction qlcnic_check_flash_fw_verfunction qlcnic_has_mnfunction qlcnic_validate_headerfunction qlcnic_validate_bootldfunction qlcnic_validate_fwfunction qlcnic_validate_product_offsfunction qlcnic_validate_unified_romimagefunction qlcnic_get_bootld_offsfunction qlcnic_get_fw_offsfunction qlcnic_get_fw_sizefunction qlcnic_get_fw_versionfunction qlcnic_get_bios_versionfunction qlcnic_rom_lock_recoveryfunction qlcnic_check_fw_hearbeatfunction qlcnic_need_fw_resetfunction qlcnic_load_firmwarefunction qlcnic_validate_firmwarefunction qlcnic_get_next_fwtypefunction qlcnic_request_firmwarefunction qlcnic_release_firmware
Annotated Snippet
struct crb_addr_pair {
u32 addr;
u32 data;
};
#define QLCNIC_MAX_CRB_XFORM 60
static unsigned int crb_addr_xform[QLCNIC_MAX_CRB_XFORM];
#define crb_addr_transform(name) \
(crb_addr_xform[QLCNIC_HW_PX_MAP_CRB_##name] = \
QLCNIC_HW_CRB_HUB_AGT_ADR_##name << 20)
#define QLCNIC_ADDR_ERROR (0xffffffff)
static int
qlcnic_check_fw_hearbeat(struct qlcnic_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 qlcnic_release_rx_buffers(struct qlcnic_adapter *adapter)
{
struct qlcnic_recv_context *recv_ctx;
struct qlcnic_host_rds_ring *rds_ring;
struct qlcnic_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->skb == NULL)
continue;
dma_unmap_single(&adapter->pdev->dev, rx_buf->dma,
rds_ring->dma_size, DMA_FROM_DEVICE);
Annotation
- Immediate include surface: `qlcnic.h`, `qlcnic_hw.h`.
- Detected declarations: `struct crb_addr_pair`, `function crb_addr_transform_setup`, `function qlcnic_release_rx_buffers`, `function qlcnic_reset_rx_buffers_list`, `function qlcnic_release_tx_buffers`, `function qlcnic_free_sw_resources`, `function qlcnic_alloc_sw_resources`, `function qlcnic_decode_crb_addr`, `function qlcnic_wait_rom_done`, `function do_rom_fast_read`.
- 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.