]>
Commit | Line | Data |
---|---|---|
bceeac26 AM |
1 | diff -uNr dahdi-linux-2.2.0.2.ORIg/drivers/dahdi/xpp/xbus-sysfs.c dahdi-linux-2.2.0.2/drivers/dahdi/xpp/xbus-sysfs.c |
2 | --- dahdi-linux-2.2.0.2.ORIg/drivers/dahdi/xpp/xbus-sysfs.c 2009-10-22 18:04:47.000000000 +0100 | |
3 | +++ dahdi-linux-2.2.0.2/drivers/dahdi/xpp/xbus-sysfs.c 2009-10-22 18:05:54.000000000 +0100 | |
4 | @@ -707,7 +707,11 @@ | |
5 | dev->parent = &xbus->astribank; | |
6 | dev_set_name(dev, "%02d:%1x:%1x", xbus->num, xpd->addr.unit, | |
7 | xpd->addr.subunit); | |
8 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32) | |
9 | + dev_set_drvdata(dev, xpd); | |
10 | +#else | |
11 | dev->driver_data = xpd; | |
12 | +#endif | |
13 | dev->release = xpd_release; | |
14 | ret = device_register(dev); | |
15 | if(ret) { | |
16 | @@ -728,11 +732,21 @@ | |
17 | BUG_ON(!xbus); | |
18 | XPD_DBG(DEVICES, xpd, "SYSFS\n"); | |
19 | dev = &xpd->xpd_dev; | |
20 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32) | |
21 | + if(!dev_get_drvdata(dev)) | |
22 | + return; | |
23 | + BUG_ON(dev_get_drvdata(dev) != xpd); | |
24 | +#else | |
25 | if(!dev->driver_data) | |
26 | return; | |
27 | BUG_ON(dev->driver_data != xpd); | |
28 | +#endif | |
29 | device_unregister(dev); | |
30 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32) | |
31 | + dev_set_drvdata(dev, NULL); | |
32 | +#else | |
33 | dev->driver_data = NULL; | |
34 | +#endif | |
35 | } | |
36 | ||
37 | /*--------- Sysfs Device handling ----*/ | |
38 | @@ -746,9 +760,15 @@ | |
39 | astribank = &xbus->astribank; | |
40 | BUG_ON(!astribank); | |
41 | sysfs_remove_link(&astribank->kobj, "transport"); | |
42 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32) | |
43 | + if(!dev_get_drvdata(astribank)) | |
44 | + return; | |
45 | + BUG_ON(dev_get_drvdata(astribank) != xbus); | |
46 | +#else | |
47 | if(!astribank->driver_data) | |
48 | return; | |
49 | BUG_ON(astribank->driver_data != xbus); | |
50 | +#endif | |
51 | device_unregister(&xbus->astribank); | |
52 | } | |
53 | ||
54 | @@ -764,18 +784,30 @@ | |
55 | astribank->bus = &toplevel_bus_type; | |
56 | astribank->parent = xbus->transport.transport_device; | |
57 | dev_set_name(astribank, "xbus-%02d", xbus->num); | |
58 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32) | |
59 | + dev_set_drvdata(astribank, xbus); | |
60 | +#else | |
61 | astribank->driver_data = xbus; | |
62 | +#endif | |
63 | astribank->release = astribank_release; | |
64 | ret = device_register(astribank); | |
65 | if(ret) { | |
66 | XBUS_ERR(xbus, "%s: device_register failed: %d\n", __FUNCTION__, ret); | |
67 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32) | |
68 | + dev_set_drvdata(astribank, NULL); | |
69 | +#else | |
70 | astribank->driver_data = NULL; | |
71 | +#endif | |
72 | goto out; | |
73 | } | |
74 | ret = sysfs_create_link(&astribank->kobj, &astribank->parent->kobj, "transport"); | |
75 | if(ret < 0) { | |
76 | XBUS_ERR(xbus, "%s: sysfs_create_link failed: %d\n", __FUNCTION__, ret); | |
77 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32) | |
78 | + dev_set_drvdata(astribank, NULL); | |
79 | +#else | |
80 | astribank->driver_data = NULL; | |
81 | +#endif | |
82 | goto out; | |
83 | } | |
84 | out: | |
85 | diff -uNr dahdi-linux-2.2.0.2.ORIG/drivers/dahdi/xpp/xpp_dahdi.c dahdi-linux-2.2.0.2/drivers/dahdi/xpp/xpp_dahdi.c | |
86 | --- dahdi-linux-2.2.0.2.ORIG/drivers/dahdi/xpp/xpp_dahdi.c 2009-10-22 18:52:23.000000000 +0100 | |
87 | +++ dahdi-linux-2.2.0.2/drivers/dahdi/xpp/xpp_dahdi.c 2009-10-22 18:52:55.000000000 +0100 | |
88 | @@ -865,9 +865,11 @@ | |
89 | #endif | |
90 | spin_lock_irqsave(&xbus->lock, flags); | |
91 | atomic_inc(&xpd->open_counter); | |
92 | +/* | |
93 | LINE_DBG(DEVICES, xpd, pos, "%s[%d]: open_counter=%d\n", | |
94 | current->comm, current->pid, | |
95 | atomic_read(&xpd->open_counter)); | |
96 | +*/ | |
97 | spin_unlock_irqrestore(&xbus->lock, flags); | |
98 | if(xpd->xops->card_open) | |
99 | xpd->xops->card_open(xpd, pos); | |
100 | @@ -885,9 +887,11 @@ | |
101 | spin_unlock_irqrestore(&xbus->lock, flags); | |
102 | if(xpd->xops->card_close) | |
103 | xpd->xops->card_close(xpd, pos); | |
104 | +/* | |
105 | LINE_DBG(DEVICES, xpd, pos, "%s[%d]: open_counter=%d\n", | |
106 | current->comm, current->pid, | |
107 | atomic_read(&xpd->open_counter)); | |
108 | +*/ | |
109 | atomic_dec(&xpd->open_counter); /* from xpp_open() */ | |
110 | put_xpd(__FUNCTION__, xpd); /* from xpp_open() */ | |
111 | return 0; | |
112 | diff -uNr dahdi-linux-2.2.0.2.ORIG/drivers/dahdi/dahdi-base.c dahdi-linux-2.2.0.2/drivers/dahdi/dahdi-base.c | |
113 | --- dahdi-linux-2.2.0.2.ORIG/drivers/dahdi/dahdi-base.c 2009-10-22 17:14:40.000000000 +0100 | |
114 | +++ dahdi-linux-2.2.0.2/drivers/dahdi/dahdi-base.c 2009-10-22 17:14:49.000000000 +0100 | |
115 | @@ -46,6 +46,7 @@ | |
116 | #include <linux/kmod.h> | |
117 | #include <linux/moduleparam.h> | |
118 | #include <linux/list.h> | |
119 | +#include <linux/sched.h> | |
120 | ||
121 | #include <linux/ppp_defs.h> | |
122 | ||
123 | diff -uNr dahdi-linux-2.2.0.2.ORIG/drivers/dahdi/pciradio.c dahdi-linux-2.2.0.2/drivers/dahdi/pciradio.c | |
124 | --- dahdi-linux-2.2.0.2.ORIG/drivers/dahdi/pciradio.c 2009-10-22 17:14:40.000000000 +0100 | |
125 | +++ dahdi-linux-2.2.0.2/drivers/dahdi/pciradio.c 2009-10-22 17:14:49.000000000 +0100 | |
126 | @@ -51,6 +51,7 @@ | |
127 | #include <linux/pci.h> | |
128 | #include <linux/interrupt.h> | |
129 | #include <linux/moduleparam.h> | |
130 | +#include <linux/sched.h> | |
131 | #include <asm/io.h> | |
132 | #include <asm/delay.h> | |
133 | ||
134 | diff -uNr dahdi-linux-2.2.0.2.ORIG/drivers/dahdi/voicebus/voicebus.c dahdi-linux-2.2.0.2/drivers/dahdi/voicebus/voicebus.c | |
135 | --- dahdi-linux-2.2.0.2.ORIG/drivers/dahdi/voicebus/voicebus.c 2009-10-22 17:14:40.000000000 +0100 | |
136 | +++ dahdi-linux-2.2.0.2/drivers/dahdi/voicebus/voicebus.c 2009-10-22 17:16:44.000000000 +0100 | |
137 | @@ -35,6 +35,7 @@ | |
138 | #include <linux/interrupt.h> | |
139 | #include <linux/timer.h> | |
140 | #include <linux/module.h> | |
141 | +#include <linux/sched.h> | |
142 | ||
143 | #include <dahdi/kernel.h> | |
144 | #include "voicebus.h" | |
145 | diff -uNr dahdi-linux-2.2.0.2.ORIG/drivers/dahdi/wcfxo.c dahdi-linux-2.2.0.2/drivers/dahdi/wcfxo.c | |
146 | --- dahdi-linux-2.2.0.2.ORIG/drivers/dahdi/wcfxo.c 2009-10-22 17:14:40.000000000 +0100 | |
147 | +++ dahdi-linux-2.2.0.2/drivers/dahdi/wcfxo.c 2009-10-22 17:14:49.000000000 +0100 | |
148 | @@ -30,6 +30,7 @@ | |
149 | #include <linux/usb.h> | |
150 | #include <linux/errno.h> | |
151 | #include <linux/pci.h> | |
152 | +#include <linux/sched.h> | |
153 | #include <asm/io.h> | |
154 | #include <linux/moduleparam.h> | |
155 | ||
156 | diff -uNr dahdi-linux-2.2.0.2.ORIG/drivers/dahdi/wct1xxp.c dahdi-linux-2.2.0.2/drivers/dahdi/wct1xxp.c | |
157 | --- dahdi-linux-2.2.0.2.ORIG/drivers/dahdi/wct1xxp.c 2009-10-22 17:14:40.000000000 +0100 | |
158 | +++ dahdi-linux-2.2.0.2/drivers/dahdi/wct1xxp.c 2009-10-22 17:14:49.000000000 +0100 | |
159 | @@ -33,6 +33,7 @@ | |
160 | #include <linux/pci.h> | |
161 | #include <linux/spinlock.h> | |
162 | #include <linux/moduleparam.h> | |
163 | +#include <linux/sched.h> | |
164 | ||
165 | #include <dahdi/kernel.h> | |
166 | ||
167 | diff -uNr dahdi-linux-2.2.0.2.ORIG/drivers/dahdi/wctdm24xxp/base.c dahdi-linux-2.2.0.2/drivers/dahdi/wctdm24xxp/base.c | |
168 | --- dahdi-linux-2.2.0.2.ORIG/drivers/dahdi/wctdm24xxp/base.c 2009-10-22 17:14:40.000000000 +0100 | |
169 | +++ dahdi-linux-2.2.0.2/drivers/dahdi/wctdm24xxp/base.c 2009-10-22 17:14:49.000000000 +0100 | |
170 | @@ -45,6 +45,7 @@ | |
171 | #include <linux/workqueue.h> | |
172 | #include <linux/delay.h> | |
173 | #include <linux/moduleparam.h> | |
174 | +#include <linux/sched.h> | |
175 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) | |
176 | #include <linux/semaphore.h> | |
177 | #else | |
178 | diff -uNr dahdi-linux-2.2.0.2.ORIG/drivers/dahdi/wctdm.c dahdi-linux-2.2.0.2/drivers/dahdi/wctdm.c | |
179 | --- dahdi-linux-2.2.0.2.ORIG/drivers/dahdi/wctdm.c 2009-10-22 17:14:40.000000000 +0100 | |
180 | +++ dahdi-linux-2.2.0.2/drivers/dahdi/wctdm.c 2009-10-22 17:14:49.000000000 +0100 | |
181 | @@ -31,6 +31,8 @@ | |
182 | #include <linux/pci.h> | |
183 | #include <linux/interrupt.h> | |
184 | #include <linux/moduleparam.h> | |
185 | +#include <linux/sched.h> | |
186 | + | |
187 | #include <asm/io.h> | |
188 | #include "proslic.h" | |
189 | ||
190 | diff -uNr dahdi-linux-2.2.0.2.ORIG/drivers/dahdi/wcte11xp.c dahdi-linux-2.2.0.2/drivers/dahdi/wcte11xp.c | |
191 | --- dahdi-linux-2.2.0.2.ORIG/drivers/dahdi/wcte11xp.c 2009-10-22 17:14:40.000000000 +0100 | |
192 | +++ dahdi-linux-2.2.0.2/drivers/dahdi/wcte11xp.c 2009-10-22 17:14:49.000000000 +0100 | |
193 | @@ -32,6 +32,7 @@ | |
194 | #include <linux/pci.h> | |
195 | #include <linux/spinlock.h> | |
196 | #include <linux/moduleparam.h> | |
197 | +#include <linux/sched.h> | |
198 | ||
199 | #include <dahdi/kernel.h> | |
200 | ||
201 | diff -uNr dahdi-linux-2.2.0.2.ORIG/drivers/dahdi/xpp/xbus-core.c dahdi-linux-2.2.0.2/drivers/dahdi/xpp/xbus-core.c | |
202 | --- dahdi-linux-2.2.0.2.ORIG/drivers/dahdi/xpp/xbus-core.c 2009-10-22 17:14:40.000000000 +0100 | |
203 | +++ dahdi-linux-2.2.0.2/drivers/dahdi/xpp/xbus-core.c 2009-10-22 17:16:10.000000000 +0100 | |
204 | @@ -35,6 +35,7 @@ | |
205 | #include <linux/workqueue.h> | |
206 | #include <linux/device.h> | |
207 | #include <linux/delay.h> /* for msleep() to debug */ | |
208 | +#include <linux/sched.h> | |
209 | #include "xpd.h" | |
210 | #include "xpp_dahdi.h" | |
211 | #include "xbus-core.h" | |
212 | --- dahdi-linux-2.2.0.2/drivers/dahdi/wctc4xxp/base.c 2009/08/04 16:30:11 6936 | |
213 | +++ dahdi-linux-2.2.0.2/drivers/dahdi/wctc4xxp/base.c 2009/08/04 16:38:56 6937 | |
214 | @@ -742,6 +742,17 @@ | |
215 | return 0; | |
216 | } | |
217 | ||
218 | +#ifdef HAVE_NET_DEVICE_OPS | |
219 | +static const struct net_device_ops wctc4xxp_netdev_ops = { | |
220 | + .ndo_set_multicast_list = &wctc4xxp_net_set_multi, | |
221 | + .ndo_open = &wctc4xxp_net_up, | |
222 | + .ndo_stop = &wctc4xxp_net_down, | |
223 | + .ndo_start_xmit = &wctc4xxp_net_hard_start_xmit, | |
224 | + .ndo_get_stats = &wctc4xxp_net_get_stats, | |
225 | + .ndo_do_ioctl = &wctc4xxp_net_ioctl, | |
226 | +}; | |
227 | +#endif | |
228 | + | |
229 | /** | |
230 | * wctc4xxp_net_register - Register a new network interface. | |
231 | * @wc: transcoder card to register the interface for. | |
232 | @@ -773,14 +784,21 @@ | |
233 | netdev->priv = wc; | |
234 | # endif | |
235 | memcpy(netdev->dev_addr, our_mac, sizeof(our_mac)); | |
236 | + | |
237 | +# ifdef HAVE_NET_DEVICE_OPS | |
238 | + netdev->netdev_ops = &wctc4xxp_netdev_ops; | |
239 | +# else | |
240 | netdev->set_multicast_list = &wctc4xxp_net_set_multi; | |
241 | netdev->open = &wctc4xxp_net_up; | |
242 | netdev->stop = &wctc4xxp_net_down; | |
243 | netdev->hard_start_xmit = &wctc4xxp_net_hard_start_xmit; | |
244 | netdev->get_stats = &wctc4xxp_net_get_stats; | |
245 | netdev->do_ioctl = &wctc4xxp_net_ioctl; | |
246 | +# endif | |
247 | + | |
248 | netdev->promiscuity = 0; | |
249 | netdev->flags |= IFF_NOARP; | |
250 | + | |
251 | # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) | |
252 | netdev->poll = &wctc4xxp_poll; | |
253 | netdev->weight = 64; | |
254 | diff -uNr dahdi-linux-2.2.0.2.ORIG/Makefile dahdi-linux-2.2.0.2/Makefile | |
255 | --- dahdi-linux-2.2.0.2.ORIG/Makefile 2009-10-22 16:46:00.000000000 +0100 | |
256 | +++ dahdi-linux-2.2.0.2/Makefile 2009-10-22 16:46:27.000000000 +0100 | |
257 | @@ -184,7 +184,7 @@ | |
258 | build_tools/uninstall-modules dahdi $(KVERS) | |
259 | endif | |
260 | $(KMAKE) INSTALL_MOD_PATH=$(DESTDIR) INSTALL_MOD_DIR=dahdi modules_install | |
261 | - [ `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || : | |
262 | +# [ `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || : | |
263 | ||
264 | uninstall-modules: | |
265 | ifdef DESTDIR |