| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
usbreset: Allow idProduct and idVendor to be 0
|
|/
|
|
|
|
|
| |
idProduct at least, is valid as 0, and I guess idVendor can
typically be left at 0 while developing some new usb thing.
Signed-off-by: Kristoffer Ellersgaard Koch <kristoffer.koch@gmail.com>
|
|
|
|
| |
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|\
| |
| | |
lsusb-t: Fix recursive sorting on child devices.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Before this change, child devices beyond the first level of children underneath Bus IDs are not sorted.
An example can be seen on a laptop with a USB-C dock attached to it. On current master, the output of lsusb -t looks like this:
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 10000M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 10000M
|__ Port 1: Dev 4, If 0, Class=Vendor Specific Class, Driver=r8152, 5000M
|__ Port 3: Dev 3, If 0, Class=Hub, Driver=hub/4p, 10000M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 5000M
|__ Port 3: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M
|__ Port 1: Dev 2, If 1, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 1: Dev 2, If 2, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 3: Dev 25, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 3: Dev 26, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 4: Dev 29, If 0, Class=Vendor Specific Class, Driver=pl2303, 12M
|__ Port 2: Dev 27, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 2: Dev 27, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 3: Dev 28, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 4: Dev 32, If 1, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 4: Dev 32, If 0, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 2: Dev 31, If 2, Class=Audio, Driver=snd-usb-audio, 12M
|__ Port 2: Dev 31, If 0, Class=Audio, Driver=snd-usb-audio, 12M
|__ Port 2: Dev 31, If 3, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 2: Dev 31, If 1, Class=Audio, Driver=snd-usb-audio, 12M
|__ Port 1: Dev 30, If 0, Class=Vendor Specific Class, Driver=, 12M
|__ Port 1: Dev 30, If 1, Class=Vendor Specific Class, Driver=, 12M
|__ Port 8: Dev 6, If 1, Class=Video, Driver=uvcvideo, 480M
|__ Port 8: Dev 6, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 9: Dev 8, If 0, Class=Vendor Specific Class, Driver=, 12M
The devices or ports of the children from second level onwards are unsorted on in reverse order.
After my change, the output becomes
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 10000M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 10000M
|__ Port 1: Dev 4, If 0, Class=Vendor Specific Class, Driver=r8152, 5000M
|__ Port 3: Dev 3, If 0, Class=Hub, Driver=hub/4p, 10000M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 5000M
|__ Port 3: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M
|__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 1: Dev 2, If 1, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 1: Dev 2, If 2, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 3: Dev 25, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 3: Dev 26, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 2: Dev 27, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 2: Dev 27, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 3: Dev 28, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 1: Dev 30, If 0, Class=Vendor Specific Class, Driver=, 12M
|__ Port 1: Dev 30, If 1, Class=Vendor Specific Class, Driver=, 12M
|__ Port 2: Dev 31, If 0, Class=Audio, Driver=snd-usb-audio, 12M
|__ Port 2: Dev 31, If 1, Class=Audio, Driver=snd-usb-audio, 12M
|__ Port 2: Dev 31, If 2, Class=Audio, Driver=snd-usb-audio, 12M
|__ Port 2: Dev 31, If 3, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 4: Dev 32, If 0, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 4: Dev 32, If 1, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 4: Dev 29, If 0, Class=Vendor Specific Class, Driver=pl2303, 12M
|__ Port 8: Dev 6, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 8: Dev 6, If 1, Class=Video, Driver=uvcvideo, 480M
|__ Port 9: Dev 8, If 0, Class=Vendor Specific Class, Driver=, 12M
Where all devices are now correctly sorted in ascending order.
Signed-off-by: Tan Li Boon <liboon.tan@mujin.co.jp>
|
|\ \
| | |
| | | |
lsusb: Improve status display for SuperSpeedPlus hubs
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add more status information for SuperSpeedPlus hubs by using the
EXT_PORT_STATUS request to determine the actual link speed ID and number
of lanes that the hub reports it is connected with. This is needed to be
able to figure out the actual connection speed for SuperSpeedPlus
devices.
This requires parsing the BOS prior to the hub information, since we can
only use EXT_PORT_STATUS if the device actually has a SuperSpeedPlus
device capability.
Also fix some issues with the SuperSpeedPlus device capability parsing -
the speed attribute and speed ID counts were off by one, and the minimum
functional speed information is now parsed out.
Signed-off-by: Robert Hancock <hancockrwd@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The DescriptorSubtype should be checking for 0x02, not 0x01, in order to
display (GENERAL) or (Invalid) as per the USB specification for USB MIDI
devices.
Reported-by: symdeb
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|\ \
| |/
|/| |
Fix an runtime error reported by undefind sanitizer
|
|/
|
|
|
|
|
|
|
| |
Fix the following error when compiling with undefined sanitizer:
./lsusb
names.c:36:29: runtime error: left shift of 16 by 27 places cannot be represented in type 'int'
Signed-off-by: Han Han <hhan@redhat.com>
|
|
|
|
| |
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
|
|
|
|
|
| |
Again, wireless USB is long dead, this code would never get triggered at
all, so just remove it as it is not being used.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
|
|
|
|
|
| |
Wireless USB is long dead, and this check never actually worked, so
remove it.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
| |
When recursing into a long USB tree, the local variables in the
print_device() function would get confused and take on the value of the
previous device it printed. This caused devices to not get printed out
at all, the exact opposite of what we wanted.
Resolve this by using the non-POSIX 'local' variable declaration.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
|
|
|
|
| |
Previously "usb10" would come before "usb2"
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
|
|
| |
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|\
| |
| | |
lsusb: don't complain on EAGAIN
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Given the requested decriptors are optional, seems like lsusb
should NOT use perror() to communicate why it can't get
the descriptors in question (output is directed to stderr, not stdout).
Further, if we were told to "come back later" (EGAIN),
then it's really not an error.
Only emit this output when user adds "-vv" to the command line.
Signed-off-by: Grant Grundler <grundler@chromium.org>
|
|/
|
|
|
|
| |
CTRL_RETRIES was never used. Remove it.
Signed-off-by: Grant Grundler <grundler@chromium.org>
|
|\
| |
| | |
Fix typos in lsusb.8.in
|
| |
| |
| |
| | |
Signed-off-by: Matthias Braun <m.braun@htl-leonding.ac.at>
|
|\ \
| | |
| | | |
desc-defs.c: fix possible out-of-bound read
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Found by static analysis:
Expression (UAC_FORMAT_TYPE_I << 12) + ARRAY_LEN(audio_data_format_type_i)
evaluates to 6 which is the length of the audio_data_format_type_i array.
Therefore, if value is set to 6, the condition evaluates to true and
ouf-of-bound read could occur.
Signed-off-by: Lukas Zaoral <lzaoral@redhat.com>
|
|\ \
| | |
| | | |
lsusb.c: fix leak in dump_printer_device
|
| |/
| |
| |
| |
| |
| | |
Allocation made by get_dev_string was not freed.
Signed-off-by: Lukas Zaoral <lzaoral@redhat.com>
|
|\ \
| | |
| | | |
lsusb: Fix typo in string output for iAdditionalInfoURL
|
| |/
| |
| |
| |
| |
| | |
Fixes #126
Signed-off-by: Benson Leung <bleung@chromium.org>
|
|\ \
| |/
|/| |
usb-devices: do not use `local` in a POSIX shell script
|
|/
|
|
|
|
|
|
| |
Fixes:
$ ksh /bin/usb-devices
/bin/usb-devices[92]: local: not found [No such file or directory]
Signed-off-by: Lukas Zaoral <lzaoral@redhat.com>
|
|\
| |
| | |
lsusb-t: Add lower bound checks in read_sysfs_file_string
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
I have a USB device that returns "\n\n" in manufacturer field which
makes newline cleanup in read_sysfs_file_string result in out-of-bound
access.
Fix this by adding lower bound checks in the loops.
Signed-off-by: Bui Quang Minh <minhquangbui99@gmail.com>
|
|\ \
| |/
|/| |
lsusb: Fix buffer size copy/paste error
|
|/
|
|
|
|
|
|
|
| |
When I added these calls, I mistakenly passed them all the size of the
vendor buffer instead of the buffers they actually fill. As it happens,
all the sizes are the same, so there's no correctness issue, but we
should still fix the issue for code clarity and ease of modification.
Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
|
|\
| |
| | |
Some fixes for printing endpoints and interfaces by usb-devices
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
/sys/kernel/debug/usb/devices
Max packet size is printed as a single number in
/sys/kernel/debug/usb/devices, rather than a product of the form X*Y.
This patch makes the output of usb-devices match
/sys/kernel/debug/usb/devices.
Signed-off-by: Ruslan Kabatsayev <b7.10110111@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Endpoint type is given as "Control" or "Interrupt" in
/sys/bus/usb/devices/..../type, while in /sys/kernel/debug/usb/devices
it's instead "Ctrl" or "Int.", respectively. This patch adds conversion
so that the relevant output of usb-devices matches
/sys/kernel/debug/usb/devices.
Signed-off-by: Ruslan Kabatsayev <b7.10110111@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Direction of an endpoint is formatted as "I", "O" or "B" in
/sys/kernel/debug/usb/devices, while in
/sys/bus/usb/devices/..../direction it's instead "in", "out" or "both". This
patch adds the conversion to make the relevant output of usb-devices
look like /sys/kernel/debug/usb/devices.
Signed-off-by: Ruslan Kabatsayev <b7.10110111@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Interface and number of endpoints are formatted as decimals in
/sys/kernel/debug/usb/devices, while their formatting in dedicated files
under /sys/bus/usb/devices/ is in hexadecimal without 0x prefix. This
patch ensures the correct conversion for both.
Signed-off-by: Ruslan Kabatsayev <b7.10110111@gmail.com>
|
| |
| |
| |
| |
| |
| |
| | |
This is required at least on my Linux 4.14.157 system, as well as Ubuntu
20.04 with Linux 5.4.0-42-generic.
Signed-off-by: Ruslan Kabatsayev <b7.10110111@gmail.com>
|
|\ \
| |/
|/| |
lsusb-t.c: fix tree mode for dual-lane modes of USB 3.2
|
| |
| |
| |
| | |
Signed-off-by: Adrian Kalazi <adrian@kalazi.com>
|
|\ \
| | |
| | | |
lsusb: Improvements to UVC Interface Descriptor decoding
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The bEndpointAddress field in UVC VideoStreaming Interface Descriptors
follows the same format as in Endpoint Descriptors. This patch changes
dump_videostreaming_interface to display the endpoint addresses in the
same way.
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
|
| |/
| |
| |
| |
| |
| |
| | |
According to the USB Device Class Definition, Revision 1.5, it is
spelled bEndpointAddress.
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
|
|\ \
| | |
| | | |
lsusb(8): mention the udev's hardware database
|
| |/
| |
| |
| |
| |
| |
| |
| |
| | |
Despite the switch to the udev's hardware database being a few years
old, users are still confused when they update usb.ids on their system
and see no effects. This patch therefore updates the lsusb(8) manpage to
mention it.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
|
| |
| |
| |
| |
| |
| | |
usbutils is now REUSE 3.0 spec compliant!
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
| |
| |
| |
| |
| |
| |
| | |
Ugh, the fact that this license is treated "unique" like this by SPDX is
crazy...
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
| |
| |
| |
| |
| |
| | |
There were a few files in usbhid-dump that were missing this.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
| |
| |
| |
| | |
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|