]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Protocol/DriverBinding.h
Formalize comments for Protocols and PPIs.
[mirror_edk2.git] / MdePkg / Include / Protocol / DriverBinding.h
index 5f5d90963e8b81bd63aa154fd81af9a5e7bc2a6e..93778915199d076dc17942f6d2d0dc57f38dcb40 100644 (file)
@@ -1,7 +1,10 @@
 /** @file\r
-  EFI ControllerHandle Driver Protocol\r
+  UEFI DriverBinding Protocol is defined in UEFI specification.\r
+  \r
+  This protocol is produced by every driver that follows the UEFI Driver Model, \r
+  and it is the central component that allows drivers and controllers to be managed.\r
 \r
-  Copyright (c) 2006, Intel Corporation                                                         \r
+  Copyright (c) 2006 - 2008, Intel Corporation                                                         \r
   All rights reserved. This program and the accompanying materials                          \r
   are licensed and made available under the terms and conditions of the BSD License         \r
   which accompanies this distribution.  The full text of the license may be found at        \r
   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
 \r
-  Module Name:  DriverBinding.h\r
-\r
 **/\r
 \r
 #ifndef __EFI_DRIVER_BINDING_H__\r
 #define __EFI_DRIVER_BINDING_H__\r
 \r
-//\r
-// Global ID for the ControllerHandle Driver Protocol\r
-//\r
+#include <Protocol/DevicePath.h>\r
+///\r
+/// Global ID for the ControllerHandle Driver Protocol\r
+///\r
 #define EFI_DRIVER_BINDING_PROTOCOL_GUID \\r
   { \\r
     0x18a031ab, 0xb443, 0x4d1a, {0xa5, 0xc0, 0xc, 0x9, 0x26, 0x1e, 0x9f, 0x71 } \\r
 typedef struct _EFI_DRIVER_BINDING_PROTOCOL  EFI_DRIVER_BINDING_PROTOCOL;\r
 \r
 /**\r
-  Test to see if this driver supports ControllerHandle. \r
+  Test to see if this driver supports ControllerHandle. This service\r
+  is called by the EFI boot service ConnectController(). In\r
+  order to make drivers as small as possible, there are a few calling\r
+  restrictions for this service. ConnectController() must\r
+  follow these calling restrictions. If any other agent wishes to call\r
+  Supported() it must also follow these calling restrictions.\r
 \r
   @param  This                Protocol instance pointer.\r
   @param  ControllerHandle    Handle of device to test\r
@@ -42,15 +49,19 @@ typedef struct _EFI_DRIVER_BINDING_PROTOCOL  EFI_DRIVER_BINDING_PROTOCOL;
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_DRIVER_BINDING_SUPPORTED) (\r
+(EFIAPI *EFI_DRIVER_BINDING_SUPPORTED)(\r
   IN EFI_DRIVER_BINDING_PROTOCOL            *This,\r
   IN EFI_HANDLE                             ControllerHandle,\r
   IN EFI_DEVICE_PATH_PROTOCOL               *RemainingDevicePath OPTIONAL\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
-  Start this driver on ControllerHandle.\r
+  Start this driver on ControllerHandle. This service is called by the\r
+  EFI boot service ConnectController(). In order to make\r
+  drivers as small as possible, there are a few calling restrictions for\r
+  this service. ConnectController() must follow these\r
+  calling restrictions. If any other agent wishes to call Start() it\r
+  must also follow these calling restrictions.\r
 \r
   @param  This                 Protocol instance pointer.\r
   @param  ControllerHandle     Handle of device to bind driver to\r
@@ -64,16 +75,20 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_DRIVER_BINDING_START) (\r
+(EFIAPI *EFI_DRIVER_BINDING_START)(\r
   IN EFI_DRIVER_BINDING_PROTOCOL            *This,\r
   IN EFI_HANDLE                             ControllerHandle,\r
   IN EFI_DEVICE_PATH_PROTOCOL               *RemainingDevicePath OPTIONAL\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
-  Stop this driver on ControllerHandle.\r
-\r
+  Stop this driver on ControllerHandle. This service is called by the\r
+  EFI boot service DisconnectController(). In order to\r
+  make drivers as small as possible, there are a few calling\r
+  restrictions for this service. DisconnectController()\r
+  must follow these calling restrictions. If any other agent wishes\r
+  to call Stop() it must also follow these calling restrictions.\r
+  \r
   @param  This              Protocol instance pointer.\r
   @param  ControllerHandle  Handle of device to stop driver on\r
   @param  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of\r
@@ -86,23 +101,50 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_DRIVER_BINDING_STOP) (\r
+(EFIAPI *EFI_DRIVER_BINDING_STOP)(\r
   IN EFI_DRIVER_BINDING_PROTOCOL            *This,\r
   IN  EFI_HANDLE                            ControllerHandle,\r
   IN  UINTN                                 NumberOfChildren,\r
   IN  EFI_HANDLE                            *ChildHandleBuffer OPTIONAL\r
-  )\r
-;\r
+  );\r
 \r
-//\r
-// Interface structure for the ControllerHandle Driver Protocol\r
-//\r
+///\r
+/// This protocol provides the services required to determine if a driver supports a given controller. \r
+/// If a controller is supported, then it also provides routines to start and stop the controller.\r
+///\r
 struct _EFI_DRIVER_BINDING_PROTOCOL {\r
   EFI_DRIVER_BINDING_SUPPORTED  Supported;\r
   EFI_DRIVER_BINDING_START      Start;\r
   EFI_DRIVER_BINDING_STOP       Stop;\r
+  \r
+  ///\r
+  /// The version number of the UEFI driver that produced the\r
+  /// EFI_DRIVER_BINDING_PROTOCOL. This field is used by\r
+  /// the EFI boot service ConnectController() to determine\r
+  /// the order that driver's Supported() service will be used when\r
+  /// a controller needs to be started. EFI Driver Binding Protocol\r
+  /// instances with higher Version values will be used before ones\r
+  /// with lower Version values. The Version values of 0x0-\r
+  /// 0x0f and 0xfffffff0-0xffffffff are reserved for\r
+  /// platform/OEM specific drivers. The Version values of 0x10-\r
+  /// 0xffffffef are reserved for IHV-developed drivers.\r
+  ///\r
   UINT32                        Version;\r
+  \r
+  ///\r
+  /// The image handle of the UEFI driver that produced this instance\r
+  /// of the EFI_DRIVER_BINDING_PROTOCOL.\r
+  ///\r
   EFI_HANDLE                    ImageHandle;\r
+  \r
+  ///\r
+  /// The handle on which this instance of the\r
+  /// EFI_DRIVER_BINDING_PROTOCOL is installed. In most\r
+  /// cases, this is the same handle as ImageHandle. However, for\r
+  /// UEFI drivers that produce more than one instance of the\r
+  /// EFI_DRIVER_BINDING_PROTOCOL, this value may not be\r
+  /// the same as ImageHandle.  \r
+  ///\r
   EFI_HANDLE                    DriverBindingHandle;\r
 };\r
 \r