> -----Original Message-----
> From: David Brownell [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 07, 2003 8:13 AM
> To: Christopher Li
> Cc: 'Oliver Neukum '; [EMAIL PROTECTED]
> Subject: Re: [linux-usb-devel] usbdevfs setup URB buffer size limit
> 
> 
> Christopher Li wrote:
> > 
> > Here is the update version of the patch.
> 
> Looks better ... except that I remembered there's another case
> to worry about.  For short reads, consider:
> The donelist handling would need to handle that; it's
> got code to skip the rest of a bulk/intr data stage,
> but not code to make sure the control status packet is
> still queued.

I think you are talking about 2.5 kernel. I can't find it
in 2.4 kernel. My patch was against the 2.4 kernel.

I try some experiment on 2.4 kernel about this.
It seems that if I issue a bigger data buffer, (a get descriptor
with 8 byte extra data). The it got time out error before the
TD show up in done list. So that urb end up being unlinked
from the list instead of running the cancel-the-rest-data-TD code.

I try change TD_R flag and it did not help.

I print out it's status, there is no error at the pending TD.
CBP is not zero either.

Looks like this ohci short packet stuff is very tricky.

Is it possible to apply the patch for usbdevfs separately?
If we don't aim for more than one data TD, we can still make
that scanner work. The check for buffer size will become:

uurb.buffer_length > PAGE_SIZE + 8

Because there is 8 bytes of setup stage should not count in
the data buffer. In this case, we support up to exactly
one page of data buffer.

Any comment? It have gone that far, I really like to make this
scanner work.

Thanks,

Chris

> 
> - Dave
> 
> 
> > ===== devio.c 1.9 vs edited =====
> > --- 1.9/drivers/usb/devio.c Thu Apr 18 05:34:31 2002
> > +++ edited/devio.c  Wed Feb  5 07:15:23 2003
> > @@ -800,7 +800,7 @@
> >                             return -EINVAL;
> >             }
> >             /* min 8 byte setup packet, max arbitrary */
> > -           if (uurb.buffer_length < 8 || 
> uurb.buffer_length > PAGE_SIZE)
> > +           if (uurb.buffer_length < 8 || 
> (uurb.buffer_length >> 16))
> >                     return -EINVAL;
> >             if (!(dr = kmalloc(sizeof(devrequest), GFP_KERNEL)))
> >                     return -ENOMEM;
> > ===== usb-ohci.c 1.23 vs edited =====
> > --- 1.23/drivers/usb/usb-ohci.c     Tue Apr 30 22:58:55 2002
> > +++ edited/usb-ohci.c       Thu Feb  6 13:32:23 2003
> > @@ -1419,12 +1419,14 @@
> >                                     urb->setup_packet, 8,
> >                                     PCI_DMA_TODEVICE),
> >                             8, urb, cnt++); 
> > -                   if (data_len > 0) {  
> > -                           info = usb_pipeout (urb->pipe)? 
> > -                                   TD_CC | TD_R | 
> TD_DP_OUT | TD_T_DATA1 : TD_CC | TD_R | TD_DP_IN | TD_T_DATA1;
> > -                           /* NOTE:  mishandles transfers 
> >8K, some >4K */
> > -                           td_fill (ohci, info, data, 
> data_len, urb, cnt++);  
> > -                   } 
> > +                   info = usb_pipeout (urb->pipe)? (TD_CC 
> | TD_R | TD_DP_OUT)
> > +                                                 : (TD_CC 
> | TD_R | TD_DP_IN);
> > +                   while(data_len > 0) {
> > +                           int td_size = min(4096, 
> data_len);            
> > +                           td_fill (ohci, info|(cnt==1? 
> TD_T_DATA1:TD_T_TOGGLE),
> > +                                    data, td_size, urb, cnt);
> > +                           data += td_size; data_len -= 
> td_size; cnt++;
> > +                   }
> >                     info = usb_pipeout (urb->pipe)? 
> >                             TD_CC | TD_DP_IN | TD_T_DATA1: 
> TD_CC | TD_DP_OUT | TD_T_DATA1;
> >                     td_fill (ohci, info, data, 0, urb, cnt++);
> > 
> > 
> 
> 
> 
> 
> 



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to