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 zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
CMakeLists.txt usb: move USB transfer functions to appropriate file 2020-02-05 11:28:12 +01:00
Kconfig usb: Sync receiving data from ISO OUT endpoint with SOF 2020-05-08 15:12:27 +02:00
os_desc.c zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
os_desc.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
usb_descriptor.c device: Apply config_info rename everywhere 2020-08-11 19:30:53 +02:00
usb_descriptor.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
usb_device.c usb: Correct USB setup packet endianness in USB core. 2020-06-23 19:21:41 +02:00
usb_transfer.c usb: usb_transfer: log which endpoint transfer will be cancelled 2020-07-17 13:37:08 +02:00
usb_transfer.h usb: move USB transfer functions to appropriate file 2020-02-05 11:28:12 +01:00