lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Implementing sys_arch on lwip 1.3.2


From: Luca Ottaviano
Subject: [lwip-users] Implementing sys_arch on lwip 1.3.2
Date: Fri, 20 May 2011 10:49:43 +0200

Hi,
I'm having a few issues in porting lwip 1.3.2 on BeRTOS
(www.bertos.org).
I have implemented my EMAC driver and the low_level_input() functions.
I've used BeRTOS facilities to implement the EMAC driver; however,
whenever I wait inside the driver timeouts are not processed and so TCP
does not retransmit lost packets.

>From what I can understand, timeouts are handled only in sys_sem_wait()
or sys_mbox_fetch() calls: when a process is going to block on a
condition, it starts to process timeouts; if there are none, the process
really blocks. Is it correct?

Since I'd like to avoid using lwip semaphores inside the EMAC driver
(which might be used without lwip), I'm looking for possible
workarounds. I've thought to process timers by hand every once in a
while with code mostly taken from sys_sem_wait. See attachment,
functions lwip_process_timers() and ethernetif_loop() [lines 283 and
315].
Do you think this kind of approach could work or there are flaws in my
reasoning?

Another question: in my application I'm creating various threads using
BeRTOS functions directly and not sys_thread_new(); all those threads
use network functions (lwip_send(), lwip_recv(), lwip_select()).
I have implemented the sys_arch_timeouts() function using the following
logic:
 * if a thread has an enhanced TCB (ie. it's created with
sys_thread_new), return it's own timeout list;
 * otherwise return a global timeout list.
Do you think that this logic is flawed?

Thanks.
-- 
Luca Ottaviano - address@hidden
Develer S.r.l. - http://www.develer.com/
.hardware .software .innovation
Tel.: +39 055 3986627 - ext.: 218

Attachment: ethernetif.c
Description: Text Data


reply via email to

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