External And Forward Declarations - Compaq Tru64 UNIX Installation Manual

Writing network device drivers
Table of Contents

Advertisement

External and forward declarations (Section 1.2.1)
Declaration of softc and controller data structure arrays
(Section 1.2.2)
Declaration of the driver data structure (Section 1.2.3)
Definitions of driver-specific macros (Section 1.2.4)
The following sections discuss each of these categories of declarations, using
the if_el device driver as an example.
The declarations section also contains the definition of the softc data
structure and declarations for configure-related variables and data
structures. Chapter 3 discusses the definition of a network driver's softc
data structure. Section 4.1 discusses the declarations that are related to
configuration.

1.2.1 External and Forward Declarations

The following code shows the external and forward declarations for the
if_el device driver:
int el_configure(cfg_op_t, cfg_attr_t *, size_t, cfg_attr_t *, size_t);
static int
el_probe (io_handle_t, struct controller *);
static int
el_attach(struct controller *);
static int
el_unattach(struct bus *, struct controller *);
static int
el_init_locked(struct el_softc *, struct ifnet *, int);
static int
el_init(int);
static void
el_start_locked(struct el_softc *, struct ifnet *);
static void
el_start(struct ifnet *);
static int
el_watch(int);
static void
el_reset_locked(struct el_softc *, struct ifnet *, int);
static void
el_reset(int);
static int
el_ioctl(struct ifnet *, u_int, caddr_t);
static int
el_intr(int);
static void
el_rint(struct el_softc *, struct ifnet *);
static void
el_tint(struct el_softc *, struct ifnet *);
static void
el_error(struct el_softc *, struct ifnet *);
static void
el_shutdown(struct el_softc *);
static void
el_card_remove(int, struct el_softc *);
static int
el_isa_reset_all(io_handle_t, int *, struct controller *);
static int
el_isa_activate(io_handle_t, int *, struct controller *);
static unsigned short
static void
el_wait(struct el_softc *);
static void
el_autosense_thread(struct el_softc *);
static int
el_card_out(struct el_softc *);
extern struct timeval time;
extern task_t first_task;
Declares the function prototype definitions for all exported functions.
1
Declares the driver interfaces for the if_el device driver.
2
Declares the external timeval data structure called time. Various
3
ioctl commands use this data structure.
el_isa_read_offset(io_handle_t, int);
3
4
Network Device Driver Environment 1–5
1
2

Advertisement

Table of Contents
loading

Table of Contents