diff options
author | Zefir Kurtisi <zefir.kurtisi@neratec.com> | 2013-04-03 12:31:30 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-04-08 15:28:38 -0400 |
commit | e39282ee1b0f639fd9eebd3547803f1694e8c370 (patch) | |
tree | cdf7b1f42b33f591662d47dc47cdfbf8b474ab27 | |
parent | e9cdedf693ac0c8e0bedb8896371bf565bf5d68b (diff) |
ath9k: add debugfs based DFS radar simulation
This helps testing DFS without radar generating
equipment and is required for certification.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/ath9k/dfs_debug.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/dfs_debug.c b/drivers/net/wireless/ath/ath9k/dfs_debug.c index 55d28072adeb..b7611b7bbe43 100644 --- a/drivers/net/wireless/ath/ath9k/dfs_debug.c +++ b/drivers/net/wireless/ath/ath9k/dfs_debug.c | |||
@@ -105,6 +105,24 @@ static ssize_t write_file_dfs(struct file *file, const char __user *user_buf, | |||
105 | return count; | 105 | return count; |
106 | } | 106 | } |
107 | 107 | ||
108 | static ssize_t write_file_simulate_radar(struct file *file, | ||
109 | const char __user *user_buf, | ||
110 | size_t count, loff_t *ppos) | ||
111 | { | ||
112 | struct ath_softc *sc = file->private_data; | ||
113 | |||
114 | ieee80211_radar_detected(sc->hw); | ||
115 | |||
116 | return count; | ||
117 | } | ||
118 | |||
119 | static const struct file_operations fops_simulate_radar = { | ||
120 | .write = write_file_simulate_radar, | ||
121 | .open = simple_open, | ||
122 | .owner = THIS_MODULE, | ||
123 | .llseek = default_llseek, | ||
124 | }; | ||
125 | |||
108 | static const struct file_operations fops_dfs_stats = { | 126 | static const struct file_operations fops_dfs_stats = { |
109 | .read = read_file_dfs, | 127 | .read = read_file_dfs, |
110 | .write = write_file_dfs, | 128 | .write = write_file_dfs, |
@@ -117,4 +135,6 @@ void ath9k_dfs_init_debug(struct ath_softc *sc) | |||
117 | { | 135 | { |
118 | debugfs_create_file("dfs_stats", S_IRUSR, | 136 | debugfs_create_file("dfs_stats", S_IRUSR, |
119 | sc->debug.debugfs_phy, sc, &fops_dfs_stats); | 137 | sc->debug.debugfs_phy, sc, &fops_dfs_stats); |
138 | debugfs_create_file("dfs_simulate_radar", S_IWUSR, | ||
139 | sc->debug.debugfs_phy, sc, &fops_simulate_radar); | ||
120 | } | 140 | } |