773f02e6e9
ZLP - zero length packet is used to indicate that the device has no more data to send. If the Host asks for more data that the device can provide and the data size is mutliplication of Endpoint wMaxPacketSize then the device must terminate the data transfer with ZLP. Until this patch Nordic device driver controller was not aware of the requested data length and could not determine when the ZLP was required. This patch introduces a fix that prevents the driver from starting setup stage before the ZLP is being send. For consistance with the Zephyr USB stack sending ZLP must be issued from the stack level. Making trans_zlp flag true results in blocking the driver from starting setup stage without required ZLP. After the data transfer finishes the driver will be prepared for ZLP and will call back the stack to start writing ZLP. After the ZLP is being send the driver will automatically start status stage and end the Control Transfer. This patch also removes CONFIG_USB_DEVICE_DISABLE_ZLP_EPIN_HANDLING and aligns Nordic driver with others. Without this patch the issue could occur when handling get requests. Typical case is string descriptor of length equal to wMaxPacketSize. Hosts usually asks for wLength = 255 Bytes when string descriptors are being requested. In that case to successfully finish the data stage of the Control transfer the device must send wMacPacketSize Bytes of actual string descriptor and then ZLP to indicate that no more data are present. After ZLP the status stage may start and the request is finished successfully. Without this patch the driver will not send ZLP making it unable to end the Control Request successful - this may lead to failing 'Device Descriptor Test' from USB3CV test tool. Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no> |
||
---|---|---|
.. | ||
class | ||
CMakeLists.txt | ||
Kconfig | ||
bos.c | ||
os_desc.c | ||
os_desc.h | ||
usb_descriptor.c | ||
usb_descriptor.h | ||
usb_device.c | ||
usb_transfer.c | ||
usb_transfer.h | ||
usb_work_q.c | ||
usb_work_q.h |