zephyr/subsys/usb
Emil Obalski 1b353d5726 usb: Avoid creating duplicate OUT transfers.
This commit fixes an issue when more than one USB transfer is
reserved for same OUT endpoint.

There are 2 scenarios when this could happen:
- The Host sends SET_CONFIGURATION(1) request twice.
- The Host triggers Suspend->Resume->Configured
  event sequence for the device.

USB tranfers are not canceled on SUSPEND event
when the device was not configred previously.

Because of that USB transfer slot is reserved twice
for the same OUT endpoint and lead to shortage of USB
transfer slots quickly.

Without this patch CDC ACM class reserves duplicated USB
transfer slots for one transfer. The sequence of
Suspend->Resume events is genereted alongside with
Configured and the stack will shortly run out of transfer
slots.

If the Host, for some reason, decides to send
SET_CONFIGURATION request twice the same issue is seen.
This patch prevents from reserving additional USB transfer
slots twice.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-08-19 13:19:56 +02:00
..
class usb: Avoid creating duplicate OUT transfers. 2020-08-19 13:19:56 +02:00
bos.c
CMakeLists.txt
Kconfig
os_desc.c
os_desc.h
usb_descriptor.c device: Apply config_info rename everywhere 2020-08-11 19:30:53 +02:00
usb_descriptor.h
usb_device.c
usb_transfer.c
usb_transfer.h