1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 05:12:57 +01:00

pkg/lwip: Set netdev callback before driver init

Otherwise if the cable is connected at boot the immediate NETDEV_EVENT_ISR
event signaling connection will not trigger the isr, and the netdev will not
clear its pending event.

This explains why the connect/rx event clash seen in "esp32/eth: Don't
overwrite queued event with RX packet" (95196fb7e4) only happened
with lwIP.

Now on my ESP32 board with Ethernet the issue was the opposite (since IDF
upgrade), the stuck connected event blocked receive from working. After
this change 95196fb7e4 can be reverted since even early events are
consumed properly.
This commit is contained in:
Erik Ekman 2022-09-03 13:53:58 +02:00
parent 44440caf68
commit 04a2070faa

View File

@ -94,8 +94,8 @@ err_t lwip_netdev_init(struct netif *netif)
netdev = netif->state;
lwip_netif_dev_acquire(netif);
netdev->driver->init(netdev);
netdev->event_callback = _event_cb;
netdev->driver->init(netdev);
if (netdev->driver->get(netdev, NETOPT_DEVICE_TYPE, &dev_type,
sizeof(dev_type)) < 0) {
res = ERR_IF;