diff options
author | Michal Kazior <michal.kazior@tieto.com> | 2015-01-19 03:53:41 -0500 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2015-01-29 05:11:44 -0500 |
commit | 5e752e42f6773c8e4d360b35c72dc1ef73240583 (patch) | |
tree | d290e0a3f03edbb4fd748d7440a2c0ee5db38b51 | |
parent | eebc67fef3eed8c768b9c046273dff6467b22cf4 (diff) |
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: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
-rw-r--r-- | drivers/net/wireless/ath/ath10k/core.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/mac.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi-ops.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi-tlv.c | 32 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi.h | 6 |
6 files changed, 35 insertions, 34 deletions
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index 2d9f87143089..abb32037c3f7 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h | |||
@@ -315,6 +315,7 @@ struct ath10k_vif { | |||
315 | bool use_cts_prot; | 315 | bool use_cts_prot; |
316 | int num_legacy_stations; | 316 | int num_legacy_stations; |
317 | int txpower; | 317 | int txpower; |
318 | struct wmi_wmm_params_all_arg wmm_params; | ||
318 | }; | 319 | }; |
319 | 320 | ||
320 | struct ath10k_vif_iter { | 321 | struct ath10k_vif_iter { |
@@ -577,7 +578,6 @@ struct ath10k { | |||
577 | u8 cfg_tx_chainmask; | 578 | u8 cfg_tx_chainmask; |
578 | u8 cfg_rx_chainmask; | 579 | u8 cfg_rx_chainmask; |
579 | 580 | ||
580 | struct wmi_pdev_set_wmm_params_arg wmm_params; | ||
581 | struct completion install_key_done; | 581 | struct completion install_key_done; |
582 | 582 | ||
583 | struct completion vdev_setup_done; | 583 | struct completion vdev_setup_done; |
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 02e2bfc04ccf..62e8adc492cb 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c | |||
@@ -4092,6 +4092,7 @@ static int ath10k_conf_tx(struct ieee80211_hw *hw, | |||
4092 | const struct ieee80211_tx_queue_params *params) | 4092 | const struct ieee80211_tx_queue_params *params) |
4093 | { | 4093 | { |
4094 | struct ath10k *ar = hw->priv; | 4094 | struct ath10k *ar = hw->priv; |
4095 | struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif); | ||
4095 | struct wmi_wmm_params_arg *p = NULL; | 4096 | struct wmi_wmm_params_arg *p = NULL; |
4096 | int ret; | 4097 | int ret; |
4097 | 4098 | ||
@@ -4099,16 +4100,16 @@ static int ath10k_conf_tx(struct ieee80211_hw *hw, | |||
4099 | 4100 | ||
4100 | switch (ac) { | 4101 | switch (ac) { |
4101 | case IEEE80211_AC_VO: | 4102 | case IEEE80211_AC_VO: |
4102 | p = &ar->wmm_params.ac_vo; | 4103 | p = &arvif->wmm_params.ac_vo; |
4103 | break; | 4104 | break; |
4104 | case IEEE80211_AC_VI: | 4105 | case IEEE80211_AC_VI: |
4105 | p = &ar->wmm_params.ac_vi; | 4106 | p = &arvif->wmm_params.ac_vi; |
4106 | break; | 4107 | break; |
4107 | case IEEE80211_AC_BE: | 4108 | case IEEE80211_AC_BE: |
4108 | p = &ar->wmm_params.ac_be; | 4109 | p = &arvif->wmm_params.ac_be; |
4109 | break; | 4110 | break; |
4110 | case IEEE80211_AC_BK: | 4111 | case IEEE80211_AC_BK: |
4111 | p = &ar->wmm_params.ac_bk; | 4112 | p = &arvif->wmm_params.ac_bk; |
4112 | break; | 4113 | break; |
4113 | } | 4114 | } |
4114 | 4115 | ||
@@ -4129,7 +4130,7 @@ static int ath10k_conf_tx(struct ieee80211_hw *hw, | |||
4129 | p->txop = params->txop * 32; | 4130 | p->txop = params->txop * 32; |
4130 | 4131 | ||
4131 | /* FIXME: FW accepts wmm params per hw, not per vif */ | 4132 | /* FIXME: FW accepts wmm params per hw, not per vif */ |
4132 | ret = ath10k_wmi_pdev_set_wmm_params(ar, &ar->wmm_params); | 4133 | ret = ath10k_wmi_pdev_set_wmm_params(ar, &arvif->wmm_params); |
4133 | if (ret) { | 4134 | if (ret) { |
4134 | ath10k_warn(ar, "failed to set wmm params: %d\n", ret); | 4135 | ath10k_warn(ar, "failed to set wmm params: %d\n", ret); |
4135 | goto exit; | 4136 | goto exit; |
diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h b/drivers/net/wireless/ath/ath10k/wmi-ops.h index 80bd28ac2ccb..6e9e38412b54 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-ops.h +++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h | |||
@@ -104,7 +104,7 @@ struct wmi_ops { | |||
104 | const struct wmi_scan_chan_list_arg *arg); | 104 | const struct wmi_scan_chan_list_arg *arg); |
105 | struct sk_buff *(*gen_beacon_dma)(struct ath10k_vif *arvif); | 105 | struct sk_buff *(*gen_beacon_dma)(struct ath10k_vif *arvif); |
106 | struct sk_buff *(*gen_pdev_set_wmm)(struct ath10k *ar, | 106 | struct sk_buff *(*gen_pdev_set_wmm)(struct ath10k *ar, |
107 | const struct wmi_pdev_set_wmm_params_arg *arg); | 107 | const struct wmi_wmm_params_all_arg *arg); |
108 | struct sk_buff *(*gen_request_stats)(struct ath10k *ar, | 108 | struct sk_buff *(*gen_request_stats)(struct ath10k *ar, |
109 | enum wmi_stats_id stats_id); | 109 | enum wmi_stats_id stats_id); |
110 | struct sk_buff *(*gen_force_fw_hang)(struct ath10k *ar, | 110 | 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 | 774 | ||
775 | static inline int | 775 | static inline int |
776 | ath10k_wmi_pdev_set_wmm_params(struct ath10k *ar, | 776 | ath10k_wmi_pdev_set_wmm_params(struct ath10k *ar, |
777 | const struct wmi_pdev_set_wmm_params_arg *arg) | 777 | const struct wmi_wmm_params_all_arg *arg) |
778 | { | 778 | { |
779 | struct sk_buff *skb; | 779 | struct sk_buff *skb; |
780 | 780 | ||
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c index d3cf91dc950b..23a376124de3 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c | |||
@@ -1584,6 +1584,21 @@ ath10k_wmi_tlv_op_gen_vdev_sta_uapsd(struct ath10k *ar, u32 vdev_id, | |||
1584 | return skb; | 1584 | return skb; |
1585 | } | 1585 | } |
1586 | 1586 | ||
1587 | static void *ath10k_wmi_tlv_put_wmm(void *ptr, | ||
1588 | const struct wmi_wmm_params_arg *arg) | ||
1589 | { | ||
1590 | struct wmi_wmm_params *wmm; | ||
1591 | struct wmi_tlv *tlv; | ||
1592 | |||
1593 | tlv = ptr; | ||
1594 | tlv->tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_WMM_PARAMS); | ||
1595 | tlv->len = __cpu_to_le16(sizeof(*wmm)); | ||
1596 | wmm = (void *)tlv->value; | ||
1597 | ath10k_wmi_set_wmm_param(wmm, arg); | ||
1598 | |||
1599 | return ptr + sizeof(*tlv) + sizeof(*wmm); | ||
1600 | } | ||
1601 | |||
1587 | static struct sk_buff * | 1602 | static struct sk_buff * |
1588 | ath10k_wmi_tlv_op_gen_peer_create(struct ath10k *ar, u32 vdev_id, | 1603 | ath10k_wmi_tlv_op_gen_peer_create(struct ath10k *ar, u32 vdev_id, |
1589 | const u8 peer_addr[ETH_ALEN]) | 1604 | const u8 peer_addr[ETH_ALEN]) |
@@ -1944,24 +1959,9 @@ ath10k_wmi_tlv_op_gen_beacon_dma(struct ath10k_vif *arvif) | |||
1944 | return skb; | 1959 | return skb; |
1945 | } | 1960 | } |
1946 | 1961 | ||
1947 | static void *ath10k_wmi_tlv_put_wmm(void *ptr, | ||
1948 | const struct wmi_wmm_params_arg *arg) | ||
1949 | { | ||
1950 | struct wmi_wmm_params *wmm; | ||
1951 | struct wmi_tlv *tlv; | ||
1952 | |||
1953 | tlv = ptr; | ||
1954 | tlv->tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_WMM_PARAMS); | ||
1955 | tlv->len = __cpu_to_le16(sizeof(*wmm)); | ||
1956 | wmm = (void *)tlv->value; | ||
1957 | ath10k_wmi_pdev_set_wmm_param(wmm, arg); | ||
1958 | |||
1959 | return ptr + sizeof(*tlv) + sizeof(*wmm); | ||
1960 | } | ||
1961 | |||
1962 | static struct sk_buff * | 1962 | static struct sk_buff * |
1963 | ath10k_wmi_tlv_op_gen_pdev_set_wmm(struct ath10k *ar, | 1963 | ath10k_wmi_tlv_op_gen_pdev_set_wmm(struct ath10k *ar, |
1964 | const struct wmi_pdev_set_wmm_params_arg *arg) | 1964 | const struct wmi_wmm_params_all_arg *arg) |
1965 | { | 1965 | { |
1966 | struct wmi_tlv_pdev_set_wmm_cmd *cmd; | 1966 | struct wmi_tlv_pdev_set_wmm_cmd *cmd; |
1967 | struct wmi_wmm_params *wmm; | 1967 | struct wmi_wmm_params *wmm; |
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index fb1e2d1f343c..050e5088acf2 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c | |||
@@ -4890,8 +4890,8 @@ ath10k_wmi_op_gen_beacon_dma(struct ath10k_vif *arvif) | |||
4890 | return skb; | 4890 | return skb; |
4891 | } | 4891 | } |
4892 | 4892 | ||
4893 | void ath10k_wmi_pdev_set_wmm_param(struct wmi_wmm_params *params, | 4893 | void ath10k_wmi_set_wmm_param(struct wmi_wmm_params *params, |
4894 | const struct wmi_wmm_params_arg *arg) | 4894 | const struct wmi_wmm_params_arg *arg) |
4895 | { | 4895 | { |
4896 | params->cwmin = __cpu_to_le32(arg->cwmin); | 4896 | params->cwmin = __cpu_to_le32(arg->cwmin); |
4897 | params->cwmax = __cpu_to_le32(arg->cwmax); | 4897 | params->cwmax = __cpu_to_le32(arg->cwmax); |
@@ -4903,7 +4903,7 @@ void ath10k_wmi_pdev_set_wmm_param(struct wmi_wmm_params *params, | |||
4903 | 4903 | ||
4904 | static struct sk_buff * | 4904 | static struct sk_buff * |
4905 | ath10k_wmi_op_gen_pdev_set_wmm(struct ath10k *ar, | 4905 | ath10k_wmi_op_gen_pdev_set_wmm(struct ath10k *ar, |
4906 | const struct wmi_pdev_set_wmm_params_arg *arg) | 4906 | const struct wmi_wmm_params_all_arg *arg) |
4907 | { | 4907 | { |
4908 | struct wmi_pdev_set_wmm_params *cmd; | 4908 | struct wmi_pdev_set_wmm_params *cmd; |
4909 | struct sk_buff *skb; | 4909 | struct sk_buff *skb; |
@@ -4913,10 +4913,10 @@ ath10k_wmi_op_gen_pdev_set_wmm(struct ath10k *ar, | |||
4913 | return ERR_PTR(-ENOMEM); | 4913 | return ERR_PTR(-ENOMEM); |
4914 | 4914 | ||
4915 | cmd = (struct wmi_pdev_set_wmm_params *)skb->data; | 4915 | cmd = (struct wmi_pdev_set_wmm_params *)skb->data; |
4916 | ath10k_wmi_pdev_set_wmm_param(&cmd->ac_be, &arg->ac_be); | 4916 | ath10k_wmi_set_wmm_param(&cmd->ac_be, &arg->ac_be); |
4917 | ath10k_wmi_pdev_set_wmm_param(&cmd->ac_bk, &arg->ac_bk); | 4917 | ath10k_wmi_set_wmm_param(&cmd->ac_bk, &arg->ac_bk); |
4918 | ath10k_wmi_pdev_set_wmm_param(&cmd->ac_vi, &arg->ac_vi); | 4918 | ath10k_wmi_set_wmm_param(&cmd->ac_vi, &arg->ac_vi); |
4919 | ath10k_wmi_pdev_set_wmm_param(&cmd->ac_vo, &arg->ac_vo); | 4919 | ath10k_wmi_set_wmm_param(&cmd->ac_vo, &arg->ac_vo); |
4920 | 4920 | ||
4921 | ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi pdev set wmm params\n"); | 4921 | ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi pdev set wmm params\n"); |
4922 | return skb; | 4922 | return skb; |
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index 34d8c44b90e8..c0093938c6ee 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h | |||
@@ -2939,7 +2939,7 @@ struct wmi_wmm_params_arg { | |||
2939 | u32 no_ack; | 2939 | u32 no_ack; |
2940 | }; | 2940 | }; |
2941 | 2941 | ||
2942 | struct wmi_pdev_set_wmm_params_arg { | 2942 | struct wmi_wmm_params_all_arg { |
2943 | struct wmi_wmm_params_arg ac_be; | 2943 | struct wmi_wmm_params_arg ac_be; |
2944 | struct wmi_wmm_params_arg ac_bk; | 2944 | struct wmi_wmm_params_arg ac_bk; |
2945 | struct wmi_wmm_params_arg ac_vi; | 2945 | struct wmi_wmm_params_arg ac_vi; |
@@ -4869,8 +4869,8 @@ void ath10k_wmi_put_host_mem_chunks(struct ath10k *ar, | |||
4869 | struct wmi_host_mem_chunks *chunks); | 4869 | struct wmi_host_mem_chunks *chunks); |
4870 | void ath10k_wmi_put_start_scan_common(struct wmi_start_scan_common *cmn, | 4870 | void ath10k_wmi_put_start_scan_common(struct wmi_start_scan_common *cmn, |
4871 | const struct wmi_start_scan_arg *arg); | 4871 | const struct wmi_start_scan_arg *arg); |
4872 | void ath10k_wmi_pdev_set_wmm_param(struct wmi_wmm_params *params, | 4872 | void ath10k_wmi_set_wmm_param(struct wmi_wmm_params *params, |
4873 | const struct wmi_wmm_params_arg *arg); | 4873 | const struct wmi_wmm_params_arg *arg); |
4874 | void ath10k_wmi_put_wmi_channel(struct wmi_channel *ch, | 4874 | void ath10k_wmi_put_wmi_channel(struct wmi_channel *ch, |
4875 | const struct wmi_channel_arg *arg); | 4875 | const struct wmi_channel_arg *arg); |
4876 | int ath10k_wmi_start_scan_verify(const struct wmi_start_scan_arg *arg); | 4876 | int ath10k_wmi_start_scan_verify(const struct wmi_start_scan_arg *arg); |