[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Correctly manage cable disconnection and reconnection
From: |
Simon Goldschmidt |
Subject: |
Re: [lwip-users] Correctly manage cable disconnection and reconnection |
Date: |
Sun, 9 Dec 2012 11:04:58 +0100 |
CORRADIN Michele wrote:
> I have some problems to correctly manage cable disconnection and
> re-connection.
> Up to now I created a slow task that checks the PHY register to verify the
> connection status and if I see a cable disconnection and re-connection I
> restart the phi init in order to correctly set speed, .. but it's not clear
> to me what I should do to "re-init" LWIP.
Whether you poll the phy registers from a slow thread or use the phy interrupt
(if there is one) doesnt matter to lwIP. What's important is that you call
lwip_set_link_up() or lwip_set_link_down() after detecting link changes. Note
that it's very important to call these functions in the lwIP thread, not from
your low prio thread or from an ISR!
Calling these functions mainly triggers AutoIP and dhcp to take action after
the link has been reestablished.
Simon