diff options
Diffstat (limited to 'nuttx')
-rw-r--r-- | nuttx/drivers/usbdev/usbdev_serial.c | 10 | ||||
-rw-r--r-- | nuttx/include/nuttx/usbdev.h | 17 |
2 files changed, 17 insertions, 10 deletions
diff --git a/nuttx/drivers/usbdev/usbdev_serial.c b/nuttx/drivers/usbdev/usbdev_serial.c index b24b95db6..dd771a413 100644 --- a/nuttx/drivers/usbdev/usbdev_serial.c +++ b/nuttx/drivers/usbdev/usbdev_serial.c @@ -969,7 +969,7 @@ static int usbclass_setconfig(FAR struct usbser_dev_s *priv, ubyte config) /* Configure the IN interrupt endpoint */ - ret = EP_CONFIGURE(priv->epintin, &g_epintindesc); + ret = EP_CONFIGURE(priv->epintin, &g_epintindesc, FALSE); if (ret < 0) { usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_EPINTINCONFIGFAIL), 0); @@ -990,9 +990,9 @@ static int usbclass_setconfig(FAR struct usbser_dev_s *priv, ubyte config) } usbclass_mkepbulkdesc(&g_epbulkindesc, bulkmxpacket, &epdesc); - ret = EP_CONFIGURE(priv->epbulkin, &epdesc); + ret = EP_CONFIGURE(priv->epbulkin, &epdesc, FALSE); #else - ret = EP_CONFIGURE(priv->epbulkin, &g_epbulkindesc); + ret = EP_CONFIGURE(priv->epbulkin, &g_epbulkindesc, FALSE); #endif if (ret < 0) { @@ -1006,9 +1006,9 @@ static int usbclass_setconfig(FAR struct usbser_dev_s *priv, ubyte config) #ifdef CONFIG_USBDEV_DUALSPEED usbclass_mkepbulkdesc(&g_epbulkoutdesc, bulkmxpacket, &epdesc); - ret = EP_CONFIGURE(priv->epbulkout, &epdesc); + ret = EP_CONFIGURE(priv->epbulkout, &epdesc, TRUE); #else - ret = EP_CONFIGURE(priv->epbulkout, &g_epbulkoutdesc); + ret = EP_CONFIGURE(priv->epbulkout, &g_epbulkoutdesc, TRUE); #endif if (ret < 0) { diff --git a/nuttx/include/nuttx/usbdev.h b/nuttx/include/nuttx/usbdev.h index 9ab836406..b3e19b00e 100644 --- a/nuttx/include/nuttx/usbdev.h +++ b/nuttx/include/nuttx/usbdev.h @@ -56,10 +56,15 @@ /* Endpoint helpers *****************************************************************/ /* Configure endpoint, making it usable. The class driver may deallocate or re-use - * the 'desc' structure after returning + * the 'desc' structure after returning: + * + * ep - the struct usbdev_ep_s instance obtained from allocep() + * desc - A struct usb_epdesc_s instance describing the endpoint + * last - TRUE if this this last endpoint to be configured. Some hardware needs + * to take special action when all of the endpoints have been configured. */ -#define EP_CONFIGURE(ep,desc) (ep)->ops->configure(ep,desc) +#define EP_CONFIGURE(ep,desc,last) (ep)->ops->configure(ep,desc,last) /* The endpoint will no longer be used */ @@ -97,8 +102,9 @@ /* Allocate an endpoint: * - * epphy - 7-bit physical endpoint number (without diretion bit). Zero means - * that any endpoint matching the other requirements will suffice. + * ep - 7-bit logical endpoint number (direction bit ignored). Zero means + * that any endpoint matching the other requirements will suffice. The + * assigned endpoint can be found in the eplog field. * in - TRUE: IN (device-to-host) endpoint requested * eptype - Endpoint type. One of {USB_EP_ATTR_XFER_ISOC, USB_EP_ATTR_XFER_BULK, * USB_EP_ATTR_XFER_INT} @@ -197,7 +203,7 @@ struct usbdev_epops_s { /* Configure/enable and disable endpoint */ - int (*configure)(FAR struct usbdev_ep_s *ep, FAR const struct usb_epdesc_s *desc); + int (*configure)(FAR struct usbdev_ep_s *ep, FAR const struct usb_epdesc_s *desc, boolean last); int (*disable)(FAR struct usbdev_ep_s *ep); /* Allocate and free I/O requests */ @@ -227,6 +233,7 @@ struct usbdev_epops_s struct usbdev_ep_s { const struct usbdev_epops_s *ops; /* Endpoint operations */ + ubyte eplog; /* Logical endpoint address */ uint16 maxpacket; /* Maximum packet size for this endpoint */ void *private; /* For use by class driver */ }; |