public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* Can't open PciIo protocol in both qemu (Nt32Pkg) and VirtualBox EFI
@ 2017-10-25 22:20 Nikolay Bodunov
  2017-10-26 10:33 ` Laszlo Ersek
  0 siblings, 1 reply; 2+ messages in thread
From: Nikolay Bodunov @ 2017-10-25 22:20 UTC (permalink / raw)
  To: edk2-devel


Hello

I try to make work a code from "UEFI Driver Writer Guide", but always receive EFI_UNSUPPORTED status:

EFI_STATUS
EFIAPI
PciDriverOnlyDriverBindingSupported (
  IN EFI_DRIVER_BINDING_PROTOCOL  *This,
  IN EFI_HANDLE                   ControllerHandle,
  IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath OPTIONAL
  )
{
    EFI_STATUS                       Status;
    EFI_PCI_IO_PROTOCOL        *PciIo;
    Status = gBS->OpenProtocol (
        ControllerHandle,
        &gEfiPciIoProtocolGuid,
        (VOID **)&PciIo,
        This->DriverBindingHandle,
        ControllerHandle,
        EFI_OPEN_PROTOCOL_BY_DRIVER 
        );
    DEBUG((EFI_D_INFO, "Status is %r \r\n", Status));
    if (EFI_ERROR (Status)) {
        return Status;
    }
    return EFI_SUCCESS;
}

However, for example, with EFI_SIMPLE_FILE_SYSTEM_PROTOCOL instead of  EFI_PCI_IO_PROTOCOL  OpenProtocol() works fine and returns EFI_SUCCESS.

Driver project was created with UEFI Driver Wizard. Inf file contains gEfiPciIoProtocolGuid.
Where I could make a mistake?

WBR,
John

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-26 10:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-25 22:20 Can't open PciIo protocol in both qemu (Nt32Pkg) and VirtualBox EFI Nikolay Bodunov
2017-10-26 10:33 ` Laszlo Ersek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox