Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Sep 2021 01:43:42 GMT
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 8895170347fc - stable/13 - bnxt(4): Fix bugs in WOL support.
Message-ID:  <202109160143.18G1hg6q057055@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by mav:

URL: https://cgit.FreeBSD.org/src/commit/?id=8895170347fcfd9c9acf413ed408f11b15760b4b

commit 8895170347fcfd9c9acf413ed408f11b15760b4b
Author:     Alexander Motin <mav@FreeBSD.org>
AuthorDate: 2021-09-02 22:11:58 +0000
Commit:     Alexander Motin <mav@FreeBSD.org>
CommitDate: 2021-09-16 01:43:40 +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 9990e26263b3..52d989a88392 100644
--- a/sys/dev/bnxt/if_bnxt.c
+++ b/sys/dev/bnxt/if_bnxt.c
@@ -796,6 +796,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 */
@@ -805,8 +808,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);
@@ -1600,7 +1601,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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109160143.18G1hg6q057055>