From nobody Mon Aug 10 00:41:58 2026 X-Original-To: dev-commits-src-main@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 4hJGD71jS9z6pMXs for ; Mon, 10 Aug 2026 00:41:59 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hJGD70VBGz3nQM for ; Mon, 10 Aug 2026 00:41:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786322519; 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=xtLNgnDlUTou2WLpKNfZKEs2Q65OWZ0KYjYcZeuD+Bc=; b=QBvmNAJjtOttdfFF6wX88Uw/zH+6rTRPo2N94GmIWWrwj+rglstQ4+sal7+DfblnJIZijt euRYneCyCL0fKfMxi9NMo9WoN5sB9V9whsBkPlE4QsRQqGb1oZfcIWjEH8wlfGEzTnCRIO 8dAJkG5m4S/XFri5wDA3xR8GfD9Q6agY9Sgbe/JmDE7ytGbOIbRV7qpwRGds7/OdiqtwWv YnjQ0YvpBC4jWTBeO8VgZIu6p59yulYYzlmzhlXMReMG87fdhzHH5ez8tqZ+F1sYWqHWAv FQMve2Mg+QNk1iHro9ip1f1e6Fenms6g33AZtbLyESOtsEYm9XGE4/2/tbif2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786322519; a=rsa-sha256; cv=none; b=IM8EOba3HvPhhIQc4tC0w00sMJjGjFL9Rev+LxkM19ylg47qrarxLUZVgjaZXI1oQulOnP NEvl7NVJ+6JnlgLegnpwmMBYo0Z3FBZMcdKpUcpY1muA+R6tMYeYhwmPLT0fDKCh6wJeCN Tgb4UBNocxBqYkb7qpvGvkQsdjrw5mnvroCbSHx96B2/NGiDWuWSKvLBNMxVxn4nIu3w8g G0Q7m5rx7eULJEOga7DWXbnyI4Esk8qb0Ms7GnoBLQdJf0h1aagVKlNk2Y0B1oeoLbfbsh FsiTtreKhAmaAGdCQUVbvGZmnoc5GaUpvYMzYDvdODZhm+PIbNaCAnTHQXTOKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786322519; 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=xtLNgnDlUTou2WLpKNfZKEs2Q65OWZ0KYjYcZeuD+Bc=; b=SWJygsWFm/O79Iwl7xv/MjNjJLhd6h2X3P4CRLMGDgRg06Pok2hLxS0G4Ys+ANvllrycGz o+IaSPNAVZvEQBogBmnIBrbtVI8bXYLcWvIPYpqijpyCHkl4Fdzqdm/35Crs+34d13O0lb y9eppPBz2Z5L7niYHhUKg0ZlX91zReAWKYD/9/a7mIjGUWMsEVm8IqVqOBaZ5qnTF3wm2+ 0bv2h5UghtSWeXsX39w9vlesrPgTeeKzt8iafZLv+1k5N1U42qRzvjz5zoDs/C1myAulDJ 76n4SINlsSXFga+ave558SnvGRhGJ5KroVTHdu6nP+rC8g5j+Xa8qOSXLs67qw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hJGD667Sxzmp4 for ; Mon, 10 Aug 2026 00:41:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4324c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 10 Aug 2026 00:41:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 2f1d9ab96214 - main - e1000: Correct 82542 flow-control mode handling List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 2f1d9ab96214db2ec6ce30c44b55a89a7eaa8f6a Auto-Submitted: auto-generated Date: Mon, 10 Aug 2026 00:41:58 +0000 Message-Id: <6a791e56.4324c.3457ed8d@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=2f1d9ab96214db2ec6ce30c44b55a89a7eaa8f6a commit 2f1d9ab96214db2ec6ce30c44b55a89a7eaa8f6a Author: Kevin Bowling AuthorDate: 2026-08-10 00:40:16 +0000 Commit: Kevin Bowling CommitDate: 2026-08-10 00:41:49 +0000 e1000: Correct 82542 flow-control mode handling The 82542-specific setup routine unconditionally reads the NVM default, overwriting a flow-control mode selected by software. It also removes transmit PAUSE support from all 82542 revisions even though the hardware restriction applies only to rev 2.0. Resolve the NVM default only when requested, scope the transmit restriction to rev 2.0, and replace integer bit masking of the enum with explicit valid mode transitions. This restores the behavior from before the Intel shared-code split and resolves -Wassign-enum. Reported by: glebius MFC after: 2 weeks --- sys/dev/e1000/e1000_82542.c | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/sys/dev/e1000/e1000_82542.c b/sys/dev/e1000/e1000_82542.c index e8de9086d05d..0656c6408b30 100644 --- a/sys/dev/e1000/e1000_82542.c +++ b/sys/dev/e1000/e1000_82542.c @@ -317,18 +317,43 @@ static s32 e1000_init_hw_82542(struct e1000_hw *hw) static s32 e1000_setup_link_82542(struct e1000_hw *hw) { struct e1000_mac_info *mac = &hw->mac; - s32 ret_val; + s32 ret_val = E1000_SUCCESS; DEBUGFUNC("e1000_setup_link_82542"); - ret_val = e1000_set_default_fc_generic(hw); - if (ret_val) - goto out; + if (hw->fc.requested_mode == e1000_fc_default) { + ret_val = e1000_set_default_fc_generic(hw); + if (ret_val) + goto out; + } - hw->fc.requested_mode &= ~e1000_fc_tx_pause; + /* 82542 rev 2.0 cannot transmit PAUSE frames. */ + if (hw->revision_id == E1000_REVISION_2) { + switch (hw->fc.requested_mode) { + case e1000_fc_tx_pause: + hw->fc.requested_mode = e1000_fc_none; + break; + case e1000_fc_full: + hw->fc.requested_mode = e1000_fc_rx_pause; + break; + default: + break; + } + } - if (mac->report_tx_early) - hw->fc.requested_mode &= ~e1000_fc_rx_pause; + /* Early transmit reporting is incompatible with receiving PAUSE. */ + if (mac->report_tx_early) { + switch (hw->fc.requested_mode) { + case e1000_fc_rx_pause: + hw->fc.requested_mode = e1000_fc_none; + break; + case e1000_fc_full: + hw->fc.requested_mode = e1000_fc_tx_pause; + break; + default: + break; + } + } /* * Save off the requested flow control mode for use later. Depending