From a032c53420bcfa71ac1eba298fcaa2f6f0ba74d9 Mon Sep 17 00:00:00 2001
From: Akshay Jaggi <akshay1994.leo@gmail.com>
Date: Sat, 24 May 2014 13:15:11 +0000
Subject: [PATCH] Fix Short Packet EHCI Control Transfers
---
src/add-ons/kernel/busses/usb/ehci.cpp | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/add-ons/kernel/busses/usb/ehci.cpp b/src/add-ons/kernel/busses/usb/ehci.cpp
index aeed838..0e4fb01 100644
a
|
b
|
EHCI::FinishTransfers()
|
1549 | 1549 | |
1550 | 1550 | while (descriptor) { |
1551 | 1551 | uint32 status = descriptor->token; |
1552 | | if (status & EHCI_QTD_STATUS_ACTIVE) { |
| 1552 | if ((status & EHCI_QTD_STATUS_ACTIVE) != 0 |
| 1553 | && ((status >> EHCI_QTD_BYTES_SHIFT) & EHCI_QTD_BYTES_MASK) |
| 1554 | != 0 ) { |
1553 | 1555 | // still in progress |
1554 | 1556 | TRACE("qtd (0x%08" B_PRIx32 ") still active\n", descriptor->this_phy); |
1555 | 1557 | break; |
… |
… |
EHCI::FillQueueWithRequest(Transfer *transfer, ehci_qh *queueHead,
|
2107 | 2109 | transfer->VectorCount()); |
2108 | 2110 | } |
2109 | 2111 | |
2110 | | LinkDescriptors(setupDescriptor, dataDescriptor, strayDescriptor); |
2111 | | LinkDescriptors(lastDescriptor, statusDescriptor, strayDescriptor); |
| 2112 | LinkDescriptors(setupDescriptor, dataDescriptor, statusDescriptor); |
| 2113 | LinkDescriptors(lastDescriptor, statusDescriptor, statusDescriptor); |
2112 | 2114 | } else { |
2113 | 2115 | // no data: link setup and status descriptors directly |
2114 | | LinkDescriptors(setupDescriptor, statusDescriptor, strayDescriptor); |
| 2116 | LinkDescriptors(setupDescriptor, statusDescriptor, statusDescriptor); |
2115 | 2117 | } |
2116 | 2118 | |
2117 | 2119 | queueHead->element_log = setupDescriptor; |