On 10/26/17 00:20, Nikolay Bodunov wrote:
>
> 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?
There's no mistake, it just means that the ControllerHandle passed to
the function does not support the PciIo interface.
Please read "Driver Writer’s Guide for UEFI 2.3.1", sections:
- 6 UEFI Driver Categories
- 7.2 UEFI Driver Model
- 18 PCI Driver Design Guidelines
https://github.com/tianocore/tianocore.github.io/wiki/UEFI-Driver-Writer%27s-Guide
Thanks
Laszlo
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel