drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c- Extension
.c- Size
- 26847 bytes
- Lines
- 992
- 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/debugfs.hlinux/device.hlinux/seq_file.hlinux/string_choices.hhnae3.hhns3_debugfs.hhns3_enet.h
Detected Declarations
function hns3_get_coal_infofunction hns3_dump_coal_infofunction hns3_dbg_coal_infofunction hns3_dump_rx_queue_infofunction hns3_dbg_rx_queue_infofunction hns3_dump_tx_queue_infofunction hns3_dbg_tx_queue_infofunction hns3_dbg_queue_mapfunction hns3_dump_rx_bd_infofunction hns3_dbg_rx_bd_infofunction hns3_dump_tx_bd_infofunction hns3_dbg_tx_bd_infofunction hns3_dbg_dev_capsfunction hns3_dbg_dev_specsfunction hns3_dbg_dev_infofunction hns3_dump_page_pool_infofunction hns3_dbg_page_pool_infofunction hns3_dbg_bd_info_showfunction hns3_dbg_bd_file_initfunction hns3_dbg_common_init_t1function hns3_dbg_common_init_t2function hns3_dbg_initfunction hns3_dbg_uninitfunction hns3_dbg_register_debugfsfunction hns3_dbg_unregister_debugfs
Annotated Snippet
if (!hns3_dbg_cmd[i].init) {
dev_err(&handle->pdev->dev,
"cmd %s lack of init func\n",
hns3_dbg_cmd[i].name);
ret = -EINVAL;
goto out;
}
ret = hns3_dbg_cmd[i].init(handle, i);
if (ret) {
dev_err(&handle->pdev->dev, "failed to init cmd %s\n",
hns3_dbg_cmd[i].name);
goto out;
}
}
return 0;
out:
debugfs_remove_recursive(handle->hnae3_dbgfs);
handle->hnae3_dbgfs = NULL;
return ret;
}
void hns3_dbg_uninit(struct hnae3_handle *handle)
{
debugfs_remove_recursive(handle->hnae3_dbgfs);
handle->hnae3_dbgfs = NULL;
}
void hns3_dbg_register_debugfs(const char *debugfs_dir_name)
{
hns3_dbgfs_root = debugfs_create_dir(debugfs_dir_name, NULL);
}
void hns3_dbg_unregister_debugfs(void)
{
debugfs_remove_recursive(hns3_dbgfs_root);
hns3_dbgfs_root = NULL;
}
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/device.h`, `linux/seq_file.h`, `linux/string_choices.h`, `hnae3.h`, `hns3_debugfs.h`, `hns3_enet.h`.
- Detected declarations: `function hns3_get_coal_info`, `function hns3_dump_coal_info`, `function hns3_dbg_coal_info`, `function hns3_dump_rx_queue_info`, `function hns3_dbg_rx_queue_info`, `function hns3_dump_tx_queue_info`, `function hns3_dbg_tx_queue_info`, `function hns3_dbg_queue_map`, `function hns3_dump_rx_bd_info`, `function hns3_dbg_rx_bd_info`.
- 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.