aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBalaji Pothunoori <bpothuno@codeaurora.org>2019-08-01 17:27:52 +0530
committerchrome-bot <chrome-bot@chromium.org>2019-09-05 17:42:24 -0700
commit2a8ae9e20e2864676094d36d787bfe75c443f63b (patch)
treeccbd1c95f83a5ce7072521444d488e252f17dcf3
parent30b27adc475ad16775b80099530997975497c56a (diff)
CHROMIUM: ath10k: add debugfs support for burst mode configuration
This patch adds debugfs support for configuring burst mode to enable or disable. f.e, echo "val" > /sys/kernel/debug/ieee80211/phyX/ath10k/burst_enable Where disable: val = 0. enable : val = 1. BUG=b:137147192 TEST=1. build image 2. verify /sys/kernel/debug/ieee80211/phyX/ath10k/burst_enable for values set. Change-Id: Ib5eb4cb9e9358dd2a533b9e6095ed050a184a813 Signed-off-by: Balaji Pothunoori <bpothuno@codeaurora.org> Signed-off-by: Vamsi Singamsetty <vamssi@codeaurora.org> Signed-off-by: Mayank Chopra <mak.chopra@codeaurora.org> Reviewed-on: https://chromium-review.googlesource.com/1739068 Tested-by: Julan Hsu <julanhsu@google.com> Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Kan Yan <kyan@chromium.org>
-rw-r--r--drivers/net/wireless/ath/ath10k/core.h2
-rw-r--r--drivers/net/wireless/ath/ath10k/debug.c66
2 files changed, 68 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index d5d2ac848c5a..e9480871ce7d 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -1172,6 +1172,8 @@ struct ath10k {
const unsigned int *debug_mask;
u32 atf_max_num_pending_tx;
+ bool burst_enabled;
+
/* must be last */
u8 drv_priv[0] __aligned(sizeof(void *));
};
diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index 5b9d86a3746f..a9f8c7b5c8f8 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -3257,6 +3257,69 @@ static const struct file_operations fops_rts_threshold = {
.llseek = default_llseek,
};
+static ssize_t ath10k_write_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->burst_enabled == enable) {
+ ret = count;
+ goto exit;
+ }
+
+ if (ar->state != ATH10K_STATE_ON &&
+ ar->state != ATH10K_STATE_RESTARTED) {
+ ret = -ENETDOWN;
+ goto exit;
+ }
+
+ ret = ath10k_wmi_pdev_set_param(ar, ar->wmi.pdev_param->burst_enable,
+ enable);
+
+ if (ret) {
+ ath10k_warn(ar, "failed to set burst value %d\n",
+ ret);
+ goto exit;
+ }
+ ar->burst_enabled = enable;
+
+ ret = count;
+
+exit:
+ mutex_unlock(&ar->conf_mutex);
+
+ return ret;
+}
+
+static ssize_t ath10k_read_burst_enable(struct file *file,
+ char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ struct ath10k *ar = file->private_data;
+ size_t len;
+ char buf[32];
+
+ len = scnprintf(buf, sizeof(buf), "%d\n", ar->burst_enabled);
+
+ return simple_read_from_buffer(user_buf, count, ppos, buf, len);
+}
+
+static const struct file_operations fops_burst_enable = {
+ .read = ath10k_read_burst_enable,
+ .write = ath10k_write_burst_enable,
+ .open = simple_open,
+ .owner = THIS_MODULE,
+ .llseek = default_llseek,
+};
+
int ath10k_debug_register(struct ath10k *ar)
{
ar->debug.debugfs_phy = debugfs_create_dir("ath10k",
@@ -3391,6 +3454,9 @@ int ath10k_debug_register(struct ath10k *ar)
debugfs_create_file("rts_threshold", 0600,
ar->debug.debugfs_phy, ar, &fops_rts_threshold);
+ debugfs_create_file("burst_enable", 0600, ar->debug.debugfs_phy, ar,
+ &fops_burst_enable);
+
ath10k_txdelay_debugfs_register(ar);
return 0;