1) Fix a typo in EhcMoniteAsyncRequests.

2) Code cleanup.
3) Doxygen comment cleanup.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7428 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qwang12 2009-02-04 06:56:31 +00:00
parent e01fb259f8
commit 597f4ee21c
13 changed files with 25 additions and 104 deletions

View File

@ -2,7 +2,7 @@
The Ehci controller driver. The Ehci controller driver.
Copyright (c) 2006 - 2008, Intel Corporation Copyright (c) 2006 - 2009, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -1436,7 +1436,7 @@ EhcCreateUsb2Hc (
Status = gBS->CreateEvent ( Status = gBS->CreateEvent (
EVT_TIMER | EVT_NOTIFY_SIGNAL, EVT_TIMER | EVT_NOTIFY_SIGNAL,
TPL_CALLBACK, TPL_CALLBACK,
EhcMoniteAsyncRequests, EhcMonitorAsyncRequests,
Ehc, Ehc,
&Ehc->PollTimer &Ehc->PollTimer
); );

View File

@ -2,7 +2,7 @@
Provides some data struct used by EHCI controller driver. Provides some data struct used by EHCI controller driver.
Copyright (c) 2006 - 2007, Intel Corporation Copyright (c) 2006 - 2009, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -67,14 +67,12 @@ typedef enum {
} EHC_TIMEOUT_EXPERIENCE_VALUE; } EHC_TIMEOUT_EXPERIENCE_VALUE;
// //
// EHC raises TPL to TPL_NOTIFY to serialize all its operations // EHC raises TPL to TPL_NOTIFY to serialize all its operations
// to protect shared data structures. // to protect shared data structures.
// //
#define EHC_TPL TPL_NOTIFY #define EHC_TPL TPL_NOTIFY
#define USB2_HC_DEV_SIGNATURE SIGNATURE_32 ('e', 'h', 'c', 'i')
// //
//Iterate through the doule linked list. NOT delete safe //Iterate through the doule linked list. NOT delete safe
// //
@ -99,7 +97,8 @@ typedef enum {
#define EHC_REG_BIT_IS_SET(Ehc, Offset, Bit) \ #define EHC_REG_BIT_IS_SET(Ehc, Offset, Bit) \
(EHC_BIT_IS_SET(EhcReadOpReg ((Ehc), (Offset)), (Bit))) (EHC_BIT_IS_SET(EhcReadOpReg ((Ehc), (Offset)), (Bit)))
#define EHC_FROM_THIS(a) CR(a, USB2_HC_DEV, Usb2Hc, USB2_HC_DEV_SIGNATURE) #define USB2_HC_DEV_SIGNATURE SIGNATURE_32 ('e', 'h', 'c', 'i')
#define EHC_FROM_THIS(a) CR(a, USB2_HC_DEV, Usb2Hc, USB2_HC_DEV_SIGNATURE)
struct _USB2_HC_DEV { struct _USB2_HC_DEV {
UINTN Signature; UINTN Signature;

View File

@ -2,7 +2,7 @@
This file provides the information dump support for EHCI when in debug mode. This file provides the information dump support for EHCI when in debug mode.
Copyright (c) 2007, Intel Corporation Copyright (c) 2007 - 2009, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -21,8 +21,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@param State The state in the QTD/QH. @param State The state in the QTD/QH.
@return None.
**/ **/
VOID VOID
EhcDumpStatus ( EhcDumpStatus (
@ -71,8 +69,6 @@ EhcDumpStatus (
@param Qtd The QTD to dump. @param Qtd The QTD to dump.
@param Msg The message to print before the dump. @param Msg The message to print before the dump.
@return None
**/ **/
VOID VOID
EhcDumpQtd ( EhcDumpQtd (
@ -126,8 +122,6 @@ EhcDumpQtd (
@param Msg The message to print before the dump. @param Msg The message to print before the dump.
@param DumpBuf Whether to dump the memory buffer of the associated QTD. @param DumpBuf Whether to dump the memory buffer of the associated QTD.
@return None
**/ **/
VOID VOID
EhcDumpQh ( EhcDumpQh (
@ -214,8 +208,6 @@ EhcDumpQh (
@param Buf The buffer to dump. @param Buf The buffer to dump.
@param Len The length of buffer. @param Len The length of buffer.
@return None.
**/ **/
VOID VOID
EhcDumpBuf ( EhcDumpBuf (

View File

@ -2,7 +2,7 @@
This file contains the definination for host controller debug support routines. This file contains the definination for host controller debug support routines.
Copyright (c) 2007, Intel Corporation Copyright (c) 2007 - 2009, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -23,8 +23,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@param Qtd The QTD to dump. @param Qtd The QTD to dump.
@param Msg The message to print before the dump. @param Msg The message to print before the dump.
@return None.
**/ **/
VOID VOID
EhcDumpQtd ( EhcDumpQtd (
@ -40,8 +38,6 @@ EhcDumpQtd (
@param Msg The message to print before the dump. @param Msg The message to print before the dump.
@param DumpBuf Whether to dump the memory buffer of the associated QTD. @param DumpBuf Whether to dump the memory buffer of the associated QTD.
@return None.
**/ **/
VOID VOID
EhcDumpQh ( EhcDumpQh (
@ -57,8 +53,6 @@ EhcDumpQh (
@param Buf The buffer to dump. @param Buf The buffer to dump.
@param Len The length of buffer. @param Len The length of buffer.
@return None.
**/ **/
VOID VOID
EhcDumpBuf ( EhcDumpBuf (

View File

@ -6,7 +6,7 @@
# It implements the interfaces of monitoring the status of all ports and transferring # It implements the interfaces of monitoring the status of all ports and transferring
# Control, Bulk, Interrupt and Isochronous requests to Usb2.0 device. # Control, Bulk, Interrupt and Isochronous requests to Usb2.0 device.
# #
# Copyright (c) 2006 - 2008, Intel Corporation. # Copyright (c) 2006 - 2009, Intel Corporation.
# #
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -72,8 +72,8 @@
PcdLib PcdLib
[Protocols] [Protocols]
gEfiPciIoProtocolGuid ## ALWAYS_CONSUMED gEfiPciIoProtocolGuid ## CONSUMES
gEfiUsb2HcProtocolGuid ## ALWAYS_PRODUCED gEfiUsb2HcProtocolGuid ## PRODUCES
# [Event] # [Event]
# ## # ##

View File

@ -2,7 +2,7 @@
The EHCI register operation routines. The EHCI register operation routines.
Copyright (c) 2007, Intel Corporation Copyright (c) 2007 - 2009, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -100,8 +100,6 @@ EhcReadOpReg (
@param Offset EHCI operation register offset. @param Offset EHCI operation register offset.
@param Data The data to write. @param Data The data to write.
@return None.
**/ **/
VOID VOID
EhcWriteOpReg ( EhcWriteOpReg (
@ -136,8 +134,6 @@ EhcWriteOpReg (
@param Offset The offset of the operational register. @param Offset The offset of the operational register.
@param Bit The bit mask of the register to set. @param Bit The bit mask of the register to set.
@return None.
**/ **/
VOID VOID
EhcSetOpRegBit ( EhcSetOpRegBit (
@ -161,8 +157,6 @@ EhcSetOpRegBit (
@param Offset The offset of the operational register. @param Offset The offset of the operational register.
@param Bit The bit mask of the register to clear. @param Bit The bit mask of the register to clear.
@return None.
**/ **/
VOID VOID
EhcClearOpRegBit ( EhcClearOpRegBit (
@ -222,8 +216,6 @@ EhcWaitOpRegBit (
@param Ehc The EHCI device. @param Ehc The EHCI device.
@return None.
**/ **/
VOID VOID
EhcClearLegacySupport ( EhcClearLegacySupport (
@ -308,8 +300,6 @@ EhcSetAndWaitDoorBell (
@param Ehc The EHCI device. @param Ehc The EHCI device.
@return None.
**/ **/
VOID VOID
EhcAckAllInterrupt ( EhcAckAllInterrupt (

View File

@ -2,7 +2,7 @@
This file contains the definination for host controller register operation routines. This file contains the definination for host controller register operation routines.
Copyright (c) 2007, Intel Corporation Copyright (c) 2007 - 2009, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -154,8 +154,6 @@ EhcReadOpReg (
@param Offset EHCI operation register offset. @param Offset EHCI operation register offset.
@param Data The data to write. @param Data The data to write.
@return None.
**/ **/
VOID VOID
EhcWriteOpReg ( EhcWriteOpReg (
@ -171,8 +169,6 @@ EhcWriteOpReg (
@param Ehc The EHCI device. @param Ehc The EHCI device.
@return None.
**/ **/
VOID VOID
EhcClearLegacySupport ( EhcClearLegacySupport (
@ -204,8 +200,6 @@ EhcSetAndWaitDoorBell (
@param Ehc The EHCI device. @param Ehc The EHCI device.
@return None.
**/ **/
VOID VOID
EhcAckAllInterrupt ( EhcAckAllInterrupt (

View File

@ -2,7 +2,7 @@
EHCI transfer scheduling routines. EHCI transfer scheduling routines.
Copyright (c) 2007, Intel Corporation Copyright (c) 2007 - 2009, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -208,8 +208,6 @@ EhcInitSched (
@param Ehc The EHCI device. @param Ehc The EHCI device.
@return None.
**/ **/
VOID VOID
EhcFreeSched ( EhcFreeSched (
@ -268,8 +266,6 @@ EhcFreeSched (
@param Ehc The EHCI device. @param Ehc The EHCI device.
@param Qh The queue head to link. @param Qh The queue head to link.
@return None.
**/ **/
VOID VOID
EhcLinkQhToAsync ( EhcLinkQhToAsync (
@ -301,8 +297,6 @@ EhcLinkQhToAsync (
@param Ehc The EHCI device. @param Ehc The EHCI device.
@param Qh The queue head to unlink. @param Qh The queue head to unlink.
@return None.
**/ **/
VOID VOID
EhcUnlinkQhFromAsync ( EhcUnlinkQhFromAsync (
@ -346,8 +340,6 @@ EhcUnlinkQhFromAsync (
@param Ehc The EHCI device. @param Ehc The EHCI device.
@param Qh The queue head to link. @param Qh The queue head to link.
@return None.
**/ **/
VOID VOID
EhcLinkQhToPeriod ( EhcLinkQhToPeriod (
@ -447,8 +439,6 @@ EhcLinkQhToPeriod (
@param Ehc The EHCI device. @param Ehc The EHCI device.
@param Qh The queue head to unlink. @param Qh The queue head to unlink.
@return None.
**/ **/
VOID VOID
EhcUnlinkQhFromPeriod ( EhcUnlinkQhFromPeriod (
@ -734,8 +724,6 @@ EhciDelAsyncIntTransfer (
@param Ehc The EHCI device. @param Ehc The EHCI device.
@return None.
**/ **/
VOID VOID
EhciDelAllAsyncIntTransfers ( EhciDelAllAsyncIntTransfers (
@ -817,8 +805,6 @@ ON_ERROR:
@param Urb The URB to update. @param Urb The URB to update.
@return None.
**/ **/
VOID VOID
EhcUpdateAsyncRequest ( EhcUpdateAsyncRequest (
@ -895,11 +881,9 @@ EhcUpdateAsyncRequest (
@param Event Interrupt event. @param Event Interrupt event.
@param Context Pointer to USB2_HC_DEV. @param Context Pointer to USB2_HC_DEV.
@return None.
**/ **/
VOID VOID
EhcMoniteAsyncRequests ( EhcMonitorAsyncRequests (
IN EFI_EVENT Event, IN EFI_EVENT Event,
IN VOID *Context IN VOID *Context
) )
@ -935,7 +919,7 @@ EhcMoniteAsyncRequests (
// //
Status = EhcFlushAsyncIntMap (Ehc, Urb); Status = EhcFlushAsyncIntMap (Ehc, Urb);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "EhcMoniteAsyncRequests: Fail to Flush AsyncInt Mapped Memeory\n")); DEBUG ((EFI_D_ERROR, "EhcMonitorAsyncRequests: Fail to Flush AsyncInt Mapped Memeory\n"));
} }
// //

View File

@ -2,7 +2,7 @@
This file contains the definination for host controller schedule routines. This file contains the definination for host controller schedule routines.
Copyright (c) 2007, Intel Corporation Copyright (c) 2007 - 2009, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -37,8 +37,6 @@ EhcInitSched (
@param Ehc The EHCI device. @param Ehc The EHCI device.
@return None
**/ **/
VOID VOID
EhcFreeSched ( EhcFreeSched (
@ -56,8 +54,6 @@ EhcFreeSched (
@param Ehc The EHCI device. @param Ehc The EHCI device.
@param Qh The queue head to link. @param Qh The queue head to link.
@return None.
**/ **/
VOID VOID
EhcLinkQhToAsync ( EhcLinkQhToAsync (
@ -73,8 +69,6 @@ EhcLinkQhToAsync (
@param Ehc The EHCI device. @param Ehc The EHCI device.
@param Qh The queue head to unlink. @param Qh The queue head to unlink.
@return None.
**/ **/
VOID VOID
EhcUnlinkQhFromAsync ( EhcUnlinkQhFromAsync (
@ -91,8 +85,6 @@ EhcUnlinkQhFromAsync (
@param Ehc The EHCI device. @param Ehc The EHCI device.
@param Qh The queue head to link. @param Qh The queue head to link.
@return None.
**/ **/
VOID VOID
EhcLinkQhToPeriod ( EhcLinkQhToPeriod (
@ -108,8 +100,6 @@ EhcLinkQhToPeriod (
@param Ehc The EHCI device. @param Ehc The EHCI device.
@param Qh The queue head to unlink. @param Qh The queue head to unlink.
@return None.
**/ **/
VOID VOID
EhcUnlinkQhFromPeriod ( EhcUnlinkQhFromPeriod (
@ -166,8 +156,6 @@ EhciDelAsyncIntTransfer (
@param Ehc The EHCI device. @param Ehc The EHCI device.
@return None.
**/ **/
VOID VOID
EhciDelAllAsyncIntTransfers ( EhciDelAllAsyncIntTransfers (
@ -181,11 +169,9 @@ EhciDelAllAsyncIntTransfers (
@param Event Interrupt event. @param Event Interrupt event.
@param Context Pointer to USB2_HC_DEV. @param Context Pointer to USB2_HC_DEV.
@return None.
**/ **/
VOID VOID
EhcMoniteAsyncRequests ( EhcMonitorAsyncRequests (
IN EFI_EVENT Event, IN EFI_EVENT Event,
IN VOID *Context IN VOID *Context
); );

View File

@ -3,7 +3,7 @@
This file contains URB request, each request is warpped in a This file contains URB request, each request is warpped in a
URB (Usb Request Block). URB (Usb Request Block).
Copyright (c) 2007, Intel Corporation Copyright (c) 2007 - 2009, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -125,8 +125,6 @@ EhcCreateQtd (
@param Ep The queue head's related endpoint. @param Ep The queue head's related endpoint.
@param QhHw The queue head to initialize. @param QhHw The queue head to initialize.
@return None.
**/ **/
VOID VOID
EhcInitIntQh ( EhcInitIntQh (
@ -293,8 +291,6 @@ EhcConvertPollRate (
@param Ehc The EHCI device. @param Ehc The EHCI device.
@param Qtds The list head of the QTD. @param Qtds The list head of the QTD.
@return None.
**/ **/
VOID VOID
EhcFreeQtds ( EhcFreeQtds (
@ -321,8 +317,6 @@ EhcFreeQtds (
@param Ehc The EHCI device. @param Ehc The EHCI device.
@param Urb The URB to free. @param Urb The URB to free.
@return None.
**/ **/
VOID VOID
EhcFreeUrb ( EhcFreeUrb (

View File

@ -3,7 +3,7 @@
This file contains URB request, each request is warpped in a This file contains URB request, each request is warpped in a
URB (Usb Request Block). URB (Usb Request Block).
Copyright (c) 2007, Intel Corporation Copyright (c) 2007 - 2009, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -287,8 +287,6 @@ EhcCreateQh (
@param Ehc The EHCI device. @param Ehc The EHCI device.
@param Urb The URB to free. @param Urb The URB to free.
@return None.
**/ **/
VOID VOID
EhcFreeUrb ( EhcFreeUrb (

View File

@ -2,7 +2,7 @@
Routine procedures for memory allocate/free. Routine procedures for memory allocate/free.
Copyright (c) 2007, Intel Corporation Copyright (c) 2007 - 2009, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -124,8 +124,6 @@ FREE_BITARRAY:
@param Pool The memory pool to free the block from. @param Pool The memory pool to free the block from.
@param Block The memory block to free. @param Block The memory block to free.
@return None.
**/ **/
VOID VOID
UsbHcFreeMemBlock ( UsbHcFreeMemBlock (
@ -230,8 +228,6 @@ UsbHcAllocMemFromBlock (
@param Head The head of the memory pool's block list. @param Head The head of the memory pool's block list.
@param Block The memory block to insert. @param Block The memory block to insert.
@return None.
**/ **/
VOID VOID
UsbHcInsertMemBlockToPool ( UsbHcInsertMemBlockToPool (
@ -277,8 +273,6 @@ UsbHcIsMemBlockEmpty (
@param Head The block list head of the memory's pool. @param Head The block list head of the memory's pool.
@param BlockToUnlink The memory block to unlink. @param BlockToUnlink The memory block to unlink.
@return None.
**/ **/
VOID VOID
UsbHcUnlinkMemBlock ( UsbHcUnlinkMemBlock (
@ -459,8 +453,6 @@ UsbHcAllocateMem (
@param Mem The memory to free. @param Mem The memory to free.
@param Size The size of the memory to free. @param Size The size of the memory to free.
@return None.
**/ **/
VOID VOID
UsbHcFreeMem ( UsbHcFreeMem (

View File

@ -2,7 +2,7 @@
This file contains the definination for host controller memory management routines. This file contains the definination for host controller memory management routines.
Copyright (c) 2007, Intel Corporation Copyright (c) 2007 - 2009, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -133,8 +133,6 @@ UsbHcAllocateMem (
@param Mem The memory to free. @param Mem The memory to free.
@param Size The size of the memory to free. @param Size The size of the memory to free.
@return None.
**/ **/
VOID VOID
UsbHcFreeMem ( UsbHcFreeMem (