On Sat, 7 May 2005, David Brownell wrote: > This patch updates the gadget drivers so they expect the > SETUP packet data in USB byteorder, not CPU byteorder. > It also updates the <linux/usb_gadget.h> header and the > dummy_hcd driver. > > Why the change? To match the host side's usage, and so > that "sparse" diagnostics will truthfully report bugs. > > Any USB device/peripheral controller drivers that aren't > merged into kernel.org _and_ run on big-endian hardware > will need updating. Most of them seem to use little-endian > hardware, so the main risks here were for the two PCI based > drivers (net2280 and goku) ... updated in the next patches.
> --- x.orig/drivers/usb/gadget/dummy_hcd.c 2005-05-07 08:51:27.000000000 > -0700 > +++ x/drivers/usb/gadget/dummy_hcd.c 2005-05-07 11:27:06.000000000 -0700 > @@ -1267,9 +1267,6 @@ > struct dummy_ep *ep2; > > setup = *(struct usb_ctrlrequest*) urb->setup_packet; > - le16_to_cpus (&setup.wIndex); > - le16_to_cpus (&setup.wValue); > - le16_to_cpus (&setup.wLength); > if (setup.wLength != urb->transfer_buffer_length) { > maybe_set_status (urb, -EOVERFLOW); > goto return_urb; This part of the update is clearly inadequate, since the code goes on to use setup.wIndex, setup.wValue, and setup.wLength. In fact setup.wLength is used in the very next line after the deleted section! Greg, if you want to go ahead an apply the patch anyway, I'll send a separate patch in a few days to fix this up. Alan Stern ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel