From nobody Thu Nov 07 06:16:29 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 4XkWzy0JK0z5cRJL; Thu, 07 Nov 2024 06:16:30 +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 4XkWzx6vdRz3y0y; Thu, 7 Nov 2024 06:16:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730960190; 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=Lwwyos9KmGoYoncYEM4muQCdJAFR9VxiMyeMZhwBICs=; b=nvQtAxGd7QgylljVqFP1xkyaLffC7G5J0KwwChTs5hkkc60utcV+ChkNbZPfY0+K1Z83PK y+whqt7YX6b9Xo5MRQSNV0ZDguqVxleKGelK/p/c7VBZpa5fyQsKZS3t/sY2JHTqhQRNzt U1npri6uwJ3yY7UhL+lP5Gyd+9zGhagQje3Avff9a4YT9e6JVeV54FlGTnNvff4q/+4+JG wVGftbpAt5fUmyork7YftY6c6sqIKj5ESvJ7bx88r10KA4OJzFvPeGr0lf9Sa18waSLgyZ 9gnBQfWuu/ycIfvXv+PUlv48hjfHYXUYcku+Fxml1/xgFqvSO1P6pbnNhEr4ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730960190; 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=Lwwyos9KmGoYoncYEM4muQCdJAFR9VxiMyeMZhwBICs=; b=puqTGm3XZYRfYvUHTH5C/N1wIxe9dB3gYDFbgHqffU8VcrQFzXOXftTtz2Tq1UhW6nyA4X EJUopFTB2OpryaZ9kiCyHQo+4lhXI7c9ktt/8TZ8KRCy445hnYuILoY3Hq1HQr0Ma+8jXv 5D4nZgFQPdaB3uX/12/AN95wlOexNL0Z3ks/txFM4ovssRi/R7BbGXEqCgMLm1KVaVuIKE HA2QFkr+gicXxBtMRAXV0BX4d2xvx3O2VWWuS1ccbyDIIPY2/c4loonGN7SZSMAa+wtuPd qR5h9TOzM7iKxpG3iKEbhU5Cabeu4+fo2u2b2B69q98DhtaZENNYZnJhOWjJHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730960190; a=rsa-sha256; cv=none; b=hKjWWLizbeRyU+LsRSIjr3mec3q/MEB/fsXFWZrMYL31vK2Bwaz/03EZ3xzn9DytgH6BmE rrwFNledPsr0/ynGkS1dYFZmpw+qzIte4PBeb078pS6UWN6J/ZnpvXbWIRDNSQrNUKT/Ow gO23doZjjI8IsxFuwksQKJp9VYDu/Ic5vgRDu76kLGZOxYYg3buHGVttR1moRrS2xi7yl3 SmMoJaixB9OdGclWckLUpsJ9VvDvs4paORSeLE5vN1IeMnIjANVQ6D0WGZbVAJSHExTucX s+QTK2puG6e3++cMxJ3qVl+EJkBDqu7qH771X7NWSwC7RTiZ76BPMRUOP+9ahw== 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 4XkWzx6VbPzZGX; Thu, 7 Nov 2024 06:16:29 +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 4A76GTc8016249; Thu, 7 Nov 2024 06:16:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A76GTjb016246; Thu, 7 Nov 2024 06:16:29 GMT (envelope-from git) Date: Thu, 7 Nov 2024 06:16:29 GMT Message-Id: <202411070616.4A76GTjb016246@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 15853a5fc954 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 15853a5fc9548d9805a2ef22f24e2eb580198341 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=15853a5fc9548d9805a2ef22f24e2eb580198341 commit 15853a5fc9548d9805a2ef22f24e2eb580198341 Author: Kevin Bowling AuthorDate: 2024-11-07 06:02:10 +0000 Commit: Kevin Bowling CommitDate: 2024-11-07 06:10:14 +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 MFC after: 2 weeks Sponsored by: Nozomi Networks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D47337 --- 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 */