#ifdef DEBUG
static void __attribute__((__unused__))
-dbg_qtd (char *label, struct ehci_hcd *ehci, struct ehci_qtd *qtd)
+dbg_qtd (const char *label, struct ehci_hcd *ehci, struct ehci_qtd *qtd)
{
ehci_dbg (ehci, "%s td %p n%08x %08x t%08x p0=%08x\n", label, qtd,
cpu_to_le32p (&qtd->hw_next),
}
static void __attribute__((__unused__))
-dbg_qh (char *label, struct ehci_hcd *ehci, struct ehci_qh *qh)
+dbg_qh (const char *label, struct ehci_hcd *ehci, struct ehci_qh *qh)
{
ehci_dbg (ehci, "%s qh %p n%08x info %x %x qtd %x\n", label,
qh, qh->hw_next, qh->hw_info1, qh->hw_info2,
* - driver buffers, read/written by HC ... single shot DMA mapped
*
* There's also PCI "register" data, which is memory mapped.
- * No memory seen by this driver is pagable.
+ * No memory seen by this driver is pageable.
*/
/*-------------------------------------------------------------------------*/
}
if (qh->dummy)
ehci_qtd_free (ehci, qh->dummy);
+ usb_put_dev (qh->dev);
pci_pool_free (ehci->qh_pool, qh, qh->qh_dma);
}
/* if async CSPLIT failed, try cleaning out the TT buffer */
} else if (urb->dev->tt && !usb_pipeint (urb->pipe)
- && QTD_CERR(token) == 0) {
+ && ((token & QTD_STS_MMF) != 0
+ || QTD_CERR(token) == 0)) {
#ifdef DEBUG
struct usb_device *tt = urb->dev->tt->hub;
dev_dbg (&tt->dev,
}
spin_unlock (&urb->lock);
+#ifdef EHCI_URB_TRACE
+ ehci_dbg (ehci,
+ "%s %s urb %p ep%d%s status %d len %d/%d\n",
+ __FUNCTION__, urb->dev->devpath, urb,
+ usb_pipeendpoint (urb->pipe),
+ usb_pipein (urb->pipe) ? "in" : "out",
+ urb->status,
+ urb->actual_length, urb->transfer_buffer_length);
+#endif
+
/* complete() can reenter this HCD */
spin_unlock (&ehci->lock);
usb_hcd_giveback_urb (&ehci->hcd, urb, regs);
qh->period = urb->interval;
}
+
+ /* support for tt scheduling */
+ qh->dev = usb_get_dev (urb->dev);
}
/* using TT? */
usb_settoggle (urb->dev, usb_pipeendpoint (urb->pipe), !is_input, 1);
return qh;
}
-#undef hb_mult
-#undef hb_packet
/*-------------------------------------------------------------------------*/
if (usb_pipein (urb->pipe) && !usb_pipecontrol (urb->pipe))
epnum |= 0x10;
- ehci_vdbg (ehci, "submit_async urb %p len %d ep%d%s qtd %p [qh %p]\n",
- urb, urb->transfer_buffer_length,
- epnum & 0x0f, (epnum & 0x10) ? "in" : "out",
+#ifdef EHCI_URB_TRACE
+ ehci_dbg (ehci,
+ "%s %s urb %p ep%d%s len %d, qtd %p [qh %p]\n",
+ __FUNCTION__, urb->dev->devpath, urb,
+ epnum & 0x0f, usb_pipein (urb->pipe) ? "in" : "out",
+ urb->transfer_buffer_length,
qtd, dev ? dev->ep [epnum] : (void *)~0);
+#endif
spin_lock_irqsave (&ehci->lock, flags);
qh = qh_append_tds (ehci, urb, qtd_list, epnum, &dev->ep [epnum]);