Date: Sun, 25 Apr 2004 01:51:55 +0300 From: Ruslan Ermilov <ru@FreeBSD.org> To: Luigi Rizzo <luigi@FreeBSD.org> Cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/net if.c if_vlan.c Message-ID: <20040424225155.GC35913@ip.net.ua> In-Reply-To: <200404242224.i3OMOmpK033235@repoman.freebsd.org> References: <200404242224.i3OMOmpK033235@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Sat, Apr 24, 2004 at 03:24:48PM -0700, Luigi Rizzo wrote:
> luigi 2004/04/24 15:24:48 PDT
>
> FreeBSD src repository
>
> Modified files:
> sys/net if.c if_vlan.c
> Log:
> arpcom untangling:
>
> consistently with the rest of the code, use IFP2AC(ifp) to access
> the arpcom structure given the ifp.
>
> In this case also fix a difference in assumptions WRT the rest of
> the net/ sources: it is not the 'struct *softc' that starts with a
> 'struct arpcom', but a 'struct arpcom' that starts with a
> 'struct ifnet'
>
Hmm, actually both statements are true. From if_var.h:
/*
* NB: For FreeBSD, it is assumed that each NIC driver's softc starts with
* one of these structures, typically held within an arpcom structure.
*
* struct <foo>_softc {
* struct arpcom {
* struct ifnet ac_if;
* ...
* } <arpcom> ;
* ...
* };
*
* The assumption is used in a number of places, including many
* files in sys/net, device drivers, and sys/dev/mii.c:miibus_attach().
*
* Unfortunately devices' softc are opaque, so we depend on this layout
* to locate the struct ifnet from the softc in the generic code.
*
*/
But I think your intention is to only leave the latter; in this
case, please care to update this comment in if_var.h. It came
very handy when I fixed the problem in sys/netgraph/ng_eiface.c,
rev. 1.11, and I'll sure look here again next time I do something
similar.
Cheers,
--
Ruslan Ermilov
ru@FreeBSD.org
FreeBSD committer
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)
iD8DBQFAiu+LUkv4P6juNwoRAsNoAJ4o35asxuY7I4nfq2sZPRY3eia54gCeJQZw
FE1Ovks9i1dPetvDVW//Qkc=
=ELUO
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040424225155.GC35913>
