]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ath10k: add wmi support for addba_set_resp
authorRajkumar Manoharan <rmanohar@qti.qualcomm.com>
Mon, 12 Jan 2015 12:07:26 +0000 (14:07 +0200)
committerKalle Valo <kvalo@qca.qualcomm.com>
Tue, 13 Jan 2015 14:12:46 +0000 (16:12 +0200)
Add WMI support for sending addba response manually. 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>
drivers/net/wireless/ath/ath10k/wmi-ops.h
drivers/net/wireless/ath/ath10k/wmi-tlv.c
drivers/net/wireless/ath/ath10k/wmi.c

index badf4223335c6bcce5dc293537737de9271d933f..e8f49de183699134958d52c1b8fad2c45eacbb6e 100644 (file)
@@ -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
index 74a0598634ed3ac9dc12b4badbc9e01c2a9b2e4c..63f98600cc05ca72350a0fba63670a882c300728 100644 (file)
@@ -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 */
 };
 
 /************/
index 980d6ee82cc6b887c9cba01ddf08118ab4fc00f7..9872181d33aa4706f2b9f5b3fa7cff0a14496aad 100644 (file)
@@ -4930,6 +4930,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,
@@ -4983,6 +5009,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 = {
@@ -5039,6 +5066,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 = {
@@ -5096,6 +5124,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 = {
@@ -5153,6 +5182,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)