--- /dev/null
+/** @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