diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2013-12-27 13:41:28 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2014-01-29 12:57:01 -0500 |
commit | 1b830fe763d49724a2c03a97931b7300073715ee (patch) | |
tree | 3af5313cc7f742f727b6ed01c9b9e97804ca256f | |
parent | 6bdc59fbca7e9279023aecde6c6b1c2a3fab152c (diff) | |
download | seabios-1b830fe763d49724a2c03a97931b7300073715ee.zip seabios-1b830fe763d49724a2c03a97931b7300073715ee.tar.gz seabios-1b830fe763d49724a2c03a97931b7300073715ee.tar.bz2 |
xhci: Fix incorrect direction setting on status transmissions.
The status part of a control message was likely to have an incorrect
direction set.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r-- | src/hw/usb-xhci.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/hw/usb-xhci.c b/src/hw/usb-xhci.c index d0df6ee..0833cb9 100644 --- a/src/hw/usb-xhci.c +++ b/src/hw/usb-xhci.c @@ -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) { |