~ubuntu-branches/ubuntu/hardy/linux-backports-modules-2.6.24/hardy-security

« back to all changes in this revision

Viewing changes to updates/wireless/iwlwifi/mac80211/pending/0092-mac80211-sta-hw-scanning.patch

  • Committer: Bazaar Package Importer
  • Author(s): , Ben Collins
  • Date: 2008-04-02 06:59:04 UTC
  • Revision ID: james.westby@ubuntu.com-20080402065904-e5knh2gn2hms3xbb
Tags: 2.6.24-14.11
[Ben Collins]

* iwlwifi: Update to iwlwifi-1.2.25 and mac80211-10.0.4
  - LP: #200950
* ubuntu: Slight cleanups to module hiearchy and Makefiles
* mac80211: Enable LED triggers
* iwlwifi: Add LED trigger support (rx and tx only)
  - LP: #176090

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
5
@@ -947,7 +947,7 @@
 
6
 #endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
 
7
        u32 sta_flags;
 
8
 
 
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))
 
13
                return TXRX_DROP;
 
14
@@ -2328,8 +2328,7 @@
 
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;
 
22
                else
 
23
                        conf.bssid = sdata->u.sta.bssid;
 
24
@@ -2374,7 +2373,7 @@
 
25
        struct ieee80211_channel *chan;
 
26
        int ret = 0;
 
27
 
 
28
-       if (local->sta_scanning) {
 
29
+       if (local->sta_sw_scanning) {
 
30
                chan = local->scan_channel;
 
31
                mode = local->scan_hw_mode;
 
32
        } else {
 
33
@@ -2549,7 +2548,7 @@
 
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);
 
40
                }
 
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;
 
45
 
 
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);
 
50
+
 
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)
 
54
+                   != TXRX_QUEUED)
 
55
+                       dev_kfree_skb(skb);
 
56
                return TXRX_QUEUED;
 
57
        }
 
58
 
 
59
@@ -4346,7 +4351,7 @@
 
60
                goto end;
 
61
        }
 
62
 
 
63
-       if (unlikely(local->sta_scanning))
 
64
+       if (unlikely(local->sta_sw_scanning || local->sta_hw_scanning))
 
65
                rx.u.rx.in_scan = 1;
 
66
 
 
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
 
72
@@ -541,7 +541,8 @@
 
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;
 
76
-       int sta_scanning;
 
77
+       int sta_sw_scanning;
 
78
+       int sta_hw_scanning;
 
79
        int scan_channel_idx;
 
80
        enum { SCAN_SET_CHANNEL, SCAN_SEND_PROBE } scan_state;
 
81
        unsigned long last_scan_completed;
 
82
@@ -856,7 +857,8 @@
 
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
 
96
@@ -493,7 +493,7 @@
 
97
        }
 
98
 
 
99
        if (set) {
 
100
-               if (local->sta_scanning)
 
101
+               if (local->sta_sw_scanning)
 
102
                        ret = 0;
 
103
                else
 
104
                        ret = ieee80211_hw_config(local);
 
105
@@ -733,7 +733,7 @@
 
106
 {
 
107
        int res;
 
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)
 
111
                return -EAGAIN;
 
112
        res = ieee80211_sta_scan_results(dev, extra, data->length);
 
113
        if (res >= 0) {
 
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");
 
120
                return;
 
121
        }
 
122
-       mode = local->sta_scanning ?
 
123
+       mode = local->sta_sw_scanning ?
 
124
               local->scan_hw_mode : local->oper_hw_mode;
 
125
        rates = mode->rates;
 
126
        num_rates = mode->num_rates;
 
127
@@ -1967,7 +1967,7 @@
 
128
                printk(KERN_ERR "DLS Parse support rates failed.\n");
 
129
                return;
 
130
        }
 
131
-       mode = local->sta_scanning ?
 
132
+       mode = local->sta_sw_scanning ?
 
133
               local->scan_hw_mode : local->oper_hw_mode;
 
134
        rates = mode->rates;
 
135
        num_rates = mode->num_rates;
 
136
@@ -2201,7 +2201,7 @@
 
137
                u32 supp_rates, prev_rates;
 
138
                int i, j;
 
139
 
 
140
-               mode = local->sta_scanning ?
 
141
+               mode = local->sta_sw_scanning ?
 
142
                       local->scan_hw_mode : local->oper_hw_mode;
 
143
                rates = mode->rates;
 
144
                num_rates = mode->num_rates;
 
145
@@ -3412,16 +3412,15 @@
 
146
 }
 
147
 
 
148
 
 
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)
 
154
 {
 
155
        struct ieee80211_mgmt *mgmt;
 
156
        u16 fc;
 
157
 
 
158
-       if (skb->len < 24) {
 
159
-               dev_kfree_skb(skb);
 
160
-               return;
 
161
-       }
 
162
+       if (skb->len < 24)
 
163
+               return TXRX_DROP;
 
164
 
 
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,
 
175
                                                 rx_status);
 
176
+                       dev_kfree_skb(skb);
 
177
+                       return TXRX_QUEUED;
 
178
                }
 
179
        }
 
180
-
 
181
-       dev_kfree_skb(skb);
 
182
+       return TXRX_CONTINUE;
 
183
 }
 
184
 
 
185
 
 
186
@@ -3535,7 +3537,7 @@
 
187
        if (!netif_running(dev))
 
188
                return;
 
189
 
 
190
-       if (local->sta_scanning)
 
191
+       if (local->sta_sw_scanning || local->sta_hw_scanning)
 
192
                return;
 
193
 
 
194
        if (sdata->type != IEEE80211_IF_TYPE_STA &&
 
195
@@ -4226,7 +4228,8 @@
 
196
 
 
197
        local->last_scan_completed = jiffies;
 
198
        wmb();
 
199
-       local->sta_scanning = 0;
 
200
+       local->sta_hw_scanning = 0;
 
201
+       local->sta_sw_scanning = 0;
 
202
 
 
203
        if (ieee80211_hw_config(local))
 
204
                printk(KERN_DEBUG "%s: failed to restore operational"
 
205
@@ -4279,7 +4282,7 @@
 
206
        int skip;
 
207
        unsigned long next_delay = 0;
 
208
 
 
209
-       if (!local->sta_scanning)
 
210
+       if (!local->sta_sw_scanning)
 
211
                return;
 
212
 
 
213
        switch (local->scan_state) {
 
214
@@ -4342,7 +4345,7 @@
 
215
                break;
 
216
        }
 
217
 
 
218
-       if (local->sta_scanning)
 
219
+       if (local->sta_sw_scanning)
 
220
                queue_delayed_work(local->hw.workqueue, &local->scan_work,
 
221
                                   next_delay);
 
222
 }
 
223
@@ -4374,7 +4377,7 @@
 
224
          * ResultCode: SUCCESS, INVALID_PARAMETERS
 
225
         */
 
226
 
 
227
-       if (local->sta_scanning) {
 
228
+       if (local->sta_sw_scanning) {
 
229
                if (local->scan_dev == dev)
 
230
                        return 0;
 
231
                return -EBUSY;
 
232
@@ -4384,13 +4387,13 @@
 
233
                int rc = local->ops->hw_scan(local_to_hw(local),
 
234
                                            ssid, ssid_len);
 
235
                if (!rc) {
 
236
-                       local->sta_scanning = 1;
 
237
+                       local->sta_hw_scanning = 1;
 
238
                        local->scan_dev = dev;
 
239
                }
 
240
                return rc;
 
241
        }
 
242
 
 
243
-       local->sta_scanning = 1;
 
244
+       local->sta_sw_scanning = 1;
 
245
 
 
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);
 
251
 
 
252
-       if (local->sta_scanning) {
 
253
-               if (local->scan_dev == dev)
 
254
-                       return 0;
 
255
+       if (local->sta_hw_scanning)
 
256
+               return 0;
 
257
+
 
258
+       if (local->sta_sw_scanning)
 
259
                return -EBUSY;
 
260
-       }
 
261
 
 
262
        set_bit(IEEE80211_STA_REQ_SCAN, &ifsta->request);
 
263
        queue_work(local->hw.workqueue, &ifsta->work);