finishing the if.h/if_var.h split

From: Brooks Davis (brooks_at_one-eyed-alien.net)
Date: 09/30/03

  • Next message: Brooks Davis: "adding if_dev member to struct ifnet"
    Date: Mon, 29 Sep 2003 18:01:28 -0700
    To: arch@freebsd.org, net@freebsd.org
    
    
    

    Six years and eight months ago, net/if.h was split into if.h and
    if_var.h. At the time, if_var.h was included at the end if if.h as
    follows (this is the current code, but it's equivalent):

    #ifdef _KERNEL
    struct thread;

    /* XXX - this should go away soon. */
    #include <net/if_var.h>
    #endif

    Unfortunately, "soon" hasn't happened yet and it is now tripping me
    up. To add the if_dev member to struct ifnet (see the forthcoming
    post on that subject), it is necessary for sys/bus.h to be included in
    net/if_var.h which in turn requires that if_var.h NOT be included in
    genassym.c. Since if.h must be included for nfsdiskless support, this
    means we need to finish the job and remove the include if_var.h from
    if.h. It involves editing a large number of files, but over all it's
    pretty mechanical as it simple includes adding and include of if_var.h
    after the if.h include in files that break after the change.

    Does this sound reasonable?

    -- Brooks

    P.S. The alternative is to add a second typedef of device_t to if_var.h.
    It's an ugly solution since it and the definition in sys/bus.h would
    have to look like the one below, but it would be a heck of a lot easier.

    #ifndef _DEVICE_T_DECLARED
    typedef struct device *device_t;
    #define _DEVICE_T_DECLARED
    #endif

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



  • Next message: Brooks Davis: "adding if_dev member to struct ifnet"