2
3
4
5
6
7
8
9
Looks for errors.
Processes the error.
Processes the overrun error case.
Processes the runt and oversized error cases.
Processes the CRC error case.
Processes the alignment error case.
Discards the packet if none of the previous cases apply. This indicates a size error.
Allocates a buffer for the received data. If the length of the received data is less than a small mbuf, allocates a small mbuf. Otherwise, a 2K cluster mbuf is allocated. This code is an optimization. In most cases, a driver does not know the size of a receive packet when the buffer resource is allocated.
13.2.3 Examining the First Part of the Packet
The following code shows how the el_rint( ) routine examines the first part of the received packet:
if (m != NULL) { |
| 1 |
|
|
|
|
|
|
|
| |||
2 | ||||||
= ifp; | ||||||
2; |
| 3 |
|
|
dat = mtod(m, unsigned char *); 4 len = (len + 3) & ~3;
if
(vm_offset_t)dat, 2UL*4UL, HANDLE_LONGWORD); 6
len
if (*mtod(m, unsigned char *) & 0x01) { 7
5
Implementing the Interrupt Section