aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-08-23 05:43:14 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2007-08-23 05:43:14 -0400
commitac0c955d5048c2c580fa7166a89133f0fd76c125 (patch)
tree041ac4fb544c7244a1a0b35c8ceabc142d5645c1 /drivers/net
parent68d09b1b6780415d82160f6b6d88e82bd724e691 (diff)
parentb377fd3982ad957c796758a90e2988401a884241 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/3c59x.c1
-rw-r--r--drivers/net/Kconfig15
-rw-r--r--drivers/net/atl1/atl1_main.c4
-rw-r--r--drivers/net/ax88796.c5
-rw-r--r--drivers/net/bnx2.c12
-rw-r--r--drivers/net/bonding/bond_main.c34
-rw-r--r--drivers/net/e1000/e1000_ethtool.c2
-rw-r--r--drivers/net/e1000/e1000_hw.c5
-rw-r--r--drivers/net/e1000/e1000_hw.h3
-rw-r--r--drivers/net/e1000/e1000_main.c4
-rw-r--r--drivers/net/ehea/ehea.h2
-rw-r--r--drivers/net/ehea/ehea_main.c44
-rw-r--r--drivers/net/forcedeth.c10
-rw-r--r--drivers/net/ibmveth.c27
-rw-r--r--drivers/net/ibmveth.h3
-rw-r--r--drivers/net/irda/irda-usb.c24
-rw-r--r--drivers/net/mlx4/reset.c3
-rw-r--r--drivers/net/myri10ge/myri10ge.c25
-rw-r--r--drivers/net/natsemi.c3
-rw-r--r--drivers/net/phy/phy.c4
-rw-r--r--drivers/net/ppp_generic.c2
-rw-r--r--drivers/net/r8169.c24
-rw-r--r--drivers/net/s2io.c9
-rw-r--r--drivers/net/sis190.c3
-rw-r--r--drivers/net/sky2.c4
-rw-r--r--drivers/net/smc91x.h4
-rw-r--r--drivers/net/tg3.c17
-rw-r--r--drivers/net/ucc_geth_ethtool.c1
-rw-r--r--drivers/net/ucc_geth_mii.c3
-rw-r--r--drivers/net/via-rhine.c6
-rw-r--r--drivers/net/wan/hdlc_fr.c3
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_phy.c2
-rw-r--r--drivers/net/wireless/rtl8187_dev.c2
-rw-r--r--drivers/net/wireless/zd1211rw/zd_mac.c2
-rw-r--r--drivers/net/xen-netfront.c7
35 files changed, 184 insertions, 135 deletions
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
index 001c66dd3a94..a8c0f436cdd2 100644
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -1555,6 +1555,7 @@ vortex_up(struct net_device *dev)
1555 mii_reg1 = mdio_read(dev, vp->phys[0], MII_BMSR); 1555 mii_reg1 = mdio_read(dev, vp->phys[0], MII_BMSR);
1556 mii_reg5 = mdio_read(dev, vp->phys[0], MII_LPA); 1556 mii_reg5 = mdio_read(dev, vp->phys[0], MII_LPA);
1557 vp->partner_flow_ctrl = ((mii_reg5 & 0x0400) != 0); 1557 vp->partner_flow_ctrl = ((mii_reg5 & 0x0400) != 0);
1558 vp->mii.full_duplex = vp->full_duplex;
1558 1559
1559 vortex_check_media(dev, 1); 1560 vortex_check_media(dev, 1);
1560 } 1561 }
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 81ef81c9a584..5b9e17bf1749 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1968,6 +1968,16 @@ menuconfig NETDEV_1000
1968 bool "Ethernet (1000 Mbit)" 1968 bool "Ethernet (1000 Mbit)"
1969 depends on !UML 1969 depends on !UML
1970 default y 1970 default y
1971 ---help---
1972 Ethernet (also called IEEE 802.3 or ISO 8802-2) is the most common
1973 type of Local Area Network (LAN) in universities and companies.
1974
1975 Say Y here to get to see options for Gigabit Ethernet drivers.
1976 This option alone does not add any kernel code.
1977 Note that drivers supporting both 100 and 1000 MBit may be listed
1978 under "Ethernet (10 or 100MBit)" instead.
1979
1980 If you say N, all options in this submenu will be skipped and disabled.
1971 1981
1972if NETDEV_1000 1982if NETDEV_1000
1973 1983
@@ -2339,6 +2349,11 @@ menuconfig NETDEV_10000
2339 bool "Ethernet (10000 Mbit)" 2349 bool "Ethernet (10000 Mbit)"
2340 depends on !UML 2350 depends on !UML
2341 default y 2351 default y
2352 ---help---
2353 Say Y here to get to see options for 10 Gigabit Ethernet drivers.
2354 This option alone does not add any kernel code.
2355
2356 If you say N, all options in this submenu will be skipped and disabled.
2342 2357
2343if NETDEV_10000 2358if NETDEV_10000
2344 2359
diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c
index 56f6389a300e..3c1984ecf36c 100644
--- a/drivers/net/atl1/atl1_main.c
+++ b/drivers/net/atl1/atl1_main.c
@@ -1704,10 +1704,8 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
1704 } 1704 }
1705 } 1705 }
1706 1706
1707 local_irq_save(flags); 1707 if (!spin_trylock_irqsave(&adapter->lock, flags)) {
1708 if (!spin_trylock(&adapter->lock)) {
1709 /* Can't get lock - tell upper layer to requeue */ 1708 /* Can't get lock - tell upper layer to requeue */
1710 local_irq_restore(flags);
1711 dev_printk(KERN_DEBUG, &adapter->pdev->dev, "tx locked\n"); 1709 dev_printk(KERN_DEBUG, &adapter->pdev->dev, "tx locked\n");
1712 return NETDEV_TX_LOCKED; 1710 return NETDEV_TX_LOCKED;
1713 } 1711 }
diff --git a/drivers/net/ax88796.c b/drivers/net/ax88796.c
index 83da1770bafb..90e0734e6037 100644
--- a/drivers/net/ax88796.c
+++ b/drivers/net/ax88796.c
@@ -821,8 +821,9 @@ static int ax_probe(struct platform_device *pdev)
821 dev->base_addr = (unsigned long)ei_status.mem; 821 dev->base_addr = (unsigned long)ei_status.mem;
822 822
823 if (ei_status.mem == NULL) { 823 if (ei_status.mem == NULL) {
824 dev_err(&pdev->dev, "Cannot ioremap area (%08zx,%08zx)\n", 824 dev_err(&pdev->dev, "Cannot ioremap area (%08llx,%08llx)\n",
825 res->start, res->end); 825 (unsigned long long)res->start,
826 (unsigned long long)res->end);
826 827
827 ret = -ENXIO; 828 ret = -ENXIO;
828 goto exit_req; 829 goto exit_req;
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index d53dfc5bbae0..24e7f9ab3f5a 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -54,8 +54,8 @@
54 54
55#define DRV_MODULE_NAME "bnx2" 55#define DRV_MODULE_NAME "bnx2"
56#define PFX DRV_MODULE_NAME ": " 56#define PFX DRV_MODULE_NAME ": "
57#define DRV_MODULE_VERSION "1.6.3" 57#define DRV_MODULE_VERSION "1.6.4"
58#define DRV_MODULE_RELDATE "July 16, 2007" 58#define DRV_MODULE_RELDATE "August 3, 2007"
59 59
60#define RUN_AT(x) (jiffies + (x)) 60#define RUN_AT(x) (jiffies + (x))
61 61
@@ -6937,6 +6937,11 @@ bnx2_suspend(struct pci_dev *pdev, pm_message_t state)
6937 struct bnx2 *bp = netdev_priv(dev); 6937 struct bnx2 *bp = netdev_priv(dev);
6938 u32 reset_code; 6938 u32 reset_code;
6939 6939
6940 /* PCI register 4 needs to be saved whether netif_running() or not.
6941 * MSI address and data need to be saved if using MSI and
6942 * netif_running().
6943 */
6944 pci_save_state(pdev);
6940 if (!netif_running(dev)) 6945 if (!netif_running(dev))
6941 return 0; 6946 return 0;
6942 6947
@@ -6952,7 +6957,6 @@ bnx2_suspend(struct pci_dev *pdev, pm_message_t state)
6952 reset_code = BNX2_DRV_MSG_CODE_SUSPEND_NO_WOL; 6957 reset_code = BNX2_DRV_MSG_CODE_SUSPEND_NO_WOL;
6953 bnx2_reset_chip(bp, reset_code); 6958 bnx2_reset_chip(bp, reset_code);
6954 bnx2_free_skbs(bp); 6959 bnx2_free_skbs(bp);
6955 pci_save_state(pdev);
6956 bnx2_set_power_state(bp, pci_choose_state(pdev, state)); 6960 bnx2_set_power_state(bp, pci_choose_state(pdev, state));
6957 return 0; 6961 return 0;
6958} 6962}
@@ -6963,10 +6967,10 @@ bnx2_resume(struct pci_dev *pdev)
6963 struct net_device *dev = pci_get_drvdata(pdev); 6967 struct net_device *dev = pci_get_drvdata(pdev);
6964 struct bnx2 *bp = netdev_priv(dev); 6968 struct bnx2 *bp = netdev_priv(dev);
6965 6969
6970 pci_restore_state(pdev);
6966 if (!netif_running(dev)) 6971 if (!netif_running(dev))
6967 return 0; 6972 return 0;
6968 6973
6969 pci_restore_state(pdev);
6970 bnx2_set_power_state(bp, PCI_D0); 6974 bnx2_set_power_state(bp, PCI_D0);
6971 netif_device_attach(dev); 6975 netif_device_attach(dev);
6972 bnx2_init_nic(bp); 6976 bnx2_init_nic(bp);
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 070b78d959cc..1afda3230def 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1202,43 +1202,35 @@ static int bond_sethwaddr(struct net_device *bond_dev,
1202 return 0; 1202 return 0;
1203} 1203}
1204 1204
1205#define BOND_INTERSECT_FEATURES \ 1205#define BOND_VLAN_FEATURES \
1206 (NETIF_F_SG | NETIF_F_ALL_CSUM | NETIF_F_TSO | NETIF_F_UFO) 1206 (NETIF_F_VLAN_CHALLENGED | NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX | \
1207 NETIF_F_HW_VLAN_FILTER)
1207 1208
1208/* 1209/*
1209 * Compute the common dev->feature set available to all slaves. Some 1210 * Compute the common dev->feature set available to all slaves. Some
1210 * feature bits are managed elsewhere, so preserve feature bits set on 1211 * feature bits are managed elsewhere, so preserve those feature bits
1211 * master device that are not part of the examined set. 1212 * on the master device.
1212 */ 1213 */
1213static int bond_compute_features(struct bonding *bond) 1214static int bond_compute_features(struct bonding *bond)
1214{ 1215{
1215 unsigned long features = BOND_INTERSECT_FEATURES;
1216 struct slave *slave; 1216 struct slave *slave;
1217 struct net_device *bond_dev = bond->dev; 1217 struct net_device *bond_dev = bond->dev;
1218 unsigned long features = bond_dev->features;
1218 unsigned short max_hard_header_len = ETH_HLEN; 1219 unsigned short max_hard_header_len = ETH_HLEN;
1219 int i; 1220 int i;
1220 1221
1222 features &= ~(NETIF_F_ALL_CSUM | BOND_VLAN_FEATURES);
1223 features |= NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA |
1224 NETIF_F_GSO_MASK | NETIF_F_NO_CSUM;
1225
1221 bond_for_each_slave(bond, slave, i) { 1226 bond_for_each_slave(bond, slave, i) {
1222 features &= (slave->dev->features & BOND_INTERSECT_FEATURES); 1227 features = netdev_compute_features(features,
1228 slave->dev->features);
1223 if (slave->dev->hard_header_len > max_hard_header_len) 1229 if (slave->dev->hard_header_len > max_hard_header_len)
1224 max_hard_header_len = slave->dev->hard_header_len; 1230 max_hard_header_len = slave->dev->hard_header_len;
1225 } 1231 }
1226 1232
1227 if ((features & NETIF_F_SG) && 1233 features |= (bond_dev->features & BOND_VLAN_FEATURES);
1228 !(features & NETIF_F_ALL_CSUM))
1229 features &= ~NETIF_F_SG;
1230
1231 /*
1232 * features will include NETIF_F_TSO (NETIF_F_UFO) iff all
1233 * slave devices support NETIF_F_TSO (NETIF_F_UFO), which
1234 * implies that all slaves also support scatter-gather
1235 * (NETIF_F_SG), which implies that features also includes
1236 * NETIF_F_SG. So no need to check whether we have an
1237 * illegal combination of NETIF_F_{TSO,UFO} and
1238 * !NETIF_F_SG
1239 */
1240
1241 features |= (bond_dev->features & ~BOND_INTERSECT_FEATURES);
1242 bond_dev->features = features; 1234 bond_dev->features = features;
1243 bond_dev->hard_header_len = max_hard_header_len; 1235 bond_dev->hard_header_len = max_hard_header_len;
1244 1236
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index c90c92e72d2a..4c3785c9d4b8 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -1706,6 +1706,7 @@ static int e1000_wol_exclusion(struct e1000_adapter *adapter, struct ethtool_wol
1706 case E1000_DEV_ID_82545EM_COPPER: 1706 case E1000_DEV_ID_82545EM_COPPER:
1707 case E1000_DEV_ID_82546GB_QUAD_COPPER: 1707 case E1000_DEV_ID_82546GB_QUAD_COPPER:
1708 case E1000_DEV_ID_82546GB_PCIE: 1708 case E1000_DEV_ID_82546GB_PCIE:
1709 case E1000_DEV_ID_82571EB_SERDES_QUAD:
1709 /* these don't support WoL at all */ 1710 /* these don't support WoL at all */
1710 wol->supported = 0; 1711 wol->supported = 0;
1711 break; 1712 break;
@@ -1723,6 +1724,7 @@ static int e1000_wol_exclusion(struct e1000_adapter *adapter, struct ethtool_wol
1723 retval = 0; 1724 retval = 0;
1724 break; 1725 break;
1725 case E1000_DEV_ID_82571EB_QUAD_COPPER: 1726 case E1000_DEV_ID_82571EB_QUAD_COPPER:
1727 case E1000_DEV_ID_82571EB_QUAD_FIBER:
1726 case E1000_DEV_ID_82571EB_QUAD_COPPER_LOWPROFILE: 1728 case E1000_DEV_ID_82571EB_QUAD_COPPER_LOWPROFILE:
1727 case E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3: 1729 case E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3:
1728 /* quad port adapters only support WoL on port A */ 1730 /* quad port adapters only support WoL on port A */
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index 9be44699300b..ba120f7fb0be 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -384,7 +384,10 @@ e1000_set_mac_type(struct e1000_hw *hw)
384 case E1000_DEV_ID_82571EB_COPPER: 384 case E1000_DEV_ID_82571EB_COPPER:
385 case E1000_DEV_ID_82571EB_FIBER: 385 case E1000_DEV_ID_82571EB_FIBER:
386 case E1000_DEV_ID_82571EB_SERDES: 386 case E1000_DEV_ID_82571EB_SERDES:
387 case E1000_DEV_ID_82571EB_SERDES_DUAL:
388 case E1000_DEV_ID_82571EB_SERDES_QUAD:
387 case E1000_DEV_ID_82571EB_QUAD_COPPER: 389 case E1000_DEV_ID_82571EB_QUAD_COPPER:
390 case E1000_DEV_ID_82571EB_QUAD_FIBER:
388 case E1000_DEV_ID_82571EB_QUAD_COPPER_LOWPROFILE: 391 case E1000_DEV_ID_82571EB_QUAD_COPPER_LOWPROFILE:
389 hw->mac_type = e1000_82571; 392 hw->mac_type = e1000_82571;
390 break; 393 break;
@@ -485,6 +488,8 @@ e1000_set_media_type(struct e1000_hw *hw)
485 case E1000_DEV_ID_82545GM_SERDES: 488 case E1000_DEV_ID_82545GM_SERDES:
486 case E1000_DEV_ID_82546GB_SERDES: 489 case E1000_DEV_ID_82546GB_SERDES:
487 case E1000_DEV_ID_82571EB_SERDES: 490 case E1000_DEV_ID_82571EB_SERDES:
491 case E1000_DEV_ID_82571EB_SERDES_DUAL:
492 case E1000_DEV_ID_82571EB_SERDES_QUAD:
488 case E1000_DEV_ID_82572EI_SERDES: 493 case E1000_DEV_ID_82572EI_SERDES:
489 case E1000_DEV_ID_80003ES2LAN_SERDES_DPT: 494 case E1000_DEV_ID_80003ES2LAN_SERDES_DPT:
490 hw->media_type = e1000_media_type_internal_serdes; 495 hw->media_type = e1000_media_type_internal_serdes;
diff --git a/drivers/net/e1000/e1000_hw.h b/drivers/net/e1000/e1000_hw.h
index bd000b802ee7..fe8714655c90 100644
--- a/drivers/net/e1000/e1000_hw.h
+++ b/drivers/net/e1000/e1000_hw.h
@@ -475,7 +475,10 @@ int32_t e1000_check_phy_reset_block(struct e1000_hw *hw);
475#define E1000_DEV_ID_82571EB_FIBER 0x105F 475#define E1000_DEV_ID_82571EB_FIBER 0x105F
476#define E1000_DEV_ID_82571EB_SERDES 0x1060 476#define E1000_DEV_ID_82571EB_SERDES 0x1060
477#define E1000_DEV_ID_82571EB_QUAD_COPPER 0x10A4 477#define E1000_DEV_ID_82571EB_QUAD_COPPER 0x10A4
478#define E1000_DEV_ID_82571EB_QUAD_FIBER 0x10A5
478#define E1000_DEV_ID_82571EB_QUAD_COPPER_LOWPROFILE 0x10BC 479#define E1000_DEV_ID_82571EB_QUAD_COPPER_LOWPROFILE 0x10BC
480#define E1000_DEV_ID_82571EB_SERDES_DUAL 0x10D9
481#define E1000_DEV_ID_82571EB_SERDES_QUAD 0x10DA
479#define E1000_DEV_ID_82572EI_COPPER 0x107D 482#define E1000_DEV_ID_82572EI_COPPER 0x107D
480#define E1000_DEV_ID_82572EI_FIBER 0x107E 483#define E1000_DEV_ID_82572EI_FIBER 0x107E
481#define E1000_DEV_ID_82572EI_SERDES 0x107F 484#define E1000_DEV_ID_82572EI_SERDES 0x107F
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index f48b659e0c2b..4a225950fb43 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -100,6 +100,7 @@ static struct pci_device_id e1000_pci_tbl[] = {
100 INTEL_E1000_ETHERNET_DEVICE(0x1099), 100 INTEL_E1000_ETHERNET_DEVICE(0x1099),
101 INTEL_E1000_ETHERNET_DEVICE(0x109A), 101 INTEL_E1000_ETHERNET_DEVICE(0x109A),
102 INTEL_E1000_ETHERNET_DEVICE(0x10A4), 102 INTEL_E1000_ETHERNET_DEVICE(0x10A4),
103 INTEL_E1000_ETHERNET_DEVICE(0x10A5),
103 INTEL_E1000_ETHERNET_DEVICE(0x10B5), 104 INTEL_E1000_ETHERNET_DEVICE(0x10B5),
104 INTEL_E1000_ETHERNET_DEVICE(0x10B9), 105 INTEL_E1000_ETHERNET_DEVICE(0x10B9),
105 INTEL_E1000_ETHERNET_DEVICE(0x10BA), 106 INTEL_E1000_ETHERNET_DEVICE(0x10BA),
@@ -107,6 +108,8 @@ static struct pci_device_id e1000_pci_tbl[] = {
107 INTEL_E1000_ETHERNET_DEVICE(0x10BC), 108 INTEL_E1000_ETHERNET_DEVICE(0x10BC),
108 INTEL_E1000_ETHERNET_DEVICE(0x10C4), 109 INTEL_E1000_ETHERNET_DEVICE(0x10C4),
109 INTEL_E1000_ETHERNET_DEVICE(0x10C5), 110 INTEL_E1000_ETHERNET_DEVICE(0x10C5),
111 INTEL_E1000_ETHERNET_DEVICE(0x10D9),
112 INTEL_E1000_ETHERNET_DEVICE(0x10DA),
110 /* required last entry */ 113 /* required last entry */
111 {0,} 114 {0,}
112}; 115};
@@ -1096,6 +1099,7 @@ e1000_probe(struct pci_dev *pdev,
1096 break; 1099 break;
1097 case E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3: 1100 case E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3:
1098 case E1000_DEV_ID_82571EB_QUAD_COPPER: 1101 case E1000_DEV_ID_82571EB_QUAD_COPPER:
1102 case E1000_DEV_ID_82571EB_QUAD_FIBER:
1099 case E1000_DEV_ID_82571EB_QUAD_COPPER_LOWPROFILE: 1103 case E1000_DEV_ID_82571EB_QUAD_COPPER_LOWPROFILE:
1100 /* if quad port adapter, disable WoL on all but port A */ 1104 /* if quad port adapter, disable WoL on all but port A */
1101 if (global_quad_port_a != 0) 1105 if (global_quad_port_a != 0)
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index 8ee2c2c86b42..d67f97bfa3a4 100644
--- a/drivers/net/ehea/ehea.h
+++ b/drivers/net/ehea/ehea.h
@@ -39,7 +39,7 @@
39#include <asm/io.h> 39#include <asm/io.h>
40 40
41#define DRV_NAME "ehea" 41#define DRV_NAME "ehea"
42#define DRV_VERSION "EHEA_0072" 42#define DRV_VERSION "EHEA_0073"
43 43
44/* eHEA capability flags */ 44/* eHEA capability flags */
45#define DLPAR_PORT_ADD_REM 1 45#define DLPAR_PORT_ADD_REM 1
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 58702f54c3fb..9756211e83ce 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -1326,7 +1326,6 @@ static void write_swqe2_TSO(struct sk_buff *skb,
1326 u8 *imm_data = &swqe->u.immdata_desc.immediate_data[0]; 1326 u8 *imm_data = &swqe->u.immdata_desc.immediate_data[0];
1327 int skb_data_size = skb->len - skb->data_len; 1327 int skb_data_size = skb->len - skb->data_len;
1328 int headersize; 1328 int headersize;
1329 u64 tmp_addr;
1330 1329
1331 /* Packet is TCP with TSO enabled */ 1330 /* Packet is TCP with TSO enabled */
1332 swqe->tx_control |= EHEA_SWQE_TSO; 1331 swqe->tx_control |= EHEA_SWQE_TSO;
@@ -1347,9 +1346,8 @@ static void write_swqe2_TSO(struct sk_buff *skb,
1347 /* set sg1entry data */ 1346 /* set sg1entry data */
1348 sg1entry->l_key = lkey; 1347 sg1entry->l_key = lkey;
1349 sg1entry->len = skb_data_size - headersize; 1348 sg1entry->len = skb_data_size - headersize;
1350 1349 sg1entry->vaddr =
1351 tmp_addr = (u64)(skb->data + headersize); 1350 ehea_map_vaddr(skb->data + headersize);
1352 sg1entry->vaddr = ehea_map_vaddr(tmp_addr);
1353 swqe->descriptors++; 1351 swqe->descriptors++;
1354 } 1352 }
1355 } else 1353 } else
@@ -1362,7 +1360,6 @@ static void write_swqe2_nonTSO(struct sk_buff *skb,
1362 int skb_data_size = skb->len - skb->data_len; 1360 int skb_data_size = skb->len - skb->data_len;
1363 u8 *imm_data = &swqe->u.immdata_desc.immediate_data[0]; 1361 u8 *imm_data = &swqe->u.immdata_desc.immediate_data[0];
1364 struct ehea_vsgentry *sg1entry = &swqe->u.immdata_desc.sg_entry; 1362 struct ehea_vsgentry *sg1entry = &swqe->u.immdata_desc.sg_entry;
1365 u64 tmp_addr;
1366 1363
1367 /* Packet is any nonTSO type 1364 /* Packet is any nonTSO type
1368 * 1365 *
@@ -1379,8 +1376,8 @@ static void write_swqe2_nonTSO(struct sk_buff *skb,
1379 /* copy sg1entry data */ 1376 /* copy sg1entry data */
1380 sg1entry->l_key = lkey; 1377 sg1entry->l_key = lkey;
1381 sg1entry->len = skb_data_size - SWQE2_MAX_IMM; 1378 sg1entry->len = skb_data_size - SWQE2_MAX_IMM;
1382 tmp_addr = (u64)(skb->data + SWQE2_MAX_IMM); 1379 sg1entry->vaddr =
1383 sg1entry->vaddr = ehea_map_vaddr(tmp_addr); 1380 ehea_map_vaddr(skb->data + SWQE2_MAX_IMM);
1384 swqe->descriptors++; 1381 swqe->descriptors++;
1385 } 1382 }
1386 } else { 1383 } else {
@@ -1395,7 +1392,6 @@ static inline void write_swqe2_data(struct sk_buff *skb, struct net_device *dev,
1395 struct ehea_vsgentry *sg_list, *sg1entry, *sgentry; 1392 struct ehea_vsgentry *sg_list, *sg1entry, *sgentry;
1396 skb_frag_t *frag; 1393 skb_frag_t *frag;
1397 int nfrags, sg1entry_contains_frag_data, i; 1394 int nfrags, sg1entry_contains_frag_data, i;
1398 u64 tmp_addr;
1399 1395
1400 nfrags = skb_shinfo(skb)->nr_frags; 1396 nfrags = skb_shinfo(skb)->nr_frags;
1401 sg1entry = &swqe->u.immdata_desc.sg_entry; 1397 sg1entry = &swqe->u.immdata_desc.sg_entry;
@@ -1417,9 +1413,9 @@ static inline void write_swqe2_data(struct sk_buff *skb, struct net_device *dev,
1417 /* copy sg1entry data */ 1413 /* copy sg1entry data */
1418 sg1entry->l_key = lkey; 1414 sg1entry->l_key = lkey;
1419 sg1entry->len = frag->size; 1415 sg1entry->len = frag->size;
1420 tmp_addr = (u64)(page_address(frag->page) 1416 sg1entry->vaddr =
1421 + frag->page_offset); 1417 ehea_map_vaddr(page_address(frag->page)
1422 sg1entry->vaddr = ehea_map_vaddr(tmp_addr); 1418 + frag->page_offset);
1423 swqe->descriptors++; 1419 swqe->descriptors++;
1424 sg1entry_contains_frag_data = 1; 1420 sg1entry_contains_frag_data = 1;
1425 } 1421 }
@@ -1431,10 +1427,9 @@ static inline void write_swqe2_data(struct sk_buff *skb, struct net_device *dev,
1431 1427
1432 sgentry->l_key = lkey; 1428 sgentry->l_key = lkey;
1433 sgentry->len = frag->size; 1429 sgentry->len = frag->size;
1434 1430 sgentry->vaddr =
1435 tmp_addr = (u64)(page_address(frag->page) 1431 ehea_map_vaddr(page_address(frag->page)
1436 + frag->page_offset); 1432 + frag->page_offset);
1437 sgentry->vaddr = ehea_map_vaddr(tmp_addr);
1438 swqe->descriptors++; 1433 swqe->descriptors++;
1439 } 1434 }
1440 } 1435 }
@@ -2165,24 +2160,18 @@ static int ehea_clean_all_portres(struct ehea_port *port)
2165 return ret; 2160 return ret;
2166} 2161}
2167 2162
2168static void ehea_remove_adapter_mr (struct ehea_adapter *adapter) 2163static void ehea_remove_adapter_mr(struct ehea_adapter *adapter)
2169{ 2164{
2170 int i; 2165 if (adapter->active_ports)
2171 2166 return;
2172 for (i=0; i < EHEA_MAX_PORTS; i++)
2173 if (adapter->port[i])
2174 return;
2175 2167
2176 ehea_rem_mr(&adapter->mr); 2168 ehea_rem_mr(&adapter->mr);
2177} 2169}
2178 2170
2179static int ehea_add_adapter_mr (struct ehea_adapter *adapter) 2171static int ehea_add_adapter_mr(struct ehea_adapter *adapter)
2180{ 2172{
2181 int i; 2173 if (adapter->active_ports)
2182 2174 return 0;
2183 for (i=0; i < EHEA_MAX_PORTS; i++)
2184 if (adapter->port[i])
2185 return 0;
2186 2175
2187 return ehea_reg_kernel_mr(adapter, &adapter->mr); 2176 return ehea_reg_kernel_mr(adapter, &adapter->mr);
2188} 2177}
@@ -3099,6 +3088,7 @@ out:
3099 3088
3100static void __exit ehea_module_exit(void) 3089static void __exit ehea_module_exit(void)
3101{ 3090{
3091 destroy_workqueue(ehea_driver_wq);
3102 driver_remove_file(&ehea_driver.driver, &driver_attr_capabilities); 3092 driver_remove_file(&ehea_driver.driver, &driver_attr_capabilities);
3103 ibmebus_unregister_driver(&ehea_driver); 3093 ibmebus_unregister_driver(&ehea_driver);
3104 ehea_destroy_busmap(); 3094 ehea_destroy_busmap();
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 69f5f365239a..10f4e3b55168 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -3068,8 +3068,8 @@ static irqreturn_t nv_nic_irq(int foo, void *data)
3068 np->nic_poll_irq = np->irqmask; 3068 np->nic_poll_irq = np->irqmask;
3069 mod_timer(&np->nic_poll, jiffies + POLL_WAIT); 3069 mod_timer(&np->nic_poll, jiffies + POLL_WAIT);
3070 } 3070 }
3071 printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq.\n", dev->name, i);
3072 spin_unlock(&np->lock); 3071 spin_unlock(&np->lock);
3072 printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq.\n", dev->name, i);
3073 break; 3073 break;
3074 } 3074 }
3075 3075
@@ -3186,8 +3186,8 @@ static irqreturn_t nv_nic_irq_optimized(int foo, void *data)
3186 np->nic_poll_irq = np->irqmask; 3186 np->nic_poll_irq = np->irqmask;
3187 mod_timer(&np->nic_poll, jiffies + POLL_WAIT); 3187 mod_timer(&np->nic_poll, jiffies + POLL_WAIT);
3188 } 3188 }
3189 printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq.\n", dev->name, i);
3190 spin_unlock(&np->lock); 3189 spin_unlock(&np->lock);
3190 printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq.\n", dev->name, i);
3191 break; 3191 break;
3192 } 3192 }
3193 3193
@@ -3233,8 +3233,8 @@ static irqreturn_t nv_nic_irq_tx(int foo, void *data)
3233 np->nic_poll_irq |= NVREG_IRQ_TX_ALL; 3233 np->nic_poll_irq |= NVREG_IRQ_TX_ALL;
3234 mod_timer(&np->nic_poll, jiffies + POLL_WAIT); 3234 mod_timer(&np->nic_poll, jiffies + POLL_WAIT);
3235 } 3235 }
3236 printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq_tx.\n", dev->name, i);
3237 spin_unlock_irqrestore(&np->lock, flags); 3236 spin_unlock_irqrestore(&np->lock, flags);
3237 printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq_tx.\n", dev->name, i);
3238 break; 3238 break;
3239 } 3239 }
3240 3240
@@ -3348,8 +3348,8 @@ static irqreturn_t nv_nic_irq_rx(int foo, void *data)
3348 np->nic_poll_irq |= NVREG_IRQ_RX_ALL; 3348 np->nic_poll_irq |= NVREG_IRQ_RX_ALL;
3349 mod_timer(&np->nic_poll, jiffies + POLL_WAIT); 3349 mod_timer(&np->nic_poll, jiffies + POLL_WAIT);
3350 } 3350 }
3351 printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq_rx.\n", dev->name, i);
3352 spin_unlock_irqrestore(&np->lock, flags); 3351 spin_unlock_irqrestore(&np->lock, flags);
3352 printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq_rx.\n", dev->name, i);
3353 break; 3353 break;
3354 } 3354 }
3355 } 3355 }
@@ -3421,8 +3421,8 @@ static irqreturn_t nv_nic_irq_other(int foo, void *data)
3421 np->nic_poll_irq |= NVREG_IRQ_OTHER; 3421 np->nic_poll_irq |= NVREG_IRQ_OTHER;
3422 mod_timer(&np->nic_poll, jiffies + POLL_WAIT); 3422 mod_timer(&np->nic_poll, jiffies + POLL_WAIT);
3423 } 3423 }
3424 printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq_other.\n", dev->name, i);
3425 spin_unlock_irqrestore(&np->lock, flags); 3424 spin_unlock_irqrestore(&np->lock, flags);
3425 printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq_other.\n", dev->name, i);
3426 break; 3426 break;
3427 } 3427 }
3428 3428
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index d96eb7229548..acba90f1638e 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -963,7 +963,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
963{ 963{
964 int rc, i; 964 int rc, i;
965 struct net_device *netdev; 965 struct net_device *netdev;
966 struct ibmveth_adapter *adapter = NULL; 966 struct ibmveth_adapter *adapter;
967 967
968 unsigned char *mac_addr_p; 968 unsigned char *mac_addr_p;
969 unsigned int *mcastFilterSize_p; 969 unsigned int *mcastFilterSize_p;
@@ -997,7 +997,6 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
997 SET_MODULE_OWNER(netdev); 997 SET_MODULE_OWNER(netdev);
998 998
999 adapter = netdev->priv; 999 adapter = netdev->priv;
1000 memset(adapter, 0, sizeof(adapter));
1001 dev->dev.driver_data = netdev; 1000 dev->dev.driver_data = netdev;
1002 1001
1003 adapter->vdev = dev; 1002 adapter->vdev = dev;
@@ -1280,24 +1279,28 @@ const char * buf, size_t count)
1280 int i; 1279 int i;
1281 /* Make sure there is a buffer pool with buffers that 1280 /* Make sure there is a buffer pool with buffers that
1282 can hold a packet of the size of the MTU */ 1281 can hold a packet of the size of the MTU */
1283 for(i = 0; i<IbmVethNumBufferPools; i++) { 1282 for (i = 0; i < IbmVethNumBufferPools; i++) {
1284 if (pool == &adapter->rx_buff_pool[i]) 1283 if (pool == &adapter->rx_buff_pool[i])
1285 continue; 1284 continue;
1286 if (!adapter->rx_buff_pool[i].active) 1285 if (!adapter->rx_buff_pool[i].active)
1287 continue; 1286 continue;
1288 if (mtu < adapter->rx_buff_pool[i].buff_size) { 1287 if (mtu <= adapter->rx_buff_pool[i].buff_size)
1289 pool->active = 0; 1288 break;
1290 h_free_logical_lan_buffer(adapter->
1291 vdev->
1292 unit_address,
1293 pool->
1294 buff_size);
1295 }
1296 } 1289 }
1297 if (pool->active) { 1290
1291 if (i == IbmVethNumBufferPools) {
1298 ibmveth_error_printk("no active pool >= MTU\n"); 1292 ibmveth_error_printk("no active pool >= MTU\n");
1299 return -EPERM; 1293 return -EPERM;
1300 } 1294 }
1295
1296 pool->active = 0;
1297 if (netif_running(netdev)) {
1298 adapter->pool_config = 1;
1299 ibmveth_close(netdev);
1300 adapter->pool_config = 0;
1301 if ((rc = ibmveth_open(netdev)))
1302 return rc;
1303 }
1301 } 1304 }
1302 } else if (attr == &veth_num_attr) { 1305 } else if (attr == &veth_num_attr) {
1303 if (value <= 0 || value > IBMVETH_MAX_POOL_COUNT) 1306 if (value <= 0 || value > IBMVETH_MAX_POOL_COUNT)
diff --git a/drivers/net/ibmveth.h b/drivers/net/ibmveth.h
index bb69ccae8ace..72cc15a6cab7 100644
--- a/drivers/net/ibmveth.h
+++ b/drivers/net/ibmveth.h
@@ -73,9 +73,6 @@ static inline long h_send_logical_lan(unsigned long unit_address,
73#define h_change_logical_lan_mac(ua, mac) \ 73#define h_change_logical_lan_mac(ua, mac) \
74 plpar_hcall_norets(H_CHANGE_LOGICAL_LAN_MAC, ua, mac) 74 plpar_hcall_norets(H_CHANGE_LOGICAL_LAN_MAC, ua, mac)
75 75
76#define h_free_logical_lan_buffer(ua, bufsize) \
77 plpar_hcall_norets(H_FREE_LOGICAL_LAN_BUFFER, ua, bufsize)
78
79#define IbmVethNumBufferPools 5 76#define IbmVethNumBufferPools 5
80#define IBMVETH_BUFF_OH 22 /* Overhead: 14 ethernet header + 8 opaque handle */ 77#define IBMVETH_BUFF_OH 22 /* Overhead: 14 ethernet header + 8 opaque handle */
81#define IBMVETH_MAX_MTU 68 78#define IBMVETH_MAX_MTU 68
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c
index 0ac240ca905b..3b0fd83fa266 100644
--- a/drivers/net/irda/irda-usb.c
+++ b/drivers/net/irda/irda-usb.c
@@ -1561,10 +1561,9 @@ static inline struct irda_class_desc *irda_usb_find_class_desc(struct usb_interf
1561 struct irda_class_desc *desc; 1561 struct irda_class_desc *desc;
1562 int ret; 1562 int ret;
1563 1563
1564 desc = kmalloc(sizeof (*desc), GFP_KERNEL); 1564 desc = kzalloc(sizeof(*desc), GFP_KERNEL);
1565 if (desc == NULL) 1565 if (!desc)
1566 return NULL; 1566 return NULL;
1567 memset(desc, 0, sizeof(*desc));
1568 1567
1569 /* USB-IrDA class spec 1.0: 1568 /* USB-IrDA class spec 1.0:
1570 * 6.1.3: Standard "Get Descriptor" Device Request is not 1569 * 6.1.3: Standard "Get Descriptor" Device Request is not
@@ -1617,7 +1616,7 @@ static int irda_usb_probe(struct usb_interface *intf,
1617{ 1616{
1618 struct net_device *net; 1617 struct net_device *net;
1619 struct usb_device *dev = interface_to_usbdev(intf); 1618 struct usb_device *dev = interface_to_usbdev(intf);
1620 struct irda_usb_cb *self = NULL; 1619 struct irda_usb_cb *self;
1621 struct usb_host_interface *interface; 1620 struct usb_host_interface *interface;
1622 struct irda_class_desc *irda_desc; 1621 struct irda_class_desc *irda_desc;
1623 int ret = -ENOMEM; 1622 int ret = -ENOMEM;
@@ -1655,7 +1654,7 @@ static int irda_usb_probe(struct usb_interface *intf,
1655 self->header_length = USB_IRDA_HEADER; 1654 self->header_length = USB_IRDA_HEADER;
1656 } 1655 }
1657 1656
1658 self->rx_urb = kzalloc(self->max_rx_urb * sizeof(struct urb *), 1657 self->rx_urb = kcalloc(self->max_rx_urb, sizeof(struct urb *),
1659 GFP_KERNEL); 1658 GFP_KERNEL);
1660 1659
1661 for (i = 0; i < self->max_rx_urb; i++) { 1660 for (i = 0; i < self->max_rx_urb; i++) {
@@ -1715,7 +1714,7 @@ static int irda_usb_probe(struct usb_interface *intf,
1715 /* Find IrDA class descriptor */ 1714 /* Find IrDA class descriptor */
1716 irda_desc = irda_usb_find_class_desc(intf); 1715 irda_desc = irda_usb_find_class_desc(intf);
1717 ret = -ENODEV; 1716 ret = -ENODEV;
1718 if (irda_desc == NULL) 1717 if (!irda_desc)
1719 goto err_out_3; 1718 goto err_out_3;
1720 1719
1721 if (self->needspatch) { 1720 if (self->needspatch) {
@@ -1738,15 +1737,13 @@ static int irda_usb_probe(struct usb_interface *intf,
1738 /* Don't change this buffer size and allocation without doing 1737 /* Don't change this buffer size and allocation without doing
1739 * some heavy and complete testing. Don't ask why :-( 1738 * some heavy and complete testing. Don't ask why :-(
1740 * Jean II */ 1739 * Jean II */
1741 self->speed_buff = kmalloc(IRDA_USB_SPEED_MTU, GFP_KERNEL); 1740 self->speed_buff = kzalloc(IRDA_USB_SPEED_MTU, GFP_KERNEL);
1742 if (self->speed_buff == NULL) 1741 if (!self->speed_buff)
1743 goto err_out_3; 1742 goto err_out_3;
1744 1743
1745 memset(self->speed_buff, 0, IRDA_USB_SPEED_MTU);
1746
1747 self->tx_buff = kzalloc(IRDA_SKB_MAX_MTU + self->header_length, 1744 self->tx_buff = kzalloc(IRDA_SKB_MAX_MTU + self->header_length,
1748 GFP_KERNEL); 1745 GFP_KERNEL);
1749 if (self->tx_buff == NULL) 1746 if (!self->tx_buff)
1750 goto err_out_4; 1747 goto err_out_4;
1751 1748
1752 ret = irda_usb_open(self); 1749 ret = irda_usb_open(self);
@@ -1767,12 +1764,11 @@ static int irda_usb_probe(struct usb_interface *intf,
1767 1764
1768 /* replace IrDA class descriptor with what patched device is now reporting */ 1765 /* replace IrDA class descriptor with what patched device is now reporting */
1769 irda_desc = irda_usb_find_class_desc (self->usbintf); 1766 irda_desc = irda_usb_find_class_desc (self->usbintf);
1770 if (irda_desc == NULL) { 1767 if (!irda_desc) {
1771 ret = -ENODEV; 1768 ret = -ENODEV;
1772 goto err_out_6; 1769 goto err_out_6;
1773 } 1770 }
1774 if (self->irda_desc) 1771 kfree(self->irda_desc);
1775 kfree (self->irda_desc);
1776 self->irda_desc = irda_desc; 1772 self->irda_desc = irda_desc;
1777 irda_usb_init_qos(self); 1773 irda_usb_init_qos(self);
1778 } 1774 }
diff --git a/drivers/net/mlx4/reset.c b/drivers/net/mlx4/reset.c
index e4dfd4b11a4a..e199715fabd0 100644
--- a/drivers/net/mlx4/reset.c
+++ b/drivers/net/mlx4/reset.c
@@ -119,6 +119,9 @@ int mlx4_reset(struct mlx4_dev *dev)
119 writel(MLX4_RESET_VALUE, reset + MLX4_RESET_OFFSET); 119 writel(MLX4_RESET_VALUE, reset + MLX4_RESET_OFFSET);
120 iounmap(reset); 120 iounmap(reset);
121 121
122 /* Docs say to wait one second before accessing device */
123 msleep(1000);
124
122 end = jiffies + MLX4_RESET_TIMEOUT_JIFFIES; 125 end = jiffies + MLX4_RESET_TIMEOUT_JIFFIES;
123 do { 126 do {
124 if (!pci_read_config_word(dev->pdev, PCI_VENDOR_ID, &vendor) && 127 if (!pci_read_config_word(dev->pdev, PCI_VENDOR_ID, &vendor) &&
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index deca65330b0f..ae9bb7b7fd67 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -191,6 +191,7 @@ struct myri10ge_priv {
191 struct timer_list watchdog_timer; 191 struct timer_list watchdog_timer;
192 int watchdog_tx_done; 192 int watchdog_tx_done;
193 int watchdog_tx_req; 193 int watchdog_tx_req;
194 int watchdog_pause;
194 int watchdog_resets; 195 int watchdog_resets;
195 int tx_linearized; 196 int tx_linearized;
196 int pause; 197 int pause;
@@ -2800,6 +2801,7 @@ static void myri10ge_watchdog(struct work_struct *work)
2800static void myri10ge_watchdog_timer(unsigned long arg) 2801static void myri10ge_watchdog_timer(unsigned long arg)
2801{ 2802{
2802 struct myri10ge_priv *mgp; 2803 struct myri10ge_priv *mgp;
2804 u32 rx_pause_cnt;
2803 2805
2804 mgp = (struct myri10ge_priv *)arg; 2806 mgp = (struct myri10ge_priv *)arg;
2805 2807
@@ -2816,19 +2818,28 @@ static void myri10ge_watchdog_timer(unsigned long arg)
2816 myri10ge_fill_thresh) 2818 myri10ge_fill_thresh)
2817 mgp->rx_big.watchdog_needed = 0; 2819 mgp->rx_big.watchdog_needed = 0;
2818 } 2820 }
2821 rx_pause_cnt = ntohl(mgp->fw_stats->dropped_pause);
2819 2822
2820 if (mgp->tx.req != mgp->tx.done && 2823 if (mgp->tx.req != mgp->tx.done &&
2821 mgp->tx.done == mgp->watchdog_tx_done && 2824 mgp->tx.done == mgp->watchdog_tx_done &&
2822 mgp->watchdog_tx_req != mgp->watchdog_tx_done) 2825 mgp->watchdog_tx_req != mgp->watchdog_tx_done) {
2823 /* nic seems like it might be stuck.. */ 2826 /* nic seems like it might be stuck.. */
2824 schedule_work(&mgp->watchdog_work); 2827 if (rx_pause_cnt != mgp->watchdog_pause) {
2825 else 2828 if (net_ratelimit())
2826 /* rearm timer */ 2829 printk(KERN_WARNING "myri10ge %s:"
2827 mod_timer(&mgp->watchdog_timer, 2830 "TX paused, check link partner\n",
2828 jiffies + myri10ge_watchdog_timeout * HZ); 2831 mgp->dev->name);
2829 2832 } else {
2833 schedule_work(&mgp->watchdog_work);
2834 return;
2835 }
2836 }
2837 /* rearm timer */
2838 mod_timer(&mgp->watchdog_timer,
2839 jiffies + myri10ge_watchdog_timeout * HZ);
2830 mgp->watchdog_tx_done = mgp->tx.done; 2840 mgp->watchdog_tx_done = mgp->tx.done;
2831 mgp->watchdog_tx_req = mgp->tx.req; 2841 mgp->watchdog_tx_req = mgp->tx.req;
2842 mgp->watchdog_pause = rx_pause_cnt;
2832} 2843}
2833 2844
2834static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 2845static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index 6bb48ba80964..b47a12d684f9 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -2438,13 +2438,16 @@ static void netdev_error(struct net_device *dev, int intr_status)
2438 dev->name); 2438 dev->name);
2439 } 2439 }
2440 np->stats.rx_fifo_errors++; 2440 np->stats.rx_fifo_errors++;
2441 np->stats.rx_errors++;
2441 } 2442 }
2442 /* Hmmmmm, it's not clear how to recover from PCI faults. */ 2443 /* Hmmmmm, it's not clear how to recover from PCI faults. */
2443 if (intr_status & IntrPCIErr) { 2444 if (intr_status & IntrPCIErr) {
2444 printk(KERN_NOTICE "%s: PCI error %#08x\n", dev->name, 2445 printk(KERN_NOTICE "%s: PCI error %#08x\n", dev->name,
2445 intr_status & IntrPCIErr); 2446 intr_status & IntrPCIErr);
2446 np->stats.tx_fifo_errors++; 2447 np->stats.tx_fifo_errors++;
2448 np->stats.tx_errors++;
2447 np->stats.rx_fifo_errors++; 2449 np->stats.rx_fifo_errors++;
2450 np->stats.rx_errors++;
2448 } 2451 }
2449 spin_unlock(&np->lock); 2452 spin_unlock(&np->lock);
2450} 2453}
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index f71dab347667..e323efd4ed18 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -261,7 +261,7 @@ void phy_sanitize_settings(struct phy_device *phydev)
261 261
262 /* Sanitize settings based on PHY capabilities */ 262 /* Sanitize settings based on PHY capabilities */
263 if ((features & SUPPORTED_Autoneg) == 0) 263 if ((features & SUPPORTED_Autoneg) == 0)
264 phydev->autoneg = 0; 264 phydev->autoneg = AUTONEG_DISABLE;
265 265
266 idx = phy_find_valid(phy_find_setting(phydev->speed, phydev->duplex), 266 idx = phy_find_valid(phy_find_setting(phydev->speed, phydev->duplex),
267 features); 267 features);
@@ -374,7 +374,7 @@ int phy_mii_ioctl(struct phy_device *phydev,
374 if (mii_data->phy_id == phydev->addr) { 374 if (mii_data->phy_id == phydev->addr) {
375 switch(mii_data->reg_num) { 375 switch(mii_data->reg_num) {
376 case MII_BMCR: 376 case MII_BMCR:
377 if (val & (BMCR_RESET|BMCR_ANENABLE)) 377 if ((val & (BMCR_RESET|BMCR_ANENABLE)) == 0)
378 phydev->autoneg = AUTONEG_DISABLE; 378 phydev->autoneg = AUTONEG_DISABLE;
379 else 379 else
380 phydev->autoneg = AUTONEG_ENABLE; 380 phydev->autoneg = AUTONEG_ENABLE;
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index ef3325b69233..9293c82ef2af 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -1726,7 +1726,7 @@ ppp_decompress_frame(struct ppp *ppp, struct sk_buff *skb)
1726 } 1726 }
1727 /* the decompressor still expects the A/C bytes in the hdr */ 1727 /* the decompressor still expects the A/C bytes in the hdr */
1728 len = ppp->rcomp->decompress(ppp->rc_state, skb->data - 2, 1728 len = ppp->rcomp->decompress(ppp->rc_state, skb->data - 2,
1729 skb->len + 2, ns->data, ppp->mru + PPP_HDRLEN); 1729 skb->len + 2, ns->data, obuff_size);
1730 if (len < 0) { 1730 if (len < 0) {
1731 /* Pass the compressed frame to pppd as an 1731 /* Pass the compressed frame to pppd as an
1732 error indication. */ 1732 error indication. */
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index c9333b9dd51a..b85ab4a8f2a3 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -725,6 +725,12 @@ static int rtl8169_set_speed_xmii(struct net_device *dev,
725 725
726 auto_nego |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM; 726 auto_nego |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM;
727 727
728 if (tp->mac_version == RTL_GIGA_MAC_VER_12) {
729 /* Vendor specific (0x1f) and reserved (0x0e) MII registers. */
730 mdio_write(ioaddr, 0x1f, 0x0000);
731 mdio_write(ioaddr, 0x0e, 0x0000);
732 }
733
728 tp->phy_auto_nego_reg = auto_nego; 734 tp->phy_auto_nego_reg = auto_nego;
729 tp->phy_1000_ctrl_reg = giga_ctrl; 735 tp->phy_1000_ctrl_reg = giga_ctrl;
730 736
@@ -2760,14 +2766,16 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
2760 rtl8169_check_link_status(dev, tp, ioaddr); 2766 rtl8169_check_link_status(dev, tp, ioaddr);
2761 2767
2762#ifdef CONFIG_R8169_NAPI 2768#ifdef CONFIG_R8169_NAPI
2763 RTL_W16(IntrMask, tp->intr_event & ~tp->napi_event); 2769 if (status & tp->napi_event) {
2764 tp->intr_mask = ~tp->napi_event; 2770 RTL_W16(IntrMask, tp->intr_event & ~tp->napi_event);
2765 2771 tp->intr_mask = ~tp->napi_event;
2766 if (likely(netif_rx_schedule_prep(dev))) 2772
2767 __netif_rx_schedule(dev); 2773 if (likely(netif_rx_schedule_prep(dev)))
2768 else if (netif_msg_intr(tp)) { 2774 __netif_rx_schedule(dev);
2769 printk(KERN_INFO "%s: interrupt %04x taken in poll\n", 2775 else if (netif_msg_intr(tp)) {
2770 dev->name, status); 2776 printk(KERN_INFO "%s: interrupt %04x in poll\n",
2777 dev->name, status);
2778 }
2771 } 2779 }
2772 break; 2780 break;
2773#else 2781#else
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 2be0a0f1b48f..24feb00600ee 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -2430,7 +2430,7 @@ static int fill_rx_buffers(struct s2io_nic *nic, int ring_no)
2430 (rxdp3->Buffer1_ptr == DMA_ERROR_CODE)) { 2430 (rxdp3->Buffer1_ptr == DMA_ERROR_CODE)) {
2431 pci_unmap_single 2431 pci_unmap_single
2432 (nic->pdev, 2432 (nic->pdev,
2433 (dma_addr_t)skb->data, 2433 (dma_addr_t)rxdp3->Buffer2_ptr,
2434 dev->mtu + 4, 2434 dev->mtu + 4,
2435 PCI_DMA_FROMDEVICE); 2435 PCI_DMA_FROMDEVICE);
2436 goto pci_map_failed; 2436 goto pci_map_failed;
@@ -6211,7 +6211,7 @@ static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp,
6211 if( (rxdp3->Buffer0_ptr == 0) || 6211 if( (rxdp3->Buffer0_ptr == 0) ||
6212 (rxdp3->Buffer0_ptr == DMA_ERROR_CODE)) { 6212 (rxdp3->Buffer0_ptr == DMA_ERROR_CODE)) {
6213 pci_unmap_single (sp->pdev, 6213 pci_unmap_single (sp->pdev,
6214 (dma_addr_t)(*skb)->data, 6214 (dma_addr_t)rxdp3->Buffer2_ptr,
6215 dev->mtu + 4, PCI_DMA_FROMDEVICE); 6215 dev->mtu + 4, PCI_DMA_FROMDEVICE);
6216 goto memalloc_failed; 6216 goto memalloc_failed;
6217 } 6217 }
@@ -6224,7 +6224,10 @@ static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp,
6224 if( (rxdp3->Buffer1_ptr == 0) || 6224 if( (rxdp3->Buffer1_ptr == 0) ||
6225 (rxdp3->Buffer1_ptr == DMA_ERROR_CODE)) { 6225 (rxdp3->Buffer1_ptr == DMA_ERROR_CODE)) {
6226 pci_unmap_single (sp->pdev, 6226 pci_unmap_single (sp->pdev,
6227 (dma_addr_t)(*skb)->data, 6227 (dma_addr_t)rxdp3->Buffer0_ptr,
6228 BUF0_LEN, PCI_DMA_FROMDEVICE);
6229 pci_unmap_single (sp->pdev,
6230 (dma_addr_t)rxdp3->Buffer2_ptr,
6228 dev->mtu + 4, PCI_DMA_FROMDEVICE); 6231 dev->mtu + 4, PCI_DMA_FROMDEVICE);
6229 goto memalloc_failed; 6232 goto memalloc_failed;
6230 } 6233 }
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
index ec2ad9f0efa2..d470b19c0810 100644
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -1593,6 +1593,9 @@ static int __devinit sis190_get_mac_addr_from_apc(struct pci_dev *pdev,
1593 pci_name(pdev)); 1593 pci_name(pdev));
1594 1594
1595 isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0965, NULL); 1595 isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0965, NULL);
1596 if (!isa_bridge)
1597 isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0966, NULL);
1598
1596 if (!isa_bridge) { 1599 if (!isa_bridge) {
1597 net_probe(tp, KERN_INFO "%s: Can not find ISA bridge.\n", 1600 net_probe(tp, KERN_INFO "%s: Can not find ISA bridge.\n",
1598 pci_name(pdev)); 1601 pci_name(pdev));
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index e7a2eadcc3b0..757592436390 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -696,8 +696,8 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port)
696 int i; 696 int i;
697 const u8 *addr = hw->dev[port]->dev_addr; 697 const u8 *addr = hw->dev[port]->dev_addr;
698 698
699 sky2_write32(hw, SK_REG(port, GPHY_CTRL), GPC_RST_SET); 699 sky2_write8(hw, SK_REG(port, GPHY_CTRL), GPC_RST_SET);
700 sky2_write32(hw, SK_REG(port, GPHY_CTRL), GPC_RST_CLR); 700 sky2_write8(hw, SK_REG(port, GPHY_CTRL), GPC_RST_CLR);
701 701
702 sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_RST_CLR); 702 sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_RST_CLR);
703 703
diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h
index f8429449dc1e..6ff3a1627af8 100644
--- a/drivers/net/smc91x.h
+++ b/drivers/net/smc91x.h
@@ -299,7 +299,7 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg)
299 299
300#define SMC_CAN_USE_8BIT 1 300#define SMC_CAN_USE_8BIT 1
301#define SMC_CAN_USE_16BIT 1 301#define SMC_CAN_USE_16BIT 1
302#define SMC_CAN_USE_32BIT 1 302#define SMC_CAN_USE_32BIT 0
303 303
304#define SMC_inb(a, r) inb((a) + (r)) 304#define SMC_inb(a, r) inb((a) + (r))
305#define SMC_inw(a, r) inw((a) + (r)) 305#define SMC_inw(a, r) inw((a) + (r))
@@ -310,8 +310,6 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg)
310 310
311#endif /* BOARDS */ 311#endif /* BOARDS */
312 312
313#define set_irq_type(irq, type) do {} while (0)
314
315#elif defined(CONFIG_M32R) 313#elif defined(CONFIG_M32R)
316 314
317#define SMC_CAN_USE_8BIT 0 315#define SMC_CAN_USE_8BIT 0
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index dc41c055ebb5..58740428dd07 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -64,8 +64,8 @@
64 64
65#define DRV_MODULE_NAME "tg3" 65#define DRV_MODULE_NAME "tg3"
66#define PFX DRV_MODULE_NAME ": " 66#define PFX DRV_MODULE_NAME ": "
67#define DRV_MODULE_VERSION "3.79" 67#define DRV_MODULE_VERSION "3.80"
68#define DRV_MODULE_RELDATE "July 18, 2007" 68#define DRV_MODULE_RELDATE "August 2, 2007"
69 69
70#define TG3_DEF_MAC_MODE 0 70#define TG3_DEF_MAC_MODE 0
71#define TG3_DEF_RX_MODE 0 71#define TG3_DEF_RX_MODE 0
@@ -12111,6 +12111,12 @@ static int tg3_suspend(struct pci_dev *pdev, pm_message_t state)
12111 struct tg3 *tp = netdev_priv(dev); 12111 struct tg3 *tp = netdev_priv(dev);
12112 int err; 12112 int err;
12113 12113
12114 /* PCI register 4 needs to be saved whether netif_running() or not.
12115 * MSI address and data need to be saved if using MSI and
12116 * netif_running().
12117 */
12118 pci_save_state(pdev);
12119
12114 if (!netif_running(dev)) 12120 if (!netif_running(dev))
12115 return 0; 12121 return 0;
12116 12122
@@ -12130,9 +12136,6 @@ static int tg3_suspend(struct pci_dev *pdev, pm_message_t state)
12130 tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE; 12136 tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE;
12131 tg3_full_unlock(tp); 12137 tg3_full_unlock(tp);
12132 12138
12133 /* Save MSI address and data for resume. */
12134 pci_save_state(pdev);
12135
12136 err = tg3_set_power_state(tp, pci_choose_state(pdev, state)); 12139 err = tg3_set_power_state(tp, pci_choose_state(pdev, state));
12137 if (err) { 12140 if (err) {
12138 tg3_full_lock(tp, 0); 12141 tg3_full_lock(tp, 0);
@@ -12160,11 +12163,11 @@ static int tg3_resume(struct pci_dev *pdev)
12160 struct tg3 *tp = netdev_priv(dev); 12163 struct tg3 *tp = netdev_priv(dev);
12161 int err; 12164 int err;
12162 12165
12166 pci_restore_state(tp->pdev);
12167
12163 if (!netif_running(dev)) 12168 if (!netif_running(dev))
12164 return 0; 12169 return 0;
12165 12170
12166 pci_restore_state(tp->pdev);
12167
12168 err = tg3_set_power_state(tp, PCI_D0); 12171 err = tg3_set_power_state(tp, PCI_D0);
12169 if (err) 12172 if (err)
12170 return err; 12173 return err;
diff --git a/drivers/net/ucc_geth_ethtool.c b/drivers/net/ucc_geth_ethtool.c
index a8994c7b8583..64bef7c12365 100644
--- a/drivers/net/ucc_geth_ethtool.c
+++ b/drivers/net/ucc_geth_ethtool.c
@@ -379,7 +379,6 @@ static const struct ethtool_ops uec_ethtool_ops = {
379 .get_stats_count = uec_get_stats_count, 379 .get_stats_count = uec_get_stats_count,
380 .get_strings = uec_get_strings, 380 .get_strings = uec_get_strings,
381 .get_ethtool_stats = uec_get_ethtool_stats, 381 .get_ethtool_stats = uec_get_ethtool_stats,
382 .get_perm_addr = ethtool_op_get_perm_addr,
383}; 382};
384 383
385void uec_set_ethtool_ops(struct net_device *netdev) 384void uec_set_ethtool_ops(struct net_device *netdev)
diff --git a/drivers/net/ucc_geth_mii.c b/drivers/net/ucc_geth_mii.c
index 5f8c2d30a328..6c257b88ce51 100644
--- a/drivers/net/ucc_geth_mii.c
+++ b/drivers/net/ucc_geth_mii.c
@@ -272,7 +272,8 @@ int __init uec_mdio_init(void)
272 return of_register_platform_driver(&uec_mdio_driver); 272 return of_register_platform_driver(&uec_mdio_driver);
273} 273}
274 274
275void __exit uec_mdio_exit(void) 275/* called from __init ucc_geth_init, therefore can not be __exit */
276void uec_mdio_exit(void)
276{ 277{
277 of_unregister_platform_driver(&uec_mdio_driver); 278 of_unregister_platform_driver(&uec_mdio_driver);
278} 279}
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
index c3fe230695a0..b56dff26772d 100644
--- a/drivers/net/via-rhine.c
+++ b/drivers/net/via-rhine.c
@@ -42,7 +42,13 @@ static int max_interrupt_work = 20;
42 42
43/* Set the copy breakpoint for the copy-only-tiny-frames scheme. 43/* Set the copy breakpoint for the copy-only-tiny-frames scheme.
44 Setting to > 1518 effectively disables this feature. */ 44 Setting to > 1518 effectively disables this feature. */
45#if defined(__alpha__) || defined(__arm__) || defined(__hppa__) \
46 || defined(CONFIG_SPARC) || defined(__ia64__) \
47 || defined(__sh__) || defined(__mips__)
48static int rx_copybreak = 1518;
49#else
45static int rx_copybreak; 50static int rx_copybreak;
51#endif
46 52
47/* Work-around for broken BIOSes: they are unable to get the chip back out of 53/* Work-around for broken BIOSes: they are unable to get the chip back out of
48 power state D3 so PXE booting fails. bootparam(7): via-rhine.avoid_D3=1 */ 54 power state D3 so PXE booting fails. bootparam(7): via-rhine.avoid_D3=1 */
diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c
index 15b6e07a4382..071a64cacd5c 100644
--- a/drivers/net/wan/hdlc_fr.c
+++ b/drivers/net/wan/hdlc_fr.c
@@ -212,14 +212,13 @@ static pvc_device* add_pvc(struct net_device *dev, u16 dlci)
212 pvc_p = &(*pvc_p)->next; 212 pvc_p = &(*pvc_p)->next;
213 } 213 }
214 214
215 pvc = kmalloc(sizeof(pvc_device), GFP_ATOMIC); 215 pvc = kzalloc(sizeof(pvc_device), GFP_ATOMIC);
216#ifdef DEBUG_PVC 216#ifdef DEBUG_PVC
217 printk(KERN_DEBUG "add_pvc: allocated pvc %p, frad %p\n", pvc, dev); 217 printk(KERN_DEBUG "add_pvc: allocated pvc %p, frad %p\n", pvc, dev);
218#endif 218#endif
219 if (!pvc) 219 if (!pvc)
220 return NULL; 220 return NULL;
221 221
222 memset(pvc, 0, sizeof(pvc_device));
223 pvc->dlci = dlci; 222 pvc->dlci = dlci;
224 pvc->frad = dev; 223 pvc->frad = dev;
225 pvc->next = *pvc_p; /* Put it in the chain */ 224 pvc->next = *pvc_p; /* Put it in the chain */
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c
index d779199c30d0..b37f1e348700 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c
@@ -1638,7 +1638,7 @@ void bcm43xx_phy_set_baseband_attenuation(struct bcm43xx_private *bcm,
1638 return; 1638 return;
1639 } 1639 }
1640 1640
1641 if (phy->analog == 1) { 1641 if (phy->analog > 1) {
1642 value = bcm43xx_phy_read(bcm, 0x0060) & ~0x003C; 1642 value = bcm43xx_phy_read(bcm, 0x0060) & ~0x003C;
1643 value |= (baseband_attenuation << 2) & 0x003C; 1643 value |= (baseband_attenuation << 2) & 0x003C;
1644 } else { 1644 } else {
diff --git a/drivers/net/wireless/rtl8187_dev.c b/drivers/net/wireless/rtl8187_dev.c
index cea85894b7f2..e61c6d5ba1a9 100644
--- a/drivers/net/wireless/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl8187_dev.c
@@ -466,7 +466,7 @@ static int rtl8187_add_interface(struct ieee80211_hw *dev,
466 return -EOPNOTSUPP; 466 return -EOPNOTSUPP;
467 } 467 }
468 468
469 priv->hwaddr = conf->mac_addr; 469 priv->hwaddr = conf->mac_addr ? conf->mac_addr : dev->wiphy->perm_addr;
470 470
471 return 0; 471 return 0;
472} 472}
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index f6c487aa8246..26869d107e52 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -822,7 +822,7 @@ static void cs_set_control(struct zd_mac *mac, struct zd_ctrlset *cs,
822 cs->control |= ZD_CS_MULTICAST; 822 cs->control |= ZD_CS_MULTICAST;
823 823
824 /* PS-POLL */ 824 /* PS-POLL */
825 if (stype == IEEE80211_STYPE_PSPOLL) 825 if (ftype == IEEE80211_FTYPE_CTL && stype == IEEE80211_STYPE_PSPOLL)
826 cs->control |= ZD_CS_PS_POLL_FRAME; 826 cs->control |= ZD_CS_PS_POLL_FRAME;
827 827
828 /* Unicast data frames over the threshold should have RTS */ 828 /* Unicast data frames over the threshold should have RTS */
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 489f69c5d6ca..4445810335a8 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -566,6 +566,10 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
566 if (notify) 566 if (notify)
567 notify_remote_via_irq(np->netdev->irq); 567 notify_remote_via_irq(np->netdev->irq);
568 568
569 np->stats.tx_bytes += skb->len;
570 np->stats.tx_packets++;
571
572 /* Note: It is not safe to access skb after xennet_tx_buf_gc()! */
569 xennet_tx_buf_gc(dev); 573 xennet_tx_buf_gc(dev);
570 574
571 if (!netfront_tx_slot_available(np)) 575 if (!netfront_tx_slot_available(np))
@@ -573,9 +577,6 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
573 577
574 spin_unlock_irq(&np->tx_lock); 578 spin_unlock_irq(&np->tx_lock);
575 579
576 np->stats.tx_bytes += skb->len;
577 np->stats.tx_packets++;
578
579 return 0; 580 return 0;
580 581
581 drop: 582 drop: