|
From: | Vinu Gopalakrishnan |
Subject: | Re: [lwip-users] DHCP and Ethernet disconnection |
Date: | Tue, 10 Dec 2019 16:29:23 +0530 |
Hi,
On Tue, Dec 10, 2019 at 04:13:33PM +0530, Vinu Gopalakrishnan wrote:
> Hi Giuseppe,
>
> You have to enable your PHY interrupt and on interrupt , read the PHY
> registers and verify that the physical link is down. Then intimate the
> stack that link has gone down using the netif_set_link_down. Then can
> dhcp_network_changed().
This is confusing, never call netif_set_link_*() from interrupt context,
those calls are not thread nor interrupt safe.
You can either use PHY interrupt then signal your main loop in some way
to call netif_set_link_*(), or periodically poll the PHY status in the
main loop.
OS users should use the netifapi API: netif_set_link_*().
Sylvain
_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users
[Prev in Thread] | Current Thread | [Next in Thread] |