diff options
author | Tom Rini <trini@konsulko.com> | 2025-02-24 17:15:14 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2025-02-24 17:15:14 -0600 |
commit | 3ecda19009ebbe46a64b0629f8b64173c7a551c0 (patch) | |
tree | ad8bc5289901745c546cafaa3a7cab4577c298c3 /net/lwip/net-lwip.c | |
parent | 523a56cc54637a0c04a1e87c262599faf26d7d69 (diff) | |
parent | dc0ee458f1afae4cb5c8a7b2c875bb24ffdf71ca (diff) |
Merge tag 'v2025.04-rc3' into next
Prepare v2025.04-rc3
Diffstat (limited to 'net/lwip/net-lwip.c')
-rw-r--r-- | net/lwip/net-lwip.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/net/lwip/net-lwip.c b/net/lwip/net-lwip.c index b863047f598..cab1dd7d483 100644 --- a/net/lwip/net-lwip.c +++ b/net/lwip/net-lwip.c @@ -127,6 +127,20 @@ static int get_udev_ipv4_info(struct udevice *dev, ip4_addr_t *ip, return 0; } +/* Initialize the lwIP stack and the ethernet devices and set current device */ +void net_lwip_set_current(void) +{ + static bool init_done; + + if (!init_done) { + eth_init_rings(); + eth_init(); + lwip_init(); + init_done = true; + } + eth_set_current(); +} + static struct netif *new_netif(struct udevice *udev, bool with_ip) { unsigned char enetaddr[ARP_HLEN]; @@ -134,19 +148,10 @@ static struct netif *new_netif(struct udevice *udev, bool with_ip) ip4_addr_t ip, mask, gw; struct netif *netif; int ret = 0; - static bool first_call = true; if (!udev) return NULL; - if (first_call) { - eth_init_rings(); - /* Pick a valid active device, if any */ - eth_init(); - lwip_init(); - first_call = false; - } - if (eth_start_udev(udev) < 0) { log_err("Could not start %s\n", udev->name); return NULL; |