Commit 67dc74f1 authored by Oleksij Rempel's avatar Oleksij Rempel Committed by John W. Linville

ath9k: move spectral.* to common-spectral.*

and rename exports from ath9k_spectral_* to ath9k_cmn_spectral_*
Signed-off-by: default avatarOleksij Rempel <linux@rempel-privat.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent f00a422c
...@@ -16,8 +16,7 @@ ath9k-$(CONFIG_ATH9K_DFS_CERTIFIED) += dfs.o ...@@ -16,8 +16,7 @@ ath9k-$(CONFIG_ATH9K_DFS_CERTIFIED) += dfs.o
ath9k-$(CONFIG_ATH9K_TX99) += tx99.o ath9k-$(CONFIG_ATH9K_TX99) += tx99.o
ath9k-$(CONFIG_ATH9K_WOW) += wow.o ath9k-$(CONFIG_ATH9K_WOW) += wow.o
ath9k-$(CONFIG_ATH9K_DEBUGFS) += debug.o \ ath9k-$(CONFIG_ATH9K_DEBUGFS) += debug.o
spectral.o
ath9k-$(CONFIG_ATH9K_STATION_STATISTICS) += debug_sta.o ath9k-$(CONFIG_ATH9K_STATION_STATISTICS) += debug_sta.o
...@@ -59,7 +58,8 @@ obj-$(CONFIG_ATH9K_COMMON) += ath9k_common.o ...@@ -59,7 +58,8 @@ obj-$(CONFIG_ATH9K_COMMON) += ath9k_common.o
ath9k_common-y:= common.o \ ath9k_common-y:= common.o \
common-init.o \ common-init.o \
common-beacon.o \ common-beacon.o \
common-debug.o common-debug.o \
common-spectral.o
ath9k_htc-y += htc_hst.o \ ath9k_htc-y += htc_hst.o \
hif_usb.o \ hif_usb.o \
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include "debug.h" #include "debug.h"
#include "mci.h" #include "mci.h"
#include "dfs.h" #include "dfs.h"
#include "spectral.h"
struct ath_node; struct ath_node;
struct ath_vif; struct ath_vif;
......
...@@ -93,7 +93,7 @@ static int ath_set_channel(struct ath_softc *sc) ...@@ -93,7 +93,7 @@ static int ath_set_channel(struct ath_softc *sc)
/* perform spectral scan if requested. */ /* perform spectral scan if requested. */
if (test_bit(ATH_OP_SCANNING, &common->op_flags) && if (test_bit(ATH_OP_SCANNING, &common->op_flags) &&
sc->spec_priv.spectral_mode == SPECTRAL_CHANSCAN) sc->spec_priv.spectral_mode == SPECTRAL_CHANSCAN)
ath9k_spectral_scan_trigger(common, &sc->spec_priv); ath9k_cmn_spectral_scan_trigger(common, &sc->spec_priv);
} }
return 0; return 0;
......
...@@ -37,7 +37,7 @@ static void ath_debug_send_fft_sample(struct ath_spec_scan_priv *spec_priv, ...@@ -37,7 +37,7 @@ static void ath_debug_send_fft_sample(struct ath_spec_scan_priv *spec_priv,
} }
/* returns 1 if this was a spectral frame, even if not handled. */ /* returns 1 if this was a spectral frame, even if not handled. */
int ath_process_fft(struct ath_spec_scan_priv *spec_priv, struct ieee80211_hdr *hdr, int ath_cmn_process_fft(struct ath_spec_scan_priv *spec_priv, struct ieee80211_hdr *hdr,
struct ath_rx_status *rs, u64 tsf) struct ath_rx_status *rs, u64 tsf)
{ {
struct ath_hw *ah = spec_priv->ah; struct ath_hw *ah = spec_priv->ah;
...@@ -204,6 +204,7 @@ int ath_process_fft(struct ath_spec_scan_priv *spec_priv, struct ieee80211_hdr * ...@@ -204,6 +204,7 @@ int ath_process_fft(struct ath_spec_scan_priv *spec_priv, struct ieee80211_hdr *
return 1; return 1;
} }
EXPORT_SYMBOL(ath_cmn_process_fft);
/*********************/ /*********************/
/* spectral_scan_ctl */ /* spectral_scan_ctl */
...@@ -234,7 +235,7 @@ static ssize_t read_file_spec_scan_ctl(struct file *file, char __user *user_buf, ...@@ -234,7 +235,7 @@ static ssize_t read_file_spec_scan_ctl(struct file *file, char __user *user_buf,
return simple_read_from_buffer(user_buf, count, ppos, mode, len); return simple_read_from_buffer(user_buf, count, ppos, mode, len);
} }
void ath9k_spectral_scan_trigger(struct ath_common *common, void ath9k_cmn_spectral_scan_trigger(struct ath_common *common,
struct ath_spec_scan_priv *spec_priv) struct ath_spec_scan_priv *spec_priv)
{ {
struct ath_hw *ah = spec_priv->ah; struct ath_hw *ah = spec_priv->ah;
...@@ -259,12 +260,13 @@ void ath9k_spectral_scan_trigger(struct ath_common *common, ...@@ -259,12 +260,13 @@ void ath9k_spectral_scan_trigger(struct ath_common *common,
* configuration, otherwise the register will have its values reset * configuration, otherwise the register will have its values reset
* (on my ar9220 to value 0x01002310) * (on my ar9220 to value 0x01002310)
*/ */
ath9k_spectral_scan_config(common, spec_priv, spec_priv->spectral_mode); ath9k_cmn_spectral_scan_config(common, spec_priv, spec_priv->spectral_mode);
ath9k_hw_ops(ah)->spectral_scan_trigger(ah); ath9k_hw_ops(ah)->spectral_scan_trigger(ah);
ath_ps_ops(common)->restore(common); ath_ps_ops(common)->restore(common);
} }
EXPORT_SYMBOL(ath9k_cmn_spectral_scan_trigger);
int ath9k_spectral_scan_config(struct ath_common *common, int ath9k_cmn_spectral_scan_config(struct ath_common *common,
struct ath_spec_scan_priv *spec_priv, struct ath_spec_scan_priv *spec_priv,
enum spectral_mode spectral_mode) enum spectral_mode spectral_mode)
{ {
...@@ -303,6 +305,7 @@ int ath9k_spectral_scan_config(struct ath_common *common, ...@@ -303,6 +305,7 @@ int ath9k_spectral_scan_config(struct ath_common *common,
return 0; return 0;
} }
EXPORT_SYMBOL(ath9k_cmn_spectral_scan_config);
static ssize_t write_file_spec_scan_ctl(struct file *file, static ssize_t write_file_spec_scan_ctl(struct file *file,
const char __user *user_buf, const char __user *user_buf,
...@@ -323,18 +326,18 @@ static ssize_t write_file_spec_scan_ctl(struct file *file, ...@@ -323,18 +326,18 @@ static ssize_t write_file_spec_scan_ctl(struct file *file,
buf[len] = '\0'; buf[len] = '\0';
if (strncmp("trigger", buf, 7) == 0) { if (strncmp("trigger", buf, 7) == 0) {
ath9k_spectral_scan_trigger(common, spec_priv); ath9k_cmn_spectral_scan_trigger(common, spec_priv);
} else if (strncmp("background", buf, 10) == 0) { } else if (strncmp("background", buf, 10) == 0) {
ath9k_spectral_scan_config(common, spec_priv, SPECTRAL_BACKGROUND); ath9k_cmn_spectral_scan_config(common, spec_priv, SPECTRAL_BACKGROUND);
ath_dbg(common, CONFIG, "spectral scan: background mode enabled\n"); ath_dbg(common, CONFIG, "spectral scan: background mode enabled\n");
} else if (strncmp("chanscan", buf, 8) == 0) { } else if (strncmp("chanscan", buf, 8) == 0) {
ath9k_spectral_scan_config(common, spec_priv, SPECTRAL_CHANSCAN); ath9k_cmn_spectral_scan_config(common, spec_priv, SPECTRAL_CHANSCAN);
ath_dbg(common, CONFIG, "spectral scan: channel scan mode enabled\n"); ath_dbg(common, CONFIG, "spectral scan: channel scan mode enabled\n");
} else if (strncmp("manual", buf, 6) == 0) { } else if (strncmp("manual", buf, 6) == 0) {
ath9k_spectral_scan_config(common, spec_priv, SPECTRAL_MANUAL); ath9k_cmn_spectral_scan_config(common, spec_priv, SPECTRAL_MANUAL);
ath_dbg(common, CONFIG, "spectral scan: manual mode enabled\n"); ath_dbg(common, CONFIG, "spectral scan: manual mode enabled\n");
} else if (strncmp("disable", buf, 7) == 0) { } else if (strncmp("disable", buf, 7) == 0) {
ath9k_spectral_scan_config(common, spec_priv, SPECTRAL_DISABLED); ath9k_cmn_spectral_scan_config(common, spec_priv, SPECTRAL_DISABLED);
ath_dbg(common, CONFIG, "spectral scan: disabled\n"); ath_dbg(common, CONFIG, "spectral scan: disabled\n");
} else { } else {
return -EINVAL; return -EINVAL;
...@@ -577,15 +580,17 @@ static struct rchan_callbacks rfs_spec_scan_cb = { ...@@ -577,15 +580,17 @@ static struct rchan_callbacks rfs_spec_scan_cb = {
/* Debug Init/Deinit */ /* Debug Init/Deinit */
/*********************/ /*********************/
void ath9k_spectral_deinit_debug(struct ath_spec_scan_priv *spec_priv) void ath9k_cmn_spectral_deinit_debug(struct ath_spec_scan_priv *spec_priv)
{ {
if (config_enabled(CONFIG_ATH9K_DEBUGFS) && spec_priv->rfs_chan_spec_scan) { if (config_enabled(CONFIG_ATH9K_DEBUGFS) && spec_priv->rfs_chan_spec_scan) {
relay_close(spec_priv->rfs_chan_spec_scan); relay_close(spec_priv->rfs_chan_spec_scan);
spec_priv->rfs_chan_spec_scan = NULL; spec_priv->rfs_chan_spec_scan = NULL;
} }
} }
EXPORT_SYMBOL(ath9k_cmn_spectral_deinit_debug);
void ath9k_spectral_init_debug(struct ath_spec_scan_priv *spec_priv, struct dentry *debugfs_phy) void ath9k_cmn_spectral_init_debug(struct ath_spec_scan_priv *spec_priv,
struct dentry *debugfs_phy)
{ {
spec_priv->rfs_chan_spec_scan = relay_open("spectral_scan", spec_priv->rfs_chan_spec_scan = relay_open("spectral_scan",
debugfs_phy, debugfs_phy,
...@@ -612,3 +617,4 @@ void ath9k_spectral_init_debug(struct ath_spec_scan_priv *spec_priv, struct dent ...@@ -612,3 +617,4 @@ void ath9k_spectral_init_debug(struct ath_spec_scan_priv *spec_priv, struct dent
debugfs_phy, spec_priv, debugfs_phy, spec_priv,
&fops_spectral_fft_period); &fops_spectral_fft_period);
} }
EXPORT_SYMBOL(ath9k_cmn_spectral_init_debug);
...@@ -130,20 +130,20 @@ static inline u8 spectral_bitmap_weight(u8 *bins) ...@@ -130,20 +130,20 @@ static inline u8 spectral_bitmap_weight(u8 *bins)
return bins[0] & 0x3f; return bins[0] & 0x3f;
} }
void ath9k_spectral_init_debug(struct ath_spec_scan_priv *spec_priv, struct dentry *debugfs_phy); void ath9k_cmn_spectral_init_debug(struct ath_spec_scan_priv *spec_priv, struct dentry *debugfs_phy);
void ath9k_spectral_deinit_debug(struct ath_spec_scan_priv *spec_priv); void ath9k_cmn_spectral_deinit_debug(struct ath_spec_scan_priv *spec_priv);
void ath9k_spectral_scan_trigger(struct ath_common *common, void ath9k_cmn_spectral_scan_trigger(struct ath_common *common,
struct ath_spec_scan_priv *spec_priv); struct ath_spec_scan_priv *spec_priv);
int ath9k_spectral_scan_config(struct ath_common *common, int ath9k_cmn_spectral_scan_config(struct ath_common *common,
struct ath_spec_scan_priv *spec_priv, struct ath_spec_scan_priv *spec_priv,
enum spectral_mode spectral_mode); enum spectral_mode spectral_mode);
#ifdef CONFIG_ATH9K_DEBUGFS #ifdef CONFIG_ATH9K_DEBUGFS
int ath_process_fft(struct ath_spec_scan_priv *spec_priv, struct ieee80211_hdr *hdr, int ath_cmn_process_fft(struct ath_spec_scan_priv *spec_priv, struct ieee80211_hdr *hdr,
struct ath_rx_status *rs, u64 tsf); struct ath_rx_status *rs, u64 tsf);
#else #else
static inline int ath_process_fft(struct ath_spec_scan_priv *spec_priv, static inline int ath_cmn_process_fft(struct ath_spec_scan_priv *spec_priv,
struct ieee80211_hdr *hdr, struct ieee80211_hdr *hdr,
struct ath_rx_status *rs, u64 tsf) struct ath_rx_status *rs, u64 tsf)
{ {
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "common-init.h" #include "common-init.h"
#include "common-beacon.h" #include "common-beacon.h"
#include "common-debug.h" #include "common-debug.h"
#include "common-spectral.h"
/* Common header for Atheros 802.11n base driver cores */ /* Common header for Atheros 802.11n base driver cores */
......
...@@ -1310,7 +1310,7 @@ void ath9k_get_et_stats(struct ieee80211_hw *hw, ...@@ -1310,7 +1310,7 @@ void ath9k_get_et_stats(struct ieee80211_hw *hw,
void ath9k_deinit_debug(struct ath_softc *sc) void ath9k_deinit_debug(struct ath_softc *sc)
{ {
ath9k_spectral_deinit_debug(&sc->spec_priv); ath9k_cmn_spectral_deinit_debug(&sc->spec_priv);
} }
int ath9k_init_debug(struct ath_hw *ah) int ath9k_init_debug(struct ath_hw *ah)
...@@ -1330,7 +1330,7 @@ int ath9k_init_debug(struct ath_hw *ah) ...@@ -1330,7 +1330,7 @@ int ath9k_init_debug(struct ath_hw *ah)
ath9k_dfs_init_debug(sc); ath9k_dfs_init_debug(sc);
ath9k_tx99_init_debug(sc); ath9k_tx99_init_debug(sc);
ath9k_spectral_init_debug(&sc->spec_priv, sc->debug.debugfs_phy); ath9k_cmn_spectral_init_debug(&sc->spec_priv, sc->debug.debugfs_phy);
debugfs_create_file("dma", S_IRUSR, sc->debug.debugfs_phy, sc, debugfs_create_file("dma", S_IRUSR, sc->debug.debugfs_phy, sc,
&fops_dma); &fops_dma);
......
...@@ -870,7 +870,7 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc, ...@@ -870,7 +870,7 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
*/ */
if (rx_stats->rs_status & ATH9K_RXERR_PHY) { if (rx_stats->rs_status & ATH9K_RXERR_PHY) {
ath9k_dfs_process_phyerr(sc, hdr, rx_stats, rx_status->mactime); ath9k_dfs_process_phyerr(sc, hdr, rx_stats, rx_status->mactime);
if (ath_process_fft(&sc->spec_priv, hdr, rx_stats, rx_status->mactime)) if (ath_cmn_process_fft(&sc->spec_priv, hdr, rx_stats, rx_status->mactime))
RX_STAT_INC(rx_spectral); RX_STAT_INC(rx_spectral);
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment