Debian Codegraph @

patches/rtl8180-0.21v2.patch

raw
1 diff -Naur rtl8180-0.21_orig/ieee80211_crypt.c rtl8180-0.21_patched/ieee80211_crypt.c
2 --- rtl8180-0.21_orig/ieee80211_crypt.c 2004-11-27 20:33:23.000000000 +0100
3 +++ rtl8180-0.21_patched/ieee80211_crypt.c 2007-02-18 17:35:03.000000000 +0100
4 @@ -11,8 +11,10 @@
5 *
6 */
7 #ifndef CONFIG_IEEE80211_NOWEP
8 -#include <linux/config.h>
9 #include <linux/version.h>
10 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
11 +#include <linux/config.h>
12 +#endif
13 #include <linux/module.h>
14 #include <linux/init.h>
15 #include <linux/slab.h>
16 diff -Naur rtl8180-0.21_orig/ieee80211_crypt_wep.c rtl8180-0.21_patched/ieee80211_crypt_wep.c
17 --- rtl8180-0.21_orig/ieee80211_crypt_wep.c 2005-04-12 14:25:42.000000000 +0200
18 +++ rtl8180-0.21_patched/ieee80211_crypt_wep.c 2007-02-18 17:35:03.000000000 +0100
19 @@ -9,8 +9,10 @@
20 * more details.
21 */
22 #ifndef CONFIG_IEEE80211_NOWEP
23 -#include <linux/config.h>
24 #include <linux/version.h>
25 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
26 +#include <linux/config.h>
27 +#endif
28 #include <linux/module.h>
29 #include <linux/init.h>
30 #include <linux/slab.h>
31 @@ -28,7 +30,11 @@
32 #endif
33
34 #include <linux/crypto.h>
35 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
36 #include <asm/scatterlist.h>
37 +#else
38 +#include <linux/scatterlist.h>
39 +#endif
40 #include <linux/crc32.h>
41
42 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,47))
43 diff -Naur rtl8180-0.21_orig/ieee80211_module.c rtl8180-0.21_patched/ieee80211_module.c
44 --- rtl8180-0.21_orig/ieee80211_module.c 2005-04-15 00:29:23.000000000 +0200
45 +++ rtl8180-0.21_patched/ieee80211_module.c 2007-02-18 17:35:03.000000000 +0100
46 @@ -37,8 +37,11 @@
47
48 *******************************************************************************/
49 #include <linux/init.h>
50 +#include <linux/version.h>
51 #include <linux/compiler.h>
52 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
53 #include <linux/config.h>
54 +#endif
55 #include <linux/errno.h>
56 #include <linux/if_arp.h>
57 #include <linux/in6.h>
58 @@ -53,7 +56,6 @@
59 #include <linux/slab.h>
60 #include <linux/tcp.h>
61 #include <linux/types.h>
62 -#include <linux/version.h>
63 #include <linux/wireless.h>
64 #include <linux/etherdevice.h>
65 #include <asm/uaccess.h>
66 diff -Naur rtl8180-0.21_orig/ieee80211_rx.c rtl8180-0.21_patched/ieee80211_rx.c
67 --- rtl8180-0.21_orig/ieee80211_rx.c 2005-04-12 14:13:18.000000000 +0200
68 +++ rtl8180-0.21_patched/ieee80211_rx.c 2007-02-18 17:35:03.000000000 +0100
69 @@ -16,8 +16,11 @@
70 * more details.
71 */
72
73 +#include <linux/version.h>
74 #include <linux/compiler.h>
75 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
76 #include <linux/config.h>
77 +#endif
78 #include <linux/errno.h>
79 #include <linux/if_arp.h>
80 #include <linux/in6.h>
81 @@ -32,7 +35,6 @@
82 #include <linux/slab.h>
83 #include <linux/tcp.h>
84 #include <linux/types.h>
85 -#include <linux/version.h>
86 #include <linux/wireless.h>
87 #include <linux/etherdevice.h>
88 #include <asm/uaccess.h>
89 diff -Naur rtl8180-0.21_orig/ieee80211_tx.c rtl8180-0.21_patched/ieee80211_tx.c
90 --- rtl8180-0.21_orig/ieee80211_tx.c 2005-04-12 23:02:17.000000000 +0200
91 +++ rtl8180-0.21_patched/ieee80211_tx.c 2007-02-18 17:35:03.000000000 +0100
92 @@ -31,7 +31,10 @@
93
94 ******************************************************************************/
95 #include <linux/compiler.h>
96 +#include <linux/version.h>
97 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
98 #include <linux/config.h>
99 +#endif
100 #include <linux/errno.h>
101 #include <linux/if_arp.h>
102 #include <linux/in6.h>
103 @@ -46,7 +49,6 @@
104 #include <linux/slab.h>
105 #include <linux/tcp.h>
106 #include <linux/types.h>
107 -#include <linux/version.h>
108 #include <linux/wireless.h>
109 #include <linux/etherdevice.h>
110 #include <asm/uaccess.h>
111 @@ -577,6 +579,14 @@
112
113 spin_lock_irqsave(&ieee->lock,flags);
114
115 + if (ieee->iw_mode == IW_MODE_MONITOR) {
116 + ieee->func->hard_data_xmit(ieee->dev,skb,0);
117 + dev_kfree_skb_any(skb);
118 + ieee->stats.tx_packets++;
119 + ieee->dev->trans_start = jiffies;
120 + goto exit;
121 + }
122 +
123 if(ieee->queue_stop){
124 IEEE80211DMESG("EE: IEEE hard_start_xmit invoked when kernel queue should be stopped");
125 netif_stop_queue(ieee->dev);
126 diff -Naur rtl8180-0.21_orig/ieee80211_wx.c rtl8180-0.21_patched/ieee80211_wx.c
127 --- rtl8180-0.21_orig/ieee80211_wx.c 2005-04-10 19:54:20.000000000 +0200
128 +++ rtl8180-0.21_patched/ieee80211_wx.c 2007-02-18 17:35:03.000000000 +0100
129 @@ -34,6 +34,9 @@
130 ******************************************************************************/
131 #include <linux/wireless.h>
132 #include <linux/version.h>
133 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
134 +#include <linux/config.h>
135 +#endif
136 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
137 #include <linux/kmod.h> /* request_module */
138 #include <linux/kernel.h>
139 diff -Naur rtl8180-0.21_orig/Makefile rtl8180-0.21_patched/Makefile
140 --- rtl8180-0.21_orig/Makefile 2005-02-27 19:48:47.000000000 +0100
141 +++ rtl8180-0.21_patched/Makefile 2007-02-18 17:34:21.000000000 +0100
142 @@ -59,7 +59,7 @@
143 make -C $(KSRC) SUBDIRS=$(PWD) modules
144
145 2.6:
146 - $(MAKE) -C $(KSRC) SUBDIRS=$(PWD) MODVERDIR=$(PWD) modules
147 + $(MAKE) -C $(KSRC) SUBDIRS=$(PWD) modules
148
149 clean:
150 rm -f *.mod.c *.mod *.o .*.cmd *.ko .*.flags
151 diff -Naur rtl8180-0.21_orig/Makefile26 rtl8180-0.21_patched/Makefile26
152 --- rtl8180-0.21_orig/Makefile26 2005-02-27 19:48:48.000000000 +0100
153 +++ rtl8180-0.21_patched/Makefile26 2007-02-18 17:34:21.000000000 +0100
154 @@ -26,7 +26,7 @@
155 rm -f *.mod.c *.mod *.o .*.cmd *.ko
156 rm -rf $(PWD)/tmp
157 modules:
158 - $(MAKE) -C $(KSRC) SUBDIRS=$(PWD) MODVERDIR=$(PWD) modules
159 + $(MAKE) -C $(KSRC) SUBDIRS=$(PWD) modules
160
161 MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless
162 MOD_ALGDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/alg
163 diff -Naur rtl8180-0.21_orig/r8180_core.c rtl8180-0.21_patched/r8180_core.c
164 --- rtl8180-0.21_orig/r8180_core.c 2005-04-12 14:39:56.000000000 +0200
165 +++ rtl8180-0.21_patched/r8180_core.c 2007-02-18 17:35:03.000000000 +0100
166 @@ -121,6 +121,7 @@
167 MODULE_AUTHOR("Andrea Merello <[email protected]>");
168 MODULE_DESCRIPTION("Linux driver for Realtek RTL8180 WiFi cards");
169
170 +#if 0
171 MODULE_PARM(ifname,"s");
172 MODULE_PARM_DESC(devname," Net interface name, wlan%d=default");
173
174 @@ -132,7 +133,7 @@
175
176 MODULE_PARM(channels,"i");
177 MODULE_PARM_DESC(channels," Channel bitmask for specific locales. NYI");
178 -
179 +#endif
180
181 static int __devinit rtl8180_pci_probe(struct pci_dev *pdev,
182 const struct pci_device_id *id);
183 @@ -452,13 +453,14 @@
184 }
185
186
187 -
188 +#if WIRELESS_EXT < 17
189 static struct iw_statistics *r8180_get_wireless_stats(struct net_device *dev)
190 {
191 struct r8180_priv *priv = dev->priv;
192
193 return &priv->wstats;
194 }
195 +#endif
196
197 void rtl8180_proc_module_init(void)
198 {
199 @@ -2204,11 +2206,12 @@
200 void rtl8180_hard_data_xmit(struct net_device *dev,struct sk_buff *skb,short morefrag)
201 {
202 struct r8180_priv *priv = (struct r8180_priv *)dev->priv;
203 - int mode;
204 + int mode, priority = LOW_PRIORITY;
205 //unsigned long flags;
206
207 mode = priv->ieee80211->iw_mode;
208 -
209 + if( mode == IW_MODE_MONITOR )
210 + priority = HI_PRIORITY;
211
212 /*
213 * This function doesn't require lock because we make
214 @@ -2220,13 +2223,13 @@
215 //spin_lock_irqsave(&priv->tx_lock,flags);
216
217
218 - if (!check_nic_enought_desc(dev, LOW_PRIORITY)){
219 + if (!check_nic_enought_desc(dev, priority)){
220 DMESG("Error: no descriptor left by previous TX (avail %d) ",
221 - get_curr_tx_free_desc(dev, LOW_PRIORITY));
222 + get_curr_tx_free_desc(dev, priority));
223 ieee80211_r8180_stop_queue(priv->ieee80211);
224 }
225 - rtl8180_tx(dev, (u32*)skb->data, skb->len, LOW_PRIORITY, morefrag,0);
226 - if (!check_nic_enought_desc(dev, LOW_PRIORITY))
227 + rtl8180_tx(dev, (u32*)skb->data, skb->len, priority, morefrag,0);
228 + if (!check_nic_enought_desc(dev, priority))
229 ieee80211_r8180_stop_queue(priv->ieee80211);
230
231 //spin_unlock_irqrestore(&priv->tx_lock,flags);
232 @@ -2634,7 +2637,11 @@
233 spin_lock_init(&priv->tx_lock);
234 sema_init(&priv->wx_sem,1);
235 priv->workqueue = create_workqueue(DRV_NAME);
236 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
237 INIT_WORK(&priv->IBSS_work,(void(*)(void*)) rtl8180_IBSS_create_wq,dev);
238 +#else
239 + INIT_WORK(&priv->IBSS_work,(void(*)(void*)) rtl8180_IBSS_create_wq);
240 +#endif
241
242 tasklet_init(&priv->irq_rx_tasklet,
243 (void(*)(unsigned long)) rtl8180_irq_rx_tasklet,
244 @@ -3411,10 +3418,18 @@
245 if (priv->ieee80211->iw_mode == IW_MODE_ADHOC)
246 rtl8180_IBSS_create(dev);
247
248 -/* if (priv->ieee80211->iw_mode == IW_MODE_MONITOR){
249 + if (priv->ieee80211->iw_mode == IW_MODE_MONITOR) {
250 + priv->retry_rts = 0;
251 + priv->retry_data = 0;
252 + rtl8180_tx_enable(dev);
253 +
254 netif_carrier_on(dev);
255 + if(netif_queue_stopped(dev))
256 + netif_wake_queue(dev);
257 + else
258 + netif_start_queue(dev);
259 }
260 -*/
261 +
262 if (priv->ieee80211->iw_mode == IW_MODE_INFRA) {
263
264 // rtl8180_tx_enable(dev);
265 @@ -3608,8 +3623,7 @@
266 pio_flags = (unsigned long)pci_resource_flags (pdev, 0);
267
268 if (!(pio_flags & IORESOURCE_IO)) {
269 - DMESG("%s: region #0 not a PIO resource, aborting",
270 - pdev->slot_name);
271 + DMESG("r8180: region #0 not a PIO resource, aborting");
272 goto fail;
273 }
274
275 @@ -3629,8 +3643,7 @@
276 pmem_flags = pci_resource_flags (pdev, 1);
277
278 if (!(pmem_flags & IORESOURCE_MEM)) {
279 - DMESG("%s: region #1 not a MMIO resource, aborting",
280 - pdev->slot_name);
281 + DMESG("r8180: region #1 not a MMIO resource, aborting");
282 goto fail;
283 }
284
285 @@ -3664,7 +3677,12 @@
286 dev->do_ioctl = do_ioctl;
287 dev->set_multicast_list = r8180_set_multicast;
288 dev->set_mac_address = r8180_set_mac_adr;
289 +#if WIRELESS_EXT >= 12
290 +#if WIRELESS_EXT < 17
291 dev->get_wireless_stats = r8180_get_wireless_stats;
292 +#endif
293 + dev->wireless_handlers = (struct iw_handler_def *) &r8180_wx_handlers_def;
294 +#endif
295 dev->type=ARPHRD_ETHER;
296
297 if (dev_alloc_name(dev, ifname) < 0){
298 diff -Naur rtl8180-0.21_orig/r8180.h rtl8180-0.21_patched/r8180.h
299 --- rtl8180-0.21_orig/r8180.h 2005-04-11 18:36:26.000000000 +0200
300 +++ rtl8180-0.21_patched/r8180.h 2007-02-18 17:35:09.000000000 +0100
301 @@ -25,7 +25,10 @@
302
303 #include <linux/module.h>
304 #include <linux/kernel.h>
305 +#include <linux/version.h>
306 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
307 #include <linux/config.h>
308 +#endif
309 #include <linux/init.h>
310 #include <linux/ioport.h>
311 #include <linux/sched.h>