aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAlexander Graf2018-03-15 09:07:09 -0500
committerJoe Hershberger2018-03-22 15:05:31 -0500
commita532e2f2e52277635fac79cdbe4e6b5b51166de4 (patch)
tree1f3f273f3dbdce03efc5475e7a0150ab413f4b06 /net
parent17d413b2531aa4bb2a97514f130bd520deee4ada (diff)
downloadu-boot-a532e2f2e52277635fac79cdbe4e6b5b51166de4.tar.gz
u-boot-a532e2f2e52277635fac79cdbe4e6b5b51166de4.tar.xz
u-boot-a532e2f2e52277635fac79cdbe4e6b5b51166de4.zip
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>
Diffstat (limited to 'net')
-rw-r--r--net/eth-uclass.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/eth-uclass.c b/net/eth-uclass.c
index d30b04ba86..240b596534 100644
--- a/net/eth-uclass.c
+++ b/net/eth-uclass.c
@@ -336,7 +336,7 @@ int eth_send(void *packet, int length)
336 if (!current) 336 if (!current)
337 return -ENODEV; 337 return -ENODEV;
338 338
339 if (!device_active(current)) 339 if (!eth_is_active(current))
340 return -EINVAL; 340 return -EINVAL;
341 341
342 ret = eth_get_ops(current)->send(current, packet, length); 342 ret = eth_get_ops(current)->send(current, packet, length);
@@ -359,7 +359,7 @@ int eth_rx(void)
359 if (!current) 359 if (!current)
360 return -ENODEV; 360 return -ENODEV;
361 361
362 if (!device_active(current)) 362 if (!eth_is_active(current))
363 return -EINVAL; 363 return -EINVAL;
364 364
365 /* Process up to 32 packets at one time */ 365 /* Process up to 32 packets at one time */