summaryrefslogtreecommitdiff
path: root/include/linux/virtio.h
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@redhat.com>2011-12-22 15:28:26 +0400
committerRusty Russell <rusty@rustcorp.com.au>2012-01-12 09:14:44 +0400
commitf0fe6f11503fa9880867554350ac5d3092c47251 (patch)
tree0f95d79a528809e169a742afeafddd041d275181 /include/linux/virtio.h
parentd077536386595309060dda57e7b7474c501a589b (diff)
downloadlinux-f0fe6f11503fa9880867554350ac5d3092c47251.tar.xz
virtio: pci: add PM notification handlers for restore, freeze, thaw, poweroff
Handle thaw, restore and freeze notifications from the PM core. Expose these to individual virtio drivers that can quiesce and resume vq operations. For drivers not implementing the thaw() method, use the restore method instead. These functions also save device-specific data so that the device can be put in pre-suspend state after resume, and disable and enable the PCI device in the freeze and resume functions, respectively. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'include/linux/virtio.h')
-rw-r--r--include/linux/virtio.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index 31fe3a62874b..d0018d27c281 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -94,6 +94,11 @@ struct virtio_driver {
int (*probe)(struct virtio_device *dev);
void (*remove)(struct virtio_device *dev);
void (*config_changed)(struct virtio_device *dev);
+#ifdef CONFIG_PM
+ int (*freeze)(struct virtio_device *dev);
+ int (*thaw)(struct virtio_device *dev);
+ int (*restore)(struct virtio_device *dev);
+#endif
};
int register_virtio_driver(struct virtio_driver *drv);