]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/TianoTools/Include/Protocol/SmmUsbDispatch.h
Remove the dependence to MdePkg
[mirror_edk2.git] / Tools / Source / TianoTools / Include / Protocol / SmmUsbDispatch.h
1 /** @file
2 This file declares EFI Smm USB Smi Child Protocol.
3
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 Module Name: SmmUsbDispatch.h
14
15 @par Revision Reference:
16 This Protocol is defined in Framework of EFI SMM Core Interface Spec
17 Version 0.9.
18 **/
19
20 #ifndef _EFI_SMM_USB_DISPATCH_H_
21 #define _EFI_SMM_USB_DISPATCH_H_
22
23 //
24 // Global ID for the USB Protocol
25 //
26 #define EFI_SMM_USB_DISPATCH_PROTOCOL_GUID \
27 { \
28 0xa05b6ffd, 0x87af, 0x4e42, {0x95, 0xc9, 0x62, 0x28, 0xb6, 0x3c, 0xf3, 0xf3 } \
29 }
30
31 typedef struct _EFI_SMM_USB_DISPATCH_PROTOCOL EFI_SMM_USB_DISPATCH_PROTOCOL;
32
33 //
34 // Related Definitions
35 //
36 typedef enum {
37 UsbLegacy,
38 UsbWake
39 } EFI_USB_SMI_TYPE;
40
41 typedef struct {
42 EFI_USB_SMI_TYPE Type;
43 EFI_DEVICE_PATH_PROTOCOL *Device;
44 } EFI_SMM_USB_DISPATCH_CONTEXT;
45
46 //
47 // Member functions
48 //
49 /**
50 Dispatch function for a USB SMI handler.
51
52 @param DispatchHandle Handle of this dispatch function.
53 @param DispatchContext Pointer to the dispatch function's context.
54 The DispatchContext fields are filled in
55 by the dispatching driver prior to
56 invoking this dispatch function.
57
58 Nothing
59
60 **/
61 typedef
62 VOID
63 (EFIAPI *EFI_SMM_USB_DISPATCH) (
64 IN EFI_HANDLE DispatchHandle,
65 IN EFI_SMM_USB_DISPATCH_CONTEXT *DispatchContext
66 );
67
68 /**
69 Register a child SMI source dispatch function with a parent SMM driver
70
71 @param This Protocol instance pointer.
72 @param DispatchFunction Pointer to dispatch function to be invoked for
73 this SMI source
74 @param DispatchContext Pointer to the dispatch function's context.
75 The caller fills this context in before calling
76 the register function to indicate to the register
77 function the USB SMI types for which the dispatch
78 function should be invoked.
79 @param DispatchHandle Handle of dispatch function, for when interfacing
80 with the parent Sx state SMM driver.
81
82 @retval EFI_SUCCESS The dispatch function has been successfully
83 registered and the SMI source has been enabled.
84 @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.
85 @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this
86 child.
87 @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The USB SMI type
88 is not within valid range.
89
90 **/
91 typedef
92 EFI_STATUS
93 (EFIAPI *EFI_SMM_USB_REGISTER) (
94 IN EFI_SMM_USB_DISPATCH_PROTOCOL *This,
95 IN EFI_SMM_USB_DISPATCH DispatchFunction,
96 IN EFI_SMM_USB_DISPATCH_CONTEXT *DispatchContext,
97 OUT EFI_HANDLE *DispatchHandle
98 );
99
100 /**
101 Unregister a child SMI source dispatch function with a parent SMM driver
102
103 @param This Protocol instance pointer.
104 @param DispatchHandle Handle of dispatch function to deregister.
105
106 @retval EFI_SUCCESS The dispatch function has been successfully
107 unregistered and the SMI source has been disabled
108 if there are no other registered child dispatch
109 functions for this SMI source.
110 @retval EFI_INVALID_PARAMETER Handle is invalid.
111
112 **/
113 typedef
114 EFI_STATUS
115 (EFIAPI *EFI_SMM_USB_UNREGISTER) (
116 IN EFI_SMM_USB_DISPATCH_PROTOCOL *This,
117 IN EFI_HANDLE DispatchHandle
118 );
119
120 //
121 // Interface structure for the SMM USB SMI Dispatch Protocol
122 //
123 /**
124 @par Protocol Description:
125 Provides the parent dispatch service for the USB SMI source generator.
126
127 @param Register
128 Installs a child service to be dispatched by this protocol.
129
130 @param UnRegister
131 Removes a child service dispatched by this protocol.
132
133 **/
134 struct _EFI_SMM_USB_DISPATCH_PROTOCOL {
135 EFI_SMM_USB_REGISTER Register;
136 EFI_SMM_USB_UNREGISTER UnRegister;
137 };
138
139 extern EFI_GUID gEfiSmmUsbDispatchProtocolGuid;
140
141 #endif