Commit 50abef85 authored by Rajkumar Manoharan's avatar Rajkumar Manoharan Committed by Kalle Valo

ath10k: add wmi support for delba_send

Add WMI support for sending delba request. This command is used for
debugging purpose.
Signed-off-by: default avatarRajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent 11597413
...@@ -126,6 +126,9 @@ struct wmi_ops { ...@@ -126,6 +126,9 @@ struct wmi_ops {
struct sk_buff *(*gen_addba_set_resp)(struct ath10k *ar, u32 vdev_id, struct sk_buff *(*gen_addba_set_resp)(struct ath10k *ar, u32 vdev_id,
const u8 *mac, u32 tid, const u8 *mac, u32 tid,
u32 status); 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); 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, ...@@ -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); 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 #endif
...@@ -2210,6 +2210,7 @@ static const struct wmi_ops wmi_tlv_ops = { ...@@ -2210,6 +2210,7 @@ static const struct wmi_ops wmi_tlv_ops = {
/* .gen_addba_clear_resp not implemented */ /* .gen_addba_clear_resp not implemented */
/* .gen_addba_send not implemented */ /* .gen_addba_send not implemented */
/* .gen_addba_set_resp not implemented */ /* .gen_addba_set_resp not implemented */
/* .gen_delba_send not implemented */
}; };
/************/ /************/
......
...@@ -4956,6 +4956,33 @@ ath10k_wmi_op_gen_addba_set_resp(struct ath10k *ar, u32 vdev_id, const u8 *mac, ...@@ -4956,6 +4956,33 @@ ath10k_wmi_op_gen_addba_set_resp(struct ath10k *ar, u32 vdev_id, const u8 *mac,
return skb; 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 = { static const struct wmi_ops wmi_ops = {
.rx = ath10k_wmi_op_rx, .rx = ath10k_wmi_op_rx,
.map_svc = wmi_main_svc_map, .map_svc = wmi_main_svc_map,
...@@ -5010,6 +5037,7 @@ static const struct wmi_ops wmi_ops = { ...@@ -5010,6 +5037,7 @@ static const struct wmi_ops wmi_ops = {
.gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp, .gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp,
.gen_addba_send = ath10k_wmi_op_gen_addba_send, .gen_addba_send = ath10k_wmi_op_gen_addba_send,
.gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp, .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 = { static const struct wmi_ops wmi_10_1_ops = {
...@@ -5067,6 +5095,7 @@ static const struct wmi_ops wmi_10_1_ops = { ...@@ -5067,6 +5095,7 @@ static const struct wmi_ops wmi_10_1_ops = {
.gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp, .gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp,
.gen_addba_send = ath10k_wmi_op_gen_addba_send, .gen_addba_send = ath10k_wmi_op_gen_addba_send,
.gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp, .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 = { static const struct wmi_ops wmi_10_2_ops = {
...@@ -5125,6 +5154,7 @@ static const struct wmi_ops wmi_10_2_ops = { ...@@ -5125,6 +5154,7 @@ static const struct wmi_ops wmi_10_2_ops = {
.gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp, .gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp,
.gen_addba_send = ath10k_wmi_op_gen_addba_send, .gen_addba_send = ath10k_wmi_op_gen_addba_send,
.gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp, .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 = { static const struct wmi_ops wmi_10_2_4_ops = {
...@@ -5183,6 +5213,7 @@ static const struct wmi_ops wmi_10_2_4_ops = { ...@@ -5183,6 +5213,7 @@ static const struct wmi_ops wmi_10_2_4_ops = {
.gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp, .gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp,
.gen_addba_send = ath10k_wmi_op_gen_addba_send, .gen_addba_send = ath10k_wmi_op_gen_addba_send,
.gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp, .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) int ath10k_wmi_attach(struct ath10k *ar)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment