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