diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-06-27 22:50:10 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-06-27 22:50:10 -0400 |
commit | aa8f6dfd355021b4dd8b74b0588fd6fd8f21b79f (patch) | |
tree | 57ca3e27227695acbd97408eabb0f967726c3b51 /drivers/usb/net/zd1201.c | |
parent | f45727d52d1581e9ff4df9d1a12a60789ad2d1eb (diff) | |
parent | 245ac8738b0b840552d56b842e70e750d65911cc (diff) | |
download | op-kernel-dev-aa8f6dfd355021b4dd8b74b0588fd6fd8f21b79f.zip op-kernel-dev-aa8f6dfd355021b4dd8b74b0588fd6fd8f21b79f.tar.gz |
Merge /spare/repo/netdev-2.6 branch 'ieee80211'
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 17b9718..72b0612 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) |