diff options
| author | Rajkumar Manoharan <rmanohar@qti.qualcomm.com> | 2015-01-12 07:07:27 -0500 |
|---|---|---|
| committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2015-01-13 09:13:21 -0500 |
| commit | 8bf8f190febcd2b4544d5fa13ed0809e2e92f53b (patch) | |
| tree | d00b0d723d318a8fe3b8aacaeb935afc5a6e1f5a | |
| parent | f5045988b937e4801e3185f9d95c34a7c050b681 (diff) | |
ath10k: add support to send addba request
This per-station debugfs entry helps to send addba request in manual
mode. Need to pass two configuration parameters (tid, buffer size)
as input.
To send addba,
echo 1 32 >/sys/kernel/debug/ieee80211/phyX/netdev:wlanX/
stations/XX:XX:XX:XX:XX:XX/addba
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| -rw-r--r-- | drivers/net/wireless/ath/ath10k/debugfs_sta.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath10k/debugfs_sta.c b/drivers/net/wireless/ath/ath10k/debugfs_sta.c index 5df967387532..23d81a244201 100644 --- a/drivers/net/wireless/ath/ath10k/debugfs_sta.c +++ b/drivers/net/wireless/ath/ath10k/debugfs_sta.c | |||
| @@ -80,9 +80,61 @@ static const struct file_operations fops_aggr_mode = { | |||
| 80 | .llseek = default_llseek, | 80 | .llseek = default_llseek, |
| 81 | }; | 81 | }; |
| 82 | 82 | ||
| 83 | static ssize_t ath10k_dbg_sta_write_addba(struct file *file, | ||
| 84 | const char __user *user_buf, | ||
| 85 | size_t count, loff_t *ppos) | ||
| 86 | { | ||
| 87 | struct ieee80211_sta *sta = file->private_data; | ||
| 88 | struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv; | ||
| 89 | struct ath10k *ar = arsta->arvif->ar; | ||
| 90 | u32 tid, buf_size; | ||
| 91 | int ret; | ||
| 92 | char buf[64]; | ||
| 93 | |||
| 94 | simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count); | ||
| 95 | |||
| 96 | /* make sure that buf is null terminated */ | ||
| 97 | buf[sizeof(buf) - 1] = '\0'; | ||
| 98 | |||
| 99 | ret = sscanf(buf, "%u %u", &tid, &buf_size); | ||
| 100 | if (ret != 2) | ||
| 101 | return -EINVAL; | ||
| 102 | |||
| 103 | /* Valid TID values are 0 through 15 */ | ||
| 104 | if (tid > HTT_DATA_TX_EXT_TID_MGMT - 2) | ||
| 105 | return -EINVAL; | ||
| 106 | |||
| 107 | mutex_lock(&ar->conf_mutex); | ||
| 108 | if ((ar->state != ATH10K_STATE_ON) || | ||
| 109 | (arsta->aggr_mode != ATH10K_DBG_AGGR_MODE_MANUAL)) { | ||
| 110 | ret = count; | ||
| 111 | goto out; | ||
| 112 | } | ||
| 113 | |||
| 114 | ret = ath10k_wmi_addba_send(ar, arsta->arvif->vdev_id, sta->addr, | ||
| 115 | tid, buf_size); | ||
| 116 | if (ret) { | ||
| 117 | ath10k_warn(ar, "failed to send addba request: vdev_id %u peer %pM tid %u buf_size %u\n", | ||
| 118 | arsta->arvif->vdev_id, sta->addr, tid, buf_size); | ||
| 119 | } | ||
| 120 | |||
| 121 | ret = count; | ||
| 122 | out: | ||
| 123 | mutex_unlock(&ar->conf_mutex); | ||
| 124 | return ret; | ||
| 125 | } | ||
| 126 | |||
| 127 | static const struct file_operations fops_addba = { | ||
| 128 | .write = ath10k_dbg_sta_write_addba, | ||
| 129 | .open = simple_open, | ||
| 130 | .owner = THIS_MODULE, | ||
| 131 | .llseek = default_llseek, | ||
| 132 | }; | ||
| 133 | |||
| 83 | void ath10k_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 134 | void ath10k_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
| 84 | struct ieee80211_sta *sta, struct dentry *dir) | 135 | struct ieee80211_sta *sta, struct dentry *dir) |
| 85 | { | 136 | { |
| 86 | debugfs_create_file("aggr_mode", S_IRUGO | S_IWUSR, dir, sta, | 137 | debugfs_create_file("aggr_mode", S_IRUGO | S_IWUSR, dir, sta, |
| 87 | &fops_aggr_mode); | 138 | &fops_aggr_mode); |
| 139 | debugfs_create_file("addba", S_IWUSR, dir, sta, &fops_addba); | ||
| 88 | } | 140 | } |
