]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Protocol/SmmUsbDispatch.h
5887951e98debb9832182e0333eacc5721f5c344
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / SmmUsbDispatch.h
1 /** @file
2 Provides the parent dispatch service for the USB SMI source generator.
3
4 Copyright (c) 2007, 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 #include <PiDxe.h>
24
25 //
26 // Global ID for the USB Protocol
27 //
28 #define EFI_SMM_USB_DISPATCH_PROTOCOL_GUID \
29 { \
30 0xa05b6ffd, 0x87af, 0x4e42, {0x95, 0xc9, 0x62, 0x28, 0xb6, 0x3c, 0xf3, 0xf3 } \
31 }
32
33 typedef struct _EFI_SMM_USB_DISPATCH_PROTOCOL EFI_SMM_USB_DISPATCH_PROTOCOL;
34
35 //
36 // Related Definitions
37 //
38 typedef enum {
39 UsbLegacy,
40 UsbWake
41 } EFI_USB_SMI_TYPE;
42
43 typedef struct {
44 EFI_USB_SMI_TYPE Type;
45 EFI_DEVICE_PATH_PROTOCOL *Device;
46 } EFI_SMM_USB_DISPATCH_CONTEXT;
47
48 //
49 // Member functions
50 //
51 /**
52 Dispatch function for a USB SMI handler.
53
54 @param DispatchHandle Handle of this dispatch function.
55 @param DispatchContext Pointer to the dispatch function's context.
56 The DispatchContext fields are filled in
57 by the dispatching driver prior to
58 invoking this dispatch function.
59
60 @return None
61
62 **/
63 typedef
64 VOID
65 (EFIAPI *EFI_SMM_USB_DISPATCH)(
66 IN EFI_HANDLE DispatchHandle,
67 IN EFI_SMM_USB_DISPATCH_CONTEXT *DispatchContext
68 );
69
70 /**
71 Register a child SMI source dispatch function with a parent SMM driver
72
73 @param This Pointer to the EFI_SMM_USB_DISPATCH_PROTOCOL instance.
74 @param DispatchFunction Pointer to dispatch function to be invoked
75 for this SMI source.
76 @param DispatchContext Pointer to the dispatch function's context.
77 The caller fills this context in before calling
78 the register function to indicate to the register
79 function the USB SMI types for which the dispatch
80 function should be invoked.
81 @param DispatchHandle Handle generated by the dispatcher to track the
82 function instance.
83
84 @retval EFI_SUCCESS The dispatch function has been successfully
85 registered and the SMI source has been enabled.
86 @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.
87 @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this
88 child.
89 @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The USB SMI type
90 is not within valid range.
91
92 **/
93 typedef
94 EFI_STATUS
95 (EFIAPI *EFI_SMM_USB_REGISTER)(
96 IN EFI_SMM_USB_DISPATCH_PROTOCOL *This,
97 IN EFI_SMM_USB_DISPATCH DispatchFunction,
98 IN EFI_SMM_USB_DISPATCH_CONTEXT *DispatchContext,
99 OUT EFI_HANDLE *DispatchHandle
100 );
101
102 /**
103 Unregisters a USB service
104
105 @param This Pointer to the EFI_SMM_USB_DISPATCH_PROTOCOL instance.
106 @param DispatchHandle Handle of the service to remove.
107
108 @retval EFI_SUCCESS The dispatch function has been successfully
109 unregistered and the SMI source has been disabled
110 if there are no other registered child dispatch
111 functions for this SMI source.
112 @retval EFI_INVALID_PARAMETER Handle is invalid.
113
114 **/
115 typedef
116 EFI_STATUS
117 (EFIAPI *EFI_SMM_USB_UNREGISTER)(
118 IN EFI_SMM_USB_DISPATCH_PROTOCOL *This,
119 IN EFI_HANDLE DispatchHandle
120 );
121
122 //
123 // Interface structure for the SMM USB SMI Dispatch Protocol
124 //
125 /**
126 @par Protocol Description:
127 Provides the parent dispatch service for the USB SMI source generator.
128
129 @param Register
130 Installs a child service to be dispatched by this protocol.
131
132 @param UnRegister
133 Removes a child service dispatched by this protocol.
134
135 **/
136 struct _EFI_SMM_USB_DISPATCH_PROTOCOL {
137 EFI_SMM_USB_REGISTER Register;
138 EFI_SMM_USB_UNREGISTER UnRegister;
139 };
140
141 extern EFI_GUID gEfiSmmUsbDispatchProtocolGuid;
142
143 #endif