summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2016-12-06 16:09:41 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2016-12-06 16:09:41 +0000
commit749c9c4adc018eceda23d07c5f8f42b245f8dd03 (patch)
treedf275eef030faece4ac7126bd845205dbe7c0a64 /sys/dev
parent484f47ed85b6125842af2a6c0370127ec9fa8813 (diff)
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!
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/ixgbe_x550.c12
1 files changed, 10 insertions, 2 deletions
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;