Re: Skeleton spectral scan driver support is in -HEAD (was Re: svn commit: r244953 - in head/tools/tools/ath: . athspectral)

2013-01-02 Thread Michael Vale

nice

-Original Message- 
From: Adrian Chadd

Sent: Wednesday, January 02, 2013 3:19 PM
To: freebsd-wireless@freebsd.org
Subject: Skeleton spectral scan driver support is in -HEAD (was Re: svn 
commit: r244953 - in head/tools/tools/ath: . athspectral)


... and with that, anyone wishing to write a spectral scan
visualisation application now has all the basic bits they need to do
so.

ie:

* create interface in monitor mode
* sysctl dev.ath.0.monpass=0xff (just to ensure you get spectral scan 
errors)

* ifconfig wlan0 channel 1:ht/20
* ifconfig wlan0 up
* athspectral -i ath0 start
* sleep 0.5
* ifconfig wlan0 down ; ifconfig wlan0 channel 6:ht/20; ifconfig wlan0 up
* athspectral -i ath0 start
* sleep 0.5
* ifconfig wlan0 down ; ifconfig wlan0 channel 11:ht/20; ifconfig wlan0 up
* athspectral -i ath0 start
* sleep 0.5
... etc.

All someone(!) now needs to do is write an application that sniffs the
spectral scan FFT data from a radiotap interface and you're done.

There's more interesting things one can do (eg not use the short
repeat functionality, so you get big sets of continuous spectral scan
reports; play with "continuous" reporting, etc.) once the basic FFT
visualisation is done.

Go forth and do interesting things. Oh, and please open source some of them. 
:)




Adrian


On 1 January 2013 20:02, Adrian Chadd  wrote:

Author: adrian
Date: Wed Jan  2 04:02:27 2013
New Revision: 244953
URL: http://svnweb.freebsd.org/changeset/base/244953

Log:
  Add a very skeletal spectral scan control application.

  The main use for this is to manually trigger spectral scan operations
  (athspectral -i athX start) whilst doing debugging.

Added:
  head/tools/tools/ath/athspectral/
  head/tools/tools/ath/athspectral/Makefile   (contents, props changed)
  head/tools/tools/ath/athspectral/athspectral.c   (contents, props 
changed)

Modified:
  head/tools/tools/ath/Makefile

Modified: head/tools/tools/ath/Makefile
==
--- head/tools/tools/ath/Makefile   Wed Jan  2 04:00:54 2013 
(r244952)
+++ head/tools/tools/ath/Makefile   Wed Jan  2 04:02:27 2013 
(r244953)

@@ -3,6 +3,6 @@
 SUBDIR=arcode athdebug athdecode athkey athpoke athprom athrd 
athregs

 SUBDIR+=   athstats ath_prom_read athradar athaggrstats
 SUBDIR+=   ath_ee_v14_print ath_ee_v4k_print ath_ee_9287_print
-SUBDIR+=   athsurvey athratestats
+SUBDIR+=   athsurvey athratestats athspectral

 .include 

Added: head/tools/tools/ath/athspectral/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/tools/ath/athspectral/Makefile   Wed Jan  2 04:02:27 2013 
(r244953)

@@ -0,0 +1,16 @@
+# $FreeBSD$
+
+PROG=  athspectral
+
+.include <../Makefile.inc>
+
+SRCS=  athspectral.c
+SRCS+= opt_ah.h
+CLEANFILES+=   opt_ah.h
+
+opt_ah.h:
+   echo "#define AH_DEBUG 1" > opt_ah.h
+   echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h
+   echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h
+
+.include 

Added: head/tools/tools/ath/athspectral/athspectral.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/tools/ath/athspectral/athspectral.c  Wed Jan  2 
04:02:27 2013(r244953)

@@ -0,0 +1,323 @@
+/*
+ * Copyright (c) 2013 Adrian Chadd 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the 
distribution.

+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE 
LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 
GOODS

+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 
WAY

+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include "diag.h"
+
+#include "ah.h"
+#include "ah_internal.h"

Skeleton spectral scan driver support is in -HEAD (was Re: svn commit: r244953 - in head/tools/tools/ath: . athspectral)

2013-01-01 Thread Adrian Chadd
... and with that, anyone wishing to write a spectral scan
visualisation application now has all the basic bits they need to do
so.

ie:

* create interface in monitor mode
* sysctl dev.ath.0.monpass=0xff (just to ensure you get spectral scan errors)
* ifconfig wlan0 channel 1:ht/20
* ifconfig wlan0 up
* athspectral -i ath0 start
* sleep 0.5
* ifconfig wlan0 down ; ifconfig wlan0 channel 6:ht/20; ifconfig wlan0 up
* athspectral -i ath0 start
* sleep 0.5
* ifconfig wlan0 down ; ifconfig wlan0 channel 11:ht/20; ifconfig wlan0 up
* athspectral -i ath0 start
* sleep 0.5
... etc.

All someone(!) now needs to do is write an application that sniffs the
spectral scan FFT data from a radiotap interface and you're done.

There's more interesting things one can do (eg not use the short
repeat functionality, so you get big sets of continuous spectral scan
reports; play with "continuous" reporting, etc.) once the basic FFT
visualisation is done.

Go forth and do interesting things. Oh, and please open source some of them. :)



Adrian


On 1 January 2013 20:02, Adrian Chadd  wrote:
> Author: adrian
> Date: Wed Jan  2 04:02:27 2013
> New Revision: 244953
> URL: http://svnweb.freebsd.org/changeset/base/244953
>
> Log:
>   Add a very skeletal spectral scan control application.
>
>   The main use for this is to manually trigger spectral scan operations
>   (athspectral -i athX start) whilst doing debugging.
>
> Added:
>   head/tools/tools/ath/athspectral/
>   head/tools/tools/ath/athspectral/Makefile   (contents, props changed)
>   head/tools/tools/ath/athspectral/athspectral.c   (contents, props changed)
> Modified:
>   head/tools/tools/ath/Makefile
>
> Modified: head/tools/tools/ath/Makefile
> ==
> --- head/tools/tools/ath/Makefile   Wed Jan  2 04:00:54 2013
> (r244952)
> +++ head/tools/tools/ath/Makefile   Wed Jan  2 04:02:27 2013
> (r244953)
> @@ -3,6 +3,6 @@
>  SUBDIR=arcode athdebug athdecode athkey athpoke athprom athrd athregs
>  SUBDIR+=   athstats ath_prom_read athradar athaggrstats
>  SUBDIR+=   ath_ee_v14_print ath_ee_v4k_print ath_ee_9287_print
> -SUBDIR+=   athsurvey athratestats
> +SUBDIR+=   athsurvey athratestats athspectral
>
>  .include 
>
> Added: head/tools/tools/ath/athspectral/Makefile
> ==
> --- /dev/null   00:00:00 1970   (empty, because file is newly added)
> +++ head/tools/tools/ath/athspectral/Makefile   Wed Jan  2 04:02:27 2013  
>   (r244953)
> @@ -0,0 +1,16 @@
> +# $FreeBSD$
> +
> +PROG=  athspectral
> +
> +.include <../Makefile.inc>
> +
> +SRCS=  athspectral.c
> +SRCS+= opt_ah.h
> +CLEANFILES+=   opt_ah.h
> +
> +opt_ah.h:
> +   echo "#define AH_DEBUG 1" > opt_ah.h
> +   echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h
> +   echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h
> +
> +.include 
>
> Added: head/tools/tools/ath/athspectral/athspectral.c
> ==
> --- /dev/null   00:00:00 1970   (empty, because file is newly added)
> +++ head/tools/tools/ath/athspectral/athspectral.c  Wed Jan  2 04:02:27 
> 2013(r244953)
> @@ -0,0 +1,323 @@
> +/*
> + * Copyright (c) 2013 Adrian Chadd 
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + * 1. Redistributions of source code must retain the above copyright
> + *notice, this list of conditions and the following disclaimer.
> + * 2. Redistributions in binary form must reproduce the above copyright
> + *notice, this list of conditions and the following disclaimer in the
> + *documentation and/or other materials provided with the distribution.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
> + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
> + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
> + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
> + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
> + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> + * SUCH DAMAGE.
> + *
> + * $FreeBSD$
> + */
> +
> +#include "diag.h"
> +
> +#include "ah.h"
> +#include "ah_internal.h"
> +
> +#ifndefATH_DEFAULT
> +#defineATH_DEFAULT "ath0"
> +#endif
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +struct spectral