]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - drivers/xen/xenbus/xenbus.h
xen: clean up xenbus internal headers
[mirror_ubuntu-artful-kernel.git] / drivers / xen / xenbus / xenbus.h
1 /*
2 * Private include for xenbus communications.
3 *
4 * Copyright (C) 2005 Rusty Russell, IBM Corporation
5 * Copyright (C) 2005 XenSource Ltd.
6 *
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:
12 *
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:
19 *
20 * The above copyright notice and this permission notice shall be included in
21 * all copies or substantial portions of the Software.
22 *
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
29 * IN THE SOFTWARE.
30 */
31
32 #ifndef _XENBUS_XENBUS_H
33 #define _XENBUS_XENBUS_H
34
35 #define XEN_BUS_ID_SIZE 20
36
37 struct xen_bus_type {
38 char *root;
39 unsigned int levels;
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,
42 const char *dir);
43 void (*otherend_changed)(struct xenbus_watch *watch, const char **vec,
44 unsigned int len);
45 struct bus_type bus;
46 };
47
48 enum xenstore_init {
49 XS_UNKNOWN,
50 XS_PV,
51 XS_HVM,
52 XS_LOCAL,
53 };
54
55 extern enum xenstore_init xen_store_domain_type;
56 extern const struct attribute_group *xenbus_dev_groups[];
57
58 int xs_init(void);
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);
65
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,
71 struct module *owner,
72 const char *mod_name);
73 int xenbus_probe_node(struct xen_bus_type *bus,
74 const char *type,
75 const char *nodename);
76 int xenbus_probe_devices(struct xen_bus_type *bus);
77
78 void xenbus_dev_changed(const char *node, struct xen_bus_type *bus);
79
80 void xenbus_dev_shutdown(struct device *_dev);
81
82 int xenbus_dev_suspend(struct device *dev);
83 int xenbus_dev_resume(struct device *dev);
84 int xenbus_dev_cancel(struct device *dev);
85
86 void xenbus_otherend_changed(struct xenbus_watch *watch,
87 const char **vec, unsigned int len,
88 int ignore_on_shutdown);
89
90 int xenbus_read_otherend_details(struct xenbus_device *xendev,
91 char *id_node, char *path_node);
92
93 void xenbus_ring_ops_init(void);
94
95 void *xenbus_dev_request_and_reply(struct xsd_sockmsg *msg);
96
97 #endif