summaryrefslogtreecommitdiff
path: root/net/lwip/net-lwip.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/lwip/net-lwip.c')
-rw-r--r--net/lwip/net-lwip.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/net/lwip/net-lwip.c b/net/lwip/net-lwip.c
index 3918d57d7e5..1a70cedfb58 100644
--- a/net/lwip/net-lwip.c
+++ b/net/lwip/net-lwip.c
@@ -27,7 +27,7 @@
#if defined(CONFIG_API) || defined(CONFIG_EFI_LOADER)
void (*push_packet)(void *, int len) = 0;
#endif
-static int net_try_count;
+int net_try_count;
static int net_restarted;
int net_restart_wrap;
static uchar net_pkt_buf[(PKTBUFSRX) * PKTSIZE_ALIGN + PKTALIGN];
@@ -147,7 +147,7 @@ static int get_udev_ipv4_info(struct udevice *dev, ip4_addr_t *ip,
*/
int net_lwip_dns_init(void)
{
-#if CONFIG_IS_ENABLED(CMD_DNS)
+#if CONFIG_IS_ENABLED(DNS)
bool has_server = false;
ip_addr_t ns;
char *nsenv;
@@ -184,16 +184,12 @@ int net_lwip_eth_start(void)
int ret;
net_init();
- if (eth_is_on_demand_init()) {
+ eth_halt();
+ eth_set_current();
+ ret = eth_init();
+ if (ret < 0) {
eth_halt();
- eth_set_current();
- ret = eth_init();
- if (ret < 0) {
- eth_halt();
- return ret;
- }
- } else {
- eth_init_state_only();
+ return ret;
}
return 0;
@@ -285,7 +281,6 @@ int net_init(void)
if (!init_done) {
eth_init_rings();
- eth_init();
lwip_init();
init_done = true;
}
@@ -369,7 +364,7 @@ int net_lwip_rx(struct udevice *udev, struct netif *netif)
*/
int net_lwip_dns_resolve(char *name_or_ip, ip_addr_t *ip)
{
-#if defined(CONFIG_CMD_DNS)
+#if defined(CONFIG_DNS)
char *var = "_dnsres";
char *argv[] = { "dns", name_or_ip, var, NULL };
int argc = ARRAY_SIZE(argv) - 1;
@@ -378,7 +373,7 @@ int net_lwip_dns_resolve(char *name_or_ip, ip_addr_t *ip)
if (ipaddr_aton(name_or_ip, ip))
return 0;
-#if defined(CONFIG_CMD_DNS)
+#if defined(CONFIG_DNS)
if (do_dns(NULL, 0, argc, argv) != CMD_RET_SUCCESS)
return -1;