aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/uhci-q.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/uhci-q.c')
-rw-r--r--drivers/usb/host/uhci-q.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/usb/host/uhci-q.c b/drivers/usb/host/uhci-q.c
index 5631d89c8730..3e5807d14ffb 100644
--- a/drivers/usb/host/uhci-q.c
+++ b/drivers/usb/host/uhci-q.c
@@ -402,7 +402,7 @@ static void uhci_fixup_toggles(struct uhci_qh *qh, int skip_first)
402 /* Otherwise all the toggles in the URB have to be switched */ 402 /* Otherwise all the toggles in the URB have to be switched */
403 } else { 403 } else {
404 list_for_each_entry(td, &urbp->td_list, list) { 404 list_for_each_entry(td, &urbp->td_list, list) {
405 td->token ^= __constant_cpu_to_le32( 405 td->token ^= cpu_to_le32(
406 TD_TOKEN_TOGGLE); 406 TD_TOKEN_TOGGLE);
407 toggle ^= 1; 407 toggle ^= 1;
408 } 408 }
@@ -883,7 +883,7 @@ static int uhci_submit_control(struct uhci_hcd *uhci, struct urb *urb,
883 883
884 uhci_fill_td(td, 0, USB_PID_OUT | uhci_explen(0), 0); 884 uhci_fill_td(td, 0, USB_PID_OUT | uhci_explen(0), 0);
885 wmb(); 885 wmb();
886 qh->dummy_td->status |= __constant_cpu_to_le32(TD_CTRL_ACTIVE); 886 qh->dummy_td->status |= cpu_to_le32(TD_CTRL_ACTIVE);
887 qh->dummy_td = td; 887 qh->dummy_td = td;
888 888
889 /* Low-speed transfers get a different queue, and won't hog the bus. 889 /* Low-speed transfers get a different queue, and won't hog the bus.
@@ -899,8 +899,6 @@ static int uhci_submit_control(struct uhci_hcd *uhci, struct urb *urb,
899 } 899 }
900 if (qh->state != QH_STATE_ACTIVE) 900 if (qh->state != QH_STATE_ACTIVE)
901 qh->skel = skel; 901 qh->skel = skel;
902
903 urb->actual_length = -8; /* Account for the SETUP packet */
904 return 0; 902 return 0;
905 903
906nomem: 904nomem:
@@ -1003,7 +1001,7 @@ static int uhci_submit_common(struct uhci_hcd *uhci, struct urb *urb,
1003 * fast side but not enough to justify delaying an interrupt 1001 * fast side but not enough to justify delaying an interrupt
1004 * more than 2 or 3 URBs, so we will ignore the URB_NO_INTERRUPT 1002 * more than 2 or 3 URBs, so we will ignore the URB_NO_INTERRUPT
1005 * flag setting. */ 1003 * flag setting. */
1006 td->status |= __constant_cpu_to_le32(TD_CTRL_IOC); 1004 td->status |= cpu_to_le32(TD_CTRL_IOC);
1007 1005
1008 /* 1006 /*
1009 * Build the new dummy TD and activate the old one 1007 * Build the new dummy TD and activate the old one
@@ -1015,7 +1013,7 @@ static int uhci_submit_common(struct uhci_hcd *uhci, struct urb *urb,
1015 1013
1016 uhci_fill_td(td, 0, USB_PID_OUT | uhci_explen(0), 0); 1014 uhci_fill_td(td, 0, USB_PID_OUT | uhci_explen(0), 0);
1017 wmb(); 1015 wmb();
1018 qh->dummy_td->status |= __constant_cpu_to_le32(TD_CTRL_ACTIVE); 1016 qh->dummy_td->status |= cpu_to_le32(TD_CTRL_ACTIVE);
1019 qh->dummy_td = td; 1017 qh->dummy_td = td;
1020 1018
1021 usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe), 1019 usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe),
@@ -1317,7 +1315,7 @@ static int uhci_submit_isochronous(struct uhci_hcd *uhci, struct urb *urb,
1317 } 1315 }
1318 1316
1319 /* Set the interrupt-on-completion flag on the last packet. */ 1317 /* Set the interrupt-on-completion flag on the last packet. */
1320 td->status |= __constant_cpu_to_le32(TD_CTRL_IOC); 1318 td->status |= cpu_to_le32(TD_CTRL_IOC);
1321 1319
1322 /* Add the TDs to the frame list */ 1320 /* Add the TDs to the frame list */
1323 frame = urb->start_frame; 1321 frame = urb->start_frame;
@@ -1494,11 +1492,10 @@ __acquires(uhci->lock)
1494 1492
1495 if (qh->type == USB_ENDPOINT_XFER_CONTROL) { 1493 if (qh->type == USB_ENDPOINT_XFER_CONTROL) {
1496 1494
1497 /* urb->actual_length < 0 means the setup transaction didn't 1495 /* Subtract off the length of the SETUP packet from
1498 * complete successfully. Either it failed or the URB was 1496 * urb->actual_length.
1499 * unlinked first. Regardless, don't confuse people with a 1497 */
1500 * negative length. */ 1498 urb->actual_length -= min_t(u32, 8, urb->actual_length);
1501 urb->actual_length = max(urb->actual_length, 0);
1502 } 1499 }
1503 1500
1504 /* When giving back the first URB in an Isochronous queue, 1501 /* When giving back the first URB in an Isochronous queue,