2

3

4

5

Copies the current counters to the ctrreq data structure.

Indicates that these are Ethernet counters.

Returns the number of seconds since the counters were last zeroed.

If the user process requested the SIOCRDZCTRS command, zeroes the counters and sets the ztime member of the softc data structure to the current time. This indicates when the counters were zeroed.

For other types of network interfaces, you can specify a different counter type and a different set of counters. Table 12–2 lists the types of counters that the various network interfaces support.

Table 12–2: Network Interface Counter Types

Network Interface

Counter Types

FDDI

FDDI interface statistics

 

Status information

 

SMT attributes

 

MAC attributes

 

Path attributes

 

Port attributes

 

SMT MIB attributes

 

Extended MIB attributes (Compaq proprietary)

Token Ring

Characteristics

 

Counters

 

MIB counters

 

MIB statistics

 

 

12.11Bringing Up the Device (SIOCSIFADDR ioctl Command)

The following code shows how the el_ioctl( ) routine implements the SIOCSIFADDR ioctl command to bring up the device:

case SIOCSIFADDR: 1 ifp->if_flags = IFF_UP; 2 el_reset_locked(sc, ifp, unit);

if (sc->ztime == 0) sc->ztime = time.tv_sec; break;

3

1

Determines whether the cmd argument is SIOCSIFADDR.

Implementing the ioctl Section 12–9

Page 133
Image 133
Compaq AA-RNG2A-TE manual Bringing Up the Device Siocsifaddr ioctl Command, Network Interface Counter Types