On Tue, 2009-10-06 at 14:17 +0200, Martin Velek wrote: > Hello, > > my EMAC driver is capable to detect link down(unplugging eth. cable). > This situation is returned in low_level_output by ERR_IF and > netif->flags &= ~NETIF_FLAG_LINK_UP. This is a normal behavior, > netconn_sendto returns ERR_IF. > > However after plugging cable and sending next packet, this operation > fails also with ERR_IF. I have tried to trace programm and this is a > sequence of called functions: > > netconn_sendto > netconn_send > do_send - return. > > The first line of do_send function contains "if > (!ERR_IS_FATAL(msg->conn->err)) " that causes return without checking > the line status. > > Does it mean, that before any netconn_sendto I should set conn->err to ERR_OK?
ERR_IF is deemed to be a fatal error: one from which the connection cannot recover. Clearly in your case this is wrong: unplugging and replugging the cable is not a permanent state so not a fatal error. What we probably need to do is split ERR_IF into two: one to describe fatal errors such as not being able to add the netif, and another describing transient errors such as the link going down. Your low_level_output could then return whichever of these is appropriate. On a related note, does anyone know why ERR_INPROGRESS is fatal? I don't think it should be. Kieran _______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
