Establishing The Media - Compaq Tru64 UNIX Installation Manual

Writing network device drivers
Table of Contents

Advertisement

if (sc->lm_media_mode == LAN_MODE_AUTOSENSE)
sc->lm_media = LAN_MEDIA_UTP;
break;
case LAN_MEDIA_BNC:
if (sc->lm_media_mode == LAN_MODE_AUTOSENSE)
sc->lm_media = LAN_MEDIA_AUI;
break;
case LAN_MEDIA_UTP:
default:
if (sc->lm_media_mode == LAN_MODE_AUTOSENSE)
sc->lm_media = LAN_MEDIA_BNC;
break;
}
el_reset(ifp->if_unit);
}
}
Selects new media.
1
Calls the el_reset( ) routine to reset the hardware. This reset will
2
establish the next media to try.

5.3.17 Establishing the Media

The following code shows how the el_autosense_thread( ) routine
establishes the new media:
}
if (sc->debug) {
if ((sc->lm_media == LAN_MEDIA_UTP) && !link_beat &&
(passes <= EL_AUTOSENSE_PASSES))
printf("el%d: No Link Beat signal\n", ifp->if_unit);
}
sc->lm_media_state = LAN_MEDIA_STATE_DETERMINED;
printf("el%d: Autosense selected %s media\n", ifp->if_unit,
lan_media_strings_10[sc->lm_media]);
s = splimp();
simple_lock(&sc->el_softc_lock);
WRITE_CMD(sc, CMD_STATSDIS);
simple_unlock(&sc->el_softc_lock);
splx(s);
6
}
}
Sets the lm_media_state member of the softc data structure to
1
LAN_MEDIA_STATE_DETERMINED. This indicates that the driver has
successfully selected a media mode.
Calls the splimp( ) routine to mask all LAN hardware interrupts.
2
Upon successful completion, splimp( ) stores an integer value in the
s variable. This value represents the CPU priority level that existed
before the call to splimp( ).
Calls the simple_lock( ) routine to assert a lock with exclusive
3
access for the resource that is associated with the el_softc_lock
data structure. This means that no other kernel thread can gain access
to the locked resource until you call simple_unlock( ) to release it.
2
2
3
4
5
Implementing the Autoconfiguration Support Section (probe) 5–25
1

Advertisement

Table of Contents
loading

Table of Contents