Greg:

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.

Please apply.

Alan Stern



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

===== drivers/usb/gadget/file_storage.c 1.20 vs edited =====
--- 1.20/drivers/usb/gadget/file_storage.c      Wed Sep  8 18:48:01 2004
+++ edited/drivers/usb/gadget/file_storage.c    Mon Sep 13 17:02:54 2004
@@ -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: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM. 
Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to