From 749c9c4adc018eceda23d07c5f8f42b245f8dd03 Mon Sep 17 00:00:00 2001 From: Mike Belopuhov Date: Tue, 6 Dec 2016 16:09:41 +0000 Subject: Let X552 SFP+ boot without a module plugged in Due to insufficient error handling X552 SFP+ card isn't configured properly on boot when an SFP+ module is not plugged in. As a side effect the interface becomes completely unusable afterwards. The issue was discovered and fix tested by Hrvoje Popovski, thanks! --- sys/dev/pci/ixgbe_x550.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/pci/ixgbe_x550.c b/sys/dev/pci/ixgbe_x550.c index 499e9656944..6921eaef764 100644 --- a/sys/dev/pci/ixgbe_x550.c +++ b/sys/dev/pci/ixgbe_x550.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ixgbe_x550.c,v 1.2 2016/11/18 11:25:11 mikeb Exp $ */ +/* $OpenBSD: ixgbe_x550.c,v 1.3 2016/12/06 16:09:40 mikeb Exp $ */ /****************************************************************************** @@ -367,6 +367,8 @@ void ixgbe_setup_mux_ctl(struct ixgbe_hw *hw) */ int32_t ixgbe_identify_phy_x550em(struct ixgbe_hw *hw) { + int32_t ret_val; + switch (hw->device_id) { case IXGBE_DEV_ID_X550EM_X_SFP: /* set up for CS4227 usage */ @@ -374,7 +376,13 @@ int32_t ixgbe_identify_phy_x550em(struct ixgbe_hw *hw) ixgbe_setup_mux_ctl(hw); ixgbe_check_cs4227(hw); - return ixgbe_identify_module_generic(hw); + ret_val = ixgbe_identify_module_generic(hw); + + /* Set PHY type none if no SFP detected */ + if (ret_val == IXGBE_ERR_SFP_NOT_PRESENT) { + hw->phy.type = ixgbe_phy_none; + return IXGBE_SUCCESS; + } break; case IXGBE_DEV_ID_X550EM_X_KX4: hw->phy.type = ixgbe_phy_x550em_kx4; -- cgit v1.2.3