
2
3
Copies transmit data from memory to the card using
If some number of bytes (fewer than 4) remain in the current memory buffer, the driver either copies those bytes directly to the card (if they were the last bytes for the entire frame), or combines those bytes with bytes from the next memory buffer (if there is more data for this frame).
9.2.4 Accounting for Outgoing Bytes
The following code shows how the el_start_locked( ) routine accounts for the outgoing bytes:
1
1
Maintains the number of bytes free in the transmit FIFO.
9.2.5Updating Counters, Freeing the Transmit Buffer, and Marking the Output Process as Active
The following code shows how the el_start_locked( ) routine updates counters, frees the transmit buffer, and marks the output process as active:
ADD_XMIT_PACKET(ifp, sc,
if
}
m_freem(m);
2
} else if (m) { 3
}else break;
}
1
2
3
Updates the counters using the ADD_XMIT_PACKET and possibly the ADD_XMIT_MPACKET (for multicast packets) macros. These macros are defined in the lan_common.h file. Most network drivers perform this task in the transmit complete interface.
Calls the m_freem( ) routine to free the mbuf buffer. Network drivers must free the buffer after the transmit operation is complete.
If there is no room for this transmit, puts the mbuf back on the queue.