mirror of
https://github.com/apache/nuttx.git
synced 2026-05-25 18:26:05 +08:00
If asynchronous tranfers are supported, then there must also be a mechanism to cancel the pending transfer
This commit is contained in:
@@ -513,6 +513,28 @@
|
||||
((drvr)->asynch(drvr,ep,buffer,buflen,callback,arg))
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: DRVR_CANCEL
|
||||
*
|
||||
* Description:
|
||||
* Cancel a pending asynchronous transfer on an endpoint.
|
||||
*
|
||||
* Input Parameters:
|
||||
* drvr - The USB host driver instance obtained as a parameter from the call to
|
||||
* the class create() method.
|
||||
* ep - The IN or OUT endpoint descriptor for the device endpoint on which an
|
||||
* asynchronous transfer should be transferred.
|
||||
*
|
||||
* Returned Values:
|
||||
* On success, zero (OK) is returned. On a failure, a negated errno value is
|
||||
* returned indicating the nature of the failure.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_USBHOST_ASYNCH
|
||||
# define DRVR_CANCEL(drvr,ep) ((drvr)->cancel(drvr,ep))
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: DRVR_CONNECT
|
||||
*
|
||||
@@ -823,6 +845,12 @@ struct usbhost_driver_s
|
||||
usbhost_asynch_t callback, FAR void *arg);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USBHOST_ASYNCH
|
||||
/* Cancel any pending asynchronous transfer on an endpoint */
|
||||
|
||||
int (*cancel)(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USBHOST_HUB
|
||||
/* New connections may be detected by an attached hub. This method is the
|
||||
* mechanism that is used by the hub class to introduce a new connection
|
||||
|
||||
Reference in New Issue
Block a user