]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Protocol/SmmUsbDispatch.h
IntelFrameworkPkg: Clean up source files
[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
1c2f052d
LG
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
f22f941e 7The full text of the license may be found at\r
1c2f052d
LG
8http://opensource.org/licenses/bsd-license.php.\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
f22f941e 11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
79964ac8 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
a2bb197e 22//\r
23// Share some common definitions with PI SMM\r
24//\r
25#include <Protocol/SmmUsbDispatch2.h>\r
b80fbe85 26\r
79964ac8 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
79964ac8 37typedef struct {\r
534b8251 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
1c2f052d 41 /// USB wake event, such as resumption from a sleep state.\r
534b8251 42 ///\r
79964ac8 43 EFI_USB_SMI_TYPE Type;\r
534b8251 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
1c2f052d 48 /// controllers in a system.\r
534b8251 49 ///\r
79964ac8 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
99caac3b 59 @param[in] DispatchHandle Handle of this dispatch function.\r
60 @param[in] DispatchContext Pointer to the dispatch function's context.\r
79964ac8 61 The DispatchContext fields are filled in\r
62 by the dispatching driver prior to\r
63 invoking this dispatch function.\r
64\r
79964ac8 65**/\r
66typedef\r
67VOID\r
69686d56 68(EFIAPI *EFI_SMM_USB_DISPATCH)(\r
79964ac8 69 IN EFI_HANDLE DispatchHandle,\r
70 IN EFI_SMM_USB_DISPATCH_CONTEXT *DispatchContext\r
71 );\r
72\r
73/**\r
d97286f4 74 Register a child SMI source dispatch function with a parent SMM driver.\r
79964ac8 75\r
f22f941e 76 @param[in] This The pointer to the EFI_SMM_USB_DISPATCH_PROTOCOL instance.\r
1c2f052d 77 @param[in] DispatchFunction The pointer to dispatch function to be invoked\r
700a7869 78 for this SMI source.\r
f22f941e 79 @param[in] DispatchContext The pointer to the dispatch function's context.\r
79964ac8 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
1c2f052d 84 @param[out] DispatchHandle The handle generated by the dispatcher to track the\r
700a7869 85 function instance.\r
79964ac8 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
69686d56 98(EFIAPI *EFI_SMM_USB_REGISTER)(\r
c7d5f35f 99 IN EFI_SMM_USB_DISPATCH_PROTOCOL *This,\r
79964ac8 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
d97286f4 106 Unregisters a USB service.\r
79964ac8 107\r
f22f941e 108 @param[in] This The pointer to the EFI_SMM_USB_DISPATCH_PROTOCOL instance.\r
99caac3b 109 @param[in] DispatchHandle Handle of the service to remove.\r
79964ac8 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
d97286f4 115 @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.\r
79964ac8 116\r
117**/\r
118typedef\r
119EFI_STATUS\r
69686d56 120(EFIAPI *EFI_SMM_USB_UNREGISTER)(\r
79964ac8 121 IN EFI_SMM_USB_DISPATCH_PROTOCOL *This,\r
99caac3b 122 IN EFI_HANDLE DispatchHandle\r
79964ac8 123 );\r
124\r
d97286f4 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
79964ac8 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