EHCI: Simplify short packet logic to use alternate pointer.
The alternate pointer is the software equivalent of the alternate physical address in the hardware queue head part. The controller follows that path, so we can follow the alternate pointer as well. Simplifies and generalizes the logic.
This commit is contained in:
@@ -1646,19 +1646,16 @@ EHCI::FinishTransfers()
|
||||
if (((status >> EHCI_QTD_PID_SHIFT) & EHCI_QTD_PID_MASK)
|
||||
== EHCI_QTD_PID_IN
|
||||
&& ((status >> EHCI_QTD_BYTES_SHIFT) & EHCI_QTD_BYTES_MASK)
|
||||
!=0) {
|
||||
// a short packet condition existed on this descriptor
|
||||
if ((transfer->transfer->TransferPipe()->Type()
|
||||
& USB_OBJECT_CONTROL_PIPE) != 0) {
|
||||
// for control pipes, the next descriptor
|
||||
// executed is the Status descriptor
|
||||
while (!(descriptor->next_phy & EHCI_ITEM_TERMINATE)) {
|
||||
descriptor = descriptor->next_log;
|
||||
}
|
||||
!= 0) {
|
||||
// a short packet condition existed on this descriptor,
|
||||
// follow the alternate next pointer if set
|
||||
if (descriptor->alt_next_log != NULL) {
|
||||
descriptor = descriptor->alt_next_log;
|
||||
continue;
|
||||
}
|
||||
// for bulk/interrupt pipes, no other descriptors are
|
||||
// executed
|
||||
|
||||
// no alternate next, transfer is done
|
||||
callbackStatus = B_OK;
|
||||
transferDone = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ typedef struct ehci_qtd {
|
||||
// Software Part
|
||||
uint32 this_phy;
|
||||
struct ehci_qtd *next_log;
|
||||
void *alt_next_log;
|
||||
struct ehci_qtd *alt_next_log;
|
||||
size_t buffer_size;
|
||||
void *buffer_log;
|
||||
} _PACKED ehci_qtd;
|
||||
|
||||
Reference in New Issue
Block a user