mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 09:18:00 +08:00
SAMA5 OHCI: Implement asynchronous I/O needed for hub support
This commit is contained in:
@@ -1464,6 +1464,9 @@ static int lpc17_wdhwait(struct lpc17_usbhost_s *priv, struct lpc17_ed_s *ed)
|
||||
*/
|
||||
|
||||
ed->wdhwait = true;
|
||||
#ifdef CONFIG_USBHOST_ASYNCH
|
||||
ed->asynch = NULL;
|
||||
#endif
|
||||
ret = OK;
|
||||
}
|
||||
|
||||
@@ -2602,9 +2605,12 @@ static int lpc17_transfer_common(struct lpc17_usbhost_s *priv,
|
||||
* TDs on the Bulk list.
|
||||
*/
|
||||
|
||||
regval = lpc17_getreg(LPC17_USBHOST_CMDST);
|
||||
regval |= OHCI_CMDST_BLF;
|
||||
lpc17_putreg(regval, LPC17_USBHOST_CMDST);
|
||||
if (ed->xfrtype == USB_EP_ATTR_XFER_BULK)
|
||||
{
|
||||
regval = lpc17_getreg(LPC17_USBHOST_CMDST);
|
||||
regval |= OHCI_CMDST_BLF;
|
||||
lpc17_putreg(regval, LPC17_USBHOST_CMDST);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -2829,10 +2835,6 @@ static int lpc17_transfer(struct usbhost_driver_s *drvr, usbhost_ep_t ep,
|
||||
goto errout_with_buffers;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_USBHOST_ASYNCH
|
||||
ed->asynch = NULL;
|
||||
#endif
|
||||
|
||||
/* Set up the transfer */
|
||||
|
||||
ret = lpc17_transfer_common(priv, ed, buffer, buflen);
|
||||
@@ -3140,6 +3142,8 @@ static int lpc17_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep)
|
||||
lpc17_freeasynch(asynch);
|
||||
}
|
||||
|
||||
/* Determine the return value */
|
||||
|
||||
ret = ed->wdhwait ? -EINVAL : OK;
|
||||
irqrestore(flags);
|
||||
return ret;
|
||||
|
||||
+483
-176
File diff suppressed because it is too large
Load Diff
@@ -93,6 +93,9 @@ static const struct sam_usbhost_trace_s g_trace1[TRACE1_NSTRINGS] =
|
||||
TRENTRY(OHCI_TRACE1_EDALLOC_FAILED, TR_OHCI, TR_FMT1, "OHCI ERROR: Failed to allocate ED\n"),
|
||||
TRENTRY(OHCI_TRACE1_TDALLOC_FAILED, TR_OHCI, TR_FMT1, "OHCI ERROR: Failed to allocate TD\n"),
|
||||
TRENTRY(OHCI_TRACE1_IRQATTACH, TR_OHCI, TR_FMT1, "OHCI ERROR: Failed to attach IRQ%d\n"),
|
||||
#ifdef CONFIG_USBHOST_ASYNCH
|
||||
TRENTRY(OHCI_TRACE1_BADTDSTATUS, TR_OHCI, TR_FMT1, "OHCI ERROR: Bad asynch TD completion status: %d\n"),
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_USBHOST_TRACE_VERBOSE
|
||||
TRENTRY(OHCI_VTRACE1_PHYSED, TR_OHCI, TR_FMT1, "OHCI physed: %06x\n"),
|
||||
|
||||
@@ -80,6 +80,9 @@ enum usbhost_trace1codes_e
|
||||
OHCI_TRACE1_EDALLOC_FAILED, /* OHCI ERROR: Failed to allocate ED */
|
||||
OHCI_TRACE1_TDALLOC_FAILED, /* OHCI ERROR: Failed to allocate TD */
|
||||
OHCI_TRACE1_IRQATTACH, /* OHCI ERROR: Failed to attach IRQ */
|
||||
#ifdef CONFIG_USBHOST_ASYNCH
|
||||
OHCI_TRACE1_BADTDSTATUS, /* OHCI ERROR: Bad asynch TD completion status */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_USBHOST_TRACE_VERBOSE
|
||||
OHCI_VTRACE1_PHYSED, /* OHCI physed */
|
||||
|
||||
@@ -1667,6 +1667,9 @@ USB High-Speed Host
|
||||
2. Stack usage make increase when USB hub support is enabled because
|
||||
the nesting depth of certain USB host class logic can increase.
|
||||
|
||||
STATUS:
|
||||
Hub support has not been verified on this board.
|
||||
|
||||
Mass Storage Device Usage
|
||||
-------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user