
#include <netinet/ip.h> #include <netinet/ip_var.h> #include <netinet/if_ether.h> 3 #include <net/ether_driver.h> #include <io/common/devdriver.h> 4 #include <hal/cpuconf.h> #include <kern/thread.h> #include <kern/sched_prim.h> #include <kern/lock.h>
#include <io/dec/eisa/eisa.h> 5 #include <io/dec/pcmcia/pcmcia.h> 6 #include <io/dec/pcmcia/cardinfo.h>
#include <io/dec/netif/lan_common.h> 7
#include <io/dec/netif/if_elreg.h>
8
1Includes the ioctl.h include file, which defines common ioctl com- mands. The ioctl.h file is located in /usr/include/sys/ioctl.h.
2Includes the sysconfig.h header file, which defines the constants that all device drivers use during configuration. The sysconfig.h file is located in /usr/include/sys/sysconfig.h.
3Includes the if_ether.h header file, which defines the ether_header data structure. All network drivers typically include this file.
If you are writing the network driver for FDDI media, you also include the header file if_fddi.h. If you are writing the network driver for Token Ring media, you also include the header file if_trn.h.
4Includes the devdriver.h header file, which defines common device driver data structures and constants. The devdriver.h file is located in /usr/include/io/common/devdriver.h.
5Includes the header file eisa.h, which is associated with the ISA bus.
6
If you are writing the driver to operate on multiple bus architectures, you must include the
Includes the header files pcmcia.h and cardinfo.h, which are associated with the PCMCIA bus.
7
Includes the lan_common.h file, which contains definitions that all local area network (LAN) device drivers need.
8
Includes the device register header file. The directory specification you make here depends on where you put the device register header file.
1.2 Declarations Section for a Network Driver
The declarations section for a network device driver contains the following categories of information: