Re: Must softc begin with arpcom?

From: Luigi Rizzo (rizzo_at_icir.org)
Date: 06/16/04

  • Next message: Richard Neese: "atw admtek driver"
    Date: Wed, 16 Jun 2004 09:53:38 -0700
    To: freebsd-net@freebsd.org
    
    

    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
    > duplicating.

    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).

    cheers
    luigi
    _______________________________________________
    freebsd-net@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-net
    To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"


  • Next message: Richard Neese: "atw admtek driver"

    Relevant Pages

    • Re: adding if_dev member to struct ifnet
      ... >> ifnet is what we use to hitch drivers to the netstack. ... If you stick a newbus requirement on "struct ifnet" you suddenly ... attachment of device drivers to hardware, it's not quite perfect, ...
      (freebsd-arch)
    • Re: adding if_dev member to struct ifnet
      ... >> ifnet is what we use to hitch drivers to the netstack. ... If you stick a newbus requirement on "struct ifnet" you suddenly ... attachment of device drivers to hardware, it's not quite perfect, ...
      (freebsd-net)