Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Dec 2014 19:02:55 +0100
From:      <knl@bitflop.com>
To:        freebsd-net@freebsd.org
Subject:   Re: NICs devices switches "pshycial" place on each boot (NOT SOLVED)
Message-ID:  <20141205190255.5f81982d@easynote>

next in thread | raw e-mail | index | archive | help
Hi,

The solution provided by, Martin before he started his travels, insn't
working reliably.

devd does not match axgeX with ueX in any fixed manner.

So sometimes this will happen:

ue0: <USB Ethernet> on axge1
ue0: Ethernet address: 00:24:9b:0d:e0:0c
ue1: <USB Ethernet> on axge0
ue1 Ethernet address: 00:24:9b:0f:9d:3f
ue2: <USB Ethernet> on axge2
ue2: Ethernet address: 00:24:9b:0e:23:8e

"axge1" has been given the "ue0" device name!

So when we do a:

attach 100 {
    device-name "axge[0-9]+";
    match "vendor" "0x0b95";
    match "product" "0x1790";
    match "sernum" "0000249B0DE00C";
    action "sleep 3";
    action "ifconfig ue`echo $device-name | tr -dc '[0-9]'` name olan";
    action "ifconfig olan inet 192.168.1.1 netmask 255.255.255.0"; };
};

.. because we're dealing with "axge1", yet it is had been given the
"ue0" device name, the above match will rename the "ue1" device instead
of the "ue0" device.

So the hack is useless.

The reason why this is not working (to my understanding) has to do with
the assignment of irq numbers on each USB bus. Monitoring devd while
attaching devices shows that some stuff are random - leading to the
assignment of driver number (axgeX).

devd performs the assignment of a device driver (axge) in one attach
event and then performs the naming (ueX) in another attach event.

The problem is with the second event because it does *not* contain the
serial number or any other unique information at all.

Currently it is not possible to get both in one go.

What needs to be done IMHO is to figure out how devd assigns device
names and then completely override that in the first match event.

If not possible then another really ugly hack would be to probe
ifconfig for device names, MAC addresses and IP numbers and then use
that to rename and change things. But I would not want to rely on that!

Cheers, Kim



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20141205190255.5f81982d>