The busybox find command is missing the -printf parameter leading to
the error:
find: unrecognized: -printf
Replace the parameter with sed.
This patch was originally created by Daniel Fancsali.
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
This change should not make any difference in behavior,
but fixes all shellcheck warnings besides https://www.shellcheck.net/wiki/SC3043
Also replacing 'var=`cat file`' with 'read' makes usb-devices much faster.
Old:
real 0m0,849s
user 0m0,388s
sys 0m0,531s
New:
real 0m0,245s
user 0m0,109s
sys 0m0,155s
Signed-off-by: Lukas Nykryn <lnykryn@redhat.com>
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>
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>
Several newer USB Device classes are not presently reported individually by
usb-devices, (They are reported as "unk. ").
This patch adds the following classes: 10h (USB Type-C combined Audio/Video
devices) 11h (USB billboard), 12h (USB Type-C Bridge).
As defined at [https://www.usb.org/defined-class-codes]
Signed-off-by: Rob Gill <rrobgill@protonmail.com>
This removes the "boiler-plate" license texts in the individual files to
use SPDX identifiers instead. Cleans up the text a lot.
All copyright notices were left intact, as this does not change
anything.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
At least with one new LTE Modem (Gemalto PLS8-E) I found
that the Interface Number can also be a character (a, b, c and d). This leads
to that the printf gives an error and the line is not displayed correctly
Changing the configuration to string fixes this for both int and string
Interface Enumerators
Signed-off-by: Tobias Grueninger <tobias.grueninger@infoteam.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The kernel already provide bcdDevice in the right format, there is no
need to reinterpret the value. Doing it leads to the following error
with some devices:
| ...
| T: Bus=06 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#= 2 Spd=12 MxCh= 0
| D: Ver= 1.10 Cls=ff(vend.) Sub=ff Prot=ff MxPS= 8 #Cfgs= 1
| /usr/sbin/usb-devices: line 128: printf: 0c: invalid number
| P: Vendor=08ff ProdID=1600 Rev= 0.10
| ...
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Some class descriptions are different from the ones defined in the
kernel and used in the usb/devices file. This harmonizes them.
Signed-off-by: Frans Pop <elendil@planet.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>