From nobody Thu Nov 21 05:52:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xv6nP02RKz5fHBY; Thu, 21 Nov 2024 05:52:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xv6nN6gKDz4qQq; Thu, 21 Nov 2024 05:52:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732168328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fes70WqxV2iIozuhm3KxoX/U/vx9SAMLGphPSdE9lWg=; b=TGgUBZ/TvBpcX2VzHPsOzGnzhQt05QUrqEqFcbxJIK5zAfRhrWRqK76+CINVqVtxLSL4oy iwucXaUWLrGJFtWk6ylp61hdfJ8uUlXCAfcem18+TDlcr+7fRRTyIsNISmGnVAOf1vHBHO qLe5MXP3WoQBNXfzij5RUOo9Tmmt2K3GEDYZtdhFPvcv4AU3npXp0TdPZIdNkGWeefIJ80 VssTOUoE/tKOSlWk27N/PA7ndGKyB+tcAh2TyhvqMuoVs+uaHEAK0Q/k6kgWddMxpFND/7 KrCzFiToW1dpg7megi9yeYN65J8kdY26tNCcVQ02KhTZhr2TiQHwaanmKpFh4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732168328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fes70WqxV2iIozuhm3KxoX/U/vx9SAMLGphPSdE9lWg=; b=hw+OBLW7MM8u2eJ3psZPE56hB9erJT62ASDKDuNJOGidIdJ/pQp8GnLpArtUmVAge+Wu51 69176CsXSM7eBwBYCuky3t1lh8uC1OMZxElA332LjtfXDgGmhcfO69W1bnF/osJFvBUPXE W50/mBhGOxzQS3eA2d6hPvnmhZWNd/Ovmc0LJbWB+5idBDmMR8wjQiIQH15fHPCJRWLENu 0jKBlWVjbb74v30BA+21qUktsidN43gNA/zx6ZLjq+mjIko6X7BphK6w2V8anH4ZhyfHeX 1BFKS6AGBlmQ2f9knOCJIM1eQN5RS/M7xIhLc0aFTE0r2nc6s6GrzdHbYRTaQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732168328; a=rsa-sha256; cv=none; b=v3XAD2SrM6/NnIlao4xQDRhgC+Jt2dveKLLtvEZNdA6H+aOeaUdy1lZxLfvWXrMF7ggBZM QVK14FUQ9HUOuptWwIqnYrUhJnVbtPg7R9h4ycu0n8uolSLwkJ7jrXXugjEG2hFbXXaQ9E 2q0jS7StL6Be2/5LDQ7CqrBGnIugjQHBMcY7N9QiJXuvjdk/oOMRYKCS1kb+S3w13I7OnZ l5+eXqf1wwU55GyaDevU345iCa2hCKpgVLeYJIYn4gmZrIKTffVe8HYUocaqqZeRIIrb5r EyFdb9xzLEuek0Fs3SVDHTTY9lvSt/YmvCQ6/ziFuBFR3ZFy4zBQgdqCHck3WA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xv6nN6H9mzR8C; Thu, 21 Nov 2024 05:52:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4AL5q8rt037120; Thu, 21 Nov 2024 05:52:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AL5q8VR037101; Thu, 21 Nov 2024 05:52:08 GMT (envelope-from git) Date: Thu, 21 Nov 2024 05:52:08 GMT Message-Id: <202411210552.4AL5q8VR037101@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: c66d2795bdb5 - stable/14 - e1000: Improve igb(4) SFP support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c66d2795bdb5368045fd2f946038d5196b0f8817 Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=c66d2795bdb5368045fd2f946038d5196b0f8817 commit c66d2795bdb5368045fd2f946038d5196b0f8817 Author: Kevin Bowling AuthorDate: 2024-11-07 06:02:10 +0000 Commit: Kevin Bowling CommitDate: 2024-11-21 05:51:50 +0000 e1000: Improve igb(4) SFP support * Adds support for SFPs that are not correctly coded as an SFP transceiver. i.e. Coherent-Finisar FCLF8522P2BTL. * Configures multi-rate SFPs i.e. Coherent-Finisar FCLF8522P2BTL as SGMII so they can do 10/100/1000 auto-negotiation. * Adds support for 100BaseLX SGMII transceivers. * Some code cleanup and additional debugging. Reviewed by: emaste, markj, Franco Fichtner Tested by: Natalino Picone Sponsored by: Nozomi Networks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D47337 (cherry picked from commit 15853a5fc9548d9805a2ef22f24e2eb580198341) --- sys/dev/e1000/e1000_82575.c | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/sys/dev/e1000/e1000_82575.c b/sys/dev/e1000/e1000_82575.c index a33aa9eb2903..47b8006314f8 100644 --- a/sys/dev/e1000/e1000_82575.c +++ b/sys/dev/e1000/e1000_82575.c @@ -1686,20 +1686,19 @@ static s32 e1000_get_media_type_82575(struct e1000_hw *hw) break; } - /* do not change link mode for 100BaseFX */ - if (dev_spec->eth_flags.e100_base_fx) - break; - /* change current link mode setting */ ctrl_ext &= ~E1000_CTRL_EXT_LINK_MODE_MASK; - if (hw->phy.media_type == e1000_media_type_copper) + if (dev_spec->sgmii_active) ctrl_ext |= E1000_CTRL_EXT_LINK_MODE_SGMII; else ctrl_ext |= E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES; E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext); + break; + default: + DEBUGOUT("e1000_get_media_type_82575 unknown link type\n"); break; } @@ -1750,24 +1749,27 @@ static s32 e1000_set_sfp_media_type_82575(struct e1000_hw *hw) /* Check if there is some SFP module plugged and powered */ if ((tranceiver_type == E1000_SFF_IDENTIFIER_SFP) || - (tranceiver_type == E1000_SFF_IDENTIFIER_SFF)) { + (tranceiver_type == E1000_SFF_IDENTIFIER_SFF)) dev_spec->module_plugged = true; - if (eth_flags->e1000_base_lx || eth_flags->e1000_base_sx) { - hw->phy.media_type = e1000_media_type_internal_serdes; - } else if (eth_flags->e100_base_fx) { - dev_spec->sgmii_active = true; - hw->phy.media_type = e1000_media_type_internal_serdes; - } else if (eth_flags->e1000_base_t) { - dev_spec->sgmii_active = true; - hw->phy.media_type = e1000_media_type_copper; - } else { - hw->phy.media_type = e1000_media_type_unknown; - DEBUGOUT("PHY module has not been recognized\n"); - goto out; - } + else + DEBUGOUT("PHY module is not SFP/SFF %x\n", tranceiver_type); + + if (eth_flags->e1000_base_lx || eth_flags->e1000_base_sx) { + hw->phy.media_type = e1000_media_type_internal_serdes; + DEBUGOUT("PHY module is 1000_base_lxsx\n"); + } else if (eth_flags->e100_base_fx || eth_flags->e100_base_lx) { + dev_spec->sgmii_active = true; + hw->phy.media_type = e1000_media_type_internal_serdes; + DEBUGOUT("PHY module is 100_base_fxlx\n"); + } else if (eth_flags->e1000_base_t) { + dev_spec->sgmii_active = true; + hw->phy.media_type = e1000_media_type_copper; + DEBUGOUT("PHY module is 1000_base_t\n"); } else { hw->phy.media_type = e1000_media_type_unknown; + DEBUGOUT("PHY module has not been recognized\n"); } + ret_val = E1000_SUCCESS; out: /* Restore I2C interface setting */