]> git.proxmox.com Git - mirror_edk2.git/commitdiff
modify coding style to pass ecc tool and provide comments that complied with Doxgen.
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 8 Jul 2008 10:26:16 +0000 (10:26 +0000)
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 8 Jul 2008 10:26:16 +0000 (10:26 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5427 6f19259b-4bc3-4df7-8a09-765794883524

13 files changed:
MdeModulePkg/Bus/Pci/EhciDxe/ComponentName.c
MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
MdeModulePkg/Bus/Pci/EhciDxe/Ehci.h
MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.c
MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.h
MdeModulePkg/Bus/Pci/EhciDxe/EhciReg.c
MdeModulePkg/Bus/Pci/EhciDxe/EhciReg.h
MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.h
MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.c
MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.h
MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c
MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.h

index 660dd5500c801fcf740d21711b621778d8121cf8..84532ef1bd4004352fef7c8c653ba14d6ba71a07 100644 (file)
@@ -1,4 +1,5 @@
 /** @file\r
+  UEFI Component Name(2) protocol implementation for EHCI driver.\r
 \r
 Copyright (c) 2006 - 2007, Intel Corporation  \r
   \r
@@ -11,13 +12,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
-  ComponentName.c\r
-\r
-Abstract:\r
-\r
-\r
 **/\r
 \r
 #include "Ehci.h"\r
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
index 94e415e2a55d705addf820520aac4e0cb5f226a7..ec2e913dc0e4fce1962056d8985173647d7006df 100644 (file)
@@ -1,5 +1,7 @@
 /** @file\r
 \r
+  Provides some data struct used by EHCI controller driver.\r
+\r
 Copyright (c) 2006 - 2007, 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
@@ -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.h\r
-\r
-Abstract:\r
-\r
-\r
-Revision History\r
-\r
 **/\r
 \r
 #ifndef _EFI_EHCI_H_\r
@@ -48,7 +41,7 @@ typedef struct _USB2_HC_DEV  USB2_HC_DEV;
 #include "EhciSched.h"\r
 #include "EhciDebug.h"\r
 \r
-enum {\r
+typedef enum {\r
   EHC_1_MICROSECOND            = 1,\r
   EHC_1_MILLISECOND            = 1000 * EHC_1_MICROSECOND,\r
   EHC_1_SECOND                 = 1000 * EHC_1_MILLISECOND,\r
@@ -69,16 +62,17 @@ enum {
   // and the unit of Async is 100us, means 50ms as interval.\r
   //\r
   EHC_SYNC_POLL_INTERVAL       = 20 * EHC_1_MICROSECOND,\r
-  EHC_ASYNC_POLL_INTERVAL      = 50 * 10000U,\r
+  EHC_ASYNC_POLL_INTERVAL      = 50 * 10000U\r
+} EHC_TIMEOUT_EXPERIENCE_VALUE;\r
+\r
 \r
   //\r
   // EHC raises TPL to TPL_NOTIFY to serialize all its operations\r
   // to protect shared data structures.\r
   //\r
-  EHC_TPL                      = TPL_NOTIFY,\r
+#define  EHC_TPL                TPL_NOTIFY\r
 \r
-  USB2_HC_DEV_SIGNATURE        = EFI_SIGNATURE_32 ('e', 'h', 'c', 'i')\r
-};\r
+#define  USB2_HC_DEV_SIGNATURE  EFI_SIGNATURE_32 ('e', 'h', 'c', 'i')\r
 \r
 //\r
 //Iterate through the doule linked list. NOT delete safe\r
index 25a4dbff9bd8f55b2caffd9024bbd1ceb01934c8..bdc8f2ff03f76aeb63df2f646b35a3684da173db 100644 (file)
@@ -1,5 +1,7 @@
 /** @file\r
 \r
+  This file provides the information dump support for EHCI when in debug mode.\r
+\r
 Copyright (c) 2007, 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
@@ -9,30 +11,19 @@ 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
-    EhciDebug.c\r
-\r
-Abstract:\r
-  This file provides the information dump support for EHCI when in debug mode.\r
-\r
-Revision History\r
-\r
 **/\r
 \r
 \r
 #include "Ehci.h"\r
 \r
 /**\r
-  Dump the status byte in QTD/QH to a more friendly\r
-  format\r
+  Dump the status byte in QTD/QH to a more friendly format.\r
 \r
-  @param  State    The state in the QTD/QH\r
+  @param  State    The state in the QTD/QH.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
-STATIC\r
 VOID\r
 EhcDumpStatus (\r
   IN UINT32               State\r
@@ -75,10 +66,10 @@ EhcDumpStatus (
 \r
 \r
 /**\r
-  Dump the fields of a QTD\r
+  Dump the fields of a QTD.\r
 \r
-  @param  Qtd      The QTD to dump\r
-  @param  Msg      The message to print before the dump\r
+  @param  Qtd      The QTD to dump.\r
+  @param  Msg      The message to print before the dump.\r
 \r
   @return None\r
 \r
@@ -129,11 +120,11 @@ EhcDumpQtd (
 \r
 \r
 /**\r
-  Dump the queue head\r
+  Dump the queue head.\r
 \r
-  @param  Qh       The queue head to dump\r
-  @param  Msg      The message to print before the dump\r
-  @param  DumpBuf  Whether to dump the memory buffer of the associated QTD\r
+  @param  Qh       The queue head to dump.\r
+  @param  Msg      The message to print before the dump.\r
+  @param  DumpBuf  Whether to dump the memory buffer of the associated QTD.\r
 \r
   @return None\r
 \r
@@ -218,12 +209,12 @@ EhcDumpQh (
 \r
 \r
 /**\r
-  Dump the buffer in the form of hex\r
+  Dump the buffer in the form of hex.\r
 \r
-  @param  Buf      The buffer to dump\r
-  @param  Len      The length of buffer\r
+  @param  Buf      The buffer to dump.\r
+  @param  Len      The length of buffer.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
 VOID\r
index 3dd4074bd432847f87d8ab203d4e6d86d032e565..c07e2c248b18c5aaf578be22c6311a61f9af156c 100644 (file)
@@ -26,12 +26,12 @@ Revision History
 \r
 \r
 /**\r
-  Dump the fields of a QTD\r
+  Dump the fields of a QTD.\r
 \r
-  @param  Qtd      The QTD to dump\r
-  @param  Msg      The message to print before the dump\r
+  @param  Qtd      The QTD to dump.\r
+  @param  Msg      The message to print before the dump.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
 VOID\r
@@ -44,13 +44,13 @@ EhcDumpQtd (
 \r
 \r
 /**\r
-  Dump the queue head\r
+  Dump the queue head.\r
 \r
-  @param  Qh       The queue head to dump\r
-  @param  Msg      The message to print before the dump\r
-  @param  DumpBuf  Whether to dump the memory buffer of the associated QTD\r
+  @param  Qh       The queue head to dump.\r
+  @param  Msg      The message to print before the dump.\r
+  @param  DumpBuf  Whether to dump the memory buffer of the associated QTD.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
 VOID\r
@@ -64,12 +64,12 @@ EhcDumpQh (
 \r
 \r
 /**\r
-  Dump the buffer in the form of hex\r
+  Dump the buffer in the form of hex.\r
 \r
-  @param  Buf      The buffer to dump\r
-  @param  Len      The length of buffer\r
+  @param  Buf      The buffer to dump.\r
+  @param  Len      The length of buffer.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
 VOID\r
index b40b0115e9438c863faf40a01460f8275b49a771..87a41e1e889505c8b9e6bbf2ad4f12a5a8145cbc 100644 (file)
@@ -1,5 +1,7 @@
 /** @file\r
 \r
+  The EHCI register operation routines.\r
+\r
 Copyright (c) 2007, 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
@@ -9,17 +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
-    EhciReg.c\r
-\r
-Abstract:\r
-\r
-    The EHCI register operation routines.\r
-\r
-\r
-Revision History\r
-\r
 **/\r
 \r
 \r
@@ -27,12 +18,13 @@ Revision History
 \r
 \r
 /**\r
-  Read  EHCI capability register\r
+  Read EHCI capability register.\r
 \r
-  @param  Ehc          The Ehc device\r
-  @param  Offset       Capability register address\r
+  @param  Ehc          The EHCI device.\r
+  @param  Offset       Capability register address.\r
 \r
-  @return The register content read\r
+  @return The register content read.\r
+  @retval If err, return 0xffff.\r
 \r
 **/\r
 UINT32\r
@@ -63,12 +55,13 @@ EhcReadCapRegister (
 \r
 \r
 /**\r
-  Read  Ehc Operation register\r
+  Read EHCI Operation register.\r
 \r
-  @param  Ehc          The EHCI device\r
-  @param  Offset       The operation register offset\r
+  @param  Ehc          The EHCI device.\r
+  @param  Offset       The operation register offset.\r
 \r
-  @return The register content read\r
+  @return The register content read.\r
+  @retval If err, return 0xffff.\r
 \r
 **/\r
 UINT32\r
@@ -101,13 +94,13 @@ EhcReadOpReg (
 \r
 \r
 /**\r
-  Write  the data to the EHCI operation register\r
+  Write  the data to the EHCI operation register.\r
 \r
-  @param  Ehc          The EHCI device\r
-  @param  Offset       EHCI operation register offset\r
-  @param  Data         The data to write\r
+  @param  Ehc          The EHCI device.\r
+  @param  Offset       EHCI operation register offset.\r
+  @param  Data         The data to write.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
 VOID\r
@@ -137,16 +130,15 @@ EhcWriteOpReg (
 \r
 \r
 /**\r
-  Set one bit of the operational register while keeping other bits\r
+  Set one bit of the operational register while keeping other bits.\r
 \r
-  @param  Ehc          The EHCI device\r
-  @param  Offset       The offset of the operational register\r
-  @param  Bit          The bit mask of the register to set\r
+  @param  Ehc          The EHCI device.\r
+  @param  Offset       The offset of the operational register.\r
+  @param  Bit          The bit mask of the register to set.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
-STATIC\r
 VOID\r
 EhcSetOpRegBit (\r
   IN USB2_HC_DEV          *Ehc,\r
@@ -163,16 +155,15 @@ EhcSetOpRegBit (
 \r
 \r
 /**\r
-  Clear one bit of the operational register while keeping other bits\r
+  Clear one bit of the operational register while keeping other bits.\r
 \r
-  @param  Ehc          The EHCI device\r
-  @param  Offset       The offset of the operational register\r
-  @param  Bit          The bit mask of the register to clear\r
+  @param  Ehc          The EHCI device.\r
+  @param  Offset       The offset of the operational register.\r
+  @param  Bit          The bit mask of the register to clear.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
-STATIC\r
 VOID\r
 EhcClearOpRegBit (\r
   IN USB2_HC_DEV          *Ehc,\r
@@ -190,19 +181,18 @@ EhcClearOpRegBit (
 \r
 /**\r
   Wait the operation register's bit as specified by Bit\r
-  to become set (or clear)\r
+  to become set (or clear).\r
 \r
-  @param  Ehc          The EHCI device\r
-  @param  Offset       The offset of the operation register\r
-  @param  Bit          The bit of the register to wait for\r
-  @param  WaitToSet    Wait the bit to set or clear\r
-  @param  Timeout      The time to wait before abort (in millisecond)\r
+  @param  Ehc          The EHCI device.\r
+  @param  Offset       The offset of the operation register.\r
+  @param  Bit          The bit of the register to wait for.\r
+  @param  WaitToSet    Wait the bit to set or clear.\r
+  @param  Timeout      The time to wait before abort (in millisecond).\r
 \r
-  @retval EFI_SUCCESS  The bit successfully changed by host controller\r
-  @retval EFI_TIMEOUT  The time out occurred\r
+  @retval EFI_SUCCESS  The bit successfully changed by host controller.\r
+  @retval EFI_TIMEOUT  The time out occurred.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EhcWaitOpRegBit (\r
   IN USB2_HC_DEV          *Ehc,\r
@@ -228,11 +218,11 @@ EhcWaitOpRegBit (
 \r
 /**\r
   Add support for UEFI Over Legacy (UoL) feature, stop\r
-  the legacy USB SMI support\r
+  the legacy USB SMI support.\r
 \r
   @param  Ehc          The EHCI device.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
 VOID\r
@@ -258,7 +248,7 @@ EhcClearLegacySupport (
   PciIo->Pci.Write (PciIo, EfiPciIoWidthUint32, ExtendCap, 1, &Value);\r
 \r
   TimeOut = 40;\r
-  while (TimeOut--) {\r
+  while (TimeOut-- != 0) {\r
     gBS->Stall (500);\r
 \r
     PciIo->Pci.Read (PciIo, EfiPciIoWidthUint32, ExtendCap, 1, &Value);\r
@@ -278,11 +268,11 @@ EhcClearLegacySupport (
   Set door bell and wait it to be ACKed by host controller.\r
   This function is used to synchronize with the hardware.\r
 \r
-  @param  Ehc          The EHCI device\r
-  @param  Timeout      The time to wait before abort (in millisecond, ms)\r
+  @param  Ehc          The EHCI device.\r
+  @param  Timeout      The time to wait before abort (in millisecond, ms).\r
 \r
-  @return EFI_SUCCESS : Synchronized with the hardware\r
-  @return EFI_TIMEOUT : Time out happened while waiting door bell to set\r
+  @retval EFI_SUCCESS  Synchronized with the hardware.\r
+  @retval EFI_TIMEOUT  Time out happened while waiting door bell to set.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -314,11 +304,11 @@ EhcSetAndWaitDoorBell (
 \r
 /**\r
   Clear all the interrutp status bits, these bits\r
-  are Write-Clean\r
+  are Write-Clean.\r
 \r
-  @param  Ehc          The EHCI device\r
+  @param  Ehc          The EHCI device.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
 VOID\r
@@ -334,14 +324,13 @@ EhcAckAllInterrupt (
   Enable the periodic schedule then wait EHC to\r
   actually enable it.\r
 \r
-  @param  Ehc          The EHCI device\r
-  @param  Timeout      The time to wait before abort (in millisecond, ms)\r
+  @param  Ehc          The EHCI device.\r
+  @param  Timeout      The time to wait before abort (in millisecond, ms).\r
 \r
-  @return EFI_SUCCESS : The periodical schedule is enabled\r
-  @return EFI_TIMEOUT : Time out happened while enabling periodic schedule\r
+  @retval EFI_SUCCESS  The periodical schedule is enabled.\r
+  @retval EFI_TIMEOUT  Time out happened while enabling periodic schedule.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EhcEnablePeriodSchd (\r
   IN USB2_HC_DEV          *Ehc,\r
@@ -357,15 +346,14 @@ EhcEnablePeriodSchd (
 }\r
 \r
 \r
-\r
 /**\r
-  Disable periodic schedule\r
+  Disable periodic schedule.\r
 \r
-  @param  Ehc          The EHCI device\r
-  @param  Timeout      Time to wait before abort (in millisecond, ms)\r
+  @param  Ehc               The EHCI device.\r
+  @param  Timeout           Time to wait before abort (in millisecond, ms).\r
 \r
-  @return EFI_SUCCESS      : Periodic schedule is disabled.\r
-  @return EFI_DEVICE_ERROR : Fail to disable periodic schedule\r
+  @retval EFI_SUCCESS       Periodic schedule is disabled.\r
+  @retval EFI_DEVICE_ERROR  Fail to disable periodic schedule.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -385,16 +373,15 @@ EhcDisablePeriodSchd (
 \r
 \r
 /**\r
-  Enable asynchrounous schedule\r
+  Enable asynchrounous schedule.\r
 \r
-  @param  Ehc          The EHCI device\r
-  @param  Timeout      Time to wait before abort\r
+  @param  Ehc          The EHCI device.\r
+  @param  Timeout      Time to wait before abort.\r
 \r
-  @return EFI_SUCCESS : The EHCI asynchronous schedule is enabled\r
-  @return Others      : Failed to enable the asynchronous scheudle\r
+  @retval EFI_SUCCESS  The EHCI asynchronous schedule is enabled.\r
+  @return Others       Failed to enable the asynchronous scheudle.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EhcEnableAsyncSchd (\r
   IN USB2_HC_DEV          *Ehc,\r
@@ -412,13 +399,13 @@ EhcEnableAsyncSchd (
 \r
 \r
 /**\r
-  Disable asynchrounous schedule\r
+  Disable asynchrounous schedule.\r
 \r
-  @param  Ehc          The EHCI device\r
-  @param  Timeout      Time to wait before abort (in millisecond, ms)\r
+  @param  Ehc          The EHCI device.\r
+  @param  Timeout      Time to wait before abort (in millisecond, ms).\r
 \r
-  @return EFI_SUCCESS : The asynchronous schedule is disabled\r
-  @return Others      : Failed to disable the asynchronous schedule\r
+  @retval EFI_SUCCESS  The asynchronous schedule is disabled.\r
+  @return Others       Failed to disable the asynchronous schedule.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -438,12 +425,12 @@ EhcDisableAsyncSchd (
 \r
 \r
 /**\r
-  Whether Ehc is halted\r
+  Whether Ehc is halted.\r
 \r
-  @param  Ehc          The EHCI device\r
+  @param  Ehc          The EHCI device.\r
 \r
-  @return TRUE  : The controller is halted\r
-  @return FALSE : It isn't halted\r
+  @retval TRUE         The controller is halted.\r
+  @retval FALSE        It isn't halted.\r
 \r
 **/\r
 BOOLEAN\r
@@ -456,12 +443,12 @@ EhcIsHalt (
 \r
 \r
 /**\r
-  Whether system error occurred\r
+  Whether system error occurred.\r
 \r
-  @param  Ehc          The EHCI device\r
+  @param  Ehc          The EHCI device.\r
 \r
-  @return TRUE  : System error happened\r
-  @return FALSE : No system error\r
+  @return TRUE         System error happened.\r
+  @return FALSE        No system error.\r
 \r
 **/\r
 BOOLEAN\r
@@ -474,13 +461,13 @@ EhcIsSysError (
 \r
 \r
 /**\r
-  Reset the host controller\r
+  Reset the host controller.\r
 \r
-  @param  Ehc          The EHCI device\r
-  @param  Timeout      Time to wait before abort (in millisecond, ms)\r
+  @param  Ehc          The EHCI device.\r
+  @param  Timeout      Time to wait before abort (in millisecond, ms).\r
 \r
-  @return EFI_SUCCESS : The host controller is reset\r
-  @return Others      : Failed to reset the host\r
+  @retval EFI_SUCCESS  The host controller is reset.\r
+  @return Others       Failed to reset the host.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -509,13 +496,13 @@ EhcResetHC (
 \r
 \r
 /**\r
-  Halt the host controller\r
+  Halt the host controller.\r
 \r
-  @param  Ehc          The EHCI device\r
-  @param  Timeout      Time to wait before abort\r
+  @param  Ehc          The EHCI device.\r
+  @param  Timeout      Time to wait before abort.\r
 \r
-  @return EFI_SUCCESS : The EHCI is halt\r
-  @return EFI_TIMEOUT : Failed to halt the controller before Timeout\r
+  @retval EFI_SUCCESS  The EHCI is halt.\r
+  @retval EFI_TIMEOUT  Failed to halt the controller before Timeout.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -533,13 +520,13 @@ EhcHaltHC (
 \r
 \r
 /**\r
-  Set the EHCI to run\r
+  Set the EHCI to run.\r
 \r
-  @param  Ehc          The EHCI device\r
-  @param  Timeout      Time to wait before abort\r
+  @param  Ehc          The EHCI device.\r
+  @param  Timeout      Time to wait before abort.\r
 \r
-  @return EFI_SUCCESS : The EHCI is running\r
-  @return Others      : Failed to set the EHCI to run\r
+  @retval EFI_SUCCESS  The EHCI is running.\r
+  @return Others       Failed to set the EHCI to run.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -558,17 +545,17 @@ EhcRunHC (
 \r
 /**\r
   Initialize the HC hardware.\r
-  EHCI spec lists the five things to do to initialize the hardware\r
+  EHCI spec lists the five things to do to initialize the hardware:\r
   1. Program CTRLDSSEGMENT\r
   2. Set USBINTR to enable interrupts\r
   3. Set periodic list base\r
   4. Set USBCMD, interrupt threshold, frame list size etc\r
   5. Write 1 to CONFIGFLAG to route all ports to EHCI\r
 \r
-  @param  Ehc          The EHCI device\r
+  @param  Ehc          The EHCI device.\r
 \r
-  @return EFI_SUCCESS : The EHCI has come out of halt state\r
-  @return EFI_TIMEOUT : Time out happened\r
+  @return EFI_SUCCESS  The EHCI has come out of halt state.\r
+  @return EFI_TIMEOUT  Time out happened.\r
 \r
 **/\r
 EFI_STATUS\r
index 929bd22a375f24ffbf63214ccecb0c3167e80adc..00406e549b7f8a8208f082745d9686297b49fbd4 100644 (file)
@@ -1,5 +1,7 @@
 /** @file\r
 \r
+  This file contains the definination for host controller register operation routines.\r
+\r
 Copyright (c) 2007, 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
@@ -9,23 +11,13 @@ 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
-  EhciReg.h\r
-\r
-Abstract:\r
-\r
-  This file contains the definination for host controller register operation routines\r
-\r
-Revision History\r
-\r
 **/\r
 \r
 #ifndef _EFI_EHCI_REG_H_\r
 #define _EFI_EHCI_REG_H_\r
 \r
 \r
-enum {\r
+typedef enum {\r
   //\r
   // Capability register offset\r
   //\r
@@ -94,7 +86,7 @@ enum {
   EHC_PCI_CLASSC          = 0x09,\r
   EHC_PCI_CLASSC_PI       = 0x20,\r
   EHC_BAR_INDEX           = 0 /* how many bytes away from USB_BASE to 0x10 */\r
-};\r
+}EHCI_REGISTER_OFFSET;\r
 \r
 #define EHC_LINK_TERMINATED(Link) (((Link) & 0x01) != 0)\r
 \r
@@ -123,38 +115,30 @@ typedef struct {
 } USB_CLASSC;\r
 #pragma pack()\r
 \r
+/**\r
+  Read EHCI capability register.\r
+\r
+  @param  Ehc     The EHCI device.\r
+  @param  Offset  Capability register address.\r
+\r
+  @return The register content.\r
 \r
+**/\r
 UINT32\r
 EhcReadCapRegister (\r
   IN  USB2_HC_DEV         *Ehc,\r
   IN  UINT32              Offset\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Read  EHCI capability register\r
-\r
-Arguments:\r
-\r
-  Ehc     - The Ehc device\r
-  Offset  - Capability register address\r
-\r
-Returns:\r
-\r
-  The register content read\r
-\r
---*/\r
 ;\r
 \r
 \r
 /**\r
-  Read  Ehc Operation register\r
+  Read EHCI Operation register.\r
 \r
-  @param  Ehc      The EHCI device\r
-  @param  Offset   The operation register offset\r
+  @param  Ehc      The EHCI device.\r
+  @param  Offset   The operation register offset.\r
 \r
-  @return The register content read\r
+  @return The register content.\r
 \r
 **/\r
 UINT32\r
@@ -166,13 +150,13 @@ EhcReadOpReg (
 \r
 \r
 /**\r
-  Write  the data to the EHCI operation register\r
+  Write  the data to the EHCI operation register.\r
 \r
-  @param  Ehc      The EHCI device\r
-  @param  Offset   EHCI operation register offset\r
-  @param  Data     The data to write\r
+  @param  Ehc      The EHCI device.\r
+  @param  Offset   EHCI operation register offset.\r
+  @param  Data     The data to write.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
 VOID\r
@@ -186,11 +170,11 @@ EhcWriteOpReg (
 \r
 /**\r
   Add support for UEFI Over Legacy (UoL) feature, stop\r
-  the legacy USB SMI support\r
+  the legacy USB SMI support.\r
 \r
   @param  Ehc      The EHCI device.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
 VOID\r
@@ -205,11 +189,11 @@ EhcClearLegacySupport (
   Set door bell and wait it to be ACKed by host controller.\r
   This function is used to synchronize with the hardware.\r
 \r
-  @param  Ehc      The EHCI device\r
-  @param  Timeout  The time to wait before abort (in millisecond, ms)\r
+  @param  Ehc          The EHCI device.\r
+  @param  Timeout      The time to wait before abort (in millisecond, ms).\r
 \r
-  @return EFI_SUCCESS : Synchronized with the hardware\r
-  @return EFI_TIMEOUT : Time out happened while waiting door bell to set\r
+  @retval EFI_SUCCESS  Synchronized with the hardware.\r
+  @retval EFI_TIMEOUT  Time out happened while waiting door bell to set.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -221,12 +205,11 @@ EhcSetAndWaitDoorBell (
 \r
 \r
 /**\r
-  Clear all the interrutp status bits, these bits\r
-  are Write-Clean\r
+  Clear all the interrutp status bits, these bits are Write-Clean.\r
 \r
-  @param  Ehc      The EHCI device\r
+  @param  Ehc      The EHCI device.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
 VOID\r
@@ -238,12 +221,12 @@ EhcAckAllInterrupt (
 \r
 \r
 /**\r
-  Whether Ehc is halted\r
+  Whether Ehc is halted.\r
 \r
-  @param  Ehc      The EHCI device\r
+  @param  Ehc     The EHCI device.\r
 \r
-  @return TRUE  : The controller is halted\r
-  @return FALSE : It isn't halted\r
+  @retval TRUE    The controller is halted.\r
+  @retval FALSE   It isn't halted.\r
 \r
 **/\r
 BOOLEAN\r
@@ -254,12 +237,12 @@ EhcIsHalt (
 \r
 \r
 /**\r
-  Whether system error occurred\r
+  Whether system error occurred.\r
 \r
-  @param  Ehc      The EHCI device\r
+  @param  Ehc      The EHCI device.\r
 \r
-  @return TRUE  : System error happened\r
-  @return FALSE : No system error\r
+  @retval TRUE     System error happened.\r
+  @retval FALSE    No system error.\r
 \r
 **/\r
 BOOLEAN\r
@@ -269,15 +252,14 @@ EhcIsSysError (
 ;\r
 \r
 \r
-\r
 /**\r
-  Reset the host controller\r
+  Reset the host controller.\r
 \r
-  @param  Ehc      The EHCI device\r
-  @param  Timeout  Time to wait before abort (in millisecond, ms)\r
+  @param  Ehc          The EHCI device.\r
+  @param  Timeout      Time to wait before abort (in millisecond, ms).\r
 \r
-  @return EFI_SUCCESS : The host controller is reset\r
-  @return Others      : Failed to reset the host\r
+  @retval EFI_SUCCESS  The host controller is reset.\r
+  @return Others       Failed to reset the host.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -288,15 +270,14 @@ EhcResetHC (
 ;\r
 \r
 \r
-\r
 /**\r
-  Halt the host controller\r
+  Halt the host controller.\r
 \r
-  @param  Ehc      The EHCI device\r
-  @param  Timeout  Time to wait before abort\r
+  @param  Ehc          The EHCI device.\r
+  @param  Timeout      Time to wait before abort.\r
 \r
-  @return EFI_SUCCESS : The EHCI is halt\r
-  @return EFI_TIMEOUT : Failed to halt the controller before Timeout\r
+  @return EFI_SUCCESS  The EHCI is halt.\r
+  @return EFI_TIMEOUT  Failed to halt the controller before Timeout.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -307,15 +288,14 @@ EhcHaltHC (
 ;\r
 \r
 \r
-\r
 /**\r
-  Set the EHCI to run\r
+  Set the EHCI to run.\r
 \r
-  @param  Ehc      The EHCI device\r
-  @param  Timeout  Time to wait before abort\r
+  @param  Ehc          The EHCI device.\r
+  @param  Timeout      Time to wait before abort.\r
 \r
-  @return EFI_SUCCESS : The EHCI is running\r
-  @return Others      : Failed to set the EHCI to run\r
+  @return EFI_SUCCESS  The EHCI is running.\r
+  @return Others       Failed to set the EHCI to run.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -329,17 +309,17 @@ EhcRunHC (
 \r
 /**\r
   Initialize the HC hardware.\r
-  EHCI spec lists the five things to do to initialize the hardware\r
+  EHCI spec lists the five things to do to initialize the hardware:\r
   1. Program CTRLDSSEGMENT\r
   2. Set USBINTR to enable interrupts\r
   3. Set periodic list base\r
   4. Set USBCMD, interrupt threshold, frame list size etc\r
   5. Write 1 to CONFIGFLAG to route all ports to EHCI\r
 \r
-  @param  Ehc      The EHCI device\r
+  @param  Ehc          The EHCI device.\r
 \r
-  @return EFI_SUCCESS : The EHCI has come out of halt state\r
-  @return EFI_TIMEOUT : Time out happened\r
+  @return EFI_SUCCESS  The EHCI has come out of halt state.\r
+  @return EFI_TIMEOUT  Time out happened.\r
 \r
 **/\r
 EFI_STATUS\r
index 60b095f31ebccd827530840989a544cc2b418096..522f2d063325ede065fcc19f76293061d4353240 100644 (file)
@@ -1,5 +1,7 @@
 /** @file\r
 \r
+  EHCI transfer scheduling routines.\r
+\r
 Copyright (c) 2007, 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
@@ -9,31 +11,20 @@ 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
-    EhciSched.c\r
-\r
-Abstract:\r
-\r
-    EHCI transfer scheduling routines\r
-\r
-Revision History\r
-\r
 **/\r
 \r
 #include "Ehci.h"\r
 \r
 \r
 /**\r
-  Create helper QTD/QH for the EHCI device\r
+  Create helper QTD/QH for the EHCI device.\r
 \r
-  @param  Ehc                   The EHCI device\r
+  @param  Ehc                   The EHCI device.\r
 \r
-  @retval EFI_OUT_OF_RESOURCES  Failed to allocate resource for helper QTD/QH\r
-  @retval EFI_SUCCESS           Helper QH/QTD are created\r
+  @retval EFI_OUT_OF_RESOURCES  Failed to allocate resource for helper QTD/QH.\r
+  @retval EFI_SUCCESS           Helper QH/QTD are created.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EhcCreateHelpQ (\r
   IN USB2_HC_DEV          *Ehc\r
@@ -102,14 +93,13 @@ EhcCreateHelpQ (
 }\r
 \r
 \r
-\r
 /**\r
-  Initialize the schedule data structure such as frame list\r
+  Initialize the schedule data structure such as frame list.\r
 \r
-  @param  Ehc                   The EHCI device to init schedule data for\r
+  @param  Ehc                   The EHCI device to init schedule data.\r
 \r
-  @retval EFI_OUT_OF_RESOURCES  Failed to allocate resource to init schedule data\r
-  @retval EFI_SUCCESS           The schedule data is initialized\r
+  @retval EFI_OUT_OF_RESOURCES  Failed to allocate resource to init schedule data.\r
+  @retval EFI_SUCCESS           The schedule data is initialized.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -213,13 +203,12 @@ EhcInitSched (
 }\r
 \r
 \r
-\r
 /**\r
   Free the schedule data. It may be partially initialized.\r
 \r
-  @param  Ehc                   The EHCI device\r
+  @param  Ehc                   The EHCI device.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
 VOID\r
@@ -269,7 +258,6 @@ EhcFreeSched (
 }\r
 \r
 \r
-\r
 /**\r
   Link the queue head to the asynchronous schedule list.\r
   UEFI only supports one CTRL/BULK transfer at a time\r
@@ -277,10 +265,10 @@ EhcFreeSched (
   management: A reclamation header is always linked to\r
   the AsyncListAddr, the only active QH is appended to it.\r
 \r
-  @param  Ehc                   The EHCI device\r
-  @param  Qh                    The queue head to link\r
+  @param  Ehc                   The EHCI device.\r
+  @param  Qh                    The queue head to link.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
 VOID\r
@@ -308,12 +296,12 @@ EhcLinkQhToAsync (
 \r
 /**\r
   Unlink a queue head from the asynchronous schedule list.\r
-  Need to synchronize with hardware\r
+  Need to synchronize with hardware.\r
 \r
-  @param  Ehc                   The EHCI device\r
-  @param  Qh                    The queue head to unlink\r
+  @param  Ehc                   The EHCI device.\r
+  @param  Qh                    The queue head to unlink.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
 VOID\r
@@ -355,10 +343,10 @@ EhcUnlinkQhFromAsync (
   schedule frame list. This code is very much the same as\r
   that in UHCI.\r
 \r
-  @param  Ehc                   The EHCI device\r
-  @param  Qh                    The queue head to link\r
+  @param  Ehc                   The EHCI device.\r
+  @param  Qh                    The queue head to link.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
 VOID\r
@@ -454,12 +442,12 @@ EhcLinkQhToPeriod (
 \r
 /**\r
   Unlink an interrupt queue head from the periodic\r
-  schedule frame list\r
+  schedule frame list.\r
 \r
-  @param  Ehc                   The EHCI device\r
-  @param  Qh                    The queue head to unlink\r
+  @param  Ehc                   The EHCI device.\r
+  @param  Qh                    The queue head to unlink.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
 VOID\r
@@ -514,18 +502,16 @@ EhcUnlinkQhFromPeriod (
 }\r
 \r
 \r
-\r
 /**\r
   Check the URB's execution result and update the URB's\r
   result accordingly.\r
 \r
-  @param  Ehc                   The EHCI device\r
-  @param  Urb                   The URB to check result\r
+  @param  Ehc                   The EHCI device.\r
+  @param  Urb                   The URB to check result.\r
 \r
   @return Whether the result of URB transfer is finialized.\r
 \r
 **/\r
-STATIC\r
 BOOLEAN\r
 EhcCheckUrbResult (\r
   IN  USB2_HC_DEV         *Ehc,\r
@@ -637,13 +623,13 @@ ON_EXIT:
 /**\r
   Execute the transfer by polling the URB. This is a synchronous operation.\r
 \r
-  @param  Ehc                   The EHCI device\r
-  @param  Urb                   The URB to execute\r
-  @param  TimeOut               The time to wait before abort, in millisecond.\r
+  @param  Ehc               The EHCI device.\r
+  @param  Urb               The URB to execute.\r
+  @param  TimeOut           The time to wait before abort, in millisecond.\r
 \r
-  @return EFI_DEVICE_ERROR : The transfer failed due to transfer error\r
-  @return EFI_TIMEOUT      : The transfer failed due to time out\r
-  @return EFI_SUCCESS      : The transfer finished OK\r
+  @return EFI_DEVICE_ERROR  The transfer failed due to transfer error.\r
+  @return EFI_TIMEOUT       The transfer failed due to time out.\r
+  @return EFI_SUCCESS       The transfer finished OK.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -691,15 +677,15 @@ EhcExecTransfer (
 \r
 /**\r
   Delete a single asynchronous interrupt transfer for\r
-  the device and endpoint\r
+  the device and endpoint.\r
 \r
-  @param  Ehc                   The EHCI device\r
-  @param  DevAddr               The address of the target device\r
-  @param  EpNum                 The endpoint of the target\r
-  @param  DataToggle            Return the next data toggle to use\r
+  @param  Ehc                   The EHCI device.\r
+  @param  DevAddr               The address of the target device.\r
+  @param  EpNum                 The endpoint of the target.\r
+  @param  DataToggle            Return the next data toggle to use.\r
 \r
-  @retval EFI_SUCCESS           An asynchronous transfer is removed\r
-  @retval EFI_NOT_FOUND         No transfer for the device is found\r
+  @retval EFI_SUCCESS           An asynchronous transfer is removed.\r
+  @retval EFI_NOT_FOUND         No transfer for the device is found.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -715,7 +701,7 @@ EhciDelAsyncIntTransfer (
   URB                     *Urb;\r
   EFI_USB_DATA_DIRECTION  Direction;\r
 \r
-  Direction = ((EpNum & 0x80) ? EfiUsbDataIn : EfiUsbDataOut);\r
+  Direction = (((EpNum & 0x80) != 0) ? EfiUsbDataIn : EfiUsbDataOut);\r
   EpNum    &= 0x0F;\r
 \r
   EFI_LIST_FOR_EACH_SAFE (Entry, Next, &Ehc->AsyncIntTransfers) {\r
@@ -744,11 +730,11 @@ EhciDelAsyncIntTransfer (
 \r
 \r
 /**\r
-  Remove all the asynchronous interrutp transfers\r
+  Remove all the asynchronous interrutp transfers.\r
 \r
-  @param  Ehc                   The EHCI device\r
+  @param  Ehc                   The EHCI device.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
 VOID\r
@@ -771,30 +757,23 @@ EhciDelAllAsyncIntTransfers (
   }\r
 }\r
 \r
-STATIC\r
-EFI_STATUS\r
-EhcFlushAsyncIntMap (\r
-  IN  USB2_HC_DEV         *Ehc,\r
-  IN  URB                 *Urb\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   Flush data from PCI controller specific address to mapped system\r
   memory address.\r
 \r
-Arguments:\r
+  @param  Ehc                The EHCI device.\r
+  @param  Urb                The URB to unmap.\r
 \r
-  Ehc         - The EHCI device\r
-  Urb         - The URB to unmap\r
+  @retval EFI_SUCCESS        Success to flush data to mapped system memory.\r
+  @retval EFI_DEVICE_ERROR   Fail to flush data to mapped system memory.\r
 \r
-Returns:\r
-\r
-  EFI_SUCCESS      - Success to flush data to mapped system memory\r
-  EFI_DEVICE_ERROR - Fail to flush data to mapped system memory\r
-\r
---*/\r
+**/\r
+EFI_STATUS\r
+EhcFlushAsyncIntMap (\r
+  IN  USB2_HC_DEV         *Ehc,\r
+  IN  URB                 *Urb\r
+  )\r
 {\r
   EFI_STATUS                    Status;\r
   EFI_PHYSICAL_ADDRESS          PhyAddr;\r
@@ -833,16 +812,14 @@ ON_ERROR:
 }\r
 \r
 \r
-\r
 /**\r
-  Update the queue head for next round of asynchronous transfer\r
+  Update the queue head for next round of asynchronous transfer.\r
 \r
-  @param  Urb                   The URB to update\r
+  @param  Urb                   The URB to update.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
-STATIC\r
 VOID\r
 EhcUpdateAsyncRequest (\r
   IN URB                  *Urb\r
@@ -913,12 +890,12 @@ EhcUpdateAsyncRequest (
 \r
 \r
 /**\r
-  Interrupt transfer periodic check handler\r
+  Interrupt transfer periodic check handler.\r
 \r
-  @param  Event                 Interrupt event\r
-  @param  Context               Pointer to USB2_HC_DEV\r
+  @param  Event                 Interrupt event.\r
+  @param  Context               Pointer to USB2_HC_DEV.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
 VOID\r
index d8f266105953889e84fd55360e3f4258383e2f96..13f7b5ad416b49a15efc65d5ee1beb46443dbda2 100644 (file)
@@ -1,5 +1,7 @@
 /** @file\r
 \r
+  This file contains the definination for host controller schedule routines.\r
+\r
 Copyright (c) 2007, 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
@@ -9,49 +11,32 @@ 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
 \r
-  EhciSched.h\r
+#ifndef _EFI_EHCI_SCHED_H_\r
+#define _EFI_EHCI_SCHED_H_\r
 \r
-Abstract:\r
 \r
-  This file contains the definination for host controller schedule routines\r
+/**\r
+  Initialize the schedule data structure such as frame list.\r
 \r
-Revision History\r
+  @param Ehc                    The EHCI device to init schedule data for.\r
 \r
-**/\r
-\r
-#ifndef _EFI_EHCI_SCHED_H_\r
-#define _EFI_EHCI_SCHED_H_\r
+  @retval EFI_OUT_OF_RESOURCES  Failed to allocate resource to init schedule data.\r
+  @retval EFI_SUCCESS           The schedule data is initialized.\r
 \r
+**/\r
 EFI_STATUS\r
 EhcInitSched (\r
   IN USB2_HC_DEV          *Ehc\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Initialize the schedule data structure such as frame list\r
-\r
-Arguments:\r
-\r
-  Ehc - The EHCI device to init schedule data for\r
-\r
-Returns:\r
-\r
-  EFI_OUT_OF_RESOURCES  - Failed to allocate resource to init schedule data\r
-  EFI_SUCCESS           - The schedule data is initialized\r
-\r
---*/\r
 ;\r
 \r
 \r
-\r
 /**\r
   Free the schedule data. It may be partially initialized.\r
 \r
-  @param  Ehc            The EHCI device\r
+  @param  Ehc            The EHCI device.\r
 \r
   @return None\r
 \r
@@ -63,7 +48,6 @@ EhcFreeSched (
 ;\r
 \r
 \r
-\r
 /**\r
   Link the queue head to the asynchronous schedule list.\r
   UEFI only supports one CTRL/BULK transfer at a time\r
@@ -71,10 +55,10 @@ EhcFreeSched (
   management: A reclamation header is always linked to\r
   the AsyncListAddr, the only active QH is appended to it.\r
 \r
-  @param  Ehc            The EHCI device\r
-  @param  Qh             The queue head to link\r
+  @param  Ehc            The EHCI device.\r
+  @param  Qh             The queue head to link.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
 VOID\r
@@ -87,12 +71,12 @@ EhcLinkQhToAsync (
 \r
 /**\r
   Unlink a queue head from the asynchronous schedule list.\r
-  Need to synchronize with hardware\r
+  Need to synchronize with hardware.\r
 \r
-  @param  Ehc            The EHCI device\r
-  @param  Qh             The queue head to unlink\r
+  @param  Ehc            The EHCI device.\r
+  @param  Qh             The queue head to unlink.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
 VOID\r
@@ -108,10 +92,10 @@ EhcUnlinkQhFromAsync (
   schedule frame list. This code is very much the same as\r
   that in UHCI.\r
 \r
-  @param  Ehc            The EHCI device\r
-  @param  Qh             The queue head to link\r
+  @param  Ehc            The EHCI device.\r
+  @param  Qh             The queue head to link.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
 VOID\r
@@ -124,12 +108,12 @@ EhcLinkQhToPeriod (
 \r
 /**\r
   Unlink an interrupt queue head from the periodic\r
-  schedule frame list\r
+  schedule frame list.\r
 \r
-  @param  Ehc            The EHCI device\r
-  @param  Qh             The queue head to unlink\r
+  @param  Ehc            The EHCI device.\r
+  @param  Qh             The queue head to unlink.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
 VOID\r
@@ -144,13 +128,13 @@ EhcUnlinkQhFromPeriod (
 /**\r
   Execute the transfer by polling the URB. This is a synchronous operation.\r
 \r
-  @param  Ehc            The EHCI device\r
-  @param  Urb            The URB to execute\r
-  @param  TimeOut        The time to wait before abort, in millisecond.\r
+  @param  Ehc               The EHCI device.\r
+  @param  Urb               The URB to execute.\r
+  @param  TimeOut           The time to wait before abort, in millisecond.\r
 \r
-  @return EFI_DEVICE_ERROR : The transfer failed due to transfer error\r
-  @return EFI_TIMEOUT      : The transfer failed due to time out\r
-  @return EFI_SUCCESS      : The transfer finished OK\r
+  @retval EFI_DEVICE_ERROR  The transfer failed due to transfer error.\r
+  @retval EFI_TIMEOUT       The transfer failed due to time out.\r
+  @retval EFI_SUCCESS       The transfer finished OK.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -164,15 +148,15 @@ EhcExecTransfer (
 \r
 /**\r
   Delete a single asynchronous interrupt transfer for\r
-  the device and endpoint\r
+  the device and endpoint.\r
 \r
-  @param  Ehc            The EHCI device\r
-  @param  DevAddr        The address of the target device\r
-  @param  EpNum          The endpoint of the target\r
-  @param  DataToggle     Return the next data toggle to use\r
+  @param  Ehc            The EHCI device.\r
+  @param  DevAddr        The address of the target device.\r
+  @param  EpNum          The endpoint of the target.\r
+  @param  DataToggle     Return the next data toggle to use.\r
 \r
-  @retval EFI_SUCCESS    An asynchronous transfer is removed\r
-  @retval EFI_NOT_FOUND  No transfer for the device is found\r
+  @retval EFI_SUCCESS    An asynchronous transfer is removed.\r
+  @retval EFI_NOT_FOUND  No transfer for the device is found.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -186,11 +170,11 @@ EhciDelAsyncIntTransfer (
 \r
 \r
 /**\r
-  Remove all the asynchronous interrutp transfers\r
+  Remove all the asynchronous interrutp transfers.\r
 \r
-  @param  Ehc            The EHCI device\r
+  @param  Ehc            The EHCI device.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
 VOID\r
@@ -200,14 +184,13 @@ EhciDelAllAsyncIntTransfers (
 ;\r
 \r
 \r
-\r
 /**\r
-  Interrupt transfer periodic check handler\r
+  Interrupt transfer periodic check handler.\r
 \r
-  @param  Event          Interrupt event\r
-  @param  Context        Pointer to USB2_HC_DEV\r
+  @param  Event          Interrupt event.\r
+  @param  Context        Pointer to USB2_HC_DEV.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
 VOID\r
index bb272cc8dee8a43bb85115aa382d4d91829b247f..4d8e38be2cc557e3517e3a2676256bd4f2f40d0a 100644 (file)
@@ -1,5 +1,8 @@
 /** @file\r
 \r
+    This file contains URB request, each request is warpped in a\r
+    URB (Usb Request Block).\r
+\r
 Copyright (c) 2007, 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
@@ -9,33 +12,22 @@ 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
-    EhciUrb.c\r
-\r
-Abstract:\r
-\r
-    This file contains URB request, each request is warpped in a\r
-    URB (Usb Request Block)\r
-\r
-Revision History\r
-\r
 **/\r
 \r
 #include "Ehci.h"\r
 \r
 \r
 /**\r
-  Create a single QTD to hold the data\r
+  Create a single QTD to hold the data.\r
 \r
-  @param  Ehc                   The EHCI device\r
-  @param  Data                  Current data not associated with a QTD\r
-  @param  DataLen               The length of the data\r
-  @param  PktId                 Packet ID to use in the QTD\r
-  @param  Toggle                Data toggle to use in the QTD\r
-  @param  MaxPacket             Maximu packet length of the endpoint\r
+  @param  Ehc                   The EHCI device.\r
+  @param  Data                  Current data not associated with a QTD.\r
+  @param  DataLen               The length of the data.\r
+  @param  PktId                 Packet ID to use in the QTD.\r
+  @param  Toggle                Data toggle to use in the QTD.\r
+  @param  MaxPacket             Maximu packet length of the endpoint.\r
 \r
-  @return Created QTD or NULL if failed to create one\r
+  @return Created QTD or NULL if failed to create one.\r
 \r
 **/\r
 EHC_QTD *\r
@@ -130,13 +122,12 @@ EhcCreateQtd (
   2. Microframe S-mask\r
   3. Microframe C-mask\r
 \r
-  @param  Ep                    The queue head's related endpoint\r
-  @param  QhHw                  The queue head to initialize\r
+  @param  Ep                    The queue head's related endpoint.\r
+  @param  QhHw                  The queue head to initialize.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
-STATIC\r
 VOID\r
 EhcInitIntQh (\r
   IN USB_ENDPOINT         *Ep,\r
@@ -173,12 +164,12 @@ EhcInitIntQh (
 \r
 \r
 /**\r
-  Allocate and initialize a EHCI queue head\r
+  Allocate and initialize a EHCI queue head.\r
 \r
-  @param  Ehci                  The EHCI device\r
-  @param  Ep                    The endpoint to create queue head for\r
+  @param  Ehci                  The EHCI device.\r
+  @param  Ep                    The endpoint to create queue head for.\r
 \r
-  @return Created queue head or NULL if failed to create one\r
+  @return Created queue head or NULL if failed to create one.\r
 \r
 **/\r
 EHC_QH *\r
@@ -258,21 +249,19 @@ EhcCreateQh (
 }\r
 \r
 \r
-\r
 /**\r
   Convert the poll interval from application to that\r
   be used by EHCI interface data structure. Only need\r
   to get the max 2^n that is less than interval. UEFI\r
   can't support high speed endpoint with a interval less\r
   than 8 microframe because interval is specified in\r
-  the unit of ms (millisecond)\r
+  the unit of ms (millisecond).\r
 \r
-  @param  Interval              The interval to convert\r
+  @param  Interval              The interval to convert.\r
 \r
-  @return The converted interval\r
+  @return The converted interval.\r
 \r
 **/\r
-STATIC\r
 UINTN\r
 EhcConvertPollRate (\r
   IN  UINTN               Interval\r
@@ -298,17 +287,15 @@ EhcConvertPollRate (
 }\r
 \r
 \r
-\r
 /**\r
-  Free a list of QTDs\r
+  Free a list of QTDs.\r
 \r
-  @param  Ehc                   The EHCI device\r
-  @param  Qtds                  The list head of the QTD\r
+  @param  Ehc                   The EHCI device.\r
+  @param  Qtds                  The list head of the QTD.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
-STATIC\r
 VOID\r
 EhcFreeQtds (\r
   IN USB2_HC_DEV          *Ehc,\r
@@ -331,10 +318,10 @@ EhcFreeQtds (
 /**\r
   Free an allocated URB. It is possible for it to be partially inited.\r
 \r
-  @param  Ehc                   The EHCI device\r
-  @param  Urb                   The URB to free\r
+  @param  Ehc                   The EHCI device.\r
+  @param  Urb                   The URB to free.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
 VOID\r
@@ -368,18 +355,16 @@ EhcFreeUrb (
 }\r
 \r
 \r
-\r
 /**\r
-  Create a list of QTDs for the URB\r
+  Create a list of QTDs for the URB.\r
 \r
-  @param  Ehc                   The EHCI device\r
-  @param  Urb                   The URB to create QTDs for\r
+  @param  Ehc                   The EHCI device.\r
+  @param  Urb                   The URB to create QTDs for.\r
 \r
-  @retval EFI_OUT_OF_RESOURCES  Failed to allocate resource for QTD\r
-  @retval EFI_SUCCESS           The QTDs are allocated for the URB\r
+  @retval EFI_OUT_OF_RESOURCES  Failed to allocate resource for QTD.\r
+  @retval EFI_SUCCESS           The QTDs are allocated for the URB.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EhcCreateQtds (\r
   IN USB2_HC_DEV          *Ehc,\r
@@ -530,24 +515,24 @@ ON_ERROR:
 \r
 \r
 /**\r
-  Create a new URB and its associated QTD\r
-\r
-  @param  Ehc                   The EHCI device\r
-  @param  DevAddr               The device address\r
-  @param  EpAddr                Endpoint addrress & its direction\r
-  @param  DevSpeed              The device speed\r
-  @param  Toggle                Initial data toggle to use\r
-  @param  MaxPacket             The max packet length of the endpoint\r
-  @param  Hub                   The transaction translator to use\r
-  @param  Type                  The transaction type\r
-  @param  Request               The standard USB request for control transfer\r
-  @param  Data                  The user data to transfer\r
-  @param  DataLen               The length of data buffer\r
-  @param  Callback              The function to call when data is transferred\r
-  @param  Context               The context to the callback\r
-  @param  Interval              The interval for interrupt transfer\r
-\r
-  @return Created URB or NULL\r
+  Create a new URB and its associated QTD.\r
+\r
+  @param  Ehc                   The EHCI device.\r
+  @param  DevAddr               The device address.\r
+  @param  EpAddr                Endpoint addrress & its direction.\r
+  @param  DevSpeed              The device speed.\r
+  @param  Toggle                Initial data toggle to use.\r
+  @param  MaxPacket             The max packet length of the endpoint.\r
+  @param  Hub                   The transaction translator to use.\r
+  @param  Type                  The transaction type.\r
+  @param  Request               The standard USB request for control transfer.\r
+  @param  Data                  The user data to transfer.\r
+  @param  DataLen               The length of data buffer.\r
+  @param  Callback              The function to call when data is transferred.\r
+  @param  Context               The context to the callback.\r
+  @param  Interval              The interval for interrupt transfer.\r
+\r
+  @return Created URB or NULL.\r
 \r
 **/\r
 URB *\r
@@ -589,7 +574,7 @@ EhcCreateUrb (
   Ep              = &Urb->Ep;\r
   Ep->DevAddr     = DevAddr;\r
   Ep->EpAddr      = (UINT8) (EpAddr & 0x0F);\r
-  Ep->Direction   = ((EpAddr & 0x80) ? EfiUsbDataIn : EfiUsbDataOut);\r
+  Ep->Direction   = (((EpAddr & 0x80) != 0) ? EfiUsbDataIn : EfiUsbDataOut);\r
   Ep->DevSpeed    = DevSpeed;\r
   Ep->MaxPacket   = MaxPacket;\r
 \r
index a1dc8e6c0a3b90f918e13c0a7971be2d643c1b91..5cda230a018228777588df15b1a4ae40c70eadb2 100644 (file)
@@ -1,5 +1,8 @@
 /** @file\r
 \r
+    This file contains URB request, each request is warpped in a\r
+    URB (Usb Request Block).\r
+\r
 Copyright (c) 2007, 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
@@ -9,17 +12,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
-    EhciUrb.h\r
-\r
-Abstract:\r
-\r
-    This file contains URB request, each request is warpped in a\r
-    URB (Usb Request Block)\r
-\r
-Revision History\r
-\r
 **/\r
 \r
 #ifndef _EFI_EHCI_URB_H_\r
@@ -30,7 +22,7 @@ typedef struct _EHC_QTD  EHC_QTD;
 typedef struct _EHC_QH   EHC_QH;\r
 typedef struct _URB      URB;\r
 \r
-enum {\r
+typedef enum {\r
   //\r
   // Transfer types, used in URB to identify the transfer type\r
   //\r
@@ -84,7 +76,7 @@ enum {
   QH_MICROFRAME_7         = 0x80,\r
 \r
   USB_ERR_SHORT_PACKET    = 0x200\r
-};\r
+}EHCI_URB_FLAG_VALUE;\r
 \r
 //\r
 // Fill in the hardware link point: pass in a EHC_QH/QH_HW\r
@@ -249,16 +241,16 @@ struct _URB {
 \r
 \r
 /**\r
-  Create a single QTD to hold the data\r
+  Create a single QTD to hold the data.\r
 \r
-  @param  Ehc        The EHCI device\r
-  @param  Data       Current data not associated with a QTD\r
-  @param  DataLen    The length of the data\r
-  @param  PktId      Packet ID to use in the QTD\r
-  @param  Toggle     Data toggle to use in the QTD\r
-  @param  MaxPacket  Maximu packet length of the endpoint\r
+  @param  Ehc        The EHCI device.\r
+  @param  Data       Current data not associated with a QTD.\r
+  @param  DataLen    The length of the data.\r
+  @param  PktId      Packet ID to use in the QTD.\r
+  @param  Toggle     Data toggle to use in the QTD.\r
+  @param  MaxPacket  Maximu packet length of the endpoint.\r
 \r
-  @return Created QTD or NULL if failed to create one\r
+  @return Created QTD or NULL if failed to create one.\r
 \r
 **/\r
 EHC_QTD *\r
@@ -275,12 +267,12 @@ EhcCreateQtd (
 \r
 \r
 /**\r
-  Allocate and initialize a EHCI queue head\r
+  Allocate and initialize a EHCI queue head.\r
 \r
-  @param  Ehci       The EHCI device\r
-  @param  Ep         The endpoint to create queue head for\r
+  @param  Ehci       The EHCI device.\r
+  @param  Ep         The endpoint to create queue head for.\r
 \r
-  @return Created queue head or NULL if failed to create one\r
+  @return Created queue head or NULL if failed to create one.\r
 \r
 **/\r
 EHC_QH *\r
@@ -294,10 +286,10 @@ EhcCreateQh (
 /**\r
   Free an allocated URB. It is possible for it to be partially inited.\r
 \r
-  @param  Ehc        The EHCI device\r
-  @param  Urb        The URB to free\r
+  @param  Ehc        The EHCI device.\r
+  @param  Urb        The URB to free.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
 VOID\r
@@ -309,24 +301,24 @@ EhcFreeUrb (
 \r
 \r
 /**\r
-  Create a new URB and its associated QTD\r
-\r
-  @param  Ehc        The EHCI device\r
-  @param  DevAddr    The device address\r
-  @param  EpAddr     Endpoint addrress & its direction\r
-  @param  DevSpeed   The device speed\r
-  @param  Toggle     Initial data toggle to use\r
-  @param  MaxPacket  The max packet length of the endpoint\r
-  @param  Hub        The transaction translator to use\r
-  @param  Type       The transaction type\r
-  @param  Request    The standard USB request for control transfer\r
-  @param  Data       The user data to transfer\r
-  @param  DataLen    The length of data buffer\r
-  @param  Callback   The function to call when data is transferred\r
-  @param  Context    The context to the callback\r
-  @param  Interval   The interval for interrupt transfer\r
-\r
-  @return Created URB or NULL\r
+  Create a new URB and its associated QTD.\r
+\r
+  @param  Ehc        The EHCI device.\r
+  @param  DevAddr    The device address.\r
+  @param  EpAddr     Endpoint addrress & its direction.\r
+  @param  DevSpeed   The device speed.\r
+  @param  Toggle     Initial data toggle to use.\r
+  @param  MaxPacket  The max packet length of the endpoint.\r
+  @param  Hub        The transaction translator to use.\r
+  @param  Type       The transaction type.\r
+  @param  Request    The standard USB request for control transfer.\r
+  @param  Data       The user data to transfer.\r
+  @param  DataLen    The length of data buffer.\r
+  @param  Callback   The function to call when data is transferred.\r
+  @param  Context    The context to the callback.\r
+  @param  Interval   The interval for interrupt transfer.\r
+\r
+  @return Created URB or NULL.\r
 \r
 **/\r
 URB *\r
index d038ebc20da64ac88c989807943c41801527d3b7..92d7bf7a84414ac8fb46f54d6f80c5f2bf1176a4 100644 (file)
@@ -1,5 +1,7 @@
 /** @file\r
 \r
+  Routine procedures for memory allocate/free.\r
+\r
 Copyright (c) 2007, 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
@@ -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
-    EhciMem.c\r
-\r
-Abstract:\r
-\r
-\r
-Revision History\r
-\r
 **/\r
 \r
 \r
@@ -25,15 +18,14 @@ Revision History
 \r
 \r
 /**\r
-  Allocate a block of memory to be used by the buffer pool\r
+  Allocate a block of memory to be used by the buffer pool.\r
 \r
-  @param  Pool           The buffer pool to allocate memory for\r
-  @param  Pages          How many pages to allocate\r
+  @param  Pool           The buffer pool to allocate memory for.\r
+  @param  Pages          How many pages to allocate.\r
 \r
-  @return The allocated memory block or NULL if failed\r
+  @return The allocated memory block or NULL if failed.\r
 \r
 **/\r
-STATIC\r
 USBHC_MEM_BLOCK *\r
 UsbHcAllocMemBlock (\r
   IN  USBHC_MEM_POOL      *Pool,\r
@@ -127,15 +119,14 @@ FREE_BITARRAY:
 \r
 \r
 /**\r
-  Free the memory block from the memory pool\r
+  Free the memory block from the memory pool.\r
 \r
-  @param  Pool           The memory pool to free the block from\r
-  @param  Block          The memory block to free\r
+  @param  Pool           The memory pool to free the block from.\r
+  @param  Block          The memory block to free.\r
 \r
-  @return VOID\r
+  @return None.\r
 \r
 **/\r
-STATIC\r
 VOID\r
 UsbHcFreeMemBlock (\r
   IN USBHC_MEM_POOL       *Pool,\r
@@ -160,17 +151,15 @@ UsbHcFreeMemBlock (
 \r
 \r
 /**\r
-  Alloc some memory from the block\r
+  Alloc some memory from the block.\r
 \r
-  @param  Block          The memory block to allocate memory from\r
-  @param  Mem            The variable to store the memory allocated\r
-  @param  Units          Number of memory units to allocate\r
+  @param  Block          The memory block to allocate memory from.\r
+  @param  Units          Number of memory units to allocate.\r
 \r
-  @return EFI_SUCCESS   : The needed memory is allocated\r
-  @return EFI_NOT_FOUND : Can't find the free memory\r
+  @return The pointer to the allocated memory. If couldn't allocate the needed memory,\r
+          the return value is NULL.\r
 \r
 **/\r
-STATIC\r
 VOID *\r
 UsbHcAllocMemFromBlock (\r
   IN  USBHC_MEM_BLOCK     *Block,\r
@@ -236,15 +225,14 @@ UsbHcAllocMemFromBlock (
 \r
 \r
 /**\r
-  Insert the memory block to the pool's list of the blocks\r
+  Insert the memory block to the pool's list of the blocks.\r
 \r
-  @param  Head           The head of the memory pool's block list\r
-  @param  Block          The memory block to insert\r
+  @param  Head           The head of the memory pool's block list.\r
+  @param  Block          The memory block to insert.\r
 \r
-  @return VOID\r
+  @return None.\r
 \r
 **/\r
-STATIC\r
 VOID\r
 UsbHcInsertMemBlockToPool (\r
   IN USBHC_MEM_BLOCK      *Head,\r
@@ -260,13 +248,12 @@ UsbHcInsertMemBlockToPool (
 /**\r
   Is the memory block empty?\r
 \r
-  @param  Block          The memory block to check\r
+  @param  Block   The memory block to check.\r
 \r
-  @return TRUE  : The memory block is empty\r
-  @return FALSE : The memory block isn't empty\r
+  @retval TRUE    The memory block is empty.\r
+  @retval FALSE   The memory block isn't empty.\r
 \r
 **/\r
-STATIC\r
 BOOLEAN\r
 UsbHcIsMemBlockEmpty (\r
   IN USBHC_MEM_BLOCK     *Block\r
@@ -285,15 +272,14 @@ UsbHcIsMemBlockEmpty (
 \r
 \r
 /**\r
-  Unlink the memory block from the pool's list\r
+  Unlink the memory block from the pool's list.\r
 \r
-  @param  Head           The block list head of the memory's pool\r
+  @param  Head           The block list head of the memory's pool.\r
   @param  BlockToUnlink  The memory block to unlink.\r
 \r
-  @return VOID\r
+  @return None.\r
 \r
 **/\r
-STATIC\r
 VOID\r
 UsbHcUnlinkMemBlock (\r
   IN USBHC_MEM_BLOCK      *Head,\r
@@ -315,16 +301,15 @@ UsbHcUnlinkMemBlock (
 \r
 \r
 /**\r
-  Initialize the memory management pool for the host controller\r
+  Initialize the memory management pool for the host controller.\r
 \r
-  @param  Pool           The USB memory pool to initialize\r
-  @param  PciIo          The PciIo that can be used to access the host controller\r
-  @param  Check4G        Whether the host controller requires allocated memory\r
-                         from one 4G address space.\r
-  @param  Which4G        The 4G memory area each memory allocated should be from\r
+  @param  PciIo                The PciIo that can be used to access the host controller.\r
+  @param  Check4G              Whether the host controller requires allocated memory\r
+                               from one 4G address space.\r
+  @param  Which4G              The 4G memory area each memory allocated should be from.\r
 \r
-  @return EFI_SUCCESS         : The memory pool is initialized\r
-  @return EFI_OUT_OF_RESOURCE : Fail to init the memory pool\r
+  @retval EFI_SUCCESS          The memory pool is initialized.\r
+  @retval EFI_OUT_OF_RESOURCE  Fail to init the memory pool.\r
 \r
 **/\r
 USBHC_MEM_POOL *\r
@@ -357,12 +342,12 @@ UsbHcInitMemPool (
 \r
 \r
 /**\r
-  Release the memory management pool\r
+  Release the memory management pool.\r
 \r
-  @param  Pool           The USB memory pool to free\r
+  @param  Pool              The USB memory pool to free.\r
 \r
-  @return EFI_SUCCESS      : The memory pool is freed\r
-  @return EFI_DEVICE_ERROR : Failed to free the memory pool\r
+  @retval EFI_SUCCESS       The memory pool is freed.\r
+  @retval EFI_DEVICE_ERROR  Failed to free the memory pool.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -394,10 +379,10 @@ UsbHcFreeMemPool (
   Allocate some memory from the host controller's memory pool\r
   which can be used to communicate with host controller.\r
 \r
-  @param  Pool           The host controller's memory pool\r
-  @param  Size           Size of the memory to allocate\r
+  @param  Pool           The host controller's memory pool.\r
+  @param  Size           Size of the memory to allocate.\r
 \r
-  @return The allocated memory or NULL\r
+  @return The allocated memory or NULL.\r
 \r
 **/\r
 VOID *\r
@@ -468,13 +453,13 @@ UsbHcAllocateMem (
 \r
 \r
 /**\r
-  Free the allocated memory back to the memory pool\r
+  Free the allocated memory back to the memory pool.\r
 \r
-  @param  Pool           The memory pool of the host controller\r
-  @param  Mem            The memory to free\r
-  @param  Size           The size of the memory to free\r
+  @param  Pool           The memory pool of the host controller.\r
+  @param  Mem            The memory to free.\r
+  @param  Size           The size of the memory to free.\r
 \r
-  @return VOID\r
+  @return None.\r
 \r
 **/\r
 VOID\r
index 09fd1625297dad36e883358d9ee6e5a3f0d11076..7fda8a528c51559b35ce6fe287408872aab4bac2 100644 (file)
@@ -1,5 +1,7 @@
 /** @file\r
 \r
+  This file contains the definination for host controller memory management routines.\r
+\r
 Copyright (c) 2007, 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
@@ -9,16 +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
-  EhciMem.h\r
-\r
-Abstract:\r
-\r
-  This file contains the definination for host controller memory management routines\r
-\r
-Revision History\r
-\r
 **/\r
 \r
 #ifndef _EFI_EHCI_MEM_H_\r
@@ -59,12 +51,12 @@ typedef struct _USBHC_MEM_POOL {
   USBHC_MEM_BLOCK         *Head;\r
 } USBHC_MEM_POOL;\r
 \r
-enum {\r
+typedef enum {\r
   USBHC_MEM_UNIT           = 64,     // Memory allocation unit, must be 2^n, n>4\r
 \r
   USBHC_MEM_UNIT_MASK      = USBHC_MEM_UNIT - 1,\r
   USBHC_MEM_DEFAULT_PAGES  = 16\r
-};\r
+} USBHC_MEM_UNIT_DATA;\r
 \r
 #define USBHC_MEM_ROUND(Len)  (((Len) + USBHC_MEM_UNIT_MASK) & (~USBHC_MEM_UNIT_MASK))\r
 \r
@@ -82,43 +74,34 @@ enum {
 \r
 \r
 \r
+/**\r
+  Initialize the memory management pool for the host controller.\r
+\r
+  @param  PciIo               The PciIo that can be used to access the host controller.\r
+  @param  Check4G             Whether the host controller requires allocated memory\r
+                              from one 4G address space.\r
+  @param  Which4G             The 4G memory area each memory allocated should be from.\r
+\r
+  @retval EFI_SUCCESS         The memory pool is initialized.\r
+  @retval EFI_OUT_OF_RESOURCE Fail to init the memory pool.\r
+\r
+**/\r
 USBHC_MEM_POOL *\r
 UsbHcInitMemPool (\r
   IN EFI_PCI_IO_PROTOCOL  *PciIo,\r
   IN BOOLEAN              Check4G,\r
   IN UINT32               Which4G\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Initialize the memory management pool for the host controller\r
-\r
-Arguments:\r
-\r
-  Pool    - The USB memory pool to initialize\r
-  PciIo   - The PciIo that can be used to access the host controller\r
-  Check4G - Whether the host controller requires allocated memory\r
-            from one 4G address space.\r
-  Which4G - The 4G memory area each memory allocated should be from\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS         : The memory pool is initialized\r
-  EFI_OUT_OF_RESOURCE : Fail to init the memory pool\r
-\r
---*/\r
 ;\r
 \r
 \r
-\r
 /**\r
-  Release the memory management pool\r
+  Release the memory management pool.\r
 \r
-  @param  Pool  The USB memory pool to free\r
+  @param   Pool               The USB memory pool to free.\r
 \r
-  @return EFI_SUCCESS      : The memory pool is freed\r
-  @return EFI_DEVICE_ERROR : Failed to free the memory pool\r
+  @retval EFI_SUCCESS       The memory pool is freed.\r
+  @retval EFI_DEVICE_ERROR  Failed to free the memory pool.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -128,15 +111,14 @@ UsbHcFreeMemPool (
 ;\r
 \r
 \r
-\r
 /**\r
   Allocate some memory from the host controller's memory pool\r
   which can be used to communicate with host controller.\r
 \r
-  @param  Pool  The host controller's memory pool\r
-  @param  Size  Size of the memory to allocate\r
+  @param  Pool  The host controller's memory pool.\r
+  @param  Size  Size of the memory to allocate.\r
 \r
-  @return The allocated memory or NULL\r
+  @return The allocated memory or NULL.\r
 \r
 **/\r
 VOID *\r
@@ -147,15 +129,14 @@ UsbHcAllocateMem (
 ;\r
 \r
 \r
-\r
 /**\r
-  Free the allocated memory back to the memory pool\r
+  Free the allocated memory back to the memory pool.\r
 \r
-  @param  Pool  The memory pool of the host controller\r
-  @param  Mem   The memory to free\r
-  @param  Size  The size of the memory to free\r
+  @param  Pool  The memory pool of the host controller.\r
+  @param  Mem   The memory to free.\r
+  @param  Size  The size of the memory to free.\r
 \r
-  @return VOID\r
+  @return None.\r
 \r
 **/\r
 VOID\r