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:32 -0500 |
commit | 8e68d55f5e4a0444a569ecf605f482b9af0b9264 (patch) | |
tree | ad75227947ae305802f991108c82b66483911c61 /drivers/net/wireless/ath | |
parent | 8bf8f190febcd2b4544d5fa13ed0809e2e92f53b (diff) |
ath10k: add support to send addba response
This per-station debugfs entry helps to send addba response in
manual mode for debugging purpose. It accepts tid and status code
as input arguments.
To send addba response,
echo 0 25 >/sys/kernel/debug/ieee80211/phyX/netdev:wlanX/
stations/XX:XX:XX:XX:XX:XX/addba_resp
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r-- | drivers/net/wireless/ath/ath10k/debugfs_sta.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath10k/debugfs_sta.c b/drivers/net/wireless/ath/ath10k/debugfs_sta.c index 23d81a244201..31a72d41addd 100644 --- a/drivers/net/wireless/ath/ath10k/debugfs_sta.c +++ b/drivers/net/wireless/ath/ath10k/debugfs_sta.c | |||
@@ -131,10 +131,61 @@ static const struct file_operations fops_addba = { | |||
131 | .llseek = default_llseek, | 131 | .llseek = default_llseek, |
132 | }; | 132 | }; |
133 | 133 | ||
134 | static ssize_t ath10k_dbg_sta_write_addba_resp(struct file *file, | ||
135 | const char __user *user_buf, | ||
136 | size_t count, loff_t *ppos) | ||
137 | { | ||
138 | struct ieee80211_sta *sta = file->private_data; | ||
139 | struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv; | ||
140 | struct ath10k *ar = arsta->arvif->ar; | ||
141 | u32 tid, status; | ||
142 | int ret; | ||
143 | char buf[64]; | ||
144 | |||
145 | simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count); | ||
146 | |||
147 | /* make sure that buf is null terminated */ | ||
148 | buf[sizeof(buf) - 1] = '\0'; | ||
149 | |||
150 | ret = sscanf(buf, "%u %u", &tid, &status); | ||
151 | if (ret != 2) | ||
152 | return -EINVAL; | ||
153 | |||
154 | /* Valid TID values are 0 through 15 */ | ||
155 | if (tid > HTT_DATA_TX_EXT_TID_MGMT - 2) | ||
156 | return -EINVAL; | ||
157 | |||
158 | mutex_lock(&ar->conf_mutex); | ||
159 | if ((ar->state != ATH10K_STATE_ON) || | ||
160 | (arsta->aggr_mode != ATH10K_DBG_AGGR_MODE_MANUAL)) { | ||
161 | ret = count; | ||
162 | goto out; | ||
163 | } | ||
164 | |||
165 | ret = ath10k_wmi_addba_set_resp(ar, arsta->arvif->vdev_id, sta->addr, | ||
166 | tid, status); | ||
167 | if (ret) { | ||
168 | ath10k_warn(ar, "failed to send addba response: vdev_id %u peer %pM tid %u status%u\n", | ||
169 | arsta->arvif->vdev_id, sta->addr, tid, status); | ||
170 | } | ||
171 | ret = count; | ||
172 | out: | ||
173 | mutex_unlock(&ar->conf_mutex); | ||
174 | return ret; | ||
175 | } | ||
176 | |||
177 | static const struct file_operations fops_addba_resp = { | ||
178 | .write = ath10k_dbg_sta_write_addba_resp, | ||
179 | .open = simple_open, | ||
180 | .owner = THIS_MODULE, | ||
181 | .llseek = default_llseek, | ||
182 | }; | ||
183 | |||
134 | void ath10k_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 184 | void ath10k_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
135 | struct ieee80211_sta *sta, struct dentry *dir) | 185 | struct ieee80211_sta *sta, struct dentry *dir) |
136 | { | 186 | { |
137 | debugfs_create_file("aggr_mode", S_IRUGO | S_IWUSR, dir, sta, | 187 | debugfs_create_file("aggr_mode", S_IRUGO | S_IWUSR, dir, sta, |
138 | &fops_aggr_mode); | 188 | &fops_aggr_mode); |
139 | debugfs_create_file("addba", S_IWUSR, dir, sta, &fops_addba); | 189 | debugfs_create_file("addba", S_IWUSR, dir, sta, &fops_addba); |
190 | debugfs_create_file("addba_resp", S_IWUSR, dir, sta, &fops_addba_resp); | ||
140 | } | 191 | } |