1
0

drvplato.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. /*++
  2. Copyright (c) 2014 Minoca Corp. All Rights Reserved
  3. Module Name:
  4. drvplato.h
  5. Abstract:
  6. This header contains definitions for the UEFI Platform Driver Override
  7. Protocol.
  8. Author:
  9. Evan Green 5-Mar-2014
  10. --*/
  11. //
  12. // ------------------------------------------------------------------- Includes
  13. //
  14. //
  15. // ---------------------------------------------------------------- Definitions
  16. //
  17. #define EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_GUID \
  18. { \
  19. 0x6B30C738, 0xA391, 0x11D4, \
  20. {0x9A, 0x3B, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D} \
  21. }
  22. //
  23. // ------------------------------------------------------ Data Type Definitions
  24. //
  25. typedef struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL
  26. EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL;
  27. typedef
  28. EFI_STATUS
  29. (EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER) (
  30. EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *This,
  31. EFI_HANDLE ControllerHandle,
  32. EFI_HANDLE *DriverImageHandle
  33. );
  34. /*++
  35. Routine Description:
  36. This routine retrieves the image handle of the platform override driver
  37. for a controller in the system.
  38. Arguments:
  39. This - Supplies a pointer to the protocol instance.
  40. ControllerHandle - Supplies the device handle of the controller to check
  41. for a driver override.
  42. DriverImageHandle - Supplies a pointer that on input contains a pointer to
  43. the previous driver image handle returned by GetDriver. On output,
  44. returns a pointer to the next driver image handle.
  45. Return Value:
  46. EFI_SUCCESS if the driver override for the given controller handle was
  47. returned.
  48. EFI_NOT_FOUND if a driver override for the given controller was not found.
  49. EFI_INVALID_PARAMETER if the controller handle was NULL or the driver image
  50. handle is not a handle that was returned by a previous call to GetDriver.
  51. --*/
  52. typedef
  53. EFI_STATUS
  54. (EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER_PATH) (
  55. EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *This,
  56. EFI_HANDLE ControllerHandle,
  57. EFI_DEVICE_PATH_PROTOCOL **DriverImagePath
  58. );
  59. /*++
  60. Routine Description:
  61. This routine retrieves the device path of the platform override driver
  62. for a controller in the system.
  63. Arguments:
  64. This - Supplies a pointer to the protocol instance.
  65. ControllerHandle - Supplies the device handle of the controller to check
  66. for a driver override.
  67. DriverImagePath - Supplies a pointer that on input contains a pointer to
  68. the previous device path returned by GetDriverPath. On output,
  69. returns a pointer to the next driver device path. Passing a pointer to
  70. NULL will return the first driver device path for the controller handle.
  71. Return Value:
  72. EFI_SUCCESS if the driver override for the given controller handle was
  73. returned.
  74. EFI_UNSUPPORTED if the operation is not supported.
  75. EFI_NOT_FOUND if a driver override for the given controller was not found.
  76. EFI_INVALID_PARAMETER if the controller handle was NULL or the driver image
  77. path is not a handle that was returned by a previous call to GetDriverPath.
  78. --*/
  79. typedef
  80. EFI_STATUS
  81. (EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_DRIVER_LOADED) (
  82. EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *This,
  83. EFI_HANDLE ControllerHandle,
  84. EFI_DEVICE_PATH_PROTOCOL *DriverImagePath,
  85. EFI_HANDLE DriverImageHandle
  86. );
  87. /*++
  88. Routine Description:
  89. This routine is used to associate a driver image handle with a device path
  90. that was returned on a prior call to the GetDriverPath function. This
  91. driver image handle will then be available through the GetDriver function.
  92. Arguments:
  93. This - Supplies a pointer to the protocol instance.
  94. ControllerHandle - Supplies the device handle of the controller.
  95. DriverImagePath - Supplies a pointer to the driver device path that was
  96. returned in a previous call to GetDriverPath.
  97. DriverImageHandle - Supplies the driver image handle that was returned by
  98. LoadImage when the driver specified in the driver image path was
  99. loaded into memory.
  100. Return Value:
  101. EFI_SUCCESS if the association between the driver image path and driver
  102. image handle was successfully established for the specified controller.
  103. EFI_UNSUPPORTED if the operation is not supported.
  104. EFI_NOT_FOUND if the driver image path is not a device path that was
  105. returned on a prior call to GetDriverPath for the controller.
  106. EFI_INVALID_PARAMETER if the controller handle was NULL, the driver image
  107. path is not valid, or the driver image handle is not valid.
  108. --*/
  109. /*++
  110. Structure Description:
  111. This structure defines the Platform Driver Override Protocol. This protocol
  112. matches one or more drivers to a controller. A platform driver produces
  113. this protocol, and it is installed on a separate handle. This protocol
  114. is used by the ConnectController() boot service to select the best driver
  115. for a controller. All of the drivers returned by this protocol have a
  116. higher precedence than drivers found from an EFI Bus Specific Driver
  117. Override Protocol or drivers found from the general UEFI driver Binding
  118. search algorithm. If more than one driver is returned by this protocol,
  119. then the drivers are returned in order from highest precedence to lowest
  120. precedence.
  121. Members:
  122. GetDriver - Stores a pointer to a function used to get an override driver
  123. for a controller.
  124. GetDriverPath - Stores a pointer to a function used to get a device path
  125. for an override driver.
  126. DriverLoaded - Stores a pointer to a function used to associate a loaded
  127. driver with a driver path returned by GetDriverPath.
  128. --*/
  129. struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL {
  130. EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER GetDriver;
  131. EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER_PATH GetDriverPath;
  132. EFI_PLATFORM_DRIVER_OVERRIDE_DRIVER_LOADED DriverLoaded;
  133. };
  134. //
  135. // -------------------------------------------------------------------- Globals
  136. //
  137. //
  138. // -------------------------------------------------------- Function Prototypes
  139. //