Subject: Re: struct ifnet's if_softc field?
To: Dave McConnell <email@example.com>
From: Matt Thomas <firstname.lastname@example.org>
Date: 05/14/1999 07:59:31
At 03:29 AM 5/14/99 , Dave McConnell wrote:
>Why does "struct ifnet" have a "void *if_softc" as its first field. It
>Isn't ifnet always the first field in a network drivers softc structure?
No. For physical interfaces, struct device is first.
>In which case the pointer to the drivers "struct softc" is also the
>address of the devices "struct ifnet" (analogous to inheritence in
>C++) or am I missing something here ?
But that usually isn't the case.
>Along the same lines, I also see explicit useage of the softc's ifnet
>field address rather than the address of the softc structure itself
>when an ifnet address is required.
This so we can use C's limited typechecking to hopefully prevent bugs.
Note that if/when we switch to dynamic ifnet structures (for pcmcia
and/or usb), compilation warnings will occur where code has not been
Matt Thomas Internet: email@example.com
3am Software Foundry WWW URL: http://www.3am-software.com/bio/matt/
Sunnyvale, CA Disclaimer: I avow all knowledge of this message