Refactoring spectral scan code and adding spectral scan support for ath9k_htc
cover Refactoring spectral scan code and adding spectral scan support for ath9k_htc
The patches move the common components of spectral scan funcationality to common-spectral.c.
Also added spectral scan support to ath9k_htc using the same mechanism to collect spectral scan data as used by ath9k driver.
This work was done at the Wisconsin Wireless and NetworkinG Systems (WiNGS) Lab at the University of Wisconsin Madison.
Ashish Patro (3):
Moving the ath9k specific spectral functions to ath9k.h from
spectral.h. Renamed spectral.h to common-spectral.h
Refactoring the ath9k driver to move common spectral functions to
common-spectral.c
Update spectral scan calls to support both ath9k and ath9k_htc.
Adding spectral scan functionality to ath9k_htc driver. Tested using a AR9271 WiFi card.
drivers/net/wireless/ath/ath9k/Makefile | 3 +- drivers/net/wireless/ath/ath9k/ar9002_phy.c | 11 +- drivers/net/wireless/ath/ath9k/ath9k.h | 9 +- drivers/net/wireless/ath/ath9k/common-spectral.c | 213 +++++++++++++ drivers/net/wireless/ath/ath9k/common-spectral.h | 199 ++++++++++++ drivers/net/wireless/ath/ath9k/htc.h | 13 + drivers/net/wireless/ath/ath9k/htc_drv_debug.c | 3 + drivers/net/wireless/ath/ath9k/htc_drv_init.c | 8 + drivers/net/wireless/ath/ath9k/htc_drv_main.c | 75 +++++ drivers/net/wireless/ath/ath9k/htc_drv_spectral.c | 353 +++++++++++++++++++++ drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 17 + drivers/net/wireless/ath/ath9k/recv.c | 7 +- drivers/net/wireless/ath/ath9k/spectral.c | 187 ----------- drivers/net/wireless/ath/ath9k/spectral.h | 212 ------------ 14 files changed, 905 insertions(+), 405 deletions(-) create mode 100644 drivers/net/wireless/ath/ath9k/common-spectral.c create mode 100644 drivers/net/wireless/ath/ath9k/common-spectral.h create mode 100644 drivers/net/wireless/ath/ath9k/htc_drv_spectral.c delete mode 100644 drivers/net/wireless/ath/ath9k/spectral.h
Signature · 1 line
1.7.5.4
PATCH 1/3 Moving the ath9k specific spectral functions to ath9k.h from spectral.h. Renamed spectral.h to common-spectral.h
--- drivers/net/wireless/ath/ath9k/ath9k.h | 9 +- drivers/net/wireless/ath/ath9k/common-spectral.h | 205 +++++++++++++++++++++ drivers/net/wireless/ath/ath9k/spectral.h | 212 ---------------------- 3 files changed, 213 insertions(+), 213 deletions(-) create mode 100644 drivers/net/wireless/ath/ath9k/common-spectral.h delete mode 100644 drivers/net/wireless/ath/ath9k/spectral.h
drivers/net/wireless/ath/ath9k/ath9k.h +8 -1
@@ -27,7 +27,7 @@#include "common.h" #include "mci.h" #include "dfs.h" -#include "spectral.h" +#include "common-spectral.h" struct ath_node ;
@@ -834,4 +834,11 @@ static inline int ath_ahb_init(void) { return 0; };static inline void ath_ahb_exit (void ) {};#endif +void ath9k_spectral_init_debug (struct ath_softc *sc); +void ath9k_spectral_deinit_debug (struct ath_softc *sc); + +void ath9k_spectral_scan_trigger (struct ieee80211_hw *hw); +int ath9k_spectral_scan_config (struct ieee80211_hw *hw, +enum spectral_mode spectral_mode); +#endif /* ATH9K_H */
drivers/net/wireless/ath/ath9k/common-spectral.h new file +205 -0
205 lines not on this page · raw message
drivers/net/wireless/ath/ath9k/spectral.h deleted +0 -212
212 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH 2/3 Refactoring the ath9k driver to move common spectral functions to common-spectral.c
In reply to Ashish Patro--- drivers/net/wireless/ath/ath9k/Makefile | 1 + drivers/net/wireless/ath/ath9k/common-spectral.c | 206 ++++++++++++++++++++++ drivers/net/wireless/ath/ath9k/spectral.c | 187 -------------------- 3 files changed, 207 insertions(+), 187 deletions(-) create mode 100644 drivers/net/wireless/ath/ath9k/common-spectral.c
drivers/net/wireless/ath/ath9k/Makefile +1 -0
@@ -53,6 +53,7 @@ obj-$(CONFIG_ATH9K_HW) += ath9k_hw.o obj-$(CONFIG_ATH9K_COMMON) += ath9k_common.o ath9k_common-y:= common.o \ common-init.o \ + common-spectral.o \ common-beacon.o ath9k_htc-y += htc_hst.o \
drivers/net/wireless/ath/ath9k/common-spectral.c new file +206 -0
206 lines not on this page · raw message
drivers/net/wireless/ath/ath9k/spectral.c +0 -187
193 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH 3/3 Update spectral scan calls to support both ath9k and ath9k_htc. Adding spectral scan functionality to ath9k_htc driver. Tested using a AR9271 WiFi card.
In reply to Ashish Patro--- drivers/net/wireless/ath/ath9k/Makefile | 2 +- drivers/net/wireless/ath/ath9k/ar9002_phy.c | 11 +- drivers/net/wireless/ath/ath9k/common-spectral.c | 29 +- drivers/net/wireless/ath/ath9k/common-spectral.h | 16 +- drivers/net/wireless/ath/ath9k/htc.h | 13 + drivers/net/wireless/ath/ath9k/htc_drv_debug.c | 3 + drivers/net/wireless/ath/ath9k/htc_drv_init.c | 8 + drivers/net/wireless/ath/ath9k/htc_drv_main.c | 75 +++++ drivers/net/wireless/ath/ath9k/htc_drv_spectral.c | 353 +++++++++++++++++++++ drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 17 + drivers/net/wireless/ath/ath9k/recv.c | 7 +- 11 files changed, 507 insertions(+), 27 deletions(-) create mode 100644 drivers/net/wireless/ath/ath9k/htc_drv_spectral.c
drivers/net/wireless/ath/ath9k/Makefile +1 -1
@@ -65,6 +65,6 @@ ath9k_htc-y += htc_hst.o \ htc_drv_init.o \ htc_drv_gpio.o -ath9k_htc-$(CONFIG_ATH9K_HTC_DEBUGFS) += htc_drv_debug.o +ath9k_htc-$(CONFIG_ATH9K_HTC_DEBUGFS) += htc_drv_debug.o htc_drv_spectral.o obj-$(CONFIG_ATH9K_HTC) += ath9k_htc.o
drivers/net/wireless/ath/ath9k/ar9002_phy.c +8 -3
@@ -641,11 +641,16 @@ static void ar9002_hw_spectral_scan_config(struct ath_hw *ah,/* on AR92xx, the highest bit of count will make the the chip send * spectral samples endlessly. Check if this really was intended, * and fix otherwise. +* +* For AR9271 chipsets, set count = 0 for endless samples. */ count = param->count; -if (param->endless) - count =0x80 ; -else if (count &0x80 ) +if (param->endless) { +if (AR_SREV_9271 (ah)) + count =0 ; +else + count =0x80 ; + }else if (count &0x80 ) count =0x7f ; REG_RMW_FIELD(ah, AR_PHY_SPECTRAL_SCAN,
drivers/net/wireless/ath/ath9k/common-spectral.c +18 -11
@@ -14,8 +14,8 @@* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <linux/relay.h> -#include "ath9k.h" +#include "common.h" +#include "common-spectral.h" static s8 fix_rssi_inv_only (u8 rssi_val) {
@@ -24,32 +24,39 @@ static s8 fix_rssi_inv_only(u8 rssi_val)return (s8 ) rssi_val; } -static void ath_debug_send_fft_sample (struct ath_softc *sc, +static void ath_debug_send_fft_sample (struct rchan *rfs_chan_spec_scan,struct fft_sample_tlv *fft_sample_tlv) {int length; -if (!sc->rfs_chan_spec_scan) +if (!rfs_chan_spec_scan)return ; length =__be16_to_cpu (fft_sample_tlv->length) +sizeof (*fft_sample_tlv); -relay_write (sc->rfs_chan_spec_scan, fft_sample_tlv, length); +relay_write (rfs_chan_spec_scan, fft_sample_tlv, length); }/* returns 1 if this was a spectral frame, even if not handled. */ -int ath_process_fft (struct ath_softc *sc,struct ieee80211_hdr *hdr, -struct ath_rx_status *rs,u64 tsf) +int ath_process_fft (struct ath_hw *ah,struct ieee80211_hdr *hdr, +struct ieee80211_hw *hw,struct rchan *rfs_chan_spec_scan, +struct ath_rx_status *rs,u64 tsf,bool is_htc) { -struct ath_hw *ah = sc->sc_ah;u8 num_bins, *bins, *vdata = (u8 *)hdr;struct fft_sample_ht20 fft_sample_20;struct fft_sample_ht20_40 fft_sample_40;struct fft_sample_tlv *tlv;struct ath_radar_info *radar_info; -int len = rs->rs_datalen;int dc_pos;u16 fft_len, length, freq = ah->curchan->chan->center_freq;enum nl80211_channel_type chan_type; +int len =0 ; + +/* Getting the length from AR9271 chipsets. +*/ +if (is_htc) + len =be16_to_cpu (rs->rs_datalen); +else + len = rs->rs_datalen;/* AR9280 and before report via ATH9K_PHYERR_RADAR, AR93xx and newer * via ATH9K_PHYERR_SPECTRAL. Haven't seen ATH9K_PHYERR_FALSE_RADAR_EXT
@@ -67,7 +74,7 @@ int ath_process_fft(struct ath_softc *sc, struct ieee80211_hdr *hdr,if (!(radar_info->pulse_bw_info &SPECTRAL_SCAN_BITMASK ))return 0 ; - chan_type =cfg80211_get_chandef_type (&sc->hw->conf.chandef); + chan_type =cfg80211_get_chandef_type (&hw->conf.chandef);if ((chan_type ==NL80211_CHAN_HT40MINUS ) || (chan_type ==NL80211_CHAN_HT40PLUS )) { fft_len =SPECTRAL_HT20_40_TOTAL_DATA_LEN ;
@@ -199,7 +206,7 @@ int ath_process_fft(struct ath_softc *sc, struct ieee80211_hdr *hdr, tlv = (struct fft_sample_tlv *)&fft_sample_20; } -ath_debug_send_fft_sample (sc, tlv); +ath_debug_send_fft_sample (rfs_chan_spec_scan, tlv);return 1 ; }
drivers/net/wireless/ath/ath9k/common-spectral.h +5 -11
@@ -17,6 +17,8 @@#ifndef SPECTRAL_H #define SPECTRAL_H +#include <linux/relay.h> +/* enum spectral_mode: * * @SPECTRAL_DISABLED: spectral mode is disabled
@@ -190,16 +192,8 @@ struct fft_sample_ht20_40 { u8 data[SPECTRAL_HT20_40_NUM_BINS]; } __packed; -#ifdef CONFIG_ATH9K_DEBUGFS -int ath_process_fft (struct ath_softc *sc,struct ieee80211_hdr *hdr, -struct ath_rx_status *rs,u64 tsf); -#else -static inline int ath_process_fft (struct ath_softc *sc, -struct ieee80211_hdr *hdr, -struct ath_rx_status *rs,u64 tsf) -{ -return 0 ; -} -#endif /* CONFIG_ATH9K_DEBUGFS */ +int ath_process_fft (struct ath_hw *ah,struct ieee80211_hdr *hdr, +struct ieee80211_hw *hw,struct rchan *rfs_chan_spec_scan, +struct ath_rx_status *rs,u64 tsf,bool is_htc);#endif /* SPECTRAL_H */
drivers/net/wireless/ath/ath9k/htc.h +13 -0
@@ -31,6 +31,7 @@#include "htc_hst.h" #include "hif_usb.h" #include "wmi.h" +#include "common-spectral.h" #define ATH_STA_SHORT_CALINTERVAL 1000/* 1 second */ #define ATH_AP_SHORT_CALINTERVAL 100/* 100 ms */
@@ -529,6 +530,11 @@ struct ath9k_htc_priv {struct ath9k_debug debug;#endif struct mutex mutex; + +/* relay(fs) channel for spectral scan */ +struct rchan *rfs_chan_spec_scan; +enum spectral_mode spectral_mode; +struct ath_spec_scan spec_config; };static inline void ath_read_cachesize (struct ath_common *common,int *csz)
@@ -636,4 +642,11 @@ int ath9k_htc_init_debug(struct ath_hw *ah);static inline int ath9k_htc_init_debug (struct ath_hw *ah) {return 0 ; };#endif /* CONFIG_ATH9K_HTC_DEBUGFS */ +void ath9k_htc_spectral_init_debug (struct ath9k_htc_priv *priv); +void ath9k_htc_spectral_deinit_debug (struct ath9k_htc_priv *priv); + +void ath9k_htc_spectral_scan_trigger (struct ieee80211_hw *hw); +int ath9k_htc_spectral_scan_config (struct ieee80211_hw *hw, +enum spectral_mode spectral_mode); +#endif /* HTC_H */
drivers/net/wireless/ath/ath9k/htc_drv_debug.c +3 -0
@@ -993,6 +993,9 @@ int ath9k_htc_init_debug(struct ath_hw *ah)if (!priv->debug.debugfs_phy)return -ENOMEM ; +/* Initialize the debugFS files for the spectral scans */ +ath9k_htc_spectral_init_debug (priv); +debugfs_create_file ("tgt_int_stats" ,S_IRUSR , priv->debug.debugfs_phy, priv, &fops_tgt_int_stats); debugfs_create_file("tgt_tx_stats", S_IRUSR, priv->debug.debugfs_phy,
drivers/net/wireless/ath/ath9k/htc_drv_init.c +8 -0
@@ -449,6 +449,14 @@ static void ath9k_init_misc(struct ath9k_htc_priv *priv) common->last_rssi =ATH_RSSI_DUMMY_MARKER ; priv->ah->opmode =NL80211_IFTYPE_STATION ; + + priv->spec_config.enabled =0 ; +/* Set false for AR9271. */ + priv->spec_config.short_repeat = false; + priv->spec_config.count =8 ; + priv->spec_config.endless = false; + priv->spec_config.period =18 ; + priv->spec_config.fft_period =0x02 ; } static int ath9k_init_priv(struct ath9k_htc_priv *priv,
drivers/net/wireless/ath/ath9k/htc_drv_main.c +75 -0
87 lines not on this page · raw message
drivers/net/wireless/ath/ath9k/htc_drv_spectral.c new file +353 -0
353 lines not on this page · raw message
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +17 -0
@@ -1010,6 +1010,23 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv,* separately to avoid doing two lookups for a rate for each frame. */ hdr = (struct ieee80211_hdr *)skb->data; + +/* Process PHY errors and return so that the packet +* can be dropped. +*/ +#ifdef CONFIG_ATH9K_HTC_DEBUGFS +if (rx_stats.rs_status &ATH9K_RXERR_PHY ) { +/* TODO: Not using DFS processing now. */ +if (ath_process_fft (priv->ah, hdr, priv->hw, + priv->rfs_chan_spec_scan, + &rx_stats, rx_status->mactime, true)) { +/* TODO: Code to collect spectral scan statistics */ + } + + goto rx_next; + } +#endif +if (!ath9k_cmn_rx_accept (common, hdr, rx_status, &rx_stats, &decrypt_error, priv->rxfilter)) goto rx_next;
drivers/net/wireless/ath/ath9k/recv.c +6 -1
@@ -847,8 +847,13 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,*/ if (rx_stats->rs_status &ATH9K_RXERR_PHY ) {ath9k_dfs_process_phyerr (sc, hdr, rx_stats, rx_status->mactime); -if (ath_process_fft (sc, hdr, rx_stats, rx_status->mactime)) + +#ifdef CONFIG_ATH9K_DEBUGFS +if (ath_process_fft (sc->sc_ah, hdr, sc->hw, + sc->rfs_chan_spec_scan, rx_stats, + rx_status->mactime, false))RX_STAT_INC (rx_spectral); +#endif return -EINVAL ; }
Signature · 1 line
1.7.5.4
cover Refactoring spectral scan code and adding spectral scan support for ath9k_htc
In reply to Ashish PatroHm... it compiles but i didn't go any results with my script:
sudo bash -c "echo chanscan > /sys/kernel/debug/ieee80211/phy1/ath9k_htc/spectral_scan_ctl" sudo bash -c "echo 8 > /sys/kernel/debug/ieee80211/phy1/ath9k_htc/spectral_count"
for i in $(seq 1 44); do
sudo iw dev wlan-test scan
sleep 1
done
sudo bash -c "cat /sys/kernel/debug/ieee80211/phy1/ath9k_htc/spectral_scan0 > /tmp/fft_results"
sudo bash -c "echo 8 > /sys/kernel/debug/ieee80211/phy1/ath9k_htc/spectral_count"
sudo bash -c "echo disable > /sys/kernel/debug/ieee80211/phy1/ath9k_htc/spectral_scan_ctl"
./fft_eval /tmp/fft_results
Am 25.04.2014 10:12, schrieb Ashish Patro:
Quoted 36 lines
The patches move the common components of spectral scan funcationality to
common-spectral.c.Also added spectral scan support to
ath9k_htcusing the same mechanism to collect spectral scan data as used by ath9k driver.This work was done at the Wisconsin Wireless and NetworkinG Systems (WiNGS) Lab at the University of Wisconsin Madison.
Ashish Patro (3):
Moving the ath9k specific spectral functions toath9k.hfrom
spectral.h. Renamedspectral.htocommon-spectral.h
Refactoring the ath9k driver to move common spectral functions to
common-spectral.c
Update spectral scan calls to support both ath9k andath9k_htc.
Adding spectral scan functionality toath9k_htcdriver. Tested using a AR9271 WiFi card.drivers/net/wireless/ath/ath9k/Makefile | 3 +- drivers/net/wireless/ath/ath9k/ar9002_phy.c | 11 +- drivers/net/wireless/ath/ath9k/ath9k.h | 9 +- drivers/net/wireless/ath/ath9k/common-spectral.c | 213 +++++++++++++ drivers/net/wireless/ath/ath9k/common-spectral.h | 199 ++++++++++++ drivers/net/wireless/ath/ath9k/htc.h | 13 + drivers/net/wireless/ath/ath9k/htc_drv_debug.c | 3 + drivers/net/wireless/ath/ath9k/htc_drv_init.c | 8 + drivers/net/wireless/ath/ath9k/htc_drv_main.c | 75 +++++ drivers/net/wireless/ath/ath9k/htc_drv_spectral.c | 353 +++++++++++++++++++++ drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 17 + drivers/net/wireless/ath/ath9k/recv.c | 7 +- drivers/net/wireless/ath/ath9k/spectral.c | 187 ----------- drivers/net/wireless/ath/ath9k/spectral.h | 212 ------------ 14 files changed, 905 insertions(+), 405 deletions(-) create mode 100644 drivers/net/wireless/ath/ath9k/common-spectral.c create mode 100644 drivers/net/wireless/ath/ath9k/common-spectral.h create mode 100644 drivers/net/wireless/ath/ath9k/htc_drv_spectral.c delete mode 100644 drivers/net/wireless/ath/ath9k/spectral.h
Signature · 10 lines
Regards, Oleksij -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 278 bytes Desc: OpenPGP digital signature Url : http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20140429/580f4fd3/attachment.pgp
cover Refactoring spectral scan code and adding spectral scan support for ath9k_htc
Hi Oleksij,
For the AR9721 chipset, the spectral count should be set to 0. Also, for the AR 9271 chipset, I get more stable results in monitor mode.
I've tested it in the following mode:-
1. Create the monitor interface.
WLAN_INTF=wlan3 # Change accordingly to client interface. PHY_INTF=phy0 # For the ath9k_htc phy interface. MON_INTF=moni0
iw dev $WLAN_INTF del
iw phy $PHY_INTF interface add $MON_INTF type monitor ifconfig moni0 up
iwconfig
2. Initiate the spectral scan.
echo background > /sys/kernel/debug/ieee80211/phy0/ath9k_htc/spectral_scan_ctl; echo trigger > /sys/kernel/debug/ieee80211/phy0/ath9k_htc/spectral_scan_ctl;
3. Write output to file (Get endless samples).
while [ 1 ];
do
echo "Writing";
sudo cat /sys/kernel/debug/ieee80211/phy0/ath9k_htc/spectral_scan0 >>/tmp/tmp_fft;
wc -l /tmp/tmp_fft;
sleep 1;
done
4. Check the FFT output
./fft_eval /tmp/fft_results
Thanks
Ashish
Quoted 71 lines · Oleksij Rempel
Hm... it compiles but i didn't go any results with my script:
sudo bash -c "echo chanscan >
/sys/kernel/debug/ieee80211/phy1/ath9k_htc/spectral_scan_ctl" sudo bash -c "echo 8 >/sys/kernel/debug/ieee80211/phy1/ath9k_htc/spectral_count"for i in $(seq 1 44); do
sudo iw dev wlan-test scan
sleep 1
donesudo bash -c "cat
/sys/kernel/debug/ieee80211/phy1/ath9k_htc/spectral_scan0>/tmp/fft_results"
sudo bash -c "echo 8 >/sys/kernel/debug/ieee80211/phy1/ath9k_htc/spectral_count"sudo bash -c "echo disable >
/sys/kernel/debug/ieee80211/phy1/ath9k_htc/spectral_scan_ctl"./fft_eval
/tmp/fft_resultsAm 25.04.2014 10:12, schrieb Ashish Patro:
Quoted 2 lines
The patches move the common components of spectral scan funcationality
to
common-spectral.c.Quoted 2 lines
Also added spectral scan support to
ath9k_htcusing the same mechanismto collect spectral scan data as used by ath9k driver.
Quoted 2 lines
This work was done at the Wisconsin Wireless and NetworkinG Systems
(WiNGS) Lab at the University of Wisconsin Madison.
Quoted 10 lines
Ashish Patro (3):
Moving the ath9k specific spectral functions toath9k.hfrom
spectral.h. Renamedspectral.htocommon-spectral.h
Refactoring the ath9k driver to move common spectral functions to
common-spectral.c
Update spectral scan calls to support both ath9k andath9k_htc.
Adding spectral scan functionality toath9k_htcdriver. Tested using a AR9271 WiFi card.Quoted 10 lines
drivers/net/wireless/ath/ath9k/Makefile | 3 +- drivers/net/wireless/ath/ath9k/ar9002_phy.c | 11 +- drivers/net/wireless/ath/ath9k/ath9k.h | 9 +- drivers/net/wireless/ath/ath9k/common-spectral.c | 213 +++++++++++++ drivers/net/wireless/ath/ath9k/common-spectral.h | 199 ++++++++++++ drivers/net/wireless/ath/ath9k/htc.h | 13 + drivers/net/wireless/ath/ath9k/htc_drv_debug.c | 3 + drivers/net/wireless/ath/ath9k/htc_drv_init.c | 8 + drivers/net/wireless/ath/ath9k/htc_drv_main.c | 75 +++++ drivers/net/wireless/ath/ath9k/htc_drv_spectral.c | 353+++++++++++++++++++++
Quoted 10 lines
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 17 + drivers/net/wireless/ath/ath9k/recv.c | 7 +- drivers/net/wireless/ath/ath9k/spectral.c | 187 ----------- drivers/net/wireless/ath/ath9k/spectral.h | 212 ------------ 14 files changed, 905 insertions(+), 405 deletions(-) create mode 100644 drivers/net/wireless/ath/ath9k/common-spectral.c create mode 100644 drivers/net/wireless/ath/ath9k/common-spectral.h create mode 100644 drivers/net/wireless/ath/ath9k/htc_drv_spectral.c delete mode 100644 drivers/net/wireless/ath/ath9k/spectral.h--
Regards,
Oleksij
Quoted 6 lines
_______________________________________________
ath9k-devel mailing list
ath9k-devel at lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20140429/f5530e91/attachment.htm
cover Refactoring spectral scan code and adding spectral scan support for ath9k_htc
Am 29.04.2014 15:16, schrieb Ashish Patro:
Quoted 35 lines
Hi Oleksij,
For the AR9721 chipset, the spectral count should be set to 0. Also, for the AR 9271 chipset, I get more stable results in monitor mode.
I've tested it in the following mode:-
1. Create the monitor interface.
WLAN_INTF=wlan3 # Change accordingly to client interface. PHY_INTF=phy0 # For the
ath9k_htcphy interface. MON_INTF=moni0iw dev $WLAN_INTF del
iw phy $PHY_INTF interface add $MON_INTF type monitor ifconfig moni0 up
iwconfig2. Initiate the spectral scan.
echo background >
/sys/kernel/debug/ieee80211/phy0/ath9k_htc/spectral_scan_ctl; echo trigger >/sys/kernel/debug/ieee80211/phy0/ath9k_htc/spectral_scan_ctl;3. Write output to file (Get endless samples).
while [ 1 ];
do
echo "Writing";
sudo cat/sys/kernel/debug/ieee80211/phy0/ath9k_htc/spectral_scan0>>/tmp/tmp_fft;
wc -l/tmp/tmp_fft;
sleep 1;
done
Quoted 2 lines
4. Check the FFT output
./fft_eval/tmp/fft_results
Thank you, it works. Now you can send your patches to linux-wireless at vger.kernel.org
and
linville at tuxdriver.com
if you have some time and can separate spectral scan to different debugfs directory to make it universal for both drivers, you'll be my hero :)
instead of phy0/ath9k/spectral... and phy0/ath9k_htc/spectral... make phy0/spectral_scan/scan_*
it will make live for user space programs easier and will make possible to move debufs part of spectral code to common-sepctral.c
Quoted 84 lines
Thanks
AshishOn Tue, Apr 29, 2014 at 1:52 AM, Oleksij Rempel <[email protected] <mailto:[email protected]>> wrote:
Hm... it compiles but i didn't go any results with my script:
sudo bash -c "echo chanscan >
/sys/kernel/debug/ieee80211/phy1/ath9k_htc/spectral_scan_ctl" sudo bash -c "echo 8 >/sys/kernel/debug/ieee80211/phy1/ath9k_htc/spectral_count"for i in $(seq 1 44); do
sudo iw dev wlan-test scan
sleep 1
donesudo bash -c "cat
/sys/kernel/debug/ieee80211/phy1/ath9k_htc/spectral_scan0>/tmp/fft_results"
sudo bash -c "echo 8 >/sys/kernel/debug/ieee80211/phy1/ath9k_htc/spectral_count"sudo bash -c "echo disable >
/sys/kernel/debug/ieee80211/phy1/ath9k_htc/spectral_scan_ctl"./fft_eval
/tmp/fft_resultsAm 25.04.2014 10:12, schrieb Ashish Patro:
>
> The patches move the common components of spectral scan funcationality tocommon-spectral.c.
>
> Also added spectral scan support toath9k_htcusing the same mechanism to collect spectral scan data as used by ath9k driver. >
> This work was done at the Wisconsin Wireless and NetworkinG Systems (WiNGS) Lab at the University of Wisconsin Madison. >
> Ashish Patro (3):
> Moving the ath9k specific spectral functions toath9k.hfrom
>spectral.h. Renamedspectral.htocommon-spectral.h
> Refactoring the ath9k driver to move common spectral functions to
>common-spectral.c
> Update spectral scan calls to support both ath9k andath9k_htc.
> Adding spectral scan functionality toath9k_htcdriver. Tested
> using a AR9271 WiFi card.
>
>drivers/net/wireless/ath/ath9k/Makefile| 3 +-
>drivers/net/wireless/ath/ath9k/ar9002_phy.c| 11 +-
>drivers/net/wireless/ath/ath9k/ath9k.h| 9 +-
>drivers/net/wireless/ath/ath9k/common-spectral.c| 213
+++++++++++++
>drivers/net/wireless/ath/ath9k/common-spectral.h| 199 ++++++++++++
>drivers/net/wireless/ath/ath9k/htc.h| 13 +
>drivers/net/wireless/ath/ath9k/htc_drv_debug.c| 3 +
>drivers/net/wireless/ath/ath9k/htc_drv_init.c| 8 +
>drivers/net/wireless/ath/ath9k/htc_drv_main.c| 75 +++++
>drivers/net/wireless/ath/ath9k/htc_drv_spectral.c| 353
+++++++++++++++++++++
>drivers/net/wireless/ath/ath9k/htc_drv_txrx.c| 17 +
>drivers/net/wireless/ath/ath9k/recv.c| 7 +-
>drivers/net/wireless/ath/ath9k/spectral.c| 187 -----------
>drivers/net/wireless/ath/ath9k/spectral.h| 212 ------------
> 14 files changed, 905 insertions(+), 405 deletions(-)
> create mode 100644drivers/net/wireless/ath/ath9k/common-spectral.c> create mode 100644drivers/net/wireless/ath/ath9k/common-spectral.h> create mode 100644drivers/net/wireless/ath/ath9k/htc_drv_spectral.c> delete mode 100644drivers/net/wireless/ath/ath9k/spectral.h>--
Regards,
Oleksij_______________________________________________
ath9k-devel mailing list
ath9k-devel at lists.ath9k.org <mailto:[email protected]>
https://lists.ath9k.org/mailman/listinfo/ath9k-devel
Signature · 10 lines
Regards, Oleksij -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 278 bytes Desc: OpenPGP digital signature Url : http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20140430/aab25551/attachment.pgp
cover Refactoring spectral scan code and adding spectral scan support for ath9k_htc
Hi Oleksij,
Thanks for the feedback and help with the patches. I?ll try looking into the common directory part soon. The next month may be hard since I?ll be traveling during most of May.
Thanks
Ashish
Quoted 131 lines · Oleksij Rempel
Am 29.04.2014 15:16, schrieb Ashish Patro:
Quoted 35 lines
Hi Oleksij,
For the AR9721 chipset, the spectral count should be set to 0. Also, for the AR 9271 chipset, I get more stable results in monitor mode.
I've tested it in the following mode:-
1. Create the monitor interface.
WLAN_INTF=wlan3 # Change accordingly to client interface. PHY_INTF=phy0 # For the
ath9k_htcphy interface. MON_INTF=moni0iw dev $WLAN_INTF del
iw phy $PHY_INTF interface add $MON_INTF type monitor ifconfig moni0 up
iwconfig2. Initiate the spectral scan.
echo background >
/sys/kernel/debug/ieee80211/phy0/ath9k_htc/spectral_scan_ctl; echo trigger >/sys/kernel/debug/ieee80211/phy0/ath9k_htc/spectral_scan_ctl;3. Write output to file (Get endless samples).
while [ 1 ];
do
echo "Writing";
sudo cat/sys/kernel/debug/ieee80211/phy0/ath9k_htc/spectral_scan0>>/tmp/tmp_fft;
wc -l/tmp/tmp_fft;
sleep 1;
doneQuoted 2 lines
4. Check the FFT output
./fft_eval/tmp/fft_resultsThank you, it works. Now you can send your patches to linux-wireless at vger.kernel.org
and
linville at tuxdriver.comif you have some time and can separate spectral scan to different debugfs directory to make it universal for both drivers, you'll be my hero :)
instead of phy0/ath9k/spectral... and phy0/ath9k_htc/spectral... make phy0/spectral_scan/scan_*it will make live for user space programs easier and will make possible to move debufs part of spectral code to
common-sepctral.cQuoted 78 lines
Thanks
AshishOn Tue, Apr 29, 2014 at 1:52 AM, Oleksij Rempel <[email protected] <mailto:[email protected]>> wrote:
Hm... it compiles but i didn't go any results with my script:
sudo bash -c "echo chanscan > /sys/kernel/debug/ieee80211/phy1/ath9k_htc/spectral_scan_ctl" sudo bash -c "echo 8 > /sys/kernel/debug/ieee80211/phy1/ath9k_htc/spectral_count" for i in $(seq 1 44); do sudo iw dev wlan-test scan sleep 1 done sudo bash -c "cat /sys/kernel/debug/ieee80211/phy1/ath9k_htc/spectral_scan0 > /tmp/fft_results" sudo bash -c "echo 8 > /sys/kernel/debug/ieee80211/phy1/ath9k_htc/spectral_count" sudo bash -c "echo disable > /sys/kernel/debug/ieee80211/phy1/ath9k_htc/spectral_scan_ctl" ./fft_eval /tmp/fft_results Am 25.04.2014 10:12, schrieb Ashish Patro:Quoted 2 lines
The patches move the common components of spectral scan
funcationality to
common-spectral.c.Quoted 2 lines
Also added spectral scan support to
ath9k_htcusing the samemechanism to collect spectral scan data as used by ath9k driver.
Quoted 2 lines
This work was done at the Wisconsin Wireless and NetworkinG
Systems (WiNGS) Lab at the University of Wisconsin Madison.
Quoted 10 lines
Ashish Patro (3):
Moving the ath9k specific spectral functions toath9k.hfrom
spectral.h. Renamedspectral.htocommon-spectral.h
Refactoring the ath9k driver to move common spectral functions to
common-spectral.c
Update spectral scan calls to support both ath9k andath9k_htc.
Adding spectral scan functionality toath9k_htcdriver. Tested using a AR9271 WiFi card.Quoted 4 lines
drivers/net/wireless/ath/ath9k/Makefile | 3 +- drivers/net/wireless/ath/ath9k/ar9002_phy.c | 11 +- drivers/net/wireless/ath/ath9k/ath9k.h | 9 +- drivers/net/wireless/ath/ath9k/common-spectral.c | 213+++++++++++++
Quoted 6 lines
drivers/net/wireless/ath/ath9k/common-spectral.h | 199 ++++++++++++ drivers/net/wireless/ath/ath9k/htc.h | 13 + drivers/net/wireless/ath/ath9k/htc_drv_debug.c | 3 + drivers/net/wireless/ath/ath9k/htc_drv_init.c | 8 + drivers/net/wireless/ath/ath9k/htc_drv_main.c | 75 +++++ drivers/net/wireless/ath/ath9k/htc_drv_spectral.c | 353+++++++++++++++++++++
Quoted 10 lines
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 17 + drivers/net/wireless/ath/ath9k/recv.c | 7 +- drivers/net/wireless/ath/ath9k/spectral.c | 187 ----------- drivers/net/wireless/ath/ath9k/spectral.h | 212 ------------ 14 files changed, 905 insertions(+), 405 deletions(-)create mode 100644
drivers/net/wireless/ath/ath9k/common-spectral.ccreate mode 100644drivers/net/wireless/ath/ath9k/common-spectral.hcreate mode 100644drivers/net/wireless/ath/ath9k/htc_drv_spectral.cdelete mode 100644drivers/net/wireless/ath/ath9k/spectral.h-- Regards, Oleksij
Quoted 11 lines
Quoted 6 lines
_______________________________________________
ath9k-devel mailing list
ath9k-devel at lists.ath9k.org <mailto:[email protected]>
https://lists.ath9k.org/mailman/listinfo/ath9k-develSignature · 2 lines
Regards, Oleksij
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20140430/342146a2/attachment.htm