• What are the sysfs structures for Linux USB(1-1.3:1.0)?


    Q: What are the sysfs structures for Linux USB?

    A: For example the directory will have something like:

     
    # ls  /sys/bus/usb/devices/
    1-0:1.0      1-1.3        1-1.3.1:1.0  1-1:1.0
    1-1          1-1.3.1      1-1.3:1.0    usb1
    

    The names that begin with "usb" refer to USB controllers. More accurately, they refer to the "root hub" associated with each controller. The number is the USB bus number. In the example there is only one controller, so its bus is number 1. Hence the name "usb1".

    "1-0:1.0" is a special case. It refers to the root hub's interface. This acts just like the interface in an actual hub an almost every respect; see below.

    All the other entries refer to genuine USB devices and their interfaces. The devices are named by a scheme like this:

    	bus-port.port.port ...
    

    In other words, the name starts with the bus number followed by a '-'. Then comes the sequence of port numbers for each of the intermediate hubs along the path to the device.

    For example, "1-1" is a device plugged into bus 1, port 1. It happens to be a hub, and "1-1.3" is the device plugged into port 3 of that hub. That device is another hub, and "1-1.3.1" is the device plugged into its port 1.

    The interfaces are indicated by suffixes having this form:

    	:config.interface
    

    That is, a ':' followed by the configuration number followed by '.' followed by the interface number. In the above example, each of the devices is using configuration 1 and this configuration has only a single interface, number 0. So the interfaces show up as;

    	1-1:1.0		1-1.3:1.0		1-1.3.1:1.0
    

    A hub will never have more than a single interface; that's part of the USB spec. But other devices can and do have multiple interfaces (and sometimes multiple configurations). Each interface gets its own entry in sysfs and can have its own driver.

    from: http://www.linux-usb.org/FAQ.html#i6

  • 相关阅读:
    C++11中静态局部变量初始化的线程安全性
    213. 打家劫舍 II
    cas解决aba相关问题
    socket[可读可写异常]3种条件的发生
    linux信号处理 (信号产生 信号阻塞 信号集)
    vim set paste解决粘贴乱序乱码问题
    174. 地下城游戏
    208. 实现 Trie (前缀树) 和 面试题 17.13. 恢复空格
    Centos安装和卸载docker
    Go语言轻量级框架-Gin与入门小案例MySQL增删查改
  • 原文地址:https://www.cnblogs.com/aspirs/p/13219215.html
Copyright © 2020-2023  润新知