diff options
author | Stefan Sperling <stsp@cvs.openbsd.org> | 2017-08-04 17:31:06 +0000 |
---|---|---|
committer | Stefan Sperling <stsp@cvs.openbsd.org> | 2017-08-04 17:31:06 +0000 |
commit | 62ba7c752cc464f345d14a2971fddc8dadf5cc13 (patch) | |
tree | 676f374d575a2a59d12f0b881a6a259750fc45ae /sys/net80211 | |
parent | 455b184bdb8d4b9947a1baab8617501f2bfb7a95 (diff) |
Remove ieee80211_input_print() which printed information about received
frames to dmesg, if debug mode was enabled with ifconfig.
This debug output was much too verbose and not actually useful for debugging.
tcpdump -y IEEE802_11_RADIO will show the same information.
ok sthen@
Diffstat (limited to 'sys/net80211')
-rw-r--r-- | sys/net80211/ieee80211_input.c | 71 |
1 files changed, 1 insertions, 70 deletions
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index ec7fcef9650..85a5e4aea0c 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_input.c,v 1.194 2017/06/04 12:48:42 tb Exp $ */ +/* $OpenBSD: ieee80211_input.c,v 1.195 2017/08/04 17:31:05 stsp Exp $ */ /*- * Copyright (c) 2001 Atsushi Onoe @@ -125,14 +125,6 @@ void ieee80211_recv_bar(struct ieee80211com *, struct mbuf *, struct ieee80211_node *); void ieee80211_bar_tid(struct ieee80211com *, struct ieee80211_node *, u_int8_t, u_int16_t); -void ieee80211_input_print(struct ieee80211com *, struct ifnet *, - struct ieee80211_frame *, struct ieee80211_rxinfo *); -void ieee80211_input_print_task(void *); - -struct ieee80211printmsg { - struct task task; - char text[512]; -}; /* * Retrieve the length in bytes of an 802.11 header. @@ -154,65 +146,6 @@ ieee80211_get_hdrlen(const struct ieee80211_frame *wh) return size; } -/* - * Work queue task that prints a received frame. Avoids printf() from - * interrupt context at IPL_NET making slow machines unusable when many - * frames are received and the interface is put in debug mode. - */ -void -ieee80211_input_print_task(void *arg1) -{ - struct ieee80211printmsg *msg = arg1; - - printf("%s", msg->text); - free(msg, M_DEVBUF, sizeof *msg); -} - -void -ieee80211_input_print(struct ieee80211com *ic, struct ifnet *ifp, - struct ieee80211_frame *wh, struct ieee80211_rxinfo *rxi) -{ - int doprint; - struct ieee80211printmsg *msg; - u_int8_t subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; - - /* avoid printing too many frames */ - doprint = 0; - switch (subtype) { - case IEEE80211_FC0_SUBTYPE_BEACON: - if (ic->ic_state == IEEE80211_S_SCAN) - doprint = 1; - break; -#ifndef IEEE80211_STA_ONLY - case IEEE80211_FC0_SUBTYPE_PROBE_REQ: - if (ic->ic_opmode == IEEE80211_M_IBSS) - doprint = 1; - break; -#endif - default: - doprint = 1; - break; - } -#ifdef IEEE80211_DEBUG - doprint += (ieee80211_debug > 1); -#endif - if (!doprint) - return; - - msg = malloc(sizeof(*msg), M_DEVBUF, M_NOWAIT); - if (msg == NULL) - return; - - snprintf(msg->text, sizeof(msg->text), - "%s: received %s from %s rssi %d mode %s\n", ifp->if_xname, - ieee80211_mgt_subtype_name[subtype >> IEEE80211_FC0_SUBTYPE_SHIFT], - ether_sprintf(wh->i_addr2), rxi->rxi_rssi, - ieee80211_phymode_name[ic->ic_curmode]); - - task_set(&msg->task, ieee80211_input_print_task, msg); - task_add(systq, &msg->task); -} - /* * Process a received frame. The node associated with the sender * should be supplied. If nothing was found in the node table then @@ -543,8 +476,6 @@ ieee80211_input(struct ifnet *ifp, struct mbuf *m, struct ieee80211_node *ni, goto out; } - if (ifp->if_flags & IFF_DEBUG) - ieee80211_input_print(ic, ifp, wh, rxi); #if NBPFILTER > 0 if (bpf_mtap(ic->ic_rawbpf, m, BPF_DIRECTION_IN) != 0) { /* |