Skip site navigation (1)Skip section navigation (2)
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

--KDt/GgjP6HVcx58l
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Apr 24, 2004 at 03:24:48PM -0700, Luigi Rizzo wrote:
> luigi       2004/04/24 15:24:48 PDT
>=20
>   FreeBSD src repository
>=20
>   Modified files:
>     sys/net              if.c if_vlan.c=20
>   Log:
>   arpcom untangling:
>  =20
>   consistently with the rest of the code, use IFP2AC(ifp) to access
>   the arpcom structure given the ifp.
>  =20
>   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'
>  =20
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,
--=20
Ruslan Ermilov
ru@FreeBSD.org
FreeBSD committer

--KDt/GgjP6HVcx58l
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFAiu+LUkv4P6juNwoRAsNoAJ4o35asxuY7I4nfq2sZPRY3eia54gCeJQZw
FE1Ovks9i1dPetvDVW//Qkc=
=ELUO
-----END PGP SIGNATURE-----

--KDt/GgjP6HVcx58l--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040424225155.GC35913>