From 3d91ef20716b75b7cb9058ee567d353b3fad13cd Mon Sep 17 00:00:00 2001 From: mtaylor Date: Fri, 20 Jun 2008 07:32:16 +0000 Subject: [PATCH] Revert portion of commit 3265 which introduced some poor use of strncat (my bad) and needlessly complicated the debug output with prefixes. Thanks, Pavel! :-) git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3738 0192ed92-7a03-0410-a25b-9323aeb14dbd --- ath/if_ath.c | 44 +++++++++++--------------------------------- 1 file changed, 11 insertions(+), 33 deletions(-) diff --git a/ath/if_ath.c b/ath/if_ath.c index baae90c..cf51c7f 100644 --- a/ath/if_ath.c +++ b/ath/if_ath.c @@ -3722,46 +3722,24 @@ ath_keyprint(struct ath_softc *sc, const char *tag, u_int ix, "CLR", }; unsigned int i, n; - static const int MLEN = 1024; - static const int BLEN = 64; - char m[MLEN+1], b[BLEN+1]; - m[MLEN] = '\0'; - b[BLEN] = '\0'; - snprintf(b, BLEN, "%s: [%02u] %-7s ", - tag, ix, ciphers[hk->kv_type]); - strncat(m, b, MLEN); - - for (i = 0, n = hk->kv_len; i < n; i++) { - snprintf(b, BLEN, "%02x", hk->kv_val[i]); - strncat(m, b, MLEN); - } - - snprintf(b, BLEN, " mac " MAC_FMT, MAC_ADDR(mac)); - strncat(m, b, MLEN); + printk("%s: [%02u] %-7s ", tag, ix, ciphers[hk->kv_type]); + for (i = 0, n = hk->kv_len; i < n; i++) + printk("%02x", hk->kv_val[i]); + printk(" mac " MAC_FMT, MAC_ADDR(mac)); if (hk->kv_type == HAL_CIPHER_TKIP) { - snprintf(b, BLEN, " %s ", - sc->sc_splitmic ? "mic" : "rxmic"); - strncat(m, b, MLEN); - - for (i = 0; i < sizeof(hk->kv_mic); i++) { - snprintf(b, BLEN, "%02x", hk->kv_mic[i]); - strncat(m, b, MLEN); - } + printk(" %s ", sc->sc_splitmic ? "mic" : "rxmic"); + for (i = 0; i < sizeof(hk->kv_mic); i++) + printk("%02x", hk->kv_mic[i]); #if HAL_ABI_VERSION > 0x06052200 if (!sc->sc_splitmic) { - strncat(m, " txmic ", MLEN); - for (i = 0; i < sizeof(hk->kv_txmic); i++) { - snprintf(b, BLEN, - "%02x", hk->kv_txmic[i]); - strncat(m, b, MLEN); - } + printk(" txmic "); + for (i = 0; i < sizeof(hk->kv_txmic); i++) + printk("%02x", hk->kv_txmic[i]); } #endif } - strncat(m, "\n", MLEN); - - DPRINTF(sc, ATH_DEBUG_ANY, "%s", m); + printk("\n"); } #endif