roothub号-设备(或者hub)插入的端口号
roothub号-设备(或者hub)插入的端口号:USB设备配置号.接口号
roothub号-设备(或者hub)插入的端口号.设备(或者hub)插入的端口号:USB设备配置号.接口号
roothub号-设备(或者hub)插入的端口号[.设备(或者hub)插入的端口号]:USB设备配置号.接口号
例如:
1)usb1
代表bus1
1) 1-1 设备的上级是roothub
bus1-port1设备
2)1-0:1.0
bus1-port0设备:配置1.port0设备
代码:
usb_alloc_dev @drivers/usb/core/usb.c
usb_alloc_dev
{
if (unlikely(!parent)) { /*没有父节点则为root hub*/
dev->devpath[0] = '0';
dev->route = 0;
dev->dev.parent = bus->controller;
dev_set_name(&dev->dev, "usb%d", bus->busnum); root hub: /sys/bus/usb/devices/usb%d
root_hub = 1;
} else {
/* match any labeling on the hubs;

这篇博客探讨了sysfs中USB设备的命名规则,包括roothub号、设备端口号、配置号和接口号的表示方式。通过示例如'usb1'和'1-0:1.0',解释了如何解读这些命名。内容还涉及到在驱动程序中如何分配和设置USB设备路径,如在`usb_alloc_dev`和`usb_set_configuration`函数中的实现细节。
最低0.47元/天 解锁文章
5499

被折叠的 条评论
为什么被折叠?



