22 PciIoDevice->PciDriverOverride.GetDriver =
GetDriver;
45 Status =
gBS->LocateHandleBuffer (
47 &gEfiLoadedImageDevicePathProtocolGuid,
52 if (EFI_ERROR (Status)) {
59 for (Index = 0; Index < HandleNum; Index++) {
60 Status =
gBS->HandleProtocol (Handles[Index], &gEfiLoadedImageDevicePathProtocolGuid, (VOID **)&DevicePath);
61 if (EFI_ERROR (Status)) {
66 (
CompareMem (ImagePath, DevicePath, ImagePathSize) == 0)
69 ImageHandle = Handles[Index];
107 PciIoDevice = PCI_IO_DEVICE_FROM_PCI_DRIVER_OVERRIDE_THIS (This);
108 ReturnNext = (BOOLEAN)(*DriverImageHandle ==
NULL);
109 for ( Link =
GetFirstNode (&PciIoDevice->OptionRomDriverList)
110 ; !
IsNull (&PciIoDevice->OptionRomDriverList, Link)
111 ; Link =
GetNextNode (&PciIoDevice->OptionRomDriverList, Link)
114 Override = DRIVER_OVERRIDE_FROM_LINK (Link);
117 if (Override->DriverImageHandle ==
NULL) {
121 if (Override->DriverImageHandle ==
NULL) {
127 *DriverImageHandle = Override->DriverImageHandle;
132 if (*DriverImageHandle == Override->DriverImageHandle) {
137 ASSERT (
IsNull (&PciIoDevice->OptionRomDriverList, Link));
144 return EFI_NOT_FOUND;
146 return EFI_INVALID_PARAMETER;
174 ASSERT ((DriverImageHandle ==
NULL) || (DriverImagePath ==
NULL));
178 return EFI_OUT_OF_RESOURCES;
181 Node->Signature = DRIVER_OVERRIDE_SIGNATURE;
182 Node->DriverImageHandle = DriverImageHandle;
187 PciIoDevice->BusOverride =
TRUE;
BOOLEAN EFIAPI IsNull(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
LIST_ENTRY *EFIAPI GetNextNode(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
LIST_ENTRY *EFIAPI GetFirstNode(IN CONST LIST_ENTRY *List)
LIST_ENTRY *EFIAPI InsertTailList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
INTN EFIAPI CompareMem(IN CONST VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
UINTN EFIAPI GetDevicePathSize(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI DuplicateDevicePath(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID InitializePciDriverOverrideInstance(IN OUT PCI_IO_DEVICE *PciIoDevice)
EFI_STATUS AddDriver(IN PCI_IO_DEVICE *PciIoDevice, IN EFI_HANDLE DriverImageHandle, IN EFI_DEVICE_PATH_PROTOCOL *DriverImagePath)
EFI_STATUS EFIAPI GetDriver(IN EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL *This, IN OUT EFI_HANDLE *DriverImageHandle)
EFI_HANDLE LocateImageHandle(IN EFI_DEVICE_PATH_PROTOCOL *ImagePath)