\r
@param HubIf The HUB that has the device connected.\r
@param Port The port index of the hub (started with zero).\r
+ @param ResetIsNeeded The boolean to control whether skip the reset of the port.\r
\r
@retval EFI_SUCCESS The device is enumerated (added or removed).\r
@retval EFI_OUT_OF_RESOURCES Failed to allocate resource for the device.\r
EFI_STATUS\r
UsbEnumerateNewDev (\r
IN USB_INTERFACE *HubIf,\r
- IN UINT8 Port\r
+ IN UINT8 Port,\r
+ IN BOOLEAN ResetIsNeeded\r
)\r
{\r
USB_BUS *Bus;\r
// and the hub is a EHCI root hub, ResetPort will release\r
// the device to its companion UHCI and return an error.\r
//\r
- Status = HubApi->ResetPort (HubIf, Port);\r
-\r
- if (EFI_ERROR (Status)) {\r
- DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: failed to reset port %d - %r\n", Port, Status));\r
-\r
- return Status;\r
+ if (ResetIsNeeded) {\r
+ Status = HubApi->ResetPort (HubIf, Port);\r
+ if (EFI_ERROR (Status)) {\r
+ DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: failed to reset port %d - %r\n", Port, Status));\r
+ \r
+ return Status;\r
+ }\r
+ DEBUG (( EFI_D_INFO, "UsbEnumerateNewDev: hub port %d is reset\n", Port));\r
+ } else {\r
+ DEBUG (( EFI_D_INFO, "UsbEnumerateNewDev: hub port %d reset is skipped\n", Port));\r
}\r
\r
- DEBUG (( EFI_D_INFO, "UsbEnumerateNewDev: hub port %d is reset\n", Port));\r
-\r
Child = UsbCreateDevice (HubIf, Port);\r
\r
if (Child == NULL) {\r
// Now, new device connected, enumerate and configure the device \r
//\r
DEBUG (( EFI_D_INFO, "UsbEnumeratePort: new device connected at port %d\n", Port));\r
- Status = UsbEnumerateNewDev (HubIf, Port);\r
+ if (USB_BIT_IS_SET (PortState.PortChangeStatus, USB_PORT_STAT_C_RESET)) {\r
+ Status = UsbEnumerateNewDev (HubIf, Port, FALSE);\r
+ } else {\r
+ Status = UsbEnumerateNewDev (HubIf, Port, TRUE);\r
+ }\r
\r
} else {\r
DEBUG (( EFI_D_INFO, "UsbEnumeratePort: device disconnected event on port %d\n", Port));\r