The 2k figure comes from the maximum size you can represent in
the wMaxPacketSize field of an isochronous endpoint descriptor.
Admittedly, this isn't really correct in either of the cases I
can picture. If usbfs really does need to verify that packets
are correct as per the spec, it should be checking this against
the endpoint's maximum packet size. If usbfs' job is just to
sanity check the sizes to prevent memory allocation issues,
this number could be much larger and much more arbitrary.
I would argue that usbfs shouldn't be strictly verifying URBs
against the spec- it should just provide enough protection to
keep a userspace process from making the machine or the host
controller unstable. Ignoring the implementation and aesthetic
issues, I have two practical arguments:
1. usbfs seems to be the last thing to be updated when new
specifications are released. Current usbfs code still doesn't
allow full USB 2 high-speed support- how long will it take
to make sure its arbitrary limits are clean for WUSB?
2. More importantly, validating URBs against the spec only helps
if your USB devices conform to the spec. Sadly, there are a
huge amount of devices out there that are broken to varying
degrees. We have at least one device that attempts to transfer
packets larger than its wMaxPacketSize. Should it be the
kernel's job to make these devices impossible to support?
Thanks,,
--Micah
David Brownell wrote:
On Friday 27 January 2006 2:19 pm, Micah Dowty wrote:
The usbfs code path for submitting Isochronous URBs still limits
each packet to 1k. This may have been appropriate for USB 1.1, but
high-speed devices sending multiple physical packets per microframe
may require a much larger "packet" size. This increases the limit
to 6144, sufficient for three 2k packets per microframe.
But the USB limit is that each ISO endpoint may only
have at most three 1KB packets ... and even that, only
for high speed devices in a releant altsetting.
So this patch is incorrect.
Signed-off-by: Micah Dowty <[EMAIL PROTECTED]>
--- .pc/usbiso-1k-limit/drivers/usb/core/devio.c 2006-01-27
14:03:56.000000000 -0800
+++ drivers/usb/core/devio.c 2006-01-27 14:03:58.000000000 -0800
@@ -928,7 +928,11 @@
return -EFAULT;
}
for (totlen = u = 0; u < uurb->number_of_packets; u++) {
- if (isopkt[u].length > 1023) {
+ /*
+ * Must be big enough for the largest possible packet
with mult=2,
+ * in order to support high-bandwidth USB2 modes.
+ */
+ if (isopkt[u].length > 6144) {
kfree(isopkt);
return -EINVAL;
}
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel