aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/epautoconf.c
diff options
context:
space:
mode:
authorJassi Brar <jassi.brar@samsung.com>2011-01-13 21:55:53 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-02-04 14:42:52 -0500
commit553fbcde3481c98a076c9744a59ad08dbc61c099 (patch)
treef41887180fc77353c29eeca95bb4b79b9a153e2f /drivers/usb/gadget/epautoconf.c
parent7af75af2424c3a866041e7981d91f01f93235533 (diff)
USB: Gadget: Initialize wMaxPacketSize if not already set
Currently, for ISO and INT, a protocol driver must chose the value for wMaxPacketSize arbitrarily. The value may be too low, resulting in lesser than efficient operation or high enough to not work with all UDC drivers. Take un-initialized wMaxPacketSize as a hint to provide maximum possible packetsize for the selected endpoint. The protocol may then choose a value not bigger than that. Signed-off-by: Jassi Brar <jassi.brar@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/epautoconf.c')
-rw-r--r--drivers/usb/gadget/epautoconf.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index 8a832488ccdd..9b7360ff5aa7 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -128,6 +128,13 @@ ep_matches (
128 } 128 }
129 } 129 }
130 130
131 /*
132 * If the protocol driver hasn't yet decided on wMaxPacketSize
133 * and wants to know the maximum possible, provide the info.
134 */
135 if (desc->wMaxPacketSize == 0)
136 desc->wMaxPacketSize = cpu_to_le16(ep->maxpacket);
137
131 /* endpoint maxpacket size is an input parameter, except for bulk 138 /* endpoint maxpacket size is an input parameter, except for bulk
132 * where it's an output parameter representing the full speed limit. 139 * where it's an output parameter representing the full speed limit.
133 * the usb spec fixes high speed bulk maxpacket at 512 bytes. 140 * the usb spec fixes high speed bulk maxpacket at 512 bytes.