I won't argue much about this because it's not very important. But there's one small part that ought to go in.
On Fri, 22 Aug 2003, Greg KH wrote: > On Fri, Aug 22, 2003 at 10:42:01AM -0400, Alan Stern wrote: > > > > When a device is not in the CONFIGURED state, it disallows > > transfers to any endpoint other than ep0 (currently the code allows > > transfers to any control endpoint). > > Again, what is this going to help? Improperly written drivers? Well, yes. Quite a lot of usb_submit_urb() is there only to detect invalid requests coming from improperly written drivers. In this case the code already contains a test, but the test is wrong. The patch fixes it. My feeling is that as long as the test is in there, it ought to be correct. And this one isn't a big change: replace "!usb_pipecontrol(pipe)" with "usb_pipeendpoint(pipe) != 0". While I don't _know_ of any USB devices with control endpoints other than endpoint 0, it's certainly a legal thing to do. > > For control transfers, it verifies that the direction given by the > > pipe is the same as the direction indicated in the setup packet (but only > > if the transfer length is > 0). > > Why? Bad drivers? Yeah. Sort of. It's easy to get confused about control transfers since the same endpoint is used for both directions. Maybe there aren't any drivers that make the mistake of using a pipe direction that disagress with the setup packet's direction -- but it wouldn't hurt much to check. I don't mind if this gets left out. > > For isochronous transfers, it verifies that none of the iso. frame > > descriptors refers to an offset that is outside the transfer buffer. It > > also initializes the error_count field to 0 so the HCD doesn't have to. > > Does this save code in the hcd core? The bounds checking doesn't save code; it protects against memory corruption. But that's an unlikely sort of error. The error_count part probably _adds_ about 6 bytes to the usb core while allowing the removal of the same amount from _each_ HC driver. (Actually not from UHCI because UHCI fails to initialize the field correctly!) However, there are good reasons to remove error_count from struct urb entirely. So forget this one. Alan Stern ------------------------------------------------------- This SF.net email is sponsored by: VM Ware With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0 _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
