ifp->if_unit, lan_media_strings_10[sc->lm_media]); good_xmits = 100;

1

Uses the default from ROM.

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 {

1

1

2

Directs the hardware to use the media setting that was selected in the previous section.

Breaks out of the packet transmit loop because the media setting has 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); 2 bcopy(sc->is_addr, mtod(m, caddr_t)+6, 6); 3 m->m_pkthdr.len = m->m_len = EL_JUNK_SIZE;

1

1

2

3

Loads the junk message into the mbuf data structure. Sets the destination address as the address of the adapter. Sets the source address as the address of the adapter.

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–22Implementing the Autoconfiguration Support Section (probe)

Page 80
Image 80
Compaq AA-RNG2A-TE manual Setting the Media in the Hardware, Building the Test Packet, Transmitting the Test Packet