Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next

Jeff Kirsher says:

====================
Intel Wired LAN Driver Updates

This series contains updates to e1000e, ixgbevf and igb.

Majority of this series contains fixes and cleanups to e1000e,
most notably are:

Todd provides a fix to PTP in e1000e which adds a lock in e1000e_phc_adjfreq
to prevent concurrent changes to TIMINCA and SYSTIMH/L. Then provides an
igb fix to use ARRAY_SIZE for array size calculation.

David provides the remaining e1000e which contain:
- cleanup of pointer references that are no longer used
- fix an issue on systems with Management Engine enabled with the
ethernet cable unplugged
- fix an issue on 82579 where enabling EEE LPI sooner than one second
after link up causes link issues on some switches
- refactor the power management flows to prevent the suspend path from
being executed twice when hibernating
- refactor the runtime power management to fix interfering with the
functionality of Energy Efficient Ethernet when enabled and to fix
the device from repeatedly flip between suspend and resume with the
interface administratively downed
- enable the feature PHY Ultra Low Power Mode which is a power saving
feature that reduces the power consumption of the PHY when a cable is
not connected
- fix the ethtool offline tests for 82579 parts
- fix SHRA register access for 82579 parts which was introduced by
previous commit c3a0dce35af0 "e1000e: fix overrun of PHY RAR array"

Florian provides a fix for ixgbevf where skb->pkt_type was being checked
like a bitmask, but it is not a bitmask.

Fix an issue reported by Stephen Hemminger where there was a warning
about code defined but never used if IGB_HWMON is not defined.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+1011 -746
+20 -27
drivers/net/ethernet/intel/e1000e/80003es2lan.c
··· 1 - /******************************************************************************* 2 - 3 - Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2013 Intel Corporation. 5 - 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, 8 - version 2, as published by the Free Software Foundation. 9 - 10 - This program is distributed in the hope it will be useful, but WITHOUT 11 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 - more details. 14 - 15 - You should have received a copy of the GNU General Public License along with 16 - this program; if not, write to the Free Software Foundation, Inc., 17 - 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 18 - 19 - The full GNU General Public License is included in this distribution in 20 - the file called "COPYING". 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 - *******************************************************************************/ 1 + /* Intel PRO/1000 Linux driver 2 + * Copyright(c) 1999 - 2014 Intel Corporation. 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms and conditions of the GNU General Public License, 6 + * version 2, as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope it will be useful, but WITHOUT 9 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 + * more details. 12 + * 13 + * The full GNU General Public License is included in this distribution in 14 + * the file called "COPYING". 15 + * 16 + * Contact Information: 17 + * Linux NICS <linux.nics@intel.com> 18 + * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 19 + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 20 + */ 28 21 29 22 /* 80003ES2LAN Gigabit Ethernet Controller (Copper) 30 23 * 80003ES2LAN Gigabit Ethernet Controller (Serdes)
+20 -27
drivers/net/ethernet/intel/e1000e/80003es2lan.h
··· 1 - /******************************************************************************* 2 - 3 - Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2013 Intel Corporation. 5 - 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, 8 - version 2, as published by the Free Software Foundation. 9 - 10 - This program is distributed in the hope it will be useful, but WITHOUT 11 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 - more details. 14 - 15 - You should have received a copy of the GNU General Public License along with 16 - this program; if not, write to the Free Software Foundation, Inc., 17 - 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 18 - 19 - The full GNU General Public License is included in this distribution in 20 - the file called "COPYING". 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 - *******************************************************************************/ 1 + /* Intel PRO/1000 Linux driver 2 + * Copyright(c) 1999 - 2014 Intel Corporation. 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms and conditions of the GNU General Public License, 6 + * version 2, as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope it will be useful, but WITHOUT 9 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 + * more details. 12 + * 13 + * The full GNU General Public License is included in this distribution in 14 + * the file called "COPYING". 15 + * 16 + * Contact Information: 17 + * Linux NICS <linux.nics@intel.com> 18 + * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 19 + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 20 + */ 28 21 29 22 #ifndef _E1000E_80003ES2LAN_H_ 30 23 #define _E1000E_80003ES2LAN_H_
+20 -27
drivers/net/ethernet/intel/e1000e/82571.c
··· 1 - /******************************************************************************* 2 - 3 - Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2013 Intel Corporation. 5 - 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, 8 - version 2, as published by the Free Software Foundation. 9 - 10 - This program is distributed in the hope it will be useful, but WITHOUT 11 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 - more details. 14 - 15 - You should have received a copy of the GNU General Public License along with 16 - this program; if not, write to the Free Software Foundation, Inc., 17 - 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 18 - 19 - The full GNU General Public License is included in this distribution in 20 - the file called "COPYING". 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 - *******************************************************************************/ 1 + /* Intel PRO/1000 Linux driver 2 + * Copyright(c) 1999 - 2014 Intel Corporation. 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms and conditions of the GNU General Public License, 6 + * version 2, as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope it will be useful, but WITHOUT 9 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 + * more details. 12 + * 13 + * The full GNU General Public License is included in this distribution in 14 + * the file called "COPYING". 15 + * 16 + * Contact Information: 17 + * Linux NICS <linux.nics@intel.com> 18 + * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 19 + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 20 + */ 28 21 29 22 /* 82571EB Gigabit Ethernet Controller 30 23 * 82571EB Gigabit Ethernet Controller (Copper)
+20 -27
drivers/net/ethernet/intel/e1000e/82571.h
··· 1 - /******************************************************************************* 2 - 3 - Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2013 Intel Corporation. 5 - 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, 8 - version 2, as published by the Free Software Foundation. 9 - 10 - This program is distributed in the hope it will be useful, but WITHOUT 11 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 - more details. 14 - 15 - You should have received a copy of the GNU General Public License along with 16 - this program; if not, write to the Free Software Foundation, Inc., 17 - 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 18 - 19 - The full GNU General Public License is included in this distribution in 20 - the file called "COPYING". 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 - *******************************************************************************/ 1 + /* Intel PRO/1000 Linux driver 2 + * Copyright(c) 1999 - 2014 Intel Corporation. 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms and conditions of the GNU General Public License, 6 + * version 2, as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope it will be useful, but WITHOUT 9 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 + * more details. 12 + * 13 + * The full GNU General Public License is included in this distribution in 14 + * the file called "COPYING". 15 + * 16 + * Contact Information: 17 + * Linux NICS <linux.nics@intel.com> 18 + * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 19 + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 20 + */ 28 21 29 22 #ifndef _E1000E_82571_H_ 30 23 #define _E1000E_82571_H_
+3 -4
drivers/net/ethernet/intel/e1000e/Makefile
··· 1 1 ################################################################################ 2 2 # 3 3 # Intel PRO/1000 Linux driver 4 - # Copyright(c) 1999 - 2013 Intel Corporation. 4 + # Copyright(c) 1999 - 2014 Intel Corporation. 5 5 # 6 6 # This program is free software; you can redistribute it and/or modify it 7 7 # under the terms and conditions of the GNU General Public License, ··· 12 12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 13 # more details. 14 14 # 15 - # You should have received a copy of the GNU General Public License along with 16 - # this program; if not, write to the Free Software Foundation, Inc., 17 - # 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 15 + # You should have received a copy of the GNU General Public License 16 + # along with this program; if not, see <http://www.gnu.org/licenses/>. 18 17 # 19 18 # The full GNU General Public License is included in this distribution in 20 19 # the file called "COPYING".
+25 -30
drivers/net/ethernet/intel/e1000e/defines.h
··· 1 - /******************************************************************************* 2 - 3 - Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2013 Intel Corporation. 5 - 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, 8 - version 2, as published by the Free Software Foundation. 9 - 10 - This program is distributed in the hope it will be useful, but WITHOUT 11 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 - more details. 14 - 15 - You should have received a copy of the GNU General Public License along with 16 - this program; if not, write to the Free Software Foundation, Inc., 17 - 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 18 - 19 - The full GNU General Public License is included in this distribution in 20 - the file called "COPYING". 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 - *******************************************************************************/ 1 + /* Intel PRO/1000 Linux driver 2 + * Copyright(c) 1999 - 2014 Intel Corporation. 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms and conditions of the GNU General Public License, 6 + * version 2, as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope it will be useful, but WITHOUT 9 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 + * more details. 12 + * 13 + * The full GNU General Public License is included in this distribution in 14 + * the file called "COPYING". 15 + * 16 + * Contact Information: 17 + * Linux NICS <linux.nics@intel.com> 18 + * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 19 + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 20 + */ 28 21 29 22 #ifndef _E1000_DEFINES_H_ 30 23 #define _E1000_DEFINES_H_ ··· 28 35 29 36 /* Definitions for power management and wakeup registers */ 30 37 /* Wake Up Control */ 31 - #define E1000_WUC_APME 0x00000001 /* APM Enable */ 32 - #define E1000_WUC_PME_EN 0x00000002 /* PME Enable */ 33 - #define E1000_WUC_PHY_WAKE 0x00000100 /* if PHY supports wakeup */ 38 + #define E1000_WUC_APME 0x00000001 /* APM Enable */ 39 + #define E1000_WUC_PME_EN 0x00000002 /* PME Enable */ 40 + #define E1000_WUC_PME_STATUS 0x00000004 /* PME Status */ 41 + #define E1000_WUC_APMPME 0x00000008 /* Assert PME on APM Wakeup */ 42 + #define E1000_WUC_PHY_WAKE 0x00000100 /* if PHY supports wakeup */ 34 43 35 44 /* Wake Up Filter Control */ 36 45 #define E1000_WUFC_LNKC 0x00000001 /* Link Status Change Wakeup Enable */
+21 -29
drivers/net/ethernet/intel/e1000e/e1000.h
··· 1 - /******************************************************************************* 2 - 3 - Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2013 Intel Corporation. 5 - 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, 8 - version 2, as published by the Free Software Foundation. 9 - 10 - This program is distributed in the hope it will be useful, but WITHOUT 11 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 - more details. 14 - 15 - You should have received a copy of the GNU General Public License along with 16 - this program; if not, write to the Free Software Foundation, Inc., 17 - 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 18 - 19 - The full GNU General Public License is included in this distribution in 20 - the file called "COPYING". 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 - *******************************************************************************/ 1 + /* Intel PRO/1000 Linux driver 2 + * Copyright(c) 1999 - 2014 Intel Corporation. 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms and conditions of the GNU General Public License, 6 + * version 2, as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope it will be useful, but WITHOUT 9 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 + * more details. 12 + * 13 + * The full GNU General Public License is included in this distribution in 14 + * the file called "COPYING". 15 + * 16 + * Contact Information: 17 + * Linux NICS <linux.nics@intel.com> 18 + * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 19 + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 20 + */ 28 21 29 22 /* Linux PRO/1000 Ethernet Driver main header file */ 30 23 ··· 326 333 struct work_struct update_phy_task; 327 334 struct work_struct print_hang_task; 328 335 329 - bool idle_check; 330 336 int phy_hang_count; 331 337 332 338 u16 tx_ring_count; ··· 468 476 void e1000e_set_ethtool_ops(struct net_device *netdev); 469 477 470 478 int e1000e_up(struct e1000_adapter *adapter); 471 - void e1000e_down(struct e1000_adapter *adapter); 479 + void e1000e_down(struct e1000_adapter *adapter, bool reset); 472 480 void e1000e_reinit_locked(struct e1000_adapter *adapter); 473 481 void e1000e_reset(struct e1000_adapter *adapter); 474 482 void e1000e_power_up_phy(struct e1000_adapter *adapter);
+31 -32
drivers/net/ethernet/intel/e1000e/ethtool.c
··· 1 - /******************************************************************************* 2 - 3 - Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2013 Intel Corporation. 5 - 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, 8 - version 2, as published by the Free Software Foundation. 9 - 10 - This program is distributed in the hope it will be useful, but WITHOUT 11 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 - more details. 14 - 15 - You should have received a copy of the GNU General Public License along with 16 - this program; if not, write to the Free Software Foundation, Inc., 17 - 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 18 - 19 - The full GNU General Public License is included in this distribution in 20 - the file called "COPYING". 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 - *******************************************************************************/ 1 + /* Intel PRO/1000 Linux driver 2 + * Copyright(c) 1999 - 2014 Intel Corporation. 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms and conditions of the GNU General Public License, 6 + * version 2, as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope it will be useful, but WITHOUT 9 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 + * more details. 12 + * 13 + * The full GNU General Public License is included in this distribution in 14 + * the file called "COPYING". 15 + * 16 + * Contact Information: 17 + * Linux NICS <linux.nics@intel.com> 18 + * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 19 + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 20 + */ 28 21 29 22 /* ethtool support for e1000 */ 30 23 ··· 325 332 326 333 /* reset the link */ 327 334 if (netif_running(adapter->netdev)) { 328 - e1000e_down(adapter); 335 + e1000e_down(adapter, true); 329 336 e1000e_up(adapter); 330 337 } else { 331 338 e1000e_reset(adapter); ··· 373 380 if (adapter->fc_autoneg == AUTONEG_ENABLE) { 374 381 hw->fc.requested_mode = e1000_fc_default; 375 382 if (netif_running(adapter->netdev)) { 376 - e1000e_down(adapter); 383 + e1000e_down(adapter, true); 377 384 e1000e_up(adapter); 378 385 } else { 379 386 e1000e_reset(adapter); ··· 719 726 720 727 pm_runtime_get_sync(netdev->dev.parent); 721 728 722 - e1000e_down(adapter); 729 + e1000e_down(adapter, true); 723 730 724 731 /* We can't just free everything and then setup again, because the 725 732 * ISRs in MSI-X mode get passed pointers to the Tx and Rx ring ··· 917 924 } 918 925 if (mac->type == e1000_pch2lan) { 919 926 /* SHRAH[0,1,2] different than previous */ 920 - if (i == 7) 927 + if (i == 1) 921 928 mask &= 0xFFF4FFFF; 922 929 /* SHRAH[3] different than SHRAH[0,1,2] */ 923 - if (i == 10) 930 + if (i == 4) 924 931 mask |= (1 << 30); 932 + /* RAR[1-6] owned by management engine - skipping */ 933 + if (i > 0) 934 + i += 6; 925 935 } 926 936 927 937 REG_PATTERN_TEST_ARRAY(E1000_RA, ((i << 1) + 1), mask, 928 938 0xFFFFFFFF); 939 + /* reset index to actual value */ 940 + if ((mac->type == e1000_pch2lan) && (i > 6)) 941 + i -= 6; 929 942 } 930 943 931 944 for (i = 0; i < mac->mta_reg_count; i++)
+28 -27
drivers/net/ethernet/intel/e1000e/hw.h
··· 1 - /******************************************************************************* 2 - 3 - Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2013 Intel Corporation. 5 - 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, 8 - version 2, as published by the Free Software Foundation. 9 - 10 - This program is distributed in the hope it will be useful, but WITHOUT 11 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 - more details. 14 - 15 - You should have received a copy of the GNU General Public License along with 16 - this program; if not, write to the Free Software Foundation, Inc., 17 - 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 18 - 19 - The full GNU General Public License is included in this distribution in 20 - the file called "COPYING". 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 - *******************************************************************************/ 1 + /* Intel PRO/1000 Linux driver 2 + * Copyright(c) 1999 - 2014 Intel Corporation. 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms and conditions of the GNU General Public License, 6 + * version 2, as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope it will be useful, but WITHOUT 9 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 + * more details. 12 + * 13 + * The full GNU General Public License is included in this distribution in 14 + * the file called "COPYING". 15 + * 16 + * Contact Information: 17 + * Linux NICS <linux.nics@intel.com> 18 + * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 19 + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 20 + */ 28 21 29 22 #ifndef _E1000_HW_H_ 30 23 #define _E1000_HW_H_ ··· 648 655 649 656 #define E1000_ICH8_SHADOW_RAM_WORDS 2048 650 657 658 + /* I218 PHY Ultra Low Power (ULP) states */ 659 + enum e1000_ulp_state { 660 + e1000_ulp_state_unknown, 661 + e1000_ulp_state_off, 662 + e1000_ulp_state_on, 663 + }; 664 + 651 665 struct e1000_dev_spec_ich8lan { 652 666 bool kmrn_lock_loss_workaround_enabled; 653 667 struct e1000_shadow_ram shadow_ram[E1000_ICH8_SHADOW_RAM_WORDS]; 654 668 bool nvm_k1_enabled; 655 669 bool eee_disable; 656 670 u16 eee_lp_ability; 671 + enum e1000_ulp_state ulp_state; 657 672 }; 658 673 659 674 struct e1000_hw {
+365 -62
drivers/net/ethernet/intel/e1000e/ich8lan.c
··· 1 - /******************************************************************************* 2 - 3 - Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2013 Intel Corporation. 5 - 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, 8 - version 2, as published by the Free Software Foundation. 9 - 10 - This program is distributed in the hope it will be useful, but WITHOUT 11 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 - more details. 14 - 15 - You should have received a copy of the GNU General Public License along with 16 - this program; if not, write to the Free Software Foundation, Inc., 17 - 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 18 - 19 - The full GNU General Public License is included in this distribution in 20 - the file called "COPYING". 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 - *******************************************************************************/ 1 + /* Intel PRO/1000 Linux driver 2 + * Copyright(c) 1999 - 2014 Intel Corporation. 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms and conditions of the GNU General Public License, 6 + * version 2, as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope it will be useful, but WITHOUT 9 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 + * more details. 12 + * 13 + * The full GNU General Public License is included in this distribution in 14 + * the file called "COPYING". 15 + * 16 + * Contact Information: 17 + * Linux NICS <linux.nics@intel.com> 18 + * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 19 + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 20 + */ 28 21 29 22 /* 82562G 10/100 Network Connection 30 23 * 82562G-2 10/100 Network Connection ··· 46 53 * 82578DC Gigabit Network Connection 47 54 * 82579LM Gigabit Network Connection 48 55 * 82579V Gigabit Network Connection 56 + * Ethernet Connection I217-LM 57 + * Ethernet Connection I217-V 58 + * Ethernet Connection I218-V 59 + * Ethernet Connection I218-LM 60 + * Ethernet Connection (2) I218-LM 61 + * Ethernet Connection (2) I218-V 62 + * Ethernet Connection (3) I218-LM 63 + * Ethernet Connection (3) I218-V 49 64 */ 50 65 51 66 #include "e1000.h" ··· 143 142 static void e1000_rar_set_pch_lpt(struct e1000_hw *hw, u8 *addr, u32 index); 144 143 static s32 e1000_k1_workaround_lv(struct e1000_hw *hw); 145 144 static void e1000_gate_hw_phy_config_ich8lan(struct e1000_hw *hw, bool gate); 145 + static s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force); 146 146 static s32 e1000_setup_copper_link_pch_lpt(struct e1000_hw *hw); 147 + static s32 e1000_oem_bits_config_ich8lan(struct e1000_hw *hw, bool d0_state); 147 148 148 149 static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg) 149 150 { ··· 242 239 } 243 240 244 241 /** 242 + * e1000_toggle_lanphypc_pch_lpt - toggle the LANPHYPC pin value 243 + * @hw: pointer to the HW structure 244 + * 245 + * Toggling the LANPHYPC pin value fully power-cycles the PHY and is 246 + * used to reset the PHY to a quiescent state when necessary. 247 + **/ 248 + static void e1000_toggle_lanphypc_pch_lpt(struct e1000_hw *hw) 249 + { 250 + u32 mac_reg; 251 + 252 + /* Set Phy Config Counter to 50msec */ 253 + mac_reg = er32(FEXTNVM3); 254 + mac_reg &= ~E1000_FEXTNVM3_PHY_CFG_COUNTER_MASK; 255 + mac_reg |= E1000_FEXTNVM3_PHY_CFG_COUNTER_50MSEC; 256 + ew32(FEXTNVM3, mac_reg); 257 + 258 + /* Toggle LANPHYPC Value bit */ 259 + mac_reg = er32(CTRL); 260 + mac_reg |= E1000_CTRL_LANPHYPC_OVERRIDE; 261 + mac_reg &= ~E1000_CTRL_LANPHYPC_VALUE; 262 + ew32(CTRL, mac_reg); 263 + e1e_flush(); 264 + usleep_range(10, 20); 265 + mac_reg &= ~E1000_CTRL_LANPHYPC_OVERRIDE; 266 + ew32(CTRL, mac_reg); 267 + e1e_flush(); 268 + 269 + if (hw->mac.type < e1000_pch_lpt) { 270 + msleep(50); 271 + } else { 272 + u16 count = 20; 273 + 274 + do { 275 + usleep_range(5000, 10000); 276 + } while (!(er32(CTRL_EXT) & E1000_CTRL_EXT_LPCD) && count--); 277 + 278 + msleep(30); 279 + } 280 + } 281 + 282 + /** 245 283 * e1000_init_phy_workarounds_pchlan - PHY initialization workarounds 246 284 * @hw: pointer to the HW structure 247 285 * ··· 291 247 **/ 292 248 static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw) 293 249 { 250 + struct e1000_adapter *adapter = hw->adapter; 294 251 u32 mac_reg, fwsm = er32(FWSM); 295 252 s32 ret_val; 296 253 ··· 299 254 * non-managed 82579 and newer adapters. 300 255 */ 301 256 e1000_gate_hw_phy_config_ich8lan(hw, true); 257 + 258 + /* It is not possible to be certain of the current state of ULP 259 + * so forcibly disable it. 260 + */ 261 + hw->dev_spec.ich8lan.ulp_state = e1000_ulp_state_unknown; 262 + e1000_disable_ulp_lpt_lp(hw, true); 302 263 303 264 ret_val = hw->phy.ops.acquire(hw); 304 265 if (ret_val) { ··· 351 300 break; 352 301 } 353 302 354 - e_dbg("Toggling LANPHYPC\n"); 355 - 356 - /* Set Phy Config Counter to 50msec */ 357 - mac_reg = er32(FEXTNVM3); 358 - mac_reg &= ~E1000_FEXTNVM3_PHY_CFG_COUNTER_MASK; 359 - mac_reg |= E1000_FEXTNVM3_PHY_CFG_COUNTER_50MSEC; 360 - ew32(FEXTNVM3, mac_reg); 361 - 362 303 /* Toggle LANPHYPC Value bit */ 363 - mac_reg = er32(CTRL); 364 - mac_reg |= E1000_CTRL_LANPHYPC_OVERRIDE; 365 - mac_reg &= ~E1000_CTRL_LANPHYPC_VALUE; 366 - ew32(CTRL, mac_reg); 367 - e1e_flush(); 368 - usleep_range(10, 20); 369 - mac_reg &= ~E1000_CTRL_LANPHYPC_OVERRIDE; 370 - ew32(CTRL, mac_reg); 371 - e1e_flush(); 372 - if (hw->mac.type < e1000_pch_lpt) { 373 - msleep(50); 374 - } else { 375 - u16 count = 20; 376 - do { 377 - usleep_range(5000, 10000); 378 - } while (!(er32(CTRL_EXT) & 379 - E1000_CTRL_EXT_LPCD) && count--); 380 - usleep_range(30000, 60000); 304 + e1000_toggle_lanphypc_pch_lpt(hw); 305 + if (hw->mac.type >= e1000_pch_lpt) { 381 306 if (e1000_phy_is_accessible_pchlan(hw)) 382 307 break; 383 308 ··· 376 349 377 350 hw->phy.ops.release(hw); 378 351 if (!ret_val) { 352 + 353 + /* Check to see if able to reset PHY. Print error if not */ 354 + if (hw->phy.ops.check_reset_block(hw)) { 355 + e_err("Reset blocked by ME\n"); 356 + goto out; 357 + } 358 + 379 359 /* Reset the PHY before any access to it. Doing so, ensures 380 360 * that the PHY is in a known good state before we read/write 381 361 * PHY registers. The generic reset is sufficient here, 382 362 * because we haven't determined the PHY type yet. 383 363 */ 384 364 ret_val = e1000e_phy_hw_reset_generic(hw); 365 + if (ret_val) 366 + goto out; 367 + 368 + /* On a successful reset, possibly need to wait for the PHY 369 + * to quiesce to an accessible state before returning control 370 + * to the calling function. If the PHY does not quiesce, then 371 + * return E1000E_BLK_PHY_RESET, as this is the condition that 372 + * the PHY is in. 373 + */ 374 + ret_val = hw->phy.ops.check_reset_block(hw); 375 + if (ret_val) 376 + e_err("ME blocked access to PHY after reset\n"); 385 377 } 386 378 387 379 out: ··· 770 724 * Enable/disable EEE based on setting in dev_spec structure, the duplex of 771 725 * the link and the EEE capabilities of the link partner. The LPI Control 772 726 * register bits will remain set only if/when link is up. 727 + * 728 + * EEE LPI must not be asserted earlier than one second after link is up. 729 + * On 82579, EEE LPI should not be enabled until such time otherwise there 730 + * can be link issues with some switches. Other devices can have EEE LPI 731 + * enabled immediately upon link up since they have a timer in hardware which 732 + * prevents LPI from being asserted too early. 773 733 **/ 774 - static s32 e1000_set_eee_pchlan(struct e1000_hw *hw) 734 + s32 e1000_set_eee_pchlan(struct e1000_hw *hw) 775 735 { 776 736 struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan; 777 737 s32 ret_val; ··· 1031 979 } 1032 980 1033 981 /** 982 + * e1000_enable_ulp_lpt_lp - configure Ultra Low Power mode for LynxPoint-LP 983 + * @hw: pointer to the HW structure 984 + * @to_sx: boolean indicating a system power state transition to Sx 985 + * 986 + * When link is down, configure ULP mode to significantly reduce the power 987 + * to the PHY. If on a Manageability Engine (ME) enabled system, tell the 988 + * ME firmware to start the ULP configuration. If not on an ME enabled 989 + * system, configure the ULP mode by software. 990 + */ 991 + s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx) 992 + { 993 + u32 mac_reg; 994 + s32 ret_val = 0; 995 + u16 phy_reg; 996 + 997 + if ((hw->mac.type < e1000_pch_lpt) || 998 + (hw->adapter->pdev->device == E1000_DEV_ID_PCH_LPT_I217_LM) || 999 + (hw->adapter->pdev->device == E1000_DEV_ID_PCH_LPT_I217_V) || 1000 + (hw->adapter->pdev->device == E1000_DEV_ID_PCH_I218_LM2) || 1001 + (hw->adapter->pdev->device == E1000_DEV_ID_PCH_I218_V2) || 1002 + (hw->dev_spec.ich8lan.ulp_state == e1000_ulp_state_on)) 1003 + return 0; 1004 + 1005 + if (er32(FWSM) & E1000_ICH_FWSM_FW_VALID) { 1006 + /* Request ME configure ULP mode in the PHY */ 1007 + mac_reg = er32(H2ME); 1008 + mac_reg |= E1000_H2ME_ULP | E1000_H2ME_ENFORCE_SETTINGS; 1009 + ew32(H2ME, mac_reg); 1010 + 1011 + goto out; 1012 + } 1013 + 1014 + if (!to_sx) { 1015 + int i = 0; 1016 + 1017 + /* Poll up to 5 seconds for Cable Disconnected indication */ 1018 + while (!(er32(FEXT) & E1000_FEXT_PHY_CABLE_DISCONNECTED)) { 1019 + /* Bail if link is re-acquired */ 1020 + if (er32(STATUS) & E1000_STATUS_LU) 1021 + return -E1000_ERR_PHY; 1022 + 1023 + if (i++ == 100) 1024 + break; 1025 + 1026 + msleep(50); 1027 + } 1028 + e_dbg("CABLE_DISCONNECTED %s set after %dmsec\n", 1029 + (er32(FEXT) & 1030 + E1000_FEXT_PHY_CABLE_DISCONNECTED) ? "" : "not", i * 50); 1031 + } 1032 + 1033 + ret_val = hw->phy.ops.acquire(hw); 1034 + if (ret_val) 1035 + goto out; 1036 + 1037 + /* Force SMBus mode in PHY */ 1038 + ret_val = e1000_read_phy_reg_hv_locked(hw, CV_SMB_CTRL, &phy_reg); 1039 + if (ret_val) 1040 + goto release; 1041 + phy_reg |= CV_SMB_CTRL_FORCE_SMBUS; 1042 + e1000_write_phy_reg_hv_locked(hw, CV_SMB_CTRL, phy_reg); 1043 + 1044 + /* Force SMBus mode in MAC */ 1045 + mac_reg = er32(CTRL_EXT); 1046 + mac_reg |= E1000_CTRL_EXT_FORCE_SMBUS; 1047 + ew32(CTRL_EXT, mac_reg); 1048 + 1049 + /* Set Inband ULP Exit, Reset to SMBus mode and 1050 + * Disable SMBus Release on PERST# in PHY 1051 + */ 1052 + ret_val = e1000_read_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, &phy_reg); 1053 + if (ret_val) 1054 + goto release; 1055 + phy_reg |= (I218_ULP_CONFIG1_RESET_TO_SMBUS | 1056 + I218_ULP_CONFIG1_DISABLE_SMB_PERST); 1057 + if (to_sx) { 1058 + if (er32(WUFC) & E1000_WUFC_LNKC) 1059 + phy_reg |= I218_ULP_CONFIG1_WOL_HOST; 1060 + 1061 + phy_reg |= I218_ULP_CONFIG1_STICKY_ULP; 1062 + } else { 1063 + phy_reg |= I218_ULP_CONFIG1_INBAND_EXIT; 1064 + } 1065 + e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg); 1066 + 1067 + /* Set Disable SMBus Release on PERST# in MAC */ 1068 + mac_reg = er32(FEXTNVM7); 1069 + mac_reg |= E1000_FEXTNVM7_DISABLE_SMB_PERST; 1070 + ew32(FEXTNVM7, mac_reg); 1071 + 1072 + /* Commit ULP changes in PHY by starting auto ULP configuration */ 1073 + phy_reg |= I218_ULP_CONFIG1_START; 1074 + e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg); 1075 + release: 1076 + hw->phy.ops.release(hw); 1077 + out: 1078 + if (ret_val) 1079 + e_dbg("Error in ULP enable flow: %d\n", ret_val); 1080 + else 1081 + hw->dev_spec.ich8lan.ulp_state = e1000_ulp_state_on; 1082 + 1083 + return ret_val; 1084 + } 1085 + 1086 + /** 1087 + * e1000_disable_ulp_lpt_lp - unconfigure Ultra Low Power mode for LynxPoint-LP 1088 + * @hw: pointer to the HW structure 1089 + * @force: boolean indicating whether or not to force disabling ULP 1090 + * 1091 + * Un-configure ULP mode when link is up, the system is transitioned from 1092 + * Sx or the driver is unloaded. If on a Manageability Engine (ME) enabled 1093 + * system, poll for an indication from ME that ULP has been un-configured. 1094 + * If not on an ME enabled system, un-configure the ULP mode by software. 1095 + * 1096 + * During nominal operation, this function is called when link is acquired 1097 + * to disable ULP mode (force=false); otherwise, for example when unloading 1098 + * the driver or during Sx->S0 transitions, this is called with force=true 1099 + * to forcibly disable ULP. 1100 + */ 1101 + static s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force) 1102 + { 1103 + s32 ret_val = 0; 1104 + u32 mac_reg; 1105 + u16 phy_reg; 1106 + int i = 0; 1107 + 1108 + if ((hw->mac.type < e1000_pch_lpt) || 1109 + (hw->adapter->pdev->device == E1000_DEV_ID_PCH_LPT_I217_LM) || 1110 + (hw->adapter->pdev->device == E1000_DEV_ID_PCH_LPT_I217_V) || 1111 + (hw->adapter->pdev->device == E1000_DEV_ID_PCH_I218_LM2) || 1112 + (hw->adapter->pdev->device == E1000_DEV_ID_PCH_I218_V2) || 1113 + (hw->dev_spec.ich8lan.ulp_state == e1000_ulp_state_off)) 1114 + return 0; 1115 + 1116 + if (er32(FWSM) & E1000_ICH_FWSM_FW_VALID) { 1117 + if (force) { 1118 + /* Request ME un-configure ULP mode in the PHY */ 1119 + mac_reg = er32(H2ME); 1120 + mac_reg &= ~E1000_H2ME_ULP; 1121 + mac_reg |= E1000_H2ME_ENFORCE_SETTINGS; 1122 + ew32(H2ME, mac_reg); 1123 + } 1124 + 1125 + /* Poll up to 100msec for ME to clear ULP_CFG_DONE */ 1126 + while (er32(FWSM) & E1000_FWSM_ULP_CFG_DONE) { 1127 + if (i++ == 10) { 1128 + ret_val = -E1000_ERR_PHY; 1129 + goto out; 1130 + } 1131 + 1132 + usleep_range(10000, 20000); 1133 + } 1134 + e_dbg("ULP_CONFIG_DONE cleared after %dmsec\n", i * 10); 1135 + 1136 + if (force) { 1137 + mac_reg = er32(H2ME); 1138 + mac_reg &= ~E1000_H2ME_ENFORCE_SETTINGS; 1139 + ew32(H2ME, mac_reg); 1140 + } else { 1141 + /* Clear H2ME.ULP after ME ULP configuration */ 1142 + mac_reg = er32(H2ME); 1143 + mac_reg &= ~E1000_H2ME_ULP; 1144 + ew32(H2ME, mac_reg); 1145 + } 1146 + 1147 + goto out; 1148 + } 1149 + 1150 + ret_val = hw->phy.ops.acquire(hw); 1151 + if (ret_val) 1152 + goto out; 1153 + 1154 + if (force) 1155 + /* Toggle LANPHYPC Value bit */ 1156 + e1000_toggle_lanphypc_pch_lpt(hw); 1157 + 1158 + /* Unforce SMBus mode in PHY */ 1159 + ret_val = e1000_read_phy_reg_hv_locked(hw, CV_SMB_CTRL, &phy_reg); 1160 + if (ret_val) { 1161 + /* The MAC might be in PCIe mode, so temporarily force to 1162 + * SMBus mode in order to access the PHY. 1163 + */ 1164 + mac_reg = er32(CTRL_EXT); 1165 + mac_reg |= E1000_CTRL_EXT_FORCE_SMBUS; 1166 + ew32(CTRL_EXT, mac_reg); 1167 + 1168 + msleep(50); 1169 + 1170 + ret_val = e1000_read_phy_reg_hv_locked(hw, CV_SMB_CTRL, 1171 + &phy_reg); 1172 + if (ret_val) 1173 + goto release; 1174 + } 1175 + phy_reg &= ~CV_SMB_CTRL_FORCE_SMBUS; 1176 + e1000_write_phy_reg_hv_locked(hw, CV_SMB_CTRL, phy_reg); 1177 + 1178 + /* Unforce SMBus mode in MAC */ 1179 + mac_reg = er32(CTRL_EXT); 1180 + mac_reg &= ~E1000_CTRL_EXT_FORCE_SMBUS; 1181 + ew32(CTRL_EXT, mac_reg); 1182 + 1183 + /* When ULP mode was previously entered, K1 was disabled by the 1184 + * hardware. Re-Enable K1 in the PHY when exiting ULP. 1185 + */ 1186 + ret_val = e1000_read_phy_reg_hv_locked(hw, HV_PM_CTRL, &phy_reg); 1187 + if (ret_val) 1188 + goto release; 1189 + phy_reg |= HV_PM_CTRL_K1_ENABLE; 1190 + e1000_write_phy_reg_hv_locked(hw, HV_PM_CTRL, phy_reg); 1191 + 1192 + /* Clear ULP enabled configuration */ 1193 + ret_val = e1000_read_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, &phy_reg); 1194 + if (ret_val) 1195 + goto release; 1196 + phy_reg &= ~(I218_ULP_CONFIG1_IND | 1197 + I218_ULP_CONFIG1_STICKY_ULP | 1198 + I218_ULP_CONFIG1_RESET_TO_SMBUS | 1199 + I218_ULP_CONFIG1_WOL_HOST | 1200 + I218_ULP_CONFIG1_INBAND_EXIT | 1201 + I218_ULP_CONFIG1_DISABLE_SMB_PERST); 1202 + e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg); 1203 + 1204 + /* Commit ULP changes by starting auto ULP configuration */ 1205 + phy_reg |= I218_ULP_CONFIG1_START; 1206 + e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg); 1207 + 1208 + /* Clear Disable SMBus Release on PERST# in MAC */ 1209 + mac_reg = er32(FEXTNVM7); 1210 + mac_reg &= ~E1000_FEXTNVM7_DISABLE_SMB_PERST; 1211 + ew32(FEXTNVM7, mac_reg); 1212 + 1213 + release: 1214 + hw->phy.ops.release(hw); 1215 + if (force) { 1216 + e1000_phy_hw_reset(hw); 1217 + msleep(50); 1218 + } 1219 + out: 1220 + if (ret_val) 1221 + e_dbg("Error in ULP disable flow: %d\n", ret_val); 1222 + else 1223 + hw->dev_spec.ich8lan.ulp_state = e1000_ulp_state_off; 1224 + 1225 + return ret_val; 1226 + } 1227 + 1228 + /** 1034 1229 * e1000_check_for_copper_link_ich8lan - Check for link (Copper) 1035 1230 * @hw: pointer to the HW structure 1036 1231 * ··· 1405 1106 e1000e_check_downshift(hw); 1406 1107 1407 1108 /* Enable/Disable EEE after link up */ 1408 - ret_val = e1000_set_eee_pchlan(hw); 1409 - if (ret_val) 1410 - return ret_val; 1109 + if (hw->phy.type > e1000_phy_82579) { 1110 + ret_val = e1000_set_eee_pchlan(hw); 1111 + if (ret_val) 1112 + return ret_val; 1113 + } 1411 1114 1412 1115 /* If we are forcing speed/duplex, then we simply return since 1413 1116 * we have already determined whether we have link or not. ··· 1675 1374 /* RAR[1-6] are owned by manageability. Skip those and program the 1676 1375 * next address into the SHRA register array. 1677 1376 */ 1678 - if (index < (u32)(hw->mac.rar_entry_count - 6)) { 1377 + if (index < (u32)(hw->mac.rar_entry_count)) { 1679 1378 s32 ret_val; 1680 1379 1681 1380 ret_val = e1000_acquire_swflag_ich8lan(hw); ··· 1785 1484 **/ 1786 1485 static s32 e1000_check_reset_block_ich8lan(struct e1000_hw *hw) 1787 1486 { 1788 - u32 fwsm; 1487 + bool blocked = false; 1488 + int i = 0; 1789 1489 1790 - fwsm = er32(FWSM); 1791 - 1792 - return (fwsm & E1000_ICH_FWSM_RSPCIPHY) ? 0 : E1000_BLK_PHY_RESET; 1490 + while ((blocked = !(er32(FWSM) & E1000_ICH_FWSM_RSPCIPHY)) && 1491 + (i++ < 10)) 1492 + usleep_range(10000, 20000); 1493 + return blocked ? E1000_BLK_PHY_RESET : 0; 1793 1494 } 1794 1495 1795 1496 /**
+44 -28
drivers/net/ethernet/intel/e1000e/ich8lan.h
··· 1 - /******************************************************************************* 2 - 3 - Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2013 Intel Corporation. 5 - 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, 8 - version 2, as published by the Free Software Foundation. 9 - 10 - This program is distributed in the hope it will be useful, but WITHOUT 11 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 - more details. 14 - 15 - You should have received a copy of the GNU General Public License along with 16 - this program; if not, write to the Free Software Foundation, Inc., 17 - 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 18 - 19 - The full GNU General Public License is included in this distribution in 20 - the file called "COPYING". 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 - *******************************************************************************/ 1 + /* Intel PRO/1000 Linux driver 2 + * Copyright(c) 1999 - 2014 Intel Corporation. 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms and conditions of the GNU General Public License, 6 + * version 2, as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope it will be useful, but WITHOUT 9 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 + * more details. 12 + * 13 + * The full GNU General Public License is included in this distribution in 14 + * the file called "COPYING". 15 + * 16 + * Contact Information: 17 + * Linux NICS <linux.nics@intel.com> 18 + * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 19 + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 20 + */ 28 21 29 22 #ifndef _E1000E_ICH8LAN_H_ 30 23 #define _E1000E_ICH8LAN_H_ ··· 58 65 59 66 #define E1000_FWSM_WLOCK_MAC_MASK 0x0380 60 67 #define E1000_FWSM_WLOCK_MAC_SHIFT 7 68 + #define E1000_FWSM_ULP_CFG_DONE 0x00000400 /* Low power cfg done */ 61 69 62 70 /* Shared Receive Address Registers */ 63 71 #define E1000_SHRAL_PCH_LPT(_i) (0x05408 + ((_i) * 8)) 64 72 #define E1000_SHRAH_PCH_LPT(_i) (0x0540C + ((_i) * 8)) 73 + 74 + #define E1000_H2ME 0x05B50 /* Host to ME */ 75 + #define E1000_H2ME_ULP 0x00000800 /* ULP Indication Bit */ 76 + #define E1000_H2ME_ENFORCE_SETTINGS 0x00001000 /* Enforce Settings */ 65 77 66 78 #define ID_LED_DEFAULT_ICH8LAN ((ID_LED_DEF1_DEF2 << 12) | \ 67 79 (ID_LED_OFF1_OFF2 << 8) | \ ··· 79 81 #define E1000_ICH_NVM_SIG_VALUE 0x80 80 82 81 83 #define E1000_ICH8_LAN_INIT_TIMEOUT 1500 84 + 85 + /* FEXT register bit definition */ 86 + #define E1000_FEXT_PHY_CABLE_DISCONNECTED 0x00000004 82 87 83 88 #define E1000_FEXTNVM_SW_CONFIG 1 84 89 #define E1000_FEXTNVM_SW_CONFIG_ICH8M (1 << 27) /* different on ICH8M */ ··· 96 95 #define E1000_FEXTNVM6_REQ_PLL_CLK 0x00000100 97 96 #define E1000_FEXTNVM6_ENABLE_K1_ENTRY_CONDITION 0x00000200 98 97 98 + #define E1000_FEXTNVM7_DISABLE_SMB_PERST 0x00000020 99 + 99 100 #define PCIE_ICH8_SNOOP_ALL PCIE_NO_SNOOP_ALL 100 101 101 102 #define E1000_ICH_RAR_ENTRIES 7 102 - #define E1000_PCH2_RAR_ENTRIES 11 /* RAR[0-6], SHRA[0-3] */ 103 + #define E1000_PCH2_RAR_ENTRIES 5 /* RAR[0], SHRA[0-3] */ 103 104 #define E1000_PCH_LPT_RAR_ENTRIES 12 /* RAR[0], SHRA[0-10] */ 104 105 105 106 #define PHY_PAGE_SHIFT 5 ··· 164 161 #define CV_SMB_CTRL PHY_REG(769, 23) 165 162 #define CV_SMB_CTRL_FORCE_SMBUS 0x0001 166 163 164 + /* I218 Ultra Low Power Configuration 1 Register */ 165 + #define I218_ULP_CONFIG1 PHY_REG(779, 16) 166 + #define I218_ULP_CONFIG1_START 0x0001 /* Start auto ULP config */ 167 + #define I218_ULP_CONFIG1_IND 0x0004 /* Pwr up from ULP indication */ 168 + #define I218_ULP_CONFIG1_STICKY_ULP 0x0010 /* Set sticky ULP mode */ 169 + #define I218_ULP_CONFIG1_INBAND_EXIT 0x0020 /* Inband on ULP exit */ 170 + #define I218_ULP_CONFIG1_WOL_HOST 0x0040 /* WoL Host on ULP exit */ 171 + #define I218_ULP_CONFIG1_RESET_TO_SMBUS 0x0100 /* Reset to SMBus mode */ 172 + #define I218_ULP_CONFIG1_DISABLE_SMB_PERST 0x1000 /* Disable on PERST# */ 173 + 167 174 /* SMBus Address Phy Register */ 168 175 #define HV_SMB_ADDR PHY_REG(768, 26) 169 176 #define HV_SMB_ADDR_MASK 0x007F ··· 208 195 /* PHY Power Management Control */ 209 196 #define HV_PM_CTRL PHY_REG(770, 17) 210 197 #define HV_PM_CTRL_PLL_STOP_IN_K1_GIGA 0x100 198 + #define HV_PM_CTRL_K1_ENABLE 0x4000 211 199 212 200 #define SW_FLAG_TIMEOUT 1000 /* SW Semaphore flag timeout in ms */ 213 201 ··· 282 268 s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable); 283 269 s32 e1000_read_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 *data); 284 270 s32 e1000_write_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 data); 271 + s32 e1000_set_eee_pchlan(struct e1000_hw *hw); 272 + s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx); 285 273 #endif /* _E1000E_ICH8LAN_H_ */
+20 -27
drivers/net/ethernet/intel/e1000e/mac.c
··· 1 - /******************************************************************************* 2 - 3 - Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2013 Intel Corporation. 5 - 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, 8 - version 2, as published by the Free Software Foundation. 9 - 10 - This program is distributed in the hope it will be useful, but WITHOUT 11 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 - more details. 14 - 15 - You should have received a copy of the GNU General Public License along with 16 - this program; if not, write to the Free Software Foundation, Inc., 17 - 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 18 - 19 - The full GNU General Public License is included in this distribution in 20 - the file called "COPYING". 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 - *******************************************************************************/ 1 + /* Intel PRO/1000 Linux driver 2 + * Copyright(c) 1999 - 2014 Intel Corporation. 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms and conditions of the GNU General Public License, 6 + * version 2, as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope it will be useful, but WITHOUT 9 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 + * more details. 12 + * 13 + * The full GNU General Public License is included in this distribution in 14 + * the file called "COPYING". 15 + * 16 + * Contact Information: 17 + * Linux NICS <linux.nics@intel.com> 18 + * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 19 + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 20 + */ 28 21 29 22 #include "e1000.h" 30 23
+20 -27
drivers/net/ethernet/intel/e1000e/mac.h
··· 1 - /******************************************************************************* 2 - 3 - Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2013 Intel Corporation. 5 - 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, 8 - version 2, as published by the Free Software Foundation. 9 - 10 - This program is distributed in the hope it will be useful, but WITHOUT 11 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 - more details. 14 - 15 - You should have received a copy of the GNU General Public License along with 16 - this program; if not, write to the Free Software Foundation, Inc., 17 - 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 18 - 19 - The full GNU General Public License is included in this distribution in 20 - the file called "COPYING". 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 - *******************************************************************************/ 1 + /* Intel PRO/1000 Linux driver 2 + * Copyright(c) 1999 - 2014 Intel Corporation. 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms and conditions of the GNU General Public License, 6 + * version 2, as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope it will be useful, but WITHOUT 9 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 + * more details. 12 + * 13 + * The full GNU General Public License is included in this distribution in 14 + * the file called "COPYING". 15 + * 16 + * Contact Information: 17 + * Linux NICS <linux.nics@intel.com> 18 + * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 19 + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 20 + */ 28 21 29 22 #ifndef _E1000E_MAC_H_ 30 23 #define _E1000E_MAC_H_
+20 -27
drivers/net/ethernet/intel/e1000e/manage.c
··· 1 - /******************************************************************************* 2 - 3 - Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2013 Intel Corporation. 5 - 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, 8 - version 2, as published by the Free Software Foundation. 9 - 10 - This program is distributed in the hope it will be useful, but WITHOUT 11 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 - more details. 14 - 15 - You should have received a copy of the GNU General Public License along with 16 - this program; if not, write to the Free Software Foundation, Inc., 17 - 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 18 - 19 - The full GNU General Public License is included in this distribution in 20 - the file called "COPYING". 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 - *******************************************************************************/ 1 + /* Intel PRO/1000 Linux driver 2 + * Copyright(c) 1999 - 2014 Intel Corporation. 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms and conditions of the GNU General Public License, 6 + * version 2, as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope it will be useful, but WITHOUT 9 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 + * more details. 12 + * 13 + * The full GNU General Public License is included in this distribution in 14 + * the file called "COPYING". 15 + * 16 + * Contact Information: 17 + * Linux NICS <linux.nics@intel.com> 18 + * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 19 + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 20 + */ 28 21 29 22 #include "e1000.h" 30 23
+20 -27
drivers/net/ethernet/intel/e1000e/manage.h
··· 1 - /******************************************************************************* 2 - 3 - Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2013 Intel Corporation. 5 - 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, 8 - version 2, as published by the Free Software Foundation. 9 - 10 - This program is distributed in the hope it will be useful, but WITHOUT 11 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 - more details. 14 - 15 - You should have received a copy of the GNU General Public License along with 16 - this program; if not, write to the Free Software Foundation, Inc., 17 - 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 18 - 19 - The full GNU General Public License is included in this distribution in 20 - the file called "COPYING". 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 - *******************************************************************************/ 1 + /* Intel PRO/1000 Linux driver 2 + * Copyright(c) 1999 - 2014 Intel Corporation. 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms and conditions of the GNU General Public License, 6 + * version 2, as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope it will be useful, but WITHOUT 9 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 + * more details. 12 + * 13 + * The full GNU General Public License is included in this distribution in 14 + * the file called "COPYING". 15 + * 16 + * Contact Information: 17 + * Linux NICS <linux.nics@intel.com> 18 + * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 19 + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 20 + */ 28 21 29 22 #ifndef _E1000E_MANAGE_H_ 30 23 #define _E1000E_MANAGE_H_
+177 -125
drivers/net/ethernet/intel/e1000e/netdev.c
··· 1 - /******************************************************************************* 2 - 3 - Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2013 Intel Corporation. 5 - 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, 8 - version 2, as published by the Free Software Foundation. 9 - 10 - This program is distributed in the hope it will be useful, but WITHOUT 11 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 - more details. 14 - 15 - You should have received a copy of the GNU General Public License along with 16 - this program; if not, write to the Free Software Foundation, Inc., 17 - 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 18 - 19 - The full GNU General Public License is included in this distribution in 20 - the file called "COPYING". 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 - *******************************************************************************/ 1 + /* Intel PRO/1000 Linux driver 2 + * Copyright(c) 1999 - 2014 Intel Corporation. 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms and conditions of the GNU General Public License, 6 + * version 2, as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope it will be useful, but WITHOUT 9 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 + * more details. 12 + * 13 + * The full GNU General Public License is included in this distribution in 14 + * the file called "COPYING". 15 + * 16 + * Contact Information: 17 + * Linux NICS <linux.nics@intel.com> 18 + * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 19 + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 20 + */ 28 21 29 22 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 30 23 ··· 1694 1701 adapter->flags2 &= ~FLAG2_IS_DISCARDING; 1695 1702 1696 1703 writel(0, rx_ring->head); 1697 - if (rx_ring->adapter->flags2 & FLAG2_PCIM2PCI_ARBITER_WA) 1704 + if (adapter->flags2 & FLAG2_PCIM2PCI_ARBITER_WA) 1698 1705 e1000e_update_rdt_wa(rx_ring, 0); 1699 1706 else 1700 1707 writel(0, rx_ring->tail); ··· 2398 2405 tx_ring->next_to_clean = 0; 2399 2406 2400 2407 writel(0, tx_ring->head); 2401 - if (tx_ring->adapter->flags2 & FLAG2_PCIM2PCI_ARBITER_WA) 2408 + if (adapter->flags2 & FLAG2_PCIM2PCI_ARBITER_WA) 2402 2409 e1000e_update_tdt_wa(tx_ring, 0); 2403 2410 else 2404 2411 writel(0, tx_ring->tail); ··· 3327 3334 struct e1000_hw *hw = &adapter->hw; 3328 3335 u32 rctl; 3329 3336 3337 + if (pm_runtime_suspended(netdev->dev.parent)) 3338 + return; 3339 + 3330 3340 /* Check for Promiscuous and All Multicast modes */ 3331 3341 rctl = er32(RCTL); 3332 3342 ··· 3690 3694 */ 3691 3695 static void e1000_power_down_phy(struct e1000_adapter *adapter) 3692 3696 { 3693 - /* WoL is enabled */ 3694 - if (adapter->wol) 3695 - return; 3696 - 3697 3697 if (adapter->hw.phy.ops.power_down) 3698 3698 adapter->hw.phy.ops.power_down(&adapter->hw); 3699 3699 } ··· 3906 3914 } 3907 3915 3908 3916 if (!netif_running(adapter->netdev) && 3909 - !test_bit(__E1000_TESTING, &adapter->state)) { 3917 + !test_bit(__E1000_TESTING, &adapter->state)) 3910 3918 e1000_power_down_phy(adapter); 3911 - return; 3912 - } 3913 3919 3914 3920 e1000_get_phy_info(hw); 3915 3921 ··· 3974 3984 3975 3985 static void e1000e_update_stats(struct e1000_adapter *adapter); 3976 3986 3977 - void e1000e_down(struct e1000_adapter *adapter) 3987 + /** 3988 + * e1000e_down - quiesce the device and optionally reset the hardware 3989 + * @adapter: board private structure 3990 + * @reset: boolean flag to reset the hardware or not 3991 + */ 3992 + void e1000e_down(struct e1000_adapter *adapter, bool reset) 3978 3993 { 3979 3994 struct net_device *netdev = adapter->netdev; 3980 3995 struct e1000_hw *hw = &adapter->hw; ··· 4033 4038 e1000_lv_jumbo_workaround_ich8lan(hw, false)) 4034 4039 e_dbg("failed to disable jumbo frame workaround mode\n"); 4035 4040 4036 - if (!pci_channel_offline(adapter->pdev)) 4041 + if (reset && !pci_channel_offline(adapter->pdev)) 4037 4042 e1000e_reset(adapter); 4038 - 4039 - /* TODO: for power management, we could drop the link and 4040 - * pci_disable_device here. 4041 - */ 4042 4043 } 4043 4044 4044 4045 void e1000e_reinit_locked(struct e1000_adapter *adapter) ··· 4042 4051 might_sleep(); 4043 4052 while (test_and_set_bit(__E1000_RESETTING, &adapter->state)) 4044 4053 usleep_range(1000, 2000); 4045 - e1000e_down(adapter); 4054 + e1000e_down(adapter, true); 4046 4055 e1000e_up(adapter); 4047 4056 clear_bit(__E1000_RESETTING, &adapter->state); 4048 4057 } ··· 4320 4329 adapter->tx_hang_recheck = false; 4321 4330 netif_start_queue(netdev); 4322 4331 4323 - adapter->idle_check = true; 4324 4332 hw->mac.get_link_status = true; 4325 4333 pm_runtime_put(&pdev->dev); 4326 4334 ··· 4369 4379 pm_runtime_get_sync(&pdev->dev); 4370 4380 4371 4381 if (!test_bit(__E1000_DOWN, &adapter->state)) { 4372 - e1000e_down(adapter); 4382 + e1000e_down(adapter, true); 4373 4383 e1000_free_irq(adapter); 4384 + 4385 + /* Link status message must follow this format */ 4386 + pr_info("%s NIC Link is Down\n", adapter->netdev->name); 4374 4387 } 4375 4388 4376 4389 napi_disable(&adapter->napi); 4377 - 4378 - e1000_power_down_phy(adapter); 4379 4390 4380 4391 e1000e_free_tx_resources(adapter->tx_ring); 4381 4392 e1000e_free_rx_resources(adapter->rx_ring); ··· 4454 4463 struct e1000_adapter *adapter = container_of(work, 4455 4464 struct e1000_adapter, 4456 4465 update_phy_task); 4466 + struct e1000_hw *hw = &adapter->hw; 4457 4467 4458 4468 if (test_bit(__E1000_DOWN, &adapter->state)) 4459 4469 return; 4460 4470 4461 - e1000_get_phy_info(&adapter->hw); 4471 + e1000_get_phy_info(hw); 4472 + 4473 + /* Enable EEE on 82579 after link up */ 4474 + if (hw->phy.type == e1000_phy_82579) 4475 + e1000_set_eee_pchlan(hw); 4462 4476 } 4463 4477 4464 4478 /** ··· 5683 5687 adapter->max_frame_size = max_frame; 5684 5688 e_info("changing MTU from %d to %d\n", netdev->mtu, new_mtu); 5685 5689 netdev->mtu = new_mtu; 5690 + 5691 + pm_runtime_get_sync(netdev->dev.parent); 5692 + 5686 5693 if (netif_running(netdev)) 5687 - e1000e_down(adapter); 5694 + e1000e_down(adapter, true); 5688 5695 5689 5696 /* NOTE: netdev_alloc_skb reserves 16 bytes, and typically NET_IP_ALIGN 5690 5697 * means we reserve 2 more, this pushes us to allocate from the next ··· 5712 5713 e1000e_up(adapter); 5713 5714 else 5714 5715 e1000e_reset(adapter); 5716 + 5717 + pm_runtime_put_sync(netdev->dev.parent); 5715 5718 5716 5719 clear_bit(__E1000_RESETTING, &adapter->state); 5717 5720 ··· 5856 5855 static int e1000_init_phy_wakeup(struct e1000_adapter *adapter, u32 wufc) 5857 5856 { 5858 5857 struct e1000_hw *hw = &adapter->hw; 5859 - u32 i, mac_reg; 5858 + u32 i, mac_reg, wuc; 5860 5859 u16 phy_reg, wuc_enable; 5861 5860 int retval; 5862 5861 ··· 5903 5902 phy_reg |= BM_RCTL_RFCE; 5904 5903 hw->phy.ops.write_reg_page(&adapter->hw, BM_RCTL, phy_reg); 5905 5904 5905 + wuc = E1000_WUC_PME_EN; 5906 + if (wufc & (E1000_WUFC_MAG | E1000_WUFC_LNKC)) 5907 + wuc |= E1000_WUC_APME; 5908 + 5906 5909 /* enable PHY wakeup in MAC register */ 5907 5910 ew32(WUFC, wufc); 5908 - ew32(WUC, E1000_WUC_PHY_WAKE | E1000_WUC_PME_EN); 5911 + ew32(WUC, (E1000_WUC_PHY_WAKE | E1000_WUC_APMPME | 5912 + E1000_WUC_PME_STATUS | wuc)); 5909 5913 5910 5914 /* configure and enable PHY wakeup in PHY registers */ 5911 5915 hw->phy.ops.write_reg_page(&adapter->hw, BM_WUFC, wufc); 5912 - hw->phy.ops.write_reg_page(&adapter->hw, BM_WUC, E1000_WUC_PME_EN); 5916 + hw->phy.ops.write_reg_page(&adapter->hw, BM_WUC, wuc); 5913 5917 5914 5918 /* activate PHY wakeup */ 5915 5919 wuc_enable |= BM_WUC_ENABLE_BIT | BM_WUC_HOST_WU_BIT; ··· 5927 5921 return retval; 5928 5922 } 5929 5923 5930 - static int __e1000_shutdown(struct pci_dev *pdev, bool runtime) 5924 + static int e1000e_pm_freeze(struct device *dev) 5931 5925 { 5932 - struct net_device *netdev = pci_get_drvdata(pdev); 5926 + struct net_device *netdev = pci_get_drvdata(to_pci_dev(dev)); 5933 5927 struct e1000_adapter *adapter = netdev_priv(netdev); 5934 - struct e1000_hw *hw = &adapter->hw; 5935 - u32 ctrl, ctrl_ext, rctl, status; 5936 - /* Runtime suspend should only enable wakeup for link changes */ 5937 - u32 wufc = runtime ? E1000_WUFC_LNKC : adapter->wol; 5938 - int retval = 0; 5939 5928 5940 5929 netif_device_detach(netdev); 5941 5930 ··· 5941 5940 usleep_range(10000, 20000); 5942 5941 5943 5942 WARN_ON(test_bit(__E1000_RESETTING, &adapter->state)); 5944 - e1000e_down(adapter); 5943 + 5944 + /* Quiesce the device without resetting the hardware */ 5945 + e1000e_down(adapter, false); 5945 5946 e1000_free_irq(adapter); 5946 5947 } 5947 5948 e1000e_reset_interrupt_capability(adapter); 5949 + 5950 + /* Allow time for pending master requests to run */ 5951 + e1000e_disable_pcie_master(&adapter->hw); 5952 + 5953 + return 0; 5954 + } 5955 + 5956 + static int __e1000_shutdown(struct pci_dev *pdev, bool runtime) 5957 + { 5958 + struct net_device *netdev = pci_get_drvdata(pdev); 5959 + struct e1000_adapter *adapter = netdev_priv(netdev); 5960 + struct e1000_hw *hw = &adapter->hw; 5961 + u32 ctrl, ctrl_ext, rctl, status; 5962 + /* Runtime suspend should only enable wakeup for link changes */ 5963 + u32 wufc = runtime ? E1000_WUFC_LNKC : adapter->wol; 5964 + int retval = 0; 5948 5965 5949 5966 status = er32(STATUS); 5950 5967 if (status & E1000_STATUS_LU) ··· 5994 5975 ew32(CTRL_EXT, ctrl_ext); 5995 5976 } 5996 5977 5978 + if (!runtime) 5979 + e1000e_power_up_phy(adapter); 5980 + 5997 5981 if (adapter->flags & FLAG_IS_ICH) 5998 5982 e1000_suspend_workarounds_ich8lan(&adapter->hw); 5999 - 6000 - /* Allow time for pending master requests to run */ 6001 - e1000e_disable_pcie_master(&adapter->hw); 6002 5983 6003 5984 if (adapter->flags2 & FLAG2_HAS_PHY_WAKEUP) { 6004 5985 /* enable wakeup by the PHY */ ··· 6013 5994 } else { 6014 5995 ew32(WUC, 0); 6015 5996 ew32(WUFC, 0); 5997 + 5998 + e1000_power_down_phy(adapter); 6016 5999 } 6017 6000 6018 - if (adapter->hw.phy.type == e1000_phy_igp_3) 6001 + if (adapter->hw.phy.type == e1000_phy_igp_3) { 6019 6002 e1000e_igp3_phy_powerdown_workaround_ich8lan(&adapter->hw); 6003 + } else if (hw->mac.type == e1000_pch_lpt) { 6004 + if (!(wufc & (E1000_WUFC_EX | E1000_WUFC_MC | E1000_WUFC_BC))) 6005 + /* ULP does not support wake from unicast, multicast 6006 + * or broadcast. 6007 + */ 6008 + retval = e1000_enable_ulp_lpt_lp(hw, !runtime); 6009 + 6010 + if (retval) 6011 + return retval; 6012 + } 6013 + 6020 6014 6021 6015 /* Release control of h/w to f/w. If f/w is AMT enabled, this 6022 6016 * would have already happened in close and is redundant. ··· 6137 6105 } 6138 6106 6139 6107 #ifdef CONFIG_PM 6140 - static bool e1000e_pm_ready(struct e1000_adapter *adapter) 6141 - { 6142 - return !!adapter->tx_ring->buffer_info; 6143 - } 6144 - 6145 6108 static int __e1000_resume(struct pci_dev *pdev) 6146 6109 { 6147 6110 struct net_device *netdev = pci_get_drvdata(pdev); 6148 6111 struct e1000_adapter *adapter = netdev_priv(netdev); 6149 6112 struct e1000_hw *hw = &adapter->hw; 6150 6113 u16 aspm_disable_flag = 0; 6151 - u32 err; 6152 6114 6153 6115 if (adapter->flags2 & FLAG2_DISABLE_ASPM_L0S) 6154 6116 aspm_disable_flag = PCIE_LINK_STATE_L0S; ··· 6152 6126 e1000e_disable_aspm(pdev, aspm_disable_flag); 6153 6127 6154 6128 pci_set_master(pdev); 6155 - 6156 - e1000e_set_interrupt_capability(adapter); 6157 - if (netif_running(netdev)) { 6158 - err = e1000_request_irq(adapter); 6159 - if (err) 6160 - return err; 6161 - } 6162 6129 6163 6130 if (hw->mac.type >= e1000_pch2lan) 6164 6131 e1000_resume_workarounds_pchlan(&adapter->hw); ··· 6191 6172 6192 6173 e1000_init_manageability_pt(adapter); 6193 6174 6194 - if (netif_running(netdev)) 6195 - e1000e_up(adapter); 6196 - 6197 - netif_device_attach(netdev); 6198 - 6199 6175 /* If the controller has AMT, do not set DRV_LOAD until the interface 6200 6176 * is up. For all other cases, let the f/w know that the h/w is now 6201 6177 * under the control of the driver. ··· 6201 6187 return 0; 6202 6188 } 6203 6189 6190 + static int e1000e_pm_thaw(struct device *dev) 6191 + { 6192 + struct net_device *netdev = pci_get_drvdata(to_pci_dev(dev)); 6193 + struct e1000_adapter *adapter = netdev_priv(netdev); 6194 + 6195 + e1000e_set_interrupt_capability(adapter); 6196 + if (netif_running(netdev)) { 6197 + u32 err = e1000_request_irq(adapter); 6198 + 6199 + if (err) 6200 + return err; 6201 + 6202 + e1000e_up(adapter); 6203 + } 6204 + 6205 + netif_device_attach(netdev); 6206 + 6207 + return 0; 6208 + } 6209 + 6204 6210 #ifdef CONFIG_PM_SLEEP 6205 - static int e1000_suspend(struct device *dev) 6211 + static int e1000e_pm_suspend(struct device *dev) 6206 6212 { 6207 6213 struct pci_dev *pdev = to_pci_dev(dev); 6214 + 6215 + e1000e_pm_freeze(dev); 6208 6216 6209 6217 return __e1000_shutdown(pdev, false); 6210 6218 } 6211 6219 6212 - static int e1000_resume(struct device *dev) 6220 + static int e1000e_pm_resume(struct device *dev) 6213 6221 { 6214 6222 struct pci_dev *pdev = to_pci_dev(dev); 6215 - struct net_device *netdev = pci_get_drvdata(pdev); 6216 - struct e1000_adapter *adapter = netdev_priv(netdev); 6223 + int rc; 6217 6224 6218 - if (e1000e_pm_ready(adapter)) 6219 - adapter->idle_check = true; 6225 + rc = __e1000_resume(pdev); 6226 + if (rc) 6227 + return rc; 6220 6228 6221 - return __e1000_resume(pdev); 6229 + return e1000e_pm_thaw(dev); 6222 6230 } 6223 6231 #endif /* CONFIG_PM_SLEEP */ 6224 6232 6225 6233 #ifdef CONFIG_PM_RUNTIME 6226 - static int e1000_runtime_suspend(struct device *dev) 6234 + static int e1000e_pm_runtime_idle(struct device *dev) 6227 6235 { 6228 6236 struct pci_dev *pdev = to_pci_dev(dev); 6229 6237 struct net_device *netdev = pci_get_drvdata(pdev); 6230 6238 struct e1000_adapter *adapter = netdev_priv(netdev); 6231 6239 6232 - if (!e1000e_pm_ready(adapter)) 6233 - return 0; 6234 - 6235 - return __e1000_shutdown(pdev, true); 6236 - } 6237 - 6238 - static int e1000_idle(struct device *dev) 6239 - { 6240 - struct pci_dev *pdev = to_pci_dev(dev); 6241 - struct net_device *netdev = pci_get_drvdata(pdev); 6242 - struct e1000_adapter *adapter = netdev_priv(netdev); 6243 - 6244 - if (!e1000e_pm_ready(adapter)) 6245 - return 0; 6246 - 6247 - if (adapter->idle_check) { 6248 - adapter->idle_check = false; 6249 - if (!e1000e_has_link(adapter)) 6250 - pm_schedule_suspend(dev, MSEC_PER_SEC); 6251 - } 6240 + if (!e1000e_has_link(adapter)) 6241 + pm_schedule_suspend(dev, 5 * MSEC_PER_SEC); 6252 6242 6253 6243 return -EBUSY; 6254 6244 } 6255 6245 6256 - static int e1000_runtime_resume(struct device *dev) 6246 + static int e1000e_pm_runtime_resume(struct device *dev) 6247 + { 6248 + struct pci_dev *pdev = to_pci_dev(dev); 6249 + struct net_device *netdev = pci_get_drvdata(pdev); 6250 + struct e1000_adapter *adapter = netdev_priv(netdev); 6251 + int rc; 6252 + 6253 + rc = __e1000_resume(pdev); 6254 + if (rc) 6255 + return rc; 6256 + 6257 + if (netdev->flags & IFF_UP) 6258 + rc = e1000e_up(adapter); 6259 + 6260 + return rc; 6261 + } 6262 + 6263 + static int e1000e_pm_runtime_suspend(struct device *dev) 6257 6264 { 6258 6265 struct pci_dev *pdev = to_pci_dev(dev); 6259 6266 struct net_device *netdev = pci_get_drvdata(pdev); 6260 6267 struct e1000_adapter *adapter = netdev_priv(netdev); 6261 6268 6262 - if (!e1000e_pm_ready(adapter)) 6263 - return 0; 6269 + if (netdev->flags & IFF_UP) { 6270 + int count = E1000_CHECK_RESET_COUNT; 6264 6271 6265 - adapter->idle_check = !dev->power.runtime_auto; 6266 - return __e1000_resume(pdev); 6272 + while (test_bit(__E1000_RESETTING, &adapter->state) && count--) 6273 + usleep_range(10000, 20000); 6274 + 6275 + WARN_ON(test_bit(__E1000_RESETTING, &adapter->state)); 6276 + 6277 + /* Down the device without resetting the hardware */ 6278 + e1000e_down(adapter, false); 6279 + } 6280 + 6281 + if (__e1000_shutdown(pdev, true)) { 6282 + e1000e_pm_runtime_resume(dev); 6283 + return -EBUSY; 6284 + } 6285 + 6286 + return 0; 6267 6287 } 6268 6288 #endif /* CONFIG_PM_RUNTIME */ 6269 6289 #endif /* CONFIG_PM */ 6270 6290 6271 6291 static void e1000_shutdown(struct pci_dev *pdev) 6272 6292 { 6293 + e1000e_pm_freeze(&pdev->dev); 6294 + 6273 6295 __e1000_shutdown(pdev, false); 6274 6296 } 6275 6297 ··· 6391 6341 return PCI_ERS_RESULT_DISCONNECT; 6392 6342 6393 6343 if (netif_running(netdev)) 6394 - e1000e_down(adapter); 6344 + e1000e_down(adapter, true); 6395 6345 pci_disable_device(pdev); 6396 6346 6397 6347 /* Request a slot slot reset. */ ··· 6403 6353 * @pdev: Pointer to PCI device 6404 6354 * 6405 6355 * Restart the card from scratch, as if from a cold-boot. Implementation 6406 - * resembles the first-half of the e1000_resume routine. 6356 + * resembles the first-half of the e1000e_pm_resume routine. 6407 6357 */ 6408 6358 static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev) 6409 6359 { ··· 6450 6400 * 6451 6401 * This callback is called when the error recovery driver tells us that 6452 6402 * its OK to resume normal operation. Implementation resembles the 6453 - * second-half of the e1000_resume routine. 6403 + * second-half of the e1000e_pm_resume routine. 6454 6404 */ 6455 6405 static void e1000_io_resume(struct pci_dev *pdev) 6456 6406 { ··· 6955 6905 } 6956 6906 } 6957 6907 6958 - if (!(netdev->flags & IFF_UP)) 6959 - e1000_power_down_phy(adapter); 6960 - 6961 6908 /* Don't lie to e1000_close() down the road. */ 6962 6909 if (!down) 6963 6910 clear_bit(__E1000_DOWN, &adapter->state); ··· 7076 7029 MODULE_DEVICE_TABLE(pci, e1000_pci_tbl); 7077 7030 7078 7031 static const struct dev_pm_ops e1000_pm_ops = { 7079 - SET_SYSTEM_SLEEP_PM_OPS(e1000_suspend, e1000_resume) 7080 - SET_RUNTIME_PM_OPS(e1000_runtime_suspend, e1000_runtime_resume, 7081 - e1000_idle) 7032 + .suspend = e1000e_pm_suspend, 7033 + .resume = e1000e_pm_resume, 7034 + .freeze = e1000e_pm_freeze, 7035 + .thaw = e1000e_pm_thaw, 7036 + .poweroff = e1000e_pm_suspend, 7037 + .restore = e1000e_pm_resume, 7038 + SET_RUNTIME_PM_OPS(e1000e_pm_runtime_suspend, e1000e_pm_runtime_resume, 7039 + e1000e_pm_runtime_idle) 7082 7040 }; 7083 7041 7084 7042 /* PCI Device API Driver */ ··· 7110 7058 int ret; 7111 7059 pr_info("Intel(R) PRO/1000 Network Driver - %s\n", 7112 7060 e1000e_driver_version); 7113 - pr_info("Copyright(c) 1999 - 2013 Intel Corporation.\n"); 7061 + pr_info("Copyright(c) 1999 - 2014 Intel Corporation.\n"); 7114 7062 ret = pci_register_driver(&e1000_driver); 7115 7063 7116 7064 return ret;
+20 -27
drivers/net/ethernet/intel/e1000e/nvm.c
··· 1 - /******************************************************************************* 2 - 3 - Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2013 Intel Corporation. 5 - 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, 8 - version 2, as published by the Free Software Foundation. 9 - 10 - This program is distributed in the hope it will be useful, but WITHOUT 11 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 - more details. 14 - 15 - You should have received a copy of the GNU General Public License along with 16 - this program; if not, write to the Free Software Foundation, Inc., 17 - 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 18 - 19 - The full GNU General Public License is included in this distribution in 20 - the file called "COPYING". 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 - *******************************************************************************/ 1 + /* Intel PRO/1000 Linux driver 2 + * Copyright(c) 1999 - 2014 Intel Corporation. 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms and conditions of the GNU General Public License, 6 + * version 2, as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope it will be useful, but WITHOUT 9 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 + * more details. 12 + * 13 + * The full GNU General Public License is included in this distribution in 14 + * the file called "COPYING". 15 + * 16 + * Contact Information: 17 + * Linux NICS <linux.nics@intel.com> 18 + * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 19 + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 20 + */ 28 21 29 22 #include "e1000.h" 30 23
+20 -27
drivers/net/ethernet/intel/e1000e/nvm.h
··· 1 - /******************************************************************************* 2 - 3 - Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2013 Intel Corporation. 5 - 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, 8 - version 2, as published by the Free Software Foundation. 9 - 10 - This program is distributed in the hope it will be useful, but WITHOUT 11 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 - more details. 14 - 15 - You should have received a copy of the GNU General Public License along with 16 - this program; if not, write to the Free Software Foundation, Inc., 17 - 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 18 - 19 - The full GNU General Public License is included in this distribution in 20 - the file called "COPYING". 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 - *******************************************************************************/ 1 + /* Intel PRO/1000 Linux driver 2 + * Copyright(c) 1999 - 2014 Intel Corporation. 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms and conditions of the GNU General Public License, 6 + * version 2, as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope it will be useful, but WITHOUT 9 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 + * more details. 12 + * 13 + * The full GNU General Public License is included in this distribution in 14 + * the file called "COPYING". 15 + * 16 + * Contact Information: 17 + * Linux NICS <linux.nics@intel.com> 18 + * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 19 + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 20 + */ 28 21 29 22 #ifndef _E1000E_NVM_H_ 30 23 #define _E1000E_NVM_H_
+26 -27
drivers/net/ethernet/intel/e1000e/param.c
··· 1 - /******************************************************************************* 2 - 3 - Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2013 Intel Corporation. 5 - 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, 8 - version 2, as published by the Free Software Foundation. 9 - 10 - This program is distributed in the hope it will be useful, but WITHOUT 11 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 - more details. 14 - 15 - You should have received a copy of the GNU General Public License along with 16 - this program; if not, write to the Free Software Foundation, Inc., 17 - 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 18 - 19 - The full GNU General Public License is included in this distribution in 20 - the file called "COPYING". 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 - *******************************************************************************/ 1 + /* Intel PRO/1000 Linux driver 2 + * Copyright(c) 1999 - 2014 Intel Corporation. 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms and conditions of the GNU General Public License, 6 + * version 2, as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope it will be useful, but WITHOUT 9 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 + * more details. 12 + * 13 + * The full GNU General Public License is included in this distribution in 14 + * the file called "COPYING". 15 + * 16 + * Contact Information: 17 + * Linux NICS <linux.nics@intel.com> 18 + * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 19 + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 20 + */ 28 21 29 22 #include <linux/netdevice.h> 30 23 #include <linux/module.h> ··· 374 381 "%s set to dynamic mode\n", opt.name); 375 382 adapter->itr = 20000; 376 383 break; 384 + case 2: 385 + dev_info(&adapter->pdev->dev, 386 + "%s Invalid mode - setting default\n", 387 + opt.name); 388 + adapter->itr_setting = opt.def; 389 + /* fall-through */ 377 390 case 3: 378 391 dev_info(&adapter->pdev->dev, 379 392 "%s set to dynamic conservative mode\n",
+20 -27
drivers/net/ethernet/intel/e1000e/phy.c
··· 1 - /******************************************************************************* 2 - 3 - Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2013 Intel Corporation. 5 - 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, 8 - version 2, as published by the Free Software Foundation. 9 - 10 - This program is distributed in the hope it will be useful, but WITHOUT 11 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 - more details. 14 - 15 - You should have received a copy of the GNU General Public License along with 16 - this program; if not, write to the Free Software Foundation, Inc., 17 - 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 18 - 19 - The full GNU General Public License is included in this distribution in 20 - the file called "COPYING". 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 - *******************************************************************************/ 1 + /* Intel PRO/1000 Linux driver 2 + * Copyright(c) 1999 - 2014 Intel Corporation. 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms and conditions of the GNU General Public License, 6 + * version 2, as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope it will be useful, but WITHOUT 9 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 + * more details. 12 + * 13 + * The full GNU General Public License is included in this distribution in 14 + * the file called "COPYING". 15 + * 16 + * Contact Information: 17 + * Linux NICS <linux.nics@intel.com> 18 + * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 19 + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 20 + */ 28 21 29 22 #include "e1000.h" 30 23
+20 -27
drivers/net/ethernet/intel/e1000e/phy.h
··· 1 - /******************************************************************************* 2 - 3 - Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2013 Intel Corporation. 5 - 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, 8 - version 2, as published by the Free Software Foundation. 9 - 10 - This program is distributed in the hope it will be useful, but WITHOUT 11 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 - more details. 14 - 15 - You should have received a copy of the GNU General Public License along with 16 - this program; if not, write to the Free Software Foundation, Inc., 17 - 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 18 - 19 - The full GNU General Public License is included in this distribution in 20 - the file called "COPYING". 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 - *******************************************************************************/ 1 + /* Intel PRO/1000 Linux driver 2 + * Copyright(c) 1999 - 2014 Intel Corporation. 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms and conditions of the GNU General Public License, 6 + * version 2, as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope it will be useful, but WITHOUT 9 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 + * more details. 12 + * 13 + * The full GNU General Public License is included in this distribution in 14 + * the file called "COPYING". 15 + * 16 + * Contact Information: 17 + * Linux NICS <linux.nics@intel.com> 18 + * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 19 + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 20 + */ 28 21 29 22 #ifndef _E1000E_PHY_H_ 30 23 #define _E1000E_PHY_H_
+25 -27
drivers/net/ethernet/intel/e1000e/ptp.c
··· 1 - /******************************************************************************* 2 - 3 - Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2013 Intel Corporation. 5 - 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, 8 - version 2, as published by the Free Software Foundation. 9 - 10 - This program is distributed in the hope it will be useful, but WITHOUT 11 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 - more details. 14 - 15 - You should have received a copy of the GNU General Public License along with 16 - this program; if not, write to the Free Software Foundation, Inc., 17 - 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 18 - 19 - The full GNU General Public License is included in this distribution in 20 - the file called "COPYING". 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 - *******************************************************************************/ 1 + /* Intel PRO/1000 Linux driver 2 + * Copyright(c) 1999 - 2014 Intel Corporation. 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms and conditions of the GNU General Public License, 6 + * version 2, as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope it will be useful, but WITHOUT 9 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 + * more details. 12 + * 13 + * The full GNU General Public License is included in this distribution in 14 + * the file called "COPYING". 15 + * 16 + * Contact Information: 17 + * Linux NICS <linux.nics@intel.com> 18 + * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 19 + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 20 + */ 28 21 29 22 /* PTP 1588 Hardware Clock (PHC) 30 23 * Derived from PTP Hardware Clock driver for Intel 82576 and 82580 (igb) ··· 40 47 ptp_clock_info); 41 48 struct e1000_hw *hw = &adapter->hw; 42 49 bool neg_adj = false; 50 + unsigned long flags; 43 51 u64 adjustment; 44 52 u32 timinca, incvalue; 45 53 s32 ret_val; ··· 58 64 if (ret_val) 59 65 return ret_val; 60 66 67 + spin_lock_irqsave(&adapter->systim_lock, flags); 68 + 61 69 incvalue = timinca & E1000_TIMINCA_INCVALUE_MASK; 62 70 63 71 adjustment = incvalue; ··· 72 76 timinca |= incvalue; 73 77 74 78 ew32(TIMINCA, timinca); 79 + 80 + spin_unlock_irqrestore(&adapter->systim_lock, flags); 75 81 76 82 return 0; 77 83 }
+21 -27
drivers/net/ethernet/intel/e1000e/regs.h
··· 1 - /******************************************************************************* 2 - 3 - Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2013 Intel Corporation. 5 - 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, 8 - version 2, as published by the Free Software Foundation. 9 - 10 - This program is distributed in the hope it will be useful, but WITHOUT 11 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 - more details. 14 - 15 - You should have received a copy of the GNU General Public License along with 16 - this program; if not, write to the Free Software Foundation, Inc., 17 - 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 18 - 19 - The full GNU General Public License is included in this distribution in 20 - the file called "COPYING". 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 - *******************************************************************************/ 1 + /* Intel PRO/1000 Linux driver 2 + * Copyright(c) 1999 - 2014 Intel Corporation. 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms and conditions of the GNU General Public License, 6 + * version 2, as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope it will be useful, but WITHOUT 9 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 + * more details. 12 + * 13 + * The full GNU General Public License is included in this distribution in 14 + * the file called "COPYING". 15 + * 16 + * Contact Information: 17 + * Linux NICS <linux.nics@intel.com> 18 + * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 19 + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 20 + */ 28 21 29 22 #ifndef _E1000E_REGS_H_ 30 23 #define _E1000E_REGS_H_ ··· 32 39 #define E1000_SCTL 0x00024 /* SerDes Control - RW */ 33 40 #define E1000_FCAL 0x00028 /* Flow Control Address Low - RW */ 34 41 #define E1000_FCAH 0x0002C /* Flow Control Address High -RW */ 42 + #define E1000_FEXT 0x0002C /* Future Extended - RW */ 35 43 #define E1000_FEXTNVM 0x00028 /* Future Extended NVM - RW */ 36 44 #define E1000_FEXTNVM3 0x0003C /* Future Extended NVM 3 - RW */ 37 45 #define E1000_FEXTNVM4 0x00024 /* Future Extended NVM 4 - RW */
+3 -3
drivers/net/ethernet/intel/igb/e1000_82575.c
··· 76 76 static const u16 e1000_82580_rxpbs_table[] = 77 77 { 36, 72, 144, 1, 2, 4, 8, 16, 78 78 35, 70, 140 }; 79 - #define E1000_82580_RXPBS_TABLE_SIZE \ 80 - (sizeof(e1000_82580_rxpbs_table)/sizeof(u16)) 81 79 82 80 /** 83 81 * igb_sgmii_uses_mdio_82575 - Determine if I2C pins are for external MDIO ··· 2305 2307 { 2306 2308 u16 ret_val = 0; 2307 2309 2308 - if (data < E1000_82580_RXPBS_TABLE_SIZE) 2310 + if (data < ARRAY_SIZE(e1000_82580_rxpbs_table)) 2309 2311 ret_val = e1000_82580_rxpbs_table[data]; 2310 2312 2311 2313 return ret_val; ··· 2711 2713 E1000_EMC_DIODE3_THERM_LIMIT 2712 2714 }; 2713 2715 2716 + #ifdef CONFIG_IGB_HWMON 2714 2717 /** 2715 2718 * igb_get_thermal_sensor_data_generic - Gathers thermal sensor data 2716 2719 * @hw: pointer to hardware structure ··· 2834 2835 return status; 2835 2836 } 2836 2837 2838 + #endif 2837 2839 static struct e1000_mac_operations e1000_mac_ops_82575 = { 2838 2840 .init_hw = igb_init_hw_82575, 2839 2841 .check_for_link = igb_check_for_link_82575,
+2 -1
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
··· 516 516 /* Workaround hardware that can't do proper VEPA multicast 517 517 * source pruning. 518 518 */ 519 - if ((skb->pkt_type & (PACKET_BROADCAST | PACKET_MULTICAST)) && 519 + if ((skb->pkt_type == PACKET_BROADCAST || 520 + skb->pkt_type == PACKET_MULTICAST) && 520 521 ether_addr_equal(rx_ring->netdev->dev_addr, 521 522 eth_hdr(skb)->h_source)) { 522 523 dev_kfree_skb_irq(skb);