On Thu, 17 Jun 2004, David Brownell wrote:

> > I'll submit patches to fix this for all three incarnations of 
> > g_file_storage (2.4, 2.6, and gadget-2.4).
> 
> Or just for gadget-2.4 and I'll submit patches to Marcelo
> by early next week, teaching 2.4 about the newer APIs.

You asked for it, you got it...

This patch for the gadget-2.4 tree fixes a couple of places where
g_file_storage is lacking some byte-swapping function calls.

Alan Stern



Signed-off-by: Alan Stern <[EMAIL PROTECTED]>

--- gadget-2.4/drivers/usb/gadget/file_storage.c        Thu Jun 17 14:58:47 2004
+++ gadget-2.4/drivers/usb/gadget/file_storage.c        Thu Jun 17 14:59:31 2004
@@ -2486,7 +2486,7 @@
                /* Store and send the Bulk-only CSW */
                csw->Signature = __constant_cpu_to_le32(USB_BULK_CS_SIG);
                csw->Tag = fsg->tag;
-               csw->Residue = fsg->residue;
+               csw->Residue = cpu_to_le32(fsg->residue);
                csw->Status = status;
 
                bh->inreq->length = USB_BULK_CS_WRAP_LEN;
@@ -2932,7 +2932,7 @@
                fsg->data_dir = DATA_DIR_TO_HOST;
        else
                fsg->data_dir = DATA_DIR_FROM_HOST;
-       fsg->data_size = cbw->DataTransferLength;
+       fsg->data_size = le32_to_cpu(cbw->DataTransferLength);
        if (fsg->data_size == 0)
                fsg->data_dir = DATA_DIR_NONE;
        fsg->lun = cbw->Lun;



-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to