]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Protocol/SmmUsbDispatch.h
EFI_HII_DATABASE_PROTOCOL.NewPackageList() allows installation of multiple package...
[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
d97286f4 4 Copyright (c) 2007 - 2009, Intel Corporation\r
79964ac8 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
79964ac8 13 @par Revision Reference:\r
14 This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
15 Version 0.9.\r
d97286f4 16\r
79964ac8 17**/\r
18\r
19#ifndef _EFI_SMM_USB_DISPATCH_H_\r
20#define _EFI_SMM_USB_DISPATCH_H_\r
21\r
b80fbe85 22\r
79964ac8 23//\r
24// Global ID for the USB Protocol\r
25//\r
26#define EFI_SMM_USB_DISPATCH_PROTOCOL_GUID \\r
27 { \\r
28 0xa05b6ffd, 0x87af, 0x4e42, {0x95, 0xc9, 0x62, 0x28, 0xb6, 0x3c, 0xf3, 0xf3 } \\r
29 }\r
30\r
31typedef struct _EFI_SMM_USB_DISPATCH_PROTOCOL EFI_SMM_USB_DISPATCH_PROTOCOL;\r
32\r
33//\r
34// Related Definitions\r
35//\r
36typedef enum {\r
37 UsbLegacy,\r
38 UsbWake\r
39} EFI_USB_SMI_TYPE;\r
40\r
41typedef struct {\r
534b8251 42 ///\r
43 /// Describes whether this child handler will be invoked in response to a USB legacy\r
44 /// emulation event, such as port-trap on the PS/2* keyboard control registers, or to a\r
45 /// USB wake event, such as resumption from a sleep state. \r
46 ///\r
79964ac8 47 EFI_USB_SMI_TYPE Type;\r
534b8251 48 ///\r
49 /// The device path is part of the context structure and describes the location of the\r
50 /// particular USB host controller in the system for which this register event will occur.\r
51 /// This location is important because of the possible integration of several USB host\r
52 /// controllers in a system. \r
53 ///\r
79964ac8 54 EFI_DEVICE_PATH_PROTOCOL *Device;\r
55} EFI_SMM_USB_DISPATCH_CONTEXT;\r
56\r
57//\r
58// Member functions\r
59//\r
60/**\r
61 Dispatch function for a USB SMI handler.\r
62\r
99caac3b 63 @param[in] DispatchHandle Handle of this dispatch function.\r
64 @param[in] DispatchContext Pointer to the dispatch function's context.\r
79964ac8 65 The DispatchContext fields are filled in\r
66 by the dispatching driver prior to\r
67 invoking this dispatch function.\r
68\r
79964ac8 69**/\r
70typedef\r
71VOID\r
69686d56 72(EFIAPI *EFI_SMM_USB_DISPATCH)(\r
79964ac8 73 IN EFI_HANDLE DispatchHandle,\r
74 IN EFI_SMM_USB_DISPATCH_CONTEXT *DispatchContext\r
75 );\r
76\r
77/**\r
d97286f4 78 Register a child SMI source dispatch function with a parent SMM driver.\r
79964ac8 79\r
99caac3b 80 @param[in] This Pointer to the EFI_SMM_USB_DISPATCH_PROTOCOL instance.\r
81 @param[in] DispatchFunction Pointer to dispatch function to be invoked \r
700a7869 82 for this SMI source.\r
99caac3b 83 @param[in] DispatchContext Pointer to the dispatch function's context.\r
79964ac8 84 The caller fills this context in before calling\r
85 the register function to indicate to the register\r
86 function the USB SMI types for which the dispatch\r
87 function should be invoked.\r
99caac3b 88 @param[out] DispatchHandle Handle generated by the dispatcher to track the \r
700a7869 89 function instance.\r
79964ac8 90\r
91 @retval EFI_SUCCESS The dispatch function has been successfully\r
92 registered and the SMI source has been enabled.\r
93 @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.\r
94 @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this\r
95 child.\r
96 @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The USB SMI type\r
97 is not within valid range.\r
98\r
99**/\r
100typedef\r
101EFI_STATUS\r
69686d56 102(EFIAPI *EFI_SMM_USB_REGISTER)(\r
c7d5f35f 103 IN EFI_SMM_USB_DISPATCH_PROTOCOL *This,\r
79964ac8 104 IN EFI_SMM_USB_DISPATCH DispatchFunction,\r
105 IN EFI_SMM_USB_DISPATCH_CONTEXT *DispatchContext,\r
106 OUT EFI_HANDLE *DispatchHandle\r
107 );\r
108\r
109/**\r
d97286f4 110 Unregisters a USB service.\r
79964ac8 111\r
99caac3b 112 @param[in] This Pointer to the EFI_SMM_USB_DISPATCH_PROTOCOL instance.\r
113 @param[in] DispatchHandle Handle of the service to remove.\r
79964ac8 114\r
115 @retval EFI_SUCCESS The dispatch function has been successfully\r
116 unregistered and the SMI source has been disabled\r
117 if there are no other registered child dispatch\r
118 functions for this SMI source.\r
d97286f4 119 @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.\r
79964ac8 120\r
121**/\r
122typedef\r
123EFI_STATUS\r
69686d56 124(EFIAPI *EFI_SMM_USB_UNREGISTER)(\r
79964ac8 125 IN EFI_SMM_USB_DISPATCH_PROTOCOL *This,\r
99caac3b 126 IN EFI_HANDLE DispatchHandle\r
79964ac8 127 );\r
128\r
d97286f4 129///\r
130/// The EFI_SMM_USB_DISPATCH_PROTOCOL provides the ability to install child handlers for the\r
131/// given event types.\r
132///\r
79964ac8 133struct _EFI_SMM_USB_DISPATCH_PROTOCOL {\r
134 EFI_SMM_USB_REGISTER Register;\r
135 EFI_SMM_USB_UNREGISTER UnRegister;\r
136};\r
137\r
138extern EFI_GUID gEfiSmmUsbDispatchProtocolGuid;\r
139\r
140#endif\r