mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-30 02:20:48 +00:00
In the USB 2.0 specification, the "8.5.3 Control Transfers" chapter says that "When all of the data structure is returned to the host, the function should indicate that the Data stage is ended by returning a packet that is shorter than the MaxPacketSize for the pipe. If the data structure is an exact multiple of wMaxPacketSize for the pipe, the function will return a zero-length packet to indicate the end of the Data stage." When doing a 'Control Read' transfer and the returned data (in IN packets) was a multiple of MaxPacketSize, we were omitting the zero-length packet and so the host was blocked waiting for a successful IN transaction. This corner-case was a regression introduced by the re-writing of the control transfer handling done by CL 318864. So the STM32 USB code which is similar to the former code is dealing properly with this case. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=cr50 BUG=none TEST=manual, extend the configuration descriptor to be exactly 64 bytes, and see the enumeration is no longer failing. Change-Id: I108e8c6bb9eb727c41f3e1c607f0919fa1192d5a Reviewed-on: https://chromium-review.googlesource.com/664814 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Marius Schilder <mschilder@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>