On 14.03.2017 14:43, Zbigniew Jędrzejewski-Szmek wrote:
On Tue, Mar 14, 2017 at 06:39:29AM +0100, poma wrote:
On 13.03.2017 21:37, Stephen Morris wrote: [...]
In fact, for me, Fedora's naming convention raises more questions than it answers. Without knowing anything about the internal hardware design of a motherboard, how is a usb port on a pci bus, I would expect pci ports to be on a pci bus and usb ports to be on a usb bus, and relative to usb ports I would expect there to be a separate bus for usb 2 and usb 3 ports.
USB bus is a PCI device connected through the PCI bus. So the "geographical location" includes first the information where to find the USB bus, and then where to find the USB device starting from that.
dmesg -t | grep wl -m1 r92su 1-3:1.0 wlp0s2f1u3: renamed from wlan0
wlp0s2f1u3 wl p0 s2 f1 u3 wl-wlan p-bus=0 s-slot=2 f-function=1 u-port=3
So this USB bus in this case is multi-function device in slot 2 of PCI bus 0. Different functions probably correspond to different USB hubs, and the wireless card happens to be connected underneath function 1.
I don't think you're supposed to be able to guess the name on your own. Rather, you have a card, and you know that it has this stable name. If the card dies, and you replace it with a new one (in the same socket), the name will not change.
lsusb Bus 001 Device 003: ...
lsusb -t /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/6p, 480M |__ Port 3: Dev 3, If 0, Class=Vendor Specific Class, Driver=r92su, 480M
ls /sys/devices/pci0000:00/0000:00:02.1/usb1/1-3/1-3:1.0/net/ wlp0s2f1u3
lspci -d ::0c03 00:02.1 USB controller: ... 00 02 1 <bus>:<device>.<func>
udevadm info -q env /sys/class/net/wlp0s2f1u3 | grep PATH DEVPATH=/devices/pci0000:00/0000:00:02.1/usb1/1-3/1-3:1.0/net/wlp0s2f1u3 ID_NET_NAME_PATH=wlp0s2f1u3 ID_PATH=pci-0000:00:02.1-usb-0:3:1.0 ID_PATH_TAG=pci-0000_00_02_1-usb-0_3_1_0
udevadm info -a -p /sys/class/net/wlp0s2f1u3 | grep looking -A 3 looking at device '/devices/pci0000:00/0000:00:02.1/usb1/1-3/1-3:1.0/net/wlp0s2f1u3': KERNEL=="wlp0s2f1u3" SUBSYSTEM=="net" DRIVER=="" -- looking at parent device '/devices/pci0000:00/0000:00:02.1/usb1/1-3/1-3:1.0': KERNELS=="1-3:1.0" SUBSYSTEMS=="usb" DRIVERS=="r92su" -- looking at parent device '/devices/pci0000:00/0000:00:02.1/usb1/1-3': KERNELS=="1-3" SUBSYSTEMS=="usb" DRIVERS=="usb" -- looking at parent device '/devices/pci0000:00/0000:00:02.1/usb1': KERNELS=="usb1" SUBSYSTEMS=="usb" DRIVERS=="usb" -- looking at parent device '/devices/pci0000:00/0000:00:02.1': KERNELS=="0000:00:02.1" SUBSYSTEMS=="pci" DRIVERS=="ehci-pci" -- looking at parent device '/devices/pci0000:00': KERNELS=="pci0000:00" SUBSYSTEMS=="" DRIVERS==""
Ref. https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfac... https://github.com/systemd/systemd/blob/master/src/udev/udev-builtin-net_id....
- [P<domain>]p<bus>s<slot>[f<function>][u<port>][..][c<config>][i<interface>]
— USB port number chainHTH, Zbyszek
Yeah, the emphasis is on consistency of names of network interfaces. Thank you.