summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00dev.c
diff options
context:
space:
mode:
authorJohannes Berg2007-09-17 07:29:23 +0200
committerDavid S. Miller2007-10-11 01:52:57 +0200
commit4150c57212ad134765dd78c654a4b9906252b66d (patch)
treec37ab7a3f75532a623ed00339782d769514422d2 /drivers/net/wireless/rt2x00/rt2x00dev.c
parent[NET]: Proper comment for loopback initialization order. (diff)
downloadkernel-qcow2-linux-4150c57212ad134765dd78c654a4b9906252b66d.tar.gz
kernel-qcow2-linux-4150c57212ad134765dd78c654a4b9906252b66d.tar.xz
kernel-qcow2-linux-4150c57212ad134765dd78c654a4b9906252b66d.zip
[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 'drivers/net/wireless/rt2x00/rt2x00dev.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index cd82eeface8f..bbccb8933876 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -135,10 +135,12 @@ void rt2x00lib_disable_radio(struct rt2x00_dev *rt2x00dev)
return;
/*
- * Stop beacon generation.
+ * Stop all scheduled work.
*/
if (work_pending(&rt2x00dev->beacon_work))
cancel_work_sync(&rt2x00dev->beacon_work);
+ if (work_pending(&rt2x00dev->filter_work))
+ cancel_work_sync(&rt2x00dev->filter_work);
/*
* Stop the TX queues.
@@ -257,6 +259,17 @@ static void rt2x00lib_link_tuner(struct work_struct *work)
LINK_TUNE_INTERVAL);
}
+static void rt2x00lib_packetfilter_scheduled(struct work_struct *work)
+{
+ struct rt2x00_dev *rt2x00dev =
+ container_of(work, struct rt2x00_dev, filter_work);
+
+ rt2x00dev->ops->hw->configure_filter(rt2x00dev->hw,
+ rt2x00dev->interface.filter,
+ &rt2x00dev->interface.filter,
+ 0, NULL);
+}
+
/*
* Interrupt context handlers.
*/
@@ -337,7 +350,7 @@ void rt2x00lib_txdone(struct data_entry *entry,
EXPORT_SYMBOL_GPL(rt2x00lib_txdone);
void rt2x00lib_rxdone(struct data_entry *entry, struct sk_buff *skb,
- const int signal, const int rssi, const int ofdm)
+ struct rxdata_entry_desc *desc)
{
struct rt2x00_dev *rt2x00dev = entry->ring->rt2x00dev;
struct ieee80211_rx_status *rx_status = &rt2x00dev->rx_status;
@@ -358,22 +371,24 @@ void rt2x00lib_rxdone(struct data_entry *entry, struct sk_buff *skb,
* the signal is the PLCP value. If it was received with
* a CCK bitrate the signal is the rate in 0.5kbit/s.
*/
- if (!ofdm)
+ if (!desc->ofdm)
val = DEVICE_GET_RATE_FIELD(rate->val, RATE);
else
val = DEVICE_GET_RATE_FIELD(rate->val, PLCP);
- if (val == signal) {
+ if (val == desc->signal) {
val = rate->val;
break;
}
}
- rt2x00_update_link_rssi(&rt2x00dev->link, rssi);
+ rt2x00_update_link_rssi(&rt2x00dev->link, desc->rssi);
rt2x00dev->link.rx_success++;
rx_status->rate = val;
- rx_status->signal = rt2x00lib_calculate_link_signal(rt2x00dev, rssi);
- rx_status->ssi = rssi;
+ rx_status->signal =
+ rt2x00lib_calculate_link_signal(rt2x00dev, desc->rssi);
+ rx_status->ssi = desc->rssi;
+ rx_status->flag = desc->flags;
/*
* Send frame to mac80211
@@ -391,7 +406,7 @@ void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev,
unsigned int length,
struct ieee80211_tx_control *control)
{
- struct data_entry_desc desc;
+ struct txdata_entry_desc desc;
struct data_ring *ring;
int tx_rate;
int bitrate;
@@ -956,6 +971,7 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev)
* Initialize configuration work.
*/
INIT_WORK(&rt2x00dev->beacon_work, rt2x00lib_beacondone_scheduled);
+ INIT_WORK(&rt2x00dev->filter_work, rt2x00lib_packetfilter_scheduled);
INIT_DELAYED_WORK(&rt2x00dev->link.work, rt2x00lib_link_tuner);
/*
@@ -1098,7 +1114,6 @@ int rt2x00lib_resume(struct rt2x00_dev *rt2x00dev)
rt2x00lib_config_mac_addr(rt2x00dev, intf->mac);
rt2x00lib_config_bssid(rt2x00dev, intf->bssid);
rt2x00lib_config_type(rt2x00dev, intf->type);
- rt2x00lib_config_packet_filter(rt2x00dev, intf->filter);
/*
* When in Master or Ad-hoc mode,