summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authormsaitoh <msaitoh@NetBSD.org>2018-04-04 06:30:09 +0000
committermsaitoh <msaitoh@NetBSD.org>2018-04-04 06:30:09 +0000
commit1a7b281328d3403525c04c7ea32da3bcffc0316c (patch)
tree4ec4bce09e22c763fbded2d7c2d69f0b1be619b4 /sys/dev
parent8c8f7639c14fd5b29930aef4640c120c67995e37 (diff)
Fix a bug that "ifconfig ixgN down up" forgot IFM_NONE setting.
- Don't assume autoneg == 0 is the first call of ixgbe_config_link(). Check ifm_media, too. - Don't override autoneg_advertised in ixgbe_get_phy_id_fw() to not to be inconsistent with if_media value.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/ixgbe/ixgbe.c12
-rw-r--r--sys/dev/pci/ixgbe/ixgbe_x550.c7
2 files changed, 17 insertions, 2 deletions
diff --git a/sys/dev/pci/ixgbe/ixgbe.c b/sys/dev/pci/ixgbe/ixgbe.c
index ab5bee722c1..b1f59f877ba 100644
--- a/sys/dev/pci/ixgbe/ixgbe.c
+++ b/sys/dev/pci/ixgbe/ixgbe.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.142 2018/04/02 10:51:35 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.143 2018/04/04 06:30:09 msaitoh Exp $ */
/******************************************************************************
@@ -1511,13 +1511,21 @@ ixgbe_config_link(struct adapter *adapter)
kpreempt_enable();
}
} else {
+ struct ifmedia *ifm = &adapter->media;
+
if (hw->mac.ops.check_link)
err = ixgbe_check_link(hw, &adapter->link_speed,
&adapter->link_up, FALSE);
if (err)
goto out;
+
+ /*
+ * Check if it's the first call. If it's the first call,
+ * get value for auto negotiation.
+ */
autoneg = hw->phy.autoneg_advertised;
- if ((!autoneg) && (hw->mac.ops.get_link_capabilities))
+ if ((IFM_SUBTYPE(ifm->ifm_cur->ifm_media) != IFM_NONE)
+ && ((!autoneg) && (hw->mac.ops.get_link_capabilities)))
err = hw->mac.ops.get_link_capabilities(hw, &autoneg,
&negotiate);
if (err)
diff --git a/sys/dev/pci/ixgbe/ixgbe_x550.c b/sys/dev/pci/ixgbe/ixgbe_x550.c
index d92d750b572..308b19cfa91 100644
--- a/sys/dev/pci/ixgbe/ixgbe_x550.c
+++ b/sys/dev/pci/ixgbe/ixgbe_x550.c
@@ -569,8 +569,15 @@ static s32 ixgbe_get_phy_id_fw(struct ixgbe_hw *hw)
if (phy_speeds & ixgbe_fw_map[i].fw_speed)
hw->phy.speeds_supported |= ixgbe_fw_map[i].phy_speed;
}
+
+#if 0
+ /*
+ * Don't set autoneg_advertised here to not to be inconsistent with
+ * if_media value.
+ */
if (!hw->phy.autoneg_advertised)
hw->phy.autoneg_advertised = hw->phy.speeds_supported;
+#endif
hw->phy.id = info[0] & FW_PHY_INFO_ID_HI_MASK;
phy_id_lo = info[1] & FW_PHY_INFO_ID_LO_MASK;