git: 1a9342cfb036 - stable/12 - bnxt(4): Fix bugs in WOL support.

Alexander Motin mav at FreeBSD.org
Thu Sep 16 01:44:13 UTC 2021


The branch stable/12 has been updated by mav:

URL: https://cgit.FreeBSD.org/src/commit/?id=1a9342cfb036b22fad93759c6093139ead6ecddb

commit 1a9342cfb036b22fad93759c6093139ead6ecddb
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-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;


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