1 /** @file
2 Intel-only SMM Child Dispatcher Protocol.
3 
4 This protocol provides a parent dispatch service for a collection of
5 chipset-specific SMI source.
6 
7 Copyright (c) 2013-2015 Intel Corporation.
8 
9 This program and the accompanying materials
10 are licensed and made available under the terms and conditions of the BSD License
11 which accompanies this distribution.  The full text of the license may be found at
12 http://opensource.org/licenses/bsd-license.php
13 
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 
17 **/
18 
19 
20 #ifndef __SMM_ICHN_DISPATCH2_H__
21 #define __SMM_ICHN_DISPATCH2_H__
22 
23 //
24 // Share some common definitions with Framework SMM
25 //
26 #include <Protocol/SmmIchnDispatch.h>
27 
28 #include <PiSmm.h>
29 
30 //
31 // Global ID for the ICH SMI Protocol
32 //
33 #define EFI_SMM_ICHN_DISPATCH2_PROTOCOL_GUID \
34   { \
35     0xadf3a128, 0x416d, 0x4060, {0x8d, 0xdf, 0x30, 0xa1, 0xd7, 0xaa, 0xb6, 0x99 } \
36   }
37 
38 typedef struct _EFI_SMM_ICHN_DISPATCH2_PROTOCOL EFI_SMM_ICHN_DISPATCH2_PROTOCOL;
39 
40 typedef struct {
41   EFI_SMM_ICHN_SMI_TYPE Type;
42 } EFI_SMM_ICHN_REGISTER_CONTEXT;
43 
44 //
45 // Member functions
46 //
47 /**
48   Register a child SMI source dispatch function with a parent SMM driver
49 
50   @param  This                  Protocol instance pointer.
51   @param  DispatchFunction      Pointer to dispatch function to be invoked for
52                                 this SMI source
53   @param  RegisterContext       Pointer to the dispatch function's context.
54                                 The caller fills this context in before calling
55                                 the register function to indicate to the register
56                                 function the ICHN SMI source for which the dispatch
57                                 function should be invoked.
58   @param  DispatchHandle        Handle generated by the dispatcher to track the
59                                 function instance.
60 
61   @retval EFI_SUCCESS           The dispatch function has been successfully
62                                 registered and the SMI source has been enabled.
63   @retval EFI_DEVICE_ERROR      The driver was unable to enable the SMI source.
64   @retval EFI_OUT_OF_RESOURCES  Not enough memory (system or SMM) to manage this
65                                 child.
66   @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The ICHN input value
67                                 is not within valid range.
68 
69 **/
70 typedef
71 EFI_STATUS
72 (EFIAPI *EFI_SMM_ICHN_DISPATCH2_REGISTER) (
73   IN CONST EFI_SMM_ICHN_DISPATCH2_PROTOCOL   *This,
74   IN       EFI_SMM_HANDLER_ENTRY_POINT2      DispatchFunction,
75   IN OUT   EFI_SMM_ICHN_REGISTER_CONTEXT     *RegisterContext,
76      OUT   EFI_HANDLE                        *DispatchHandle
77   );
78 
79 /**
80   Unregister a child SMI source dispatch function with a parent SMM driver
81 
82   @param  This                  Protocol instance pointer.
83   @param  DispatchHandle        Handle of dispatch function to deregister.
84 
85   @retval EFI_SUCCESS           The dispatch function has been successfully
86                                 unregistered and the SMI source has been disabled
87                                 if there are no other registered child dispatch
88                                 functions for this SMI source.
89   @retval EFI_INVALID_PARAMETER Handle is invalid.
90   @retval other
91 
92 **/
93 typedef
94 EFI_STATUS
95 (EFIAPI *EFI_SMM_ICHN_DISPATCH2_UNREGISTER) (
96   IN EFI_SMM_ICHN_DISPATCH2_PROTOCOL          *This,
97   IN EFI_HANDLE                               DispatchHandle
98   );
99 
100 //
101 // Interface structure for the SMM Ich n specific SMI Dispatch Protocol
102 //
103 /**
104   @par Protocol Description:
105   Provides a parent dispatch service for ICH SMI sources.
106 
107   @param Register
108   Installs a child service to be dispatched by this protocol.
109 
110   @param UnRegister
111   Removes a child service dispatched by this protocol.
112 
113 **/
114 struct _EFI_SMM_ICHN_DISPATCH2_PROTOCOL {
115   EFI_SMM_ICHN_DISPATCH2_REGISTER   Register;
116   EFI_SMM_ICHN_DISPATCH2_UNREGISTER UnRegister;
117 };
118 
119 extern EFI_GUID gEfiSmmIchnDispatch2ProtocolGuid;
120 
121 #endif
122