ChangeSet 1.1867.3.10, 2004/09/14 12:00:01-07:00, [EMAIL PROTECTED]

[PATCH] USB: Descriptor listing bugfix for g_file_storage

This patch repairs a mistake I made when adding OTG support to the
file-storage gadget.  All the descriptor entries were bumped up by one,
which caused a problem during initialization.


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


 drivers/usb/gadget/file_storage.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)


diff -Nru a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
--- a/drivers/usb/gadget/file_storage.c 2004-10-19 08:13:37 -07:00
+++ b/drivers/usb/gadget/file_storage.c 2004-10-19 08:13:37 -07:00
@@ -929,6 +929,7 @@
        (struct usb_descriptor_header *) &fs_intr_in_desc,
        NULL,
 };
+#define FS_FUNCTION_PRE_EP_ENTRIES     2
 
 
 #ifdef CONFIG_USB_GADGET_DUALSPEED
@@ -992,6 +993,7 @@
        (struct usb_descriptor_header *) &hs_intr_in_desc,
        NULL,
 };
+#define HS_FUNCTION_PRE_EP_ENTRIES     2
 
 /* Maxpacket and other transfer characteristics vary by speed. */
 #define ep_desc(g,fs,hs)       (((g)->speed==USB_SPEED_HIGH) ? (hs) : (fs))
@@ -3899,10 +3901,10 @@
        intf_desc.bNumEndpoints = i;
        intf_desc.bInterfaceSubClass = mod_data.protocol_type;
        intf_desc.bInterfaceProtocol = mod_data.transport_type;
-       fs_function[i+1] = NULL;
+       fs_function[i + FS_FUNCTION_PRE_EP_ENTRIES] = NULL;
 
 #ifdef CONFIG_USB_GADGET_DUALSPEED
-       hs_function[i+1] = NULL;
+       hs_function[i + HS_FUNCTION_PRE_EP_ENTRIES] = NULL;
 
        /* Assume ep0 uses the same maxpacket value for both speeds */
        dev_qualifier.bMaxPacketSize0 = fsg->ep0->maxpacket;



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to