svn commit: r188170 - head/sys/net80211

Sam Leffler sam at FreeBSD.org
Thu Feb 5 11:20:35 PST 2009


Author: sam
Date: Thu Feb  5 19:20:34 2009
New Revision: 188170
URL: http://svn.freebsd.org/changeset/base/188170

Log:
  o add IEEE80211_KEY_BITS for %b printing of wk_flags
  o replace hand-rolled code to print wk_flags
  o add display of ni_ucastkey in show sta
  o fix \n in _db_show_key

Modified:
  head/sys/net80211/ieee80211_crypto.h
  head/sys/net80211/ieee80211_ddb.c

Modified: head/sys/net80211/ieee80211_crypto.h
==============================================================================
--- head/sys/net80211/ieee80211_crypto.h	Thu Feb  5 19:09:15 2009	(r188169)
+++ head/sys/net80211/ieee80211_crypto.h	Thu Feb  5 19:20:34 2009	(r188170)
@@ -104,6 +104,10 @@ struct ieee80211_key {
 	(IEEE80211_KEY_SWENCRYPT | IEEE80211_KEY_SWDECRYPT)
 #define	IEEE80211_KEY_SWMIC	(IEEE80211_KEY_SWENMIC | IEEE80211_KEY_SWDEMIC)
 
+#define	IEEE80211_KEY_BITS \
+	"\20\1XMIT\2RECV\3GROUP\4SWENCRYPT\5SWDECRYPT\6SWENMIC\7SWDEMIC" \
+	"\10DEVKEY\11CIPHER0\12CIPHER1"
+
 #define	IEEE80211_KEYIX_NONE	((ieee80211_keyix) -1)
 
 /*

Modified: head/sys/net80211/ieee80211_ddb.c
==============================================================================
--- head/sys/net80211/ieee80211_ddb.c	Thu Feb  5 19:09:15 2009	(r188169)
+++ head/sys/net80211/ieee80211_ddb.c	Thu Feb  5 19:20:34 2009	(r188170)
@@ -219,6 +219,7 @@ _db_show_sta(const struct ieee80211_node
 		ni->ni_rxfragstamp);
 	db_printf("\trxfrag[0] %p rxfrag[1] %p rxfrag[2] %p\n",
 		ni->ni_rxfrag[0], ni->ni_rxfrag[1], ni->ni_rxfrag[2]);
+	_db_show_key("\tucastkey", 0, &ni->ni_ucastkey);
 	db_printf("\trstamp %u avgrssi 0x%x (rssi %d) noise %d\n",
 		ni->ni_rstamp, ni->ni_avgrssi,
 		IEEE80211_RSSI_GET(ni->ni_avgrssi), ni->ni_noise);
@@ -670,6 +671,8 @@ _db_show_key(const char *tag, int ix, co
 			cip->ic_cipher, wk->wk_keyix, 8*keylen);
 		break;
 	}
+	if (wk->wk_rxkeyix != wk->wk_keyix)
+		db_printf(" rxkeyix %u", wk->wk_rxkeyix);
 	if (memcmp(wk->wk_key, zerodata, keylen) != 0) {
 		int i;
 
@@ -683,22 +686,9 @@ _db_show_key(const char *tag, int ix, co
 		if (cip->ic_cipher != IEEE80211_CIPHER_WEP &&
 		    wk->wk_keytsc != 0)
 			db_printf(" tsc %ju", (uintmax_t)wk->wk_keytsc);
-		if (wk->wk_flags != 0) {
-			const char *sep = " ";
-
-			if (wk->wk_flags & IEEE80211_KEY_XMIT)
-				db_printf("%stx", sep), sep = "+";
-			if (wk->wk_flags & IEEE80211_KEY_RECV)
-				db_printf("%srx", sep), sep = "+";
-			if (wk->wk_flags & IEEE80211_KEY_DEFAULT)
-				db_printf("%sdef", sep), sep = "+";
-			if (wk->wk_flags & IEEE80211_KEY_SWCRYPT)
-				db_printf("%sswcrypt", sep), sep = "+";
-			if (wk->wk_flags & IEEE80211_KEY_SWMIC)
-				db_printf("%sswmic", sep), sep = "+";
-		}
-		db_printf("\n");
+		db_printf(" flags=%b", wk->wk_flags, IEEE80211_KEY_BITS);
 	}
+	db_printf("\n");
 }
 
 static void


More information about the svn-src-all mailing list