Browse Source

This patch adds protocol definitions (and the corresponding global
EFI_GUID instances) for EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL,
EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL, and
EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL, used in the driver
binding search procedure to select which driver to connect when
multiple drivers' Supported() functions indicate support for
the same controller.

Signed-off-by: Nathan Blythe <nblythe@lgsinnovations.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>

Nigel Croxon 9 years ago
parent
commit
63213a7b4e
3 changed files with 81 additions and 0 deletions
  1. 3 0
      inc/efilib.h
  2. 75 0
      inc/efiprot.h
  3. 3 0
      lib/data.c

+ 3 - 0
inc/efilib.h

@@ -65,6 +65,9 @@ extern EFI_GUID ComponentNameProtocol;
 extern EFI_GUID ComponentName2Protocol;
 extern EFI_GUID LoadedImageProtocol;
 extern EFI_GUID HashProtocol;
+extern EFI_GUID PlatformDriverOverrideProtocol;
+extern EFI_GUID BusSpecificDriverOverrideProtocol;
+extern EFI_GUID DriverFamilyOverrideProtocol;
 
 extern EFI_GUID EfiGlobalVariable;
 extern EFI_GUID GenericFileInfo;

+ 75 - 0
inc/efiprot.h

@@ -1017,5 +1017,80 @@ typedef struct _EFI_RNG_PROTOCOL {
 } EFI_RNG_PROTOCOL;
 
 
+//
+// EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL
+//
+
+#define EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_GUID          \
+          { 0x6b30c738, 0xa391, 0x11d4, {0x9a, 0x3b, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
+
+INTERFACE_DECL(_EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER) (
+IN      struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL  *This,
+IN      EFI_HANDLE                                      ControllerHandle,
+IN OUT  EFI_HANDLE                                     *DriverImageHandle);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER_PATH) (
+IN      struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL  *This,
+IN      EFI_HANDLE                                      ControllerHandle,
+IN OUT  EFI_DEVICE_PATH                               **DriverImagePath);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_DRIVER_LOADED) (
+IN      struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL  *This,
+IN      EFI_HANDLE                                      ControllerHandle,
+IN      EFI_DEVICE_PATH                                *DriverImagePath,
+IN      EFI_HANDLE                                      DriverImageHandle);
+
+typedef struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL {
+  EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER       GetDriver;
+  EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER_PATH  GetDriverPath;
+  EFI_PLATFORM_DRIVER_OVERRIDE_DRIVER_LOADED    DriverLoaded;
+} EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL;
+
+//
+// EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL
+//
+
+#define EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_GUID          \
+          { 0x3bc1b285, 0x8a15, 0x4a82, {0xaa, 0xbf, 0x4d, 0x7d, 0x13, 0xfb, 0x32, 0x65} }
+
+INTERFACE_DECL(_EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_GET_DRIVER) (
+IN      struct _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL  *This,
+IN OUT  EFI_HANDLE                                         *DriverImageHandle);
+
+typedef struct _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL {
+  EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_GET_DRIVER       GetDriver;
+} EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL;
+
+//
+// EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL
+//
+
+#define EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL_GUID          \
+          { 0xb1ee129e, 0xda36, 0x4181, {0x91, 0xf8, 0x04, 0xa4, 0x92, 0x37, 0x66, 0xa7} }
+
+INTERFACE_DECL(_EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL);
+
+typedef
+UINT32
+(EFIAPI *EFI_DRIVER_FAMILY_OVERRIDE_GET_VERSION) (
+IN      struct _EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL  *This);
+
+typedef struct _EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL {
+  EFI_DRIVER_FAMILY_OVERRIDE_GET_VERSION       GetVersion;
+} EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL;
+
+
 #endif
 

+ 3 - 0
lib/data.c

@@ -108,6 +108,9 @@ EFI_GUID DriverBindingProtocol    = DRIVER_BINDING_PROTOCOL;
 EFI_GUID ComponentNameProtocol    = COMPONENT_NAME_PROTOCOL;
 EFI_GUID ComponentName2Protocol   = COMPONENT_NAME2_PROTOCOL;
 EFI_GUID HashProtocol             = HASH_PROTOCOL;
+EFI_GUID PlatformDriverOverrideProtocol     = EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_GUID;
+EFI_GUID BusSpecificDriverOverrideProtocol  = EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_GUID;
+EFI_GUID DriverFamilyOverrideProtocol       = EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL_GUID;
 
 //
 // File system information IDs