mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-28 15:40:29 +09:00
qoriq eth.c bugfix: handle received corrupted frames correctly
The rxbd is not correctly handled in case of a frame physical error (FPE) or frame size error (FSE). The rxbd must be cleared and advanced in case of an error to avoid receive stall. Signed-off-by: Daniel Inderbitzin <daniel.inderbitzin@gmail.com>
This commit is contained in:
parent
1a791892dc
commit
466f775e02
@ -520,6 +520,7 @@ static int fm_eth_recv(struct eth_device *dev)
|
|||||||
u16 status, len;
|
u16 status, len;
|
||||||
u8 *data;
|
u8 *data;
|
||||||
u16 offset_out;
|
u16 offset_out;
|
||||||
|
int ret = 1;
|
||||||
|
|
||||||
fm_eth = (struct fm_eth *)dev->priv;
|
fm_eth = (struct fm_eth *)dev->priv;
|
||||||
pram = fm_eth->rx_pram;
|
pram = fm_eth->rx_pram;
|
||||||
@ -533,7 +534,7 @@ static int fm_eth_recv(struct eth_device *dev)
|
|||||||
net_process_received_packet(data, len);
|
net_process_received_packet(data, len);
|
||||||
} else {
|
} else {
|
||||||
printf("%s: Rx error\n", dev->name);
|
printf("%s: Rx error\n", dev->name);
|
||||||
return 0;
|
ret = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* clear the RxBDs */
|
/* clear the RxBDs */
|
||||||
@ -559,7 +560,7 @@ static int fm_eth_recv(struct eth_device *dev)
|
|||||||
}
|
}
|
||||||
fm_eth->cur_rxbd = (void *)rxbd;
|
fm_eth->cur_rxbd = (void *)rxbd;
|
||||||
|
|
||||||
return 1;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int fm_eth_init_mac(struct fm_eth *fm_eth, struct ccsr_fman *reg)
|
static int fm_eth_init_mac(struct fm_eth *fm_eth, struct ccsr_fman *reg)
|
||||||
|
Loading…
Reference in New Issue
Block a user