aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/uhci-q.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2007-01-08 12:01:43 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2007-02-07 18:44:35 -0500
commit85a975d0ce48dfa8dec5bf1bd970f8fd2c48af32 (patch)
treeb122cba23280c7ff01e3e301d08f7e7c56bae8e5 /drivers/usb/host/uhci-q.c
parentf3fe239b67424d88104e32076aec902c0642925f (diff)
UHCI: no dummy TDs for Iso QHs
Isochronous queues don't need a dummy TD because the Queue Header isn't managed by the hardware. This patch (as836) removes the unnecessary dummy TDs. The patch also fixes a long-standing typo in a comment (a "don't" was missing -- potentially very confusing!). Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/uhci-q.c')
-rw-r--r--drivers/usb/host/uhci-q.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/usb/host/uhci-q.c b/drivers/usb/host/uhci-q.c
index 30b88459ac7d..5afcc5227284 100644
--- a/drivers/usb/host/uhci-q.c
+++ b/drivers/usb/host/uhci-q.c
@@ -248,16 +248,18 @@ static struct uhci_qh *uhci_alloc_qh(struct uhci_hcd *uhci,
248 INIT_LIST_HEAD(&qh->node); 248 INIT_LIST_HEAD(&qh->node);
249 249
250 if (udev) { /* Normal QH */ 250 if (udev) { /* Normal QH */
251 qh->dummy_td = uhci_alloc_td(uhci); 251 qh->type = hep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;
252 if (!qh->dummy_td) { 252 if (qh->type != USB_ENDPOINT_XFER_ISOC) {
253 dma_pool_free(uhci->qh_pool, qh, dma_handle); 253 qh->dummy_td = uhci_alloc_td(uhci);
254 return NULL; 254 if (!qh->dummy_td) {
255 dma_pool_free(uhci->qh_pool, qh, dma_handle);
256 return NULL;
257 }
255 } 258 }
256 qh->state = QH_STATE_IDLE; 259 qh->state = QH_STATE_IDLE;
257 qh->hep = hep; 260 qh->hep = hep;
258 qh->udev = udev; 261 qh->udev = udev;
259 hep->hcpriv = qh; 262 hep->hcpriv = qh;
260 qh->type = hep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;
261 263
262 } else { /* Skeleton QH */ 264 } else { /* Skeleton QH */
263 qh->state = QH_STATE_ACTIVE; 265 qh->state = QH_STATE_ACTIVE;
@@ -275,7 +277,8 @@ static void uhci_free_qh(struct uhci_hcd *uhci, struct uhci_qh *qh)
275 list_del(&qh->node); 277 list_del(&qh->node);
276 if (qh->udev) { 278 if (qh->udev) {
277 qh->hep->hcpriv = NULL; 279 qh->hep->hcpriv = NULL;
278 uhci_free_td(uhci, qh->dummy_td); 280 if (qh->dummy_td)
281 uhci_free_td(uhci, qh->dummy_td);
279 } 282 }
280 dma_pool_free(uhci->qh_pool, qh, qh->dma_handle); 283 dma_pool_free(uhci->qh_pool, qh, qh->dma_handle);
281} 284}
@@ -327,7 +330,7 @@ static int uhci_cleanup_queue(struct uhci_hcd *uhci, struct uhci_qh *qh,
327 goto done; 330 goto done;
328 qh->element = UHCI_PTR_TERM; 331 qh->element = UHCI_PTR_TERM;
329 332
330 /* Control pipes have to worry about toggles */ 333 /* Control pipes don't have to worry about toggles */
331 if (qh->type == USB_ENDPOINT_XFER_CONTROL) 334 if (qh->type == USB_ENDPOINT_XFER_CONTROL)
332 goto done; 335 goto done;
333 336