git: 8c14d7da5b9b - main - bnxt(4): Fix bugs in WOL support.

Alexander Motin mav at FreeBSD.org
Thu Sep 2 22:23:14 UTC 2021


The branch main has been updated by mav:

URL: https://cgit.FreeBSD.org/src/commit/?id=8c14d7da5b9be78f71b1aa803e93ae7de973dd42

commit 8c14d7da5b9be78f71b1aa803e93ae7de973dd42
Author:     Alexander Motin <mav at FreeBSD.org>
AuthorDate: 2021-09-02 22:11:58 +0000
Commit:     Alexander Motin <mav at FreeBSD.org>
CommitDate: 2021-09-02 22:23:05 +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.
---
 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;


More information about the dev-commits-src-all mailing list