svn commit: r188182 - head/sys/net80211

Sam Leffler sam at FreeBSD.org
Thu Feb 5 12:26:54 PST 2009


Author: sam
Date: Thu Feb  5 20:26:53 2009
New Revision: 188182
URL: http://svn.freebsd.org/changeset/base/188182

Log:
  o change _db_show_key to always dump the contents instead of checking
    IEEE80211_KEY_DEVKEY
  o fix channel power printing (they are signed values)
  o add show statab to dump a node table and automatically dump the sta
    table of a com structure with /s

Modified:
  head/sys/net80211/ieee80211_ddb.c

Modified: head/sys/net80211/ieee80211_ddb.c
==============================================================================
--- head/sys/net80211/ieee80211_ddb.c	Thu Feb  5 20:13:51 2009	(r188181)
+++ head/sys/net80211/ieee80211_ddb.c	Thu Feb  5 20:26:53 2009	(r188182)
@@ -61,6 +61,8 @@ static void _db_show_vap(const struct ie
 static void _db_show_com(const struct ieee80211com *,
 	int showvaps, int showsta, int showprocs);
 
+static void _db_show_node_table(const char *tag,
+	const struct ieee80211_node_table *);
 static void _db_show_channel(const char *tag, const struct ieee80211_channel *);
 static void _db_show_ssid(const char *tag, int ix, int len, const uint8_t *);
 static void _db_show_appie(const char *tag, const struct ieee80211_appie *);
@@ -80,6 +82,15 @@ DB_SHOW_COMMAND(sta, db_show_sta)
 	_db_show_sta((const struct ieee80211_node *) addr);
 }
 
+DB_SHOW_COMMAND(statab, db_show_statab)
+{
+	if (!have_addr) {
+		db_printf("usage: show statab <addr>\n");
+		return;
+	}
+	_db_show_node_table("", (const struct ieee80211_node_table *) addr);
+}
+
 DB_SHOW_COMMAND(vap, db_show_vap)
 {
 	int i, showprocs = 0;
@@ -509,9 +520,12 @@ _db_show_com(const struct ieee80211com *
 	db_printf("\n");
 
 	db_printf("\tmax_keyix %d", ic->ic_max_keyix);
-	db_printf(" sta %p", &ic->ic_sta);
 	db_printf(" wme %p", &ic->ic_wme);
+	if (!showsta)
+		db_printf(" sta %p", &ic->ic_sta);
 	db_printf("\n");
+	if (showsta)
+		_db_show_node_table("\t", &ic->ic_sta);
 
 	db_printf("\tprotmode %d", ic->ic_protmode);
 	db_printf(" nonerpsta %u", ic->ic_nonerpsta);
@@ -576,6 +590,26 @@ _db_show_com(const struct ieee80211com *
 }
 
 static void
+_db_show_node_table(const char *tag, const struct ieee80211_node_table *nt)
+{
+	int i;
+
+	db_printf("%s%s@%p:\n", tag, nt->nt_name, nt);
+	db_printf("%s  nodelock %p", tag, &nt->nt_nodelock);
+	db_printf(" inact_init %d", nt->nt_inact_init);
+	db_printf(" scanlock %p", &nt->nt_scanlock);
+	db_printf(" scangen %u\n", nt->nt_scangen);
+	db_printf("%s  keyixmax %d keyixmap %p\n",
+	    tag, nt->nt_keyixmax, nt->nt_keyixmap);
+	for (i = 0; i < nt->nt_keyixmax; i++) {
+		const struct ieee80211_node *ni = nt->nt_keyixmap[i];
+		if (ni != NULL)
+			db_printf("%s  [%3u] %p %s\n", tag, i, ni,
+			    ether_sprintf(ni->ni_macaddr));
+	}
+}
+
+static void
 _db_show_channel(const char *tag, const struct ieee80211_channel *c)
 {
 	db_printf("%s ", tag);
@@ -584,7 +618,7 @@ _db_show_channel(const char *tag, const 
 	else if (c == IEEE80211_CHAN_ANYC)
 		db_printf("<ANY>");
 	else
-		db_printf("[%u (%u) flags=%b maxreg %u maxpow %u minpow %u state 0x%x extieee %u]",
+		db_printf("[%u (%u) flags=%b maxreg %d maxpow %d minpow %d state 0x%x extieee %u]",
 		    c->ic_freq, c->ic_ieee,
 		    c->ic_flags, IEEE80211_CHAN_BITS,
 		    c->ic_maxregpower, c->ic_maxpower, c->ic_minpower,
@@ -639,8 +673,6 @@ _db_show_key(const char *tag, int ix, co
 	const struct ieee80211_cipher *cip = wk->wk_cipher;
 	int keylen = wk->wk_keylen;
 
-	if ((wk->wk_flags & IEEE80211_KEY_DEVKEY) == 0)
-		return;
 	db_printf(tag, ix);
 	switch (cip->ic_cipher) {
 	case IEEE80211_CIPHER_WEP:


More information about the svn-src-head mailing list