usb: hub port reset is also done when the port status reset bit is zero.

* encountered on QEmu 1.6.50 with nec-usb-xhci and usb-storage devices.
This commit is contained in:
Jérôme Duval
2013-11-09 14:34:37 +01:00
parent f559e51835
commit c5e233d388
+6 -3
View File
@@ -157,14 +157,17 @@ Hub::ResetPort(uint8 index)
if (result < B_OK)
return result;
if (fPortStatus[index].change & PORT_STATUS_RESET) {
if ((fPortStatus[index].change & PORT_STATUS_RESET) != 0
|| (fPortStatus[index].status & PORT_STATUS_RESET) == 0) {
// reset is done
break;
}
}
if ((fPortStatus[index].change & PORT_STATUS_RESET) == 0) {
TRACE_ERROR("port %d won't reset\n", index);
if ((fPortStatus[index].change & PORT_STATUS_RESET) == 0
&& (fPortStatus[index].status & PORT_STATUS_RESET) != 0) {
TRACE_ERROR("port %d won't reset (%#x, %#x)\n", index,
fPortStatus[index].change, fPortStatus[index].status);
return B_ERROR;
}