`
wx1569578408
  • 浏览: 71541 次
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论

Linux 查看usb设备信息

 
阅读更多

下面的信息都是在VMware中运行Ubuntu12-04系统上执行的。同样该命令也支持在嵌入式系统中进行USB调试。

一、cat设备节点获取信息

在一些嵌入式开发中需要调试USB功能,经常会cat /sys 下的相关设备节点来查看某些信息,比如说我们可以看到 /sys/bus/usb/devices 目录有多个子目录。进入到某个子目录可以看到usb设备更加详细的信息(可以理解为设备描述符)。

1、usb设备在总线上的信息

// usb设备在总线上的信息
root@ubuntu:/sys/kernel/debug# cd /sys/bus/usb/devices
root@ubuntu:/sys/bus/usb/devices# ll
total 0
drwxr-xr-x 2 root root 0 Nov 26 21:21 ./
drwxr-xr-x 4 root root 0 Nov 26 21:21 ../
lrwxrwxrwx 1 root root 0 Nov 26 21:21 1-0:1.0 -> ../../../devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb1/1-0:1.0/
lrwxrwxrwx 1 root root 0 Dec 15 23:10 1-1 -> ../../../devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb1/1-1/
lrwxrwxrwx 1 root root 0 Dec 15 23:18 1-1:1.0 -> ../../../devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb1/1-1/1-1:1.0/
lrwxrwxrwx 1 root root 0 Nov 26 21:21 2-0:1.0 -> ../../../devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-0:1.0/
lrwxrwxrwx 1 root root 0 Nov 26 21:21 2-1 -> ../../../devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-1/
lrwxrwxrwx 1 root root 0 Nov 26 21:21 2-1:1.0 -> ../../../devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-1/2-1:1.0/
lrwxrwxrwx 1 root root 0 Nov 26 21:21 2-2 -> ../../../devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-2/
lrwxrwxrwx 1 root root 0 Nov 26 21:21 2-2:1.0 -> ../../../devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-2/2-2:1.0/
lrwxrwxrwx 1 root root 0 Nov 26 21:21 usb1 -> ../../../devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb1/
lrwxrwxrwx 1 root root 0 Nov 26 21:21 usb2 -> ../../../devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/

其中 usbx/第x个总线,x-y:a.b/的目录格式,x表示总线号,y表示端口,a表示配置,b表示接口。

具体解释可以参照如下:

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.

 

2、特定设备的详细信息

进入到某个目录中去,可以看到该设备的详细信息,可用cat命令获取信息。

// usb设备的详细信息
root@ubuntu:/sys/bus/usb/devices/usb1# ll
total 0
drwxr-xr-x  6 root root     0 Nov 26 21:21 ./
drwxr-xr-x  4 root root     0 Nov 26 21:21 ../
drwxr-xr-x 10 root root     0 Nov 26 21:21 1-0:1.0/
drwxr-xr-x  5 root root     0 Dec 15 23:10 1-1/
-rw-r--r--  1 root root  4096 Dec 15 23:40 authorized
-rw-r--r--  1 root root  4096 Dec 15 23:40 authorized_default
-rw-r--r--  1 root root  4096 Dec 15 23:40 avoid_reset_quirk
-r--r--r--  1 root root  4096 Nov 26 21:21 bcdDevice
-rw-r--r--  1 root root  4096 Nov 26 21:21 bConfigurationValue
-r--r--r--  1 root root  4096 Nov 26 21:21 bDeviceClass
-r--r--r--  1 root root  4096 Nov 26 21:21 bDeviceProtocol
-r--r--r--  1 root root  4096 Nov 26 21:21 bDeviceSubClass
-r--r--r--  1 root root  4096 Dec 15 23:40 bmAttributes
-r--r--r--  1 root root  4096 Dec 15 23:40 bMaxPacketSize0
-r--r--r--  1 root root  4096 Dec 15 23:40 bMaxPower
-r--r--r--  1 root root  4096 Dec 15 23:40 bNumConfigurations
-r--r--r--  1 root root  4096 Dec 15 23:40 bNumInterfaces
-r--r--r--  1 root root  4096 Nov 26 21:21 busnum
-r--r--r--  1 root root  4096 Dec 15 23:40 configuration
-r--r--r--  1 root root 65553 Nov 26 21:21 descriptors
-r--r--r--  1 root root  4096 Dec 15 23:40 dev
-r--r--r--  1 root root  4096 Nov 26 21:21 devnum
-r--r--r--  1 root root  4096 Dec 15 23:40 devpath
lrwxrwxrwx  1 root root     0 Nov 27 20:06 driver -> ../../../../../bus/usb/drivers/usb/
drwxr-xr-x  3 root root     0 Dec 15 23:40 ep_00/
-r--r--r--  1 root root  4096 Nov 26 21:21 idProduct
-r--r--r--  1 root root  4096 Nov 26 21:21 idVendor
-r--r--r--  1 root root  4096 Dec 15 23:40 ltm_capable
-r--r--r--  1 root root  4096 Nov 26 21:21 manufacturer
-r--r--r--  1 root root  4096 Dec 15 23:40 maxchild
drwxr-xr-x  2 root root     0 Nov 26 21:21 power/
-r--r--r--  1 root root  4096 Nov 26 21:21 product
-r--r--r--  1 root root  4096 Dec 15 23:40 quirks
-r--r--r--  1 root root  4096 Nov 26 21:21 removable
--w-------  1 root root  4096 Dec 15 23:40 remove
-r--r--r--  1 root root  4096 Nov 26 21:21 serial
-r--r--r--  1 root root  4096 Nov 26 21:21 speed
lrwxrwxrwx  1 root root     0 Nov 26 21:21 subsystem -> ../../../../../bus/usb/
-rw-r--r--  1 root root  4096 Nov 26 21:21 uevent
-r--r--r--  1 root root  4096 Dec 15 23:40 urbnum
-r--r--r--  1 root root  4096 Dec 15 23:40 version

 

二、使用debugfs

1、挂载 debugfs 到 /sys/kernel/debug 路径下

root@ubuntu:mount -t debugfs none /sys/kernel/debug

 

2、执行上述步骤之后,在 /sys/kernel/debug 就会生成如下的文件

root@ubuntu:/sys/bus/usb/devices# cd /sys/kernel/debug/
root@ubuntu:/sys/kernel/debug# ll
total 0
drwx------ 22 root root 0 Nov 26 21:21 ./
drwxr-xr-x  7 root root 0 Nov 26 21:21 ../
drwxr-xr-x  2 root root 0 Nov 26 21:21 acpi/
drwxr-xr-x 32 root root 0 Dec  4 16:30 bdi/
drwxr-xr-x  2 root root 0 Nov 26 21:21 bluetooth/
drwxr-xr-x  2 root root 0 Nov 26 21:21 cleancache/
drwxr-xr-x  2 root root 0 Nov 26 21:21 dma_buf/
drwxr-xr-x  4 root root 0 Nov 26 21:21 dri/
drwxr-xr-x  2 root root 0 Nov 26 21:21 dynamic_debug/
drwxr-xr-x  2 root root 0 Nov 26 21:21 extfrag/
drwxr-xr-x  2 root root 0 Nov 26 21:21 frontswap/
-r--r--r--  1 root root 0 Nov 26 21:21 gpio
drwxr-xr-x  3 root root 0 Nov 26 21:21 hid/
drwxr-xr-x  2 root root 0 Nov 26 21:21 kprobes/
drwxr-xr-x  3 root root 0 Nov 26 21:21 kvm-guest/
drwxr-xr-x  2 root root 0 Nov 26 21:21 mce/
drwxr-xr-x  2 root root 0 Nov 26 21:21 pinctrl/
-r--r--r--  1 root root 0 Nov 26 21:21 pwm
drwxr-xr-x  2 root root 0 Nov 26 21:21 regmap/
drwxr-xr-x  3 root root 0 Nov 26 21:21 regulator/
-rw-r--r--  1 root root 0 Nov 26 21:21 sched_features
-r--r--r--  1 root root 0 Nov 26 21:21 sleep_time
-r--r--r--  1 root root 0 Nov 26 21:21 suspend_stats
drwxr-xr-x  7 root root 0 Nov 26 21:21 tracing/
drwxr-xr-x  3 root root 0 Nov 26 21:21 usb/
drwxr-xr-x  2 root root 0 Nov 26 21:21 virtio-ports/
-r--r--r--  1 root root 0 Nov 26 21:21 vmmemctl
-r--r--r--  1 root root 0 Nov 26 21:21 wakeup_sources
drwxr-xr-x  2 root root 0 Nov 26 21:21 x86/

 

3、cat 设备节点

执行下述命令之后会以特定格式打印目前USB总线上所有USB设备的信息如下:

root@ubuntu:/sys/kernel/debug# cat usb/devices 

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12   MxCh= 2
B:  Alloc= 17/900 us ( 2%), #Int=  1, #Iso=  0
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0001 Rev= 3.13
S:  Manufacturer=Linux 3.13.0-32-generic uhci_hcd
S:  Product=UHCI Host Controller
S:  SerialNumber=0000:02:00.0
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms

T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12   MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0e0f ProdID=0003 Rev= 1.03
S:  Manufacturer=VMware
S:  Product=VMware Virtual USB Mouse
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbhid
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=1ms

T:  Bus=02 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#=  3 Spd=12   MxCh= 7
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0e0f ProdID=0002 Rev= 1.00
S:  Product=VMware Virtual USB Hub
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=255ms

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 6
B:  Alloc=  0/800 us ( 0%), #Int=  1, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 3.13
S:  Manufacturer=Linux 3.13.0-32-generic ehci_hcd
S:  Product=EHCI Host Controller
S:  SerialNumber=0000:02:03.0
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  7 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=ff(vend.) Sub=ff Prot=ff MxPS=64 #Cfgs=  1
P:  Vendor=0bda ProdID=0129 Rev=39.60
S:  Manufacturer=Generic
S:  Product=USB2.0-CRW
S:  SerialNumber=20100201396000000
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=06 Prot=50 Driver=rts5139
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=83(I) Atr=03(Int.) MxPS=   3 Ivl=64ms

 

至于信息的详细解析可以参照 Linux源代码中 Documentation/usb/proc_usb_info.txt 文件。现摘录其中对该格式的详细解释:

Each line is tagged with a one-character ID for that line:

T = Topology (etc.)
B = Bandwidth (applies only to USB host controllers, which are
    virtualized as root hubs)
D = Device descriptor info.
P = Product ID info. (from Device descriptor, but they won't fit
    together on one line)
S = String descriptors.
C = Configuration descriptor info. (* = active configuration)
I = Interface descriptor info.
E = Endpoint descriptor info.

Legend:
  d = decimal number (may have leading spaces or 0's)
  x = hexadecimal number (may have leading spaces or 0's)
  s = string


Topology info:

T:  Bus=dd Lev=dd Prnt=dd Port=dd Cnt=dd Dev#=ddd Spd=dddd MxCh=dd
|   |      |      |       |       |      |        |        |__MaxChildren
|   |      |      |       |       |      |        |__Device Speed in Mbps
|   |      |      |       |       |      |__DeviceNumber
|   |      |      |       |       |__Count of devices at this level
|   |      |      |       |__Connector/Port on Parent for this device
|   |      |      |__Parent DeviceNumber
|   |      |__Level in topology for this bus
|   |__Bus number
|__Topology info tag

    Speed may be:
        1.5 Mbit/s for low speed USB
    12  Mbit/s for full speed USB
    480 Mbit/s for high speed USB (added for USB 2.0);
          also used for Wireless USB, which has no fixed speed
    5000    Mbit/s for SuperSpeed USB (added for USB 3.0)

    For reasons lost in the mists of time, the Port number is always
    too low by 1.  For example, a device plugged into port 4 will
    show up with "Port=03".

Bandwidth info:
B:  Alloc=ddd/ddd us (xx%), #Int=ddd, #Iso=ddd
|   |                       |         |__Number of isochronous requests
|   |                       |__Number of interrupt requests
|   |__Total Bandwidth allocated to this bus
|__Bandwidth info tag

    Bandwidth allocation is an approximation of how much of one frame
    (millisecond) is in use.  It reflects only periodic transfers, which
    are the only transfers that reserve bandwidth.  Control and bulk
    transfers use all other bandwidth, including reserved bandwidth that
    is not used for transfers (such as for short packets).

    The percentage is how much of the "reserved" bandwidth is scheduled by
    those transfers.  For a low or full speed bus (loosely, "USB 1.1"),
    90% of the bus bandwidth is reserved.  For a high speed bus (loosely,
    "USB 2.0") 80% is reserved.


Device descriptor info & Product ID info:

D:  Ver=x.xx Cls=xx(s) Sub=xx Prot=xx MxPS=dd #Cfgs=dd
P:  Vendor=xxxx ProdID=xxxx Rev=xx.xx

where
D:  Ver=x.xx Cls=xx(sssss) Sub=xx Prot=xx MxPS=dd #Cfgs=dd
|   |        |             |      |       |       |__NumberConfigurations
|   |        |             |      |       |__MaxPacketSize of Default Endpoint
|   |        |             |      |__DeviceProtocol
|   |        |             |__DeviceSubClass
|   |        |__DeviceClass
|   |__Device USB version
|__Device info tag #1

where
P:  Vendor=xxxx ProdID=xxxx Rev=xx.xx
|   |           |           |__Product revision number
|   |           |__Product ID code
|   |__Vendor ID code
|__Device info tag #2


String descriptor info:

S:  Manufacturer=ssss
|   |__Manufacturer of this device as read from the device.
|      For USB host controller drivers (virtual root hubs) this may
|      be omitted, or (for newer drivers) will identify the kernel
|      version and the driver which provides this hub emulation.
|__String info tag

S:  Product=ssss
|   |__Product description of this device as read from the device.
|      For older USB host controller drivers (virtual root hubs) this
|      indicates the driver; for newer ones, it's a product (and vendor)
|      description that often comes from the kernel's PCI ID database.
|__String info tag

S:  SerialNumber=ssss
|   |__Serial Number of this device as read from the device.
|      For USB host controller drivers (virtual root hubs) this is
|      some unique ID, normally a bus ID (address or slot name) that
|      can't be shared with any other device.
|__String info tag



Configuration descriptor info:

C:* #Ifs=dd Cfg#=dd Atr=xx MPwr=dddmA
| | |       |       |      |__MaxPower in mA
| | |       |       |__Attributes
| | |       |__ConfiguratioNumber
| | |__NumberOfInterfaces
| |__ "*" indicates the active configuration (others are " ")
|__Config info tag

    USB devices may have multiple configurations, each of which act
    rather differently.  For example, a bus-powered configuration
    might be much less capable than one that is self-powered.  Only
    one device configuration can be active at a time; most devices
    have only one configuration.

    Each configuration consists of one or more interfaces.  Each
    interface serves a distinct "function", which is typically bound
    to a different USB device driver.  One common example is a USB
    speaker with an audio interface for playback, and a HID interface
    for use with software volume control.


Interface descriptor info (can be multiple per Config):

I:* If#=dd Alt=dd #EPs=dd Cls=xx(sssss) Sub=xx Prot=xx Driver=ssss
| | |      |      |       |             |      |       |__Driver name
| | |      |      |       |             |      |          or "(none)"
| | |      |      |       |             |      |__InterfaceProtocol
| | |      |      |       |             |__InterfaceSubClass
| | |      |      |       |__InterfaceClass
| | |      |      |__NumberOfEndpoints
| | |      |__AlternateSettingNumber
| | |__InterfaceNumber
| |__ "*" indicates the active altsetting (others are " ")
|__Interface info tag

    A given interface may have one or more "alternate" settings.
    For example, default settings may not use more than a small
    amount of periodic bandwidth.  To use significant fractions
    of bus bandwidth, drivers must select a non-default altsetting.

    Only one setting for an interface may be active at a time, and
    only one driver may bind to an interface at a time.  Most devices
    have only one alternate setting per interface.


Endpoint descriptor info (can be multiple per Interface):

E:  Ad=xx(s) Atr=xx(ssss) MxPS=dddd Ivl=dddss
|   |        |            |         |__Interval (max) between transfers
|   |        |            |__EndpointMaxPacketSize
|   |        |__Attributes(EndpointType)
|   |__EndpointAddress(I=In,O=Out)
|__Endpoint info tag

    The interval is nonzero for all periodic (interrupt or isochronous)
    endpoints.  For high speed endpoints the transfer interval may be
    measured in microseconds rather than milliseconds.

    For high speed periodic endpoints, the "MaxPacketSize" reflects
    the per-microframe data transfer size.  For "high bandwidth"
    endpoints, that can reflect two or three packets (for up to
    3KBytes every 125 usec) per endpoint.

    With the Linux-USB stack, periodic bandwidth reservations use the
    transfer intervals and sizes provided by URBs, which can be less
    than those found in endpoint descriptor.

转载于:https://my.oschina.net/u/3415127/blog/1505458

分享到:
评论

相关推荐

    Linux下USB设备驱动程序的编写.pdf

    Linux 下 USB 设备驱动程序的编写 本文主要介绍了 Linux 下 USB 设备驱动程序的编写,包括驱动程序的结构、编写方法和实现细节。同时,还介绍了 Linux 操作系统的发展历程、USB 设备的特点和驱动程序的重要性。 ...

    基于Linux的USB设备.pdf

    本文主要介绍了基于Linux的USB设备的相关知识点。下面是对标题、描述、标签和部分内容的详细解释: 一、USB设备概述 USB(Universal Serial Bus)是一种快速、灵活的连接配件与计算机工作站的接口,其应用非常广泛...

    基于Linux的USB设备重定向研究.pdf

    用户要和USB设备通信,必须按照URB请求包的格式提交给Linux内核,内核根据这个URB请求包的pipe信息,把URB请求包添加到不同时链表中,并通过总线发送出去。USB设备收到与自身地址相匹配的URB请求包后,对发送方作出...

    基于Linux的USB主/从设备之间的三种通信方式

    在嵌入式系统中,Linux还提供了对USB设备控制器的驱动支持,使得基于Linux的设备能够作为USB设备与主机进行通信。USB设备端的驱动程序可以是简单的,也可以是复杂的,具体取决于设备的特性和通信需求。 总的来说,...

    linux usb gadget mini2440虚拟为usb从设备(虚拟串口)

    Linux USB Gadget mini2440 虚拟为 USB 从设备(虚拟串口) Linux USB Gadget 是一个实现 USB 协议定义的设备端软件功能的驱动框架。它可以模拟多种 USB 设备,如 U 盘、USB 网卡等。mini2440 是一个 ARM 结构的...

    Linux设备驱动编程_Linux下USB设备驱动编写

    对于USB设备来说,Linux下的USB驱动编程是一项复杂而关键的任务,它涉及到内核模块开发、USB协议理解以及设备通信等多个方面。 USB(Universal Serial Bus)是一种通用串行总线,它支持多种设备类型,如键盘、鼠标...

    Linux让USB设备网络共享.pdf

    Linux 让 USB 设备网络共享 本文介绍了如何使用 Linux 操作系统来实现 USB 设备的网络共享,以提高小型办公网和家庭式办公网的工作效率。在小型办公网和家庭式办公网中,使用免费的 Linux 操作系统构建一个完整的...

    usbkey.rar_USBKEY linux_usbkey _设备

    4. **设备信息查看**:要查看USBKEY的详细信息,可以使用`lsusb`命令,这会列出所有连接的USB设备及其制造商和产品信息。另外,`dmesg`命令可以查看内核日志,看到设备插入时的相关消息。 5. **手动挂载与卸载**:...

    一种Linux下USB设备主从切换的实现.pdf

    "一种Linux下USB设备主从切换的实现.pdf" 本文档讨论了Linux下USB设备主从切换的实现方法。USB协议是一种严格的主从协议,在通信过程中规定通信双方必须有一个做Host(例如PC),一个做Device(例如U盘)。但是,...

    Linux内核USB驱动架构:USB设备驱动架构.pdf

    在USB设备驱动架构中,每一个端点都与urb_list(USB请求块列表)相关联,urb是Linux内核中用于USB传输的软件结构,它包含了一个端点的信息和传输数据的缓冲区。urb的传输方向由端点地址的第七位决定,0表示输出,1表示...

    usb.rar_Linux USB转can号_USBCAN linux驱动_USB设备驱动_linux_linux usb转ca

    LInux 下 USB 转CAN设备驱动

    怎样写linux下的USB设备驱动程序

    在Linux系统中编写USB设备驱动程序是一项复杂但重要的任务,因为Linux内核并不总是能自动识别和配置所有类型的USB设备。本文将引导你了解USB的基础知识,以及如何着手编写Linux下的USB驱动程序。 USB(Universal ...

    Linux下usb设备驱动开发5部曲

    一个别人的资源,是个linux环境下usb设备驱动开发的“入门到精通”,里面有5个逐步深入的例子。 其中最后一个例子step 5 是个通用驱动,应用层打开驱动设备文件,如同用串口设备一样简单就能读取到usb数据,usb应用...

    嵌入式Linux下USB主设备驱动程序的实现.pdf

    然而,为了使USB设备在嵌入式系统中正常工作,需要编写对应的驱动程序,这通常涉及到对Linux内核的理解以及设备驱动编程的知识。 驱动程序在操作系统和硬件之间起到桥梁作用,隐藏了硬件的具体实现细节,使得应用...

    Qt Linux版USB-HID通讯范例

    而USB-HID是USB设备类规范的一部分,用于设计人机交互设备,如键盘、鼠标、游戏控制器等。 标题“Qt Linux版USB-HID通讯范例”表明我们将专注于使用Qt库与Linux系统上的USB-HID设备进行通信的方法。这通常涉及读取...

    Linux系统下USB设备驱动程序的开发

    6. **调试技巧**:利用`dmesg`命令查看内核日志,`lsusb`列出已连接的USB设备,`usbmon`工具进行更详细的监控,以及`strace`跟踪系统调用。 7. **文档参考**:提供的文档如“基于嵌入式Linux的MPC850 USB驱动程序的...

    linux usb驱动

    Linux提供`dmesg`命令来查看内核消息,`lsusb`查看连接的USB设备,`usbmon`工具可以监控USB总线的通信。 总的来说,学习Linux USB驱动涉及到对USB规范的理解、Linux内核驱动模型的熟悉、设备描述符解析、数据传输...

    基于嵌入式Linux下USB设备安装与管理的实现.pdf

    基于嵌入式Linux下USB设备安装与管理的实现 基于嵌入式Linux系统下USB设备的安装和管理是当前嵌入式系统开发中的一个重要问题。目前,嵌入式Linux系统缺乏对USB设备的管理,导致了许多问题,如设备无法自动安装、...

    面向Linux的USB设备监控技术研究与实现.pdf

    这样,系统能够在保证用户正常使用的前提下,有效地加强了对USB设备的管理和安全控制,降低了内部网络的信息泄露风险。 **总结** 面向Linux的USB设备监控技术是一项重要的安全措施,它提供了对USB设备的细粒度管理...

Global site tag (gtag.js) - Google Analytics