From e7a3af5d8cd782b84e6ca4e4dcc8613be1a809f0 Mon Sep 17 00:00:00 2001 From: Brian King Date: Fri, 7 May 2010 08:56:08 +0000 Subject: ibmveth: Add suspend/resume support Adds support for resuming from suspend for IBM virtual ethernet devices. We may have lost an interrupt over the suspend, so we just kick the interrupt handler to process anything that is outstanding. Signed-off-by: Brian King Signed-off-by: David S. Miller --- drivers/net/ibmveth.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c index 3e4dead5a2f4..941be84deb67 100644 --- a/drivers/net/ibmveth.c +++ b/drivers/net/ibmveth.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -1588,6 +1589,12 @@ static struct kobj_type ktype_veth_pool = { .default_attrs = veth_pool_attrs, }; +static int ibmveth_resume(struct device *dev) +{ + struct net_device *netdev = dev_get_drvdata(dev); + ibmveth_interrupt(netdev->irq, netdev); + return 0; +} static struct vio_device_id ibmveth_device_table[] __devinitdata= { { "network", "IBM,l-lan"}, @@ -1595,6 +1602,10 @@ static struct vio_device_id ibmveth_device_table[] __devinitdata= { }; MODULE_DEVICE_TABLE(vio, ibmveth_device_table); +static struct dev_pm_ops ibmveth_pm_ops = { + .resume = ibmveth_resume +}; + static struct vio_driver ibmveth_driver = { .id_table = ibmveth_device_table, .probe = ibmveth_probe, @@ -1603,6 +1614,7 @@ static struct vio_driver ibmveth_driver = { .driver = { .name = ibmveth_driver_name, .owner = THIS_MODULE, + .pm = &ibmveth_pm_ops, } }; -- cgit v1.2.3