diff options
author | Ilan Peer <ilan.peer@intel.com> | 2013-03-13 08:52:04 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-03-20 09:17:08 -0400 |
commit | 1e1391ca43994b697b0145384797a078ce1e0ce7 (patch) | |
tree | 8c7450d19df51b1adba5c164f1cc3c1144a097b6 /drivers/net | |
parent | 5649ce429e81b77919c0029a02edf44df3be7797 (diff) |
iwlwifi: mvm: Fix quota handling for monitor interface
1. Quota for the monitor interface should be added only if there is
a channel context assigned to the interface.
2. In the unassign channel context flow, need to remove the quota
for the monitor interface binding, before unbinding.
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/mac80211.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/mvm.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/quota.c | 3 |
3 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c index 3492d6092b2d..064eaefdff72 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c | |||
@@ -1264,6 +1264,7 @@ static int iwl_mvm_assign_vif_chanctx(struct ieee80211_hw *hw, | |||
1264 | * will handle quota settings. | 1264 | * will handle quota settings. |
1265 | */ | 1265 | */ |
1266 | if (vif->type == NL80211_IFTYPE_MONITOR) { | 1266 | if (vif->type == NL80211_IFTYPE_MONITOR) { |
1267 | mvmvif->monitor_active = true; | ||
1267 | ret = iwl_mvm_update_quotas(mvm, vif); | 1268 | ret = iwl_mvm_update_quotas(mvm, vif); |
1268 | if (ret) | 1269 | if (ret) |
1269 | goto out_remove_binding; | 1270 | goto out_remove_binding; |
@@ -1294,15 +1295,16 @@ static void iwl_mvm_unassign_vif_chanctx(struct ieee80211_hw *hw, | |||
1294 | if (vif->type == NL80211_IFTYPE_AP) | 1295 | if (vif->type == NL80211_IFTYPE_AP) |
1295 | goto out_unlock; | 1296 | goto out_unlock; |
1296 | 1297 | ||
1297 | iwl_mvm_binding_remove_vif(mvm, vif); | ||
1298 | switch (vif->type) { | 1298 | switch (vif->type) { |
1299 | case NL80211_IFTYPE_MONITOR: | 1299 | case NL80211_IFTYPE_MONITOR: |
1300 | iwl_mvm_update_quotas(mvm, vif); | 1300 | mvmvif->monitor_active = false; |
1301 | iwl_mvm_update_quotas(mvm, NULL); | ||
1301 | break; | 1302 | break; |
1302 | default: | 1303 | default: |
1303 | break; | 1304 | break; |
1304 | } | 1305 | } |
1305 | 1306 | ||
1307 | iwl_mvm_binding_remove_vif(mvm, vif); | ||
1306 | out_unlock: | 1308 | out_unlock: |
1307 | mvmvif->phy_ctxt = NULL; | 1309 | mvmvif->phy_ctxt = NULL; |
1308 | mutex_unlock(&mvm->mutex); | 1310 | mutex_unlock(&mvm->mutex); |
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h index 43a1d297ec1e..53d58968e30a 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h | |||
@@ -157,6 +157,8 @@ enum iwl_power_scheme { | |||
157 | * @uploaded: indicates the MAC context has been added to the device | 157 | * @uploaded: indicates the MAC context has been added to the device |
158 | * @ap_active: indicates that ap context is configured, and that the interface | 158 | * @ap_active: indicates that ap context is configured, and that the interface |
159 | * should get quota etc. | 159 | * should get quota etc. |
160 | * @monitor_active: indicates that monitor context is configured, and that the | ||
161 | * interface should get quota etc. | ||
160 | * @queue_params: QoS params for this MAC | 162 | * @queue_params: QoS params for this MAC |
161 | * @bcast_sta: station used for broadcast packets. Used by the following | 163 | * @bcast_sta: station used for broadcast packets. Used by the following |
162 | * vifs: P2P_DEVICE, GO and AP. | 164 | * vifs: P2P_DEVICE, GO and AP. |
@@ -169,6 +171,7 @@ struct iwl_mvm_vif { | |||
169 | 171 | ||
170 | bool uploaded; | 172 | bool uploaded; |
171 | bool ap_active; | 173 | bool ap_active; |
174 | bool monitor_active; | ||
172 | 175 | ||
173 | u32 ap_beacon_time; | 176 | u32 ap_beacon_time; |
174 | 177 | ||
diff --git a/drivers/net/wireless/iwlwifi/mvm/quota.c b/drivers/net/wireless/iwlwifi/mvm/quota.c index df85c49dc599..a1e3e923ea3e 100644 --- a/drivers/net/wireless/iwlwifi/mvm/quota.c +++ b/drivers/net/wireless/iwlwifi/mvm/quota.c | |||
@@ -114,7 +114,8 @@ static void iwl_mvm_quota_iterator(void *_data, u8 *mac, | |||
114 | data->n_interfaces[id]++; | 114 | data->n_interfaces[id]++; |
115 | break; | 115 | break; |
116 | case NL80211_IFTYPE_MONITOR: | 116 | case NL80211_IFTYPE_MONITOR: |
117 | data->n_interfaces[id]++; | 117 | if (mvmvif->monitor_active) |
118 | data->n_interfaces[id]++; | ||
118 | break; | 119 | break; |
119 | case NL80211_IFTYPE_P2P_DEVICE: | 120 | case NL80211_IFTYPE_P2P_DEVICE: |
120 | break; | 121 | break; |