diff mbox

[8/8] ath10k: ath10k: add support to send delba

Message ID 1418972099-5296-9-git-send-email-rmanohar@qti.qualcomm.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Rajkumar Manoharan Dec. 19, 2014, 6:54 a.m. UTC
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>
---
 drivers/net/wireless/ath/ath10k/debugfs_sta.c | 56 +++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)

Comments

Rajkumar Manoharan Dec. 21, 2014, 6:13 a.m. UTC | #1
> Subject: [PATCH 8/8] ath10k: 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.
Kalle,

Subject needs small correction (ath10k: ath10k:). Do you want
me send v2 patch for this change?

Sorry for the inconvenience.

-Rajkumar--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kalle Valo Dec. 23, 2014, 7:46 a.m. UTC | #2
"Manoharan, Rajkumar" <rmanohar@qti.qualcomm.com> writes:

>> Subject: [PATCH 8/8] ath10k: 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.
> Kalle,
>
> Subject needs small correction (ath10k: ath10k:). Do you want
> me send v2 patch for this change?

No need to send v2, I can do the change myself. But I noticed that you
already sent it :)

But in the future please don't resubmit individual patches, that's just
too error prone. Instead just resubmit the whole series.
Rajkumar Manoharan Dec. 24, 2014, 7:54 a.m. UTC | #3
On Tue, Dec 23, 2014 at 09:46:28AM +0200, Kalle Valo wrote:
> "Manoharan, Rajkumar" <rmanohar@qti.qualcomm.com> writes:
> 
> >> Subject: [PATCH 8/8] ath10k: 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.
> > Kalle,
> >
> > Subject needs small correction (ath10k: ath10k:). Do you want
> > me send v2 patch for this change?
> 
> No need to send v2, I can do the change myself. But I noticed that you
> already sent it :)
> 
> But in the future please don't resubmit individual patches, that's just
> too error prone. Instead just resubmit the whole series.
> 
Agree... I will resend the whole series. Recently separate WMI ops for 10.2.4
is added. So newer WMI APIs has to be registered in 10.2.4 table.

Will send v2 series.

-Rajkumar
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kalle Valo Dec. 24, 2014, 8:11 a.m. UTC | #4
Rajkumar <rmanohar@qti.qualcomm.com> writes:

> On Tue, Dec 23, 2014 at 09:46:28AM +0200, Kalle Valo wrote:
>> "Manoharan, Rajkumar" <rmanohar@qti.qualcomm.com> writes:
>> 
>> >> Subject: [PATCH 8/8] ath10k: 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.
>> > Kalle,
>> >
>> > Subject needs small correction (ath10k: ath10k:). Do you want
>> > me send v2 patch for this change?
>> 
>> No need to send v2, I can do the change myself. But I noticed that you
>> already sent it :)
>> 
>> But in the future please don't resubmit individual patches, that's just
>> too error prone. Instead just resubmit the whole series.
>> 
> Agree... I will resend the whole series. Recently separate WMI ops for 10.2.4
> is added. So newer WMI APIs has to be registered in 10.2.4 table.

Perfect, I was just about to mention that.
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath10k/debugfs_sta.c b/drivers/net/wireless/ath/ath10k/debugfs_sta.c
index 95eb5a1..5effd7bb 100644
--- a/drivers/net/wireless/ath/ath10k/debugfs_sta.c
+++ b/drivers/net/wireless/ath/ath10k/debugfs_sta.c
@@ -190,6 +190,61 @@  static const struct file_operations fops_addba_resp = {
 	.llseek = default_llseek,
 };
 
+static ssize_t ath10k_dbg_sta_write_delba(struct file *file,
+					  const char __user *user_buf,
+					  size_t count, loff_t *ppos)
+{
+	struct ieee80211_sta *sta = file->private_data;
+	struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv;
+	struct ath10k *ar = arsta->arvif->ar;
+	u32 tid, initiator, reason;
+	int ret;
+	char buf[64];
+
+	simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count);
+
+	/* make sure that buf is null terminated */
+	buf[sizeof(buf) - 1] = '\0';
+
+	ret = sscanf(buf, "%u %u %u", &tid, &initiator, &reason);
+	if (ret != 3) {
+		ath10k_warn(ar, "ex: echo <tid> <initiator> <reason code> >delba\n");
+		return -EINVAL;
+	}
+
+	/* Valid TID values are 0 through 15 */
+	if (tid > HTT_DATA_TX_EXT_TID_MGMT - 2) {
+		ath10k_warn(ar, "Invalid TID %u\n", tid);
+		return -EINVAL;
+	}
+
+	mutex_lock(&ar->conf_mutex);
+	if ((ar->state != ATH10K_STATE_ON) ||
+	    (arsta->aggr_mode != ATH10K_DBG_AGGR_MODE_MANUAL)) {
+		ret = count;
+		goto out;
+	}
+
+	ret = ath10k_wmi_delba_send(ar, arsta->arvif->vdev_id, sta->addr,
+				    tid, initiator, reason);
+	if (ret) {
+		ath10k_warn(ar, "failed to send delba: vdev_id %u peer %pM tid %u initiator %u reason %u\n",
+			    arsta->arvif->vdev_id, sta->addr, tid, initiator,
+			    reason);
+	}
+	ret = count;
+out:
+	mutex_unlock(&ar->conf_mutex);
+	return ret;
+}
+
+static const struct file_operations fops_delba = {
+	.write = ath10k_dbg_sta_write_delba,
+	.open = simple_open,
+	.owner = THIS_MODULE,
+	.llseek = default_llseek,
+};
+
 void ath10k_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 			    struct ieee80211_sta *sta, struct dentry *dir)
 {
@@ -197,4 +252,5 @@  void ath10k_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 			    &fops_aggr_mode);
 	debugfs_create_file("addba", S_IWUSR, dir, sta, &fops_addba);
 	debugfs_create_file("addba_resp", S_IWUSR, dir, sta, &fops_addba_resp);
+	debugfs_create_file("delba", S_IWUSR, dir, sta, &fops_delba);
 }