diff options
author | Frank Blaschka <frank.blaschka@de.ibm.com> | 2009-06-16 04:30:32 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-06-16 04:31:13 -0400 |
commit | b8a2d42a8276d4dbc5a5c99f4422132c43ce3e1d (patch) | |
tree | 181dcd7339656a6da2dd0eecf8b4bd1bc23b5f71 /drivers/s390 | |
parent | bbcfcdc8324e75532c4d2592a545a91fcb45f229 (diff) |
[S390] pm: ctcm driver power management callbacks
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/net/ctcm_main.c | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c index 54c4649a493b..222e47394437 100644 --- a/drivers/s390/net/ctcm_main.c +++ b/drivers/s390/net/ctcm_main.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * drivers/s390/net/ctcm_main.c | 2 | * drivers/s390/net/ctcm_main.c |
3 | * | 3 | * |
4 | * Copyright IBM Corp. 2001, 2007 | 4 | * Copyright IBM Corp. 2001, 2009 |
5 | * Author(s): | 5 | * Author(s): |
6 | * Original CTC driver(s): | 6 | * Original CTC driver(s): |
7 | * Fritz Elfert (felfert@millenux.com) | 7 | * Fritz Elfert (felfert@millenux.com) |
@@ -1688,6 +1688,38 @@ static void ctcm_remove_device(struct ccwgroup_device *cgdev) | |||
1688 | put_device(&cgdev->dev); | 1688 | put_device(&cgdev->dev); |
1689 | } | 1689 | } |
1690 | 1690 | ||
1691 | static int ctcm_pm_suspend(struct ccwgroup_device *gdev) | ||
1692 | { | ||
1693 | struct ctcm_priv *priv = dev_get_drvdata(&gdev->dev); | ||
1694 | |||
1695 | if (gdev->state == CCWGROUP_OFFLINE) | ||
1696 | return 0; | ||
1697 | netif_device_detach(priv->channel[READ]->netdev); | ||
1698 | ctcm_close(priv->channel[READ]->netdev); | ||
1699 | ccw_device_set_offline(gdev->cdev[1]); | ||
1700 | ccw_device_set_offline(gdev->cdev[0]); | ||
1701 | return 0; | ||
1702 | } | ||
1703 | |||
1704 | static int ctcm_pm_resume(struct ccwgroup_device *gdev) | ||
1705 | { | ||
1706 | struct ctcm_priv *priv = dev_get_drvdata(&gdev->dev); | ||
1707 | int rc; | ||
1708 | |||
1709 | if (gdev->state == CCWGROUP_OFFLINE) | ||
1710 | return 0; | ||
1711 | rc = ccw_device_set_online(gdev->cdev[1]); | ||
1712 | if (rc) | ||
1713 | goto err_out; | ||
1714 | rc = ccw_device_set_online(gdev->cdev[0]); | ||
1715 | if (rc) | ||
1716 | goto err_out; | ||
1717 | ctcm_open(priv->channel[READ]->netdev); | ||
1718 | err_out: | ||
1719 | netif_device_attach(priv->channel[READ]->netdev); | ||
1720 | return rc; | ||
1721 | } | ||
1722 | |||
1691 | static struct ccwgroup_driver ctcm_group_driver = { | 1723 | static struct ccwgroup_driver ctcm_group_driver = { |
1692 | .owner = THIS_MODULE, | 1724 | .owner = THIS_MODULE, |
1693 | .name = CTC_DRIVER_NAME, | 1725 | .name = CTC_DRIVER_NAME, |
@@ -1697,6 +1729,9 @@ static struct ccwgroup_driver ctcm_group_driver = { | |||
1697 | .remove = ctcm_remove_device, | 1729 | .remove = ctcm_remove_device, |
1698 | .set_online = ctcm_new_device, | 1730 | .set_online = ctcm_new_device, |
1699 | .set_offline = ctcm_shutdown_device, | 1731 | .set_offline = ctcm_shutdown_device, |
1732 | .freeze = ctcm_pm_suspend, | ||
1733 | .thaw = ctcm_pm_resume, | ||
1734 | .restore = ctcm_pm_resume, | ||
1700 | }; | 1735 | }; |
1701 | 1736 | ||
1702 | 1737 | ||