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)

> 
> +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?

 
> --- 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?

Alex.



Liste de diffusion modem ALCATEL SpeedTouch USB
Pour se d�sinscrire : mailto:[EMAIL PROTECTED]?subject=unsubscribe

        

Reply via email to