Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 3669
b: refs/heads/master
c: a3c900b
h: refs/heads/master
i:
  3667: e1001f0
v: v3
  • Loading branch information
Colin Leroy authored and Greg Kroah-Hartman committed Jun 27, 2005
1 parent 20b727e commit e905dfd
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 507ca9bc0476662f3463888d583864834eab1e11
refs/heads/master: a3c900bb8cbacfecf0be51313e43f330663266a1
38 changes: 38 additions & 0 deletions trunk/drivers/usb/net/zd1201.c
Original file line number Diff line number Diff line change
Expand Up @@ -1884,12 +1884,50 @@ 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);

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)
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/usb/net/zd1201.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ struct zd1201 {
char essid[IW_ESSID_MAX_SIZE+1];
int essidlen;
int mac_enabled;
int was_enabled;
int monitor;
int encode_enabled;
int encode_restricted;
Expand Down

0 comments on commit e905dfd

Please sign in to comment.