On Thu, 11 Apr 2002, Tim Woodall wrote:
> On Thu, 11 Apr 2002, Alex Bennee wrote:
>
> > Tim Woodall said:
> > > On Tue, 9 Apr 2002, Tim Woodall wrote:
> > > The hdlc conversion will
> > > double the size of the packet for 0xff which will (presumably) be done
> > > by the kernel. Perhaps if I put the hdlc conversion code in pppoa3 it
> > > might help?
> >
> > Are you sure? I thought HDLC stuffed an extra 0 for every 5 1's, that won't
> > double the size of your frame, only increase it by 1/5th.
> >
> I must admit I haven't looked at it in detail but, in some respects, that
> sounds even worse as it will require more processing power to do it.
>
Been looking at the rp-pppoe code. It was the async stuff I was thinking of.
Interestingly, in the rp-pppoe code, one of the suggestions it makes for
slow machines is to use async instead of sync. So I might stea^H^H^H^Hadapt
the code from rp to see if it makes any difference.
I also found the following: (Shamelessly cribbed from rp-pppoe.c :-)
[tim@pauli /home/tim/cvs/speedtouch/src]$ cvs diff pppoa3.c | more
Index: pppoa3.c
===================================================================
RCS file: /cvsroot/speedtouch/speedtouch/src/pppoa3.c,v
retrieving revision 1.20
diff -u -r1.20 pppoa3.c
--- pppoa3.c 20 Mar 2002 09:26:46 -0000 1.20
+++ pppoa3.c 11 Apr 2002 12:22:38 -0000
@@ -491,12 +491,23 @@
if(isatty(STDIN_FILENO)) {
#ifdef N_HDLC
int disc = N_HDLC;
+ long flags;
if(ioctl(STDIN_FILENO, TIOCSETD, &disc) < 0) {
report(0, REPORT_ERROR|REPORT_DATE, "Error loading N_HDLC\n");
return(-1);
}
report(2, REPORT_DEBUG|REPORT_DATE, "N_HDLC line set up\n");
+ /* There is a bug in Linux's select which returns a descriptor
+ * as readable if N_HDLC line discipline is on, even if
+ * it isn't really readable. This return happens only when
+ * select() times out. To avoid blocking forever in read(),
+ * make descriptor 0 non-blocking */
+ flags = fcntl(STDIN_FILENO, F_GETFL);
+ if (flags < 0 || fcntl(STDIN_FILENO, F_SETFL, (long) flags |
+O_NONBLOCK) < 0) {
+ report(STDIN_FILENO, REPORT_DEBUG|REPORT_DATE, "Error setting
+NONBLOCK for stdin\n");
+ return(-1);
+ }
#elif defined TTYDISC
int disc = TTYDISC;
@@ -787,6 +798,7 @@
/* Reads 64*53 bytes from usb */
do {
+// usleep(900);
n = pusb_endpoint_read(ep_data, lbuf, sizeof(lbuf), 0);
} while (n < 0 && (errno == EINTR || errno == ETIMEDOUT));
@@ -826,6 +838,7 @@
/* Writes the result buffer */
if(ppp_write(STDOUT_FILENO, ppp_write_buf, n +
HDLC_HEADER_SIZE) > 0)
report(2, REPORT_DEBUG|REPORT_DATE, "Extracted
PPP packet sent to ppp(d)\n\n");
+// usleep(100);
}
@@ -1076,7 +1089,7 @@
do {
r = read(fd, buffer, size);
- } while(r < 0 && errno == EINTR);
+ } while(r < 0 && (errno == EINTR || errno == EAGAIN));
if(r < 0) {
report(0, REPORT_ERROR|REPORT_DATE|REPORT_PERROR, "Error
reading from pppd\n");
This didn't fix my problems but ... :-)
Regards,
Tim.
--
God said, "div D = rho, div B = 0, curl E = - @B/@t, curl H = J + @D/@t,"
and there was light.
http://tjw.hn.org/ http://www.locofungus.btinternet.co.uk/
Liste de diffusion modem ALCATEL SpeedTouch USB
Pour se d�sinscrire : mailto:[EMAIL PROTECTED]?subject=unsubscribe