aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/iface.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-07-12 13:28:31 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-07-13 10:16:10 -0400
commit075e08477d51709ae1998a05c35aadf59ef823b9 (patch)
treeed1d72cfa15a711901484e82cd56577f60d9dd8e /net/mac80211/iface.c
parent4b4b8229aeff4ca09b4aee921d383c596146eca0 (diff)
Revert "mac80211: refactor virtual monitor code"
This reverts commit 870d37fc22f3e40f9f23e06c581c8538fc16a2f0. This code doesn't work as cfg80211 will call set_monitor_enabled at the wrong time and it doesn't seem to be possible to fix this. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/iface.c')
-rw-r--r--net/mac80211/iface.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 334ee0fb18ca..bfb57dcc1538 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -331,7 +331,7 @@ static void ieee80211_set_default_queues(struct ieee80211_sub_if_data *sdata)
331 sdata->vif.cab_queue = IEEE80211_INVAL_HW_QUEUE; 331 sdata->vif.cab_queue = IEEE80211_INVAL_HW_QUEUE;
332} 332}
333 333
334int ieee80211_add_virtual_monitor(struct ieee80211_local *local) 334static int ieee80211_add_virtual_monitor(struct ieee80211_local *local)
335{ 335{
336 struct ieee80211_sub_if_data *sdata; 336 struct ieee80211_sub_if_data *sdata;
337 int ret = 0; 337 int ret = 0;
@@ -377,7 +377,7 @@ int ieee80211_add_virtual_monitor(struct ieee80211_local *local)
377 return ret; 377 return ret;
378} 378}
379 379
380void ieee80211_del_virtual_monitor(struct ieee80211_local *local) 380static void ieee80211_del_virtual_monitor(struct ieee80211_local *local)
381{ 381{
382 struct ieee80211_sub_if_data *sdata; 382 struct ieee80211_sub_if_data *sdata;
383 383
@@ -497,6 +497,12 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up)
497 break; 497 break;
498 } 498 }
499 499
500 if (local->monitors == 0 && local->open_count == 0) {
501 res = ieee80211_add_virtual_monitor(local);
502 if (res)
503 goto err_stop;
504 }
505
500 /* must be before the call to ieee80211_configure_filter */ 506 /* must be before the call to ieee80211_configure_filter */
501 local->monitors++; 507 local->monitors++;
502 if (local->monitors == 1) { 508 if (local->monitors == 1) {
@@ -511,6 +517,8 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up)
511 break; 517 break;
512 default: 518 default:
513 if (coming_up) { 519 if (coming_up) {
520 ieee80211_del_virtual_monitor(local);
521
514 res = drv_add_interface(local, sdata); 522 res = drv_add_interface(local, sdata);
515 if (res) 523 if (res)
516 goto err_stop; 524 goto err_stop;
@@ -745,6 +753,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
745 if (local->monitors == 0) { 753 if (local->monitors == 0) {
746 local->hw.conf.flags &= ~IEEE80211_CONF_MONITOR; 754 local->hw.conf.flags &= ~IEEE80211_CONF_MONITOR;
747 hw_reconf_flags |= IEEE80211_CONF_CHANGE_MONITOR; 755 hw_reconf_flags |= IEEE80211_CONF_CHANGE_MONITOR;
756 ieee80211_del_virtual_monitor(local);
748 } 757 }
749 758
750 ieee80211_adjust_monitor_flags(sdata, -1); 759 ieee80211_adjust_monitor_flags(sdata, -1);
@@ -818,6 +827,9 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
818 } 827 }
819 } 828 }
820 spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); 829 spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
830
831 if (local->monitors == local->open_count && local->monitors > 0)
832 ieee80211_add_virtual_monitor(local);
821} 833}
822 834
823static int ieee80211_stop(struct net_device *dev) 835static int ieee80211_stop(struct net_device *dev)