]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/UhciDxe/Uhci.h
fixed DMA not be stopped issue when gBS->ExitBootServices called.
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / UhciDxe / Uhci.h
index 92c78333ebff4a3cce50a84155806d55bb404a02..58be29e444a32ab6fc9b76311e6b191d923a6f18 100644 (file)
@@ -2,7 +2,7 @@
 \r
   The definition for UHCI driver model and HC protocol routines.\r
 \r
-Copyright (c) 2004 - 2007, Intel Corporation\r
+Copyright (c) 2004 - 2009, 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
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -17,12 +17,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define _EFI_UHCI_H_\r
 \r
 \r
-#include <PiDxe.h>\r
+#include <Uefi.h>\r
 \r
 #include <Protocol/Usb2HostController.h>\r
 #include <Protocol/UsbHostController.h>\r
 #include <Protocol/PciIo.h>\r
 \r
+#include <Guid/EventGroup.h>\r
+\r
 #include <Library/DebugLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/UefiDriverEntryPoint.h>\r
@@ -41,6 +43,7 @@ typedef struct _USB_HC_DEV  USB_HC_DEV;
 #include "UhciReg.h"\r
 #include "UhciSched.h"\r
 #include "UhciDebug.h"\r
+#include "ComponentName.h"\r
 \r
 typedef enum {\r
   UHC_1_MICROSECOND             = 1,\r
@@ -81,7 +84,7 @@ typedef enum {
 //\r
 #define  UHCI_TPL                     TPL_NOTIFY\r
 \r
-#define  USB_HC_DEV_SIGNATURE         EFI_SIGNATURE_32 ('u', 'h', 'c', 'i')\r
+#define  USB_HC_DEV_SIGNATURE         SIGNATURE_32 ('u', 'h', 'c', 'i')\r
 \r
 #pragma pack(1)\r
 typedef struct {\r
@@ -136,10 +139,79 @@ struct _USB_HC_DEV {
   USBHC_MEM_POOL            *MemPool;\r
   EFI_UNICODE_STRING_TABLE  *CtrlNameTable;\r
   VOID                      *FrameMapping;\r
+\r
+  //\r
+  // ExitBootServicesEvent is used to stop the EHC DMA operation \r
+  // after exit boot service.\r
+  //\r
+  EFI_EVENT                 ExitBootServiceEvent;\r
 };\r
 \r
 extern EFI_DRIVER_BINDING_PROTOCOL   gUhciDriverBinding;\r
 extern EFI_COMPONENT_NAME_PROTOCOL   gUhciComponentName;\r
 extern EFI_COMPONENT_NAME2_PROTOCOL  gUhciComponentName2;\r
 \r
+/**\r
+  Test to see if this driver supports ControllerHandle. Any\r
+  ControllerHandle that has UsbHcProtocol installed will be supported.\r
+\r
+  @param  This                 Protocol instance pointer.\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
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UhciDriverBindingSupported (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL     *This,\r
+  IN EFI_HANDLE                      Controller,\r
+  IN EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath\r
+  );\r
+\r
+/**\r
+  Starting the Usb UHCI Driver.\r
+\r
+  @param  This                 Protocol instance pointer.\r
+  @param  Controller           Handle of device to test.\r
+  @param  RemainingDevicePath  Not used.\r
+\r
+  @retval EFI_SUCCESS          This driver supports this device.\r
+  @retval EFI_UNSUPPORTED      This driver does not support this device.\r
+  @retval EFI_DEVICE_ERROR     This driver cannot be started due to device Error.\r
+                               EFI_OUT_OF_RESOURCES- Failed due to resource shortage.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UhciDriverBindingStart (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL     *This,\r
+  IN EFI_HANDLE                      Controller,\r
+  IN EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath\r
+  );\r
+\r
+/**\r
+  Stop this driver on ControllerHandle. Support stoping any child handles\r
+  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  ChildHandleBuffer    List of handles for the children we need to stop.\r
+\r
+  @return EFI_SUCCESS\r
+  @return others\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UhciDriverBindingStop (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL     *This,\r
+  IN EFI_HANDLE                      Controller,\r
+  IN UINTN                           NumberOfChildren,\r
+  IN EFI_HANDLE                      *ChildHandleBuffer\r
+  );\r
+\r
 #endif\r