Skip to content

Commit

Permalink
ath10k: implement adaptive qcs command
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michal Kazior authored and Kalle Valo committed Apr 1, 2015
1 parent 500ff9f commit 5b272e3
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 0 deletions.
16 changes: 16 additions & 0 deletions drivers/net/wireless/ath/ath10k/wmi-ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
30 changes: 30 additions & 0 deletions drivers/net/wireless/ath/ath10k/wmi-tlv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
/****************/
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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,
};

/************/
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/wireless/ath/ath10k/wmi-tlv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions drivers/net/wireless/ath/ath10k/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/ath/ath10k/wmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

/*
Expand Down

0 comments on commit 5b272e3

Please sign in to comment.