diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/3c509.c | 13 | ||||
-rw-r--r-- | drivers/net/8139cp.c | 37 | ||||
-rw-r--r-- | drivers/net/Kconfig | 3 | ||||
-rw-r--r-- | drivers/net/chelsio/espi.c | 4 | ||||
-rw-r--r-- | drivers/net/de620.c | 2 | ||||
-rw-r--r-- | drivers/net/dl2k.c | 25 | ||||
-rw-r--r-- | drivers/net/e1000/e1000.h | 3 | ||||
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 121 | ||||
-rw-r--r-- | drivers/net/pcmcia/axnet_cs.c | 1 | ||||
-rw-r--r-- | drivers/net/s2io.c | 1 | ||||
-rw-r--r-- | drivers/net/sis900.c | 4 | ||||
-rw-r--r-- | drivers/net/sky2.c | 109 | ||||
-rw-r--r-- | drivers/net/sky2.h | 1 | ||||
-rw-r--r-- | drivers/net/tg3.c | 98 | ||||
-rw-r--r-- | drivers/net/tulip/de2104x.c | 26 | ||||
-rw-r--r-- | drivers/net/tun.c | 5 | ||||
-rw-r--r-- | drivers/net/via-velocity.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_cs.c | 5 |
18 files changed, 212 insertions, 249 deletions
diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c index 824e430486c2..830528dce0ca 100644 --- a/drivers/net/3c509.c +++ b/drivers/net/3c509.c | |||
@@ -1574,6 +1574,7 @@ MODULE_LICENSE("GPL"); | |||
1574 | 1574 | ||
1575 | static int __init el3_init_module(void) | 1575 | static int __init el3_init_module(void) |
1576 | { | 1576 | { |
1577 | int ret = 0; | ||
1577 | el3_cards = 0; | 1578 | el3_cards = 0; |
1578 | 1579 | ||
1579 | if (debug >= 0) | 1580 | if (debug >= 0) |
@@ -1589,14 +1590,16 @@ static int __init el3_init_module(void) | |||
1589 | } | 1590 | } |
1590 | 1591 | ||
1591 | #ifdef CONFIG_EISA | 1592 | #ifdef CONFIG_EISA |
1592 | if (eisa_driver_register (&el3_eisa_driver) < 0) { | 1593 | ret = eisa_driver_register(&el3_eisa_driver); |
1593 | eisa_driver_unregister (&el3_eisa_driver); | ||
1594 | } | ||
1595 | #endif | 1594 | #endif |
1596 | #ifdef CONFIG_MCA | 1595 | #ifdef CONFIG_MCA |
1597 | mca_register_driver(&el3_mca_driver); | 1596 | { |
1597 | int err = mca_register_driver(&el3_mca_driver); | ||
1598 | if (ret == 0) | ||
1599 | ret = err; | ||
1600 | } | ||
1598 | #endif | 1601 | #endif |
1599 | return 0; | 1602 | return ret; |
1600 | } | 1603 | } |
1601 | 1604 | ||
1602 | static void __exit el3_cleanup_module(void) | 1605 | static void __exit el3_cleanup_module(void) |
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index f822cd3025ff..dd410496aadb 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c | |||
@@ -1118,13 +1118,18 @@ err_out: | |||
1118 | return -ENOMEM; | 1118 | return -ENOMEM; |
1119 | } | 1119 | } |
1120 | 1120 | ||
1121 | static void cp_init_rings_index (struct cp_private *cp) | ||
1122 | { | ||
1123 | cp->rx_tail = 0; | ||
1124 | cp->tx_head = cp->tx_tail = 0; | ||
1125 | } | ||
1126 | |||
1121 | static int cp_init_rings (struct cp_private *cp) | 1127 | static int cp_init_rings (struct cp_private *cp) |
1122 | { | 1128 | { |
1123 | memset(cp->tx_ring, 0, sizeof(struct cp_desc) * CP_TX_RING_SIZE); | 1129 | memset(cp->tx_ring, 0, sizeof(struct cp_desc) * CP_TX_RING_SIZE); |
1124 | cp->tx_ring[CP_TX_RING_SIZE - 1].opts1 = cpu_to_le32(RingEnd); | 1130 | cp->tx_ring[CP_TX_RING_SIZE - 1].opts1 = cpu_to_le32(RingEnd); |
1125 | 1131 | ||
1126 | cp->rx_tail = 0; | 1132 | cp_init_rings_index(cp); |
1127 | cp->tx_head = cp->tx_tail = 0; | ||
1128 | 1133 | ||
1129 | return cp_refill_rx (cp); | 1134 | return cp_refill_rx (cp); |
1130 | } | 1135 | } |
@@ -1886,30 +1891,30 @@ static int cp_suspend (struct pci_dev *pdev, pm_message_t state) | |||
1886 | 1891 | ||
1887 | spin_unlock_irqrestore (&cp->lock, flags); | 1892 | spin_unlock_irqrestore (&cp->lock, flags); |
1888 | 1893 | ||
1889 | if (cp->pdev && cp->wol_enabled) { | 1894 | pci_save_state(pdev); |
1890 | pci_save_state (cp->pdev); | 1895 | pci_enable_wake(pdev, pci_choose_state(pdev, state), cp->wol_enabled); |
1891 | cp_set_d3_state (cp); | 1896 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); |
1892 | } | ||
1893 | 1897 | ||
1894 | return 0; | 1898 | return 0; |
1895 | } | 1899 | } |
1896 | 1900 | ||
1897 | static int cp_resume (struct pci_dev *pdev) | 1901 | static int cp_resume (struct pci_dev *pdev) |
1898 | { | 1902 | { |
1899 | struct net_device *dev; | 1903 | struct net_device *dev = pci_get_drvdata (pdev); |
1900 | struct cp_private *cp; | 1904 | struct cp_private *cp = netdev_priv(dev); |
1901 | unsigned long flags; | 1905 | unsigned long flags; |
1902 | 1906 | ||
1903 | dev = pci_get_drvdata (pdev); | 1907 | if (!netif_running(dev)) |
1904 | cp = netdev_priv(dev); | 1908 | return 0; |
1905 | 1909 | ||
1906 | netif_device_attach (dev); | 1910 | netif_device_attach (dev); |
1907 | 1911 | ||
1908 | if (cp->pdev && cp->wol_enabled) { | 1912 | pci_set_power_state(pdev, PCI_D0); |
1909 | pci_set_power_state (cp->pdev, PCI_D0); | 1913 | pci_restore_state(pdev); |
1910 | pci_restore_state (cp->pdev); | 1914 | pci_enable_wake(pdev, PCI_D0, 0); |
1911 | } | 1915 | |
1912 | 1916 | /* FIXME: sh*t may happen if the Rx ring buffer is depleted */ | |
1917 | cp_init_rings_index (cp); | ||
1913 | cp_init_hw (cp); | 1918 | cp_init_hw (cp); |
1914 | netif_start_queue (dev); | 1919 | netif_start_queue (dev); |
1915 | 1920 | ||
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index e45a8f959719..aa633fa95e64 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -1087,7 +1087,8 @@ config NE2000 | |||
1087 | without a specific driver are compatible with NE2000. | 1087 | without a specific driver are compatible with NE2000. |
1088 | 1088 | ||
1089 | If you have a PCI NE2000 card however, say N here and Y to "PCI | 1089 | If you have a PCI NE2000 card however, say N here and Y to "PCI |
1090 | NE2000 support", above. If you have a NE2000 card and are running on | 1090 | NE2000 and clone support" under "EISA, VLB, PCI and on board |
1091 | controllers" below. If you have a NE2000 card and are running on | ||
1091 | an MCA system (a bus system used on some IBM PS/2 computers and | 1092 | an MCA system (a bus system used on some IBM PS/2 computers and |
1092 | laptops), say N here and Y to "NE/2 (ne2000 MCA version) support", | 1093 | laptops), say N here and Y to "NE/2 (ne2000 MCA version) support", |
1093 | below. | 1094 | below. |
diff --git a/drivers/net/chelsio/espi.c b/drivers/net/chelsio/espi.c index 230642571c92..e824acaf188a 100644 --- a/drivers/net/chelsio/espi.c +++ b/drivers/net/chelsio/espi.c | |||
@@ -296,9 +296,7 @@ void t1_espi_destroy(struct peespi *espi) | |||
296 | 296 | ||
297 | struct peespi *t1_espi_create(adapter_t *adapter) | 297 | struct peespi *t1_espi_create(adapter_t *adapter) |
298 | { | 298 | { |
299 | struct peespi *espi = kmalloc(sizeof(*espi), GFP_KERNEL); | 299 | struct peespi *espi = kzalloc(sizeof(*espi), GFP_KERNEL); |
300 | |||
301 | memset(espi, 0, sizeof(*espi)); | ||
302 | 300 | ||
303 | if (espi) | 301 | if (espi) |
304 | espi->adapter = adapter; | 302 | espi->adapter = adapter; |
diff --git a/drivers/net/de620.c b/drivers/net/de620.c index 0069f5fa973a..22fc5b869a60 100644 --- a/drivers/net/de620.c +++ b/drivers/net/de620.c | |||
@@ -1012,7 +1012,7 @@ static int __init read_eeprom(struct net_device *dev) | |||
1012 | #ifdef MODULE | 1012 | #ifdef MODULE |
1013 | static struct net_device *de620_dev; | 1013 | static struct net_device *de620_dev; |
1014 | 1014 | ||
1015 | int init_module(void) | 1015 | int __init init_module(void) |
1016 | { | 1016 | { |
1017 | de620_dev = de620_probe(-1); | 1017 | de620_dev = de620_probe(-1); |
1018 | if (IS_ERR(de620_dev)) | 1018 | if (IS_ERR(de620_dev)) |
diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c index 430c628279b3..fb9dae302dcc 100644 --- a/drivers/net/dl2k.c +++ b/drivers/net/dl2k.c | |||
@@ -50,8 +50,8 @@ | |||
50 | 50 | ||
51 | */ | 51 | */ |
52 | #define DRV_NAME "D-Link DL2000-based linux driver" | 52 | #define DRV_NAME "D-Link DL2000-based linux driver" |
53 | #define DRV_VERSION "v1.17a" | 53 | #define DRV_VERSION "v1.17b" |
54 | #define DRV_RELDATE "2002/10/04" | 54 | #define DRV_RELDATE "2006/03/10" |
55 | #include "dl2k.h" | 55 | #include "dl2k.h" |
56 | 56 | ||
57 | static char version[] __devinitdata = | 57 | static char version[] __devinitdata = |
@@ -765,7 +765,7 @@ rio_free_tx (struct net_device *dev, int irq) | |||
765 | break; | 765 | break; |
766 | skb = np->tx_skbuff[entry]; | 766 | skb = np->tx_skbuff[entry]; |
767 | pci_unmap_single (np->pdev, | 767 | pci_unmap_single (np->pdev, |
768 | np->tx_ring[entry].fraginfo, | 768 | np->tx_ring[entry].fraginfo & 0xffffffffffff, |
769 | skb->len, PCI_DMA_TODEVICE); | 769 | skb->len, PCI_DMA_TODEVICE); |
770 | if (irq) | 770 | if (irq) |
771 | dev_kfree_skb_irq (skb); | 771 | dev_kfree_skb_irq (skb); |
@@ -892,14 +892,16 @@ receive_packet (struct net_device *dev) | |||
892 | 892 | ||
893 | /* Small skbuffs for short packets */ | 893 | /* Small skbuffs for short packets */ |
894 | if (pkt_len > copy_thresh) { | 894 | if (pkt_len > copy_thresh) { |
895 | pci_unmap_single (np->pdev, desc->fraginfo, | 895 | pci_unmap_single (np->pdev, |
896 | desc->fraginfo & 0xffffffffffff, | ||
896 | np->rx_buf_sz, | 897 | np->rx_buf_sz, |
897 | PCI_DMA_FROMDEVICE); | 898 | PCI_DMA_FROMDEVICE); |
898 | skb_put (skb = np->rx_skbuff[entry], pkt_len); | 899 | skb_put (skb = np->rx_skbuff[entry], pkt_len); |
899 | np->rx_skbuff[entry] = NULL; | 900 | np->rx_skbuff[entry] = NULL; |
900 | } else if ((skb = dev_alloc_skb (pkt_len + 2)) != NULL) { | 901 | } else if ((skb = dev_alloc_skb (pkt_len + 2)) != NULL) { |
901 | pci_dma_sync_single_for_cpu(np->pdev, | 902 | pci_dma_sync_single_for_cpu(np->pdev, |
902 | desc->fraginfo, | 903 | desc->fraginfo & |
904 | 0xffffffffffff, | ||
903 | np->rx_buf_sz, | 905 | np->rx_buf_sz, |
904 | PCI_DMA_FROMDEVICE); | 906 | PCI_DMA_FROMDEVICE); |
905 | skb->dev = dev; | 907 | skb->dev = dev; |
@@ -910,7 +912,8 @@ receive_packet (struct net_device *dev) | |||
910 | pkt_len, 0); | 912 | pkt_len, 0); |
911 | skb_put (skb, pkt_len); | 913 | skb_put (skb, pkt_len); |
912 | pci_dma_sync_single_for_device(np->pdev, | 914 | pci_dma_sync_single_for_device(np->pdev, |
913 | desc->fraginfo, | 915 | desc->fraginfo & |
916 | 0xffffffffffff, | ||
914 | np->rx_buf_sz, | 917 | np->rx_buf_sz, |
915 | PCI_DMA_FROMDEVICE); | 918 | PCI_DMA_FROMDEVICE); |
916 | } | 919 | } |
@@ -1796,8 +1799,9 @@ rio_close (struct net_device *dev) | |||
1796 | np->rx_ring[i].fraginfo = 0; | 1799 | np->rx_ring[i].fraginfo = 0; |
1797 | skb = np->rx_skbuff[i]; | 1800 | skb = np->rx_skbuff[i]; |
1798 | if (skb) { | 1801 | if (skb) { |
1799 | pci_unmap_single (np->pdev, np->rx_ring[i].fraginfo, | 1802 | pci_unmap_single(np->pdev, |
1800 | skb->len, PCI_DMA_FROMDEVICE); | 1803 | np->rx_ring[i].fraginfo & 0xffffffffffff, |
1804 | skb->len, PCI_DMA_FROMDEVICE); | ||
1801 | dev_kfree_skb (skb); | 1805 | dev_kfree_skb (skb); |
1802 | np->rx_skbuff[i] = NULL; | 1806 | np->rx_skbuff[i] = NULL; |
1803 | } | 1807 | } |
@@ -1805,8 +1809,9 @@ rio_close (struct net_device *dev) | |||
1805 | for (i = 0; i < TX_RING_SIZE; i++) { | 1809 | for (i = 0; i < TX_RING_SIZE; i++) { |
1806 | skb = np->tx_skbuff[i]; | 1810 | skb = np->tx_skbuff[i]; |
1807 | if (skb) { | 1811 | if (skb) { |
1808 | pci_unmap_single (np->pdev, np->tx_ring[i].fraginfo, | 1812 | pci_unmap_single(np->pdev, |
1809 | skb->len, PCI_DMA_TODEVICE); | 1813 | np->tx_ring[i].fraginfo & 0xffffffffffff, |
1814 | skb->len, PCI_DMA_TODEVICE); | ||
1810 | dev_kfree_skb (skb); | 1815 | dev_kfree_skb (skb); |
1811 | np->tx_skbuff[i] = NULL; | 1816 | np->tx_skbuff[i] = NULL; |
1812 | } | 1817 | } |
diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h index 27c77306193b..99baf0e099fc 100644 --- a/drivers/net/e1000/e1000.h +++ b/drivers/net/e1000/e1000.h | |||
@@ -225,9 +225,6 @@ struct e1000_rx_ring { | |||
225 | struct e1000_ps_page *ps_page; | 225 | struct e1000_ps_page *ps_page; |
226 | struct e1000_ps_page_dma *ps_page_dma; | 226 | struct e1000_ps_page_dma *ps_page_dma; |
227 | 227 | ||
228 | struct sk_buff *rx_skb_top; | ||
229 | struct sk_buff *rx_skb_prev; | ||
230 | |||
231 | /* cpu for rx queue */ | 228 | /* cpu for rx queue */ |
232 | int cpu; | 229 | int cpu; |
233 | 230 | ||
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 31e332935e5a..4c4db96d0b7b 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -103,7 +103,7 @@ static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver"; | |||
103 | #else | 103 | #else |
104 | #define DRIVERNAPI "-NAPI" | 104 | #define DRIVERNAPI "-NAPI" |
105 | #endif | 105 | #endif |
106 | #define DRV_VERSION "6.3.9-k2"DRIVERNAPI | 106 | #define DRV_VERSION "6.3.9-k4"DRIVERNAPI |
107 | char e1000_driver_version[] = DRV_VERSION; | 107 | char e1000_driver_version[] = DRV_VERSION; |
108 | static char e1000_copyright[] = "Copyright (c) 1999-2005 Intel Corporation."; | 108 | static char e1000_copyright[] = "Copyright (c) 1999-2005 Intel Corporation."; |
109 | 109 | ||
@@ -1635,8 +1635,6 @@ setup_rx_desc_die: | |||
1635 | 1635 | ||
1636 | rxdr->next_to_clean = 0; | 1636 | rxdr->next_to_clean = 0; |
1637 | rxdr->next_to_use = 0; | 1637 | rxdr->next_to_use = 0; |
1638 | rxdr->rx_skb_top = NULL; | ||
1639 | rxdr->rx_skb_prev = NULL; | ||
1640 | 1638 | ||
1641 | return 0; | 1639 | return 0; |
1642 | } | 1640 | } |
@@ -1713,8 +1711,23 @@ e1000_setup_rctl(struct e1000_adapter *adapter) | |||
1713 | rctl |= adapter->rx_buffer_len << 0x11; | 1711 | rctl |= adapter->rx_buffer_len << 0x11; |
1714 | } else { | 1712 | } else { |
1715 | rctl &= ~E1000_RCTL_SZ_4096; | 1713 | rctl &= ~E1000_RCTL_SZ_4096; |
1716 | rctl &= ~E1000_RCTL_BSEX; | 1714 | rctl |= E1000_RCTL_BSEX; |
1717 | rctl |= E1000_RCTL_SZ_2048; | 1715 | switch (adapter->rx_buffer_len) { |
1716 | case E1000_RXBUFFER_2048: | ||
1717 | default: | ||
1718 | rctl |= E1000_RCTL_SZ_2048; | ||
1719 | rctl &= ~E1000_RCTL_BSEX; | ||
1720 | break; | ||
1721 | case E1000_RXBUFFER_4096: | ||
1722 | rctl |= E1000_RCTL_SZ_4096; | ||
1723 | break; | ||
1724 | case E1000_RXBUFFER_8192: | ||
1725 | rctl |= E1000_RCTL_SZ_8192; | ||
1726 | break; | ||
1727 | case E1000_RXBUFFER_16384: | ||
1728 | rctl |= E1000_RCTL_SZ_16384; | ||
1729 | break; | ||
1730 | } | ||
1718 | } | 1731 | } |
1719 | 1732 | ||
1720 | #ifndef CONFIG_E1000_DISABLE_PACKET_SPLIT | 1733 | #ifndef CONFIG_E1000_DISABLE_PACKET_SPLIT |
@@ -2107,16 +2120,6 @@ e1000_clean_rx_ring(struct e1000_adapter *adapter, | |||
2107 | } | 2120 | } |
2108 | } | 2121 | } |
2109 | 2122 | ||
2110 | /* there also may be some cached data in our adapter */ | ||
2111 | if (rx_ring->rx_skb_top) { | ||
2112 | dev_kfree_skb(rx_ring->rx_skb_top); | ||
2113 | |||
2114 | /* rx_skb_prev will be wiped out by rx_skb_top */ | ||
2115 | rx_ring->rx_skb_top = NULL; | ||
2116 | rx_ring->rx_skb_prev = NULL; | ||
2117 | } | ||
2118 | |||
2119 | |||
2120 | size = sizeof(struct e1000_buffer) * rx_ring->count; | 2123 | size = sizeof(struct e1000_buffer) * rx_ring->count; |
2121 | memset(rx_ring->buffer_info, 0, size); | 2124 | memset(rx_ring->buffer_info, 0, size); |
2122 | size = sizeof(struct e1000_ps_page) * rx_ring->count; | 2125 | size = sizeof(struct e1000_ps_page) * rx_ring->count; |
@@ -2914,7 +2917,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
2914 | if (!__pskb_pull_tail(skb, pull_size)) { | 2917 | if (!__pskb_pull_tail(skb, pull_size)) { |
2915 | printk(KERN_ERR "__pskb_pull_tail failed.\n"); | 2918 | printk(KERN_ERR "__pskb_pull_tail failed.\n"); |
2916 | dev_kfree_skb_any(skb); | 2919 | dev_kfree_skb_any(skb); |
2917 | return -EFAULT; | 2920 | return NETDEV_TX_OK; |
2918 | } | 2921 | } |
2919 | len = skb->len - skb->data_len; | 2922 | len = skb->len - skb->data_len; |
2920 | } | 2923 | } |
@@ -3106,24 +3109,27 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu) | |||
3106 | break; | 3109 | break; |
3107 | } | 3110 | } |
3108 | 3111 | ||
3109 | /* since the driver code now supports splitting a packet across | 3112 | |
3110 | * multiple descriptors, most of the fifo related limitations on | ||
3111 | * jumbo frame traffic have gone away. | ||
3112 | * simply use 2k descriptors for everything. | ||
3113 | * | ||
3114 | * NOTE: dev_alloc_skb reserves 16 bytes, and typically NET_IP_ALIGN | ||
3115 | * means we reserve 2 more, this pushes us to allocate from the next | ||
3116 | * larger slab size | ||
3117 | * i.e. RXBUFFER_2048 --> size-4096 slab */ | ||
3118 | |||
3119 | /* recent hardware supports 1KB granularity */ | ||
3120 | if (adapter->hw.mac_type > e1000_82547_rev_2) { | 3113 | if (adapter->hw.mac_type > e1000_82547_rev_2) { |
3121 | adapter->rx_buffer_len = | 3114 | adapter->rx_buffer_len = max_frame; |
3122 | ((max_frame < E1000_RXBUFFER_2048) ? | ||
3123 | max_frame : E1000_RXBUFFER_2048); | ||
3124 | E1000_ROUNDUP(adapter->rx_buffer_len, 1024); | 3115 | E1000_ROUNDUP(adapter->rx_buffer_len, 1024); |
3125 | } else | 3116 | } else { |
3126 | adapter->rx_buffer_len = E1000_RXBUFFER_2048; | 3117 | if(unlikely((adapter->hw.mac_type < e1000_82543) && |
3118 | (max_frame > MAXIMUM_ETHERNET_FRAME_SIZE))) { | ||
3119 | DPRINTK(PROBE, ERR, "Jumbo Frames not supported " | ||
3120 | "on 82542\n"); | ||
3121 | return -EINVAL; | ||
3122 | } else { | ||
3123 | if(max_frame <= E1000_RXBUFFER_2048) | ||
3124 | adapter->rx_buffer_len = E1000_RXBUFFER_2048; | ||
3125 | else if(max_frame <= E1000_RXBUFFER_4096) | ||
3126 | adapter->rx_buffer_len = E1000_RXBUFFER_4096; | ||
3127 | else if(max_frame <= E1000_RXBUFFER_8192) | ||
3128 | adapter->rx_buffer_len = E1000_RXBUFFER_8192; | ||
3129 | else if(max_frame <= E1000_RXBUFFER_16384) | ||
3130 | adapter->rx_buffer_len = E1000_RXBUFFER_16384; | ||
3131 | } | ||
3132 | } | ||
3127 | 3133 | ||
3128 | netdev->mtu = new_mtu; | 3134 | netdev->mtu = new_mtu; |
3129 | 3135 | ||
@@ -3620,7 +3626,7 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter, | |||
3620 | uint8_t last_byte; | 3626 | uint8_t last_byte; |
3621 | unsigned int i; | 3627 | unsigned int i; |
3622 | int cleaned_count = 0; | 3628 | int cleaned_count = 0; |
3623 | boolean_t cleaned = FALSE, multi_descriptor = FALSE; | 3629 | boolean_t cleaned = FALSE; |
3624 | 3630 | ||
3625 | i = rx_ring->next_to_clean; | 3631 | i = rx_ring->next_to_clean; |
3626 | rx_desc = E1000_RX_DESC(*rx_ring, i); | 3632 | rx_desc = E1000_RX_DESC(*rx_ring, i); |
@@ -3652,43 +3658,12 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter, | |||
3652 | 3658 | ||
3653 | length = le16_to_cpu(rx_desc->length); | 3659 | length = le16_to_cpu(rx_desc->length); |
3654 | 3660 | ||
3655 | skb_put(skb, length); | 3661 | if (unlikely(!(status & E1000_RXD_STAT_EOP))) { |
3656 | 3662 | /* All receives must fit into a single buffer */ | |
3657 | if (!(status & E1000_RXD_STAT_EOP)) { | 3663 | E1000_DBG("%s: Receive packet consumed multiple" |
3658 | if (!rx_ring->rx_skb_top) { | 3664 | " buffers\n", netdev->name); |
3659 | rx_ring->rx_skb_top = skb; | 3665 | dev_kfree_skb_irq(skb); |
3660 | rx_ring->rx_skb_top->len = length; | ||
3661 | rx_ring->rx_skb_prev = skb; | ||
3662 | } else { | ||
3663 | if (skb_shinfo(rx_ring->rx_skb_top)->frag_list) { | ||
3664 | rx_ring->rx_skb_prev->next = skb; | ||
3665 | skb->prev = rx_ring->rx_skb_prev; | ||
3666 | } else { | ||
3667 | skb_shinfo(rx_ring->rx_skb_top)->frag_list = skb; | ||
3668 | } | ||
3669 | rx_ring->rx_skb_prev = skb; | ||
3670 | rx_ring->rx_skb_top->data_len += length; | ||
3671 | } | ||
3672 | goto next_desc; | 3666 | goto next_desc; |
3673 | } else { | ||
3674 | if (rx_ring->rx_skb_top) { | ||
3675 | if (skb_shinfo(rx_ring->rx_skb_top) | ||
3676 | ->frag_list) { | ||
3677 | rx_ring->rx_skb_prev->next = skb; | ||
3678 | skb->prev = rx_ring->rx_skb_prev; | ||
3679 | } else | ||
3680 | skb_shinfo(rx_ring->rx_skb_top) | ||
3681 | ->frag_list = skb; | ||
3682 | |||
3683 | rx_ring->rx_skb_top->data_len += length; | ||
3684 | rx_ring->rx_skb_top->len += | ||
3685 | rx_ring->rx_skb_top->data_len; | ||
3686 | |||
3687 | skb = rx_ring->rx_skb_top; | ||
3688 | multi_descriptor = TRUE; | ||
3689 | rx_ring->rx_skb_top = NULL; | ||
3690 | rx_ring->rx_skb_prev = NULL; | ||
3691 | } | ||
3692 | } | 3667 | } |
3693 | 3668 | ||
3694 | if (unlikely(rx_desc->errors & E1000_RXD_ERR_FRAME_ERR_MASK)) { | 3669 | if (unlikely(rx_desc->errors & E1000_RXD_ERR_FRAME_ERR_MASK)) { |
@@ -3712,10 +3687,7 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter, | |||
3712 | * performance for small packets with large amounts | 3687 | * performance for small packets with large amounts |
3713 | * of reassembly being done in the stack */ | 3688 | * of reassembly being done in the stack */ |
3714 | #define E1000_CB_LENGTH 256 | 3689 | #define E1000_CB_LENGTH 256 |
3715 | if ((length < E1000_CB_LENGTH) && | 3690 | if (length < E1000_CB_LENGTH) { |
3716 | !rx_ring->rx_skb_top && | ||
3717 | /* or maybe (status & E1000_RXD_STAT_EOP) && */ | ||
3718 | !multi_descriptor) { | ||
3719 | struct sk_buff *new_skb = | 3691 | struct sk_buff *new_skb = |
3720 | dev_alloc_skb(length + NET_IP_ALIGN); | 3692 | dev_alloc_skb(length + NET_IP_ALIGN); |
3721 | if (new_skb) { | 3693 | if (new_skb) { |
@@ -3729,7 +3701,8 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter, | |||
3729 | skb = new_skb; | 3701 | skb = new_skb; |
3730 | skb_put(skb, length); | 3702 | skb_put(skb, length); |
3731 | } | 3703 | } |
3732 | } | 3704 | } else |
3705 | skb_put(skb, length); | ||
3733 | 3706 | ||
3734 | /* end copybreak code */ | 3707 | /* end copybreak code */ |
3735 | 3708 | ||
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 01ddfc8cce3f..aa5581369399 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -806,6 +806,7 @@ static struct pcmcia_device_id axnet_ids[] = { | |||
806 | PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0309), | 806 | PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0309), |
807 | PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1106), | 807 | PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1106), |
808 | PCMCIA_DEVICE_MANF_CARD(0x8a01, 0xc1ab), | 808 | PCMCIA_DEVICE_MANF_CARD(0x8a01, 0xc1ab), |
809 | PCMCIA_DEVICE_PROD_ID12("AmbiCom,Inc.", "Fast Ethernet PC Card(AMB8110)", 0x49b020a7, 0x119cc9fc), | ||
809 | PCMCIA_DEVICE_PROD_ID124("Fast Ethernet", "16-bit PC Card", "AX88190", 0xb4be14e3, 0x9a12eb6a, 0xab9be5ef), | 810 | PCMCIA_DEVICE_PROD_ID124("Fast Ethernet", "16-bit PC Card", "AX88190", 0xb4be14e3, 0x9a12eb6a, 0xab9be5ef), |
810 | PCMCIA_DEVICE_PROD_ID12("ASIX", "AX88190", 0x0959823b, 0xab9be5ef), | 811 | PCMCIA_DEVICE_PROD_ID12("ASIX", "AX88190", 0x0959823b, 0xab9be5ef), |
811 | PCMCIA_DEVICE_PROD_ID12("Billionton", "LNA-100B", 0x552ab682, 0xbc3b87e1), | 812 | PCMCIA_DEVICE_PROD_ID12("Billionton", "LNA-100B", 0x552ab682, 0xbc3b87e1), |
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 49b597cbc19a..b7f00d6eb6a6 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -4092,6 +4092,7 @@ static void s2io_set_multicast(struct net_device *dev) | |||
4092 | i++, mclist = mclist->next) { | 4092 | i++, mclist = mclist->next) { |
4093 | memcpy(sp->usr_addrs[i].addr, mclist->dmi_addr, | 4093 | memcpy(sp->usr_addrs[i].addr, mclist->dmi_addr, |
4094 | ETH_ALEN); | 4094 | ETH_ALEN); |
4095 | mac_addr = 0; | ||
4095 | for (j = 0; j < ETH_ALEN; j++) { | 4096 | for (j = 0; j < ETH_ALEN; j++) { |
4096 | mac_addr |= mclist->dmi_addr[j]; | 4097 | mac_addr |= mclist->dmi_addr[j]; |
4097 | mac_addr <<= 8; | 4098 | mac_addr <<= 8; |
diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c index 3d95fa20cd88..7a952fe60be2 100644 --- a/drivers/net/sis900.c +++ b/drivers/net/sis900.c | |||
@@ -540,7 +540,7 @@ static int __devinit sis900_probe(struct pci_dev *pci_dev, | |||
540 | printk("%2.2x.\n", net_dev->dev_addr[i]); | 540 | printk("%2.2x.\n", net_dev->dev_addr[i]); |
541 | 541 | ||
542 | /* Detect Wake on Lan support */ | 542 | /* Detect Wake on Lan support */ |
543 | ret = inl(CFGPMC & PMESP); | 543 | ret = (inl(net_dev->base_addr + CFGPMC) & PMESP) >> 27; |
544 | if (netif_msg_probe(sis_priv) && (ret & PME_D3C) == 0) | 544 | if (netif_msg_probe(sis_priv) && (ret & PME_D3C) == 0) |
545 | printk(KERN_INFO "%s: Wake on LAN only available from suspend to RAM.", net_dev->name); | 545 | printk(KERN_INFO "%s: Wake on LAN only available from suspend to RAM.", net_dev->name); |
546 | 546 | ||
@@ -2040,7 +2040,7 @@ static int sis900_set_wol(struct net_device *net_dev, struct ethtool_wolinfo *wo | |||
2040 | 2040 | ||
2041 | if (wol->wolopts == 0) { | 2041 | if (wol->wolopts == 0) { |
2042 | pci_read_config_dword(sis_priv->pci_dev, CFGPMCSR, &cfgpmcsr); | 2042 | pci_read_config_dword(sis_priv->pci_dev, CFGPMCSR, &cfgpmcsr); |
2043 | cfgpmcsr |= ~PME_EN; | 2043 | cfgpmcsr &= ~PME_EN; |
2044 | pci_write_config_dword(sis_priv->pci_dev, CFGPMCSR, cfgpmcsr); | 2044 | pci_write_config_dword(sis_priv->pci_dev, CFGPMCSR, cfgpmcsr); |
2045 | outl(pmctrl_bits, pmctrl_addr); | 2045 | outl(pmctrl_bits, pmctrl_addr); |
2046 | if (netif_msg_wol(sis_priv)) | 2046 | if (netif_msg_wol(sis_priv)) |
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index ca8160d68229..73260364cba3 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -74,7 +74,7 @@ | |||
74 | #define TX_RING_SIZE 512 | 74 | #define TX_RING_SIZE 512 |
75 | #define TX_DEF_PENDING (TX_RING_SIZE - 1) | 75 | #define TX_DEF_PENDING (TX_RING_SIZE - 1) |
76 | #define TX_MIN_PENDING 64 | 76 | #define TX_MIN_PENDING 64 |
77 | #define MAX_SKB_TX_LE (4 + 2*MAX_SKB_FRAGS) | 77 | #define MAX_SKB_TX_LE (4 + (sizeof(dma_addr_t)/sizeof(u32))*MAX_SKB_FRAGS) |
78 | 78 | ||
79 | #define STATUS_RING_SIZE 2048 /* 2 ports * (TX + 2*RX) */ | 79 | #define STATUS_RING_SIZE 2048 /* 2 ports * (TX + 2*RX) */ |
80 | #define STATUS_LE_BYTES (STATUS_RING_SIZE*sizeof(struct sky2_status_le)) | 80 | #define STATUS_LE_BYTES (STATUS_RING_SIZE*sizeof(struct sky2_status_le)) |
@@ -96,10 +96,6 @@ static int copybreak __read_mostly = 256; | |||
96 | module_param(copybreak, int, 0); | 96 | module_param(copybreak, int, 0); |
97 | MODULE_PARM_DESC(copybreak, "Receive copy threshold"); | 97 | MODULE_PARM_DESC(copybreak, "Receive copy threshold"); |
98 | 98 | ||
99 | static int disable_msi = 0; | ||
100 | module_param(disable_msi, int, 0); | ||
101 | MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)"); | ||
102 | |||
103 | static const struct pci_device_id sky2_id_table[] = { | 99 | static const struct pci_device_id sky2_id_table[] = { |
104 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) }, | 100 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) }, |
105 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) }, | 101 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) }, |
@@ -626,8 +622,8 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port) | |||
626 | 622 | ||
627 | /* Configure Rx MAC FIFO */ | 623 | /* Configure Rx MAC FIFO */ |
628 | sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_CLR); | 624 | sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_CLR); |
629 | sky2_write16(hw, SK_REG(port, RX_GMF_CTRL_T), | 625 | sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T), |
630 | GMF_RX_CTRL_DEF); | 626 | GMF_OPER_ON | GMF_RX_F_FL_ON); |
631 | 627 | ||
632 | /* Flush Rx MAC FIFO on any flow control or error */ | 628 | /* Flush Rx MAC FIFO on any flow control or error */ |
633 | sky2_write16(hw, SK_REG(port, RX_GMF_FL_MSK), GMR_FS_ANY_ERR); | 629 | sky2_write16(hw, SK_REG(port, RX_GMF_FL_MSK), GMR_FS_ANY_ERR); |
@@ -999,6 +995,10 @@ static int sky2_rx_start(struct sky2_port *sky2) | |||
999 | sky2_rx_add(sky2, re->mapaddr); | 995 | sky2_rx_add(sky2, re->mapaddr); |
1000 | } | 996 | } |
1001 | 997 | ||
998 | /* Truncate oversize frames */ | ||
999 | sky2_write16(hw, SK_REG(sky2->port, RX_GMF_TR_THR), sky2->rx_bufsize - 8); | ||
1000 | sky2_write32(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), RX_TRUNC_ON); | ||
1001 | |||
1002 | /* Tell chip about available buffers */ | 1002 | /* Tell chip about available buffers */ |
1003 | sky2_write16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX), sky2->rx_put); | 1003 | sky2_write16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX), sky2->rx_put); |
1004 | sky2->rx_last_put = sky2_read16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX)); | 1004 | sky2->rx_last_put = sky2_read16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX)); |
@@ -1149,6 +1149,7 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev) | |||
1149 | struct sky2_tx_le *le = NULL; | 1149 | struct sky2_tx_le *le = NULL; |
1150 | struct tx_ring_info *re; | 1150 | struct tx_ring_info *re; |
1151 | unsigned i, len; | 1151 | unsigned i, len; |
1152 | int avail; | ||
1152 | dma_addr_t mapping; | 1153 | dma_addr_t mapping; |
1153 | u32 addr64; | 1154 | u32 addr64; |
1154 | u16 mss; | 1155 | u16 mss; |
@@ -1291,12 +1292,16 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev) | |||
1291 | re->idx = sky2->tx_prod; | 1292 | re->idx = sky2->tx_prod; |
1292 | le->ctrl |= EOP; | 1293 | le->ctrl |= EOP; |
1293 | 1294 | ||
1295 | avail = tx_avail(sky2); | ||
1296 | if (mss != 0 || avail < TX_MIN_PENDING) { | ||
1297 | le->ctrl |= FRC_STAT; | ||
1298 | if (avail <= MAX_SKB_TX_LE) | ||
1299 | netif_stop_queue(dev); | ||
1300 | } | ||
1301 | |||
1294 | sky2_put_idx(hw, txqaddr[sky2->port], sky2->tx_prod, | 1302 | sky2_put_idx(hw, txqaddr[sky2->port], sky2->tx_prod, |
1295 | &sky2->tx_last_put, TX_RING_SIZE); | 1303 | &sky2->tx_last_put, TX_RING_SIZE); |
1296 | 1304 | ||
1297 | if (tx_avail(sky2) <= MAX_SKB_TX_LE) | ||
1298 | netif_stop_queue(dev); | ||
1299 | |||
1300 | out_unlock: | 1305 | out_unlock: |
1301 | spin_unlock(&sky2->tx_lock); | 1306 | spin_unlock(&sky2->tx_lock); |
1302 | 1307 | ||
@@ -1711,10 +1716,12 @@ static void sky2_tx_timeout(struct net_device *dev) | |||
1711 | 1716 | ||
1712 | 1717 | ||
1713 | #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) | 1718 | #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) |
1714 | /* Want receive buffer size to be multiple of 64 bits, and incl room for vlan */ | 1719 | /* Want receive buffer size to be multiple of 64 bits |
1720 | * and incl room for vlan and truncation | ||
1721 | */ | ||
1715 | static inline unsigned sky2_buf_size(int mtu) | 1722 | static inline unsigned sky2_buf_size(int mtu) |
1716 | { | 1723 | { |
1717 | return roundup(mtu + ETH_HLEN + 4, 8); | 1724 | return roundup(mtu + ETH_HLEN + VLAN_HLEN, 8) + 8; |
1718 | } | 1725 | } |
1719 | 1726 | ||
1720 | static int sky2_change_mtu(struct net_device *dev, int new_mtu) | 1727 | static int sky2_change_mtu(struct net_device *dev, int new_mtu) |
@@ -1797,7 +1804,7 @@ static struct sk_buff *sky2_receive(struct sky2_port *sky2, | |||
1797 | if (!(status & GMR_FS_RX_OK)) | 1804 | if (!(status & GMR_FS_RX_OK)) |
1798 | goto resubmit; | 1805 | goto resubmit; |
1799 | 1806 | ||
1800 | if ((status >> 16) != length || length > sky2->rx_bufsize) | 1807 | if (length > sky2->netdev->mtu + ETH_HLEN) |
1801 | goto oversize; | 1808 | goto oversize; |
1802 | 1809 | ||
1803 | if (length < copybreak) { | 1810 | if (length < copybreak) { |
@@ -3126,61 +3133,6 @@ static void __devinit sky2_show_addr(struct net_device *dev) | |||
3126 | dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]); | 3133 | dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]); |
3127 | } | 3134 | } |
3128 | 3135 | ||
3129 | /* Handle software interrupt used during MSI test */ | ||
3130 | static irqreturn_t __devinit sky2_test_intr(int irq, void *dev_id, | ||
3131 | struct pt_regs *regs) | ||
3132 | { | ||
3133 | struct sky2_hw *hw = dev_id; | ||
3134 | u32 status = sky2_read32(hw, B0_Y2_SP_ISRC2); | ||
3135 | |||
3136 | if (status == 0) | ||
3137 | return IRQ_NONE; | ||
3138 | |||
3139 | if (status & Y2_IS_IRQ_SW) { | ||
3140 | sky2_write8(hw, B0_CTST, CS_CL_SW_IRQ); | ||
3141 | hw->msi = 1; | ||
3142 | } | ||
3143 | sky2_write32(hw, B0_Y2_SP_ICR, 2); | ||
3144 | |||
3145 | sky2_read32(hw, B0_IMSK); | ||
3146 | return IRQ_HANDLED; | ||
3147 | } | ||
3148 | |||
3149 | /* Test interrupt path by forcing a a software IRQ */ | ||
3150 | static int __devinit sky2_test_msi(struct sky2_hw *hw) | ||
3151 | { | ||
3152 | struct pci_dev *pdev = hw->pdev; | ||
3153 | int i, err; | ||
3154 | |||
3155 | sky2_write32(hw, B0_IMSK, Y2_IS_IRQ_SW); | ||
3156 | |||
3157 | err = request_irq(pdev->irq, sky2_test_intr, SA_SHIRQ, DRV_NAME, hw); | ||
3158 | if (err) { | ||
3159 | printk(KERN_ERR PFX "%s: cannot assign irq %d\n", | ||
3160 | pci_name(pdev), pdev->irq); | ||
3161 | return err; | ||
3162 | } | ||
3163 | |||
3164 | sky2_write8(hw, B0_CTST, CS_ST_SW_IRQ); | ||
3165 | wmb(); | ||
3166 | |||
3167 | for (i = 0; i < 10; i++) { | ||
3168 | barrier(); | ||
3169 | if (hw->msi) | ||
3170 | goto found; | ||
3171 | mdelay(1); | ||
3172 | } | ||
3173 | |||
3174 | err = -EOPNOTSUPP; | ||
3175 | sky2_write8(hw, B0_CTST, CS_CL_SW_IRQ); | ||
3176 | found: | ||
3177 | sky2_write32(hw, B0_IMSK, 0); | ||
3178 | |||
3179 | free_irq(pdev->irq, hw); | ||
3180 | |||
3181 | return err; | ||
3182 | } | ||
3183 | |||
3184 | static int __devinit sky2_probe(struct pci_dev *pdev, | 3136 | static int __devinit sky2_probe(struct pci_dev *pdev, |
3185 | const struct pci_device_id *ent) | 3137 | const struct pci_device_id *ent) |
3186 | { | 3138 | { |
@@ -3302,22 +3254,7 @@ static int __devinit sky2_probe(struct pci_dev *pdev, | |||
3302 | } | 3254 | } |
3303 | } | 3255 | } |
3304 | 3256 | ||
3305 | if (!disable_msi && pci_enable_msi(pdev) == 0) { | 3257 | err = request_irq(pdev->irq, sky2_intr, SA_SHIRQ, DRV_NAME, hw); |
3306 | err = sky2_test_msi(hw); | ||
3307 | if (err == -EOPNOTSUPP) { | ||
3308 | /* MSI test failed, go back to INTx mode */ | ||
3309 | printk(KERN_WARNING PFX "%s: No interrupt was generated using MSI, " | ||
3310 | "switching to INTx mode. Please report this failure to " | ||
3311 | "the PCI maintainer and include system chipset information.\n", | ||
3312 | pci_name(pdev)); | ||
3313 | pci_disable_msi(pdev); | ||
3314 | } | ||
3315 | else if (err) | ||
3316 | goto err_out_unregister; | ||
3317 | } | ||
3318 | |||
3319 | err = request_irq(pdev->irq, sky2_intr, SA_SHIRQ | SA_SAMPLE_RANDOM, | ||
3320 | DRV_NAME, hw); | ||
3321 | if (err) { | 3258 | if (err) { |
3322 | printk(KERN_ERR PFX "%s: cannot assign irq %d\n", | 3259 | printk(KERN_ERR PFX "%s: cannot assign irq %d\n", |
3323 | pci_name(pdev), pdev->irq); | 3260 | pci_name(pdev), pdev->irq); |
@@ -3332,8 +3269,6 @@ static int __devinit sky2_probe(struct pci_dev *pdev, | |||
3332 | return 0; | 3269 | return 0; |
3333 | 3270 | ||
3334 | err_out_unregister: | 3271 | err_out_unregister: |
3335 | if (hw->msi) | ||
3336 | pci_disable_msi(pdev); | ||
3337 | if (dev1) { | 3272 | if (dev1) { |
3338 | unregister_netdev(dev1); | 3273 | unregister_netdev(dev1); |
3339 | free_netdev(dev1); | 3274 | free_netdev(dev1); |
@@ -3376,8 +3311,6 @@ static void __devexit sky2_remove(struct pci_dev *pdev) | |||
3376 | sky2_read8(hw, B0_CTST); | 3311 | sky2_read8(hw, B0_CTST); |
3377 | 3312 | ||
3378 | free_irq(pdev->irq, hw); | 3313 | free_irq(pdev->irq, hw); |
3379 | if (hw->msi) | ||
3380 | pci_disable_msi(pdev); | ||
3381 | pci_free_consistent(pdev, STATUS_LE_BYTES, hw->st_le, hw->st_dma); | 3314 | pci_free_consistent(pdev, STATUS_LE_BYTES, hw->st_le, hw->st_dma); |
3382 | pci_release_regions(pdev); | 3315 | pci_release_regions(pdev); |
3383 | pci_disable_device(pdev); | 3316 | pci_disable_device(pdev); |
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h index 3edb98075e0a..dce955c76f3c 100644 --- a/drivers/net/sky2.h +++ b/drivers/net/sky2.h | |||
@@ -1881,7 +1881,6 @@ struct sky2_hw { | |||
1881 | u32 intr_mask; | 1881 | u32 intr_mask; |
1882 | 1882 | ||
1883 | int pm_cap; | 1883 | int pm_cap; |
1884 | int msi; | ||
1885 | u8 chip_id; | 1884 | u8 chip_id; |
1886 | u8 chip_rev; | 1885 | u8 chip_rev; |
1887 | u8 copper; | 1886 | u8 copper; |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index e7dc653d5bd6..b8f1524da557 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -3532,9 +3532,23 @@ static inline int tg3_4g_overflow_test(dma_addr_t mapping, int len) | |||
3532 | (base + len + 8 < base)); | 3532 | (base + len + 8 < base)); |
3533 | } | 3533 | } |
3534 | 3534 | ||
3535 | /* Test for DMA addresses > 40-bit */ | ||
3536 | static inline int tg3_40bit_overflow_test(struct tg3 *tp, dma_addr_t mapping, | ||
3537 | int len) | ||
3538 | { | ||
3539 | #if defined(CONFIG_HIGHMEM) && (BITS_PER_LONG == 64) | ||
3540 | if (tp->tg3_flags2 & TG3_FLG2_5780_CLASS) | ||
3541 | return (((u64) mapping + len) > DMA_40BIT_MASK); | ||
3542 | return 0; | ||
3543 | #else | ||
3544 | return 0; | ||
3545 | #endif | ||
3546 | } | ||
3547 | |||
3535 | static void tg3_set_txd(struct tg3 *, int, dma_addr_t, int, u32, u32); | 3548 | static void tg3_set_txd(struct tg3 *, int, dma_addr_t, int, u32, u32); |
3536 | 3549 | ||
3537 | static int tigon3_4gb_hwbug_workaround(struct tg3 *tp, struct sk_buff *skb, | 3550 | /* Workaround 4GB and 40-bit hardware DMA bugs. */ |
3551 | static int tigon3_dma_hwbug_workaround(struct tg3 *tp, struct sk_buff *skb, | ||
3538 | u32 last_plus_one, u32 *start, | 3552 | u32 last_plus_one, u32 *start, |
3539 | u32 base_flags, u32 mss) | 3553 | u32 base_flags, u32 mss) |
3540 | { | 3554 | { |
@@ -3742,6 +3756,9 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
3742 | if (tg3_4g_overflow_test(mapping, len)) | 3756 | if (tg3_4g_overflow_test(mapping, len)) |
3743 | would_hit_hwbug = 1; | 3757 | would_hit_hwbug = 1; |
3744 | 3758 | ||
3759 | if (tg3_40bit_overflow_test(tp, mapping, len)) | ||
3760 | would_hit_hwbug = 1; | ||
3761 | |||
3745 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) | 3762 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) |
3746 | tg3_set_txd(tp, entry, mapping, len, | 3763 | tg3_set_txd(tp, entry, mapping, len, |
3747 | base_flags, (i == last)|(mss << 1)); | 3764 | base_flags, (i == last)|(mss << 1)); |
@@ -3763,7 +3780,7 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
3763 | /* If the workaround fails due to memory/mapping | 3780 | /* If the workaround fails due to memory/mapping |
3764 | * failure, silently drop this packet. | 3781 | * failure, silently drop this packet. |
3765 | */ | 3782 | */ |
3766 | if (tigon3_4gb_hwbug_workaround(tp, skb, last_plus_one, | 3783 | if (tigon3_dma_hwbug_workaround(tp, skb, last_plus_one, |
3767 | &start, base_flags, mss)) | 3784 | &start, base_flags, mss)) |
3768 | goto out_unlock; | 3785 | goto out_unlock; |
3769 | 3786 | ||
@@ -9408,6 +9425,15 @@ static int __devinit tg3_is_sun_570X(struct tg3 *tp) | |||
9408 | return 0; | 9425 | return 0; |
9409 | if (venid == PCI_VENDOR_ID_SUN) | 9426 | if (venid == PCI_VENDOR_ID_SUN) |
9410 | return 1; | 9427 | return 1; |
9428 | |||
9429 | /* TG3 chips onboard the SunBlade-2500 don't have the | ||
9430 | * subsystem-vendor-id set to PCI_VENDOR_ID_SUN but they | ||
9431 | * are distinguishable from non-Sun variants by being | ||
9432 | * named "network" by the firmware. Non-Sun cards will | ||
9433 | * show up as being named "ethernet". | ||
9434 | */ | ||
9435 | if (!strcmp(pcp->prom_name, "network")) | ||
9436 | return 1; | ||
9411 | } | 9437 | } |
9412 | return 0; | 9438 | return 0; |
9413 | } | 9439 | } |
@@ -10517,8 +10543,6 @@ static char * __devinit tg3_bus_string(struct tg3 *tp, char *str) | |||
10517 | strcat(str, "66MHz"); | 10543 | strcat(str, "66MHz"); |
10518 | else if (clock_ctrl == 6) | 10544 | else if (clock_ctrl == 6) |
10519 | strcat(str, "100MHz"); | 10545 | strcat(str, "100MHz"); |
10520 | else if (clock_ctrl == 7) | ||
10521 | strcat(str, "133MHz"); | ||
10522 | } else { | 10546 | } else { |
10523 | strcpy(str, "PCI:"); | 10547 | strcpy(str, "PCI:"); |
10524 | if (tp->tg3_flags & TG3_FLAG_PCI_HIGH_SPEED) | 10548 | if (tp->tg3_flags & TG3_FLAG_PCI_HIGH_SPEED) |
@@ -10599,8 +10623,9 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
10599 | unsigned long tg3reg_base, tg3reg_len; | 10623 | unsigned long tg3reg_base, tg3reg_len; |
10600 | struct net_device *dev; | 10624 | struct net_device *dev; |
10601 | struct tg3 *tp; | 10625 | struct tg3 *tp; |
10602 | int i, err, pci_using_dac, pm_cap; | 10626 | int i, err, pm_cap; |
10603 | char str[40]; | 10627 | char str[40]; |
10628 | u64 dma_mask, persist_dma_mask; | ||
10604 | 10629 | ||
10605 | if (tg3_version_printed++ == 0) | 10630 | if (tg3_version_printed++ == 0) |
10606 | printk(KERN_INFO "%s", version); | 10631 | printk(KERN_INFO "%s", version); |
@@ -10637,26 +10662,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
10637 | goto err_out_free_res; | 10662 | goto err_out_free_res; |
10638 | } | 10663 | } |
10639 | 10664 | ||
10640 | /* Configure DMA attributes. */ | ||
10641 | err = pci_set_dma_mask(pdev, DMA_64BIT_MASK); | ||
10642 | if (!err) { | ||
10643 | pci_using_dac = 1; | ||
10644 | err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK); | ||
10645 | if (err < 0) { | ||
10646 | printk(KERN_ERR PFX "Unable to obtain 64 bit DMA " | ||
10647 | "for consistent allocations\n"); | ||
10648 | goto err_out_free_res; | ||
10649 | } | ||
10650 | } else { | ||
10651 | err = pci_set_dma_mask(pdev, DMA_32BIT_MASK); | ||
10652 | if (err) { | ||
10653 | printk(KERN_ERR PFX "No usable DMA configuration, " | ||
10654 | "aborting.\n"); | ||
10655 | goto err_out_free_res; | ||
10656 | } | ||
10657 | pci_using_dac = 0; | ||
10658 | } | ||
10659 | |||
10660 | tg3reg_base = pci_resource_start(pdev, 0); | 10665 | tg3reg_base = pci_resource_start(pdev, 0); |
10661 | tg3reg_len = pci_resource_len(pdev, 0); | 10666 | tg3reg_len = pci_resource_len(pdev, 0); |
10662 | 10667 | ||
@@ -10670,8 +10675,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
10670 | SET_MODULE_OWNER(dev); | 10675 | SET_MODULE_OWNER(dev); |
10671 | SET_NETDEV_DEV(dev, &pdev->dev); | 10676 | SET_NETDEV_DEV(dev, &pdev->dev); |
10672 | 10677 | ||
10673 | if (pci_using_dac) | ||
10674 | dev->features |= NETIF_F_HIGHDMA; | ||
10675 | dev->features |= NETIF_F_LLTX; | 10678 | dev->features |= NETIF_F_LLTX; |
10676 | #if TG3_VLAN_TAG_USED | 10679 | #if TG3_VLAN_TAG_USED |
10677 | dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; | 10680 | dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; |
@@ -10756,6 +10759,44 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
10756 | goto err_out_iounmap; | 10759 | goto err_out_iounmap; |
10757 | } | 10760 | } |
10758 | 10761 | ||
10762 | /* 5714, 5715 and 5780 cannot support DMA addresses > 40-bit. | ||
10763 | * On 64-bit systems with IOMMU, use 40-bit dma_mask. | ||
10764 | * On 64-bit systems without IOMMU, use 64-bit dma_mask and | ||
10765 | * do DMA address check in tg3_start_xmit(). | ||
10766 | */ | ||
10767 | if (tp->tg3_flags2 & TG3_FLG2_5780_CLASS) { | ||
10768 | persist_dma_mask = dma_mask = DMA_40BIT_MASK; | ||
10769 | #ifdef CONFIG_HIGHMEM | ||
10770 | dma_mask = DMA_64BIT_MASK; | ||
10771 | #endif | ||
10772 | } else if (tp->tg3_flags2 & TG3_FLG2_IS_5788) | ||
10773 | persist_dma_mask = dma_mask = DMA_32BIT_MASK; | ||
10774 | else | ||
10775 | persist_dma_mask = dma_mask = DMA_64BIT_MASK; | ||
10776 | |||
10777 | /* Configure DMA attributes. */ | ||
10778 | if (dma_mask > DMA_32BIT_MASK) { | ||
10779 | err = pci_set_dma_mask(pdev, dma_mask); | ||
10780 | if (!err) { | ||
10781 | dev->features |= NETIF_F_HIGHDMA; | ||
10782 | err = pci_set_consistent_dma_mask(pdev, | ||
10783 | persist_dma_mask); | ||
10784 | if (err < 0) { | ||
10785 | printk(KERN_ERR PFX "Unable to obtain 64 bit " | ||
10786 | "DMA for consistent allocations\n"); | ||
10787 | goto err_out_iounmap; | ||
10788 | } | ||
10789 | } | ||
10790 | } | ||
10791 | if (err || dma_mask == DMA_32BIT_MASK) { | ||
10792 | err = pci_set_dma_mask(pdev, DMA_32BIT_MASK); | ||
10793 | if (err) { | ||
10794 | printk(KERN_ERR PFX "No usable DMA configuration, " | ||
10795 | "aborting.\n"); | ||
10796 | goto err_out_iounmap; | ||
10797 | } | ||
10798 | } | ||
10799 | |||
10759 | tg3_init_bufmgr_config(tp); | 10800 | tg3_init_bufmgr_config(tp); |
10760 | 10801 | ||
10761 | #if TG3_TSO_SUPPORT != 0 | 10802 | #if TG3_TSO_SUPPORT != 0 |
@@ -10824,9 +10865,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
10824 | } else | 10865 | } else |
10825 | tp->tg3_flags &= ~TG3_FLAG_RX_CHECKSUMS; | 10866 | tp->tg3_flags &= ~TG3_FLAG_RX_CHECKSUMS; |
10826 | 10867 | ||
10827 | if (tp->tg3_flags2 & TG3_FLG2_IS_5788) | ||
10828 | dev->features &= ~NETIF_F_HIGHDMA; | ||
10829 | |||
10830 | /* flow control autonegotiation is default behavior */ | 10868 | /* flow control autonegotiation is default behavior */ |
10831 | tp->tg3_flags |= TG3_FLAG_PAUSE_AUTONEG; | 10869 | tp->tg3_flags |= TG3_FLAG_PAUSE_AUTONEG; |
10832 | 10870 | ||
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c index d7fb3ffe06ac..2d0cfbceee22 100644 --- a/drivers/net/tulip/de2104x.c +++ b/drivers/net/tulip/de2104x.c | |||
@@ -1362,7 +1362,6 @@ static int de_open (struct net_device *dev) | |||
1362 | { | 1362 | { |
1363 | struct de_private *de = dev->priv; | 1363 | struct de_private *de = dev->priv; |
1364 | int rc; | 1364 | int rc; |
1365 | unsigned long flags; | ||
1366 | 1365 | ||
1367 | if (netif_msg_ifup(de)) | 1366 | if (netif_msg_ifup(de)) |
1368 | printk(KERN_DEBUG "%s: enabling interface\n", dev->name); | 1367 | printk(KERN_DEBUG "%s: enabling interface\n", dev->name); |
@@ -1376,18 +1375,20 @@ static int de_open (struct net_device *dev) | |||
1376 | return rc; | 1375 | return rc; |
1377 | } | 1376 | } |
1378 | 1377 | ||
1379 | rc = de_init_hw(de); | 1378 | dw32(IntrMask, 0); |
1380 | if (rc) { | ||
1381 | printk(KERN_ERR "%s: h/w init failure, err=%d\n", | ||
1382 | dev->name, rc); | ||
1383 | goto err_out_free; | ||
1384 | } | ||
1385 | 1379 | ||
1386 | rc = request_irq(dev->irq, de_interrupt, SA_SHIRQ, dev->name, dev); | 1380 | rc = request_irq(dev->irq, de_interrupt, SA_SHIRQ, dev->name, dev); |
1387 | if (rc) { | 1381 | if (rc) { |
1388 | printk(KERN_ERR "%s: IRQ %d request failure, err=%d\n", | 1382 | printk(KERN_ERR "%s: IRQ %d request failure, err=%d\n", |
1389 | dev->name, dev->irq, rc); | 1383 | dev->name, dev->irq, rc); |
1390 | goto err_out_hw; | 1384 | goto err_out_free; |
1385 | } | ||
1386 | |||
1387 | rc = de_init_hw(de); | ||
1388 | if (rc) { | ||
1389 | printk(KERN_ERR "%s: h/w init failure, err=%d\n", | ||
1390 | dev->name, rc); | ||
1391 | goto err_out_free_irq; | ||
1391 | } | 1392 | } |
1392 | 1393 | ||
1393 | netif_start_queue(dev); | 1394 | netif_start_queue(dev); |
@@ -1395,11 +1396,8 @@ static int de_open (struct net_device *dev) | |||
1395 | 1396 | ||
1396 | return 0; | 1397 | return 0; |
1397 | 1398 | ||
1398 | err_out_hw: | 1399 | err_out_free_irq: |
1399 | spin_lock_irqsave(&de->lock, flags); | 1400 | free_irq(dev->irq, dev); |
1400 | de_stop_hw(de); | ||
1401 | spin_unlock_irqrestore(&de->lock, flags); | ||
1402 | |||
1403 | err_out_free: | 1401 | err_out_free: |
1404 | de_free_rings(de); | 1402 | de_free_rings(de); |
1405 | return rc; | 1403 | return rc; |
@@ -1455,6 +1453,8 @@ static void de_tx_timeout (struct net_device *dev) | |||
1455 | synchronize_irq(dev->irq); | 1453 | synchronize_irq(dev->irq); |
1456 | de_clean_rings(de); | 1454 | de_clean_rings(de); |
1457 | 1455 | ||
1456 | de_init_rings(de); | ||
1457 | |||
1458 | de_init_hw(de); | 1458 | de_init_hw(de); |
1459 | 1459 | ||
1460 | netif_wake_queue(dev); | 1460 | netif_wake_queue(dev); |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 50b8c6754b1e..a1ed2d983740 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -249,8 +249,11 @@ static __inline__ ssize_t tun_get_user(struct tun_struct *tun, struct iovec *iv, | |||
249 | 249 | ||
250 | if (align) | 250 | if (align) |
251 | skb_reserve(skb, align); | 251 | skb_reserve(skb, align); |
252 | if (memcpy_fromiovec(skb_put(skb, len), iv, len)) | 252 | if (memcpy_fromiovec(skb_put(skb, len), iv, len)) { |
253 | tun->stats.rx_dropped++; | ||
254 | kfree_skb(skb); | ||
253 | return -EFAULT; | 255 | return -EFAULT; |
256 | } | ||
254 | 257 | ||
255 | skb->dev = tun->dev; | 258 | skb->dev = tun->dev; |
256 | switch (tun->flags & TUN_TYPE_MASK) { | 259 | switch (tun->flags & TUN_TYPE_MASK) { |
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index c2d5907dc8e0..ed1f837c8fda 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -1106,6 +1106,9 @@ static void velocity_free_rd_ring(struct velocity_info *vptr) | |||
1106 | 1106 | ||
1107 | for (i = 0; i < vptr->options.numrx; i++) { | 1107 | for (i = 0; i < vptr->options.numrx; i++) { |
1108 | struct velocity_rd_info *rd_info = &(vptr->rd_info[i]); | 1108 | struct velocity_rd_info *rd_info = &(vptr->rd_info[i]); |
1109 | struct rx_desc *rd = vptr->rd_ring + i; | ||
1110 | |||
1111 | memset(rd, 0, sizeof(*rd)); | ||
1109 | 1112 | ||
1110 | if (!rd_info->skb) | 1113 | if (!rd_info->skb) |
1111 | continue; | 1114 | continue; |
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c index 8bc0b528548f..f8f4503475f9 100644 --- a/drivers/net/wireless/hostap/hostap_cs.c +++ b/drivers/net/wireless/hostap/hostap_cs.c | |||
@@ -877,7 +877,6 @@ static struct pcmcia_device_id hostap_cs_ids[] = { | |||
877 | PCMCIA_DEVICE_MANF_CARD(0x0101, 0x0777), | 877 | PCMCIA_DEVICE_MANF_CARD(0x0101, 0x0777), |
878 | PCMCIA_DEVICE_MANF_CARD(0x0126, 0x8000), | 878 | PCMCIA_DEVICE_MANF_CARD(0x0126, 0x8000), |
879 | PCMCIA_DEVICE_MANF_CARD(0x0138, 0x0002), | 879 | PCMCIA_DEVICE_MANF_CARD(0x0138, 0x0002), |
880 | PCMCIA_DEVICE_MANF_CARD(0x0156, 0x0002), | ||
881 | PCMCIA_DEVICE_MANF_CARD(0x0250, 0x0002), | 880 | PCMCIA_DEVICE_MANF_CARD(0x0250, 0x0002), |
882 | PCMCIA_DEVICE_MANF_CARD(0x026f, 0x030b), | 881 | PCMCIA_DEVICE_MANF_CARD(0x026f, 0x030b), |
883 | PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1612), | 882 | PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1612), |
@@ -891,6 +890,10 @@ static struct pcmcia_device_id hostap_cs_ids[] = { | |||
891 | PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0002), | 890 | PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0002), |
892 | PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0005), | 891 | PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0005), |
893 | PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0010), | 892 | PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0010), |
893 | PCMCIA_DEVICE_MANF_CARD_PROD_ID1(0x0156, 0x0002, "INTERSIL", | ||
894 | 0x74c5e40d), | ||
895 | PCMCIA_DEVICE_MANF_CARD_PROD_ID1(0x0156, 0x0002, "Intersil", | ||
896 | 0x4b801a17), | ||
894 | PCMCIA_MFC_DEVICE_PROD_ID12(0, "SanDisk", "ConnectPlus", | 897 | PCMCIA_MFC_DEVICE_PROD_ID12(0, "SanDisk", "ConnectPlus", |
895 | 0x7a954bd9, 0x74be00c6), | 898 | 0x7a954bd9, 0x74be00c6), |
896 | PCMCIA_DEVICE_PROD_ID1234( | 899 | PCMCIA_DEVICE_PROD_ID1234( |