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;
nee+;
} else if ((ifc->ifc_auto_sense == LAN_AUTOSENSE_DISABLE) &&
(sc->lm_media_mode == LAN_MODE_AUTOSENSE)) {
sc->lm_media_mode = sc->lm_media;
6
nee+;
}
}
if (ifc->ifc_media_type != -1) {
7
switch (ifc->ifc_media_type) {
8
case LAN_MEDIA_UTP:
case LAN_MEDIA_AUI:
case LAN_MEDIA_BNC:
if (ifc->ifc_media_type != sc->lm_media)
9
nee+;
sc->lm_media_mode = sc->lm_media = ifc->ifc_media_type;
break;
default:
status = EINVAL;
break;
}
}
if (need_reset && (ifp->if_flags & IFF_RUNNING))
10
el_reset_locked(sc, ifp, unit);
break;
default:
11
status = EINVAL;
}
1
Determines whether the
cmd
argument is
SIOCIFSETCHAR
.
2
Assumes no device reset is necessary.
3
If the LAN speed passed is anything other than 10 (–1 means no
change), fails the request.
4
Examines the media mode settings. If the
ioctl
request specifies both
autosense enable and an explicit media setting, fails the request.
5
Determines whether autosensing has changed.
6
If autosensing is now disabled, selects the last known media.
7
Determines whether the explicit media type selection has changed.
8
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–12 Implementing the ioctl Section