diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-27 15:13:26 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-27 15:13:26 -0700 |
commit | d3b8a1a8496c83bc4a3cc76505c29255af15572c (patch) | |
tree | b56eb3ef27117bad5c516d6b647bdcd465d7659a /drivers/usb/net/zd1201.c | |
parent | 60564a313a5738960064d6c555ec066d9332f278 (diff) | |
parent | 0ed0c0c48c508578c30aa58f755ca0d692636906 (diff) | |
download | kernel_samsung_smdk4412-d3b8a1a8496c83bc4a3cc76505c29255af15572c.zip kernel_samsung_smdk4412-d3b8a1a8496c83bc4a3cc76505c29255af15572c.tar.gz kernel_samsung_smdk4412-d3b8a1a8496c83bc4a3cc76505c29255af15572c.tar.bz2 |
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6
Diffstat (limited to 'drivers/usb/net/zd1201.c')
-rw-r--r-- | drivers/usb/net/zd1201.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/drivers/usb/net/zd1201.c b/drivers/usb/net/zd1201.c index 341ae5f..3b387b0 100644 --- a/drivers/usb/net/zd1201.c +++ b/drivers/usb/net/zd1201.c @@ -1884,12 +1884,53 @@ static void zd1201_disconnect(struct usb_interface *interface) kfree(zd); } +#ifdef CONFIG_PM + +static int zd1201_suspend(struct usb_interface *interface, + pm_message_t message) +{ + struct zd1201 *zd = usb_get_intfdata(interface); + + netif_device_detach(zd->dev); + + zd->was_enabled = zd->mac_enabled; + + if (zd->was_enabled) + return zd1201_disable(zd); + else + return 0; +} + +static int zd1201_resume(struct usb_interface *interface) +{ + struct zd1201 *zd = usb_get_intfdata(interface); + + if (!zd || !zd->dev) + return -ENODEV; + + netif_device_attach(zd->dev); + + if (zd->was_enabled) + return zd1201_enable(zd); + else + return 0; +} + +#else + +#define zd1201_suspend NULL +#define zd1201_resume NULL + +#endif + static struct usb_driver zd1201_usb = { .owner = THIS_MODULE, .name = "zd1201", .probe = zd1201_probe, .disconnect = zd1201_disconnect, .id_table = zd1201_table, + .suspend = zd1201_suspend, + .resume = zd1201_resume, }; static int __init zd1201_init(void) |