From owner-freebsd-net Fri Jul 26 23:12:24 2002 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 BAB4437B400 for ; Fri, 26 Jul 2002 23:12:20 -0700 (PDT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3AAED43E3B for ; Fri, 26 Jul 2002 23:12:20 -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.3/8.12.3) with ESMTP id g6R6CIpO009284; Fri, 26 Jul 2002 23:12:18 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.3/8.12.3/Submit) id g6R6CI7t009283; Fri, 26 Jul 2002 23:12:18 -0700 Date: Fri, 26 Jul 2002 23:12:17 -0700 From: Brooks Davis To: Jonathan Lemon Cc: Brooks Davis , net@FreeBSD.ORG Subject: Re: switching to if_xname from if_name and if_unit Message-ID: <20020726231217.A8038@Odin.AC.HMC.Edu> References: <20020726211050.A30598@Odin.AC.HMC.Edu> <20020727005801.D6547@prism.flugsvamp.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="bg08WKrSYDhXBjb5" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020727005801.D6547@prism.flugsvamp.com>; from jlemon@flugsvamp.com on Sat, Jul 27, 2002 at 12:58:01AM -0500 X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --bg08WKrSYDhXBjb5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jul 27, 2002 at 12:58:01AM -0500, Jonathan Lemon wrote: > On Fri, Jul 26, 2002 at 09:10:50PM -0700, Brooks Davis wrote: > > [Bcc to -arch for interested people not on -net] > >=20 > > NetBSD and OpenBSD have replaced the "char *if_name" and "int if_unit" > > members of struct ifnet with "char if_xname[IFNAMESIZ]". I propose that > > we follow suit. > >=20 >=20 > Note that the unit/name appears to be stored at three places right now: >=20 > - interface (if_name, if_unit) > - device_t (dev->devclass->name, dev->unit, dev->nameunit) > - dev_t (dev->si_name) >=20 > I'd prefer if we could figure out how to do away with the names at the > interface level completely and see if it is possible to use the dev->name= unit > instead. Perhaps it would be feasible to add a device_t to the ifp? The only problem I can see there is that not all interfaces have devices associated with them. lo(4) and vlan(4) are examples of that. A useful compromise might be to create a helper function/macro that takes an ifp and dev and sets the if_xname member of the ifp. That way we'll have the same code in all the functions have have device_t's available in if_attach without requiring new device_t's for each pseudo interface just to have something to hang a name off of. > Most uses of the if_name seem to be for error messages, and many newer > drivers now use device_printf(dev, ...) for driver messages. I've been thinking we need an if_printf(ifp, ...) function to get rid of some of this uglyness. -- Brooks --=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 --bg08WKrSYDhXBjb5 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE9QjnBXY6L6fI4GtQRAomuAKCT9y6x7vFtHFaiIq6NUZnlQ+HwcQCfTxdE ebu+RF/MeVRUYu9g38R++dw= =UIVX -----END PGP SIGNATURE----- --bg08WKrSYDhXBjb5-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message