]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/SmmUsbDispatch2.h
Rename PI SMM definitions which has same name with those of Framework SMM spec but...
[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
7 Copyright (c) 2009, Intel Corporation\r
8 All rights reserved. This program and the accompanying materials\r
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
a2bb197e 26///\r
27/// Note:\r
28/// To avoid name conflict between PI and Framework SMM spec, the following names defined\r
29/// in PI 1.2 SMM spec are renamed. These renamings are not yet in a public PI spec and errta.\r
30///\r
31/// EFI_SMM_USB_REGISTER -> EFI_SMM_USB_REGISTER2\r
32/// EFI_SMM_USB_UNREGISTER -> EFI_SMM_USB_UNREGISTER2\r
33///\r
34\r
1a42a56f 35#define EFI_SMM_USB_DISPATCH2_PROTOCOL_GUID \\r
36 { \\r
37 0xee9b8d90, 0xc5a6, 0x40a2, {0xbd, 0xe2, 0x52, 0x55, 0x8d, 0x33, 0xcc, 0xa1 } \\r
38 }\r
39\r
40///\r
41/// USB SMI event types\r
42///\r
43typedef enum {\r
44 UsbLegacy,\r
45 UsbWake\r
46} EFI_USB_SMI_TYPE;\r
47\r
48///\r
49/// The dispatch function's context.\r
50///\r
51typedef struct {\r
52 ///\r
53 /// Describes whether this child handler will be invoked in response to a USB legacy \r
54 /// emulation event, such as port-trap on the PS/2* keyboard control registers, or to a \r
55 /// USB wake event, such as resumption from a sleep state.\r
56 ///\r
57 EFI_USB_SMI_TYPE Type;\r
58 ///\r
59 /// The device path is part of the context structure and describes the location of the \r
60 /// particular USB host controller in the system for which this register event will occur.\r
61 /// This location is important because of the possible integration of several USB host \r
62 /// controllers in a system.\r
63 ///\r
64 EFI_DEVICE_PATH_PROTOCOL *Device;\r
65} EFI_SMM_USB_REGISTER_CONTEXT;\r
66\r
67typedef struct _EFI_SMM_USB_DISPATCH2_PROTOCOL EFI_SMM_USB_DISPATCH2_PROTOCOL;\r
68\r
69/**\r
70 Provides the parent dispatch service for the USB SMI source generator.\r
71\r
72 This service registers a function (DispatchFunction) which will be called when the USB-\r
73 related SMI specified by RegisterContext has occurred. On return, DispatchHandle \r
74 contains a unique handle which may be used later to unregister the function using UnRegister().\r
75 The DispatchFunction will be called with Context set to the same value as was passed into \r
76 this function in RegisterContext and with CommBuffer containing NULL and \r
77 CommBufferSize containing zero.\r
78\r
79 @param[in] This Pointer to the EFI_SMM_USB_DISPATCH2_PROTOCOL instance.\r
80 @param[in] DispatchFunction Function to register for handler when a USB-related SMI occurs. \r
81 @param[in] RegisterContext Pointer to the dispatch function's context.\r
82 The caller fills this context in before calling\r
83 the register function to indicate to the register\r
84 function the USB SMI types for which the dispatch\r
85 function should be invoked.\r
86 @param[out] DispatchHandle Handle generated by the dispatcher to track the function instance.\r
87\r
88 @retval EFI_SUCCESS The dispatch function has been successfully\r
89 registered and the SMI source has been enabled.\r
90 @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.\r
91 @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The USB SMI type\r
92 is not within valid range.\r
93 @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or SMM) to manage this child.\r
94**/\r
95typedef\r
96EFI_STATUS\r
a2bb197e 97(EFIAPI *EFI_SMM_USB_REGISTER2)(\r
1a42a56f 98 IN CONST EFI_SMM_USB_DISPATCH2_PROTOCOL *This,\r
99 IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction,\r
100 IN CONST EFI_SMM_USB_REGISTER_CONTEXT *RegisterContext,\r
101 OUT EFI_HANDLE *DispatchHandle\r
102 );\r
103\r
104/**\r
105 Unregisters a USB service.\r
106\r
107 This service removes the handler associated with DispatchHandle so that it will no longer be \r
108 called when the USB event occurs.\r
109\r
110 @param[in] This Pointer to the EFI_SMM_USB_DISPATCH2_PROTOCOL instance.\r
111 @param[in] DispatchHandle Handle of the service to remove. \r
112\r
113 @retval EFI_SUCCESS The dispatch function has been successfully\r
114 unregistered and the SMI source has been disabled\r
115 if there are no other registered child dispatch\r
116 functions for this SMI source.\r
117 @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.\r
118**/\r
119typedef\r
120EFI_STATUS\r
a2bb197e 121(EFIAPI *EFI_SMM_USB_UNREGISTER2)(\r
1a42a56f 122 IN CONST EFI_SMM_USB_DISPATCH2_PROTOCOL *This,\r
123 IN EFI_HANDLE DispatchHandle\r
124 );\r
125\r
126///\r
127/// Interface structure for the SMM USB SMI Dispatch2 Protocol\r
128///\r
129/// This protocol provides the parent dispatch service for the USB SMI source generator.\r
130///\r
131struct _EFI_SMM_USB_DISPATCH2_PROTOCOL {\r
a2bb197e 132 EFI_SMM_USB_REGISTER2 Register;\r
133 EFI_SMM_USB_UNREGISTER2 UnRegister;\r
1a42a56f 134};\r
135\r
136extern EFI_GUID gEfiSmmUsbDispatch2ProtocolGuid;\r
137\r
138#endif\r
139\r