From owner-freebsd-net@FreeBSD.ORG Tue Sep 30 10:53:04 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 6EE5316A4B3; Tue, 30 Sep 2003 10:53:04 -0700 (PDT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 95E1C43F85; Tue, 30 Sep 2003 10:53:02 -0700 (PDT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:smmsp@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.9/8.12.3) with ESMTP id h8UHpLDX025768; Tue, 30 Sep 2003 10:52:48 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.9/8.12.3/Submit) id h8UHFa4c011339; Tue, 30 Sep 2003 10:15:36 -0700 Date: Tue, 30 Sep 2003 10:15:36 -0700 From: Brooks Davis To: Poul-Henning Kamp Message-ID: <20030930171535.GA31908@Odin.AC.HMC.Edu> References: <200309301045.15776.vjardin@wanadoo.fr> <8475.1064905854@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wac7ysb48OaltWcw" Content-Disposition: inline In-Reply-To: <8475.1064905854@critter.freebsd.dk> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu cc: arch@FreeBSD.org cc: net@FreeBSD.org Subject: Re: adding if_dev member to struct ifnet 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: Tue, 30 Sep 2003 17:53:04 -0000 --wac7ysb48OaltWcw Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 30, 2003 at 09:10:54AM +0200, Poul-Henning Kamp wrote: > In message <200309301045.15776.vjardin@wanadoo.fr>, Vincent Jardin writes: > >Le Mardi 30 Septembre 2003 03:03, Brooks Davis a =E9crit : > >> [Previously posted to -net in another form.] > >> > >> I propose to add an if_dev member to struct ifnet. It would be of type > >> device_t and be defined to point to the device for the interface or NU= LL > >> if there is no device (or if there was not an easy way to get access to > >> one). > >> > >> This change would codify the the relationship between an interface and > >> the underlying physical device. It also would get rid of the existing > >> abuses of if_name to look up the driver associated with an interface > >> and simplify a number of messy cases in the conversion from if_unit and > >> if_name to if_xname. > >> > >> Does this seem like a reasonable thing to do? > > > >Yes, if it helps to remove if_name/if_unit, it is a thing to do. Moreove= r it=20 > >sounds a good idea to have the if_dev field into the ifnet structure. >=20 > Somebody please explain how this would work for non-hardware > interfaces like if_loop, if_tun, if_tap etc ? if_dev would be NULL when a device_t was not available. Code which used this feature would be required to either check that if_dev was non-NULL before trying to use it or have special knowldege that it only gets called with struct ifnet instances which have a non-NULL if_dev member. For instance, driver routines which take a struct ifnet would know that they are only called on their own ifnet so they could assume they had filled it in. -- 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 --wac7ysb48OaltWcw Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/ebnzXY6L6fI4GtQRAlveAJ9ZoFSGyyHg317JC6z+Wrgp2K+/2QCdGID2 ttlbZccT/fcmYswywjaqA1o= =HbMf -----END PGP SIGNATURE----- --wac7ysb48OaltWcw--