Commit a971231c authored by Kirill Smelkov's avatar Kirill Smelkov

X neotest/info: Handle USB NICs

e.g. before:

	# wwan0: lspci: -s: Invalid bus number
	lspci: -s: Invalid bus number
	lspci: -s: Invalid bus number
	  rev

after:

	# wwan0: Novatel Wireless Expedite E362 (usb)
parent 521d3ae5
......@@ -627,6 +627,14 @@ system_info() {
nicdev=`realpath $nic/device` # /sys/class/net/eth0 -> /sys/devices/pci0000:00/0000:00:1f.6
case "$nicdev" in
*usb*)
# /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.6 -> .../usb2/2-1/2-1.6
usbdev="$nicdev/.."
usbdev=`cat $usbdev/busnum`:`cat $usbdev/devnum` # ... -> 2:4
product=`lsusb -s $usbdev |sed -e 's/^Bus\s[0-9]*\sDevice\s[0-9]*:\sID\s[0-9a-f]*:[0-9a-f]*\s//'`
echo "$product (usb)"
;;
*pci*)
pcidev=`basename $nicdev` # /sys/devices/pci0000:00/0000:00:1f.6 -> 0000:00:1f.6
#lspci -s $pcidev
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment