usbdev-composite: fix enumeration error for 192 bytes desc

when the size of the usb configuration descriptor
is a multiple of 64 integers, only for this size less than wlength,
host do need send ZLP

Signed-off-by: sunkun3 <sunkun3@xiaomi.com>
This commit is contained in:
sunkun3
2023-05-30 20:00:10 +08:00
committed by Mateusz Szafoni
parent 9f19a333d2
commit 324402ed30
+6 -1
View File
@@ -680,7 +680,12 @@ static int composite_setup(FAR struct usbdevclass_driver_s *driver,
/* Setup the request */
ctrlreq->len = MIN(len, ret);
ctrlreq->flags = USBDEV_REQFLAGS_NULLPKT;
/* Only when ret is less than len do zero length packet
* need to be sent
*/
ctrlreq->flags = ret < len ? USBDEV_REQFLAGS_NULLPKT : 0;
/* And submit the request to the USB controller driver */