proposal adding device_t* to struct if_net

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

  • Next message: Roderick van Domburg: "DEVICE_POLLING together with link0 interrupt offloading?"
    Date: Thu, 25 Sep 2003 16:12:23 -0700
    To: net@freebsd.org
    
    
    

    I'd like to propose that we add a device_t pointer to struct if_net. It
    would be defined to contain either a pointer to the device associated
    with this interface or NULL (pseudo-interfaces and interfaces without
    access to a device_t in their attach routine (COMPAT_OLDISA devices)
    will have NULL pointers).

    The motivation for this change is that currently we make the assumption
    that there is a one to one mapping between if_name values and device
    drivers (if the interface actually has a physical device associated with
    it). Three drivers rely on this as do administrators looking at
    ifconfig output. The current plan is to replace if_name and if_unit with
    if_xname and to allow the interface to be renamed by the administrator
    removing any tie between interface names and hardware. The three drivers
    relying on if_name need to be fixed before if_xname can go in and having
    a way for administrators to map interfaces to hardware would be useful
    once renaming is possible.

    Does anyone see any major problems with doing this? My main concern is
    that this could have locking implications.

    -- Brooks

    P.S. The main example of driver abuse of if_name is in
    sys/dev/mii/brgphy.c near lines 203 and 617.

    -- 
    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: Roderick van Domburg: "DEVICE_POLLING together with link0 interrupt offloading?"

    Relevant Pages

    • Being more anal about iospace accesses..
      ... (MMIO), mainly because on a PC ... pointer directly, and it will actually work on most machines. ... result some drivers didn't use a pointer at all, ... Sometimes such a "mixed interface" driver does it based on a compile ...
      (Linux-Kernel)
    • Re: C# DLL mittels COM-Interop aus C aufrufen
      ... Have u tried the IDispatch interface, which is used for those language ... which doesnot have capability of maintaining VTables. ... The __cplusplus symbol is defined automatically when you're compiling C ... appropriate function pointer type. ...
      (microsoft.public.de.german.entwickler.dotnet.csharp)
    • Re: Pointers in derived types, help needed
      ... subroutine/function must have an explicit interface. ... C is not a pointer. ... then probably the best thing to do is use allocatables. ...
      (comp.lang.fortran)
    • Re: Why ABCs make bad Interfaces
      ... > equivalent to an Abstract Base Class (ABC). ... > because it is common practice to implement an interface using ABC's. ... To convert an object to its interface, you return a fat pointer ... The NaiveInt constructor has to set up the vtables, ...
      (comp.object)
    • Re: HARDWARE: Open-Source-Friendly Graphics Cards -- Viable?
      ... I expect we'll come out with PCI and AGP ... Standardizing the hardware interface lowers the cost of doing an OS ... been writing and maintaining drivers for years... ...
      (Linux-Kernel)