]> code.delx.au - refind/blob - filesystems/edk2/DriverBinding.h
Properly initialise variable to fix detection of non-Arch kernel versions
[refind] / filesystems / edk2 / DriverBinding.h
1 /*++
2
3 Copyright (c) 2004, 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 Module Name:
13
14 DriverBinding.h
15
16 Abstract:
17
18 EFI ControllerHandle Driver Protocol
19
20 Revision History
21
22 --*/
23
24 #ifndef _EFI_DRIVER_BINDING_H_
25 #define _EFI_DRIVER_BINDING_H_
26
27 #include <efidevp.h>
28
29 //
30 // Global ID for the ControllerHandle Driver Protocol
31 //
32 #define EFI_DRIVER_BINDING_PROTOCOL_GUID \
33 { \
34 0x18a031ab, 0xb443, 0x4d1a, {0xa5, 0xc0, 0xc, 0x9, 0x26, 0x1e, 0x9f, 0x71} \
35 }
36
37 #define EFI_FORWARD_DECLARATION(x) typedef struct _##x x
38
39 EFI_FORWARD_DECLARATION (EFI_DRIVER_BINDING_PROTOCOL);
40
41 ///
42 /// Device Path protocol.
43 ///
44 #define EFI_DEVICE_PATH_PROTOCOL_GUID \
45 { \
46 0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
47 }
48
49 // Begin included from DevicePath.h....
50
51 ///
52 /// Device Path guid definition for backward-compatible with EFI1.1.
53 ///
54 //#define DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH_PROTOCOL_GUID
55
56 #pragma pack(1)
57
58 /**
59 This protocol can be used on any device handle to obtain generic path/location
60 information concerning the physical device or logical device. If the handle does
61 not logically map to a physical device, the handle may not necessarily support
62 the device path protocol. The device path describes the location of the device
63 the handle is for. The size of the Device Path can be determined from the structures
64 that make up the Device Path.
65 **/
66 typedef struct {
67 UINT8 Type; ///< 0x01 Hardware Device Path.
68 ///< 0x02 ACPI Device Path.
69 ///< 0x03 Messaging Device Path.
70 ///< 0x04 Media Device Path.
71 ///< 0x05 BIOS Boot Specification Device Path.
72 ///< 0x7F End of Hardware Device Path.
73
74 UINT8 SubType; ///< Varies by Type
75 ///< 0xFF End Entire Device Path, or
76 ///< 0x01 End This Instance of a Device Path and start a new
77 ///< Device Path.
78
79 UINT8 Length[2]; ///< Specific Device Path data. Type and Sub-Type define
80 ///< type of data. Size of data is included in Length.
81
82 } EFI_DEVICE_PATH_PROTOCOL;
83
84 #pragma pack()
85
86 // End included from DevicePath.h
87
88 typedef
89 EFI_STATUS
90 (EFI_FUNCTION EFIAPI *EFI_DRIVER_BINDING_SUPPORTED) (
91 IN EFI_DRIVER_BINDING_PROTOCOL * This,
92 IN EFI_HANDLE ControllerHandle,
93 IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
94 )
95 /*++
96
97 Routine Description:
98 Test to see if this driver supports ControllerHandle.
99
100 Arguments:
101 This - Protocol instance pointer.
102 ControllerHandle - Handle of device to test
103 RemainingDevicePath - Optional parameter use to pick a specific child
104 device to start.
105
106 Returns:
107 EFI_SUCCESS - This driver supports this device
108 EFI_ALREADY_STARTED - This driver is already running on this device
109 other - This driver does not support this device
110
111 --*/
112 ;
113
114 typedef
115 EFI_STATUS
116 (EFI_FUNCTION EFIAPI *EFI_DRIVER_BINDING_START) (
117 IN EFI_DRIVER_BINDING_PROTOCOL * This,
118 IN EFI_HANDLE ControllerHandle,
119 IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
120 )
121 /*++
122
123 Routine Description:
124 Start this driver on ControllerHandle.
125
126 Arguments:
127 This - Protocol instance pointer.
128 ControllerHandle - Handle of device to bind driver to
129 RemainingDevicePath - Optional parameter use to pick a specific child
130 device to start.
131
132 Returns:
133 EFI_SUCCESS - This driver is added to ControllerHandle
134 EFI_ALREADY_STARTED - This driver is already running on ControllerHandle
135 other - This driver does not support this device
136
137 --*/
138 ;
139
140 typedef
141 EFI_STATUS
142 (EFI_FUNCTION EFIAPI *EFI_DRIVER_BINDING_STOP) (
143 IN EFI_DRIVER_BINDING_PROTOCOL * This,
144 IN EFI_HANDLE ControllerHandle,
145 IN UINTN NumberOfChildren,
146 IN EFI_HANDLE * ChildHandleBuffer
147 )
148 /*++
149
150 Routine Description:
151 Stop this driver on ControllerHandle.
152
153 Arguments:
154 This - Protocol instance pointer.
155 ControllerHandle - Handle of device to stop driver on
156 NumberOfChildren - Number of Handles in ChildHandleBuffer. If number of
157 children is zero stop the entire bus driver.
158 ChildHandleBuffer - List of Child Handles to Stop.
159
160 Returns:
161 EFI_SUCCESS - This driver is removed ControllerHandle
162 other - This driver was not removed from this device
163
164 --*/
165 ;
166
167 //
168 // Interface structure for the ControllerHandle Driver Protocol
169 //
170 struct _EFI_DRIVER_BINDING_PROTOCOL {
171 EFI_DRIVER_BINDING_SUPPORTED Supported;
172 EFI_DRIVER_BINDING_START Start;
173 EFI_DRIVER_BINDING_STOP Stop;
174 UINT32 Version;
175 EFI_HANDLE ImageHandle;
176 EFI_HANDLE DriverBindingHandle;
177 };
178
179 extern EFI_GUID gEfiDriverBindingProtocolGuid;
180
181 #endif