Determining Whether Packets Were Transmitted Successfully; Printing Debug Information; Setting Up New Media - Compaq Tru64 UNIX Installation Manual

Writing network device drivers
Table of Contents

Advertisement

WRITE_CMD(sc, CMD_WINDOW1);
simple_unlock(&sc->el_softc_lock);
splx(s);
break;
default:
break;
}
Tests for loss of carrier errors. Most network adapters give carrier
1
errors if no cable is plugged in or if transceivers are not present.

5.3.14 Determining Whether Packets Were Transmitted Successfully

The following code shows how the el_autosense_thread( ) routine
determines whether packets were successfully transmitted:
if ((prev_err == ifp->if_oerrors) &&
(prev_tmo == sc->xmit_tmo) &&
(wait < 5)) {
good_xmits++;
if (sc->debug)
printf("el%d: autosense: %s packet sent OK (%d)\n",
ifp->if_unit, lan_media_strings_10[sc->lm_media],
good_xmits);
} else {
good_xmits = 0;
Determines whether traffic went out successfully.
1

5.3.15 Printing Debug Information

The following code shows how the el_autosense_thread( ) routine prints
debug information:
if (sc->debug) {
if (prev_err != ifp->if_oerrors)
printf("el%d: autosense: %s transmit error\n",
ifp->if_unit,
lan_media_strings_10[sc->lm_media]);
if (prev_tmo != sc->xmit_tmo)
printf("el%d: autosense: %s driver transmit timeout\n",
ifp->if_unit,
lan_media_strings_10[sc->lm_media]);
if ((wait >= 5) && (wait < 100))
printf("el%d: autosense: %s transmit timeout\n",
ifp->if_unit,
lan_media_strings_10[sc->lm_media]);
}
Prints debugging information (if requested).
1

5.3.16 Setting Up New Media

The following code shows how the el_autosense_thread( ) routine
selects new media to try if the transmit operation failed:
switch (sc->lm_media) {
case LAN_MEDIA_AUI:
5–24 Implementing the Autoconfiguration Support Section (probe)
1
1
1

Advertisement

Table of Contents
loading

Table of Contents