Using any network interface whatsoever (solution?)

M. Warner Losh imp at bsdimp.com
Mon Apr 10 02:46:31 UTC 2006


In message: <4439AF09.6030209 at bitfreak.org>
            Darren Pilgrim <darren.pilgrim at bitfreak.org> writes:
: M. Warner Losh wrote:
: > 
: > The device subsystem already exports a bus-dependent plug and play
: > position.  No need to make it specific to USB/PCI/whatever.
: 
: Where is this information found?  I can't find anything obvious that 
: wouldn't change if you inserted a bus in the middle of the probe order.

I was replying to the position stuff that was proposed as a way to
find something.  I was saying that you don't need to invent special
locators, since all busses are required to provide them.

For example:

% devinfo -v | grep fxp0
            fxp0 pnpinfo vendor=0x8086 device=0x103d subvendor=0x104d subdevice=0x8140 class=0x020000 at slot=8 function=0 handle=\_SB_.PCI0.PCIB.LANC

You'd write the devd rule like:

attach 10 {
	match	"slot"	"8";
	match	"function" "0";
	action	"configure-network $device-name";
};

This is technically independent of the bus, since the bus isn't
exported (it should be).  I'm told that some machines have multiple
pci domains, so bus number isn't unique.  devinfo(8) should provide a
way to get this information as well, but it currently makes that kinda
hard (you could parse out the parent device name).

Warner



More information about the freebsd-hackers mailing list