diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-08-29 16:40:27 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-08-29 16:40:27 -0400 |
commit | c1b054d03f5b31c33eaa0b267c629b118eaf3790 (patch) | |
tree | 9333907ca767be24fcb3667877242976c3e3c8dd /drivers/usb/net | |
parent | 559fb51ba7e66fe298b8355fabde1275b7def35f (diff) | |
parent | bf4e70e54cf31dcca48d279c7f7e71328eebe749 (diff) |
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'drivers/usb/net')
-rw-r--r-- | drivers/usb/net/kaweth.c | 4 | ||||
-rw-r--r-- | drivers/usb/net/pegasus.c | 3 | ||||
-rw-r--r-- | drivers/usb/net/pegasus.h | 2 | ||||
-rw-r--r-- | drivers/usb/net/rtl8150.c | 4 | ||||
-rw-r--r-- | drivers/usb/net/usbnet.c | 10 | ||||
-rw-r--r-- | drivers/usb/net/zd1201.c | 45 | ||||
-rw-r--r-- | drivers/usb/net/zd1201.h | 1 |
7 files changed, 55 insertions, 14 deletions
diff --git a/drivers/usb/net/kaweth.c b/drivers/usb/net/kaweth.c index fd6ff4cb2c62..7ffa99b9760f 100644 --- a/drivers/usb/net/kaweth.c +++ b/drivers/usb/net/kaweth.c | |||
@@ -477,7 +477,7 @@ static int kaweth_reset(struct kaweth_device *kaweth) | |||
477 | } | 477 | } |
478 | 478 | ||
479 | static void kaweth_usb_receive(struct urb *, struct pt_regs *regs); | 479 | static void kaweth_usb_receive(struct urb *, struct pt_regs *regs); |
480 | static int kaweth_resubmit_rx_urb(struct kaweth_device *, int); | 480 | static int kaweth_resubmit_rx_urb(struct kaweth_device *, unsigned); |
481 | 481 | ||
482 | /**************************************************************** | 482 | /**************************************************************** |
483 | int_callback | 483 | int_callback |
@@ -550,7 +550,7 @@ static void kaweth_resubmit_tl(void *d) | |||
550 | * kaweth_resubmit_rx_urb | 550 | * kaweth_resubmit_rx_urb |
551 | ****************************************************************/ | 551 | ****************************************************************/ |
552 | static int kaweth_resubmit_rx_urb(struct kaweth_device *kaweth, | 552 | static int kaweth_resubmit_rx_urb(struct kaweth_device *kaweth, |
553 | int mem_flags) | 553 | unsigned mem_flags) |
554 | { | 554 | { |
555 | int result; | 555 | int result; |
556 | 556 | ||
diff --git a/drivers/usb/net/pegasus.c b/drivers/usb/net/pegasus.c index d976790312aa..fcd6d3ccef44 100644 --- a/drivers/usb/net/pegasus.c +++ b/drivers/usb/net/pegasus.c | |||
@@ -59,7 +59,6 @@ static const char driver_name[] = "pegasus"; | |||
59 | 59 | ||
60 | static int loopback = 0; | 60 | static int loopback = 0; |
61 | static int mii_mode = 0; | 61 | static int mii_mode = 0; |
62 | static int multicast_filter_limit = 32; | ||
63 | 62 | ||
64 | static struct usb_eth_dev usb_dev_id[] = { | 63 | static struct usb_eth_dev usb_dev_id[] = { |
65 | #define PEGASUS_DEV(pn, vid, pid, flags) \ | 64 | #define PEGASUS_DEV(pn, vid, pid, flags) \ |
@@ -1166,7 +1165,7 @@ static void pegasus_set_multicast(struct net_device *net) | |||
1166 | pegasus->eth_regs[EthCtrl2] |= RX_PROMISCUOUS; | 1165 | pegasus->eth_regs[EthCtrl2] |= RX_PROMISCUOUS; |
1167 | if (netif_msg_link(pegasus)) | 1166 | if (netif_msg_link(pegasus)) |
1168 | pr_info("%s: Promiscuous mode enabled.\n", net->name); | 1167 | pr_info("%s: Promiscuous mode enabled.\n", net->name); |
1169 | } else if ((net->mc_count > multicast_filter_limit) || | 1168 | } else if (net->mc_count || |
1170 | (net->flags & IFF_ALLMULTI)) { | 1169 | (net->flags & IFF_ALLMULTI)) { |
1171 | pegasus->eth_regs[EthCtrl0] |= RX_MULTICAST; | 1170 | pegasus->eth_regs[EthCtrl0] |= RX_MULTICAST; |
1172 | pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS; | 1171 | pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS; |
diff --git a/drivers/usb/net/pegasus.h b/drivers/usb/net/pegasus.h index 13ccedef5c7e..b98f2a833442 100644 --- a/drivers/usb/net/pegasus.h +++ b/drivers/usb/net/pegasus.h | |||
@@ -249,6 +249,8 @@ PEGASUS_DEV( "Kingston KNU101TX Ethernet", VENDOR_KINGSTON, 0x000a, | |||
249 | DEFAULT_GPIO_RESET) | 249 | DEFAULT_GPIO_RESET) |
250 | PEGASUS_DEV( "LANEED USB Ethernet LD-USB/TX", VENDOR_LANEED, 0x4002, | 250 | PEGASUS_DEV( "LANEED USB Ethernet LD-USB/TX", VENDOR_LANEED, 0x4002, |
251 | DEFAULT_GPIO_RESET ) | 251 | DEFAULT_GPIO_RESET ) |
252 | PEGASUS_DEV( "LANEED USB Ethernet LD-USBL/TX", VENDOR_LANEED, 0x4005, | ||
253 | DEFAULT_GPIO_RESET | PEGASUS_II) | ||
252 | PEGASUS_DEV( "LANEED USB Ethernet LD-USB/TX", VENDOR_LANEED, 0x400b, | 254 | PEGASUS_DEV( "LANEED USB Ethernet LD-USB/TX", VENDOR_LANEED, 0x400b, |
253 | DEFAULT_GPIO_RESET | PEGASUS_II ) | 255 | DEFAULT_GPIO_RESET | PEGASUS_II ) |
254 | PEGASUS_DEV( "LANEED USB Ethernet LD-USB/T", VENDOR_LANEED, 0xabc1, | 256 | PEGASUS_DEV( "LANEED USB Ethernet LD-USB/T", VENDOR_LANEED, 0xabc1, |
diff --git a/drivers/usb/net/rtl8150.c b/drivers/usb/net/rtl8150.c index 8fb223385f2f..59ab40ebb394 100644 --- a/drivers/usb/net/rtl8150.c +++ b/drivers/usb/net/rtl8150.c | |||
@@ -167,8 +167,6 @@ struct rtl8150 { | |||
167 | 167 | ||
168 | typedef struct rtl8150 rtl8150_t; | 168 | typedef struct rtl8150 rtl8150_t; |
169 | 169 | ||
170 | static unsigned long multicast_filter_limit = 32; | ||
171 | |||
172 | static void fill_skb_pool(rtl8150_t *); | 170 | static void fill_skb_pool(rtl8150_t *); |
173 | static void free_skb_pool(rtl8150_t *); | 171 | static void free_skb_pool(rtl8150_t *); |
174 | static inline struct sk_buff *pull_skb(rtl8150_t *); | 172 | static inline struct sk_buff *pull_skb(rtl8150_t *); |
@@ -667,7 +665,7 @@ static void rtl8150_set_multicast(struct net_device *netdev) | |||
667 | if (netdev->flags & IFF_PROMISC) { | 665 | if (netdev->flags & IFF_PROMISC) { |
668 | dev->rx_creg |= cpu_to_le16(0x0001); | 666 | dev->rx_creg |= cpu_to_le16(0x0001); |
669 | info("%s: promiscuous mode", netdev->name); | 667 | info("%s: promiscuous mode", netdev->name); |
670 | } else if ((netdev->mc_count > multicast_filter_limit) || | 668 | } else if (netdev->mc_count || |
671 | (netdev->flags & IFF_ALLMULTI)) { | 669 | (netdev->flags & IFF_ALLMULTI)) { |
672 | dev->rx_creg &= cpu_to_le16(0xfffe); | 670 | dev->rx_creg &= cpu_to_le16(0xfffe); |
673 | dev->rx_creg |= cpu_to_le16(0x0002); | 671 | dev->rx_creg |= cpu_to_le16(0x0002); |
diff --git a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c index 4cbb408af727..4528a00c45b0 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 ( |
@@ -1922,7 +1922,7 @@ static int genelink_rx_fixup (struct usbnet *dev, struct sk_buff *skb) | |||
1922 | 1922 | ||
1923 | // copy the packet data to the new skb | 1923 | // copy the packet data to the new skb |
1924 | memcpy(skb_put(gl_skb, size), packet->packet_data, size); | 1924 | memcpy(skb_put(gl_skb, size), packet->packet_data, size); |
1925 | skb_return (dev, skb); | 1925 | skb_return (dev, gl_skb); |
1926 | } | 1926 | } |
1927 | 1927 | ||
1928 | // advance to the next packet | 1928 | // advance to the next packet |
@@ -3227,9 +3227,9 @@ static int usbnet_stop (struct net_device *net) | |||
3227 | temp = unlink_urbs (dev, &dev->txq) + unlink_urbs (dev, &dev->rxq); | 3227 | temp = unlink_urbs (dev, &dev->txq) + unlink_urbs (dev, &dev->rxq); |
3228 | 3228 | ||
3229 | // maybe wait for deletions to finish. | 3229 | // maybe wait for deletions to finish. |
3230 | while (skb_queue_len (&dev->rxq) | 3230 | while (!skb_queue_empty(&dev->rxq) && |
3231 | && skb_queue_len (&dev->txq) | 3231 | !skb_queue_empty(&dev->txq) && |
3232 | && skb_queue_len (&dev->done)) { | 3232 | !skb_queue_empty(&dev->done)) { |
3233 | msleep(UNLINK_TIMEOUT_MS); | 3233 | msleep(UNLINK_TIMEOUT_MS); |
3234 | if (netif_msg_ifdown (dev)) | 3234 | if (netif_msg_ifdown (dev)) |
3235 | devdbg (dev, "waited for %d urb completions", temp); | 3235 | devdbg (dev, "waited for %d urb completions", temp); |
diff --git a/drivers/usb/net/zd1201.c b/drivers/usb/net/zd1201.c index 341ae5f732dd..e32a80b39182 100644 --- a/drivers/usb/net/zd1201.c +++ b/drivers/usb/net/zd1201.c | |||
@@ -29,6 +29,7 @@ static struct usb_device_id zd1201_table[] = { | |||
29 | {USB_DEVICE(0x0ace, 0x1201)}, /* ZyDAS ZD1201 Wireless USB Adapter */ | 29 | {USB_DEVICE(0x0ace, 0x1201)}, /* ZyDAS ZD1201 Wireless USB Adapter */ |
30 | {USB_DEVICE(0x050d, 0x6051)}, /* Belkin F5D6051 usb adapter */ | 30 | {USB_DEVICE(0x050d, 0x6051)}, /* Belkin F5D6051 usb adapter */ |
31 | {USB_DEVICE(0x0db0, 0x6823)}, /* MSI UB11B usb adapter */ | 31 | {USB_DEVICE(0x0db0, 0x6823)}, /* MSI UB11B usb adapter */ |
32 | {USB_DEVICE(0x1044, 0x8005)}, /* GIGABYTE GN-WLBZ201 usb adapter */ | ||
32 | {} | 33 | {} |
33 | }; | 34 | }; |
34 | 35 | ||
@@ -345,8 +346,7 @@ static void zd1201_usbrx(struct urb *urb, struct pt_regs *regs) | |||
345 | if (datalen<14) | 346 | if (datalen<14) |
346 | goto resubmit; | 347 | goto resubmit; |
347 | if ((seq & IEEE802_11_SCTL_FRAG) == 0) { | 348 | if ((seq & IEEE802_11_SCTL_FRAG) == 0) { |
348 | frag = kmalloc(sizeof(struct zd1201_frag*), | 349 | frag = kmalloc(sizeof(*frag), GFP_ATOMIC); |
349 | GFP_ATOMIC); | ||
350 | if (!frag) | 350 | if (!frag) |
351 | goto resubmit; | 351 | goto resubmit; |
352 | skb = dev_alloc_skb(IEEE802_11_DATA_LEN +14+2); | 352 | skb = dev_alloc_skb(IEEE802_11_DATA_LEN +14+2); |
@@ -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; |