Re: device present in lsusb, disappears in lsusb -t

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 12, 2023 at 10:38:31AM -0400, Douglas Gilbert wrote:
> On 2023-10-12 08:50, Greg KH wrote:
> > I've pushed all of the remaining pending changes for usbutils to the
> > repo, and added a few of my own that makes the 'lsusb -t' output a bit
> > more sane (sorted order, proper digit field width, etc.)
> > 
> > Can you try the latest version in github (or on kernel.org, they are
> > mirrors) and show the output there?
> 
> Removed the Lenovo dock [40AN] to lessen the clutter.
> 
> 
>   ~/usbutils$ ./lsusb
> Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
> Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> Bus 003 Device 002: ID 06cb:00f9 Synaptics, Inc.
> Bus 003 Device 003: ID 5986:1177 Acer, Inc Integrated Camera
> Bus 003 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver
> Bus 003 Device 005: ID 8087:0033 Intel Corp.
> Bus 003 Device 012: ID 0483:572b STMicroelectronics STEVAL-USBC2DP Type-C to
> DisplayPort adapter
> Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
> 
>   ~/usbutils$ ./lsusb -tv
> /:  Bus 001.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/1p, 480M
>     ID 1d6b:0002 Linux Foundation 2.0 root hub
> /:  Bus 002.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/3p, 20000M/x2
>     ID 1d6b:0003 Linux Foundation 3.0 root hub
> /:  Bus 003.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/12p, 480M
>     ID 1d6b:0002 Linux Foundation 2.0 root hub
>     |__ Port 003: Dev 002, If 0, Class=Vendor Specific Class, Driver=, 12M
>         ID 06cb:00f9 Synaptics, Inc.
>     |__ Port 004: Dev 003, If 0, Class=Video, Driver=uvcvideo, 480M
>         ID 5986:1177 Acer, Inc
>     |__ Port 004: Dev 003, If 1, Class=Video, Driver=uvcvideo, 480M
>         ID 5986:1177 Acer, Inc
>     |__ Port 004: Dev 003, If 2, Class=Application Specific Interface,
> Driver=, 480M
>         ID 5986:1177 Acer, Inc
>     |__ Port 007: Dev 004, If 0, Class=Human Interface Device, Driver=usbhid, 12M
>         ID 046d:c52b Logitech, Inc. Unifying Receiver
>     |__ Port 007: Dev 004, If 1, Class=Human Interface Device, Driver=usbhid, 12M
>         ID 046d:c52b Logitech, Inc. Unifying Receiver
>     |__ Port 007: Dev 004, If 2, Class=Human Interface Device, Driver=usbhid, 12M
>         ID 046d:c52b Logitech, Inc. Unifying Receiver
>     |__ Port 010: Dev 005, If 0, Class=Wireless, Driver=btusb, 12M
>         ID 8087:0033 Intel Corp.
>     |__ Port 010: Dev 005, If 1, Class=Wireless, Driver=btusb, 12M
>         ID 8087:0033 Intel Corp.
> /:  Bus 004.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/4p, 10000M
>     ID 1d6b:0003 Linux Foundation 3.0 root hub
> 
> 
> So ID 0483:572b (ST Micro DP dongle) still missing in the 'lsusb -t' output.

Your dongle is an unusual USB device, in that it has no interfaces.  
That's why nothing shows up in the lsusb -t output.

Try applying the patch below.

Alan Stern



 lsusb-t.c |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

Index: usbutils-master/lsusb-t.c
===================================================================
--- usbutils-master.orig/lsusb-t.c
+++ usbutils-master/lsusb-t.c
@@ -183,9 +183,12 @@ static void print_usbdevice(struct usbde
 	char lanes[32];
 
 	lanes_to_str(lanes, d->tx_lanes, d->rx_lanes);
-	get_class_string(subcls, sizeof(subcls), i->bInterfaceClass);
+	if (i)
+		get_class_string(subcls, sizeof(subcls), i->bInterfaceClass);
 
-	if (i->bInterfaceClass == 9)
+	if (!i)
+		printf("Port %03u: Dev %03u, %sM%s\n", d->portnum, d->devnum, d->speed, lanes);
+	else if (i->bInterfaceClass == 9)
 		printf("Port %03u: Dev %03u, If %u, Class=%s, Driver=%s/%up, %sM%s\n", d->portnum, d->devnum, i->ifnum, subcls,
 		       i->driver, d->maxchild, d->speed, lanes);
 	else
@@ -690,11 +693,12 @@ static void sort_busses(void)
 static void print_tree_dev_interface(struct usbdevice *d, struct usbinterface *i)
 {
 	indent += 3;
-	while (i) {
+	do {
 		printf(" %*s", indent, "|__ ");
 		print_usbdevice(d, i);
-		i = i->next;
-	}
+		if (i)
+			i = i->next;
+	} while (i);
 	indent -= 3;
 }
 static void print_tree_dev_children(struct usbdevice *d)





[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux