Skip to contentSkip to conversation

Continuous Spectral Scan

PATCH New hounos at uth.gr 2 participants 2 messages Jul 26, 2013 – Aug 13, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Continuous Spectral Scan

Hello,

I am working on the specral sensing mode of the Atheros 9380. I am using the compat 3.9-rc4-2 driver. This driver was already pathced for the spectral scan mode.

I would like to perform a continuous scan, either in a channel or multiple and gather spectrum samples in the /sys/kernel/debug/ieee80211/phy0/ath9k/spectral_scan0 file endlessly until I stop its operation manually.

Looking the source code, I saw some references for the endless mode. Theoretically as understood this function is already deployed in the driver.

Initially at hw.h a is refered that:

@count: number of scan results requested. There are special meanings
* in some chip revisions:
* AR92xx: highest bit set (>=128) for endless mode
* (spectral scan won't stopped until explicitly disabled)
* AR9300 and newer: 0 for endless mode
* @endless: true if endless mode is intended. Otherwise, count value is
* corrected to the next possible value.

As understood count and endless are the two variables which I have to change (in the init.c file). I changed the count variable to "0" and the endless variable to "true". I ran the fft_eval script and took 32 result sets. Assigned a result set for each channel.

Also references for "endless" are given to the main.c file. There is a switch case which seems weird to me.

switch (spectral_mode) {
	case SPECTRAL_DISABLED:
		sc->spec_config.enabled = 0;
		break;
	case SPECTRAL_BACKGROUND:
		/* send endless samples.
		 * TODO: is this really useful for "background"?
		 */
		sc->spec_config.endless = 1;
		sc->spec_config.enabled = 1;
		break;
	case SPECTRAL_CHANSCAN:
	case SPECTRAL_MANUAL:
		sc->spec_config.endless = 0;
		sc->spec_config.enabled = 1;
		break;
	default:
		return -1;
	}

I have tried to add spec_config.endless and spec_config.enabled to the CHANSCAN case but nothing really happend.

Am I missing anything important?
Are there any corrections need to be done?
Is the endless(continuous) operation supported at all?

Thank you in advance for your help.

Chounos K.

#1 lore raw

PATCH 1/1 Continuous Spectral Scan

Quoted 6 lines · hounos at uth.gr

Hello,

I am working on the specral sensing mode of the Atheros 9380. I am using the compat 3.9-rc4-2 driver. This driver was already pathced for the spectral scan mode.

Quoted 7 lines

I would like to perform a continuous scan, either in a channel or multiple and gather spectrum samples in the /sys/kernel/debug/ieee80211/phy0/ath9k/spectral_scan0 file endlessly until I stop its operation manually.

Looking the source code, I saw some references for the endless mode. Theoretically as understood this function is already deployed in the driver.

Yes, what was not so clear at first sight (at least for me) is that you have to issue a "trigger" to actually start getting samples (Thanks Simon for the tip ;) )

so

cd /sys/kernel/debug/ieee80211/phy0/ath9k
echo background > spectral_scan_ctl
echo trigger > spectral_scan_ctl

will fill in the spectral_scan0 file endlessly, collecting a huge number of samples per second, until any of this happens:

echo disable > spectral_scan_ctl

or

iw wlan0 scan
# i understand a scan resets the card flags in some way # or maybe it's an unexpected possibility (i.e. bug :P)

or if you let it run for long enough without cat'ting spectral_scan0, it will also stop collecting samples (looks like spectral_scan0 buffer gets filled up or something)

hope that helps,

you can find further, more specific information here:
https://wiki.freebsd.org/dev/ath_hal%284%29/SpectralScan

and i'll try to update this blogpost with info about "continuous mode" blog.altermundi.net/article/playing-with-ath9k-spectral-scan/

Cheers!

gui