Setting The Media In The Hardware; Building The Test Packet; Transmitting The Test Packet - Compaq Tru64 UNIX Installation Manual

Writing network device drivers
Table of Contents

Advertisement

ifp->if_unit, lan_media_strings_10[sc->lm_media]);
good_xmits = 100;
Uses the default from ROM.
1

5.3.9 Setting the Media in the Hardware

The following code shows how the el_autosense_thread( ) routine sets
the media setting in the hardware:
el_reset(ifp->if_unit);
break;
2
} else {
Directs the hardware to use the media setting that was selected in the
1
previous section.
Breaks out of the packet transmit loop because the media setting has
2
been determined.

5.3.10 Building the Test Packet

The following code shows how the el_autosense_thread( ) routine builds
a test packet to transmit:
bcopy(el_junk_msg, mtod(m, caddr_t), EL_JUNK_SIZE);
bcopy(sc->is_addr, mtod(m, caddr_t), 6);
bcopy(sc->is_addr, mtod(m, caddr_t)+6, 6);
m->m_pkthdr.len = m->m_len = EL_JUNK_SIZE;
Loads the junk message into the mbuf data structure.
1
Sets the destination address as the address of the adapter.
2
Sets the source address as the address of the adapter.
3

5.3.11 Transmitting the Test Packet

The following code shows how the el_autosense_thread( ) routine
transmits the test packet:
s = splimp();
simple_lock(&sc->el_softc_lock);
IF_ENQUEUE(&ifp->if_snd, m);
el_start_locked(sc, ifp);
simple_unlock(&sc->el_softc_lock);
splx(s);
5–22 Implementing the Autoconfiguration Support Section (probe)
1
1
2
3

Advertisement

Table of Contents
loading

Table of Contents