The branch main has been updated by bz:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=7513a0afe5fb26d30dbcae0347e43728e3511d3e

commit 7513a0afe5fb26d30dbcae0347e43728e3511d3e
Author:     Bjoern A. Zeeb <b...@freebsd.org>
AuthorDate: 2025-03-14 23:43:17 +0000
Commit:     Bjoern A. Zeeb <b...@freebsd.org>
CommitDate: 2025-03-18 09:21:57 +0000

    net80211: make use of IEEE80211_KEY_BITS for debug messages
    
    Use %b with IEEE80211_KEY_BITS for the debug logging in
    ieee80211_crypto.c rather than just printing the hex value, which
    makes some of the messages more obvious and avoids having the header
    file next to one at all times.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
    Reviewed by:    adrian
    Differential Revision: https://reviews.freebsd.org/D49369
---
 sys/net80211/ieee80211_crypto.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/sys/net80211/ieee80211_crypto.c b/sys/net80211/ieee80211_crypto.c
index b1c8b750e145..600d69d6043b 100644
--- a/sys/net80211/ieee80211_crypto.c
+++ b/sys/net80211/ieee80211_crypto.c
@@ -466,14 +466,15 @@ ieee80211_crypto_newkey(struct ieee80211vap *vap,
                         */
                        IEEE80211_DPRINTF(vap, IEEE80211_MSG_CRYPTO,
                            "%s: driver override for cipher %s, flags "
-                           "0x%x -> 0x%x\n", __func__, cip->ic_name,
-                           oflags, key->wk_flags);
+                           "%b -> %b\n", __func__, cip->ic_name,
+                           oflags, IEEE80211_KEY_BITS,
+                           key->wk_flags, IEEE80211_KEY_BITS);
                        keyctx = cip->ic_attach(vap, key);
                        if (keyctx == NULL) {
                                IEEE80211_DPRINTF(vap, IEEE80211_MSG_CRYPTO,
                                    "%s: unable to attach cipher %s with "
-                                   "flags 0x%x\n", __func__, cip->ic_name,
-                                   key->wk_flags);
+                                   "flags %b\n", __func__, cip->ic_name,
+                                   key->wk_flags, IEEE80211_KEY_BITS);
                                key->wk_flags = oflags; /* restore old flags */
                                vap->iv_stats.is_crypto_attachfail++;
                                return 0;
@@ -498,9 +499,9 @@ _ieee80211_crypto_delkey(struct ieee80211vap *vap, struct 
ieee80211_key *key)
        KASSERT(key->wk_cipher != NULL, ("No cipher!"));
 
        IEEE80211_DPRINTF(vap, IEEE80211_MSG_CRYPTO,
-           "%s: %s keyix %u flags 0x%x rsc %ju tsc %ju len %u\n",
+           "%s: %s keyix %u flags %b rsc %ju tsc %ju len %u\n",
            __func__, key->wk_cipher->ic_name,
-           key->wk_keyix, key->wk_flags,
+           key->wk_keyix, key->wk_flags, IEEE80211_KEY_BITS,
            key->wk_keyrsc[IEEE80211_NONQOS_TID], key->wk_keytsc,
            key->wk_keylen);
 
@@ -566,9 +567,9 @@ ieee80211_crypto_setkey(struct ieee80211vap *vap, struct 
ieee80211_key *key)
        KASSERT(cip != NULL, ("No cipher!"));
 
        IEEE80211_DPRINTF(vap, IEEE80211_MSG_CRYPTO,
-           "%s: %s keyix %u flags 0x%x mac %s rsc %ju tsc %ju len %u\n",
+           "%s: %s keyix %u flags %b mac %s rsc %ju tsc %ju len %u\n",
            __func__, cip->ic_name, key->wk_keyix,
-           key->wk_flags, ether_sprintf(key->wk_macaddr),
+           key->wk_flags, IEEE80211_KEY_BITS, ether_sprintf(key->wk_macaddr),
            key->wk_keyrsc[IEEE80211_NONQOS_TID], key->wk_keytsc,
            key->wk_keylen);
 
@@ -586,9 +587,9 @@ ieee80211_crypto_setkey(struct ieee80211vap *vap, struct 
ieee80211_key *key)
         */
        if (!cip->ic_setkey(key)) {
                IEEE80211_DPRINTF(vap, IEEE80211_MSG_CRYPTO,
-                   "%s: cipher %s rejected key index %u len %u flags 0x%x\n",
+                   "%s: cipher %s rejected key index %u len %u flags %b\n",
                    __func__, cip->ic_name, key->wk_keyix,
-                   key->wk_keylen, key->wk_flags);
+                   key->wk_keylen, key->wk_flags, IEEE80211_KEY_BITS);
                vap->iv_stats.is_crypto_setkey_cipher++;
                return 0;
        }

Reply via email to