diff options
author | Juergen Gross <jgross@suse.com> | 2017-02-09 08:39:56 -0500 |
---|---|---|
committer | Boris Ostrovsky <boris.ostrovsky@oracle.com> | 2017-02-09 11:26:49 -0500 |
commit | 332f791dc98d98116f4473b726f67c9321b0f31e (patch) | |
tree | 7ec64588dcd472189bd00306f89800a0f8c6703c /drivers/xen | |
parent | c0d197d55e8e8aeeea55f79bdf67e1c957bfa25d (diff) |
xen: clean up xenbus internal headers
The xenbus driver has an awful mixture of internally and globally
visible headers: some of the internally used only stuff is defined in
the global header include/xen/xenbus.h while some stuff defined in
internal headers is used by other drivers, too.
Clean this up by moving the externally used symbols to
include/xen/xenbus.h and the symbols used internally only to a new
header drivers/xen/xenbus/xenbus.h replacing xenbus_comms.h and
xenbus_probe.h
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Diffstat (limited to 'drivers/xen')
-rw-r--r-- | drivers/xen/xenbus/xenbus.h (renamed from drivers/xen/xenbus/xenbus_probe.h) | 63 | ||||
-rw-r--r-- | drivers/xen/xenbus/xenbus_client.c | 2 | ||||
-rw-r--r-- | drivers/xen/xenbus/xenbus_comms.c | 2 | ||||
-rw-r--r-- | drivers/xen/xenbus/xenbus_comms.h | 51 | ||||
-rw-r--r-- | drivers/xen/xenbus/xenbus_dev_backend.c | 2 | ||||
-rw-r--r-- | drivers/xen/xenbus/xenbus_dev_frontend.c | 4 | ||||
-rw-r--r-- | drivers/xen/xenbus/xenbus_probe.c | 3 | ||||
-rw-r--r-- | drivers/xen/xenbus/xenbus_probe_backend.c | 3 | ||||
-rw-r--r-- | drivers/xen/xenbus/xenbus_probe_frontend.c | 3 | ||||
-rw-r--r-- | drivers/xen/xenbus/xenbus_xs.c | 3 | ||||
-rw-r--r-- | drivers/xen/xenfs/super.c | 2 | ||||
-rw-r--r-- | drivers/xen/xenfs/xenstored.c | 2 |
12 files changed, 47 insertions, 93 deletions
diff --git a/drivers/xen/xenbus/xenbus_probe.h b/drivers/xen/xenbus/xenbus.h index c9ec7ca1f7ab..a6b007dfdaa8 100644 --- a/drivers/xen/xenbus/xenbus_probe.h +++ b/drivers/xen/xenbus/xenbus.h | |||
@@ -1,7 +1,5 @@ | |||
1 | /****************************************************************************** | 1 | /* |
2 | * xenbus_probe.h | 2 | * Private include for xenbus communications. |
3 | * | ||
4 | * Talks to Xen Store to figure out what devices we have. | ||
5 | * | 3 | * |
6 | * Copyright (C) 2005 Rusty Russell, IBM Corporation | 4 | * Copyright (C) 2005 Rusty Russell, IBM Corporation |
7 | * Copyright (C) 2005 XenSource Ltd. | 5 | * Copyright (C) 2005 XenSource Ltd. |
@@ -31,8 +29,8 @@ | |||
31 | * IN THE SOFTWARE. | 29 | * IN THE SOFTWARE. |
32 | */ | 30 | */ |
33 | 31 | ||
34 | #ifndef _XENBUS_PROBE_H | 32 | #ifndef _XENBUS_XENBUS_H |
35 | #define _XENBUS_PROBE_H | 33 | #define _XENBUS_XENBUS_H |
36 | 34 | ||
37 | #define XEN_BUS_ID_SIZE 20 | 35 | #define XEN_BUS_ID_SIZE 20 |
38 | 36 | ||
@@ -54,35 +52,46 @@ enum xenstore_init { | |||
54 | XS_LOCAL, | 52 | XS_LOCAL, |
55 | }; | 53 | }; |
56 | 54 | ||
55 | extern enum xenstore_init xen_store_domain_type; | ||
57 | extern const struct attribute_group *xenbus_dev_groups[]; | 56 | extern const struct attribute_group *xenbus_dev_groups[]; |
58 | 57 | ||
59 | extern int xenbus_match(struct device *_dev, struct device_driver *_drv); | 58 | int xs_init(void); |
60 | extern int xenbus_dev_probe(struct device *_dev); | 59 | int xb_init_comms(void); |
61 | extern int xenbus_dev_remove(struct device *_dev); | 60 | void xb_deinit_comms(void); |
62 | extern int xenbus_register_driver_common(struct xenbus_driver *drv, | 61 | int xb_write(const void *data, unsigned int len); |
63 | struct xen_bus_type *bus, | 62 | int xb_read(void *data, unsigned int len); |
64 | struct module *owner, | 63 | int xb_data_to_read(void); |
65 | const char *mod_name); | 64 | int xb_wait_for_data_to_read(void); |
66 | extern int xenbus_probe_node(struct xen_bus_type *bus, | 65 | |
67 | const char *type, | 66 | int xenbus_match(struct device *_dev, struct device_driver *_drv); |
68 | const char *nodename); | 67 | int xenbus_dev_probe(struct device *_dev); |
69 | extern int xenbus_probe_devices(struct xen_bus_type *bus); | 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); | ||
70 | 77 | ||
71 | extern void xenbus_dev_changed(const char *node, struct xen_bus_type *bus); | 78 | void xenbus_dev_changed(const char *node, struct xen_bus_type *bus); |
72 | 79 | ||
73 | extern void xenbus_dev_shutdown(struct device *_dev); | 80 | void xenbus_dev_shutdown(struct device *_dev); |
74 | 81 | ||
75 | extern int xenbus_dev_suspend(struct device *dev); | 82 | int xenbus_dev_suspend(struct device *dev); |
76 | extern int xenbus_dev_resume(struct device *dev); | 83 | int xenbus_dev_resume(struct device *dev); |
77 | extern int xenbus_dev_cancel(struct device *dev); | 84 | int xenbus_dev_cancel(struct device *dev); |
78 | 85 | ||
79 | extern void xenbus_otherend_changed(struct xenbus_watch *watch, | 86 | void xenbus_otherend_changed(struct xenbus_watch *watch, |
80 | const char **vec, unsigned int len, | 87 | const char **vec, unsigned int len, |
81 | int ignore_on_shutdown); | 88 | int ignore_on_shutdown); |
82 | 89 | ||
83 | extern int xenbus_read_otherend_details(struct xenbus_device *xendev, | 90 | int xenbus_read_otherend_details(struct xenbus_device *xendev, |
84 | char *id_node, char *path_node); | 91 | char *id_node, char *path_node); |
85 | 92 | ||
86 | void xenbus_ring_ops_init(void); | 93 | void xenbus_ring_ops_init(void); |
87 | 94 | ||
95 | void *xenbus_dev_request_and_reply(struct xsd_sockmsg *msg); | ||
96 | |||
88 | #endif | 97 | #endif |
diff --git a/drivers/xen/xenbus/xenbus_client.c b/drivers/xen/xenbus/xenbus_client.c index 915d77785193..29f82338ab75 100644 --- a/drivers/xen/xenbus/xenbus_client.c +++ b/drivers/xen/xenbus/xenbus_client.c | |||
@@ -47,7 +47,7 @@ | |||
47 | #include <xen/xen.h> | 47 | #include <xen/xen.h> |
48 | #include <xen/features.h> | 48 | #include <xen/features.h> |
49 | 49 | ||
50 | #include "xenbus_probe.h" | 50 | #include "xenbus.h" |
51 | 51 | ||
52 | #define XENBUS_PAGES(_grants) (DIV_ROUND_UP(_grants, XEN_PFN_PER_PAGE)) | 52 | #define XENBUS_PAGES(_grants) (DIV_ROUND_UP(_grants, XEN_PFN_PER_PAGE)) |
53 | 53 | ||
diff --git a/drivers/xen/xenbus/xenbus_comms.c b/drivers/xen/xenbus/xenbus_comms.c index ecdecce80a6c..c21ec02643e1 100644 --- a/drivers/xen/xenbus/xenbus_comms.c +++ b/drivers/xen/xenbus/xenbus_comms.c | |||
@@ -40,7 +40,7 @@ | |||
40 | #include <asm/xen/hypervisor.h> | 40 | #include <asm/xen/hypervisor.h> |
41 | #include <xen/events.h> | 41 | #include <xen/events.h> |
42 | #include <xen/page.h> | 42 | #include <xen/page.h> |
43 | #include "xenbus_comms.h" | 43 | #include "xenbus.h" |
44 | 44 | ||
45 | static int xenbus_irq; | 45 | static int xenbus_irq; |
46 | 46 | ||
diff --git a/drivers/xen/xenbus/xenbus_comms.h b/drivers/xen/xenbus/xenbus_comms.h deleted file mode 100644 index 867a2e425208..000000000000 --- a/drivers/xen/xenbus/xenbus_comms.h +++ /dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | /* | ||
2 | * Private include for xenbus communications. | ||
3 | * | ||
4 | * Copyright (C) 2005 Rusty Russell, IBM Corporation | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License version 2 | ||
8 | * as published by the Free Software Foundation; or, when distributed | ||
9 | * separately from the Linux kernel or incorporated into other | ||
10 | * software packages, subject to the following license: | ||
11 | * | ||
12 | * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
13 | * of this source file (the "Software"), to deal in the Software without | ||
14 | * restriction, including without limitation the rights to use, copy, modify, | ||
15 | * merge, publish, distribute, sublicense, and/or sell copies of the Software, | ||
16 | * and to permit persons to whom the Software is furnished to do so, subject to | ||
17 | * the following conditions: | ||
18 | * | ||
19 | * The above copyright notice and this permission notice shall be included in | ||
20 | * all copies or substantial portions of the Software. | ||
21 | * | ||
22 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
23 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
24 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
25 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
26 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
27 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
28 | * IN THE SOFTWARE. | ||
29 | */ | ||
30 | |||
31 | #ifndef _XENBUS_COMMS_H | ||
32 | #define _XENBUS_COMMS_H | ||
33 | |||
34 | #include <linux/fs.h> | ||
35 | |||
36 | int xs_init(void); | ||
37 | int xb_init_comms(void); | ||
38 | void xb_deinit_comms(void); | ||
39 | |||
40 | /* Low level routines. */ | ||
41 | int xb_write(const void *data, unsigned len); | ||
42 | int xb_read(void *data, unsigned len); | ||
43 | int xb_data_to_read(void); | ||
44 | int xb_wait_for_data_to_read(void); | ||
45 | extern struct xenstore_domain_interface *xen_store_interface; | ||
46 | extern int xen_store_evtchn; | ||
47 | extern enum xenstore_init xen_store_domain_type; | ||
48 | |||
49 | extern const struct file_operations xen_xenbus_fops; | ||
50 | |||
51 | #endif /* _XENBUS_COMMS_H */ | ||
diff --git a/drivers/xen/xenbus/xenbus_dev_backend.c b/drivers/xen/xenbus/xenbus_dev_backend.c index 4a41ac9af966..1126701e212e 100644 --- a/drivers/xen/xenbus/xenbus_dev_backend.c +++ b/drivers/xen/xenbus/xenbus_dev_backend.c | |||
@@ -16,7 +16,7 @@ | |||
16 | #include <xen/events.h> | 16 | #include <xen/events.h> |
17 | #include <asm/xen/hypervisor.h> | 17 | #include <asm/xen/hypervisor.h> |
18 | 18 | ||
19 | #include "xenbus_comms.h" | 19 | #include "xenbus.h" |
20 | 20 | ||
21 | static int xenbus_backend_open(struct inode *inode, struct file *filp) | 21 | static int xenbus_backend_open(struct inode *inode, struct file *filp) |
22 | { | 22 | { |
diff --git a/drivers/xen/xenbus/xenbus_dev_frontend.c b/drivers/xen/xenbus/xenbus_dev_frontend.c index 79130b310247..e2bc9b301494 100644 --- a/drivers/xen/xenbus/xenbus_dev_frontend.c +++ b/drivers/xen/xenbus/xenbus_dev_frontend.c | |||
@@ -57,12 +57,12 @@ | |||
57 | #include <linux/miscdevice.h> | 57 | #include <linux/miscdevice.h> |
58 | #include <linux/init.h> | 58 | #include <linux/init.h> |
59 | 59 | ||
60 | #include "xenbus_comms.h" | ||
61 | |||
62 | #include <xen/xenbus.h> | 60 | #include <xen/xenbus.h> |
63 | #include <xen/xen.h> | 61 | #include <xen/xen.h> |
64 | #include <asm/xen/hypervisor.h> | 62 | #include <asm/xen/hypervisor.h> |
65 | 63 | ||
64 | #include "xenbus.h" | ||
65 | |||
66 | /* | 66 | /* |
67 | * An element of a list of outstanding transactions, for which we're | 67 | * An element of a list of outstanding transactions, for which we're |
68 | * still waiting a reply. | 68 | * still waiting a reply. |
diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c index 4bdf654041e9..6baffbb6acf9 100644 --- a/drivers/xen/xenbus/xenbus_probe.c +++ b/drivers/xen/xenbus/xenbus_probe.c | |||
@@ -62,8 +62,7 @@ | |||
62 | 62 | ||
63 | #include <xen/hvm.h> | 63 | #include <xen/hvm.h> |
64 | 64 | ||
65 | #include "xenbus_comms.h" | 65 | #include "xenbus.h" |
66 | #include "xenbus_probe.h" | ||
67 | 66 | ||
68 | 67 | ||
69 | int xen_store_evtchn; | 68 | int xen_store_evtchn; |
diff --git a/drivers/xen/xenbus/xenbus_probe_backend.c b/drivers/xen/xenbus/xenbus_probe_backend.c index 37929df829a3..f46b4dc72c76 100644 --- a/drivers/xen/xenbus/xenbus_probe_backend.c +++ b/drivers/xen/xenbus/xenbus_probe_backend.c | |||
@@ -53,8 +53,7 @@ | |||
53 | #include <xen/xenbus.h> | 53 | #include <xen/xenbus.h> |
54 | #include <xen/features.h> | 54 | #include <xen/features.h> |
55 | 55 | ||
56 | #include "xenbus_comms.h" | 56 | #include "xenbus.h" |
57 | #include "xenbus_probe.h" | ||
58 | 57 | ||
59 | /* backend/<type>/<fe-uuid>/<id> => <type>-<fe-domid>-<id> */ | 58 | /* backend/<type>/<fe-uuid>/<id> => <type>-<fe-domid>-<id> */ |
60 | static int backend_bus_id(char bus_id[XEN_BUS_ID_SIZE], const char *nodename) | 59 | static int backend_bus_id(char bus_id[XEN_BUS_ID_SIZE], const char *nodename) |
diff --git a/drivers/xen/xenbus/xenbus_probe_frontend.c b/drivers/xen/xenbus/xenbus_probe_frontend.c index 6d40a972ffb2..d7b77a62e6e7 100644 --- a/drivers/xen/xenbus/xenbus_probe_frontend.c +++ b/drivers/xen/xenbus/xenbus_probe_frontend.c | |||
@@ -27,8 +27,7 @@ | |||
27 | 27 | ||
28 | #include <xen/platform_pci.h> | 28 | #include <xen/platform_pci.h> |
29 | 29 | ||
30 | #include "xenbus_comms.h" | 30 | #include "xenbus.h" |
31 | #include "xenbus_probe.h" | ||
32 | 31 | ||
33 | 32 | ||
34 | 33 | ||
diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c index 6afb993c5809..4c49d8709765 100644 --- a/drivers/xen/xenbus/xenbus_xs.c +++ b/drivers/xen/xenbus/xenbus_xs.c | |||
@@ -48,8 +48,7 @@ | |||
48 | #include <asm/xen/hypervisor.h> | 48 | #include <asm/xen/hypervisor.h> |
49 | #include <xen/xenbus.h> | 49 | #include <xen/xenbus.h> |
50 | #include <xen/xen.h> | 50 | #include <xen/xen.h> |
51 | #include "xenbus_comms.h" | 51 | #include "xenbus.h" |
52 | #include "xenbus_probe.h" | ||
53 | 52 | ||
54 | struct xs_stored_msg { | 53 | struct xs_stored_msg { |
55 | struct list_head list; | 54 | struct list_head list; |
diff --git a/drivers/xen/xenfs/super.c b/drivers/xen/xenfs/super.c index 8559a71f36b1..328c3987b112 100644 --- a/drivers/xen/xenfs/super.c +++ b/drivers/xen/xenfs/super.c | |||
@@ -16,10 +16,10 @@ | |||
16 | #include <linux/magic.h> | 16 | #include <linux/magic.h> |
17 | 17 | ||
18 | #include <xen/xen.h> | 18 | #include <xen/xen.h> |
19 | #include <xen/xenbus.h> | ||
19 | 20 | ||
20 | #include "xenfs.h" | 21 | #include "xenfs.h" |
21 | #include "../privcmd.h" | 22 | #include "../privcmd.h" |
22 | #include "../xenbus/xenbus_comms.h" | ||
23 | 23 | ||
24 | #include <asm/xen/hypervisor.h> | 24 | #include <asm/xen/hypervisor.h> |
25 | 25 | ||
diff --git a/drivers/xen/xenfs/xenstored.c b/drivers/xen/xenfs/xenstored.c index fef20dbc6a5c..82fd2a396d96 100644 --- a/drivers/xen/xenfs/xenstored.c +++ b/drivers/xen/xenfs/xenstored.c | |||
@@ -4,9 +4,9 @@ | |||
4 | #include <linux/fs.h> | 4 | #include <linux/fs.h> |
5 | 5 | ||
6 | #include <xen/page.h> | 6 | #include <xen/page.h> |
7 | #include <xen/xenbus.h> | ||
7 | 8 | ||
8 | #include "xenfs.h" | 9 | #include "xenfs.h" |
9 | #include "../xenbus/xenbus_comms.h" | ||
10 | 10 | ||
11 | static ssize_t xsd_read(struct file *file, char __user *buf, | 11 | static ssize_t xsd_read(struct file *file, char __user *buf, |
12 | size_t size, loff_t *off) | 12 | size_t size, loff_t *off) |