LINUX.ORG.RU

Multiseat помогите понять как идентифицировать контроллеры usb для проброса в гостя

 , ,


1

1

Материнская плата Gigabyte TRX40 AORUS XTREME rev. 1.0
https://www.gigabyte.com/Motherboard/TRX40-AORUS-XTREME-rev-10

Помогите понять с методикой как вычислить устройство usb контроллера с целью выдать его целиком в гостя. И понять возможно ли вообще выдать его в гостя. Реализованные непосредственно в ЦП контроллеры пробрасываются? По идее, должны же?

Я так понимаю, что нужно взять известное конечное usb устройство, втыкать в порты и смотреть вывод lsusb (-t). Но как результат сопоставить с выводом lspci?

★★★★★
root@tarh-multiseat:~# lsusb -t
/:  Bus 10.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 10000M
/:  Bus 09.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 480M
    |__ Port 3: Dev 7, If 1, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 3: Dev 7, If 2, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 3: Dev 7, If 0, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 5: Dev 6, If 0, Class=Wireless, Driver=btusb, 12M
    |__ Port 5: Dev 6, If 1, Class=Wireless, Driver=btusb, 12M
    |__ Port 6: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 4, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 2: Dev 5, If 0, Class=Human Interface Device, Driver=usbhid, 12M
/:  Bus 08.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 10000M
/:  Bus 07.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 480M
    |__ Port 1: Dev 2, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
    |__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
    |__ Port 2: Dev 7, If 1, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 2: Dev 7, If 2, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 2: Dev 7, If 0, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 4: Dev 4, If 0, Class=Hub, Driver=hub/4p, 480M
    |__ Port 5: Dev 5, If 3, Class=Audio, Driver=usbfs, 480M
    |__ Port 5: Dev 5, If 1, Class=Audio, Driver=usbfs, 480M
    |__ Port 5: Dev 5, If 6, Class=Human Interface Device, Driver=usbfs, 480M
    |__ Port 5: Dev 5, If 4, Class=Audio, Driver=usbfs, 480M
    |__ Port 5: Dev 5, If 2, Class=Audio, Driver=usbfs, 480M
    |__ Port 5: Dev 5, If 0, Class=Audio, Driver=usbfs, 480M
    |__ Port 5: Dev 5, If 5, Class=Audio, Driver=usbfs, 480M
    |__ Port 6: Dev 6, If 1, Class=Audio, Driver=usbfs, 480M
    |__ Port 6: Dev 6, If 2, Class=Human Interface Device, Driver=usbfs, 480M
    |__ Port 6: Dev 6, If 0, Class=Audio, Driver=usbfs, 480M
/:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 10000M
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 10000M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
    |__ Port 1: Dev 2, If 0, Class=Video, Driver=usbfs, 480M
    |__ Port 1: Dev 2, If 1, Class=Video, Driver=usbfs, 480M
    |__ Port 1: Dev 2, If 2, Class=Audio, Driver=usbfs, 480M
    |__ Port 1: Dev 2, If 3, Class=Audio, Driver=usbfs, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 10000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
    |__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbfs, 12M
    |__ Port 1: Dev 2, If 1, Class=Human Interface Device, Driver=usbfs, 12M
    |__ Port 1: Dev 2, If 2, Class=Human Interface Device, Driver=usbfs, 12M
    |__ Port 2: Dev 4, If 2, Class=Human Interface Device, Driver=usbfs, 12M
    |__ Port 2: Dev 4, If 0, Class=Human Interface Device, Driver=usbfs, 12M
    |__ Port 2: Dev 4, If 1, Class=Human Interface Device, Driver=usbfs, 12M
root@tarh-multiseat:~# 
root@tarh-multiseat:~# lsusb 
Bus 009 Device 005: ID 048d:8297 Integrated Technology Express, Inc. 
Bus 009 Device 004: ID 048d:8297 Integrated Technology Express, Inc. 
Bus 009 Device 003: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 009 Device 006: ID 8087:0029 Intel Corp. 
Bus 009 Device 007: ID 1532:0207 Razer USA, Ltd 
Bus 009 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 010 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 008 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 007 Device 006: ID 0414:a000 Giga-Byte Technology Co., Ltd 
Bus 007 Device 005: ID 0414:a001 Giga-Byte Technology Co., Ltd 
Bus 007 Device 004: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 007 Device 007: ID 046d:c539 Logitech, Inc. 
Bus 007 Device 002: ID 0c45:7603 Microdia 
Bus 007 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 002: ID 046d:082d Logitech, Inc. HD Pro Webcam C920
Bus 003 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 001 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 002: ID 0951:16bf Kingston Technology 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@tarh-multiseat:~# 

Конкретно сейчас я воткнул во фронтальный (на морде корпуса) порт устройство

Bus 009 Device 007: ID 1532:0207 Razer USA, Ltd

targitaj ★★★★★
() автор топика
root@tarh-multiseat:~# lspci | grep -i usb
03:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] Starship USB 3.0 Host Controller
23:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] Starship USB 3.0 Host Controller
45:00.0 USB controller: ASMedia Technology Inc. ASM2142 USB 3.1 Host Controller
48:00.1 USB controller: Advanced Micro Devices, Inc. [AMD] Matisse USB 3.0 Host Controller
48:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] Matisse USB 3.0 Host Controller
root@tarh-multiseat:~# 
targitaj ★★★★★
() автор топика
Ответ на: комментарий от targitaj
root@tarh-multiseat:~# lspci -tv
-+-[0000:60]-+-00.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse Root Complex
 |           +-00.2  Advanced Micro Devices, Inc. [AMD] Starship/Matisse IOMMU
 |           +-01.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
 |           +-02.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
 |           +-03.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
 |           +-04.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
 |           +-05.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
 |           +-07.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
 |           +-07.1-[61]----00.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Function
 |           +-08.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
 |           \-08.1-[62]----00.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse Reserved SPP
 +-[0000:40]-+-00.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse Root Complex
 |           +-00.2  Advanced Micro Devices, Inc. [AMD] Starship/Matisse IOMMU
 |           +-01.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
 |           +-01.1-[41-4a]----00.0-[42-4a]--+-02.0-[43-44]--+-00.0  Intel Corporation Ethernet Controller 10G X550T
 |           |                               |               \-00.1  Intel Corporation Ethernet Controller 10G X550T
 |           |                               +-03.0-[45]----00.0  ASMedia Technology Inc. ASM2142 USB 3.1 Host Controller
 |           |                               +-04.0-[46]----00.0  ASMedia Technology Inc. ASM1062 Serial ATA Controller
 |           |                               +-05.0-[47]----00.0  Intel Corporation Device 2723
 |           |                               +-08.0-[48]--+-00.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse Reserved SPP
 |           |                               |            +-00.1  Advanced Micro Devices, Inc. [AMD] Matisse USB 3.0 Host Controller
 |           |                               |            \-00.3  Advanced Micro Devices, Inc. [AMD] Matisse USB 3.0 Host Controller
 |           |                               +-09.0-[49]----00.0  Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode]
 |           |                               \-0a.0-[4a]----00.0  Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode]
 |           +-02.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
 |           +-03.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
 |           +-03.1-[4b-4d]----00.0-[4c-4d]----00.0-[4d]--+-00.0  Advanced Micro Devices, Inc. [AMD/ATI] Vega 10 XL/XT [Radeon RX Vega 56/64]
 |           |                                            \-00.1  Advanced Micro Devices, Inc. [AMD/ATI] Vega 10 HDMI Audio [Radeon Vega 56/64]
 |           +-04.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
 |           +-05.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
 |           +-07.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
 |           +-07.1-[4e]----00.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Function
 |           +-08.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
 |           \-08.1-[4f]----00.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse Reserved SPP
 +-[0000:20]-+-00.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse Root Complex
 |           +-00.2  Advanced Micro Devices, Inc. [AMD] Starship/Matisse IOMMU
 |           +-01.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
 |           +-02.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
 |           +-03.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
 |           +-03.1-[21]--+-00.0  Advanced Micro Devices, Inc. [AMD/ATI] Lexa PRO [Radeon RX 550/550X]
 |           |            \-00.1  Advanced Micro Devices, Inc. [AMD/ATI] Baffin HDMI/DP Audio [Radeon RX 550 640SP / RX 560/560X]
 |           +-04.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
 |           +-05.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
 |           +-07.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
 |           +-07.1-[22]----00.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Function
 |           +-08.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
 |           \-08.1-[23]--+-00.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse Reserved SPP
 |                        +-00.1  Advanced Micro Devices, Inc. [AMD] Starship/Matisse Cryptographic Coprocessor PSPCPP
 |                        +-00.3  Advanced Micro Devices, Inc. [AMD] Starship USB 3.0 Host Controller
 |                        \-00.4  Advanced Micro Devices, Inc. [AMD] Starship/Matisse HD Audio Controller
 \-[0000:00]-+-00.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse Root Complex
             +-00.2  Advanced Micro Devices, Inc. [AMD] Starship/Matisse IOMMU
             +-01.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
             +-01.3-[01]--+-00.0  Advanced Micro Devices, Inc. [AMD/ATI] Oland PRO [Radeon R7 240/340]
             |            \-00.1  Advanced Micro Devices, Inc. [AMD/ATI] Cape Verde/Pitcairn HDMI Audio [Radeon HD 7700/7800 Series]
             +-02.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
             +-03.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
             +-04.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
             +-05.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
             +-07.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
             +-07.1-[02]----00.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Function
             +-08.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
             +-08.1-[03]--+-00.0  Advanced Micro Devices, Inc. [AMD] Starship/Matisse Reserved SPP
             |            \-00.3  Advanced Micro Devices, Inc. [AMD] Starship USB 3.0 Host Controller
             +-14.0  Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller
             +-14.3  Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge
             +-18.0  Advanced Micro Devices, Inc. [AMD] Starship Device 24; Function 0
             +-18.1  Advanced Micro Devices, Inc. [AMD] Starship Device 24; Function 1
             +-18.2  Advanced Micro Devices, Inc. [AMD] Starship Device 24; Function 2
             +-18.3  Advanced Micro Devices, Inc. [AMD] Starship Device 24; Function 3
             +-18.4  Advanced Micro Devices, Inc. [AMD] Starship Device 24; Function 4
             +-18.5  Advanced Micro Devices, Inc. [AMD] Starship Device 24; Function 5
             +-18.6  Advanced Micro Devices, Inc. [AMD] Starship Device 24; Function 6
             \-18.7  Advanced Micro Devices, Inc. [AMD] Starship Device 24; Function 7
root@tarh-multiseat:~# 

Формат адресов разный или я чего-то не понял?

targitaj ★★★★★
() автор топика
Последнее исправление: targitaj (всего исправлений: 1)
18 марта 2021 г.

В общем, процедура следующая. Ссылка, которая помогла понять порядок действий.

Я взял usb накопитель и воткнул в хост. В журнале хоста прошло сообщение вида

Mar 18 19:02:26 tarh-multiseat kernel: usb 10-3: new SuperSpeed Gen 1 USB device number 3 using xhci_hcd
Mar 18 19:02:26 tarh-multiseat kernel: usb 10-3: New USB device found, idVendor=8564, idProduct=4000, bcdDevice= 0.3a
Mar 18 19:02:26 tarh-multiseat kernel: usb 10-3: New USB device strings: Mfr=3, Product=4, SerialNumber=5
Mar 18 19:02:26 tarh-multiseat kernel: usb 10-3: Product: Transcend
Mar 18 19:02:26 tarh-multiseat kernel: usb 10-3: Manufacturer: TS-RDF5 
Mar 18 19:02:26 tarh-multiseat kernel: usb 10-3: SerialNumber: 000000000037
Mar 18 19:02:26 tarh-multiseat kernel: usb-storage 10-3:1.0: USB Mass Storage device detected
Mar 18 19:02:26 tarh-multiseat kernel: scsi host12: usb-storage 10-3:1.0
Mar 18 19:02:27 tarh-multiseat kernel: scsi 12:0:0:0: Direct-Access     TS-RDF5  SD  Transcend    TS3A PQ: 0 ANSI: 6
Mar 18 19:02:27 tarh-multiseat kernel: sd 12:0:0:0: Attached scsi generic sg5 type 0
Mar 18 19:02:27 tarh-multiseat kernel: sd 12:0:0:0: [sdf] 500170752 512-byte logical blocks: (256 GB/239 GiB)
Mar 18 19:02:27 tarh-multiseat kernel: sd 12:0:0:0: [sdf] Write Protect is off
Mar 18 19:02:27 tarh-multiseat kernel: sd 12:0:0:0: [sdf] Mode Sense: 23 00 00 00
Mar 18 19:02:27 tarh-multiseat kernel: sd 12:0:0:0: [sdf] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
Mar 18 19:02:27 tarh-multiseat kernel:  sdf: sdf1
Mar 18 19:02:27 tarh-multiseat kernel: sd 12:0:0:0: [sdf] Attached SCSI removable disk

Ключевая инфа для поиска

usb 10-3
idVendor=8564, idProduct=4000

Далее, у нас есть вывод lsusb

root@tarh-multiseat:~# lsusb | grep '8564'
Bus 010 Device 003: ID 8564:4000 Transcend Information, Inc. RDF8
root@tarh-multiseat:~# 
Всё точно, и теперь мы знаем, что запись 10-3 означает «Bus 010 Device 003»

Далее, идём смотрим сюда

root@tarh-multiseat:/sys/bus/usb/devices# ll | grep 10-3
lrwxrwxrwx 1 root root 0 Mar 18 19:02 10-3 -> ../../../devices/pci0000:40/0000:40:01.1/0000:41:00.0/0000:42:08.0/0000:48:00.3/usb10/10-3/
lrwxrwxrwx 1 root root 0 Mar 18 19:02 10-3:1.0 -> ../../../devices/pci0000:40/0000:40:01.1/0000:41:00.0/0000:42:08.0/0000:48:00.3/usb10/10-3/10-3:1.0/
root@tarh-multiseat:/sys/bus/usb/devices# 

и получаем, я так понимаю, полную цепь подключенных последовательно устройств и в конце цепи устройство

0000:48:00.3

Которое пересекается с выводом команды lspci

root@tarh-multiseat:~# lspci -nnv | grep -i -e usb 
03:00.3 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Starship USB 3.0 Host Controller [1022:148c] (prog-if 30 [XHCI])
	Subsystem: Gigabyte Technology Co., Ltd Starship USB 3.0 Host Controller [1458:5007]
23:00.3 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Starship USB 3.0 Host Controller [1022:148c] (prog-if 30 [XHCI])
	Subsystem: Gigabyte Technology Co., Ltd Starship USB 3.0 Host Controller [1458:5007]
45:00.0 USB controller [0c03]: ASMedia Technology Inc. ASM2142 USB 3.1 Host Controller [1b21:2142] (prog-if 30 [XHCI])
	Subsystem: Gigabyte Technology Co., Ltd ASM2142 USB 3.1 Host Controller [1458:5007]
48:00.1 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Matisse USB 3.0 Host Controller [1022:149c] (prog-if 30 [XHCI])
	Subsystem: Advanced Micro Devices, Inc. [AMD] Matisse USB 3.0 Host Controller [1022:1486]
48:00.3 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Matisse USB 3.0 Host Controller [1022:149c] (prog-if 30 [XHCI])
	Subsystem: Advanced Micro Devices, Inc. [AMD] Matisse USB 3.0 Host Controller [1022:148c]
root@tarh-multiseat:~# 

То есть

48:00.3 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Matisse USB 3.0 Host Controller [1022:149c] (prog-if 30 [XHCI])
и есть искомый контроллер.

targitaj ★★★★★
() автор топика

Отлично, получилось, работает. Правда, отпал звук в машине, из которой пишу. Сейчас модно звуковые набортные ставить и usb подключением. Очевидно, на том же контроллере звук был. Надо карту устройств рисовать...

targitaj ★★★★★
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.