]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/MmStandbyButtonDispatch.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Protocol / MmStandbyButtonDispatch.h
1 /** @file
2 MM Standby Button Dispatch Protocol as defined in PI 1.5 Specification
3 Volume 4 Management Mode Core Interface.
4
5 This protocol provides the parent dispatch service for the standby button MMI source generator.
6
7 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
9
10 @par Revision Reference:
11 This protocol is from PI Version 1.5.
12
13 **/
14
15 #ifndef _MM_STANDBY_BUTTON_DISPATCH_H_
16 #define _MM_STANDBY_BUTTON_DISPATCH_H_
17
18 #include <Pi/PiMmCis.h>
19
20 #define EFI_MM_STANDBY_BUTTON_DISPATCH_PROTOCOL_GUID \
21 { \
22 0x7300c4a1, 0x43f2, 0x4017, {0xa5, 0x1b, 0xc8, 0x1a, 0x7f, 0x40, 0x58, 0x5b } \
23 }
24
25 ///
26 /// Standby Button phases
27 ///
28 typedef enum {
29 EfiStandbyButtonEntry,
30 EfiStandbyButtonExit,
31 EfiStandbyButtonMax
32 } EFI_STANDBY_BUTTON_PHASE;
33
34 ///
35 /// The dispatch function's context.
36 ///
37 typedef struct {
38 ///
39 /// Describes whether the child handler should be invoked upon the entry to the button
40 /// activation or upon exit.
41 ///
42 EFI_STANDBY_BUTTON_PHASE Phase;
43 } EFI_MM_STANDBY_BUTTON_REGISTER_CONTEXT;
44
45 typedef struct _EFI_MM_STANDBY_BUTTON_DISPATCH_PROTOCOL EFI_MM_STANDBY_BUTTON_DISPATCH_PROTOCOL;
46
47 /**
48 Provides the parent dispatch service for a standby button event.
49
50 This service registers a function (DispatchFunction) which will be called when an MMI is
51 generated because the standby button was pressed or released, as specified by
52 RegisterContext. On return, DispatchHandle contains a unique handle which may be used
53 later to unregister the function using UnRegister().
54 The DispatchFunction will be called with Context set to the same value as was passed into
55 this function in RegisterContext and with CommBuffer and CommBufferSize set to NULL.
56
57 @param[in] This Pointer to the EFI_MM_STANDBY_BUTTON_DISPATCH_PROTOCOL instance.
58 @param[in] DispatchFunction Function to register for handler when the standby button is pressed or released.
59 @param[in] RegisterContext Pointer to the dispatch function's context. The caller fills in this context
60 before calling the register function to indicate to the register function the
61 standby button MMI source for which the dispatch function should be invoked.
62 @param[out] DispatchHandle Handle generated by the dispatcher to track the function instance.
63
64 @retval EFI_SUCCESS The dispatch function has been successfully
65 registered and the MMI source has been enabled.
66 @retval EFI_DEVICE_ERROR The driver was unable to enable the MMI source.
67 @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The standby button input value
68 is not within valid range.
69 @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or MM) to manage this child.
70 **/
71 typedef
72 EFI_STATUS
73 (EFIAPI *EFI_MM_STANDBY_BUTTON_REGISTER)(
74 IN CONST EFI_MM_STANDBY_BUTTON_DISPATCH_PROTOCOL *This,
75 IN EFI_MM_HANDLER_ENTRY_POINT DispatchFunction,
76 IN EFI_MM_STANDBY_BUTTON_REGISTER_CONTEXT *RegisterContext,
77 OUT EFI_HANDLE *DispatchHandle
78 );
79
80 /**
81 Unregisters a child MMI source dispatch function with a parent MM driver.
82
83 This service removes the handler associated with DispatchHandle so that it will no longer be
84 called when the standby button is pressed or released.
85
86 @param[in] This Pointer to the EFI_MM_STANDBY_BUTTON_DISPATCH_PROTOCOL instance.
87 @param[in] DispatchHandle Handle of the service to remove.
88
89 @retval EFI_SUCCESS The service has been successfully removed.
90 @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.
91 **/
92 typedef
93 EFI_STATUS
94 (EFIAPI *EFI_MM_STANDBY_BUTTON_UNREGISTER)(
95 IN CONST EFI_MM_STANDBY_BUTTON_DISPATCH_PROTOCOL *This,
96 IN EFI_HANDLE DispatchHandle
97 );
98
99 ///
100 /// Interface structure for the MM Standby Button Dispatch Protocol.
101 ///
102 /// This protocol provides the parent dispatch service for the standby
103 /// button MMI source generator.
104 ///
105 struct _EFI_MM_STANDBY_BUTTON_DISPATCH_PROTOCOL {
106 EFI_MM_STANDBY_BUTTON_REGISTER Register;
107 EFI_MM_STANDBY_BUTTON_UNREGISTER UnRegister;
108 };
109
110 extern EFI_GUID gEfiMmStandbyButtonDispatchProtocolGuid;
111
112 #endif
113