Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci/ixgbe Add force_10_100_autonego sysctl. The defa...
details: https://anonhg.NetBSD.org/src/rev/c15639689878
branches: trunk
changeset: 323894:c15639689878
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Fri Jul 06 02:36:35 2018 +0000
description:
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.
diffstat:
sys/dev/pci/ixgbe/ixgbe.c | 11 ++++++++++-
sys/dev/pci/ixgbe/ixgbe_type.h | 3 ++-
sys/dev/pci/ixgbe/ixgbe_x550.c | 10 +++++++---
3 files changed, 19 insertions(+), 5 deletions(-)
diffs (69 lines):
diff -r a82586a0f648 -r c15639689878 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Fri Jul 06 01:58:12 2018 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Fri Jul 06 02:36:35 2018 +0000
@@ -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 @@
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",
diff -r a82586a0f648 -r c15639689878 sys/dev/pci/ixgbe/ixgbe_type.h
--- a/sys/dev/pci/ixgbe/ixgbe_type.h Fri Jul 06 01:58:12 2018 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe_type.h Fri Jul 06 02:36:35 2018 +0000
@@ -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 @@
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;
diff -r a82586a0f648 -r c15639689878 sys/dev/pci/ixgbe/ixgbe_x550.c
--- a/sys/dev/pci/ixgbe/ixgbe_x550.c Fri Jul 06 01:58:12 2018 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe_x550.c Fri Jul 06 02:36:35 2018 +0000
@@ -847,9 +847,10 @@
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 @@
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;
Home |
Main Index |
Thread Index |
Old Index