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:
parent
6da34a3b75
commit
f5781681df
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user