lwip bindings and pppos

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
Post Reply
wizhippo
Posts: 18
Joined: Thu Oct 31, 2013 3:41 pm

lwip bindings and pppos

Post by wizhippo »

I have been settings the lwip bindings tu use pppos.

pppos needs support for sys_jiffies which is not included in the current sys_arch.c. Below is an example implementation.

Also when lwip exits its pppThread the way both sys_arch.c and ppp.c in lwip are written the threads resources stick around when pppClose is called. See http://lists.gnu.org/archive/html/lwip- ... 00124.html.

Perhaps we could implement a fix by patching lwip as suggested in the thread.

Code: Select all


u32_t sys_jiffies(void) {
   static u32_t jiffies = 0;
#if OSAL_ST_FREQUENCY == 1000
   jiffies += (u32_t)osalOsGetSystemTimeX();
#elif (OSAL_ST_FREQUENCY / 1000) >= 1 && (OSAL_ST_FREQUENCY % 1000) == 0
   jiffies += ((u32_t)osalOsGetSystemTimeX() - 1) / (OSAL_ST_FREQUENCY / 1000) + 1;
#elif (1000 / OSAL_ST_FREQUENCY) >= 1 && (1000 % OSAL_ST_FREQUENCY) == 0
   jiffies += ((u32_t)osalOsGetSystemTimeX() - 1) * (1000 / OSAL_ST_FREQUENCY) + 1;
#else
   jiffies += (u32_t)(((u64_t)(osalOsGetSystemTimeX() - 1) * 1000) / OSAL_ST_FREQUENCY) + 1;
#endif

   return jiffies;
}
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: lwip bindings and pppos

Post by Giovanni »

I don't know if we should patch lwip but thanks for the code, I will include it anyway.

Let's see if there are answers to that thread.

BTW, is the project still alive? 1.4.1 is quite old.

Giovanni
Post Reply