2 * Private include for xenbus communications.
4 * Copyright (C) 2005 Rusty Russell, IBM Corporation
5 * Copyright (C) 2005 XenSource Ltd.
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License version 2
9 * as published by the Free Software Foundation; or, when distributed
10 * separately from the Linux kernel or incorporated into other
11 * software packages, subject to the following license:
13 * Permission is hereby granted, free of charge, to any person obtaining a copy
14 * of this source file (the "Software"), to deal in the Software without
15 * restriction, including without limitation the rights to use, copy, modify,
16 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
17 * and to permit persons to whom the Software is furnished to do so, subject to
18 * the following conditions:
20 * The above copyright notice and this permission notice shall be included in
21 * all copies or substantial portions of the Software.
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
32 #ifndef _XENBUS_XENBUS_H
33 #define _XENBUS_XENBUS_H
35 #define XEN_BUS_ID_SIZE 20
40 int (*get_bus_id
)(char bus_id
[XEN_BUS_ID_SIZE
], const char *nodename
);
41 int (*probe
)(struct xen_bus_type
*bus
, const char *type
,
43 void (*otherend_changed
)(struct xenbus_watch
*watch
, const char **vec
,
55 extern enum xenstore_init xen_store_domain_type
;
56 extern const struct attribute_group
*xenbus_dev_groups
[];
59 int xb_init_comms(void);
60 void xb_deinit_comms(void);
61 int xb_write(const void *data
, unsigned int len
);
62 int xb_read(void *data
, unsigned int len
);
63 int xb_data_to_read(void);
64 int xb_wait_for_data_to_read(void);
66 int xenbus_match(struct device
*_dev
, struct device_driver
*_drv
);
67 int xenbus_dev_probe(struct device
*_dev
);
68 int xenbus_dev_remove(struct device
*_dev
);
69 int xenbus_register_driver_common(struct xenbus_driver
*drv
,
70 struct xen_bus_type
*bus
,
72 const char *mod_name
);
73 int xenbus_probe_node(struct xen_bus_type
*bus
,
75 const char *nodename
);
76 int xenbus_probe_devices(struct xen_bus_type
*bus
);
78 void xenbus_dev_changed(const char *node
, struct xen_bus_type
*bus
);
80 void xenbus_dev_shutdown(struct device
*_dev
);
82 int xenbus_dev_suspend(struct device
*dev
);
83 int xenbus_dev_resume(struct device
*dev
);
84 int xenbus_dev_cancel(struct device
*dev
);
86 void xenbus_otherend_changed(struct xenbus_watch
*watch
,
87 const char **vec
, unsigned int len
,
88 int ignore_on_shutdown
);
90 int xenbus_read_otherend_details(struct xenbus_device
*xendev
,
91 char *id_node
, char *path_node
);
93 void xenbus_ring_ops_init(void);
95 void *xenbus_dev_request_and_reply(struct xsd_sockmsg
*msg
);