3
while (m) {
4
m_freem(m);
}
return;
}
1
2
3
4
Declares a pointer to an ether_header data structure called eh. The ether_header data structure contains information that is associated with a 10 Mb/s and 100 Mb/s Ethernet header.
If the cardout member of the el_softc data structure for this device is set to 1 (true), the user removed the PCMCIA card from the slot.
Calls the IF_DEQUEUE macro to remove an entry from the output queue. The output queue is referenced through the if_snd member of the ifnet data structure for this device. The memory buffer information that IF_DEQUEUE manipulates is specified in the instance of the mbuf data structure called m.
As long as a transmit request was dequeued from the output queue, calls m_freem( ) to free the request and IF_DEQUEUE to dequeue the next transmit request.
9.2.2Removing Packets from the Pending Queue and Preparing the Transmit Buffer
The following code shows how the el_start_locked( ) routine removes packets from the pending queue and prepares the transmit buffer:
while(1) { 1
if ((m) &&
while (ms &&
ms =
m_freem(m); continue;
}
3