code clean up for Security.h.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / SmmUsbDispatch.h
CommitLineData
79964ac8 1/** @file\r
8411f1c0 2 Provides the parent dispatch service for the USB SMI source generator.\r
79964ac8 3\r
4 Copyright (c) 2007, Intel Corporation\r
5 All rights reserved. This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13 Module Name: SmmUsbDispatch.h\r
14\r
15 @par Revision Reference:\r
16 This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
17 Version 0.9.\r
18**/\r
19\r
20#ifndef _EFI_SMM_USB_DISPATCH_H_\r
21#define _EFI_SMM_USB_DISPATCH_H_\r
22\r
b80fbe85 23#include <PiDxe.h>\r
24\r
79964ac8 25//\r
26// Global ID for the USB Protocol\r
27//\r
28#define EFI_SMM_USB_DISPATCH_PROTOCOL_GUID \\r
29 { \\r
30 0xa05b6ffd, 0x87af, 0x4e42, {0x95, 0xc9, 0x62, 0x28, 0xb6, 0x3c, 0xf3, 0xf3 } \\r
31 }\r
32\r
33typedef struct _EFI_SMM_USB_DISPATCH_PROTOCOL EFI_SMM_USB_DISPATCH_PROTOCOL;\r
34\r
35//\r
36// Related Definitions\r
37//\r
38typedef enum {\r
39 UsbLegacy,\r
40 UsbWake\r
41} EFI_USB_SMI_TYPE;\r
42\r
43typedef struct {\r
534b8251 44 ///\r
45 /// Describes whether this child handler will be invoked in response to a USB legacy\r
46 /// emulation event, such as port-trap on the PS/2* keyboard control registers, or to a\r
47 /// USB wake event, such as resumption from a sleep state. \r
48 ///\r
79964ac8 49 EFI_USB_SMI_TYPE Type;\r
534b8251 50 ///\r
51 /// The device path is part of the context structure and describes the location of the\r
52 /// particular USB host controller in the system for which this register event will occur.\r
53 /// This location is important because of the possible integration of several USB host\r
54 /// controllers in a system. \r
55 ///\r
79964ac8 56 EFI_DEVICE_PATH_PROTOCOL *Device;\r
57} EFI_SMM_USB_DISPATCH_CONTEXT;\r
58\r
59//\r
60// Member functions\r
61//\r
62/**\r
63 Dispatch function for a USB SMI handler.\r
64\r
65 @param DispatchHandle Handle of this dispatch function.\r
66 @param DispatchContext Pointer to the dispatch function's context.\r
67 The DispatchContext fields are filled in\r
68 by the dispatching driver prior to\r
69 invoking this dispatch function.\r
70\r
700a7869 71 @return None\r
79964ac8 72\r
73**/\r
74typedef\r
75VOID\r
69686d56 76(EFIAPI *EFI_SMM_USB_DISPATCH)(\r
79964ac8 77 IN EFI_HANDLE DispatchHandle,\r
78 IN EFI_SMM_USB_DISPATCH_CONTEXT *DispatchContext\r
79 );\r
80\r
81/**\r
82 Register a child SMI source dispatch function with a parent SMM driver\r
83\r
700a7869 84 @param This Pointer to the EFI_SMM_USB_DISPATCH_PROTOCOL instance.\r
85 @param DispatchFunction Pointer to dispatch function to be invoked \r
86 for this SMI source.\r
79964ac8 87 @param DispatchContext Pointer to the dispatch function's context.\r
88 The caller fills this context in before calling\r
89 the register function to indicate to the register\r
90 function the USB SMI types for which the dispatch\r
91 function should be invoked.\r
700a7869 92 @param DispatchHandle Handle generated by the dispatcher to track the \r
93 function instance.\r
79964ac8 94\r
95 @retval EFI_SUCCESS The dispatch function has been successfully\r
96 registered and the SMI source has been enabled.\r
97 @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.\r
98 @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this\r
99 child.\r
100 @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The USB SMI type\r
101 is not within valid range.\r
102\r
103**/\r
104typedef\r
105EFI_STATUS\r
69686d56 106(EFIAPI *EFI_SMM_USB_REGISTER)(\r
79964ac8 107 IN EFI_SMM_USB_DISPATCH_PROTOCOL *This,\r
108 IN EFI_SMM_USB_DISPATCH DispatchFunction,\r
109 IN EFI_SMM_USB_DISPATCH_CONTEXT *DispatchContext,\r
110 OUT EFI_HANDLE *DispatchHandle\r
111 );\r
112\r
113/**\r
700a7869 114 Unregisters a USB service\r
79964ac8 115\r
700a7869 116 @param This Pointer to the EFI_SMM_USB_DISPATCH_PROTOCOL instance.\r
117 @param DispatchHandle Handle of the service to remove.\r
79964ac8 118\r
119 @retval EFI_SUCCESS The dispatch function has been successfully\r
120 unregistered and the SMI source has been disabled\r
121 if there are no other registered child dispatch\r
122 functions for this SMI source.\r
123 @retval EFI_INVALID_PARAMETER Handle is invalid.\r
124\r
125**/\r
126typedef\r
127EFI_STATUS\r
69686d56 128(EFIAPI *EFI_SMM_USB_UNREGISTER)(\r
79964ac8 129 IN EFI_SMM_USB_DISPATCH_PROTOCOL *This,\r
130 IN EFI_HANDLE DispatchHandle\r
131 );\r
132\r
133//\r
134// Interface structure for the SMM USB SMI Dispatch Protocol\r
135//\r
136/**\r
137 @par Protocol Description:\r
138 Provides the parent dispatch service for the USB SMI source generator.\r
139\r
140 @param Register\r
141 Installs a child service to be dispatched by this protocol.\r
142\r
143 @param UnRegister\r
144 Removes a child service dispatched by this protocol.\r
145\r
146**/\r
147struct _EFI_SMM_USB_DISPATCH_PROTOCOL {\r
148 EFI_SMM_USB_REGISTER Register;\r
149 EFI_SMM_USB_UNREGISTER UnRegister;\r
150};\r
151\r
152extern EFI_GUID gEfiSmmUsbDispatchProtocolGuid;\r
153\r
154#endif\r