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