[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] DHCP and Ethernet disconnection
From: |
Sylvain Rochet |
Subject: |
Re: [lwip-users] DHCP and Ethernet disconnection |
Date: |
Tue, 10 Dec 2019 11:54:31 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
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
signature.asc
Description: Digital signature