diff options
author | sam <sam@FreeBSD.org> | 2009-02-13 05:38:03 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2009-02-13 05:38:03 +0000 |
commit | 73d051056b6866e2c6f3eca92b7481de415a72a7 (patch) | |
tree | aea904757f626965a8bbbb2b30db81c81fb109ef /sys | |
parent | 9705c5de7132b086b659b1cfb357159ec753092a (diff) | |
download | FreeBSD-src-73d051056b6866e2c6f3eca92b7481de415a72a7.zip FreeBSD-src-73d051056b6866e2c6f3eca92b7481de415a72a7.tar.gz |
add SIOCZATHSTATS ioctl to zero driver statistics
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ath/if_ath.c | 6 | ||||
-rw-r--r-- | sys/dev/ath/if_athioctl.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 4459bf1..1577e88 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include <sys/endian.h> #include <sys/kthread.h> #include <sys/taskqueue.h> +#include <sys/priv.h> #include <machine/bus.h> @@ -6583,6 +6584,11 @@ ath_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) rt->info[sc->sc_txrix].dot11Rate &~ IEEE80211_RATE_BASIC; return copyout(&sc->sc_stats, ifr->ifr_data, sizeof (sc->sc_stats)); + case SIOCZATHSTATS: + error = priv_check(curthread, PRIV_DRIVER); + if (error == 0) + memset(&sc->sc_stats, 0, sizeof(sc->sc_stats)); + break; #ifdef ATH_DIAGAPI case SIOCGATHDIAG: error = ath_ioctl_diag(sc, (struct ath_diag *) ifr); diff --git a/sys/dev/ath/if_athioctl.h b/sys/dev/ath/if_athioctl.h index e9ea17b..35947a0 100644 --- a/sys/dev/ath/if_athioctl.h +++ b/sys/dev/ath/if_athioctl.h @@ -122,6 +122,7 @@ struct ath_stats { }; #define SIOCGATHSTATS _IOWR('i', 137, struct ifreq) +#define SIOCZATHSTATS _IOWR('i', 139, struct ifreq) struct ath_diag { char ad_name[IFNAMSIZ]; /* if name, e.g. "ath0" */ |