From 9ffeae830f4a1ee2e4f57c1a88756b4cd560ccda Mon Sep 17 00:00:00 2001 From: sam Date: Sat, 25 Oct 2008 23:23:41 +0000 Subject: add/improve debug msgs --- sys/net80211/ieee80211_adhoc.c | 14 ++++++++++++-- sys/net80211/ieee80211_crypto.c | 4 ++++ sys/net80211/ieee80211_sta.c | 4 ++-- 3 files changed, 18 insertions(+), 4 deletions(-) (limited to 'sys/net80211') diff --git a/sys/net80211/ieee80211_adhoc.c b/sys/net80211/ieee80211_adhoc.c index 32de8cc..cbd11fd 100644 --- a/sys/net80211/ieee80211_adhoc.c +++ b/sys/net80211/ieee80211_adhoc.c @@ -209,8 +209,8 @@ adhoc_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) break; default: invalid: - IEEE80211_DPRINTF(vap, IEEE80211_MSG_ANY, - "%s: invalid state transition %s -> %s\n", __func__, + IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, + "%s: unexpected state transition %s -> %s\n", __func__, ieee80211_state_name[ostate], ieee80211_state_name[nstate]); break; } @@ -735,11 +735,16 @@ adhoc_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, case IEEE80211_FC0_SUBTYPE_PROBE_REQ: if (vap->iv_state != IEEE80211_S_RUN) { + IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, + wh, NULL, "wrong state %s", + ieee80211_state_name[vap->iv_state]); vap->iv_stats.is_rx_mgtdiscard++; return; } if (IEEE80211_IS_MULTICAST(wh->i_addr2)) { /* frame must be directed */ + IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, + wh, NULL, "%s", "not unicast"); vap->iv_stats.is_rx_mgtdiscard++; /* XXX stat */ return; } @@ -798,6 +803,9 @@ adhoc_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, const struct ieee80211_action *ia; if (vap->iv_state != IEEE80211_S_RUN) { + IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, + wh, NULL, "wrong state %s", + ieee80211_state_name[vap->iv_state]); vap->iv_stats.is_rx_mgtdiscard++; return; } @@ -857,6 +865,8 @@ adhoc_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, case IEEE80211_FC0_SUBTYPE_REASSOC_RESP: case IEEE80211_FC0_SUBTYPE_DEAUTH: case IEEE80211_FC0_SUBTYPE_DISASSOC: + IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, + wh, NULL, "%s", "not handled"); vap->iv_stats.is_rx_mgtdiscard++; return; diff --git a/sys/net80211/ieee80211_crypto.c b/sys/net80211/ieee80211_crypto.c index 86dc0ff..126de72 100644 --- a/sys/net80211/ieee80211_crypto.c +++ b/sys/net80211/ieee80211_crypto.c @@ -267,6 +267,10 @@ ieee80211_crypto_newkey(struct ieee80211vap *vap, void *keyctx; int oflags; + IEEE80211_DPRINTF(vap, IEEE80211_MSG_CRYPTO, + "%s: cipher %u flags 0x%x keyix %u\n", + __func__, cipher, flags, key->wk_keyix); + /* * Validate cipher and set reference to cipher routines. */ diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c index c50fa53..293616e 100644 --- a/sys/net80211/ieee80211_sta.c +++ b/sys/net80211/ieee80211_sta.c @@ -406,8 +406,8 @@ sta_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) break; default: invalid: - IEEE80211_DPRINTF(vap, IEEE80211_MSG_ANY, - "%s: invalid state transition %s -> %s\n", __func__, + IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, + "%s: unexpected state transition %s -> %s\n", __func__, ieee80211_state_name[ostate], ieee80211_state_name[nstate]); break; } -- cgit v1.1