diff options
author | 2016-04-28 13:51:22 +0000 | |
---|---|---|
committer | 2016-04-28 13:51:22 +0000 | |
commit | 568903e7677180af9b397163468cc24ee667d2aa (patch) | |
tree | 4d2c6d409165fb5d472f1eaaeb4e4df4722970c1 | |
parent | Copy some ieee8021_node HT information to userspace. (diff) | |
download | wireguard-openbsd-568903e7677180af9b397163468cc24ee667d2aa.tar.xz wireguard-openbsd-568903e7677180af9b397163468cc24ee667d2aa.zip |
Show 11n HT rate in ifconfig scan output. Needs a new kernel.
ok mpi@
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index e8b74bbe174..6dab1c14315 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifconfig.c,v 1.320 2016/04/18 06:20:23 mpi Exp $ */ +/* $OpenBSD: ifconfig.c,v 1.321 2016/04/28 13:51:22 stsp Exp $ */ /* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */ /* @@ -63,6 +63,7 @@ #include <sys/types.h> #include <sys/socket.h> #include <sys/ioctl.h> +#include <sys/param.h> #include <net/if.h> #include <net/if_dl.h> @@ -2283,7 +2284,7 @@ ieee80211_listnodes(void) void ieee80211_printnode(struct ieee80211_nodereq *nr) { - int len; + int len, i; if (nr->nr_flags & IEEE80211_NODEREQ_AP || nr->nr_capinfo & IEEE80211_CAPINFO_IBSS) { @@ -2311,8 +2312,16 @@ ieee80211_printnode(struct ieee80211_nodereq *nr) if (nr->nr_pwrsave) printf("powersave "); - if (nr->nr_nrates) { - /* Only print the fastest rate */ + /* Only print the fastest rate */ + if (nr->nr_max_rxrate) { + printf("%uM HT ", nr->nr_max_rxrate); + } else if (nr->nr_rxmcs[0] != 0) { + for (i = IEEE80211_HT_NUM_MCS - 1; i >= 0; i--) { + if (isset(nr->nr_rxmcs, i)) + break; + } + printf("HT-MCS%d ", i); + } else if (nr->nr_nrates) { printf("%uM", (nr->nr_rates[nr->nr_nrates - 1] & IEEE80211_RATE_VAL) / 2); putchar(' '); |