]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
modify coding style to pass ecc tool and provide comments that complied with Doxgen.
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / EhciDxe / EhciSched.c
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