From ea0bdf2d547dd1ade20880d8e3d39ee0f77fe212 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Mon, 16 Feb 2015 17:00:59 +0100 Subject: libpayload: Add zero length packet support to UDC framework Some IN transfers must be terminated by an empty packet because otherwise the host wouldn't know. The zlp() function determines this requirement in accordance to USB rules: If the transfer's size is aligned to the maximum packet size, and the host expects a larger transfer, add the empty packet as a hint. BRANCH=none BUG=none TEST=USB device mode still works Change-Id: Ia69f3d017f72a3a0e0b21bac72fe97be184c7daa Signed-off-by: Patrick Georgi Original-Commit-Id: fd0e946e4948a74a9ed15a5eed6ce827b7672a56 Original-Change-Id: I8153cc5bd2ff1c88e383c1dbcddaf1bf72f9194c Original-Signed-off-by: Patrick Georgi Original-Reviewed-on: https://chromium-review.googlesource.com/250790 Original-Reviewed-by: Furquan Shaikh Reviewed-on: http://review.coreboot.org/9784 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- payloads/libpayload/include/udc/udc.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'payloads/libpayload/include') diff --git a/payloads/libpayload/include/udc/udc.h b/payloads/libpayload/include/udc/udc.h index 48e73f4c56..7987c51286 100644 --- a/payloads/libpayload/include/udc/udc.h +++ b/payloads/libpayload/include/udc/udc.h @@ -80,6 +80,7 @@ struct usbdev_ctrl { int remote_wakeup; struct usbdev_configuration *current_config; + struct usbdev_interface *current_iface; int current_config_id; struct configuration_list configs; @@ -87,6 +88,7 @@ struct usbdev_ctrl { device_descriptor_t device_descriptor; int ep_halted[16][2]; + int ep_mps[16][2]; /** returns 0 if an error occurred */ int (*poll)(struct usbdev_ctrl *); -- cgit v1.2.3