aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2014-05-23 10:17:13 -0400
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2014-07-07 14:41:15 -0400
commit494983e0e7ae24de7ad3eaa2edc1e31a6a0d7502 (patch)
tree643b991e47844827a1263aeaf95601b494bfd66b /drivers/net
parent99a1230d9d1cb5d52bb37b8c03f3931502f0e44d (diff)
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: Johannes Berg <johannes.berg@intel.com> Reviewed-by: Luciano Coelho <luciano.coelho@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/quota.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/quota.c b/drivers/net/wireless/iwlwifi/mvm/quota.c
index 3f18786311f4..6de0c6352943 100644
--- a/drivers/net/wireless/iwlwifi/mvm/quota.c
+++ b/drivers/net/wireless/iwlwifi/mvm/quota.c
@@ -73,8 +73,7 @@ struct iwl_mvm_quota_iterator_data {
73 int colors[MAX_BINDINGS]; 73 int colors[MAX_BINDINGS];
74 int low_latency[MAX_BINDINGS]; 74 int low_latency[MAX_BINDINGS];
75 int n_low_latency_bindings; 75 int n_low_latency_bindings;
76 struct ieee80211_vif *vif; 76 struct ieee80211_vif *skip_vif;
77 enum iwl_mvm_quota_update_type type;
78}; 77};
79 78
80static void iwl_mvm_quota_iterator(void *_data, u8 *mac, 79static void iwl_mvm_quota_iterator(void *_data, u8 *mac,
@@ -89,8 +88,9 @@ static void iwl_mvm_quota_iterator(void *_data, u8 *mac,
89 * skip it here in case we're not called from within 88 * skip it here in case we're not called from within
90 * the add_interface callback (otherwise it won't show 89 * the add_interface callback (otherwise it won't show
91 * up in iteration) 90 * up in iteration)
91 * Also skip disabled interfaces here immediately.
92 */ 92 */
93 if (data->type == IWL_MVM_QUOTA_UPDATE_TYPE_NEW && vif == data->vif) 93 if (vif == data->skip_vif)
94 return; 94 return;
95 95
96 if (!mvmvif->phy_ctxt) 96 if (!mvmvif->phy_ctxt)
@@ -105,10 +105,6 @@ static void iwl_mvm_quota_iterator(void *_data, u8 *mac,
105 if (WARN_ON_ONCE(id >= MAX_BINDINGS)) 105 if (WARN_ON_ONCE(id >= MAX_BINDINGS))
106 return; 106 return;
107 107
108 if (data->type == IWL_MVM_QUOTA_UPDATE_TYPE_DISABLED &&
109 vif == data->vif)
110 return;
111
112 switch (vif->type) { 108 switch (vif->type) {
113 case NL80211_IFTYPE_STATION: 109 case NL80211_IFTYPE_STATION:
114 if (vif->bss_conf.assoc) 110 if (vif->bss_conf.assoc)
@@ -184,8 +180,7 @@ int iwl_mvm_update_quotas(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
184 struct iwl_mvm_quota_iterator_data data = { 180 struct iwl_mvm_quota_iterator_data data = {
185 .n_interfaces = {}, 181 .n_interfaces = {},
186 .colors = { -1, -1, -1, -1 }, 182 .colors = { -1, -1, -1, -1 },
187 .vif = vif, 183 .skip_vif = vif,
188 .type = type,
189 }; 184 };
190 185
191 lockdep_assert_held(&mvm->mutex); 186 lockdep_assert_held(&mvm->mutex);
@@ -205,8 +200,7 @@ int iwl_mvm_update_quotas(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
205 mvm->hw, IEEE80211_IFACE_ITER_NORMAL, 200 mvm->hw, IEEE80211_IFACE_ITER_NORMAL,
206 iwl_mvm_quota_iterator, &data); 201 iwl_mvm_quota_iterator, &data);
207 if (type == IWL_MVM_QUOTA_UPDATE_TYPE_NEW) { 202 if (type == IWL_MVM_QUOTA_UPDATE_TYPE_NEW) {
208 data.vif = NULL; 203 data.skip_vif = NULL;
209 data.type = IWL_MVM_QUOTA_UPDATE_TYPE_REGULAR;
210 iwl_mvm_quota_iterator(&data, vif->addr, vif); 204 iwl_mvm_quota_iterator(&data, vif->addr, vif);
211 } 205 }
212 206