patchlwIP - A Lightweight TCP/IP stack - Patches: patch #6142, Fix link callback

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #6142: Fix link callback

Submitter:  Jared Grubb <jgrubb>
Submitted:  Mon 06 Aug 2007 03:30:07 PM UTC
   
 
Category:  None Priority:  3 - Low
Status:  Done Privacy:  Public
Assigned to:  jgrubb Open/Closed:  Closed
Planned Release:  1.3.0

Jump to the original submission

Thu 09 Aug 2007 09:10:01 AM UTC, comment #7: 

ok for me

Frédéric Bernon <fbernon>
Group Member
Wed 08 Aug 2007 06:23:01 PM UTC, comment #6: 

I've added the two NETIF_LINK_CALLBACK lines. OK to close?

Jared Grubb <jgrubb>
Group Member
Mon 06 Aug 2007 10:25:49 PM UTC, comment #5: 

So, to my point of view, the patch is ok for me, except this part:

@@ -438,19 +438,12 @@
 
 #if LWIP_NETIF_LINK_CALLBACK
 /**
- * Set callback to be called when link is brought up/down
- */
-void netif_set_link_callback( struct netif netif, void ( link_callback)(struct netif *netif ))
-{
-    if ( netif )
-        netif->link_callback = link_callback;
-}
-/**

Frédéric Bernon <fbernon>
Group Member
Mon 06 Aug 2007 08:18:37 PM UTC, comment #4: 


> I don't understand:


Forget the original comment -- I was confused. The patch is all I want to change.

Jared Grubb <jgrubb>
Group Member
Mon 06 Aug 2007 08:10:10 PM UTC, comment #3: 

I don't understand: if you remove the netif_set_link_callback, how do you initialize "netif->link_callback" ? To my point of view, I would let the function in the code (and, if it's not called, the linker will remove it from the footprint).

Else, Ok for the two "+NETIF_LINK_CALLBACK(netif);"


Frédéric Bernon <fbernon>
Group Member
Mon 06 Aug 2007 08:05:14 PM UTC, comment #2: 

Ah, I see it now. I was confused... the "link callback" is into the application, not the driver. In any case, the link callback needs to get called. The following patch should be applied to make that call.


(file #13607)

Jared Grubb <jgrubb>
Group Member
Mon 06 Aug 2007 07:39:41 PM UTC, comment #1: 

I'm not sure to remember which comment in #20409 suggest to remove the link_callback? Can you provide a patch file to see this new change ?


Frédéric Bernon <fbernon>
Group Member
Mon 06 Aug 2007 03:30:07 PM UTC, original submission:  

I was doing some documentation on the link callback feature we added a few weeks back (bug #20409), and I think the patch I made had too much code in it. Specifically, we decided that there would be two functions:

  • netif_set_link_up
  • netif_set_link_down

and that we would leave it to the driver to know whether to call these directly or call tcpip_callback with these functions as parameters.

In any case, the patch I applied had a netif_set_link_callback function and a new variable in the netif struct. These were suggestions early in the task, but what we agreed on at the end didn't need them... I forgot to take them out of the patch.

I would like to remove netif_set_link_callback and the variable in netif. netif_set_link_up/down will still be in the code. Does anyone object?

Jared Grubb <jgrubb>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #13607:  netif.c.patch added by jgrubb (953B - text/x-patch - call link callback in link change functions)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by fbernon (Posted a comment)
  • -email is unavailable- added by jgrubb (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-08-09 jgrubb StatusWorks For Me Done
        Open/ClosedOpen Closed
    2007-08-08 jgrubb StatusNone Works For Me
    2007-08-06 jgrubb Attached File- Added netif.c.patch, #13607

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code