Commit 1e1391ca authored by Ilan Peer's avatar Ilan Peer Committed by Johannes Berg

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: default avatarIlan Peer <ilan.peer@intel.com>
Reviewed-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 5649ce42
...@@ -1264,6 +1264,7 @@ static int iwl_mvm_assign_vif_chanctx(struct ieee80211_hw *hw, ...@@ -1264,6 +1264,7 @@ static int iwl_mvm_assign_vif_chanctx(struct ieee80211_hw *hw,
* will handle quota settings. * will handle quota settings.
*/ */
if (vif->type == NL80211_IFTYPE_MONITOR) { if (vif->type == NL80211_IFTYPE_MONITOR) {
mvmvif->monitor_active = true;
ret = iwl_mvm_update_quotas(mvm, vif); ret = iwl_mvm_update_quotas(mvm, vif);
if (ret) if (ret)
goto out_remove_binding; goto out_remove_binding;
...@@ -1294,15 +1295,16 @@ static void iwl_mvm_unassign_vif_chanctx(struct ieee80211_hw *hw, ...@@ -1294,15 +1295,16 @@ static void iwl_mvm_unassign_vif_chanctx(struct ieee80211_hw *hw,
if (vif->type == NL80211_IFTYPE_AP) if (vif->type == NL80211_IFTYPE_AP)
goto out_unlock; goto out_unlock;
iwl_mvm_binding_remove_vif(mvm, vif);
switch (vif->type) { switch (vif->type) {
case NL80211_IFTYPE_MONITOR: case NL80211_IFTYPE_MONITOR:
iwl_mvm_update_quotas(mvm, vif); mvmvif->monitor_active = false;
iwl_mvm_update_quotas(mvm, NULL);
break; break;
default: default:
break; break;
} }
iwl_mvm_binding_remove_vif(mvm, vif);
out_unlock: out_unlock:
mvmvif->phy_ctxt = NULL; mvmvif->phy_ctxt = NULL;
mutex_unlock(&mvm->mutex); mutex_unlock(&mvm->mutex);
......
...@@ -157,6 +157,8 @@ enum iwl_power_scheme { ...@@ -157,6 +157,8 @@ enum iwl_power_scheme {
* @uploaded: indicates the MAC context has been added to the device * @uploaded: indicates the MAC context has been added to the device
* @ap_active: indicates that ap context is configured, and that the interface * @ap_active: indicates that ap context is configured, and that the interface
* should get quota etc. * should get quota etc.
* @monitor_active: indicates that monitor context is configured, and that the
* interface should get quota etc.
* @queue_params: QoS params for this MAC * @queue_params: QoS params for this MAC
* @bcast_sta: station used for broadcast packets. Used by the following * @bcast_sta: station used for broadcast packets. Used by the following
* vifs: P2P_DEVICE, GO and AP. * vifs: P2P_DEVICE, GO and AP.
...@@ -169,6 +171,7 @@ struct iwl_mvm_vif { ...@@ -169,6 +171,7 @@ struct iwl_mvm_vif {
bool uploaded; bool uploaded;
bool ap_active; bool ap_active;
bool monitor_active;
u32 ap_beacon_time; u32 ap_beacon_time;
......
...@@ -114,7 +114,8 @@ static void iwl_mvm_quota_iterator(void *_data, u8 *mac, ...@@ -114,7 +114,8 @@ static void iwl_mvm_quota_iterator(void *_data, u8 *mac,
data->n_interfaces[id]++; data->n_interfaces[id]++;
break; break;
case NL80211_IFTYPE_MONITOR: case NL80211_IFTYPE_MONITOR:
data->n_interfaces[id]++; if (mvmvif->monitor_active)
data->n_interfaces[id]++;
break; break;
case NL80211_IFTYPE_P2P_DEVICE: case NL80211_IFTYPE_P2P_DEVICE:
break; break;
......
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