ath10k: implement adaptive qcs command
authorMichal Kazior <michal.kazior@tieto.com>
Tue, 31 Mar 2015 10:26:22 +0000 (10:26 +0000)
committerKalle Valo <kvalo@qca.qualcomm.com>
Wed, 1 Apr 2015 17:30:52 +0000 (20:30 +0300)
This command will be used to configure
multi-channel scheduler in firmware.

Signed-off-by: Michal Kazior <michal.kazior@tieto.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-tlv.h
drivers/net/wireless/ath/ath10k/wmi.c
drivers/net/wireless/ath/ath10k/wmi.h

index 5d7bbec17b53a5ac75d485d912e78464f925efcc..47fe2e756becd4ebacabf199ee204f732413e378 100644 (file)
@@ -173,6 +173,7 @@ struct wmi_ops {
                                                const struct wmi_tdls_peer_update_cmd_arg *arg,
                                                const struct wmi_tdls_peer_capab_arg *cap,
                                                const struct wmi_channel_arg *chan);
+       struct sk_buff *(*gen_adaptive_qcs)(struct ath10k *ar, bool enable);
 };
 
 int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
@@ -1232,4 +1233,19 @@ ath10k_wmi_tdls_peer_update(struct ath10k *ar,
                                   ar->wmi.cmd->tdls_peer_update_cmdid);
 }
 
+static inline int
+ath10k_wmi_adaptive_qcs(struct ath10k *ar, bool enable)
+{
+       struct sk_buff *skb;
+
+       if (!ar->wmi.ops->gen_adaptive_qcs)
+               return -EOPNOTSUPP;
+
+       skb = ar->wmi.ops->gen_adaptive_qcs(ar, enable);
+       if (IS_ERR(skb))
+               return PTR_ERR(skb);
+
+       return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->adaptive_qcs_cmdid);
+}
+
 #endif
index ac3b4fd5b752cdfedec937f8761c82d2c55baffb..28cab0777ef1171d82a64ea48177e6614c461776 100644 (file)
@@ -2947,6 +2947,34 @@ ath10k_wmi_tlv_op_gen_wow_del_pattern(struct ath10k *ar, u32 vdev_id,
        return skb;
 }
 
+static struct sk_buff *
+ath10k_wmi_tlv_op_gen_adaptive_qcs(struct ath10k *ar, bool enable)
+{
+       struct wmi_tlv_adaptive_qcs *cmd;
+       struct wmi_tlv *tlv;
+       struct sk_buff *skb;
+       void *ptr;
+       size_t len;
+
+       len = sizeof(*tlv) + sizeof(*cmd);
+       skb = ath10k_wmi_alloc_skb(ar, len);
+       if (!skb)
+               return ERR_PTR(-ENOMEM);
+
+       ptr = (void *)skb->data;
+       tlv = ptr;
+       tlv->tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_RESMGR_ADAPTIVE_OCS_CMD);
+       tlv->len = __cpu_to_le16(sizeof(*cmd));
+       cmd = (void *)tlv->value;
+       cmd->enable = __cpu_to_le32(enable ? 1 : 0);
+
+       ptr += sizeof(*tlv);
+       ptr += sizeof(*cmd);
+
+       ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv adaptive qcs %d\n", enable);
+       return skb;
+}
+
 /****************/
 /* TLV mappings */
 /****************/
@@ -3073,6 +3101,7 @@ static struct wmi_cmd_map wmi_tlv_cmd_map = {
        .vdev_set_wmm_params_cmdid = WMI_TLV_VDEV_SET_WMM_PARAMS_CMDID,
        .tdls_set_state_cmdid = WMI_TLV_TDLS_SET_STATE_CMDID,
        .tdls_peer_update_cmdid = WMI_TLV_TDLS_PEER_UPDATE_CMDID,
+       .adaptive_qcs_cmdid = WMI_TLV_RESMGR_ADAPTIVE_OCS_CMDID,
 };
 
 static struct wmi_pdev_param_map wmi_tlv_pdev_param_map = {
@@ -3254,6 +3283,7 @@ static const struct wmi_ops wmi_tlv_ops = {
        .gen_wow_del_pattern = ath10k_wmi_tlv_op_gen_wow_del_pattern,
        .gen_update_fw_tdls_state = ath10k_wmi_tlv_op_gen_update_fw_tdls_state,
        .gen_tdls_peer_update = ath10k_wmi_tlv_op_gen_tdls_peer_update,
+       .gen_adaptive_qcs = ath10k_wmi_tlv_op_gen_adaptive_qcs,
 };
 
 /************/
index f65b6148cc7700532fa508e559babf9f3db37466..8d41492f3aff2971f1ae9a744abdad15d918169b 100644 (file)
@@ -1576,6 +1576,10 @@ struct wmi_tdls_peer_capab {
        __le32 pref_offchan_bw;
 } __packed;
 
+struct wmi_tlv_adaptive_qcs {
+       __le32 enable;
+} __packed;
+
 void ath10k_wmi_tlv_attach(struct ath10k *ar);
 
 #endif
index 9694cd0a02496192520cda56d8d215a1519b097e..20fd9f61fbadd63415df81a580077922d3d11203 100644 (file)
@@ -5212,6 +5212,7 @@ static const struct wmi_ops wmi_ops = {
        /* .gen_bcn_tmpl not implemented */
        /* .gen_prb_tmpl not implemented */
        /* .gen_p2p_go_bcn_ie not implemented */
+       /* .gen_adaptive_qcs not implemented */
 };
 
 static const struct wmi_ops wmi_10_1_ops = {
@@ -5275,6 +5276,7 @@ static const struct wmi_ops wmi_10_1_ops = {
        /* .gen_bcn_tmpl not implemented */
        /* .gen_prb_tmpl not implemented */
        /* .gen_p2p_go_bcn_ie not implemented */
+       /* .gen_adaptive_qcs not implemented */
 };
 
 static const struct wmi_ops wmi_10_2_ops = {
@@ -5399,6 +5401,7 @@ static const struct wmi_ops wmi_10_2_4_ops = {
        /* .gen_bcn_tmpl not implemented */
        /* .gen_prb_tmpl not implemented */
        /* .gen_p2p_go_bcn_ie not implemented */
+       /* .gen_adaptive_qcs not implemented */
 };
 
 int ath10k_wmi_attach(struct ath10k *ar)
index 00b5799c5cdb8b0dbef7663833571d45e7befee2..d0942b0a4326aba5110616c79b81bfa63ebc7296 100644 (file)
@@ -554,6 +554,7 @@ struct wmi_cmd_map {
        u32 vdev_set_wmm_params_cmdid;
        u32 tdls_set_state_cmdid;
        u32 tdls_peer_update_cmdid;
+       u32 adaptive_qcs_cmdid;
 };
 
 /*
This page took 0.029096 seconds and 5 git commands to generate.