aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/epautoconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/epautoconf.c')
-rw-r--r--drivers/usb/gadget/epautoconf.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index a777f7bd11b4..0567cca1465e 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -11,7 +11,6 @@
11 11
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/init.h>
15#include <linux/types.h> 14#include <linux/types.h>
16#include <linux/device.h> 15#include <linux/device.h>
17 16
@@ -58,7 +57,7 @@ ep_matches (
58 return 0; 57 return 0;
59 58
60 /* only support ep0 for portable CONTROL traffic */ 59 /* only support ep0 for portable CONTROL traffic */
61 type = desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK; 60 type = usb_endpoint_type(desc);
62 if (USB_ENDPOINT_XFER_CONTROL == type) 61 if (USB_ENDPOINT_XFER_CONTROL == type)
63 return 0; 62 return 0;
64 63
@@ -129,7 +128,7 @@ ep_matches (
129 * and wants to know the maximum possible, provide the info. 128 * and wants to know the maximum possible, provide the info.
130 */ 129 */
131 if (desc->wMaxPacketSize == 0) 130 if (desc->wMaxPacketSize == 0)
132 desc->wMaxPacketSize = cpu_to_le16(ep->maxpacket); 131 desc->wMaxPacketSize = cpu_to_le16(ep->maxpacket_limit);
133 132
134 /* endpoint maxpacket size is an input parameter, except for bulk 133 /* endpoint maxpacket size is an input parameter, except for bulk
135 * where it's an output parameter representing the full speed limit. 134 * where it's an output parameter representing the full speed limit.
@@ -145,7 +144,7 @@ ep_matches (
145 144
146 case USB_ENDPOINT_XFER_ISOC: 145 case USB_ENDPOINT_XFER_ISOC:
147 /* ISO: limit 1023 bytes full speed, 1024 high/super speed */ 146 /* ISO: limit 1023 bytes full speed, 1024 high/super speed */
148 if (ep->maxpacket < max) 147 if (ep->maxpacket_limit < max)
149 return 0; 148 return 0;
150 if (!gadget_is_dualspeed(gadget) && max > 1023) 149 if (!gadget_is_dualspeed(gadget) && max > 1023)
151 return 0; 150 return 0;
@@ -178,7 +177,7 @@ ep_matches (
178 177
179 /* report (variable) full speed bulk maxpacket */ 178 /* report (variable) full speed bulk maxpacket */
180 if ((USB_ENDPOINT_XFER_BULK == type) && !ep_comp) { 179 if ((USB_ENDPOINT_XFER_BULK == type) && !ep_comp) {
181 int size = ep->maxpacket; 180 int size = ep->maxpacket_limit;
182 181
183 /* min() doesn't work on bitfields with gcc-3.5 */ 182 /* min() doesn't work on bitfields with gcc-3.5 */
184 if (size > 64) 183 if (size > 64)