提交 dfe1a51d 编写于 作者: Y Yoshihiro Shimoda 提交者: Felipe Balbi

usb: gadget: udc: renesas_usb3: fix maxpacket size of ep0

This patch fixes an issue that maxpacket size of ep0 is incorrect
for SuperSpeed. Otherwise, CDC NCM class with SuperSpeed doesn't
work correctly on this driver because its control read data size
is more than 64 bytes.
Reported-by: NJunki Kato <junki.kato.xk@renesas.com>
Fixes: 746bfe63 ("usb: gadget: renesas_usb3: add support for Renesas USB3.0 peripheral controller")
Cc: <stable@vger.kernel.org> # v4.5+
Signed-off-by: NYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tested-by: NJunki Kato <junki.kato.xk@renesas.com>
Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
上级 c37bd528
...@@ -812,12 +812,15 @@ static void usb3_irq_epc_int_1_speed(struct renesas_usb3 *usb3) ...@@ -812,12 +812,15 @@ static void usb3_irq_epc_int_1_speed(struct renesas_usb3 *usb3)
switch (speed) { switch (speed) {
case USB_STA_SPEED_SS: case USB_STA_SPEED_SS:
usb3->gadget.speed = USB_SPEED_SUPER; usb3->gadget.speed = USB_SPEED_SUPER;
usb3->gadget.ep0->maxpacket = USB3_EP0_SS_MAX_PACKET_SIZE;
break; break;
case USB_STA_SPEED_HS: case USB_STA_SPEED_HS:
usb3->gadget.speed = USB_SPEED_HIGH; usb3->gadget.speed = USB_SPEED_HIGH;
usb3->gadget.ep0->maxpacket = USB3_EP0_HSFS_MAX_PACKET_SIZE;
break; break;
case USB_STA_SPEED_FS: case USB_STA_SPEED_FS:
usb3->gadget.speed = USB_SPEED_FULL; usb3->gadget.speed = USB_SPEED_FULL;
usb3->gadget.ep0->maxpacket = USB3_EP0_HSFS_MAX_PACKET_SIZE;
break; break;
default: default:
usb3->gadget.speed = USB_SPEED_UNKNOWN; usb3->gadget.speed = USB_SPEED_UNKNOWN;
...@@ -2513,7 +2516,7 @@ static int renesas_usb3_init_ep(struct renesas_usb3 *usb3, struct device *dev, ...@@ -2513,7 +2516,7 @@ static int renesas_usb3_init_ep(struct renesas_usb3 *usb3, struct device *dev,
/* for control pipe */ /* for control pipe */
usb3->gadget.ep0 = &usb3_ep->ep; usb3->gadget.ep0 = &usb3_ep->ep;
usb_ep_set_maxpacket_limit(&usb3_ep->ep, usb_ep_set_maxpacket_limit(&usb3_ep->ep,
USB3_EP0_HSFS_MAX_PACKET_SIZE); USB3_EP0_SS_MAX_PACKET_SIZE);
usb3_ep->ep.caps.type_control = true; usb3_ep->ep.caps.type_control = true;
usb3_ep->ep.caps.dir_in = true; usb3_ep->ep.caps.dir_in = true;
usb3_ep->ep.caps.dir_out = true; usb3_ep->ep.caps.dir_out = true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册