]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/SmmUsbDispatch2.h
Update the copyright notice format
[mirror_edk2.git] / MdePkg / Include / Protocol / SmmUsbDispatch2.h
CommitLineData
1a42a56f 1/** @file\r
2 SMM USB Dispatch2 Protocol as defined in PI 1.1 Specification\r
3 Volume 4 System Management Mode Core Interface.\r
4\r
5 Provides the parent dispatch service for the USB SMI source generator.\r
6\r
9df063a0
HT
7 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
8 This program and the accompanying materials\r
1a42a56f 9 are licensed and made available under the terms and conditions of the BSD License\r
10 which accompanies this distribution. The full text of the license may be found at\r
11 http://opensource.org/licenses/bsd-license.php\r
12\r
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
15\r
16 @par Revision Reference:\r
17 This protocol is from PI Version 1.1.\r
18\r
19**/\r
20\r
21#ifndef _SMM_USB_DISPATCH2_H_\r
22#define _SMM_USB_DISPATCH2_H_\r
23\r
24#include <Pi/PiSmmCis.h>\r
25\r
26#define EFI_SMM_USB_DISPATCH2_PROTOCOL_GUID \\r
27 { \\r
28 0xee9b8d90, 0xc5a6, 0x40a2, {0xbd, 0xe2, 0x52, 0x55, 0x8d, 0x33, 0xcc, 0xa1 } \\r
29 }\r
30\r
31///\r
32/// USB SMI event types\r
33///\r
34typedef enum {\r
35 UsbLegacy,\r
36 UsbWake\r
37} EFI_USB_SMI_TYPE;\r
38\r
39///\r
40/// The dispatch function's context.\r
41///\r
42typedef struct {\r
43 ///\r
44 /// Describes whether this child handler will be invoked in response to a USB legacy \r
45 /// emulation event, such as port-trap on the PS/2* keyboard control registers, or to a \r
46 /// USB wake event, such as resumption from a sleep state.\r
47 ///\r
48 EFI_USB_SMI_TYPE Type;\r
49 ///\r
50 /// The device path is part of the context structure and describes the location of the \r
51 /// particular USB host controller in the system for which this register event will occur.\r
52 /// This location is important because of the possible integration of several USB host \r
53 /// controllers in a system.\r
54 ///\r
55 EFI_DEVICE_PATH_PROTOCOL *Device;\r
56} EFI_SMM_USB_REGISTER_CONTEXT;\r
57\r
58typedef struct _EFI_SMM_USB_DISPATCH2_PROTOCOL EFI_SMM_USB_DISPATCH2_PROTOCOL;\r
59\r
60/**\r
61 Provides the parent dispatch service for the USB SMI source generator.\r
62\r
63 This service registers a function (DispatchFunction) which will be called when the USB-\r
64 related SMI specified by RegisterContext has occurred. On return, DispatchHandle \r
65 contains a unique handle which may be used later to unregister the function using UnRegister().\r
66 The DispatchFunction will be called with Context set to the same value as was passed into \r
67 this function in RegisterContext and with CommBuffer containing NULL and \r
68 CommBufferSize containing zero.\r
69\r
70 @param[in] This Pointer to the EFI_SMM_USB_DISPATCH2_PROTOCOL instance.\r
71 @param[in] DispatchFunction Function to register for handler when a USB-related SMI occurs. \r
72 @param[in] RegisterContext Pointer to the dispatch function's context.\r
73 The caller fills this context in before calling\r
74 the register function to indicate to the register\r
75 function the USB SMI types for which the dispatch\r
76 function should be invoked.\r
77 @param[out] DispatchHandle Handle generated by the dispatcher to track the function instance.\r
78\r
79 @retval EFI_SUCCESS The dispatch function has been successfully\r
80 registered and the SMI source has been enabled.\r
81 @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.\r
82 @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The USB SMI type\r
83 is not within valid range.\r
84 @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or SMM) to manage this child.\r
85**/\r
86typedef\r
87EFI_STATUS\r
a2bb197e 88(EFIAPI *EFI_SMM_USB_REGISTER2)(\r
1a42a56f 89 IN CONST EFI_SMM_USB_DISPATCH2_PROTOCOL *This,\r
90 IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction,\r
91 IN CONST EFI_SMM_USB_REGISTER_CONTEXT *RegisterContext,\r
92 OUT EFI_HANDLE *DispatchHandle\r
93 );\r
94\r
95/**\r
96 Unregisters a USB service.\r
97\r
98 This service removes the handler associated with DispatchHandle so that it will no longer be \r
99 called when the USB event occurs.\r
100\r
101 @param[in] This Pointer to the EFI_SMM_USB_DISPATCH2_PROTOCOL instance.\r
102 @param[in] DispatchHandle Handle of the service to remove. \r
103\r
104 @retval EFI_SUCCESS The dispatch function has been successfully\r
105 unregistered and the SMI source has been disabled\r
106 if there are no other registered child dispatch\r
107 functions for this SMI source.\r
108 @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.\r
109**/\r
110typedef\r
111EFI_STATUS\r
a2bb197e 112(EFIAPI *EFI_SMM_USB_UNREGISTER2)(\r
1a42a56f 113 IN CONST EFI_SMM_USB_DISPATCH2_PROTOCOL *This,\r
114 IN EFI_HANDLE DispatchHandle\r
115 );\r
116\r
117///\r
118/// Interface structure for the SMM USB SMI Dispatch2 Protocol\r
119///\r
120/// This protocol provides the parent dispatch service for the USB SMI source generator.\r
121///\r
122struct _EFI_SMM_USB_DISPATCH2_PROTOCOL {\r
a2bb197e 123 EFI_SMM_USB_REGISTER2 Register;\r
124 EFI_SMM_USB_UNREGISTER2 UnRegister;\r
1a42a56f 125};\r
126\r
127extern EFI_GUID gEfiSmmUsbDispatch2ProtocolGuid;\r
128\r
129#endif\r
130\r