summaryrefslogtreecommitdiffstats
path: root/tools/tools
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2007-12-13 02:01:01 +0000
committersam <sam@FreeBSD.org>2007-12-13 02:01:01 +0000
commit7e498012ab35abe310626f222edcbc2a067abfc9 (patch)
treef1ffa51068d8aa0b8db48750fa1a0ebcd54da204 /tools/tools
parentec64d39bbd702b2dc3b24292e740cf5385cc0768 (diff)
downloadFreeBSD-src-7e498012ab35abe310626f222edcbc2a067abfc9.zip
FreeBSD-src-7e498012ab35abe310626f222edcbc2a067abfc9.tar.gz
use ATH environment variable (when set) as the default interface name
Diffstat (limited to 'tools/tools')
-rw-r--r--tools/tools/ath/athdebug/athdebug.c7
-rw-r--r--tools/tools/ath/athstats/main.c7
2 files changed, 12 insertions, 2 deletions
diff --git a/tools/tools/ath/athdebug/athdebug.c b/tools/tools/ath/athdebug/athdebug.c
index 9915347..0f60f2c 100644
--- a/tools/tools/ath/athdebug/athdebug.c
+++ b/tools/tools/ath/athdebug/athdebug.c
@@ -67,6 +67,7 @@ enum {
ATH_DEBUG_LED = 0x00100000, /* led management */
ATH_DEBUG_FF = 0x00200000, /* fast frames */
ATH_DEBUG_DFS = 0x00400000, /* DFS processing */
+ ATH_DEBUG_TDMA = 0x00800000, /* TDMA processing */
ATH_DEBUG_FATAL = 0x80000000, /* fatal errors */
ATH_DEBUG_ANY = 0xffffffff
};
@@ -95,6 +96,7 @@ static struct {
{ "led", ATH_DEBUG_LED },
{ "ff", ATH_DEBUG_FF },
{ "dfs", ATH_DEBUG_DFS },
+ { "tdma", ATH_DEBUG_TDMA },
{ "fatal", ATH_DEBUG_FATAL },
};
@@ -135,7 +137,7 @@ usage(void)
int
main(int argc, char *argv[])
{
- const char *ifname = "ath0";
+ const char *ifname;
const char *cp, *tp;
const char *sep;
int c, op, i;
@@ -143,6 +145,9 @@ main(int argc, char *argv[])
size_t debuglen;
char oid[256];
+ ifname = getenv("ATH");
+ if (ifname == NULL)
+ ifname = "ath0";
progname = argv[0];
if (argc > 1) {
if (strcmp(argv[1], "-i") == 0) {
diff --git a/tools/tools/ath/athstats/main.c b/tools/tools/ath/athstats/main.c
index dbd2a1b..8bf23b1 100644
--- a/tools/tools/ath/athstats/main.c
+++ b/tools/tools/ath/athstats/main.c
@@ -42,6 +42,7 @@
*/
#include <stdio.h>
+#include <stdlib.h>
#include <signal.h>
#include <unistd.h>
#include <err.h>
@@ -63,9 +64,13 @@ int
main(int argc, char *argv[])
{
struct athstatfoo *wf;
+ const char *ifname;
int c;
- wf = athstats_new("ath0", S_DEFAULT);
+ ifname = getenv("ATH");
+ if (ifname == NULL)
+ ifname = "ath0";
+ wf = athstats_new(ifname, S_DEFAULT);
while ((c = getopt(argc, argv, "i:lo:")) != -1) {
switch (c) {
case 'i':
OpenPOWER on IntegriCloud