mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-10 12:39:22 -04:00
ppc4xx: Change receive buffer handling in the 4xx emac driver
This change fixes a bug in the receive buffer handling, that could lead to problems upon high network traffic (broadcasts...). Signed-off-by: Stefan Roese <sr@denx.de>
This commit is contained in:
parent
53629f439c
commit
a2e1c7098c
@ -1415,10 +1415,8 @@ static void enet_rcv (struct eth_device *dev, unsigned long malisr)
|
|||||||
if ((MAL_RX_CTRL_EMPTY & hw_p->rx[i].ctrl)
|
if ((MAL_RX_CTRL_EMPTY & hw_p->rx[i].ctrl)
|
||||||
|| (loop_count >= NUM_RX_BUFF))
|
|| (loop_count >= NUM_RX_BUFF))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
loop_count++;
|
loop_count++;
|
||||||
hw_p->rx_slot++;
|
|
||||||
if (NUM_RX_BUFF == hw_p->rx_slot)
|
|
||||||
hw_p->rx_slot = 0;
|
|
||||||
handled++;
|
handled++;
|
||||||
data_len = (unsigned long) hw_p->rx[i].data_len; /* Get len */
|
data_len = (unsigned long) hw_p->rx[i].data_len; /* Get len */
|
||||||
if (data_len) {
|
if (data_len) {
|
||||||
@ -1468,6 +1466,10 @@ static void enet_rcv (struct eth_device *dev, unsigned long malisr)
|
|||||||
if (NUM_RX_BUFF == hw_p->rx_i_index)
|
if (NUM_RX_BUFF == hw_p->rx_i_index)
|
||||||
hw_p->rx_i_index = 0;
|
hw_p->rx_i_index = 0;
|
||||||
|
|
||||||
|
hw_p->rx_slot++;
|
||||||
|
if (NUM_RX_BUFF == hw_p->rx_slot)
|
||||||
|
hw_p->rx_slot = 0;
|
||||||
|
|
||||||
/* AS.HARNOIS
|
/* AS.HARNOIS
|
||||||
* free receive buffer only when
|
* free receive buffer only when
|
||||||
* buffer has been handled (eth_rx)
|
* buffer has been handled (eth_rx)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user