Account for full-/lowspeed errors and ensure an error is set.

For full- and lowspeed devices the unused ping status bit works as an
additional error bit (albeit it's so generic that it isn't really
useful). Include that bit when the error counter counts down to zero.

Also ensure that an error is returned if the error counter reaches
zero, but print a warning if none of the describing bits are set.
This commit is contained in:
Michael Lotz
2011-12-05 01:42:23 +01:00
parent 30fc876c38
commit ef2eaedc2e
2 changed files with 16 additions and 0 deletions
+15
View File
@@ -1500,9 +1500,24 @@ EHCI::FinishTransfers()
callbackStatus = B_DEV_CRC_ERROR;
reasons++;
}
if ((transfer->queue_head->endpoint_chars
& EHCI_QH_CHARS_EPS_HIGH) == 0) {
// For full-/lowspeed endpoints the unused ping
// state bit is used as another error bit, it is
// unspecific however.
if ((status & EHCI_QTD_STATUS_LS_ERR) != 0) {
callbackStatus = B_DEV_STALLED;
reasons++;
}
}
if (reasons > 1)
callbackStatus = B_DEV_MULTIPLE_ERRORS;
else if (reasons == 0) {
TRACE_ERROR("error counter counted down to zero "
"but none of the error bits are set\n");
callbackStatus = B_DEV_STALLED;
}
} else if (status & EHCI_QTD_STATUS_BABBLE) {
// there is a babble condition
callbackStatus = transfer->incoming ? B_DEV_FIFO_OVERRUN : B_DEV_FIFO_UNDERRUN;
@@ -237,6 +237,7 @@ typedef struct ehci_qtd {
#define EHCI_QTD_STATUS_MISSED (1 << 2) // Missed Micro-Frame
#define EHCI_QTD_STATUS_SPLIT (1 << 1) // Split Transaction State
#define EHCI_QTD_STATUS_PING (1 << 0) // Ping State
#define EHCI_QTD_STATUS_LS_ERR (1 << 0) // Full-/Lowspeed Error
#define EHCI_QTD_PAGE_MASK 0xfffff000