iwlwifi: mvm: remove update type argument from quota update
It turns out that adding the update type argument was pointless as
quota update is never called from the add_interface() callback.
Therefore, IWL_MVM_QUOTA_UPDATE_TYPE_NEW isn't actually needed and
then only a "disabled_vif" argument is needed for the upcoming CSA
work.
Remove the whole enum iwl_mvm_quota_update_type and pass the right
arguments (always NULL for disabled vif right now) to the function
in all current call sites.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
diff --git a/drivers/net/wireless/iwlwifi/mvm/quota.c b/drivers/net/wireless/iwlwifi/mvm/quota.c
index 6de0c63..4e20b3c 100644
--- a/drivers/net/wireless/iwlwifi/mvm/quota.c
+++ b/drivers/net/wireless/iwlwifi/mvm/quota.c
@@ -73,7 +73,7 @@
int colors[MAX_BINDINGS];
int low_latency[MAX_BINDINGS];
int n_low_latency_bindings;
- struct ieee80211_vif *skip_vif;
+ struct ieee80211_vif *disabled_vif;
};
static void iwl_mvm_quota_iterator(void *_data, u8 *mac,
@@ -83,14 +83,8 @@
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
u16 id;
- /*
- * We'll account for the new interface (if any) below,
- * skip it here in case we're not called from within
- * the add_interface callback (otherwise it won't show
- * up in iteration)
- * Also skip disabled interfaces here immediately.
- */
- if (vif == data->skip_vif)
+ /* skip disabled interfaces here immediately */
+ if (vif == data->disabled_vif)
return;
if (!mvmvif->phy_ctxt)
@@ -172,15 +166,15 @@
#endif
}
-int iwl_mvm_update_quotas(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
- enum iwl_mvm_quota_update_type type)
+int iwl_mvm_update_quotas(struct iwl_mvm *mvm,
+ struct ieee80211_vif *disabled_vif)
{
struct iwl_time_quota_cmd cmd = {};
int i, idx, ret, num_active_macs, quota, quota_rem, n_non_lowlat;
struct iwl_mvm_quota_iterator_data data = {
.n_interfaces = {},
.colors = { -1, -1, -1, -1 },
- .skip_vif = vif,
+ .disabled_vif = disabled_vif,
};
lockdep_assert_held(&mvm->mutex);
@@ -192,17 +186,9 @@
/* iterator data above must match */
BUILD_BUG_ON(MAX_BINDINGS != 4);
- if (WARN_ON_ONCE((type != IWL_MVM_QUOTA_UPDATE_TYPE_REGULAR && !vif) ||
- (type == IWL_MVM_QUOTA_UPDATE_TYPE_REGULAR && vif)))
- return -EINVAL;
-
ieee80211_iterate_active_interfaces_atomic(
mvm->hw, IEEE80211_IFACE_ITER_NORMAL,
iwl_mvm_quota_iterator, &data);
- if (type == IWL_MVM_QUOTA_UPDATE_TYPE_NEW) {
- data.skip_vif = NULL;
- iwl_mvm_quota_iterator(&data, vif->addr, vif);
- }
/*
* The FW's scheduling session consists of