From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C750FA0544; Fri, 2 Sep 2022 09:02:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 05C6141144; Fri, 2 Sep 2022 09:02:07 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id B835F40684 for ; Fri, 2 Sep 2022 02:18:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662077913; x=1693613913; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=IAWBUsgCz9yc07xzUThtCfbcgQ6kpFuErrFz6sttSxo=; b=GmsYOCer2sKxaAJGY1CUoQ2pSpZ0CtFjcBYNoNgVgaXvwrBko6N98aLs CcEulexN/DK5gTYgZHesIEHWNYcArjTlj7r4SoPeyFbgMsru/L4bwVdbO z678KzmXv/jodRPkUmfvpaYHLMklaPvQ20bKZYeOz8k+4Uzfa3y+XufpY rDxI9txtL/1V/EWlrsXlbtl+TKKaq21XtsEop3Zsi3j4nivZuH825WTUU mWtp8Z3u+pwV4L6tqQ8SyxMvSpS9FEcosFX2B61aEgjr7r3xuIM5mulpK Nek2HkPyk9c76qK8gtc6Q9HQvmzMqNflh7CC0MnlWhfNGqFfYEPrHFBoz g==; X-IronPort-AV: E=McAfee;i="6500,9779,10457"; a="382159498" X-IronPort-AV: E=Sophos;i="5.93,281,1654585200"; d="scan'208";a="382159498" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2022 17:18:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,281,1654585200"; d="scan'208";a="681078139" Received: from andromeda02.png.intel.com ([10.221.253.198]) by fmsmga004.fm.intel.com with ESMTP; 01 Sep 2022 17:18:31 -0700 From: yock.gen.mah@intel.com To: qi.z.zhang@intel.com Cc: dev@dpdk.org Subject: [PATCH v3] IGC: Remove I225_I_PHY_ID checking Date: Fri, 2 Sep 2022 08:18:28 +0800 Message-Id: <20220902001828.1977-1-yock.gen.mah@intel.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220831225139.78201-1-iotg.dpdk.ref.app@intel.com> References: <20220831225139.78201-1-iotg.dpdk.ref.app@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Fri, 02 Sep 2022 09:02:05 +0200 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Mah Yock Gen i225 devices have only one PHY vendor. There is unnecessary to check _I_PHY_ID during the link establishment and auto-negotiation process, the checking also caused devices like i225-IT failed. This patch is to remove the mentioned unnecessary checking. Cc: stable@dpdk.org Co-developed-by: Mah Yock Gen Signed-off-by: Mah Yock Gen Co-developed-by: Taripin Samuel Signed-off-by: Taripin Samuel Signed-off-by: Mah Yock Gen --- V3: * Fixed coding style issue V2: * Removing i225-IT device id added in V1 patch, as it has been superseded drivers/net/igc/base/igc_i225.c | 15 ++------------- drivers/net/igc/base/igc_phy.c | 6 ++---- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/net/igc/base/igc_i225.c b/drivers/net/igc/base/igc_i225.c index 5f3d535490..180d3cf687 100644 --- a/drivers/net/igc/base/igc_i225.c +++ b/drivers/net/igc/base/igc_i225.c @@ -173,19 +173,8 @@ static s32 igc_init_phy_params_i225(struct igc_hw *hw) phy->ops.write_reg = igc_write_phy_reg_gpy; ret_val = igc_get_phy_id(hw); - /* Verify phy id and set remaining function pointers */ - switch (phy->id) { - case I225_I_PHY_ID: - case I226_LM_PHY_ID: - phy->type = igc_phy_i225; - phy->ops.set_d0_lplu_state = igc_set_d0_lplu_state_i225; - phy->ops.set_d3_lplu_state = igc_set_d3_lplu_state_i225; - /* TODO - complete with GPY PHY information */ - break; - default: - ret_val = -IGC_ERR_PHY; - goto out; - } + phy->type = igc_phy_i225; + out: return ret_val; diff --git a/drivers/net/igc/base/igc_phy.c b/drivers/net/igc/base/igc_phy.c index 43bbe69bca..2906bae21a 100644 --- a/drivers/net/igc/base/igc_phy.c +++ b/drivers/net/igc/base/igc_phy.c @@ -1474,8 +1474,7 @@ s32 igc_phy_setup_autoneg(struct igc_hw *hw) return ret_val; } - if ((phy->autoneg_mask & ADVERTISE_2500_FULL) && - hw->phy.id == I225_I_PHY_ID) { + if (phy->autoneg_mask & ADVERTISE_2500_FULL) { /* Read the MULTI GBT AN Control Register - reg 7.32 */ ret_val = phy->ops.read_reg(hw, (STANDARD_AN_REG_MASK << MMD_DEVADDR_SHIFT) | @@ -1615,8 +1614,7 @@ s32 igc_phy_setup_autoneg(struct igc_hw *hw) ret_val = phy->ops.write_reg(hw, PHY_1000T_CTRL, mii_1000t_ctrl_reg); - if ((phy->autoneg_mask & ADVERTISE_2500_FULL) && - hw->phy.id == I225_I_PHY_ID) + if (phy->autoneg_mask & ADVERTISE_2500_FULL) ret_val = phy->ops.write_reg(hw, (STANDARD_AN_REG_MASK << MMD_DEVADDR_SHIFT) | -- 2.36.1