aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/e1000e
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/intel/e1000e')
-rw-r--r--drivers/net/ethernet/intel/e1000e/80003es2lan.c47
-rw-r--r--drivers/net/ethernet/intel/e1000e/80003es2lan.h47
-rw-r--r--drivers/net/ethernet/intel/e1000e/82571.c47
-rw-r--r--drivers/net/ethernet/intel/e1000e/82571.h47
-rw-r--r--drivers/net/ethernet/intel/e1000e/Makefile7
-rw-r--r--drivers/net/ethernet/intel/e1000e/defines.h55
-rw-r--r--drivers/net/ethernet/intel/e1000e/e1000.h50
-rw-r--r--drivers/net/ethernet/intel/e1000e/ethtool.c63
-rw-r--r--drivers/net/ethernet/intel/e1000e/hw.h55
-rw-r--r--drivers/net/ethernet/intel/e1000e/ich8lan.c427
-rw-r--r--drivers/net/ethernet/intel/e1000e/ich8lan.h72
-rw-r--r--drivers/net/ethernet/intel/e1000e/mac.c47
-rw-r--r--drivers/net/ethernet/intel/e1000e/mac.h47
-rw-r--r--drivers/net/ethernet/intel/e1000e/manage.c47
-rw-r--r--drivers/net/ethernet/intel/e1000e/manage.h47
-rw-r--r--drivers/net/ethernet/intel/e1000e/netdev.c343
-rw-r--r--drivers/net/ethernet/intel/e1000e/nvm.c47
-rw-r--r--drivers/net/ethernet/intel/e1000e/nvm.h47
-rw-r--r--drivers/net/ethernet/intel/e1000e/param.c53
-rw-r--r--drivers/net/ethernet/intel/e1000e/phy.c47
-rw-r--r--drivers/net/ethernet/intel/e1000e/phy.h47
-rw-r--r--drivers/net/ethernet/intel/e1000e/ptp.c53
-rw-r--r--drivers/net/ethernet/intel/e1000e/regs.h48
23 files changed, 1041 insertions, 749 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/80003es2lan.c b/drivers/net/ethernet/intel/e1000e/80003es2lan.c
index ff2d806eaef7..a5f6b11d6992 100644
--- a/drivers/net/ethernet/intel/e1000e/80003es2lan.c
+++ b/drivers/net/ethernet/intel/e1000e/80003es2lan.c
@@ -1,30 +1,23 @@
1/******************************************************************************* 1/* Intel PRO/1000 Linux driver
2 2 * Copyright(c) 1999 - 2014 Intel Corporation.
3 Intel PRO/1000 Linux driver 3 *
4 Copyright(c) 1999 - 2013 Intel Corporation. 4 * This program is free software; you can redistribute it and/or modify it
5 5 * under the terms and conditions of the GNU General Public License,
6 This program is free software; you can redistribute it and/or modify it 6 * version 2, as published by the Free Software Foundation.
7 under the terms and conditions of the GNU General Public License, 7 *
8 version 2, as published by the Free Software Foundation. 8 * This program is distributed in the hope it will be useful, but WITHOUT
9 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 This program is distributed in the hope it will be useful, but WITHOUT 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * more details.
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 *
13 more details. 13 * The full GNU General Public License is included in this distribution in
14 14 * the file called "COPYING".
15 You should have received a copy of the GNU General Public License along with 15 *
16 this program; if not, write to the Free Software Foundation, Inc., 16 * Contact Information:
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 17 * Linux NICS <linux.nics@intel.com>
18 18 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
19 The full GNU General Public License is included in this distribution in 19 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
20 the file called "COPYING". 20 */
21
22 Contact Information:
23 Linux NICS <linux.nics@intel.com>
24 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26
27*******************************************************************************/
28 21
29/* 80003ES2LAN Gigabit Ethernet Controller (Copper) 22/* 80003ES2LAN Gigabit Ethernet Controller (Copper)
30 * 80003ES2LAN Gigabit Ethernet Controller (Serdes) 23 * 80003ES2LAN Gigabit Ethernet Controller (Serdes)
diff --git a/drivers/net/ethernet/intel/e1000e/80003es2lan.h b/drivers/net/ethernet/intel/e1000e/80003es2lan.h
index 90d363b2d280..535a9430976d 100644
--- a/drivers/net/ethernet/intel/e1000e/80003es2lan.h
+++ b/drivers/net/ethernet/intel/e1000e/80003es2lan.h
@@ -1,30 +1,23 @@
1/******************************************************************************* 1/* Intel PRO/1000 Linux driver
2 2 * Copyright(c) 1999 - 2014 Intel Corporation.
3 Intel PRO/1000 Linux driver 3 *
4 Copyright(c) 1999 - 2013 Intel Corporation. 4 * This program is free software; you can redistribute it and/or modify it
5 5 * under the terms and conditions of the GNU General Public License,
6 This program is free software; you can redistribute it and/or modify it 6 * version 2, as published by the Free Software Foundation.
7 under the terms and conditions of the GNU General Public License, 7 *
8 version 2, as published by the Free Software Foundation. 8 * This program is distributed in the hope it will be useful, but WITHOUT
9 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 This program is distributed in the hope it will be useful, but WITHOUT 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * more details.
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 *
13 more details. 13 * The full GNU General Public License is included in this distribution in
14 14 * the file called "COPYING".
15 You should have received a copy of the GNU General Public License along with 15 *
16 this program; if not, write to the Free Software Foundation, Inc., 16 * Contact Information:
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 17 * Linux NICS <linux.nics@intel.com>
18 18 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
19 The full GNU General Public License is included in this distribution in 19 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
20 the file called "COPYING". 20 */
21
22 Contact Information:
23 Linux NICS <linux.nics@intel.com>
24 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26
27*******************************************************************************/
28 21
29#ifndef _E1000E_80003ES2LAN_H_ 22#ifndef _E1000E_80003ES2LAN_H_
30#define _E1000E_80003ES2LAN_H_ 23#define _E1000E_80003ES2LAN_H_
diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c
index 8fed74e3fa53..e0aa7f1efb08 100644
--- a/drivers/net/ethernet/intel/e1000e/82571.c
+++ b/drivers/net/ethernet/intel/e1000e/82571.c
@@ -1,30 +1,23 @@
1/******************************************************************************* 1/* Intel PRO/1000 Linux driver
2 2 * Copyright(c) 1999 - 2014 Intel Corporation.
3 Intel PRO/1000 Linux driver 3 *
4 Copyright(c) 1999 - 2013 Intel Corporation. 4 * This program is free software; you can redistribute it and/or modify it
5 5 * under the terms and conditions of the GNU General Public License,
6 This program is free software; you can redistribute it and/or modify it 6 * version 2, as published by the Free Software Foundation.
7 under the terms and conditions of the GNU General Public License, 7 *
8 version 2, as published by the Free Software Foundation. 8 * This program is distributed in the hope it will be useful, but WITHOUT
9 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 This program is distributed in the hope it will be useful, but WITHOUT 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * more details.
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 *
13 more details. 13 * The full GNU General Public License is included in this distribution in
14 14 * the file called "COPYING".
15 You should have received a copy of the GNU General Public License along with 15 *
16 this program; if not, write to the Free Software Foundation, Inc., 16 * Contact Information:
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 17 * Linux NICS <linux.nics@intel.com>
18 18 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
19 The full GNU General Public License is included in this distribution in 19 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
20 the file called "COPYING". 20 */
21
22 Contact Information:
23 Linux NICS <linux.nics@intel.com>
24 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26
27*******************************************************************************/
28 21
29/* 82571EB Gigabit Ethernet Controller 22/* 82571EB Gigabit Ethernet Controller
30 * 82571EB Gigabit Ethernet Controller (Copper) 23 * 82571EB Gigabit Ethernet Controller (Copper)
diff --git a/drivers/net/ethernet/intel/e1000e/82571.h b/drivers/net/ethernet/intel/e1000e/82571.h
index 08e24dc3dc0e..2e758f796d60 100644
--- a/drivers/net/ethernet/intel/e1000e/82571.h
+++ b/drivers/net/ethernet/intel/e1000e/82571.h
@@ -1,30 +1,23 @@
1/******************************************************************************* 1/* Intel PRO/1000 Linux driver
2 2 * Copyright(c) 1999 - 2014 Intel Corporation.
3 Intel PRO/1000 Linux driver 3 *
4 Copyright(c) 1999 - 2013 Intel Corporation. 4 * This program is free software; you can redistribute it and/or modify it
5 5 * under the terms and conditions of the GNU General Public License,
6 This program is free software; you can redistribute it and/or modify it 6 * version 2, as published by the Free Software Foundation.
7 under the terms and conditions of the GNU General Public License, 7 *
8 version 2, as published by the Free Software Foundation. 8 * This program is distributed in the hope it will be useful, but WITHOUT
9 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 This program is distributed in the hope it will be useful, but WITHOUT 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * more details.
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 *
13 more details. 13 * The full GNU General Public License is included in this distribution in
14 14 * the file called "COPYING".
15 You should have received a copy of the GNU General Public License along with 15 *
16 this program; if not, write to the Free Software Foundation, Inc., 16 * Contact Information:
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 17 * Linux NICS <linux.nics@intel.com>
18 18 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
19 The full GNU General Public License is included in this distribution in 19 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
20 the file called "COPYING". 20 */
21
22 Contact Information:
23 Linux NICS <linux.nics@intel.com>
24 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26
27*******************************************************************************/
28 21
29#ifndef _E1000E_82571_H_ 22#ifndef _E1000E_82571_H_
30#define _E1000E_82571_H_ 23#define _E1000E_82571_H_
diff --git a/drivers/net/ethernet/intel/e1000e/Makefile b/drivers/net/ethernet/intel/e1000e/Makefile
index c2dcfcc10857..106de493373c 100644
--- a/drivers/net/ethernet/intel/e1000e/Makefile
+++ b/drivers/net/ethernet/intel/e1000e/Makefile
@@ -1,7 +1,7 @@
1################################################################################ 1################################################################################
2# 2#
3# Intel PRO/1000 Linux driver 3# Intel PRO/1000 Linux driver
4# Copyright(c) 1999 - 2013 Intel Corporation. 4# Copyright(c) 1999 - 2014 Intel Corporation.
5# 5#
6# This program is free software; you can redistribute it and/or modify it 6# This program is free software; you can redistribute it and/or modify it
7# under the terms and conditions of the GNU General Public License, 7# under the terms and conditions of the GNU General Public License,
@@ -12,9 +12,8 @@
12# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13# more details. 13# more details.
14# 14#
15# You should have received a copy of the GNU General Public License along with 15# You should have received a copy of the GNU General Public License
16# this program; if not, write to the Free Software Foundation, Inc., 16# along with this program; if not, see <http://www.gnu.org/licenses/>.
17# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
18# 17#
19# The full GNU General Public License is included in this distribution in 18# The full GNU General Public License is included in this distribution in
20# the file called "COPYING". 19# the file called "COPYING".
diff --git a/drivers/net/ethernet/intel/e1000e/defines.h b/drivers/net/ethernet/intel/e1000e/defines.h
index 351c94a0cf74..d18e89212575 100644
--- a/drivers/net/ethernet/intel/e1000e/defines.h
+++ b/drivers/net/ethernet/intel/e1000e/defines.h
@@ -1,30 +1,23 @@
1/******************************************************************************* 1/* Intel PRO/1000 Linux driver
2 2 * Copyright(c) 1999 - 2014 Intel Corporation.
3 Intel PRO/1000 Linux driver 3 *
4 Copyright(c) 1999 - 2013 Intel Corporation. 4 * This program is free software; you can redistribute it and/or modify it
5 5 * under the terms and conditions of the GNU General Public License,
6 This program is free software; you can redistribute it and/or modify it 6 * version 2, as published by the Free Software Foundation.
7 under the terms and conditions of the GNU General Public License, 7 *
8 version 2, as published by the Free Software Foundation. 8 * This program is distributed in the hope it will be useful, but WITHOUT
9 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 This program is distributed in the hope it will be useful, but WITHOUT 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * more details.
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 *
13 more details. 13 * The full GNU General Public License is included in this distribution in
14 14 * the file called "COPYING".
15 You should have received a copy of the GNU General Public License along with 15 *
16 this program; if not, write to the Free Software Foundation, Inc., 16 * Contact Information:
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 17 * Linux NICS <linux.nics@intel.com>
18 18 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
19 The full GNU General Public License is included in this distribution in 19 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
20 the file called "COPYING". 20 */
21
22 Contact Information:
23 Linux NICS <linux.nics@intel.com>
24 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26
27*******************************************************************************/
28 21
29#ifndef _E1000_DEFINES_H_ 22#ifndef _E1000_DEFINES_H_
30#define _E1000_DEFINES_H_ 23#define _E1000_DEFINES_H_
@@ -35,9 +28,11 @@
35 28
36/* Definitions for power management and wakeup registers */ 29/* Definitions for power management and wakeup registers */
37/* Wake Up Control */ 30/* Wake Up Control */
38#define E1000_WUC_APME 0x00000001 /* APM Enable */ 31#define E1000_WUC_APME 0x00000001 /* APM Enable */
39#define E1000_WUC_PME_EN 0x00000002 /* PME Enable */ 32#define E1000_WUC_PME_EN 0x00000002 /* PME Enable */
40#define E1000_WUC_PHY_WAKE 0x00000100 /* if PHY supports wakeup */ 33#define E1000_WUC_PME_STATUS 0x00000004 /* PME Status */
34#define E1000_WUC_APMPME 0x00000008 /* Assert PME on APM Wakeup */
35#define E1000_WUC_PHY_WAKE 0x00000100 /* if PHY supports wakeup */
41 36
42/* Wake Up Filter Control */ 37/* Wake Up Filter Control */
43#define E1000_WUFC_LNKC 0x00000001 /* Link Status Change Wakeup Enable */ 38#define E1000_WUFC_LNKC 0x00000001 /* Link Status Change Wakeup Enable */
diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h
index 0150f7fc893d..5325e3e2154e 100644
--- a/drivers/net/ethernet/intel/e1000e/e1000.h
+++ b/drivers/net/ethernet/intel/e1000e/e1000.h
@@ -1,30 +1,23 @@
1/******************************************************************************* 1/* Intel PRO/1000 Linux driver
2 2 * Copyright(c) 1999 - 2014 Intel Corporation.
3 Intel PRO/1000 Linux driver 3 *
4 Copyright(c) 1999 - 2013 Intel Corporation. 4 * This program is free software; you can redistribute it and/or modify it
5 5 * under the terms and conditions of the GNU General Public License,
6 This program is free software; you can redistribute it and/or modify it 6 * version 2, as published by the Free Software Foundation.
7 under the terms and conditions of the GNU General Public License, 7 *
8 version 2, as published by the Free Software Foundation. 8 * This program is distributed in the hope it will be useful, but WITHOUT
9 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 This program is distributed in the hope it will be useful, but WITHOUT 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * more details.
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 *
13 more details. 13 * The full GNU General Public License is included in this distribution in
14 14 * the file called "COPYING".
15 You should have received a copy of the GNU General Public License along with 15 *
16 this program; if not, write to the Free Software Foundation, Inc., 16 * Contact Information:
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 17 * Linux NICS <linux.nics@intel.com>
18 18 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
19 The full GNU General Public License is included in this distribution in 19 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
20 the file called "COPYING". 20 */
21
22 Contact Information:
23 Linux NICS <linux.nics@intel.com>
24 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26
27*******************************************************************************/
28 21
29/* Linux PRO/1000 Ethernet Driver main header file */ 22/* Linux PRO/1000 Ethernet Driver main header file */
30 23
@@ -333,7 +326,6 @@ struct e1000_adapter {
333 struct work_struct update_phy_task; 326 struct work_struct update_phy_task;
334 struct work_struct print_hang_task; 327 struct work_struct print_hang_task;
335 328
336 bool idle_check;
337 int phy_hang_count; 329 int phy_hang_count;
338 330
339 u16 tx_ring_count; 331 u16 tx_ring_count;
@@ -476,7 +468,7 @@ void e1000e_check_options(struct e1000_adapter *adapter);
476void e1000e_set_ethtool_ops(struct net_device *netdev); 468void e1000e_set_ethtool_ops(struct net_device *netdev);
477 469
478int e1000e_up(struct e1000_adapter *adapter); 470int e1000e_up(struct e1000_adapter *adapter);
479void e1000e_down(struct e1000_adapter *adapter); 471void e1000e_down(struct e1000_adapter *adapter, bool reset);
480void e1000e_reinit_locked(struct e1000_adapter *adapter); 472void e1000e_reinit_locked(struct e1000_adapter *adapter);
481void e1000e_reset(struct e1000_adapter *adapter); 473void e1000e_reset(struct e1000_adapter *adapter);
482void e1000e_power_up_phy(struct e1000_adapter *adapter); 474void e1000e_power_up_phy(struct e1000_adapter *adapter);
diff --git a/drivers/net/ethernet/intel/e1000e/ethtool.c b/drivers/net/ethernet/intel/e1000e/ethtool.c
index d14c8f53384c..3c2898d0c2aa 100644
--- a/drivers/net/ethernet/intel/e1000e/ethtool.c
+++ b/drivers/net/ethernet/intel/e1000e/ethtool.c
@@ -1,30 +1,23 @@
1/******************************************************************************* 1/* Intel PRO/1000 Linux driver
2 2 * Copyright(c) 1999 - 2014 Intel Corporation.
3 Intel PRO/1000 Linux driver 3 *
4 Copyright(c) 1999 - 2013 Intel Corporation. 4 * This program is free software; you can redistribute it and/or modify it
5 5 * under the terms and conditions of the GNU General Public License,
6 This program is free software; you can redistribute it and/or modify it 6 * version 2, as published by the Free Software Foundation.
7 under the terms and conditions of the GNU General Public License, 7 *
8 version 2, as published by the Free Software Foundation. 8 * This program is distributed in the hope it will be useful, but WITHOUT
9 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 This program is distributed in the hope it will be useful, but WITHOUT 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * more details.
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 *
13 more details. 13 * The full GNU General Public License is included in this distribution in
14 14 * the file called "COPYING".
15 You should have received a copy of the GNU General Public License along with 15 *
16 this program; if not, write to the Free Software Foundation, Inc., 16 * Contact Information:
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 17 * Linux NICS <linux.nics@intel.com>
18 18 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
19 The full GNU General Public License is included in this distribution in 19 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
20 the file called "COPYING". 20 */
21
22 Contact Information:
23 Linux NICS <linux.nics@intel.com>
24 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26
27*******************************************************************************/
28 21
29/* ethtool support for e1000 */ 22/* ethtool support for e1000 */
30 23
@@ -332,7 +325,7 @@ static int e1000_set_settings(struct net_device *netdev,
332 325
333 /* reset the link */ 326 /* reset the link */
334 if (netif_running(adapter->netdev)) { 327 if (netif_running(adapter->netdev)) {
335 e1000e_down(adapter); 328 e1000e_down(adapter, true);
336 e1000e_up(adapter); 329 e1000e_up(adapter);
337 } else { 330 } else {
338 e1000e_reset(adapter); 331 e1000e_reset(adapter);
@@ -380,7 +373,7 @@ static int e1000_set_pauseparam(struct net_device *netdev,
380 if (adapter->fc_autoneg == AUTONEG_ENABLE) { 373 if (adapter->fc_autoneg == AUTONEG_ENABLE) {
381 hw->fc.requested_mode = e1000_fc_default; 374 hw->fc.requested_mode = e1000_fc_default;
382 if (netif_running(adapter->netdev)) { 375 if (netif_running(adapter->netdev)) {
383 e1000e_down(adapter); 376 e1000e_down(adapter, true);
384 e1000e_up(adapter); 377 e1000e_up(adapter);
385 } else { 378 } else {
386 e1000e_reset(adapter); 379 e1000e_reset(adapter);
@@ -726,7 +719,7 @@ static int e1000_set_ringparam(struct net_device *netdev,
726 719
727 pm_runtime_get_sync(netdev->dev.parent); 720 pm_runtime_get_sync(netdev->dev.parent);
728 721
729 e1000e_down(adapter); 722 e1000e_down(adapter, true);
730 723
731 /* We can't just free everything and then setup again, because the 724 /* We can't just free everything and then setup again, because the
732 * ISRs in MSI-X mode get passed pointers to the Tx and Rx ring 725 * ISRs in MSI-X mode get passed pointers to the Tx and Rx ring
@@ -924,15 +917,21 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)
924 } 917 }
925 if (mac->type == e1000_pch2lan) { 918 if (mac->type == e1000_pch2lan) {
926 /* SHRAH[0,1,2] different than previous */ 919 /* SHRAH[0,1,2] different than previous */
927 if (i == 7) 920 if (i == 1)
928 mask &= 0xFFF4FFFF; 921 mask &= 0xFFF4FFFF;
929 /* SHRAH[3] different than SHRAH[0,1,2] */ 922 /* SHRAH[3] different than SHRAH[0,1,2] */
930 if (i == 10) 923 if (i == 4)
931 mask |= (1 << 30); 924 mask |= (1 << 30);
925 /* RAR[1-6] owned by management engine - skipping */
926 if (i > 0)
927 i += 6;
932 } 928 }
933 929
934 REG_PATTERN_TEST_ARRAY(E1000_RA, ((i << 1) + 1), mask, 930 REG_PATTERN_TEST_ARRAY(E1000_RA, ((i << 1) + 1), mask,
935 0xFFFFFFFF); 931 0xFFFFFFFF);
932 /* reset index to actual value */
933 if ((mac->type == e1000_pch2lan) && (i > 6))
934 i -= 6;
936 } 935 }
937 936
938 for (i = 0; i < mac->mta_reg_count; i++) 937 for (i = 0; i < mac->mta_reg_count; i++)
diff --git a/drivers/net/ethernet/intel/e1000e/hw.h b/drivers/net/ethernet/intel/e1000e/hw.h
index b7f38435d1fd..6b3de5f39a97 100644
--- a/drivers/net/ethernet/intel/e1000e/hw.h
+++ b/drivers/net/ethernet/intel/e1000e/hw.h
@@ -1,30 +1,23 @@
1/******************************************************************************* 1/* Intel PRO/1000 Linux driver
2 2 * Copyright(c) 1999 - 2014 Intel Corporation.
3 Intel PRO/1000 Linux driver 3 *
4 Copyright(c) 1999 - 2013 Intel Corporation. 4 * This program is free software; you can redistribute it and/or modify it
5 5 * under the terms and conditions of the GNU General Public License,
6 This program is free software; you can redistribute it and/or modify it 6 * version 2, as published by the Free Software Foundation.
7 under the terms and conditions of the GNU General Public License, 7 *
8 version 2, as published by the Free Software Foundation. 8 * This program is distributed in the hope it will be useful, but WITHOUT
9 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 This program is distributed in the hope it will be useful, but WITHOUT 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * more details.
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 *
13 more details. 13 * The full GNU General Public License is included in this distribution in
14 14 * the file called "COPYING".
15 You should have received a copy of the GNU General Public License along with 15 *
16 this program; if not, write to the Free Software Foundation, Inc., 16 * Contact Information:
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 17 * Linux NICS <linux.nics@intel.com>
18 18 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
19 The full GNU General Public License is included in this distribution in 19 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
20 the file called "COPYING". 20 */
21
22 Contact Information:
23 Linux NICS <linux.nics@intel.com>
24 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26
27*******************************************************************************/
28 21
29#ifndef _E1000_HW_H_ 22#ifndef _E1000_HW_H_
30#define _E1000_HW_H_ 23#define _E1000_HW_H_
@@ -655,12 +648,20 @@ struct e1000_shadow_ram {
655 648
656#define E1000_ICH8_SHADOW_RAM_WORDS 2048 649#define E1000_ICH8_SHADOW_RAM_WORDS 2048
657 650
651/* I218 PHY Ultra Low Power (ULP) states */
652enum e1000_ulp_state {
653 e1000_ulp_state_unknown,
654 e1000_ulp_state_off,
655 e1000_ulp_state_on,
656};
657
658struct e1000_dev_spec_ich8lan { 658struct e1000_dev_spec_ich8lan {
659 bool kmrn_lock_loss_workaround_enabled; 659 bool kmrn_lock_loss_workaround_enabled;
660 struct e1000_shadow_ram shadow_ram[E1000_ICH8_SHADOW_RAM_WORDS]; 660 struct e1000_shadow_ram shadow_ram[E1000_ICH8_SHADOW_RAM_WORDS];
661 bool nvm_k1_enabled; 661 bool nvm_k1_enabled;
662 bool eee_disable; 662 bool eee_disable;
663 u16 eee_lp_ability; 663 u16 eee_lp_ability;
664 enum e1000_ulp_state ulp_state;
664}; 665};
665 666
666struct e1000_hw { 667struct e1000_hw {
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index 42f0f6717511..9866f264f55e 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -1,30 +1,23 @@
1/******************************************************************************* 1/* Intel PRO/1000 Linux driver
2 2 * Copyright(c) 1999 - 2014 Intel Corporation.
3 Intel PRO/1000 Linux driver 3 *
4 Copyright(c) 1999 - 2013 Intel Corporation. 4 * This program is free software; you can redistribute it and/or modify it
5 5 * under the terms and conditions of the GNU General Public License,
6 This program is free software; you can redistribute it and/or modify it 6 * version 2, as published by the Free Software Foundation.
7 under the terms and conditions of the GNU General Public License, 7 *
8 version 2, as published by the Free Software Foundation. 8 * This program is distributed in the hope it will be useful, but WITHOUT
9 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 This program is distributed in the hope it will be useful, but WITHOUT 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * more details.
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 *
13 more details. 13 * The full GNU General Public License is included in this distribution in
14 14 * the file called "COPYING".
15 You should have received a copy of the GNU General Public License along with 15 *
16 this program; if not, write to the Free Software Foundation, Inc., 16 * Contact Information:
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 17 * Linux NICS <linux.nics@intel.com>
18 18 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
19 The full GNU General Public License is included in this distribution in 19 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
20 the file called "COPYING". 20 */
21
22 Contact Information:
23 Linux NICS <linux.nics@intel.com>
24 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26
27*******************************************************************************/
28 21
29/* 82562G 10/100 Network Connection 22/* 82562G 10/100 Network Connection
30 * 82562G-2 10/100 Network Connection 23 * 82562G-2 10/100 Network Connection
@@ -53,6 +46,14 @@
53 * 82578DC Gigabit Network Connection 46 * 82578DC Gigabit Network Connection
54 * 82579LM Gigabit Network Connection 47 * 82579LM Gigabit Network Connection
55 * 82579V Gigabit Network Connection 48 * 82579V Gigabit Network Connection
49 * Ethernet Connection I217-LM
50 * Ethernet Connection I217-V
51 * Ethernet Connection I218-V
52 * Ethernet Connection I218-LM
53 * Ethernet Connection (2) I218-LM
54 * Ethernet Connection (2) I218-V
55 * Ethernet Connection (3) I218-LM
56 * Ethernet Connection (3) I218-V
56 */ 57 */
57 58
58#include "e1000.h" 59#include "e1000.h"
@@ -142,7 +143,9 @@ static void e1000_rar_set_pch2lan(struct e1000_hw *hw, u8 *addr, u32 index);
142static void e1000_rar_set_pch_lpt(struct e1000_hw *hw, u8 *addr, u32 index); 143static void e1000_rar_set_pch_lpt(struct e1000_hw *hw, u8 *addr, u32 index);
143static s32 e1000_k1_workaround_lv(struct e1000_hw *hw); 144static s32 e1000_k1_workaround_lv(struct e1000_hw *hw);
144static void e1000_gate_hw_phy_config_ich8lan(struct e1000_hw *hw, bool gate); 145static void e1000_gate_hw_phy_config_ich8lan(struct e1000_hw *hw, bool gate);
146static s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force);
145static s32 e1000_setup_copper_link_pch_lpt(struct e1000_hw *hw); 147static s32 e1000_setup_copper_link_pch_lpt(struct e1000_hw *hw);
148static s32 e1000_oem_bits_config_ich8lan(struct e1000_hw *hw, bool d0_state);
146 149
147static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg) 150static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg)
148{ 151{
@@ -239,6 +242,47 @@ out:
239} 242}
240 243
241/** 244/**
245 * e1000_toggle_lanphypc_pch_lpt - toggle the LANPHYPC pin value
246 * @hw: pointer to the HW structure
247 *
248 * Toggling the LANPHYPC pin value fully power-cycles the PHY and is
249 * used to reset the PHY to a quiescent state when necessary.
250 **/
251static void e1000_toggle_lanphypc_pch_lpt(struct e1000_hw *hw)
252{
253 u32 mac_reg;
254
255 /* Set Phy Config Counter to 50msec */
256 mac_reg = er32(FEXTNVM3);
257 mac_reg &= ~E1000_FEXTNVM3_PHY_CFG_COUNTER_MASK;
258 mac_reg |= E1000_FEXTNVM3_PHY_CFG_COUNTER_50MSEC;
259 ew32(FEXTNVM3, mac_reg);
260
261 /* Toggle LANPHYPC Value bit */
262 mac_reg = er32(CTRL);
263 mac_reg |= E1000_CTRL_LANPHYPC_OVERRIDE;
264 mac_reg &= ~E1000_CTRL_LANPHYPC_VALUE;
265 ew32(CTRL, mac_reg);
266 e1e_flush();
267 usleep_range(10, 20);
268 mac_reg &= ~E1000_CTRL_LANPHYPC_OVERRIDE;
269 ew32(CTRL, mac_reg);
270 e1e_flush();
271
272 if (hw->mac.type < e1000_pch_lpt) {
273 msleep(50);
274 } else {
275 u16 count = 20;
276
277 do {
278 usleep_range(5000, 10000);
279 } while (!(er32(CTRL_EXT) & E1000_CTRL_EXT_LPCD) && count--);
280
281 msleep(30);
282 }
283}
284
285/**
242 * e1000_init_phy_workarounds_pchlan - PHY initialization workarounds 286 * e1000_init_phy_workarounds_pchlan - PHY initialization workarounds
243 * @hw: pointer to the HW structure 287 * @hw: pointer to the HW structure
244 * 288 *
@@ -247,6 +291,7 @@ out:
247 **/ 291 **/
248static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw) 292static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw)
249{ 293{
294 struct e1000_adapter *adapter = hw->adapter;
250 u32 mac_reg, fwsm = er32(FWSM); 295 u32 mac_reg, fwsm = er32(FWSM);
251 s32 ret_val; 296 s32 ret_val;
252 297
@@ -255,6 +300,12 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw)
255 */ 300 */
256 e1000_gate_hw_phy_config_ich8lan(hw, true); 301 e1000_gate_hw_phy_config_ich8lan(hw, true);
257 302
303 /* It is not possible to be certain of the current state of ULP
304 * so forcibly disable it.
305 */
306 hw->dev_spec.ich8lan.ulp_state = e1000_ulp_state_unknown;
307 e1000_disable_ulp_lpt_lp(hw, true);
308
258 ret_val = hw->phy.ops.acquire(hw); 309 ret_val = hw->phy.ops.acquire(hw);
259 if (ret_val) { 310 if (ret_val) {
260 e_dbg("Failed to initialize PHY flow\n"); 311 e_dbg("Failed to initialize PHY flow\n");
@@ -300,33 +351,9 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw)
300 break; 351 break;
301 } 352 }
302 353
303 e_dbg("Toggling LANPHYPC\n");
304
305 /* Set Phy Config Counter to 50msec */
306 mac_reg = er32(FEXTNVM3);
307 mac_reg &= ~E1000_FEXTNVM3_PHY_CFG_COUNTER_MASK;
308 mac_reg |= E1000_FEXTNVM3_PHY_CFG_COUNTER_50MSEC;
309 ew32(FEXTNVM3, mac_reg);
310
311 /* Toggle LANPHYPC Value bit */ 354 /* Toggle LANPHYPC Value bit */
312 mac_reg = er32(CTRL); 355 e1000_toggle_lanphypc_pch_lpt(hw);
313 mac_reg |= E1000_CTRL_LANPHYPC_OVERRIDE; 356 if (hw->mac.type >= e1000_pch_lpt) {
314 mac_reg &= ~E1000_CTRL_LANPHYPC_VALUE;
315 ew32(CTRL, mac_reg);
316 e1e_flush();
317 usleep_range(10, 20);
318 mac_reg &= ~E1000_CTRL_LANPHYPC_OVERRIDE;
319 ew32(CTRL, mac_reg);
320 e1e_flush();
321 if (hw->mac.type < e1000_pch_lpt) {
322 msleep(50);
323 } else {
324 u16 count = 20;
325 do {
326 usleep_range(5000, 10000);
327 } while (!(er32(CTRL_EXT) &
328 E1000_CTRL_EXT_LPCD) && count--);
329 usleep_range(30000, 60000);
330 if (e1000_phy_is_accessible_pchlan(hw)) 357 if (e1000_phy_is_accessible_pchlan(hw))
331 break; 358 break;
332 359
@@ -349,12 +376,31 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw)
349 376
350 hw->phy.ops.release(hw); 377 hw->phy.ops.release(hw);
351 if (!ret_val) { 378 if (!ret_val) {
379
380 /* Check to see if able to reset PHY. Print error if not */
381 if (hw->phy.ops.check_reset_block(hw)) {
382 e_err("Reset blocked by ME\n");
383 goto out;
384 }
385
352 /* Reset the PHY before any access to it. Doing so, ensures 386 /* Reset the PHY before any access to it. Doing so, ensures
353 * that the PHY is in a known good state before we read/write 387 * that the PHY is in a known good state before we read/write
354 * PHY registers. The generic reset is sufficient here, 388 * PHY registers. The generic reset is sufficient here,
355 * because we haven't determined the PHY type yet. 389 * because we haven't determined the PHY type yet.
356 */ 390 */
357 ret_val = e1000e_phy_hw_reset_generic(hw); 391 ret_val = e1000e_phy_hw_reset_generic(hw);
392 if (ret_val)
393 goto out;
394
395 /* On a successful reset, possibly need to wait for the PHY
396 * to quiesce to an accessible state before returning control
397 * to the calling function. If the PHY does not quiesce, then
398 * return E1000E_BLK_PHY_RESET, as this is the condition that
399 * the PHY is in.
400 */
401 ret_val = hw->phy.ops.check_reset_block(hw);
402 if (ret_val)
403 e_err("ME blocked access to PHY after reset\n");
358 } 404 }
359 405
360out: 406out:
@@ -724,8 +770,14 @@ s32 e1000_write_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 data)
724 * Enable/disable EEE based on setting in dev_spec structure, the duplex of 770 * Enable/disable EEE based on setting in dev_spec structure, the duplex of
725 * the link and the EEE capabilities of the link partner. The LPI Control 771 * the link and the EEE capabilities of the link partner. The LPI Control
726 * register bits will remain set only if/when link is up. 772 * register bits will remain set only if/when link is up.
773 *
774 * EEE LPI must not be asserted earlier than one second after link is up.
775 * On 82579, EEE LPI should not be enabled until such time otherwise there
776 * can be link issues with some switches. Other devices can have EEE LPI
777 * enabled immediately upon link up since they have a timer in hardware which
778 * prevents LPI from being asserted too early.
727 **/ 779 **/
728static s32 e1000_set_eee_pchlan(struct e1000_hw *hw) 780s32 e1000_set_eee_pchlan(struct e1000_hw *hw)
729{ 781{
730 struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan; 782 struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
731 s32 ret_val; 783 s32 ret_val;
@@ -979,6 +1031,253 @@ static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link)
979} 1031}
980 1032
981/** 1033/**
1034 * e1000_enable_ulp_lpt_lp - configure Ultra Low Power mode for LynxPoint-LP
1035 * @hw: pointer to the HW structure
1036 * @to_sx: boolean indicating a system power state transition to Sx
1037 *
1038 * When link is down, configure ULP mode to significantly reduce the power
1039 * to the PHY. If on a Manageability Engine (ME) enabled system, tell the
1040 * ME firmware to start the ULP configuration. If not on an ME enabled
1041 * system, configure the ULP mode by software.
1042 */
1043s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx)
1044{
1045 u32 mac_reg;
1046 s32 ret_val = 0;
1047 u16 phy_reg;
1048
1049 if ((hw->mac.type < e1000_pch_lpt) ||
1050 (hw->adapter->pdev->device == E1000_DEV_ID_PCH_LPT_I217_LM) ||
1051 (hw->adapter->pdev->device == E1000_DEV_ID_PCH_LPT_I217_V) ||
1052 (hw->adapter->pdev->device == E1000_DEV_ID_PCH_I218_LM2) ||
1053 (hw->adapter->pdev->device == E1000_DEV_ID_PCH_I218_V2) ||
1054 (hw->dev_spec.ich8lan.ulp_state == e1000_ulp_state_on))
1055 return 0;
1056
1057 if (er32(FWSM) & E1000_ICH_FWSM_FW_VALID) {
1058 /* Request ME configure ULP mode in the PHY */
1059 mac_reg = er32(H2ME);
1060 mac_reg |= E1000_H2ME_ULP | E1000_H2ME_ENFORCE_SETTINGS;
1061 ew32(H2ME, mac_reg);
1062
1063 goto out;
1064 }
1065
1066 if (!to_sx) {
1067 int i = 0;
1068
1069 /* Poll up to 5 seconds for Cable Disconnected indication */
1070 while (!(er32(FEXT) & E1000_FEXT_PHY_CABLE_DISCONNECTED)) {
1071 /* Bail if link is re-acquired */
1072 if (er32(STATUS) & E1000_STATUS_LU)
1073 return -E1000_ERR_PHY;
1074
1075 if (i++ == 100)
1076 break;
1077
1078 msleep(50);
1079 }
1080 e_dbg("CABLE_DISCONNECTED %s set after %dmsec\n",
1081 (er32(FEXT) &
1082 E1000_FEXT_PHY_CABLE_DISCONNECTED) ? "" : "not", i * 50);
1083 }
1084
1085 ret_val = hw->phy.ops.acquire(hw);
1086 if (ret_val)
1087 goto out;
1088
1089 /* Force SMBus mode in PHY */
1090 ret_val = e1000_read_phy_reg_hv_locked(hw, CV_SMB_CTRL, &phy_reg);
1091 if (ret_val)
1092 goto release;
1093 phy_reg |= CV_SMB_CTRL_FORCE_SMBUS;
1094 e1000_write_phy_reg_hv_locked(hw, CV_SMB_CTRL, phy_reg);
1095
1096 /* Force SMBus mode in MAC */
1097 mac_reg = er32(CTRL_EXT);
1098 mac_reg |= E1000_CTRL_EXT_FORCE_SMBUS;
1099 ew32(CTRL_EXT, mac_reg);
1100
1101 /* Set Inband ULP Exit, Reset to SMBus mode and
1102 * Disable SMBus Release on PERST# in PHY
1103 */
1104 ret_val = e1000_read_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, &phy_reg);
1105 if (ret_val)
1106 goto release;
1107 phy_reg |= (I218_ULP_CONFIG1_RESET_TO_SMBUS |
1108 I218_ULP_CONFIG1_DISABLE_SMB_PERST);
1109 if (to_sx) {
1110 if (er32(WUFC) & E1000_WUFC_LNKC)
1111 phy_reg |= I218_ULP_CONFIG1_WOL_HOST;
1112
1113 phy_reg |= I218_ULP_CONFIG1_STICKY_ULP;
1114 } else {
1115 phy_reg |= I218_ULP_CONFIG1_INBAND_EXIT;
1116 }
1117 e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg);
1118
1119 /* Set Disable SMBus Release on PERST# in MAC */
1120 mac_reg = er32(FEXTNVM7);
1121 mac_reg |= E1000_FEXTNVM7_DISABLE_SMB_PERST;
1122 ew32(FEXTNVM7, mac_reg);
1123
1124 /* Commit ULP changes in PHY by starting auto ULP configuration */
1125 phy_reg |= I218_ULP_CONFIG1_START;
1126 e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg);
1127release:
1128 hw->phy.ops.release(hw);
1129out:
1130 if (ret_val)
1131 e_dbg("Error in ULP enable flow: %d\n", ret_val);
1132 else
1133 hw->dev_spec.ich8lan.ulp_state = e1000_ulp_state_on;
1134
1135 return ret_val;
1136}
1137
1138/**
1139 * e1000_disable_ulp_lpt_lp - unconfigure Ultra Low Power mode for LynxPoint-LP
1140 * @hw: pointer to the HW structure
1141 * @force: boolean indicating whether or not to force disabling ULP
1142 *
1143 * Un-configure ULP mode when link is up, the system is transitioned from
1144 * Sx or the driver is unloaded. If on a Manageability Engine (ME) enabled
1145 * system, poll for an indication from ME that ULP has been un-configured.
1146 * If not on an ME enabled system, un-configure the ULP mode by software.
1147 *
1148 * During nominal operation, this function is called when link is acquired
1149 * to disable ULP mode (force=false); otherwise, for example when unloading
1150 * the driver or during Sx->S0 transitions, this is called with force=true
1151 * to forcibly disable ULP.
1152 */
1153static s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force)
1154{
1155 s32 ret_val = 0;
1156 u32 mac_reg;
1157 u16 phy_reg;
1158 int i = 0;
1159
1160 if ((hw->mac.type < e1000_pch_lpt) ||
1161 (hw->adapter->pdev->device == E1000_DEV_ID_PCH_LPT_I217_LM) ||
1162 (hw->adapter->pdev->device == E1000_DEV_ID_PCH_LPT_I217_V) ||
1163 (hw->adapter->pdev->device == E1000_DEV_ID_PCH_I218_LM2) ||
1164 (hw->adapter->pdev->device == E1000_DEV_ID_PCH_I218_V2) ||
1165 (hw->dev_spec.ich8lan.ulp_state == e1000_ulp_state_off))
1166 return 0;
1167
1168 if (er32(FWSM) & E1000_ICH_FWSM_FW_VALID) {
1169 if (force) {
1170 /* Request ME un-configure ULP mode in the PHY */
1171 mac_reg = er32(H2ME);
1172 mac_reg &= ~E1000_H2ME_ULP;
1173 mac_reg |= E1000_H2ME_ENFORCE_SETTINGS;
1174 ew32(H2ME, mac_reg);
1175 }
1176
1177 /* Poll up to 100msec for ME to clear ULP_CFG_DONE */
1178 while (er32(FWSM) & E1000_FWSM_ULP_CFG_DONE) {
1179 if (i++ == 10) {
1180 ret_val = -E1000_ERR_PHY;
1181 goto out;
1182 }
1183
1184 usleep_range(10000, 20000);
1185 }
1186 e_dbg("ULP_CONFIG_DONE cleared after %dmsec\n", i * 10);
1187
1188 if (force) {
1189 mac_reg = er32(H2ME);
1190 mac_reg &= ~E1000_H2ME_ENFORCE_SETTINGS;
1191 ew32(H2ME, mac_reg);
1192 } else {
1193 /* Clear H2ME.ULP after ME ULP configuration */
1194 mac_reg = er32(H2ME);
1195 mac_reg &= ~E1000_H2ME_ULP;
1196 ew32(H2ME, mac_reg);
1197 }
1198
1199 goto out;
1200 }
1201
1202 ret_val = hw->phy.ops.acquire(hw);
1203 if (ret_val)
1204 goto out;
1205
1206 if (force)
1207 /* Toggle LANPHYPC Value bit */
1208 e1000_toggle_lanphypc_pch_lpt(hw);
1209
1210 /* Unforce SMBus mode in PHY */
1211 ret_val = e1000_read_phy_reg_hv_locked(hw, CV_SMB_CTRL, &phy_reg);
1212 if (ret_val) {
1213 /* The MAC might be in PCIe mode, so temporarily force to
1214 * SMBus mode in order to access the PHY.
1215 */
1216 mac_reg = er32(CTRL_EXT);
1217 mac_reg |= E1000_CTRL_EXT_FORCE_SMBUS;
1218 ew32(CTRL_EXT, mac_reg);
1219
1220 msleep(50);
1221
1222 ret_val = e1000_read_phy_reg_hv_locked(hw, CV_SMB_CTRL,
1223 &phy_reg);
1224 if (ret_val)
1225 goto release;
1226 }
1227 phy_reg &= ~CV_SMB_CTRL_FORCE_SMBUS;
1228 e1000_write_phy_reg_hv_locked(hw, CV_SMB_CTRL, phy_reg);
1229
1230 /* Unforce SMBus mode in MAC */
1231 mac_reg = er32(CTRL_EXT);
1232 mac_reg &= ~E1000_CTRL_EXT_FORCE_SMBUS;
1233 ew32(CTRL_EXT, mac_reg);
1234
1235 /* When ULP mode was previously entered, K1 was disabled by the
1236 * hardware. Re-Enable K1 in the PHY when exiting ULP.
1237 */
1238 ret_val = e1000_read_phy_reg_hv_locked(hw, HV_PM_CTRL, &phy_reg);
1239 if (ret_val)
1240 goto release;
1241 phy_reg |= HV_PM_CTRL_K1_ENABLE;
1242 e1000_write_phy_reg_hv_locked(hw, HV_PM_CTRL, phy_reg);
1243
1244 /* Clear ULP enabled configuration */
1245 ret_val = e1000_read_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, &phy_reg);
1246 if (ret_val)
1247 goto release;
1248 phy_reg &= ~(I218_ULP_CONFIG1_IND |
1249 I218_ULP_CONFIG1_STICKY_ULP |
1250 I218_ULP_CONFIG1_RESET_TO_SMBUS |
1251 I218_ULP_CONFIG1_WOL_HOST |
1252 I218_ULP_CONFIG1_INBAND_EXIT |
1253 I218_ULP_CONFIG1_DISABLE_SMB_PERST);
1254 e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg);
1255
1256 /* Commit ULP changes by starting auto ULP configuration */
1257 phy_reg |= I218_ULP_CONFIG1_START;
1258 e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg);
1259
1260 /* Clear Disable SMBus Release on PERST# in MAC */
1261 mac_reg = er32(FEXTNVM7);
1262 mac_reg &= ~E1000_FEXTNVM7_DISABLE_SMB_PERST;
1263 ew32(FEXTNVM7, mac_reg);
1264
1265release:
1266 hw->phy.ops.release(hw);
1267 if (force) {
1268 e1000_phy_hw_reset(hw);
1269 msleep(50);
1270 }
1271out:
1272 if (ret_val)
1273 e_dbg("Error in ULP disable flow: %d\n", ret_val);
1274 else
1275 hw->dev_spec.ich8lan.ulp_state = e1000_ulp_state_off;
1276
1277 return ret_val;
1278}
1279
1280/**
982 * e1000_check_for_copper_link_ich8lan - Check for link (Copper) 1281 * e1000_check_for_copper_link_ich8lan - Check for link (Copper)
983 * @hw: pointer to the HW structure 1282 * @hw: pointer to the HW structure
984 * 1283 *
@@ -1106,9 +1405,11 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
1106 e1000e_check_downshift(hw); 1405 e1000e_check_downshift(hw);
1107 1406
1108 /* Enable/Disable EEE after link up */ 1407 /* Enable/Disable EEE after link up */
1109 ret_val = e1000_set_eee_pchlan(hw); 1408 if (hw->phy.type > e1000_phy_82579) {
1110 if (ret_val) 1409 ret_val = e1000_set_eee_pchlan(hw);
1111 return ret_val; 1410 if (ret_val)
1411 return ret_val;
1412 }
1112 1413
1113 /* If we are forcing speed/duplex, then we simply return since 1414 /* If we are forcing speed/duplex, then we simply return since
1114 * we have already determined whether we have link or not. 1415 * we have already determined whether we have link or not.
@@ -1374,7 +1675,7 @@ static void e1000_rar_set_pch2lan(struct e1000_hw *hw, u8 *addr, u32 index)
1374 /* RAR[1-6] are owned by manageability. Skip those and program the 1675 /* RAR[1-6] are owned by manageability. Skip those and program the
1375 * next address into the SHRA register array. 1676 * next address into the SHRA register array.
1376 */ 1677 */
1377 if (index < (u32)(hw->mac.rar_entry_count - 6)) { 1678 if (index < (u32)(hw->mac.rar_entry_count)) {
1378 s32 ret_val; 1679 s32 ret_val;
1379 1680
1380 ret_val = e1000_acquire_swflag_ich8lan(hw); 1681 ret_val = e1000_acquire_swflag_ich8lan(hw);
@@ -1484,11 +1785,13 @@ out:
1484 **/ 1785 **/
1485static s32 e1000_check_reset_block_ich8lan(struct e1000_hw *hw) 1786static s32 e1000_check_reset_block_ich8lan(struct e1000_hw *hw)
1486{ 1787{
1487 u32 fwsm; 1788 bool blocked = false;
1789 int i = 0;
1488 1790
1489 fwsm = er32(FWSM); 1791 while ((blocked = !(er32(FWSM) & E1000_ICH_FWSM_RSPCIPHY)) &&
1490 1792 (i++ < 10))
1491 return (fwsm & E1000_ICH_FWSM_RSPCIPHY) ? 0 : E1000_BLK_PHY_RESET; 1793 usleep_range(10000, 20000);
1794 return blocked ? E1000_BLK_PHY_RESET : 0;
1492} 1795}
1493 1796
1494/** 1797/**
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.h b/drivers/net/ethernet/intel/e1000e/ich8lan.h
index 217090df33e7..bead50f9187b 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.h
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.h
@@ -1,30 +1,23 @@
1/******************************************************************************* 1/* Intel PRO/1000 Linux driver
2 2 * Copyright(c) 1999 - 2014 Intel Corporation.
3 Intel PRO/1000 Linux driver 3 *
4 Copyright(c) 1999 - 2013 Intel Corporation. 4 * This program is free software; you can redistribute it and/or modify it
5 5 * under the terms and conditions of the GNU General Public License,
6 This program is free software; you can redistribute it and/or modify it 6 * version 2, as published by the Free Software Foundation.
7 under the terms and conditions of the GNU General Public License, 7 *
8 version 2, as published by the Free Software Foundation. 8 * This program is distributed in the hope it will be useful, but WITHOUT
9 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 This program is distributed in the hope it will be useful, but WITHOUT 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * more details.
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 *
13 more details. 13 * The full GNU General Public License is included in this distribution in
14 14 * the file called "COPYING".
15 You should have received a copy of the GNU General Public License along with 15 *
16 this program; if not, write to the Free Software Foundation, Inc., 16 * Contact Information:
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 17 * Linux NICS <linux.nics@intel.com>
18 18 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
19 The full GNU General Public License is included in this distribution in 19 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
20 the file called "COPYING". 20 */
21
22 Contact Information:
23 Linux NICS <linux.nics@intel.com>
24 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26
27*******************************************************************************/
28 21
29#ifndef _E1000E_ICH8LAN_H_ 22#ifndef _E1000E_ICH8LAN_H_
30#define _E1000E_ICH8LAN_H_ 23#define _E1000E_ICH8LAN_H_
@@ -65,11 +58,16 @@
65 58
66#define E1000_FWSM_WLOCK_MAC_MASK 0x0380 59#define E1000_FWSM_WLOCK_MAC_MASK 0x0380
67#define E1000_FWSM_WLOCK_MAC_SHIFT 7 60#define E1000_FWSM_WLOCK_MAC_SHIFT 7
61#define E1000_FWSM_ULP_CFG_DONE 0x00000400 /* Low power cfg done */
68 62
69/* Shared Receive Address Registers */ 63/* Shared Receive Address Registers */
70#define E1000_SHRAL_PCH_LPT(_i) (0x05408 + ((_i) * 8)) 64#define E1000_SHRAL_PCH_LPT(_i) (0x05408 + ((_i) * 8))
71#define E1000_SHRAH_PCH_LPT(_i) (0x0540C + ((_i) * 8)) 65#define E1000_SHRAH_PCH_LPT(_i) (0x0540C + ((_i) * 8))
72 66
67#define E1000_H2ME 0x05B50 /* Host to ME */
68#define E1000_H2ME_ULP 0x00000800 /* ULP Indication Bit */
69#define E1000_H2ME_ENFORCE_SETTINGS 0x00001000 /* Enforce Settings */
70
73#define ID_LED_DEFAULT_ICH8LAN ((ID_LED_DEF1_DEF2 << 12) | \ 71#define ID_LED_DEFAULT_ICH8LAN ((ID_LED_DEF1_DEF2 << 12) | \
74 (ID_LED_OFF1_OFF2 << 8) | \ 72 (ID_LED_OFF1_OFF2 << 8) | \
75 (ID_LED_OFF1_ON2 << 4) | \ 73 (ID_LED_OFF1_ON2 << 4) | \
@@ -82,6 +80,9 @@
82 80
83#define E1000_ICH8_LAN_INIT_TIMEOUT 1500 81#define E1000_ICH8_LAN_INIT_TIMEOUT 1500
84 82
83/* FEXT register bit definition */
84#define E1000_FEXT_PHY_CABLE_DISCONNECTED 0x00000004
85
85#define E1000_FEXTNVM_SW_CONFIG 1 86#define E1000_FEXTNVM_SW_CONFIG 1
86#define E1000_FEXTNVM_SW_CONFIG_ICH8M (1 << 27) /* different on ICH8M */ 87#define E1000_FEXTNVM_SW_CONFIG_ICH8M (1 << 27) /* different on ICH8M */
87 88
@@ -95,10 +96,12 @@
95#define E1000_FEXTNVM6_REQ_PLL_CLK 0x00000100 96#define E1000_FEXTNVM6_REQ_PLL_CLK 0x00000100
96#define E1000_FEXTNVM6_ENABLE_K1_ENTRY_CONDITION 0x00000200 97#define E1000_FEXTNVM6_ENABLE_K1_ENTRY_CONDITION 0x00000200
97 98
99#define E1000_FEXTNVM7_DISABLE_SMB_PERST 0x00000020
100
98#define PCIE_ICH8_SNOOP_ALL PCIE_NO_SNOOP_ALL 101#define PCIE_ICH8_SNOOP_ALL PCIE_NO_SNOOP_ALL
99 102
100#define E1000_ICH_RAR_ENTRIES 7 103#define E1000_ICH_RAR_ENTRIES 7
101#define E1000_PCH2_RAR_ENTRIES 11 /* RAR[0-6], SHRA[0-3] */ 104#define E1000_PCH2_RAR_ENTRIES 5 /* RAR[0], SHRA[0-3] */
102#define E1000_PCH_LPT_RAR_ENTRIES 12 /* RAR[0], SHRA[0-10] */ 105#define E1000_PCH_LPT_RAR_ENTRIES 12 /* RAR[0], SHRA[0-10] */
103 106
104#define PHY_PAGE_SHIFT 5 107#define PHY_PAGE_SHIFT 5
@@ -161,6 +164,16 @@
161#define CV_SMB_CTRL PHY_REG(769, 23) 164#define CV_SMB_CTRL PHY_REG(769, 23)
162#define CV_SMB_CTRL_FORCE_SMBUS 0x0001 165#define CV_SMB_CTRL_FORCE_SMBUS 0x0001
163 166
167/* I218 Ultra Low Power Configuration 1 Register */
168#define I218_ULP_CONFIG1 PHY_REG(779, 16)
169#define I218_ULP_CONFIG1_START 0x0001 /* Start auto ULP config */
170#define I218_ULP_CONFIG1_IND 0x0004 /* Pwr up from ULP indication */
171#define I218_ULP_CONFIG1_STICKY_ULP 0x0010 /* Set sticky ULP mode */
172#define I218_ULP_CONFIG1_INBAND_EXIT 0x0020 /* Inband on ULP exit */
173#define I218_ULP_CONFIG1_WOL_HOST 0x0040 /* WoL Host on ULP exit */
174#define I218_ULP_CONFIG1_RESET_TO_SMBUS 0x0100 /* Reset to SMBus mode */
175#define I218_ULP_CONFIG1_DISABLE_SMB_PERST 0x1000 /* Disable on PERST# */
176
164/* SMBus Address Phy Register */ 177/* SMBus Address Phy Register */
165#define HV_SMB_ADDR PHY_REG(768, 26) 178#define HV_SMB_ADDR PHY_REG(768, 26)
166#define HV_SMB_ADDR_MASK 0x007F 179#define HV_SMB_ADDR_MASK 0x007F
@@ -195,6 +208,7 @@
195/* PHY Power Management Control */ 208/* PHY Power Management Control */
196#define HV_PM_CTRL PHY_REG(770, 17) 209#define HV_PM_CTRL PHY_REG(770, 17)
197#define HV_PM_CTRL_PLL_STOP_IN_K1_GIGA 0x100 210#define HV_PM_CTRL_PLL_STOP_IN_K1_GIGA 0x100
211#define HV_PM_CTRL_K1_ENABLE 0x4000
198 212
199#define SW_FLAG_TIMEOUT 1000 /* SW Semaphore flag timeout in ms */ 213#define SW_FLAG_TIMEOUT 1000 /* SW Semaphore flag timeout in ms */
200 214
@@ -268,4 +282,6 @@ void e1000_copy_rx_addrs_to_phy_ich8lan(struct e1000_hw *hw);
268s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable); 282s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable);
269s32 e1000_read_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 *data); 283s32 e1000_read_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 *data);
270s32 e1000_write_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 data); 284s32 e1000_write_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 data);
285s32 e1000_set_eee_pchlan(struct e1000_hw *hw);
286s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx);
271#endif /* _E1000E_ICH8LAN_H_ */ 287#endif /* _E1000E_ICH8LAN_H_ */
diff --git a/drivers/net/ethernet/intel/e1000e/mac.c b/drivers/net/ethernet/intel/e1000e/mac.c
index 2480c1091873..baa0a466d1d0 100644
--- a/drivers/net/ethernet/intel/e1000e/mac.c
+++ b/drivers/net/ethernet/intel/e1000e/mac.c
@@ -1,30 +1,23 @@
1/******************************************************************************* 1/* Intel PRO/1000 Linux driver
2 2 * Copyright(c) 1999 - 2014 Intel Corporation.
3 Intel PRO/1000 Linux driver 3 *
4 Copyright(c) 1999 - 2013 Intel Corporation. 4 * This program is free software; you can redistribute it and/or modify it
5 5 * under the terms and conditions of the GNU General Public License,
6 This program is free software; you can redistribute it and/or modify it 6 * version 2, as published by the Free Software Foundation.
7 under the terms and conditions of the GNU General Public License, 7 *
8 version 2, as published by the Free Software Foundation. 8 * This program is distributed in the hope it will be useful, but WITHOUT
9 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 This program is distributed in the hope it will be useful, but WITHOUT 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * more details.
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 *
13 more details. 13 * The full GNU General Public License is included in this distribution in
14 14 * the file called "COPYING".
15 You should have received a copy of the GNU General Public License along with 15 *
16 this program; if not, write to the Free Software Foundation, Inc., 16 * Contact Information:
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 17 * Linux NICS <linux.nics@intel.com>
18 18 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
19 The full GNU General Public License is included in this distribution in 19 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
20 the file called "COPYING". 20 */
21
22 Contact Information:
23 Linux NICS <linux.nics@intel.com>
24 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26
27*******************************************************************************/
28 21
29#include "e1000.h" 22#include "e1000.h"
30 23
diff --git a/drivers/net/ethernet/intel/e1000e/mac.h b/drivers/net/ethernet/intel/e1000e/mac.h
index a61fee404ebe..4e81c2825b7a 100644
--- a/drivers/net/ethernet/intel/e1000e/mac.h
+++ b/drivers/net/ethernet/intel/e1000e/mac.h
@@ -1,30 +1,23 @@
1/******************************************************************************* 1/* Intel PRO/1000 Linux driver
2 2 * Copyright(c) 1999 - 2014 Intel Corporation.
3 Intel PRO/1000 Linux driver 3 *
4 Copyright(c) 1999 - 2013 Intel Corporation. 4 * This program is free software; you can redistribute it and/or modify it
5 5 * under the terms and conditions of the GNU General Public License,
6 This program is free software; you can redistribute it and/or modify it 6 * version 2, as published by the Free Software Foundation.
7 under the terms and conditions of the GNU General Public License, 7 *
8 version 2, as published by the Free Software Foundation. 8 * This program is distributed in the hope it will be useful, but WITHOUT
9 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 This program is distributed in the hope it will be useful, but WITHOUT 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * more details.
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 *
13 more details. 13 * The full GNU General Public License is included in this distribution in
14 14 * the file called "COPYING".
15 You should have received a copy of the GNU General Public License along with 15 *
16 this program; if not, write to the Free Software Foundation, Inc., 16 * Contact Information:
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 17 * Linux NICS <linux.nics@intel.com>
18 18 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
19 The full GNU General Public License is included in this distribution in 19 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
20 the file called "COPYING". 20 */
21
22 Contact Information:
23 Linux NICS <linux.nics@intel.com>
24 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26
27*******************************************************************************/
28 21
29#ifndef _E1000E_MAC_H_ 22#ifndef _E1000E_MAC_H_
30#define _E1000E_MAC_H_ 23#define _E1000E_MAC_H_
diff --git a/drivers/net/ethernet/intel/e1000e/manage.c b/drivers/net/ethernet/intel/e1000e/manage.c
index e4b0f1ef92f6..cb37ff1f1321 100644
--- a/drivers/net/ethernet/intel/e1000e/manage.c
+++ b/drivers/net/ethernet/intel/e1000e/manage.c
@@ -1,30 +1,23 @@
1/******************************************************************************* 1/* Intel PRO/1000 Linux driver
2 2 * Copyright(c) 1999 - 2014 Intel Corporation.
3 Intel PRO/1000 Linux driver 3 *
4 Copyright(c) 1999 - 2013 Intel Corporation. 4 * This program is free software; you can redistribute it and/or modify it
5 5 * under the terms and conditions of the GNU General Public License,
6 This program is free software; you can redistribute it and/or modify it 6 * version 2, as published by the Free Software Foundation.
7 under the terms and conditions of the GNU General Public License, 7 *
8 version 2, as published by the Free Software Foundation. 8 * This program is distributed in the hope it will be useful, but WITHOUT
9 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 This program is distributed in the hope it will be useful, but WITHOUT 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * more details.
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 *
13 more details. 13 * The full GNU General Public License is included in this distribution in
14 14 * the file called "COPYING".
15 You should have received a copy of the GNU General Public License along with 15 *
16 this program; if not, write to the Free Software Foundation, Inc., 16 * Contact Information:
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 17 * Linux NICS <linux.nics@intel.com>
18 18 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
19 The full GNU General Public License is included in this distribution in 19 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
20 the file called "COPYING". 20 */
21
22 Contact Information:
23 Linux NICS <linux.nics@intel.com>
24 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26
27*******************************************************************************/
28 21
29#include "e1000.h" 22#include "e1000.h"
30 23
diff --git a/drivers/net/ethernet/intel/e1000e/manage.h b/drivers/net/ethernet/intel/e1000e/manage.h
index 326897c29ea8..a8c27f98f7b0 100644
--- a/drivers/net/ethernet/intel/e1000e/manage.h
+++ b/drivers/net/ethernet/intel/e1000e/manage.h
@@ -1,30 +1,23 @@
1/******************************************************************************* 1/* Intel PRO/1000 Linux driver
2 2 * Copyright(c) 1999 - 2014 Intel Corporation.
3 Intel PRO/1000 Linux driver 3 *
4 Copyright(c) 1999 - 2013 Intel Corporation. 4 * This program is free software; you can redistribute it and/or modify it
5 5 * under the terms and conditions of the GNU General Public License,
6 This program is free software; you can redistribute it and/or modify it 6 * version 2, as published by the Free Software Foundation.
7 under the terms and conditions of the GNU General Public License, 7 *
8 version 2, as published by the Free Software Foundation. 8 * This program is distributed in the hope it will be useful, but WITHOUT
9 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 This program is distributed in the hope it will be useful, but WITHOUT 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * more details.
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 *
13 more details. 13 * The full GNU General Public License is included in this distribution in
14 14 * the file called "COPYING".
15 You should have received a copy of the GNU General Public License along with 15 *
16 this program; if not, write to the Free Software Foundation, Inc., 16 * Contact Information:
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 17 * Linux NICS <linux.nics@intel.com>
18 18 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
19 The full GNU General Public License is included in this distribution in 19 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
20 the file called "COPYING". 20 */
21
22 Contact Information:
23 Linux NICS <linux.nics@intel.com>
24 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26
27*******************************************************************************/
28 21
29#ifndef _E1000E_MANAGE_H_ 22#ifndef _E1000E_MANAGE_H_
30#define _E1000E_MANAGE_H_ 23#define _E1000E_MANAGE_H_
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 6d91933c4cdd..6bd1832e3f3e 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -1,30 +1,23 @@
1/******************************************************************************* 1/* Intel PRO/1000 Linux driver
2 2 * Copyright(c) 1999 - 2014 Intel Corporation.
3 Intel PRO/1000 Linux driver 3 *
4 Copyright(c) 1999 - 2013 Intel Corporation. 4 * This program is free software; you can redistribute it and/or modify it
5 5 * under the terms and conditions of the GNU General Public License,
6 This program is free software; you can redistribute it and/or modify it 6 * version 2, as published by the Free Software Foundation.
7 under the terms and conditions of the GNU General Public License, 7 *
8 version 2, as published by the Free Software Foundation. 8 * This program is distributed in the hope it will be useful, but WITHOUT
9 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 This program is distributed in the hope it will be useful, but WITHOUT 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * more details.
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 *
13 more details. 13 * The full GNU General Public License is included in this distribution in
14 14 * the file called "COPYING".
15 You should have received a copy of the GNU General Public License along with 15 *
16 this program; if not, write to the Free Software Foundation, Inc., 16 * Contact Information:
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 17 * Linux NICS <linux.nics@intel.com>
18 18 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
19 The full GNU General Public License is included in this distribution in 19 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
20 the file called "COPYING". 20 */
21
22 Contact Information:
23 Linux NICS <linux.nics@intel.com>
24 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26
27*******************************************************************************/
28 21
29#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 22#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
30 23
@@ -885,7 +878,7 @@ static inline void e1000_rx_hash(struct net_device *netdev, __le32 rss,
885 struct sk_buff *skb) 878 struct sk_buff *skb)
886{ 879{
887 if (netdev->features & NETIF_F_RXHASH) 880 if (netdev->features & NETIF_F_RXHASH)
888 skb->rxhash = le32_to_cpu(rss); 881 skb_set_hash(skb, le32_to_cpu(rss), PKT_HASH_TYPE_L3);
889} 882}
890 883
891/** 884/**
@@ -1097,8 +1090,14 @@ static void e1000_print_hw_hang(struct work_struct *work)
1097 adapter->tx_hang_recheck = true; 1090 adapter->tx_hang_recheck = true;
1098 return; 1091 return;
1099 } 1092 }
1100 /* Real hang detected */
1101 adapter->tx_hang_recheck = false; 1093 adapter->tx_hang_recheck = false;
1094
1095 if (er32(TDH(0)) == er32(TDT(0))) {
1096 e_dbg("false hang detected, ignoring\n");
1097 return;
1098 }
1099
1100 /* Real hang detected */
1102 netif_stop_queue(netdev); 1101 netif_stop_queue(netdev);
1103 1102
1104 e1e_rphy(hw, MII_BMSR, &phy_status); 1103 e1e_rphy(hw, MII_BMSR, &phy_status);
@@ -1128,6 +1127,8 @@ static void e1000_print_hw_hang(struct work_struct *work)
1128 eop, jiffies, eop_desc->upper.fields.status, er32(STATUS), 1127 eop, jiffies, eop_desc->upper.fields.status, er32(STATUS),
1129 phy_status, phy_1000t_status, phy_ext_status, pci_status); 1128 phy_status, phy_1000t_status, phy_ext_status, pci_status);
1130 1129
1130 e1000e_dump(adapter);
1131
1131 /* Suggest workaround for known h/w issue */ 1132 /* Suggest workaround for known h/w issue */
1132 if ((hw->mac.type == e1000_pchlan) && (er32(CTRL) & E1000_CTRL_TFCE)) 1133 if ((hw->mac.type == e1000_pchlan) && (er32(CTRL) & E1000_CTRL_TFCE))
1133 e_err("Try turning off Tx pause (flow control) via ethtool\n"); 1134 e_err("Try turning off Tx pause (flow control) via ethtool\n");
@@ -1701,7 +1702,7 @@ static void e1000_clean_rx_ring(struct e1000_ring *rx_ring)
1701 adapter->flags2 &= ~FLAG2_IS_DISCARDING; 1702 adapter->flags2 &= ~FLAG2_IS_DISCARDING;
1702 1703
1703 writel(0, rx_ring->head); 1704 writel(0, rx_ring->head);
1704 if (rx_ring->adapter->flags2 & FLAG2_PCIM2PCI_ARBITER_WA) 1705 if (adapter->flags2 & FLAG2_PCIM2PCI_ARBITER_WA)
1705 e1000e_update_rdt_wa(rx_ring, 0); 1706 e1000e_update_rdt_wa(rx_ring, 0);
1706 else 1707 else
1707 writel(0, rx_ring->tail); 1708 writel(0, rx_ring->tail);
@@ -2038,13 +2039,16 @@ void e1000e_set_interrupt_capability(struct e1000_adapter *adapter)
2038 msix_entry), 2039 msix_entry),
2039 GFP_KERNEL); 2040 GFP_KERNEL);
2040 if (adapter->msix_entries) { 2041 if (adapter->msix_entries) {
2042 struct e1000_adapter *a = adapter;
2043
2041 for (i = 0; i < adapter->num_vectors; i++) 2044 for (i = 0; i < adapter->num_vectors; i++)
2042 adapter->msix_entries[i].entry = i; 2045 adapter->msix_entries[i].entry = i;
2043 2046
2044 err = pci_enable_msix(adapter->pdev, 2047 err = pci_enable_msix_range(a->pdev,
2045 adapter->msix_entries, 2048 a->msix_entries,
2046 adapter->num_vectors); 2049 a->num_vectors,
2047 if (err == 0) 2050 a->num_vectors);
2051 if (err > 0)
2048 return; 2052 return;
2049 } 2053 }
2050 /* MSI-X failed, so fall through and try MSI */ 2054 /* MSI-X failed, so fall through and try MSI */
@@ -2402,7 +2406,7 @@ static void e1000_clean_tx_ring(struct e1000_ring *tx_ring)
2402 tx_ring->next_to_clean = 0; 2406 tx_ring->next_to_clean = 0;
2403 2407
2404 writel(0, tx_ring->head); 2408 writel(0, tx_ring->head);
2405 if (tx_ring->adapter->flags2 & FLAG2_PCIM2PCI_ARBITER_WA) 2409 if (adapter->flags2 & FLAG2_PCIM2PCI_ARBITER_WA)
2406 e1000e_update_tdt_wa(tx_ring, 0); 2410 e1000e_update_tdt_wa(tx_ring, 0);
2407 else 2411 else
2408 writel(0, tx_ring->tail); 2412 writel(0, tx_ring->tail);
@@ -2894,7 +2898,7 @@ static void e1000_configure_tx(struct e1000_adapter *adapter)
2894 struct e1000_hw *hw = &adapter->hw; 2898 struct e1000_hw *hw = &adapter->hw;
2895 struct e1000_ring *tx_ring = adapter->tx_ring; 2899 struct e1000_ring *tx_ring = adapter->tx_ring;
2896 u64 tdba; 2900 u64 tdba;
2897 u32 tdlen, tarc; 2901 u32 tdlen, tctl, tarc;
2898 2902
2899 /* Setup the HW Tx Head and Tail descriptor pointers */ 2903 /* Setup the HW Tx Head and Tail descriptor pointers */
2900 tdba = tx_ring->dma; 2904 tdba = tx_ring->dma;
@@ -2931,6 +2935,12 @@ static void e1000_configure_tx(struct e1000_adapter *adapter)
2931 /* erratum work around: set txdctl the same for both queues */ 2935 /* erratum work around: set txdctl the same for both queues */
2932 ew32(TXDCTL(1), er32(TXDCTL(0))); 2936 ew32(TXDCTL(1), er32(TXDCTL(0)));
2933 2937
2938 /* Program the Transmit Control Register */
2939 tctl = er32(TCTL);
2940 tctl &= ~E1000_TCTL_CT;
2941 tctl |= E1000_TCTL_PSP | E1000_TCTL_RTLC |
2942 (E1000_COLLISION_THRESHOLD << E1000_CT_SHIFT);
2943
2934 if (adapter->flags & FLAG_TARC_SPEED_MODE_BIT) { 2944 if (adapter->flags & FLAG_TARC_SPEED_MODE_BIT) {
2935 tarc = er32(TARC(0)); 2945 tarc = er32(TARC(0));
2936 /* set the speed mode bit, we'll clear it if we're not at 2946 /* set the speed mode bit, we'll clear it if we're not at
@@ -2961,6 +2971,8 @@ static void e1000_configure_tx(struct e1000_adapter *adapter)
2961 /* enable Report Status bit */ 2971 /* enable Report Status bit */
2962 adapter->txd_cmd |= E1000_TXD_CMD_RS; 2972 adapter->txd_cmd |= E1000_TXD_CMD_RS;
2963 2973
2974 ew32(TCTL, tctl);
2975
2964 hw->mac.ops.config_collision_dist(hw); 2976 hw->mac.ops.config_collision_dist(hw);
2965} 2977}
2966 2978
@@ -3331,6 +3343,9 @@ static void e1000e_set_rx_mode(struct net_device *netdev)
3331 struct e1000_hw *hw = &adapter->hw; 3343 struct e1000_hw *hw = &adapter->hw;
3332 u32 rctl; 3344 u32 rctl;
3333 3345
3346 if (pm_runtime_suspended(netdev->dev.parent))
3347 return;
3348
3334 /* Check for Promiscuous and All Multicast modes */ 3349 /* Check for Promiscuous and All Multicast modes */
3335 rctl = er32(RCTL); 3350 rctl = er32(RCTL);
3336 3351
@@ -3691,10 +3706,6 @@ void e1000e_power_up_phy(struct e1000_adapter *adapter)
3691 */ 3706 */
3692static void e1000_power_down_phy(struct e1000_adapter *adapter) 3707static void e1000_power_down_phy(struct e1000_adapter *adapter)
3693{ 3708{
3694 /* WoL is enabled */
3695 if (adapter->wol)
3696 return;
3697
3698 if (adapter->hw.phy.ops.power_down) 3709 if (adapter->hw.phy.ops.power_down)
3699 adapter->hw.phy.ops.power_down(&adapter->hw); 3710 adapter->hw.phy.ops.power_down(&adapter->hw);
3700} 3711}
@@ -3911,10 +3922,8 @@ void e1000e_reset(struct e1000_adapter *adapter)
3911 } 3922 }
3912 3923
3913 if (!netif_running(adapter->netdev) && 3924 if (!netif_running(adapter->netdev) &&
3914 !test_bit(__E1000_TESTING, &adapter->state)) { 3925 !test_bit(__E1000_TESTING, &adapter->state))
3915 e1000_power_down_phy(adapter); 3926 e1000_power_down_phy(adapter);
3916 return;
3917 }
3918 3927
3919 e1000_get_phy_info(hw); 3928 e1000_get_phy_info(hw);
3920 3929
@@ -3981,7 +3990,12 @@ static void e1000e_flush_descriptors(struct e1000_adapter *adapter)
3981 3990
3982static void e1000e_update_stats(struct e1000_adapter *adapter); 3991static void e1000e_update_stats(struct e1000_adapter *adapter);
3983 3992
3984void e1000e_down(struct e1000_adapter *adapter) 3993/**
3994 * e1000e_down - quiesce the device and optionally reset the hardware
3995 * @adapter: board private structure
3996 * @reset: boolean flag to reset the hardware or not
3997 */
3998void e1000e_down(struct e1000_adapter *adapter, bool reset)
3985{ 3999{
3986 struct net_device *netdev = adapter->netdev; 4000 struct net_device *netdev = adapter->netdev;
3987 struct e1000_hw *hw = &adapter->hw; 4001 struct e1000_hw *hw = &adapter->hw;
@@ -4035,12 +4049,8 @@ void e1000e_down(struct e1000_adapter *adapter)
4035 e1000_lv_jumbo_workaround_ich8lan(hw, false)) 4049 e1000_lv_jumbo_workaround_ich8lan(hw, false))
4036 e_dbg("failed to disable jumbo frame workaround mode\n"); 4050 e_dbg("failed to disable jumbo frame workaround mode\n");
4037 4051
4038 if (!pci_channel_offline(adapter->pdev)) 4052 if (reset && !pci_channel_offline(adapter->pdev))
4039 e1000e_reset(adapter); 4053 e1000e_reset(adapter);
4040
4041 /* TODO: for power management, we could drop the link and
4042 * pci_disable_device here.
4043 */
4044} 4054}
4045 4055
4046void e1000e_reinit_locked(struct e1000_adapter *adapter) 4056void e1000e_reinit_locked(struct e1000_adapter *adapter)
@@ -4048,7 +4058,7 @@ void e1000e_reinit_locked(struct e1000_adapter *adapter)
4048 might_sleep(); 4058 might_sleep();
4049 while (test_and_set_bit(__E1000_RESETTING, &adapter->state)) 4059 while (test_and_set_bit(__E1000_RESETTING, &adapter->state))
4050 usleep_range(1000, 2000); 4060 usleep_range(1000, 2000);
4051 e1000e_down(adapter); 4061 e1000e_down(adapter, true);
4052 e1000e_up(adapter); 4062 e1000e_up(adapter);
4053 clear_bit(__E1000_RESETTING, &adapter->state); 4063 clear_bit(__E1000_RESETTING, &adapter->state);
4054} 4064}
@@ -4326,7 +4336,6 @@ static int e1000_open(struct net_device *netdev)
4326 adapter->tx_hang_recheck = false; 4336 adapter->tx_hang_recheck = false;
4327 netif_start_queue(netdev); 4337 netif_start_queue(netdev);
4328 4338
4329 adapter->idle_check = true;
4330 hw->mac.get_link_status = true; 4339 hw->mac.get_link_status = true;
4331 pm_runtime_put(&pdev->dev); 4340 pm_runtime_put(&pdev->dev);
4332 4341
@@ -4376,14 +4385,15 @@ static int e1000_close(struct net_device *netdev)
4376 pm_runtime_get_sync(&pdev->dev); 4385 pm_runtime_get_sync(&pdev->dev);
4377 4386
4378 if (!test_bit(__E1000_DOWN, &adapter->state)) { 4387 if (!test_bit(__E1000_DOWN, &adapter->state)) {
4379 e1000e_down(adapter); 4388 e1000e_down(adapter, true);
4380 e1000_free_irq(adapter); 4389 e1000_free_irq(adapter);
4390
4391 /* Link status message must follow this format */
4392 pr_info("%s NIC Link is Down\n", adapter->netdev->name);
4381 } 4393 }
4382 4394
4383 napi_disable(&adapter->napi); 4395 napi_disable(&adapter->napi);
4384 4396
4385 e1000_power_down_phy(adapter);
4386
4387 e1000e_free_tx_resources(adapter->tx_ring); 4397 e1000e_free_tx_resources(adapter->tx_ring);
4388 e1000e_free_rx_resources(adapter->rx_ring); 4398 e1000e_free_rx_resources(adapter->rx_ring);
4389 4399
@@ -4460,11 +4470,16 @@ static void e1000e_update_phy_task(struct work_struct *work)
4460 struct e1000_adapter *adapter = container_of(work, 4470 struct e1000_adapter *adapter = container_of(work,
4461 struct e1000_adapter, 4471 struct e1000_adapter,
4462 update_phy_task); 4472 update_phy_task);
4473 struct e1000_hw *hw = &adapter->hw;
4463 4474
4464 if (test_bit(__E1000_DOWN, &adapter->state)) 4475 if (test_bit(__E1000_DOWN, &adapter->state))
4465 return; 4476 return;
4466 4477
4467 e1000_get_phy_info(&adapter->hw); 4478 e1000_get_phy_info(hw);
4479
4480 /* Enable EEE on 82579 after link up */
4481 if (hw->phy.type == e1000_phy_82579)
4482 e1000_set_eee_pchlan(hw);
4468} 4483}
4469 4484
4470/** 4485/**
@@ -4799,6 +4814,7 @@ static void e1000e_check_82574_phy_workaround(struct e1000_adapter *adapter)
4799 4814
4800 if (adapter->phy_hang_count > 1) { 4815 if (adapter->phy_hang_count > 1) {
4801 adapter->phy_hang_count = 0; 4816 adapter->phy_hang_count = 0;
4817 e_dbg("PHY appears hung - resetting\n");
4802 schedule_work(&adapter->reset_task); 4818 schedule_work(&adapter->reset_task);
4803 } 4819 }
4804} 4820}
@@ -4957,15 +4973,11 @@ static void e1000_watchdog_task(struct work_struct *work)
4957 mod_timer(&adapter->phy_info_timer, 4973 mod_timer(&adapter->phy_info_timer,
4958 round_jiffies(jiffies + 2 * HZ)); 4974 round_jiffies(jiffies + 2 * HZ));
4959 4975
4960 /* The link is lost so the controller stops DMA. 4976 /* 8000ES2LAN requires a Rx packet buffer work-around
4961 * If there is queued Tx work that cannot be done 4977 * on link down event; reset the controller to flush
4962 * or if on an 8000ES2LAN which requires a Rx packet 4978 * the Rx packet buffer.
4963 * buffer work-around on link down event, reset the
4964 * controller to flush the Tx/Rx packet buffers.
4965 * (Do the reset outside of interrupt context).
4966 */ 4979 */
4967 if ((adapter->flags & FLAG_RX_NEEDS_RESTART) || 4980 if (adapter->flags & FLAG_RX_NEEDS_RESTART)
4968 (e1000_desc_unused(tx_ring) + 1 < tx_ring->count))
4969 adapter->flags |= FLAG_RESTART_NOW; 4981 adapter->flags |= FLAG_RESTART_NOW;
4970 else 4982 else
4971 pm_schedule_suspend(netdev->dev.parent, 4983 pm_schedule_suspend(netdev->dev.parent,
@@ -4988,6 +5000,15 @@ link_up:
4988 adapter->gotc_old = adapter->stats.gotc; 5000 adapter->gotc_old = adapter->stats.gotc;
4989 spin_unlock(&adapter->stats64_lock); 5001 spin_unlock(&adapter->stats64_lock);
4990 5002
5003 /* If the link is lost the controller stops DMA, but
5004 * if there is queued Tx work it cannot be done. So
5005 * reset the controller to flush the Tx packet buffers.
5006 */
5007 if (!netif_carrier_ok(netdev) &&
5008 (e1000_desc_unused(tx_ring) + 1 < tx_ring->count))
5009 adapter->flags |= FLAG_RESTART_NOW;
5010
5011 /* If reset is necessary, do it outside of interrupt context. */
4991 if (adapter->flags & FLAG_RESTART_NOW) { 5012 if (adapter->flags & FLAG_RESTART_NOW) {
4992 schedule_work(&adapter->reset_task); 5013 schedule_work(&adapter->reset_task);
4993 /* return immediately since reset is imminent */ 5014 /* return immediately since reset is imminent */
@@ -5684,8 +5705,11 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
5684 adapter->max_frame_size = max_frame; 5705 adapter->max_frame_size = max_frame;
5685 e_info("changing MTU from %d to %d\n", netdev->mtu, new_mtu); 5706 e_info("changing MTU from %d to %d\n", netdev->mtu, new_mtu);
5686 netdev->mtu = new_mtu; 5707 netdev->mtu = new_mtu;
5708
5709 pm_runtime_get_sync(netdev->dev.parent);
5710
5687 if (netif_running(netdev)) 5711 if (netif_running(netdev))
5688 e1000e_down(adapter); 5712 e1000e_down(adapter, true);
5689 5713
5690 /* NOTE: netdev_alloc_skb reserves 16 bytes, and typically NET_IP_ALIGN 5714 /* NOTE: netdev_alloc_skb reserves 16 bytes, and typically NET_IP_ALIGN
5691 * means we reserve 2 more, this pushes us to allocate from the next 5715 * means we reserve 2 more, this pushes us to allocate from the next
@@ -5711,6 +5735,8 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
5711 else 5735 else
5712 e1000e_reset(adapter); 5736 e1000e_reset(adapter);
5713 5737
5738 pm_runtime_put_sync(netdev->dev.parent);
5739
5714 clear_bit(__E1000_RESETTING, &adapter->state); 5740 clear_bit(__E1000_RESETTING, &adapter->state);
5715 5741
5716 return 0; 5742 return 0;
@@ -5852,7 +5878,7 @@ static int e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
5852static int e1000_init_phy_wakeup(struct e1000_adapter *adapter, u32 wufc) 5878static int e1000_init_phy_wakeup(struct e1000_adapter *adapter, u32 wufc)
5853{ 5879{
5854 struct e1000_hw *hw = &adapter->hw; 5880 struct e1000_hw *hw = &adapter->hw;
5855 u32 i, mac_reg; 5881 u32 i, mac_reg, wuc;
5856 u16 phy_reg, wuc_enable; 5882 u16 phy_reg, wuc_enable;
5857 int retval; 5883 int retval;
5858 5884
@@ -5899,13 +5925,18 @@ static int e1000_init_phy_wakeup(struct e1000_adapter *adapter, u32 wufc)
5899 phy_reg |= BM_RCTL_RFCE; 5925 phy_reg |= BM_RCTL_RFCE;
5900 hw->phy.ops.write_reg_page(&adapter->hw, BM_RCTL, phy_reg); 5926 hw->phy.ops.write_reg_page(&adapter->hw, BM_RCTL, phy_reg);
5901 5927
5928 wuc = E1000_WUC_PME_EN;
5929 if (wufc & (E1000_WUFC_MAG | E1000_WUFC_LNKC))
5930 wuc |= E1000_WUC_APME;
5931
5902 /* enable PHY wakeup in MAC register */ 5932 /* enable PHY wakeup in MAC register */
5903 ew32(WUFC, wufc); 5933 ew32(WUFC, wufc);
5904 ew32(WUC, E1000_WUC_PHY_WAKE | E1000_WUC_PME_EN); 5934 ew32(WUC, (E1000_WUC_PHY_WAKE | E1000_WUC_APMPME |
5935 E1000_WUC_PME_STATUS | wuc));
5905 5936
5906 /* configure and enable PHY wakeup in PHY registers */ 5937 /* configure and enable PHY wakeup in PHY registers */
5907 hw->phy.ops.write_reg_page(&adapter->hw, BM_WUFC, wufc); 5938 hw->phy.ops.write_reg_page(&adapter->hw, BM_WUFC, wufc);
5908 hw->phy.ops.write_reg_page(&adapter->hw, BM_WUC, E1000_WUC_PME_EN); 5939 hw->phy.ops.write_reg_page(&adapter->hw, BM_WUC, wuc);
5909 5940
5910 /* activate PHY wakeup */ 5941 /* activate PHY wakeup */
5911 wuc_enable |= BM_WUC_ENABLE_BIT | BM_WUC_HOST_WU_BIT; 5942 wuc_enable |= BM_WUC_ENABLE_BIT | BM_WUC_HOST_WU_BIT;
@@ -5918,15 +5949,10 @@ release:
5918 return retval; 5949 return retval;
5919} 5950}
5920 5951
5921static int __e1000_shutdown(struct pci_dev *pdev, bool runtime) 5952static int e1000e_pm_freeze(struct device *dev)
5922{ 5953{
5923 struct net_device *netdev = pci_get_drvdata(pdev); 5954 struct net_device *netdev = pci_get_drvdata(to_pci_dev(dev));
5924 struct e1000_adapter *adapter = netdev_priv(netdev); 5955 struct e1000_adapter *adapter = netdev_priv(netdev);
5925 struct e1000_hw *hw = &adapter->hw;
5926 u32 ctrl, ctrl_ext, rctl, status;
5927 /* Runtime suspend should only enable wakeup for link changes */
5928 u32 wufc = runtime ? E1000_WUFC_LNKC : adapter->wol;
5929 int retval = 0;
5930 5956
5931 netif_device_detach(netdev); 5957 netif_device_detach(netdev);
5932 5958
@@ -5937,11 +5963,29 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool runtime)
5937 usleep_range(10000, 20000); 5963 usleep_range(10000, 20000);
5938 5964
5939 WARN_ON(test_bit(__E1000_RESETTING, &adapter->state)); 5965 WARN_ON(test_bit(__E1000_RESETTING, &adapter->state));
5940 e1000e_down(adapter); 5966
5967 /* Quiesce the device without resetting the hardware */
5968 e1000e_down(adapter, false);
5941 e1000_free_irq(adapter); 5969 e1000_free_irq(adapter);
5942 } 5970 }
5943 e1000e_reset_interrupt_capability(adapter); 5971 e1000e_reset_interrupt_capability(adapter);
5944 5972
5973 /* Allow time for pending master requests to run */
5974 e1000e_disable_pcie_master(&adapter->hw);
5975
5976 return 0;
5977}
5978
5979static int __e1000_shutdown(struct pci_dev *pdev, bool runtime)
5980{
5981 struct net_device *netdev = pci_get_drvdata(pdev);
5982 struct e1000_adapter *adapter = netdev_priv(netdev);
5983 struct e1000_hw *hw = &adapter->hw;
5984 u32 ctrl, ctrl_ext, rctl, status;
5985 /* Runtime suspend should only enable wakeup for link changes */
5986 u32 wufc = runtime ? E1000_WUFC_LNKC : adapter->wol;
5987 int retval = 0;
5988
5945 status = er32(STATUS); 5989 status = er32(STATUS);
5946 if (status & E1000_STATUS_LU) 5990 if (status & E1000_STATUS_LU)
5947 wufc &= ~E1000_WUFC_LNKC; 5991 wufc &= ~E1000_WUFC_LNKC;
@@ -5972,12 +6016,12 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool runtime)
5972 ew32(CTRL_EXT, ctrl_ext); 6016 ew32(CTRL_EXT, ctrl_ext);
5973 } 6017 }
5974 6018
6019 if (!runtime)
6020 e1000e_power_up_phy(adapter);
6021
5975 if (adapter->flags & FLAG_IS_ICH) 6022 if (adapter->flags & FLAG_IS_ICH)
5976 e1000_suspend_workarounds_ich8lan(&adapter->hw); 6023 e1000_suspend_workarounds_ich8lan(&adapter->hw);
5977 6024
5978 /* Allow time for pending master requests to run */
5979 e1000e_disable_pcie_master(&adapter->hw);
5980
5981 if (adapter->flags2 & FLAG2_HAS_PHY_WAKEUP) { 6025 if (adapter->flags2 & FLAG2_HAS_PHY_WAKEUP) {
5982 /* enable wakeup by the PHY */ 6026 /* enable wakeup by the PHY */
5983 retval = e1000_init_phy_wakeup(adapter, wufc); 6027 retval = e1000_init_phy_wakeup(adapter, wufc);
@@ -5991,10 +6035,23 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool runtime)
5991 } else { 6035 } else {
5992 ew32(WUC, 0); 6036 ew32(WUC, 0);
5993 ew32(WUFC, 0); 6037 ew32(WUFC, 0);
6038
6039 e1000_power_down_phy(adapter);
5994 } 6040 }
5995 6041
5996 if (adapter->hw.phy.type == e1000_phy_igp_3) 6042 if (adapter->hw.phy.type == e1000_phy_igp_3) {
5997 e1000e_igp3_phy_powerdown_workaround_ich8lan(&adapter->hw); 6043 e1000e_igp3_phy_powerdown_workaround_ich8lan(&adapter->hw);
6044 } else if (hw->mac.type == e1000_pch_lpt) {
6045 if (!(wufc & (E1000_WUFC_EX | E1000_WUFC_MC | E1000_WUFC_BC)))
6046 /* ULP does not support wake from unicast, multicast
6047 * or broadcast.
6048 */
6049 retval = e1000_enable_ulp_lpt_lp(hw, !runtime);
6050
6051 if (retval)
6052 return retval;
6053 }
6054
5998 6055
5999 /* Release control of h/w to f/w. If f/w is AMT enabled, this 6056 /* Release control of h/w to f/w. If f/w is AMT enabled, this
6000 * would have already happened in close and is redundant. 6057 * would have already happened in close and is redundant.
@@ -6102,18 +6159,12 @@ static void e1000e_disable_aspm(struct pci_dev *pdev, u16 state)
6102} 6159}
6103 6160
6104#ifdef CONFIG_PM 6161#ifdef CONFIG_PM
6105static bool e1000e_pm_ready(struct e1000_adapter *adapter)
6106{
6107 return !!adapter->tx_ring->buffer_info;
6108}
6109
6110static int __e1000_resume(struct pci_dev *pdev) 6162static int __e1000_resume(struct pci_dev *pdev)
6111{ 6163{
6112 struct net_device *netdev = pci_get_drvdata(pdev); 6164 struct net_device *netdev = pci_get_drvdata(pdev);
6113 struct e1000_adapter *adapter = netdev_priv(netdev); 6165 struct e1000_adapter *adapter = netdev_priv(netdev);
6114 struct e1000_hw *hw = &adapter->hw; 6166 struct e1000_hw *hw = &adapter->hw;
6115 u16 aspm_disable_flag = 0; 6167 u16 aspm_disable_flag = 0;
6116 u32 err;
6117 6168
6118 if (adapter->flags2 & FLAG2_DISABLE_ASPM_L0S) 6169 if (adapter->flags2 & FLAG2_DISABLE_ASPM_L0S)
6119 aspm_disable_flag = PCIE_LINK_STATE_L0S; 6170 aspm_disable_flag = PCIE_LINK_STATE_L0S;
@@ -6124,13 +6175,6 @@ static int __e1000_resume(struct pci_dev *pdev)
6124 6175
6125 pci_set_master(pdev); 6176 pci_set_master(pdev);
6126 6177
6127 e1000e_set_interrupt_capability(adapter);
6128 if (netif_running(netdev)) {
6129 err = e1000_request_irq(adapter);
6130 if (err)
6131 return err;
6132 }
6133
6134 if (hw->mac.type >= e1000_pch2lan) 6178 if (hw->mac.type >= e1000_pch2lan)
6135 e1000_resume_workarounds_pchlan(&adapter->hw); 6179 e1000_resume_workarounds_pchlan(&adapter->hw);
6136 6180
@@ -6169,11 +6213,6 @@ static int __e1000_resume(struct pci_dev *pdev)
6169 6213
6170 e1000_init_manageability_pt(adapter); 6214 e1000_init_manageability_pt(adapter);
6171 6215
6172 if (netif_running(netdev))
6173 e1000e_up(adapter);
6174
6175 netif_device_attach(netdev);
6176
6177 /* If the controller has AMT, do not set DRV_LOAD until the interface 6216 /* If the controller has AMT, do not set DRV_LOAD until the interface
6178 * is up. For all other cases, let the f/w know that the h/w is now 6217 * is up. For all other cases, let the f/w know that the h/w is now
6179 * under the control of the driver. 6218 * under the control of the driver.
@@ -6184,75 +6223,111 @@ static int __e1000_resume(struct pci_dev *pdev)
6184 return 0; 6223 return 0;
6185} 6224}
6186 6225
6226static int e1000e_pm_thaw(struct device *dev)
6227{
6228 struct net_device *netdev = pci_get_drvdata(to_pci_dev(dev));
6229 struct e1000_adapter *adapter = netdev_priv(netdev);
6230
6231 e1000e_set_interrupt_capability(adapter);
6232 if (netif_running(netdev)) {
6233 u32 err = e1000_request_irq(adapter);
6234
6235 if (err)
6236 return err;
6237
6238 e1000e_up(adapter);
6239 }
6240
6241 netif_device_attach(netdev);
6242
6243 return 0;
6244}
6245
6187#ifdef CONFIG_PM_SLEEP 6246#ifdef CONFIG_PM_SLEEP
6188static int e1000_suspend(struct device *dev) 6247static int e1000e_pm_suspend(struct device *dev)
6189{ 6248{
6190 struct pci_dev *pdev = to_pci_dev(dev); 6249 struct pci_dev *pdev = to_pci_dev(dev);
6191 6250
6251 e1000e_pm_freeze(dev);
6252
6192 return __e1000_shutdown(pdev, false); 6253 return __e1000_shutdown(pdev, false);
6193} 6254}
6194 6255
6195static int e1000_resume(struct device *dev) 6256static int e1000e_pm_resume(struct device *dev)
6196{ 6257{
6197 struct pci_dev *pdev = to_pci_dev(dev); 6258 struct pci_dev *pdev = to_pci_dev(dev);
6198 struct net_device *netdev = pci_get_drvdata(pdev); 6259 int rc;
6199 struct e1000_adapter *adapter = netdev_priv(netdev);
6200 6260
6201 if (e1000e_pm_ready(adapter)) 6261 rc = __e1000_resume(pdev);
6202 adapter->idle_check = true; 6262 if (rc)
6263 return rc;
6203 6264
6204 return __e1000_resume(pdev); 6265 return e1000e_pm_thaw(dev);
6205} 6266}
6206#endif /* CONFIG_PM_SLEEP */ 6267#endif /* CONFIG_PM_SLEEP */
6207 6268
6208#ifdef CONFIG_PM_RUNTIME 6269#ifdef CONFIG_PM_RUNTIME
6209static int e1000_runtime_suspend(struct device *dev) 6270static int e1000e_pm_runtime_idle(struct device *dev)
6210{ 6271{
6211 struct pci_dev *pdev = to_pci_dev(dev); 6272 struct pci_dev *pdev = to_pci_dev(dev);
6212 struct net_device *netdev = pci_get_drvdata(pdev); 6273 struct net_device *netdev = pci_get_drvdata(pdev);
6213 struct e1000_adapter *adapter = netdev_priv(netdev); 6274 struct e1000_adapter *adapter = netdev_priv(netdev);
6214 6275
6215 if (!e1000e_pm_ready(adapter)) 6276 if (!e1000e_has_link(adapter))
6216 return 0; 6277 pm_schedule_suspend(dev, 5 * MSEC_PER_SEC);
6217 6278
6218 return __e1000_shutdown(pdev, true); 6279 return -EBUSY;
6219} 6280}
6220 6281
6221static int e1000_idle(struct device *dev) 6282static int e1000e_pm_runtime_resume(struct device *dev)
6222{ 6283{
6223 struct pci_dev *pdev = to_pci_dev(dev); 6284 struct pci_dev *pdev = to_pci_dev(dev);
6224 struct net_device *netdev = pci_get_drvdata(pdev); 6285 struct net_device *netdev = pci_get_drvdata(pdev);
6225 struct e1000_adapter *adapter = netdev_priv(netdev); 6286 struct e1000_adapter *adapter = netdev_priv(netdev);
6287 int rc;
6226 6288
6227 if (!e1000e_pm_ready(adapter)) 6289 rc = __e1000_resume(pdev);
6228 return 0; 6290 if (rc)
6291 return rc;
6229 6292
6230 if (adapter->idle_check) { 6293 if (netdev->flags & IFF_UP)
6231 adapter->idle_check = false; 6294 rc = e1000e_up(adapter);
6232 if (!e1000e_has_link(adapter))
6233 pm_schedule_suspend(dev, MSEC_PER_SEC);
6234 }
6235 6295
6236 return -EBUSY; 6296 return rc;
6237} 6297}
6238 6298
6239static int e1000_runtime_resume(struct device *dev) 6299static int e1000e_pm_runtime_suspend(struct device *dev)
6240{ 6300{
6241 struct pci_dev *pdev = to_pci_dev(dev); 6301 struct pci_dev *pdev = to_pci_dev(dev);
6242 struct net_device *netdev = pci_get_drvdata(pdev); 6302 struct net_device *netdev = pci_get_drvdata(pdev);
6243 struct e1000_adapter *adapter = netdev_priv(netdev); 6303 struct e1000_adapter *adapter = netdev_priv(netdev);
6244 6304
6245 if (!e1000e_pm_ready(adapter)) 6305 if (netdev->flags & IFF_UP) {
6246 return 0; 6306 int count = E1000_CHECK_RESET_COUNT;
6247 6307
6248 adapter->idle_check = !dev->power.runtime_auto; 6308 while (test_bit(__E1000_RESETTING, &adapter->state) && count--)
6249 return __e1000_resume(pdev); 6309 usleep_range(10000, 20000);
6310
6311 WARN_ON(test_bit(__E1000_RESETTING, &adapter->state));
6312
6313 /* Down the device without resetting the hardware */
6314 e1000e_down(adapter, false);
6315 }
6316
6317 if (__e1000_shutdown(pdev, true)) {
6318 e1000e_pm_runtime_resume(dev);
6319 return -EBUSY;
6320 }
6321
6322 return 0;
6250} 6323}
6251#endif /* CONFIG_PM_RUNTIME */ 6324#endif /* CONFIG_PM_RUNTIME */
6252#endif /* CONFIG_PM */ 6325#endif /* CONFIG_PM */
6253 6326
6254static void e1000_shutdown(struct pci_dev *pdev) 6327static void e1000_shutdown(struct pci_dev *pdev)
6255{ 6328{
6329 e1000e_pm_freeze(&pdev->dev);
6330
6256 __e1000_shutdown(pdev, false); 6331 __e1000_shutdown(pdev, false);
6257} 6332}
6258 6333
@@ -6338,7 +6413,7 @@ static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev,
6338 return PCI_ERS_RESULT_DISCONNECT; 6413 return PCI_ERS_RESULT_DISCONNECT;
6339 6414
6340 if (netif_running(netdev)) 6415 if (netif_running(netdev))
6341 e1000e_down(adapter); 6416 e1000e_down(adapter, true);
6342 pci_disable_device(pdev); 6417 pci_disable_device(pdev);
6343 6418
6344 /* Request a slot slot reset. */ 6419 /* Request a slot slot reset. */
@@ -6350,7 +6425,7 @@ static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev,
6350 * @pdev: Pointer to PCI device 6425 * @pdev: Pointer to PCI device
6351 * 6426 *
6352 * Restart the card from scratch, as if from a cold-boot. Implementation 6427 * Restart the card from scratch, as if from a cold-boot. Implementation
6353 * resembles the first-half of the e1000_resume routine. 6428 * resembles the first-half of the e1000e_pm_resume routine.
6354 */ 6429 */
6355static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev) 6430static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev)
6356{ 6431{
@@ -6397,7 +6472,7 @@ static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev)
6397 * 6472 *
6398 * This callback is called when the error recovery driver tells us that 6473 * This callback is called when the error recovery driver tells us that
6399 * its OK to resume normal operation. Implementation resembles the 6474 * its OK to resume normal operation. Implementation resembles the
6400 * second-half of the e1000_resume routine. 6475 * second-half of the e1000e_pm_resume routine.
6401 */ 6476 */
6402static void e1000_io_resume(struct pci_dev *pdev) 6477static void e1000_io_resume(struct pci_dev *pdev)
6403{ 6478{
@@ -6902,9 +6977,6 @@ static void e1000_remove(struct pci_dev *pdev)
6902 } 6977 }
6903 } 6978 }
6904 6979
6905 if (!(netdev->flags & IFF_UP))
6906 e1000_power_down_phy(adapter);
6907
6908 /* Don't lie to e1000_close() down the road. */ 6980 /* Don't lie to e1000_close() down the road. */
6909 if (!down) 6981 if (!down)
6910 clear_bit(__E1000_DOWN, &adapter->state); 6982 clear_bit(__E1000_DOWN, &adapter->state);
@@ -7026,9 +7098,16 @@ static DEFINE_PCI_DEVICE_TABLE(e1000_pci_tbl) = {
7026MODULE_DEVICE_TABLE(pci, e1000_pci_tbl); 7098MODULE_DEVICE_TABLE(pci, e1000_pci_tbl);
7027 7099
7028static const struct dev_pm_ops e1000_pm_ops = { 7100static const struct dev_pm_ops e1000_pm_ops = {
7029 SET_SYSTEM_SLEEP_PM_OPS(e1000_suspend, e1000_resume) 7101#ifdef CONFIG_PM_SLEEP
7030 SET_RUNTIME_PM_OPS(e1000_runtime_suspend, e1000_runtime_resume, 7102 .suspend = e1000e_pm_suspend,
7031 e1000_idle) 7103 .resume = e1000e_pm_resume,
7104 .freeze = e1000e_pm_freeze,
7105 .thaw = e1000e_pm_thaw,
7106 .poweroff = e1000e_pm_suspend,
7107 .restore = e1000e_pm_resume,
7108#endif
7109 SET_RUNTIME_PM_OPS(e1000e_pm_runtime_suspend, e1000e_pm_runtime_resume,
7110 e1000e_pm_runtime_idle)
7032}; 7111};
7033 7112
7034/* PCI Device API Driver */ 7113/* PCI Device API Driver */
@@ -7055,7 +7134,7 @@ static int __init e1000_init_module(void)
7055 int ret; 7134 int ret;
7056 pr_info("Intel(R) PRO/1000 Network Driver - %s\n", 7135 pr_info("Intel(R) PRO/1000 Network Driver - %s\n",
7057 e1000e_driver_version); 7136 e1000e_driver_version);
7058 pr_info("Copyright(c) 1999 - 2013 Intel Corporation.\n"); 7137 pr_info("Copyright(c) 1999 - 2014 Intel Corporation.\n");
7059 ret = pci_register_driver(&e1000_driver); 7138 ret = pci_register_driver(&e1000_driver);
7060 7139
7061 return ret; 7140 return ret;
diff --git a/drivers/net/ethernet/intel/e1000e/nvm.c b/drivers/net/ethernet/intel/e1000e/nvm.c
index d70a03906ac0..a9a976f04bff 100644
--- a/drivers/net/ethernet/intel/e1000e/nvm.c
+++ b/drivers/net/ethernet/intel/e1000e/nvm.c
@@ -1,30 +1,23 @@
1/******************************************************************************* 1/* Intel PRO/1000 Linux driver
2 2 * Copyright(c) 1999 - 2014 Intel Corporation.
3 Intel PRO/1000 Linux driver 3 *
4 Copyright(c) 1999 - 2013 Intel Corporation. 4 * This program is free software; you can redistribute it and/or modify it
5 5 * under the terms and conditions of the GNU General Public License,
6 This program is free software; you can redistribute it and/or modify it 6 * version 2, as published by the Free Software Foundation.
7 under the terms and conditions of the GNU General Public License, 7 *
8 version 2, as published by the Free Software Foundation. 8 * This program is distributed in the hope it will be useful, but WITHOUT
9 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 This program is distributed in the hope it will be useful, but WITHOUT 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * more details.
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 *
13 more details. 13 * The full GNU General Public License is included in this distribution in
14 14 * the file called "COPYING".
15 You should have received a copy of the GNU General Public License along with 15 *
16 this program; if not, write to the Free Software Foundation, Inc., 16 * Contact Information:
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 17 * Linux NICS <linux.nics@intel.com>
18 18 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
19 The full GNU General Public License is included in this distribution in 19 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
20 the file called "COPYING". 20 */
21
22 Contact Information:
23 Linux NICS <linux.nics@intel.com>
24 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26
27*******************************************************************************/
28 21
29#include "e1000.h" 22#include "e1000.h"
30 23
diff --git a/drivers/net/ethernet/intel/e1000e/nvm.h b/drivers/net/ethernet/intel/e1000e/nvm.h
index 45fc69561627..342bf69efab5 100644
--- a/drivers/net/ethernet/intel/e1000e/nvm.h
+++ b/drivers/net/ethernet/intel/e1000e/nvm.h
@@ -1,30 +1,23 @@
1/******************************************************************************* 1/* Intel PRO/1000 Linux driver
2 2 * Copyright(c) 1999 - 2014 Intel Corporation.
3 Intel PRO/1000 Linux driver 3 *
4 Copyright(c) 1999 - 2013 Intel Corporation. 4 * This program is free software; you can redistribute it and/or modify it
5 5 * under the terms and conditions of the GNU General Public License,
6 This program is free software; you can redistribute it and/or modify it 6 * version 2, as published by the Free Software Foundation.
7 under the terms and conditions of the GNU General Public License, 7 *
8 version 2, as published by the Free Software Foundation. 8 * This program is distributed in the hope it will be useful, but WITHOUT
9 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 This program is distributed in the hope it will be useful, but WITHOUT 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * more details.
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 *
13 more details. 13 * The full GNU General Public License is included in this distribution in
14 14 * the file called "COPYING".
15 You should have received a copy of the GNU General Public License along with 15 *
16 this program; if not, write to the Free Software Foundation, Inc., 16 * Contact Information:
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 17 * Linux NICS <linux.nics@intel.com>
18 18 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
19 The full GNU General Public License is included in this distribution in 19 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
20 the file called "COPYING". 20 */
21
22 Contact Information:
23 Linux NICS <linux.nics@intel.com>
24 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26
27*******************************************************************************/
28 21
29#ifndef _E1000E_NVM_H_ 22#ifndef _E1000E_NVM_H_
30#define _E1000E_NVM_H_ 23#define _E1000E_NVM_H_
diff --git a/drivers/net/ethernet/intel/e1000e/param.c b/drivers/net/ethernet/intel/e1000e/param.c
index c16bd75b6caa..d0ac0f3249c8 100644
--- a/drivers/net/ethernet/intel/e1000e/param.c
+++ b/drivers/net/ethernet/intel/e1000e/param.c
@@ -1,30 +1,23 @@
1/******************************************************************************* 1/* Intel PRO/1000 Linux driver
2 2 * Copyright(c) 1999 - 2014 Intel Corporation.
3 Intel PRO/1000 Linux driver 3 *
4 Copyright(c) 1999 - 2013 Intel Corporation. 4 * This program is free software; you can redistribute it and/or modify it
5 5 * under the terms and conditions of the GNU General Public License,
6 This program is free software; you can redistribute it and/or modify it 6 * version 2, as published by the Free Software Foundation.
7 under the terms and conditions of the GNU General Public License, 7 *
8 version 2, as published by the Free Software Foundation. 8 * This program is distributed in the hope it will be useful, but WITHOUT
9 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 This program is distributed in the hope it will be useful, but WITHOUT 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * more details.
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 *
13 more details. 13 * The full GNU General Public License is included in this distribution in
14 14 * the file called "COPYING".
15 You should have received a copy of the GNU General Public License along with 15 *
16 this program; if not, write to the Free Software Foundation, Inc., 16 * Contact Information:
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 17 * Linux NICS <linux.nics@intel.com>
18 18 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
19 The full GNU General Public License is included in this distribution in 19 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
20 the file called "COPYING". 20 */
21
22 Contact Information:
23 Linux NICS <linux.nics@intel.com>
24 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26
27*******************************************************************************/
28 21
29#include <linux/netdevice.h> 22#include <linux/netdevice.h>
30#include <linux/module.h> 23#include <linux/module.h>
@@ -381,6 +374,12 @@ void e1000e_check_options(struct e1000_adapter *adapter)
381 "%s set to dynamic mode\n", opt.name); 374 "%s set to dynamic mode\n", opt.name);
382 adapter->itr = 20000; 375 adapter->itr = 20000;
383 break; 376 break;
377 case 2:
378 dev_info(&adapter->pdev->dev,
379 "%s Invalid mode - setting default\n",
380 opt.name);
381 adapter->itr_setting = opt.def;
382 /* fall-through */
384 case 3: 383 case 3:
385 dev_info(&adapter->pdev->dev, 384 dev_info(&adapter->pdev->dev,
386 "%s set to dynamic conservative mode\n", 385 "%s set to dynamic conservative mode\n",
diff --git a/drivers/net/ethernet/intel/e1000e/phy.c b/drivers/net/ethernet/intel/e1000e/phy.c
index 20e71f4ca426..00b3fc98bf30 100644
--- a/drivers/net/ethernet/intel/e1000e/phy.c
+++ b/drivers/net/ethernet/intel/e1000e/phy.c
@@ -1,30 +1,23 @@
1/******************************************************************************* 1/* Intel PRO/1000 Linux driver
2 2 * Copyright(c) 1999 - 2014 Intel Corporation.
3 Intel PRO/1000 Linux driver 3 *
4 Copyright(c) 1999 - 2013 Intel Corporation. 4 * This program is free software; you can redistribute it and/or modify it
5 5 * under the terms and conditions of the GNU General Public License,
6 This program is free software; you can redistribute it and/or modify it 6 * version 2, as published by the Free Software Foundation.
7 under the terms and conditions of the GNU General Public License, 7 *
8 version 2, as published by the Free Software Foundation. 8 * This program is distributed in the hope it will be useful, but WITHOUT
9 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 This program is distributed in the hope it will be useful, but WITHOUT 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * more details.
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 *
13 more details. 13 * The full GNU General Public License is included in this distribution in
14 14 * the file called "COPYING".
15 You should have received a copy of the GNU General Public License along with 15 *
16 this program; if not, write to the Free Software Foundation, Inc., 16 * Contact Information:
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 17 * Linux NICS <linux.nics@intel.com>
18 18 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
19 The full GNU General Public License is included in this distribution in 19 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
20 the file called "COPYING". 20 */
21
22 Contact Information:
23 Linux NICS <linux.nics@intel.com>
24 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26
27*******************************************************************************/
28 21
29#include "e1000.h" 22#include "e1000.h"
30 23
diff --git a/drivers/net/ethernet/intel/e1000e/phy.h b/drivers/net/ethernet/intel/e1000e/phy.h
index f4f71b9991e3..3841bccf058c 100644
--- a/drivers/net/ethernet/intel/e1000e/phy.h
+++ b/drivers/net/ethernet/intel/e1000e/phy.h
@@ -1,30 +1,23 @@
1/******************************************************************************* 1/* Intel PRO/1000 Linux driver
2 2 * Copyright(c) 1999 - 2014 Intel Corporation.
3 Intel PRO/1000 Linux driver 3 *
4 Copyright(c) 1999 - 2013 Intel Corporation. 4 * This program is free software; you can redistribute it and/or modify it
5 5 * under the terms and conditions of the GNU General Public License,
6 This program is free software; you can redistribute it and/or modify it 6 * version 2, as published by the Free Software Foundation.
7 under the terms and conditions of the GNU General Public License, 7 *
8 version 2, as published by the Free Software Foundation. 8 * This program is distributed in the hope it will be useful, but WITHOUT
9 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 This program is distributed in the hope it will be useful, but WITHOUT 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * more details.
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 *
13 more details. 13 * The full GNU General Public License is included in this distribution in
14 14 * the file called "COPYING".
15 You should have received a copy of the GNU General Public License along with 15 *
16 this program; if not, write to the Free Software Foundation, Inc., 16 * Contact Information:
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 17 * Linux NICS <linux.nics@intel.com>
18 18 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
19 The full GNU General Public License is included in this distribution in 19 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
20 the file called "COPYING". 20 */
21
22 Contact Information:
23 Linux NICS <linux.nics@intel.com>
24 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26
27*******************************************************************************/
28 21
29#ifndef _E1000E_PHY_H_ 22#ifndef _E1000E_PHY_H_
30#define _E1000E_PHY_H_ 23#define _E1000E_PHY_H_
diff --git a/drivers/net/ethernet/intel/e1000e/ptp.c b/drivers/net/ethernet/intel/e1000e/ptp.c
index 065f8c80d4f2..fb1a914a3ad4 100644
--- a/drivers/net/ethernet/intel/e1000e/ptp.c
+++ b/drivers/net/ethernet/intel/e1000e/ptp.c
@@ -1,30 +1,23 @@
1/******************************************************************************* 1/* Intel PRO/1000 Linux driver
2 2 * Copyright(c) 1999 - 2014 Intel Corporation.
3 Intel PRO/1000 Linux driver 3 *
4 Copyright(c) 1999 - 2013 Intel Corporation. 4 * This program is free software; you can redistribute it and/or modify it
5 5 * under the terms and conditions of the GNU General Public License,
6 This program is free software; you can redistribute it and/or modify it 6 * version 2, as published by the Free Software Foundation.
7 under the terms and conditions of the GNU General Public License, 7 *
8 version 2, as published by the Free Software Foundation. 8 * This program is distributed in the hope it will be useful, but WITHOUT
9 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 This program is distributed in the hope it will be useful, but WITHOUT 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * more details.
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 *
13 more details. 13 * The full GNU General Public License is included in this distribution in
14 14 * the file called "COPYING".
15 You should have received a copy of the GNU General Public License along with 15 *
16 this program; if not, write to the Free Software Foundation, Inc., 16 * Contact Information:
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 17 * Linux NICS <linux.nics@intel.com>
18 18 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
19 The full GNU General Public License is included in this distribution in 19 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
20 the file called "COPYING". 20 */
21
22 Contact Information:
23 Linux NICS <linux.nics@intel.com>
24 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26
27*******************************************************************************/
28 21
29/* PTP 1588 Hardware Clock (PHC) 22/* PTP 1588 Hardware Clock (PHC)
30 * Derived from PTP Hardware Clock driver for Intel 82576 and 82580 (igb) 23 * Derived from PTP Hardware Clock driver for Intel 82576 and 82580 (igb)
@@ -47,6 +40,7 @@ static int e1000e_phc_adjfreq(struct ptp_clock_info *ptp, s32 delta)
47 ptp_clock_info); 40 ptp_clock_info);
48 struct e1000_hw *hw = &adapter->hw; 41 struct e1000_hw *hw = &adapter->hw;
49 bool neg_adj = false; 42 bool neg_adj = false;
43 unsigned long flags;
50 u64 adjustment; 44 u64 adjustment;
51 u32 timinca, incvalue; 45 u32 timinca, incvalue;
52 s32 ret_val; 46 s32 ret_val;
@@ -64,6 +58,8 @@ static int e1000e_phc_adjfreq(struct ptp_clock_info *ptp, s32 delta)
64 if (ret_val) 58 if (ret_val)
65 return ret_val; 59 return ret_val;
66 60
61 spin_lock_irqsave(&adapter->systim_lock, flags);
62
67 incvalue = timinca & E1000_TIMINCA_INCVALUE_MASK; 63 incvalue = timinca & E1000_TIMINCA_INCVALUE_MASK;
68 64
69 adjustment = incvalue; 65 adjustment = incvalue;
@@ -77,6 +73,8 @@ static int e1000e_phc_adjfreq(struct ptp_clock_info *ptp, s32 delta)
77 73
78 ew32(TIMINCA, timinca); 74 ew32(TIMINCA, timinca);
79 75
76 spin_unlock_irqrestore(&adapter->systim_lock, flags);
77
80 return 0; 78 return 0;
81} 79}
82 80
@@ -191,6 +189,7 @@ static const struct ptp_clock_info e1000e_ptp_clock_info = {
191 .n_alarm = 0, 189 .n_alarm = 0,
192 .n_ext_ts = 0, 190 .n_ext_ts = 0,
193 .n_per_out = 0, 191 .n_per_out = 0,
192 .n_pins = 0,
194 .pps = 0, 193 .pps = 0,
195 .adjfreq = e1000e_phc_adjfreq, 194 .adjfreq = e1000e_phc_adjfreq,
196 .adjtime = e1000e_phc_adjtime, 195 .adjtime = e1000e_phc_adjtime,
diff --git a/drivers/net/ethernet/intel/e1000e/regs.h b/drivers/net/ethernet/intel/e1000e/regs.h
index a7e6a3e37257..ea235bbe50d3 100644
--- a/drivers/net/ethernet/intel/e1000e/regs.h
+++ b/drivers/net/ethernet/intel/e1000e/regs.h
@@ -1,30 +1,23 @@
1/******************************************************************************* 1/* Intel PRO/1000 Linux driver
2 2 * Copyright(c) 1999 - 2014 Intel Corporation.
3 Intel PRO/1000 Linux driver 3 *
4 Copyright(c) 1999 - 2013 Intel Corporation. 4 * This program is free software; you can redistribute it and/or modify it
5 5 * under the terms and conditions of the GNU General Public License,
6 This program is free software; you can redistribute it and/or modify it 6 * version 2, as published by the Free Software Foundation.
7 under the terms and conditions of the GNU General Public License, 7 *
8 version 2, as published by the Free Software Foundation. 8 * This program is distributed in the hope it will be useful, but WITHOUT
9 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 This program is distributed in the hope it will be useful, but WITHOUT 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * more details.
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 *
13 more details. 13 * The full GNU General Public License is included in this distribution in
14 14 * the file called "COPYING".
15 You should have received a copy of the GNU General Public License along with 15 *
16 this program; if not, write to the Free Software Foundation, Inc., 16 * Contact Information:
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 17 * Linux NICS <linux.nics@intel.com>
18 18 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
19 The full GNU General Public License is included in this distribution in 19 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
20 the file called "COPYING". 20 */
21
22 Contact Information:
23 Linux NICS <linux.nics@intel.com>
24 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26
27*******************************************************************************/
28 21
29#ifndef _E1000E_REGS_H_ 22#ifndef _E1000E_REGS_H_
30#define _E1000E_REGS_H_ 23#define _E1000E_REGS_H_
@@ -39,6 +32,7 @@
39#define E1000_SCTL 0x00024 /* SerDes Control - RW */ 32#define E1000_SCTL 0x00024 /* SerDes Control - RW */
40#define E1000_FCAL 0x00028 /* Flow Control Address Low - RW */ 33#define E1000_FCAL 0x00028 /* Flow Control Address Low - RW */
41#define E1000_FCAH 0x0002C /* Flow Control Address High -RW */ 34#define E1000_FCAH 0x0002C /* Flow Control Address High -RW */
35#define E1000_FEXT 0x0002C /* Future Extended - RW */
42#define E1000_FEXTNVM 0x00028 /* Future Extended NVM - RW */ 36#define E1000_FEXTNVM 0x00028 /* Future Extended NVM - RW */
43#define E1000_FEXTNVM3 0x0003C /* Future Extended NVM 3 - RW */ 37#define E1000_FEXTNVM3 0x0003C /* Future Extended NVM 3 - RW */
44#define E1000_FEXTNVM4 0x00024 /* Future Extended NVM 4 - RW */ 38#define E1000_FEXTNVM4 0x00024 /* Future Extended NVM 4 - RW */