Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Any help? Still can't comprehend bus, device, physical ports

Need help with peripherals or devices?
Post Reply
Message
Author
bkpsusmitaa
Posts: 485
Joined: 2009-07-04 06:32
Location: Home: Barrackpore and Mysore
Has thanked: 5 times

Any help? Still can't comprehend bus, device, physical ports

#1 Post by bkpsusmitaa »

12 years have passed by.

Please check my earlier discussions in the post, HOW to suspend USB Device
I have posted a solution to the above question.

I have two physical USB ports in my Lenovo lapttop.

I get the following outputs with the following codes:

Code: Select all

ls -l /sys/bus/usb/devices/
Output:
total 0
lrwxrwxrwx 1 root root 0 Jun 1 11:37 1-0:1.0 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-0:1.0
lrwxrwxrwx 1 root root 0 Jun 1 11:37 1-1 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-1
lrwxrwxrwx 1 root root 0 Jun 1 11:37 1-1:1.0 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0
lrwxrwxrwx 1 root root 0 Jun 1 11:37 1-3 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-3
lrwxrwxrwx 1 root root 0 Jun 1 11:37 1-3:1.0 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0
lrwxrwxrwx 1 root root 0 Jun 1 11:37 1-7 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-7
lrwxrwxrwx 1 root root 0 Jun 1 11:37 1-7:1.0 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7:1.0
lrwxrwxrwx 1 root root 0 Jun 1 11:37 1-7:1.1 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7:1.1
lrwxrwxrwx 1 root root 0 Jun 1 11:37 1-8 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-8
lrwxrwxrwx 1 root root 0 Jun 1 11:37 1-8:1.0 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0
lrwxrwxrwx 1 root root 0 Jun 1 11:37 1-8:1.1 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.1
lrwxrwxrwx 1 root root 0 Jun 1 11:37 2-0:1.0 -> ../../../devices/pci0000:00/0000:00:14.0/usb2/2-0:1.0
lrwxrwxrwx 1 root root 0 Jun 1 11:37 usb1 -> ../../../devices/pci0000:00/0000:00:14.0/usb1
lrwxrwxrwx 1 root root 0 Jun 1 11:37 usb2 -> ../../../devices/pci0000:00/0000:00:14.0/usb2

Code: Select all

lsusb -v | grep -i -e "flash"
Output:
can't get debug descriptor: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
can't get device qualifier: Resource temporarily unavailable
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Bus 001 Device 064: ID 058f:6387 Alcor Micro Corp. Flash Drive
idProduct 0x6387 Flash Drive
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable

Code: Select all

dmesg | grep -i -e "flash"
Output:
[345790.379145] scsi 2:0:0:0: Direct-Access JetFlash TS1GJF150 8.07 PQ: 0 ANSI: 2

Code: Select all

lsblk
Output:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 1.8T 0 disk
├─sda1 8:1 0 499M 0 part
├─sda2 8:2 0 100M 0 part
├─sda3 8:3 0 16M 0 part
├─sda4 8:4 0 200.6G 0 part
├─sda5 8:5 0 500G 0 part
├─sda6 8:6 0 46.6G 0 part
├─sda7 8:7 0 18.6G 0 part [SWAP]
├─sda8 8:8 0 40G 0 part /mnt-system
└─sda9 8:9 0 1T 0 part /KNOPPIX-DATA
sdb 8:16 1 980M 0 disk
├─sdb1 8:17 1 128M 0 part
├─sdb2 8:18 1 1K 0 part
└─sdb5 8:21 1 850M 0 part
sr0 11:0 1 1024M 0 rom
cloop0 240:0 0 9G 1 disk /KNOPPIX
cloop1 240:1 0 2.2G 1 disk /KNOPPIX1
cloop2 240:2 0 144.8M 1 disk /KNOPPIX2
zram0 253:0 0 2.7G 0 disk [SWAP]


[Question]:
Could an advanced user kindly explain how to correlate among the outputs of dmesg, lsusb, lsblk and ls -l /sys/bus/usb/devices/ please? One on One Basis?
That is, correlate and interrelate between:
(1) the value 2:0:0:0: printed on terminal by executing dmesg | grep -i -e "flash",
(2) the value Bus 001 Device 064: printed on terminal by executing lsusb -v | grep -i -e "flash"
(3) the values:
1-0:1.0 1-1:1.0 1-3:1.0 1-7:1.0 1-8 1-8:1.1 usb1
1-1 1-3 1-7 1-7:1.1 1-8:1.0 2-0:1.0 usb2
printed on terminal by executing ls /sys/bus/usb/devices/ ,
and
(4) the Codes RM, RO, and values sdb 8:16 1 980M 0 disk by executing lsblk please?
Freedom is impossible to conceive.
Books that help:
Dale Carnegie's How To Win Friends And Influence People and Emilie Post's Etiquette In Society, In Business, In Politics, And At Home

lindi
Debian Developer
Debian Developer
Posts: 407
Joined: 2022-07-12 14:10
Has thanked: 1 time
Been thanked: 77 times

Re: Any help? Still can't comprehend bus, device, physical ports

#2 Post by lindi »

I can try to guess something :)

1) 2:0:0:0 are the host, bus, target and lun values of the SCSI device that represents your USB flash drive. I am not sure but in the case of USB but I would assume these number are not going to be stable and can change each time you reinsert the drive. These are documented in https://tldp.org/HOWTO/SCSI-2.4-HOWTO/scsiaddr.html

2) In "Bus 001 Device 064" the Bus refers to the top-level root hub. The device number is probably going to change each time you reinsert the drive. You can get better visualization of this using "lsusb -t". Here is output from a system that has two physical USB ports. There is a USB hub connected to each port and each hub has a HDMI capture device and USB serial adapter. The HDMI capture device offers multiple interfaces:

Code: Select all

/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 480M
    |__ Port 2: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 28, If 3, Class=Audio, Driver=snd-usb-audio, 480M
        |__ Port 1: Dev 28, If 1, Class=Video, Driver=uvcvideo, 480M
        |__ Port 1: Dev 28, If 4, Class=Human Interface Device, Driver=usbhid, 480M
        |__ Port 1: Dev 28, If 2, Class=Audio, Driver=snd-usb-audio, 480M
        |__ Port 1: Dev 28, If 0, Class=Video, Driver=uvcvideo, 480M
        |__ Port 3: Dev 7, If 0, Class=Vendor Specific Class, Driver=ftdi_sio, 12M
    |__ Port 3: Dev 32, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 2: Dev 33, If 0, Class=Vendor Specific Class, Driver=pl2303, 12M
        |__ Port 4: Dev 34, If 0, Class=Video, Driver=uvcvideo, 480M
        |__ Port 4: Dev 34, If 1, Class=Video, Driver=uvcvideo, 480M
        |__ Port 4: Dev 34, If 2, Class=Audio, Driver=snd-usb-audio, 480M
        |__ Port 4: Dev 34, If 3, Class=Audio, Driver=snd-usb-audio, 480M
        |__ Port 4: Dev 34, If 4, Class=Human Interface Device, Driver=usbhid, 480M
    |__ Port 4: Dev 5, If 1, Class=Wireless, Driver=btusb, 12M
    |__ Port 4: Dev 5, If 0, Class=Wireless, Driver=btusb, 12M
3) In my above example I see for example "1-2.1:1.4" in /sys/bus/usb/devices. This refers to "Bus 1, hub port 2, hub port 1, configuration 1, interface 4". These are documented in https://www.kernel.org/doc/Documentatio ... fs-bus-usb

4) RM means removable device, RO means read-only device 8 and 16 are the major and minor number of the block device /dev/sdb. These are documented in lsblk --help. You can use "ls -l /dev/sdb" to see the values and https://github.com/torvalds/linux/blob/ ... evices.txt to interpret them. The minor number can change every time you replug the drive.

I hope this is useful.

bkpsusmitaa
Posts: 485
Joined: 2009-07-04 06:32
Location: Home: Barrackpore and Mysore
Has thanked: 5 times

Re: Any help? Still can't comprehend bus, device, physical ports

#3 Post by bkpsusmitaa »

lindi wrote: 2022-07-28 09:15 I can try to guess something :)
...
Dear friend lindi.

First of all, I apologise profusely that I missed notification email for your post and failed to thank you.

While you had posted your message on 2022-07-28, I only noticed it today. So please accept my apologies for the delay.

Please accept my thanks and inform me how to register my Thanks on the BB forum.

Next, if you are a programmer tinkering with c and linux, then I shall accept your notes, No Questions Asked.

But you must understand that we all represent sections of a particular Bell Curve, and I could be an yeedeeyot. So your humour, "... I can try to guess something :) ..." might in fact create a distraction and plant doubts in my mind and others representative of our gift bracket.

So please preserve your humour for the right kind of your specie and a representative of your gift bracket.

Thanks for your post. Again.
Freedom is impossible to conceive.
Books that help:
Dale Carnegie's How To Win Friends And Influence People and Emilie Post's Etiquette In Society, In Business, In Politics, And At Home

Post Reply