Handling Subsequent Probe Operations - Compaq Tru64 UNIX Installation Manual

Writing network device drivers
Table of Contents

Advertisement

Calls the kernel_thread_w_arg( ) routine to create and start a
8
kernel thread with timeshare scheduling. A kernel thread that is
created with timeshare scheduling means that its priority degrades if it
consumes an inordinate amount of CPU resources. Make sure that your
device driver calls kernel_thread_w_arg( ) only for long-running
tasks and always attaches a kernel thread to the first task.
The kernel_thread_w_arg( ) routine returns a pointer to the thread
data structure for the newly created thread. The device driver stores
this pointer in the autosense_thread member of the el_softc data
structure.
If the value that kernel_thread_w_arg( ) returns is NULL, then the
9
thread could not be created. At this point, the el_probe( ) routine
must undo previous work and return a failure indication to the caller.
For PCMCIA versions of the card, unregisters the callback routine that
10
was previously registered.
Deallocates the ether_driver data structure for this device.
11
Frees up any memory that was allocated for enhanced hardware
12
management and unregisters this card from the hardware management
database.
Calls the FREE macro, which frees the memory that was previously
13
allocated for the el_softc data structure.
Returns the value 0 (zero) to indicate that the probe operation failed.
14

5.1.10 Handling Subsequent Probe Operations

If the device had already been probed, the if_el device driver reads the
EEPROM to determine whether the hardware address has changed. The
following code shows how the el_probe( ) routine performs these tasks:
} else {
struct w3_eeprom ee_copy;
unsigned char tmp_addr[8];
struct ifreq ifr;
struct ifnet *ifp = &sc->is_if
if (multi_func_flag) {
bzero((caddr_t)&tuple_data, sizeof(struct tuple_data_info));
tuple_data_infop = &tuple_data;
tuple_infop = (struct tuple_info *)&tuple_data;
tuple_infop->socket = (short) card_infop->socket_vnum;
tuple_infop->attributes = 0;
tuple_infop->DesiredTuple = 0x88;
status = GetFirstTuple(tuple_infop);
if (status == SUCCESS) {
tuple_data_infop->TupleOffset = 0;
tuple_data_infop->TupleDataMax = (u_short)TUPLE_DATA_MAX;
status = GetTupleData(tuple_data_infop);
5–12 Implementing the Autoconfiguration Support Section (probe)
1

Advertisement

Table of Contents
loading

Table of Contents