Compaq Tru64 UNIX Installation Manual page 117

Writing network device drivers
Table of Contents

Advertisement

mp = ms;
8
mn = mp->m_next;
len = mp->m_len;
while (mn != NULL) {
if (mn->m_len == 0) {
mp->m_next = mn->m_next;
mn->m_next = NULL;
m_free(mn);
} else {
12
len += mn->m_len;
mp = mn;
}
mn = mp->m_next;
}
While true, removes packets from the pending queue and has the device
1
transmit the packets.
Calls the IF_DEQUEUE macro to remove an entry from the output queue.
2
The output queue is referenced through the if_snd member of the
ifnet data structure for this device. The memory buffer information is
the instance of the mbuf data structure called m.
Checks that the total packet length is less than the number of bytes left
3
in the transmit first-in/first-out (FIFO).
Eliminates any zero-length segments. The ms mbuf pointer will point to
4
the first buffer segment with data.
Skips over any leading zero-length segments.
5
Stores the next memory buffer in the chain of mbuf data structures in
6
the ms mbuf pointer. The m_next member stores the next memory
buffer in the chain. Network device drivers typically reference this
member through the alternate name m_next, which is defined in the
mbuf.h header file.
If this is a zero-length transmit, calls the m_freem( ) routine to free the
7
mbuf buffer chain.
Stores the first memory buffer in the chain of mbuf data structures in
8
the mp mbuf pointer.
Stores the next memory buffer in the chain of mbuf data structures in
9
the mn mbuf pointer.
Stores the amount of data in the mp mbuf in the len variable. The
10
mh_len member of the mbuf data structure pointer stores the amount
of data in this mbuf data structure. Network device drivers typically
reference this member through the alternate name m_len, which is
defined in the mbuf.h header file.
While the mn mbuf is not NULL, manipulates the mh_len and mh_next
11
members of the mbuf data structure to eliminate any zero-length buffers
9
10
11
Implementing the Start Section 9–5

Advertisement

Table of Contents
loading

Table of Contents