00001 /** @file 00002 UEFI DriverBinding Protocol is defined in UEFI specification. 00003 00004 This protocol is produced by every driver that follows the UEFI Driver Model, 00005 and it is the central component that allows drivers and controllers to be managed. 00006 00007 Copyright (c) 2006 - 2008, Intel Corporation 00008 All rights reserved. This program and the accompanying materials 00009 are licensed and made available under the terms and conditions of the BSD License 00010 which accompanies this distribution. The full text of the license may be found at 00011 http://opensource.org/licenses/bsd-license.php 00012 00013 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 00014 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 00015 00016 **/ 00017 00018 #ifndef __EFI_DRIVER_BINDING_H__ 00019 #define __EFI_DRIVER_BINDING_H__ 00020 00021 #include <gpxe/efi/Protocol/DevicePath.h> 00022 /// 00023 /// Global ID for the ControllerHandle Driver Protocol 00024 /// 00025 #define EFI_DRIVER_BINDING_PROTOCOL_GUID \ 00026 { \ 00027 0x18a031ab, 0xb443, 0x4d1a, {0xa5, 0xc0, 0xc, 0x9, 0x26, 0x1e, 0x9f, 0x71 } \ 00028 } 00029 00030 typedef struct _EFI_DRIVER_BINDING_PROTOCOL EFI_DRIVER_BINDING_PROTOCOL; 00031 00032 /** 00033 Test to see if this driver supports ControllerHandle. This service 00034 is called by the EFI boot service ConnectController(). In 00035 order to make drivers as small as possible, there are a few calling 00036 restrictions for this service. ConnectController() must 00037 follow these calling restrictions. If any other agent wishes to call 00038 Supported() it must also follow these calling restrictions. 00039 00040 @param This Protocol instance pointer. 00041 @param ControllerHandle Handle of device to test 00042 @param RemainingDevicePath Optional parameter use to pick a specific child 00043 device to start. 00044 00045 @retval EFI_SUCCESS This driver supports this device 00046 @retval EFI_ALREADY_STARTED This driver is already running on this device 00047 @retval other This driver does not support this device 00048 00049 **/ 00050 typedef 00051 EFI_STATUS 00052 (EFIAPI *EFI_DRIVER_BINDING_SUPPORTED)( 00053 IN EFI_DRIVER_BINDING_PROTOCOL *This, 00054 IN EFI_HANDLE ControllerHandle, 00055 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL 00056 ); 00057 00058 /** 00059 Start this driver on ControllerHandle. This service is called by the 00060 EFI boot service ConnectController(). In order to make 00061 drivers as small as possible, there are a few calling restrictions for 00062 this service. ConnectController() must follow these 00063 calling restrictions. If any other agent wishes to call Start() it 00064 must also follow these calling restrictions. 00065 00066 @param This Protocol instance pointer. 00067 @param ControllerHandle Handle of device to bind driver to 00068 @param RemainingDevicePath Optional parameter use to pick a specific child 00069 device to start. 00070 00071 @retval EFI_SUCCESS This driver is added to ControllerHandle 00072 @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle 00073 @retval other This driver does not support this device 00074 00075 **/ 00076 typedef 00077 EFI_STATUS 00078 (EFIAPI *EFI_DRIVER_BINDING_START)( 00079 IN EFI_DRIVER_BINDING_PROTOCOL *This, 00080 IN EFI_HANDLE ControllerHandle, 00081 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL 00082 ); 00083 00084 /** 00085 Stop this driver on ControllerHandle. This service is called by the 00086 EFI boot service DisconnectController(). In order to 00087 make drivers as small as possible, there are a few calling 00088 restrictions for this service. DisconnectController() 00089 must follow these calling restrictions. If any other agent wishes 00090 to call Stop() it must also follow these calling restrictions. 00091 00092 @param This Protocol instance pointer. 00093 @param ControllerHandle Handle of device to stop driver on 00094 @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of 00095 children is zero stop the entire bus driver. 00096 @param ChildHandleBuffer List of Child Handles to Stop. 00097 00098 @retval EFI_SUCCESS This driver is removed ControllerHandle 00099 @retval other This driver was not removed from this device 00100 00101 **/ 00102 typedef 00103 EFI_STATUS 00104 (EFIAPI *EFI_DRIVER_BINDING_STOP)( 00105 IN EFI_DRIVER_BINDING_PROTOCOL *This, 00106 IN EFI_HANDLE ControllerHandle, 00107 IN UINTN NumberOfChildren, 00108 IN EFI_HANDLE *ChildHandleBuffer OPTIONAL 00109 ); 00110 00111 /// 00112 /// This protocol provides the services required to determine if a driver supports a given controller. 00113 /// If a controller is supported, then it also provides routines to start and stop the controller. 00114 /// 00115 struct _EFI_DRIVER_BINDING_PROTOCOL { 00116 EFI_DRIVER_BINDING_SUPPORTED Supported; 00117 EFI_DRIVER_BINDING_START Start; 00118 EFI_DRIVER_BINDING_STOP Stop; 00119 00120 /// 00121 /// The version number of the UEFI driver that produced the 00122 /// EFI_DRIVER_BINDING_PROTOCOL. This field is used by 00123 /// the EFI boot service ConnectController() to determine 00124 /// the order that driver's Supported() service will be used when 00125 /// a controller needs to be started. EFI Driver Binding Protocol 00126 /// instances with higher Version values will be used before ones 00127 /// with lower Version values. The Version values of 0x0- 00128 /// 0x0f and 0xfffffff0-0xffffffff are reserved for 00129 /// platform/OEM specific drivers. The Version values of 0x10- 00130 /// 0xffffffef are reserved for IHV-developed drivers. 00131 /// 00132 UINT32 Version; 00133 00134 /// 00135 /// The image handle of the UEFI driver that produced this instance 00136 /// of the EFI_DRIVER_BINDING_PROTOCOL. 00137 /// 00138 EFI_HANDLE ImageHandle; 00139 00140 /// 00141 /// The handle on which this instance of the 00142 /// EFI_DRIVER_BINDING_PROTOCOL is installed. In most 00143 /// cases, this is the same handle as ImageHandle. However, for 00144 /// UEFI drivers that produce more than one instance of the 00145 /// EFI_DRIVER_BINDING_PROTOCOL, this value may not be 00146 /// the same as ImageHandle. 00147 /// 00148 EFI_HANDLE DriverBindingHandle; 00149 }; 00150 00151 extern EFI_GUID gEfiDriverBindingProtocolGuid; 00152 00153 #endif
1.5.7.1