TianoCore EDK2 master
Loading...
Searching...
No Matches
XenBus.c File Reference
#include <Library/PrintLib.h>
#include "XenBus.h"
#include "GrantTable.h"
#include "XenStore.h"
#include "EventChannel.h"
#include <IndustryStandard/Xen/io/xenbus.h>

Go to the source code of this file.

Functions

STATIC XENBUS_PRIVATE_DATAXenBusDeviceInitialized (IN XENBUS_DEVICE *Dev, IN CONST CHAR8 *Node)
 
STATIC XenbusState XenBusReadDriverState (IN CONST CHAR8 *Path)
 
STATIC EFI_STATUS XenBusAddDevice (XENBUS_DEVICE *Dev, CONST CHAR8 *Type, CONST CHAR8 *Id)
 
STATIC VOID XenBusEnumerateDeviceType (XENBUS_DEVICE *Dev, CONST CHAR8 *Type)
 
XENSTORE_STATUS XenBusEnumerateBus (XENBUS_DEVICE *Dev)
 
STATIC XENSTORE_STATUS EFIAPI XenBusSetState (IN XENBUS_PROTOCOL *This, IN CONST XENSTORE_TRANSACTION *Transaction, IN enum xenbus_state NewState)
 

Variables

STATIC XENBUS_PRIVATE_DATA gXenBusPrivateData
 
STATIC XENBUS_DEVICE_PATH gXenBusDevicePathTemplate
 

Detailed Description

XenBus Bus driver implementation.

This file implement the necessary to discover and enumerate Xen PV devices through XenStore.

Copyright (C) 2010 Spectra Logic Corporation Copyright (C) 2008 Doug Rabson Copyright (C) 2005 Rusty Russell, IBM Corporation Copyright (C) 2005 Mike Wray, Hewlett-Packard Copyright (C) 2005 XenSource Ltd Copyright (C) 2014, Citrix Ltd.

This file may be distributed separately from the Linux kernel, or incorporated into other software packages, subject to the following license:

SPDX-License-Identifier: MIT

Definition in file XenBus.c.

Function Documentation

◆ XenBusAddDevice()

STATIC EFI_STATUS XenBusAddDevice ( XENBUS_DEVICE Dev,
CONST CHAR8 *  Type,
CONST CHAR8 *  Id 
)

Definition at line 115 of file XenBus.c.

◆ XenBusDeviceInitialized()

STATIC XENBUS_PRIVATE_DATA * XenBusDeviceInitialized ( IN XENBUS_DEVICE Dev,
IN CONST CHAR8 *  Node 
)

Search our internal record of configured devices (not the XenStore) to determine if the XenBus device indicated by Node is known to the system.

Parameters
DevThe XENBUS_DEVICE instance to search for device children.
NodeThe XenStore node path for the device to find.
Returns
The XENBUS_PRIVATE_DATA of the found device if any, or NULL.

Definition at line 58 of file XenBus.c.

◆ XenBusEnumerateBus()

XENSTORE_STATUS XenBusEnumerateBus ( XENBUS_DEVICE Dev)

Enumerate the devices on a XenBus bus and install a XenBus Protocol instance.

Caller should ensure that it is the only one to call this function. This function cannot be called concurrently.

Parameters
DevA XENBUS_DEVICE instance.
Returns
On success, XENSTORE_STATUS_SUCCESS. Otherwise an errno value indicating the type of failure.

Definition at line 313 of file XenBus.c.

◆ XenBusEnumerateDeviceType()

STATIC VOID XenBusEnumerateDeviceType ( XENBUS_DEVICE Dev,
CONST CHAR8 *  Type 
)

Enumerate all devices of the given type on this bus.

Parameters
DevA XENBUS_DEVICE instance.
TypeString indicating the device sub-tree (e.g. "vfb", "vif") to enumerate.

Devices that are found are been initialize via XenBusAddDevice (). XenBusAddDevice () ignores duplicate detects and ignores duplicate devices, so it can be called unconditionally for any device found in the XenStore.

Definition at line 273 of file XenBus.c.

◆ XenBusReadDriverState()

STATIC XenbusState XenBusReadDriverState ( IN CONST CHAR8 *  Path)

Definition at line 88 of file XenBus.c.

◆ XenBusSetState()

STATIC XENSTORE_STATUS EFIAPI XenBusSetState ( IN XENBUS_PROTOCOL This,
IN CONST XENSTORE_TRANSACTION Transaction,
IN enum xenbus_state  NewState 
)

Definition at line 345 of file XenBus.c.

Variable Documentation

◆ gXenBusDevicePathTemplate

STATIC XENBUS_DEVICE_PATH gXenBusDevicePathTemplate
Initial value:
= {
{
{
{
(UINT8)(sizeof (XENBUS_DEVICE_PATH)),
(UINT8)(sizeof (XENBUS_DEVICE_PATH) >> 8),
}
},
XENBUS_PROTOCOL_GUID,
},
0,
0
}
#define HARDWARE_DEVICE_PATH
Definition: DevicePath.h:68
#define HW_VENDOR_DP
Definition: DevicePath.h:133

Definition at line 31 of file XenBus.c.

◆ gXenBusPrivateData

STATIC XENBUS_PRIVATE_DATA gXenBusPrivateData

Definition at line 29 of file XenBus.c.