====== WiFi debugging ======
net80211 has quite an extensive set of debugging utilities. This page attempts to cover some of these
===== net80211 debug flags =====
Each subsystem in net80211 has some debugging (to the kernel console) which can be selectively enabled and disabled.
This can be done via sysctl (net.wlan.X.debug) or via 'wlandebug'.
This requires **IEEE80211_DEBUG** to be enabled in your kernel. (Enabled by default on amd64, i386 and mips GENERIC kernel)
The various flags are defined in src/sys/net80211/ieee80211_var.h and begin with **IEEE80211_MSG_**.
===== Tools =====
==== wlandebug ====
The wlandebug tool is available in the base system.
The tool is in //usr.sbin/wlandebug///.
It is a front-end to the sysctl method and debug bitmask flags above. To get a list of supported debug flags, do the following:
adrian@marilyn:~/work/freebsd/svn/src/sys/net80211]> wlandebug '-?'
usage: wlandebug [-d | -i device] [flags]
where flags are:
11n
debug
dumppkts
crypto
input
xrate
elemid
node
assoc
auth
scan
output
state
power
hwmp
dot1xsm
radius
raddump
mesh
wpa
acl
wme
superg
doth
inact
roam
rate
action
wds
ioctl
tdma
==== wlanstats ====
wlanstats is a tool which provides real time statistics about the current net80211 vap interface. Statistics are kept per-vap, even for multiple vaps on the same physical interface.
The tool is in src/tools/tools/net80211/wlanstats/.
To list the available statistics, use 'wlanstats -h'.
It can show both a summary of statistics and live statistics. To use live statistics, place a time interval on the command line. For example, ''%%wlanstats 1%%''. '-o' can be used to select which statistics are to be shown.
To view a set of 802.11n aggregation related statistics, use ''%%wlanstats -o ampdu 1%%''.
Here's an example output from the tool on an 802.11n station:
adrian@marilyn:~/work/freebsd/ath/head/src/tools/tools/net80211/wlanstats]> wlanstats
873372 rx from wrong bssid
4127 rx discard 'cuz dup
89 rx discard 'cuz mcast echo
219 rx discard mgt frames
6077 rx ctrl frames
552767 rx beacon frames
68 rx element too small
19471 rx element unknown
1334 rx frame chan mismatch
2 rx deauthentication
3 beacon miss events handled
95 rx w/ incorrect keyid
1 rx seq# violation (TKIP)
5 tx failed 'cuz no defkey
26 active scans started
90 rx frame with bogus beacon interval
555341 rx management frames
31 rx action frames
3393186 A-MPDU frames held in reorder q
3 A-MPDU BAR rx out of BA window
5797 A-MPDU BAR rx moved BA window
6077 A-MPDU BAR rx successful
286 A-MPDU frame moved BA window
3639694 A-MPDU frames rx out-of-order
3676659 A-MPDU rx window slots copied
54297 A-MPDU frames discarded for out of range seqno
3 A-MPDU frames sent up due to old age
11 tx failed 'cuz vap not in RUN state
5014 total data frames received
2223 unicast data frames received
2791 multicast data frames received
3113 total data frames transmit
3113 unicast data frames sent
121M current transmit rate
36 current rssi
-96 current noise floor (dBm)
-60 current signal (dBm)
4600 BAR frames sent
42 BAR frames retried
==== iwnstats ====
iwnstats is a tool which provides general and detailed statistics about physical layer, transmit (tx) and receive (rx) for the iwn(4) driver compatible cards.
The tool is in src/tools/tools/iwn/iwnstats/.
----
{{tag>WiFi}}