tools/usb/usbip/src/usbip_port.c
Source file repositories/reference/linux-study-clean/tools/usb/usbip/src/usbip_port.c
File Facts
- System
- Linux kernel
- Corpus path
tools/usb/usbip/src/usbip_port.c- Extension
.c- Size
- 1100 bytes
- Lines
- 58
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
vhci_driver.husbip_common.h
Detected Declarations
function Copyrightfunction usbip_port_show
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright (C) 2011 matt mooney <mfm@muteddisk.com>
* 2005-2007 Takahiro Hirofuchi
*/
#include "vhci_driver.h"
#include "usbip_common.h"
static int list_imported_devices(void)
{
int i;
struct usbip_imported_device *idev;
int ret;
if (usbip_names_init(USBIDS_FILE))
err("failed to open %s", USBIDS_FILE);
ret = usbip_vhci_driver_open();
if (ret < 0) {
err("open vhci_driver (is vhci_hcd loaded?)");
goto err_names_free;
}
printf("Imported USB devices\n");
printf("====================\n");
for (i = 0; i < vhci_driver->nports; i++) {
idev = &vhci_driver->idev[i];
if (usbip_vhci_imported_device_dump(idev) < 0)
goto err_driver_close;
}
usbip_vhci_driver_close();
usbip_names_free();
return ret;
err_driver_close:
usbip_vhci_driver_close();
err_names_free:
usbip_names_free();
return -1;
}
int usbip_port_show(__attribute__((unused)) int argc,
__attribute__((unused)) char *argv[])
{
int ret;
ret = list_imported_devices();
if (ret < 0)
err("list imported devices");
return ret;
}
Annotation
- Immediate include surface: `vhci_driver.h`, `usbip_common.h`.
- Detected declarations: `function Copyright`, `function usbip_port_show`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
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.