From ef0894bfd2b6fcc4dacadaa9acfac1355a09d3a7 Mon Sep 17 00:00:00 2001 From: Weongyo Jeong Date: Fri, 19 Feb 2010 03:36:02 +0000 Subject: [PATCH] o print msgs with length if the frame is too short to pass to net80211. o print key index for debugging if the frame is attempted to decrypt for WEP, AES or TKIP though currently HW decryption isn't supported. --- sys/dev/bwn/if_bwn.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/dev/bwn/if_bwn.c b/sys/dev/bwn/if_bwn.c index 6120474f175c..26d4724b4746 100644 --- a/sys/dev/bwn/if_bwn.c +++ b/sys/dev/bwn/if_bwn.c @@ -9416,19 +9416,24 @@ bwn_rxeof(struct bwn_mac *mac, struct mbuf *m, const void *_rxhdr) padding = (macstat & BWN_RX_MAC_PADDING) ? 2 : 0; if (m->m_pkthdr.len < (sizeof(struct bwn_plcp6) + padding)) { - device_printf(sc->sc_dev, "RX: Packet size underrun (1)\n"); + device_printf(sc->sc_dev, "frame too short (length=%d)\n", + m->m_pkthdr.len); goto drop; } plcp = (struct bwn_plcp6 *)(mp + padding); m_adj(m, sizeof(struct bwn_plcp6) + padding); if (m->m_pkthdr.len < IEEE80211_MIN_LEN) { - device_printf(sc->sc_dev, "RX: Packet size underrun (2)\n"); + device_printf(sc->sc_dev, "frame too short (length=%d)\n", + m->m_pkthdr.len); goto drop; } wh = mtod(m, struct ieee80211_frame_min *); if (macstat & BWN_RX_MAC_DEC) - device_printf(sc->sc_dev, "TODO: BWN_RX_MAC_DEC\n"); + device_printf(sc->sc_dev, + "RX decryption attempted (old %d keyidx %#x)\n", + BWN_ISOLDFMT(mac), + (macstat & BWN_RX_MAC_KEYIDX) >> BWN_RX_MAC_KEYIDX_SHIFT); /* XXX calculating RSSI & noise & antenna */