]> xenbits.xensource.com Git - seabios.git/commitdiff
xhci: Fix incorrect direction setting on status transmissions.
authorKevin O'Connor <kevin@koconnor.net>
Fri, 27 Dec 2013 18:41:28 +0000 (13:41 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Wed, 29 Jan 2014 17:57:01 +0000 (12:57 -0500)
The status part of a control message was likely to have an incorrect
direction set.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/hw/usb-xhci.c

index d0df6ee628e6813cf6fee704d3e91abb01877111..0833cb9f2b1b94690fb27bca7b2a45e2ce354e42 100644 (file)
@@ -621,7 +621,7 @@ static void xhci_xfer_data(struct xhci_pipe *pipe,
     xhci_xfer_queue(pipe, &trb);
 }
 
-static void xhci_xfer_status(struct xhci_pipe *pipe, int dir)
+static void xhci_xfer_status(struct xhci_pipe *pipe, int dir, int datalen)
 {
     ASSERT32FLAT();
     struct xhci_trb trb;
@@ -629,7 +629,7 @@ static void xhci_xfer_status(struct xhci_pipe *pipe, int dir)
     memset(&trb, 0, sizeof(trb));
     trb.control  |= (TR_STATUS << 10); // trb type
     trb.control  |= TRB_TR_IOC;
-    if (dir)
+    if (!datalen || !dir)
         trb.control |= (1 << 16);
 
     xhci_xfer_queue(pipe, &trb);
@@ -1007,7 +1007,7 @@ xhci_control(struct usb_pipe *p, int dir, const void *cmd, int cmdsize
     xhci_xfer_setup(pipe, req, dir, datalen);
     if (datalen)
         xhci_xfer_data(pipe, dir, data, datalen);
-    xhci_xfer_status(pipe, dir);
+    xhci_xfer_status(pipe, dir, datalen);
 
     cc = xhci_event_wait(xhci, &pipe->reqs, 1000);
     if (cc != CC_SUCCESS) {