Module Name:    src
Committed By:   msaitoh
Date:           Fri Jul  6 02:36:35 UTC 2018

Modified Files:
        src/sys/dev/pci/ixgbe: ixgbe.c ixgbe_type.h ixgbe_x550.c

Log Message:
 Add force_10_100_autonego sysctl. The default vaule is 0(false).
This sysctl is only for 550EM_a with PHY firmware for a while.


To generate a diff of this commit:
cvs rdiff -u -r1.162 -r1.163 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pci/ixgbe/ixgbe_x550.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.162 src/sys/dev/pci/ixgbe/ixgbe.c:1.163
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.162	Tue Jul  3 04:02:06 2018
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Fri Jul  6 02:36:35 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.162 2018/07/03 04:02:06 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.163 2018/07/06 02:36:35 msaitoh Exp $ */
 
 /******************************************************************************
 
@@ -3317,6 +3317,15 @@ ixgbe_add_device_sysctls(struct adapter 
 			aprint_error_dev(dev, "could not create sysctl\n");
 	}
 
+	if ((hw->mac.type == ixgbe_mac_X550EM_a)
+	    && (hw->phy.type == ixgbe_phy_fw))
+		if (sysctl_createv(log, 0, &rnode, &cnode, CTLFLAG_READWRITE,
+		    CTLTYPE_BOOL, "force_10_100_autonego",
+		    SYSCTL_DESCR("Force autonego on 10M and 100M"),
+		    NULL, 0, &hw->phy.force_10_100_autonego, 0,
+		    CTL_CREATE, CTL_EOL) != 0)
+			aprint_error_dev(dev, "could not create sysctl\n");
+
 	if (adapter->feat_cap & IXGBE_FEATURE_EEE) {
 		if (sysctl_createv(log, 0, &rnode, &cnode, CTLFLAG_READWRITE,
 		    CTLTYPE_INT, "eee_state",

Index: src/sys/dev/pci/ixgbe/ixgbe_type.h
diff -u src/sys/dev/pci/ixgbe/ixgbe_type.h:1.35 src/sys/dev/pci/ixgbe/ixgbe_type.h:1.36
--- src/sys/dev/pci/ixgbe/ixgbe_type.h:1.35	Mon Jun 11 10:34:18 2018
+++ src/sys/dev/pci/ixgbe/ixgbe_type.h	Fri Jul  6 02:36:35 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_type.h,v 1.35 2018/06/11 10:34:18 msaitoh Exp $ */
+/* $NetBSD: ixgbe_type.h,v 1.36 2018/07/06 02:36:35 msaitoh Exp $ */
 
 /******************************************************************************
   SPDX-License-Identifier: BSD-3-Clause
@@ -4166,6 +4166,7 @@ struct ixgbe_phy_info {
 	enum ixgbe_media_type		media_type;
 	u32 phy_semaphore_mask;
 	bool				reset_disable;
+	bool				force_10_100_autonego;
 	ixgbe_autoneg_advertised	autoneg_advertised;
 	ixgbe_link_speed speeds_supported;
 	ixgbe_link_speed eee_speeds_supported;

Index: src/sys/dev/pci/ixgbe/ixgbe_x550.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_x550.c:1.12 src/sys/dev/pci/ixgbe/ixgbe_x550.c:1.13
--- src/sys/dev/pci/ixgbe/ixgbe_x550.c:1.12	Wed Apr  4 08:59:22 2018
+++ src/sys/dev/pci/ixgbe/ixgbe_x550.c	Fri Jul  6 02:36:35 2018
@@ -847,9 +847,10 @@ static s32 ixgbe_setup_fw_link(struct ix
 		setup[0] |= FW_PHY_ACT_SETUP_LINK_EEE;
 
 #ifdef IXGBE_DENVERTON_WA
-	/* Don't use auto-nego for 10/100Mbps */
-	if ((hw->phy.autoneg_advertised == IXGBE_LINK_SPEED_100_FULL)
-	    || (hw->phy.autoneg_advertised == IXGBE_LINK_SPEED_10_FULL)) {
+	if ((hw->phy.force_10_100_autonego == false)
+	    && ((hw->phy.autoneg_advertised == IXGBE_LINK_SPEED_100_FULL)
+		|| (hw->phy.autoneg_advertised == IXGBE_LINK_SPEED_10_FULL))) {
+		/* Don't use auto-nego for 10/100Mbps */
 		setup[0] &= ~FW_PHY_ACT_SETUP_LINK_AN;
 		setup[0] &= ~FW_PHY_ACT_SETUP_LINK_EEE;
 		setup[0] &= ~(FW_PHY_ACT_SETUP_LINK_PAUSE_RXTX
@@ -862,6 +863,9 @@ static s32 ixgbe_setup_fw_link(struct ix
 		return rc;
 
 #ifdef IXGBE_DENVERTON_WA
+	if (hw->phy.force_10_100_autonego == true)
+		goto out;
+
 	ret_val = ixgbe_read_phy_reg_x550a(hw, MII_BMCR, 0, &phydata);
 	if (ret_val != 0)
 		goto out;

Reply via email to