|
@@ -71,6 +71,9 @@ static int xenbus_probe_frontend(const char *type, const char *name);
|
|
|
|
|
|
static void xenbus_dev_shutdown(struct device *_dev);
|
|
static void xenbus_dev_shutdown(struct device *_dev);
|
|
|
|
|
|
|
|
+static int xenbus_dev_suspend(struct device *dev, pm_message_t state);
|
|
|
|
+static int xenbus_dev_resume(struct device *dev);
|
|
|
|
+
|
|
/* If something in array of ids matches this device, return it. */
|
|
/* If something in array of ids matches this device, return it. */
|
|
static const struct xenbus_device_id *
|
|
static const struct xenbus_device_id *
|
|
match_device(const struct xenbus_device_id *arr, struct xenbus_device *dev)
|
|
match_device(const struct xenbus_device_id *arr, struct xenbus_device *dev)
|
|
@@ -188,6 +191,9 @@ static struct xen_bus_type xenbus_frontend = {
|
|
.remove = xenbus_dev_remove,
|
|
.remove = xenbus_dev_remove,
|
|
.shutdown = xenbus_dev_shutdown,
|
|
.shutdown = xenbus_dev_shutdown,
|
|
.dev_attrs = xenbus_dev_attrs,
|
|
.dev_attrs = xenbus_dev_attrs,
|
|
|
|
+
|
|
|
|
+ .suspend = xenbus_dev_suspend,
|
|
|
|
+ .resume = xenbus_dev_resume,
|
|
},
|
|
},
|
|
};
|
|
};
|
|
|
|
|
|
@@ -669,7 +675,7 @@ static struct xenbus_watch fe_watch = {
|
|
.callback = frontend_changed,
|
|
.callback = frontend_changed,
|
|
};
|
|
};
|
|
|
|
|
|
-static int suspend_dev(struct device *dev, void *data)
|
|
|
|
|
|
+static int xenbus_dev_suspend(struct device *dev, pm_message_t state)
|
|
{
|
|
{
|
|
int err = 0;
|
|
int err = 0;
|
|
struct xenbus_driver *drv;
|
|
struct xenbus_driver *drv;
|
|
@@ -682,14 +688,14 @@ static int suspend_dev(struct device *dev, void *data)
|
|
drv = to_xenbus_driver(dev->driver);
|
|
drv = to_xenbus_driver(dev->driver);
|
|
xdev = container_of(dev, struct xenbus_device, dev);
|
|
xdev = container_of(dev, struct xenbus_device, dev);
|
|
if (drv->suspend)
|
|
if (drv->suspend)
|
|
- err = drv->suspend(xdev);
|
|
|
|
|
|
+ err = drv->suspend(xdev, state);
|
|
if (err)
|
|
if (err)
|
|
printk(KERN_WARNING
|
|
printk(KERN_WARNING
|
|
"xenbus: suspend %s failed: %i\n", dev_name(dev), err);
|
|
"xenbus: suspend %s failed: %i\n", dev_name(dev), err);
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static int resume_dev(struct device *dev, void *data)
|
|
|
|
|
|
+static int xenbus_dev_resume(struct device *dev)
|
|
{
|
|
{
|
|
int err;
|
|
int err;
|
|
struct xenbus_driver *drv;
|
|
struct xenbus_driver *drv;
|
|
@@ -734,31 +740,6 @@ static int resume_dev(struct device *dev, void *data)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-void xenbus_suspend(void)
|
|
|
|
-{
|
|
|
|
- DPRINTK("");
|
|
|
|
-
|
|
|
|
- bus_for_each_dev(&xenbus_frontend.bus, NULL, NULL, suspend_dev);
|
|
|
|
- xenbus_backend_suspend(suspend_dev);
|
|
|
|
- xs_suspend();
|
|
|
|
-}
|
|
|
|
-EXPORT_SYMBOL_GPL(xenbus_suspend);
|
|
|
|
-
|
|
|
|
-void xenbus_resume(void)
|
|
|
|
-{
|
|
|
|
- xb_init_comms();
|
|
|
|
- xs_resume();
|
|
|
|
- bus_for_each_dev(&xenbus_frontend.bus, NULL, NULL, resume_dev);
|
|
|
|
- xenbus_backend_resume(resume_dev);
|
|
|
|
-}
|
|
|
|
-EXPORT_SYMBOL_GPL(xenbus_resume);
|
|
|
|
-
|
|
|
|
-void xenbus_suspend_cancel(void)
|
|
|
|
-{
|
|
|
|
- xs_suspend_cancel();
|
|
|
|
-}
|
|
|
|
-EXPORT_SYMBOL_GPL(xenbus_suspend_cancel);
|
|
|
|
-
|
|
|
|
/* A flag to determine if xenstored is 'ready' (i.e. has started) */
|
|
/* A flag to determine if xenstored is 'ready' (i.e. has started) */
|
|
int xenstored_ready = 0;
|
|
int xenstored_ready = 0;
|
|
|
|
|