lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Calling netif_set_link_up/down in my driver


From: Mason
Subject: Re: [lwip-users] Calling netif_set_link_up/down in my driver
Date: Mon, 28 May 2012 14:55:02 +0200
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20120429 Firefox/12.0 SeaMonkey/2.9.1

Mason wrote:

> Simon Goldschmidt wrote:
> 
>> Mason wrote:
>>
>>> If LWIP_TCPIP_CORE_LOCKING is 0, tcpip_netifapi looks
>>> fairly similar to tcpip_callback_with_block.
>>>
>>> Does netifapi make sense when LWIP_TCPIP_CORE_LOCKING is 1,
>>> in which case there is no message passing, the operation is
>>> done within the calling context holding LOCK_TCPIP_CORE?
>>
>> Using netifapi makes sense in both configurations as you can just
>> use the predefined functions instead of writing your own code.
> 
> Can I call netif_set_link_up( ) directly in my driver?
> Or would I need some hypothetical netifapi_netif_set_link_up?
> 
> $ grep -rn netifapi_netif_set_link
> 
> NB: netifapi_netif_set_link is not defined in the list of
> wrappers in netifapi.h (in the 1.4.x branch)
> 
> Should netifapi_netif_set_link_up be defined in netifapi.h?
> 
>> I didn't quite get why you can't use the netifapi functions,
>> though.
> 
> I haven't needed netifapi until now, thus it is not compiled in.
> Adding this module to my project (thus adding object code) when
> the same operation can be done through tcpip_callback does not
> seem warranted to me. But perhaps I have some misconceptions?

Do I need to provide a patch to add netifapi_netif_set_link_up?

Something along the lines of

$ diff -u netifapi.h.orig netifapi.h
--- netifapi.h.orig     2012-05-14 14:10:21.984375000 +0200
+++ netifapi.h  2012-05-28 14:53:39.750000000 +0200
@@ -93,6 +93,8 @@
 #define netifapi_netif_remove(n)      netifapi_netif_common(n, netif_remove, 
NULL)
 #define netifapi_netif_set_up(n)      netifapi_netif_common(n, netif_set_up, 
NULL)
 #define netifapi_netif_set_down(n)    netifapi_netif_common(n, netif_set_down, 
NULL)
+#define netifapi_netif_set_link_up(n)   netifapi_netif_common(n, 
netif_set_link_up, NULL)
+#define netifapi_netif_set_link_down(n) netifapi_netif_common(n, 
netif_set_link_down, NULL)
 #define netifapi_netif_set_default(n) netifapi_netif_common(n, 
netif_set_default, NULL)
 #define netifapi_dhcp_start(n)        netifapi_netif_common(n, NULL, 
dhcp_start)
 #define netifapi_dhcp_stop(n)         netifapi_netif_common(n, dhcp_stop, NULL)

Or can I call netif_set_link_up directly in my driver?

-- 
Regards.



reply via email to

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