diff options
author | Rajkumar Manoharan <rmanohar@qti.qualcomm.com> | 2015-01-12 07:07:26 -0500 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2015-01-13 09:13:01 -0500 |
commit | 50abef85e7cc7576b37ba8dbe480f0537fe74d6d (patch) | |
tree | 3ee0d6d1d8fa1fbca9f508e9ca15a18c2ddfcd2b | |
parent | 11597413b22d1a2ee02501d4167ae712a2b7929e (diff) |
ath10k: add wmi support for delba_send
Add WMI support for sending delba request. This command is used for
debugging purpose.
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/wmi-ops.h | 21 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi-tlv.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi.c | 31 |
3 files changed, 53 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h b/drivers/net/wireless/ath/ath10k/wmi-ops.h index e8f49de18369..3a3d15e65e0a 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 { | |||
126 | struct sk_buff *(*gen_addba_set_resp)(struct ath10k *ar, u32 vdev_id, | 126 | struct sk_buff *(*gen_addba_set_resp)(struct ath10k *ar, u32 vdev_id, |
127 | const u8 *mac, u32 tid, | 127 | const u8 *mac, u32 tid, |
128 | u32 status); | 128 | u32 status); |
129 | struct sk_buff *(*gen_delba_send)(struct ath10k *ar, u32 vdev_id, | ||
130 | const u8 *mac, u32 tid, u32 initiator, | ||
131 | u32 reason); | ||
129 | }; | 132 | }; |
130 | 133 | ||
131 | int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id); | 134 | 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 | ar->wmi.cmd->addba_set_resp_cmdid); | 917 | ar->wmi.cmd->addba_set_resp_cmdid); |
915 | } | 918 | } |
916 | 919 | ||
920 | static inline int | ||
921 | ath10k_wmi_delba_send(struct ath10k *ar, u32 vdev_id, const u8 *mac, | ||
922 | u32 tid, u32 initiator, u32 reason) | ||
923 | { | ||
924 | struct sk_buff *skb; | ||
925 | |||
926 | if (!ar->wmi.ops->gen_delba_send) | ||
927 | return -EOPNOTSUPP; | ||
928 | |||
929 | skb = ar->wmi.ops->gen_delba_send(ar, vdev_id, mac, tid, initiator, | ||
930 | reason); | ||
931 | if (IS_ERR(skb)) | ||
932 | return PTR_ERR(skb); | ||
933 | |||
934 | return ath10k_wmi_cmd_send(ar, skb, | ||
935 | ar->wmi.cmd->delba_send_cmdid); | ||
936 | } | ||
937 | |||
917 | #endif | 938 | #endif |
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c index 63f98600cc05..57d2b50c1f00 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 = { | |||
2210 | /* .gen_addba_clear_resp not implemented */ | 2210 | /* .gen_addba_clear_resp not implemented */ |
2211 | /* .gen_addba_send not implemented */ | 2211 | /* .gen_addba_send not implemented */ |
2212 | /* .gen_addba_set_resp not implemented */ | 2212 | /* .gen_addba_set_resp not implemented */ |
2213 | /* .gen_delba_send not implemented */ | ||
2213 | }; | 2214 | }; |
2214 | 2215 | ||
2215 | /************/ | 2216 | /************/ |
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 9872181d33aa..2d3c700e2cbb 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c | |||
@@ -4956,6 +4956,33 @@ ath10k_wmi_op_gen_addba_set_resp(struct ath10k *ar, u32 vdev_id, const u8 *mac, | |||
4956 | return skb; | 4956 | return skb; |
4957 | } | 4957 | } |
4958 | 4958 | ||
4959 | static struct sk_buff * | ||
4960 | ath10k_wmi_op_gen_delba_send(struct ath10k *ar, u32 vdev_id, const u8 *mac, | ||
4961 | u32 tid, u32 initiator, u32 reason) | ||
4962 | { | ||
4963 | struct wmi_delba_send_cmd *cmd; | ||
4964 | struct sk_buff *skb; | ||
4965 | |||
4966 | if (!mac) | ||
4967 | return ERR_PTR(-EINVAL); | ||
4968 | |||
4969 | skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); | ||
4970 | if (!skb) | ||
4971 | return ERR_PTR(-ENOMEM); | ||
4972 | |||
4973 | cmd = (struct wmi_delba_send_cmd *)skb->data; | ||
4974 | cmd->vdev_id = __cpu_to_le32(vdev_id); | ||
4975 | ether_addr_copy(cmd->peer_macaddr.addr, mac); | ||
4976 | cmd->tid = __cpu_to_le32(tid); | ||
4977 | cmd->initiator = __cpu_to_le32(initiator); | ||
4978 | cmd->reasoncode = __cpu_to_le32(reason); | ||
4979 | |||
4980 | ath10k_dbg(ar, ATH10K_DBG_WMI, | ||
4981 | "wmi delba send vdev_id 0x%X mac_addr %pM tid %u initiator %u reason %u\n", | ||
4982 | vdev_id, mac, tid, initiator, reason); | ||
4983 | return skb; | ||
4984 | } | ||
4985 | |||
4959 | static const struct wmi_ops wmi_ops = { | 4986 | static const struct wmi_ops wmi_ops = { |
4960 | .rx = ath10k_wmi_op_rx, | 4987 | .rx = ath10k_wmi_op_rx, |
4961 | .map_svc = wmi_main_svc_map, | 4988 | .map_svc = wmi_main_svc_map, |
@@ -5010,6 +5037,7 @@ static const struct wmi_ops wmi_ops = { | |||
5010 | .gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp, | 5037 | .gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp, |
5011 | .gen_addba_send = ath10k_wmi_op_gen_addba_send, | 5038 | .gen_addba_send = ath10k_wmi_op_gen_addba_send, |
5012 | .gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp, | 5039 | .gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp, |
5040 | .gen_delba_send = ath10k_wmi_op_gen_delba_send, | ||
5013 | }; | 5041 | }; |
5014 | 5042 | ||
5015 | static const struct wmi_ops wmi_10_1_ops = { | 5043 | static const struct wmi_ops wmi_10_1_ops = { |
@@ -5067,6 +5095,7 @@ static const struct wmi_ops wmi_10_1_ops = { | |||
5067 | .gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp, | 5095 | .gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp, |
5068 | .gen_addba_send = ath10k_wmi_op_gen_addba_send, | 5096 | .gen_addba_send = ath10k_wmi_op_gen_addba_send, |
5069 | .gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp, | 5097 | .gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp, |
5098 | .gen_delba_send = ath10k_wmi_op_gen_delba_send, | ||
5070 | }; | 5099 | }; |
5071 | 5100 | ||
5072 | static const struct wmi_ops wmi_10_2_ops = { | 5101 | static const struct wmi_ops wmi_10_2_ops = { |
@@ -5125,6 +5154,7 @@ static const struct wmi_ops wmi_10_2_ops = { | |||
5125 | .gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp, | 5154 | .gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp, |
5126 | .gen_addba_send = ath10k_wmi_op_gen_addba_send, | 5155 | .gen_addba_send = ath10k_wmi_op_gen_addba_send, |
5127 | .gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp, | 5156 | .gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp, |
5157 | .gen_delba_send = ath10k_wmi_op_gen_delba_send, | ||
5128 | }; | 5158 | }; |
5129 | 5159 | ||
5130 | static const struct wmi_ops wmi_10_2_4_ops = { | 5160 | 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 | .gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp, | 5213 | .gen_addba_clear_resp = ath10k_wmi_op_gen_addba_clear_resp, |
5184 | .gen_addba_send = ath10k_wmi_op_gen_addba_send, | 5214 | .gen_addba_send = ath10k_wmi_op_gen_addba_send, |
5185 | .gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp, | 5215 | .gen_addba_set_resp = ath10k_wmi_op_gen_addba_set_resp, |
5216 | .gen_delba_send = ath10k_wmi_op_gen_delba_send, | ||
5186 | }; | 5217 | }; |
5187 | 5218 | ||
5188 | int ath10k_wmi_attach(struct ath10k *ar) | 5219 | int ath10k_wmi_attach(struct ath10k *ar) |