diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dca/dca-core.c | 85 | ||||
-rw-r--r-- | drivers/net/3c59x.c | 7 | ||||
-rw-r--r-- | drivers/net/atlx/atl1.c | 11 | ||||
-rw-r--r-- | drivers/net/bonding/bond_3ad.c | 3 | ||||
-rw-r--r-- | drivers/net/bonding/bond_alb.c | 3 | ||||
-rw-r--r-- | drivers/net/cxgb3/cxgb3_main.c | 2 | ||||
-rw-r--r-- | drivers/net/e1000e/hw.h | 1 | ||||
-rw-r--r-- | drivers/net/e1000e/ich8lan.c | 197 | ||||
-rw-r--r-- | drivers/net/e1000e/netdev.c | 29 | ||||
-rw-r--r-- | drivers/net/eql.c | 2 | ||||
-rw-r--r-- | drivers/net/ibm_newemac/core.c | 4 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_init.c | 3 | ||||
-rw-r--r-- | drivers/net/phy/mdio_bus.c | 4 | ||||
-rw-r--r-- | drivers/net/ppp_generic.c | 9 | ||||
-rw-r--r-- | drivers/net/qlcnic/qlcnic_init.c | 2 | ||||
-rw-r--r-- | drivers/net/r8169.c | 5 | ||||
-rw-r--r-- | drivers/net/rionet.c | 2 | ||||
-rw-r--r-- | drivers/net/sgiseeq.c | 2 | ||||
-rw-r--r-- | drivers/net/smsc911x.c | 1 | ||||
-rw-r--r-- | drivers/net/tulip/de2104x.c | 38 | ||||
-rw-r--r-- | drivers/net/usb/hso.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 5 | ||||
-rw-r--r-- | drivers/s390/net/ctcm_main.c | 4 | ||||
-rw-r--r-- | drivers/vhost/net.c | 2 |
24 files changed, 346 insertions, 77 deletions
diff --git a/drivers/dca/dca-core.c b/drivers/dca/dca-core.c index 8661c84a105d..b98c67664ae7 100644 --- a/drivers/dca/dca-core.c +++ b/drivers/dca/dca-core.c | |||
@@ -39,6 +39,10 @@ static DEFINE_SPINLOCK(dca_lock); | |||
39 | 39 | ||
40 | static LIST_HEAD(dca_domains); | 40 | static LIST_HEAD(dca_domains); |
41 | 41 | ||
42 | static BLOCKING_NOTIFIER_HEAD(dca_provider_chain); | ||
43 | |||
44 | static int dca_providers_blocked; | ||
45 | |||
42 | static struct pci_bus *dca_pci_rc_from_dev(struct device *dev) | 46 | static struct pci_bus *dca_pci_rc_from_dev(struct device *dev) |
43 | { | 47 | { |
44 | struct pci_dev *pdev = to_pci_dev(dev); | 48 | struct pci_dev *pdev = to_pci_dev(dev); |
@@ -70,6 +74,60 @@ static void dca_free_domain(struct dca_domain *domain) | |||
70 | kfree(domain); | 74 | kfree(domain); |
71 | } | 75 | } |
72 | 76 | ||
77 | static int dca_provider_ioat_ver_3_0(struct device *dev) | ||
78 | { | ||
79 | struct pci_dev *pdev = to_pci_dev(dev); | ||
80 | |||
81 | return ((pdev->vendor == PCI_VENDOR_ID_INTEL) && | ||
82 | ((pdev->device == PCI_DEVICE_ID_INTEL_IOAT_TBG0) || | ||
83 | (pdev->device == PCI_DEVICE_ID_INTEL_IOAT_TBG1) || | ||
84 | (pdev->device == PCI_DEVICE_ID_INTEL_IOAT_TBG2) || | ||
85 | (pdev->device == PCI_DEVICE_ID_INTEL_IOAT_TBG3) || | ||
86 | (pdev->device == PCI_DEVICE_ID_INTEL_IOAT_TBG4) || | ||
87 | (pdev->device == PCI_DEVICE_ID_INTEL_IOAT_TBG5) || | ||
88 | (pdev->device == PCI_DEVICE_ID_INTEL_IOAT_TBG6) || | ||
89 | (pdev->device == PCI_DEVICE_ID_INTEL_IOAT_TBG7))); | ||
90 | } | ||
91 | |||
92 | static void unregister_dca_providers(void) | ||
93 | { | ||
94 | struct dca_provider *dca, *_dca; | ||
95 | struct list_head unregistered_providers; | ||
96 | struct dca_domain *domain; | ||
97 | unsigned long flags; | ||
98 | |||
99 | blocking_notifier_call_chain(&dca_provider_chain, | ||
100 | DCA_PROVIDER_REMOVE, NULL); | ||
101 | |||
102 | INIT_LIST_HEAD(&unregistered_providers); | ||
103 | |||
104 | spin_lock_irqsave(&dca_lock, flags); | ||
105 | |||
106 | if (list_empty(&dca_domains)) { | ||
107 | spin_unlock_irqrestore(&dca_lock, flags); | ||
108 | return; | ||
109 | } | ||
110 | |||
111 | /* at this point only one domain in the list is expected */ | ||
112 | domain = list_first_entry(&dca_domains, struct dca_domain, node); | ||
113 | if (!domain) | ||
114 | return; | ||
115 | |||
116 | list_for_each_entry_safe(dca, _dca, &domain->dca_providers, node) { | ||
117 | list_del(&dca->node); | ||
118 | list_add(&dca->node, &unregistered_providers); | ||
119 | } | ||
120 | |||
121 | dca_free_domain(domain); | ||
122 | |||
123 | spin_unlock_irqrestore(&dca_lock, flags); | ||
124 | |||
125 | list_for_each_entry_safe(dca, _dca, &unregistered_providers, node) { | ||
126 | dca_sysfs_remove_provider(dca); | ||
127 | list_del(&dca->node); | ||
128 | } | ||
129 | } | ||
130 | |||
73 | static struct dca_domain *dca_find_domain(struct pci_bus *rc) | 131 | static struct dca_domain *dca_find_domain(struct pci_bus *rc) |
74 | { | 132 | { |
75 | struct dca_domain *domain; | 133 | struct dca_domain *domain; |
@@ -90,9 +148,13 @@ static struct dca_domain *dca_get_domain(struct device *dev) | |||
90 | domain = dca_find_domain(rc); | 148 | domain = dca_find_domain(rc); |
91 | 149 | ||
92 | if (!domain) { | 150 | if (!domain) { |
93 | domain = dca_allocate_domain(rc); | 151 | if (dca_provider_ioat_ver_3_0(dev) && !list_empty(&dca_domains)) { |
94 | if (domain) | 152 | dca_providers_blocked = 1; |
95 | list_add(&domain->node, &dca_domains); | 153 | } else { |
154 | domain = dca_allocate_domain(rc); | ||
155 | if (domain) | ||
156 | list_add(&domain->node, &dca_domains); | ||
157 | } | ||
96 | } | 158 | } |
97 | 159 | ||
98 | return domain; | 160 | return domain; |
@@ -293,8 +355,6 @@ void free_dca_provider(struct dca_provider *dca) | |||
293 | } | 355 | } |
294 | EXPORT_SYMBOL_GPL(free_dca_provider); | 356 | EXPORT_SYMBOL_GPL(free_dca_provider); |
295 | 357 | ||
296 | static BLOCKING_NOTIFIER_HEAD(dca_provider_chain); | ||
297 | |||
298 | /** | 358 | /** |
299 | * register_dca_provider - register a dca provider | 359 | * register_dca_provider - register a dca provider |
300 | * @dca - struct created by alloc_dca_provider() | 360 | * @dca - struct created by alloc_dca_provider() |
@@ -306,6 +366,13 @@ int register_dca_provider(struct dca_provider *dca, struct device *dev) | |||
306 | unsigned long flags; | 366 | unsigned long flags; |
307 | struct dca_domain *domain; | 367 | struct dca_domain *domain; |
308 | 368 | ||
369 | spin_lock_irqsave(&dca_lock, flags); | ||
370 | if (dca_providers_blocked) { | ||
371 | spin_unlock_irqrestore(&dca_lock, flags); | ||
372 | return -ENODEV; | ||
373 | } | ||
374 | spin_unlock_irqrestore(&dca_lock, flags); | ||
375 | |||
309 | err = dca_sysfs_add_provider(dca, dev); | 376 | err = dca_sysfs_add_provider(dca, dev); |
310 | if (err) | 377 | if (err) |
311 | return err; | 378 | return err; |
@@ -313,7 +380,13 @@ int register_dca_provider(struct dca_provider *dca, struct device *dev) | |||
313 | spin_lock_irqsave(&dca_lock, flags); | 380 | spin_lock_irqsave(&dca_lock, flags); |
314 | domain = dca_get_domain(dev); | 381 | domain = dca_get_domain(dev); |
315 | if (!domain) { | 382 | if (!domain) { |
316 | spin_unlock_irqrestore(&dca_lock, flags); | 383 | if (dca_providers_blocked) { |
384 | spin_unlock_irqrestore(&dca_lock, flags); | ||
385 | dca_sysfs_remove_provider(dca); | ||
386 | unregister_dca_providers(); | ||
387 | } else { | ||
388 | spin_unlock_irqrestore(&dca_lock, flags); | ||
389 | } | ||
317 | return -ENODEV; | 390 | return -ENODEV; |
318 | } | 391 | } |
319 | list_add(&dca->node, &domain->dca_providers); | 392 | list_add(&dca->node, &domain->dca_providers); |
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c index e31a6d1919c6..ed964964fe1f 100644 --- a/drivers/net/3c59x.c +++ b/drivers/net/3c59x.c | |||
@@ -635,6 +635,9 @@ struct vortex_private { | |||
635 | must_free_region:1, /* Flag: if zero, Cardbus owns the I/O region */ | 635 | must_free_region:1, /* Flag: if zero, Cardbus owns the I/O region */ |
636 | large_frames:1, /* accept large frames */ | 636 | large_frames:1, /* accept large frames */ |
637 | handling_irq:1; /* private in_irq indicator */ | 637 | handling_irq:1; /* private in_irq indicator */ |
638 | /* {get|set}_wol operations are already serialized by rtnl. | ||
639 | * no additional locking is required for the enable_wol and acpi_set_WOL() | ||
640 | */ | ||
638 | int drv_flags; | 641 | int drv_flags; |
639 | u16 status_enable; | 642 | u16 status_enable; |
640 | u16 intr_enable; | 643 | u16 intr_enable; |
@@ -2939,13 +2942,11 @@ static void vortex_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | |||
2939 | { | 2942 | { |
2940 | struct vortex_private *vp = netdev_priv(dev); | 2943 | struct vortex_private *vp = netdev_priv(dev); |
2941 | 2944 | ||
2942 | spin_lock_irq(&vp->lock); | ||
2943 | wol->supported = WAKE_MAGIC; | 2945 | wol->supported = WAKE_MAGIC; |
2944 | 2946 | ||
2945 | wol->wolopts = 0; | 2947 | wol->wolopts = 0; |
2946 | if (vp->enable_wol) | 2948 | if (vp->enable_wol) |
2947 | wol->wolopts |= WAKE_MAGIC; | 2949 | wol->wolopts |= WAKE_MAGIC; |
2948 | spin_unlock_irq(&vp->lock); | ||
2949 | } | 2950 | } |
2950 | 2951 | ||
2951 | static int vortex_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | 2952 | static int vortex_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) |
@@ -2954,13 +2955,11 @@ static int vortex_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | |||
2954 | if (wol->wolopts & ~WAKE_MAGIC) | 2955 | if (wol->wolopts & ~WAKE_MAGIC) |
2955 | return -EINVAL; | 2956 | return -EINVAL; |
2956 | 2957 | ||
2957 | spin_lock_irq(&vp->lock); | ||
2958 | if (wol->wolopts & WAKE_MAGIC) | 2958 | if (wol->wolopts & WAKE_MAGIC) |
2959 | vp->enable_wol = 1; | 2959 | vp->enable_wol = 1; |
2960 | else | 2960 | else |
2961 | vp->enable_wol = 0; | 2961 | vp->enable_wol = 0; |
2962 | acpi_set_WOL(dev); | 2962 | acpi_set_WOL(dev); |
2963 | spin_unlock_irq(&vp->lock); | ||
2964 | 2963 | ||
2965 | return 0; | 2964 | return 0; |
2966 | } | 2965 | } |
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c index 4ba6431deeef..b8c053f76878 100644 --- a/drivers/net/atlx/atl1.c +++ b/drivers/net/atlx/atl1.c | |||
@@ -1251,6 +1251,12 @@ static void atl1_free_ring_resources(struct atl1_adapter *adapter) | |||
1251 | 1251 | ||
1252 | rrd_ring->desc = NULL; | 1252 | rrd_ring->desc = NULL; |
1253 | rrd_ring->dma = 0; | 1253 | rrd_ring->dma = 0; |
1254 | |||
1255 | adapter->cmb.dma = 0; | ||
1256 | adapter->cmb.cmb = NULL; | ||
1257 | |||
1258 | adapter->smb.dma = 0; | ||
1259 | adapter->smb.smb = NULL; | ||
1254 | } | 1260 | } |
1255 | 1261 | ||
1256 | static void atl1_setup_mac_ctrl(struct atl1_adapter *adapter) | 1262 | static void atl1_setup_mac_ctrl(struct atl1_adapter *adapter) |
@@ -2847,10 +2853,11 @@ static int atl1_resume(struct pci_dev *pdev) | |||
2847 | pci_enable_wake(pdev, PCI_D3cold, 0); | 2853 | pci_enable_wake(pdev, PCI_D3cold, 0); |
2848 | 2854 | ||
2849 | atl1_reset_hw(&adapter->hw); | 2855 | atl1_reset_hw(&adapter->hw); |
2850 | adapter->cmb.cmb->int_stats = 0; | ||
2851 | 2856 | ||
2852 | if (netif_running(netdev)) | 2857 | if (netif_running(netdev)) { |
2858 | adapter->cmb.cmb->int_stats = 0; | ||
2853 | atl1_up(adapter); | 2859 | atl1_up(adapter); |
2860 | } | ||
2854 | netif_device_attach(netdev); | 2861 | netif_device_attach(netdev); |
2855 | 2862 | ||
2856 | return 0; | 2863 | return 0; |
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index 2a47c1deb9f0..079b9d1eead5 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c | |||
@@ -2466,6 +2466,9 @@ int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct pac | |||
2466 | if (!(dev->flags & IFF_MASTER)) | 2466 | if (!(dev->flags & IFF_MASTER)) |
2467 | goto out; | 2467 | goto out; |
2468 | 2468 | ||
2469 | if (!pskb_may_pull(skb, sizeof(struct lacpdu))) | ||
2470 | goto out; | ||
2471 | |||
2469 | read_lock(&bond->lock); | 2472 | read_lock(&bond->lock); |
2470 | slave = bond_get_slave_by_dev((struct bonding *)netdev_priv(dev), | 2473 | slave = bond_get_slave_by_dev((struct bonding *)netdev_priv(dev), |
2471 | orig_dev); | 2474 | orig_dev); |
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index c746b331771d..26bb118c4533 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
@@ -362,6 +362,9 @@ static int rlb_arp_recv(struct sk_buff *skb, struct net_device *bond_dev, struct | |||
362 | goto out; | 362 | goto out; |
363 | } | 363 | } |
364 | 364 | ||
365 | if (!pskb_may_pull(skb, arp_hdr_len(bond_dev))) | ||
366 | goto out; | ||
367 | |||
365 | if (skb->len < sizeof(struct arp_pkt)) { | 368 | if (skb->len < sizeof(struct arp_pkt)) { |
366 | pr_debug("Packet is too small to be an ARP\n"); | 369 | pr_debug("Packet is too small to be an ARP\n"); |
367 | goto out; | 370 | goto out; |
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c index 1ecf53dafe06..f9eede0a4b86 100644 --- a/drivers/net/cxgb3/cxgb3_main.c +++ b/drivers/net/cxgb3/cxgb3_main.c | |||
@@ -2302,6 +2302,8 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr) | |||
2302 | case CHELSIO_GET_QSET_NUM:{ | 2302 | case CHELSIO_GET_QSET_NUM:{ |
2303 | struct ch_reg edata; | 2303 | struct ch_reg edata; |
2304 | 2304 | ||
2305 | memset(&edata, 0, sizeof(struct ch_reg)); | ||
2306 | |||
2305 | edata.cmd = CHELSIO_GET_QSET_NUM; | 2307 | edata.cmd = CHELSIO_GET_QSET_NUM; |
2306 | edata.val = pi->nqsets; | 2308 | edata.val = pi->nqsets; |
2307 | if (copy_to_user(useraddr, &edata, sizeof(edata))) | 2309 | if (copy_to_user(useraddr, &edata, sizeof(edata))) |
diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h index 66ed08f726fb..ba302a5c2c30 100644 --- a/drivers/net/e1000e/hw.h +++ b/drivers/net/e1000e/hw.h | |||
@@ -57,6 +57,7 @@ enum e1e_registers { | |||
57 | E1000_SCTL = 0x00024, /* SerDes Control - RW */ | 57 | E1000_SCTL = 0x00024, /* SerDes Control - RW */ |
58 | E1000_FCAL = 0x00028, /* Flow Control Address Low - RW */ | 58 | E1000_FCAL = 0x00028, /* Flow Control Address Low - RW */ |
59 | E1000_FCAH = 0x0002C, /* Flow Control Address High -RW */ | 59 | E1000_FCAH = 0x0002C, /* Flow Control Address High -RW */ |
60 | E1000_FEXTNVM4 = 0x00024, /* Future Extended NVM 4 - RW */ | ||
60 | E1000_FEXTNVM = 0x00028, /* Future Extended NVM - RW */ | 61 | E1000_FEXTNVM = 0x00028, /* Future Extended NVM - RW */ |
61 | E1000_FCT = 0x00030, /* Flow Control Type - RW */ | 62 | E1000_FCT = 0x00030, /* Flow Control Type - RW */ |
62 | E1000_VET = 0x00038, /* VLAN Ether Type - RW */ | 63 | E1000_VET = 0x00038, /* VLAN Ether Type - RW */ |
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c index 63930d12711c..57b5435599ab 100644 --- a/drivers/net/e1000e/ich8lan.c +++ b/drivers/net/e1000e/ich8lan.c | |||
@@ -105,6 +105,10 @@ | |||
105 | #define E1000_FEXTNVM_SW_CONFIG 1 | 105 | #define E1000_FEXTNVM_SW_CONFIG 1 |
106 | #define E1000_FEXTNVM_SW_CONFIG_ICH8M (1 << 27) /* Bit redefined for ICH8M :/ */ | 106 | #define E1000_FEXTNVM_SW_CONFIG_ICH8M (1 << 27) /* Bit redefined for ICH8M :/ */ |
107 | 107 | ||
108 | #define E1000_FEXTNVM4_BEACON_DURATION_MASK 0x7 | ||
109 | #define E1000_FEXTNVM4_BEACON_DURATION_8USEC 0x7 | ||
110 | #define E1000_FEXTNVM4_BEACON_DURATION_16USEC 0x3 | ||
111 | |||
108 | #define PCIE_ICH8_SNOOP_ALL PCIE_NO_SNOOP_ALL | 112 | #define PCIE_ICH8_SNOOP_ALL PCIE_NO_SNOOP_ALL |
109 | 113 | ||
110 | #define E1000_ICH_RAR_ENTRIES 7 | 114 | #define E1000_ICH_RAR_ENTRIES 7 |
@@ -125,6 +129,7 @@ | |||
125 | 129 | ||
126 | /* SMBus Address Phy Register */ | 130 | /* SMBus Address Phy Register */ |
127 | #define HV_SMB_ADDR PHY_REG(768, 26) | 131 | #define HV_SMB_ADDR PHY_REG(768, 26) |
132 | #define HV_SMB_ADDR_MASK 0x007F | ||
128 | #define HV_SMB_ADDR_PEC_EN 0x0200 | 133 | #define HV_SMB_ADDR_PEC_EN 0x0200 |
129 | #define HV_SMB_ADDR_VALID 0x0080 | 134 | #define HV_SMB_ADDR_VALID 0x0080 |
130 | 135 | ||
@@ -237,6 +242,8 @@ static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link); | |||
237 | static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw); | 242 | static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw); |
238 | static bool e1000_check_mng_mode_ich8lan(struct e1000_hw *hw); | 243 | static bool e1000_check_mng_mode_ich8lan(struct e1000_hw *hw); |
239 | static bool e1000_check_mng_mode_pchlan(struct e1000_hw *hw); | 244 | static bool e1000_check_mng_mode_pchlan(struct e1000_hw *hw); |
245 | static s32 e1000_k1_workaround_lv(struct e1000_hw *hw); | ||
246 | static void e1000_gate_hw_phy_config_ich8lan(struct e1000_hw *hw, bool gate); | ||
240 | 247 | ||
241 | static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg) | 248 | static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg) |
242 | { | 249 | { |
@@ -272,7 +279,7 @@ static inline void __ew32flash(struct e1000_hw *hw, unsigned long reg, u32 val) | |||
272 | static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) | 279 | static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) |
273 | { | 280 | { |
274 | struct e1000_phy_info *phy = &hw->phy; | 281 | struct e1000_phy_info *phy = &hw->phy; |
275 | u32 ctrl; | 282 | u32 ctrl, fwsm; |
276 | s32 ret_val = 0; | 283 | s32 ret_val = 0; |
277 | 284 | ||
278 | phy->addr = 1; | 285 | phy->addr = 1; |
@@ -294,7 +301,8 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) | |||
294 | * disabled, then toggle the LANPHYPC Value bit to force | 301 | * disabled, then toggle the LANPHYPC Value bit to force |
295 | * the interconnect to PCIe mode. | 302 | * the interconnect to PCIe mode. |
296 | */ | 303 | */ |
297 | if (!(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) { | 304 | fwsm = er32(FWSM); |
305 | if (!(fwsm & E1000_ICH_FWSM_FW_VALID)) { | ||
298 | ctrl = er32(CTRL); | 306 | ctrl = er32(CTRL); |
299 | ctrl |= E1000_CTRL_LANPHYPC_OVERRIDE; | 307 | ctrl |= E1000_CTRL_LANPHYPC_OVERRIDE; |
300 | ctrl &= ~E1000_CTRL_LANPHYPC_VALUE; | 308 | ctrl &= ~E1000_CTRL_LANPHYPC_VALUE; |
@@ -303,6 +311,13 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) | |||
303 | ctrl &= ~E1000_CTRL_LANPHYPC_OVERRIDE; | 311 | ctrl &= ~E1000_CTRL_LANPHYPC_OVERRIDE; |
304 | ew32(CTRL, ctrl); | 312 | ew32(CTRL, ctrl); |
305 | msleep(50); | 313 | msleep(50); |
314 | |||
315 | /* | ||
316 | * Gate automatic PHY configuration by hardware on | ||
317 | * non-managed 82579 | ||
318 | */ | ||
319 | if (hw->mac.type == e1000_pch2lan) | ||
320 | e1000_gate_hw_phy_config_ich8lan(hw, true); | ||
306 | } | 321 | } |
307 | 322 | ||
308 | /* | 323 | /* |
@@ -315,6 +330,13 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) | |||
315 | if (ret_val) | 330 | if (ret_val) |
316 | goto out; | 331 | goto out; |
317 | 332 | ||
333 | /* Ungate automatic PHY configuration on non-managed 82579 */ | ||
334 | if ((hw->mac.type == e1000_pch2lan) && | ||
335 | !(fwsm & E1000_ICH_FWSM_FW_VALID)) { | ||
336 | msleep(10); | ||
337 | e1000_gate_hw_phy_config_ich8lan(hw, false); | ||
338 | } | ||
339 | |||
318 | phy->id = e1000_phy_unknown; | 340 | phy->id = e1000_phy_unknown; |
319 | ret_val = e1000e_get_phy_id(hw); | 341 | ret_val = e1000e_get_phy_id(hw); |
320 | if (ret_val) | 342 | if (ret_val) |
@@ -561,13 +583,10 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter) | |||
561 | if (mac->type == e1000_ich8lan) | 583 | if (mac->type == e1000_ich8lan) |
562 | e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw, true); | 584 | e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw, true); |
563 | 585 | ||
564 | /* Disable PHY configuration by hardware, config by software */ | 586 | /* Gate automatic PHY configuration by hardware on managed 82579 */ |
565 | if (mac->type == e1000_pch2lan) { | 587 | if ((mac->type == e1000_pch2lan) && |
566 | u32 extcnf_ctrl = er32(EXTCNF_CTRL); | 588 | (er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) |
567 | 589 | e1000_gate_hw_phy_config_ich8lan(hw, true); | |
568 | extcnf_ctrl |= E1000_EXTCNF_CTRL_GATE_PHY_CFG; | ||
569 | ew32(EXTCNF_CTRL, extcnf_ctrl); | ||
570 | } | ||
571 | 590 | ||
572 | return 0; | 591 | return 0; |
573 | } | 592 | } |
@@ -652,6 +671,12 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) | |||
652 | goto out; | 671 | goto out; |
653 | } | 672 | } |
654 | 673 | ||
674 | if (hw->mac.type == e1000_pch2lan) { | ||
675 | ret_val = e1000_k1_workaround_lv(hw); | ||
676 | if (ret_val) | ||
677 | goto out; | ||
678 | } | ||
679 | |||
655 | /* | 680 | /* |
656 | * Check if there was DownShift, must be checked | 681 | * Check if there was DownShift, must be checked |
657 | * immediately after link-up | 682 | * immediately after link-up |
@@ -895,6 +920,34 @@ static s32 e1000_check_reset_block_ich8lan(struct e1000_hw *hw) | |||
895 | } | 920 | } |
896 | 921 | ||
897 | /** | 922 | /** |
923 | * e1000_write_smbus_addr - Write SMBus address to PHY needed during Sx states | ||
924 | * @hw: pointer to the HW structure | ||
925 | * | ||
926 | * Assumes semaphore already acquired. | ||
927 | * | ||
928 | **/ | ||
929 | static s32 e1000_write_smbus_addr(struct e1000_hw *hw) | ||
930 | { | ||
931 | u16 phy_data; | ||
932 | u32 strap = er32(STRAP); | ||
933 | s32 ret_val = 0; | ||
934 | |||
935 | strap &= E1000_STRAP_SMBUS_ADDRESS_MASK; | ||
936 | |||
937 | ret_val = e1000_read_phy_reg_hv_locked(hw, HV_SMB_ADDR, &phy_data); | ||
938 | if (ret_val) | ||
939 | goto out; | ||
940 | |||
941 | phy_data &= ~HV_SMB_ADDR_MASK; | ||
942 | phy_data |= (strap >> E1000_STRAP_SMBUS_ADDRESS_SHIFT); | ||
943 | phy_data |= HV_SMB_ADDR_PEC_EN | HV_SMB_ADDR_VALID; | ||
944 | ret_val = e1000_write_phy_reg_hv_locked(hw, HV_SMB_ADDR, phy_data); | ||
945 | |||
946 | out: | ||
947 | return ret_val; | ||
948 | } | ||
949 | |||
950 | /** | ||
898 | * e1000_sw_lcd_config_ich8lan - SW-based LCD Configuration | 951 | * e1000_sw_lcd_config_ich8lan - SW-based LCD Configuration |
899 | * @hw: pointer to the HW structure | 952 | * @hw: pointer to the HW structure |
900 | * | 953 | * |
@@ -903,7 +956,6 @@ static s32 e1000_check_reset_block_ich8lan(struct e1000_hw *hw) | |||
903 | **/ | 956 | **/ |
904 | static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) | 957 | static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) |
905 | { | 958 | { |
906 | struct e1000_adapter *adapter = hw->adapter; | ||
907 | struct e1000_phy_info *phy = &hw->phy; | 959 | struct e1000_phy_info *phy = &hw->phy; |
908 | u32 i, data, cnf_size, cnf_base_addr, sw_cfg_mask; | 960 | u32 i, data, cnf_size, cnf_base_addr, sw_cfg_mask; |
909 | s32 ret_val = 0; | 961 | s32 ret_val = 0; |
@@ -921,7 +973,8 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) | |||
921 | if (phy->type != e1000_phy_igp_3) | 973 | if (phy->type != e1000_phy_igp_3) |
922 | return ret_val; | 974 | return ret_val; |
923 | 975 | ||
924 | if (adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_AMT) { | 976 | if ((hw->adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_AMT) || |
977 | (hw->adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_C)) { | ||
925 | sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG; | 978 | sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG; |
926 | break; | 979 | break; |
927 | } | 980 | } |
@@ -961,21 +1014,16 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) | |||
961 | cnf_base_addr = data & E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK; | 1014 | cnf_base_addr = data & E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK; |
962 | cnf_base_addr >>= E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT; | 1015 | cnf_base_addr >>= E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT; |
963 | 1016 | ||
964 | if (!(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) && | 1017 | if ((!(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) && |
965 | ((hw->mac.type == e1000_pchlan) || | 1018 | (hw->mac.type == e1000_pchlan)) || |
966 | (hw->mac.type == e1000_pch2lan))) { | 1019 | (hw->mac.type == e1000_pch2lan)) { |
967 | /* | 1020 | /* |
968 | * HW configures the SMBus address and LEDs when the | 1021 | * HW configures the SMBus address and LEDs when the |
969 | * OEM and LCD Write Enable bits are set in the NVM. | 1022 | * OEM and LCD Write Enable bits are set in the NVM. |
970 | * When both NVM bits are cleared, SW will configure | 1023 | * When both NVM bits are cleared, SW will configure |
971 | * them instead. | 1024 | * them instead. |
972 | */ | 1025 | */ |
973 | data = er32(STRAP); | 1026 | ret_val = e1000_write_smbus_addr(hw); |
974 | data &= E1000_STRAP_SMBUS_ADDRESS_MASK; | ||
975 | reg_data = data >> E1000_STRAP_SMBUS_ADDRESS_SHIFT; | ||
976 | reg_data |= HV_SMB_ADDR_PEC_EN | HV_SMB_ADDR_VALID; | ||
977 | ret_val = e1000_write_phy_reg_hv_locked(hw, HV_SMB_ADDR, | ||
978 | reg_data); | ||
979 | if (ret_val) | 1027 | if (ret_val) |
980 | goto out; | 1028 | goto out; |
981 | 1029 | ||
@@ -1440,10 +1488,6 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) | |||
1440 | goto out; | 1488 | goto out; |
1441 | 1489 | ||
1442 | /* Enable jumbo frame workaround in the PHY */ | 1490 | /* Enable jumbo frame workaround in the PHY */ |
1443 | e1e_rphy(hw, PHY_REG(769, 20), &data); | ||
1444 | ret_val = e1e_wphy(hw, PHY_REG(769, 20), data & ~(1 << 14)); | ||
1445 | if (ret_val) | ||
1446 | goto out; | ||
1447 | e1e_rphy(hw, PHY_REG(769, 23), &data); | 1491 | e1e_rphy(hw, PHY_REG(769, 23), &data); |
1448 | data &= ~(0x7F << 5); | 1492 | data &= ~(0x7F << 5); |
1449 | data |= (0x37 << 5); | 1493 | data |= (0x37 << 5); |
@@ -1452,7 +1496,6 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) | |||
1452 | goto out; | 1496 | goto out; |
1453 | e1e_rphy(hw, PHY_REG(769, 16), &data); | 1497 | e1e_rphy(hw, PHY_REG(769, 16), &data); |
1454 | data &= ~(1 << 13); | 1498 | data &= ~(1 << 13); |
1455 | data |= (1 << 12); | ||
1456 | ret_val = e1e_wphy(hw, PHY_REG(769, 16), data); | 1499 | ret_val = e1e_wphy(hw, PHY_REG(769, 16), data); |
1457 | if (ret_val) | 1500 | if (ret_val) |
1458 | goto out; | 1501 | goto out; |
@@ -1477,7 +1520,7 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) | |||
1477 | 1520 | ||
1478 | mac_reg = er32(RCTL); | 1521 | mac_reg = er32(RCTL); |
1479 | mac_reg &= ~E1000_RCTL_SECRC; | 1522 | mac_reg &= ~E1000_RCTL_SECRC; |
1480 | ew32(FFLT_DBG, mac_reg); | 1523 | ew32(RCTL, mac_reg); |
1481 | 1524 | ||
1482 | ret_val = e1000e_read_kmrn_reg(hw, | 1525 | ret_val = e1000e_read_kmrn_reg(hw, |
1483 | E1000_KMRNCTRLSTA_CTRL_OFFSET, | 1526 | E1000_KMRNCTRLSTA_CTRL_OFFSET, |
@@ -1503,17 +1546,12 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) | |||
1503 | goto out; | 1546 | goto out; |
1504 | 1547 | ||
1505 | /* Write PHY register values back to h/w defaults */ | 1548 | /* Write PHY register values back to h/w defaults */ |
1506 | e1e_rphy(hw, PHY_REG(769, 20), &data); | ||
1507 | ret_val = e1e_wphy(hw, PHY_REG(769, 20), data & ~(1 << 14)); | ||
1508 | if (ret_val) | ||
1509 | goto out; | ||
1510 | e1e_rphy(hw, PHY_REG(769, 23), &data); | 1549 | e1e_rphy(hw, PHY_REG(769, 23), &data); |
1511 | data &= ~(0x7F << 5); | 1550 | data &= ~(0x7F << 5); |
1512 | ret_val = e1e_wphy(hw, PHY_REG(769, 23), data); | 1551 | ret_val = e1e_wphy(hw, PHY_REG(769, 23), data); |
1513 | if (ret_val) | 1552 | if (ret_val) |
1514 | goto out; | 1553 | goto out; |
1515 | e1e_rphy(hw, PHY_REG(769, 16), &data); | 1554 | e1e_rphy(hw, PHY_REG(769, 16), &data); |
1516 | data &= ~(1 << 12); | ||
1517 | data |= (1 << 13); | 1555 | data |= (1 << 13); |
1518 | ret_val = e1e_wphy(hw, PHY_REG(769, 16), data); | 1556 | ret_val = e1e_wphy(hw, PHY_REG(769, 16), data); |
1519 | if (ret_val) | 1557 | if (ret_val) |
@@ -1559,6 +1597,69 @@ out: | |||
1559 | } | 1597 | } |
1560 | 1598 | ||
1561 | /** | 1599 | /** |
1600 | * e1000_k1_gig_workaround_lv - K1 Si workaround | ||
1601 | * @hw: pointer to the HW structure | ||
1602 | * | ||
1603 | * Workaround to set the K1 beacon duration for 82579 parts | ||
1604 | **/ | ||
1605 | static s32 e1000_k1_workaround_lv(struct e1000_hw *hw) | ||
1606 | { | ||
1607 | s32 ret_val = 0; | ||
1608 | u16 status_reg = 0; | ||
1609 | u32 mac_reg; | ||
1610 | |||
1611 | if (hw->mac.type != e1000_pch2lan) | ||
1612 | goto out; | ||
1613 | |||
1614 | /* Set K1 beacon duration based on 1Gbps speed or otherwise */ | ||
1615 | ret_val = e1e_rphy(hw, HV_M_STATUS, &status_reg); | ||
1616 | if (ret_val) | ||
1617 | goto out; | ||
1618 | |||
1619 | if ((status_reg & (HV_M_STATUS_LINK_UP | HV_M_STATUS_AUTONEG_COMPLETE)) | ||
1620 | == (HV_M_STATUS_LINK_UP | HV_M_STATUS_AUTONEG_COMPLETE)) { | ||
1621 | mac_reg = er32(FEXTNVM4); | ||
1622 | mac_reg &= ~E1000_FEXTNVM4_BEACON_DURATION_MASK; | ||
1623 | |||
1624 | if (status_reg & HV_M_STATUS_SPEED_1000) | ||
1625 | mac_reg |= E1000_FEXTNVM4_BEACON_DURATION_8USEC; | ||
1626 | else | ||
1627 | mac_reg |= E1000_FEXTNVM4_BEACON_DURATION_16USEC; | ||
1628 | |||
1629 | ew32(FEXTNVM4, mac_reg); | ||
1630 | } | ||
1631 | |||
1632 | out: | ||
1633 | return ret_val; | ||
1634 | } | ||
1635 | |||
1636 | /** | ||
1637 | * e1000_gate_hw_phy_config_ich8lan - disable PHY config via hardware | ||
1638 | * @hw: pointer to the HW structure | ||
1639 | * @gate: boolean set to true to gate, false to ungate | ||
1640 | * | ||
1641 | * Gate/ungate the automatic PHY configuration via hardware; perform | ||
1642 | * the configuration via software instead. | ||
1643 | **/ | ||
1644 | static void e1000_gate_hw_phy_config_ich8lan(struct e1000_hw *hw, bool gate) | ||
1645 | { | ||
1646 | u32 extcnf_ctrl; | ||
1647 | |||
1648 | if (hw->mac.type != e1000_pch2lan) | ||
1649 | return; | ||
1650 | |||
1651 | extcnf_ctrl = er32(EXTCNF_CTRL); | ||
1652 | |||
1653 | if (gate) | ||
1654 | extcnf_ctrl |= E1000_EXTCNF_CTRL_GATE_PHY_CFG; | ||
1655 | else | ||
1656 | extcnf_ctrl &= ~E1000_EXTCNF_CTRL_GATE_PHY_CFG; | ||
1657 | |||
1658 | ew32(EXTCNF_CTRL, extcnf_ctrl); | ||
1659 | return; | ||
1660 | } | ||
1661 | |||
1662 | /** | ||
1562 | * e1000_lan_init_done_ich8lan - Check for PHY config completion | 1663 | * e1000_lan_init_done_ich8lan - Check for PHY config completion |
1563 | * @hw: pointer to the HW structure | 1664 | * @hw: pointer to the HW structure |
1564 | * | 1665 | * |
@@ -1602,6 +1703,9 @@ static s32 e1000_post_phy_reset_ich8lan(struct e1000_hw *hw) | |||
1602 | if (e1000_check_reset_block(hw)) | 1703 | if (e1000_check_reset_block(hw)) |
1603 | goto out; | 1704 | goto out; |
1604 | 1705 | ||
1706 | /* Allow time for h/w to get to quiescent state after reset */ | ||
1707 | msleep(10); | ||
1708 | |||
1605 | /* Perform any necessary post-reset workarounds */ | 1709 | /* Perform any necessary post-reset workarounds */ |
1606 | switch (hw->mac.type) { | 1710 | switch (hw->mac.type) { |
1607 | case e1000_pchlan: | 1711 | case e1000_pchlan: |
@@ -1630,6 +1734,13 @@ static s32 e1000_post_phy_reset_ich8lan(struct e1000_hw *hw) | |||
1630 | /* Configure the LCD with the OEM bits in NVM */ | 1734 | /* Configure the LCD with the OEM bits in NVM */ |
1631 | ret_val = e1000_oem_bits_config_ich8lan(hw, true); | 1735 | ret_val = e1000_oem_bits_config_ich8lan(hw, true); |
1632 | 1736 | ||
1737 | /* Ungate automatic PHY configuration on non-managed 82579 */ | ||
1738 | if ((hw->mac.type == e1000_pch2lan) && | ||
1739 | !(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) { | ||
1740 | msleep(10); | ||
1741 | e1000_gate_hw_phy_config_ich8lan(hw, false); | ||
1742 | } | ||
1743 | |||
1633 | out: | 1744 | out: |
1634 | return ret_val; | 1745 | return ret_val; |
1635 | } | 1746 | } |
@@ -1646,6 +1757,11 @@ static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw) | |||
1646 | { | 1757 | { |
1647 | s32 ret_val = 0; | 1758 | s32 ret_val = 0; |
1648 | 1759 | ||
1760 | /* Gate automatic PHY configuration by hardware on non-managed 82579 */ | ||
1761 | if ((hw->mac.type == e1000_pch2lan) && | ||
1762 | !(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) | ||
1763 | e1000_gate_hw_phy_config_ich8lan(hw, true); | ||
1764 | |||
1649 | ret_val = e1000e_phy_hw_reset_generic(hw); | 1765 | ret_val = e1000e_phy_hw_reset_generic(hw); |
1650 | if (ret_val) | 1766 | if (ret_val) |
1651 | goto out; | 1767 | goto out; |
@@ -2910,6 +3026,14 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) | |||
2910 | * external PHY is reset. | 3026 | * external PHY is reset. |
2911 | */ | 3027 | */ |
2912 | ctrl |= E1000_CTRL_PHY_RST; | 3028 | ctrl |= E1000_CTRL_PHY_RST; |
3029 | |||
3030 | /* | ||
3031 | * Gate automatic PHY configuration by hardware on | ||
3032 | * non-managed 82579 | ||
3033 | */ | ||
3034 | if ((hw->mac.type == e1000_pch2lan) && | ||
3035 | !(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) | ||
3036 | e1000_gate_hw_phy_config_ich8lan(hw, true); | ||
2913 | } | 3037 | } |
2914 | ret_val = e1000_acquire_swflag_ich8lan(hw); | 3038 | ret_val = e1000_acquire_swflag_ich8lan(hw); |
2915 | e_dbg("Issuing a global reset to ich8lan\n"); | 3039 | e_dbg("Issuing a global reset to ich8lan\n"); |
@@ -3460,13 +3584,20 @@ void e1000e_gig_downshift_workaround_ich8lan(struct e1000_hw *hw) | |||
3460 | void e1000e_disable_gig_wol_ich8lan(struct e1000_hw *hw) | 3584 | void e1000e_disable_gig_wol_ich8lan(struct e1000_hw *hw) |
3461 | { | 3585 | { |
3462 | u32 phy_ctrl; | 3586 | u32 phy_ctrl; |
3587 | s32 ret_val; | ||
3463 | 3588 | ||
3464 | phy_ctrl = er32(PHY_CTRL); | 3589 | phy_ctrl = er32(PHY_CTRL); |
3465 | phy_ctrl |= E1000_PHY_CTRL_D0A_LPLU | E1000_PHY_CTRL_GBE_DISABLE; | 3590 | phy_ctrl |= E1000_PHY_CTRL_D0A_LPLU | E1000_PHY_CTRL_GBE_DISABLE; |
3466 | ew32(PHY_CTRL, phy_ctrl); | 3591 | ew32(PHY_CTRL, phy_ctrl); |
3467 | 3592 | ||
3468 | if (hw->mac.type >= e1000_pchlan) | 3593 | if (hw->mac.type >= e1000_pchlan) { |
3469 | e1000_phy_hw_reset_ich8lan(hw); | 3594 | e1000_oem_bits_config_ich8lan(hw, true); |
3595 | ret_val = hw->phy.ops.acquire(hw); | ||
3596 | if (ret_val) | ||
3597 | return; | ||
3598 | e1000_write_smbus_addr(hw); | ||
3599 | hw->phy.ops.release(hw); | ||
3600 | } | ||
3470 | } | 3601 | } |
3471 | 3602 | ||
3472 | /** | 3603 | /** |
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 5d5850b556cf..c69563c3ce96 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -2705,6 +2705,16 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter) | |||
2705 | u32 psrctl = 0; | 2705 | u32 psrctl = 0; |
2706 | u32 pages = 0; | 2706 | u32 pages = 0; |
2707 | 2707 | ||
2708 | /* Workaround Si errata on 82579 - configure jumbo frame flow */ | ||
2709 | if (hw->mac.type == e1000_pch2lan) { | ||
2710 | s32 ret_val; | ||
2711 | |||
2712 | if (adapter->netdev->mtu > ETH_DATA_LEN) | ||
2713 | ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true); | ||
2714 | else | ||
2715 | ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false); | ||
2716 | } | ||
2717 | |||
2708 | /* Program MC offset vector base */ | 2718 | /* Program MC offset vector base */ |
2709 | rctl = er32(RCTL); | 2719 | rctl = er32(RCTL); |
2710 | rctl &= ~(3 << E1000_RCTL_MO_SHIFT); | 2720 | rctl &= ~(3 << E1000_RCTL_MO_SHIFT); |
@@ -2745,16 +2755,6 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter) | |||
2745 | e1e_wphy(hw, 22, phy_data); | 2755 | e1e_wphy(hw, 22, phy_data); |
2746 | } | 2756 | } |
2747 | 2757 | ||
2748 | /* Workaround Si errata on 82579 - configure jumbo frame flow */ | ||
2749 | if (hw->mac.type == e1000_pch2lan) { | ||
2750 | s32 ret_val; | ||
2751 | |||
2752 | if (rctl & E1000_RCTL_LPE) | ||
2753 | ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true); | ||
2754 | else | ||
2755 | ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false); | ||
2756 | } | ||
2757 | |||
2758 | /* Setup buffer sizes */ | 2758 | /* Setup buffer sizes */ |
2759 | rctl &= ~E1000_RCTL_SZ_4096; | 2759 | rctl &= ~E1000_RCTL_SZ_4096; |
2760 | rctl |= E1000_RCTL_BSEX; | 2760 | rctl |= E1000_RCTL_BSEX; |
@@ -4813,6 +4813,15 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu) | |||
4813 | return -EINVAL; | 4813 | return -EINVAL; |
4814 | } | 4814 | } |
4815 | 4815 | ||
4816 | /* Jumbo frame workaround on 82579 requires CRC be stripped */ | ||
4817 | if ((adapter->hw.mac.type == e1000_pch2lan) && | ||
4818 | !(adapter->flags2 & FLAG2_CRC_STRIPPING) && | ||
4819 | (new_mtu > ETH_DATA_LEN)) { | ||
4820 | e_err("Jumbo Frames not supported on 82579 when CRC " | ||
4821 | "stripping is disabled.\n"); | ||
4822 | return -EINVAL; | ||
4823 | } | ||
4824 | |||
4816 | /* 82573 Errata 17 */ | 4825 | /* 82573 Errata 17 */ |
4817 | if (((adapter->hw.mac.type == e1000_82573) || | 4826 | if (((adapter->hw.mac.type == e1000_82573) || |
4818 | (adapter->hw.mac.type == e1000_82574)) && | 4827 | (adapter->hw.mac.type == e1000_82574)) && |
diff --git a/drivers/net/eql.c b/drivers/net/eql.c index dda2c7944da9..0cb1cf9cf4b0 100644 --- a/drivers/net/eql.c +++ b/drivers/net/eql.c | |||
@@ -555,6 +555,8 @@ static int eql_g_master_cfg(struct net_device *dev, master_config_t __user *mcp) | |||
555 | equalizer_t *eql; | 555 | equalizer_t *eql; |
556 | master_config_t mc; | 556 | master_config_t mc; |
557 | 557 | ||
558 | memset(&mc, 0, sizeof(master_config_t)); | ||
559 | |||
558 | if (eql_is_master(dev)) { | 560 | if (eql_is_master(dev)) { |
559 | eql = netdev_priv(dev); | 561 | eql = netdev_priv(dev); |
560 | mc.max_slaves = eql->max_slaves; | 562 | mc.max_slaves = eql->max_slaves; |
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c index 3bdb4fa32064..385dc3204cb7 100644 --- a/drivers/net/ibm_newemac/core.c +++ b/drivers/net/ibm_newemac/core.c | |||
@@ -2928,7 +2928,7 @@ static int __devinit emac_probe(struct platform_device *ofdev, | |||
2928 | if (dev->emac_irq != NO_IRQ) | 2928 | if (dev->emac_irq != NO_IRQ) |
2929 | irq_dispose_mapping(dev->emac_irq); | 2929 | irq_dispose_mapping(dev->emac_irq); |
2930 | err_free: | 2930 | err_free: |
2931 | kfree(ndev); | 2931 | free_netdev(ndev); |
2932 | err_gone: | 2932 | err_gone: |
2933 | /* if we were on the bootlist, remove us as we won't show up and | 2933 | /* if we were on the bootlist, remove us as we won't show up and |
2934 | * wake up all waiters to notify them in case they were waiting | 2934 | * wake up all waiters to notify them in case they were waiting |
@@ -2971,7 +2971,7 @@ static int __devexit emac_remove(struct platform_device *ofdev) | |||
2971 | if (dev->emac_irq != NO_IRQ) | 2971 | if (dev->emac_irq != NO_IRQ) |
2972 | irq_dispose_mapping(dev->emac_irq); | 2972 | irq_dispose_mapping(dev->emac_irq); |
2973 | 2973 | ||
2974 | kfree(dev->ndev); | 2974 | free_netdev(dev->ndev); |
2975 | 2975 | ||
2976 | return 0; | 2976 | return 0; |
2977 | } | 2977 | } |
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index 9b05e7da83de..a2d805aa75cd 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -1540,7 +1540,6 @@ netxen_process_rcv(struct netxen_adapter *adapter, | |||
1540 | if (pkt_offset) | 1540 | if (pkt_offset) |
1541 | skb_pull(skb, pkt_offset); | 1541 | skb_pull(skb, pkt_offset); |
1542 | 1542 | ||
1543 | skb->truesize = skb->len + sizeof(struct sk_buff); | ||
1544 | skb->protocol = eth_type_trans(skb, netdev); | 1543 | skb->protocol = eth_type_trans(skb, netdev); |
1545 | 1544 | ||
1546 | napi_gro_receive(&sds_ring->napi, skb); | 1545 | napi_gro_receive(&sds_ring->napi, skb); |
@@ -1602,8 +1601,6 @@ netxen_process_lro(struct netxen_adapter *adapter, | |||
1602 | 1601 | ||
1603 | skb_put(skb, lro_length + data_offset); | 1602 | skb_put(skb, lro_length + data_offset); |
1604 | 1603 | ||
1605 | skb->truesize = skb->len + sizeof(struct sk_buff) + skb_headroom(skb); | ||
1606 | |||
1607 | skb_pull(skb, l2_hdr_offset); | 1604 | skb_pull(skb, l2_hdr_offset); |
1608 | skb->protocol = eth_type_trans(skb, netdev); | 1605 | skb->protocol = eth_type_trans(skb, netdev); |
1609 | 1606 | ||
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 6a6b8199a0d6..6c58da2b882c 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c | |||
@@ -308,7 +308,7 @@ static int mdio_bus_suspend(struct device *dev) | |||
308 | * may call phy routines that try to grab the same lock, and that may | 308 | * may call phy routines that try to grab the same lock, and that may |
309 | * lead to a deadlock. | 309 | * lead to a deadlock. |
310 | */ | 310 | */ |
311 | if (phydev->attached_dev) | 311 | if (phydev->attached_dev && phydev->adjust_link) |
312 | phy_stop_machine(phydev); | 312 | phy_stop_machine(phydev); |
313 | 313 | ||
314 | if (!mdio_bus_phy_may_suspend(phydev)) | 314 | if (!mdio_bus_phy_may_suspend(phydev)) |
@@ -331,7 +331,7 @@ static int mdio_bus_resume(struct device *dev) | |||
331 | return ret; | 331 | return ret; |
332 | 332 | ||
333 | no_resume: | 333 | no_resume: |
334 | if (phydev->attached_dev) | 334 | if (phydev->attached_dev && phydev->adjust_link) |
335 | phy_start_machine(phydev, NULL); | 335 | phy_start_machine(phydev, NULL); |
336 | 336 | ||
337 | return 0; | 337 | return 0; |
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index 6695a51e09e9..736b91703b3e 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c | |||
@@ -1314,8 +1314,13 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb) | |||
1314 | hdrlen = (ppp->flags & SC_MP_XSHORTSEQ)? MPHDRLEN_SSN: MPHDRLEN; | 1314 | hdrlen = (ppp->flags & SC_MP_XSHORTSEQ)? MPHDRLEN_SSN: MPHDRLEN; |
1315 | i = 0; | 1315 | i = 0; |
1316 | list_for_each_entry(pch, &ppp->channels, clist) { | 1316 | list_for_each_entry(pch, &ppp->channels, clist) { |
1317 | navail += pch->avail = (pch->chan != NULL); | 1317 | if (pch->chan) { |
1318 | pch->speed = pch->chan->speed; | 1318 | pch->avail = 1; |
1319 | navail++; | ||
1320 | pch->speed = pch->chan->speed; | ||
1321 | } else { | ||
1322 | pch->avail = 0; | ||
1323 | } | ||
1319 | if (pch->avail) { | 1324 | if (pch->avail) { |
1320 | if (skb_queue_empty(&pch->file.xq) || | 1325 | if (skb_queue_empty(&pch->file.xq) || |
1321 | !pch->had_frag) { | 1326 | !pch->had_frag) { |
diff --git a/drivers/net/qlcnic/qlcnic_init.c b/drivers/net/qlcnic/qlcnic_init.c index 16dd9ebd36c9..5c33d15c874a 100644 --- a/drivers/net/qlcnic/qlcnic_init.c +++ b/drivers/net/qlcnic/qlcnic_init.c | |||
@@ -1303,7 +1303,7 @@ qlcnic_alloc_rx_skb(struct qlcnic_adapter *adapter, | |||
1303 | return -ENOMEM; | 1303 | return -ENOMEM; |
1304 | } | 1304 | } |
1305 | 1305 | ||
1306 | skb_reserve(skb, 2); | 1306 | skb_reserve(skb, NET_IP_ALIGN); |
1307 | 1307 | ||
1308 | dma = pci_map_single(pdev, skb->data, | 1308 | dma = pci_map_single(pdev, skb->data, |
1309 | rds_ring->dma_size, PCI_DMA_FROMDEVICE); | 1309 | rds_ring->dma_size, PCI_DMA_FROMDEVICE); |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 54900332f12d..fe3b7622fba0 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -2939,7 +2939,7 @@ static const struct rtl_cfg_info { | |||
2939 | .hw_start = rtl_hw_start_8168, | 2939 | .hw_start = rtl_hw_start_8168, |
2940 | .region = 2, | 2940 | .region = 2, |
2941 | .align = 8, | 2941 | .align = 8, |
2942 | .intr_event = SYSErr | LinkChg | RxOverflow | | 2942 | .intr_event = SYSErr | RxFIFOOver | LinkChg | RxOverflow | |
2943 | TxErr | TxOK | RxOK | RxErr, | 2943 | TxErr | TxOK | RxOK | RxErr, |
2944 | .napi_event = TxErr | TxOK | RxOK | RxOverflow, | 2944 | .napi_event = TxErr | TxOK | RxOK | RxOverflow, |
2945 | .features = RTL_FEATURE_GMII | RTL_FEATURE_MSI, | 2945 | .features = RTL_FEATURE_GMII | RTL_FEATURE_MSI, |
@@ -4629,8 +4629,7 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance) | |||
4629 | } | 4629 | } |
4630 | 4630 | ||
4631 | /* Work around for rx fifo overflow */ | 4631 | /* Work around for rx fifo overflow */ |
4632 | if (unlikely(status & RxFIFOOver) && | 4632 | if (unlikely(status & RxFIFOOver)) { |
4633 | (tp->mac_version == RTL_GIGA_MAC_VER_11)) { | ||
4634 | netif_stop_queue(dev); | 4633 | netif_stop_queue(dev); |
4635 | rtl8169_tx_timeout(dev); | 4634 | rtl8169_tx_timeout(dev); |
4636 | break; | 4635 | break; |
diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c index 07eb884ff982..44150f2f7bfd 100644 --- a/drivers/net/rionet.c +++ b/drivers/net/rionet.c | |||
@@ -384,7 +384,7 @@ static void rionet_remove(struct rio_dev *rdev) | |||
384 | free_pages((unsigned long)rionet_active, rdev->net->hport->sys_size ? | 384 | free_pages((unsigned long)rionet_active, rdev->net->hport->sys_size ? |
385 | __ilog2(sizeof(void *)) + 4 : 0); | 385 | __ilog2(sizeof(void *)) + 4 : 0); |
386 | unregister_netdev(ndev); | 386 | unregister_netdev(ndev); |
387 | kfree(ndev); | 387 | free_netdev(ndev); |
388 | 388 | ||
389 | list_for_each_entry_safe(peer, tmp, &rionet_peers, node) { | 389 | list_for_each_entry_safe(peer, tmp, &rionet_peers, node) { |
390 | list_del(&peer->node); | 390 | list_del(&peer->node); |
diff --git a/drivers/net/sgiseeq.c b/drivers/net/sgiseeq.c index cc4bd8c65f8b..9265315baa0b 100644 --- a/drivers/net/sgiseeq.c +++ b/drivers/net/sgiseeq.c | |||
@@ -804,7 +804,7 @@ static int __devinit sgiseeq_probe(struct platform_device *pdev) | |||
804 | err_out_free_page: | 804 | err_out_free_page: |
805 | free_page((unsigned long) sp->srings); | 805 | free_page((unsigned long) sp->srings); |
806 | err_out_free_dev: | 806 | err_out_free_dev: |
807 | kfree(dev); | 807 | free_netdev(dev); |
808 | 808 | ||
809 | err_out: | 809 | err_out: |
810 | return err; | 810 | return err; |
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c index 13ddcd487200..a8e5856ce882 100644 --- a/drivers/net/smsc911x.c +++ b/drivers/net/smsc911x.c | |||
@@ -58,6 +58,7 @@ | |||
58 | 58 | ||
59 | MODULE_LICENSE("GPL"); | 59 | MODULE_LICENSE("GPL"); |
60 | MODULE_VERSION(SMSC_DRV_VERSION); | 60 | MODULE_VERSION(SMSC_DRV_VERSION); |
61 | MODULE_ALIAS("platform:smsc911x"); | ||
61 | 62 | ||
62 | #if USE_DEBUG > 0 | 63 | #if USE_DEBUG > 0 |
63 | static int debug = 16; | 64 | static int debug = 16; |
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c index 5efa57757a2c..9124c5c638d8 100644 --- a/drivers/net/tulip/de2104x.c +++ b/drivers/net/tulip/de2104x.c | |||
@@ -243,6 +243,7 @@ enum { | |||
243 | NWayState = (1 << 14) | (1 << 13) | (1 << 12), | 243 | NWayState = (1 << 14) | (1 << 13) | (1 << 12), |
244 | NWayRestart = (1 << 12), | 244 | NWayRestart = (1 << 12), |
245 | NonselPortActive = (1 << 9), | 245 | NonselPortActive = (1 << 9), |
246 | SelPortActive = (1 << 8), | ||
246 | LinkFailStatus = (1 << 2), | 247 | LinkFailStatus = (1 << 2), |
247 | NetCxnErr = (1 << 1), | 248 | NetCxnErr = (1 << 1), |
248 | }; | 249 | }; |
@@ -364,6 +365,8 @@ static u16 t21040_csr15[] = { 0, 0, 0x0006, 0x0000, 0x0000, }; | |||
364 | /* 21041 transceiver register settings: TP AUTO, BNC, AUI, TP, TP FD*/ | 365 | /* 21041 transceiver register settings: TP AUTO, BNC, AUI, TP, TP FD*/ |
365 | static u16 t21041_csr13[] = { 0xEF01, 0xEF09, 0xEF09, 0xEF01, 0xEF09, }; | 366 | static u16 t21041_csr13[] = { 0xEF01, 0xEF09, 0xEF09, 0xEF01, 0xEF09, }; |
366 | static u16 t21041_csr14[] = { 0xFFFF, 0xF7FD, 0xF7FD, 0x6F3F, 0x6F3D, }; | 367 | static u16 t21041_csr14[] = { 0xFFFF, 0xF7FD, 0xF7FD, 0x6F3F, 0x6F3D, }; |
368 | /* If on-chip autonegotiation is broken, use half-duplex (FF3F) instead */ | ||
369 | static u16 t21041_csr14_brk[] = { 0xFF3F, 0xF7FD, 0xF7FD, 0x6F3F, 0x6F3D, }; | ||
367 | static u16 t21041_csr15[] = { 0x0008, 0x0006, 0x000E, 0x0008, 0x0008, }; | 370 | static u16 t21041_csr15[] = { 0x0008, 0x0006, 0x000E, 0x0008, 0x0008, }; |
368 | 371 | ||
369 | 372 | ||
@@ -1064,6 +1067,9 @@ static void de21041_media_timer (unsigned long data) | |||
1064 | unsigned int carrier; | 1067 | unsigned int carrier; |
1065 | unsigned long flags; | 1068 | unsigned long flags; |
1066 | 1069 | ||
1070 | /* clear port active bits */ | ||
1071 | dw32(SIAStatus, NonselPortActive | SelPortActive); | ||
1072 | |||
1067 | carrier = (status & NetCxnErr) ? 0 : 1; | 1073 | carrier = (status & NetCxnErr) ? 0 : 1; |
1068 | 1074 | ||
1069 | if (carrier) { | 1075 | if (carrier) { |
@@ -1158,14 +1164,29 @@ no_link_yet: | |||
1158 | static void de_media_interrupt (struct de_private *de, u32 status) | 1164 | static void de_media_interrupt (struct de_private *de, u32 status) |
1159 | { | 1165 | { |
1160 | if (status & LinkPass) { | 1166 | if (status & LinkPass) { |
1167 | /* Ignore if current media is AUI or BNC and we can't use TP */ | ||
1168 | if ((de->media_type == DE_MEDIA_AUI || | ||
1169 | de->media_type == DE_MEDIA_BNC) && | ||
1170 | (de->media_lock || | ||
1171 | !de_ok_to_advertise(de, DE_MEDIA_TP_AUTO))) | ||
1172 | return; | ||
1173 | /* If current media is not TP, change it to TP */ | ||
1174 | if ((de->media_type == DE_MEDIA_AUI || | ||
1175 | de->media_type == DE_MEDIA_BNC)) { | ||
1176 | de->media_type = DE_MEDIA_TP_AUTO; | ||
1177 | de_stop_rxtx(de); | ||
1178 | de_set_media(de); | ||
1179 | de_start_rxtx(de); | ||
1180 | } | ||
1161 | de_link_up(de); | 1181 | de_link_up(de); |
1162 | mod_timer(&de->media_timer, jiffies + DE_TIMER_LINK); | 1182 | mod_timer(&de->media_timer, jiffies + DE_TIMER_LINK); |
1163 | return; | 1183 | return; |
1164 | } | 1184 | } |
1165 | 1185 | ||
1166 | BUG_ON(!(status & LinkFail)); | 1186 | BUG_ON(!(status & LinkFail)); |
1167 | 1187 | /* Mark the link as down only if current media is TP */ | |
1168 | if (netif_carrier_ok(de->dev)) { | 1188 | if (netif_carrier_ok(de->dev) && de->media_type != DE_MEDIA_AUI && |
1189 | de->media_type != DE_MEDIA_BNC) { | ||
1169 | de_link_down(de); | 1190 | de_link_down(de); |
1170 | mod_timer(&de->media_timer, jiffies + DE_TIMER_NO_LINK); | 1191 | mod_timer(&de->media_timer, jiffies + DE_TIMER_NO_LINK); |
1171 | } | 1192 | } |
@@ -1229,6 +1250,7 @@ static void de_adapter_sleep (struct de_private *de) | |||
1229 | if (de->de21040) | 1250 | if (de->de21040) |
1230 | return; | 1251 | return; |
1231 | 1252 | ||
1253 | dw32(CSR13, 0); /* Reset phy */ | ||
1232 | pci_read_config_dword(de->pdev, PCIPM, &pmctl); | 1254 | pci_read_config_dword(de->pdev, PCIPM, &pmctl); |
1233 | pmctl |= PM_Sleep; | 1255 | pmctl |= PM_Sleep; |
1234 | pci_write_config_dword(de->pdev, PCIPM, pmctl); | 1256 | pci_write_config_dword(de->pdev, PCIPM, pmctl); |
@@ -1911,8 +1933,14 @@ fill_defaults: | |||
1911 | for (i = 0; i < DE_MAX_MEDIA; i++) { | 1933 | for (i = 0; i < DE_MAX_MEDIA; i++) { |
1912 | if (de->media[i].csr13 == 0xffff) | 1934 | if (de->media[i].csr13 == 0xffff) |
1913 | de->media[i].csr13 = t21041_csr13[i]; | 1935 | de->media[i].csr13 = t21041_csr13[i]; |
1914 | if (de->media[i].csr14 == 0xffff) | 1936 | if (de->media[i].csr14 == 0xffff) { |
1915 | de->media[i].csr14 = t21041_csr14[i]; | 1937 | /* autonegotiation is broken at least on some chip |
1938 | revisions - rev. 0x21 works, 0x11 does not */ | ||
1939 | if (de->pdev->revision < 0x20) | ||
1940 | de->media[i].csr14 = t21041_csr14_brk[i]; | ||
1941 | else | ||
1942 | de->media[i].csr14 = t21041_csr14[i]; | ||
1943 | } | ||
1916 | if (de->media[i].csr15 == 0xffff) | 1944 | if (de->media[i].csr15 == 0xffff) |
1917 | de->media[i].csr15 = t21041_csr15[i]; | 1945 | de->media[i].csr15 = t21041_csr15[i]; |
1918 | } | 1946 | } |
@@ -2158,6 +2186,8 @@ static int de_resume (struct pci_dev *pdev) | |||
2158 | dev_err(&dev->dev, "pci_enable_device failed in resume\n"); | 2186 | dev_err(&dev->dev, "pci_enable_device failed in resume\n"); |
2159 | goto out; | 2187 | goto out; |
2160 | } | 2188 | } |
2189 | pci_set_master(pdev); | ||
2190 | de_init_rings(de); | ||
2161 | de_init_hw(de); | 2191 | de_init_hw(de); |
2162 | out_attach: | 2192 | out_attach: |
2163 | netif_device_attach(dev); | 2193 | netif_device_attach(dev); |
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 4f123f869bdc..8110595fbbcc 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
@@ -1643,6 +1643,8 @@ static int hso_get_count(struct hso_serial *serial, | |||
1643 | struct uart_icount cnow; | 1643 | struct uart_icount cnow; |
1644 | struct hso_tiocmget *tiocmget = serial->tiocmget; | 1644 | struct hso_tiocmget *tiocmget = serial->tiocmget; |
1645 | 1645 | ||
1646 | memset(&icount, 0, sizeof(struct serial_icounter_struct)); | ||
1647 | |||
1646 | if (!tiocmget) | 1648 | if (!tiocmget) |
1647 | return -ENOENT; | 1649 | return -ENOENT; |
1648 | spin_lock_irq(&serial->serial_lock); | 1650 | spin_lock_irq(&serial->serial_lock); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 393f02d94c4e..5c568933ce48 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -2736,6 +2736,11 @@ int iwl_force_reset(struct iwl_priv *priv, int mode, bool external) | |||
2736 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | 2736 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) |
2737 | return -EINVAL; | 2737 | return -EINVAL; |
2738 | 2738 | ||
2739 | if (test_bit(STATUS_SCANNING, &priv->status)) { | ||
2740 | IWL_DEBUG_INFO(priv, "scan in progress.\n"); | ||
2741 | return -EINVAL; | ||
2742 | } | ||
2743 | |||
2739 | if (mode >= IWL_MAX_FORCE_RESET) { | 2744 | if (mode >= IWL_MAX_FORCE_RESET) { |
2740 | IWL_DEBUG_INFO(priv, "invalid reset request.\n"); | 2745 | IWL_DEBUG_INFO(priv, "invalid reset request.\n"); |
2741 | return -EINVAL; | 2746 | return -EINVAL; |
diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c index 6edf20b62de5..2c7d2d9be4d0 100644 --- a/drivers/s390/net/ctcm_main.c +++ b/drivers/s390/net/ctcm_main.c | |||
@@ -1154,7 +1154,7 @@ static struct net_device *ctcm_init_netdevice(struct ctcm_priv *priv) | |||
1154 | dev_fsm, dev_fsm_len, GFP_KERNEL); | 1154 | dev_fsm, dev_fsm_len, GFP_KERNEL); |
1155 | if (priv->fsm == NULL) { | 1155 | if (priv->fsm == NULL) { |
1156 | CTCMY_DBF_DEV(SETUP, dev, "init_fsm error"); | 1156 | CTCMY_DBF_DEV(SETUP, dev, "init_fsm error"); |
1157 | kfree(dev); | 1157 | free_netdev(dev); |
1158 | return NULL; | 1158 | return NULL; |
1159 | } | 1159 | } |
1160 | fsm_newstate(priv->fsm, DEV_STATE_STOPPED); | 1160 | fsm_newstate(priv->fsm, DEV_STATE_STOPPED); |
@@ -1165,7 +1165,7 @@ static struct net_device *ctcm_init_netdevice(struct ctcm_priv *priv) | |||
1165 | grp = ctcmpc_init_mpc_group(priv); | 1165 | grp = ctcmpc_init_mpc_group(priv); |
1166 | if (grp == NULL) { | 1166 | if (grp == NULL) { |
1167 | MPC_DBF_DEV(SETUP, dev, "init_mpc_group error"); | 1167 | MPC_DBF_DEV(SETUP, dev, "init_mpc_group error"); |
1168 | kfree(dev); | 1168 | free_netdev(dev); |
1169 | return NULL; | 1169 | return NULL; |
1170 | } | 1170 | } |
1171 | tasklet_init(&grp->mpc_tasklet2, | 1171 | tasklet_init(&grp->mpc_tasklet2, |
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 29e850a7a2f9..7c8008225ee3 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c | |||
@@ -243,7 +243,7 @@ static int get_rx_bufs(struct vhost_virtqueue *vq, | |||
243 | int r, nlogs = 0; | 243 | int r, nlogs = 0; |
244 | 244 | ||
245 | while (datalen > 0) { | 245 | while (datalen > 0) { |
246 | if (unlikely(headcount >= VHOST_NET_MAX_SG)) { | 246 | if (unlikely(seg >= VHOST_NET_MAX_SG)) { |
247 | r = -ENOBUFS; | 247 | r = -ENOBUFS; |
248 | goto err; | 248 | goto err; |
249 | } | 249 | } |