TianoCore EDK2 master
|
#include <Library/DevicePathLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/PrintLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
#include <Protocol/ComponentName2.h>
#include <Protocol/DevicePath.h>
#include <Protocol/DriverBinding.h>
#include <Protocol/PciIo.h>
#include "VirtioGpu.h"
Go to the source code of this file.
Implement the Driver Binding Protocol and the Component Name 2 Protocol for the Virtio GPU hybrid driver.
Copyright (C) 2016, Red Hat, Inc.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file DriverBinding.c.
STATIC EFI_STATUS FormatVgpuDevName | ( | IN EFI_HANDLE | ControllerHandle, |
IN EFI_HANDLE | AgentHandle, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath, | ||
OUT CHAR16 ** | ControllerName | ||
) |
Format the VGPU_DEV controller name, to be looked up and returned by VirtioGpuGetControllerName().
[in] | ControllerHandle | The handle that identifies the VGPU_DEV controller. |
[in] | AgentHandle | The handle of the agent that will attempt to temporarily open the PciIo protocol. This is the DriverBindingHandle member of the EFI_DRIVER_BINDING_PROTOCOL whose Start() function is calling this function. |
[in] | DevicePath | The device path that is installed on ControllerHandle. |
[out] | ControllerName | A dynamically allocated unicode string that unconditionally says "Virtio GPU Device", with a PCI Segment:Bus:Device.Function location optionally appended. The latter part is only produced if DevicePath contains at least one PciIo node; in that case, the most specific such node is used for retrieving the location info. The caller is responsible for freeing ControllerName after use. |
EFI_SUCCESS | ControllerName has been formatted. |
EFI_OUT_OF_RESOURCES | Failed to allocate memory for ControllerName. |
Definition at line 205 of file DriverBinding.c.
STATIC EFI_STATUS InitVgpuGop | ( | IN OUT VGPU_DEV * | ParentBus, |
IN EFI_DEVICE_PATH_PROTOCOL * | ParentDevicePath, | ||
IN EFI_HANDLE | ParentBusController, | ||
IN EFI_HANDLE | DriverBindingHandle | ||
) |
Dynamically allocate and initialize the VGPU_GOP child object within an otherwise configured parent VGPU_DEV object.
This function adds a BY_CHILD_CONTROLLER reference to ParentBusController's VIRTIO_DEVICE_PROTOCOL interface.
[in,out] | ParentBus | The pre-initialized VGPU_DEV object that the newly created VGPU_GOP object will be the child of. |
[in] | ParentDevicePath | The device path protocol instance that is installed on ParentBusController. |
[in] | ParentBusController | The UEFI controller handle on which the ParentBus VGPU_DEV object and the ParentDevicePath device path protocol are installed. |
[in] | DriverBindingHandle | The DriverBindingHandle member of EFI_DRIVER_BINDING_PROTOCOL whose Start() function is calling this function. It is passed as AgentHandle to gBS->OpenProtocol() when creating the BY_CHILD_CONTROLLER reference. |
EFI_SUCCESS | ParentBus->Child has been created and populated, and ParentBus->Child->GopHandle now references ParentBusController->VirtIo BY_CHILD_CONTROLLER. |
EFI_OUT_OF_RESOURCES | Memory allocation failed. |
Definition at line 319 of file DriverBinding.c.
STATIC VOID UninitVgpuGop | ( | IN OUT VGPU_DEV * | ParentBus, |
IN EFI_HANDLE | ParentBusController, | ||
IN EFI_HANDLE | DriverBindingHandle | ||
) |
Tear down and release the VGPU_GOP child object within the VGPU_DEV parent object.
This function removes the BY_CHILD_CONTROLLER reference from ParentBusController's VIRTIO_DEVICE_PROTOCOL interface.
[in,out] | ParentBus | The VGPU_DEV object that the VGPU_GOP child object will be removed from. |
[in] | ParentBusController | The UEFI controller handle on which the ParentBus VGPU_DEV object is installed. |
[in] | DriverBindingHandle | The DriverBindingHandle member of EFI_DRIVER_BINDING_PROTOCOL whose Stop() function is calling this function. It is passed as AgentHandle to gBS->CloseProtocol() when removing the BY_CHILD_CONTROLLER reference. |
Definition at line 509 of file DriverBinding.c.
STATIC EFI_STATUS EFIAPI VirtioGpuDriverBindingStart | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath | OPTIONAL | ||
) |
Definition at line 666 of file DriverBinding.c.
STATIC EFI_STATUS EFIAPI VirtioGpuDriverBindingStop | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN UINTN | NumberOfChildren, | ||
IN EFI_HANDLE *ChildHandleBuffer | OPTIONAL | ||
) |
Definition at line 902 of file DriverBinding.c.
STATIC EFI_STATUS EFIAPI VirtioGpuDriverBindingSupported | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath | OPTIONAL | ||
) |
Definition at line 559 of file DriverBinding.c.
EFI_STATUS EFIAPI VirtioGpuEntryPoint | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Definition at line 1044 of file DriverBinding.c.
STATIC EFI_STATUS EFIAPI VirtioGpuGetControllerName | ( | IN EFI_COMPONENT_NAME2_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN EFI_HANDLE ChildHandle | OPTIONAL, | ||
IN CHAR8 * | Language, | ||
OUT CHAR16 ** | ControllerName | ||
) |
Definition at line 81 of file DriverBinding.c.
STATIC EFI_STATUS EFIAPI VirtioGpuGetDriverName | ( | IN EFI_COMPONENT_NAME2_PROTOCOL * | This, |
IN CHAR8 * | Language, | ||
OUT CHAR16 ** | DriverName | ||
) |
Definition at line 63 of file DriverBinding.c.
STATIC CONST ACPI_ADR_DEVICE_PATH mAcpiAdr |
Definition at line 32 of file DriverBinding.c.
STATIC CONST EFI_COMPONENT_NAME2_PROTOCOL mComponentName2 |
Definition at line 163 of file DriverBinding.c.
STATIC EFI_DRIVER_BINDING_PROTOCOL mDriverBinding |
Definition at line 1030 of file DriverBinding.c.
STATIC CONST EFI_UNICODE_STRING_TABLE mDriverNameTable[] |
Definition at line 55 of file DriverBinding.c.