Expand the comment on the layout of softc, arpcom and ifnet structures,

and list the places where the assumption is used.
This commit is contained in:
luigi 2001-11-22 23:59:56 +00:00
parent 6da34a3b75
commit f5781681df

View File

@ -110,6 +110,21 @@ struct ifqueue {
/*
* NB: For FreeBSD, it is assumed that each NIC driver's softc starts with
* one of these structures, typically held within an arpcom structure.
*
* struct <foo>_softc {
* struct arpcom {
* struct ifnet ac_if;
* ...
* } <arpcom> ;
* ...
* };
*
* The assumption is used in a number of places, including many
* files in sys/net, device drivers, and sys/dev/mii.c:miibus_attach().
*
* Unfortunately devices' softc are opaque, so we depend on this layout
* to locate the struct ifnet from the softc in the generic code.
*
*/
struct ifnet {
void *if_softc; /* pointer to driver state */