From owner-dev-commits-src-branches@freebsd.org Thu Sep 16 01:44:13 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BF805672503; Thu, 16 Sep 2021 01:44:13 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H90Hd53Jfz4lcS; Thu, 16 Sep 2021 01:44:13 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 8DEC3189DD; Thu, 16 Sep 2021 01:44:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18G1iDAr057214; Thu, 16 Sep 2021 01:44:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18G1iDVj057213; Thu, 16 Sep 2021 01:44:13 GMT (envelope-from git) Date: Thu, 16 Sep 2021 01:44:13 GMT Message-Id: <202109160144.18G1iDVj057213@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 1a9342cfb036 - stable/12 - bnxt(4): Fix bugs in WOL support. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 1a9342cfb036b22fad93759c6093139ead6ecddb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 01:44:13 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=1a9342cfb036b22fad93759c6093139ead6ecddb commit 1a9342cfb036b22fad93759c6093139ead6ecddb Author: Alexander Motin AuthorDate: 2021-09-02 22:11:58 +0000 Commit: Alexander Motin CommitDate: 2021-09-16 01:44:06 +0000 bnxt(4): Fix bugs in WOL support. Before this change driver reported IFCAP_WOL_MAGIC enabled, but not supported. It caused errors on some SIOCSIFCAP calls. Instead report the support if hardware supports WOL, and enabled status if it has such filter installed on boot. Also bnxt_wol_config() should check WOL status in if_getcapenable(), not in if_getcapabilities() to get current one. MFC after: 2 weeks Sponsored by: iXsystems, Inc. (cherry picked from commit 8c14d7da5b9be78f71b1aa803e93ae7de973dd42) --- sys/dev/bnxt/if_bnxt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c index 002a18a2ee29..381c4df49372 100644 --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -798,6 +798,9 @@ bnxt_attach_pre(if_ctx_t ctx) IFCAP_VLAN_HWCSUM | IFCAP_JUMBO_MTU; if (bnxt_wol_supported(softc)) + scctx->isc_capabilities |= IFCAP_WOL_MAGIC; + bnxt_get_wol_settings(softc); + if (softc->wol) scctx->isc_capenable |= IFCAP_WOL_MAGIC; /* Get the queue config */ @@ -807,8 +810,6 @@ bnxt_attach_pre(if_ctx_t ctx) goto failed; } - bnxt_get_wol_settings(softc); - /* Now perform a function reset */ rc = bnxt_hwrm_func_reset(softc); bnxt_clear_ids(softc); @@ -1593,7 +1594,7 @@ bnxt_wol_config(if_ctx_t ctx) if (!bnxt_wol_supported(softc)) return -ENOTSUP; - if (if_getcapabilities(ifp) & IFCAP_WOL_MAGIC) { + if (if_getcapenable(ifp) & IFCAP_WOL_MAGIC) { if (!softc->wol) { if (bnxt_hwrm_alloc_wol_fltr(softc)) return -EBUSY;