Commit 494983e0 authored by Johannes Berg's avatar Johannes Berg Committed by Emmanuel Grumbach

iwlwifi: mvm: don't pass update type to quota iterator

Simplify the quota iterator by not passing the update type,
it only needs to know whether or not to skip an interface.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Reviewed-by: default avatarLuciano Coelho <luciano.coelho@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent 99a1230d
...@@ -73,8 +73,7 @@ struct iwl_mvm_quota_iterator_data { ...@@ -73,8 +73,7 @@ struct iwl_mvm_quota_iterator_data {
int colors[MAX_BINDINGS]; int colors[MAX_BINDINGS];
int low_latency[MAX_BINDINGS]; int low_latency[MAX_BINDINGS];
int n_low_latency_bindings; int n_low_latency_bindings;
struct ieee80211_vif *vif; struct ieee80211_vif *skip_vif;
enum iwl_mvm_quota_update_type type;
}; };
static void iwl_mvm_quota_iterator(void *_data, u8 *mac, static void iwl_mvm_quota_iterator(void *_data, u8 *mac,
...@@ -89,8 +88,9 @@ static void iwl_mvm_quota_iterator(void *_data, u8 *mac, ...@@ -89,8 +88,9 @@ static void iwl_mvm_quota_iterator(void *_data, u8 *mac,
* skip it here in case we're not called from within * skip it here in case we're not called from within
* the add_interface callback (otherwise it won't show * the add_interface callback (otherwise it won't show
* up in iteration) * up in iteration)
* Also skip disabled interfaces here immediately.
*/ */
if (data->type == IWL_MVM_QUOTA_UPDATE_TYPE_NEW && vif == data->vif) if (vif == data->skip_vif)
return; return;
if (!mvmvif->phy_ctxt) if (!mvmvif->phy_ctxt)
...@@ -105,10 +105,6 @@ static void iwl_mvm_quota_iterator(void *_data, u8 *mac, ...@@ -105,10 +105,6 @@ static void iwl_mvm_quota_iterator(void *_data, u8 *mac,
if (WARN_ON_ONCE(id >= MAX_BINDINGS)) if (WARN_ON_ONCE(id >= MAX_BINDINGS))
return; return;
if (data->type == IWL_MVM_QUOTA_UPDATE_TYPE_DISABLED &&
vif == data->vif)
return;
switch (vif->type) { switch (vif->type) {
case NL80211_IFTYPE_STATION: case NL80211_IFTYPE_STATION:
if (vif->bss_conf.assoc) if (vif->bss_conf.assoc)
...@@ -184,8 +180,7 @@ int iwl_mvm_update_quotas(struct iwl_mvm *mvm, struct ieee80211_vif *vif, ...@@ -184,8 +180,7 @@ int iwl_mvm_update_quotas(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
struct iwl_mvm_quota_iterator_data data = { struct iwl_mvm_quota_iterator_data data = {
.n_interfaces = {}, .n_interfaces = {},
.colors = { -1, -1, -1, -1 }, .colors = { -1, -1, -1, -1 },
.vif = vif, .skip_vif = vif,
.type = type,
}; };
lockdep_assert_held(&mvm->mutex); lockdep_assert_held(&mvm->mutex);
...@@ -205,8 +200,7 @@ int iwl_mvm_update_quotas(struct iwl_mvm *mvm, struct ieee80211_vif *vif, ...@@ -205,8 +200,7 @@ int iwl_mvm_update_quotas(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
mvm->hw, IEEE80211_IFACE_ITER_NORMAL, mvm->hw, IEEE80211_IFACE_ITER_NORMAL,
iwl_mvm_quota_iterator, &data); iwl_mvm_quota_iterator, &data);
if (type == IWL_MVM_QUOTA_UPDATE_TYPE_NEW) { if (type == IWL_MVM_QUOTA_UPDATE_TYPE_NEW) {
data.vif = NULL; data.skip_vif = NULL;
data.type = IWL_MVM_QUOTA_UPDATE_TYPE_REGULAR;
iwl_mvm_quota_iterator(&data, vif->addr, vif); iwl_mvm_quota_iterator(&data, vif->addr, vif);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment