Compaq AA-RNG2A-TE manual 12-12Implementing the ioctl Section

Models: AA-RNG2A-TE

1 159
Download 159 pages 42.56 Kb
Page 136
Image 136

if (ifc->ifc_auto_sense != -1) { 5

if ((ifc->ifc_auto_sense == LAN_AUTOSENSE_ENABLE) &&

(sc->lm_media_mode != LAN_MODE_AUTOSENSE)) { sc->lm_media_mode = LAN_MODE_AUTOSENSE; need_reset++;

}else if ((ifc->ifc_auto_sense == LAN_AUTOSENSE_DISABLE) && (sc->lm_media_mode == LAN_MODE_AUTOSENSE)) {

sc->lm_media_mode = sc->lm_media; 6 need_reset++;

}

}

if (ifc->ifc_media_type != -1) {

7

switch (ifc->ifc_media_type) { case LAN_MEDIA_UTP:

case LAN_MEDIA_AUI: case LAN_MEDIA_BNC:

8

if (ifc->ifc_media_type != sc->lm_media) 9 need_reset++;

sc->lm_media_mode = sc->lm_media = ifc->ifc_media_type; break;

default:

status = EINVAL;

break;

}

}

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

break;

default: 11 status = EINVAL;

10

}

1

2

3

4

5

6

7

8

Determines whether the cmd argument is SIOCIFSETCHAR.

Assumes no device reset is necessary.

If the LAN speed passed is anything other than 10 (–1 means no change), fails the request.

Examines the media mode settings. If the ioctl request specifies both autosense enable and an explicit media setting, fails the request.

Determines whether autosensing has changed.

If autosensing is now disabled, selects the last known media.

Determines whether the explicit media type selection has changed.

If the requested media value is out of range or not supported by the EtherLink III family, fails the ioctl request immediately.

The EtherLink III family supports the usual 802.3 media. The if_el driver does not check the card’s capability in the registers because it is not useful to do so. The registers always indicate they have all media, regardless of what they really have.

12–12Implementing the ioctl Section

Page 136
Image 136
Compaq AA-RNG2A-TE manual 12-12Implementing the ioctl Section