rndis: use composite_ep0submit to send the ep0 when composite

This commit is contained in:
raiden00pl 2023-03-23 11:45:44 +01:00 committed by Alan Carvalho de Assis
parent 17e8163b6e
commit d014b9d384

View File

@ -56,6 +56,10 @@
#include "rndis_std.h"
#ifdef CONFIG_USBMSC_COMPOSITE
# include <nuttx/usb/composite.h>
#endif
/****************************************************************************
* Pre-processor definitions
****************************************************************************/
@ -2569,9 +2573,21 @@ static int usbclass_setup(FAR struct usbdevclass_driver_s *driver,
if (ret >= 0)
{
/* Configure the response */
ctrlreq->len = MIN(len, ret);
ctrlreq->flags = USBDEV_REQFLAGS_NULLPKT;
/* Send the response -- either directly to the USB controller or
* indirectly in the case where this class is a member of a composite
* device.
*/
#ifndef CONFIG_RNDIS_COMPOSITE
ret = EP_SUBMIT(dev->ep0, ctrlreq);
#else
ret = composite_ep0submit(driver, dev, ctrlreq);
#endif
if (ret < 0)
{
usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_EPRESPQ), (uint16_t)-ret);