Commit 190b5799 authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

[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: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 73c85813
......@@ -929,6 +929,7 @@ static const struct usb_descriptor_header *fs_function[] = {
(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 @@ static const struct usb_descriptor_header *hs_function[] = {
(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 @@ static int __init fsg_bind(struct usb_gadget *gadget)
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment