wifi: iwlwifi: mvm: store WMM params per link
authorJohannes Berg <johannes.berg@intel.com>
Wed, 14 Jun 2023 09:41:28 +0000 (12:41 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 19 Jun 2023 10:05:25 +0000 (12:05 +0200)
We have the data structure set up to store the parameters
per link, but weren't using them. Fix that and store them
in the right link.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230614123446.332c4949a1be.Icae03975d578b0cc82279911a1ea7cbc313046d6@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c

index 954ea9a..61c1ec4 100644 (file)
@@ -470,19 +470,24 @@ void iwl_mvm_set_fw_qos_params(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
                               struct iwl_ac_qos *ac, __le32 *qos_flags)
 {
        struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
+       struct iwl_mvm_vif_link_info *mvm_link =
+               mvmvif->link[link_conf->link_id];
        int i;
 
+       if (!mvm_link)
+               return;
+
        for (i = 0; i < IEEE80211_NUM_ACS; i++) {
                u8 txf = iwl_mvm_mac_ac_to_tx_fifo(mvm, i);
                u8 ucode_ac = iwl_mvm_mac80211_ac_to_ucode_ac(i);
 
                ac[ucode_ac].cw_min =
-                       cpu_to_le16(mvmvif->deflink.queue_params[i].cw_min);
+                       cpu_to_le16(mvm_link->queue_params[i].cw_min);
                ac[ucode_ac].cw_max =
-                       cpu_to_le16(mvmvif->deflink.queue_params[i].cw_max);
+                       cpu_to_le16(mvm_link->queue_params[i].cw_max);
                ac[ucode_ac].edca_txop =
-                       cpu_to_le16(mvmvif->deflink.queue_params[i].txop * 32);
-               ac[ucode_ac].aifsn = mvmvif->deflink.queue_params[i].aifs;
+                       cpu_to_le16(mvm_link->queue_params[i].txop * 32);
+               ac[ucode_ac].aifsn = mvm_link->queue_params[i].aifs;
                ac[ucode_ac].fifos_mask = BIT(txf);
        }
 
index cb4df8c..8cd0335 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 /*
- * Copyright (C) 2022 Intel Corporation
+ * Copyright (C) 2022-2023 Intel Corporation
  */
 #include "mvm.h"
 
@@ -820,8 +820,12 @@ iwl_mvm_mld_mac_conf_tx(struct ieee80211_hw *hw,
 {
        struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
        struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
+       struct iwl_mvm_vif_link_info *mvm_link = mvmvif->link[link_id];
 
-       mvmvif->deflink.queue_params[ac] = *params;
+       if (!mvm_link)
+               return -EINVAL;
+
+       mvm_link->queue_params[ac] = *params;
 
        /* No need to update right away, we'll get BSS_CHANGED_QOS
         * The exception is P2P_DEVICE interface which needs immediate update.