lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] (netif==up) vs (link==up)


From: Grubb, Jared
Subject: [lwip-devel] (netif==up) vs (link==up)
Date: Fri, 6 Jul 2007 13:25:37 -0700

Do we need a stack-level link change callback function? I think we do… here’s why:

 

There are two different axes for a network interface. Whether the interface is available to the app layer (“up”) and whether the interface has a connection to the outside world (“link”).

 

Based on my understanding of the LWIP code, the stack is ignorant of the link. So the following is the behavior:
UP & LINK => Everything works.

UP & NO LINK => Stack sends frames, but the driver ignores them, and sends nothing up the RX stack.

DOWN & LINK => Stack never sends anything to the output of the iface, hardware doesn’t send anything up

DOWN & NO LINK => Nobody does anything on this iface

 

There are some events that should happen when the link appears, like sending the gratuitous ARP, triggering DHCP, etc. If the cable is unplugged and plugged into a new spot without a board-reboot, these things should all happen again. The link changes but the interface never goes “down”.

 

Therefore, I think there should be a callback in netif.c that a netif should call whenever its link status changes. This is sort of the dual to the callback the status callback that the stack calls when the interface goes UP or DOWN.

 

1.       Netif_set_up calls status_callback in driver, which flags the hardware to enable its RX & TX whenever it can – but does not issue an ARP

2.       When link status changes, driver calls the link change callback in netif, which issues the gratuitous ARP for a link up.

 

Does that sound reasonable, or have I misunderstood something in the way this all works?

Jared


reply via email to

[Prev in Thread] Current Thread [Next in Thread]