modify coding style to pass ecc tool and provide comments that complied with Doxgen.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5427 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
eric_tian
2008-07-08 10:26:16 +00:00
parent 38bbd3d91c
commit 78c2ffb5a7
13 changed files with 632 additions and 812 deletions

View File

@@ -1,5 +1,7 @@
/** @file
The EHCI register operation routines.
Copyright (c) 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -9,17 +11,6 @@ http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EhciReg.c
Abstract:
The EHCI register operation routines.
Revision History
**/
@@ -27,12 +18,13 @@ Revision History
/**
Read EHCI capability register
Read EHCI capability register.
@param Ehc The Ehc device
@param Offset Capability register address
@param Ehc The EHCI device.
@param Offset Capability register address.
@return The register content read
@return The register content read.
@retval If err, return 0xffff.
**/
UINT32
@@ -63,12 +55,13 @@ EhcReadCapRegister (
/**
Read Ehc Operation register
Read EHCI Operation register.
@param Ehc The EHCI device
@param Offset The operation register offset
@param Ehc The EHCI device.
@param Offset The operation register offset.
@return The register content read
@return The register content read.
@retval If err, return 0xffff.
**/
UINT32
@@ -101,13 +94,13 @@ EhcReadOpReg (
/**
Write the data to the EHCI operation register
Write the data to the EHCI operation register.
@param Ehc The EHCI device
@param Offset EHCI operation register offset
@param Data The data to write
@param Ehc The EHCI device.
@param Offset EHCI operation register offset.
@param Data The data to write.
@return None
@return None.
**/
VOID
@@ -137,16 +130,15 @@ EhcWriteOpReg (
/**
Set one bit of the operational register while keeping other bits
Set one bit of the operational register while keeping other bits.
@param Ehc The EHCI device
@param Offset The offset of the operational register
@param Bit The bit mask of the register to set
@param Ehc The EHCI device.
@param Offset The offset of the operational register.
@param Bit The bit mask of the register to set.
@return None
@return None.
**/
STATIC
VOID
EhcSetOpRegBit (
IN USB2_HC_DEV *Ehc,
@@ -163,16 +155,15 @@ EhcSetOpRegBit (
/**
Clear one bit of the operational register while keeping other bits
Clear one bit of the operational register while keeping other bits.
@param Ehc The EHCI device
@param Offset The offset of the operational register
@param Bit The bit mask of the register to clear
@param Ehc The EHCI device.
@param Offset The offset of the operational register.
@param Bit The bit mask of the register to clear.
@return None
@return None.
**/
STATIC
VOID
EhcClearOpRegBit (
IN USB2_HC_DEV *Ehc,
@@ -190,19 +181,18 @@ EhcClearOpRegBit (
/**
Wait the operation register's bit as specified by Bit
to become set (or clear)
to become set (or clear).
@param Ehc The EHCI device
@param Offset The offset of the operation register
@param Bit The bit of the register to wait for
@param WaitToSet Wait the bit to set or clear
@param Timeout The time to wait before abort (in millisecond)
@param Ehc The EHCI device.
@param Offset The offset of the operation register.
@param Bit The bit of the register to wait for.
@param WaitToSet Wait the bit to set or clear.
@param Timeout The time to wait before abort (in millisecond).
@retval EFI_SUCCESS The bit successfully changed by host controller
@retval EFI_TIMEOUT The time out occurred
@retval EFI_SUCCESS The bit successfully changed by host controller.
@retval EFI_TIMEOUT The time out occurred.
**/
STATIC
EFI_STATUS
EhcWaitOpRegBit (
IN USB2_HC_DEV *Ehc,
@@ -228,11 +218,11 @@ EhcWaitOpRegBit (
/**
Add support for UEFI Over Legacy (UoL) feature, stop
the legacy USB SMI support
the legacy USB SMI support.
@param Ehc The EHCI device.
@return None
@return None.
**/
VOID
@@ -258,7 +248,7 @@ EhcClearLegacySupport (
PciIo->Pci.Write (PciIo, EfiPciIoWidthUint32, ExtendCap, 1, &Value);
TimeOut = 40;
while (TimeOut--) {
while (TimeOut-- != 0) {
gBS->Stall (500);
PciIo->Pci.Read (PciIo, EfiPciIoWidthUint32, ExtendCap, 1, &Value);
@@ -278,11 +268,11 @@ EhcClearLegacySupport (
Set door bell and wait it to be ACKed by host controller.
This function is used to synchronize with the hardware.
@param Ehc The EHCI device
@param Timeout The time to wait before abort (in millisecond, ms)
@param Ehc The EHCI device.
@param Timeout The time to wait before abort (in millisecond, ms).
@return EFI_SUCCESS : Synchronized with the hardware
@return EFI_TIMEOUT : Time out happened while waiting door bell to set
@retval EFI_SUCCESS Synchronized with the hardware.
@retval EFI_TIMEOUT Time out happened while waiting door bell to set.
**/
EFI_STATUS
@@ -314,11 +304,11 @@ EhcSetAndWaitDoorBell (
/**
Clear all the interrutp status bits, these bits
are Write-Clean
are Write-Clean.
@param Ehc The EHCI device
@param Ehc The EHCI device.
@return None
@return None.
**/
VOID
@@ -334,14 +324,13 @@ EhcAckAllInterrupt (
Enable the periodic schedule then wait EHC to
actually enable it.
@param Ehc The EHCI device
@param Timeout The time to wait before abort (in millisecond, ms)
@param Ehc The EHCI device.
@param Timeout The time to wait before abort (in millisecond, ms).
@return EFI_SUCCESS : The periodical schedule is enabled
@return EFI_TIMEOUT : Time out happened while enabling periodic schedule
@retval EFI_SUCCESS The periodical schedule is enabled.
@retval EFI_TIMEOUT Time out happened while enabling periodic schedule.
**/
STATIC
EFI_STATUS
EhcEnablePeriodSchd (
IN USB2_HC_DEV *Ehc,
@@ -357,15 +346,14 @@ EhcEnablePeriodSchd (
}
/**
Disable periodic schedule
Disable periodic schedule.
@param Ehc The EHCI device
@param Timeout Time to wait before abort (in millisecond, ms)
@param Ehc The EHCI device.
@param Timeout Time to wait before abort (in millisecond, ms).
@return EFI_SUCCESS : Periodic schedule is disabled.
@return EFI_DEVICE_ERROR : Fail to disable periodic schedule
@retval EFI_SUCCESS Periodic schedule is disabled.
@retval EFI_DEVICE_ERROR Fail to disable periodic schedule.
**/
EFI_STATUS
@@ -385,16 +373,15 @@ EhcDisablePeriodSchd (
/**
Enable asynchrounous schedule
Enable asynchrounous schedule.
@param Ehc The EHCI device
@param Timeout Time to wait before abort
@param Ehc The EHCI device.
@param Timeout Time to wait before abort.
@return EFI_SUCCESS : The EHCI asynchronous schedule is enabled
@return Others : Failed to enable the asynchronous scheudle
@retval EFI_SUCCESS The EHCI asynchronous schedule is enabled.
@return Others Failed to enable the asynchronous scheudle.
**/
STATIC
EFI_STATUS
EhcEnableAsyncSchd (
IN USB2_HC_DEV *Ehc,
@@ -412,13 +399,13 @@ EhcEnableAsyncSchd (
/**
Disable asynchrounous schedule
Disable asynchrounous schedule.
@param Ehc The EHCI device
@param Timeout Time to wait before abort (in millisecond, ms)
@param Ehc The EHCI device.
@param Timeout Time to wait before abort (in millisecond, ms).
@return EFI_SUCCESS : The asynchronous schedule is disabled
@return Others : Failed to disable the asynchronous schedule
@retval EFI_SUCCESS The asynchronous schedule is disabled.
@return Others Failed to disable the asynchronous schedule.
**/
EFI_STATUS
@@ -438,12 +425,12 @@ EhcDisableAsyncSchd (
/**
Whether Ehc is halted
Whether Ehc is halted.
@param Ehc The EHCI device
@param Ehc The EHCI device.
@return TRUE : The controller is halted
@return FALSE : It isn't halted
@retval TRUE The controller is halted.
@retval FALSE It isn't halted.
**/
BOOLEAN
@@ -456,12 +443,12 @@ EhcIsHalt (
/**
Whether system error occurred
Whether system error occurred.
@param Ehc The EHCI device
@param Ehc The EHCI device.
@return TRUE : System error happened
@return FALSE : No system error
@return TRUE System error happened.
@return FALSE No system error.
**/
BOOLEAN
@@ -474,13 +461,13 @@ EhcIsSysError (
/**
Reset the host controller
Reset the host controller.
@param Ehc The EHCI device
@param Timeout Time to wait before abort (in millisecond, ms)
@param Ehc The EHCI device.
@param Timeout Time to wait before abort (in millisecond, ms).
@return EFI_SUCCESS : The host controller is reset
@return Others : Failed to reset the host
@retval EFI_SUCCESS The host controller is reset.
@return Others Failed to reset the host.
**/
EFI_STATUS
@@ -509,13 +496,13 @@ EhcResetHC (
/**
Halt the host controller
Halt the host controller.
@param Ehc The EHCI device
@param Timeout Time to wait before abort
@param Ehc The EHCI device.
@param Timeout Time to wait before abort.
@return EFI_SUCCESS : The EHCI is halt
@return EFI_TIMEOUT : Failed to halt the controller before Timeout
@retval EFI_SUCCESS The EHCI is halt.
@retval EFI_TIMEOUT Failed to halt the controller before Timeout.
**/
EFI_STATUS
@@ -533,13 +520,13 @@ EhcHaltHC (
/**
Set the EHCI to run
Set the EHCI to run.
@param Ehc The EHCI device
@param Timeout Time to wait before abort
@param Ehc The EHCI device.
@param Timeout Time to wait before abort.
@return EFI_SUCCESS : The EHCI is running
@return Others : Failed to set the EHCI to run
@retval EFI_SUCCESS The EHCI is running.
@return Others Failed to set the EHCI to run.
**/
EFI_STATUS
@@ -558,17 +545,17 @@ EhcRunHC (
/**
Initialize the HC hardware.
EHCI spec lists the five things to do to initialize the hardware
EHCI spec lists the five things to do to initialize the hardware:
1. Program CTRLDSSEGMENT
2. Set USBINTR to enable interrupts
3. Set periodic list base
4. Set USBCMD, interrupt threshold, frame list size etc
5. Write 1 to CONFIGFLAG to route all ports to EHCI
@param Ehc The EHCI device
@param Ehc The EHCI device.
@return EFI_SUCCESS : The EHCI has come out of halt state
@return EFI_TIMEOUT : Time out happened
@return EFI_SUCCESS The EHCI has come out of halt state.
@return EFI_TIMEOUT Time out happened.
**/
EFI_STATUS