[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [patch #7449] allow tcpip callback from interrupt with stat
From: |
Stephane Lesage |
Subject: |
[lwip-devel] [patch #7449] allow tcpip callback from interrupt with static memory message |
Date: |
Tue, 29 Mar 2011 20:45:33 +0000 |
User-agent: |
Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0) |
Follow-up Comment #5, patch #7449 (project lwip):
>However, I think the function tcpip_trypost() would have to be changed to
something more like tcpip_callback() because it should
>a) resemble that function if it does similar things and
ok
>b) not require the "user" to think about the contents of 'struct tcpip_msg'.
>In fact, tcpip_msg should not even be in that header file at all.
I like this idea to keep internals hidden from the user.
(there is work to do in this area, splitting header files into internal and
public API, but this is another story for 1.4.1)
>Instead, I suggest to change tcpip_trypost() to:
>err_t tcpip_trycallback(tcpip_callback_fn function, void ctx, struct
tcpip_msg msg_buffer);
I see some problems with this:
a. we will fill the same structure again and again for nothing
b. the user may think it can make multiple calls to different callbacks with
the same msg_buffer.
(we typically need PHY and MAC callbacks and maybe split RX and TX)
A simpler solution may be to allocate a message from the pool at init, using a
dedicated function:
struct tcpip_msg* tcpip_alloccallbackmsg(tcpip_callback_fn function, void
ctx);
then call in the interrupt:
err_t tcpip_trycallback(struct tcpip_msg* msg);
struct tcpip_msg can be only declared and not defined if we decide to hide all
internal stuff in the future ?
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/patch/?7449>
_______________________________________________
Message posté via/par Savannah
http://savannah.nongnu.org/