Implementing The El_Start_Locked Routine; Pcmcia Card - Compaq Tru64 UNIX Installation Manual

Writing network device drivers
Table of Contents

Advertisement

This simple lock was previously asserted by calling the simple_lock( )
or simple_lock_try( ) routine.
Calls the splx( ) routine to reset the CPU priority to the level that the
2
s variable specifies.

9.2 Implementing the el_start_locked Routine

The el_start_locked( ) routine performs the start operation. It is
called by the if_el device driver's el_init_locked( ), el_start( ),
el_intr( ), and el_autosense_thread( ) routines.
The el_start_locked( ) routine performs the following tasks:
Discards all transmits if the user has removed the PCMCIA card
(Section 9.2.1)
Removes packets from the pending queue and prepares the transmit
buffer (Section 9.2.2)
Transmits the packets (Section 9.2.3)
Accounts for the outgoing bytes (Section 9.2.4)
Updates counters, frees the transmit buffer, and marks the output
process as active (Section 9.2.5)
Indicates when to start the watchdog interface (Section 9.2.6)
______________________
If you decide not to implement your start section as a jacket
routine, then some of the tasks listed in this section would be
performed by your start section.
9.2.1 Discarding All Transmits After the User Removes the PCMCIA
Card
The following code shows how the el_start_locked( ) routine discards all
pending transmits after the user has removed the card from the system.
static void el_start_locked(struct el_softc *sc,
struct ifnet *ifp)
{
struct mbuf *m, *ms, *mp, *mn;
int len, i, j, val;
unsigned char *dat;
struct ether_header *eh;
if (sc->cardout) {
Note
_______________________
1
2
Implementing the Start Section 9–3

Advertisement

Table of Contents
loading

Table of Contents