diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-27 18:13:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-27 18:13:26 -0400 |
commit | d3b8a1a8496c83bc4a3cc76505c29255af15572c (patch) | |
tree | b56eb3ef27117bad5c516d6b647bdcd465d7659a /drivers/usb/net | |
parent | 60564a313a5738960064d6c555ec066d9332f278 (diff) | |
parent | 0ed0c0c48c508578c30aa58f755ca0d692636906 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6
Diffstat (limited to 'drivers/usb/net')
-rw-r--r-- | drivers/usb/net/usbnet.c | 2 | ||||
-rw-r--r-- | drivers/usb/net/zd1201.c | 41 | ||||
-rw-r--r-- | drivers/usb/net/zd1201.h | 1 |
3 files changed, 43 insertions, 1 deletions
diff --git a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c index 4cbb408af727..8a945f4f3693 100644 --- a/drivers/usb/net/usbnet.c +++ b/drivers/usb/net/usbnet.c | |||
@@ -1429,7 +1429,7 @@ static int generic_cdc_bind (struct usbnet *dev, struct usb_interface *intf) | |||
1429 | info->ether = (void *) buf; | 1429 | info->ether = (void *) buf; |
1430 | if (info->ether->bLength != sizeof *info->ether) { | 1430 | if (info->ether->bLength != sizeof *info->ether) { |
1431 | dev_dbg (&intf->dev, "CDC ether len %u\n", | 1431 | dev_dbg (&intf->dev, "CDC ether len %u\n", |
1432 | info->u->bLength); | 1432 | info->ether->bLength); |
1433 | goto bad_desc; | 1433 | goto bad_desc; |
1434 | } | 1434 | } |
1435 | dev->net->mtu = le16_to_cpup ( | 1435 | dev->net->mtu = le16_to_cpup ( |
diff --git a/drivers/usb/net/zd1201.c b/drivers/usb/net/zd1201.c index 341ae5f732dd..3b387b005739 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) | |||
1884 | kfree(zd); | 1884 | kfree(zd); |
1885 | } | 1885 | } |
1886 | 1886 | ||
1887 | #ifdef CONFIG_PM | ||
1888 | |||
1889 | static int zd1201_suspend(struct usb_interface *interface, | ||
1890 | pm_message_t message) | ||
1891 | { | ||
1892 | struct zd1201 *zd = usb_get_intfdata(interface); | ||
1893 | |||
1894 | netif_device_detach(zd->dev); | ||
1895 | |||
1896 | zd->was_enabled = zd->mac_enabled; | ||
1897 | |||
1898 | if (zd->was_enabled) | ||
1899 | return zd1201_disable(zd); | ||
1900 | else | ||
1901 | return 0; | ||
1902 | } | ||
1903 | |||
1904 | static int zd1201_resume(struct usb_interface *interface) | ||
1905 | { | ||
1906 | struct zd1201 *zd = usb_get_intfdata(interface); | ||
1907 | |||
1908 | if (!zd || !zd->dev) | ||
1909 | return -ENODEV; | ||
1910 | |||
1911 | netif_device_attach(zd->dev); | ||
1912 | |||
1913 | if (zd->was_enabled) | ||
1914 | return zd1201_enable(zd); | ||
1915 | else | ||
1916 | return 0; | ||
1917 | } | ||
1918 | |||
1919 | #else | ||
1920 | |||
1921 | #define zd1201_suspend NULL | ||
1922 | #define zd1201_resume NULL | ||
1923 | |||
1924 | #endif | ||
1925 | |||
1887 | static struct usb_driver zd1201_usb = { | 1926 | static struct usb_driver zd1201_usb = { |
1888 | .owner = THIS_MODULE, | 1927 | .owner = THIS_MODULE, |
1889 | .name = "zd1201", | 1928 | .name = "zd1201", |
1890 | .probe = zd1201_probe, | 1929 | .probe = zd1201_probe, |
1891 | .disconnect = zd1201_disconnect, | 1930 | .disconnect = zd1201_disconnect, |
1892 | .id_table = zd1201_table, | 1931 | .id_table = zd1201_table, |
1932 | .suspend = zd1201_suspend, | ||
1933 | .resume = zd1201_resume, | ||
1893 | }; | 1934 | }; |
1894 | 1935 | ||
1895 | static int __init zd1201_init(void) | 1936 | static int __init zd1201_init(void) |
diff --git a/drivers/usb/net/zd1201.h b/drivers/usb/net/zd1201.h index 1627c71e8052..235f0ee34b24 100644 --- a/drivers/usb/net/zd1201.h +++ b/drivers/usb/net/zd1201.h | |||
@@ -46,6 +46,7 @@ struct zd1201 { | |||
46 | char essid[IW_ESSID_MAX_SIZE+1]; | 46 | char essid[IW_ESSID_MAX_SIZE+1]; |
47 | int essidlen; | 47 | int essidlen; |
48 | int mac_enabled; | 48 | int mac_enabled; |
49 | int was_enabled; | ||
49 | int monitor; | 50 | int monitor; |
50 | int encode_enabled; | 51 | int encode_enabled; |
51 | int encode_restricted; | 52 | int encode_restricted; |