Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Feb 2009 05:38:03 +0000 (UTC)
From:      Sam Leffler <sam@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r188557 - head/sys/dev/ath
Message-ID:  <200902130538.n1D5c30d077465@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sam
Date: Fri Feb 13 05:38:03 2009
New Revision: 188557
URL: http://svn.freebsd.org/changeset/base/188557

Log:
  add SIOCZATHSTATS ioctl to zero driver statistics

Modified:
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_athioctl.h

Modified: head/sys/dev/ath/if_ath.c
==============================================================================
--- head/sys/dev/ath/if_ath.c	Fri Feb 13 05:31:18 2009	(r188556)
+++ head/sys/dev/ath/if_ath.c	Fri Feb 13 05:38:03 2009	(r188557)
@@ -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,
 		    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);

Modified: head/sys/dev/ath/if_athioctl.h
==============================================================================
--- head/sys/dev/ath/if_athioctl.h	Fri Feb 13 05:31:18 2009	(r188556)
+++ head/sys/dev/ath/if_athioctl.h	Fri Feb 13 05:38:03 2009	(r188557)
@@ -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" */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902130538.n1D5c30d077465>