diff options
| author | Rajkumar Manoharan <rmanohar@qti.qualcomm.com> | 2015-01-12 07:07:28 -0500 |
|---|---|---|
| committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2015-01-13 09:13:47 -0500 |
| commit | da2aedcadbe2e03db78b30adccbdba77e25f406b (patch) | |
| tree | 8b8972e71e62ee6a2fb6c9c896625be3d89660fd | |
| parent | 8e68d55f5e4a0444a569ecf605f482b9af0b9264 (diff) | |
ath10k: add support to send delba
This per-station debugfs entry helps to send delba in manual mode
for debugging purpose. It accepts tid, initiator and reason code
as inputs.
To send delba,
echo 0 1 37 >/sys/kernel/debug/ieee80211/phyX/netdev:wlanX/
stations/XX:XX:XX:XX:XX:XX/delba
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 31a72d41addd..95b5c49374e0 100644 --- a/drivers/net/wireless/ath/ath10k/debugfs_sta.c +++ b/drivers/net/wireless/ath/ath10k/debugfs_sta.c | |||
| @@ -181,6 +181,57 @@ static const struct file_operations fops_addba_resp = { | |||
| 181 | .llseek = default_llseek, | 181 | .llseek = default_llseek, |
| 182 | }; | 182 | }; |
| 183 | 183 | ||
| 184 | static ssize_t ath10k_dbg_sta_write_delba(struct file *file, | ||
| 185 | const char __user *user_buf, | ||
| 186 | size_t count, loff_t *ppos) | ||
| 187 | { | ||
| 188 | struct ieee80211_sta *sta = file->private_data; | ||
| 189 | struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv; | ||
| 190 | struct ath10k *ar = arsta->arvif->ar; | ||
| 191 | u32 tid, initiator, reason; | ||
| 192 | int ret; | ||
| 193 | char buf[64]; | ||
| 194 | |||
| 195 | simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count); | ||
| 196 | |||
| 197 | /* make sure that buf is null terminated */ | ||
| 198 | buf[sizeof(buf) - 1] = '\0'; | ||
| 199 | |||
| 200 | ret = sscanf(buf, "%u %u %u", &tid, &initiator, &reason); | ||
| 201 | if (ret != 3) | ||
| 202 | return -EINVAL; | ||
| 203 | |||
| 204 | /* Valid TID values are 0 through 15 */ | ||
| 205 | if (tid > HTT_DATA_TX_EXT_TID_MGMT - 2) | ||
| 206 | return -EINVAL; | ||
| 207 | |||
| 208 | mutex_lock(&ar->conf_mutex); | ||
| 209 | if ((ar->state != ATH10K_STATE_ON) || | ||
| 210 | (arsta->aggr_mode != ATH10K_DBG_AGGR_MODE_MANUAL)) { | ||
| 211 | ret = count; | ||
| 212 | goto out; | ||
| 213 | } | ||
| 214 | |||
| 215 | ret = ath10k_wmi_delba_send(ar, arsta->arvif->vdev_id, sta->addr, | ||
| 216 | tid, initiator, reason); | ||
| 217 | if (ret) { | ||
| 218 | ath10k_warn(ar, "failed to send delba: vdev_id %u peer %pM tid %u initiator %u reason %u\n", | ||
| 219 | arsta->arvif->vdev_id, sta->addr, tid, initiator, | ||
| 220 | reason); | ||
| 221 | } | ||
| 222 | ret = count; | ||
| 223 | out: | ||
| 224 | mutex_unlock(&ar->conf_mutex); | ||
| 225 | return ret; | ||
| 226 | } | ||
| 227 | |||
| 228 | static const struct file_operations fops_delba = { | ||
| 229 | .write = ath10k_dbg_sta_write_delba, | ||
| 230 | .open = simple_open, | ||
| 231 | .owner = THIS_MODULE, | ||
| 232 | .llseek = default_llseek, | ||
| 233 | }; | ||
| 234 | |||
| 184 | void ath10k_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 235 | void ath10k_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
| 185 | struct ieee80211_sta *sta, struct dentry *dir) | 236 | struct ieee80211_sta *sta, struct dentry *dir) |
| 186 | { | 237 | { |
| @@ -188,4 +239,5 @@ void ath10k_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
| 188 | &fops_aggr_mode); | 239 | &fops_aggr_mode); |
| 189 | debugfs_create_file("addba", S_IWUSR, dir, sta, &fops_addba); | 240 | debugfs_create_file("addba", S_IWUSR, dir, sta, &fops_addba); |
| 190 | debugfs_create_file("addba_resp", S_IWUSR, dir, sta, &fops_addba_resp); | 241 | debugfs_create_file("addba_resp", S_IWUSR, dir, sta, &fops_addba_resp); |
| 242 | debugfs_create_file("delba", S_IWUSR, dir, sta, &fops_delba); | ||
| 191 | } | 243 | } |
