]>
Commit | Line | Data |
---|---|---|
d1f95000 | 1 | /** @file\r |
4ca9b6c4 LG |
2 | UEFI DriverBinding Protocol is defined in UEFI specification.\r |
3 | \r | |
4 | This protocol is produced by every driver that follows the UEFI Driver Model, \r | |
5 | and it is the central component that allows drivers and controllers to be managed.\r | |
d1f95000 | 6 | \r |
4ca9b6c4 | 7 | Copyright (c) 2006 - 2008, Intel Corporation \r |
d1f95000 | 8 | All rights reserved. This program and the accompanying materials \r |
9 | are licensed and made available under the terms and conditions of the BSD License \r | |
10 | which accompanies this distribution. The full text of the license may be found at \r | |
11 | http://opensource.org/licenses/bsd-license.php \r | |
12 | \r | |
13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
15 | \r | |
d1f95000 | 16 | **/\r |
17 | \r | |
18 | #ifndef __EFI_DRIVER_BINDING_H__\r | |
19 | #define __EFI_DRIVER_BINDING_H__\r | |
20 | \r | |
1a5589a1 | 21 | #include <Protocol/DevicePath.h>\r |
99e8ed21 | 22 | ///\r |
23 | /// Global ID for the ControllerHandle Driver Protocol\r | |
24 | ///\r | |
d1f95000 | 25 | #define EFI_DRIVER_BINDING_PROTOCOL_GUID \\r |
26 | { \\r | |
27 | 0x18a031ab, 0xb443, 0x4d1a, {0xa5, 0xc0, 0xc, 0x9, 0x26, 0x1e, 0x9f, 0x71 } \\r | |
28 | }\r | |
29 | \r | |
30 | typedef struct _EFI_DRIVER_BINDING_PROTOCOL EFI_DRIVER_BINDING_PROTOCOL;\r | |
31 | \r | |
32 | /**\r | |
3354353d | 33 | Test to see if this driver supports ControllerHandle. This service\r |
34 | is called by the EFI boot service ConnectController(). In\r | |
35 | order to make drivers as small as possible, there are a few calling\r | |
36 | restrictions for this service. ConnectController() must\r | |
37 | follow these calling restrictions. If any other agent wishes to call\r | |
38 | Supported() it must also follow these calling restrictions.\r | |
d1f95000 | 39 | \r |
40 | @param This Protocol instance pointer.\r | |
41 | @param ControllerHandle Handle of device to test\r | |
42 | @param RemainingDevicePath Optional parameter use to pick a specific child\r | |
43 | device to start.\r | |
44 | \r | |
45 | @retval EFI_SUCCESS This driver supports this device\r | |
46 | @retval EFI_ALREADY_STARTED This driver is already running on this device\r | |
47 | @retval other This driver does not support this device\r | |
48 | \r | |
49 | **/\r | |
50 | typedef\r | |
51 | EFI_STATUS\r | |
8b13229b | 52 | (EFIAPI *EFI_DRIVER_BINDING_SUPPORTED)(\r |
d1f95000 | 53 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r |
54 | IN EFI_HANDLE ControllerHandle,\r | |
55 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r | |
ed66e1bc | 56 | );\r |
d1f95000 | 57 | \r |
58 | /**\r | |
3354353d | 59 | Start this driver on ControllerHandle. This service is called by the\r |
60 | EFI boot service ConnectController(). In order to make\r | |
61 | drivers as small as possible, there are a few calling restrictions for\r | |
62 | this service. ConnectController() must follow these\r | |
63 | calling restrictions. If any other agent wishes to call Start() it\r | |
64 | must also follow these calling restrictions.\r | |
d1f95000 | 65 | \r |
66 | @param This Protocol instance pointer.\r | |
67 | @param ControllerHandle Handle of device to bind driver to\r | |
68 | @param RemainingDevicePath Optional parameter use to pick a specific child\r | |
69 | device to start.\r | |
70 | \r | |
71 | @retval EFI_SUCCESS This driver is added to ControllerHandle\r | |
72 | @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle\r | |
73 | @retval other This driver does not support this device\r | |
74 | \r | |
75 | **/\r | |
76 | typedef\r | |
77 | EFI_STATUS\r | |
8b13229b | 78 | (EFIAPI *EFI_DRIVER_BINDING_START)(\r |
d1f95000 | 79 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r |
80 | IN EFI_HANDLE ControllerHandle,\r | |
81 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r | |
ed66e1bc | 82 | );\r |
d1f95000 | 83 | \r |
84 | /**\r | |
3354353d | 85 | Stop this driver on ControllerHandle. This service is called by the\r |
86 | EFI boot service DisconnectController(). In order to\r | |
87 | make drivers as small as possible, there are a few calling\r | |
88 | restrictions for this service. DisconnectController()\r | |
89 | must follow these calling restrictions. If any other agent wishes\r | |
90 | to call Stop() it must also follow these calling restrictions.\r | |
91 | \r | |
d1f95000 | 92 | @param This Protocol instance pointer.\r |
93 | @param ControllerHandle Handle of device to stop driver on\r | |
94 | @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of\r | |
95 | children is zero stop the entire bus driver.\r | |
96 | @param ChildHandleBuffer List of Child Handles to Stop.\r | |
97 | \r | |
98 | @retval EFI_SUCCESS This driver is removed ControllerHandle\r | |
99 | @retval other This driver was not removed from this device\r | |
100 | \r | |
101 | **/\r | |
102 | typedef\r | |
103 | EFI_STATUS\r | |
8b13229b | 104 | (EFIAPI *EFI_DRIVER_BINDING_STOP)(\r |
d1f95000 | 105 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r |
106 | IN EFI_HANDLE ControllerHandle,\r | |
107 | IN UINTN NumberOfChildren,\r | |
108 | IN EFI_HANDLE *ChildHandleBuffer OPTIONAL\r | |
ed66e1bc | 109 | );\r |
d1f95000 | 110 | \r |
44717a39 | 111 | ///\r |
112 | /// This protocol provides the services required to determine if a driver supports a given controller. \r | |
113 | /// If a controller is supported, then it also provides routines to start and stop the controller.\r | |
114 | ///\r | |
d1f95000 | 115 | struct _EFI_DRIVER_BINDING_PROTOCOL {\r |
116 | EFI_DRIVER_BINDING_SUPPORTED Supported;\r | |
117 | EFI_DRIVER_BINDING_START Start;\r | |
118 | EFI_DRIVER_BINDING_STOP Stop;\r | |
3354353d | 119 | \r |
120 | ///\r | |
121 | /// The version number of the UEFI driver that produced the\r | |
122 | /// EFI_DRIVER_BINDING_PROTOCOL. This field is used by\r | |
123 | /// the EFI boot service ConnectController() to determine\r | |
124 | /// the order that driver's Supported() service will be used when\r | |
125 | /// a controller needs to be started. EFI Driver Binding Protocol\r | |
126 | /// instances with higher Version values will be used before ones\r | |
127 | /// with lower Version values. The Version values of 0x0-\r | |
128 | /// 0x0f and 0xfffffff0-0xffffffff are reserved for\r | |
129 | /// platform/OEM specific drivers. The Version values of 0x10-\r | |
130 | /// 0xffffffef are reserved for IHV-developed drivers.\r | |
131 | ///\r | |
d1f95000 | 132 | UINT32 Version;\r |
3354353d | 133 | \r |
134 | ///\r | |
135 | /// The image handle of the UEFI driver that produced this instance\r | |
136 | /// of the EFI_DRIVER_BINDING_PROTOCOL.\r | |
137 | ///\r | |
d1f95000 | 138 | EFI_HANDLE ImageHandle;\r |
3354353d | 139 | \r |
140 | ///\r | |
141 | /// The handle on which this instance of the\r | |
142 | /// EFI_DRIVER_BINDING_PROTOCOL is installed. In most\r | |
143 | /// cases, this is the same handle as ImageHandle. However, for\r | |
144 | /// UEFI drivers that produce more than one instance of the\r | |
145 | /// EFI_DRIVER_BINDING_PROTOCOL, this value may not be\r | |
146 | /// the same as ImageHandle. \r | |
147 | ///\r | |
d1f95000 | 148 | EFI_HANDLE DriverBindingHandle;\r |
149 | };\r | |
150 | \r | |
151 | extern EFI_GUID gEfiDriverBindingProtocolGuid;\r | |
152 | \r | |
153 | #endif\r |