drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c- Extension
.c- Size
- 102387 bytes
- Lines
- 3610
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/sort.hlinux/string.ht4_regs.hcxgb4.hcxgb4_cudbg.hcudbg_if.hcudbg_lib_common.hcudbg_entity.hcudbg_lib.hcudbg_zlib.hcxgb4_tc_mqprio.h
Detected Declarations
function cudbg_get_entity_lengthfunction cudbg_do_compressionfunction cudbg_write_and_release_bufffunction is_fw_attachedfunction cudbg_align_debug_bufferfunction cudbg_read_vpd_regfunction cudbg_mem_desc_cmpfunction cudbg_fill_meminfofunction cudbg_collect_reg_dumpfunction cudbg_collect_fw_devlogfunction cudbg_collect_cim_lafunction cudbg_collect_cim_ma_lafunction cudbg_collect_cim_qcfgfunction cudbg_read_cim_ibqfunction cudbg_collect_cim_ibq_tp0function cudbg_collect_cim_ibq_tp1function cudbg_collect_cim_ibq_ulpfunction cudbg_collect_cim_ibq_sge0function cudbg_collect_cim_ibq_sge1function cudbg_collect_cim_ibq_ncsifunction cudbg_cim_obq_sizefunction cudbg_read_cim_obqfunction cudbg_collect_cim_obq_ulp0function cudbg_collect_cim_obq_ulp1function cudbg_collect_cim_obq_ulp2function cudbg_collect_cim_obq_ulp3function cudbg_collect_cim_obq_sgefunction cudbg_collect_cim_obq_ncsifunction cudbg_collect_obq_sge_rx_q0function cudbg_collect_obq_sge_rx_q1function cudbg_meminfo_get_mem_indexfunction cudbg_get_mem_regionfunction cudbg_get_mem_relativefunction cudbg_get_payload_rangefunction cudbg_memory_readfunction cudbg_read_fw_memfunction cudbg_t4_fwcachefunction cudbg_mem_region_sizefunction cudbg_collect_mem_regionfunction cudbg_collect_edc0_meminfofunction cudbg_collect_edc1_meminfofunction cudbg_collect_mc0_meminfofunction cudbg_collect_mc1_meminfofunction cudbg_collect_hma_meminfofunction cudbg_collect_rssfunction cudbg_collect_rss_vf_configfunction cudbg_collect_path_mtufunction cudbg_collect_pm_stats
Annotated Snippet
switch (CHELSIO_CHIP_VERSION(adap->params.chip)) {
case CHELSIO_T4:
len = T4_REGMAP_SIZE;
break;
case CHELSIO_T5:
case CHELSIO_T6:
len = T5_REGMAP_SIZE;
break;
default:
break;
}
break;
case CUDBG_DEV_LOG:
len = adap->params.devlog.size;
break;
case CUDBG_CIM_LA:
if (is_t6(adap->params.chip)) {
len = adap->params.cim_la_size / 10 + 1;
len *= 10 * sizeof(u32);
} else {
len = adap->params.cim_la_size / 8;
len *= 8 * sizeof(u32);
}
len += sizeof(u32); /* for reading CIM LA configuration */
break;
case CUDBG_CIM_MA_LA:
len = 2 * CIM_MALA_SIZE * 5 * sizeof(u32);
break;
case CUDBG_CIM_QCFG:
len = sizeof(struct cudbg_cim_qcfg);
break;
case CUDBG_CIM_IBQ_TP0:
case CUDBG_CIM_IBQ_TP1:
case CUDBG_CIM_IBQ_ULP:
case CUDBG_CIM_IBQ_SGE0:
case CUDBG_CIM_IBQ_SGE1:
case CUDBG_CIM_IBQ_NCSI:
len = CIM_IBQ_SIZE * 4 * sizeof(u32);
break;
case CUDBG_CIM_OBQ_ULP0:
len = cudbg_cim_obq_size(adap, 0);
break;
case CUDBG_CIM_OBQ_ULP1:
len = cudbg_cim_obq_size(adap, 1);
break;
case CUDBG_CIM_OBQ_ULP2:
len = cudbg_cim_obq_size(adap, 2);
break;
case CUDBG_CIM_OBQ_ULP3:
len = cudbg_cim_obq_size(adap, 3);
break;
case CUDBG_CIM_OBQ_SGE:
len = cudbg_cim_obq_size(adap, 4);
break;
case CUDBG_CIM_OBQ_NCSI:
len = cudbg_cim_obq_size(adap, 5);
break;
case CUDBG_CIM_OBQ_RXQ0:
len = cudbg_cim_obq_size(adap, 6);
break;
case CUDBG_CIM_OBQ_RXQ1:
len = cudbg_cim_obq_size(adap, 7);
break;
case CUDBG_EDC0:
value = t4_read_reg(adap, MA_TARGET_MEM_ENABLE_A);
if (value & EDRAM0_ENABLE_F) {
value = t4_read_reg(adap, MA_EDRAM0_BAR_A);
len = EDRAM0_SIZE_G(value);
}
len = cudbg_mbytes_to_bytes(len);
break;
case CUDBG_EDC1:
value = t4_read_reg(adap, MA_TARGET_MEM_ENABLE_A);
if (value & EDRAM1_ENABLE_F) {
value = t4_read_reg(adap, MA_EDRAM1_BAR_A);
len = EDRAM1_SIZE_G(value);
}
len = cudbg_mbytes_to_bytes(len);
break;
case CUDBG_MC0:
value = t4_read_reg(adap, MA_TARGET_MEM_ENABLE_A);
if (value & EXT_MEM0_ENABLE_F) {
value = t4_read_reg(adap, MA_EXT_MEMORY0_BAR_A);
len = EXT_MEM0_SIZE_G(value);
}
len = cudbg_mbytes_to_bytes(len);
break;
case CUDBG_MC1:
value = t4_read_reg(adap, MA_TARGET_MEM_ENABLE_A);
if (value & EXT_MEM1_ENABLE_F) {
Annotation
- Immediate include surface: `linux/sort.h`, `linux/string.h`, `t4_regs.h`, `cxgb4.h`, `cxgb4_cudbg.h`, `cudbg_if.h`, `cudbg_lib_common.h`, `cudbg_entity.h`.
- Detected declarations: `function cudbg_get_entity_length`, `function cudbg_do_compression`, `function cudbg_write_and_release_buff`, `function is_fw_attached`, `function cudbg_align_debug_buffer`, `function cudbg_read_vpd_reg`, `function cudbg_mem_desc_cmp`, `function cudbg_fill_meminfo`, `function cudbg_collect_reg_dump`, `function cudbg_collect_fw_devlog`.
- 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.
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.