diff options
author | Ruslan Kabatsayev <b7.10110111@gmail.com> | 2020-11-10 10:51:42 +0300 |
---|---|---|
committer | Ruslan Kabatsayev <b7.10110111@gmail.com> | 2021-02-23 14:45:32 +0300 |
commit | 9a8fef9f31d723be3bd96f30a0388948dcc51003 (patch) | |
tree | 5f0721814710a199db196bb59d8ccc3ae02a99a3 | |
parent | fa02764527f3f8275ac89a6a38922b653d4c5097 (diff) | |
download | usbutils-9a8fef9f31d723be3bd96f30a0388948dcc51003.tar.gz |
Fix formatting of endpoint type to match /sys/kernel/debug/usb/devices
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>
-rwxr-xr-x | usb-devices | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/usb-devices b/usb-devices index 296d432..740bfe0 100755 --- a/usb-devices +++ b/usb-devices @@ -57,6 +57,11 @@ print_endpoint() { dir=B fi eptype=`cat $eppath/type` + if [ "$eptype" = Control ]; then + eptype="Ctrl" + elif [ "$eptype" = Interrupt ]; then + eptype="Int." + fi maxps_hex="0x`cat $eppath/wMaxPacketSize`" # Extract MaxPS size (bits 0-10) and multiplicity values (bits 11-12) maxps=`printf "%4i*%s\n" $(($maxps_hex & 0x7ff)) \ |