]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Protocol/SmmUsbDispatch.h
Clean the public header files to remove the unnecessary include files.
[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 - 2009, 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 @par Revision Reference:
14 This Protocol is defined in Framework of EFI SMM Core Interface Spec
15 Version 0.9.
16
17 **/
18
19 #ifndef _EFI_SMM_USB_DISPATCH_H_
20 #define _EFI_SMM_USB_DISPATCH_H_
21
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 ///
43 /// Describes whether this child handler will be invoked in response to a USB legacy
44 /// emulation event, such as port-trap on the PS/2* keyboard control registers, or to a
45 /// USB wake event, such as resumption from a sleep state.
46 ///
47 EFI_USB_SMI_TYPE Type;
48 ///
49 /// The device path is part of the context structure and describes the location of the
50 /// particular USB host controller in the system for which this register event will occur.
51 /// This location is important because of the possible integration of several USB host
52 /// controllers in a system.
53 ///
54 EFI_DEVICE_PATH_PROTOCOL *Device;
55 } EFI_SMM_USB_DISPATCH_CONTEXT;
56
57 //
58 // Member functions
59 //
60 /**
61 Dispatch function for a USB SMI handler.
62
63 @param[in] DispatchHandle Handle of this dispatch function.
64 @param[in] DispatchContext Pointer to the dispatch function's context.
65 The DispatchContext fields are filled in
66 by the dispatching driver prior to
67 invoking this dispatch function.
68
69 **/
70 typedef
71 VOID
72 (EFIAPI *EFI_SMM_USB_DISPATCH)(
73 IN EFI_HANDLE DispatchHandle,
74 IN EFI_SMM_USB_DISPATCH_CONTEXT *DispatchContext
75 );
76
77 /**
78 Register a child SMI source dispatch function with a parent SMM driver.
79
80 @param[in] This Pointer to the EFI_SMM_USB_DISPATCH_PROTOCOL instance.
81 @param[in] DispatchFunction Pointer to dispatch function to be invoked
82 for this SMI source.
83 @param[in] DispatchContext Pointer to the dispatch function's context.
84 The caller fills this context in before calling
85 the register function to indicate to the register
86 function the USB SMI types for which the dispatch
87 function should be invoked.
88 @param[out] DispatchHandle Handle generated by the dispatcher to track the
89 function instance.
90
91 @retval EFI_SUCCESS The dispatch function has been successfully
92 registered and the SMI source has been enabled.
93 @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.
94 @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this
95 child.
96 @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The USB SMI type
97 is not within valid range.
98
99 **/
100 typedef
101 EFI_STATUS
102 (EFIAPI *EFI_SMM_USB_REGISTER)(
103 IN EFI_SMM_USB_DISPATCH_PROTOCOL *This,
104 IN EFI_SMM_USB_DISPATCH DispatchFunction,
105 IN EFI_SMM_USB_DISPATCH_CONTEXT *DispatchContext,
106 OUT EFI_HANDLE *DispatchHandle
107 );
108
109 /**
110 Unregisters a USB service.
111
112 @param[in] This Pointer to the EFI_SMM_USB_DISPATCH_PROTOCOL instance.
113 @param[in] DispatchHandle Handle of the service to remove.
114
115 @retval EFI_SUCCESS The dispatch function has been successfully
116 unregistered and the SMI source has been disabled
117 if there are no other registered child dispatch
118 functions for this SMI source.
119 @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.
120
121 **/
122 typedef
123 EFI_STATUS
124 (EFIAPI *EFI_SMM_USB_UNREGISTER)(
125 IN EFI_SMM_USB_DISPATCH_PROTOCOL *This,
126 IN EFI_HANDLE DispatchHandle
127 );
128
129 ///
130 /// The EFI_SMM_USB_DISPATCH_PROTOCOL provides the ability to install child handlers for the
131 /// given event types.
132 ///
133 struct _EFI_SMM_USB_DISPATCH_PROTOCOL {
134 EFI_SMM_USB_REGISTER Register;
135 EFI_SMM_USB_UNREGISTER UnRegister;
136 };
137
138 extern EFI_GUID gEfiSmmUsbDispatchProtocolGuid;
139
140 #endif