iPXE
|
Xen device bus. More...
#include <stdio.h>
#include <errno.h>
#include <ipxe/malloc.h>
#include <ipxe/device.h>
#include <ipxe/timer.h>
#include <ipxe/nap.h>
#include <ipxe/xen.h>
#include <ipxe/xenstore.h>
#include <ipxe/xenbus.h>
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
int | xenbus_set_state (struct xen_device *xendev, int state) |
Set device state. More... | |
int | xenbus_backend_state (struct xen_device *xendev) |
Get backend state. More... | |
int | xenbus_backend_wait (struct xen_device *xendev, int state) |
Wait for backend to reach a given state. More... | |
static struct xen_driver * | xenbus_find_driver (const char *type) |
Find driver for Xen device. More... | |
static int | xenbus_probe_device (struct xen_hypervisor *xen, struct device *parent, const char *instance, struct xen_driver *driver) |
Probe Xen device. More... | |
static void | xenbus_remove_device (struct xen_device *xendev) |
Remove Xen device. More... | |
static int | xenbus_probe_type (struct xen_hypervisor *xen, struct device *parent, const char *type) |
Probe Xen devices of a given type. More... | |
int | xenbus_probe (struct xen_hypervisor *xen, struct device *parent) |
Probe Xen bus. More... | |
void | xenbus_remove (struct xen_hypervisor *xen __unused, struct device *parent) |
Remove Xen bus. More... | |
Xen device bus.
Definition in file xenbus.c.
#define ETIMEDOUT_UNKNOWN __einfo_error ( EINFO_ETIMEDOUT_UNKNOWN ) |
#define EINFO_ETIMEDOUT_UNKNOWN |
#define ETIMEDOUT_INITIALISING __einfo_error ( EINFO_ETIMEDOUT_INITIALISING ) |
#define EINFO_ETIMEDOUT_INITIALISING |
#define ETIMEDOUT_INITWAIT __einfo_error ( EINFO_ETIMEDOUT_INITWAIT ) |
#define EINFO_ETIMEDOUT_INITWAIT |
#define ETIMEDOUT_INITIALISED __einfo_error ( EINFO_ETIMEDOUT_INITIALISED ) |
#define EINFO_ETIMEDOUT_INITIALISED |
#define ETIMEDOUT_CONNECTED __einfo_error ( EINFO_ETIMEDOUT_CONNECTED ) |
#define EINFO_ETIMEDOUT_CONNECTED |
#define ETIMEDOUT_CLOSING __einfo_error ( EINFO_ETIMEDOUT_CLOSING ) |
#define EINFO_ETIMEDOUT_CLOSING |
#define ETIMEDOUT_CLOSED __einfo_error ( EINFO_ETIMEDOUT_CLOSED ) |
#define EINFO_ETIMEDOUT_CLOSED |
#define ETIMEDOUT_RECONFIGURING __einfo_error ( EINFO_ETIMEDOUT_RECONFIGURING ) |
#define EINFO_ETIMEDOUT_RECONFIGURING |
#define ETIMEDOUT_RECONFIGURED __einfo_error ( EINFO_ETIMEDOUT_RECONFIGURED ) |
#define EINFO_ETIMEDOUT_RECONFIGURED |
#define ETIMEDOUT_STATE | ( | state | ) |
#define XENBUS_BACKEND_TIMEOUT ( 5 * TICKS_PER_SEC ) |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
int xenbus_set_state | ( | struct xen_device * | xendev, |
int | state | ||
) |
Set device state.
xendev | Xen device |
state | New state |
rc | Return status code |
Definition at line 105 of file xenbus.c.
References DBGC, xen_device::key, NULL, rc, state, strerror(), xen_device::xen, and xenstore_write_num().
Referenced by netfront_open(), and netfront_reset().
int xenbus_backend_state | ( | struct xen_device * | xendev | ) |
Get backend state.
xendev | Xen device |
state | Backend state, or negative error |
Definition at line 125 of file xenbus.c.
References xen_device::backend, DBGC, xen_device::key, NULL, rc, state, strerror(), xen_device::xen, and xenstore_read_num().
Referenced by netfront_reset(), and xenbus_backend_wait().
int xenbus_backend_wait | ( | struct xen_device * | xendev, |
int | state | ||
) |
Wait for backend to reach a given state.
xendev | Xen device |
state | Desired backend state |
rc | Return status code |
Definition at line 147 of file xenbus.c.
References xen_device::backend, cpu_nap(), currticks(), DBGC, ETIMEDOUT_STATE, xen_device::key, rc, started, state, strerror(), xenbus_backend_state(), and XENBUS_BACKEND_TIMEOUT.
Referenced by netfront_open(), and netfront_reset().
|
static |
Find driver for Xen device.
type | Device type |
driver | Driver, or NULL |
Definition at line 194 of file xenbus.c.
References for_each_table_entry, NULL, strcmp(), type, xen_driver::type, and XEN_DRIVERS.
Referenced by xenbus_probe_type().
|
static |
Probe Xen device.
xen | Xen hypervisor |
parent | Parent device |
instance | Device instance |
driver | Device driver |
rc | Return status code |
Definition at line 213 of file xenbus.c.
References xen_device::backend, xen_device::backend_id, device_description::bus_type, BUS_TYPE_XEN, device::children, DBGC, device::desc, xen_device::dev, xen_device::driver, device::driver_name, ENOMEM, free, INIT_LIST_HEAD, xen_device::key, list_add_tail, list_del, xen_driver::name, device::name, NULL, device::parent, xen_driver::probe, rc, xen_driver::remove, device::siblings, snprintf(), strerror(), strlen(), type, xen_driver::type, xen_device::xen, xenstore_read(), xenstore_read_num(), and zalloc().
Referenced by xenbus_probe_type().
|
static |
Remove Xen device.
xendev | Xen device |
Definition at line 286 of file xenbus.c.
References xen_device::backend, xen_device::dev, xen_device::driver, free, list_del, xen_driver::remove, and device::siblings.
Referenced by xenbus_remove().
|
static |
Probe Xen devices of a given type.
xen | Xen hypervisor |
parent | Parent device |
type | Device type |
rc | Return status code |
Definition at line 303 of file xenbus.c.
References children, DBGC, free, len, NULL, rc, strerror(), strlen(), type, xenbus_find_driver(), xenbus_probe_device(), and xenstore_directory().
Referenced by xenbus_probe().
int xenbus_probe | ( | struct xen_hypervisor * | xen, |
struct device * | parent | ||
) |
Probe Xen bus.
xen | Xen hypervisor |
parent | Parent device |
rc | Return status code |
Definition at line 353 of file xenbus.c.
References DBGC, free, len, NULL, rc, strerror(), strlen(), type, xenbus_probe_type(), xenbus_remove(), and xenstore_directory().
Referenced by hvm_probe().
void xenbus_remove | ( | struct xen_hypervisor *xen | __unused, |
struct device * | parent | ||
) |
Remove Xen bus.
xen | Xen hypervisor |
parent | Parent device |
Definition at line 390 of file xenbus.c.
References device::children, xen_device::dev, list_for_each_entry_safe, device::siblings, tmp, and xenbus_remove_device().
Referenced by hvm_probe(), hvm_remove(), and xenbus_probe().