![](/images/new-backgrounds/1195471/195471287x1.webp)
13.2.2 Pulling the Packets from the FIFO Buffer
The following code shows how the el_rint( ) routine pulls the packets from the
while ((status > 0) &&
if ((status & RX_ER) (len > 1518) (len < 60)) { if (status & RX_ER) { 3
status &= RX_EM;
if
switch (status) {
case RX_EOR: 4
if
if
printf("el%d: Overrun\n",
2
case RX_ERT: 5 case RX_EOS:
printf("el%d: Bad Sized packet\n",
case RX_ECR: 6
printf("el%d: CRC\n",
case RX_EAL: 7 default:
printf("el%d: Alignment\n",
}
}else
if
printf("el%d: Received illegal size packet (%d)\n",
} else {
if (len <=
} else {
MGETHDR(m, M_DONTWAIT, MT_DATA); if (m) {
MCLGET2(m, M_DONTWAIT);
if
m = (struct mbuf *)NULL;
}
}
}
1
Sets up a while loop that executes as long as there are complete packets.