Commit 5e752e42 authored by Michal Kazior's avatar Michal Kazior Committed by Kalle Valo

ath10k: move wmm param storage to vif

mac80211 already requests WMM per vif but firmware
wasn't able to handle this until now. However new
wmi-tlv firmware for qca6174 is capable of this.

This prepares per-vif WMM param setup.
Signed-off-by: default avatarMichal Kazior <michal.kazior@tieto.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent eebc67fe
...@@ -315,6 +315,7 @@ struct ath10k_vif { ...@@ -315,6 +315,7 @@ struct ath10k_vif {
bool use_cts_prot; bool use_cts_prot;
int num_legacy_stations; int num_legacy_stations;
int txpower; int txpower;
struct wmi_wmm_params_all_arg wmm_params;
}; };
struct ath10k_vif_iter { struct ath10k_vif_iter {
...@@ -577,7 +578,6 @@ struct ath10k { ...@@ -577,7 +578,6 @@ struct ath10k {
u8 cfg_tx_chainmask; u8 cfg_tx_chainmask;
u8 cfg_rx_chainmask; u8 cfg_rx_chainmask;
struct wmi_pdev_set_wmm_params_arg wmm_params;
struct completion install_key_done; struct completion install_key_done;
struct completion vdev_setup_done; struct completion vdev_setup_done;
......
...@@ -4092,6 +4092,7 @@ static int ath10k_conf_tx(struct ieee80211_hw *hw, ...@@ -4092,6 +4092,7 @@ static int ath10k_conf_tx(struct ieee80211_hw *hw,
const struct ieee80211_tx_queue_params *params) const struct ieee80211_tx_queue_params *params)
{ {
struct ath10k *ar = hw->priv; struct ath10k *ar = hw->priv;
struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
struct wmi_wmm_params_arg *p = NULL; struct wmi_wmm_params_arg *p = NULL;
int ret; int ret;
...@@ -4099,16 +4100,16 @@ static int ath10k_conf_tx(struct ieee80211_hw *hw, ...@@ -4099,16 +4100,16 @@ static int ath10k_conf_tx(struct ieee80211_hw *hw,
switch (ac) { switch (ac) {
case IEEE80211_AC_VO: case IEEE80211_AC_VO:
p = &ar->wmm_params.ac_vo; p = &arvif->wmm_params.ac_vo;
break; break;
case IEEE80211_AC_VI: case IEEE80211_AC_VI:
p = &ar->wmm_params.ac_vi; p = &arvif->wmm_params.ac_vi;
break; break;
case IEEE80211_AC_BE: case IEEE80211_AC_BE:
p = &ar->wmm_params.ac_be; p = &arvif->wmm_params.ac_be;
break; break;
case IEEE80211_AC_BK: case IEEE80211_AC_BK:
p = &ar->wmm_params.ac_bk; p = &arvif->wmm_params.ac_bk;
break; break;
} }
...@@ -4129,7 +4130,7 @@ static int ath10k_conf_tx(struct ieee80211_hw *hw, ...@@ -4129,7 +4130,7 @@ static int ath10k_conf_tx(struct ieee80211_hw *hw,
p->txop = params->txop * 32; p->txop = params->txop * 32;
/* FIXME: FW accepts wmm params per hw, not per vif */ /* FIXME: FW accepts wmm params per hw, not per vif */
ret = ath10k_wmi_pdev_set_wmm_params(ar, &ar->wmm_params); ret = ath10k_wmi_pdev_set_wmm_params(ar, &arvif->wmm_params);
if (ret) { if (ret) {
ath10k_warn(ar, "failed to set wmm params: %d\n", ret); ath10k_warn(ar, "failed to set wmm params: %d\n", ret);
goto exit; goto exit;
......
...@@ -104,7 +104,7 @@ struct wmi_ops { ...@@ -104,7 +104,7 @@ struct wmi_ops {
const struct wmi_scan_chan_list_arg *arg); const struct wmi_scan_chan_list_arg *arg);
struct sk_buff *(*gen_beacon_dma)(struct ath10k_vif *arvif); struct sk_buff *(*gen_beacon_dma)(struct ath10k_vif *arvif);
struct sk_buff *(*gen_pdev_set_wmm)(struct ath10k *ar, struct sk_buff *(*gen_pdev_set_wmm)(struct ath10k *ar,
const struct wmi_pdev_set_wmm_params_arg *arg); const struct wmi_wmm_params_all_arg *arg);
struct sk_buff *(*gen_request_stats)(struct ath10k *ar, struct sk_buff *(*gen_request_stats)(struct ath10k *ar,
enum wmi_stats_id stats_id); enum wmi_stats_id stats_id);
struct sk_buff *(*gen_force_fw_hang)(struct ath10k *ar, struct sk_buff *(*gen_force_fw_hang)(struct ath10k *ar,
...@@ -774,7 +774,7 @@ ath10k_wmi_beacon_send_ref_nowait(struct ath10k_vif *arvif) ...@@ -774,7 +774,7 @@ ath10k_wmi_beacon_send_ref_nowait(struct ath10k_vif *arvif)
static inline int static inline int
ath10k_wmi_pdev_set_wmm_params(struct ath10k *ar, ath10k_wmi_pdev_set_wmm_params(struct ath10k *ar,
const struct wmi_pdev_set_wmm_params_arg *arg) const struct wmi_wmm_params_all_arg *arg)
{ {
struct sk_buff *skb; struct sk_buff *skb;
......
...@@ -1584,6 +1584,21 @@ ath10k_wmi_tlv_op_gen_vdev_sta_uapsd(struct ath10k *ar, u32 vdev_id, ...@@ -1584,6 +1584,21 @@ ath10k_wmi_tlv_op_gen_vdev_sta_uapsd(struct ath10k *ar, u32 vdev_id,
return skb; return skb;
} }
static void *ath10k_wmi_tlv_put_wmm(void *ptr,
const struct wmi_wmm_params_arg *arg)
{
struct wmi_wmm_params *wmm;
struct wmi_tlv *tlv;
tlv = ptr;
tlv->tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_WMM_PARAMS);
tlv->len = __cpu_to_le16(sizeof(*wmm));
wmm = (void *)tlv->value;
ath10k_wmi_set_wmm_param(wmm, arg);
return ptr + sizeof(*tlv) + sizeof(*wmm);
}
static struct sk_buff * static struct sk_buff *
ath10k_wmi_tlv_op_gen_peer_create(struct ath10k *ar, u32 vdev_id, ath10k_wmi_tlv_op_gen_peer_create(struct ath10k *ar, u32 vdev_id,
const u8 peer_addr[ETH_ALEN]) const u8 peer_addr[ETH_ALEN])
...@@ -1944,24 +1959,9 @@ ath10k_wmi_tlv_op_gen_beacon_dma(struct ath10k_vif *arvif) ...@@ -1944,24 +1959,9 @@ ath10k_wmi_tlv_op_gen_beacon_dma(struct ath10k_vif *arvif)
return skb; return skb;
} }
static void *ath10k_wmi_tlv_put_wmm(void *ptr,
const struct wmi_wmm_params_arg *arg)
{
struct wmi_wmm_params *wmm;
struct wmi_tlv *tlv;
tlv = ptr;
tlv->tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_WMM_PARAMS);
tlv->len = __cpu_to_le16(sizeof(*wmm));
wmm = (void *)tlv->value;
ath10k_wmi_pdev_set_wmm_param(wmm, arg);
return ptr + sizeof(*tlv) + sizeof(*wmm);
}
static struct sk_buff * static struct sk_buff *
ath10k_wmi_tlv_op_gen_pdev_set_wmm(struct ath10k *ar, ath10k_wmi_tlv_op_gen_pdev_set_wmm(struct ath10k *ar,
const struct wmi_pdev_set_wmm_params_arg *arg) const struct wmi_wmm_params_all_arg *arg)
{ {
struct wmi_tlv_pdev_set_wmm_cmd *cmd; struct wmi_tlv_pdev_set_wmm_cmd *cmd;
struct wmi_wmm_params *wmm; struct wmi_wmm_params *wmm;
......
...@@ -4890,8 +4890,8 @@ ath10k_wmi_op_gen_beacon_dma(struct ath10k_vif *arvif) ...@@ -4890,8 +4890,8 @@ ath10k_wmi_op_gen_beacon_dma(struct ath10k_vif *arvif)
return skb; return skb;
} }
void ath10k_wmi_pdev_set_wmm_param(struct wmi_wmm_params *params, void ath10k_wmi_set_wmm_param(struct wmi_wmm_params *params,
const struct wmi_wmm_params_arg *arg) const struct wmi_wmm_params_arg *arg)
{ {
params->cwmin = __cpu_to_le32(arg->cwmin); params->cwmin = __cpu_to_le32(arg->cwmin);
params->cwmax = __cpu_to_le32(arg->cwmax); params->cwmax = __cpu_to_le32(arg->cwmax);
...@@ -4903,7 +4903,7 @@ void ath10k_wmi_pdev_set_wmm_param(struct wmi_wmm_params *params, ...@@ -4903,7 +4903,7 @@ void ath10k_wmi_pdev_set_wmm_param(struct wmi_wmm_params *params,
static struct sk_buff * static struct sk_buff *
ath10k_wmi_op_gen_pdev_set_wmm(struct ath10k *ar, ath10k_wmi_op_gen_pdev_set_wmm(struct ath10k *ar,
const struct wmi_pdev_set_wmm_params_arg *arg) const struct wmi_wmm_params_all_arg *arg)
{ {
struct wmi_pdev_set_wmm_params *cmd; struct wmi_pdev_set_wmm_params *cmd;
struct sk_buff *skb; struct sk_buff *skb;
...@@ -4913,10 +4913,10 @@ ath10k_wmi_op_gen_pdev_set_wmm(struct ath10k *ar, ...@@ -4913,10 +4913,10 @@ ath10k_wmi_op_gen_pdev_set_wmm(struct ath10k *ar,
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
cmd = (struct wmi_pdev_set_wmm_params *)skb->data; cmd = (struct wmi_pdev_set_wmm_params *)skb->data;
ath10k_wmi_pdev_set_wmm_param(&cmd->ac_be, &arg->ac_be); ath10k_wmi_set_wmm_param(&cmd->ac_be, &arg->ac_be);
ath10k_wmi_pdev_set_wmm_param(&cmd->ac_bk, &arg->ac_bk); ath10k_wmi_set_wmm_param(&cmd->ac_bk, &arg->ac_bk);
ath10k_wmi_pdev_set_wmm_param(&cmd->ac_vi, &arg->ac_vi); ath10k_wmi_set_wmm_param(&cmd->ac_vi, &arg->ac_vi);
ath10k_wmi_pdev_set_wmm_param(&cmd->ac_vo, &arg->ac_vo); ath10k_wmi_set_wmm_param(&cmd->ac_vo, &arg->ac_vo);
ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi pdev set wmm params\n"); ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi pdev set wmm params\n");
return skb; return skb;
......
...@@ -2939,7 +2939,7 @@ struct wmi_wmm_params_arg { ...@@ -2939,7 +2939,7 @@ struct wmi_wmm_params_arg {
u32 no_ack; u32 no_ack;
}; };
struct wmi_pdev_set_wmm_params_arg { struct wmi_wmm_params_all_arg {
struct wmi_wmm_params_arg ac_be; struct wmi_wmm_params_arg ac_be;
struct wmi_wmm_params_arg ac_bk; struct wmi_wmm_params_arg ac_bk;
struct wmi_wmm_params_arg ac_vi; struct wmi_wmm_params_arg ac_vi;
...@@ -4869,8 +4869,8 @@ void ath10k_wmi_put_host_mem_chunks(struct ath10k *ar, ...@@ -4869,8 +4869,8 @@ void ath10k_wmi_put_host_mem_chunks(struct ath10k *ar,
struct wmi_host_mem_chunks *chunks); struct wmi_host_mem_chunks *chunks);
void ath10k_wmi_put_start_scan_common(struct wmi_start_scan_common *cmn, void ath10k_wmi_put_start_scan_common(struct wmi_start_scan_common *cmn,
const struct wmi_start_scan_arg *arg); const struct wmi_start_scan_arg *arg);
void ath10k_wmi_pdev_set_wmm_param(struct wmi_wmm_params *params, void ath10k_wmi_set_wmm_param(struct wmi_wmm_params *params,
const struct wmi_wmm_params_arg *arg); const struct wmi_wmm_params_arg *arg);
void ath10k_wmi_put_wmi_channel(struct wmi_channel *ch, void ath10k_wmi_put_wmi_channel(struct wmi_channel *ch,
const struct wmi_channel_arg *arg); const struct wmi_channel_arg *arg);
int ath10k_wmi_start_scan_verify(const struct wmi_start_scan_arg *arg); int ath10k_wmi_start_scan_verify(const struct wmi_start_scan_arg *arg);
......
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