adding if_dev member to struct ifnet

Poul-Henning Kamp phk at phk.freebsd.dk
Tue Sep 30 10:56:46 PDT 2003


In message <20030930171535.GA31908 at Odin.AC.HMC.Edu>, Brooks Davis writes:

>> Somebody please explain how this would work for non-hardware
>> interfaces like if_loop, if_tun, if_tap etc ?
>
>if_dev would be NULL when a device_t was not available.  Code which used
>this feature would be required to either check that if_dev was non-NULL
>before trying to use it or have special knowldege that it only gets
>called with struct ifnet instances which have a non-NULL if_dev member.
>For instance, driver routines which take a struct ifnet would know that
>they are only called on their own ifnet so they could assume they had
>filled it in.

So you'd still have to keep the if_name + if_unit around for the
drivers which do not have a device_t ?

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.


More information about the freebsd-arch mailing list