diff -r -u5 -N -x CVS -x '*~' -x '.#*' clean/ecos/packages/net/ppp/current/ChangeLog devo/ecos/packages/net/ppp/current/ChangeLog --- clean/ecos/packages/net/ppp/current/ChangeLog 2004-04-30 09:03:45.873750000 +0100 +++ devo/ecos/packages/net/ppp/current/ChangeLog 2004-05-06 14:04:18.023750000 +0100 @@ -1,5 +1,14 @@ +2004-04-15 Mark Retallack + + * src/ppp_io.c: + * src/sys-ecos.c: + * src/ppp_io.h: + The wait_input function sometimes blocked even if a packet was + available for processing. Now checks the tty queue and then the + serial driver before blocking. + 2004-04-15 Oyvind Harboe * src/chat.c: Script now returns success when it runs to completion 2004-03-31 John Dallaway diff -r -u5 -N -x CVS -x '*~' -x '.#*' clean/ecos/packages/net/ppp/current/include/ppp_io.h devo/ecos/packages/net/ppp/current/include/ppp_io.h --- clean/ecos/packages/net/ppp/current/include/ppp_io.h 2004-04-30 09:03:47.295625000 +0100 +++ devo/ecos/packages/net/ppp/current/include/ppp_io.h 2004-05-06 14:00:06.820625000 +0100 @@ -144,10 +144,12 @@ extern int cyg_ppp_pppread __P((struct tty *tp, struct uio *uio, int flag)); extern int cyg_ppp_pppclose __P((struct tty *tp, int flag)); +extern int cyg_ppp_pppcheck __P((struct tty *tp)); + // ==================================================================== // Start PPP transmission. This is called from the TX thread to cause // any pending packets to be sent. extern int cyg_ppp_pppstart __P((struct tty *tp)); diff -r -u5 -N -x CVS -x '*~' -x '.#*' clean/ecos/packages/net/ppp/current/src/ppp_io.c devo/ecos/packages/net/ppp/current/src/ppp_io.c --- clean/ecos/packages/net/ppp/current/src/ppp_io.c 2004-04-30 09:03:50.905000000 +0100 +++ devo/ecos/packages/net/ppp/current/src/ppp_io.c 2004-05-06 14:00:09.008125000 +0100 @@ -289,10 +289,49 @@ register struct ppp_softc *sc; { db_printf("%s called\n", __PRETTY_FUNCTION__); } + + +//========================================================================== +/* + * function to check if data is available + */ + +int +cyg_ppp_pppcheck(tp) + register struct tty *tp; +{ + register struct ppp_softc *sc = (struct ppp_softc *)tp->t_sc; + int status = 0; + register int s; + + s = spltty(); + + if (tp != (struct tty *) sc->sc_devp ) { + splx(s); + return 0; + } + if (sc->sc_inq.ifq_head == NULL) + { + splx(s); + return 0; + } + + // if the queue is not empty + if ( IF_IS_EMPTY(&sc->sc_inq) == false) + { + status = 1; + } + + splx(s); + + return(status); +} + + //========================================================================== /* * Line specific (tty) read routine. * called at zero spl from the device driver in the response to user-level * reads on the tty file descriptor (ie: pppd). diff -r -u5 -N -x CVS -x '*~' -x '.#*' clean/ecos/packages/net/ppp/current/src/sys-ecos.c devo/ecos/packages/net/ppp/current/src/sys-ecos.c --- clean/ecos/packages/net/ppp/current/src/sys-ecos.c 2004-04-30 09:03:51.358125000 +0100 +++ devo/ecos/packages/net/ppp/current/src/sys-ecos.c 2004-05-06 14:00:09.367500000 +0100 @@ -591,10 +591,13 @@ */ void wait_input(timo) struct timeval *timo; { + if (cyg_ppp_pppcheck(&ppp_tty) == 0) + { + if( timo != NULL ) { cyg_tick_count_t trigger = timo->tv_sec*ppp_rtc_resolution.divisor; // If the timeval has a microseconds value, just add another @@ -680,10 +683,11 @@ ppp_tty.pppd_wakeup = 0; break; } } } +} //========================================================================== /* * wait_time - wait for a given length of time or until a * signal is received.