Hello,
On my platform, the hardware notifies the driver of link status
changes by calling a user-defined call-back function.
In this call-back, I pass the notification up to lwip.
Here's my rough code:
static int mac_link_callback(ethernet_device_t *dev, unsigned status)
{
if ((status & LINK_STATUS) == 0)
{
netif_set_link_down(mynetif);
}
else
{
netif_set_link_up(mynetif);
}
return 0;
}
However, this call-back is invoked by an Ethernet-specific task
(phy_ops_update_task) i.e. not in the context of tcpip_thread.
I think this means I am not allowed to call netif_* functions
directly, and I must use the netifapi_netif_* variants?
So my call-back should call
netifapi_netif_set_link_down and netifapi_netif_set_link_up?
NB : AFAICS, netifapi_netif_set_link_* are not defined in
netifapi.h
--
Regards.
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users