ath10k: implement debugfs interface for sifs burst
This interface can be used to enable or disable sifs burst from debugfs. CRs-Fixed: 2017024 Change-Id: If1ce889c4a829c20e0570a6cf35711f988859b89 Signed-off-by: Rakesh Pillai <pillair@codeaurora.org>
This commit is contained in:
parent
687a4eb82b
commit
c3ff8e405f
3 changed files with 63 additions and 1 deletions
|
@ -729,7 +729,7 @@ struct ath10k {
|
|||
u32 max_spatial_stream;
|
||||
/* protected by conf_mutex */
|
||||
bool ani_enabled;
|
||||
|
||||
bool sifs_burst_enabled;
|
||||
bool p2p;
|
||||
|
||||
struct {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue