Defining Autosense Kernel Thread Context Information; Defining The Polling Context Flag - Compaq Tru64 UNIX Installation Manual

Writing network device drivers
Table of Contents

Advertisement

The following code shows the declarations of the timeout and interrupt
information in the if_el device driver's el_softc data structure:
unsigned long
unsigned long
unsigned long
unsigned long
Contains the number of transmitter error resets.
1
Contains the number of times that transmit timeouts occurred. The
2
el_watch( ) routine increments this member.
Contains the count of transmit interrupts.
3
Contains the count of receive interrupts.
4

3.13 Defining Autosense Kernel Thread Context Information

The autosense kernel thread context information in the if_el driver's
el_softc data structure consists of information about the kernel thread
that performs the autosense operation. For the if_el driver, this kernel
thread is called el_autosense_thread.
The following code shows the declarations of the autosense kernel thread
variables in the if_el device driver's el_softc data structure. The if_el
device driver uses kernel threads to perform the tasks that are related to
autosensing the media. However, you can choose other methods instead of
kernel threads.
thread_t
autosense_thread;
int
autosense_flag;
Contains the autosense kernel thread ID.
1
Contains the autosense kernel thread blocking flag.
2

3.14 Defining the Polling Context Flag

A LAN driver typically does not need to perform polling operations. However,
the if_el driver provides an example of how polling operations might be
accomplished.
The polling context flag in a network driver's softc data structure indicates
whether polling is on or off. The following code shows the declaration of the
polling member in the if_el device driver's el_softc data structure:
int
polling_flag;
Declares a polling context flag member called polling_flag. This
1
member stores a boolean value of 1 (polling context is on) or 0 (polling
context is off).
txreset;
1
xmit_tmo;
2
tint;
3
rint;
4
1
2
1
Defining the softc Data Structure 3–9

Advertisement

Table of Contents
loading

Table of Contents