From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <wenzhuol@shecgisg004.sh.intel.com>
Received: from mga11.intel.com (mga11.intel.com [192.55.52.93])
 by dpdk.org (Postfix) with ESMTP id 09CC75A65
 for <dev@dpdk.org>; Wed, 24 Jun 2015 05:26:42 +0200 (CEST)
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
 by fmsmga102.fm.intel.com with ESMTP; 23 Jun 2015 20:26:42 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.13,669,1427785200"; d="scan'208";a="749302354"
Received: from shvmail01.sh.intel.com ([10.239.29.42])
 by fmsmga002.fm.intel.com with ESMTP; 23 Jun 2015 20:26:43 -0700
Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com
 [10.239.29.89])
 by shvmail01.sh.intel.com with ESMTP id t5O3Qewm019254;
 Wed, 24 Jun 2015 11:26:40 +0800
Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1])
 by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id
 t5O3QbBV012074; Wed, 24 Jun 2015 11:26:39 +0800
Received: (from wenzhuol@localhost)
 by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t5O3QbKf012070;
 Wed, 24 Jun 2015 11:26:37 +0800
From: Wenzhuo Lu <wenzhuo.lu@intel.com>
To: dev@dpdk.org
Date: Wed, 24 Jun 2015 11:25:53 +0800
Message-Id: <1435116386-12010-5-git-send-email-wenzhuo.lu@intel.com>
X-Mailer: git-send-email 1.7.4.1
In-Reply-To: <1435116386-12010-1-git-send-email-wenzhuo.lu@intel.com>
References: <1435116386-12010-1-git-send-email-wenzhuo.lu@intel.com>
Subject: [dpdk-dev] [PATCH 04/37] ixgbe/base: update x550em SFP link setup
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 24 Jun 2015 03:26:43 -0000

This patch updates the x550em SFP link setup by adding
ixgbe_sfp_type_unknown and ixgbe_sfp_type_not_present case expression
to the ixgbe_setup_mac_link_sfp_x550em SFP type switch statement. This
handles the case when no module is present.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_x550.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ixgbe/base/ixgbe_x550.c b/drivers/net/ixgbe/base/ixgbe_x550.c
index 181264d..82414dc 100644
--- a/drivers/net/ixgbe/base/ixgbe_x550.c
+++ b/drivers/net/ixgbe/base/ixgbe_x550.c
@@ -990,7 +990,7 @@ enum ixgbe_media_type ixgbe_get_media_type_X550em(struct ixgbe_hw *hw)
 }
 
 /**
- *  ixgbe_setup_sfp_modules_X550em - Setup SFP module
+ *  ixgbe_setup_sfp_modules_X550em - Setup MAC link ops
  *  @hw: pointer to hardware structure
  */
 s32 ixgbe_setup_sfp_modules_X550em(struct ixgbe_hw *hw)
@@ -1637,10 +1637,10 @@ STATIC s32 ixgbe_setup_ixfi_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed)
 }
 
 /**
- *  ixgbe_setup_mac_link_sfp_x550em - Configure the KR PHY for SFP.
+ *  ixgbe_setup_mac_link_sfp_x550em - Configure the CS4227 & KR PHY for SFP
  *  @hw: pointer to hardware structure
  *
- *  Configures the integrated KR PHY for SFP support.
+ *  Configure the external CS4227 PHY and the integrated KR PHY for SFP support.
  **/
 s32 ixgbe_setup_mac_link_sfp_x550em(struct ixgbe_hw *hw,
 				    ixgbe_link_speed speed,
@@ -1653,6 +1653,10 @@ s32 ixgbe_setup_mac_link_sfp_x550em(struct ixgbe_hw *hw,
 
 	/* Configure the external PHY. */
 	switch (hw->phy.sfp_type) {
+	case ixgbe_sfp_type_unknown:
+		return IXGBE_ERR_SFP_NOT_SUPPORTED;
+	case ixgbe_sfp_type_not_present:
+		return IXGBE_SUCCESS;
 	case ixgbe_sfp_type_da_cu_core0:
 	case ixgbe_sfp_type_da_cu_core1:
 		setup_linear = true;
-- 
1.9.3