diff options
author | adrian <adrian@FreeBSD.org> | 2013-01-09 18:50:06 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2013-01-09 18:50:06 +0000 |
commit | fc044aacf6364972c1c45db0b3c395e778c8f9e6 (patch) | |
tree | 5a1bd4a8d555f4cf74a44e008d91efab0efc88e4 /tools | |
parent | e33acd92c323d70e5d6df57f002fc99962711614 (diff) | |
download | FreeBSD-src-fc044aacf6364972c1c45db0b3c395e778c8f9e6.zip FreeBSD-src-fc044aacf6364972c1c45db0b3c395e778c8f9e6.tar.gz |
Add the "enable at reset" functionality to trigger spectral scan upon
a channel change/reset.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/tools/ath/athspectral/athspectral.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tools/tools/ath/athspectral/athspectral.c b/tools/tools/ath/athspectral/athspectral.c index 8e6962a..7bdfa2b 100644 --- a/tools/tools/ath/athspectral/athspectral.c +++ b/tools/tools/ath/athspectral/athspectral.c @@ -187,6 +187,29 @@ spectral_stop(struct spectralhandler *spectral) err(1, spectral->atd.ad_name); } +static void +spectral_enable_at_reset(struct spectralhandler *spectral, int val) +{ + int v = val; + + spectral->atd.ad_id = SPECTRAL_CONTROL_ENABLE_AT_RESET + | ATH_DIAG_IN; + + /* + * XXX don't need these, but need to eliminate the ATH_DIAG_DYN flag + * and debug + */ + spectral->atd.ad_out_data = NULL; + spectral->atd.ad_out_size = 0; + spectral->atd.ad_in_data = (caddr_t) &v; + spectral->atd.ad_in_size = sizeof(v); + + printf("%s: val=%d\n", __func__, v); + + if (ioctl(spectral->s, SIOCGATHSPECTRAL, &spectral->atd) < 0) + err(1, spectral->atd.ad_name); +} + static int spectral_set_param(struct spectralhandler *spectral, const char *param, const char *val) @@ -258,6 +281,7 @@ usage(const char *progname) printf("\tset <param> <value>:\t\tSet spectral parameter\n"); printf("\tstart: Start spectral scan\n"); printf("\tstop: Stop spectral scan\n"); + printf("\tenable_at_reset <0|1>: enable reporting upon channel reset\n"); } int @@ -312,6 +336,12 @@ main(int argc, char *argv[]) spectral_start(&spectral); } else if (strcasecmp(argv[1], "stop") == 0) { spectral_stop(&spectral); + } else if (strcasecmp(argv[1], "enable_at_reset") == 0) { + if (argc < 3) { + usage(progname); + exit(127); + } + spectral_enable_at_reset(&spectral, atoi(argv[2])); } else { usage(progname); exit(127); |