Must softc begin with arpcom?
rizzo at icir.org
Wed Jun 16 16:54:09 GMT 2004
On Wed, Jun 16, 2004 at 02:24:05PM +0100, Bruce M Simpson wrote:
> In if_arp.h:
> 103 * The code is written so that each *_softc _must_ begin with a
> 104 * struct arpcom, which in turn _must_ begin with a struct ifnet.
> It seems to be that this may no longer be the case after luigi's
> recent cleanups (IFP2AC() and friends) which I nearly ended up
it is still necessary.
Many drivers certainly make this assumption by casting
either ifp or sc to (struct arpcom *).
One easy way out that does not require to touch all drivers
is to move the only remaining arpcom field (one, plus one
which is only used by ng_ether and can go into the af_data array)
into the struct ifnet and '#define arpcom ifnet'
The #define then can be removed after a cleaning pass on all drivers
(which i'd postpone to a later time when we know what we want
to do with the arpcom field, given that it is supposed to be
driver-specific or possibly useless).
More information about the freebsd-net