diff --git a/arch/arm/src/efm32/efm32_usbhost.c b/arch/arm/src/efm32/efm32_usbhost.c index b29bee3ca9..6f22dd5b2e 100644 --- a/arch/arm/src/efm32/efm32_usbhost.c +++ b/arch/arm/src/efm32/efm32_usbhost.c @@ -461,8 +461,8 @@ static ssize_t efm32_transfer(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep static int efm32_asynch(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep, FAR uint8_t *buffer, size_t buflen, usbhost_asynch_t callback, FAR void *arg); -static int efm32_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep); #endif +static int efm32_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep); #ifdef CONFIG_USBHOST_HUB static int efm32_connect(FAR struct usbhost_driver_s *drvr, FAR struct usbhost_hubport_s *hport, @@ -4678,8 +4678,8 @@ static int efm32_asynch(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep, * Name: efm32_cancel * * Description: - * Cancel a pending asynchronous transfer on an endpoint. Cancelled synchronous - * or asynchronous transfer will complete normally with the error -ESHUTDOWN. + * Cancel a pending transfer on an endpoint. Cancelled synchronous or + * asynchronous transfer will complete normally with the error -ESHUTDOWN. * * Input Parameters: * drvr - The USB host driver instance obtained as a parameter from the call to @@ -4693,7 +4693,6 @@ static int efm32_asynch(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep, * ************************************************************************************/ -#ifdef CONFIG_USBHOST_ASYNCH static int efm32_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) { FAR struct efm32_usbhost_s *priv = (FAR struct efm32_usbhost_s *)drvr; @@ -4723,9 +4722,11 @@ static int efm32_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) if (chan->waiter) { +#ifdef CONFIG_USBHOST_ASYNCH /* Yes.. there should not also be a callback scheduled */ DEBUGASSERT(chan->callback == NULL); +#endif /* Wake'em up! */ @@ -4733,6 +4734,7 @@ static int efm32_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) chan->waiter = false; } +#ifdef CONFIG_USBHOST_ASYNCH /* No.. is an asynchronous callback expected when the transfer * completes? */ @@ -4755,6 +4757,7 @@ static int efm32_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) callback(arg, -ESHUTDOWN); } +#endif irqrestore(flags); efm32_givesem(&priv->exclsem); @@ -5131,8 +5134,8 @@ static inline void efm32_sw_initialize(FAR struct efm32_usbhost_s *priv) drvr->transfer = efm32_transfer; #ifdef CONFIG_USBHOST_ASYNCH drvr->asynch = efm32_asynch; - drvr->cancel = efm32_cancel; #endif + drvr->cancel = efm32_cancel; #ifdef CONFIG_USBHOST_HUB drvr->connect = efm32_connect; #endif diff --git a/arch/arm/src/lpc17xx/lpc17_usbhost.c b/arch/arm/src/lpc17xx/lpc17_usbhost.c index 77f69fb713..ea183f1ee3 100644 --- a/arch/arm/src/lpc17xx/lpc17_usbhost.c +++ b/arch/arm/src/lpc17xx/lpc17_usbhost.c @@ -390,8 +390,8 @@ static void lpc17_asynch_completion(struct lpc17_usbhost_s *priv, static int lpc17_asynch(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep, FAR uint8_t *buffer, size_t buflen, usbhost_asynch_t callback, FAR void *arg); -static int lpc17_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep); #endif +static int lpc17_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep); #ifdef CONFIG_USBHOST_HUB static int lpc17_connect(FAR struct usbhost_driver_s *drvr, FAR struct usbhost_hubport_s *hport, @@ -3224,8 +3224,8 @@ errout_with_sem: * Name: lpc17_cancel * * Description: - * Cancel a pending asynchronous transfer on an endpoint. Cancelled synchronous - * or asynchronous transfer will complete normally with the error -ESHUTDOWN. + * Cancel a pending transfer on an endpoint. Cancelled synchronous or + * asynchronous transfer will complete normally with the error -ESHUTDOWN. * * Input Parameters: * drvr - The USB host driver instance obtained as a parameter from the call to @@ -3239,7 +3239,6 @@ errout_with_sem: * ************************************************************************************/ -#ifdef CONFIG_USBHOST_ASYNCH static int lpc17_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) { struct lpc17_usbhost_s *priv = (struct lpc17_usbhost_s *)drvr; @@ -3264,7 +3263,11 @@ static int lpc17_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) * and wdhwait == false) */ +#ifdef CONFIG_USBHOST_ASYNCH if (xfrinfo->callback || xfrinfo->wdhwait) +#else + if (xfrinfo->wdhwait) +#endif { /* We really need some kind of atomic test and set to do this right */ @@ -3290,9 +3293,11 @@ static int lpc17_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) if (xfrinfo->wdhwait) { +#ifdef CONFIG_USBHOST_ASYNCH /* Yes.. there should not also be a callback scheduled */ DEBUGASSERT(xfrinfo->callback == NULL); +#endif /* Wake up the waiting thread */ @@ -3304,12 +3309,14 @@ static int lpc17_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) lpc17_free_xfrinfo(xfrinfo); ed->xfrinfo = NULL; } +#ifdef CONFIG_USBHOST_ASYNCH else { /* Otherwise, perform the callback and free the transfer structure */ lpc17_asynch_completion(priv, ed); } +#endif } else { @@ -3325,7 +3332,6 @@ static int lpc17_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) irqrestore(flags); return OK; } -#endif /* CONFIG_USBHOST_ASYNCH */ /************************************************************************************ * Name: lpc17_connect @@ -3514,8 +3520,8 @@ struct usbhost_connection_s *lpc17_usbhost_initialize(int controller) drvr->transfer = lpc17_transfer; #ifdef CONFIG_USBHOST_ASYNCH drvr->asynch = lpc17_asynch; - drvr->cancel = lpc17_cancel; #endif + drvr->cancel = lpc17_cancel; #ifdef CONFIG_USBHOST_HUB drvr->connect = lpc17_connect; #endif diff --git a/arch/arm/src/lpc31xx/lpc31_ehci.c b/arch/arm/src/lpc31xx/lpc31_ehci.c index 54406ec3b9..719c5715c1 100644 --- a/arch/arm/src/lpc31xx/lpc31_ehci.c +++ b/arch/arm/src/lpc31xx/lpc31_ehci.c @@ -551,8 +551,8 @@ static ssize_t lpc31_transfer(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep static int lpc31_asynch(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep, FAR uint8_t *buffer, size_t buflen, usbhost_asynch_t callback, FAR void *arg); -static int lpc31_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep); #endif +static int lpc31_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep); #ifdef CONFIG_USBHOST_HUB static int lpc31_connect(FAR struct usbhost_driver_s *drvr, FAR struct usbhost_hubport_s *hport, bool connected); @@ -4475,8 +4475,8 @@ errout_with_sem: * Name: lpc31_cancel * * Description: - * Cancel a pending asynchronous transfer on an endpoint. Cancelled synchronous - * or asynchronous transfer will complete normally with the error -ESHUTDOWN. + * Cancel a pending transfer on an endpoint. Cancelled synchronous or + * asynchronous transfer will complete normally with the error -ESHUTDOWN. * * Input Parameters: * drvr - The USB host driver instance obtained as a parameter from the call to @@ -4490,13 +4490,14 @@ errout_with_sem: * ************************************************************************************/ -#ifdef CONFIG_USBHOST_ASYNCH static int lpc31_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) { struct lpc31_epinfo_s *epinfo = (struct lpc31_epinfo_s *)ep; struct lpc31_qh_s *qh; +#ifdef CONFIG_USBHOST_ASYNCH usbhost_asynch_t callback; void *arg; +#endif uint32_t *bp; irqstate_t flags; bool iocwait; @@ -4518,12 +4519,16 @@ static int lpc31_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) */ flags = irqsave(); +#ifdef CONFIG_USBHOST_ASYNCH callback = epinfo->callback; arg = epinfo->arg; +#endif iocwait = epinfo->iocwait; +#ifdef CONFIG_USBHOST_ASYNCH epinfo->callback = NULL; epinfo->arg = NULL; +#endif epinfo->iocwait = false; irqrestore(flags); @@ -4622,10 +4627,13 @@ exit_terminate: { /* Yes... wake it up */ +#ifdef CONFIG_USBHOST_ASYNCH DEBUGASSERT(callback == NULL); +#endif lpc31_givesem(&epinfo->iocsem); } +#ifdef CONFIG_USBHOST_ASYNCH /* No.. Is there a pending asynchronous transfer? */ else if (callback != NULL) @@ -4634,12 +4642,12 @@ exit_terminate: callback(arg, -ESHUTDOWN); } +#endif errout_with_sem: lpc31_givesem(&g_ehci.exclsem); return ret; } -#endif /* CONFIG_USBHOST_ASYNCH */ /************************************************************************************ * Name: lpc31_connect @@ -4932,8 +4940,8 @@ FAR struct usbhost_connection_s *lpc31_ehci_initialize(int controller) rhport->drvr.transfer = lpc31_transfer; #ifdef CONFIG_USBHOST_ASYNCH rhport->drvr.asynch = lpc31_asynch; - rhport->drvr.cancel = lpc31_cancel; #endif + rhport->drvr.cancel = lpc31_cancel; #ifdef CONFIG_USBHOST_HUB rhport->drvr.connect = lpc31_connect; #endif diff --git a/arch/arm/src/sama5/sam_ehci.c b/arch/arm/src/sama5/sam_ehci.c index 1d1007c94d..f9688d7a56 100644 --- a/arch/arm/src/sama5/sam_ehci.c +++ b/arch/arm/src/sama5/sam_ehci.c @@ -427,8 +427,8 @@ static ssize_t sam_transfer(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep, static int sam_asynch(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep, FAR uint8_t *buffer, size_t buflen, usbhost_asynch_t callback, FAR void *arg); -static int sam_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep); #endif +static int sam_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep); #ifdef CONFIG_USBHOST_HUB static int sam_connect(FAR struct usbhost_driver_s *drvr, FAR struct usbhost_hubport_s *hport, bool connected); @@ -4302,8 +4302,8 @@ errout_with_sem: * Name: sam_cancel * * Description: - * Cancel a pending asynchronous transfer on an endpoint. Cancelled synchronous - * or asynchronous transfer will complete normally with the error -ESHUTDOWN. + * Cancel a pending transfer on an endpoint. Cancelled synchronous or + * asynchronous transfer will complete normally with the error -ESHUTDOWN. * * Input Parameters: * drvr - The USB host driver instance obtained as a parameter from the call to @@ -4317,13 +4317,14 @@ errout_with_sem: * ************************************************************************************/ -#ifdef CONFIG_USBHOST_ASYNCH static int sam_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) { struct sam_epinfo_s *epinfo = (struct sam_epinfo_s *)ep; struct sam_qh_s *qh; +#ifdef CONFIG_USBHOST_ASYNCH usbhost_asynch_t callback; void *arg; +#endif uint32_t *bp; irqstate_t flags; bool iocwait; @@ -4345,12 +4346,16 @@ static int sam_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) */ flags = irqsave(); +#ifdef CONFIG_USBHOST_ASYNCH callback = epinfo->callback; arg = epinfo->arg; +#endif iocwait = epinfo->iocwait; +#ifdef CONFIG_USBHOST_ASYNCH epinfo->callback = NULL; epinfo->arg = NULL; +#endif epinfo->iocwait = false; irqrestore(flags); @@ -4440,10 +4445,13 @@ exit_terminate: { /* Yes... wake it up */ +#ifdef CONFIG_USBHOST_ASYNCH DEBUGASSERT(callback == NULL); +#endif sam_givesem(&epinfo->iocsem); } +#ifdef CONFIG_USBHOST_ASYNCH /* No.. Is there a pending asynchronous transfer? */ else if (callback != NULL) @@ -4452,12 +4460,12 @@ exit_terminate: callback(arg, -ESHUTDOWN); } +#endif errout_with_sem: sam_givesem(&g_ehci.exclsem); return ret; } -#endif /* CONFIG_USBHOST_ASYNCH */ /************************************************************************************ * Name: sam_connect @@ -4808,8 +4816,8 @@ FAR struct usbhost_connection_s *sam_ehci_initialize(int controller) rhport->drvr.transfer = sam_transfer; #ifdef CONFIG_USBHOST_ASYNCH rhport->drvr.asynch = sam_asynch; - rhport->drvr.cancel = sam_cancel; #endif + rhport->drvr.cancel = sam_cancel; #ifdef CONFIG_USBHOST_HUB rhport->drvr.connect = sam_connect; #endif diff --git a/arch/arm/src/sama5/sam_ohci.c b/arch/arm/src/sama5/sam_ohci.c index 2845224bd8..6be8f39a73 100644 --- a/arch/arm/src/sama5/sam_ohci.c +++ b/arch/arm/src/sama5/sam_ohci.c @@ -453,8 +453,8 @@ static void sam_asynch_completion(struct sam_eplist_s *eplist); static int sam_asynch(struct usbhost_driver_s *drvr, usbhost_ep_t ep, uint8_t *buffer, size_t buflen, usbhost_asynch_t callback, void *arg); -static int sam_cancel(struct usbhost_driver_s *drvr, usbhost_ep_t ep); #endif +static int sam_cancel(struct usbhost_driver_s *drvr, usbhost_ep_t ep); #ifdef CONFIG_USBHOST_HUB static int sam_connect(struct usbhost_driver_s *drvr, struct usbhost_hubport_s *hport, @@ -3605,8 +3605,8 @@ errout: * Name: sam_cancel * * Description: - * Cancel a pending asynchronous transfer on an endpoint. Cancelled synchronous - * or asynchronous transfer will complete normally with the error -ESHUTDOWN. + * Cancel a pending transfer on an endpoint. Cancelled synchronous or + * asynchronous transfer will complete normally with the error -ESHUTDOWN. * * Input Parameters: * drvr - The USB host driver instance obtained as a parameter from the call to @@ -3620,7 +3620,6 @@ errout: * ************************************************************************************/ -#ifdef CONFIG_USBHOST_ASYNCH static int sam_cancel(struct usbhost_driver_s *drvr, usbhost_ep_t ep) { struct sam_eplist_s *eplist = (struct sam_eplist_s *)ep; @@ -3641,7 +3640,11 @@ static int sam_cancel(struct usbhost_driver_s *drvr, usbhost_ep_t ep) * and wdhwait == false) */ +#ifdef CONFIG_USBHOST_ASYNCH if (eplist->callback || eplist->wdhwait) +#else + if (eplist->wdhwait) +#endif { /* We really need some kind of atomic test and set to do this right */ @@ -3670,35 +3673,40 @@ static int sam_cancel(struct usbhost_driver_s *drvr, usbhost_ep_t ep) if (eplist->wdhwait) { +#ifdef CONFIG_USBHOST_ASYNCH /* Yes.. there should not also be a callback scheduled */ DEBUGASSERT(eplist->callback == NULL); +#endif /* Wake up the waiting thread */ sam_givesem(&eplist->wdhsem); eplist->wdhwait = false; } +#ifdef CONFIG_USBHOST_ASYNCH else { /* Otherwise, perform the callback */ sam_asynch_completion(eplist); } +#endif } /* Reset any pending activity indications */ eplist->wdhwait = false; +#ifdef CONFIG_USBHOST_ASYNCH eplist->callback = NULL; eplist->arg = NULL; +#endif eplist->buffer = NULL; eplist->buflen = 0; irqrestore(flags); return OK; } -#endif /* CONFIG_USBHOST_ASYNCH */ /************************************************************************************ * Name: sam_connect @@ -3970,8 +3978,8 @@ struct usbhost_connection_s *sam_ohci_initialize(int controller) rhport->drvr.transfer = sam_transfer; #ifdef CONFIG_USBHOST_ASYNCH rhport->drvr.asynch = sam_asynch; - rhport->drvr.cancel = sam_cancel; #endif + rhport->drvr.cancel = sam_cancel; #ifdef CONFIG_USBHOST_HUB rhport->drvr.connect = sam_connect; #endif diff --git a/arch/arm/src/stm32/stm32_otgfshost.c b/arch/arm/src/stm32/stm32_otgfshost.c index 3d7124a95a..cb1a1a2965 100644 --- a/arch/arm/src/stm32/stm32_otgfshost.c +++ b/arch/arm/src/stm32/stm32_otgfshost.c @@ -448,8 +448,8 @@ static ssize_t stm32_transfer(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep static int stm32_asynch(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep, FAR uint8_t *buffer, size_t buflen, usbhost_asynch_t callback, FAR void *arg); -static int stm32_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep); #endif +static int stm32_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep); #ifdef CONFIG_USBHOST_HUB static int stm32_connect(FAR struct usbhost_driver_s *drvr, FAR struct usbhost_hubport_s *hport, @@ -4610,8 +4610,8 @@ static int stm32_asynch(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep, * Name: stm32_cancel * * Description: - * Cancel a pending asynchronous transfer on an endpoint. Cancelled synchronous - * or asynchronous transfer will complete normally with the error -ESHUTDOWN. + * Cancel a pending transfer on an endpoint. Cancelled synchronous or + * asynchronous transfer will complete normally with the error -ESHUTDOWN. * * Input Parameters: * drvr - The USB host driver instance obtained as a parameter from the call to @@ -4625,7 +4625,6 @@ static int stm32_asynch(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep, * ************************************************************************************/ -#ifdef CONFIG_USBHOST_ASYNCH static int stm32_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) { FAR struct stm32_usbhost_s *priv = (FAR struct stm32_usbhost_s *)drvr; @@ -4655,9 +4654,11 @@ static int stm32_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) if (chan->waiter) { +#ifdef CONFIG_USBHOST_ASYNCH /* Yes.. there should not also be a callback scheduled */ DEBUGASSERT(chan->callback == NULL); +#endif /* Wake'em up! */ @@ -4665,6 +4666,7 @@ static int stm32_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) chan->waiter = false; } +#ifdef CONFIG_USBHOST_ASYNCH /* No.. is an asynchronous callback expected when the transfer * completes? */ @@ -4687,6 +4689,7 @@ static int stm32_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) callback(arg, -ESHUTDOWN); } +#endif irqrestore(flags); stm32_givesem(&priv->exclsem); @@ -5063,8 +5066,8 @@ static inline void stm32_sw_initialize(FAR struct stm32_usbhost_s *priv) drvr->transfer = stm32_transfer; #ifdef CONFIG_USBHOST_ASYNCH drvr->asynch = stm32_asynch; - drvr->cancel = stm32_cancel; #endif + drvr->cancel = stm32_cancel; #ifdef CONFIG_USBHOST_HUB drvr->connect = stm32_connect; #endif diff --git a/arch/arm/src/stm32/stm32_otghshost.c b/arch/arm/src/stm32/stm32_otghshost.c index 800797beb5..43839af7aa 100644 --- a/arch/arm/src/stm32/stm32_otghshost.c +++ b/arch/arm/src/stm32/stm32_otghshost.c @@ -448,8 +448,8 @@ static ssize_t stm32_transfer(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep static int stm32_asynch(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep, FAR uint8_t *buffer, size_t buflen, usbhost_asynch_t callback, FAR void *arg); -static int stm32_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep); #endif +static int stm32_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep); #ifdef CONFIG_USBHOST_HUB static int stm32_connect(FAR struct usbhost_driver_s *drvr, FAR struct usbhost_hubport_s *hport, @@ -4610,8 +4610,8 @@ static int stm32_asynch(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep, * Name: stm32_cancel * * Description: - * Cancel a pending asynchronous transfer on an endpoint. Cancelled synchronous - * or asynchronous transfer will complete normally with the error -ESHUTDOWN. + * Cancel a pending transfer on an endpoint. Cancelled synchronous or + * asynchronous transfer will complete normally with the error -ESHUTDOWN. * * Input Parameters: * drvr - The USB host driver instance obtained as a parameter from the call to @@ -4625,7 +4625,6 @@ static int stm32_asynch(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep, * ************************************************************************************/ -#ifdef CONFIG_USBHOST_ASYNCH static int stm32_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) { FAR struct stm32_usbhost_s *priv = (FAR struct stm32_usbhost_s *)drvr; @@ -4655,9 +4654,11 @@ static int stm32_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) if (chan->waiter) { +#ifdef CONFIG_USBHOST_ASYNCH /* Yes.. there should not also be a callback scheduled */ DEBUGASSERT(chan->callback == NULL); +#endif /* Wake'em up! */ @@ -4665,6 +4666,7 @@ static int stm32_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) chan->waiter = false; } +#ifdef CONFIG_USBHOST_ASYNCH /* No.. is an asynchronous callback expected when the transfer * completes? */ @@ -4687,6 +4689,7 @@ static int stm32_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) callback(arg, -ESHUTDOWN); } +#endif irqrestore(flags); stm32_givesem(&priv->exclsem); @@ -5063,8 +5066,8 @@ static inline void stm32_sw_initialize(FAR struct stm32_usbhost_s *priv) drvr->transfer = stm32_transfer; #ifdef CONFIG_USBHOST_ASYNCH drvr->asynch = stm32_asynch; - drvr->cancel = stm32_cancel; #endif + drvr->cancel = stm32_cancel; #ifdef CONFIG_USBHOST_HUB drvr->connect = stm32_connect; #endif diff --git a/include/nuttx/usb/usbhost.h b/include/nuttx/usb/usbhost.h index cfa9001e8a..1e72ae2635 100644 --- a/include/nuttx/usb/usbhost.h +++ b/include/nuttx/usb/usbhost.h @@ -552,8 +552,8 @@ * Name: DRVR_CANCEL * * Description: - * Cancel a pending asynchronous transfer on an endpoint. Cancelled synchronous - * or asynchronous transfer will complete normally with the error -ESHUTDOWN. + * Cancel a pending transfer on an endpoint. Cancelled synchronous or + * asynchronous transfer will complete normally with the error -ESHUTDOWN. * * Input Parameters: * drvr - The USB host driver instance obtained as a parameter from the call to @@ -567,9 +567,7 @@ * ************************************************************************************/ -#ifdef CONFIG_USBHOST_ASYNCH -# define DRVR_CANCEL(drvr,ep) ((drvr)->cancel(drvr,ep)) -#endif +#define DRVR_CANCEL(drvr,ep) ((drvr)->cancel(drvr,ep)) /************************************************************************************ * Name: DRVR_CONNECT @@ -895,11 +893,9 @@ struct usbhost_driver_s usbhost_asynch_t callback, FAR void *arg); #endif -#ifdef CONFIG_USBHOST_ASYNCH - /* Cancel any pending asynchronous transfer on an endpoint */ + /* Cancel any pending syncrhonous or 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