diff --git a/doc/ppp.txt b/doc/ppp.txt index 8b0acdf0..7a9ba674 100644 --- a/doc/ppp.txt +++ b/doc/ppp.txt @@ -419,3 +419,5 @@ from previous lwIP version is pretty easy: conditional. * PPPoS now requires a serial output callback + +* PPP_MAXIDLEFLAG is now in ms instead of jiffies diff --git a/src/include/lwip/opt.h b/src/include/lwip/opt.h index c5b25725..5aea2d83 100644 --- a/src/include/lwip/opt.h +++ b/src/include/lwip/opt.h @@ -2394,7 +2394,7 @@ #endif /** - * PPP_MAXIDLEFLAG: Max Xmit idle time (in jiffies) before resend flag char. + * PPP_MAXIDLEFLAG: Max Xmit idle time (in ms) before resend flag char. */ #ifndef PPP_MAXIDLEFLAG #define PPP_MAXIDLEFLAG 100 diff --git a/src/netif/ppp/pppos.c b/src/netif/ppp/pppos.c index 95411229..f1d922dd 100644 --- a/src/netif/ppp/pppos.c +++ b/src/netif/ppp/pppos.c @@ -215,7 +215,7 @@ pppos_write(ppp_pcb *ppp, void *ctx, struct pbuf *p) /* If the link has been idle, we'll send a fresh flag character to * flush any noise. */ err = ERR_OK; - if ((sys_jiffies() - pppos->last_xmit) >= PPP_MAXIDLEFLAG) { + if ((sys_now() - pppos->last_xmit) >= PPP_MAXIDLEFLAG) { err = pppos_output_append(pppos, err, nb, PPP_FLAG, 0, NULL); } @@ -260,7 +260,7 @@ pppos_netif_output(ppp_pcb *ppp, void *ctx, struct pbuf *pb, u16_t protocol) /* If the link has been idle, we'll send a fresh flag character to * flush any noise. */ err = ERR_OK; - if ((sys_jiffies() - pppos->last_xmit) >= PPP_MAXIDLEFLAG) { + if ((sys_now() - pppos->last_xmit) >= PPP_MAXIDLEFLAG) { err = pppos_output_append(pppos, err, nb, PPP_FLAG, 0, NULL); } @@ -879,7 +879,7 @@ pppos_output_last(pppos_pcb *pppos, err_t err, struct pbuf *nb, u16_t *fcs) } } - pppos->last_xmit = sys_jiffies(); + pppos->last_xmit = sys_now(); MIB2_STATS_NETIF_ADD(ppp->netif, ifoutoctets, nb->tot_len); MIB2_STATS_NETIF_INC(ppp->netif, ifoutucastpkts); LINK_STATS_INC(link.xmit);