Compaq AA-RNG2A-TE manual Using Currently Set Flags Siocsifflags ioctl Command

Models: AA-RNG2A-TE

1 159
Download 159 pages 42.56 Kb
Page 134
Image 134

2

3

Marks the interface as up and calls the el_reset_locked( ) routine to start the network interface with the current settings.

Sets the counter cleared time (used by DECnet, netstat, clusters, and so forth).

12.12Using 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: 1

if (ifp->if_flags & IFF_RUNNING) el_reset_locked(sc, ifp, unit);

break;

2

1

2

Determines whether the cmd argument is SIOCSIFFLAGS.

If the 3Com 3C5x9 device is running, calls the el_reset_locked( ) 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: 1

bcopy(ifr->ifr_data, (u_char *)&ifmtu, sizeof(u_short)); if (ifmtu > ETHERMTU ifmtu < IP_MINMTU) 2

status = EINVAL; else {

ifp->if_mtu = ifmtu;

lan_set_attribute(sc->ehm.current_val, NET_MTU_NDX, (void *)ifmtu);

}

break;

1

2

Determines whether the cmd argument is SIOCSIPMTU.

Compares the passed value to the media’s maximum and minimum 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.14Setting 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–10Implementing the ioctl Section

Page 134
Image 134
Compaq AA-RNG2A-TE manual Using Currently Set Flags Siocsifflags ioctl Command, Setting the IP MTU Siocsipmtu ioctl Command