]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: ath11k: add support for MU EDCA
authorYu Zhang(Yuriy) <quic_yuzha@quicinc.com>
Fri, 24 Jan 2025 06:13:43 +0000 (14:13 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:33:56 +0000 (15:33 -0500)
[ Upstream commit b78c02f7c7104f1e77ade12ebde267e6fb388ca9 ]

The current code does not have the MU EDCA feature, so it cannot support
the use of EDCA by STA in specific UL MU HE TB PPDU transmissions. Refer
to IEEE Std 802.11ax-2021 "9.4.2.251 MU EDCA Parameter Set element",
"26.2.7 EDCA operation using MU EDCA parameters".

Add ath11k_mac_op_conf_tx_mu_edca() to construct the MU EDCA parameters
received from mac80211 into WMI WMM parameters,and send to the firmware
according to the different WMM type flags.

Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-04523-QCAHSPSWPL_V1_V2_SILICONZ_IOE-1

Signed-off-by: Yu Zhang (Yuriy) <quic_yuzha@quicinc.com>
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Link: https://patch.msgid.link/20250124061343.2263467-1-quic_yuzha@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Stable-dep-of: 9c78e747dd4f ("wifi: ath11k: avoid bit operation on key flags")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/ath/ath11k/core.h
drivers/net/wireless/ath/ath11k/mac.c
drivers/net/wireless/ath/ath11k/wmi.c
drivers/net/wireless/ath/ath11k/wmi.h

index cd9f9fb6ab68eb70c6615477320b002d8466e293..7394b46835e1a58d5678955944dd223803e161bf 100644 (file)
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause-Clear */
 /*
  * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #ifndef ATH11K_CORE_H
@@ -372,6 +372,7 @@ struct ath11k_vif {
 
        u16 tx_seq_no;
        struct wmi_wmm_params_all_arg wmm_params;
+       struct wmi_wmm_params_all_arg muedca_params;
        struct list_head list;
        union {
                struct {
index 9db3369d32048d35671ad6a11f7d6da8bcb680e9..3889f08822d41078fccfedb035217a05e04a280d 100644 (file)
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: BSD-3-Clause-Clear
 /*
  * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #include <net/mac80211.h>
@@ -5283,6 +5283,45 @@ exit:
        return ret;
 }
 
+static int ath11k_mac_op_conf_tx_mu_edca(struct ieee80211_hw *hw,
+                                        struct ieee80211_vif *vif,
+                                        unsigned int link_id, u16 ac,
+                                        const struct ieee80211_tx_queue_params *params)
+{
+       struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
+       struct ath11k *ar = hw->priv;
+       struct wmi_wmm_params_arg *p;
+       int ret;
+
+       switch (ac) {
+       case IEEE80211_AC_VO:
+               p = &arvif->muedca_params.ac_vo;
+               break;
+       case IEEE80211_AC_VI:
+               p = &arvif->muedca_params.ac_vi;
+               break;
+       case IEEE80211_AC_BE:
+               p = &arvif->muedca_params.ac_be;
+               break;
+       case IEEE80211_AC_BK:
+               p = &arvif->muedca_params.ac_bk;
+               break;
+       default:
+               ath11k_warn(ar->ab, "error ac: %d", ac);
+               return -EINVAL;
+       }
+
+       p->cwmin = u8_get_bits(params->mu_edca_param_rec.ecw_min_max, GENMASK(3, 0));
+       p->cwmax = u8_get_bits(params->mu_edca_param_rec.ecw_min_max, GENMASK(7, 4));
+       p->aifs = u8_get_bits(params->mu_edca_param_rec.aifsn, GENMASK(3, 0));
+       p->txop = params->mu_edca_param_rec.mu_edca_timer;
+
+       ret = ath11k_wmi_send_wmm_update_cmd_tlv(ar, arvif->vdev_id,
+                                                &arvif->muedca_params,
+                                                WMI_WMM_PARAM_TYPE_11AX_MU_EDCA);
+       return ret;
+}
+
 static int ath11k_mac_op_conf_tx(struct ieee80211_hw *hw,
                                 struct ieee80211_vif *vif,
                                 unsigned int link_id, u16 ac,
@@ -5321,12 +5360,22 @@ static int ath11k_mac_op_conf_tx(struct ieee80211_hw *hw,
        p->txop = params->txop;
 
        ret = ath11k_wmi_send_wmm_update_cmd_tlv(ar, arvif->vdev_id,
-                                                &arvif->wmm_params);
+                                                &arvif->wmm_params,
+                                                WMI_WMM_PARAM_TYPE_LEGACY);
        if (ret) {
                ath11k_warn(ar->ab, "failed to set wmm params: %d\n", ret);
                goto exit;
        }
 
+       if (params->mu_edca) {
+               ret = ath11k_mac_op_conf_tx_mu_edca(hw, vif, link_id, ac,
+                                                   params);
+               if (ret) {
+                       ath11k_warn(ar->ab, "failed to set mu_edca params: %d\n", ret);
+                       goto exit;
+               }
+       }
+
        ret = ath11k_conf_tx_uapsd(ar, vif, ac, params->uapsd);
 
        if (ret)
index 5f7edf622de7a8b49250cc9aecaef237725edd79..98811726d33bf19c47c59c54eecb4c1a50f44b68 100644 (file)
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: BSD-3-Clause-Clear
 /*
  * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 #include <linux/skbuff.h>
 #include <linux/ctype.h>
@@ -2662,7 +2662,8 @@ int ath11k_wmi_send_scan_chan_list_cmd(struct ath11k *ar,
 }
 
 int ath11k_wmi_send_wmm_update_cmd_tlv(struct ath11k *ar, u32 vdev_id,
-                                      struct wmi_wmm_params_all_arg *param)
+                                      struct wmi_wmm_params_all_arg *param,
+                                      enum wmi_wmm_params_type wmm_param_type)
 {
        struct ath11k_pdev_wmi *wmi = ar->wmi;
        struct wmi_vdev_set_wmm_params_cmd *cmd;
@@ -2681,7 +2682,7 @@ int ath11k_wmi_send_wmm_update_cmd_tlv(struct ath11k *ar, u32 vdev_id,
                          FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE);
 
        cmd->vdev_id = vdev_id;
-       cmd->wmm_param_type = 0;
+       cmd->wmm_param_type = wmm_param_type;
 
        for (ac = 0; ac < WME_NUM_AC; ac++) {
                switch (ac) {
@@ -2714,8 +2715,8 @@ int ath11k_wmi_send_wmm_update_cmd_tlv(struct ath11k *ar, u32 vdev_id,
                wmm_param->no_ack = wmi_wmm_arg->no_ack;
 
                ath11k_dbg(ar->ab, ATH11K_DBG_WMI,
-                          "wmm set ac %d aifs %d cwmin %d cwmax %d txop %d acm %d no_ack %d\n",
-                          ac, wmm_param->aifs, wmm_param->cwmin,
+                          "wmm set type %d ac %d aifs %d cwmin %d cwmax %d txop %d acm %d no_ack %d\n",
+                          wmm_param_type, ac, wmm_param->aifs, wmm_param->cwmin,
                           wmm_param->cwmax, wmm_param->txoplimit,
                           wmm_param->acm, wmm_param->no_ack);
        }
index 30b4b0c1768269348615dd5de6457ddfdde85a9f..9fcffaa2f383c9348f5f07b139763de50212d856 100644 (file)
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause-Clear */
 /*
  * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #ifndef ATH11K_WMI_H
@@ -6347,6 +6347,11 @@ enum wmi_sta_keepalive_method {
 #define WMI_STA_KEEPALIVE_INTERVAL_DEFAULT     30
 #define WMI_STA_KEEPALIVE_INTERVAL_DISABLE     0
 
+enum wmi_wmm_params_type {
+       WMI_WMM_PARAM_TYPE_LEGACY = 0,
+       WMI_WMM_PARAM_TYPE_11AX_MU_EDCA = 1,
+};
+
 const void **ath11k_wmi_tlv_parse_alloc(struct ath11k_base *ab,
                                        struct sk_buff *skb, gfp_t gfp);
 int ath11k_wmi_cmd_send(struct ath11k_pdev_wmi *wmi, struct sk_buff *skb,
@@ -6403,7 +6408,8 @@ int ath11k_wmi_send_scan_start_cmd(struct ath11k *ar,
 int ath11k_wmi_send_scan_stop_cmd(struct ath11k *ar,
                                  struct scan_cancel_param *param);
 int ath11k_wmi_send_wmm_update_cmd_tlv(struct ath11k *ar, u32 vdev_id,
-                                      struct wmi_wmm_params_all_arg *param);
+                                      struct wmi_wmm_params_all_arg *param,
+                                      enum wmi_wmm_params_type wmm_param_type);
 int ath11k_wmi_pdev_suspend(struct ath11k *ar, u32 suspend_opt,
                            u32 pdev_id);
 int ath11k_wmi_pdev_resume(struct ath11k *ar, u32 pdev_id);