Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Mar 2014 07:47:19 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r262829 - head/tools/tools/ath/athstats
Message-ID:  <201403060747.s267lJrt064325@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <bsdstat.h>
 
 /*
  * 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);



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