mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-13 20:36:02 +01:00
net: dm9000: Correctly handle empty FIFO
Assign packet pointer only in case the MAC reports anything in the FIFO. In case the MAC indicates empty FIFO, return 0 to pass that information to the network stack. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Ramon Fried <rfried.dev@gmail.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
This commit is contained in:
parent
01207947d5
commit
ecd8b03713
@ -666,10 +666,10 @@ static int dm9000_recv(struct udevice *dev, int flags, uchar **packetp)
|
||||
int ret;
|
||||
|
||||
ret = dm9000_recv_common(db, data);
|
||||
if (ret)
|
||||
if (ret > 0)
|
||||
*packetp = (void *)data;
|
||||
|
||||
return ret ? ret : -EAGAIN;
|
||||
return ret >= 0 ? ret : -EAGAIN;
|
||||
}
|
||||
|
||||
static int dm9000_write_hwaddr(struct udevice *dev)
|
||||
|
Loading…
x
Reference in New Issue
Block a user