Date: Tue, 30 Sep 2003 10:15:36 -0700 From: Brooks Davis <brooks@one-eyed-alien.net> To: Poul-Henning Kamp <phk@phk.freebsd.dk> Cc: Vincent Jardin <vjardin@wanadoo.fr> Subject: Re: adding if_dev member to struct ifnet Message-ID: <20030930171535.GA31908@Odin.AC.HMC.Edu> In-Reply-To: <8475.1064905854@critter.freebsd.dk> References: <200309301045.15776.vjardin@wanadoo.fr> <8475.1064905854@critter.freebsd.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030930171535.GA31908>