aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ieee80211.c
diff options
context:
space:
mode:
authorMichael Wu <flamingice@sourmilk.net>2008-01-31 13:48:23 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-02-29 15:37:02 -0500
commit8cc9a73914b07b5908d8a59320f4557fc9639f2e (patch)
tree34ad48b7fa4078c04bd83a45e7cef75b0f49176a /net/mac80211/ieee80211.c
parent66f7ac50ed7cc5c19a62bc97e8f6e7891004a03a (diff)
mac80211: Use monitor configuration flags
Take advantage of the monitor configuration flags now provided by cfg80211. Signed-off-by: Michael Wu <flamingice@sourmilk.net> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/ieee80211.c')
-rw-r--r--net/mac80211/ieee80211.c56
1 files changed, 41 insertions, 15 deletions
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
index cb09931af86a..83694fb49734 100644
--- a/net/mac80211/ieee80211.c
+++ b/net/mac80211/ieee80211.c
@@ -67,9 +67,19 @@ static void ieee80211_configure_filter(struct ieee80211_local *local)
67 new_flags |= FIF_ALLMULTI; 67 new_flags |= FIF_ALLMULTI;
68 68
69 if (local->monitors) 69 if (local->monitors)
70 new_flags |= FIF_CONTROL | 70 new_flags |= FIF_BCN_PRBRESP_PROMISC;
71 FIF_OTHER_BSS | 71
72 FIF_BCN_PRBRESP_PROMISC; 72 if (local->fif_fcsfail)
73 new_flags |= FIF_FCSFAIL;
74
75 if (local->fif_plcpfail)
76 new_flags |= FIF_PLCPFAIL;
77
78 if (local->fif_control)
79 new_flags |= FIF_CONTROL;
80
81 if (local->fif_other_bss)
82 new_flags |= FIF_OTHER_BSS;
73 83
74 changed_flags = local->filter_flags ^ new_flags; 84 changed_flags = local->filter_flags ^ new_flags;
75 85
@@ -231,13 +241,21 @@ static int ieee80211_open(struct net_device *dev)
231 case IEEE80211_IF_TYPE_MNTR: 241 case IEEE80211_IF_TYPE_MNTR:
232 /* must be before the call to ieee80211_configure_filter */ 242 /* must be before the call to ieee80211_configure_filter */
233 local->monitors++; 243 local->monitors++;
234 if (local->monitors == 1) { 244 if (local->monitors == 1)
235 netif_tx_lock_bh(local->mdev);
236 ieee80211_configure_filter(local);
237 netif_tx_unlock_bh(local->mdev);
238
239 local->hw.conf.flags |= IEEE80211_CONF_RADIOTAP; 245 local->hw.conf.flags |= IEEE80211_CONF_RADIOTAP;
240 } 246
247 if (sdata->u.mntr_flags & MONITOR_FLAG_FCSFAIL)
248 local->fif_fcsfail++;
249 if (sdata->u.mntr_flags & MONITOR_FLAG_PLCPFAIL)
250 local->fif_plcpfail++;
251 if (sdata->u.mntr_flags & MONITOR_FLAG_CONTROL)
252 local->fif_control++;
253 if (sdata->u.mntr_flags & MONITOR_FLAG_OTHER_BSS)
254 local->fif_other_bss++;
255
256 netif_tx_lock_bh(local->mdev);
257 ieee80211_configure_filter(local);
258 netif_tx_unlock_bh(local->mdev);
241 break; 259 break;
242 case IEEE80211_IF_TYPE_STA: 260 case IEEE80211_IF_TYPE_STA:
243 case IEEE80211_IF_TYPE_IBSS: 261 case IEEE80211_IF_TYPE_IBSS:
@@ -353,13 +371,21 @@ static int ieee80211_stop(struct net_device *dev)
353 break; 371 break;
354 case IEEE80211_IF_TYPE_MNTR: 372 case IEEE80211_IF_TYPE_MNTR:
355 local->monitors--; 373 local->monitors--;
356 if (local->monitors == 0) { 374 if (local->monitors == 0)
357 netif_tx_lock_bh(local->mdev);
358 ieee80211_configure_filter(local);
359 netif_tx_unlock_bh(local->mdev);
360
361 local->hw.conf.flags &= ~IEEE80211_CONF_RADIOTAP; 375 local->hw.conf.flags &= ~IEEE80211_CONF_RADIOTAP;
362 } 376
377 if (sdata->u.mntr_flags & MONITOR_FLAG_FCSFAIL)
378 local->fif_fcsfail--;
379 if (sdata->u.mntr_flags & MONITOR_FLAG_PLCPFAIL)
380 local->fif_plcpfail--;
381 if (sdata->u.mntr_flags & MONITOR_FLAG_CONTROL)
382 local->fif_control--;
383 if (sdata->u.mntr_flags & MONITOR_FLAG_OTHER_BSS)
384 local->fif_other_bss--;
385
386 netif_tx_lock_bh(local->mdev);
387 ieee80211_configure_filter(local);
388 netif_tx_unlock_bh(local->mdev);
363 break; 389 break;
364 case IEEE80211_IF_TYPE_STA: 390 case IEEE80211_IF_TYPE_STA:
365 case IEEE80211_IF_TYPE_IBSS: 391 case IEEE80211_IF_TYPE_IBSS: