From owner-svn-src-all@FreeBSD.ORG Fri Feb 13 05:38:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4FDA1065703; Fri, 13 Feb 2009 05:38:03 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3C2F8FC24; Fri, 13 Feb 2009 05:38:03 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1D5c3Zf077468; Fri, 13 Feb 2009 05:38:03 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1D5c30d077465; Fri, 13 Feb 2009 05:38:03 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902130538.n1D5c30d077465@svn.freebsd.org> From: Sam Leffler Date: Fri, 13 Feb 2009 05:38:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188557 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 05:38:04 -0000 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 #include #include +#include #include @@ -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" */