aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00pci.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 /drivers/net/wireless/rt2x00/rt2x00pci.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 'drivers/net/wireless/rt2x00/rt2x00pci.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00pci.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c
index 85629f1999a..2780df00623 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
@@ -124,47 +124,40 @@ void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev)
124 struct data_entry *entry; 124 struct data_entry *entry;
125 struct data_desc *rxd; 125 struct data_desc *rxd;
126 struct sk_buff *skb; 126 struct sk_buff *skb;
127 u32 desc; 127 struct rxdata_entry_desc desc;
128 int retval; 128 u32 word;
129 int signal;
130 int rssi;
131 int ofdm;
132 int size;
133 129
134 while (1) { 130 while (1) {
135 entry = rt2x00_get_data_entry(ring); 131 entry = rt2x00_get_data_entry(ring);
136 rxd = entry->priv; 132 rxd = entry->priv;
137 rt2x00_desc_read(rxd, 0, &desc); 133 rt2x00_desc_read(rxd, 0, &word);
138 134
139 if (rt2x00_get_field32(desc, RXD_ENTRY_OWNER_NIC)) 135 if (rt2x00_get_field32(word, RXD_ENTRY_OWNER_NIC))
140 break; 136 break;
141 137
142 retval = rt2x00dev->ops->lib->fill_rxdone(entry, &signal, 138 memset(&desc, 0x00, sizeof(desc));
143 &rssi, &ofdm, &size); 139 rt2x00dev->ops->lib->fill_rxdone(entry, &desc);
144 if (retval)
145 goto skip_entry;
146 140
147 /* 141 /*
148 * Allocate the sk_buffer, initialize it and copy 142 * Allocate the sk_buffer, initialize it and copy
149 * all data into it. 143 * all data into it.
150 */ 144 */
151 skb = dev_alloc_skb(size + NET_IP_ALIGN); 145 skb = dev_alloc_skb(desc.size + NET_IP_ALIGN);
152 if (!skb) 146 if (!skb)
153 return; 147 return;
154 148
155 skb_reserve(skb, NET_IP_ALIGN); 149 skb_reserve(skb, NET_IP_ALIGN);
156 skb_put(skb, size); 150 skb_put(skb, desc.size);
157 memcpy(skb->data, entry->data_addr, size); 151 memcpy(skb->data, entry->data_addr, desc.size);
158 152
159 /* 153 /*
160 * Send the frame to rt2x00lib for further processing. 154 * Send the frame to rt2x00lib for further processing.
161 */ 155 */
162 rt2x00lib_rxdone(entry, skb, signal, rssi, ofdm); 156 rt2x00lib_rxdone(entry, skb, &desc);
163 157
164skip_entry:
165 if (test_bit(DEVICE_ENABLED_RADIO, &ring->rt2x00dev->flags)) { 158 if (test_bit(DEVICE_ENABLED_RADIO, &ring->rt2x00dev->flags)) {
166 rt2x00_set_field32(&desc, RXD_ENTRY_OWNER_NIC, 1); 159 rt2x00_set_field32(&word, RXD_ENTRY_OWNER_NIC, 1);
167 rt2x00_desc_write(rxd, 0, desc); 160 rt2x00_desc_write(rxd, 0, word);
168 } 161 }
169 162
170 rt2x00_ring_index_inc(ring); 163 rt2x00_ring_index_inc(ring);