Patrick Georgi (pgeorgi@google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9790
-gerrit
commit 3ad1267c3fa0f87a85032abbcd5df233714857c7 Author: Patrick Georgi pgeorgi@google.com Date: Tue Mar 10 12:58:55 2015 +0100
libpayload udc: Support legal edge case of GET_CONFIGURATION call
I doubt anybody will ask for the configuration and request that 0 bytes be returned, but AFAICS that's legal, so let's support it.
Should have no effect on ChipIdea since it knows not to send more data than requested by the host.
BRANCH=none BUG=none TEST=none
Change-Id: Ibfe57b593015fa5e0381c45ff9e39c3f912b4d4d Signed-off-by: Patrick Georgi pgeorgi@chromium.org Original-Commit-Id: 45555e929d9d07dbb58ecfd18333f26375a0e3d7 Original-Change-Id: I7432772a1812c6f52c2b1688ee4c6f67d02ccf28 Original-Signed-off-by: Patrick Georgi pgeorgi@chromium.org Original-Reviewed-on: https://chromium-review.googlesource.com/258064 Original-Reviewed-by: Furquan Shaikh furquan@chromium.org --- payloads/libpayload/drivers/udc/udc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/payloads/libpayload/drivers/udc/udc.c b/payloads/libpayload/drivers/udc/udc.c index 23c319b..e01b454 100644 --- a/payloads/libpayload/drivers/udc/udc.c +++ b/payloads/libpayload/drivers/udc/udc.c @@ -168,9 +168,10 @@ static int setup_ep0(struct usbdev_ctrl *this, dev_req_t *dr) res[0] = this->current_config_id;
/* data phase IN */ - this->enqueue_packet(this, 0, 1, res, 1, 0, 1); + this->enqueue_packet(this, 0, 1, res, min(1, dr->wLength), + 0, 1);
- // status phase OUT + /* status phase OUT */ this->enqueue_packet(this, 0, 0, NULL, 0, 0, 0); return 1; } else