* [PATCH v2 1/8] ath10k: add wmi support for addba_clear_resp
2014-12-24 7:59 [PATCH v2 0/8] ath10k: add per station debugfs support Rajkumar Manoharan
@ 2014-12-24 7:59 ` Rajkumar Manoharan
2014-12-24 7:59 ` [PATCH v2 2/8] ath10k: add wmi support for addba_send Rajkumar Manoharan
` (7 subsequent siblings)
8 siblings, 0 replies; 14+ messages in thread
From: Rajkumar Manoharan @ 2014-12-24 7:59 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Rajkumar Manoharan
Add WMI support for clearing addba response before switching aggregation
mode (auto/manual) for debugging purpose.
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/wmi-ops.h | 18 ++++++++++++++++++
drivers/net/wireless/ath/ath10k/wmi-tlv.c | 1 +
drivers/net/wireless/ath/ath10k/wmi.c | 28 ++++++++++++++++++++++++++++
3 files changed, 47 insertions(+)
diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h b/drivers/net/wireless/ath/ath10k/wmi-ops.h
index 20e2c30..b161043 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-ops.h
+++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h
@@ -119,6 +119,8 @@ struct wmi_ops {
u32 next_offset,
u32 enabled);
struct sk_buff *(*gen_pdev_get_temperature)(struct ath10k *ar);
+ struct sk_buff *(*gen_addba_clear_resp)(struct ath10k *ar, u32 vdev_id,
+ const u8 *mac);
};
int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
@@ -857,4 +859,20 @@ ath10k_wmi_pdev_get_temperature(struct ath10k *ar)
ar->wmi.cmd->pdev_get_temperature_cmdid);
}
+static inline int
+ath10k_wmi_addba_clear_resp(struct ath10k *ar, u32 vdev_id, const u8 *mac)
+{
+ struct sk_buff *skb;
+
+ if (!ar->wmi.ops->gen_addba_clear_resp)
+ return -EOPNOTSUPP;
+
+ skb = ar->wmi.ops->gen_addba_clear_resp(ar, vdev_id, mac);
+ if (IS_ERR(skb))
+ return PTR_ERR(skb);
+
+ return ath10k_wmi_cmd_send(ar, skb,
+ ar->wmi.cmd->addba_clear_resp_cmdid);
+}
+
#endif
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
index 4c050ce..499a779 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
@@ -2207,6 +2207,7 @@ static const struct wmi_ops wmi_tlv_ops = {
.gen_pktlog_disable = ath10k_wmi_tlv_op_gen_pktlog_disable,
/* .gen_pdev_set_quiet_mode not implemented */
/* .gen_pdev_get_temperature not implemented */
+ /* .gen_addba_clear_resp not implemented */
};
/************/
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index ac74290..4bd38a6 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -4877,6 +4877,30 @@ ath10k_wmi_op_gen_pdev_set_quiet_mode(struct ath10k *ar, u32 period,
return skb;
}
+static struct sk_buff *
+ath10k_wmi_op_gen_addba_clear_resp(struct ath10k *ar, u32 vdev_id,
+ const u8 *mac)
+{
+ struct wmi_addba_clear_resp_cmd *cmd;
+ struct sk_buff *skb;
+
+ if (!mac)
+ return ERR_PTR(-EINVAL);
+
+ skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd));
+ if (!skb)
+ return ERR_PTR(-ENOMEM);
+
+ cmd = (struct wmi_addba_clear_resp_cmd *)skb->data;
+ cmd->vdev_id = __cpu_to_le32(vdev_id);
+ ether_addr_copy(cmd->peer_macaddr.addr, mac);
+
+ ath10k_dbg(ar, ATH10K_DBG_WMI,
+ "wmi addba clear resp vdev_id 0x%X mac_addr %pM\n",
+ vdev_id, mac);
+ return skb;
+}
+
static const struct wmi_ops wmi_ops = {
.rx = ath10k_wmi_op_rx,
.map_svc = wmi_main_svc_map,
@@ -4928,6 +4952,7 @@ static const struct wmi_ops wmi_ops = {
.gen_pktlog_disable = ath10k_wmi_op_gen_pktlog_disable,
.gen_pdev_set_quiet_mode = ath10k_wmi_op_gen_pdev_set_quiet_mode,
/* .gen_pdev_get_temperature not implemented */
+ .gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp,
};
static const struct wmi_ops wmi_10_1_ops = {
@@ -4982,6 +5007,7 @@ static const struct wmi_ops wmi_10_1_ops = {
.gen_pktlog_enable = ath10k_wmi_op_gen_pktlog_enable,
.gen_pktlog_disable = ath10k_wmi_op_gen_pktlog_disable,
.gen_pdev_set_quiet_mode = ath10k_wmi_op_gen_pdev_set_quiet_mode,
+ .gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp,
};
static const struct wmi_ops wmi_10_2_ops = {
@@ -5037,6 +5063,7 @@ static const struct wmi_ops wmi_10_2_ops = {
.gen_pktlog_enable = ath10k_wmi_op_gen_pktlog_enable,
.gen_pktlog_disable = ath10k_wmi_op_gen_pktlog_disable,
.gen_pdev_set_quiet_mode = ath10k_wmi_op_gen_pdev_set_quiet_mode,
+ .gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp,
};
static const struct wmi_ops wmi_10_2_4_ops = {
@@ -5092,6 +5119,7 @@ static const struct wmi_ops wmi_10_2_4_ops = {
.gen_pktlog_enable = ath10k_wmi_op_gen_pktlog_enable,
.gen_pktlog_disable = ath10k_wmi_op_gen_pktlog_disable,
.gen_pdev_set_quiet_mode = ath10k_wmi_op_gen_pdev_set_quiet_mode,
+ .gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp,
};
int ath10k_wmi_attach(struct ath10k *ar)
--
2.2.1
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH v2 2/8] ath10k: add wmi support for addba_send
2014-12-24 7:59 [PATCH v2 0/8] ath10k: add per station debugfs support Rajkumar Manoharan
2014-12-24 7:59 ` [PATCH v2 1/8] ath10k: add wmi support for addba_clear_resp Rajkumar Manoharan
@ 2014-12-24 7:59 ` Rajkumar Manoharan
2014-12-24 7:59 ` [PATCH v2 3/8] ath10k: add wmi support for addba_set_resp Rajkumar Manoharan
` (6 subsequent siblings)
8 siblings, 0 replies; 14+ messages in thread
From: Rajkumar Manoharan @ 2014-12-24 7:59 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Rajkumar Manoharan
Add WMI support for sending addba request. This command is meant
for debugging purpose.
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/wmi-ops.h | 19 +++++++++++++++++++
drivers/net/wireless/ath/ath10k/wmi-tlv.c | 1 +
drivers/net/wireless/ath/ath10k/wmi.c | 30 ++++++++++++++++++++++++++++++
3 files changed, 50 insertions(+)
diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h b/drivers/net/wireless/ath/ath10k/wmi-ops.h
index b161043..badf422 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-ops.h
+++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h
@@ -121,6 +121,8 @@ struct wmi_ops {
struct sk_buff *(*gen_pdev_get_temperature)(struct ath10k *ar);
struct sk_buff *(*gen_addba_clear_resp)(struct ath10k *ar, u32 vdev_id,
const u8 *mac);
+ struct sk_buff *(*gen_addba_send)(struct ath10k *ar, u32 vdev_id,
+ const u8 *mac, u32 tid, u32 buf_size);
};
int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
@@ -875,4 +877,21 @@ ath10k_wmi_addba_clear_resp(struct ath10k *ar, u32 vdev_id, const u8 *mac)
ar->wmi.cmd->addba_clear_resp_cmdid);
}
+static inline int
+ath10k_wmi_addba_send(struct ath10k *ar, u32 vdev_id, const u8 *mac,
+ u32 tid, u32 buf_size)
+{
+ struct sk_buff *skb;
+
+ if (!ar->wmi.ops->gen_addba_send)
+ return -EOPNOTSUPP;
+
+ skb = ar->wmi.ops->gen_addba_send(ar, vdev_id, mac, tid, buf_size);
+ if (IS_ERR(skb))
+ return PTR_ERR(skb);
+
+ return ath10k_wmi_cmd_send(ar, skb,
+ ar->wmi.cmd->addba_send_cmdid);
+}
+
#endif
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
index 499a779..74a0598 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
@@ -2208,6 +2208,7 @@ static const struct wmi_ops wmi_tlv_ops = {
/* .gen_pdev_set_quiet_mode not implemented */
/* .gen_pdev_get_temperature not implemented */
/* .gen_addba_clear_resp not implemented */
+ /* .gen_addba_send not implemented */
};
/************/
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 4bd38a6..8103cbc 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -4901,6 +4901,32 @@ ath10k_wmi_op_gen_addba_clear_resp(struct ath10k *ar, u32 vdev_id,
return skb;
}
+static struct sk_buff *
+ath10k_wmi_op_gen_addba_send(struct ath10k *ar, u32 vdev_id, const u8 *mac,
+ u32 tid, u32 buf_size)
+{
+ struct wmi_addba_send_cmd *cmd;
+ struct sk_buff *skb;
+
+ if (!mac)
+ return ERR_PTR(-EINVAL);
+
+ skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd));
+ if (!skb)
+ return ERR_PTR(-ENOMEM);
+
+ cmd = (struct wmi_addba_send_cmd *)skb->data;
+ cmd->vdev_id = __cpu_to_le32(vdev_id);
+ ether_addr_copy(cmd->peer_macaddr.addr, mac);
+ cmd->tid = __cpu_to_le32(tid);
+ cmd->buffersize = __cpu_to_le32(buf_size);
+
+ ath10k_dbg(ar, ATH10K_DBG_WMI,
+ "wmi addba send vdev_id 0x%X mac_addr %pM tid %u bufsize %u\n",
+ vdev_id, mac, tid, buf_size);
+ return skb;
+}
+
static const struct wmi_ops wmi_ops = {
.rx = ath10k_wmi_op_rx,
.map_svc = wmi_main_svc_map,
@@ -4953,6 +4979,7 @@ static const struct wmi_ops wmi_ops = {
.gen_pdev_set_quiet_mode = ath10k_wmi_op_gen_pdev_set_quiet_mode,
/* .gen_pdev_get_temperature not implemented */
.gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp,
+ .gen_addba_send = ath10k_wmi_op_gen_addba_send,
};
static const struct wmi_ops wmi_10_1_ops = {
@@ -5008,6 +5035,7 @@ static const struct wmi_ops wmi_10_1_ops = {
.gen_pktlog_disable = ath10k_wmi_op_gen_pktlog_disable,
.gen_pdev_set_quiet_mode = ath10k_wmi_op_gen_pdev_set_quiet_mode,
.gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp,
+ .gen_addba_send = ath10k_wmi_op_gen_addba_send,
};
static const struct wmi_ops wmi_10_2_ops = {
@@ -5064,6 +5092,7 @@ static const struct wmi_ops wmi_10_2_ops = {
.gen_pktlog_disable = ath10k_wmi_op_gen_pktlog_disable,
.gen_pdev_set_quiet_mode = ath10k_wmi_op_gen_pdev_set_quiet_mode,
.gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp,
+ .gen_addba_send = ath10k_wmi_op_gen_addba_send,
};
static const struct wmi_ops wmi_10_2_4_ops = {
@@ -5120,6 +5149,7 @@ static const struct wmi_ops wmi_10_2_4_ops = {
.gen_pktlog_disable = ath10k_wmi_op_gen_pktlog_disable,
.gen_pdev_set_quiet_mode = ath10k_wmi_op_gen_pdev_set_quiet_mode,
.gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp,
+ .gen_addba_send = ath10k_wmi_op_gen_addba_send,
};
int ath10k_wmi_attach(struct ath10k *ar)
--
2.2.1
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH v2 3/8] ath10k: add wmi support for addba_set_resp
2014-12-24 7:59 [PATCH v2 0/8] ath10k: add per station debugfs support Rajkumar Manoharan
2014-12-24 7:59 ` [PATCH v2 1/8] ath10k: add wmi support for addba_clear_resp Rajkumar Manoharan
2014-12-24 7:59 ` [PATCH v2 2/8] ath10k: add wmi support for addba_send Rajkumar Manoharan
@ 2014-12-24 7:59 ` Rajkumar Manoharan
2014-12-24 7:59 ` [PATCH v2 4/8] ath10k: add wmi support for delba_send Rajkumar Manoharan
` (5 subsequent siblings)
8 siblings, 0 replies; 14+ messages in thread
From: Rajkumar Manoharan @ 2014-12-24 7:59 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Rajkumar Manoharan
Add WMI support for sending addba response manually. This command
is used for debugging purpose.
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/wmi-ops.h | 20 ++++++++++++++++++++
drivers/net/wireless/ath/ath10k/wmi-tlv.c | 1 +
drivers/net/wireless/ath/ath10k/wmi.c | 30 ++++++++++++++++++++++++++++++
3 files changed, 51 insertions(+)
diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h b/drivers/net/wireless/ath/ath10k/wmi-ops.h
index badf422..e8f49de 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-ops.h
+++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h
@@ -123,6 +123,9 @@ struct wmi_ops {
const u8 *mac);
struct sk_buff *(*gen_addba_send)(struct ath10k *ar, u32 vdev_id,
const u8 *mac, u32 tid, u32 buf_size);
+ struct sk_buff *(*gen_addba_set_resp)(struct ath10k *ar, u32 vdev_id,
+ const u8 *mac, u32 tid,
+ u32 status);
};
int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
@@ -894,4 +897,21 @@ ath10k_wmi_addba_send(struct ath10k *ar, u32 vdev_id, const u8 *mac,
ar->wmi.cmd->addba_send_cmdid);
}
+static inline int
+ath10k_wmi_addba_set_resp(struct ath10k *ar, u32 vdev_id, const u8 *mac,
+ u32 tid, u32 status)
+{
+ struct sk_buff *skb;
+
+ if (!ar->wmi.ops->gen_addba_set_resp)
+ return -EOPNOTSUPP;
+
+ skb = ar->wmi.ops->gen_addba_set_resp(ar, vdev_id, mac, tid, status);
+ if (IS_ERR(skb))
+ return PTR_ERR(skb);
+
+ return ath10k_wmi_cmd_send(ar, skb,
+ ar->wmi.cmd->addba_set_resp_cmdid);
+}
+
#endif
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
index 74a0598..63f9860 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
@@ -2209,6 +2209,7 @@ static const struct wmi_ops wmi_tlv_ops = {
/* .gen_pdev_get_temperature not implemented */
/* .gen_addba_clear_resp not implemented */
/* .gen_addba_send not implemented */
+ /* .gen_addba_set_resp not implemented */
};
/************/
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 8103cbc..dd17c00 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -4927,6 +4927,32 @@ ath10k_wmi_op_gen_addba_send(struct ath10k *ar, u32 vdev_id, const u8 *mac,
return skb;
}
+static struct sk_buff *
+ath10k_wmi_op_gen_addba_set_resp(struct ath10k *ar, u32 vdev_id, const u8 *mac,
+ u32 tid, u32 status)
+{
+ struct wmi_addba_setresponse_cmd *cmd;
+ struct sk_buff *skb;
+
+ if (!mac)
+ return ERR_PTR(-EINVAL);
+
+ skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd));
+ if (!skb)
+ return ERR_PTR(-ENOMEM);
+
+ cmd = (struct wmi_addba_setresponse_cmd *)skb->data;
+ cmd->vdev_id = __cpu_to_le32(vdev_id);
+ ether_addr_copy(cmd->peer_macaddr.addr, mac);
+ cmd->tid = __cpu_to_le32(tid);
+ cmd->statuscode = __cpu_to_le32(status);
+
+ ath10k_dbg(ar, ATH10K_DBG_WMI,
+ "wmi addba set resp vdev_id 0x%X mac_addr %pM tid %u status %u\n",
+ vdev_id, mac, tid, status);
+ return skb;
+}
+
static const struct wmi_ops wmi_ops = {
.rx = ath10k_wmi_op_rx,
.map_svc = wmi_main_svc_map,
@@ -4980,6 +5006,7 @@ static const struct wmi_ops wmi_ops = {
/* .gen_pdev_get_temperature not implemented */
.gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp,
.gen_addba_send = ath10k_wmi_op_gen_addba_send,
+ .gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp,
};
static const struct wmi_ops wmi_10_1_ops = {
@@ -5036,6 +5063,7 @@ static const struct wmi_ops wmi_10_1_ops = {
.gen_pdev_set_quiet_mode = ath10k_wmi_op_gen_pdev_set_quiet_mode,
.gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp,
.gen_addba_send = ath10k_wmi_op_gen_addba_send,
+ .gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp,
};
static const struct wmi_ops wmi_10_2_ops = {
@@ -5093,6 +5121,7 @@ static const struct wmi_ops wmi_10_2_ops = {
.gen_pdev_set_quiet_mode = ath10k_wmi_op_gen_pdev_set_quiet_mode,
.gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp,
.gen_addba_send = ath10k_wmi_op_gen_addba_send,
+ .gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp,
};
static const struct wmi_ops wmi_10_2_4_ops = {
@@ -5150,6 +5179,7 @@ static const struct wmi_ops wmi_10_2_4_ops = {
.gen_pdev_set_quiet_mode = ath10k_wmi_op_gen_pdev_set_quiet_mode,
.gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp,
.gen_addba_send = ath10k_wmi_op_gen_addba_send,
+ .gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp,
};
int ath10k_wmi_attach(struct ath10k *ar)
--
2.2.1
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH v2 4/8] ath10k: add wmi support for delba_send
2014-12-24 7:59 [PATCH v2 0/8] ath10k: add per station debugfs support Rajkumar Manoharan
` (2 preceding siblings ...)
2014-12-24 7:59 ` [PATCH v2 3/8] ath10k: add wmi support for addba_set_resp Rajkumar Manoharan
@ 2014-12-24 7:59 ` Rajkumar Manoharan
2014-12-24 7:59 ` [PATCH v2 5/8] ath10k: Implement sta_add_debugfs Rajkumar Manoharan
` (4 subsequent siblings)
8 siblings, 0 replies; 14+ messages in thread
From: Rajkumar Manoharan @ 2014-12-24 7:59 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Rajkumar Manoharan
Add WMI support for sending delba request. This command is used for
debugging purpose.
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/wmi-ops.h | 21 +++++++++++++++++++++
drivers/net/wireless/ath/ath10k/wmi-tlv.c | 1 +
drivers/net/wireless/ath/ath10k/wmi.c | 31 +++++++++++++++++++++++++++++++
3 files changed, 53 insertions(+)
diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h b/drivers/net/wireless/ath/ath10k/wmi-ops.h
index e8f49de..3a3d15e 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-ops.h
+++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h
@@ -126,6 +126,9 @@ struct wmi_ops {
struct sk_buff *(*gen_addba_set_resp)(struct ath10k *ar, u32 vdev_id,
const u8 *mac, u32 tid,
u32 status);
+ struct sk_buff *(*gen_delba_send)(struct ath10k *ar, u32 vdev_id,
+ const u8 *mac, u32 tid, u32 initiator,
+ u32 reason);
};
int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
@@ -914,4 +917,22 @@ ath10k_wmi_addba_set_resp(struct ath10k *ar, u32 vdev_id, const u8 *mac,
ar->wmi.cmd->addba_set_resp_cmdid);
}
+static inline int
+ath10k_wmi_delba_send(struct ath10k *ar, u32 vdev_id, const u8 *mac,
+ u32 tid, u32 initiator, u32 reason)
+{
+ struct sk_buff *skb;
+
+ if (!ar->wmi.ops->gen_delba_send)
+ return -EOPNOTSUPP;
+
+ skb = ar->wmi.ops->gen_delba_send(ar, vdev_id, mac, tid, initiator,
+ reason);
+ if (IS_ERR(skb))
+ return PTR_ERR(skb);
+
+ return ath10k_wmi_cmd_send(ar, skb,
+ ar->wmi.cmd->delba_send_cmdid);
+}
+
#endif
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
index 63f9860..57d2b50 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
@@ -2210,6 +2210,7 @@ static const struct wmi_ops wmi_tlv_ops = {
/* .gen_addba_clear_resp not implemented */
/* .gen_addba_send not implemented */
/* .gen_addba_set_resp not implemented */
+ /* .gen_delba_send not implemented */
};
/************/
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index dd17c00..26d8139 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -4953,6 +4953,33 @@ ath10k_wmi_op_gen_addba_set_resp(struct ath10k *ar, u32 vdev_id, const u8 *mac,
return skb;
}
+static struct sk_buff *
+ath10k_wmi_op_gen_delba_send(struct ath10k *ar, u32 vdev_id, const u8 *mac,
+ u32 tid, u32 initiator, u32 reason)
+{
+ struct wmi_delba_send_cmd *cmd;
+ struct sk_buff *skb;
+
+ if (!mac)
+ return ERR_PTR(-EINVAL);
+
+ skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd));
+ if (!skb)
+ return ERR_PTR(-ENOMEM);
+
+ cmd = (struct wmi_delba_send_cmd *)skb->data;
+ cmd->vdev_id = __cpu_to_le32(vdev_id);
+ ether_addr_copy(cmd->peer_macaddr.addr, mac);
+ cmd->tid = __cpu_to_le32(tid);
+ cmd->initiator = __cpu_to_le32(initiator);
+ cmd->reasoncode = __cpu_to_le32(reason);
+
+ ath10k_dbg(ar, ATH10K_DBG_WMI,
+ "wmi delba send vdev_id 0x%X mac_addr %pM tid %u initiator %u reason %u\n",
+ vdev_id, mac, tid, initiator, reason);
+ return skb;
+}
+
static const struct wmi_ops wmi_ops = {
.rx = ath10k_wmi_op_rx,
.map_svc = wmi_main_svc_map,
@@ -5007,6 +5034,7 @@ static const struct wmi_ops wmi_ops = {
.gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp,
.gen_addba_send = ath10k_wmi_op_gen_addba_send,
.gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp,
+ .gen_delba_send = ath10k_wmi_op_gen_delba_send,
};
static const struct wmi_ops wmi_10_1_ops = {
@@ -5064,6 +5092,7 @@ static const struct wmi_ops wmi_10_1_ops = {
.gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp,
.gen_addba_send = ath10k_wmi_op_gen_addba_send,
.gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp,
+ .gen_delba_send = ath10k_wmi_op_gen_delba_send,
};
static const struct wmi_ops wmi_10_2_ops = {
@@ -5122,6 +5151,7 @@ static const struct wmi_ops wmi_10_2_ops = {
.gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp,
.gen_addba_send = ath10k_wmi_op_gen_addba_send,
.gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp,
+ .gen_delba_send = ath10k_wmi_op_gen_delba_send,
};
static const struct wmi_ops wmi_10_2_4_ops = {
@@ -5180,6 +5210,7 @@ static const struct wmi_ops wmi_10_2_4_ops = {
.gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp,
.gen_addba_send = ath10k_wmi_op_gen_addba_send,
.gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp,
+ .gen_delba_send = ath10k_wmi_op_gen_delba_send,
};
int ath10k_wmi_attach(struct ath10k *ar)
--
2.2.1
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH v2 5/8] ath10k: Implement sta_add_debugfs
2014-12-24 7:59 [PATCH v2 0/8] ath10k: add per station debugfs support Rajkumar Manoharan
` (3 preceding siblings ...)
2014-12-24 7:59 ` [PATCH v2 4/8] ath10k: add wmi support for delba_send Rajkumar Manoharan
@ 2014-12-24 7:59 ` Rajkumar Manoharan
2015-01-12 11:37 ` Kalle Valo
2014-12-24 7:59 ` [PATCH v2 6/8] ath10k: add support to send addba request Rajkumar Manoharan
` (3 subsequent siblings)
8 siblings, 1 reply; 14+ messages in thread
From: Rajkumar Manoharan @ 2014-12-24 7:59 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Rajkumar Manoharan
Add per station debugfs files when a station is added to mac80211's
station list. This helps to group peer specific debugfs entries
altogether. Right now this callback adds support to test aggregation
procedures (addba/addba_resp/delba) manually.
To enable automatic aggregation in target,
echo 0 >/sys/kernel/debug/ieee80211/phyX/netdev:wlanX/
stations/XX:XX:XX:XX:XX:XX/aggr_mode
For manual mode,
echo 1 >/sys/kernel/debug/ieee80211/phyX/netdev:wlanX/
stations/XX:XX:XX:XX:XX:XX/aggr_mode
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/Makefile | 1 +
drivers/net/wireless/ath/ath10k/core.h | 5 ++
drivers/net/wireless/ath/ath10k/debug.h | 11 +++-
drivers/net/wireless/ath/ath10k/debugfs_sta.c | 89 +++++++++++++++++++++++++++
drivers/net/wireless/ath/ath10k/mac.c | 3 +
5 files changed, 108 insertions(+), 1 deletion(-)
create mode 100644 drivers/net/wireless/ath/ath10k/debugfs_sta.c
diff --git a/drivers/net/wireless/ath/ath10k/Makefile b/drivers/net/wireless/ath/ath10k/Makefile
index ffa3b1a..6c0c23e 100644
--- a/drivers/net/wireless/ath/ath10k/Makefile
+++ b/drivers/net/wireless/ath/ath10k/Makefile
@@ -15,6 +15,7 @@ ath10k_core-$(CONFIG_ATH10K_DEBUGFS) += spectral.o
ath10k_core-$(CONFIG_NL80211_TESTMODE) += testmode.o
ath10k_core-$(CONFIG_ATH10K_TRACING) += trace.o
ath10k_core-$(CONFIG_THERMAL) += thermal.o
+ath10k_core-$(CONFIG_MAC80211_DEBUGFS) += debugfs_sta.o
obj-$(CONFIG_ATH10K_PCI) += ath10k_pci.o
ath10k_pci-y += pci.o \
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 7b6d9e4..c568612 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -239,6 +239,11 @@ struct ath10k_sta {
u32 smps;
struct work_struct update_wk;
+
+#ifdef CONFIG_MAC80211_DEBUGFS
+ /* protected by conf_mutex */
+ bool aggr_mode;
+#endif
};
#define ATH10K_VDEV_SETUP_TIMEOUT_HZ (5*HZ)
diff --git a/drivers/net/wireless/ath/ath10k/debug.h b/drivers/net/wireless/ath/ath10k/debug.h
index 1b87a5d..a12b832 100644
--- a/drivers/net/wireless/ath/ath10k/debug.h
+++ b/drivers/net/wireless/ath/ath10k/debug.h
@@ -48,6 +48,12 @@ enum ath10k_pktlog_filter {
ATH10K_PKTLOG_ANY = 0x00000001f,
};
+enum ath10k_dbg_aggr_mode {
+ ATH10K_DBG_AGGR_MODE_AUTO,
+ ATH10K_DBG_AGGR_MODE_MANUAL,
+ ATH10K_DBG_AGGR_MODE_MAX,
+};
+
extern unsigned int ath10k_debug_mask;
__printf(2, 3) void ath10k_info(struct ath10k *ar, const char *fmt, ...);
@@ -77,7 +83,6 @@ int ath10k_debug_get_et_sset_count(struct ieee80211_hw *hw,
void ath10k_debug_get_et_stats(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ethtool_stats *stats, u64 *data);
-
#else
static inline int ath10k_debug_start(struct ath10k *ar)
{
@@ -129,6 +134,10 @@ ath10k_debug_get_new_fw_crash_data(struct ath10k *ar)
#define ath10k_debug_get_et_stats NULL
#endif /* CONFIG_ATH10K_DEBUGFS */
+#ifdef CONFIG_MAC80211_DEBUGFS
+void ath10k_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+ struct ieee80211_sta *sta, struct dentry *dir);
+#endif /* CONFIG_MAC80211_DEBUGFS */
#ifdef CONFIG_ATH10K_DEBUG
__printf(3, 4) void ath10k_dbg(struct ath10k *ar,
diff --git a/drivers/net/wireless/ath/ath10k/debugfs_sta.c b/drivers/net/wireless/ath/ath10k/debugfs_sta.c
new file mode 100644
index 0000000..d5fca70
--- /dev/null
+++ b/drivers/net/wireless/ath/ath10k/debugfs_sta.c
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2014 Qualcomm Atheros, Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+#include <linux/utsname.h>
+
+#include "core.h"
+#include "wmi-ops.h"
+#include "debug.h"
+
+static ssize_t ath10k_dbg_sta_read_aggr_mode(struct file *file,
+ 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;
+ char buf[32];
+ int len = 0;
+
+ mutex_lock(&ar->conf_mutex);
+ len = scnprintf(buf, sizeof(buf) - len, "aggregation mode: %s\n",
+ (arsta->aggr_mode == ATH10K_DBG_AGGR_MODE_AUTO) ?
+ "auto" : "manual");
+ mutex_unlock(&ar->conf_mutex);
+
+ return simple_read_from_buffer(user_buf, count, ppos, buf, len);
+}
+
+static ssize_t ath10k_dbg_sta_write_aggr_mode(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 aggr_mode;
+ int ret;
+
+ if (kstrtouint_from_user(user_buf, count, 0, &aggr_mode))
+ return -EINVAL;
+
+ if (aggr_mode >= ATH10K_DBG_AGGR_MODE_MAX)
+ return -EINVAL;
+
+ mutex_lock(&ar->conf_mutex);
+ if ((ar->state != ATH10K_STATE_ON) ||
+ (aggr_mode == arsta->aggr_mode)) {
+ ret = count;
+ goto out;
+ }
+
+ ret = ath10k_wmi_addba_clear_resp(ar, arsta->arvif->vdev_id, sta->addr);
+ if (ret) {
+ ath10k_warn(ar, "failed to clear addba session ret: %d\n", ret);
+ goto out;
+ }
+
+ arsta->aggr_mode = aggr_mode;
+out:
+ mutex_unlock(&ar->conf_mutex);
+ return ret;
+}
+
+static const struct file_operations fops_aggr_mode = {
+ .read = ath10k_dbg_sta_read_aggr_mode,
+ .write = ath10k_dbg_sta_write_aggr_mode,
+ .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)
+{
+ debugfs_create_file("aggr_mode", S_IRUGO | S_IWUSR, dir, sta,
+ &fops_aggr_mode);
+}
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 5085f55..c7febfc 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -4746,6 +4746,9 @@ static const struct ieee80211_ops ath10k_ops = {
.suspend = ath10k_suspend,
.resume = ath10k_resume,
#endif
+#ifdef CONFIG_MAC80211_DEBUGFS
+ .sta_add_debugfs = ath10k_sta_add_debugfs,
+#endif
};
#define RATETAB_ENT(_rate, _rateid, _flags) { \
--
2.2.1
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH v2 5/8] ath10k: Implement sta_add_debugfs
2014-12-24 7:59 ` [PATCH v2 5/8] ath10k: Implement sta_add_debugfs Rajkumar Manoharan
@ 2015-01-12 11:37 ` Kalle Valo
0 siblings, 0 replies; 14+ messages in thread
From: Kalle Valo @ 2015-01-12 11:37 UTC (permalink / raw)
To: Rajkumar Manoharan; +Cc: ath10k, linux-wireless
Rajkumar Manoharan <rmanohar@qti.qualcomm.com> writes:
> Add per station debugfs files when a station is added to mac80211's
> station list. This helps to group peer specific debugfs entries
> altogether. Right now this callback adds support to test aggregation
> procedures (addba/addba_resp/delba) manually.
>
> To enable automatic aggregation in target,
> echo 0 >/sys/kernel/debug/ieee80211/phyX/netdev:wlanX/
> stations/XX:XX:XX:XX:XX:XX/aggr_mode
>
> For manual mode,
> echo 1 >/sys/kernel/debug/ieee80211/phyX/netdev:wlanX/
> stations/XX:XX:XX:XX:XX:XX/aggr_mode
>
> Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
[...]
> diff --git a/drivers/net/wireless/ath/ath10k/debugfs_sta.c b/drivers/net/wireless/ath/ath10k/debugfs_sta.c
> new file mode 100644
> index 0000000..d5fca70
> --- /dev/null
> +++ b/drivers/net/wireless/ath/ath10k/debugfs_sta.c
> @@ -0,0 +1,89 @@
> +/*
> + * Copyright (c) 2014 Qualcomm Atheros, Inc.
> + *
> + * Permission to use, copy, modify, and/or distribute this software for any
> + * purpose with or without fee is hereby granted, provided that the above
> + * copyright notice and this permission notice appear in all copies.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
> + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
> + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
> + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
> + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
> + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
> + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
> + */
> +#include <linux/utsname.h>
Why include utsname.h? I don't see it used anywhere.
--
Kalle Valo
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v2 6/8] ath10k: add support to send addba request
2014-12-24 7:59 [PATCH v2 0/8] ath10k: add per station debugfs support Rajkumar Manoharan
` (4 preceding siblings ...)
2014-12-24 7:59 ` [PATCH v2 5/8] ath10k: Implement sta_add_debugfs Rajkumar Manoharan
@ 2014-12-24 7:59 ` Rajkumar Manoharan
2015-01-12 11:42 ` Kalle Valo
2014-12-24 7:59 ` [PATCH v2 7/8] ath10k: add support to send addba response Rajkumar Manoharan
` (2 subsequent siblings)
8 siblings, 1 reply; 14+ messages in thread
From: Rajkumar Manoharan @ 2014-12-24 7:59 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Rajkumar Manoharan
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>
---
drivers/net/wireless/ath/ath10k/debugfs_sta.c | 56 +++++++++++++++++++++++++++
1 file changed, 56 insertions(+)
diff --git a/drivers/net/wireless/ath/ath10k/debugfs_sta.c b/drivers/net/wireless/ath/ath10k/debugfs_sta.c
index d5fca70..89e5e5a 100644
--- a/drivers/net/wireless/ath/ath10k/debugfs_sta.c
+++ b/drivers/net/wireless/ath/ath10k/debugfs_sta.c
@@ -81,9 +81,65 @@ static const struct file_operations fops_aggr_mode = {
.llseek = default_llseek,
};
+static ssize_t ath10k_dbg_sta_write_addba(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, buf_size;
+ 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", &tid, &buf_size);
+ if (ret != 2) {
+ ath10k_warn(ar, "ex: echo <tid> <buffer size> >addba\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_addba_send(ar, arsta->arvif->vdev_id, sta->addr,
+ tid, buf_size);
+ if (ret) {
+ ath10k_warn(ar, "failed to send addba request: vdev_id %u peer %pM tid %u buf_size %u\n",
+ arsta->arvif->vdev_id, sta->addr, tid, buf_size);
+ }
+
+ ret = count;
+out:
+ mutex_unlock(&ar->conf_mutex);
+ return ret;
+}
+
+static const struct file_operations fops_addba = {
+ .write = ath10k_dbg_sta_write_addba,
+ .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)
{
debugfs_create_file("aggr_mode", S_IRUGO | S_IWUSR, dir, sta,
&fops_aggr_mode);
+ debugfs_create_file("addba", S_IWUSR, dir, sta, &fops_addba);
}
--
2.2.1
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH v2 6/8] ath10k: add support to send addba request
2014-12-24 7:59 ` [PATCH v2 6/8] ath10k: add support to send addba request Rajkumar Manoharan
@ 2015-01-12 11:42 ` Kalle Valo
0 siblings, 0 replies; 14+ messages in thread
From: Kalle Valo @ 2015-01-12 11:42 UTC (permalink / raw)
To: Rajkumar Manoharan; +Cc: ath10k, linux-wireless
Rajkumar Manoharan <rmanohar@qti.qualcomm.com> writes:
> 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>
[...]
> + ret = sscanf(buf, "%u %u", &tid, &buf_size);
> + if (ret != 2) {
> + ath10k_warn(ar, "ex: echo <tid> <buffer size> >addba\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;
> + }
It's preferred that the driver doesn't print anything based on wrong
user input, so I removed these two warning messages:
--- a/drivers/net/wireless/ath/ath10k/debugfs_sta.c
+++ b/drivers/net/wireless/ath/ath10k/debugfs_sta.c
@@ -97,16 +97,12 @@ static ssize_t ath10k_dbg_sta_write_addba(struct file *file,
buf[sizeof(buf) - 1] = '\0';
ret = sscanf(buf, "%u %u", &tid, &buf_size);
- if (ret != 2) {
- ath10k_warn(ar, "ex: echo <tid> <buffer size> >addba\n");
+ if (ret != 2)
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);
+ if (tid > HTT_DATA_TX_EXT_TID_MGMT - 2)
return -EINVAL;
- }
mutex_lock(&ar->conf_mutex);
if ((ar->state != ATH10K_STATE_ON) ||
--
Kalle Valo
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v2 7/8] ath10k: add support to send addba response
2014-12-24 7:59 [PATCH v2 0/8] ath10k: add per station debugfs support Rajkumar Manoharan
` (5 preceding siblings ...)
2014-12-24 7:59 ` [PATCH v2 6/8] ath10k: add support to send addba request Rajkumar Manoharan
@ 2014-12-24 7:59 ` Rajkumar Manoharan
2015-01-12 11:43 ` Kalle Valo
2014-12-24 7:59 ` [PATCH v2 8/8] ath10k: add support to send delba Rajkumar Manoharan
2015-01-13 14:15 ` [PATCH v2 0/8] ath10k: add per station debugfs support Kalle Valo
8 siblings, 1 reply; 14+ messages in thread
From: Rajkumar Manoharan @ 2014-12-24 7:59 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Rajkumar Manoharan
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>
---
drivers/net/wireless/ath/ath10k/debugfs_sta.c | 55 +++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
diff --git a/drivers/net/wireless/ath/ath10k/debugfs_sta.c b/drivers/net/wireless/ath/ath10k/debugfs_sta.c
index 89e5e5a..95eb5a1 100644
--- a/drivers/net/wireless/ath/ath10k/debugfs_sta.c
+++ b/drivers/net/wireless/ath/ath10k/debugfs_sta.c
@@ -136,10 +136,65 @@ static const struct file_operations fops_addba = {
.llseek = default_llseek,
};
+static ssize_t ath10k_dbg_sta_write_addba_resp(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, status;
+ 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", &tid, &status);
+ if (ret != 2) {
+ ath10k_warn(ar, "ex: echo <tid> <status code> >addba_resp\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_addba_set_resp(ar, arsta->arvif->vdev_id, sta->addr,
+ tid, status);
+ if (ret) {
+ ath10k_warn(ar, "failed to send addba response: vdev_id %u peer %pM tid %u status%u\n",
+ arsta->arvif->vdev_id, sta->addr, tid, status);
+ }
+ ret = count;
+out:
+ mutex_unlock(&ar->conf_mutex);
+ return ret;
+}
+
+static const struct file_operations fops_addba_resp = {
+ .write = ath10k_dbg_sta_write_addba_resp,
+ .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)
{
debugfs_create_file("aggr_mode", S_IRUGO | S_IWUSR, dir, sta,
&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);
}
--
2.2.1
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH v2 7/8] ath10k: add support to send addba response
2014-12-24 7:59 ` [PATCH v2 7/8] ath10k: add support to send addba response Rajkumar Manoharan
@ 2015-01-12 11:43 ` Kalle Valo
0 siblings, 0 replies; 14+ messages in thread
From: Kalle Valo @ 2015-01-12 11:43 UTC (permalink / raw)
To: Rajkumar Manoharan; +Cc: ath10k, linux-wireless
Rajkumar Manoharan <rmanohar@qti.qualcomm.com> writes:
> 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>
Same here:
--- a/drivers/net/wireless/ath/ath10k/debugfs_sta.c
+++ b/drivers/net/wireless/ath/ath10k/debugfs_sta.c
@@ -148,16 +148,12 @@ static ssize_t ath10k_dbg_sta_write_addba_resp(struct file *file,
buf[sizeof(buf) - 1] = '\0';
ret = sscanf(buf, "%u %u", &tid, &status);
- if (ret != 2) {
- ath10k_warn(ar, "ex: echo <tid> <status code> >addba_resp\n");
+ if (ret != 2)
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);
+ if (tid > HTT_DATA_TX_EXT_TID_MGMT - 2)
return -EINVAL;
- }
mutex_lock(&ar->conf_mutex);
if ((ar->state != ATH10K_STATE_ON) ||
--
Kalle Valo
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v2 8/8] ath10k: add support to send delba
2014-12-24 7:59 [PATCH v2 0/8] ath10k: add per station debugfs support Rajkumar Manoharan
` (6 preceding siblings ...)
2014-12-24 7:59 ` [PATCH v2 7/8] ath10k: add support to send addba response Rajkumar Manoharan
@ 2014-12-24 7:59 ` Rajkumar Manoharan
2015-01-12 11:45 ` Kalle Valo
2015-01-13 14:15 ` [PATCH v2 0/8] ath10k: add per station debugfs support Kalle Valo
8 siblings, 1 reply; 14+ messages in thread
From: Rajkumar Manoharan @ 2014-12-24 7:59 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Rajkumar Manoharan
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(+)
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);
}
--
2.2.1
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH v2 8/8] ath10k: add support to send delba
2014-12-24 7:59 ` [PATCH v2 8/8] ath10k: add support to send delba Rajkumar Manoharan
@ 2015-01-12 11:45 ` Kalle Valo
0 siblings, 0 replies; 14+ messages in thread
From: Kalle Valo @ 2015-01-12 11:45 UTC (permalink / raw)
To: Rajkumar Manoharan; +Cc: ath10k, linux-wireless
Rajkumar Manoharan <rmanohar@qti.qualcomm.com> writes:
> 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>
[...]
> + 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;
> + }
And I did the same here as well.
--
Kalle Valo
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 0/8] ath10k: add per station debugfs support
2014-12-24 7:59 [PATCH v2 0/8] ath10k: add per station debugfs support Rajkumar Manoharan
` (7 preceding siblings ...)
2014-12-24 7:59 ` [PATCH v2 8/8] ath10k: add support to send delba Rajkumar Manoharan
@ 2015-01-13 14:15 ` Kalle Valo
8 siblings, 0 replies; 14+ messages in thread
From: Kalle Valo @ 2015-01-13 14:15 UTC (permalink / raw)
To: Rajkumar Manoharan; +Cc: ath10k, linux-wireless
Rajkumar Manoharan <rmanohar@qti.qualcomm.com> writes:
> The following patches add support for sending addba/addba response/delba
> for every station entries. These commands are purely for testing purpose.
>
> Before using any of the above aggregation commands, the mode should be moved
> to manual. To disable automatic aggretation in target
>
> echo 1 >/sys/kernel/debug/ieee80211/phyX/netdev:wlanX/
> stations/XX:XX:XX:XX:XX:XX/aggr_mode
>
> Then for sending addba request,
>
> echo 1 32 >/sys/kernel/debug/ieee80211/phyX/netdev:wlanX/
> stations/XX:XX:XX:XX:XX:XX/addba
>
> To send addba response,
>
> echo 0 25 >/sys/kernel/debug/ieee80211/phyX/netdev:wlanX/
> stations/XX:XX:XX:XX:XX:XX/addba_resp
>
> And for delba,
>
> echo 0 1 37 >/sys/kernel/debug/ieee80211/phyX/netdev:wlanX/
> stations/XX:XX:XX:XX:XX:XX/delba
>
> v2: Rebased on top of 10.2.4 WMI ops support
>
> Rajkumar Manoharan (8):
> ath10k: add wmi support for addba_clear_resp
> ath10k: add wmi support for addba_send
> ath10k: add wmi support for addba_set_resp
> ath10k: add wmi support for delba_send
> ath10k: Implement sta_add_debugfs
> ath10k: add support to send addba request
> ath10k: add support to send addba response
> ath10k: add support to send delba
Thanks, all eight patches applied to ath.git.
--
Kalle Valo
^ permalink raw reply [flat|nested] 14+ messages in thread