The USB host cancellation now applies to all transfers and so it no longer conditional
This commit is contained in:
parent
8ed11a374d
commit
cf1ab6baec
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user