]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add into MdePkg definitions for the SMM USB Dispatch2 Protocol as defined in PI 1...
authorrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 3 Sep 2009 07:34:19 +0000 (07:34 +0000)
committerrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 3 Sep 2009 07:34:19 +0000 (07:34 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9230 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Include/Protocol/SmmUsbDispatch2.h [new file with mode: 0644]
MdePkg/MdePkg.dec

diff --git a/MdePkg/Include/Protocol/SmmUsbDispatch2.h b/MdePkg/Include/Protocol/SmmUsbDispatch2.h
new file mode 100644 (file)
index 0000000..a95f8f6
--- /dev/null
@@ -0,0 +1,130 @@
+/** @file\r
+  SMM USB Dispatch2 Protocol as defined in PI 1.1 Specification\r
+  Volume 4 System Management Mode Core Interface.\r
+\r
+  Provides the parent dispatch service for the USB SMI source generator.\r
+\r
+  Copyright (c) 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
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  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
+  @par Revision Reference:\r
+  This protocol is from PI Version 1.1.\r
+\r
+**/\r
+\r
+#ifndef _SMM_USB_DISPATCH2_H_\r
+#define _SMM_USB_DISPATCH2_H_\r
+\r
+#include <Pi/PiSmmCis.h>\r
+\r
+#define EFI_SMM_USB_DISPATCH2_PROTOCOL_GUID \\r
+  { \\r
+    0xee9b8d90, 0xc5a6, 0x40a2, {0xbd, 0xe2, 0x52, 0x55, 0x8d, 0x33, 0xcc, 0xa1 } \\r
+  }\r
+\r
+///\r
+/// USB SMI event types\r
+///\r
+typedef enum {\r
+  UsbLegacy,\r
+  UsbWake\r
+} EFI_USB_SMI_TYPE;\r
+\r
+///\r
+/// The dispatch function's context.\r
+///\r
+typedef struct {\r
+  ///\r
+  /// Describes whether this child handler will be invoked in response to a USB legacy \r
+  /// emulation event, such as port-trap on the PS/2* keyboard control registers, or to a \r
+  /// USB wake event, such as resumption from a sleep state.\r
+  ///\r
+  EFI_USB_SMI_TYPE          Type;\r
+  ///\r
+  /// The device path is part of the context structure and describes the location of the \r
+  /// particular USB host controller in the system for which this register event will occur.\r
+  /// This location is important because of the possible integration of several USB host \r
+  /// controllers in a system.\r
+  ///\r
+  EFI_DEVICE_PATH_PROTOCOL  *Device;\r
+} EFI_SMM_USB_REGISTER_CONTEXT;\r
+\r
+typedef struct _EFI_SMM_USB_DISPATCH2_PROTOCOL EFI_SMM_USB_DISPATCH2_PROTOCOL;\r
+\r
+/**\r
+  Provides the parent dispatch service for the USB SMI source generator.\r
+\r
+  This service registers a function (DispatchFunction) which will be called when the USB-\r
+  related SMI specified by RegisterContext has occurred. On return, DispatchHandle \r
+  contains a unique handle which may be used later to unregister the function using UnRegister().\r
+  The DispatchFunction will be called with Context set to the same value as was passed into \r
+  this function in RegisterContext and with CommBuffer containing NULL and \r
+  CommBufferSize containing zero.\r
+\r
+  @param[in]  This               Pointer to the EFI_SMM_USB_DISPATCH2_PROTOCOL instance.\r
+  @param[in]  DispatchFunction   Function to register for handler when a USB-related SMI occurs. \r
+  @param[in]  RegisterContext    Pointer to the dispatch function's context.\r
+                                 The caller fills this context in before calling\r
+                                 the register function to indicate to the register\r
+                                 function the USB SMI types for which the dispatch\r
+                                 function should be invoked.\r
+  @param[out] DispatchHandle     Handle generated by the dispatcher to track the function instance.\r
+\r
+  @retval EFI_SUCCESS            The dispatch function has been successfully\r
+                                 registered and the SMI source has been enabled.\r
+  @retval EFI_DEVICE_ERROR       The driver was unable to enable the SMI source.\r
+  @retval EFI_INVALID_PARAMETER  RegisterContext is invalid. The USB SMI type\r
+                                 is not within valid range.\r
+  @retval EFI_OUT_OF_RESOURCES   There is not enough memory (system or SMM) to manage this child.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_USB_REGISTER)(\r
+  IN  CONST EFI_SMM_USB_DISPATCH2_PROTOCOL  *This,\r
+  IN        EFI_SMM_HANDLER_ENTRY_POINT2    DispatchFunction,\r
+  IN  CONST EFI_SMM_USB_REGISTER_CONTEXT    *RegisterContext,\r
+  OUT       EFI_HANDLE                      *DispatchHandle\r
+  );\r
+\r
+/**\r
+  Unregisters a USB service.\r
+\r
+  This service removes the handler associated with DispatchHandle so that it will no longer be \r
+  called when the USB event occurs.\r
+\r
+  @param[in]  This               Pointer to the EFI_SMM_USB_DISPATCH2_PROTOCOL instance.\r
+  @param[in]  DispatchHandle     Handle of the service to remove. \r
+\r
+  @retval EFI_SUCCESS            The dispatch function has been successfully\r
+                                 unregistered and the SMI source has been disabled\r
+                                 if there are no other registered child dispatch\r
+                                 functions for this SMI source.\r
+  @retval EFI_INVALID_PARAMETER  The DispatchHandle was not valid.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_USB_UNREGISTER)(\r
+  IN CONST EFI_SMM_USB_DISPATCH2_PROTOCOL  *This,\r
+  IN       EFI_HANDLE                      DispatchHandle\r
+  );\r
+\r
+///\r
+/// Interface structure for the SMM USB SMI Dispatch2 Protocol\r
+///\r
+/// This protocol provides the parent dispatch service for the USB SMI source generator.\r
+///\r
+struct _EFI_SMM_USB_DISPATCH2_PROTOCOL {\r
+  EFI_SMM_USB_REGISTER    Register;\r
+  EFI_SMM_USB_UNREGISTER  UnRegister;\r
+};\r
+\r
+extern EFI_GUID gEfiSmmUsbDispatch2ProtocolGuid;\r
+\r
+#endif\r
+\r
index e60efb92b769bbe9f8f24ced9906cfa60ba66919..a36e9766d3574f225339181291527e8f711ff786 100644 (file)
   ## Include/Protocol/SmmPeriodicTimerDispatch2.h\r
   gEfiSmmPeriodicTimerDispatch2ProtocolGuid = { 0x4cec368e, 0x8e8e, 0x4d71, {0x8b, 0xe1, 0x95, 0x8c, 0x45, 0xfc, 0x8a, 0x53 }}\r
 \r
+  ## Include/Protocol/SmmUsbDispatch2.h\r
+  gEfiSmmUsbDispatch2ProtocolGuid = { 0xee9b8d90, 0xc5a6, 0x40a2, {0xbd, 0xe2, 0x52, 0x55, 0x8d, 0x33, 0xcc, 0xa1 }}\r
+\r
   #\r
   # Protocols defined in UEFI2.1/UEFI2.0/EFI1.1\r
   #\r