summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2017-03-21 05:01:03 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-03-21 05:01:03 -0700
commita51b73d50dedaa10e33ace0e5d064ac6ffe0a862 (patch)
tree208281fe6167456d6fc32b09e86b80d401df3ab4
parentc9069144efc5befba795c4dd02bda12f9bfbc0e6 (diff)
parentc3ff8e405fd0c9327eadd2f1ebc7177c68787195 (diff)
Merge "ath10k: implement debugfs interface for sifs burst"
-rw-r--r--drivers/net/wireless/ath/ath10k/core.h2
-rw-r--r--drivers/net/wireless/ath/ath10k/debug.c61
-rw-r--r--drivers/net/wireless/ath/ath10k/mac.c1
3 files changed, 63 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 21c63d5d3ead..a20ac680cfb9 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -729,7 +729,7 @@ struct ath10k {
u32 max_spatial_stream;
/* protected by conf_mutex */
bool ani_enabled;
-
+ bool sifs_burst_enabled;
bool p2p;
struct {
diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index c36c2481856b..8d97822cbbde 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -1572,6 +1572,64 @@ static const struct file_operations fops_ani_enable = {
.llseek = default_llseek,
};
+static ssize_t ath10k_write_sifs_burst_enable(struct file *file,
+ const char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ struct ath10k *ar = file->private_data;
+ int ret;
+ u8 enable;
+
+ if (kstrtou8_from_user(user_buf, count, 0, &enable))
+ return -EINVAL;
+
+ mutex_lock(&ar->conf_mutex);
+
+ if (ar->sifs_burst_enabled == enable) {
+ ret = count;
+ goto exit;
+ }
+
+ ret = ath10k_wmi_pdev_set_param(ar, ar->wmi.pdev_param->burst_enable,
+ enable);
+ if (ret) {
+ ath10k_warn(ar, "sifs_burst_enable failed: %d\n", ret);
+ goto exit;
+ }
+ ar->sifs_burst_enabled = enable;
+
+ ret = count;
+
+exit:
+ mutex_unlock(&ar->conf_mutex);
+
+ return ret;
+}
+
+static ssize_t ath10k_read_sifs_burst_enable(struct file *file,
+ char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ struct ath10k *ar = file->private_data;
+ char buf[32];
+ int len;
+ bool ret = false;
+
+ if (ar->sifs_burst_enabled)
+ ret = true;
+
+ len = scnprintf(buf, sizeof(buf), "%d\n", ret);
+ return simple_read_from_buffer(user_buf, count, ppos, buf, len);
+}
+
+static const struct file_operations fops_sifs_burst_enable = {
+ .read = ath10k_read_sifs_burst_enable,
+ .write = ath10k_write_sifs_burst_enable,
+ .open = simple_open,
+ .owner = THIS_MODULE,
+ .llseek = default_llseek,
+};
+
static const struct file_operations fops_cal_data = {
.open = ath10k_debug_cal_data_open,
.read = ath10k_debug_cal_data_read,
@@ -2432,6 +2490,9 @@ int ath10k_debug_register(struct ath10k *ar)
debugfs_create_file("ani_enable", S_IRUSR | S_IWUSR,
ar->debug.debugfs_phy, ar, &fops_ani_enable);
+ debugfs_create_file("sifs_burst_enable", S_IRUSR | S_IWUSR,
+ ar->debug.debugfs_phy, ar, &fops_sifs_burst_enable);
+
if (IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED)) {
debugfs_create_file("dfs_simulate_radar", S_IWUSR,
ar->debug.debugfs_phy, ar,
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 8d49acd3c9f5..265744c75f82 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -4538,6 +4538,7 @@ static int ath10k_start(struct ieee80211_hw *hw)
ret);
goto err_core_stop;
}
+ ar->sifs_burst_enabled = false;
}
param = ar->wmi.pdev_param->ani_enable;