aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/net2272.c
diff options
context:
space:
mode:
authorRobert Baldyga <r.baldyga@samsung.com>2013-12-13 06:23:38 -0500
committerFelipe Balbi <balbi@ti.com>2013-12-17 14:17:41 -0500
commite117e742d310683b410951faeab4b13b6c3c609f (patch)
treea1f4eecfd74b5b80adb034acf11d102490d0e6d9 /drivers/usb/gadget/net2272.c
parentf8800d47bcdf5ae0582ac674657fd939a9105be0 (diff)
usb: gadget: add "maxpacket_limit" field to struct usb_ep
This patch adds "maxpacket_limit" to struct usb_ep. This field contains maximum value of maxpacket supported by driver, and is set in driver probe. This value should be used by autoconfig() function, because value of field "maxpacket" is set to value from endpoint descriptor when endpoint becomes enabled. So when autoconfig() function will be called again for this endpoint, "maxpacket" value will contain wMaxPacketSize from descriptior instead of maximum packet size for this endpoint. For this reason this patch adds new field "maxpacket_limit" which contains value of maximum packet size (which defines maximum endpoint capabilities). This value is used in ep_matches() function used by autoconfig(). Value of "maxpacket_limit" should be set in UDC driver probe function, using usb_ep_set_maxpacket_limit() function, defined in gadget.h. This function set choosen value to both "maxpacket_limit" and "maxpacket" fields. This patch modifies UDC drivers by adding support for maxpacket_limit. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/net2272.c')
-rw-r--r--drivers/usb/gadget/net2272.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/gadget/net2272.c b/drivers/usb/gadget/net2272.c
index bf2bb39f35a2..ca15405583e2 100644
--- a/drivers/usb/gadget/net2272.c
+++ b/drivers/usb/gadget/net2272.c
@@ -266,7 +266,7 @@ static void net2272_ep_reset(struct net2272_ep *ep)
266 ep->desc = NULL; 266 ep->desc = NULL;
267 INIT_LIST_HEAD(&ep->queue); 267 INIT_LIST_HEAD(&ep->queue);
268 268
269 ep->ep.maxpacket = ~0; 269 usb_ep_set_maxpacket_limit(&ep->ep, ~0);
270 ep->ep.ops = &net2272_ep_ops; 270 ep->ep.ops = &net2272_ep_ops;
271 271
272 /* disable irqs, endpoint */ 272 /* disable irqs, endpoint */
@@ -1409,7 +1409,7 @@ net2272_usb_reinit(struct net2272 *dev)
1409 ep->fifo_size = 64; 1409 ep->fifo_size = 64;
1410 net2272_ep_reset(ep); 1410 net2272_ep_reset(ep);
1411 } 1411 }
1412 dev->ep[0].ep.maxpacket = 64; 1412 usb_ep_set_maxpacket_limit(&dev->ep[0].ep, 64);
1413 1413
1414 dev->gadget.ep0 = &dev->ep[0].ep; 1414 dev->gadget.ep0 = &dev->ep[0].ep;
1415 dev->ep[0].stopped = 0; 1415 dev->ep[0].stopped = 0;