I test my patch on an ohci box and find a bug. The last status
stage is always use DATA1?
This patch seems works so far. The previous one is broken.
Any comment are welcome.
Thanks
Chris
===== 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 Wed Feb 5 08:10:34 2003
@@ -1419,12 +1419,13 @@
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_T_TOGGLE)
+ : (TD_CC | TD_R | TD_DP_IN |
+TD_T_TOGGLE);
+ while(data_len > 0) {
+ int td_size = min(4096, data_len);
+ td_fill (ohci, info, 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++);
On Wed, Feb 05, 2003 at 12:37:18PM -0800, David Brownell wrote:
> >From usb-ohci.c:
> >
> >case PIPE_CONTROL: /* 1 TD for setup, 1 for ACK and 1 for every 4096 B */
> > size = (urb->transfer_buffer_length == 0)? 2:
> > (urb->transfer_buffer_length - 1) / 4096 + 3;
> > break;
> >
> >Then it will allocate "size" number of TDs.
> >
> >Do I miss anything?
>
> Look at td_submit_urb() where it only _uses_ the first one;
> you'd have to manually track the data toggle inside longer
> control DATA segments, too. The relevant line has a NOTE.
>
>
-------------------------------------------------------
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