diff options
author | luigi <luigi@FreeBSD.org> | 2001-11-22 23:59:56 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2001-11-22 23:59:56 +0000 |
commit | f5781681dfcb479518be4dd0ef3747bdcb2a27fa (patch) | |
tree | 38d371a69b1d03a8b0f316393d9f9456200bb71e /sys/net/if_var.h | |
parent | 6da34a3b753e2b722b72080ca55caf8b00baaada (diff) | |
download | FreeBSD-src-f5781681dfcb479518be4dd0ef3747bdcb2a27fa.zip FreeBSD-src-f5781681dfcb479518be4dd0ef3747bdcb2a27fa.tar.gz |
Expand the comment on the layout of softc, arpcom and ifnet structures,
and list the places where the assumption is used.
Diffstat (limited to 'sys/net/if_var.h')
-rw-r--r-- | sys/net/if_var.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/net/if_var.h b/sys/net/if_var.h index 9797d90..58d3780 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -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 */ |