1
Index: compatible/net/mac80211/ieee80211.c
2
===================================================================
3
--- compatible.orig/net/mac80211/ieee80211.c 2008-01-06 12:08:49.000000000 +0200
4
+++ compatible/net/mac80211/ieee80211.c 2008-01-06 12:09:02.000000000 +0200
6
#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
9
- if (unlikely(tx->local->sta_scanning != 0) &&
10
+ if (unlikely(tx->local->sta_sw_scanning != 0) &&
11
((tx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_MGMT ||
12
(tx->fc & IEEE80211_FCTL_STYPE) != IEEE80211_STYPE_PROBE_REQ))
15
conf.type = sdata->type;
16
if (sdata->type == IEEE80211_IF_TYPE_STA ||
17
sdata->type == IEEE80211_IF_TYPE_IBSS) {
18
- if (local->sta_scanning &&
19
- local->scan_dev == dev)
20
+ if (local->sta_hw_scanning)
21
conf.bssid = scan_bssid;
23
conf.bssid = sdata->u.sta.bssid;
25
struct ieee80211_channel *chan;
28
- if (local->sta_scanning) {
29
+ if (local->sta_sw_scanning) {
30
chan = local->scan_channel;
31
mode = local->scan_hw_mode;
34
skb_queue_purge(&sdata->u.sta.skb_queue);
35
if (!local->ops->hw_scan &&
36
local->scan_dev == sdata->dev) {
37
- local->sta_scanning = 0;
38
+ local->sta_sw_scanning = 0;
39
cancel_delayed_work(&local->scan_work);
41
flush_workqueue(local->hw.workqueue);
42
@@ -4152,8 +4151,14 @@
43
struct ieee80211_local *local = rx->local;
44
struct sk_buff *skb = rx->skb;
46
- if (unlikely(local->sta_scanning != 0)) {
47
- ieee80211_sta_rx_scan(rx->dev, skb, rx->u.rx.status);
48
+ if (unlikely(local->sta_hw_scanning != 0))
49
+ return ieee80211_sta_rx_scan(rx->dev, skb, rx->u.rx.status);
51
+ if (unlikely(local->sta_sw_scanning != 0)) {
52
+ /* drop all the other packets during a software scan anyway */
53
+ if (ieee80211_sta_rx_scan(rx->dev, skb, rx->u.rx.status)
63
- if (unlikely(local->sta_scanning))
64
+ if (unlikely(local->sta_sw_scanning || local->sta_hw_scanning))
67
if (__ieee80211_invoke_rx_handlers(local, local->rx_pre_handlers, &rx,
68
Index: compatible/net/mac80211/ieee80211_i.h
69
===================================================================
70
--- compatible.orig/net/mac80211/ieee80211_i.h 2008-01-06 12:07:06.000000000 +0200
71
+++ compatible/net/mac80211/ieee80211_i.h 2008-01-06 12:09:02.000000000 +0200
73
rwlock_t sub_if_lock; /* Protects sub_if_list. Cannot be taken under
74
* sta_bss_lock or sta_lock. */
75
struct list_head sub_if_list;
77
+ int sta_sw_scanning;
78
+ int sta_hw_scanning;
80
enum { SCAN_SET_CHANNEL, SCAN_SEND_PROBE } scan_state;
81
unsigned long last_scan_completed;
83
void ieee80211_sta_req_auth(struct net_device *dev,
84
struct ieee80211_if_sta *ifsta);
85
int ieee80211_sta_scan_results(struct net_device *dev, char *buf, size_t len);
86
-void ieee80211_sta_rx_scan(struct net_device *dev, struct sk_buff *skb,
87
+ieee80211_txrx_result ieee80211_sta_rx_scan(struct net_device *dev,
88
+ struct sk_buff *skb,
89
struct ieee80211_rx_status *rx_status);
90
void ieee80211_rx_bss_list_init(struct net_device *dev);
91
void ieee80211_rx_bss_list_deinit(struct net_device *dev);
92
Index: compatible/net/mac80211/ieee80211_ioctl.c
93
===================================================================
94
--- compatible.orig/net/mac80211/ieee80211_ioctl.c 2008-01-06 12:08:57.000000000 +0200
95
+++ compatible/net/mac80211/ieee80211_ioctl.c 2008-01-06 12:09:02.000000000 +0200
100
- if (local->sta_scanning)
101
+ if (local->sta_sw_scanning)
104
ret = ieee80211_hw_config(local);
108
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
109
- if (local->sta_scanning)
110
+ if (local->sta_sw_scanning || local->sta_hw_scanning)
112
res = ieee80211_sta_scan_results(dev, extra, data->length);
114
Index: compatible/net/mac80211/ieee80211_sta.c
115
===================================================================
116
--- compatible.orig/net/mac80211/ieee80211_sta.c 2008-01-06 12:08:57.000000000 +0200
117
+++ compatible/net/mac80211/ieee80211_sta.c 2008-01-06 12:09:02.000000000 +0200
118
@@ -1893,7 +1893,7 @@
119
printk(KERN_ERR "DLS Parse support rates failed.\n");
122
- mode = local->sta_scanning ?
123
+ mode = local->sta_sw_scanning ?
124
local->scan_hw_mode : local->oper_hw_mode;
126
num_rates = mode->num_rates;
127
@@ -1967,7 +1967,7 @@
128
printk(KERN_ERR "DLS Parse support rates failed.\n");
131
- mode = local->sta_scanning ?
132
+ mode = local->sta_sw_scanning ?
133
local->scan_hw_mode : local->oper_hw_mode;
135
num_rates = mode->num_rates;
136
@@ -2201,7 +2201,7 @@
137
u32 supp_rates, prev_rates;
140
- mode = local->sta_scanning ?
141
+ mode = local->sta_sw_scanning ?
142
local->scan_hw_mode : local->oper_hw_mode;
144
num_rates = mode->num_rates;
145
@@ -3412,16 +3412,15 @@
149
-void ieee80211_sta_rx_scan(struct net_device *dev, struct sk_buff *skb,
150
- struct ieee80211_rx_status *rx_status)
151
+ieee80211_txrx_result
152
+ieee80211_sta_rx_scan(struct net_device *dev, struct sk_buff *skb,
153
+ struct ieee80211_rx_status *rx_status)
155
struct ieee80211_mgmt *mgmt;
158
- if (skb->len < 24) {
159
- dev_kfree_skb(skb);
165
mgmt = (struct ieee80211_mgmt *) skb->data;
166
fc = le16_to_cpu(mgmt->frame_control);
167
@@ -3430,13 +3429,16 @@
168
if ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PROBE_RESP) {
169
ieee80211_rx_mgmt_probe_resp(dev, mgmt,
170
skb->len, rx_status);
171
+ dev_kfree_skb(skb);
172
+ return TXRX_QUEUED;
173
} else if ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_BEACON) {
174
ieee80211_rx_mgmt_beacon(dev, mgmt, skb->len,
176
+ dev_kfree_skb(skb);
177
+ return TXRX_QUEUED;
181
- dev_kfree_skb(skb);
182
+ return TXRX_CONTINUE;
186
@@ -3535,7 +3537,7 @@
187
if (!netif_running(dev))
190
- if (local->sta_scanning)
191
+ if (local->sta_sw_scanning || local->sta_hw_scanning)
194
if (sdata->type != IEEE80211_IF_TYPE_STA &&
195
@@ -4226,7 +4228,8 @@
197
local->last_scan_completed = jiffies;
199
- local->sta_scanning = 0;
200
+ local->sta_hw_scanning = 0;
201
+ local->sta_sw_scanning = 0;
203
if (ieee80211_hw_config(local))
204
printk(KERN_DEBUG "%s: failed to restore operational"
205
@@ -4279,7 +4282,7 @@
207
unsigned long next_delay = 0;
209
- if (!local->sta_scanning)
210
+ if (!local->sta_sw_scanning)
213
switch (local->scan_state) {
214
@@ -4342,7 +4345,7 @@
218
- if (local->sta_scanning)
219
+ if (local->sta_sw_scanning)
220
queue_delayed_work(local->hw.workqueue, &local->scan_work,
223
@@ -4374,7 +4377,7 @@
224
* ResultCode: SUCCESS, INVALID_PARAMETERS
227
- if (local->sta_scanning) {
228
+ if (local->sta_sw_scanning) {
229
if (local->scan_dev == dev)
232
@@ -4384,13 +4387,13 @@
233
int rc = local->ops->hw_scan(local_to_hw(local),
236
- local->sta_scanning = 1;
237
+ local->sta_hw_scanning = 1;
238
local->scan_dev = dev;
243
- local->sta_scanning = 1;
244
+ local->sta_sw_scanning = 1;
246
read_lock(&local->sub_if_lock);
247
list_for_each_entry(sdata, &local->sub_if_list, list) {
248
@@ -4441,11 +4444,11 @@
249
if (sdata->type != IEEE80211_IF_TYPE_STA)
250
return ieee80211_sta_start_scan(dev, ssid, ssid_len);
252
- if (local->sta_scanning) {
253
- if (local->scan_dev == dev)
255
+ if (local->sta_hw_scanning)
258
+ if (local->sta_sw_scanning)
262
set_bit(IEEE80211_STA_REQ_SCAN, &ifsta->request);
263
queue_work(local->hw.workqueue, &ifsta->work);