Using Currently Set Flags (Siocsifflags Ioctl Command); Setting The Ip Mtu (Siocsipmtu Ioctl Command); Setting The Media Speed (Siocsmacspeed Ioctl Command) - Compaq Tru64 UNIX Installation Manual

Writing network device drivers
Table of Contents

Advertisement

Marks the interface as up and calls the el_reset_locked( ) routine
2
to start the network interface with the current settings.
Sets the counter cleared time (used by DECnet, netstat, clusters, and so
3
forth).
12.12 Using Currently Set Flags (SIOCSIFFLAGS ioctl
Command)
The following code shows how the el_ioctl( ) routine implements the
SIOCSIFFLAGS ioctl command to reset the device using currently set flags:
case SIOCSIFFLAGS:
if (ifp->if_flags & IFF_RUNNING)
el_reset_locked(sc, ifp, unit);
break;
Determines whether the cmd argument is SIOCSIFFLAGS.
1
If the 3Com 3C5x9 device is running, calls the el_reset_locked( )
2
routine to restart the network interface with the current flag settings.

12.13 Setting the IP MTU (SIOCSIPMTU ioctl Command)

The following code shows how the el_ioctl( ) routine implements the
SIOCSIPMTU ioctl command to set the IP MTU. You must implement this
task in your network driver to accommodate the IP layer.
case SIOCSIPMTU:
bcopy(ifr->ifr_data, (u_char *)&ifmtu, sizeof(u_short));
if (ifmtu > ETHERMTU || ifmtu < IP_MINMTU)
status = EINVAL;
else {
ifp->if_mtu = ifmtu;
lan_set_attribute(sc->ehm.current_val, NET_MTU_NDX, (void *)ifmtu);
}
break;
Determines whether the cmd argument is SIOCSIPMTU.
1
Compares the passed value to the media's maximum and minimum
2
values. If this value is not within the range allowed, the driver
returns an error. Otherwise, it sets the if_mtu member of the driver's
ifnet data structure to the specified IP MTU value. Also, updates
the corresponding hardware attribute in the enhanced hardware
management (EHM) database.
12.14 Setting the Media Speed (SIOCSMACSPEED ioctl
Command)
The following code shows how the el_ioctl( ) routine implements
the SIOCSMACSPEED ioctl command to set the media speed. (The
12–10 Implementing the ioctl Section
1
2
1
2

Advertisement

Table of Contents
loading

Table of Contents