]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: ath12k: update ath12k_mac_op_conf_tx() for MLO
authorSriram R <quic_srirrama@quicinc.com>
Tue, 15 Oct 2024 17:14:14 +0000 (20:14 +0300)
committerJeff Johnson <quic_jjohnson@quicinc.com>
Wed, 16 Oct 2024 15:36:20 +0000 (08:36 -0700)
Refactor ath12k_mac_op_conf_tx() to apply and cache the TX parameters based on
the link id provided by mac80211.

While at it, the link id argument of ath12k_mac_conf_tx() is not used so remove
it.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
Co-developed-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://patch.msgid.link/20241015171416.518022-10-kvalo@kernel.org
Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
drivers/net/wireless/ath/ath12k/mac.c

index 7185cffe7dd422504e93e6c393a9138a32ac4602..8771d9738ffb7d15570103a68ab5dbd99eab3d50 100644 (file)
@@ -5127,8 +5127,7 @@ exit:
        return ret;
 }
 
-static int ath12k_mac_conf_tx(struct ath12k_link_vif *arvif,
-                             unsigned int link_id, u16 ac,
+static int ath12k_mac_conf_tx(struct ath12k_link_vif *arvif, u16 ac,
                              const struct ieee80211_tx_queue_params *params)
 {
        struct wmi_wmm_params_arg *p = NULL;
@@ -5188,16 +5187,16 @@ static int ath12k_mac_op_conf_tx(struct ieee80211_hw *hw,
        struct ath12k_vif *ahvif = ath12k_vif_to_ahvif(vif);
        struct ath12k_link_vif *arvif;
        struct ath12k_vif_cache *cache;
-       struct ath12k *ar;
        int ret;
 
        lockdep_assert_wiphy(hw->wiphy);
 
-       arvif = &ahvif->deflink;
-       ar = ath12k_get_ar_by_vif(hw, vif);
-       if (!ar) {
-               /* cache the info and apply after vdev is created */
-               cache = ath12k_ahvif_get_link_cache(ahvif, ATH12K_DEFAULT_LINK_ID);
+       if (link_id >= IEEE80211_MLD_MAX_NUM_LINKS)
+               return -EINVAL;
+
+       arvif = wiphy_dereference(hw->wiphy, ahvif->link[link_id]);
+       if (!arvif || !arvif->is_created) {
+               cache = ath12k_ahvif_get_link_cache(ahvif, link_id);
                if (!cache)
                        return -ENOSPC;
 
@@ -5208,7 +5207,7 @@ static int ath12k_mac_op_conf_tx(struct ieee80211_hw *hw,
                return 0;
        }
 
-       ret = ath12k_mac_conf_tx(arvif, link_id, ac, params);
+       ret = ath12k_mac_conf_tx(arvif, ac, params);
 
        return ret;
 }
@@ -6962,7 +6961,7 @@ static void ath12k_mac_vif_cache_flush(struct ath12k *ar, struct ath12k_link_vif
                return;
 
        if (cache->tx_conf.changed) {
-               ret = ath12k_mac_conf_tx(arvif, 0, cache->tx_conf.ac,
+               ret = ath12k_mac_conf_tx(arvif, cache->tx_conf.ac,
                                         &cache->tx_conf.tx_queue_params);
                if (ret)
                        ath12k_warn(ab,