mirror of
https://xff.cz/git/u-boot/
synced 2025-09-30 06:51:28 +02:00
net: Only access network devices after init
In the efi_loader main loop we call eth_rx() occasionally. This rx function might end up calling into devices that haven't been initialized yet, potentially resulting in a lot of transfer timeouts. Instead, let's make sure the ethernet device is actually initialized before reading from or writing to it. Signed-off-by: Alexander Graf <agraf@suse.de> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
committed by
Joe Hershberger
parent
17d413b253
commit
a532e2f2e5
@@ -336,7 +336,7 @@ int eth_send(void *packet, int length)
|
|||||||
if (!current)
|
if (!current)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
if (!device_active(current))
|
if (!eth_is_active(current))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
ret = eth_get_ops(current)->send(current, packet, length);
|
ret = eth_get_ops(current)->send(current, packet, length);
|
||||||
@@ -359,7 +359,7 @@ int eth_rx(void)
|
|||||||
if (!current)
|
if (!current)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
if (!device_active(current))
|
if (!eth_is_active(current))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
/* Process up to 32 packets at one time */
|
/* Process up to 32 packets at one time */
|
||||||
|
Reference in New Issue
Block a user