summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormikeb <mikeb@openbsd.org>2016-12-06 16:09:40 +0000
committermikeb <mikeb@openbsd.org>2016-12-06 16:09:40 +0000
commit1544f1b62984676eea98a690393a2fd8fad19983 (patch)
tree8dc314f715b8dece6a48f00eec58d79502dd9c80
parentBetter matching and remove a useless use of sort(1). (diff)
downloadwireguard-openbsd-1544f1b62984676eea98a690393a2fd8fad19983.tar.xz
wireguard-openbsd-1544f1b62984676eea98a690393a2fd8fad19983.zip
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!
-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;