From nobody Thu Nov 21 05:52:39 2024 X-Original-To: dev-commits-src-branches@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 4Xv6nz5ksGz5fH6Y; Thu, 21 Nov 2024 05:52:39 +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 4Xv6nz50L6z4qVW; Thu, 21 Nov 2024 05:52:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732168359; 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=B9GxUM1rX140xSvzVeujX1a+iY4eL0HVuTmqILBEF4Y=; b=Uclv1oe4MCu60sMWyI1DU+54X9tqqj5RTswiydoJ/jKu3HvnZ9pXG9YoWIU24r5T+DbrsK RhoH3bWpZWIDZaQn/dP2Yb2MLrpepPBaoGZZEwGjw2GX1unB4B+zTUZlUyU9Lfcy539q3l cZ4DPQd5r1vzkFxDqJKOoCwA+4Fi23yFGEV+/iqKqLU7GRLWoDQ6anOzOGljbB8IWvTAxv E3pL1sMb3QHlriBhIj/PUNPnNfPBfW74nkrJtzu1Ot+0YmlWM2yr+XoU1lTWNx8aIXLDs3 uzr7G4yWFjCxrLdrtXUxWPJxvCWTXUIYMVbIRa1bvyOhUEMmPXJq63upLy7Z+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732168359; 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=B9GxUM1rX140xSvzVeujX1a+iY4eL0HVuTmqILBEF4Y=; b=A0+wJR0Ga8lUjI85FFgyywxk7Nun6PzsIgHlY4+6BWUdBA33fv65FfcdtWRO2KkoDNeE7q OJrNroXzoOmPPJzFVxB2La/+rSWOE86SNyvdKdDA/UXPVgqZgrXsn5ukKrVmrs+Hwv1tGf aeZXGXaiAd6wRGwzKBwYwKDL34/dTxh690Vmfm0uLhXF2qg1brdPEUEN0Bu6rWT3WdaeMi ew+fD8+bhZf4mfQ43aT9UP3OOYKWQebNuEgDgS51eoyKjUktHpkwA3NjyZaETNQvpQEkRR bCSXiAWIHPP5/dFCqUIoNQqIh7lfv4WVJ9gbo2JxlMdTuiaSV9KR94yEM8wUtA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732168359; a=rsa-sha256; cv=none; b=mtPVp/SQ0x4qkhfzLzQ3881nsCpyy0YTQKpJDsEmDbr1L7mVgQ6FAzHzVMoGXdr6FS29QL VMiNrDySGKEl4fqxqtyNpEe96I8CMW8HC/JmMTVaD4HQBtl3UdEN1aYLvY4TiQ/2P52Asv KKoqnL9z+dZ1r3rRJ8464+hmVKP/UZ87aWgV0mhAPi3Tl4fwNF+Q9HpZsff/h9LpynDSwU osuzckxFzPUPbdDgUBbR9H/UOLmhCYCUtSYP4k/rBD65nD5mWm5kqmQK3N+FDxq4L1U46r vzoZPSHtiAZjsj0uYKxpnSvFj8rb8OjJbjw0JEpqVfF3ZcGnB0jhyGQ++TfAPA== 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 4Xv6nz4bnszRjS; Thu, 21 Nov 2024 05:52:39 +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 4AL5qdgx038153; Thu, 21 Nov 2024 05:52:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AL5qdf1038150; Thu, 21 Nov 2024 05:52:39 GMT (envelope-from git) Date: Thu, 21 Nov 2024 05:52:39 GMT Message-Id: <202411210552.4AL5qdf1038150@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: cf6a8711e437 - stable/13 - e1000: Improve igb(4) SFP support List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/13 X-Git-Reftype: branch X-Git-Commit: cf6a8711e437c69da5e2d34d27862a3f8beff892 Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=cf6a8711e437c69da5e2d34d27862a3f8beff892 commit cf6a8711e437c69da5e2d34d27862a3f8beff892 Author: Kevin Bowling AuthorDate: 2024-11-07 06:02:10 +0000 Commit: Kevin Bowling CommitDate: 2024-11-21 05:52:27 +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 */