summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c
diff options
context:
space:
mode:
authoryshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524>2007-10-08 06:14:13 +0000
committeryshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524>2007-10-08 06:14:13 +0000
commit41e8ff2781f3ca14f73ef5f39e781ccba8cb373d (patch)
tree8fd7edcbb8c98bf324db6e2b043b3603abf67158 /MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c
parentba5711102a63d081cb388289983a0e2734e42fb5 (diff)
Fixed unexpected timeout in Usb MassStorage Driver.
Fixed unexpected timeout in Uhci/Ehci driver. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4038 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c')
-rw-r--r--MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c
index 795f545b7..8a69ca6ec 100644
--- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c
+++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c
@@ -745,7 +745,7 @@ UsbHubInit (
UsbHubCtrlSetPortFeature (HubIf->Device, Index, (EFI_USB_PORT_FEATURE) USB_HUB_PORT_POWER);
}
- gBS->Stall (HubDesc.PwrOn2PwrGood * 2 * USB_STALL_1_MS);
+ gBS->Stall (HubDesc.PwrOn2PwrGood * USB_SET_PORT_POWER_STALL);
UsbHubAckHubStatus (HubIf->Device);
DEBUG (( EFI_D_INFO, "UsbHubInit: hub %d initialized\n", HubDev->Address));
@@ -915,14 +915,14 @@ UsbHubResetPort (
// Drive the reset signal for at least 10ms. Check USB 2.0 Spec
// section 7.1.7.5 for timing requirements.
//
- gBS->Stall (20 * USB_STALL_1_MS);
+ gBS->Stall (USB_SET_PORT_RESET_STALL);
//
// USB hub will clear RESET bit if reset is actually finished.
//
ZeroMem (&PortState, sizeof (EFI_USB_PORT_STATUS));
- for (Index = 0; Index < 20; Index++) {
+ for (Index = 0; Index < USB_WAIT_PORT_STS_CHANGE_LOOP; Index++) {
Status = UsbHubGetPortStatus (HubIf, Port, &PortState);
if (!EFI_ERROR (Status) &&
@@ -931,7 +931,7 @@ UsbHubResetPort (
return EFI_SUCCESS;
}
- gBS->Stall (5 * USB_STALL_1_MS);
+ gBS->Stall (USB_WAIT_PORT_STS_CHANGE_STALL);
}
return EFI_TIMEOUT;
@@ -1228,7 +1228,7 @@ UsbRootHubResetPort (
// Drive the reset signal for at least 50ms. Check USB 2.0 Spec
// section 7.1.7.5 for timing requirements.
//
- gBS->Stall (50 * USB_STALL_1_MS);
+ gBS->Stall (USB_SET_ROOT_PORT_RESET_STALL);
Status = UsbHcClearRootHubPortFeature (Bus, Port, EfiUsbPortReset);
@@ -1237,7 +1237,7 @@ UsbRootHubResetPort (
return Status;
}
- gBS->Stall (USB_STALL_1_MS);
+ gBS->Stall (USB_CLR_ROOT_PORT_RESET_STALL);
//
// USB host controller won't clear the RESET bit until
@@ -1245,7 +1245,7 @@ UsbRootHubResetPort (
//
ZeroMem (&PortState, sizeof (EFI_USB_PORT_STATUS));
- for (Index = 0; Index < USB_HUB_LOOP; Index++) {
+ for (Index = 0; Index < USB_WAIT_PORT_STS_CHANGE_LOOP; Index++) {
Status = UsbHcGetRootHubPortStatus (Bus, Port, &PortState);
if (EFI_ERROR (Status)) {
@@ -1256,11 +1256,11 @@ UsbRootHubResetPort (
break;
}
- gBS->Stall (10 * USB_STALL_1_MS);
+ gBS->Stall (USB_WAIT_PORT_STS_CHANGE_STALL);
}
- if (Index == USB_HUB_LOOP) {
- DEBUG (( EFI_D_ERROR, "UsbRootHubResetPort: reset not finished in time on port %d\n", Port));
+ if (Index == USB_WAIT_PORT_STS_CHANGE_LOOP) {
+ DEBUG ((EFI_D_ERROR, "UsbRootHubResetPort: reset not finished in time on port %d\n", Port));
return EFI_TIMEOUT;
}
@@ -1286,7 +1286,7 @@ UsbRootHubResetPort (
return Status;
}
- gBS->Stall (20 * USB_STALL_1_MS);
+ gBS->Stall (USB_SET_ROOT_PORT_ENABLE_STALL);
}
}