On 9 Sep 2001, alex wrote:
>
> comments on patch follow
> >
> >
> > --- pppoa3.orig/pusb-linux.c Thu Aug 16 23:50:27 2001
> > +++ pppoa3/pusb-linux.c Sun Sep 9 00:37:54 2001
> > @@ -306,17 +306,38 @@
> > if (ret < 0)
> > return ret;
> >
> > -/*if (purb != &urb)
> > - printf("purb=%p, &urb=%p\n",purb,&urb);
> > -*/
> > -
> > -/* if (purb->buffer != buf)
> > - printf("purb->buffer=%p, buf=%p\n",purb->buffer,buf);
> > -*/
> > -
> > return purb->actual_length;
> > }
>
> Should realy use report instead of printf. Report does log stuff
> (although as I mentioned it still breaks my machine)
:-)
This crept in from my original hacking. I hadn't realised I had left that
in but this bit of the patch is just removing some comments that were
cluttering up my screen.
As far as logging goes. It breaks my machine as well unless this patch is
installed.
>
> >
> > +int pusb_endpoint_read_timeout(int fd,int ep,const unsigned char * buf,int
>size,int timeout)
> > +{
> > + struct usbdevfs_bulktransfer bulk;
> > + int ret, received = 0;
> > +
> > + bulk.ep = ep;
> > + bulk.len = size;
> > + if (bulk.len > PAGE_SIZE)
> > + bulk.len = PAGE_SIZE;
> > + bulk.timeout = timeout;
> > + bulk.data = (unsigned char*)buf;
> > +
> > + do
> > + {
> > + ret = ioctl(fd,USBDEVFS_BULK,&bulk);
> > + }
> > + while (ret < 0 && errno == EINTR);
> > +
> > + if (ret < 0)
> > + return ret;
> > +
> > + buf += ret;
> > + size -= ret;
> > +
> > + received += ret;
> > +
> > + return received;
> > +}
> > +
> > int pusb_endpoint_rw(int fd,int ep,const unsigned char * buf,int size,int timeout)
> > {
> > struct usbdevfs_bulktransfer bulk;
> > @@ -362,7 +383,8 @@
> > unsigned char *buf, int size, int timeout)
> > {
> > if (timeout == 0)
> > - return pusb_endpoint_rw_no_timeout(ep->fd,ep->ep|USB_DIR_IN,buf,size);
> > + return pusb_endpoint_read_timeout(ep->fd,ep->ep|USB_DIR_IN,buf,size,30000);
> > +/* return
>pusb_endpoint_rw_no_timeout(ep->fd,ep->ep|USB_DIR_IN,buf,size);*/
> > return pusb_endpoint_rw(ep->fd,ep->ep|USB_DIR_IN,buf,size,timeout);
> > }
>
> Looks ok. Does the USB timeout that often? Does what calls
> pusb_enpoint_rw handle - results ok?
>
At the moment it is set to 30 seconds (I think) because I wasn't sure how
large I could make it and I assumed that 15 bits would work. It did and I
haven't investigated further yet. Hopefully I can set it to 2,000,000
seconds.
It never times out unless you have an idle connection for 30 seconds. The
original code is hanging in the REAP ioctl and I don't know why :-(
>
> > --- pppoa3.orig/pppoa3.c Sun Sep 9 00:51:47 2001
> > +++ pppoa3/pppoa3.c Sun Sep 9 00:53:58 2001
> > @@ -451,12 +451,14 @@
> > unsigned char *unused_cells;
> >
> > /* Reads 64*53 bytes from usb */
> > - n = pusb_endpoint_read(ep_data, lbuf, sizeof(lbuf), 0);
> > + do {
> > + n = pusb_endpoint_read(ep_data, lbuf, sizeof(lbuf), 0);
> >
> > - if(n < 0) {
> > - report(0, REPORT_DATE|REPORT_PERROR, "Error reading usb
>urb\n");
> > - break;
> > - }
> > +/* if(n < 0) {
> > + report(0, REPORT_PERROR, "Error reading usb urb (timeout?)\n");
> > + }
> > +*/
> > + } while(n<0);
> >
> > /* Debug information */
> > report(2, REPORT_DATE|REPORT_DUMP, "ATM cells read from USB (%d bytes
>long)\n", lbuf, n, n);
> >
> >
>
> Ok I guess, how often does it occur, is it valid to handle a partial set
> of cells?
>
Handling a partial set of cells is ok. What I'm not absolutely sure about is
whether a partial cell is ok. I don't think it is but we never actually
attempt to read PAGE_SIZE bytes from the usb and so we can never get a
partial cell.
Thanks for the feedback.
Tim.
--
God said, "div D = rho, div B = 0, curl E = - @B/@t, curl H = J + @D/@t,"
and there was light.
http://locofungus.2y.net/ http://www.locofungus.btinternet.co.uk/
Liste de diffusion modem ALCATEL SpeedTouch USB
Pour se d�sinscrire : mailto:[EMAIL PROTECTED]?subject=unsubscribe