]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Bus/Pci/Uhci/Dxe/uhci.c
Add some definitions for efi event in Uefi/UefiSpec.h to follow spec.
[mirror_edk2.git] / EdkModulePkg / Bus / Pci / Uhci / Dxe / uhci.c
index b3cb1f543dab18ef324a700f258212fc10aa2ae5..7cb9605066df040370efa4328193681e9897717f 100644 (file)
@@ -1,20 +1,20 @@
 /*++\r
 \r
 /*++\r
 \r
-Copyright (c) 2006, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+Copyright (c) 2006, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
 Module Name:\r
 \r
     Uhci.c\r
 \r
 Module Name:\r
 \r
     Uhci.c\r
-    \r
-Abstract: \r
-    \r
+\r
+Abstract:\r
+\r
 \r
 Revision History\r
 --*/\r
 \r
 Revision History\r
 --*/\r
@@ -144,13 +144,13 @@ UHCIDriverBindingStart (
     EFI_OUT_OF_RESOURCES\r
 \r
 --*/\r
     EFI_OUT_OF_RESOURCES\r
 \r
 --*/\r
-{ \r
-  EFI_STATUS              Status; \r
-  UINTN                   FlBaseAddrReg; \r
-  EFI_PCI_IO_PROTOCOL     *PciIo; \r
+{\r
+  EFI_STATUS              Status;\r
+  UINTN                   FlBaseAddrReg;\r
+  EFI_PCI_IO_PROTOCOL     *PciIo;\r
   USB_HC_DEV              *HcDev;\r
   UINT64                  Supports;\r
   USB_HC_DEV              *HcDev;\r
   UINT64                  Supports;\r
-  \r
+\r
   HcDev = NULL;\r
 \r
   Status = gBS->OpenProtocol (\r
   HcDev = NULL;\r
 \r
   Status = gBS->OpenProtocol (\r
@@ -249,10 +249,10 @@ UHCIDriverBindingStart (
   HcDev->Usb2Hc.GetRootHubPortStatus     = UHCI2GetRootHubPortStatus;\r
   HcDev->Usb2Hc.SetRootHubPortFeature    = UHCI2SetRootHubPortFeature;\r
   HcDev->Usb2Hc.ClearRootHubPortFeature  = UHCI2ClearRootHubPortFeature;\r
   HcDev->Usb2Hc.GetRootHubPortStatus     = UHCI2GetRootHubPortStatus;\r
   HcDev->Usb2Hc.SetRootHubPortFeature    = UHCI2SetRootHubPortFeature;\r
   HcDev->Usb2Hc.ClearRootHubPortFeature  = UHCI2ClearRootHubPortFeature;\r
-  \r
+\r
   HcDev->Usb2Hc.MajorRevision            = 0x1;\r
   HcDev->Usb2Hc.MinorRevision            = 0x1;\r
   HcDev->Usb2Hc.MajorRevision            = 0x1;\r
   HcDev->Usb2Hc.MinorRevision            = 0x1;\r
-  \r
+\r
   //\r
   //  Init UHCI private data structures\r
   //\r
   //\r
   //  Init UHCI private data structures\r
   //\r
@@ -289,8 +289,8 @@ UHCIDriverBindingStart (
   //  Create timer for interrupt transfer result polling\r
   //\r
   Status = gBS->CreateEvent (\r
   //  Create timer for interrupt transfer result polling\r
   //\r
   Status = gBS->CreateEvent (\r
-                  EFI_EVENT_TIMER | EFI_EVENT_NOTIFY_SIGNAL,\r
-                  EFI_TPL_NOTIFY,\r
+                  EVT_TIMER | EVT_NOTIFY_SIGNAL,\r
+                  TPL_NOTIFY,\r
                   MonitorInterruptTrans,\r
                   HcDev,\r
                   &HcDev->InterruptTransTimer\r
                   MonitorInterruptTrans,\r
                   HcDev,\r
                   &HcDev->InterruptTransTimer\r
@@ -337,7 +337,7 @@ UHCIDriverBindingStart (
            );\r
     return EFI_UNSUPPORTED;\r
   }\r
            );\r
     return EFI_UNSUPPORTED;\r
   }\r
-  \r
+\r
   //\r
   // QH,TD structures must in common buffer that will be\r
   // accessed by both cpu and usb bus master at the same time.\r
   //\r
   // QH,TD structures must in common buffer that will be\r
   // accessed by both cpu and usb bus master at the same time.\r
@@ -345,9 +345,9 @@ UHCIDriverBindingStart (
   //\r
   Status = InitializeMemoryManagement (HcDev);\r
   if (EFI_ERROR (Status)) {\r
   //\r
   Status = InitializeMemoryManagement (HcDev);\r
   if (EFI_ERROR (Status)) {\r
-  \r
+\r
     gBS->CloseEvent (HcDev->InterruptTransTimer);\r
     gBS->CloseEvent (HcDev->InterruptTransTimer);\r
-    \r
+\r
     FreeFrameListEntry (HcDev);\r
 \r
     if (HcDev != NULL) {\r
     FreeFrameListEntry (HcDev);\r
 \r
     if (HcDev != NULL) {\r
@@ -355,9 +355,9 @@ UHCIDriverBindingStart (
     }\r
 \r
     gBS->CloseProtocol (\r
     }\r
 \r
     gBS->CloseProtocol (\r
-           Controller, \r
-           &gEfiPciIoProtocolGuid, \r
-           This->DriverBindingHandle,   \r
+           Controller,\r
+           &gEfiPciIoProtocolGuid,\r
+           This->DriverBindingHandle,\r
            Controller\r
            );\r
     return Status;\r
            Controller\r
            );\r
     return Status;\r
@@ -417,7 +417,7 @@ UHCIDriverBindingStart (
 \r
     return Status;\r
   }\r
 \r
     return Status;\r
   }\r
-  \r
+\r
   //\r
   // component name protocol.\r
   //\r
   //\r
   // component name protocol.\r
   //\r
@@ -461,13 +461,13 @@ UnInstallUHCInterface (
          &gEfiUsbHcProtocolGuid,\r
          &HcDev->UsbHc\r
          );\r
          &gEfiUsbHcProtocolGuid,\r
          &HcDev->UsbHc\r
          );\r
-         \r
+\r
   gBS->UninstallProtocolInterface (\r
          Controller,\r
          &gEfiUsb2HcProtocolGuid,\r
          &HcDev->Usb2Hc\r
          );\r
   gBS->UninstallProtocolInterface (\r
          Controller,\r
          &gEfiUsb2HcProtocolGuid,\r
          &HcDev->Usb2Hc\r
          );\r
-  //     \r
+  //\r
   // first stop USB Host Controller\r
   //\r
   This->SetState (This, EfiUsbHcStateHalt);\r
   // first stop USB Host Controller\r
   //\r
   This->SetState (This, EfiUsbHcStateHalt);\r
@@ -610,35 +610,35 @@ UHCIReset (
   IN UINT16                  Attributes\r
   )\r
 /*++\r
   IN UINT16                  Attributes\r
   )\r
 /*++\r
-  \r
+\r
   Routine Description:\r
     Provides software reset for the USB host controller.\r
   Routine Description:\r
     Provides software reset for the USB host controller.\r
-  \r
+\r
   Arguments:\r
   Arguments:\r
-  \r
-  This        A pointer to the EFI_USB_HC_PROTOCOL instance.  \r
-  \r
-  Attributes  A bit mask of the reset operation to perform. \r
+\r
+  This        A pointer to the EFI_USB_HC_PROTOCOL instance.\r
+\r
+  Attributes  A bit mask of the reset operation to perform.\r
               See below for a list of the supported bit mask values.\r
               See below for a list of the supported bit mask values.\r
-  \r
+\r
   #define EFI_USB_HC_RESET_GLOBAL           0x0001\r
   #define EFI_USB_HC_RESET_HOST_CONTROLLER  0x0002\r
 \r
   #define EFI_USB_HC_RESET_GLOBAL           0x0001\r
   #define EFI_USB_HC_RESET_HOST_CONTROLLER  0x0002\r
 \r
-  EFI_USB_HC_RESET_GLOBAL \r
+  EFI_USB_HC_RESET_GLOBAL\r
         If this bit is set, a global reset signal will be sent to the USB bus.\r
         If this bit is set, a global reset signal will be sent to the USB bus.\r
-        This resets all of the USB bus logic, including the USB host \r
+        This resets all of the USB bus logic, including the USB host\r
         controller hardware and all the devices attached on the USB bus.\r
         controller hardware and all the devices attached on the USB bus.\r
-  EFI_USB_HC_RESET_HOST_CONTROLLER  \r
-        If this bit is set, the USB host controller hardware will be reset. \r
+  EFI_USB_HC_RESET_HOST_CONTROLLER\r
+        If this bit is set, the USB host controller hardware will be reset.\r
         No reset signal will be sent to the USB bus.\r
         No reset signal will be sent to the USB bus.\r
-  \r
+\r
   Returns:\r
   Returns:\r
-    EFI_SUCCESS \r
+    EFI_SUCCESS\r
         The reset operation succeeded.\r
         The reset operation succeeded.\r
-    EFI_INVALID_PARAMETER \r
+    EFI_INVALID_PARAMETER\r
         Attributes is not valid.\r
         Attributes is not valid.\r
-    EFI_DEVICE_ERROR  \r
-        An error was encountered while attempting to perform \r
+    EFI_DEVICE_ERROR\r
+        An error was encountered while attempting to perform\r
         the reset operation.\r
 --*/\r
 {\r
         the reset operation.\r
 --*/\r
 {\r
@@ -736,7 +736,7 @@ UHCIReset (
   if (!Match) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
   if (!Match) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   //\r
   // Delete all old transactions on the USB bus\r
   //\r
   //\r
   // Delete all old transactions on the USB bus\r
   //\r
@@ -767,33 +767,33 @@ UHCIGetState (
   OUT EFI_USB_HC_STATE        *State\r
   )\r
 /*++\r
   OUT EFI_USB_HC_STATE        *State\r
   )\r
 /*++\r
-  \r
+\r
   Routine Description:\r
     Retrieves current state of the USB host controller.\r
   Routine Description:\r
     Retrieves current state of the USB host controller.\r
-  \r
+\r
   Arguments:\r
   Arguments:\r
-    \r
+\r
     This      A pointer to the EFI_USB_HC_PROTOCOL instance.\r
     This      A pointer to the EFI_USB_HC_PROTOCOL instance.\r
-    \r
-    State     A pointer to the EFI_USB_HC_STATE data structure that \r
-              indicates current state of the USB host controller.  \r
+\r
+    State     A pointer to the EFI_USB_HC_STATE data structure that\r
+              indicates current state of the USB host controller.\r
               Type EFI_USB_HC_STATE is defined below.\r
               Type EFI_USB_HC_STATE is defined below.\r
-              \r
+\r
     typedef enum {\r
       EfiUsbHcStateHalt,\r
       EfiUsbHcStateOperational,\r
       EfiUsbHcStateSuspend,\r
       EfiUsbHcStateMaximum\r
     } EFI_USB_HC_STATE;\r
     typedef enum {\r
       EfiUsbHcStateHalt,\r
       EfiUsbHcStateOperational,\r
       EfiUsbHcStateSuspend,\r
       EfiUsbHcStateMaximum\r
     } EFI_USB_HC_STATE;\r
-  \r
+\r
   Returns:\r
   Returns:\r
-    EFI_SUCCESS \r
+    EFI_SUCCESS\r
             The state information of the host controller was returned in State.\r
             The state information of the host controller was returned in State.\r
-    EFI_INVALID_PARAMETER \r
+    EFI_INVALID_PARAMETER\r
             State is NULL.\r
             State is NULL.\r
-    EFI_DEVICE_ERROR  \r
-            An error was encountered while attempting to retrieve the \r
-            host controller's current state.  \r
+    EFI_DEVICE_ERROR\r
+            An error was encountered while attempting to retrieve the\r
+            host controller's current state.\r
 --*/\r
 {\r
   USB_HC_DEV  *HcDev;\r
 --*/\r
 {\r
   USB_HC_DEV  *HcDev;\r
@@ -853,24 +853,24 @@ UHCISetState (
   IN EFI_USB_HC_STATE        State\r
   )\r
 /*++\r
   IN EFI_USB_HC_STATE        State\r
   )\r
 /*++\r
-  \r
+\r
   Routine Description:\r
     Sets the USB host controller to a specific state.\r
   Routine Description:\r
     Sets the USB host controller to a specific state.\r
-  \r
+\r
   Arguments:\r
   Arguments:\r
-    \r
+\r
     This      A pointer to the EFI_USB_HC_PROTOCOL instance.\r
 \r
     State     Indicates the state of the host controller that will be set.\r
     This      A pointer to the EFI_USB_HC_PROTOCOL instance.\r
 \r
     State     Indicates the state of the host controller that will be set.\r
-  \r
+\r
   Returns:\r
   Returns:\r
-    EFI_SUCCESS \r
-          The USB host controller was successfully placed in the state \r
+    EFI_SUCCESS\r
+          The USB host controller was successfully placed in the state\r
           specified by State.\r
           specified by State.\r
-    EFI_INVALID_PARAMETER \r
+    EFI_INVALID_PARAMETER\r
           State is invalid.\r
           State is invalid.\r
-    EFI_DEVICE_ERROR  \r
-          Failed to set the state specified by State due to device error.  \r
+    EFI_DEVICE_ERROR\r
+          Failed to set the state specified by State due to device error.\r
 --*/\r
 {\r
   USB_HC_DEV        *HcDev;\r
 --*/\r
 {\r
   USB_HC_DEV        *HcDev;\r
@@ -970,7 +970,7 @@ UHCISetState (
       if (EFI_ERROR (Status)) {\r
         return EFI_DEVICE_ERROR;\r
       }\r
       if (EFI_ERROR (Status)) {\r
         return EFI_DEVICE_ERROR;\r
       }\r
-      \r
+\r
       //\r
       // FGR(Force Global Resume) bit is 0\r
       //\r
       //\r
       // FGR(Force Global Resume) bit is 0\r
       //\r
@@ -985,7 +985,7 @@ UHCISetState (
           Command\r
           );\r
       }\r
           Command\r
           );\r
       }\r
-      \r
+\r
       //\r
       // wait 20ms to let resume complete\r
       // (20ms is specified by UHCI spec)\r
       //\r
       // wait 20ms to let resume complete\r
       // (20ms is specified by UHCI spec)\r
@@ -1056,24 +1056,24 @@ UHCIGetRootHubPortNumber (
   OUT UINT8                   *PortNumber\r
   )\r
 /*++\r
   OUT UINT8                   *PortNumber\r
   )\r
 /*++\r
-  \r
+\r
   Routine Description:\r
     Retrieves the number of root hub ports.\r
   Routine Description:\r
     Retrieves the number of root hub ports.\r
-    \r
+\r
   Arguments:\r
   Arguments:\r
-  \r
+\r
     This        A pointer to the EFI_USB_HC_PROTOCOL instance.\r
     This        A pointer to the EFI_USB_HC_PROTOCOL instance.\r
-    \r
+\r
     PortNumber  A pointer to the number of the root hub ports.\r
     PortNumber  A pointer to the number of the root hub ports.\r
-  \r
+\r
   Returns:\r
   Returns:\r
-    EFI_SUCCESS \r
+    EFI_SUCCESS\r
           The port number was retrieved successfully.\r
           The port number was retrieved successfully.\r
-    EFI_INVALID_PARAMETER \r
+    EFI_INVALID_PARAMETER\r
           PortNumber is NULL.\r
           PortNumber is NULL.\r
-    EFI_DEVICE_ERROR  \r
-          An error was encountered while attempting to \r
-          retrieve the port number.  \r
+    EFI_DEVICE_ERROR\r
+          An error was encountered while attempting to\r
+          retrieve the port number.\r
 --*/\r
 {\r
   USB_HC_DEV  *HcDev;\r
 --*/\r
 {\r
   USB_HC_DEV  *HcDev;\r
@@ -1119,29 +1119,29 @@ UHCIGetRootHubPortStatus (
   OUT EFI_USB_PORT_STATUS     *PortStatus\r
   )\r
 /*++\r
   OUT EFI_USB_PORT_STATUS     *PortStatus\r
   )\r
 /*++\r
-  \r
+\r
   Routine Description:\r
     Retrieves the current status of a USB root hub port.\r
   Routine Description:\r
     Retrieves the current status of a USB root hub port.\r
-  \r
+\r
   Arguments:\r
   Arguments:\r
-  \r
+\r
     This        A pointer to the EFI_USB_HC_PROTOCOL.\r
     This        A pointer to the EFI_USB_HC_PROTOCOL.\r
-    \r
-    PortNumber  Specifies the root hub port from which the status \r
-                is to be retrieved.  This value is zero-based. For example, \r
+\r
+    PortNumber  Specifies the root hub port from which the status\r
+                is to be retrieved.  This value is zero-based. For example,\r
                 if a root hub has two ports, then the first port is numbered 0,\r
                 and the second port is numbered 1.\r
                 if a root hub has two ports, then the first port is numbered 0,\r
                 and the second port is numbered 1.\r
-    \r
-    PortStatus  A pointer to the current port status bits and \r
-                port status change bits.  \r
-  \r
+\r
+    PortStatus  A pointer to the current port status bits and\r
+                port status change bits.\r
+\r
   Returns:\r
   Returns:\r
-    EFI_SUCCESS \r
-        The status of the USB root hub port specified by PortNumber \r
+    EFI_SUCCESS\r
+        The status of the USB root hub port specified by PortNumber\r
         was returned in PortStatus.\r
         was returned in PortStatus.\r
-    EFI_INVALID_PARAMETER \r
-        PortNumber is invalid. \r
-    EFI_DEVICE_ERROR - Can't read register      \r
+    EFI_INVALID_PARAMETER\r
+        PortNumber is invalid.\r
+    EFI_DEVICE_ERROR - Can't read register\r
 --*/\r
 {\r
   USB_HC_DEV  *HcDev;\r
 --*/\r
 {\r
   USB_HC_DEV  *HcDev;\r
@@ -1180,7 +1180,7 @@ UHCIGetRootHubPortStatus (
   //\r
   //    Fill Port Status bits\r
   //\r
   //\r
   //    Fill Port Status bits\r
   //\r
-  \r
+\r
   //\r
   // Current Connect Status\r
   //\r
   //\r
   // Current Connect Status\r
   //\r
@@ -1193,21 +1193,21 @@ UHCIGetRootHubPortStatus (
   if (RHPortStatus & USBPORTSC_PED) {\r
     PortStatus->PortStatus |= USB_PORT_STAT_ENABLE;\r
   }\r
   if (RHPortStatus & USBPORTSC_PED) {\r
     PortStatus->PortStatus |= USB_PORT_STAT_ENABLE;\r
   }\r
-  \r
+\r
   //\r
   // Port Suspend\r
   //\r
   if (RHPortStatus & USBPORTSC_SUSP) {\r
     PortStatus->PortStatus |= USB_PORT_STAT_SUSPEND;\r
   }\r
   //\r
   // Port Suspend\r
   //\r
   if (RHPortStatus & USBPORTSC_SUSP) {\r
     PortStatus->PortStatus |= USB_PORT_STAT_SUSPEND;\r
   }\r
-  \r
+\r
   //\r
   // Port Reset\r
   //\r
   if (RHPortStatus & USBPORTSC_PR) {\r
     PortStatus->PortStatus |= USB_PORT_STAT_RESET;\r
   }\r
   //\r
   // Port Reset\r
   //\r
   if (RHPortStatus & USBPORTSC_PR) {\r
     PortStatus->PortStatus |= USB_PORT_STAT_RESET;\r
   }\r
-  \r
+\r
   //\r
   // Low Speed Device Attached\r
   //\r
   //\r
   // Low Speed Device Attached\r
   //\r
@@ -1221,14 +1221,14 @@ UHCIGetRootHubPortStatus (
   //\r
   //   Fill Port Status Change bits\r
   //\r
   //\r
   //   Fill Port Status Change bits\r
   //\r
-  \r
+\r
   //\r
   // Connect Status Change\r
   //\r
   if (RHPortStatus & USBPORTSC_CSC) {\r
     PortStatus->PortChangeStatus |= USB_PORT_STAT_C_CONNECTION;\r
   }\r
   //\r
   // Connect Status Change\r
   //\r
   if (RHPortStatus & USBPORTSC_CSC) {\r
     PortStatus->PortChangeStatus |= USB_PORT_STAT_C_CONNECTION;\r
   }\r
-  \r
+\r
   //\r
   // Port Enabled/Disabled Change\r
   //\r
   //\r
   // Port Enabled/Disabled Change\r
   //\r
@@ -1247,25 +1247,25 @@ UHCISetRootHubPortFeature (
   IN  EFI_USB_PORT_FEATURE    PortFeature\r
   )\r
 /*++\r
   IN  EFI_USB_PORT_FEATURE    PortFeature\r
   )\r
 /*++\r
-  \r
+\r
   Routine Description:\r
     Sets a feature for the specified root hub port.\r
   Routine Description:\r
     Sets a feature for the specified root hub port.\r
-  \r
+\r
   Arguments:\r
   Arguments:\r
-  \r
+\r
     This        A pointer to the EFI_USB_HC_PROTOCOL.\r
     This        A pointer to the EFI_USB_HC_PROTOCOL.\r
-    \r
-    PortNumber  Specifies the root hub port whose feature \r
+\r
+    PortNumber  Specifies the root hub port whose feature\r
                 is requested to be set.\r
                 is requested to be set.\r
-    \r
-    PortFeature Indicates the feature selector associated \r
-                with the feature set request. \r
-  \r
+\r
+    PortFeature Indicates the feature selector associated\r
+                with the feature set request.\r
+\r
   Returns:\r
   Returns:\r
-    EFI_SUCCESS \r
-        The feature specified by PortFeature was set for the \r
+    EFI_SUCCESS\r
+        The feature specified by PortFeature was set for the\r
         USB root hub port specified by PortNumber.\r
         USB root hub port specified by PortNumber.\r
-    EFI_INVALID_PARAMETER \r
+    EFI_INVALID_PARAMETER\r
         PortNumber is invalid or PortFeature is invalid.\r
     EFI_DEVICE_ERROR\r
         Can't read register\r
         PortNumber is invalid or PortFeature is invalid.\r
     EFI_DEVICE_ERROR\r
         Can't read register\r
@@ -1359,25 +1359,25 @@ UHCIClearRootHubPortFeature (
   IN  EFI_USB_PORT_FEATURE    PortFeature\r
   )\r
 /*++\r
   IN  EFI_USB_PORT_FEATURE    PortFeature\r
   )\r
 /*++\r
-  \r
+\r
   Routine Description:\r
     Clears a feature for the specified root hub port.\r
   Routine Description:\r
     Clears a feature for the specified root hub port.\r
-  \r
+\r
   Arguments:\r
   Arguments:\r
-  \r
+\r
     This        A pointer to the EFI_USB_HC_PROTOCOL instance.\r
     This        A pointer to the EFI_USB_HC_PROTOCOL instance.\r
-    \r
-    PortNumber  Specifies the root hub port whose feature \r
+\r
+    PortNumber  Specifies the root hub port whose feature\r
                 is requested to be cleared.\r
                 is requested to be cleared.\r
-    \r
-    PortFeature Indicates the feature selector associated with the \r
+\r
+    PortFeature Indicates the feature selector associated with the\r
                 feature clear request.\r
                 feature clear request.\r
-                  \r
+\r
   Returns:\r
   Returns:\r
-    EFI_SUCCESS \r
-        The feature specified by PortFeature was cleared for the \r
+    EFI_SUCCESS\r
+        The feature specified by PortFeature was cleared for the\r
         USB root hub port specified by PortNumber.\r
         USB root hub port specified by PortNumber.\r
-    EFI_INVALID_PARAMETER \r
+    EFI_INVALID_PARAMETER\r
         PortNumber is invalid or PortFeature is invalid.\r
     EFI_DEVICE_ERROR\r
         Can't read register\r
         PortNumber is invalid or PortFeature is invalid.\r
     EFI_DEVICE_ERROR\r
         Can't read register\r
@@ -1501,54 +1501,54 @@ UHCIControlTransfer (
   OUT      UINT32                     *TransferResult\r
   )\r
 /*++\r
   OUT      UINT32                     *TransferResult\r
   )\r
 /*++\r
-  \r
+\r
   Routine Description:\r
     Submits control transfer to a target USB device.\r
   Routine Description:\r
     Submits control transfer to a target USB device.\r
-  \r
+\r
   Arguments:\r
   Arguments:\r
-    \r
+\r
     This          A pointer to the EFI_USB_HC_PROTOCOL instance.\r
 \r
     DeviceAddress Represents the address of the target device on the USB,\r
                   which is assigned during USB enumeration.\r
 \r
     This          A pointer to the EFI_USB_HC_PROTOCOL instance.\r
 \r
     DeviceAddress Represents the address of the target device on the USB,\r
                   which is assigned during USB enumeration.\r
 \r
-    IsSlowDevice  Indicates whether the target device is slow device \r
+    IsSlowDevice  Indicates whether the target device is slow device\r
                   or full-speed device.\r
                   or full-speed device.\r
-    \r
-    MaximumPacketLength Indicates the maximum packet size that the \r
-                        default control transfer endpoint is capable of \r
+\r
+    MaximumPacketLength Indicates the maximum packet size that the\r
+                        default control transfer endpoint is capable of\r
                         sending or receiving.\r
                         sending or receiving.\r
-    \r
-    Request       A pointer to the USB device request that will be sent \r
-                  to the USB device. \r
-    \r
+\r
+    Request       A pointer to the USB device request that will be sent\r
+                  to the USB device.\r
+\r
     TransferDirection Specifies the data direction for the transfer.\r
     TransferDirection Specifies the data direction for the transfer.\r
-                      There are three values available, DataIn, DataOut \r
+                      There are three values available, DataIn, DataOut\r
                       and NoData.\r
                       and NoData.\r
-    \r
-    Data          A pointer to the buffer of data that will be transmitted \r
+\r
+    Data          A pointer to the buffer of data that will be transmitted\r
                   to USB device or received from USB device.\r
                   to USB device or received from USB device.\r
-    \r
-    DataLength    Indicates the size, in bytes, of the data buffer \r
+\r
+    DataLength    Indicates the size, in bytes, of the data buffer\r
                   specified by Data.\r
                   specified by Data.\r
-    \r
-    TimeOut       Indicates the maximum time, in microseconds, \r
+\r
+    TimeOut       Indicates the maximum time, in microseconds,\r
                   which the transfer is allowed to complete.\r
                   which the transfer is allowed to complete.\r
-    \r
-    TransferResult  A pointer to the detailed result information generated \r
+\r
+    TransferResult  A pointer to the detailed result information generated\r
                     by this control transfer.\r
                     by this control transfer.\r
-                    \r
+\r
   Returns:\r
   Returns:\r
-    EFI_SUCCESS \r
+    EFI_SUCCESS\r
         The control transfer was completed successfully.\r
         The control transfer was completed successfully.\r
-    EFI_OUT_OF_RESOURCES  \r
+    EFI_OUT_OF_RESOURCES\r
         The control transfer could not be completed due to a lack of resources.\r
         The control transfer could not be completed due to a lack of resources.\r
-    EFI_INVALID_PARAMETER \r
+    EFI_INVALID_PARAMETER\r
         Some parameters are invalid.\r
         Some parameters are invalid.\r
-    EFI_TIMEOUT \r
+    EFI_TIMEOUT\r
         The control transfer failed due to timeout.\r
         The control transfer failed due to timeout.\r
-    EFI_DEVICE_ERROR  \r
-        The control transfer failed due to host controller or device error. \r
+    EFI_DEVICE_ERROR\r
+        The control transfer failed due to host controller or device error.\r
         Caller should check TranferResult for detailed error information.\r
 \r
 --*/\r
         Caller should check TranferResult for detailed error information.\r
 \r
 --*/\r
@@ -1602,7 +1602,7 @@ UHCIControlTransfer (
   if (Request == NULL || TransferResult == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
   if (Request == NULL || TransferResult == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   //\r
   // if errors exist that cause host controller halt,\r
   // then return EFI_DEVICE_ERROR.\r
   //\r
   // if errors exist that cause host controller halt,\r
   // then return EFI_DEVICE_ERROR.\r
@@ -1613,7 +1613,7 @@ UHCIControlTransfer (
     *TransferResult = EFI_USB_ERR_SYSTEM;\r
     return EFI_DEVICE_ERROR;\r
   }\r
     *TransferResult = EFI_USB_ERR_SYSTEM;\r
     return EFI_DEVICE_ERROR;\r
   }\r
-  \r
+\r
   //\r
   // low speed usb devices are limited to only an eight-byte\r
   // maximum data payload size\r
   //\r
   // low speed usb devices are limited to only an eight-byte\r
   // maximum data payload size\r
@@ -1622,7 +1622,7 @@ UHCIControlTransfer (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  if (MaximumPacketLength != 8  && \r
+  if (MaximumPacketLength != 8  &&\r
       MaximumPacketLength != 16 &&\r
       MaximumPacketLength != 32 &&\r
       MaximumPacketLength != 64) {\r
       MaximumPacketLength != 16 &&\r
       MaximumPacketLength != 32 &&\r
       MaximumPacketLength != 64) {\r
@@ -1714,7 +1714,7 @@ UHCIControlTransfer (
     HcDev->PciIo->Unmap (HcDev->PciIo, Mapping);\r
     return Status;\r
   }\r
     HcDev->PciIo->Unmap (HcDev->PciIo, Mapping);\r
     return Status;\r
   }\r
-  \r
+\r
   //\r
   // map the Request for bus master access.\r
   // BusMasterRead means cpu write\r
   //\r
   // map the Request for bus master access.\r
   // BusMasterRead means cpu write\r
@@ -1756,7 +1756,7 @@ UHCIControlTransfer (
     HcDev->PciIo->Unmap (HcDev->PciIo, RequestMapping);\r
     return Status;\r
   }\r
     HcDev->PciIo->Unmap (HcDev->PciIo, RequestMapping);\r
     return Status;\r
   }\r
-  \r
+\r
   //\r
   //  Data Stage of Control Transfer\r
   //\r
   //\r
   //  Data Stage of Control Transfer\r
   //\r
@@ -1766,7 +1766,7 @@ UHCIControlTransfer (
     //\r
     // create TD structures and link together\r
     //\r
     //\r
     // create TD structures and link together\r
     //\r
-    \r
+\r
     //\r
     // PktSize is the data load size that each TD carries.\r
     //\r
     //\r
     // PktSize is the data load size that each TD carries.\r
     //\r
@@ -1798,7 +1798,7 @@ UHCIControlTransfer (
       DeleteQueuedTDs (HcDev, PtrFirstDataTD);\r
       return Status;\r
     }\r
       DeleteQueuedTDs (HcDev, PtrFirstDataTD);\r
       return Status;\r
     }\r
-    \r
+\r
     //\r
     // Link two TDs in vertical depth\r
     //\r
     //\r
     // Link two TDs in vertical depth\r
     //\r
@@ -1827,7 +1827,7 @@ UHCIControlTransfer (
   } else {\r
     PktID = OUTPUT_PACKET_ID;\r
   }\r
   } else {\r
     PktID = OUTPUT_PACKET_ID;\r
   }\r
-  \r
+\r
   //\r
   // create Status Stage TD structure\r
   //\r
   //\r
   // create Status Stage TD structure\r
   //\r
@@ -2101,54 +2101,54 @@ UHCIBulkTransfer (
   OUT      UINT32                  *TransferResult\r
   )\r
 /*++\r
   OUT      UINT32                  *TransferResult\r
   )\r
 /*++\r
-  \r
+\r
   Routine Description:\r
     Submits bulk transfer to a bulk endpoint of a USB device.\r
   Routine Description:\r
     Submits bulk transfer to a bulk endpoint of a USB device.\r
-    \r
+\r
   Arguments:\r
   Arguments:\r
-    \r
+\r
     This          A pointer to the EFI_USB_HC_PROTOCOL instance.\r
     This          A pointer to the EFI_USB_HC_PROTOCOL instance.\r
-    \r
+\r
     DeviceAddress Represents the address of the target device on the USB,\r
                   which is assigned during USB enumeration.\r
     DeviceAddress Represents the address of the target device on the USB,\r
                   which is assigned during USB enumeration.\r
-    EndPointAddress   The combination of an endpoint number and an \r
-                      endpoint direction of the target USB device. \r
-                      Each endpoint address supports data transfer in \r
-                      one direction except the control endpoint \r
-                      (whose default endpoint address is 0). \r
-                      It is the caller's responsibility to make sure that \r
-                      the EndPointAddress represents a bulk endpoint. \r
-                      \r
+    EndPointAddress   The combination of an endpoint number and an\r
+                      endpoint direction of the target USB device.\r
+                      Each endpoint address supports data transfer in\r
+                      one direction except the control endpoint\r
+                      (whose default endpoint address is 0).\r
+                      It is the caller's responsibility to make sure that\r
+                      the EndPointAddress represents a bulk endpoint.\r
+\r
     MaximumPacketLength Indicates the maximum packet size the target endpoint\r
                         is capable of sending or receiving.\r
     MaximumPacketLength Indicates the maximum packet size the target endpoint\r
                         is capable of sending or receiving.\r
-                        \r
-    Data          A pointer to the buffer of data that will be transmitted \r
+\r
+    Data          A pointer to the buffer of data that will be transmitted\r
                   to USB device or received from USB device.\r
     DataLength    When input, indicates the size, in bytes, of the data buffer\r
                   to USB device or received from USB device.\r
     DataLength    When input, indicates the size, in bytes, of the data buffer\r
-                  specified by Data. When output, indicates the actually \r
+                  specified by Data. When output, indicates the actually\r
                   transferred data size.\r
                   transferred data size.\r
-                  \r
-    DataToggle    A pointer to the data toggle value. On input, it indicates \r
+\r
+    DataToggle    A pointer to the data toggle value. On input, it indicates\r
                   the initial data toggle value the bulk transfer should adopt;\r
                   the initial data toggle value the bulk transfer should adopt;\r
-                  on output, it is updated to indicate the data toggle value \r
-                  of the subsequent bulk transfer. \r
-                  \r
-    TimeOut       Indicates the maximum time, in microseconds, which the \r
+                  on output, it is updated to indicate the data toggle value\r
+                  of the subsequent bulk transfer.\r
+\r
+    TimeOut       Indicates the maximum time, in microseconds, which the\r
                   transfer is allowed to complete.\r
                   transfer is allowed to complete.\r
-                  \r
-    TransferResult  A pointer to the detailed result information of the \r
+\r
+    TransferResult  A pointer to the detailed result information of the\r
                     bulk transfer.\r
 \r
   Returns:\r
                     bulk transfer.\r
 \r
   Returns:\r
-    EFI_SUCCESS \r
+    EFI_SUCCESS\r
         The bulk transfer was completed successfully.\r
         The bulk transfer was completed successfully.\r
-    EFI_OUT_OF_RESOURCES  \r
+    EFI_OUT_OF_RESOURCES\r
         The bulk transfer could not be submitted due to lack of resource.\r
         The bulk transfer could not be submitted due to lack of resource.\r
-    EFI_INVALID_PARAMETER \r
+    EFI_INVALID_PARAMETER\r
         Some parameters are invalid.\r
         Some parameters are invalid.\r
-    EFI_TIMEOUT \r
+    EFI_TIMEOUT\r
         The bulk transfer failed due to timeout.\r
         The bulk transfer failed due to timeout.\r
-    EFI_DEVICE_ERROR  \r
+    EFI_DEVICE_ERROR\r
         The bulk transfer failed due to host controller or device error.\r
         Caller should check TranferResult for detailed error information.\r
 \r
         The bulk transfer failed due to host controller or device error.\r
         Caller should check TranferResult for detailed error information.\r
 \r
@@ -2199,13 +2199,13 @@ UHCIBulkTransfer (
   //\r
   // Parameters Checking\r
   //\r
   //\r
   // Parameters Checking\r
   //\r
-  \r
+\r
   if ((DataLength == NULL) ||\r
       (Data == NULL)       ||\r
       (TransferResult == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
   if ((DataLength == NULL) ||\r
       (Data == NULL)       ||\r
       (TransferResult == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   //\r
   // if has errors that cause host controller halt,\r
   // then return EFI_DEVICE_ERROR directly.\r
   //\r
   // if has errors that cause host controller halt,\r
   // then return EFI_DEVICE_ERROR directly.\r
@@ -2231,7 +2231,7 @@ UHCIBulkTransfer (
       MaximumPacketLength != 64) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
       MaximumPacketLength != 64) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   //\r
   // Enable the maximum packet size (64bytes)\r
   // that can be used for full speed bandwidth reclamation\r
   //\r
   // Enable the maximum packet size (64bytes)\r
   // that can be used for full speed bandwidth reclamation\r
@@ -2243,7 +2243,7 @@ UHCIBulkTransfer (
   if (EFI_ERROR (Status)) {\r
     return EFI_DEVICE_ERROR;\r
   }\r
   if (EFI_ERROR (Status)) {\r
     return EFI_DEVICE_ERROR;\r
   }\r
\r
+\r
   //\r
   // construct QH and TD data structures,\r
   // and link them together\r
   //\r
   // construct QH and TD data structures,\r
   // and link them together\r
@@ -2306,7 +2306,7 @@ UHCIBulkTransfer (
   default:\r
     return EFI_INVALID_PARAMETER;\r
   }\r
   default:\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   //\r
   //  create QH structure and init\r
   //\r
   //\r
   //  create QH structure and init\r
   //\r
@@ -2315,7 +2315,7 @@ UHCIBulkTransfer (
     HcDev->PciIo->Unmap (HcDev->PciIo, Mapping);\r
     return Status;\r
   }\r
     HcDev->PciIo->Unmap (HcDev->PciIo, Mapping);\r
     return Status;\r
   }\r
-  \r
+\r
   //\r
   // i is used to calculate the total number of TDs.\r
   //\r
   //\r
   // i is used to calculate the total number of TDs.\r
   //\r
@@ -2323,11 +2323,11 @@ UHCIBulkTransfer (
 \r
   IsFirstTD = TRUE;\r
   while (DataLen > 0) {\r
 \r
   IsFirstTD = TRUE;\r
   while (DataLen > 0) {\r
-    \r
+\r
     //\r
     // create TD structures and link together\r
     //\r
     //\r
     // create TD structures and link together\r
     //\r
-    \r
+\r
     PktSize = (UINT8) DataLen;\r
     if (DataLen > MaximumPacketLength) {\r
       PktSize = MaximumPacketLength;\r
     PktSize = (UINT8) DataLen;\r
     if (DataLen > MaximumPacketLength) {\r
       PktSize = MaximumPacketLength;\r
@@ -2351,7 +2351,7 @@ UHCIBulkTransfer (
       DeleteQueuedTDs (HcDev, PtrFirstTD);\r
       return Status;\r
     }\r
       DeleteQueuedTDs (HcDev, PtrFirstTD);\r
       return Status;\r
     }\r
-    \r
+\r
     //\r
     // Enable short packet detection.\r
     // (default action is disabling short packet detection)\r
     //\r
     // Enable short packet detection.\r
     // (default action is disabling short packet detection)\r
@@ -2379,7 +2379,7 @@ UHCIBulkTransfer (
     Ptr += PktSize;\r
     DataLen -= PktSize;\r
   }\r
     Ptr += PktSize;\r
     DataLen -= PktSize;\r
   }\r
-  \r
+\r
   //\r
   // link TD structures to QH structure\r
   //\r
   //\r
   // link TD structures to QH structure\r
   //\r
@@ -2416,7 +2416,7 @@ UHCIBulkTransfer (
   SavedFrameListIndex = LoadFrameListIndex;\r
 \r
   for (Index = 0; Index <= LinkTimes; Index++) {\r
   SavedFrameListIndex = LoadFrameListIndex;\r
 \r
   for (Index = 0; Index <= LinkTimes; Index++) {\r
-    \r
+\r
     //\r
     // put the QH-TD directly or indirectly into the proper place\r
     // in the Frame List\r
     //\r
     // put the QH-TD directly or indirectly into the proper place\r
     // in the Frame List\r
@@ -2473,7 +2473,7 @@ UHCIBulkTransfer (
   if (Mapping != NULL) {\r
     HcDev->PciIo->Unmap (HcDev->PciIo, Mapping);\r
   }\r
   if (Mapping != NULL) {\r
     HcDev->PciIo->Unmap (HcDev->PciIo, Mapping);\r
   }\r
-  \r
+\r
   //\r
   // if has errors that cause host controller halt,\r
   // then return EFI_DEVICE_ERROR directly.\r
   //\r
   // if has errors that cause host controller halt,\r
   // then return EFI_DEVICE_ERROR directly.\r
@@ -2508,68 +2508,68 @@ UHCIAsyncInterruptTransfer (
   IN     VOID                               *Context OPTIONAL\r
   )\r
 /*++\r
   IN     VOID                               *Context OPTIONAL\r
   )\r
 /*++\r
-  \r
+\r
   Routine Description:\r
   Routine Description:\r
-    Submits an asynchronous interrupt transfer to an \r
+    Submits an asynchronous interrupt transfer to an\r
     interrupt endpoint of a USB device.\r
     interrupt endpoint of a USB device.\r
-  \r
+\r
   Arguments:\r
   Arguments:\r
-    \r
+\r
     This            A pointer to the EFI_USB_HC_PROTOCOL instance.\r
     This            A pointer to the EFI_USB_HC_PROTOCOL instance.\r
-    \r
+\r
     DeviceAddress   Represents the address of the target device on the USB,\r
                     which is assigned during USB enumeration.\r
     DeviceAddress   Represents the address of the target device on the USB,\r
                     which is assigned during USB enumeration.\r
-                    \r
-    EndPointAddress The combination of an endpoint number and an endpoint \r
-                    direction of the target USB device. Each endpoint address \r
-                    supports data transfer in one direction except the \r
-                    control endpoint (whose default endpoint address is 0). \r
-                    It is the caller's responsibility to make sure that \r
+\r
+    EndPointAddress The combination of an endpoint number and an endpoint\r
+                    direction of the target USB device. Each endpoint address\r
+                    supports data transfer in one direction except the\r
+                    control endpoint (whose default endpoint address is 0).\r
+                    It is the caller's responsibility to make sure that\r
                     the EndPointAddress represents an interrupt endpoint.\r
                     the EndPointAddress represents an interrupt endpoint.\r
-                    \r
-    IsSlowDevice    Indicates whether the target device is slow device \r
+\r
+    IsSlowDevice    Indicates whether the target device is slow device\r
                     or full-speed device.\r
                     or full-speed device.\r
-                    \r
+\r
     MaximumPacketLength  Indicates the maximum packet size the target endpoint\r
                         is capable of sending or receiving.\r
     MaximumPacketLength  Indicates the maximum packet size the target endpoint\r
                         is capable of sending or receiving.\r
-                        \r
+\r
     IsNewTransfer   If TRUE, an asynchronous interrupt pipe is built between\r
     IsNewTransfer   If TRUE, an asynchronous interrupt pipe is built between\r
-                    the host and the target interrupt endpoint. \r
-                    If FALSE, the specified asynchronous interrupt pipe \r
+                    the host and the target interrupt endpoint.\r
+                    If FALSE, the specified asynchronous interrupt pipe\r
                     is canceled.\r
                     is canceled.\r
-                    \r
-    DataToggle      A pointer to the data toggle value.  On input, it is valid \r
-                    when IsNewTransfer is TRUE, and it indicates the initial \r
-                    data toggle value the asynchronous interrupt transfer \r
-                    should adopt.  \r
-                    On output, it is valid when IsNewTransfer is FALSE, \r
-                    and it is updated to indicate the data toggle value of \r
+\r
+    DataToggle      A pointer to the data toggle value.  On input, it is valid\r
+                    when IsNewTransfer is TRUE, and it indicates the initial\r
+                    data toggle value the asynchronous interrupt transfer\r
+                    should adopt.\r
+                    On output, it is valid when IsNewTransfer is FALSE,\r
+                    and it is updated to indicate the data toggle value of\r
                     the subsequent asynchronous interrupt transfer.\r
                     the subsequent asynchronous interrupt transfer.\r
-                    \r
-    PollingInterval Indicates the interval, in milliseconds, that the \r
-                    asynchronous interrupt transfer is polled.  \r
+\r
+    PollingInterval Indicates the interval, in milliseconds, that the\r
+                    asynchronous interrupt transfer is polled.\r
                     This parameter is required when IsNewTransfer is TRUE.\r
                     This parameter is required when IsNewTransfer is TRUE.\r
-                    \r
-    DataLength      Indicates the length of data to be received at the \r
-                    rate specified by PollingInterval from the target \r
-                    asynchronous interrupt endpoint.  This parameter \r
+\r
+    DataLength      Indicates the length of data to be received at the\r
+                    rate specified by PollingInterval from the target\r
+                    asynchronous interrupt endpoint.  This parameter\r
                     is only required when IsNewTransfer is TRUE.\r
                     is only required when IsNewTransfer is TRUE.\r
-                    \r
-    CallBackFunction  The Callback function.This function is called at the \r
-                      rate specified by PollingInterval.This parameter is \r
+\r
+    CallBackFunction  The Callback function.This function is called at the\r
+                      rate specified by PollingInterval.This parameter is\r
                       only required when IsNewTransfer is TRUE.\r
                       only required when IsNewTransfer is TRUE.\r
-                      \r
+\r
     Context         The context that is passed to the CallBackFunction.\r
                     This is an optional parameter and may be NULL.\r
     Context         The context that is passed to the CallBackFunction.\r
                     This is an optional parameter and may be NULL.\r
-  \r
+\r
   Returns:\r
   Returns:\r
-    EFI_SUCCESS \r
-        The asynchronous interrupt transfer request has been successfully \r
+    EFI_SUCCESS\r
+        The asynchronous interrupt transfer request has been successfully\r
         submitted or canceled.\r
         submitted or canceled.\r
-    EFI_INVALID_PARAMETER \r
+    EFI_INVALID_PARAMETER\r
         Some parameters are invalid.\r
         Some parameters are invalid.\r
-    EFI_OUT_OF_RESOURCES  \r
-        The request could not be completed due to a lack of resources.  \r
+    EFI_OUT_OF_RESOURCES\r
+        The request could not be completed due to a lack of resources.\r
     EFI_DEVICE_ERROR\r
         Can't read register\r
 --*/\r
     EFI_DEVICE_ERROR\r
         Can't read register\r
 --*/\r
@@ -2618,13 +2618,13 @@ UHCIAsyncInterruptTransfer (
   if ((EndPointAddress & 0x80) == 0) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
   if ((EndPointAddress & 0x80) == 0) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   //\r
   // delete Async interrupt transfer request\r
   //\r
   if (!IsNewTransfer) {\r
 \r
   //\r
   // delete Async interrupt transfer request\r
   //\r
   if (!IsNewTransfer) {\r
 \r
-    OldTpl = gBS->RaiseTPL (EFI_TPL_NOTIFY);\r
+    OldTpl = gBS->RaiseTPL (TPL_NOTIFY);\r
 \r
     Status = DeleteAsyncINTQHTDs (\r
                HcDev,\r
 \r
     Status = DeleteAsyncINTQHTDs (\r
                HcDev,\r
@@ -2698,7 +2698,7 @@ UHCIAsyncInterruptTransfer (
     //\r
     // create TD structures and link together\r
     //\r
     //\r
     // create TD structures and link together\r
     //\r
-        \r
+\r
     PktSize = (UINT8) DataLen;\r
     if (DataLen > MaximumPacketLength) {\r
       PktSize = MaximumPacketLength;\r
     PktSize = (UINT8) DataLen;\r
     if (DataLen > MaximumPacketLength) {\r
       PktSize = MaximumPacketLength;\r
@@ -2745,7 +2745,7 @@ UHCIAsyncInterruptTransfer (
     MappedPtr += PktSize;\r
     DataLen -= PktSize;\r
   }\r
     MappedPtr += PktSize;\r
     DataLen -= PktSize;\r
   }\r
-  \r
+\r
   //\r
   // roll one value back\r
   //\r
   //\r
   // roll one value back\r
   //\r
@@ -2774,7 +2774,7 @@ UHCIAsyncInterruptTransfer (
 \r
       return Status;\r
     }\r
 \r
       return Status;\r
     }\r
-    \r
+\r
     //\r
     // link TD structures to QH structure\r
     //\r
     //\r
     // link TD structures to QH structure\r
     //\r
@@ -2827,7 +2827,7 @@ UHCIAsyncInterruptTransfer (
   PtrQH               = ptrFirstQH;\r
 \r
   for (Index = LoadFrameListIndex; Index < (1024 + LoadFrameListIndex);) {\r
   PtrQH               = ptrFirstQH;\r
 \r
   for (Index = LoadFrameListIndex; Index < (1024 + LoadFrameListIndex);) {\r
-      \r
+\r
     //\r
     // put the QH-TD directly or indirectly into the proper place\r
     // in the Frame List\r
     //\r
     // put the QH-TD directly or indirectly into the proper place\r
     // in the Frame List\r
@@ -2859,64 +2859,64 @@ UHCISyncInterruptTransfer (
   OUT      UINT32                  *TransferResult\r
   )\r
 /*++\r
   OUT      UINT32                  *TransferResult\r
   )\r
 /*++\r
-  \r
+\r
   Routine Description:\r
   Routine Description:\r
-    Submits synchronous interrupt transfer to an interrupt endpoint \r
+    Submits synchronous interrupt transfer to an interrupt endpoint\r
     of a USB device.\r
     of a USB device.\r
-  \r
+\r
   Arguments:\r
   Arguments:\r
-    \r
+\r
     This            A pointer to the EFI_USB_HC_PROTOCOL instance.\r
     This            A pointer to the EFI_USB_HC_PROTOCOL instance.\r
-    \r
-    DeviceAddress   Represents the address of the target device on the USB, \r
+\r
+    DeviceAddress   Represents the address of the target device on the USB,\r
                     which is assigned during USB enumeration.\r
                     which is assigned during USB enumeration.\r
-                    \r
-    EndPointAddress   The combination of an endpoint number and an endpoint \r
-                      direction of the target USB device. Each endpoint \r
-                      address supports data transfer in one direction \r
-                      except the control endpoint (whose default \r
+\r
+    EndPointAddress   The combination of an endpoint number and an endpoint\r
+                      direction of the target USB device. Each endpoint\r
+                      address supports data transfer in one direction\r
+                      except the control endpoint (whose default\r
                       endpoint address is 0). It is the caller's responsibility\r
                       endpoint address is 0). It is the caller's responsibility\r
-                      to make sure that the EndPointAddress represents \r
-                      an interrupt endpoint. \r
-                      \r
-    IsSlowDevice    Indicates whether the target device is slow device \r
+                      to make sure that the EndPointAddress represents\r
+                      an interrupt endpoint.\r
+\r
+    IsSlowDevice    Indicates whether the target device is slow device\r
                     or full-speed device.\r
                     or full-speed device.\r
-                    \r
-    MaximumPacketLength Indicates the maximum packet size the target endpoint \r
+\r
+    MaximumPacketLength Indicates the maximum packet size the target endpoint\r
                         is capable of sending or receiving.\r
                         is capable of sending or receiving.\r
-                        \r
-    Data            A pointer to the buffer of data that will be transmitted \r
+\r
+    Data            A pointer to the buffer of data that will be transmitted\r
                     to USB device or received from USB device.\r
                     to USB device or received from USB device.\r
-                    \r
-    DataLength      On input, the size, in bytes, of the data buffer specified \r
+\r
+    DataLength      On input, the size, in bytes, of the data buffer specified\r
                     by Data. On output, the number of bytes transferred.\r
                     by Data. On output, the number of bytes transferred.\r
-                    \r
+\r
     DataToggle      A pointer to the data toggle value. On input, it indicates\r
     DataToggle      A pointer to the data toggle value. On input, it indicates\r
-                    the initial data toggle value the synchronous interrupt \r
-                    transfer should adopt; \r
-                    on output, it is updated to indicate the data toggle value \r
-                    of the subsequent synchronous interrupt transfer. \r
-                    \r
-    TimeOut         Indicates the maximum time, in microseconds, which the \r
+                    the initial data toggle value the synchronous interrupt\r
+                    transfer should adopt;\r
+                    on output, it is updated to indicate the data toggle value\r
+                    of the subsequent synchronous interrupt transfer.\r
+\r
+    TimeOut         Indicates the maximum time, in microseconds, which the\r
                     transfer is allowed to complete.\r
                     transfer is allowed to complete.\r
-                    \r
-    TransferResult  A pointer to the detailed result information from \r
-                    the synchronous interrupt transfer.  \r
+\r
+    TransferResult  A pointer to the detailed result information from\r
+                    the synchronous interrupt transfer.\r
 \r
   Returns:\r
 \r
   Returns:\r
-    EFI_SUCCESS \r
+    EFI_SUCCESS\r
         The synchronous interrupt transfer was completed successfully.\r
         The synchronous interrupt transfer was completed successfully.\r
-    EFI_OUT_OF_RESOURCES  \r
-        The synchronous interrupt transfer could not be submitted due \r
+    EFI_OUT_OF_RESOURCES\r
+        The synchronous interrupt transfer could not be submitted due\r
         to lack of resource.\r
         to lack of resource.\r
-    EFI_INVALID_PARAMETER \r
+    EFI_INVALID_PARAMETER\r
         Some parameters are invalid.\r
         Some parameters are invalid.\r
-    EFI_TIMEOUT \r
+    EFI_TIMEOUT\r
         The synchronous interrupt transfer failed due to timeout.\r
         The synchronous interrupt transfer failed due to timeout.\r
-    EFI_DEVICE_ERROR  \r
-        The synchronous interrupt transfer failed due to host controller \r
-        or device error. Caller should check TranferResult for detailed \r
-        error information.  \r
+    EFI_DEVICE_ERROR\r
+        The synchronous interrupt transfer failed due to host controller\r
+        or device error. Caller should check TranferResult for detailed\r
+        error information.\r
 --*/\r
 {\r
   USB_HC_DEV            *HcDev;\r
 --*/\r
 {\r
   USB_HC_DEV            *HcDev;\r
@@ -2958,13 +2958,13 @@ UHCISyncInterruptTransfer (
   //\r
   // Parameters Checking\r
   //\r
   //\r
   // Parameters Checking\r
   //\r
-  \r
+\r
   if ((DataLength == NULL) ||\r
       (Data == NULL)       ||\r
       (TransferResult == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
   if ((DataLength == NULL) ||\r
       (Data == NULL)       ||\r
       (TransferResult == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   //\r
   // if has errors that cause host controller halt,\r
   // then return EFI_DEVICE_ERROR directly.\r
   //\r
   // if has errors that cause host controller halt,\r
   // then return EFI_DEVICE_ERROR directly.\r
@@ -3017,7 +3017,7 @@ UHCISyncInterruptTransfer (
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
-  \r
+\r
   //\r
   // BusMasterWrite means cpu read\r
   //\r
   //\r
   // BusMasterWrite means cpu read\r
   //\r
@@ -3089,7 +3089,7 @@ UHCISyncInterruptTransfer (
     Ptr += PktSize;\r
     DataLen -= PktSize;\r
   }\r
     Ptr += PktSize;\r
     DataLen -= PktSize;\r
   }\r
-  \r
+\r
   //\r
   // link TD structures to QH structure\r
   //\r
   //\r
   // link TD structures to QH structure\r
   //\r
@@ -3119,7 +3119,7 @@ UHCISyncInterruptTransfer (
   SavedFrameListIndex = LoadFrameListIndex;\r
 \r
   for (Index = 0; Index < LinkTimes; Index++) {\r
   SavedFrameListIndex = LoadFrameListIndex;\r
 \r
   for (Index = 0; Index < LinkTimes; Index++) {\r
-        \r
+\r
     //\r
     // put the QH-TD directly or indirectly into the proper place\r
     // in the Frame List\r
     //\r
     // put the QH-TD directly or indirectly into the proper place\r
     // in the Frame List\r
@@ -3200,27 +3200,27 @@ UHCIIsochronousTransfer (
   OUT      UINT32                  *TransferResult\r
   )\r
 /*++\r
   OUT      UINT32                  *TransferResult\r
   )\r
 /*++\r
-  \r
+\r
   Routine Description:\r
     Submits isochronous transfer to a target USB device.\r
   Routine Description:\r
     Submits isochronous transfer to a target USB device.\r
-  \r
+\r
   Arguments:\r
   Arguments:\r
-    \r
+\r
     This                - A pointer to the EFI_USB_HC_PROTOCOL instance.\r
     DeviceAddress       - Represents the address of the target device on the USB,\r
                            which is assigned during USB enumeration.\r
     EndPointAddress     - End point address\r
     This                - A pointer to the EFI_USB_HC_PROTOCOL instance.\r
     DeviceAddress       - Represents the address of the target device on the USB,\r
                            which is assigned during USB enumeration.\r
     EndPointAddress     - End point address\r
-    MaximumPacketLength - Indicates the maximum packet size that the \r
-                           default control transfer endpoint is capable of \r
+    MaximumPacketLength - Indicates the maximum packet size that the\r
+                           default control transfer endpoint is capable of\r
                            sending or receiving.\r
                            sending or receiving.\r
-    Data                - A pointer to the buffer of data that will be transmitted \r
+    Data                - A pointer to the buffer of data that will be transmitted\r
                            to USB device or received from USB device.\r
                            to USB device or received from USB device.\r
-    DataLength          - Indicates the size, in bytes, of the data buffer \r
+    DataLength          - Indicates the size, in bytes, of the data buffer\r
                            specified by Data.\r
                            specified by Data.\r
-    TransferResult      - A pointer to the detailed result information generated \r
-                           by this control transfer.               \r
+    TransferResult      - A pointer to the detailed result information generated\r
+                           by this control transfer.\r
   Returns:\r
   Returns:\r
-    EFI_UNSUPPORTED \r
+    EFI_UNSUPPORTED\r
 \r
 --*/\r
 {\r
 \r
 --*/\r
 {\r
@@ -3241,32 +3241,32 @@ UHCIAsyncIsochronousTransfer (
   IN       VOID                                *Context OPTIONAL\r
   )\r
 /*++\r
   IN       VOID                                *Context OPTIONAL\r
   )\r
 /*++\r
-  \r
+\r
   Routine Description:\r
     Submits Async isochronous transfer to a target USB device.\r
   Routine Description:\r
     Submits Async isochronous transfer to a target USB device.\r
-  \r
+\r
   Arguments:\r
   Arguments:\r
-    \r
+\r
     This                - A pointer to the EFI_USB_HC_PROTOCOL instance.\r
     This                - A pointer to the EFI_USB_HC_PROTOCOL instance.\r
-    \r
+\r
     DeviceAddress       - Represents the address of the target device on the USB,\r
                            which is assigned during USB enumeration.\r
 \r
     EndPointAddress     - End point address\r
     DeviceAddress       - Represents the address of the target device on the USB,\r
                            which is assigned during USB enumeration.\r
 \r
     EndPointAddress     - End point address\r
-    \r
-    MaximumPacketLength - Indicates the maximum packet size that the \r
-                           default control transfer endpoint is capable of \r
+\r
+    MaximumPacketLength - Indicates the maximum packet size that the\r
+                           default control transfer endpoint is capable of\r
                            sending or receiving.\r
                            sending or receiving.\r
-       \r
-    Data                - A pointer to the buffer of data that will be transmitted \r
+\r
+    Data                - A pointer to the buffer of data that will be transmitted\r
                            to USB device or received from USB device.\r
                            to USB device or received from USB device.\r
-    \r
+\r
     IsochronousCallBack - When the transfer complete, the call back function will be called\r
     IsochronousCallBack - When the transfer complete, the call back function will be called\r
-    \r
+\r
     Context             - Pass to the call back function as parameter\r
     Context             - Pass to the call back function as parameter\r
-                    \r
+\r
   Returns:\r
   Returns:\r
-    EFI_UNSUPPORTED \r
+    EFI_UNSUPPORTED\r
 \r
 --*/\r
 {\r
 \r
 --*/\r
 {\r
@@ -3291,34 +3291,34 @@ UHCI2GetCapability(
 \r
   Arguments:\r
     This                      - A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
 \r
   Arguments:\r
     This                      - A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
-    \r
+\r
     MaxSpeed             - A pointer to the max speed USB host controller supports.\r
     MaxSpeed             - A pointer to the max speed USB host controller supports.\r
-    \r
+\r
     PortNumber           - A pointer to the number of root hub ports.\r
     PortNumber           - A pointer to the number of root hub ports.\r
-    \r
+\r
     Is64BitCapable      - A pointer to an integer to show whether USB host controller\r
                                   supports 64-bit memory addressing.\r
   Returns:\r
     Is64BitCapable      - A pointer to an integer to show whether USB host controller\r
                                   supports 64-bit memory addressing.\r
   Returns:\r
-    EFI_SUCCESS \r
+    EFI_SUCCESS\r
         The host controller capabilities were retrieved successfully.\r
         The host controller capabilities were retrieved successfully.\r
-    EFI_INVALID_PARAMETER \r
+    EFI_INVALID_PARAMETER\r
         MaxSpeed or PortNumber or Is64BitCapable is NULL.\r
         MaxSpeed or PortNumber or Is64BitCapable is NULL.\r
-    EFI_DEVICE_ERROR  \r
+    EFI_DEVICE_ERROR\r
        An error was encountered while attempting to retrieve the capabilities.\r
        An error was encountered while attempting to retrieve the capabilities.\r
-        \r
---*/     \r
+\r
+--*/\r
 {\r
   USB_HC_DEV *HcDev;\r
 \r
   HcDev = USB2_HC_DEV_FROM_THIS (This);\r
 {\r
   USB_HC_DEV *HcDev;\r
 \r
   HcDev = USB2_HC_DEV_FROM_THIS (This);\r
-  \r
-  if ((NULL == MaxSpeed) \r
+\r
+  if ((NULL == MaxSpeed)\r
        ||(NULL == PortNumber)\r
        || (NULL == Is64BitCapable))\r
   {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
        ||(NULL == PortNumber)\r
        || (NULL == Is64BitCapable))\r
   {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   *MaxSpeed = EFI_USB_SPEED_FULL;\r
   *Is64BitCapable = (UINT8)FALSE;\r
   return  UHCIGetRootHubPortNumber(&HcDev->UsbHc, PortNumber);\r
   *MaxSpeed = EFI_USB_SPEED_FULL;\r
   *Is64BitCapable = (UINT8)FALSE;\r
   return  UHCIGetRootHubPortNumber(&HcDev->UsbHc, PortNumber);\r
@@ -3337,46 +3337,46 @@ UHCI2Reset (
 \r
   Arguments:\r
     This           - A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
 \r
   Arguments:\r
     This           - A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
-    \r
-    Attributes   - A bit mask of the reset operation to perform. \r
+\r
+    Attributes   - A bit mask of the reset operation to perform.\r
                        See below for a list of the supported bit mask values.\r
                        See below for a list of the supported bit mask values.\r
-  \r
+\r
   #define EFI_USB_HC_RESET_GLOBAL                      0x0001\r
   #define EFI_USB_HC_RESET_HOST_CONTROLLER             0x0002\r
   #define EFI_USB_HC_RESET_GLOBAL _WITH_DEBUG          0x0004\r
   #define EFI_USB_HC_RESET_HOST_WITH_DEBUG             0x0008\r
 \r
   #define EFI_USB_HC_RESET_GLOBAL                      0x0001\r
   #define EFI_USB_HC_RESET_HOST_CONTROLLER             0x0002\r
   #define EFI_USB_HC_RESET_GLOBAL _WITH_DEBUG          0x0004\r
   #define EFI_USB_HC_RESET_HOST_WITH_DEBUG             0x0008\r
 \r
-  EFI_USB_HC_RESET_GLOBAL \r
+  EFI_USB_HC_RESET_GLOBAL\r
         If this bit is set, a global reset signal will be sent to the USB bus.\r
         If this bit is set, a global reset signal will be sent to the USB bus.\r
-        This resets all of the USB bus logic, including the USB host \r
+        This resets all of the USB bus logic, including the USB host\r
         controller hardware and all the devices attached on the USB bus.\r
         controller hardware and all the devices attached on the USB bus.\r
-  EFI_USB_HC_RESET_HOST_CONTROLLER  \r
-        If this bit is set, the USB host controller hardware will be reset. \r
+  EFI_USB_HC_RESET_HOST_CONTROLLER\r
+        If this bit is set, the USB host controller hardware will be reset.\r
         No reset signal will be sent to the USB bus.\r
         No reset signal will be sent to the USB bus.\r
-  \r
+\r
   Returns:\r
   Returns:\r
-    EFI_SUCCESS \r
+    EFI_SUCCESS\r
         The reset operation succeeded.\r
         The reset operation succeeded.\r
-    EFI_INVALID_PARAMETER \r
+    EFI_INVALID_PARAMETER\r
         Attributes is not valid.\r
     EFI_UNSUPPORTED\r
         The type of reset specified by Attributes is not currently supported by the host controller hardware.\r
     EFI_ACCESS_DENIED\r
         Reset operation is rejected due to the debug port being configured and active.\r
         Attributes is not valid.\r
     EFI_UNSUPPORTED\r
         The type of reset specified by Attributes is not currently supported by the host controller hardware.\r
     EFI_ACCESS_DENIED\r
         Reset operation is rejected due to the debug port being configured and active.\r
-    EFI_DEVICE_ERROR  \r
-        An error was encountered while attempting to perform \r
+    EFI_DEVICE_ERROR\r
+        An error was encountered while attempting to perform\r
         the reset operation.\r
 --*/\r
 {\r
   USB_HC_DEV *HcDev;\r
 \r
   HcDev = USB2_HC_DEV_FROM_THIS (This);\r
         the reset operation.\r
 --*/\r
 {\r
   USB_HC_DEV *HcDev;\r
 \r
   HcDev = USB2_HC_DEV_FROM_THIS (This);\r
-  \r
+\r
   if (Attributes==EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG || Attributes==EFI_USB_HC_RESET_HOST_WITH_DEBUG)\r
        return EFI_UNSUPPORTED;\r
   if (Attributes==EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG || Attributes==EFI_USB_HC_RESET_HOST_WITH_DEBUG)\r
        return EFI_UNSUPPORTED;\r
-  \r
+\r
   return UHCIReset(\r
   return UHCIReset(\r
-       &HcDev->UsbHc, \r
+       &HcDev->UsbHc,\r
        Attributes\r
        );\r
 }\r
        Attributes\r
        );\r
 }\r
@@ -3388,40 +3388,40 @@ UHCI2GetState (
   OUT EFI_USB_HC_STATE       * State\r
   )\r
 /*++\r
   OUT EFI_USB_HC_STATE       * State\r
   )\r
 /*++\r
-  \r
+\r
   Routine Description:\r
     Retrieves current state of the USB host controller according to UEFI 2.0 spec.\r
   Routine Description:\r
     Retrieves current state of the USB host controller according to UEFI 2.0 spec.\r
-  \r
+\r
   Arguments:\r
   Arguments:\r
-    \r
+\r
     This     - A pointer to the EFI_USB_HC_PROTOCOL instance.\r
     This     - A pointer to the EFI_USB_HC_PROTOCOL instance.\r
-    \r
-    State    - A pointer to the EFI_USB_HC_STATE data structure that \r
-              indicates current state of the USB host controller.  \r
+\r
+    State    - A pointer to the EFI_USB_HC_STATE data structure that\r
+              indicates current state of the USB host controller.\r
               Type EFI_USB_HC_STATE is defined below.\r
               Type EFI_USB_HC_STATE is defined below.\r
-              \r
+\r
     typedef enum {\r
       EfiUsbHcStateHalt,\r
       EfiUsbHcStateOperational,\r
       EfiUsbHcStateSuspend,\r
       EfiUsbHcStateMaximum\r
     } EFI_USB_HC_STATE;\r
     typedef enum {\r
       EfiUsbHcStateHalt,\r
       EfiUsbHcStateOperational,\r
       EfiUsbHcStateSuspend,\r
       EfiUsbHcStateMaximum\r
     } EFI_USB_HC_STATE;\r
-  \r
+\r
   Returns:\r
   Returns:\r
-    EFI_SUCCESS \r
+    EFI_SUCCESS\r
             The state information of the host controller was returned in State.\r
             The state information of the host controller was returned in State.\r
-    EFI_INVALID_PARAMETER \r
+    EFI_INVALID_PARAMETER\r
             State is NULL.\r
             State is NULL.\r
-    EFI_DEVICE_ERROR  \r
-            An error was encountered while attempting to retrieve the \r
-            host controller's current state.  \r
---*/  \r
+    EFI_DEVICE_ERROR\r
+            An error was encountered while attempting to retrieve the\r
+            host controller's current state.\r
+--*/\r
 {\r
   USB_HC_DEV *HcDev;\r
 \r
   HcDev = USB2_HC_DEV_FROM_THIS (This);\r
   return UHCIGetState(\r
 {\r
   USB_HC_DEV *HcDev;\r
 \r
   HcDev = USB2_HC_DEV_FROM_THIS (This);\r
   return UHCIGetState(\r
-       &HcDev->UsbHc, \r
+       &HcDev->UsbHc,\r
        State\r
        );\r
 }\r
        State\r
        );\r
 }\r
@@ -3433,31 +3433,31 @@ UHCI2SetState (
   IN EFI_USB_HC_STATE        State\r
   )\r
 /*++\r
   IN EFI_USB_HC_STATE        State\r
   )\r
 /*++\r
-  \r
+\r
   Routine Description:\r
     Sets the USB host controller to a specific state according to UEFI 2.0 spec.\r
   Routine Description:\r
     Sets the USB host controller to a specific state according to UEFI 2.0 spec.\r
-  \r
+\r
   Arguments:\r
   Arguments:\r
-    \r
+\r
     This     - A pointer to the EFI_USB_HC_PROTOCOL instance.\r
 \r
     State    - Indicates the state of the host controller that will be set.\r
     This     - A pointer to the EFI_USB_HC_PROTOCOL instance.\r
 \r
     State    - Indicates the state of the host controller that will be set.\r
-  \r
+\r
   Returns:\r
   Returns:\r
-    EFI_SUCCESS \r
-          The USB host controller was successfully placed in the state \r
+    EFI_SUCCESS\r
+          The USB host controller was successfully placed in the state\r
           specified by State.\r
           specified by State.\r
-    EFI_INVALID_PARAMETER \r
+    EFI_INVALID_PARAMETER\r
           State is invalid.\r
           State is invalid.\r
-    EFI_DEVICE_ERROR  \r
-          Failed to set the state specified by State due to device error.  \r
+    EFI_DEVICE_ERROR\r
+          Failed to set the state specified by State due to device error.\r
 --*/\r
 {\r
   USB_HC_DEV *HcDev;\r
 \r
   HcDev = USB2_HC_DEV_FROM_THIS (This);\r
   return UHCISetState(\r
 --*/\r
 {\r
   USB_HC_DEV *HcDev;\r
 \r
   HcDev = USB2_HC_DEV_FROM_THIS (This);\r
   return UHCISetState(\r
-       &HcDev->UsbHc, \r
+       &HcDev->UsbHc,\r
        State\r
        );\r
 }\r
        State\r
        );\r
 }\r
@@ -3478,53 +3478,53 @@ UHCI2ControlTransfer (
   OUT    UINT32                                         *TransferResult\r
   )\r
 /*++\r
   OUT    UINT32                                         *TransferResult\r
   )\r
 /*++\r
-  \r
+\r
   Routine Description:\r
     Submits control transfer to a target USB device accroding to UEFI 2.0 spec..\r
   Routine Description:\r
     Submits control transfer to a target USB device accroding to UEFI 2.0 spec..\r
-  \r
+\r
   Arguments:\r
   Arguments:\r
-    \r
+\r
     This         - A pointer to the EFI_USB_HC_PROTOCOL instance.\r
 \r
     DeviceAddress -Represents the address of the target device on the USB,\r
                   which is assigned during USB enumeration.\r
 \r
     DeviceSpeed  - Indicates transfer speed of device.\r
     This         - A pointer to the EFI_USB_HC_PROTOCOL instance.\r
 \r
     DeviceAddress -Represents the address of the target device on the USB,\r
                   which is assigned during USB enumeration.\r
 \r
     DeviceSpeed  - Indicates transfer speed of device.\r
-    \r
-    MaximumPacketLength - Indicates the maximum packet size that the \r
-                        default control transfer endpoint is capable of \r
+\r
+    MaximumPacketLength - Indicates the maximum packet size that the\r
+                        default control transfer endpoint is capable of\r
                         sending or receiving.\r
                         sending or receiving.\r
-    \r
-    Request      - A pointer to the USB device request that will be sent \r
-                  to the USB device. \r
-    \r
+\r
+    Request      - A pointer to the USB device request that will be sent\r
+                  to the USB device.\r
+\r
     TransferDirection - Specifies the data direction for the transfer.\r
     TransferDirection - Specifies the data direction for the transfer.\r
-                      There are three values available, DataIn, DataOut \r
+                      There are three values available, DataIn, DataOut\r
                       and NoData.\r
                       and NoData.\r
-    \r
-    Data          -A pointer to the buffer of data that will be transmitted \r
+\r
+    Data          -A pointer to the buffer of data that will be transmitted\r
                   to USB device or received from USB device.\r
                   to USB device or received from USB device.\r
-    \r
-    DataLength    - Indicates the size, in bytes, of the data buffer \r
+\r
+    DataLength    - Indicates the size, in bytes, of the data buffer\r
                   specified by Data.\r
                   specified by Data.\r
-    \r
-    TimeOut       - Indicates the maximum time, in microseconds, \r
+\r
+    TimeOut       - Indicates the maximum time, in microseconds,\r
                   which the transfer is allowed to complete.\r
                   which the transfer is allowed to complete.\r
-    \r
-    TransferResult  - A pointer to the detailed result information generated \r
+\r
+    TransferResult  - A pointer to the detailed result information generated\r
                     by this control transfer.\r
                     by this control transfer.\r
-                    \r
+\r
   Returns:\r
   Returns:\r
-    EFI_SUCCESS \r
+    EFI_SUCCESS\r
         The control transfer was completed successfully.\r
         The control transfer was completed successfully.\r
-    EFI_OUT_OF_RESOURCES  \r
+    EFI_OUT_OF_RESOURCES\r
         The control transfer could not be completed due to a lack of resources.\r
         The control transfer could not be completed due to a lack of resources.\r
-    EFI_INVALID_PARAMETER \r
+    EFI_INVALID_PARAMETER\r
         Some parameters are invalid.\r
         Some parameters are invalid.\r
-    EFI_TIMEOUT \r
+    EFI_TIMEOUT\r
         The control transfer failed due to timeout.\r
         The control transfer failed due to timeout.\r
-    EFI_DEVICE_ERROR  \r
-        The control transfer failed due to host controller or device error. \r
+    EFI_DEVICE_ERROR\r
+        The control transfer failed due to host controller or device error.\r
         Caller should check TranferResult for detailed error information.\r
 \r
 --*/\r
         Caller should check TranferResult for detailed error information.\r
 \r
 --*/\r
@@ -3533,19 +3533,19 @@ UHCI2ControlTransfer (
   BOOLEAN IsSlowDevice = (BOOLEAN) ((EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE);\r
 \r
   HcDev = USB2_HC_DEV_FROM_THIS (This);\r
   BOOLEAN IsSlowDevice = (BOOLEAN) ((EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE);\r
 \r
   HcDev = USB2_HC_DEV_FROM_THIS (This);\r
-  \r
+\r
   return UHCIControlTransfer(\r
   return UHCIControlTransfer(\r
-       &HcDev->UsbHc, \r
-       DeviceAddress, \r
-       IsSlowDevice, \r
-       (UINT8) MaximumPacketLength, \r
-       Request, \r
-       TransferDirection, \r
-       Data, \r
+       &HcDev->UsbHc,\r
+       DeviceAddress,\r
+       IsSlowDevice,\r
+       (UINT8) MaximumPacketLength,\r
+       Request,\r
+       TransferDirection,\r
+       Data,\r
        DataLength,\r
        TimeOut,\r
        TransferResult\r
        DataLength,\r
        TimeOut,\r
        TransferResult\r
-       );      \r
+       );\r
 }\r
 \r
 EFI_STATUS\r
 }\r
 \r
 EFI_STATUS\r
@@ -3563,91 +3563,91 @@ UHCI2BulkTransfer (
   IN     UINTN                                           TimeOut,\r
   IN     EFI_USB2_HC_TRANSACTION_TRANSLATOR              *Translator,\r
   OUT    UINT32                                          *TransferResult\r
   IN     UINTN                                           TimeOut,\r
   IN     EFI_USB2_HC_TRANSACTION_TRANSLATOR              *Translator,\r
   OUT    UINT32                                          *TransferResult\r
-  )                                                  \r
+  )\r
 /*++\r
 /*++\r
-  \r
+\r
   Routine Description:\r
     Submits bulk transfer to a bulk endpoint of a USB device according to UEFI 2.0 spec.\r
   Routine Description:\r
     Submits bulk transfer to a bulk endpoint of a USB device according to UEFI 2.0 spec.\r
-    \r
+\r
   Arguments:\r
   Arguments:\r
-    \r
+\r
     This          A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
     This          A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
-    \r
+\r
     DeviceAddress Represents the address of the target device on the USB,\r
                   which is assigned during USB enumeration.\r
     DeviceAddress Represents the address of the target device on the USB,\r
                   which is assigned during USB enumeration.\r
-                  \r
-    EndPointAddress   The combination of an endpoint number and an \r
-                      endpoint direction of the target USB device. \r
-                      Each endpoint address supports data transfer in \r
-                      one direction except the control endpoint \r
-                      (whose default endpoint address is 0). \r
-                      It is the caller's responsibility to make sure that \r
-                      the EndPointAddress represents a bulk endpoint. \r
-                      \r
+\r
+    EndPointAddress   The combination of an endpoint number and an\r
+                      endpoint direction of the target USB device.\r
+                      Each endpoint address supports data transfer in\r
+                      one direction except the control endpoint\r
+                      (whose default endpoint address is 0).\r
+                      It is the caller's responsibility to make sure that\r
+                      the EndPointAddress represents a bulk endpoint.\r
+\r
     DeviceSpeed  Indicates device speed. The supported values are EFI_USB_SPEED_FULL\r
                           and EFI_USB_SPEED_HIGH.\r
     DeviceSpeed  Indicates device speed. The supported values are EFI_USB_SPEED_FULL\r
                           and EFI_USB_SPEED_HIGH.\r
-                          \r
+\r
     MaximumPacketLength Indicates the maximum packet size the target endpoint\r
                         is capable of sending or receiving.\r
     MaximumPacketLength Indicates the maximum packet size the target endpoint\r
                         is capable of sending or receiving.\r
-                        \r
+\r
     DataBuffersNumber  Number of data buffers prepared for the transfer.\r
     DataBuffersNumber  Number of data buffers prepared for the transfer.\r
-    \r
-    Data          Array of pointers to the buffers of data that will be transmitted \r
+\r
+    Data          Array of pointers to the buffers of data that will be transmitted\r
                   to USB device or received from USB device.\r
                   to USB device or received from USB device.\r
-                  \r
+\r
     DataLength    When input, indicates the size, in bytes, of the data buffer\r
     DataLength    When input, indicates the size, in bytes, of the data buffer\r
-                  specified by Data. When output, indicates the actually \r
+                  specified by Data. When output, indicates the actually\r
                   transferred data size.\r
                   transferred data size.\r
-                  \r
-    DataToggle    A pointer to the data toggle value. On input, it indicates \r
+\r
+    DataToggle    A pointer to the data toggle value. On input, it indicates\r
                   the initial data toggle value the bulk transfer should adopt;\r
                   the initial data toggle value the bulk transfer should adopt;\r
-                  on output, it is updated to indicate the data toggle value \r
-                  of the subsequent bulk transfer. \r
-                  \r
+                  on output, it is updated to indicate the data toggle value\r
+                  of the subsequent bulk transfer.\r
+\r
     Translator  A pointr to the transaction translator data.\r
     Translator  A pointr to the transaction translator data.\r
-    \r
-    TimeOut       Indicates the maximum time, in microseconds, which the \r
+\r
+    TimeOut       Indicates the maximum time, in microseconds, which the\r
                   transfer is allowed to complete.\r
                   transfer is allowed to complete.\r
-                  \r
-    TransferResult  A pointer to the detailed result information of the \r
+\r
+    TransferResult  A pointer to the detailed result information of the\r
                     bulk transfer.\r
 \r
   Returns:\r
                     bulk transfer.\r
 \r
   Returns:\r
-    EFI_SUCCESS \r
+    EFI_SUCCESS\r
         The bulk transfer was completed successfully.\r
         The bulk transfer was completed successfully.\r
-        \r
-    EFI_OUT_OF_RESOURCES  \r
+\r
+    EFI_OUT_OF_RESOURCES\r
         The bulk transfer could not be submitted due to lack of resource.\r
         The bulk transfer could not be submitted due to lack of resource.\r
-        \r
-    EFI_INVALID_PARAMETER \r
+\r
+    EFI_INVALID_PARAMETER\r
         Some parameters are invalid.\r
         Some parameters are invalid.\r
-        \r
-    EFI_TIMEOUT \r
+\r
+    EFI_TIMEOUT\r
         The bulk transfer failed due to timeout.\r
         The bulk transfer failed due to timeout.\r
-        \r
-    EFI_DEVICE_ERROR  \r
+\r
+    EFI_DEVICE_ERROR\r
         The bulk transfer failed due to host controller or device error.\r
         Caller should check TranferResult for detailed error information.\r
 \r
         The bulk transfer failed due to host controller or device error.\r
         Caller should check TranferResult for detailed error information.\r
 \r
---*/  \r
+--*/\r
 {\r
   USB_HC_DEV *HcDev;\r
 \r
   HcDev = USB2_HC_DEV_FROM_THIS (This);\r
 {\r
   USB_HC_DEV *HcDev;\r
 \r
   HcDev = USB2_HC_DEV_FROM_THIS (This);\r
-  \r
+\r
   if( Data == NULL || DeviceSpeed==EFI_USB_SPEED_LOW)\r
        return EFI_INVALID_PARAMETER;\r
   /* For full-speed bulk transfers only the data pointed by Data[0] shall be used */\r
 \r
   return UHCIBulkTransfer (\r
   if( Data == NULL || DeviceSpeed==EFI_USB_SPEED_LOW)\r
        return EFI_INVALID_PARAMETER;\r
   /* For full-speed bulk transfers only the data pointed by Data[0] shall be used */\r
 \r
   return UHCIBulkTransfer (\r
-       &HcDev->UsbHc, \r
-       DeviceAddress, \r
-       EndPointAddress, \r
-       (UINT8) MaximumPacketLength, \r
-       *Data, \r
-       DataLength, \r
-       DataToggle, \r
-       TimeOut, \r
+       &HcDev->UsbHc,\r
+       DeviceAddress,\r
+       EndPointAddress,\r
+       (UINT8) MaximumPacketLength,\r
+       *Data,\r
+       DataLength,\r
+       DataToggle,\r
+       TimeOut,\r
        TransferResult\r
        );\r
 }\r
        TransferResult\r
        );\r
 }\r
@@ -3669,91 +3669,91 @@ UHCI2AsyncInterruptTransfer (
   IN     VOID                                        *Context\r
   )\r
 /*++\r
   IN     VOID                                        *Context\r
   )\r
 /*++\r
-  \r
+\r
   Routine Description:\r
   Routine Description:\r
-    Submits an asynchronous interrupt transfer to an \r
+    Submits an asynchronous interrupt transfer to an\r
     interrupt endpoint of a USB device according to UEFI 2.0 spec.\r
     interrupt endpoint of a USB device according to UEFI 2.0 spec.\r
-  \r
+\r
   Arguments:\r
   Arguments:\r
-    \r
+\r
     This            A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
     This            A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
-    \r
+\r
     DeviceAddress   Represents the address of the target device on the USB,\r
                     which is assigned during USB enumeration.\r
     DeviceAddress   Represents the address of the target device on the USB,\r
                     which is assigned during USB enumeration.\r
-                    \r
-    EndPointAddress The combination of an endpoint number and an endpoint \r
-                    direction of the target USB device. Each endpoint address \r
-                    supports data transfer in one direction except the \r
-                    control endpoint (whose default endpoint address is 0). \r
-                    It is the caller's responsibility to make sure that \r
+\r
+    EndPointAddress The combination of an endpoint number and an endpoint\r
+                    direction of the target USB device. Each endpoint address\r
+                    supports data transfer in one direction except the\r
+                    control endpoint (whose default endpoint address is 0).\r
+                    It is the caller's responsibility to make sure that\r
                     the EndPointAddress represents an interrupt endpoint.\r
                     the EndPointAddress represents an interrupt endpoint.\r
-                    \r
+\r
     DeviceSpeed     Indicates device speed.\r
     DeviceSpeed     Indicates device speed.\r
-    \r
+\r
     MaximumPacketLength  Indicates the maximum packet size the target endpoint\r
                         is capable of sending or receiving.\r
     MaximumPacketLength  Indicates the maximum packet size the target endpoint\r
                         is capable of sending or receiving.\r
-                        \r
+\r
     IsNewTransfer   If TRUE, an asynchronous interrupt pipe is built between\r
     IsNewTransfer   If TRUE, an asynchronous interrupt pipe is built between\r
-                    the host and the target interrupt endpoint. \r
-                    If FALSE, the specified asynchronous interrupt pipe \r
+                    the host and the target interrupt endpoint.\r
+                    If FALSE, the specified asynchronous interrupt pipe\r
                     is canceled.\r
                     is canceled.\r
-                    \r
-    DataToggle      A pointer to the data toggle value.  On input, it is valid \r
-                    when IsNewTransfer is TRUE, and it indicates the initial \r
-                    data toggle value the asynchronous interrupt transfer \r
-                    should adopt.  \r
-                    On output, it is valid when IsNewTransfer is FALSE, \r
-                    and it is updated to indicate the data toggle value of \r
+\r
+    DataToggle      A pointer to the data toggle value.  On input, it is valid\r
+                    when IsNewTransfer is TRUE, and it indicates the initial\r
+                    data toggle value the asynchronous interrupt transfer\r
+                    should adopt.\r
+                    On output, it is valid when IsNewTransfer is FALSE,\r
+                    and it is updated to indicate the data toggle value of\r
                     the subsequent asynchronous interrupt transfer.\r
                     the subsequent asynchronous interrupt transfer.\r
-                    \r
-    PollingInterval Indicates the interval, in milliseconds, that the \r
-                    asynchronous interrupt transfer is polled.  \r
+\r
+    PollingInterval Indicates the interval, in milliseconds, that the\r
+                    asynchronous interrupt transfer is polled.\r
                     This parameter is required when IsNewTransfer is TRUE.\r
                     This parameter is required when IsNewTransfer is TRUE.\r
-                    \r
-    DataLength      Indicates the length of data to be received at the \r
-                    rate specified by PollingInterval from the target \r
-                    asynchronous interrupt endpoint.  This parameter \r
+\r
+    DataLength      Indicates the length of data to be received at the\r
+                    rate specified by PollingInterval from the target\r
+                    asynchronous interrupt endpoint.  This parameter\r
                     is only required when IsNewTransfer is TRUE.\r
                     is only required when IsNewTransfer is TRUE.\r
-                    \r
+\r
     Translator  A pointr to the transaction translator data.\r
     Translator  A pointr to the transaction translator data.\r
-    \r
-    CallBackFunction  The Callback function.This function is called at the \r
-                      rate specified by PollingInterval.This parameter is \r
+\r
+    CallBackFunction  The Callback function.This function is called at the\r
+                      rate specified by PollingInterval.This parameter is\r
                       only required when IsNewTransfer is TRUE.\r
                       only required when IsNewTransfer is TRUE.\r
-                      \r
+\r
     Context         The context that is passed to the CallBackFunction.\r
                     This is an optional parameter and may be NULL.\r
     Context         The context that is passed to the CallBackFunction.\r
                     This is an optional parameter and may be NULL.\r
-  \r
+\r
   Returns:\r
   Returns:\r
-  \r
-    EFI_SUCCESS \r
-        The asynchronous interrupt transfer request has been successfully \r
+\r
+    EFI_SUCCESS\r
+        The asynchronous interrupt transfer request has been successfully\r
         submitted or canceled.\r
         submitted or canceled.\r
-        \r
-    EFI_INVALID_PARAMETER \r
+\r
+    EFI_INVALID_PARAMETER\r
         Some parameters are invalid.\r
         Some parameters are invalid.\r
-        \r
-    EFI_OUT_OF_RESOURCES  \r
-        The request could not be completed due to a lack of resources.  \r
-        \r
+\r
+    EFI_OUT_OF_RESOURCES\r
+        The request could not be completed due to a lack of resources.\r
+\r
     EFI_DEVICE_ERROR\r
         Can't read register\r
     EFI_DEVICE_ERROR\r
         Can't read register\r
---*/  \r
+--*/\r
 {\r
   USB_HC_DEV *HcDev;\r
   BOOLEAN IsSlowDevice = (BOOLEAN) ((EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE);\r
 {\r
   USB_HC_DEV *HcDev;\r
   BOOLEAN IsSlowDevice = (BOOLEAN) ((EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE);\r
-   \r
+\r
   HcDev = USB2_HC_DEV_FROM_THIS (This);\r
   return UHCIAsyncInterruptTransfer(\r
   HcDev = USB2_HC_DEV_FROM_THIS (This);\r
   return UHCIAsyncInterruptTransfer(\r
-       &HcDev->UsbHc, \r
-       DeviceAddress, \r
-       EndPointAddress, \r
-       IsSlowDevice, \r
-       (UINT8) MaximumPacketLength, \r
-       IsNewTransfer, \r
-       DataToggle, \r
+       &HcDev->UsbHc,\r
+       DeviceAddress,\r
+       EndPointAddress,\r
+       IsSlowDevice,\r
+       (UINT8) MaximumPacketLength,\r
+       IsNewTransfer,\r
+       DataToggle,\r
        PollingInterval,\r
        PollingInterval,\r
-       DataLength, \r
+       DataLength,\r
        CallBackFunction,\r
        Context\r
        );\r
        CallBackFunction,\r
        Context\r
        );\r
@@ -3775,82 +3775,82 @@ UHCI2SyncInterruptTransfer (
   OUT    UINT32                                    *TransferResult\r
   )\r
 /*++\r
   OUT    UINT32                                    *TransferResult\r
   )\r
 /*++\r
-  \r
+\r
   Routine Description:\r
   Routine Description:\r
-    Submits synchronous interrupt transfer to an interrupt endpoint \r
+    Submits synchronous interrupt transfer to an interrupt endpoint\r
     of a USB device according to UEFI 2.0 spec.\r
     of a USB device according to UEFI 2.0 spec.\r
-  \r
+\r
   Arguments:\r
   Arguments:\r
-    \r
+\r
     This            A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
     This            A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
-    \r
-    DeviceAddress   Represents the address of the target device on the USB, \r
+\r
+    DeviceAddress   Represents the address of the target device on the USB,\r
                     which is assigned during USB enumeration.\r
                     which is assigned during USB enumeration.\r
-                    \r
-    EndPointAddress   The combination of an endpoint number and an endpoint \r
-                      direction of the target USB device. Each endpoint \r
-                      address supports data transfer in one direction \r
-                      except the control endpoint (whose default \r
+\r
+    EndPointAddress   The combination of an endpoint number and an endpoint\r
+                      direction of the target USB device. Each endpoint\r
+                      address supports data transfer in one direction\r
+                      except the control endpoint (whose default\r
                       endpoint address is 0). It is the caller's responsibility\r
                       endpoint address is 0). It is the caller's responsibility\r
-                      to make sure that the EndPointAddress represents \r
-                      an interrupt endpoint. \r
-                      \r
+                      to make sure that the EndPointAddress represents\r
+                      an interrupt endpoint.\r
+\r
     DeviceSpeed  Indicates device speed.\r
     DeviceSpeed  Indicates device speed.\r
-                    \r
-    MaximumPacketLength Indicates the maximum packet size the target endpoint \r
+\r
+    MaximumPacketLength Indicates the maximum packet size the target endpoint\r
                         is capable of sending or receiving.\r
                         is capable of sending or receiving.\r
-                        \r
-    Data            A pointer to the buffer of data that will be transmitted \r
+\r
+    Data            A pointer to the buffer of data that will be transmitted\r
                     to USB device or received from USB device.\r
                     to USB device or received from USB device.\r
-                    \r
-    DataLength      On input, the size, in bytes, of the data buffer specified \r
+\r
+    DataLength      On input, the size, in bytes, of the data buffer specified\r
                     by Data. On output, the number of bytes transferred.\r
                     by Data. On output, the number of bytes transferred.\r
-                    \r
+\r
     DataToggle      A pointer to the data toggle value. On input, it indicates\r
     DataToggle      A pointer to the data toggle value. On input, it indicates\r
-                    the initial data toggle value the synchronous interrupt \r
-                    transfer should adopt; \r
-                    on output, it is updated to indicate the data toggle value \r
-                    of the subsequent synchronous interrupt transfer. \r
-                    \r
-    TimeOut         Indicates the maximum time, in microseconds, which the \r
+                    the initial data toggle value the synchronous interrupt\r
+                    transfer should adopt;\r
+                    on output, it is updated to indicate the data toggle value\r
+                    of the subsequent synchronous interrupt transfer.\r
+\r
+    TimeOut         Indicates the maximum time, in microseconds, which the\r
                     transfer is allowed to complete.\r
     Translator  A pointr to the transaction translator data.\r
                     transfer is allowed to complete.\r
     Translator  A pointr to the transaction translator data.\r
-    TransferResult  A pointer to the detailed result information from \r
-                    the synchronous interrupt transfer.  \r
+    TransferResult  A pointer to the detailed result information from\r
+                    the synchronous interrupt transfer.\r
 \r
   Returns:\r
 \r
   Returns:\r
-    EFI_SUCCESS \r
+    EFI_SUCCESS\r
         The synchronous interrupt transfer was completed successfully.\r
         The synchronous interrupt transfer was completed successfully.\r
-    EFI_OUT_OF_RESOURCES  \r
-        The synchronous interrupt transfer could not be submitted due \r
+    EFI_OUT_OF_RESOURCES\r
+        The synchronous interrupt transfer could not be submitted due\r
         to lack of resource.\r
         to lack of resource.\r
-    EFI_INVALID_PARAMETER \r
+    EFI_INVALID_PARAMETER\r
         Some parameters are invalid.\r
         Some parameters are invalid.\r
-    EFI_TIMEOUT \r
+    EFI_TIMEOUT\r
         The synchronous interrupt transfer failed due to timeout.\r
         The synchronous interrupt transfer failed due to timeout.\r
-    EFI_DEVICE_ERROR  \r
-        The synchronous interrupt transfer failed due to host controller \r
-        or device error. Caller should check TranferResult for detailed \r
-        error information.  \r
---*/  \r
+    EFI_DEVICE_ERROR\r
+        The synchronous interrupt transfer failed due to host controller\r
+        or device error. Caller should check TranferResult for detailed\r
+        error information.\r
+--*/\r
 {\r
   USB_HC_DEV *HcDev;\r
   BOOLEAN IsSlowDevice;\r
 {\r
   USB_HC_DEV *HcDev;\r
   BOOLEAN IsSlowDevice;\r
-  \r
+\r
   if(DeviceSpeed==EFI_USB_SPEED_HIGH)\r
        return EFI_INVALID_PARAMETER;\r
   if(DeviceSpeed==EFI_USB_SPEED_HIGH)\r
        return EFI_INVALID_PARAMETER;\r
-  \r
-  IsSlowDevice = (BOOLEAN) ((EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE);  \r
+\r
+  IsSlowDevice = (BOOLEAN) ((EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE);\r
   HcDev = USB2_HC_DEV_FROM_THIS (This);\r
   HcDev = USB2_HC_DEV_FROM_THIS (This);\r
-  \r
+\r
   return UHCISyncInterruptTransfer(\r
   return UHCISyncInterruptTransfer(\r
-       &HcDev->UsbHc, \r
-       DeviceAddress, \r
-       EndPointAddress, \r
-       IsSlowDevice, \r
-       (UINT8) MaximumPacketLength, \r
-       Data, \r
-       DataLength, \r
+       &HcDev->UsbHc,\r
+       DeviceAddress,\r
+       EndPointAddress,\r
+       IsSlowDevice,\r
+       (UINT8) MaximumPacketLength,\r
+       Data,\r
+       DataLength,\r
        DataToggle,\r
        TimeOut,\r
        TransferResult\r
        DataToggle,\r
        TimeOut,\r
        TransferResult\r
@@ -3872,43 +3872,43 @@ UHCI2IsochronousTransfer (
   OUT    UINT32                                     *TransferResult\r
   )\r
 /*++\r
   OUT    UINT32                                     *TransferResult\r
   )\r
 /*++\r
-  \r
+\r
   Routine Description:\r
   Routine Description:\r
-  \r
+\r
     Submits isochronous transfer to a target USB device according to UEFI 2.0 spec.\r
     Submits isochronous transfer to a target USB device according to UEFI 2.0 spec.\r
-  \r
+\r
   Arguments:\r
   Arguments:\r
-    \r
+\r
     This             A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
     This             A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
-    \r
+\r
     DeviceAddress    Represents the address of the target device on the USB,\r
                            which is assigned during USB enumeration.\r
     DeviceAddress    Represents the address of the target device on the USB,\r
                            which is assigned during USB enumeration.\r
-                           \r
+\r
     EndPointAddress  End point address\r
     EndPointAddress  End point address\r
-    \r
+\r
     DeviceSpeed      Indicates device speed.\r
     DeviceSpeed      Indicates device speed.\r
-    \r
-    MaximumPacketLength    Indicates the maximum packet size that the \r
-                           default control transfer endpoint is capable of \r
+\r
+    MaximumPacketLength    Indicates the maximum packet size that the\r
+                           default control transfer endpoint is capable of\r
                            sending or receiving.\r
                            sending or receiving.\r
-                           \r
+\r
     DataBuffersNumber Number of data buffers prepared for the transfer.\r
     DataBuffersNumber Number of data buffers prepared for the transfer.\r
-    \r
-    Data              Array of pointers to the buffers of data that will be \r
+\r
+    Data              Array of pointers to the buffers of data that will be\r
                       transmitted to USB device or received from USB device.\r
                       transmitted to USB device or received from USB device.\r
-                  \r
-    DataLength        Indicates the size, in bytes, of the data buffer \r
+\r
+    DataLength        Indicates the size, in bytes, of the data buffer\r
                       specified by Data.\r
                       specified by Data.\r
-                           \r
+\r
     Translator        A pointr to the transaction translator data.\r
     Translator        A pointr to the transaction translator data.\r
-    \r
-    TransferResult    A pointer to the detailed result information generated \r
-                      by this control transfer.               \r
+\r
+    TransferResult    A pointer to the detailed result information generated\r
+                      by this control transfer.\r
   Returns:\r
   Returns:\r
-  \r
-    EFI_UNSUPPORTED \r
 \r
 \r
---*/  \r
+    EFI_UNSUPPORTED\r
+\r
+--*/\r
 {\r
   return EFI_UNSUPPORTED;\r
 }\r
 {\r
   return EFI_UNSUPPORTED;\r
 }\r
@@ -3929,42 +3929,42 @@ UHCI2AsyncIsochronousTransfer (
   IN     VOID                                         *Context\r
   )\r
 /*++\r
   IN     VOID                                         *Context\r
   )\r
 /*++\r
-  \r
+\r
   Routine Description:\r
   Routine Description:\r
-  \r
+\r
     Submits Async isochronous transfer to a target USB device according to UEFI 2.0 spec.\r
     Submits Async isochronous transfer to a target USB device according to UEFI 2.0 spec.\r
-  \r
+\r
   Arguments:\r
   Arguments:\r
-    \r
+\r
     This                A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
     This                A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
-    \r
+\r
     DeviceAddress       Represents the address of the target device on the USB,\r
                            which is assigned during USB enumeration.\r
 \r
     EndPointAddress     End point address\r
     DeviceAddress       Represents the address of the target device on the USB,\r
                            which is assigned during USB enumeration.\r
 \r
     EndPointAddress     End point address\r
-    \r
+\r
     DeviceSpeed         Indicates device speed.\r
     DeviceSpeed         Indicates device speed.\r
-    \r
-    MaximumPacketLength Indicates the maximum packet size that the \r
-                        default control transfer endpoint is capable of \r
+\r
+    MaximumPacketLength Indicates the maximum packet size that the\r
+                        default control transfer endpoint is capable of\r
                         sending or receiving.\r
                         sending or receiving.\r
-                        \r
+\r
     DataBuffersNumber   Number of data buffers prepared for the transfer.\r
     DataBuffersNumber   Number of data buffers prepared for the transfer.\r
-    \r
-    Data                Array of pointers to the buffers of data that will be transmitted \r
+\r
+    Data                Array of pointers to the buffers of data that will be transmitted\r
                         to USB device or received from USB device.\r
                         to USB device or received from USB device.\r
-                        \r
+\r
     Translator          A pointr to the transaction translator data.\r
     Translator          A pointr to the transaction translator data.\r
-    \r
+\r
     IsochronousCallBack When the transfer complete, the call back function will be called\r
     IsochronousCallBack When the transfer complete, the call back function will be called\r
-    \r
+\r
     Context             Pass to the call back function as parameter\r
     Context             Pass to the call back function as parameter\r
-                    \r
+\r
   Returns:\r
   Returns:\r
-  \r
-    EFI_UNSUPPORTED \r
 \r
 \r
---*/  \r
+    EFI_UNSUPPORTED\r
+\r
+--*/\r
 {\r
   return EFI_UNSUPPORTED;\r
 }\r
 {\r
   return EFI_UNSUPPORTED;\r
 }\r
@@ -3977,38 +3977,38 @@ UHCI2GetRootHubPortStatus (
   OUT EFI_USB_PORT_STATUS    * PortStatus\r
   )\r
 /*++\r
   OUT EFI_USB_PORT_STATUS    * PortStatus\r
   )\r
 /*++\r
-  \r
+\r
   Routine Description:\r
     Retrieves the current status of a USB root hub port according to UEFI 2.0 spec.\r
   Routine Description:\r
     Retrieves the current status of a USB root hub port according to UEFI 2.0 spec.\r
-  \r
+\r
   Arguments:\r
   Arguments:\r
-  \r
+\r
     This        A pointer to the EFI_USB2_HC_PROTOCOL.\r
     This        A pointer to the EFI_USB2_HC_PROTOCOL.\r
-    \r
-    PortNumber  Specifies the root hub port from which the status \r
-                is to be retrieved.  This value is zero-based. For example, \r
+\r
+    PortNumber  Specifies the root hub port from which the status\r
+                is to be retrieved.  This value is zero-based. For example,\r
                 if a root hub has two ports, then the first port is numbered 0,\r
                 and the second port is numbered 1.\r
                 if a root hub has two ports, then the first port is numbered 0,\r
                 and the second port is numbered 1.\r
-    \r
-    PortStatus  A pointer to the current port status bits and \r
-                port status change bits.  \r
-  \r
+\r
+    PortStatus  A pointer to the current port status bits and\r
+                port status change bits.\r
+\r
   Returns:\r
   Returns:\r
-    EFI_SUCCESS \r
-        The status of the USB root hub port specified by PortNumber \r
+    EFI_SUCCESS\r
+        The status of the USB root hub port specified by PortNumber\r
         was returned in PortStatus.\r
         was returned in PortStatus.\r
-    EFI_INVALID_PARAMETER \r
-        PortNumber is invalid. \r
-    EFI_DEVICE_ERROR - Can't read register      \r
---*/     \r
+    EFI_INVALID_PARAMETER\r
+        PortNumber is invalid.\r
+    EFI_DEVICE_ERROR - Can't read register\r
+--*/\r
 {\r
   USB_HC_DEV *HcDev;\r
 \r
   HcDev = USB2_HC_DEV_FROM_THIS (This);\r
 {\r
   USB_HC_DEV *HcDev;\r
 \r
   HcDev = USB2_HC_DEV_FROM_THIS (This);\r
-  \r
+\r
   return UHCIGetRootHubPortStatus(\r
   return UHCIGetRootHubPortStatus(\r
-       &HcDev->UsbHc, \r
-       PortNumber, \r
+       &HcDev->UsbHc,\r
+       PortNumber,\r
        PortStatus\r
        );\r
 }\r
        PortStatus\r
        );\r
 }\r
@@ -4021,36 +4021,36 @@ UHCI2SetRootHubPortFeature (
   IN EFI_USB_PORT_FEATURE    PortFeature\r
   )\r
 /*++\r
   IN EFI_USB_PORT_FEATURE    PortFeature\r
   )\r
 /*++\r
-  \r
+\r
   Routine Description:\r
     Sets a feature for the specified root hub port according to UEFI 2.0 spec.\r
   Routine Description:\r
     Sets a feature for the specified root hub port according to UEFI 2.0 spec.\r
-  \r
+\r
   Arguments:\r
   Arguments:\r
-  \r
+\r
     This        A pointer to the EFI_USB2_HC_PROTOCOL.\r
     This        A pointer to the EFI_USB2_HC_PROTOCOL.\r
-    \r
-    PortNumber  Specifies the root hub port whose feature \r
+\r
+    PortNumber  Specifies the root hub port whose feature\r
                 is requested to be set.\r
                 is requested to be set.\r
-    \r
-    PortFeature Indicates the feature selector associated \r
-                with the feature set request. \r
-  \r
+\r
+    PortFeature Indicates the feature selector associated\r
+                with the feature set request.\r
+\r
   Returns:\r
   Returns:\r
-    EFI_SUCCESS \r
-        The feature specified by PortFeature was set for the \r
+    EFI_SUCCESS\r
+        The feature specified by PortFeature was set for the\r
         USB root hub port specified by PortNumber.\r
         USB root hub port specified by PortNumber.\r
-    EFI_INVALID_PARAMETER \r
+    EFI_INVALID_PARAMETER\r
         PortNumber is invalid or PortFeature is invalid.\r
     EFI_DEVICE_ERROR\r
         Can't read register\r
         PortNumber is invalid or PortFeature is invalid.\r
     EFI_DEVICE_ERROR\r
         Can't read register\r
---*/  \r
+--*/\r
 {\r
   USB_HC_DEV *HcDev;\r
 \r
   HcDev = USB2_HC_DEV_FROM_THIS (This);\r
   return UHCISetRootHubPortFeature(\r
 {\r
   USB_HC_DEV *HcDev;\r
 \r
   HcDev = USB2_HC_DEV_FROM_THIS (This);\r
   return UHCISetRootHubPortFeature(\r
-       &HcDev->UsbHc, \r
-       PortNumber, \r
+       &HcDev->UsbHc,\r
+       PortNumber,\r
        PortFeature\r
        );\r
 }\r
        PortFeature\r
        );\r
 }\r
@@ -4063,36 +4063,36 @@ UHCI2ClearRootHubPortFeature (
   IN EFI_USB_PORT_FEATURE    PortFeature\r
   )\r
 /*++\r
   IN EFI_USB_PORT_FEATURE    PortFeature\r
   )\r
 /*++\r
-  \r
+\r
   Routine Description:\r
     Clears a feature for the specified root hub port according to Uefi 2.0 spec.\r
   Routine Description:\r
     Clears a feature for the specified root hub port according to Uefi 2.0 spec.\r
-  \r
+\r
   Arguments:\r
   Arguments:\r
-  \r
+\r
     This        A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
     This        A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
-    \r
-    PortNumber  Specifies the root hub port whose feature \r
+\r
+    PortNumber  Specifies the root hub port whose feature\r
                 is requested to be cleared.\r
                 is requested to be cleared.\r
-    \r
-    PortFeature Indicates the feature selector associated with the \r
+\r
+    PortFeature Indicates the feature selector associated with the\r
                 feature clear request.\r
                 feature clear request.\r
-                  \r
+\r
   Returns:\r
   Returns:\r
-    EFI_SUCCESS \r
-        The feature specified by PortFeature was cleared for the \r
+    EFI_SUCCESS\r
+        The feature specified by PortFeature was cleared for the\r
         USB root hub port specified by PortNumber.\r
         USB root hub port specified by PortNumber.\r
-    EFI_INVALID_PARAMETER \r
+    EFI_INVALID_PARAMETER\r
         PortNumber is invalid or PortFeature is invalid.\r
     EFI_DEVICE_ERROR\r
         Can't read register\r
         PortNumber is invalid or PortFeature is invalid.\r
     EFI_DEVICE_ERROR\r
         Can't read register\r
---*/  \r
+--*/\r
 {\r
   USB_HC_DEV *HcDev;\r
 \r
   HcDev = USB2_HC_DEV_FROM_THIS (This);\r
   return UHCIClearRootHubPortFeature(\r
 {\r
   USB_HC_DEV *HcDev;\r
 \r
   HcDev = USB2_HC_DEV_FROM_THIS (This);\r
   return UHCIClearRootHubPortFeature(\r
-       &HcDev->UsbHc, \r
-       PortNumber, \r
+       &HcDev->UsbHc,\r
+       PortNumber,\r
        PortFeature\r
        );\r
 }\r
        PortFeature\r
        );\r
 }\r
@@ -4111,7 +4111,7 @@ MonitorInterruptTrans (
     Contex - Pointer to USB_HC_DEV\r
   Returns:\r
     None\r
     Contex - Pointer to USB_HC_DEV\r
   Returns:\r
     None\r
---*/            \r
+--*/\r
 {\r
 \r
   USB_HC_DEV      *HcDev;\r
 {\r
 \r
   USB_HC_DEV      *HcDev;\r
@@ -4199,7 +4199,7 @@ MonitorInterruptTrans (
       if (DataBuffer) {\r
         gBS->FreePool (DataBuffer);\r
       }\r
       if (DataBuffer) {\r
         gBS->FreePool (DataBuffer);\r
       }\r
-      \r
+\r
       //\r
       // update should done after data buffer got.\r
       //\r
       //\r
       // update should done after data buffer got.\r
       //\r