aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ieee80211_sta.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2007-09-17 01:29:23 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:52:57 -0400
commit4150c57212ad134765dd78c654a4b9906252b66d (patch)
treec37ab7a3f75532a623ed00339782d769514422d2 /net/mac80211/ieee80211_sta.c
parent070ac3a2651e3c1c4d277c5f1981517427c386a7 (diff)
[PATCH] mac80211: revamp interface and filter configuration
Drivers are currently supposed to keep track of monitor interfaces if they allow so-called "hard" monitor, and they are also supposed to keep track of multicast etc. This patch changes that, replaces the set_multicast_list() callback with a new configure_filter() callback that takes filter flags (FIF_*) instead of interface flags (IFF_*). For a driver, this means it should open the filter as much as necessary to get all frames requested by the filter flags. Accordingly, the filter flags are named "positively", e.g. FIF_ALLMULTI. Multicast filtering is a bit special in that drivers that have no multicast address filters need to allow multicast frames through when either the FIF_ALLMULTI flag is set or when the mc_count value is positive. At the same time, drivers are no longer notified about monitor interfaces at all, this means they now need to implement the start() and stop() callbacks and the new change_filter_flags() callback. Also, the start()/stop() ordering changed, start() is now called *before* any add_interface() as it really should be, and stop() after any remove_interface(). The patch also changes the behaviour of setting the bssid to multicast for scanning when IEEE80211_HW_NO_PROBE_FILTERING is set; the IEEE80211_HW_NO_PROBE_FILTERING flag is removed and the filter flag FIF_BCN_PRBRESP_PROMISC introduced. This is a lot more efficient for hardware like b43 that supports it and other hardware can still set the BSSID to all-ones. Driver modifications by Johannes Berg (b43 & iwlwifi), Michael Wu (rtl8187, adm8211, and p54), Larry Finger (b43legacy), and Ivo van Doorn (rt2x00). Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Michael Wu <flamingice@sourmilk.net> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/ieee80211_sta.c')
-rw-r--r--net/mac80211/ieee80211_sta.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index 3f0a2faf37d4..17455c6a5229 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -2662,10 +2662,16 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw)
2662 printk(KERN_DEBUG "%s: failed to restore operational" 2662 printk(KERN_DEBUG "%s: failed to restore operational"
2663 "channel after scan\n", dev->name); 2663 "channel after scan\n", dev->name);
2664 2664
2665 if (!(local->hw.flags & IEEE80211_HW_NO_PROBE_FILTERING) && 2665
2666 ieee80211_if_config(dev)) 2666 netif_tx_lock_bh(local->mdev);
2667 printk(KERN_DEBUG "%s: failed to restore operational" 2667 local->filter_flags &= ~FIF_BCN_PRBRESP_PROMISC;
2668 "BSSID after scan\n", dev->name); 2668 local->ops->configure_filter(local_to_hw(local),
2669 FIF_BCN_PRBRESP_PROMISC,
2670 &local->filter_flags,
2671 local->mdev->mc_count,
2672 local->mdev->mc_list);
2673
2674 netif_tx_unlock_bh(local->mdev);
2669 2675
2670 memset(&wrqu, 0, sizeof(wrqu)); 2676 memset(&wrqu, 0, sizeof(wrqu));
2671 wireless_send_event(dev, SIOCGIWSCAN, &wrqu, NULL); 2677 wireless_send_event(dev, SIOCGIWSCAN, &wrqu, NULL);
@@ -2849,10 +2855,14 @@ static int ieee80211_sta_start_scan(struct net_device *dev,
2849 local->scan_channel_idx = 0; 2855 local->scan_channel_idx = 0;
2850 local->scan_dev = dev; 2856 local->scan_dev = dev;
2851 2857
2852 if (!(local->hw.flags & IEEE80211_HW_NO_PROBE_FILTERING) && 2858 netif_tx_lock_bh(local->mdev);
2853 ieee80211_if_config(dev)) 2859 local->filter_flags |= FIF_BCN_PRBRESP_PROMISC;
2854 printk(KERN_DEBUG "%s: failed to set BSSID for scan\n", 2860 local->ops->configure_filter(local_to_hw(local),
2855 dev->name); 2861 FIF_BCN_PRBRESP_PROMISC,
2862 &local->filter_flags,
2863 local->mdev->mc_count,
2864 local->mdev->mc_list);
2865 netif_tx_unlock_bh(local->mdev);
2856 2866
2857 /* TODO: start scan as soon as all nullfunc frames are ACKed */ 2867 /* TODO: start scan as soon as all nullfunc frames are ACKed */
2858 queue_delayed_work(local->hw.workqueue, &local->scan_work, 2868 queue_delayed_work(local->hw.workqueue, &local->scan_work,