From owner-svn-src-all@FreeBSD.ORG Thu Mar 6 07:47:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9B1432AE; Thu, 6 Mar 2014 07:47:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 87A97B21; Thu, 6 Mar 2014 07:47:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s267lKFm064328; Thu, 6 Mar 2014 07:47:20 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s267lJrt064325; Thu, 6 Mar 2014 07:47:19 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403060747.s267lJrt064325@svn.freebsd.org> From: Adrian Chadd Date: Thu, 6 Mar 2014 07:47:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262829 - head/tools/tools/ath/athstats X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 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: Thu, 06 Mar 2014 07:47:20 -0000 Author: adrian Date: Thu Mar 6 07:47:19 2014 New Revision: 262829 URL: http://svnweb.freebsd.org/changeset/base/262829 Log: Migrate athstats to use bsdstat. Deleted: head/tools/tools/ath/athstats/statfoo.c head/tools/tools/ath/athstats/statfoo.h Modified: head/tools/tools/ath/athstats/Makefile head/tools/tools/ath/athstats/athstats.c head/tools/tools/ath/athstats/athstats.h Modified: head/tools/tools/ath/athstats/Makefile ============================================================================== --- head/tools/tools/ath/athstats/Makefile Thu Mar 6 07:46:32 2014 (r262828) +++ head/tools/tools/ath/athstats/Makefile Thu Mar 6 07:47:19 2014 (r262829) @@ -12,7 +12,7 @@ PROG= athstats # to not compile, use gcc for now. #CC= gcc -SRCS= main.c statfoo.c athstats.c opt_ah.h ah_osdep.h +SRCS= main.c athstats.c opt_ah.h ah_osdep.h CLEANFILES+= opt_ah.h @@ -23,6 +23,9 @@ CFLAGS+=-DATH_SUPPORT_TDMA CFLAGS.clang+= -fbracket-depth=512 +USEPRIVATELIB= +LDADD= -lbsdstat + opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h Modified: head/tools/tools/ath/athstats/athstats.c ============================================================================== --- head/tools/tools/ath/athstats/athstats.c Thu Mar 6 07:46:32 2014 (r262828) +++ head/tools/tools/ath/athstats/athstats.c Thu Mar 6 07:47:19 2014 (r262829) @@ -521,7 +521,7 @@ ath_collect(struct athstatfoo_p *wf, str } static void -ath_collect_cur(struct statfoo *sf) +ath_collect_cur(struct bsdstat *sf) { struct athstatfoo_p *wf = (struct athstatfoo_p *) sf; @@ -529,7 +529,7 @@ ath_collect_cur(struct statfoo *sf) } static void -ath_collect_tot(struct statfoo *sf) +ath_collect_tot(struct bsdstat *sf) { struct athstatfoo_p *wf = (struct athstatfoo_p *) sf; @@ -537,7 +537,7 @@ ath_collect_tot(struct statfoo *sf) } static void -ath_update_tot(struct statfoo *sf) +ath_update_tot(struct bsdstat *sf) { struct athstatfoo_p *wf = (struct athstatfoo_p *) sf; @@ -556,7 +556,7 @@ snprintrate(char b[], size_t bs, int rat } static int -ath_get_curstat(struct statfoo *sf, int s, char b[], size_t bs) +ath_get_curstat(struct bsdstat *sf, int s, char b[], size_t bs) { struct athstatfoo_p *wf = (struct athstatfoo_p *) sf; #define STAT(x) \ @@ -802,7 +802,7 @@ ath_get_curstat(struct statfoo *sf, int } static int -ath_get_totstat(struct statfoo *sf, int s, char b[], size_t bs) +ath_get_totstat(struct bsdstat *sf, int s, char b[], size_t bs) { struct athstatfoo_p *wf = (struct athstatfoo_p *) sf; #define STAT(x) \ @@ -1045,7 +1045,7 @@ ath_get_totstat(struct statfoo *sf, int } static void -ath_print_verbose(struct statfoo *sf, FILE *fd) +ath_print_verbose(struct bsdstat *sf, FILE *fd) { struct athstatfoo_p *wf = (struct athstatfoo_p *) sf; #define isphyerr(i) (S_PHY_MIN <= i && i <= S_PHY_MAX) @@ -1078,7 +1078,7 @@ ath_print_verbose(struct statfoo *sf, FI #undef isphyerr } -STATFOO_DEFINE_BOUNCE(athstatfoo) +BSDSTAT_DEFINE_BOUNCE(athstatfoo) struct athstatfoo * athstats_new(const char *ifname, const char *fmtstring) @@ -1088,7 +1088,7 @@ athstats_new(const char *ifname, const c wf = calloc(1, sizeof(struct athstatfoo_p)); if (wf != NULL) { - statfoo_init(&wf->base.base, "athstats", athstats, N(athstats)); + bsdstat_init(&wf->base.base, "athstats", athstats, N(athstats)); /* override base methods */ wf->base.base.collect_cur = ath_collect_cur; wf->base.base.collect_tot = ath_collect_tot; @@ -1098,7 +1098,7 @@ athstats_new(const char *ifname, const c wf->base.base.print_verbose = ath_print_verbose; /* setup bounce functions for public methods */ - STATFOO_BOUNCE(wf, athstatfoo); + BSDSTAT_BOUNCE(wf, athstatfoo); /* setup our public methods */ wf->base.setifname = ath_setifname; Modified: head/tools/tools/ath/athstats/athstats.h ============================================================================== --- head/tools/tools/ath/athstats/athstats.h Thu Mar 6 07:46:32 2014 (r262828) +++ head/tools/tools/ath/athstats/athstats.h Thu Mar 6 07:47:19 2014 (r262829) @@ -32,15 +32,15 @@ #ifndef _ATHSTATS_H_ #define _ATHSTATS_H_ -#include "statfoo.h" +#include /* * ath statistics class. */ struct athstatfoo { - struct statfoo base; + struct bsdstat base; - STATFOO_DECL_METHODS(struct athstatfoo *); + BSDSTAT_DECL_METHODS(struct athstatfoo *); /* set the network interface name for collection */ void (*setifname)(struct athstatfoo *, const char *ifname);