From owner-freebsd-net@FreeBSD.ORG Thu Sep 25 16:12:28 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2486E16A4BF for ; Thu, 25 Sep 2003 16:12:28 -0700 (PDT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 76A9243FE9 for ; Thu, 25 Sep 2003 16:12:27 -0700 (PDT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:brdavis@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.9/8.12.3) with ESMTP id h8PNCNgg025713 for ; Thu, 25 Sep 2003 16:12:23 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.9/8.12.3/Submit) id h8PNCNj1025710 for net@freebsd.org; Thu, 25 Sep 2003 16:12:23 -0700 Date: Thu, 25 Sep 2003 16:12:23 -0700 From: Brooks Davis To: net@freebsd.org Message-ID: <20030925231223.GA19202@Odin.AC.HMC.Edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="17pEHd4RhPHOinZp" Content-Disposition: inline User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu Subject: proposal adding device_t* to struct if_net X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2003 23:12:28 -0000 --17pEHd4RhPHOinZp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. --=20 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 --17pEHd4RhPHOinZp Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/c3ZWXY6L6fI4GtQRAtz7AJwKnYVOPgri2jpTSOZxumQlSGb4DACg1SEL QKfdN75A4LSlZm0mfiQaF5c= =jB7t -----END PGP SIGNATURE----- --17pEHd4RhPHOinZp--