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