10
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
12
#include <ipxe/device.h>
13
#include <ipxe/tables.h>
15
#include <xen/io/xenbus.h>
19
/** Generic iPXE device */
22
struct xen_hypervisor *xen;
25
/** Backend XenStore key */
27
/** Backend domain ID */
28
unsigned long backend_id;
30
struct xen_driver *driver;
31
/** Driver-private data */
35
/** A Xen device driver */
43
* @v xendev Xen device
44
* @ret rc Return status code
46
int ( * probe ) ( struct xen_device *xendev );
49
* @v xendev Xen device
51
void ( * remove ) ( struct xen_device *xendev );
54
/** Xen device driver table */
55
#define XEN_DRIVERS __table ( struct xen_driver, "xen_drivers" )
57
/** Declare a Xen device driver */
58
#define __xen_driver __table_entry ( XEN_DRIVERS, 01 )
61
* Set Xen device driver-private data
63
* @v xendev Xen device
64
* @v priv Private data
66
static inline void xen_set_drvdata ( struct xen_device *xendev, void *priv ) {
71
* Get Xen device driver-private data
73
* @v xendev Xen device
74
* @ret priv Private data
76
static inline void * xen_get_drvdata ( struct xen_device *xendev ) {
80
extern int xenbus_set_state ( struct xen_device *xendev, int state );
81
extern int xenbus_backend_state ( struct xen_device *xendev );
82
extern int xenbus_backend_wait ( struct xen_device *xendev, int state );
83
extern int xenbus_probe ( struct xen_hypervisor *xen, struct device *parent );
84
extern void xenbus_remove ( struct xen_hypervisor *xen, struct device *parent );
86
#endif /* _IPXE_XENBUS_H */