aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/cfg.c11
-rw-r--r--net/mac80211/ieee80211_i.h4
-rw-r--r--net/mac80211/iface.c16
3 files changed, 14 insertions, 17 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index cfdc03f59e27..e95f24eef870 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2982,16 +2982,6 @@ static int ieee80211_probe_client(struct wiphy *wiphy, struct net_device *dev,
2982 return 0; 2982 return 0;
2983} 2983}
2984 2984
2985static void ieee80211_set_monitor_enabled(struct wiphy *wiphy, bool enabled)
2986{
2987 struct ieee80211_local *local = wiphy_priv(wiphy);
2988
2989 if (enabled)
2990 WARN_ON(ieee80211_add_virtual_monitor(local));
2991 else
2992 ieee80211_del_virtual_monitor(local);
2993}
2994
2995#ifdef CONFIG_PM 2985#ifdef CONFIG_PM
2996static void ieee80211_set_wakeup(struct wiphy *wiphy, bool enabled) 2986static void ieee80211_set_wakeup(struct wiphy *wiphy, bool enabled)
2997{ 2987{
@@ -3066,7 +3056,6 @@ struct cfg80211_ops mac80211_config_ops = {
3066 .tdls_mgmt = ieee80211_tdls_mgmt, 3056 .tdls_mgmt = ieee80211_tdls_mgmt,
3067 .probe_client = ieee80211_probe_client, 3057 .probe_client = ieee80211_probe_client,
3068 .set_noack_map = ieee80211_set_noack_map, 3058 .set_noack_map = ieee80211_set_noack_map,
3069 .set_monitor_enabled = ieee80211_set_monitor_enabled,
3070#ifdef CONFIG_PM 3059#ifdef CONFIG_PM
3071 .set_wakeup = ieee80211_set_wakeup, 3060 .set_wakeup = ieee80211_set_wakeup,
3072#endif 3061#endif
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 7998513ec831..bb61f7718c4c 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1491,10 +1491,6 @@ int ieee80211_add_srates_ie(struct ieee80211_sub_if_data *sdata,
1491int ieee80211_add_ext_srates_ie(struct ieee80211_sub_if_data *sdata, 1491int ieee80211_add_ext_srates_ie(struct ieee80211_sub_if_data *sdata,
1492 struct sk_buff *skb, bool need_basic); 1492 struct sk_buff *skb, bool need_basic);
1493 1493
1494/* virtual monitor */
1495int ieee80211_add_virtual_monitor(struct ieee80211_local *local);
1496void ieee80211_del_virtual_monitor(struct ieee80211_local *local);
1497
1498/* channel management */ 1494/* channel management */
1499enum ieee80211_chan_mode { 1495enum ieee80211_chan_mode {
1500 CHAN_MODE_UNDEFINED, 1496 CHAN_MODE_UNDEFINED,
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)