]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
modify coding style to pass ecc tool and provide comments that complied with Doxgen.
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / EhciDxe / Ehci.c
index f72ba551276c2ac2ba5b4bd458a634a6b4855b8f..9dccd6f00d4b7179793304d1ce9c6091e153d32d 100644 (file)
@@ -1,4 +1,6 @@
 /** @file\r
+  \r
+  The Ehci controller driver.\r
 \r
 Copyright (c) 2006 - 2008, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
@@ -9,15 +11,6 @@ http://opensource.org/licenses/bsd-license.php
 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
-    Ehci.c\r
-\r
-Abstract:\r
-\r
-\r
-Revision History\r
-\r
 **/\r
 \r
 \r
@@ -47,17 +40,16 @@ USB_PORT_STATE_MAP  mUsbPortChangeMap[] = {
 /**\r
   Retrieves the capablility of root hub ports.\r
 \r
-  @param  This                 This EFI_USB_HC_PROTOCOL instance.\r
-  @param  MaxSpeed             Max speed supported by the controller\r
-  @param  PortNumber           Number of the root hub ports.\r
-  @param  Is64BitCapable       Whether the controller supports 64-bit memory\r
-                               addressing.\r
+  @param  This                  This EFI_USB_HC_PROTOCOL instance.\r
+  @param  MaxSpeed              Max speed supported by the controller.\r
+  @param  PortNumber            Number of the root hub ports.\r
+  @param  Is64BitCapable        Whether the controller supports 64-bit memory\r
+                                addressing.\r
 \r
-  @return EFI_SUCCESS           : host controller capability were retrieved successfully.\r
-  @return EFI_INVALID_PARAMETER : Either of the three capability pointer is NULL\r
+  @retval EFI_SUCCESS           Host controller capability were retrieved successfully.\r
+  @retval EFI_INVALID_PARAMETER Either of the three capability pointer is NULL.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 EhcGetCapability (\r
@@ -91,17 +83,16 @@ EhcGetCapability (
 /**\r
   Provides software reset for the USB host controller.\r
 \r
-  @param  This                 This EFI_USB2_HC_PROTOCOL instance.\r
-  @param  Attributes           A bit mask of the reset operation to perform.\r
+  @param  This                  This EFI_USB2_HC_PROTOCOL instance.\r
+  @param  Attributes            A bit mask of the reset operation to perform.\r
 \r
-  @return EFI_SUCCESS           : The reset operation succeeded.\r
-  @return EFI_INVALID_PARAMETER : Attributes is not valid.\r
-  @return EFI_UNSUPPOURTED      : The type of reset specified by Attributes is\r
-  @return not currently supported by the host controller.\r
-  @return EFI_DEVICE_ERROR      : Host controller isn't halted to reset.\r
+  @retval EFI_SUCCESS           The reset operation succeeded.\r
+  @retval EFI_INVALID_PARAMETER Attributes is not valid.\r
+  @retval EFI_UNSUPPOURTED      The type of reset specified by Attributes is\r
+                                not currently supported by the host controller.\r
+  @retval EFI_DEVICE_ERROR      Host controller isn't halted to reset.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 EhcReset (\r
@@ -170,17 +161,16 @@ ON_EXIT:
 /**\r
   Retrieve the current state of the USB host controller.\r
 \r
-  @param  This                 This EFI_USB2_HC_PROTOCOL instance.\r
-  @param  State                Variable to return the current host controller\r
-                               state.\r
+  @param  This                   This EFI_USB2_HC_PROTOCOL instance.\r
+  @param  State                  Variable to return the current host controller\r
+                                 state.\r
 \r
-  @return EFI_SUCCESS           : Host controller state was returned in State.\r
-  @return EFI_INVALID_PARAMETER : State is NULL.\r
-  @return EFI_DEVICE_ERROR      : An error was encountered while attempting to\r
-  @return retrieve the host controller's current state.\r
+  @retval EFI_SUCCESS            Host controller state was returned in State.\r
+  @retval EFI_INVALID_PARAMETER  State is NULL.\r
+  @retval EFI_DEVICE_ERROR       An error was encountered while attempting to\r
+                                 retrieve the host controller's current state.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 EhcGetState (\r
@@ -214,16 +204,15 @@ EhcGetState (
 /**\r
   Sets the USB host controller to a specific state.\r
 \r
-  @param  This                 This EFI_USB2_HC_PROTOCOL instance.\r
-  @param  State                The state of the host controller that will be set.\r
+  @param  This                  This EFI_USB2_HC_PROTOCOL instance.\r
+  @param  State                 The state of the host controller that will be set.\r
 \r
-  @return EFI_SUCCESS           : The USB host controller was successfully placed\r
-  @return in the state specified by State.\r
-  @return EFI_INVALID_PARAMETER : State is invalid.\r
-  @return EFI_DEVICE_ERROR      : Failed to set the state due to device error.\r
+  @retval EFI_SUCCESS           The USB host controller was successfully placed\r
+                                in the state specified by State.\r
+  @retval EFI_INVALID_PARAMETER State is invalid.\r
+  @retval EFI_DEVICE_ERROR      Failed to set the state due to device error.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 EhcSetState (\r
@@ -290,18 +279,17 @@ EhcSetState (
 /**\r
   Retrieves the current status of a USB root hub port.\r
 \r
-  @param  This                 This EFI_USB2_HC_PROTOCOL instance.\r
-  @param  PortNumber           The root hub port to retrieve the state from.   This\r
-                               value is zero-based.\r
-  @param  PortStatus           Variable to receive the port state\r
+  @param  This                  This EFI_USB2_HC_PROTOCOL instance.\r
+  @param  PortNumber            The root hub port to retrieve the state from.\r
+                                This value is zero-based.\r
+  @param  PortStatus            Variable to receive the port state.\r
 \r
-  @return EFI_SUCCESS           : The status of the USB root hub port specified\r
-  @return by PortNumber was returned in PortStatus.\r
-  @return EFI_INVALID_PARAMETER : PortNumber is invalid.\r
-  @return EFI_DEVICE_ERROR      : Can't read register\r
+  @retval EFI_SUCCESS           The status of the USB root hub port specified.\r
+                                by PortNumber was returned in PortStatus.\r
+  @retval EFI_INVALID_PARAMETER PortNumber is invalid.\r
+  @retval EFI_DEVICE_ERROR      Can't read register.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 EhcGetRootHubPortStatus (\r
@@ -382,16 +370,15 @@ ON_EXIT:
 /**\r
   Sets a feature for the specified root hub port.\r
 \r
-  @param  This                 This EFI_USB2_HC_PROTOCOL instance.\r
-  @param  PortNumber           Root hub port to set.\r
-  @param  PortFeature          Feature to set\r
+  @param  This                  This EFI_USB2_HC_PROTOCOL instance.\r
+  @param  PortNumber            Root hub port to set.\r
+  @param  PortFeature           Feature to set.\r
 \r
-  @return EFI_SUCCESS           : The feature specified by PortFeature was set\r
-  @return EFI_INVALID_PARAMETER : PortNumber is invalid or PortFeature is invalid.\r
-  @return EFI_DEVICE_ERROR      : Can't read register\r
+  @retval EFI_SUCCESS           The feature specified by PortFeature was set.\r
+  @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid.\r
+  @retval EFI_DEVICE_ERROR      Can't read register.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 EhcSetRootHubPortFeature (\r
@@ -490,19 +477,18 @@ ON_EXIT:
 /**\r
   Clears a feature for the specified root hub port.\r
 \r
-  @param  This                 A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
-  @param  PortNumber           Specifies the root hub port whose feature is\r
-                               requested to be cleared.\r
-  @param  PortFeature          Indicates the feature selector associated with the\r
-                               feature clear request.\r
+  @param  This                  A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
+  @param  PortNumber            Specifies the root hub port whose feature is\r
+                                requested to be cleared.\r
+  @param  PortFeature           Indicates the feature selector associated with the\r
+                                feature clear request.\r
 \r
-  @return EFI_SUCCESS           : The feature specified by PortFeature was cleared\r
-  @return for the USB root hub port specified by PortNumber.\r
-  @return EFI_INVALID_PARAMETER : PortNumber is invalid or PortFeature is invalid.\r
-  @return EFI_DEVICE_ERROR      : Can't read register\r
+  @retval EFI_SUCCESS           The feature specified by PortFeature was cleared\r
+                                for the USB root hub port specified by PortNumber.\r
+  @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid.\r
+  @retval EFI_DEVICE_ERROR      Can't read register.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 EhcClearRootHubPortFeature (\r
@@ -617,28 +603,27 @@ ON_EXIT:
 /**\r
   Submits control transfer to a target USB device.\r
 \r
-  @param  This                 This EFI_USB2_HC_PROTOCOL instance.\r
-  @param  DeviceAddress        The target device address\r
-  @param  DeviceSpeed          Target device speed.\r
-  @param  MaximumPacketLength  Maximum packet size the default control transfer\r
-                               endpoint is capable of sending or receiving.\r
-  @param  Request              USB device request to send\r
-  @param  TransferDirection    Specifies the data direction for the data stage\r
-  @param  Data                 Data buffer to be transmitted or received from USB\r
-                               device.\r
-  @param  DataLength           The size (in bytes) of the data buffer\r
-  @param  TimeOut              Indicates the maximum timeout, in millisecond,\r
-  @param  Translator           Transaction translator to be used by this device.\r
-  @param  TransferResult       Return the result of this control transfer.\r
-\r
-  @return EFI_SUCCESS           : Transfer was completed successfully.\r
-  @return EFI_OUT_OF_RESOURCES  : The transfer failed due to lack of resources.\r
-  @return EFI_INVALID_PARAMETER : Some parameters are invalid.\r
-  @return EFI_TIMEOUT           : Transfer failed due to timeout.\r
-  @return EFI_DEVICE_ERROR      : Transfer failed due to host controller or device error.\r
+  @param  This                  This EFI_USB2_HC_PROTOCOL instance.\r
+  @param  DeviceAddress         The target device address.\r
+  @param  DeviceSpeed           Target device speed.\r
+  @param  MaximumPacketLength   Maximum packet size the default control transfer\r
+                                endpoint is capable of sending or receiving.\r
+  @param  Request               USB device request to send.\r
+  @param  TransferDirection     Specifies the data direction for the data stage\r
+  @param  Data                  Data buffer to be transmitted or received from USB\r
+                                device.\r
+  @param  DataLength            The size (in bytes) of the data buffer.\r
+  @param  TimeOut               Indicates the maximum timeout, in millisecond.\r
+  @param  Translator            Transaction translator to be used by this device.\r
+  @param  TransferResult        Return the result of this control transfer.\r
+\r
+  @retval EFI_SUCCESS           Transfer was completed successfully.\r
+  @retval EFI_OUT_OF_RESOURCES  The transfer failed due to lack of resources.\r
+  @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
+  @retval EFI_TIMEOUT           Transfer failed due to timeout.\r
+  @retval EFI_DEVICE_ERROR      Transfer failed due to host controller or device error.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 EhcControlTransfer (\r
@@ -775,35 +760,33 @@ ON_EXIT:
 /**\r
   Submits bulk transfer to a bulk endpoint of a USB device.\r
 \r
-  @param  This                 This EFI_USB2_HC_PROTOCOL instance.\r
-  @param  DeviceAddress        Target device address\r
-  @param  EndPointAddress      Endpoint number and its direction in bit 7. .\r
-  @param  DeviceSpeed          Device speed, Low speed device doesn't support  bulk\r
-                               transfer.\r
-  @param  MaximumPacketLength  Maximum packet size the endpoint is capable of\r
-                               sending or receiving.\r
-  @param  DataBuffersNumber    Number of data buffers prepared for the transfer.\r
-  @param  Data                 Array of pointers to the buffers of data to transmit\r
+  @param  This                  This EFI_USB2_HC_PROTOCOL instance.\r
+  @param  DeviceAddress         Target device address.\r
+  @param  EndPointAddress       Endpoint number and its direction in bit 7.\r
+  @param  DeviceSpeed           Device speed, Low speed device doesn't support bulk\r
+                                transfer.\r
+  @param  MaximumPacketLength   Maximum packet size the endpoint is capable of\r
+                                sending or receiving.\r
+  @param  DataBuffersNumber     Number of data buffers prepared for the transfer.\r
+  @param  Data                  Array of pointers to the buffers of data to transmit\r
                                 from or receive into.\r
-  @param  DataLength           The lenght of the data buffer\r
-  @param  DataToggle           On input, the initial data toggle for the transfer;\r
-                               On output, it is updated to to next data toggle to\r
-                               use                        of the subsequent bulk\r
-                               transfer.\r
-  @param  Translator           A pointr to the transaction translator data.\r
-  @param  TimeOut              Indicates the maximum time, in millisecond, which\r
-                               the transfer is allowed to complete.\r
-  @param  TransferResult       A pointer to the detailed result information of the\r
-                               bulk transfer.\r
-\r
-  @return EFI_SUCCESS           : The transfer was completed successfully.\r
-  @return EFI_OUT_OF_RESOURCES  : The transfer failed due to lack of resource.\r
-  @return EFI_INVALID_PARAMETER : Some parameters are invalid.\r
-  @return EFI_TIMEOUT           : The transfer failed due to timeout.\r
-  @return EFI_DEVICE_ERROR      : The transfer failed due to host controller error.\r
+  @param  DataLength            The lenght of the data buffer.\r
+  @param  DataToggle            On input, the initial data toggle for the transfer;\r
+                                On output, it is updated to to next data toggle to\r
+                                use of the subsequent bulk transfer.\r
+  @param  TimeOut               Indicates the maximum time, in millisecond, which\r
+                                the transfer is allowed to complete.\r
+  @param  Translator            A pointr to the transaction translator data.\r
+  @param  TransferResult        A pointer to the detailed result information of the\r
+                                bulk transfer.\r
+\r
+  @retval EFI_SUCCESS           The transfer was completed successfully.\r
+  @retval EFI_OUT_OF_RESOURCES  The transfer failed due to lack of resource.\r
+  @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
+  @retval EFI_TIMEOUT           The transfer failed due to timeout.\r
+  @retval EFI_DEVICE_ERROR      The transfer failed due to host controller error.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 EhcBulkTransfer (\r
@@ -918,32 +901,31 @@ ON_EXIT:
   Submits an asynchronous interrupt transfer to an\r
   interrupt endpoint of a USB device.\r
 \r
-  @param  This                 This EFI_USB2_HC_PROTOCOL instance.\r
-  @param  DeviceAddress        Target device address\r
-  @param  EndPointAddress      Endpoint number and its direction encoded in bit 7\r
-  @param  DeviceSpeed          Indicates device speed.\r
-  @param  MaximumPacketLength  Maximum packet size the target endpoint is capable\r
-  @param  IsNewTransfer        If TRUE, to submit an new asynchronous interrupt\r
-                               transfer If FALSE, to remove the specified\r
-                               asynchronous interrupt\r
-  @param  DataToggle           On input, the initial data toggle to use; on output,\r
-                               it is updated to indicate the next data toggle\r
-  @param  PollingInterval      The he interval, in milliseconds, that the transfer\r
-                               is polled.\r
-  @param  DataLength           The length of data to receive at the rate specified\r
-                               by  PollingInterval.\r
-  @param  Translator           Transaction translator to use.\r
-  @param  CallBackFunction     Function to call at the rate specified by\r
-                               PollingInterval\r
-  @param  Context              Context to CallBackFunction.\r
-\r
-  @return EFI_SUCCESS           : The request has been successfully submitted or canceled.\r
-  @return EFI_INVALID_PARAMETER : Some parameters are invalid.\r
-  @return EFI_OUT_OF_RESOURCES  : The request failed due to a lack of resources.\r
-  @return EFI_DEVICE_ERROR      : The transfer failed due to host controller error.\r
+  @param  This                  This EFI_USB2_HC_PROTOCOL instance.\r
+  @param  DeviceAddress         Target device address.\r
+  @param  EndPointAddress       Endpoint number and its direction encoded in bit 7\r
+  @param  DeviceSpeed           Indicates device speed.\r
+  @param  MaximumPacketLength   Maximum packet size the target endpoint is capable\r
+  @param  IsNewTransfer         If TRUE, to submit an new asynchronous interrupt\r
+                                transfer If FALSE, to remove the specified\r
+                                asynchronous interrupt.\r
+  @param  DataToggle            On input, the initial data toggle to use; on output,\r
+                                it is updated to indicate the next data toggle.\r
+  @param  PollingInterval       The he interval, in milliseconds, that the transfer\r
+                                is polled.\r
+  @param  DataLength            The length of data to receive at the rate specified\r
+                                by  PollingInterval.\r
+  @param  Translator            Transaction translator to use.\r
+  @param  CallBackFunction      Function to call at the rate specified by\r
+                                PollingInterval.\r
+  @param  Context               Context to CallBackFunction.\r
+\r
+  @retval EFI_SUCCESS           The request has been successfully submitted or canceled.\r
+  @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
+  @retval EFI_OUT_OF_RESOURCES  The request failed due to a lack of resources.\r
+  @retval EFI_DEVICE_ERROR      The transfer failed due to host controller error.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 EhcAsyncInterruptTransfer (\r
@@ -1067,30 +1049,29 @@ ON_EXIT:
   Submits synchronous interrupt transfer to an interrupt endpoint\r
   of a USB device.\r
 \r
-  @param  This                 This EFI_USB2_HC_PROTOCOL instance.\r
-  @param  DeviceAddress        Target device address\r
-  @param  EndPointAddress      Endpoint number and its direction encoded in bit 7\r
-  @param  DeviceSpeed          Indicates device speed.\r
-  @param  MaximumPacketLength  Maximum packet size the target endpoint is capable\r
-                               of sending or receiving.\r
-  @param  Data                 Buffer of data that will be transmitted to  USB\r
-                               device or received from USB device.\r
-  @param  DataLength           On input, the size, in bytes, of the data buffer; On\r
-                               output, the number of bytes transferred.\r
-  @param  DataToggle           On input, the initial data toggle to use; on output,\r
-                               it is updated to indicate the next data toggle\r
-  @param  TimeOut              Maximum time, in second, to complete\r
-  @param  Translator           Transaction translator to use.\r
-  @param  TransferResult       Variable to receive the transfer result\r
-\r
-  @return EFI_SUCCESS           The transfer was completed successfully.\r
-  @return EFI_OUT_OF_RESOURCES  The transfer failed due to lack of resource.\r
-  @return EFI_INVALID_PARAMETER Some parameters are invalid.\r
-  @return EFI_TIMEOUT           The transfer failed due to timeout.\r
-  @return EFI_DEVICE_ERROR      The failed due to host controller or device error\r
+  @param  This                  This EFI_USB2_HC_PROTOCOL instance.\r
+  @param  DeviceAddress         Target device address.\r
+  @param  EndPointAddress       Endpoint number and its direction encoded in bit 7\r
+  @param  DeviceSpeed           Indicates device speed.\r
+  @param  MaximumPacketLength   Maximum packet size the target endpoint is capable\r
+                                of sending or receiving.\r
+  @param  Data                  Buffer of data that will be transmitted to  USB\r
+                                device or received from USB device.\r
+  @param  DataLength            On input, the size, in bytes, of the data buffer; On\r
+                                output, the number of bytes transferred.\r
+  @param  DataToggle            On input, the initial data toggle to use; on output,\r
+                                it is updated to indicate the next data toggle.\r
+  @param  TimeOut               Maximum time, in second, to complete.\r
+  @param  Translator            Transaction translator to use.\r
+  @param  TransferResult        Variable to receive the transfer result.\r
+\r
+  @return EFI_SUCCESS           The transfer was completed successfully.\r
+  @return EFI_OUT_OF_RESOURCES  The transfer failed due to lack of resource.\r
+  @return EFI_INVALID_PARAMETER Some parameters are invalid.\r
+  @return EFI_TIMEOUT           The transfer failed due to timeout.\r
+  @return EFI_DEVICE_ERROR      The failed due to host controller or device error\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 EhcSyncInterruptTransfer (\r
@@ -1201,8 +1182,8 @@ ON_EXIT:
   Submits isochronous transfer to a target USB device.\r
 \r
   @param  This                 This EFI_USB2_HC_PROTOCOL instance.\r
-  @param  DeviceAddress        Target device address\r
-  @param  EndPointAddress      End point address with its direction\r
+  @param  DeviceAddress        Target device address.\r
+  @param  EndPointAddress      End point address with its direction.\r
   @param  DeviceSpeed          Device speed, Low speed device doesn't support this\r
                                type.\r
   @param  MaximumPacketLength  Maximum packet size that the endpoint is capable of\r
@@ -1211,14 +1192,13 @@ ON_EXIT:
   @param  Data                 Array of pointers to the buffers of data that will\r
                                be transmitted to USB device or received from USB\r
                                device.\r
-  @param  DataLength           The size, in bytes, of the data buffer\r
+  @param  DataLength           The size, in bytes, of the data buffer.\r
   @param  Translator           Transaction translator to use.\r
-  @param  TransferResult       Variable to receive the transfer result\r
+  @param  TransferResult       Variable to receive the transfer result.\r
 \r
-  @return EFI_UNSUPPORTED : Isochronous transfer is unsupported.\r
+  @return EFI_UNSUPPORTED      Isochronous transfer is unsupported.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 EhcIsochronousTransfer (\r
@@ -1242,8 +1222,8 @@ EhcIsochronousTransfer (
   Submits Async isochronous transfer to a target USB device.\r
 \r
   @param  This                 This EFI_USB2_HC_PROTOCOL instance.\r
-  @param  DeviceAddress        Target device address\r
-  @param  EndPointAddress      End point address with its direction\r
+  @param  DeviceAddress        Target device address.\r
+  @param  EndPointAddress      End point address with its direction.\r
   @param  DeviceSpeed          Device speed, Low speed device doesn't support this\r
                                type.\r
   @param  MaximumPacketLength  Maximum packet size that the endpoint is capable of\r
@@ -1252,16 +1232,15 @@ EhcIsochronousTransfer (
   @param  Data                 Array of pointers to the buffers of data that will\r
                                be transmitted to USB device or received from USB\r
                                device.\r
-  @param  DataLength           The size, in bytes, of the data buffer\r
+  @param  DataLength           The size, in bytes, of the data buffer.\r
   @param  Translator           Transaction translator to use.\r
-  @param  IsochronousCallBack  Function to be called when the transfer complete\r
+  @param  IsochronousCallBack  Function to be called when the transfer complete.\r
   @param  Context              Context passed to the call back function as\r
-                               parameter\r
+                               parameter.\r
 \r
-  @return EFI_UNSUPPORTED : Isochronous transfer isn't supported\r
+  @return EFI_UNSUPPORTED      Isochronous transfer isn't supported.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 EhcAsyncIsochronousTransfer (\r
@@ -1281,29 +1260,22 @@ EhcAsyncIsochronousTransfer (
   return EFI_UNSUPPORTED;\r
 }\r
 \r
+/**\r
+  Entry point for EFI drivers.\r
+\r
+  @param  ImageHandle       EFI_HANDLE.\r
+  @param  SystemTable       EFI_SYSTEM_TABLE.\r
+\r
+  @return EFI_SUCCESS       Success.\r
+          EFI_DEVICE_ERROR  Fail.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 EhcDriverEntryPoint (\r
   IN EFI_HANDLE           ImageHandle,\r
   IN EFI_SYSTEM_TABLE     *SystemTable\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Entry point for EFI drivers.\r
-\r
-Arguments:\r
-\r
-  ImageHandle - EFI_HANDLE\r
-  SystemTable - EFI_SYSTEM_TABLE\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS         Success\r
-  EFI_DEVICE_ERROR    Fail\r
-\r
---*/\r
 {\r
   return EfiLibInstallDriverBindingComponentName2 (\r
            ImageHandle,\r
@@ -1322,11 +1294,11 @@ Returns:
   be supported.\r
 \r
   @param  This                 Protocol instance pointer.\r
-  @param  Controlle            Handle of device to test\r
-  @param  RemainingDevicePath  Not used\r
+  @param  Controller           Handle of device to test.\r
+  @param  RemainingDevicePath  Not used.\r
 \r
-  @return EFI_SUCCESS         : This driver supports this device.\r
-  @return EFI_UNSUPPORTED     : This driver does not support this device.\r
+  @return EFI_SUCCESS          This driver supports this device.\r
+  @return EFI_UNSUPPORTED      This driver does not support this device.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -1393,16 +1365,15 @@ ON_EXIT:
 \r
 \r
 /**\r
-  Create and initialize a USB2_HC_DEV\r
+  Create and initialize a USB2_HC_DEV.\r
 \r
-  @param  PciIo                  The PciIo on this device\r
-  @param  OriginalPciAttributes  Original PCI attributes\r
+  @param  PciIo                  The PciIo on this device.\r
+  @param  OriginalPciAttributes  Original PCI attributes.\r
 \r
-  @return The allocated and initialized USB2_HC_DEV structure\r
-  @return if created, otherwise NULL.\r
+  @return  The allocated and initialized USB2_HC_DEV structure if created,\r
+           otherwise NULL.\r
 \r
 **/\r
-STATIC\r
 USB2_HC_DEV *\r
 EhcCreateUsb2Hc (\r
   IN EFI_PCI_IO_PROTOCOL  *PciIo,\r
@@ -1471,16 +1442,16 @@ EhcCreateUsb2Hc (
 \r
 \r
 /**\r
-  Starting the Usb EHCI Driver\r
+  Starting the Usb EHCI Driver.\r
 \r
   @param  This                 Protocol instance pointer.\r
-  @param  Controller           Handle of device to test\r
-  @param  RemainingDevicePath  Not used\r
+  @param  Controller           Handle of device to test.\r
+  @param  RemainingDevicePath  Not used.\r
 \r
-  @return EFI_SUCCESS          supports this device.\r
-  @return EFI_UNSUPPORTED      do not support this device.\r
-  @return EFI_DEVICE_ERROR     : cannot be started due to device Error\r
-  @return EFI_OUT_OF_RESOURCES : cannot allocate resources\r
+  @return EFI_SUCCESS          supports this device.\r
+  @return EFI_UNSUPPORTED      do not support this device.\r
+  @return EFI_DEVICE_ERROR     cannot be started due to device Error.\r
+  @return EFI_OUT_OF_RESOURCES cannot allocate resources.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -1668,12 +1639,12 @@ CLOSE_PCIIO:
   created by this driver.\r
 \r
   @param  This                 Protocol instance pointer.\r
-  @param  Controller           Handle of device to stop driver on\r
-  @param  NumberOfChildren     Number of Children in the ChildHandleBuffer\r
+  @param  Controller           Handle of device to stop driver on.\r
+  @param  NumberOfChildren     Number of Children in the ChildHandleBuffer.\r
   @param  ChildHandleBuffer    List of handles for the children we need to stop.\r
 \r
-  @return EFI_SUCCESS         Success\r
-  @return EFI_DEVICE_ERROR    Fail\r
+  @return EFI_SUCCESS          Success.\r
+  @return EFI_DEVICE_ERROR     Fail.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -1734,7 +1705,7 @@ EhcDriverBindingStop (
 \r
   EhcFreeSched (Ehc);\r
 \r
-  if (Ehc->ControllerNameTable) {\r
+  if (Ehc->ControllerNameTable != NULL) {\r
     FreeUnicodeStringTable (Ehc->ControllerNameTable);\r
   }\r
 \r