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 Fix SFP+ insersion or replacement stuff.
details: https://anonhg.NetBSD.org/src/rev/5ba9045f0602
branches: trunk
changeset: 350868:5ba9045f0602
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Wed Jan 25 07:46:53 2017 +0000
description:
Fix SFP+ insersion or replacement stuff.
diffstat:
sys/dev/pci/ixgbe/ixgbe.c | 24 +++++++++++++-----------
sys/dev/pci/ixgbe/ixgbe.h | 10 ++++++++--
2 files changed, 21 insertions(+), 13 deletions(-)
diffs (112 lines):
diff -r d0bb771c89c4 -r 5ba9045f0602 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Wed Jan 25 07:19:24 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Wed Jan 25 07:46:53 2017 +0000
@@ -59,7 +59,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
/*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixgbe.c,v 1.63 2017/01/19 09:42:08 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.64 2017/01/25 07:46:53 msaitoh Exp $*/
#include "opt_inet.h"
#include "opt_inet6.h"
@@ -1799,12 +1799,12 @@
mod_mask = IXGBE_EICR_GPI_SDP2_BY_MAC(hw);
if (ixgbe_is_sfp(hw)) {
- if (reg_eicr & IXGBE_EICR_GPI_SDP1_BY_MAC(hw)) {
+ if (reg_eicr & mod_mask) {
+ IXGBE_WRITE_REG(hw, IXGBE_EICR, mod_mask);
+ softint_schedule(adapter->mod_si);
+ } else if (reg_eicr & IXGBE_EICR_GPI_SDP1_BY_MAC(hw)) {
IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1_BY_MAC(hw));
softint_schedule(adapter->msf_si);
- } else if (reg_eicr & mod_mask) {
- IXGBE_WRITE_REG(hw, IXGBE_EICR, mod_mask);
- softint_schedule(adapter->mod_si);
}
}
@@ -3961,7 +3961,7 @@
u32 err;
IXGBE_CORE_LOCK(adapter);
-
+ printf("%s: called\n", __func__);
/* Check to see if the PHY type changed */
if (hw->phy.ops.identify) {
hw->phy.type = ixgbe_phy_unknown;
@@ -3996,8 +3996,6 @@
"Setup failure - unsupported SFP+ module type.\n");
goto out;
}
- if (hw->phy.multispeed_fiber)
- softint_schedule(adapter->msf_si);
out:
/* Update media type */
switch (hw->mac.ops.get_media_type(hw)) {
@@ -4015,6 +4013,12 @@
break;
}
+ /* Adjust media types shown in ifconfig */
+ ifmedia_removeall(&adapter->media);
+ ixgbe_add_media_types(adapter);
+ ifmedia_set(&adapter->media, IFM_ETHER | IFM_AUTO);
+
+ softint_schedule(adapter->msf_si);
IXGBE_CORE_UNLOCK(adapter);
return;
}
@@ -4032,6 +4036,7 @@
bool negotiate;
IXGBE_CORE_LOCK(adapter);
+ printf("%s: called\n", __func__);
/* get_supported_phy_layer will call hw->phy.ops.identify_sfp() */
adapter->phy_layer = ixgbe_get_supported_physical_layer(hw);
@@ -4043,9 +4048,6 @@
if (hw->mac.ops.setup_link)
hw->mac.ops.setup_link(hw, autoneg, TRUE);
- /* Adjust media types shown in ifconfig */
- ifmedia_removeall(&adapter->media);
- ixgbe_add_media_types(adapter);
IXGBE_CORE_UNLOCK(adapter);
return;
}
diff -r d0bb771c89c4 -r 5ba9045f0602 sys/dev/pci/ixgbe/ixgbe.h
--- a/sys/dev/pci/ixgbe/ixgbe.h Wed Jan 25 07:19:24 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.h Wed Jan 25 07:46:53 2017 +0000
@@ -59,7 +59,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe.h 303890 2016-08-09 19:32:06Z dumbbell $*/
-/*$NetBSD: ixgbe.h,v 1.19 2017/01/18 10:18:40 msaitoh Exp $*/
+/*$NetBSD: ixgbe.h,v 1.20 2017/01/25 07:46:53 msaitoh Exp $*/
#ifndef _IXGBE_H_
@@ -698,14 +698,20 @@
case ixgbe_phy_sfp_unknown:
case ixgbe_phy_sfp_passive_tyco:
case ixgbe_phy_sfp_passive_unknown:
+ case ixgbe_phy_sfp_unsupported:
case ixgbe_phy_qsfp_passive_unknown:
case ixgbe_phy_qsfp_active_unknown:
case ixgbe_phy_qsfp_intel:
case ixgbe_phy_qsfp_unknown:
return TRUE;
default:
- return FALSE;
+ break;
}
+
+ if (hw->phy.sfp_type == ixgbe_sfp_type_not_present)
+ return TRUE;
+
+ return FALSE;
}
/* Workaround to make 8.0 buildable */
Home |
Main Index |
Thread Index |
Old Index