From nobody Mon Aug 10 00:41:58 2026 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 4hJGDD6MgVz6pMXt for ; Mon, 10 Aug 2026 00:42:04 +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 4hJGDD2xXmz3n4P for ; Mon, 10 Aug 2026 00:42:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786322524; 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=vKxjLWjQen9DC80KKIydpZQnJSCEoDQiUNG5j1vH06HdR+FzdpNItHOvn/lQ+yQ5/tvJ9/ 8Im6d5aJ3KcvAM0VOBvRvfpXapNmvsC4f9I3Zql70OJeotzLWcpAQebTDOOu6F5OAUxDAS OSp8F2JXQ9zWFt5d1g5tffKvXEzxGYUmmFJTz0Rqjn4zrJBsazTLABLCJBl7KBgFgvjdKJ +zltC2Gd0CF1Iqw6RMfK19ioGYGFdTLO77UZpnOUnM+lNfpwMgzp6Iysvox+itVAWUsyhG Sb8ilQi+WuhIMsdWfEUD+K9hKrBwjUx+rU5bH1MDvksNUKZtLJ0RZ78m7eexJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786322524; a=rsa-sha256; cv=none; b=ut0QWT1apiAVzuDV85K6MbeVcN3JgWB90BcOiJFG8EmY8+9aoxxFzsbZU9EJflx0Oy5BVQ IOEkUqIKWO7LHbg9wJ8Go94RchDwyx3fPZnqZ5k//KgCaIP3zGIzlJg1Vp3FNWEcA8bxQF NZzl8WyIj3m+EyqGnqrUscKMRDH0S160Oyze8lhgb3HEXwQlM8vfMl8jJTSx0puFBgUndW aduRwyGLjzYAKdYPQaRKTQ92RXsLW5QRw3VcmZKIpzZFNQVyFEbx1jsVPtz8tFHwNCwDD1 hiqiiZVIUU4MPD6qnMtbSo5Wew0MizhkxiuGpIPyfXWVyRVhkOU0EURhbR+Bkg== 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=1786322524; 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=EFXhO7ldD28uH9DyjLxOk8QsJNLIXcSLT6vYod5PdcrZyAA7dlF6EHF5jU6wRx0029ZDOP uFWos0sorMZjb1BD2UNsPVeYr6Lj24Bd5wXYVF6t1FWaRt52RVJZRzVClj3H05ptX0+ZJ+ bYbaVxcwk8BpC9MjZ9GTajGyQzu9vi5xNrhjto0ZbIaK7KKQr+QVpZxRzyDt5ZHO2lAIFn swK8q5pFMblwF5jenx6zD2yipuRiV0RK/wirUQAAF7myMiPwFvXPEwqbxd9DyYROQn9CJ5 GJITKIps01kaHO4J6QtwN/tcsO+kx/X3LVyrPrPQUw5kW4yD2l0lwVdksxD/4w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hJGDC6LjYzmlp for ; Mon, 10 Aug 2026 00:42:03 +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 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 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