Skip to content

Commit

Permalink
ath9k: add debugfs based DFS radar simulation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Zefir Kurtisi authored and John W. Linville committed Apr 8, 2013
1 parent e9cdedf commit e39282e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions drivers/net/wireless/ath/ath9k/dfs_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,24 @@ static ssize_t write_file_dfs(struct file *file, const char __user *user_buf,
return count;
}

static ssize_t write_file_simulate_radar(struct file *file,
const char __user *user_buf,
size_t count, loff_t *ppos)
{
struct ath_softc *sc = file->private_data;

ieee80211_radar_detected(sc->hw);

return count;
}

static const struct file_operations fops_simulate_radar = {
.write = write_file_simulate_radar,
.open = simple_open,
.owner = THIS_MODULE,
.llseek = default_llseek,
};

static const struct file_operations fops_dfs_stats = {
.read = read_file_dfs,
.write = write_file_dfs,
Expand All @@ -117,4 +135,6 @@ void ath9k_dfs_init_debug(struct ath_softc *sc)
{
debugfs_create_file("dfs_stats", S_IRUSR,
sc->debug.debugfs_phy, sc, &fops_dfs_stats);
debugfs_create_file("dfs_simulate_radar", S_IWUSR,
sc->debug.debugfs_phy, sc, &fops_simulate_radar);
}

0 comments on commit e39282e

Please sign in to comment.