diff options
author | Dominic Chen <ddchen@chromium.org> | 2014-07-07 16:22:09 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-07-08 04:28:21 +0000 |
commit | 3b49eaee539f9982faa554c4eaa75e5f94ee0395 (patch) | |
tree | 53ef85a652d7f6b3ef2f0bb5700d35e167a7abc9 /chip | |
parent | 786e208b508585d490722f143c0f7ec3971e15d5 (diff) | |
download | chrome-ec-3b49eaee539f9982faa554c4eaa75e5f94ee0395.tar.gz |
usb: send correct device descriptor length, and null set address response
BRANCH=none
BUG=none
TEST=verify usb operation with mac 10.7.3
Change-Id: I137a20637273b9a8683470ae42337a8d38e1b038
Signed-off-by: Dominic Chen <ddchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/206931
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r-- | chip/stm32/usb.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/chip/stm32/usb.c b/chip/stm32/usb.c index 9731fef9c1..35f2427ecd 100644 --- a/chip/stm32/usb.c +++ b/chip/stm32/usb.c @@ -87,7 +87,8 @@ static void ep0_rx(void) case USB_DT_DEVICE: /* Setup : Get device descriptor */ memcpy_usbram(ep0_buf_tx, (void *)&dev_desc, sizeof(dev_desc)); - btable_ep[0].tx_count = sizeof(dev_desc); + btable_ep[0].tx_count = MIN(ep0_buf_rx[3], + sizeof(dev_desc)); STM32_TOGGLE_EP(0, EP_TX_RX_MASK, EP_TX_RX_VALID, EP_STATUS_OUT /*null OUT transaction */); break; @@ -135,6 +136,7 @@ static void ep0_rx(void) /* set the address after we got IN packet handshake */ set_addr = ep0_buf_rx[1] & 0xff; /* need null IN transaction -> TX Valid */ + btable_ep[0].tx_count = 0; STM32_TOGGLE_EP(0, EP_TX_RX_MASK, EP_TX_RX_VALID, 0); break; case USB_REQ_SET_CONFIGURATION: |