nvme: Do not allocate 8kB buffer on stack
[platform/kernel/u-boot.git] / net / eth_legacy.c
index 340469b..f383ccc 100644 (file)
@@ -8,10 +8,12 @@
 #include <common.h>
 #include <bootstage.h>
 #include <command.h>
+#include <dm.h>
 #include <env.h>
 #include <log.h>
 #include <net.h>
 #include <phy.h>
+#include <asm/global_data.h>
 #include <linux/bug.h>
 #include <linux/errno.h>
 #include <net/pcap.h>
@@ -112,7 +114,7 @@ static int on_ethaddr(const char *name, const char *value, enum env_op op,
                return 0;
 
        /* look for an index after "eth" */
-       index = simple_strtoul(name + 3, NULL, 10);
+       index = dectoul(name + 3, NULL);
 
        dev = eth_devices;
        do {
@@ -260,7 +262,7 @@ int eth_initialize(void)
        }
 
        if (!eth_devices) {
-               puts("No ethernet found.\n");
+               log_err("No ethernet found.\n");
                bootstage_error(BOOTSTAGE_ID_NET_ETH_START);
        } else {
                struct eth_device *dev = eth_devices;
@@ -318,7 +320,7 @@ int eth_init(void)
        struct eth_device *old_current;
 
        if (!eth_current) {
-               puts("No ethernet found.\n");
+               log_err("No ethernet found.\n");
                return -ENODEV;
        }
 
@@ -364,7 +366,7 @@ int eth_send(void *packet, int length)
        ret = eth_current->send(eth_current, packet, length);
 #if defined(CONFIG_CMD_PCAP)
        if (ret >= 0)
-               pcap_post(packet, lengeth, true);
+               pcap_post(packet, length, true);
 #endif
        return ret;
 }