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

txreset;

unsigned long

xmit_tmo;

unsigned

long

tint;

3

unsigned

long

rint;

4

1

2

1

2

3

4

Contains the number of transmitter error resets.

Contains the number of times that transmit timeouts occurred. The el_watch( ) routine increments this member.

Contains the count of transmit interrupts.

Contains the count of receive interrupts.

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;

2

1

1

2

Contains the autosense kernel thread ID.

Contains the autosense kernel thread blocking flag.

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;

1

1

Declares a polling context flag member called polling_flag. This member stores a boolean value of 1 (polling context is on) or 0 (polling context is off).

Defining the softc Data Structure 3–9

Page 53
Image 53
Compaq AA-RNG2A-TE manual Defining Autosense Kernel Thread Context Information, Defining the Polling Context Flag