TianoCore EDK2 master
Loading...
Searching...
No Matches
XenIoPciDxe.c File Reference

Go to the source code of this file.

Macros

#define PCI_VENDOR_ID_XEN   0x5853
 
#define PCI_DEVICE_ID_XEN_PLATFORM   0x0001
 

Functions

STATIC EFI_STATUS EFIAPI XenIoPciDeviceBindingSupported (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE DeviceHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 
STATIC EFI_STATUS EFIAPI XenIoPciDeviceBindingStart (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE DeviceHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 
STATIC EFI_STATUS EFIAPI XenIoPciDeviceBindingStop (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE DeviceHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
 
EFI_STATUS EFIAPI XenIoPciGetDriverName (IN EFI_COMPONENT_NAME_PROTOCOL *This, IN CHAR8 *Language, OUT CHAR16 **DriverName)
 
EFI_STATUS EFIAPI XenIoPciGetDeviceName (IN EFI_COMPONENT_NAME_PROTOCOL *This, IN EFI_HANDLE DeviceHandle, IN EFI_HANDLE ChildHandle, IN CHAR8 *Language, OUT CHAR16 **ControllerName)
 
EFI_STATUS EFIAPI XenIoPciDeviceEntryPoint (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

STATIC EFI_DRIVER_BINDING_PROTOCOL gDriverBinding
 
STATIC EFI_UNICODE_STRING_TABLE mDriverNameTable []
 
STATIC EFI_COMPONENT_NAME_PROTOCOL gComponentName
 
STATIC EFI_COMPONENT_NAME2_PROTOCOL gComponentName2
 

Detailed Description

Driver for the virtual Xen PCI device

Copyright (C) 2012, Red Hat, Inc. Copyright (c) 2012 - 2016, Intel Corporation. All rights reserved.
Copyright (C) 2013, ARM Ltd. Copyright (C) 2015, Linaro Ltd.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file XenIoPciDxe.c.

Macro Definition Documentation

◆ PCI_DEVICE_ID_XEN_PLATFORM

#define PCI_DEVICE_ID_XEN_PLATFORM   0x0001

Definition at line 26 of file XenIoPciDxe.c.

◆ PCI_VENDOR_ID_XEN

#define PCI_VENDOR_ID_XEN   0x5853

Definition at line 25 of file XenIoPciDxe.c.

Function Documentation

◆ XenIoPciDeviceBindingStart()

STATIC EFI_STATUS EFIAPI XenIoPciDeviceBindingStart ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  DeviceHandle,
IN EFI_DEVICE_PATH_PROTOCOL RemainingDevicePath 
)

After we've pronounced support for a specific device in DriverBindingSupported(), we start managing said device (passed in by the Driver Execution Environment) with the following service.

See DriverBindingSupported() for specification references.

Parameters
[in]ThisThe EFI_DRIVER_BINDING_PROTOCOL object incorporating this driver (independently of any device).
[in]DeviceHandleThe supported device to drive.
[in]RemainingDevicePathRelevant only for bus drivers, ignored.
Return values
EFI_SUCCESSThe device was started.
EFI_OUT_OF_RESOURCESMemory allocation failed.
Returns
Error codes from the OpenProtocol() boot service, the PciIo protocol or the InstallProtocolInterface() boot service.

Definition at line 150 of file XenIoPciDxe.c.

◆ XenIoPciDeviceBindingStop()

STATIC EFI_STATUS EFIAPI XenIoPciDeviceBindingStop ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  DeviceHandle,
IN UINTN  NumberOfChildren,
IN EFI_HANDLE ChildHandleBuffer 
)

Stop driving the XenIo PCI device

Parameters
[in]ThisThe EFI_DRIVER_BINDING_PROTOCOL object incorporating this driver (independently of any device).
[in]DeviceHandleStop driving this device.
[in]NumberOfChildrenSince this function belongs to a device driver only (as opposed to a bus driver), the caller environment sets NumberOfChildren to zero, and we ignore it.
[in]ChildHandleBufferIgnored (corresponding to NumberOfChildren).
Return values
EFI_SUCCESSDriver instance has been stopped and the PCI configuration attributes have been restored.
Returns
Error codes from the OpenProtocol() or CloseProtocol(), UninstallProtocolInterface() boot services.

Definition at line 244 of file XenIoPciDxe.c.

◆ XenIoPciDeviceBindingSupported()

STATIC EFI_STATUS EFIAPI XenIoPciDeviceBindingSupported ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  DeviceHandle,
IN EFI_DEVICE_PATH_PROTOCOL RemainingDevicePath 
)

Device probe function for this driver.

The DXE core calls this function for any given device in order to see if the driver can drive the device.

Parameters
[in]ThisThe EFI_DRIVER_BINDING_PROTOCOL object incorporating this driver (independently of any device).
[in]DeviceHandleThe device to probe.
[in]RemainingDevicePathRelevant only for bus drivers, ignored.
Return values
EFI_SUCCESSThe driver supports the device being probed.
EFI_UNSUPPORTEDThe driver does not support the device being probed.
Returns
Error codes from the OpenProtocol() boot service or the PciIo protocol.

Definition at line 55 of file XenIoPciDxe.c.

◆ XenIoPciDeviceEntryPoint()

EFI_STATUS EFIAPI XenIoPciDeviceEntryPoint ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Definition at line 370 of file XenIoPciDxe.c.

◆ XenIoPciGetDeviceName()

EFI_STATUS EFIAPI XenIoPciGetDeviceName ( IN EFI_COMPONENT_NAME_PROTOCOL This,
IN EFI_HANDLE  DeviceHandle,
IN EFI_HANDLE  ChildHandle,
IN CHAR8 *  Language,
OUT CHAR16 **  ControllerName 
)

Definition at line 340 of file XenIoPciDxe.c.

◆ XenIoPciGetDriverName()

EFI_STATUS EFIAPI XenIoPciGetDriverName ( IN EFI_COMPONENT_NAME_PROTOCOL This,
IN CHAR8 *  Language,
OUT CHAR16 **  DriverName 
)

Definition at line 323 of file XenIoPciDxe.c.

Variable Documentation

◆ gComponentName

Initial value:
= {
&XenIoPciGetDriverName,
&XenIoPciGetDeviceName,
"eng"
}

Definition at line 319 of file XenIoPciDxe.c.

◆ gComponentName2

Initial value:
= {
(EFI_COMPONENT_NAME2_GET_DRIVER_NAME)&XenIoPciGetDriverName,
(EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME)&XenIoPciGetDeviceName,
"en"
}
EFI_STATUS(EFIAPI * EFI_COMPONENT_NAME2_GET_DRIVER_NAME)(IN EFI_COMPONENT_NAME2_PROTOCOL *This, IN CHAR8 *Language, OUT CHAR16 **DriverName)
EFI_STATUS(EFIAPI * EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME)(IN EFI_COMPONENT_NAME2_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE ChildHandle OPTIONAL, IN CHAR8 *Language, OUT CHAR16 **ControllerName)

Definition at line 359 of file XenIoPciDxe.c.

◆ gDriverBinding

Initial value:
= {
0x10,
NULL,
}
#define NULL
Definition: Base.h:319
STATIC EFI_STATUS EFIAPI XenIoPciDeviceBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE DeviceHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
Definition: XenIoPciDxe.c:55
STATIC EFI_STATUS EFIAPI XenIoPciDeviceBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE DeviceHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
Definition: XenIoPciDxe.c:150
STATIC EFI_STATUS EFIAPI XenIoPciDeviceBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE DeviceHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
Definition: XenIoPciDxe.c:244

Definition at line 295 of file XenIoPciDxe.c.

◆ mDriverNameTable

STATIC EFI_UNICODE_STRING_TABLE mDriverNameTable[]
Initial value:
= {
{ "eng;en", L"XenIo PCI Driver" },
{ NULL, NULL }
}

Definition at line 313 of file XenIoPciDxe.c.