proposal adding device_t* to struct if_net

Brooks Davis brooks at one-eyed-alien.net
Thu Sep 25 16:12:28 PDT 2003


I'd like to propose that we add a device_t pointer to struct if_net.  It
would be defined to contain either a pointer to the device associated
with this interface or NULL (pseudo-interfaces and interfaces without
access to a device_t in their attach routine (COMPAT_OLDISA devices)
will have NULL pointers).

The motivation for this change is that currently we make the assumption
that there is a one to one mapping between if_name values and device
drivers (if the interface actually has a physical device associated with
it).  Three drivers rely on this as do administrators looking at
ifconfig output.  The current plan is to replace if_name and if_unit with
if_xname and to allow the interface to be renamed by the administrator
removing any tie between interface names and hardware.  The three drivers
relying on if_name need to be fixed before if_xname can go in and having
a way for administrators to map interfaces to hardware would be useful
once renaming is possible.

Does anyone see any major problems with doing this?  My main concern is
that this could have locking implications.

-- Brooks

P.S. The main example of driver abuse of if_name is in
sys/dev/mii/brgphy.c near lines 203 and 617.

-- 
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20030925/a5d67a79/attachment.bin


More information about the freebsd-net mailing list