[x86] fix grub installation on target images, regression caused by multi-libc support
[openwrt.git] / target / linux / generic-2.4 / patches / 200-i4l.patch
1 Index: linux-2.4.35.4/Documentation/isdn/CREDITS
2 ===================================================================
3 --- linux-2.4.35.4.orig/Documentation/isdn/CREDITS
4 +++ linux-2.4.35.4/Documentation/isdn/CREDITS
5 @@ -37,7 +37,7 @@ Michael Knigge (knick@cove.han.de)
6 Andreas Kool (akool@Kool.f.EUnet.de)
7 For contribution of the isdnlog/isdnrep-tool
8
9 -Pedro Roque Marques (pedro_m@yahoo.com)
10 +Pedro Roque Marques (roque@di.fc.ul.pt)
11 For lot of new ideas and the pcbit driver.
12
13 Eberhard Moenkeberg (emoenke@gwdg.de)
14 Index: linux-2.4.35.4/Documentation/isdn/HiSax.cert
15 ===================================================================
16 --- linux-2.4.35.4.orig/Documentation/isdn/HiSax.cert
17 +++ linux-2.4.35.4/Documentation/isdn/HiSax.cert
18 @@ -68,6 +68,8 @@ drivers/isdn/hisax/cert.c
19 drivers/isdn/hisax/elsa.c
20 drivers/isdn/hisax/diva.c
21 drivers/isdn/hisax/hfc_pci.c
22 +drivers/isdn/hisax/hfc_usbr.c
23 +drivers/isdn/hisax/hfc_usb.c
24
25 Please send any changes, bugfixes and patches to me rather than implementing
26 them directly into the HiSax sources.
27 Index: linux-2.4.35.4/Documentation/isdn/INTERFACE
28 ===================================================================
29 --- linux-2.4.35.4.orig/Documentation/isdn/INTERFACE
30 +++ linux-2.4.35.4/Documentation/isdn/INTERFACE
31 @@ -1,4 +1,4 @@
32 -$Id: INTERFACE,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
33 +$Id: INTERFACE,v 1.17 2002/01/31 13:26:35 keil Exp $
34
35 Description of the Interface between Linklevel and Hardwarelevel
36 of isdn4linux:
37 @@ -399,7 +399,7 @@ Description of the Interface between Lin
38 protocol-Id is one of the constants ISDN_PROTO_L3...
39 parm.fax = Pointer to T30_s fax struct. (fax usage only)
40
41 - ISDN_CMD_GETL2: (currently unused)
42 + ISDN_CMD_GETL3: (currently unused)
43
44 With this command, the HL-driver is told to return the current
45 setting of the Layer-3-protocol.
46 @@ -781,3 +781,22 @@ Description of the Interface between Lin
47 arg = channel-number, locally to the driver. (starting with 0)
48 parm = unused.
49
50 + ISDN_STAT_ALERT:
51 +
52 + With this call, the HL-driver signals the receive of an ALERTING message to the LL.
53 +
54 + Parameter:
55 + driver = driver-Id
56 + command = ISDN_STAT_ALERT
57 + arg = channel-number, locally to the driver. (starting with 0)
58 +
59 + ISDN_STAT_PROCEED:
60 +
61 + With this call, the HL-driver signals the receive of an CALL PROCEEDING message
62 + to the LL.
63 +
64 + Parameter:
65 + driver = driver-Id
66 + command = ISDN_STAT_PROCEED
67 + arg = channel-number, locally to the driver. (starting with 0)
68 +
69 Index: linux-2.4.35.4/Documentation/isdn/INTERFACE.fax
70 ===================================================================
71 --- linux-2.4.35.4.orig/Documentation/isdn/INTERFACE.fax
72 +++ linux-2.4.35.4/Documentation/isdn/INTERFACE.fax
73 @@ -1,4 +1,4 @@
74 -$Id: INTERFACE.fax,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
75 +$Id: INTERFACE.fax,v 1.2 2000/08/06 09:22:50 armin Exp $
76
77
78 Description of the fax-subinterface between linklevel and hardwarelevel of
79 Index: linux-2.4.35.4/Documentation/isdn/README
80 ===================================================================
81 --- linux-2.4.35.4.orig/Documentation/isdn/README
82 +++ linux-2.4.35.4/Documentation/isdn/README
83 @@ -278,6 +278,12 @@ README for the ISDN-subsystem
84 1 = Add CPN to FCON message on
85 Bit 2: 0 = Add CDN to RING/FCON message off
86 1 = Add CDN to RING/FCON message on
87 + Bit 3: 0 = Do not signal RINGING
88 + 1 = Signal RINGING if ALERT was received
89 + Bit 4: 0 = Do not signal PROCEEDING
90 + 1 = Signal PROCEEDING if CALL PROCEEDING
91 + was received
92 +
93
94 Last but not least a (at the moment fairly primitive) device to request
95 the line-status (/dev/isdninfo) is made available.
96 Index: linux-2.4.35.4/Documentation/isdn/README.HiSax
97 ===================================================================
98 --- linux-2.4.35.4.orig/Documentation/isdn/README.HiSax
99 +++ linux-2.4.35.4/Documentation/isdn/README.HiSax
100 @@ -41,10 +41,9 @@ ELSA Quickstep 3000 (same settings as QS
101 ELSA Quickstep 3000PCI
102 ELSA PCMCIA
103 ITK ix1-micro Rev.2
104 -Eicon Diva 2.0 ISA and PCI (S0 and U interface, no PRO version)
105 -Eicon Diva 2.01 ISA and PCI
106 -Eicon Diva 2.02 PCI
107 -Eicon Diva Piccola
108 +Eicon.Diehl Diva 2.0 ISA and PCI (S0 and U interface, no PRO version)
109 +Eicon.Diehl Diva 2.01 ISA and PCI
110 +Eicon.Diehl Diva Piccola
111 ASUSCOM NETWORK INC. ISDNLink 128K PC adapter (order code I-IN100-ST-D)
112 Dynalink IS64PH (OEM version of ASUSCOM NETWORK INC. ISDNLink 128K adapter)
113 PCBIT-DP (OEM version of ASUSCOM NETWORK INC. ISDNLink)
114 @@ -53,7 +52,6 @@ Sedlbauer Speed Card (Speed Win, Teledat
115 Sedlbauer Speed Star/Speed Star2 (PCMCIA)
116 Sedlbauer ISDN-Controller PC/104
117 USR Sportster internal TA (compatible Stollmann tina-pp V3)
118 -USR internal TA PCI
119 ith Kommunikationstechnik GmbH MIC 16 ISA card
120 Traverse Technologie NETjet PCI S0 card and NETspider U card
121 Ovislink ISDN sc100-p card (NETjet driver)
122 @@ -68,14 +66,14 @@ Gazel ISDN cards
123 HFC-PCI based cards
124 Winbond W6692 based cards
125 HFC-S+, HFC-SP/PCMCIA cards
126 -formula-n enternow
127 -Gerdes Power ISDN
128 +HFC-USB ISDN TAs
129
130 Note: PCF, PCF-Pro: up to now, only the ISDN part is supported
131 PCC-8: not tested yet
132 Eicon.Diehl Diva U interface not tested
133
134 If you know other passive cards with the Siemens chipset, please let me know.
135 +To use the PNP cards you need the isapnptools.
136 You can combine any card, if there is no conflict between the resources
137 (io, mem, irq).
138
139 @@ -91,15 +89,8 @@ There is also some config needed before
140 modules. It is included in the normal "make [menu]config" target at the
141 kernel. Don't forget it, especially to select the right D-channel protocol.
142
143 -Please note: In older versions of the HiSax driver, all PnP cards
144 -needed to be configured with isapnp and worked only with the HiSax
145 -driver used as a module.
146 -
147 -In the current version, HiSax will automatically use the in-kernel
148 -ISAPnP support, provided you selected it during kernel configuration
149 -(CONFIG_ISAPNP), if you don't give the io=, irq= command line parameters.
150 -
151 -The affected card types are: 4,7,12,14,19,27-30
152 +Please note: All PnP cards need to be configured with isapnp and will work
153 +only with the HiSax driver used as a module.
154
155 a) when built as a module
156 -------------------------
157 @@ -200,8 +191,6 @@ Card types:
158 37 HFC 2BDS0 S+, SP irq,io
159 38 NETspider U PCI card none
160 39 HFC 2BDS0 SP/PCMCIA irq,io (set with cardmgr)
161 - 40 hotplug interface
162 - 41 Formula-n enter:now PCI none
163
164 At the moment IRQ sharing is only possible with PCI cards. Please make sure
165 that your IRQ is free and enabled for ISA use.
166 @@ -227,13 +216,6 @@ Examples for module loading
167 (IO 1 (BASE 0x0180))
168 modprobe hisax type=4 protocol=2 irq=10 io0=0x580 io1=0x180
169
170 - In the current version of HiSax, you can instead simply use
171 -
172 - modprobe hisax type=4 protocol=2
173 -
174 - if you configured your kernel for ISAPnP. Don't run isapnp in
175 - this case!
176 -
177 6. Teles 16.3, Euro ISDN, I/O base 280 hex, IRQ 12 and
178 Teles 16.0, 1TR6, IRQ 5, Memory d0000 hex
179 modprobe hisax type=3,1 protocol=2,1 io=0x280 mem=0,0xd0000
180 @@ -314,9 +296,7 @@ type
181 36 W6692 based PCI cards none
182 37 HFC 2BDS0 S+,SP/PCMCIA ONLY WORKS AS A MODULE !
183 38 NETspider U PCI card none
184 - 39 HFC 2BDS0 SP/PCMCIA ONLY WORKS AS A MODULE !
185 - 40 hotplug interface ONLY WORKS AS A MODULE !
186 - 41 Formula-n enter:now PCI none
187 +
188
189 Running the driver
190 ------------------
191 Index: linux-2.4.35.4/Documentation/isdn/README.act2000
192 ===================================================================
193 --- linux-2.4.35.4.orig/Documentation/isdn/README.act2000
194 +++ linux-2.4.35.4/Documentation/isdn/README.act2000
195 @@ -1,4 +1,4 @@
196 -$Id: README.act2000,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
197 +$Id: README.act2000,v 1.3 2000/08/06 09:22:51 armin Exp $
198
199 This document describes the ACT2000 driver for the
200 IBM Active 2000 ISDN card.
201 Index: linux-2.4.35.4/Documentation/isdn/README.audio
202 ===================================================================
203 --- linux-2.4.35.4.orig/Documentation/isdn/README.audio
204 +++ linux-2.4.35.4/Documentation/isdn/README.audio
205 @@ -1,4 +1,4 @@
206 -$Id: README.audio,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
207 +$Id: README.audio,v 1.8 1999/07/11 17:17:29 armin Exp $
208
209 ISDN subsystem for Linux.
210 Description of audio mode.
211 Index: linux-2.4.35.4/Documentation/isdn/README.eicon
212 ===================================================================
213 --- linux-2.4.35.4.orig/Documentation/isdn/README.eicon
214 +++ linux-2.4.35.4/Documentation/isdn/README.eicon
215 @@ -1,4 +1,4 @@
216 -$Id: README.eicon,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
217 +$Id: README.eicon,v 1.10 2000/08/13 12:19:15 armin Exp $
218
219 (c) 1999,2000 Armin Schindler (mac@melware.de)
220 (c) 1999,2000 Cytronics & Melware (info@melware.de)
221 Index: linux-2.4.35.4/Documentation/isdn/README.hysdn
222 ===================================================================
223 --- linux-2.4.35.4.orig/Documentation/isdn/README.hysdn
224 +++ linux-2.4.35.4/Documentation/isdn/README.hysdn
225 @@ -1,4 +1,4 @@
226 -$Id: README.hysdn,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
227 +$Id: README.hysdn,v 1.3.6.1 2001/02/10 14:41:19 kai Exp $
228 The hysdn driver has been written by
229 by Werner Cornelius (werner@isdn4linux.de or werner@titro.de)
230 for Hypercope GmbH Aachen Germany. Hypercope agreed to publish this driver
231 Index: linux-2.4.35.4/Documentation/isdn/README.icn
232 ===================================================================
233 --- linux-2.4.35.4.orig/Documentation/isdn/README.icn
234 +++ linux-2.4.35.4/Documentation/isdn/README.icn
235 @@ -1,4 +1,4 @@
236 -$Id: README.icn,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
237 +$Id: README.icn,v 1.7 2000/08/06 09:22:51 armin Exp $
238
239 You can get the ICN-ISDN-card from:
240
241 Index: linux-2.4.35.4/Documentation/isdn/README.pcbit
242 ===================================================================
243 --- linux-2.4.35.4.orig/Documentation/isdn/README.pcbit
244 +++ linux-2.4.35.4/Documentation/isdn/README.pcbit
245 @@ -37,4 +37,4 @@ mailing list (isdn4linux@listserv.isdn4l
246 regards,
247 Pedro.
248
249 -<pedro_m@yahoo.com>
250 +<roque@di.fc.ul.pt>
251 Index: linux-2.4.35.4/Documentation/isdn/abcext_kernel.help
252 ===================================================================
253 --- /dev/null
254 +++ linux-2.4.35.4/Documentation/isdn/abcext_kernel.help
255 @@ -0,0 +1,166 @@
256 +
257 +ISDN-ABC-DW Extension
258 +CONFIG_ISDN_WITH_ABC
259 + These are many brand new Options and Features for the
260 + ISDN SUBSYSTEM. Including Logical Device bindings,
261 + Compression and other good stuff for Optimizing your
262 + ISDN System.
263 +
264 + To Use this Extensions you MUST HAVE THE NEWEST
265 + ISDN4K-UTILS. You must have Version 3.1-Beta6 or
266 + higher. Elsewhere you can not configure this Extensions.
267 +
268 + WARNING ! THIS STUF IS NOT PRODUCTION RELEASE THE
269 + FUNCTION ARE UNDER DEVELOPMENT. This ist BETA-CODE.
270 + You can use it at you Own Risk.
271 +
272 + For more Information on these Extensions take a look at
273 + "linux/Documentation/isdn/dw-abc-extension-howto.txt or
274 + Online at the Web "http://www.mediatronix.de/i4l/index.html"
275 +
276 + Please Report Bugs to "mario@mediatronix.de" or
277 + "delefw@isdn4linux.de"
278 +
279 +D-Channel-Callback with Channel in use check
280 +CONFIG_ISDN_WITH_ABC_CALLB
281 + When a Interface is declared as an Callback Interface,
282 + the Interface is checking that the other Side is not
283 + Calling on the same time before the Interface is Dialing.
284 +
285 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
286 + for more Information
287 +
288 + In most case answer with "Yes" when you have Callback devices,
289 + otherwise leave it "No"
290 +
291 +Outgoing-EAZ-Support
292 +CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
293 + Enables the Feature to Define an other EAZ or MSN for
294 + Outgoing calls on an Interface.
295 +
296 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
297 + for more Information
298 +
299 +Least Cost Router Support
300 +CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
301 + This is the final Kernel Code for configuring an Least
302 + Cost Router Softwarebased. The other Job is to do the
303 + action in ISDNLOG. You need the ISDNLOG to use this
304 + function. Currently the ISDNLOG have not the Support for
305 + this Option.
306 + So in most situations let the Option off.
307 +
308 +TCP keepalive detect and response
309 +CONFIG_ISDN_WITH_ABC_IPV4_TCP_KEEPALIVE
310 + This Option works only with the TCP/IP V4. It enables
311 + the Function that ISDN Devices are Answering TCP_KEEPALIVE Pakets
312 + localy. So that TCP KEEPALIVE Pakets not longer takes the Line
313 + open.
314 +
315 +Drop frames Sourceadresse is not Interfaceadress
316 +CONFIG_ISDN_WITH_ABC_IPV4_DYNADDR
317 + This Option works only with the TCP/IP V4. It will allow only
318 + the Transmitt of Pakets where the Sourceadresse is the Interface
319 + adress. It is usefull when you have Lines with Dynamic IP.
320 +
321 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
322 + for more Information
323 +
324 +Receive do not reset the Hanguptimer
325 +CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
326 + When you activate this option than the reiceive of pakets do
327 + not reset the Hanguptimer. It is very usefull because if the
328 + Paket vor your Network your Network generate an Response and
329 + the Transmit is reseting the HUPTIMER. But when the Paket is
330 + Rejected at your firewall your network generate no Response
331 + and no Sendtraffic is generated. So in this case there is no
332 + need to Reset the Huptimer because you have only received Data.
333 + With that option only Transmitted Data/Pakets will reset the
334 + HUPTIMER.
335 +
336 +Support of (device-channel) and Binding Groups
337 +CONFIG_ISDN_WITH_ABC_ICALL_BIND
338 + This Option enables the Feature to Bind logical ISDN Interfaces
339 + to an prefered ISDN Card or ISDN Card plus Channel. So you have
340 + the Chance to keep Channels exclusively for one (or more)
341 + Connection. Very usefull when you have more channels and Use
342 + Calling Line Identification, because you can organize that your
343 + call is going out over the Line with the right EAZ for the CLI.
344 +
345 +Skip channel if used external (Dial Only)
346 +CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
347 + When you have more than One ISDN Card in your System and you
348 + will Dialout with an Interface you can become the Situation
349 + that an External Device such a Telephone or Fax is Using the
350 + B-Channels. Normaly ISDN4Linux does not detect this Situation
351 + and dial everytime of the "External Busy" line out. With this
352 + Option Enabled the I4L will detect that he can not dialout on
353 + This Card and dial over the next Card out.
354 +
355 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
356 + for more Information
357 +
358 +Interface autodisable if Config error
359 +CONFIG_ISDN_WITH_ABC_CONN_ERROR
360 + This Option will detect an Device which generate Telephone
361 + Cost but does not Function correctly because there are
362 + Configerrors on one of the Site. In this Situation the
363 + Interface will be marked as Unsuably for some time to do
364 + not call every time this Site.
365 +
366 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
367 + for more Information
368 +
369 +UDP-Info-Support
370 +CONFIG_ISDN_WITH_ABC_UDP_CHECK
371 + This is the Mainoption to Enable or Disable the UDP
372 + Info Support. An Option to Controll ISDN-Interfaces
373 + Remotely. For this very Complex thing take a look at
374 +
375 + "linux/Documentation/isdn/dw-abc-extension-howto.txt"
376 + for more Information.
377 +
378 +UDP Hangup Support
379 +CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP
380 +
381 + Sorry no more Information!
382 +
383 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
384 + for more Information
385 +
386 +UDP Dial Support
387 +CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL
388 +
389 + Sorry no more Information!
390 +
391 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
392 + for more Information
393 +
394 +Limit on the line frames to two
395 +CONFIG_ISDN_WITH_ABC_FRAME_LIMIT
396 +
397 + This Option enables support for sending only 2 Pakets on
398 + the Fly to the ISDN Driver. It is very usefull when you
399 + will use the new RAW-IP Compression. Because of sending
400 + Only 2 Pakets on the Fly makes the risk of overflowing
401 + the ISDN Driver very smaller.
402 +
403 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
404 + for more Information
405 +
406 +Compression with RAWIP and X75I
407 +CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS
408 +
409 + With this Option you have the ability to make Datacompression
410 + on RAW-IP Lines. It is function on HDLC and X75I Connection,
411 + but the Prefered L2-Protocol for Compression is X75I because
412 + the HDLC Protocol have no Errorcorrection.
413 +
414 + To Use this Option YOU MUST HAVE ENABLED THE OPTION:
415 + Support synchronous PPP
416 + and must load after loading the main isdndrivers the
417 + Modul "isdn_bsdcomp".
418 +
419 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
420 + for more Information
421 +
422 Index: linux-2.4.35.4/drivers/isdn/Config.in
423 ===================================================================
424 --- linux-2.4.35.4.orig/drivers/isdn/Config.in
425 +++ linux-2.4.35.4/drivers/isdn/Config.in
426 @@ -4,11 +4,9 @@
427
428 # only included if CONFIG_ISDN != n
429
430 -define_bool CONFIG_ISDN_BOOL y
431 if [ "$CONFIG_INET" != "n" ]; then
432 bool ' Support synchronous PPP' CONFIG_ISDN_PPP
433 if [ "$CONFIG_ISDN_PPP" != "n" ]; then
434 - dep_bool ' PPP filtering for ISDN' CONFIG_IPPP_FILTER $CONFIG_FILTER
435 bool ' Use VJ-compression with synchronous PPP' CONFIG_ISDN_PPP_VJ
436 bool ' Support generic MP (RFC 1717)' CONFIG_ISDN_MPP
437 dep_tristate ' Support BSD compression' CONFIG_ISDN_PPP_BSDCOMP $CONFIG_ISDN
438 @@ -23,6 +21,30 @@ if [ "$CONFIG_X25" != "n" ]; then
439 fi
440
441 mainmenu_option next_comment
442 +comment 'ISDN abc-dw-extension'
443 +bool 'Enable isdn-abc-dw-extension' CONFIG_ISDN_WITH_ABC
444 +if [ "$CONFIG_ISDN_WITH_ABC" != "n" ]; then
445 + bool ' Use D-Channel-Callback with Channel in use check' CONFIG_ISDN_WITH_ABC_CALLB
446 + bool ' Enable Outgoing-EAZ-Support' CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
447 + bool ' Enable LCR-Support (need isdnlog)' CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
448 + bool ' RX dont reset hanguptimeout' CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
449 + if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then
450 + bool ' Enable UDP-Info-Support' CONFIG_ISDN_WITH_ABC_UDP_CHECK
451 + if [ "$CONFIG_ISDN_WITH_ABC_UDP_CHECK" != "n" ]; then
452 + bool ' Enable Hangup-Support with UDP-INFO' CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP
453 + bool ' Enable Dial-Support with UDP-INFO' CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL
454 + fi
455 + fi
456 +
457 + bool ' Skip channel if used external (dial only)' CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
458 + bool ' Support interface-auto-disable if config-error' CONFIG_ISDN_WITH_ABC_CONN_ERROR
459 + if [ "$CONFIG_ISDN_PPP" != "n" ]; then
460 + bool ' Enable Compression with rawip and x75i' CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS
461 + fi
462 +fi
463 +endmenu
464 +
465 +mainmenu_option next_comment
466 comment 'ISDN feature submodules'
467 dep_tristate 'isdnloop support' CONFIG_ISDN_DRV_LOOP $CONFIG_ISDN
468 dep_tristate 'Support isdn diversion services' CONFIG_ISDN_DIVERSION $CONFIG_ISDN
469 @@ -34,7 +56,6 @@ mainmenu_option next_comment
470 comment 'Passive ISDN cards'
471 dep_tristate 'HiSax SiemensChipSet driver support' CONFIG_ISDN_DRV_HISAX $CONFIG_ISDN
472 if [ "$CONFIG_ISDN_DRV_HISAX" != "n" ]; then
473 - define_bool CONFIG_ISDN_HISAX y
474 comment ' D-channel protocol features'
475 bool ' HiSax Support for EURO/DSS1' CONFIG_HISAX_EURO
476 if [ "$CONFIG_HISAX_EURO" != "n" ]; then
477 @@ -45,31 +66,28 @@ if [ "$CONFIG_ISDN_DRV_HISAX" != "n" ];
478 fi
479 bool ' HiSax Support for german 1TR6' CONFIG_HISAX_1TR6
480 bool ' HiSax Support for US NI1' CONFIG_HISAX_NI1
481 - int ' Maximum number of cards supported by HiSax' CONFIG_HISAX_MAX_CARDS 8
482 comment ' HiSax supported cards'
483 - if [ "$CONFIG_ISA" != "n" ]; then
484 - bool ' Teles 16.0/8.0' CONFIG_HISAX_16_0
485 - bool ' Teles 16.3 or PNP or PCMCIA' CONFIG_HISAX_16_3
486 - bool ' AVM A1 (Fritz)' CONFIG_HISAX_AVM_A1
487 - bool ' ITK ix1-micro Revision 2' CONFIG_HISAX_IX1MICROR2
488 - bool ' ASUSCOM ISA cards' CONFIG_HISAX_ASUSCOM
489 - bool ' TELEINT cards' CONFIG_HISAX_TELEINT
490 - bool ' HFC-S based cards' CONFIG_HISAX_HFCS
491 - bool ' USR Sportster internal TA' CONFIG_HISAX_SPORTSTER
492 - bool ' MIC card' CONFIG_HISAX_MIC
493 - bool ' Siemens I-Surf card' CONFIG_HISAX_ISURF
494 - bool ' HST Saphir card' CONFIG_HISAX_HSTSAPHIR
495 - fi
496 + bool ' Teles 16.0/8.0' CONFIG_HISAX_16_0
497 + bool ' Teles 16.3 or PNP or PCMCIA' CONFIG_HISAX_16_3
498 bool ' Teles PCI' CONFIG_HISAX_TELESPCI
499 bool ' Teles S0Box' CONFIG_HISAX_S0BOX
500 + bool ' AVM A1 (Fritz)' CONFIG_HISAX_AVM_A1
501 bool ' AVM PnP/PCI (Fritz!PnP/PCI)' CONFIG_HISAX_FRITZPCI
502 bool ' AVM A1 PCMCIA (Fritz)' CONFIG_HISAX_AVM_A1_PCMCIA
503 bool ' Elsa cards' CONFIG_HISAX_ELSA
504 + bool ' ITK ix1-micro Revision 2' CONFIG_HISAX_IX1MICROR2
505 bool ' Eicon.Diehl Diva cards' CONFIG_HISAX_DIEHLDIVA
506 + bool ' ASUSCOM ISA cards' CONFIG_HISAX_ASUSCOM
507 + bool ' TELEINT cards' CONFIG_HISAX_TELEINT
508 + bool ' HFC-S based cards' CONFIG_HISAX_HFCS
509 bool ' Sedlbauer cards' CONFIG_HISAX_SEDLBAUER
510 + bool ' USR Sportster internal TA' CONFIG_HISAX_SPORTSTER
511 + bool ' MIC card' CONFIG_HISAX_MIC
512 bool ' NETjet card' CONFIG_HISAX_NETJET
513 bool ' NETspider U card' CONFIG_HISAX_NETJET_U
514 bool ' Niccy PnP/PCI card' CONFIG_HISAX_NICCY
515 + bool ' Siemens I-Surf card' CONFIG_HISAX_ISURF
516 + bool ' HST Saphir card' CONFIG_HISAX_HSTSAPHIR
517 bool ' Telekom A4T card' CONFIG_HISAX_BKM_A4T
518 bool ' Scitel Quadro card' CONFIG_HISAX_SCT_QUADRO
519 bool ' Gazel cards' CONFIG_HISAX_GAZEL
520 @@ -78,20 +96,27 @@ if [ "$CONFIG_ISDN_DRV_HISAX" != "n" ];
521 bool ' HFC-S+, HFC-SP, HFC-PCMCIA cards' CONFIG_HISAX_HFC_SX
522 if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then
523 # bool ' TESTEMULATOR (EXPERIMENTAL)' CONFIG_HISAX_TESTEMU
524 - bool ' Formula-n enter:now PCI card' CONFIG_HISAX_ENTERNOW_PCI
525 if [ "$ARCH" = "sparc" -o "$ARCH" = "sparc64" ]; then
526 bool ' Am7930' CONFIG_HISAX_AMD7930
527 fi
528 fi
529 bool ' HiSax debugging' CONFIG_HISAX_DEBUG
530
531 - dep_tristate 'Sedlbauer PCMCIA cards' CONFIG_HISAX_SEDLBAUER_CS $CONFIG_ISDN_DRV_HISAX $CONFIG_PCMCIA
532 - dep_tristate 'ELSA PCMCIA MicroLink cards' CONFIG_HISAX_ELSA_CS $CONFIG_ISDN_DRV_HISAX $CONFIG_PCMCIA
533 - dep_tristate 'AVM A1 PCMCIA cards' CONFIG_HISAX_AVM_A1_CS $CONFIG_ISDN_DRV_HISAX $CONFIG_PCMCIA $CONFIG_HISAX_AVM_A1_PCMCIA
534 - dep_tristate 'ST5481 USB ISDN modem (EXPERIMENTAL)' CONFIG_HISAX_ST5481 $CONFIG_ISDN_DRV_HISAX $CONFIG_EXPERIMENTAL
535 - dep_tristate 'AVM Fritz!Card PCI/PCIv2/PnP support (EXPERIMENTAL)' CONFIG_HISAX_FRITZ_PCIPNP $CONFIG_ISDN_DRV_HISAX $CONFIG_EXPERIMENTAL
536 - dep_tristate 'Auerswald devices ISDN support' CONFIG_USB_AUERISDN $CONFIG_ISDN_DRV_HISAX
537 + dep_tristate 'Sedlbauer PCMCIA cards' CONFIG_HISAX_SEDLBAUER_CS $CONFIG_PCMCIA
538 + dep_tristate 'ELSA PCMCIA MicroLink cards' CONFIG_HISAX_ELSA_CS $CONFIG_PCMCIA
539 + dep_tristate 'Colognechip HFC-USB support' CONFIG_HISAX_HFC_USB_CS $CONFIG_HISAX $CONFIG_USB
540 + dep_tristate 'ST5481 USB ISDN modem (EXPERIMENTAL)' CONFIG_HISAX_ST5481 $CONFIG_HISAX $CONFIG_USB $CONFIG_EXPERIMENTAL
541 + dep_tristate 'Fritz!PCIv2 support (EXPERIMENTAL)' CONFIG_HISAX_FRITZ_PCIPNP $CONFIG_HISAX $CONFIG_EXPERIMENTAL
542
543 + if [ "$CONFIG_HISAX_SEDLBAUER_CS" != "n" ]; then
544 + define_bool CONFIG_HISAX_SEDLBAUER y
545 + fi
546 + if [ "$CONFIG_HISAX_ELSA_CS" != "n" ]; then
547 + define_bool CONFIG_HISAX_ELSA y
548 + fi
549 + if [ "$CONFIG_HISAX_HFC_USB_CS" != "n" ]; then
550 + define_bool CONFIG_HISAX_HFC_USB y
551 + fi
552 fi
553 endmenu
554
555 Index: linux-2.4.35.4/drivers/isdn/Makefile
556 ===================================================================
557 --- linux-2.4.35.4.orig/drivers/isdn/Makefile
558 +++ linux-2.4.35.4/drivers/isdn/Makefile
559 @@ -2,7 +2,7 @@
560
561 # The target object and module list name.
562
563 -O_TARGET := vmlinux-obj.o
564 +O_TARGET := isdn.a
565
566 # Objects that export symbols.
567
568 @@ -32,9 +32,9 @@ obj-$(CONFIG_ISDN_PPP_BSDCOMP) += isdn_
569
570 # Object files in subdirectories
571
572 -mod-subdirs := avmb1 eicon hisax
573 +mod-subdirs := avmb1 eicon
574 subdir-$(CONFIG_ISDN_DIVERSION) += divert
575 -subdir-$(CONFIG_ISDN_HISAX) += hisax
576 +subdir-$(CONFIG_ISDN_DRV_HISAX) += hisax
577 subdir-$(CONFIG_ISDN_DRV_ICN) += icn
578 subdir-$(CONFIG_ISDN_DRV_PCBIT) += pcbit
579 subdir-$(CONFIG_ISDN_DRV_SC) += sc
580 Index: linux-2.4.35.4/drivers/isdn/act2000/act2000.h
581 ===================================================================
582 --- linux-2.4.35.4.orig/drivers/isdn/act2000/act2000.h
583 +++ linux-2.4.35.4/drivers/isdn/act2000/act2000.h
584 @@ -1,4 +1,4 @@
585 -/* $Id: act2000.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
586 +/* $Id$
587 *
588 * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
589 *
590 @@ -178,19 +178,19 @@ typedef struct act2000_card {
591 char regname[35]; /* Name used for request_region */
592 } act2000_card;
593
594 -static inline void act2000_schedule_tx(act2000_card *card)
595 +extern __inline__ void act2000_schedule_tx(act2000_card *card)
596 {
597 queue_task(&card->snd_tq, &tq_immediate);
598 mark_bh(IMMEDIATE_BH);
599 }
600
601 -static inline void act2000_schedule_rx(act2000_card *card)
602 +extern __inline__ void act2000_schedule_rx(act2000_card *card)
603 {
604 queue_task(&card->rcv_tq, &tq_immediate);
605 mark_bh(IMMEDIATE_BH);
606 }
607
608 -static inline void act2000_schedule_poll(act2000_card *card)
609 +extern __inline__ void act2000_schedule_poll(act2000_card *card)
610 {
611 queue_task(&card->poll_tq, &tq_immediate);
612 mark_bh(IMMEDIATE_BH);
613 Index: linux-2.4.35.4/drivers/isdn/act2000/act2000_isa.c
614 ===================================================================
615 --- linux-2.4.35.4.orig/drivers/isdn/act2000/act2000_isa.c
616 +++ linux-2.4.35.4/drivers/isdn/act2000/act2000_isa.c
617 @@ -1,4 +1,4 @@
618 -/* $Id: act2000_isa.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
619 +/* $Id$
620 *
621 * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000 (ISA-Version).
622 *
623 @@ -178,8 +178,7 @@ act2000_isa_config_port(act2000_card * c
624 card->flags &= ~ACT2000_FLAGS_PVALID;
625 }
626 if (!check_region(portbase, ISA_REGION)) {
627 - if (request_region(portbase, ACT2000_PORTLEN, card->regname) == NULL)
628 - return -EIO;
629 + request_region(portbase, ACT2000_PORTLEN, card->regname);
630 card->port = portbase;
631 card->flags |= ACT2000_FLAGS_PVALID;
632 return 0;
633 @@ -341,6 +340,9 @@ act2000_isa_send(act2000_card * card)
634 while (skb->len) {
635 if (act2000_isa_writeb(card, *(skb->data))) {
636 /* Fifo is full, but more data to send */
637 +#if 0
638 + printk(KERN_DEBUG "act2000_isa_send: %d bytes\n", l);
639 +#endif
640 test_and_clear_bit(ACT2000_LOCK_TX, (void *) &card->ilock);
641 /* Schedule myself */
642 act2000_schedule_tx(card);
643 @@ -363,6 +365,9 @@ act2000_isa_send(act2000_card * card)
644 } else
645 dev_kfree_skb(skb);
646 card->sbuf = NULL;
647 +#if 0
648 + printk(KERN_DEBUG "act2000_isa_send: %d bytes\n", l);
649 +#endif
650 }
651 }
652
653 Index: linux-2.4.35.4/drivers/isdn/act2000/act2000_isa.h
654 ===================================================================
655 --- linux-2.4.35.4.orig/drivers/isdn/act2000/act2000_isa.h
656 +++ linux-2.4.35.4/drivers/isdn/act2000/act2000_isa.h
657 @@ -1,4 +1,4 @@
658 -/* $Id: act2000_isa.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
659 +/* $Id$
660 *
661 * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000 (ISA-Version).
662 *
663 Index: linux-2.4.35.4/drivers/isdn/act2000/capi.c
664 ===================================================================
665 --- linux-2.4.35.4.orig/drivers/isdn/act2000/capi.c
666 +++ linux-2.4.35.4/drivers/isdn/act2000/capi.c
667 @@ -1,4 +1,4 @@
668 -/* $Id: capi.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
669 +/* $Id$
670 *
671 * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
672 * CAPI encoder/decoder
673 @@ -76,6 +76,10 @@ static actcapi_msgdsc valid_msg[] = {
674 {{ 0x84, 0x03}, "DISCONNECT_B3_RESP"},
675 {{ 0x86, 0x03}, "DATA_B3_RESP"},
676 {{ 0xff, 0x03}, "MANUFACTURER_RESP"},
677 +#if 0
678 +/* CAPI 2.0 */
679 + {{ 0x05, 0x80}, "LISTEN_REQ (CAPI 2.0)"},
680 +#endif
681 #endif
682 {{ 0x00, 0x00}, NULL},
683 };
684 Index: linux-2.4.35.4/drivers/isdn/act2000/capi.h
685 ===================================================================
686 --- linux-2.4.35.4.orig/drivers/isdn/act2000/capi.h
687 +++ linux-2.4.35.4/drivers/isdn/act2000/capi.h
688 @@ -1,4 +1,4 @@
689 -/* $Id: capi.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
690 +/* $Id$
691 *
692 * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
693 *
694 @@ -294,6 +294,19 @@ typedef struct actcapi_msg {
695 __u16 plci;
696 __u16 info;
697 } select_b3_protocol_conf;
698 +#if 0
699 + struct listen_req {
700 + __u32 controller;
701 + __u32 infomask;
702 + __u32 cipmask;
703 + __u32 cipmask2;
704 + __u16 dummy; /* 2 Length-bytes of 2 Structs MUST always be 0!!! */
705 + } listen_req;
706 + struct listen_conf {
707 + __u32 controller;
708 + __u16 info;
709 + } listen_conf;
710 +#else
711 struct listen_req {
712 __u8 controller;
713 __u32 infomask __attribute__ ((packed));
714 @@ -304,6 +317,7 @@ typedef struct actcapi_msg {
715 __u8 controller;
716 __u16 info __attribute__ ((packed));
717 } listen_conf;
718 +#endif
719 struct data_b3_req {
720 __u16 fakencci;
721 __u16 datalen;
722 @@ -330,7 +344,7 @@ typedef struct actcapi_msg {
723 } msg;
724 } actcapi_msg;
725
726 -static inline unsigned short
727 +extern __inline__ unsigned short
728 actcapi_nextsmsg(act2000_card *card)
729 {
730 unsigned long flags;
731 Index: linux-2.4.35.4/drivers/isdn/act2000/module.c
732 ===================================================================
733 --- linux-2.4.35.4.orig/drivers/isdn/act2000/module.c
734 +++ linux-2.4.35.4/drivers/isdn/act2000/module.c
735 @@ -1,4 +1,4 @@
736 -/* $Id: module.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
737 +/* $Id$
738 *
739 * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
740 *
741 @@ -630,6 +630,10 @@ act2000_alloccard(int bus, int port, int
742 card->interface.features =
743 ISDN_FEATURE_L2_X75I |
744 ISDN_FEATURE_L2_HDLC |
745 +#if 0
746 +/* Not yet! New Firmware is on the way ... */
747 + ISDN_FEATURE_L2_TRANS |
748 +#endif
749 ISDN_FEATURE_L3_TRANS |
750 ISDN_FEATURE_P_UNKNOWN;
751 card->interface.hl_hdrlen = 20;
752 @@ -843,6 +847,39 @@ static void __exit act2000_exit(void)
753 }
754 printk(KERN_INFO "%s unloaded\n", DRIVERNAME);
755 }
756 +#if 0
757 +#ifndef MODULE
758 +void
759 +act2000_setup(char *str, int *ints)
760 +{
761 + int i, j, argc, port, irq, bus;
762 +
763 + argc = ints[0];
764 + i = 1;
765 + if (argc)
766 + while (argc) {
767 + port = irq = -1;
768 + bus = 0;
769 + if (argc) {
770 + bus = ints[i];
771 + i++;
772 + argc--;
773 + }
774 + if (argc) {
775 + port = ints[i];
776 + i++;
777 + argc--;
778 + }
779 + if (argc) {
780 + irq = ints[i];
781 + i++;
782 + argc--;
783 + }
784 + act2000_addcard(bus, port, irq, act_id);
785 + }
786 +}
787 +#endif
788 +#endif
789
790 module_init(act2000_init);
791 module_exit(act2000_exit);
792 Index: linux-2.4.35.4/drivers/isdn/avmb1/avm_cs.c
793 ===================================================================
794 --- linux-2.4.35.4.orig/drivers/isdn/avmb1/avm_cs.c
795 +++ linux-2.4.35.4/drivers/isdn/avmb1/avm_cs.c
796 @@ -1,4 +1,4 @@
797 -/* $Id: avm_cs.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
798 +/* $Id: avm_cs.c,v 1.6 2001/09/24 13:22:44 kai Exp $
799 *
800 * A PCMCIA client driver for AVM B1/M1/M2
801 *
802 Index: linux-2.4.35.4/drivers/isdn/avmb1/avmcard.h
803 ===================================================================
804 --- linux-2.4.35.4.orig/drivers/isdn/avmb1/avmcard.h
805 +++ linux-2.4.35.4/drivers/isdn/avmb1/avmcard.h
806 @@ -1,4 +1,4 @@
807 -/* $Id: avmcard.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
808 +/* $Id: avmcard.h,v 1.12 2001/09/24 13:22:44 kai Exp $
809 *
810 * Copyright 1999 by Carsten Paeth <calle@calle.de>
811 *
812 Index: linux-2.4.35.4/drivers/isdn/avmb1/b1.c
813 ===================================================================
814 --- linux-2.4.35.4.orig/drivers/isdn/avmb1/b1.c
815 +++ linux-2.4.35.4/drivers/isdn/avmb1/b1.c
816 @@ -1,4 +1,4 @@
817 -/* $Id: b1.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
818 +/* $Id: b1.c,v 1.26 2001/09/24 13:22:44 kai Exp $
819 *
820 * Common module for AVM B1 cards.
821 *
822 @@ -20,6 +20,7 @@
823 #include <linux/kernelcapi.h>
824 #include <asm/io.h>
825 #include <linux/init.h>
826 +#include <linux/isdn_compat.h>
827 #include <asm/uaccess.h>
828 #include <linux/netdevice.h>
829 #include "capilli.h"
830 @@ -27,7 +28,7 @@
831 #include "capicmd.h"
832 #include "capiutil.h"
833
834 -static char *revision = "$Revision: 1.1.4.1 $";
835 +static char *revision = "$Revision: 1.26 $";
836
837 /* ------------------------------------------------------------- */
838
839 Index: linux-2.4.35.4/drivers/isdn/avmb1/b1dma.c
840 ===================================================================
841 --- linux-2.4.35.4.orig/drivers/isdn/avmb1/b1dma.c
842 +++ linux-2.4.35.4/drivers/isdn/avmb1/b1dma.c
843 @@ -1,4 +1,4 @@
844 -/* $Id: b1dma.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
845 +/* $Id: b1dma.c,v 1.18 2001/09/24 13:22:44 kai Exp $
846 *
847 * Common module for AVM B1 cards that support dma with AMCC
848 *
849 @@ -21,6 +21,7 @@
850 #include <linux/kernelcapi.h>
851 #include <asm/io.h>
852 #include <linux/init.h>
853 +#include <linux/isdn_compat.h>
854 #include <asm/uaccess.h>
855 #include <linux/netdevice.h>
856 #include "capilli.h"
857 @@ -28,7 +29,11 @@
858 #include "capicmd.h"
859 #include "capiutil.h"
860
861 -static char *revision = "$Revision: 1.1.4.1 $";
862 +#if BITS_PER_LONG != 32
863 +#error FIXME: driver requires 32-bit platform
864 +#endif
865 +
866 +static char *revision = "$Revision: 1.18 $";
867
868 /* ------------------------------------------------------------- */
869
870 @@ -851,7 +856,7 @@ int b1dmactl_read_proc(char *page, char
871 __u8 flag;
872 int len = 0;
873 char *s;
874 - u_long txaddr, txlen, rxaddr, rxlen, csr;
875 + __u32 txaddr, txlen, rxaddr, rxlen, csr;
876
877 len += sprintf(page+len, "%-16s %s\n", "name", card->name);
878 len += sprintf(page+len, "%-16s 0x%x\n", "io", card->port);
879 @@ -907,12 +912,12 @@ int b1dmactl_read_proc(char *page, char
880 save_flags(flags);
881 cli();
882
883 - txaddr = (u_long)phys_to_virt(b1dmainmeml(card->mbase+0x2c));
884 - txaddr -= (u_long)card->dma->sendbuf;
885 + txaddr = (__u32)phys_to_virt(b1dmainmeml(card->mbase+0x2c));
886 + txaddr -= (__u32)card->dma->sendbuf;
887 txlen = b1dmainmeml(card->mbase+0x30);
888
889 - rxaddr = (u_long)phys_to_virt(b1dmainmeml(card->mbase+0x24));
890 - rxaddr -= (u_long)card->dma->recvbuf;
891 + rxaddr = (__u32)phys_to_virt(b1dmainmeml(card->mbase+0x24));
892 + rxaddr -= (__u32)card->dma->recvbuf;
893 rxlen = b1dmainmeml(card->mbase+0x28);
894
895 csr = b1dmainmeml(card->mbase+AMCC_INTCSR);
896 Index: linux-2.4.35.4/drivers/isdn/avmb1/b1isa.c
897 ===================================================================
898 --- linux-2.4.35.4.orig/drivers/isdn/avmb1/b1isa.c
899 +++ linux-2.4.35.4/drivers/isdn/avmb1/b1isa.c
900 @@ -1,4 +1,4 @@
901 -/* $Id: b1isa.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
902 +/* $Id: b1isa.c,v 1.14 2001/09/24 13:22:44 kai Exp $
903 *
904 * Module for AVM B1 ISA-card.
905 *
906 @@ -19,12 +19,13 @@
907 #include <linux/capi.h>
908 #include <linux/init.h>
909 #include <asm/io.h>
910 +#include <linux/isdn_compat.h>
911 #include "capicmd.h"
912 #include "capiutil.h"
913 #include "capilli.h"
914 #include "avmcard.h"
915
916 -static char *revision = "$Revision: 1.1.4.1 $";
917 +static char *revision = "$Revision: 1.14 $";
918
919 /* ------------------------------------------------------------- */
920
921 Index: linux-2.4.35.4/drivers/isdn/avmb1/b1pci.c
922 ===================================================================
923 --- linux-2.4.35.4.orig/drivers/isdn/avmb1/b1pci.c
924 +++ linux-2.4.35.4/drivers/isdn/avmb1/b1pci.c
925 @@ -1,4 +1,4 @@
926 -/* $Id: b1pci.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
927 +/* $Id: b1pci.c,v 1.40 2001/09/24 13:22:44 kai Exp $
928 *
929 * Module for AVM B1 PCI-card.
930 *
931 @@ -21,21 +21,24 @@
932 #include <linux/capi.h>
933 #include <asm/io.h>
934 #include <linux/init.h>
935 +#include <linux/isdn_compat.h>
936 #include "capicmd.h"
937 #include "capiutil.h"
938 #include "capilli.h"
939 #include "avmcard.h"
940
941 -static char *revision = "$Revision: 1.1.4.1 $";
942 +static char *revision = "$Revision: 1.40 $";
943
944 /* ------------------------------------------------------------- */
945
946 +#ifndef COMPAT_HAS_2_2_PCI
947 static struct pci_device_id b1pci_pci_tbl[] __initdata = {
948 { PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_B1, PCI_ANY_ID, PCI_ANY_ID },
949 { } /* Terminating entry */
950 };
951
952 MODULE_DEVICE_TABLE(pci, b1pci_pci_tbl);
953 +#endif
954 MODULE_DESCRIPTION("CAPI4Linux: Driver for AVM B1 PCI card");
955 MODULE_AUTHOR("Carsten Paeth");
956 MODULE_LICENSE("GPL");
957 @@ -416,14 +419,14 @@ static int add_card(struct pci_dev *dev)
958 }
959 param.irq = dev->irq;
960
961 - if (pci_resource_start(dev, 2)) { /* B1 PCI V4 */
962 + if (pci_resource_start_io(dev, 2)) { /* B1 PCI V4 */
963 #ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4
964 driver = &b1pciv4_driver;
965
966 pci_set_master(dev);
967 #endif
968 - param.membase = pci_resource_start(dev, 0);
969 - param.port = pci_resource_start(dev, 2);
970 + param.membase = pci_resource_start_mem(dev, 0);
971 + param.port = pci_resource_start_io(dev, 2);
972
973 printk(KERN_INFO
974 "%s: PCI BIOS reports AVM-B1 V4 at i/o %#x, irq %d, mem %#x\n",
975 @@ -440,7 +443,7 @@ static int add_card(struct pci_dev *dev)
976 }
977 } else {
978 param.membase = 0;
979 - param.port = pci_resource_start(dev, 1);
980 + param.port = pci_resource_start_io(dev, 1);
981
982 printk(KERN_INFO
983 "%s: PCI BIOS reports AVM-B1 at i/o %#x, irq %d\n",
984 Index: linux-2.4.35.4/drivers/isdn/avmb1/b1pcmcia.c
985 ===================================================================
986 --- linux-2.4.35.4.orig/drivers/isdn/avmb1/b1pcmcia.c
987 +++ linux-2.4.35.4/drivers/isdn/avmb1/b1pcmcia.c
988 @@ -1,4 +1,4 @@
989 -/* $Id: b1pcmcia.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
990 +/* $Id: b1pcmcia.c,v 1.17 2001/09/24 13:22:44 kai Exp $
991 *
992 * Module for AVM B1/M1/M2 PCMCIA-card.
993 *
994 @@ -25,7 +25,7 @@
995 #include "capilli.h"
996 #include "avmcard.h"
997
998 -static char *revision = "$Revision: 1.1.4.1 $";
999 +static char *revision = "$Revision: 1.17 $";
1000
1001 /* ------------------------------------------------------------- */
1002
1003 Index: linux-2.4.35.4/drivers/isdn/avmb1/c4.c
1004 ===================================================================
1005 --- linux-2.4.35.4.orig/drivers/isdn/avmb1/c4.c
1006 +++ linux-2.4.35.4/drivers/isdn/avmb1/c4.c
1007 @@ -1,4 +1,4 @@
1008 -/* $Id: c4.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
1009 +/* $Id: c4.c,v 1.38 2001/09/24 13:22:44 kai Exp $
1010 *
1011 * Module for AVM C4 & C2 card.
1012 *
1013 @@ -18,6 +18,7 @@
1014 #include <linux/interrupt.h>
1015 #include <linux/ioport.h>
1016 #include <linux/pci.h>
1017 +#include <linux/isdn_compat.h>
1018 #include <linux/capi.h>
1019 #include <linux/kernelcapi.h>
1020 #include <linux/init.h>
1021 @@ -30,7 +31,7 @@
1022 #include "capilli.h"
1023 #include "avmcard.h"
1024
1025 -static char *revision = "$Revision: 1.1.4.1 $";
1026 +static char *revision = "$Revision: 1.38 $";
1027
1028 #undef CONFIG_C4_DEBUG
1029 #undef CONFIG_C4_POLLDEBUG
1030 @@ -39,6 +40,7 @@ static char *revision = "$Revision: 1.1.
1031
1032 static int suppress_pollack;
1033
1034 +#ifndef COMPAT_HAS_2_2_PCI
1035 static struct pci_device_id c4_pci_tbl[] __initdata = {
1036 { PCI_VENDOR_ID_DEC,PCI_DEVICE_ID_DEC_21285, PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_C4 },
1037 { PCI_VENDOR_ID_DEC,PCI_DEVICE_ID_DEC_21285, PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_C2 },
1038 @@ -46,6 +48,7 @@ static struct pci_device_id c4_pci_tbl[]
1039 };
1040
1041 MODULE_DEVICE_TABLE(pci, c4_pci_tbl);
1042 +#endif
1043 MODULE_DESCRIPTION("CAPI4Linux: Driver for AVM C2/C4 cards");
1044 MODULE_AUTHOR("Carsten Paeth");
1045 MODULE_LICENSE("GPL");
1046 @@ -1332,9 +1335,9 @@ static int __init search_cards(struct ca
1047 }
1048 pci_set_master(dev);
1049
1050 - param.port = pci_resource_start(dev, 1);
1051 + param.port = pci_resource_start_io(dev, 1);
1052 param.irq = dev->irq;
1053 - param.membase = pci_resource_start(dev, 0);
1054 + param.membase = pci_resource_start_mem(dev, 0);
1055
1056 printk(KERN_INFO
1057 "%s: PCI BIOS reports AVM-C%d at i/o %#x, irq %d, mem %#x\n",
1058 Index: linux-2.4.35.4/drivers/isdn/avmb1/capi.c
1059 ===================================================================
1060 --- linux-2.4.35.4.orig/drivers/isdn/avmb1/capi.c
1061 +++ linux-2.4.35.4/drivers/isdn/avmb1/capi.c
1062 @@ -1,4 +1,4 @@
1063 -/* $Id: capi.c,v 1.1.4.2 2001/12/09 18:45:13 kai Exp $
1064 +/* $Id: capi.c,v 1.59 2001/11/07 22:35:48 kai Exp $
1065 *
1066 * CAPI 2.0 Interface for Linux
1067 *
1068 @@ -23,6 +23,7 @@
1069 #include <linux/smp_lock.h>
1070 #include <linux/timer.h>
1071 #include <linux/wait.h>
1072 +#include <linux/isdn_compat.h>
1073 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1074 #include <linux/tty.h>
1075 #ifdef CONFIG_PPP
1076 @@ -30,6 +31,9 @@
1077 #include <linux/ppp_defs.h>
1078 #include <linux/if_ppp.h>
1079 #undef CAPI_PPP_ON_RAW_DEVICE
1080 +#ifdef CAPI_PPP_ON_RAW_DEVICE
1081 +#include <linux/ppp_channel.h>
1082 +#endif /* CAPI_PPP_ON_RAW_DEVICE */
1083 #endif /* CONFIG_PPP */
1084 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1085 #include <linux/skbuff.h>
1086 @@ -38,14 +42,16 @@
1087 #include <linux/capi.h>
1088 #include <linux/kernelcapi.h>
1089 #include <linux/init.h>
1090 +#ifdef HAVE_DEVFS_FS
1091 #include <linux/devfs_fs_kernel.h>
1092 +#endif /* HAVE_DEVFS_FS */
1093 #include "capiutil.h"
1094 #include "capicmd.h"
1095 #if defined(CONFIG_ISDN_CAPI_CAPIFS) || defined(CONFIG_ISDN_CAPI_CAPIFS_MODULE)
1096 #include "capifs.h"
1097 #endif
1098
1099 -static char *revision = "$Revision: 1.1.4.2 $";
1100 +static char *revision = "$Revision: 1.59 $";
1101
1102 MODULE_DESCRIPTION("CAPI4Linux: Userspace /dev/capi20 interface");
1103 MODULE_AUTHOR("Carsten Paeth");
1104 @@ -87,10 +93,10 @@ struct capiminor {
1105 struct capincci *nccip;
1106 unsigned int minor;
1107
1108 - u16 applid;
1109 - u32 ncci;
1110 - u16 datahandle;
1111 - u16 msgid;
1112 + __u16 applid;
1113 + __u32 ncci;
1114 + __u16 datahandle;
1115 + __u16 msgid;
1116
1117 struct file *file;
1118 struct tty_struct *tty;
1119 @@ -112,16 +118,22 @@ struct capiminor {
1120 /* transmit path */
1121 struct datahandle_queue {
1122 struct datahandle_queue *next;
1123 - u16 datahandle;
1124 + __u16 datahandle;
1125 } *ackqueue;
1126 int nack;
1127
1128 +#ifdef CAPI_PPP_ON_RAW_DEVICE
1129 + /* interface to generic ppp layer */
1130 + struct ppp_channel chan;
1131 + int chan_connected;
1132 + int chan_index;
1133 +#endif
1134 };
1135 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1136
1137 struct capincci {
1138 struct capincci *next;
1139 - u32 ncci;
1140 + __u32 ncci;
1141 struct capidev *cdev;
1142 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1143 struct capiminor *minorp;
1144 @@ -131,8 +143,8 @@ struct capincci {
1145 struct capidev {
1146 struct capidev *next;
1147 struct file *file;
1148 - u16 applid;
1149 - u16 errcode;
1150 + __u16 applid;
1151 + __u16 errcode;
1152 unsigned int minor;
1153 unsigned userflags;
1154
1155 @@ -156,22 +168,28 @@ static struct capidev *capidev_openlist
1156 static struct capiminor *minors = 0;
1157 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1158
1159 +#ifdef COMPAT_HAS_kmem_cache
1160 static kmem_cache_t *capidev_cachep = 0;
1161 static kmem_cache_t *capincci_cachep = 0;
1162 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1163 static kmem_cache_t *capiminor_cachep = 0;
1164 static kmem_cache_t *capidh_cachep = 0;
1165 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1166 +#endif
1167
1168 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1169 /* -------- datahandles --------------------------------------------- */
1170
1171 -static int capincci_add_ack(struct capiminor *mp, u16 datahandle)
1172 +int capincci_add_ack(struct capiminor *mp, __u16 datahandle)
1173 {
1174 struct datahandle_queue *n, **pp;
1175
1176 n = (struct datahandle_queue *)
1177 +#ifdef COMPAT_HAS_kmem_cache
1178 kmem_cache_alloc(capidh_cachep, GFP_ATOMIC);
1179 +#else
1180 + kmalloc(sizeof(struct datahandle_queue), GFP_ATOMIC);
1181 +#endif
1182 if (!n) {
1183 printk(KERN_ERR "capi: alloc datahandle failed\n");
1184 return -1;
1185 @@ -184,7 +202,7 @@ static int capincci_add_ack(struct capim
1186 return 0;
1187 }
1188
1189 -static int capiminor_del_ack(struct capiminor *mp, u16 datahandle)
1190 +int capiminor_del_ack(struct capiminor *mp, __u16 datahandle)
1191 {
1192 struct datahandle_queue **pp, *p;
1193
1194 @@ -192,7 +210,11 @@ static int capiminor_del_ack(struct capi
1195 if ((*pp)->datahandle == datahandle) {
1196 p = *pp;
1197 *pp = (*pp)->next;
1198 +#ifdef COMPAT_HAS_kmem_cache
1199 kmem_cache_free(capidh_cachep, p);
1200 +#else
1201 + kfree(p);
1202 +#endif
1203 mp->nack--;
1204 return 0;
1205 }
1206 @@ -200,7 +222,7 @@ static int capiminor_del_ack(struct capi
1207 return -1;
1208 }
1209
1210 -static void capiminor_del_all_ack(struct capiminor *mp)
1211 +void capiminor_del_all_ack(struct capiminor *mp)
1212 {
1213 struct datahandle_queue **pp, *p;
1214
1215 @@ -208,7 +230,11 @@ static void capiminor_del_all_ack(struct
1216 while (*pp) {
1217 p = *pp;
1218 *pp = (*pp)->next;
1219 +#ifdef COMPAT_HAS_kmem_cache
1220 kmem_cache_free(capidh_cachep, p);
1221 +#else
1222 + kfree(p);
1223 +#endif
1224 mp->nack--;
1225 }
1226 }
1227 @@ -216,13 +242,17 @@ static void capiminor_del_all_ack(struct
1228
1229 /* -------- struct capiminor ---------------------------------------- */
1230
1231 -static struct capiminor *capiminor_alloc(u16 applid, u32 ncci)
1232 +struct capiminor *capiminor_alloc(__u16 applid, __u32 ncci)
1233 {
1234 struct capiminor *mp, **pp;
1235 unsigned int minor = 0;
1236
1237 MOD_INC_USE_COUNT;
1238 +#ifdef COMPAT_HAS_kmem_cache
1239 mp = (struct capiminor *)kmem_cache_alloc(capiminor_cachep, GFP_ATOMIC);
1240 +#else
1241 + mp = (struct capiminor *)kmalloc(sizeof(struct capiminor), GFP_ATOMIC);
1242 +#endif
1243 if (!mp) {
1244 MOD_DEC_USE_COUNT;
1245 printk(KERN_ERR "capi: can't alloc capiminor\n");
1246 @@ -257,7 +287,7 @@ static struct capiminor *capiminor_alloc
1247 return mp;
1248 }
1249
1250 -static void capiminor_free(struct capiminor *mp)
1251 +void capiminor_free(struct capiminor *mp)
1252 {
1253 struct capiminor **pp;
1254
1255 @@ -271,7 +301,11 @@ static void capiminor_free(struct capimi
1256 skb_queue_purge(&mp->inqueue);
1257 skb_queue_purge(&mp->outqueue);
1258 capiminor_del_all_ack(mp);
1259 +#ifdef COMPAT_HAS_kmem_cache
1260 kmem_cache_free(capiminor_cachep, mp);
1261 +#else
1262 + kfree(mp);
1263 +#endif
1264 MOD_DEC_USE_COUNT;
1265 #ifdef _DEBUG_REFCOUNT
1266 printk(KERN_DEBUG "capiminor_free %d\n", GET_USE_COUNT(THIS_MODULE));
1267 @@ -283,7 +317,7 @@ static void capiminor_free(struct capimi
1268 }
1269 }
1270
1271 -static struct capiminor *capiminor_find(unsigned int minor)
1272 +struct capiminor *capiminor_find(unsigned int minor)
1273 {
1274 struct capiminor *p;
1275 for (p = minors; p && p->minor != minor; p = p->next)
1276 @@ -294,7 +328,7 @@ static struct capiminor *capiminor_find(
1277
1278 /* -------- struct capincci ----------------------------------------- */
1279
1280 -static struct capincci *capincci_alloc(struct capidev *cdev, u32 ncci)
1281 +static struct capincci *capincci_alloc(struct capidev *cdev, __u32 ncci)
1282 {
1283 struct capincci *np, **pp;
1284 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1285 @@ -302,7 +336,11 @@ static struct capincci *capincci_alloc(s
1286 kdev_t kdev;
1287 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1288
1289 +#ifdef COMPAT_HAS_kmem_cache
1290 np = (struct capincci *)kmem_cache_alloc(capincci_cachep, GFP_ATOMIC);
1291 +#else
1292 + np = (struct capincci *)kmalloc(sizeof(struct capincci), GFP_ATOMIC);
1293 +#endif
1294 if (!np)
1295 return 0;
1296 memset(np, 0, sizeof(struct capincci));
1297 @@ -331,7 +369,7 @@ static struct capincci *capincci_alloc(s
1298 return np;
1299 }
1300
1301 -static void capincci_free(struct capidev *cdev, u32 ncci)
1302 +static void capincci_free(struct capidev *cdev, __u32 ncci)
1303 {
1304 struct capincci *np, **pp;
1305 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1306 @@ -367,7 +405,11 @@ static void capincci_free(struct capidev
1307 }
1308 }
1309 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1310 +#ifdef COMPAT_HAS_kmem_cache
1311 kmem_cache_free(capincci_cachep, np);
1312 +#else
1313 + kfree(np);
1314 +#endif
1315 if (*pp == 0) return;
1316 } else {
1317 pp = &(*pp)->next;
1318 @@ -375,7 +417,7 @@ static void capincci_free(struct capidev
1319 }
1320 }
1321
1322 -static struct capincci *capincci_find(struct capidev *cdev, u32 ncci)
1323 +struct capincci *capincci_find(struct capidev *cdev, __u32 ncci)
1324 {
1325 struct capincci *p;
1326
1327 @@ -393,7 +435,11 @@ static struct capidev *capidev_alloc(str
1328 struct capidev *cdev;
1329 struct capidev **pp;
1330
1331 +#ifdef COMPAT_HAS_kmem_cache
1332 cdev = (struct capidev *)kmem_cache_alloc(capidev_cachep, GFP_KERNEL);
1333 +#else
1334 + cdev = (struct capidev *)kmalloc(sizeof(struct capidev), GFP_KERNEL);
1335 +#endif
1336 if (!cdev)
1337 return 0;
1338 memset(cdev, 0, sizeof(struct capidev));
1339 @@ -423,10 +469,14 @@ static void capidev_free(struct capidev
1340 if (*pp)
1341 *pp = cdev->next;
1342
1343 +#ifdef COMPAT_HAS_kmem_cache
1344 kmem_cache_free(capidev_cachep, cdev);
1345 +#else
1346 + kfree(cdev);
1347 +#endif
1348 }
1349
1350 -static struct capidev *capidev_find(u16 applid)
1351 +static struct capidev *capidev_find(__u16 applid)
1352 {
1353 struct capidev *p;
1354 for (p=capidev_openlist; p; p = p->next) {
1355 @@ -439,13 +489,13 @@ static struct capidev *capidev_find(u16
1356 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1357 /* -------- handle data queue --------------------------------------- */
1358
1359 -static struct sk_buff *
1360 +struct sk_buff *
1361 gen_data_b3_resp_for(struct capiminor *mp, struct sk_buff *skb)
1362 {
1363 struct sk_buff *nskb;
1364 nskb = alloc_skb(CAPI_DATA_B3_RESP_LEN, GFP_ATOMIC);
1365 if (nskb) {
1366 - u16 datahandle = CAPIMSG_U16(skb->data,CAPIMSG_BASELEN+4+4+2);
1367 + __u16 datahandle = CAPIMSG_U16(skb->data,CAPIMSG_BASELEN+4+4+2);
1368 unsigned char *s = skb_put(nskb, CAPI_DATA_B3_RESP_LEN);
1369 capimsg_setu16(s, 0, CAPI_DATA_B3_RESP_LEN);
1370 capimsg_setu16(s, 2, mp->applid);
1371 @@ -458,11 +508,11 @@ gen_data_b3_resp_for(struct capiminor *m
1372 return nskb;
1373 }
1374
1375 -static int handle_recv_skb(struct capiminor *mp, struct sk_buff *skb)
1376 +int handle_recv_skb(struct capiminor *mp, struct sk_buff *skb)
1377 {
1378 struct sk_buff *nskb;
1379 unsigned int datalen;
1380 - u16 errcode, datahandle;
1381 + __u16 errcode, datahandle;
1382
1383 datalen = skb->len - CAPIMSG_LEN(skb->data);
1384 if (mp->tty) {
1385 @@ -504,6 +554,28 @@ static int handle_recv_skb(struct capimi
1386 kfree_skb(skb);
1387 return 0;
1388
1389 +#ifdef CAPI_PPP_ON_RAW_DEVICE
1390 + } else if (mp->chan_connected) {
1391 + if ((nskb = gen_data_b3_resp_for(mp, skb)) == 0) {
1392 + printk(KERN_ERR "capi: gen_data_b3_resp failed\n");
1393 + return -1;
1394 + }
1395 + datahandle = CAPIMSG_U16(skb->data,CAPIMSG_BASELEN+4);
1396 + errcode = (*capifuncs->capi_put_message)(mp->applid, nskb);
1397 + if (errcode != CAPI_NOERROR) {
1398 + printk(KERN_ERR "capi: send DATA_B3_RESP failed=%x\n",
1399 + errcode);
1400 + kfree_skb(nskb);
1401 + return -1;
1402 + }
1403 + (void)skb_pull(skb, CAPIMSG_LEN(skb->data));
1404 +#ifdef _DEBUG_DATAFLOW
1405 + printk(KERN_DEBUG "capi: DATA_B3_RESP %u len=%d => ppp\n",
1406 + datahandle, skb->len);
1407 +#endif
1408 + ppp_input(&mp->chan, skb);
1409 + return 0;
1410 +#endif
1411 } else if (mp->file) {
1412 if (skb_queue_len(&mp->recvqueue) > CAPINC_MAX_RECVQUEUE) {
1413 #if defined(_DEBUG_DATAFLOW) || defined(_DEBUG_TTYFUNCS)
1414 @@ -538,7 +610,7 @@ static int handle_recv_skb(struct capimi
1415 return -1;
1416 }
1417
1418 -static void handle_minor_recv(struct capiminor *mp)
1419 +void handle_minor_recv(struct capiminor *mp)
1420 {
1421 struct sk_buff *skb;
1422 while ((skb = skb_dequeue(&mp->inqueue)) != 0) {
1423 @@ -552,13 +624,13 @@ static void handle_minor_recv(struct cap
1424 }
1425 }
1426
1427 -static int handle_minor_send(struct capiminor *mp)
1428 +int handle_minor_send(struct capiminor *mp)
1429 {
1430 struct sk_buff *skb;
1431 - u16 len;
1432 + __u16 len;
1433 int count = 0;
1434 - u16 errcode;
1435 - u16 datahandle;
1436 + __u16 errcode;
1437 + __u16 datahandle;
1438
1439 if (mp->tty && mp->ttyoutstop) {
1440 #if defined(_DEBUG_DATAFLOW) || defined(_DEBUG_TTYFUNCS)
1441 @@ -569,7 +641,7 @@ static int handle_minor_send(struct capi
1442
1443 while ((skb = skb_dequeue(&mp->outqueue)) != 0) {
1444 datahandle = mp->datahandle;
1445 - len = (u16)skb->len;
1446 + len = (__u16)skb->len;
1447 skb_push(skb, CAPI_DATA_B3_REQ_LEN);
1448 memset(skb->data, 0, CAPI_DATA_B3_REQ_LEN);
1449 capimsg_setu16(skb->data, 0, CAPI_DATA_B3_REQ_LEN);
1450 @@ -578,7 +650,7 @@ static int handle_minor_send(struct capi
1451 capimsg_setu8 (skb->data, 5, CAPI_REQ);
1452 capimsg_setu16(skb->data, 6, mp->msgid++);
1453 capimsg_setu32(skb->data, 8, mp->ncci); /* NCCI */
1454 - capimsg_setu32(skb->data, 12, (u32) skb->data); /* Data32 */
1455 + capimsg_setu32(skb->data, 12, (__u32) skb->data); /* Data32 */
1456 capimsg_setu16(skb->data, 16, len); /* Data length */
1457 capimsg_setu16(skb->data, 18, datahandle);
1458 capimsg_setu16(skb->data, 20, 0); /* Flags */
1459 @@ -620,16 +692,16 @@ static int handle_minor_send(struct capi
1460 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1461 /* -------- function called by lower level -------------------------- */
1462
1463 -static void capi_signal(u16 applid, void *param)
1464 +static void capi_signal(__u16 applid, void *param)
1465 {
1466 struct capidev *cdev = (struct capidev *)param;
1467 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1468 struct capiminor *mp;
1469 - u16 datahandle;
1470 + __u16 datahandle;
1471 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1472 struct capincci *np;
1473 struct sk_buff *skb = 0;
1474 - u32 ncci;
1475 + __u32 ncci;
1476
1477 (void) (*capifuncs->capi_get_message) (applid, &skb);
1478 if (!skb) {
1479 @@ -683,6 +755,12 @@ static void capi_signal(u16 applid, void
1480 #endif
1481 kfree_skb(skb);
1482 (void)capiminor_del_ack(mp, datahandle);
1483 +#ifdef CAPI_PPP_ON_RAW_DEVICE
1484 + if (mp->chan_connected) {
1485 + ppp_output_wakeup(&mp->chan);
1486 + return;
1487 + }
1488 +#endif
1489 if (mp->tty) {
1490 if (mp->tty->ldisc.write_wakeup)
1491 mp->tty->ldisc.write_wakeup(mp->tty);
1492 @@ -758,7 +836,7 @@ capi_write(struct file *file, const char
1493 struct capidev *cdev = (struct capidev *)file->private_data;
1494 struct sk_buff *skb;
1495 int retval;
1496 - u16 mlen;
1497 + __u16 mlen;
1498
1499 if (ppos != &file->f_pos)
1500 return -ESPIPE;
1501 @@ -998,7 +1076,7 @@ capi_ioctl(struct inode *inode, struct f
1502 sizeof(ncci));
1503 if (retval)
1504 return -EFAULT;
1505 - nccip = capincci_find(cdev, (u32) ncci);
1506 + nccip = capincci_find(cdev, (__u32) ncci);
1507 if (!nccip)
1508 return 0;
1509 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1510 @@ -1023,7 +1101,7 @@ capi_ioctl(struct inode *inode, struct f
1511 sizeof(ncci));
1512 if (retval)
1513 return -EFAULT;
1514 - nccip = capincci_find(cdev, (u32) ncci);
1515 + nccip = capincci_find(cdev, (__u32) ncci);
1516 if (!nccip || (mp = nccip->minorp) == 0)
1517 return -ESRCH;
1518 return mp->minor;
1519 @@ -1070,7 +1148,9 @@ capi_release(struct inode *inode, struct
1520
1521 static struct file_operations capi_fops =
1522 {
1523 +#ifdef COMPAT_HAS_FILEOP_OWNER
1524 owner: THIS_MODULE,
1525 +#endif
1526 llseek: no_llseek,
1527 read: capi_read,
1528 write: capi_write,
1529 @@ -1233,6 +1313,45 @@ capinc_raw_ioctl(struct inode *inode, st
1530 return -EINVAL;
1531
1532 switch (cmd) {
1533 +#ifdef CAPI_PPP_ON_RAW_DEVICE
1534 + case PPPIOCATTACH:
1535 + {
1536 + int retval, val;
1537 + if (get_user(val, (int *) arg))
1538 + break;
1539 + if (mp->chan_connected)
1540 + return -EALREADY;
1541 + mp->chan.private = mp;
1542 +#if 1
1543 + return -EINVAL;
1544 +#else
1545 + mp->chan.ops = &ppp_ops;
1546 +#endif
1547 +
1548 + retval = ppp_register_channel(&mp->chan, val);
1549 + if (retval)
1550 + return retval;
1551 + mp->chan_connected = 1;
1552 + mp->chan_index = val;
1553 + }
1554 + return 0;
1555 + case PPPIOCDETACH:
1556 + {
1557 + if (!mp->chan_connected)
1558 + return -ENXIO;
1559 + ppp_unregister_channel(&mp->chan);
1560 + mp->chan_connected = 0;
1561 + }
1562 + return 0;
1563 + case PPPIOCGUNIT:
1564 + {
1565 + if (!mp->chan_connected)
1566 + return -ENXIO;
1567 + if (put_user(mp->chan_index, (int *) arg))
1568 + return -EFAULT;
1569 + }
1570 + return 0;
1571 +#endif
1572 }
1573 return -EINVAL;
1574 }
1575 @@ -1260,7 +1379,9 @@ capinc_raw_release(struct inode *inode,
1576
1577 static struct file_operations capinc_raw_fops =
1578 {
1579 +#ifdef COMPAT_HAS_FILEOP_OWNER
1580 owner: THIS_MODULE,
1581 +#endif
1582 llseek: no_llseek,
1583 read: capinc_raw_read,
1584 write: capinc_raw_write,
1585 @@ -1272,7 +1393,7 @@ static struct file_operations capinc_raw
1586
1587 /* -------- tty_operations for capincci ----------------------------- */
1588
1589 -static int capinc_tty_open(struct tty_struct * tty, struct file * file)
1590 +int capinc_tty_open(struct tty_struct * tty, struct file * file)
1591 {
1592 struct capiminor *mp;
1593
1594 @@ -1300,7 +1421,7 @@ static int capinc_tty_open(struct tty_st
1595 return 0;
1596 }
1597
1598 -static void capinc_tty_close(struct tty_struct * tty, struct file * file)
1599 +void capinc_tty_close(struct tty_struct * tty, struct file * file)
1600 {
1601 struct capiminor *mp;
1602
1603 @@ -1325,8 +1446,8 @@ static void capinc_tty_close(struct tty_
1604 #endif
1605 }
1606
1607 -static int capinc_tty_write(struct tty_struct * tty, int from_user,
1608 - const unsigned char *buf, int count)
1609 +int capinc_tty_write(struct tty_struct * tty, int from_user,
1610 + const unsigned char *buf, int count)
1611 {
1612 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1613 struct sk_buff *skb;
1614 @@ -1377,7 +1498,7 @@ static int capinc_tty_write(struct tty_s
1615 return count;
1616 }
1617
1618 -static void capinc_tty_put_char(struct tty_struct *tty, unsigned char ch)
1619 +void capinc_tty_put_char(struct tty_struct *tty, unsigned char ch)
1620 {
1621 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1622 struct sk_buff *skb;
1623 @@ -1414,7 +1535,7 @@ static void capinc_tty_put_char(struct t
1624 }
1625 }
1626
1627 -static void capinc_tty_flush_chars(struct tty_struct *tty)
1628 +void capinc_tty_flush_chars(struct tty_struct *tty)
1629 {
1630 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1631 struct sk_buff *skb;
1632 @@ -1440,7 +1561,7 @@ static void capinc_tty_flush_chars(struc
1633 (void)handle_minor_recv(mp);
1634 }
1635
1636 -static int capinc_tty_write_room(struct tty_struct *tty)
1637 +int capinc_tty_write_room(struct tty_struct *tty)
1638 {
1639 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1640 int room;
1641 @@ -1458,7 +1579,7 @@ static int capinc_tty_write_room(struct
1642 return room;
1643 }
1644
1645 -static int capinc_tty_chars_in_buffer(struct tty_struct *tty)
1646 +int capinc_tty_chars_in_buffer(struct tty_struct *tty)
1647 {
1648 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1649 if (!mp || !mp->nccip) {
1650 @@ -1476,7 +1597,7 @@ static int capinc_tty_chars_in_buffer(st
1651 return mp->outbytes;
1652 }
1653
1654 -static int capinc_tty_ioctl(struct tty_struct *tty, struct file * file,
1655 +int capinc_tty_ioctl(struct tty_struct *tty, struct file * file,
1656 unsigned int cmd, unsigned long arg)
1657 {
1658 int error = 0;
1659 @@ -1488,14 +1609,14 @@ static int capinc_tty_ioctl(struct tty_s
1660 return error;
1661 }
1662
1663 -static void capinc_tty_set_termios(struct tty_struct *tty, struct termios * old)
1664 +void capinc_tty_set_termios(struct tty_struct *tty, struct termios * old)
1665 {
1666 #ifdef _DEBUG_TTYFUNCS
1667 printk(KERN_DEBUG "capinc_tty_set_termios\n");
1668 #endif
1669 }
1670
1671 -static void capinc_tty_throttle(struct tty_struct * tty)
1672 +void capinc_tty_throttle(struct tty_struct * tty)
1673 {
1674 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1675 #ifdef _DEBUG_TTYFUNCS
1676 @@ -1505,7 +1626,7 @@ static void capinc_tty_throttle(struct t
1677 mp->ttyinstop = 1;
1678 }
1679
1680 -static void capinc_tty_unthrottle(struct tty_struct * tty)
1681 +void capinc_tty_unthrottle(struct tty_struct * tty)
1682 {
1683 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1684 #ifdef _DEBUG_TTYFUNCS
1685 @@ -1517,7 +1638,7 @@ static void capinc_tty_unthrottle(struct
1686 }
1687 }
1688
1689 -static void capinc_tty_stop(struct tty_struct *tty)
1690 +void capinc_tty_stop(struct tty_struct *tty)
1691 {
1692 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1693 #ifdef _DEBUG_TTYFUNCS
1694 @@ -1528,7 +1649,7 @@ static void capinc_tty_stop(struct tty_s
1695 }
1696 }
1697
1698 -static void capinc_tty_start(struct tty_struct *tty)
1699 +void capinc_tty_start(struct tty_struct *tty)
1700 {
1701 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1702 #ifdef _DEBUG_TTYFUNCS
1703 @@ -1540,43 +1661,49 @@ static void capinc_tty_start(struct tty_
1704 }
1705 }
1706
1707 -static void capinc_tty_hangup(struct tty_struct *tty)
1708 +void capinc_tty_hangup(struct tty_struct *tty)
1709 {
1710 #ifdef _DEBUG_TTYFUNCS
1711 printk(KERN_DEBUG "capinc_tty_hangup\n");
1712 #endif
1713 }
1714
1715 -static void capinc_tty_break_ctl(struct tty_struct *tty, int state)
1716 +void capinc_tty_break_ctl(struct tty_struct *tty, int state)
1717 {
1718 #ifdef _DEBUG_TTYFUNCS
1719 printk(KERN_DEBUG "capinc_tty_break_ctl(%d)\n", state);
1720 #endif
1721 }
1722
1723 -static void capinc_tty_flush_buffer(struct tty_struct *tty)
1724 +void capinc_tty_flush_buffer(struct tty_struct *tty)
1725 {
1726 #ifdef _DEBUG_TTYFUNCS
1727 printk(KERN_DEBUG "capinc_tty_flush_buffer\n");
1728 #endif
1729 }
1730
1731 -static void capinc_tty_set_ldisc(struct tty_struct *tty)
1732 +void capinc_tty_set_ldisc(struct tty_struct *tty)
1733 {
1734 #ifdef _DEBUG_TTYFUNCS
1735 printk(KERN_DEBUG "capinc_tty_set_ldisc\n");
1736 #endif
1737 }
1738
1739 -static void capinc_tty_send_xchar(struct tty_struct *tty, char ch)
1740 +void capinc_tty_send_xchar(struct tty_struct *tty, char ch)
1741 {
1742 #ifdef _DEBUG_TTYFUNCS
1743 printk(KERN_DEBUG "capinc_tty_send_xchar(%d)\n", ch);
1744 #endif
1745 }
1746
1747 -static int capinc_tty_read_proc(char *page, char **start, off_t off,
1748 - int count, int *eof, void *data)
1749 +int capinc_tty_read_proc(char *page, char **start, off_t off,
1750 + int count, int *eof, void *data)
1751 +{
1752 + return 0;
1753 +}
1754 +
1755 +int capinc_write_proc(struct file *file, const char *buffer,
1756 + unsigned long count, void *data)
1757 {
1758 return 0;
1759 }
1760 @@ -1588,7 +1715,7 @@ static struct tty_struct *capinc_tty_tab
1761 static struct termios *capinc_tty_termios[CAPINC_NR_PORTS];
1762 static struct termios *capinc_tty_termios_locked[CAPINC_NR_PORTS];
1763
1764 -static int capinc_tty_init(void)
1765 +int capinc_tty_init(void)
1766 {
1767 struct tty_driver *drv = &capinc_tty_driver;
1768
1769 @@ -1646,7 +1773,7 @@ static int capinc_tty_init(void)
1770 return 0;
1771 }
1772
1773 -static void capinc_tty_exit(void)
1774 +void capinc_tty_exit(void)
1775 {
1776 struct tty_driver *drv = &capinc_tty_driver;
1777 int retval;
1778 @@ -1771,8 +1898,9 @@ static void __exit proc_exit(void)
1779
1780 /* -------- init function and module interface ---------------------- */
1781
1782 +#ifdef COMPAT_HAS_kmem_cache
1783
1784 -static void alloc_exit(void)
1785 +static void __exit alloc_exit(void)
1786 {
1787 if (capidev_cachep) {
1788 (void)kmem_cache_destroy(capidev_cachep);
1789 @@ -1837,8 +1965,9 @@ static int __init alloc_init(void)
1790 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1791 return 0;
1792 }
1793 +#endif
1794
1795 -static void lower_callback(unsigned int cmd, u32 contr, void *data)
1796 +static void lower_callback(unsigned int cmd, __u32 contr, void *data)
1797 {
1798 struct capi_ncciinfo *np;
1799 struct capidev *cdev;
1800 @@ -1900,15 +2029,19 @@ static int __init capi_init(void)
1801 MOD_DEC_USE_COUNT;
1802 return -EIO;
1803 }
1804 +#ifdef HAVE_DEVFS_FS
1805 devfs_register_series (NULL, "capi/r%u", CAPINC_NR_PORTS,
1806 DEVFS_FL_DEFAULT,
1807 capi_rawmajor, 0,
1808 S_IFCHR | S_IRUSR | S_IWUSR,
1809 &capinc_raw_fops, NULL);
1810 +#endif
1811 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1812 +#ifdef HAVE_DEVFS_FS
1813 devfs_register (NULL, "isdn/capi20", DEVFS_FL_DEFAULT,
1814 capi_major, 0, S_IFCHR | S_IRUSR | S_IWUSR,
1815 &capi_fops, NULL);
1816 +#endif
1817 printk(KERN_NOTICE "capi20: started up with major %d\n", capi_major);
1818
1819 if ((capifuncs = attach_capi_interface(&cuser)) == 0) {
1820 @@ -1918,9 +2051,11 @@ static int __init capi_init(void)
1821 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1822 devfs_unregister_chrdev(capi_rawmajor, "capi/r%d");
1823 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1824 +#ifdef HAVE_DEVFS_FS
1825 devfs_unregister(devfs_find_handle(NULL, "capi20",
1826 capi_major, 0,
1827 DEVFS_SPECIAL_CHR, 0));
1828 +#endif
1829 return -EIO;
1830 }
1831
1832 @@ -1934,8 +2069,10 @@ static int __init capi_init(void)
1833 }
1834 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1835
1836 +#ifdef COMPAT_HAS_kmem_cache
1837 if (alloc_init() < 0) {
1838 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1839 +#ifdef HAVE_DEVFS_FS
1840 unsigned int j;
1841 devfs_unregister_chrdev(capi_rawmajor, "capi/r%d");
1842 for (j = 0; j < CAPINC_NR_PORTS; j++) {
1843 @@ -1943,16 +2080,20 @@ static int __init capi_init(void)
1844 sprintf(devname, "capi/r%u", j);
1845 devfs_unregister(devfs_find_handle(NULL, devname, capi_rawmajor, j, DEVFS_SPECIAL_CHR, 0));
1846 }
1847 +#endif
1848 capinc_tty_exit();
1849 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1850 (void) detach_capi_interface(&cuser);
1851 devfs_unregister_chrdev(capi_major, "capi20");
1852 +#ifdef HAVE_DEVFS_FS
1853 devfs_unregister(devfs_find_handle(NULL, "capi20",
1854 capi_major, 0,
1855 DEVFS_SPECIAL_CHR, 0));
1856 +#endif
1857 MOD_DEC_USE_COUNT;
1858 return -ENOMEM;
1859 }
1860 +#endif /* COMPAT_HAS_kmem_cache */
1861
1862 (void)proc_init();
1863
1864 @@ -1975,23 +2116,31 @@ static int __init capi_init(void)
1865 static void __exit capi_exit(void)
1866 {
1867 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1868 +#ifdef HAVE_DEVFS_FS
1869 unsigned int j;
1870 #endif
1871 +#endif
1872 +#ifdef COMPAT_HAS_kmem_cache
1873 alloc_exit();
1874 +#endif
1875 (void)proc_exit();
1876
1877 devfs_unregister_chrdev(capi_major, "capi20");
1878 +#ifdef HAVE_DEVFS_FS
1879 devfs_unregister(devfs_find_handle(NULL, "isdn/capi20", capi_major, 0, DEVFS_SPECIAL_CHR, 0));
1880 +#endif
1881
1882 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1883 capinc_tty_exit();
1884 devfs_unregister_chrdev(capi_rawmajor, "capi/r%d");
1885 +#ifdef HAVE_DEVFS_FS
1886 for (j = 0; j < CAPINC_NR_PORTS; j++) {
1887 char devname[32];
1888 sprintf(devname, "capi/r%u", j);
1889 devfs_unregister(devfs_find_handle(NULL, devname, capi_rawmajor, j, DEVFS_SPECIAL_CHR, 0));
1890 }
1891 #endif
1892 +#endif
1893 (void) detach_capi_interface(&cuser);
1894 printk(KERN_NOTICE "capi: Rev %s: unloaded\n", rev);
1895 }
1896 Index: linux-2.4.35.4/drivers/isdn/avmb1/capicmd.h
1897 ===================================================================
1898 --- linux-2.4.35.4.orig/drivers/isdn/avmb1/capicmd.h
1899 +++ linux-2.4.35.4/drivers/isdn/avmb1/capicmd.h
1900 @@ -1,4 +1,4 @@
1901 -/* $Id: capicmd.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
1902 +/* $Id: capicmd.h,v 1.4 2001/09/24 13:22:44 kai Exp $
1903 *
1904 * CAPI 2.0 Interface for Linux
1905 *
1906 Index: linux-2.4.35.4/drivers/isdn/avmb1/capidev.h
1907 ===================================================================
1908 --- linux-2.4.35.4.orig/drivers/isdn/avmb1/capidev.h
1909 +++ linux-2.4.35.4/drivers/isdn/avmb1/capidev.h
1910 @@ -1,4 +1,4 @@
1911 -/* $Id: capidev.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
1912 +/* $Id: capidev.h,v 1.8 2001/09/24 13:22:44 kai Exp $
1913 *
1914 * CAPI 2.0 Interface for Linux
1915 *
1916 Index: linux-2.4.35.4/drivers/isdn/avmb1/capidrv.c
1917 ===================================================================
1918 --- linux-2.4.35.4.orig/drivers/isdn/avmb1/capidrv.c
1919 +++ linux-2.4.35.4/drivers/isdn/avmb1/capidrv.c
1920 @@ -1,4 +1,4 @@
1921 -/* $Id: capidrv.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
1922 +/* $Id: capidrv.c,v 1.45 2001/09/24 13:22:44 kai Exp $
1923 *
1924 * ISDN4Linux Driver, using capi20 interface (kernelcapi)
1925 *
1926 @@ -35,7 +35,7 @@
1927 #include "capicmd.h"
1928 #include "capidrv.h"
1929
1930 -static char *revision = "$Revision: 1.1.4.1 $";
1931 +static char *revision = "$Revision: 1.45 $";
1932 static int debugmode = 0;
1933
1934 MODULE_DESCRIPTION("CAPI4Linux: Interface to ISDN4Linux");
1935 @@ -105,7 +105,6 @@ struct capidrv_contr {
1936 int oldstate;
1937 /* */
1938 __u16 datahandle;
1939 - spinlock_t lock;
1940 struct ncci_datahandle_queue {
1941 struct ncci_datahandle_queue *next;
1942 __u16 datahandle;
1943 @@ -423,7 +422,6 @@ static inline capidrv_ncci *new_ncci(cap
1944 nccip->plcip = plcip;
1945 nccip->chan = plcip->chan;
1946 nccip->datahandle = 0;
1947 - nccip->lock = SPIN_LOCK_UNLOCKED;
1948
1949 nccip->next = plcip->ncci_list;
1950 plcip->ncci_list = nccip;
1951 @@ -480,7 +478,6 @@ static int capidrv_add_ack(struct capidr
1952 __u16 datahandle, int len)
1953 {
1954 struct ncci_datahandle_queue *n, **pp;
1955 - unsigned long flags;
1956
1957 n = (struct ncci_datahandle_queue *)
1958 kmalloc(sizeof(struct ncci_datahandle_queue), GFP_ATOMIC);
1959 @@ -491,31 +488,25 @@ static int capidrv_add_ack(struct capidr
1960 n->next = 0;
1961 n->datahandle = datahandle;
1962 n->len = len;
1963 - spin_lock_irqsave(&nccip->lock, flags);
1964 for (pp = &nccip->ackqueue; *pp; pp = &(*pp)->next) ;
1965 *pp = n;
1966 - spin_unlock_irqrestore(&nccip->lock, flags);
1967 return 0;
1968 }
1969
1970 static int capidrv_del_ack(struct capidrv_ncci *nccip, __u16 datahandle)
1971 {
1972 struct ncci_datahandle_queue **pp, *p;
1973 - unsigned long flags;
1974 int len;
1975
1976 - spin_lock_irqsave(&nccip->lock, flags);
1977 for (pp = &nccip->ackqueue; *pp; pp = &(*pp)->next) {
1978 if ((*pp)->datahandle == datahandle) {
1979 p = *pp;
1980 len = p->len;
1981 *pp = (*pp)->next;
1982 - spin_unlock_irqrestore(&nccip->lock, flags);
1983 kfree(p);
1984 return len;
1985 }
1986 }
1987 - spin_unlock_irqrestore(&nccip->lock, flags);
1988 return -1;
1989 }
1990
1991 @@ -523,25 +514,13 @@ static int capidrv_del_ack(struct capidr
1992
1993 static void send_message(capidrv_contr * card, _cmsg * cmsg)
1994 {
1995 - struct sk_buff *skb;
1996 - size_t len;
1997 - u16 err;
1998 -
1999 + struct sk_buff *skb;
2000 + size_t len;
2001 capi_cmsg2message(cmsg, cmsg->buf);
2002 len = CAPIMSG_LEN(cmsg->buf);
2003 skb = alloc_skb(len, GFP_ATOMIC);
2004 - if(!skb) {
2005 - printk(KERN_ERR "no skb len(%d) memory\n", len);
2006 - return;
2007 - }
2008 memcpy(skb_put(skb, len), cmsg->buf, len);
2009 - err = (*capifuncs->capi_put_message) (global.appid, skb);
2010 - if (err) {
2011 - printk(KERN_WARNING "%s: capi_put_message error: %04x\n",
2012 - __FUNCTION__, err);
2013 - kfree_skb(skb);
2014 - return;
2015 - }
2016 + (*capifuncs->capi_put_message) (global.appid, skb);
2017 global.nsentctlpkt++;
2018 }
2019
2020 @@ -1932,8 +1911,10 @@ static int if_sendbuf(int id, int channe
2021 (void)capidrv_del_ack(nccip, datahandle);
2022 return 0;
2023 }
2024 +#if 1
2025 printk(KERN_DEBUG "capidrv-%d: only %d bytes headroom, need %d\n",
2026 card->contrnr, skb_headroom(skb), msglen);
2027 +#endif
2028 memcpy(skb_push(nskb, msglen), sendcmsg.buf, msglen);
2029 errcode = (*capifuncs->capi_put_message) (global.appid, nskb);
2030 if (errcode == CAPI_NOERROR) {
2031 @@ -2035,6 +2016,52 @@ static void enable_dchannel_trace(capidr
2032 send_message(card, &cmdcmsg);
2033 }
2034
2035 +#if 0
2036 +static void disable_dchannel_trace(capidrv_contr *card)
2037 +{
2038 + __u8 manufacturer[CAPI_MANUFACTURER_LEN];
2039 + capi_version version;
2040 + __u16 contr = card->contrnr;
2041 + __u16 errcode;
2042 + __u16 avmversion[3];
2043 +
2044 + errcode = (*capifuncs->capi_get_manufacturer)(contr, manufacturer);
2045 + if (errcode != CAPI_NOERROR) {
2046 + printk(KERN_ERR "%s: can't get manufacturer (0x%x)\n",
2047 + card->name, errcode);
2048 + return;
2049 + }
2050 + if (strstr(manufacturer, "AVM") == 0) {
2051 + printk(KERN_ERR "%s: not from AVM, no d-channel trace possible (%s)\n",
2052 + card->name, manufacturer);
2053 + return;
2054 + }
2055 + errcode = (*capifuncs->capi_get_version)(contr, &version);
2056 + if (errcode != CAPI_NOERROR) {
2057 + printk(KERN_ERR "%s: can't get version (0x%x)\n",
2058 + card->name, errcode);
2059 + return;
2060 + }
2061 + avmversion[0] = (version.majormanuversion >> 4) & 0x0f;
2062 + avmversion[1] = (version.majormanuversion << 4) & 0xf0;
2063 + avmversion[1] |= (version.minormanuversion >> 4) & 0x0f;
2064 + avmversion[2] |= version.minormanuversion & 0x0f;
2065 +
2066 + if (avmversion[0] > 3 || (avmversion[0] == 3 && avmversion[1] > 5)) {
2067 + printk(KERN_INFO "%s: D2 trace disabled\n", card->name);
2068 + } else {
2069 + printk(KERN_INFO "%s: D3 trace disabled\n", card->name);
2070 + }
2071 + capi_fill_MANUFACTURER_REQ(&cmdcmsg, global.appid,
2072 + card->msgid++,
2073 + contr,
2074 + 0x214D5641, /* ManuID */
2075 + 0, /* Class */
2076 + 1, /* Function */
2077 + (_cstruct)"\004\000\000\000\000");
2078 + send_message(card, &cmdcmsg);
2079 +}
2080 +#endif
2081
2082 static void send_listen(capidrv_contr *card)
2083 {
2084 @@ -2200,10 +2227,10 @@ static int capidrv_delcontr(__u16 contr)
2085 free_ncci(card, card->bchans[card->nbchan-1].nccip);
2086 if (card->bchans[card->nbchan-1].plcip)
2087 free_plci(card, card->bchans[card->nbchan-1].plcip);
2088 + if (card->plci_list)
2089 + printk(KERN_ERR "capidrv: bug in free_plci()\n");
2090 card->nbchan--;
2091 }
2092 - if (card->plci_list)
2093 - printk(KERN_ERR "capidrv: bug in free_plci()\n");
2094 kfree(card->bchans);
2095 card->bchans = 0;
2096
2097 Index: linux-2.4.35.4/drivers/isdn/avmb1/capidrv.h
2098 ===================================================================
2099 --- linux-2.4.35.4.orig/drivers/isdn/avmb1/capidrv.h
2100 +++ linux-2.4.35.4/drivers/isdn/avmb1/capidrv.h
2101 @@ -1,4 +1,4 @@
2102 -/* $Id: capidrv.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
2103 +/* $Id: capidrv.h,v 1.4 2001/09/24 13:22:44 kai Exp $
2104 *
2105 * ISDN4Linux Driver, using capi20 interface (kernelcapi)
2106 *
2107 Index: linux-2.4.35.4/drivers/isdn/avmb1/capifs.c
2108 ===================================================================
2109 --- linux-2.4.35.4.orig/drivers/isdn/avmb1/capifs.c
2110 +++ linux-2.4.35.4/drivers/isdn/avmb1/capifs.c
2111 @@ -1,4 +1,4 @@
2112 -/* $Id: capifs.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
2113 +/* $Id: capifs.c,v 1.22 2001/09/24 13:22:44 kai Exp $
2114 *
2115 * Copyright 2000 by Carsten Paeth <calle@calle.de>
2116 *
2117 @@ -25,6 +25,7 @@
2118 #include <linux/major.h>
2119 #include <linux/slab.h>
2120 #include <linux/ctype.h>
2121 +#include <linux/isdn_compat.h>
2122 #include <asm/bitops.h>
2123 #include <asm/uaccess.h>
2124
2125 @@ -32,7 +33,7 @@ MODULE_DESCRIPTION("CAPI4Linux: /dev/cap
2126 MODULE_AUTHOR("Carsten Paeth");
2127 MODULE_LICENSE("GPL");
2128
2129 -static char *revision = "$Revision: 1.1.4.1 $";
2130 +static char *revision = "$Revision: 1.22 $";
2131
2132 struct capifs_ncci {
2133 struct inode *inode;
2134 @@ -69,14 +70,21 @@ static inline struct capifs_sb_info *SBI
2135 static int capifs_root_readdir(struct file *,void *,filldir_t);
2136 static struct dentry *capifs_root_lookup(struct inode *,struct dentry *);
2137 static int capifs_revalidate(struct dentry *, int);
2138 +#ifdef COMPAT_VFS_2_4
2139 static struct inode *capifs_new_inode(struct super_block *sb);
2140 +#endif
2141
2142 static struct file_operations capifs_root_operations = {
2143 +#ifdef COMPAT_VFS_2_4
2144 read: generic_read_dir,
2145 +#endif
2146 readdir: capifs_root_readdir,
2147 };
2148
2149 struct inode_operations capifs_root_inode_operations = {
2150 +#ifndef COMPAT_VFS_2_4
2151 + default_file_ops: &capifs_root_operations, /* file operations */
2152 +#endif
2153 lookup: capifs_root_lookup,
2154 };
2155
2156 @@ -101,12 +109,20 @@ static int capifs_root_readdir(struct fi
2157 switch(nr)
2158 {
2159 case 0:
2160 +#ifdef COMPAT_VFS_2_4
2161 if (filldir(dirent, ".", 1, nr, inode->i_ino, DT_DIR) < 0)
2162 +#else
2163 + if (filldir(dirent, ".", 1, nr, inode->i_ino) < 0)
2164 +#endif
2165 return 0;
2166 filp->f_pos = ++nr;
2167 /* fall through */
2168 case 1:
2169 +#ifdef COMPAT_VFS_2_4
2170 if (filldir(dirent, "..", 2, nr, inode->i_ino, DT_DIR) < 0)
2171 +#else
2172 + if (filldir(dirent, "..", 2, nr, inode->i_ino) < 0)
2173 +#endif
2174 return 0;
2175 filp->f_pos = ++nr;
2176 /* fall through */
2177 @@ -118,7 +134,11 @@ static int capifs_root_readdir(struct fi
2178 char *p = numbuf;
2179 if (np->type) *p++ = np->type;
2180 sprintf(p, "%u", np->num);
2181 +#ifdef COMPAT_VFS_2_4
2182 if ( filldir(dirent, numbuf, strlen(numbuf), nr, nr, DT_UNKNOWN) < 0 )
2183 +#else
2184 + if ( filldir(dirent, numbuf, strlen(numbuf), nr, nr) < 0 )
2185 +#endif
2186 return 0;
2187 }
2188 filp->f_pos = ++nr;
2189 @@ -180,7 +200,7 @@ static struct dentry *capifs_root_lookup
2190
2191 dentry->d_inode = np->inode;
2192 if ( dentry->d_inode )
2193 - atomic_inc(&dentry->d_inode->i_count);
2194 + i_count_inc(dentry->d_inode->i_count);
2195
2196 d_add(dentry, dentry->d_inode);
2197
2198 @@ -199,9 +219,9 @@ static void capifs_put_super(struct supe
2199
2200 for ( i = 0 ; i < sbi->max_ncci ; i++ ) {
2201 if ( (inode = sbi->nccis[i].inode) ) {
2202 - if (atomic_read(&inode->i_count) != 1 )
2203 + if (i_count_read(inode->i_count) != 1 )
2204 printk("capifs_put_super: badness: entry %d count %d\n",
2205 - i, (unsigned)atomic_read(&inode->i_count));
2206 + i, (unsigned)i_count_read(inode->i_count));
2207 inode->i_nlink--;
2208 iput(inode);
2209 }
2210 @@ -213,11 +233,24 @@ static void capifs_put_super(struct supe
2211
2212 kfree(sbi->nccis);
2213 kfree(sbi);
2214 +#ifndef COMPAT_VFS_2_4
2215 + MOD_DEC_USE_COUNT;
2216 +#endif
2217 }
2218
2219 +#ifdef COMPAT_VFS_2_4
2220 static int capifs_statfs(struct super_block *sb, struct statfs *buf);
2221 +#else
2222 +static int capifs_statfs(struct super_block *sb, struct statfs *buf, int bufsiz);
2223 +static void capifs_write_inode(struct inode *inode) { };
2224 +static void capifs_read_inode(struct inode *inode);
2225 +#endif
2226
2227 static struct super_operations capifs_sops = {
2228 +#ifndef COMPAT_VFS_2_4
2229 + read_inode: capifs_read_inode,
2230 + write_inode: capifs_write_inode,
2231 +#endif
2232 put_super: capifs_put_super,
2233 statfs: capifs_statfs,
2234 };
2235 @@ -288,6 +321,10 @@ struct super_block *capifs_read_super(st
2236 struct dentry * root;
2237 struct capifs_sb_info *sbi;
2238
2239 +#ifndef COMPAT_VFS_2_4
2240 + MOD_INC_USE_COUNT;
2241 + lock_super(s);
2242 +#endif
2243 /* Super block already completed? */
2244 if (s->s_root)
2245 goto out;
2246 @@ -322,6 +359,7 @@ struct super_block *capifs_read_super(st
2247 /*
2248 * Get the root inode and dentry, but defer checking for errors.
2249 */
2250 +#ifdef COMPAT_VFS_2_4
2251 root_inode = capifs_new_inode(s);
2252 if (root_inode) {
2253 root_inode->i_ino = 1;
2254 @@ -331,6 +369,10 @@ struct super_block *capifs_read_super(st
2255 root_inode->i_nlink = 2;
2256 }
2257 root = d_alloc_root(root_inode);
2258 +#else
2259 + root_inode = iget(s, 1); /* inode 1 == root directory */
2260 + root = d_alloc_root(root_inode, NULL);
2261 +#endif
2262
2263 /*
2264 * Check whether somebody else completed the super block.
2265 @@ -370,11 +412,34 @@ struct super_block *capifs_read_super(st
2266 mounts = s;
2267
2268 out: /* Success ... somebody else completed the super block for us. */
2269 +#ifndef COMPAT_VFS_2_4
2270 + unlock_super(s);
2271 +#endif
2272 return s;
2273 fail:
2274 +#ifndef COMPAT_VFS_2_4
2275 + unlock_super(s);
2276 + MOD_DEC_USE_COUNT;
2277 +#endif
2278 return NULL;
2279 }
2280
2281 +#ifndef COMPAT_VFS_2_4
2282 +static int capifs_statfs(struct super_block *sb, struct statfs *buf, int bufsiz)
2283 +{
2284 + struct statfs tmp;
2285 +
2286 + tmp.f_type = CAPIFS_SUPER_MAGIC;
2287 + tmp.f_bsize = 1024;
2288 + tmp.f_blocks = 0;
2289 + tmp.f_bfree = 0;
2290 + tmp.f_bavail = 0;
2291 + tmp.f_files = 0;
2292 + tmp.f_ffree = 0;
2293 + tmp.f_namelen = NAME_MAX;
2294 + return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0;
2295 +}
2296 +#else
2297 static int capifs_statfs(struct super_block *sb, struct statfs *buf)
2298 {
2299 buf->f_type = CAPIFS_SUPER_MAGIC;
2300 @@ -387,7 +452,9 @@ static int capifs_statfs(struct super_bl
2301 buf->f_namelen = NAME_MAX;
2302 return 0;
2303 }
2304 +#endif
2305
2306 +#ifdef COMPAT_VFS_2_4
2307 static struct inode *capifs_new_inode(struct super_block *sb)
2308 {
2309 struct inode *inode = new_inode(sb);
2310 @@ -399,8 +466,51 @@ static struct inode *capifs_new_inode(st
2311 }
2312 return inode;
2313 }
2314 +#else
2315 +static void capifs_read_inode(struct inode *inode)
2316 +{
2317 + ino_t ino = inode->i_ino;
2318 + struct capifs_sb_info *sbi = SBI(inode->i_sb);
2319 +
2320 + inode->i_mode = 0;
2321 + inode->i_nlink = 0;
2322 + inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
2323 + inode->i_blocks = 0;
2324 + inode->i_blksize = 1024;
2325 + inode->i_uid = inode->i_gid = 0;
2326 +
2327 + if ( ino == 1 ) {
2328 + inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR;
2329 + inode->i_op = &capifs_root_inode_operations;
2330 + inode->i_nlink = 2;
2331 + return;
2332 + }
2333
2334 + ino -= 2;
2335 + if ( ino >= sbi->max_ncci )
2336 + return; /* Bogus */
2337 +
2338 +#ifdef COMPAT_VFS_2_4
2339 + init_special_inode(inode, S_IFCHR, 0);
2340 +#else
2341 + inode->i_mode = S_IFCHR;
2342 + inode->i_op = &chrdev_inode_operations;
2343 +#endif
2344 +
2345 + return;
2346 +}
2347 +#endif
2348 +
2349 +#ifndef COMPAT_VFS_2_4
2350 +static struct file_system_type capifs_fs_type = {
2351 + "capifs",
2352 + 0,
2353 + capifs_read_super,
2354 + NULL
2355 +};
2356 +#else
2357 static DECLARE_FSTYPE(capifs_fs_type, "capifs", capifs_read_super, 0);
2358 +#endif
2359
2360 void capifs_new_ncci(char type, unsigned int num, kdev_t device)
2361 {
2362 @@ -421,16 +531,26 @@ void capifs_new_ncci(char type, unsigned
2363 break;
2364 }
2365 }
2366 +#ifdef COMPAT_VFS_2_4
2367 if ( ino >= sbi->max_ncci )
2368 continue;
2369
2370 if ((np->inode = capifs_new_inode(sb)) != NULL) {
2371 +#else
2372 + if ((np->inode = iget(sb, ino+2)) != NULL) {
2373 +#endif
2374 struct inode *inode = np->inode;
2375 inode->i_uid = sbi->setuid ? sbi->uid : current->fsuid;
2376 inode->i_gid = sbi->setgid ? sbi->gid : current->fsgid;
2377 +#ifdef COMPAT_VFS_2_4
2378 inode->i_nlink = 1;
2379 inode->i_ino = ino + 2;
2380 init_special_inode(inode, sbi->mode|S_IFCHR, np->kdev);
2381 +#else
2382 + inode->i_mode = sbi->mode | S_IFCHR;
2383 + inode->i_rdev = np->kdev;
2384 + inode->i_nlink++;
2385 +#endif
2386 }
2387 }
2388 }
2389 Index: linux-2.4.35.4/drivers/isdn/avmb1/capifs.h
2390 ===================================================================
2391 --- linux-2.4.35.4.orig/drivers/isdn/avmb1/capifs.h
2392 +++ linux-2.4.35.4/drivers/isdn/avmb1/capifs.h
2393 @@ -1,4 +1,4 @@
2394 -/* $Id: capifs.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
2395 +/* $Id: capifs.h,v 1.4 2001/09/24 13:22:44 kai Exp $
2396 *
2397 * Copyright 2000 by Carsten Paeth <calle@calle.de>
2398 *
2399 Index: linux-2.4.35.4/drivers/isdn/avmb1/capilli.h
2400 ===================================================================
2401 --- linux-2.4.35.4.orig/drivers/isdn/avmb1/capilli.h
2402 +++ linux-2.4.35.4/drivers/isdn/avmb1/capilli.h
2403 @@ -1,4 +1,4 @@
2404 -/* $Id: capilli.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
2405 +/* $Id: capilli.h,v 1.5 2001/09/24 13:22:44 kai Exp $
2406 *
2407 * Kernel CAPI 2.0 Driver Interface for Linux
2408 *
2409 Index: linux-2.4.35.4/drivers/isdn/avmb1/capiutil.c
2410 ===================================================================
2411 --- linux-2.4.35.4.orig/drivers/isdn/avmb1/capiutil.c
2412 +++ linux-2.4.35.4/drivers/isdn/avmb1/capiutil.c
2413 @@ -1,4 +1,4 @@
2414 -/* $Id: capiutil.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
2415 +/* $Id: capiutil.c,v 1.16 2001/09/24 13:22:44 kai Exp $
2416 *
2417 * CAPI 2.0 convert capi message to capi message struct
2418 *
2419 @@ -19,6 +19,7 @@
2420 #include <linux/init.h>
2421 #include <asm/segment.h>
2422 #include <linux/config.h>
2423 +#include <linux/isdn_compat.h>
2424 #include "capiutil.h"
2425
2426 MODULE_DESCRIPTION("CAPI4Linux: CAPI message conversion support");
2427 Index: linux-2.4.35.4/drivers/isdn/avmb1/capiutil.h
2428 ===================================================================
2429 --- linux-2.4.35.4.orig/drivers/isdn/avmb1/capiutil.h
2430 +++ linux-2.4.35.4/drivers/isdn/avmb1/capiutil.h
2431 @@ -1,4 +1,4 @@
2432 -/* $Id: capiutil.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
2433 +/* $Id: capiutil.h,v 1.7 2001/09/24 13:22:44 kai Exp $
2434 *
2435 * CAPI 2.0 defines & types
2436 *
2437 Index: linux-2.4.35.4/drivers/isdn/avmb1/kcapi.c
2438 ===================================================================
2439 --- linux-2.4.35.4.orig/drivers/isdn/avmb1/kcapi.c
2440 +++ linux-2.4.35.4/drivers/isdn/avmb1/kcapi.c
2441 @@ -1,4 +1,4 @@
2442 -/* $Id: kcapi.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
2443 +/* $Id: kcapi.c,v 1.28 2001/09/24 13:22:44 kai Exp $
2444 *
2445 * Kernel CAPI 2.0 Module
2446 *
2447 @@ -21,6 +21,7 @@
2448 #include <linux/proc_fs.h>
2449 #include <linux/skbuff.h>
2450 #include <linux/tqueue.h>
2451 +#include <linux/isdn_compat.h>
2452 #include <linux/capi.h>
2453 #include <linux/kernelcapi.h>
2454 #include <linux/locks.h>
2455 @@ -33,7 +34,7 @@
2456 #include <linux/b1lli.h>
2457 #endif
2458
2459 -static char *revision = "$Revision: 1.1.4.1 $";
2460 +static char *revision = "$Revision: 1.28 $";
2461
2462 /* ------------------------------------------------------------- */
2463
2464 @@ -64,7 +65,6 @@ struct capi_ncci {
2465 __u32 ncci;
2466 __u32 winsize;
2467 int nmsg;
2468 - spinlock_t lock;
2469 struct msgidqueue *msgidqueue;
2470 struct msgidqueue *msgidlast;
2471 struct msgidqueue *msgidfree;
2472 @@ -104,14 +104,14 @@ static char capi_manufakturer[64] = "AVM
2473 #define APPL(a) (&applications[(a)-1])
2474 #define VALID_APPLID(a) ((a) && (a) <= CAPI_MAXAPPL && APPL(a)->applid == a)
2475 #define APPL_IS_FREE(a) (APPL(a)->applid == 0)
2476 -#define APPL_MARK_FREE(a) do{ APPL(a)->applid=0; MOD_DEC_USE_COUNT; }while(0)
2477 -#define APPL_MARK_USED(a) do{ APPL(a)->applid=(a); MOD_INC_USE_COUNT; }while(0)
2478 +#define APPL_MARK_FREE(a) do{ APPL(a)->applid=0; MOD_DEC_USE_COUNT; }while(0);
2479 +#define APPL_MARK_USED(a) do{ APPL(a)->applid=(a); MOD_INC_USE_COUNT; }while(0);
2480
2481 #define NCCI2CTRL(ncci) (((ncci) >> 24) & 0x7f)
2482
2483 #define VALID_CARD(c) ((c) > 0 && (c) <= CAPI_MAXCONTR)
2484 #define CARD(c) (&cards[(c)-1])
2485 -#define CARDNR(cp) ((((cp)-cards)+1) & 0xff)
2486 +#define CARDNR(cp) (((cp)-cards)+1)
2487
2488 static struct capi_appl applications[CAPI_MAXAPPL];
2489 static struct capi_ctr cards[CAPI_MAXCONTR];
2490 @@ -535,9 +535,13 @@ static int notify_push(unsigned int cmd,
2491 * of devices. Devices can only removed in
2492 * user process, not in bh.
2493 */
2494 +#ifdef COMPAT_HAS_SCHEDULE_TASK
2495 MOD_INC_USE_COUNT;
2496 if (schedule_task(&tq_state_notify) == 0)
2497 MOD_DEC_USE_COUNT;
2498 +#else
2499 + queue_task(&tq_state_notify, &tq_scheduler);
2500 +#endif
2501 return 0;
2502 }
2503
2504 @@ -546,13 +550,7 @@ static int notify_push(unsigned int cmd,
2505 static void notify_up(__u32 contr)
2506 {
2507 struct capi_interface_user *p;
2508 - __u16 appl;
2509
2510 - for (appl = 1; appl <= CAPI_MAXAPPL; appl++) {
2511 - if (!VALID_APPLID(appl)) continue;
2512 - if (APPL(appl)->releasing) continue;
2513 - CARD(contr)->driver->register_appl(CARD(contr), appl, &APPL(appl)->rparam);
2514 - }
2515 printk(KERN_NOTICE "kcapi: notify up contr %d\n", contr);
2516 spin_lock(&capi_users_lock);
2517 for (p = capi_users; p; p = p->next) {
2518 @@ -639,7 +637,9 @@ static void notify_handler(void *dummy)
2519 kfree(np);
2520 MOD_DEC_USE_COUNT;
2521 }
2522 +#ifdef COMPAT_HAS_SCHEDULE_TASK
2523 MOD_DEC_USE_COUNT;
2524 +#endif
2525 }
2526
2527 /* -------- NCCI Handling ------------------------------------- */
2528 @@ -647,7 +647,6 @@ static void notify_handler(void *dummy)
2529 static inline void mq_init(struct capi_ncci * np)
2530 {
2531 int i;
2532 - np->lock = SPIN_LOCK_UNLOCKED;
2533 np->msgidqueue = 0;
2534 np->msgidlast = 0;
2535 np->nmsg = 0;
2536 @@ -662,11 +661,8 @@ static inline void mq_init(struct capi_n
2537 static inline int mq_enqueue(struct capi_ncci * np, __u16 msgid)
2538 {
2539 struct msgidqueue *mq;
2540 - spin_lock_bh(&np->lock);
2541 - if ((mq = np->msgidfree) == 0) {
2542 - spin_unlock_bh(&np->lock);
2543 + if ((mq = np->msgidfree) == 0)
2544 return 0;
2545 - }
2546 np->msgidfree = mq->next;
2547 mq->msgid = msgid;
2548 mq->next = 0;
2549 @@ -676,14 +672,12 @@ static inline int mq_enqueue(struct capi
2550 if (!np->msgidqueue)
2551 np->msgidqueue = mq;
2552 np->nmsg++;
2553 - spin_unlock_bh(&np->lock);
2554 return 1;
2555 }
2556
2557 static inline int mq_dequeue(struct capi_ncci * np, __u16 msgid)
2558 {
2559 struct msgidqueue **pp;
2560 - spin_lock_bh(&np->lock);
2561 for (pp = &np->msgidqueue; *pp; pp = &(*pp)->next) {
2562 if ((*pp)->msgid == msgid) {
2563 struct msgidqueue *mq = *pp;
2564 @@ -693,11 +687,9 @@ static inline int mq_dequeue(struct capi
2565 mq->next = np->msgidfree;
2566 np->msgidfree = mq;
2567 np->nmsg--;
2568 - spin_unlock_bh(&np->lock);
2569 return 1;
2570 }
2571 }
2572 - spin_unlock_bh(&np->lock);
2573 return 0;
2574 }
2575
2576 @@ -720,16 +712,12 @@ static void controllercb_appl_released(s
2577 nextpp = &(*pp)->next;
2578 }
2579 }
2580 - if (APPL(appl)->releasing) { /* only release if the application was marked for release */
2581 - printk(KERN_DEBUG "kcapi: appl %d releasing(%d)\n", appl, APPL(appl)->releasing);
2582 - APPL(appl)->releasing--;
2583 - if (APPL(appl)->releasing <= 0) {
2584 - APPL(appl)->signal = 0;
2585 - APPL_MARK_FREE(appl);
2586 - printk(KERN_INFO "kcapi: appl %d down\n", appl);
2587 - }
2588 - } else
2589 - printk(KERN_WARNING "kcapi: appl %d card%d released without request\n", appl, card->cnr);
2590 + APPL(appl)->releasing--;
2591 + if (APPL(appl)->releasing <= 0) {
2592 + APPL(appl)->signal = 0;
2593 + APPL_MARK_FREE(appl);
2594 + printk(KERN_INFO "kcapi: appl %d down\n", appl);
2595 + }
2596 }
2597 /*
2598 * ncci management
2599 @@ -882,7 +870,16 @@ error:
2600
2601 static void controllercb_ready(struct capi_ctr * card)
2602 {
2603 + __u16 appl;
2604 +
2605 card->cardstate = CARD_RUNNING;
2606 +
2607 + for (appl = 1; appl <= CAPI_MAXAPPL; appl++) {
2608 + if (!VALID_APPLID(appl)) continue;
2609 + if (APPL(appl)->releasing) continue;
2610 + card->driver->register_appl(card, appl, &APPL(appl)->rparam);
2611 + }
2612 +
2613 printk(KERN_NOTICE "kcapi: card %d \"%s\" ready.\n",
2614 CARDNR(card), card->name);
2615
2616 Index: linux-2.4.35.4/drivers/isdn/avmb1/t1isa.c
2617 ===================================================================
2618 --- linux-2.4.35.4.orig/drivers/isdn/avmb1/t1isa.c
2619 +++ linux-2.4.35.4/drivers/isdn/avmb1/t1isa.c
2620 @@ -1,4 +1,4 @@
2621 -/* $Id: t1isa.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
2622 +/* $Id: t1isa.c,v 1.22 2001/09/24 13:22:44 kai Exp $
2623 *
2624 * Module for AVM T1 HEMA-card.
2625 *
2626 @@ -19,13 +19,14 @@
2627 #include <linux/capi.h>
2628 #include <linux/kernelcapi.h>
2629 #include <linux/init.h>
2630 +#include <linux/isdn_compat.h>
2631 #include <asm/io.h>
2632 #include "capicmd.h"
2633 #include "capiutil.h"
2634 #include "capilli.h"
2635 #include "avmcard.h"
2636
2637 -static char *revision = "$Revision: 1.1.4.1 $";
2638 +static char *revision = "$Revision: 1.22 $";
2639
2640 /* ------------------------------------------------------------- */
2641
2642 Index: linux-2.4.35.4/drivers/isdn/avmb1/t1pci.c
2643 ===================================================================
2644 --- linux-2.4.35.4.orig/drivers/isdn/avmb1/t1pci.c
2645 +++ linux-2.4.35.4/drivers/isdn/avmb1/t1pci.c
2646 @@ -1,4 +1,4 @@
2647 -/* $Id: t1pci.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
2648 +/* $Id: t1pci.c,v 1.25 2001/09/24 13:22:44 kai Exp $
2649 *
2650 * Module for AVM T1 PCI-card.
2651 *
2652 @@ -18,6 +18,7 @@
2653 #include <linux/interrupt.h>
2654 #include <linux/ioport.h>
2655 #include <linux/pci.h>
2656 +#include <linux/isdn_compat.h>
2657 #include <linux/capi.h>
2658 #include <linux/init.h>
2659 #include <asm/io.h>
2660 @@ -26,19 +27,21 @@
2661 #include "capilli.h"
2662 #include "avmcard.h"
2663
2664 -static char *revision = "$Revision: 1.1.4.1 $";
2665 +static char *revision = "$Revision: 1.25 $";
2666
2667 #undef CONFIG_T1PCI_DEBUG
2668 #undef CONFIG_T1PCI_POLLDEBUG
2669
2670 /* ------------------------------------------------------------- */
2671
2672 +#ifndef COMPAT_HAS_2_2_PCI
2673 static struct pci_device_id t1pci_pci_tbl[] __initdata = {
2674 { PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_T1, PCI_ANY_ID, PCI_ANY_ID },
2675 { } /* Terminating entry */
2676 };
2677
2678 MODULE_DEVICE_TABLE(pci, t1pci_pci_tbl);
2679 +#endif
2680 MODULE_DESCRIPTION("CAPI4Linux: Driver for AVM T1 PCI card");
2681 MODULE_AUTHOR("Carsten Paeth");
2682 MODULE_LICENSE("GPL");
2683 @@ -264,9 +267,9 @@ static int __init t1pci_init(void)
2684 }
2685 pci_set_master(dev);
2686
2687 - param.port = pci_resource_start(dev, 1);
2688 + param.port = pci_resource_start_io(dev, 1);
2689 param.irq = dev->irq;
2690 - param.membase = pci_resource_start(dev, 0);
2691 + param.membase = pci_resource_start_mem(dev, 0);
2692
2693 printk(KERN_INFO
2694 "%s: PCI BIOS reports AVM-T1-PCI at i/o %#x, irq %d, mem %#x\n",
2695 Index: linux-2.4.35.4/drivers/isdn/divert/divert_procfs.c
2696 ===================================================================
2697 --- linux-2.4.35.4.orig/drivers/isdn/divert/divert_procfs.c
2698 +++ linux-2.4.35.4/drivers/isdn/divert/divert_procfs.c
2699 @@ -1,4 +1,4 @@
2700 -/* $Id: divert_procfs.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
2701 +/* $Id$
2702 *
2703 * Filesystem handling for the diversion supplementary services.
2704 *
2705 @@ -14,13 +14,16 @@
2706 #include <linux/module.h>
2707 #include <linux/version.h>
2708 #include <linux/poll.h>
2709 +#ifndef COMPAT_USE_MODCOUNT_LOCK
2710 #include <linux/smp_lock.h>
2711 +#endif
2712 #ifdef CONFIG_PROC_FS
2713 #include <linux/proc_fs.h>
2714 #else
2715 #include <linux/fs.h>
2716 #endif
2717 #include <linux/isdnif.h>
2718 +#include <linux/isdn_compat.h>
2719 #include "isdn_divert.h"
2720
2721 /*********************************/
2722 @@ -80,7 +83,6 @@ static ssize_t
2723 isdn_divert_read(struct file *file, char *buf, size_t count, loff_t * off)
2724 {
2725 struct divert_info *inf;
2726 - loff_t pos = *off;
2727 int len;
2728
2729 if (!*((struct divert_info **) file->private_data)) {
2730 @@ -92,11 +94,11 @@ isdn_divert_read(struct file *file, char
2731 return (0);
2732
2733 inf->usage_cnt--; /* new usage count */
2734 - file->private_data = &inf->next; /* next structure */
2735 + (struct divert_info **) file->private_data = &inf->next; /* next structure */
2736 if ((len = strlen(inf->info_start)) <= count) {
2737 if (copy_to_user(buf, inf->info_start, len))
2738 return -EFAULT;
2739 - *off = pos + len;
2740 + file->f_pos += len;
2741 return (len);
2742 }
2743 return (0);
2744 @@ -136,17 +138,23 @@ isdn_divert_open(struct inode *ino, stru
2745 {
2746 unsigned long flags;
2747
2748 +#ifdef COMPAT_USE_MODCOUNT_LOCK
2749 + MOD_INC_USE_COUNT;
2750 +#else
2751 lock_kernel();
2752 +#endif
2753 save_flags(flags);
2754 cli();
2755 if_used++;
2756 if (divert_info_head)
2757 - filep->private_data = &(divert_info_tail->next);
2758 + (struct divert_info **) filep->private_data = &(divert_info_tail->next);
2759 else
2760 - filep->private_data = &divert_info_head;
2761 + (struct divert_info **) filep->private_data = &divert_info_head;
2762 restore_flags(flags);
2763 /* start_divert(); */
2764 +#ifndef COMPAT_USE_MODCOUNT_LOCK
2765 unlock_kernel();
2766 +#endif
2767 return (0);
2768 } /* isdn_divert_open */
2769
2770 @@ -159,7 +167,9 @@ isdn_divert_close(struct inode *ino, str
2771 struct divert_info *inf;
2772 unsigned long flags;
2773
2774 +#ifndef COMPAT_USE_MODCOUNT_LOCK
2775 lock_kernel();
2776 +#endif
2777 save_flags(flags);
2778 cli();
2779 if_used--;
2780 @@ -175,7 +185,11 @@ isdn_divert_close(struct inode *ino, str
2781 divert_info_head = divert_info_head->next;
2782 kfree(inf);
2783 }
2784 +#ifdef COMPAT_USE_MODCOUNT_LOCK
2785 + MOD_DEC_USE_COUNT;
2786 +#else
2787 unlock_kernel();
2788 +#endif
2789 return (0);
2790 } /* isdn_divert_close */
2791
2792 @@ -276,6 +290,9 @@ static struct file_operations isdn_fops
2793 open: isdn_divert_open,
2794 release: isdn_divert_close,
2795 };
2796 +#ifdef COMPAT_NO_SOFTNET
2797 +struct inode_operations divert_file_inode_operations;
2798 +#endif
2799
2800 /****************************/
2801 /* isdn subdir in /proc/net */
2802 @@ -302,8 +319,16 @@ divert_dev_init(void)
2803 remove_proc_entry("isdn", proc_net);
2804 return (-1);
2805 }
2806 +#ifdef COMPAT_NO_SOFTNET
2807 + memset(&divert_file_inode_operations, 0, sizeof(struct inode_operations));
2808 + divert_file_inode_operations.default_file_ops = &isdn_fops;
2809 + isdn_divert_entry->ops = &divert_file_inode_operations;
2810 +#else
2811 isdn_divert_entry->proc_fops = &isdn_fops;
2812 +#ifdef COMPAT_HAS_FILEOP_OWNER
2813 isdn_divert_entry->owner = THIS_MODULE;
2814 +#endif
2815 +#endif /* COMPAT_NO_SOFTNET */
2816 #endif /* CONFIG_PROC_FS */
2817
2818 return (0);
2819 Index: linux-2.4.35.4/drivers/isdn/divert/isdn_divert.c
2820 ===================================================================
2821 --- linux-2.4.35.4.orig/drivers/isdn/divert/isdn_divert.c
2822 +++ linux-2.4.35.4/drivers/isdn/divert/isdn_divert.c
2823 @@ -1,4 +1,4 @@
2824 -/* $Id: isdn_divert.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
2825 +/* $Id$
2826 *
2827 * DSS1 main diversion supplementary handling for i4l.
2828 *
2829 @@ -84,6 +84,9 @@ static void deflect_timer_expire(ulong a
2830 restore_flags(flags);
2831 break;
2832
2833 + case NETWORK_DIAL:
2834 + divert_if.dial_net_name(cs->deflect_dest);
2835 +
2836 case DEFLECT_AUTODEL:
2837 default:
2838 save_flags(flags);
2839 @@ -452,6 +455,7 @@ int isdn_divert_icall(isdn_ctrl *ic)
2840 case DEFLECT_PROCEED:
2841 case DEFLECT_REPORT:
2842 case DEFLECT_REJECT:
2843 + case NETWORK_DIAL:
2844 if (dv->rule.action == DEFLECT_PROCEED)
2845 if ((!if_used) || ((!extern_wait_max) && (!dv->rule.waittime)))
2846 return(0); /* no external deflection needed */
2847 @@ -495,6 +499,11 @@ int isdn_divert_icall(isdn_ctrl *ic)
2848 else
2849 { cs->deflect_dest[0] = '\0';
2850 retval = 4; /* only proceed */
2851 + if (cs->akt_state == NETWORK_DIAL) {
2852 + strcpy(cs->deflect_dest,dv->rule.to_nr);
2853 + cs->timer.expires = jiffies + 10;
2854 + retval = 0;
2855 + }
2856 }
2857 sprintf(cs->info,"%d 0x%lx %s %s %s %s 0x%x 0x%x %d %d %s\n",
2858 cs->akt_state,
2859 @@ -739,6 +748,18 @@ int prot_stat_callback(isdn_ctrl *ic)
2860 }
2861
2862
2863 +#if 0
2864 + sprintf(st, "0x%lx 0x%lx",ic->arg, ic->parm.dss1_io.ll_id);
2865 + p = st + strlen(st);
2866 + p1 = ic->parm.dss1_io.data;
2867 + i = ic->parm.dss1_io.datalen;
2868 + while ((i > 0) && (p - st < 530))
2869 + { p += sprintf(p," %02x",(*p1++) & 0xFF);
2870 + i--;
2871 + }
2872 + sprintf(p, "\n");
2873 + put_info_buffer(st);
2874 +#endif
2875 break;
2876
2877 default:
2878 Index: linux-2.4.35.4/drivers/isdn/divert/isdn_divert.h
2879 ===================================================================
2880 --- linux-2.4.35.4.orig/drivers/isdn/divert/isdn_divert.h
2881 +++ linux-2.4.35.4/drivers/isdn/divert/isdn_divert.h
2882 @@ -1,4 +1,4 @@
2883 -/* $Id: isdn_divert.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
2884 +/* $Id$
2885 *
2886 * Header for the diversion supplementary ioctl interface.
2887 *
2888 @@ -36,9 +36,10 @@
2889 #define DEFLECT_PROCEED 2 /* deflect when externally triggered */
2890 #define DEFLECT_ALERT 3 /* alert and deflect after delay */
2891 #define DEFLECT_REJECT 4 /* reject immediately */
2892 -#define DIVERT_ACTIVATE 5 /* diversion activate */
2893 -#define DIVERT_DEACTIVATE 6 /* diversion deactivate */
2894 -#define DIVERT_REPORT 7 /* interrogation result */
2895 +#define NETWORK_DIAL 5 /* dial a network interface */
2896 +#define DIVERT_ACTIVATE 16 /* diversion activate */
2897 +#define DIVERT_DEACTIVATE 17 /* diversion deactivate */
2898 +#define DIVERT_REPORT 18 /* interrogation result */
2899 #define DEFLECT_AUTODEL 255 /* only for internal use */
2900
2901 #define DEFLECT_ALL_IDS 0xFFFFFFFF /* all drivers selected */
2902 @@ -60,6 +61,7 @@ typedef struct
2903 2 = report call, send proceed, wait max waittime secs
2904 3 = report call, alert and deflect after waittime
2905 4 = report call, reject immediately
2906 + 5 = dial net interface specified in to_nr
2907 actions 1-2 only take place if interface is opened
2908 */
2909 u_char waittime; /* maximum wait time for proceeding */
2910 Index: linux-2.4.35.4/drivers/isdn/eicon/Divas_mod.c
2911 ===================================================================
2912 --- linux-2.4.35.4.orig/drivers/isdn/eicon/Divas_mod.c
2913 +++ linux-2.4.35.4/drivers/isdn/eicon/Divas_mod.c
2914 @@ -20,6 +20,7 @@
2915 #include "adapter.h"
2916 #include "uxio.h"
2917
2918 +#include <linux/isdn_compat.h>
2919
2920 MODULE_DESCRIPTION("ISDN4Linux: Driver for Eicon Diva Server cards");
2921 MODULE_AUTHOR("Armin Schindler");
2922 Index: linux-2.4.35.4/drivers/isdn/eicon/common.c
2923 ===================================================================
2924 --- linux-2.4.35.4.orig/drivers/isdn/eicon/common.c
2925 +++ linux-2.4.35.4/drivers/isdn/eicon/common.c
2926 @@ -808,9 +808,7 @@ void DivasDoDpc(void *pData)
2927
2928 while(i--)
2929 {
2930 - if (card->state == DIA_RUNNING)
2931 - DivaDoCardDpc(card);
2932 - card++;
2933 + DivaDoCardDpc(card++);
2934 }
2935 }
2936
2937 Index: linux-2.4.35.4/drivers/isdn/eicon/eicon.h
2938 ===================================================================
2939 --- linux-2.4.35.4.orig/drivers/isdn/eicon/eicon.h
2940 +++ linux-2.4.35.4/drivers/isdn/eicon/eicon.h
2941 @@ -1,4 +1,4 @@
2942 -/* $Id: eicon.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
2943 +/* $Id: eicon.h,v 1.26 2001/09/24 13:22:47 kai Exp $
2944 *
2945 * ISDN low-level module for Eicon active ISDN-Cards.
2946 *
2947 @@ -347,19 +347,19 @@ typedef struct eicon_card {
2948 extern char *eicon_ctype_name[];
2949
2950
2951 -static inline void eicon_schedule_tx(eicon_card *card)
2952 +extern __inline__ void eicon_schedule_tx(eicon_card *card)
2953 {
2954 queue_task(&card->snd_tq, &tq_immediate);
2955 mark_bh(IMMEDIATE_BH);
2956 }
2957
2958 -static inline void eicon_schedule_rx(eicon_card *card)
2959 +extern __inline__ void eicon_schedule_rx(eicon_card *card)
2960 {
2961 queue_task(&card->rcv_tq, &tq_immediate);
2962 mark_bh(IMMEDIATE_BH);
2963 }
2964
2965 -static inline void eicon_schedule_ack(eicon_card *card)
2966 +extern __inline__ void eicon_schedule_ack(eicon_card *card)
2967 {
2968 queue_task(&card->ack_tq, &tq_immediate);
2969 mark_bh(IMMEDIATE_BH);
2970 Index: linux-2.4.35.4/drivers/isdn/eicon/eicon_dsp.h
2971 ===================================================================
2972 --- linux-2.4.35.4.orig/drivers/isdn/eicon/eicon_dsp.h
2973 +++ linux-2.4.35.4/drivers/isdn/eicon/eicon_dsp.h
2974 @@ -1,4 +1,4 @@
2975 -/* $Id: eicon_dsp.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
2976 +/* $Id: eicon_dsp.h,v 1.8 2001/09/24 13:22:47 kai Exp $
2977 *
2978 * ISDN lowlevel-module for Eicon active cards.
2979 * DSP definitions
2980 Index: linux-2.4.35.4/drivers/isdn/eicon/eicon_idi.c
2981 ===================================================================
2982 --- linux-2.4.35.4.orig/drivers/isdn/eicon/eicon_idi.c
2983 +++ linux-2.4.35.4/drivers/isdn/eicon/eicon_idi.c
2984 @@ -1,4 +1,4 @@
2985 -/* $Id: eicon_idi.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
2986 +/* $Id: eicon_idi.c,v 1.45 2001/11/07 22:35:48 kai Exp $
2987 *
2988 * ISDN lowlevel-module for Eicon active cards.
2989 * IDI interface
2990 @@ -25,7 +25,7 @@
2991
2992 #undef EICON_FULL_SERVICE_OKTETT
2993
2994 -char *eicon_idi_revision = "$Revision: 1.1.4.1 $";
2995 +char *eicon_idi_revision = "$Revision: 1.45 $";
2996
2997 eicon_manifbuf *manbuf;
2998
2999 @@ -1583,6 +1583,37 @@ idi_faxdata_rcv(eicon_card *ccard, eicon
3000 return;
3001 }
3002
3003 +#if 0
3004 + eicon_sff_dochead *doc = (eicon_sff_dochead *)skb->data;
3005 + eicon_sff_pagehead *page = (eicon_sff_pagehead *)skb->data + sizeof(eicon_sff_dochead);
3006 +
3007 + printk(KERN_DEBUG"SFF: doc %d / page %d (skb : %d)\n",
3008 + sizeof(eicon_sff_dochead),
3009 + sizeof(eicon_sff_pagehead), skb->len);
3010 +
3011 + if (skb->len >= sizeof(eicon_sff_dochead)) {
3012 + printk(KERN_DEBUG"SFF: id = 0x%x\n", doc->id);
3013 + printk(KERN_DEBUG"SFF: version = 0x%x\n", doc->version);
3014 + printk(KERN_DEBUG"SFF: reserved1 = 0x%x\n", doc->reserved1);
3015 + printk(KERN_DEBUG"SFF: userinfo = 0x%x\n", doc->userinfo);
3016 + printk(KERN_DEBUG"SFF: pagecount = 0x%x\n", doc->pagecount);
3017 + printk(KERN_DEBUG"SFF: off1pagehead = 0x%x\n", doc->off1pagehead);
3018 + printk(KERN_DEBUG"SFF: offnpagehead = 0x%x\n", doc->offnpagehead);
3019 + printk(KERN_DEBUG"SFF: offdocend = 0x%x\n", doc->offdocend);
3020 + }
3021 + if (skb->len >= (sizeof(eicon_sff_dochead) + sizeof(eicon_sff_pagehead))) {
3022 + printk(KERN_DEBUG"SFFp: id = 0x%x\n", page->pageheadid);
3023 + printk(KERN_DEBUG"SFFp: len = 0x%x\n", page->pageheadlen);
3024 + printk(KERN_DEBUG"SFFp: resvert = 0x%x\n", page->resvert);
3025 + printk(KERN_DEBUG"SFFp: reshoriz = 0x%x\n", page->reshoriz);
3026 + printk(KERN_DEBUG"SFFp: coding = 0x%x\n", page->coding);
3027 + printk(KERN_DEBUG"SFFp: reserved2 = 0x%x\n", page->reserved2);
3028 + printk(KERN_DEBUG"SFFp: linelength = 0x%x\n", page->linelength);
3029 + printk(KERN_DEBUG"SFFp: pagelength = 0x%x\n", page->pagelength);
3030 + printk(KERN_DEBUG"SFFp: offprevpage = 0x%x\n", page->offprevpage);
3031 + printk(KERN_DEBUG"SFFp: offnextpage = 0x%x\n", page->offnextpage);
3032 + }
3033 +#endif
3034
3035
3036 if (chan->fax->direction == ISDN_TTY_FAX_CONN_IN) {
3037 @@ -2054,8 +2085,7 @@ idi_faxdata_send(eicon_card *ccard, eico
3038 OutBuf.Len++;
3039 } else {
3040 *OutBuf.Next++ = 0;
3041 - *(__u16 *) OutBuf.Next = (__u16) LineBuf.Len;
3042 - OutBuf.Next += sizeof(__u16);
3043 + *((__u16 *) OutBuf.Next)++ = (__u16) LineBuf.Len;
3044 OutBuf.Len += 3;
3045 }
3046 memcpy(OutBuf.Next, LineBuf.Data, LineBuf.Len);
3047 @@ -2385,6 +2415,12 @@ idi_handle_ind(eicon_card *ccard, struct
3048 } else {
3049 if (chan->e.B2Id)
3050 idi_do_req(ccard, chan, REMOVE, 1);
3051 +#if 0
3052 + if (chan->e.D3Id) {
3053 + idi_do_req(ccard, chan, REMOVE, 0);
3054 + idi_do_req(ccard, chan, ASSIGN, 0);
3055 + }
3056 +#endif
3057 chan->statectrl &= ~WAITING_FOR_HANGUP;
3058 chan->statectrl &= ~IN_HOLD;
3059 if (chan->statectrl & HAVE_CONN_REQ) {
3060 Index: linux-2.4.35.4/drivers/isdn/eicon/eicon_idi.h
3061 ===================================================================
3062 --- linux-2.4.35.4.orig/drivers/isdn/eicon/eicon_idi.h
3063 +++ linux-2.4.35.4/drivers/isdn/eicon/eicon_idi.h
3064 @@ -1,4 +1,4 @@
3065 -/* $Id: eicon_idi.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
3066 +/* $Id: eicon_idi.h,v 1.12 2001/09/24 13:22:47 kai Exp $
3067 *
3068 * ISDN lowlevel-module for the Eicon active cards.
3069 * IDI-Interface
3070 Index: linux-2.4.35.4/drivers/isdn/eicon/eicon_io.c
3071 ===================================================================
3072 --- linux-2.4.35.4.orig/drivers/isdn/eicon/eicon_io.c
3073 +++ linux-2.4.35.4/drivers/isdn/eicon/eicon_io.c
3074 @@ -1,4 +1,4 @@
3075 -/* $Id: eicon_io.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
3076 +/* $Id: eicon_io.c,v 1.15 2001/09/24 13:22:47 kai Exp $
3077 *
3078 * ISDN low-level module for Eicon active ISDN-Cards.
3079 * Code for communicating with hardware.
3080 Index: linux-2.4.35.4/drivers/isdn/eicon/eicon_isa.c
3081 ===================================================================
3082 --- linux-2.4.35.4.orig/drivers/isdn/eicon/eicon_isa.c
3083 +++ linux-2.4.35.4/drivers/isdn/eicon/eicon_isa.c
3084 @@ -1,4 +1,4 @@
3085 -/* $Id: eicon_isa.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
3086 +/* $Id: eicon_isa.c,v 1.18 2001/11/07 22:35:48 kai Exp $
3087 *
3088 * ISDN low-level module for Eicon active ISDN-Cards.
3089 * Hardware-specific code for old ISA cards.
3090 @@ -20,7 +20,7 @@
3091 #define release_shmem release_region
3092 #define request_shmem request_region
3093
3094 -char *eicon_isa_revision = "$Revision: 1.1.4.1 $";
3095 +char *eicon_isa_revision = "$Revision: 1.18 $";
3096
3097 #undef EICON_MCA_DEBUG
3098
3099 @@ -38,8 +38,12 @@ static int eicon_isa_valid_irq[] = {
3100 static void
3101 eicon_isa_release_shmem(eicon_isa_card *card) {
3102 if (card->mvalid) {
3103 +#ifdef COMPAT_HAS_ISA_IOREMAP
3104 iounmap(card->shmem);
3105 release_mem_region(card->physmem, card->ramsize);
3106 +#else
3107 + release_shmem((unsigned long)card->shmem, card->ramsize);
3108 +#endif
3109 }
3110 card->mvalid = 0;
3111 }
3112 @@ -94,12 +98,20 @@ eicon_isa_find_card(int Mem, int Irq, ch
3113 Mem, Id);
3114 return -1;
3115 }
3116 +#ifdef COMPAT_HAS_ISA_IOREMAP
3117 if (check_mem_region(Mem, RAMSIZE)) {
3118 +#else
3119 + if (check_shmem(Mem, RAMSIZE)) {
3120 +#endif
3121 printk(KERN_WARNING "eicon_isa_boot: memory at 0x%x already in use.\n", Mem);
3122 return -1;
3123 }
3124
3125 +#ifdef COMPAT_HAS_ISA_IOREMAP
3126 amem = (unsigned long) ioremap(Mem, RAMSIZE);
3127 +#else
3128 + amem = (unsigned long) Mem;
3129 +#endif
3130 writew(0x55aa, amem + 0x402);
3131 if (readw(amem + 0x402) != 0x55aa) primary = 0;
3132 writew(0, amem + 0x402);
3133 @@ -109,12 +121,16 @@ eicon_isa_find_card(int Mem, int Irq, ch
3134 if (primary) {
3135 printk(KERN_INFO "Eicon: assuming pri card at 0x%x\n", Mem);
3136 writeb(0, amem + 0x3ffe);
3137 +#ifdef COMPAT_HAS_ISA_IOREMAP
3138 iounmap((unsigned char *)amem);
3139 +#endif
3140 return EICON_CTYPE_ISAPRI;
3141 } else {
3142 printk(KERN_INFO "Eicon: assuming bri card at 0x%x\n", Mem);
3143 writeb(0, amem + 0x400);
3144 +#ifdef COMPAT_HAS_ISA_IOREMAP
3145 iounmap((unsigned char *)amem);
3146 +#endif
3147 return EICON_CTYPE_ISABRI;
3148 }
3149 return -1;
3150 @@ -151,6 +167,7 @@ eicon_isa_bootload(eicon_isa_card *card,
3151 else
3152 card->ramsize = RAMSIZE;
3153
3154 +#ifdef COMPAT_HAS_ISA_IOREMAP
3155 if (check_mem_region(card->physmem, card->ramsize)) {
3156 printk(KERN_WARNING "eicon_isa_boot: memory at 0x%lx already in use.\n",
3157 card->physmem);
3158 @@ -159,6 +176,16 @@ eicon_isa_bootload(eicon_isa_card *card,
3159 }
3160 request_mem_region(card->physmem, card->ramsize, "Eicon ISA ISDN");
3161 card->shmem = (eicon_isa_shmem *) ioremap(card->physmem, card->ramsize);
3162 +#else
3163 + /* Register shmem */
3164 + if (check_shmem((unsigned long)card->shmem, card->ramsize)) {
3165 + printk(KERN_WARNING "eicon_isa_boot: memory at 0x%lx already in use.\n",
3166 + (unsigned long)card->shmem);
3167 + kfree(code);
3168 + return -EBUSY;
3169 + }
3170 + request_shmem((unsigned long)card->shmem, card->ramsize, "Eicon ISA ISDN");
3171 +#endif
3172 #ifdef EICON_MCA_DEBUG
3173 printk(KERN_INFO "eicon_isa_boot: card->ramsize = %d.\n", card->ramsize);
3174 #endif
3175 Index: linux-2.4.35.4/drivers/isdn/eicon/eicon_isa.h
3176 ===================================================================
3177 --- linux-2.4.35.4.orig/drivers/isdn/eicon/eicon_isa.h
3178 +++ linux-2.4.35.4/drivers/isdn/eicon/eicon_isa.h
3179 @@ -1,4 +1,4 @@
3180 -/* $Id: eicon_isa.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
3181 +/* $Id: eicon_isa.h,v 1.11 2001/09/24 13:22:47 kai Exp $
3182 *
3183 * ISDN low-level module for Eicon active ISDN-Cards.
3184 *
3185 Index: linux-2.4.35.4/drivers/isdn/eicon/eicon_mod.c
3186 ===================================================================
3187 --- linux-2.4.35.4.orig/drivers/isdn/eicon/eicon_mod.c
3188 +++ linux-2.4.35.4/drivers/isdn/eicon/eicon_mod.c
3189 @@ -1,4 +1,4 @@
3190 -/* $Id: eicon_mod.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
3191 +/* $Id: eicon_mod.c,v 1.44 2001/11/20 09:48:25 armin Exp $
3192 *
3193 * ISDN lowlevel-module for Eicon active cards.
3194 *
3195 @@ -44,7 +44,7 @@
3196 static eicon_card *cards = (eicon_card *) NULL; /* glob. var , contains
3197 start of card-list */
3198
3199 -static char *eicon_revision = "$Revision: 1.1.4.1 $";
3200 +static char *eicon_revision = "$Revision: 1.44 $";
3201
3202 extern char *eicon_pci_revision;
3203 extern char *eicon_isa_revision;
3204 @@ -639,6 +639,18 @@ if_command(isdn_ctrl * c)
3205 static int
3206 if_writecmd(const u_char * buf, int len, int user, int id, int channel)
3207 {
3208 +#if 0
3209 + /* Not yet used */
3210 + eicon_card *card = eicon_findcard(id);
3211 +
3212 + if (card) {
3213 + if (!card->flags & EICON_FLAGS_RUNNING)
3214 + return (len);
3215 + return (len);
3216 + }
3217 + printk(KERN_ERR
3218 + "eicon: if_writecmd called with invalid driverId!\n");
3219 +#endif
3220 return (len);
3221 }
3222
3223 @@ -665,11 +677,8 @@ if_readstatus(u_char * buf, int len, int
3224 else
3225 cnt = skb->len;
3226
3227 - if (user) {
3228 - spin_unlock_irqrestore(&eicon_lock, flags);
3229 + if (user)
3230 copy_to_user(p, skb->data, cnt);
3231 - spin_lock_irqsave(&eicon_lock, flags);
3232 - }
3233 else
3234 memcpy(p, skb->data, cnt);
3235
3236 @@ -1459,6 +1468,7 @@ eicon_exit(void)
3237
3238 #ifndef MODULE
3239
3240 +#ifdef COMPAT_HAS_NEW_SETUP
3241 static int __init
3242 eicon_setup(char *line)
3243 {
3244 @@ -1467,6 +1477,12 @@ eicon_setup(char *line)
3245 char *str;
3246
3247 str = get_options(line, 4, ints);
3248 +#else
3249 +void
3250 +eicon_setup(char *str, int *ints)
3251 +{
3252 + int i, argc;
3253 +#endif
3254
3255 argc = ints[0];
3256 i = 1;
3257 @@ -1494,9 +1510,13 @@ eicon_setup(char *line)
3258 #else
3259 printk(KERN_INFO "Eicon ISDN active driver setup\n");
3260 #endif
3261 +#ifdef COMPAT_HAS_NEW_SETUP
3262 return(1);
3263 }
3264 __setup("eicon=", eicon_setup);
3265 +#else
3266 +}
3267 +#endif
3268
3269 #endif /* MODULE */
3270
3271 Index: linux-2.4.35.4/drivers/isdn/eicon/eicon_pci.c
3272 ===================================================================
3273 --- linux-2.4.35.4.orig/drivers/isdn/eicon/eicon_pci.c
3274 +++ linux-2.4.35.4/drivers/isdn/eicon/eicon_pci.c
3275 @@ -1,4 +1,4 @@
3276 -/* $Id: eicon_pci.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
3277 +/* $Id: eicon_pci.c,v 1.18 2001/09/24 13:22:47 kai Exp $
3278 *
3279 * ISDN low-level module for Eicon active ISDN-Cards.
3280 * Hardware-specific code for PCI cards.
3281 @@ -24,7 +24,7 @@
3282 #include "adapter.h"
3283 #include "uxio.h"
3284
3285 -char *eicon_pci_revision = "$Revision: 1.1.4.1 $";
3286 +char *eicon_pci_revision = "$Revision: 1.18 $";
3287
3288 #if CONFIG_PCI /* intire stuff is only for PCI */
3289 #ifdef CONFIG_ISDN_DRV_EICON_PCI
3290 Index: linux-2.4.35.4/drivers/isdn/eicon/eicon_pci.h
3291 ===================================================================
3292 --- linux-2.4.35.4.orig/drivers/isdn/eicon/eicon_pci.h
3293 +++ linux-2.4.35.4/drivers/isdn/eicon/eicon_pci.h
3294 @@ -1,4 +1,4 @@
3295 -/* $Id: eicon_pci.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
3296 +/* $Id: eicon_pci.h,v 1.7 2001/09/24 13:22:47 kai Exp $
3297 *
3298 * ISDN low-level module for Eicon active ISDN-Cards (PCI part).
3299 *
3300 Index: linux-2.4.35.4/drivers/isdn/eicon/fourbri.c
3301 ===================================================================
3302 --- linux-2.4.35.4.orig/drivers/isdn/eicon/fourbri.c
3303 +++ linux-2.4.35.4/drivers/isdn/eicon/fourbri.c
3304 @@ -337,8 +337,7 @@ static int diva_server_4bri_load(card_t
3305 static int diva_server_4bri_start(card_t *card, byte *channels)
3306 {
3307 byte *ctl;
3308 - byte *shared;
3309 - int i;
3310 + byte *shared, i;
3311 int adapter_num;
3312
3313 DPRINTF(("divas: start Diva Server 4BRI"));
3314 Index: linux-2.4.35.4/drivers/isdn/eicon/kprintf.c
3315 ===================================================================
3316 --- linux-2.4.35.4.orig/drivers/isdn/eicon/kprintf.c
3317 +++ linux-2.4.35.4/drivers/isdn/eicon/kprintf.c
3318 @@ -18,6 +18,468 @@
3319 #include "divalog.h"
3320 #include "uxio.h"
3321
3322 +/*
3323 + * Implementation of printf and sprintf for kernel
3324 + */
3325 +
3326 +#define MAX_BUFF (80) /* limit size of temporary buffers */
3327 +
3328 +#define WRITE_CHAR(BUFFER, SIZE, C) \
3329 + if (--(SIZE) < 0) { (BUFFER)--; *(BUFFER) = '\0'; return; } *(BUFFER)++ = (C)
3330 +
3331 +
3332 +/*
3333 + * convert a number to decimal ASCII
3334 + */
3335 +
3336 +static
3337 +void do_decimal( char *temp,
3338 + int temp_len,
3339 + unsigned int value,
3340 + char *s)
3341 +
3342 +{
3343 + int i;
3344 +
3345 + temp[0] = '\0';
3346 +
3347 + for (i = 1; i < temp_len; i++)
3348 + {
3349 + temp[i] = (char) ((value % 10) + (int) '0');
3350 + value /= 10;
3351 + }
3352 +
3353 + for (i = (temp_len - 1); temp[i] == '0'; i--)
3354 + {
3355 + ;
3356 + }
3357 +
3358 + if (i == 0)
3359 + {
3360 + i++;
3361 + }
3362 +
3363 + while (i >= 0)
3364 + {
3365 + *s++ = temp[i--];
3366 + }
3367 +
3368 + return;
3369 +}
3370 +
3371 +/*
3372 + * convert a number to octal ASCII
3373 + */
3374 +
3375 +static
3376 +void do_octal( char *temp,
3377 + unsigned int value,
3378 + char *s)
3379 +
3380 +{
3381 + int i;
3382 +
3383 + temp[0] = '\0';
3384 +
3385 + for (i = 1; i <= 11; i++)
3386 + {
3387 + temp[i] = (char) ((value & 07) + (int) '0');
3388 + value >>= 3;
3389 + }
3390 + temp[11] &= '3';
3391 +
3392 + for (i = 11; temp[i] == '0'; i--)
3393 + {
3394 + ;
3395 + }
3396 +
3397 + if (i == 0)
3398 + {
3399 + i++;
3400 + }
3401 +
3402 + while (i >= 0)
3403 + {
3404 + *s++ = temp[i--];
3405 + }
3406 +
3407 + return;
3408 +}
3409 +
3410 +/*
3411 + * convert a number to hex ASCII
3412 + */
3413 +
3414 +static
3415 +void do_hex( char *temp,
3416 + unsigned int value,
3417 + char *s)
3418 +
3419 +{
3420 + int i;
3421 + static
3422 + char *dec_to_hex = "0123456789abcdef";
3423 +
3424 + temp[0] = '\0';
3425 +
3426 + for (i = 1; i <= 8; i++)
3427 + {
3428 + temp[i] = dec_to_hex[value & 0x0f];
3429 + value >>= 4;
3430 + }
3431 +
3432 + for (i = 8; temp[i] == '0'; i--)
3433 + {
3434 + ;
3435 + }
3436 +
3437 + if (i == 0)
3438 + {
3439 + i++;
3440 + }
3441 +
3442 + while (i >= 0)
3443 + {
3444 + *s++ = temp[i--];
3445 + }
3446 +
3447 + return;
3448 +}
3449 +
3450 +/*
3451 + * convert a buffer to ASCII HEX
3452 + */
3453 +
3454 +static
3455 +void do_buffer( char *buffer,
3456 + int length,
3457 + char *s)
3458 +
3459 +{
3460 + static
3461 + char hex_char [] = "0123456789abcdef";
3462 + char *b = buffer;
3463 + int hex_byte;
3464 + int nybble;
3465 +
3466 + length = (length >= ((MAX_BUFF / 3) + 1)) ? (MAX_BUFF / 3) : length;
3467 +
3468 + while (length)
3469 + {
3470 + hex_byte = (int) *b++;
3471 + nybble = (hex_byte >> 4) & 0xf;
3472 + *s++ = hex_char[nybble];
3473 + nybble = hex_byte & 0xf;
3474 + *s++ = hex_char[nybble];
3475 + *s++ = ' ';
3476 + length--;
3477 + }
3478 + *s = '\0';
3479 +
3480 + return;
3481 +}
3482 +
3483 +/*
3484 + * Body of sprintf function: behaves just like standard sprintf, except we
3485 + * have an extra argument (buffer size) which we use to ensure we don't
3486 + * overflow
3487 + */
3488 +
3489 +void Divas_vsprintf( char *buffer,
3490 + int size,
3491 + char *fmt,
3492 + va_list argptr)
3493 +
3494 +{
3495 + char c; /* single character buffer */
3496 + int i; /* handy scratch counter */
3497 + int f; /* format character (after %) */
3498 + char *str; /* pointer into string */
3499 + char temp[20]; /* temp buffer used in printing numbers */
3500 + char string[MAX_BUFF]; /* output from number conversion */
3501 + int length; /* length of string "str" */
3502 + char fill; /* fill character ' ' or '0' */
3503 + boolean_t leftjust; /* TRUE if left justified, else right justified */
3504 + int fmax, fmin; /* field specifiers % MIN . MAX s */
3505 + int leading; /* number of leading/trailing fill characters */
3506 + char sign; /* set to '-' for negative decimals */
3507 + int number; /* numeric argument */
3508 +
3509 + char *buff_ptr; /* pointer to user's buffer of hex data */
3510 + int buff_len; /* length of hex data */
3511 +
3512 + /* make sure we have somthing to write into */
3513 +
3514 + if ((!buffer) || (size <= 0))
3515 + {
3516 + return;
3517 + }
3518 +
3519 + while (TRUE)
3520 + {
3521 + /* echo characters until end or '%' encountered */
3522 +
3523 + while ((c = *fmt++) != '%')
3524 + {
3525 + if (!c)
3526 + {
3527 + *buffer = '\0';
3528 + return;
3529 + }
3530 + WRITE_CHAR(buffer, size, c);
3531 + }
3532 +
3533 + /* echo %% as % */
3534 +
3535 + if (*fmt == '%')
3536 + {
3537 + WRITE_CHAR(buffer, size, *fmt);
3538 + continue;
3539 + }
3540 +
3541 + /* %- turns on left-justify */
3542 +
3543 + if ((leftjust = (boolean_t) ((*fmt == '-') ? TRUE : FALSE)))
3544 + {
3545 + fmt++;
3546 + }
3547 +
3548 + /* %0 turns on zero filling */
3549 +
3550 + if (*fmt == '0')
3551 + {
3552 + fill = '0';
3553 + }
3554 + else
3555 + {
3556 + fill = ' ';
3557 + }
3558 +
3559 + /* minium field width specifier for %d, u, x, c, s */
3560 +
3561 + fmin = 0;
3562 +
3563 + if (*fmt == '*')
3564 + {
3565 + fmin = va_arg(argptr, int);
3566 + fmt++;
3567 + }
3568 + else
3569 + {
3570 + while ('0' <= *fmt && *fmt <= '9')
3571 + {
3572 + fmin = (fmin * 10) + (*fmt++ - '0');
3573 + }
3574 + }
3575 +
3576 + /* maximum string width specifier for %s */
3577 +
3578 + fmax = 0;
3579 +
3580 + if (*fmt == '.')
3581 + {
3582 + if (*(++fmt) == '*')
3583 + {
3584 + fmax = va_arg(argptr, int);
3585 + fmt++;
3586 + }
3587 + else
3588 + {
3589 + while ('0' <= *fmt && *fmt <= '9')
3590 + {
3591 + fmax = (fmax * 10) + (*fmt++ - '0');
3592 + }
3593 + }
3594 + }
3595 +
3596 + /* skip over 'l' option (ints are assumed same size as longs) */
3597 +
3598 + if (*fmt == 'l')
3599 + {
3600 + fmt++;
3601 + }
3602 +
3603 + /* get the format chacater */
3604 +
3605 + if (!(f = *fmt++))
3606 + {
3607 + WRITE_CHAR(buffer, size, '%');
3608 + *buffer = '\0';
3609 + return;
3610 + }
3611 +
3612 + sign = '\0'; /* sign == '-' for negative decimal */
3613 +
3614 + str = string;
3615 +
3616 + switch (f)
3617 + {
3618 + case 'c' :
3619 + string[0] = (char) va_arg(argptr, int);
3620 + string[1] = '\0';
3621 + fmax = 0;
3622 + fill = ' ';
3623 + break;
3624 +
3625 + case 's' :
3626 + str = va_arg(argptr, char *);
3627 + fill = ' ';
3628 + break;
3629 +
3630 + case 'D' :
3631 + case 'd' :
3632 + number = va_arg(argptr, int);
3633 + if (number < 0)
3634 + {
3635 + sign = '-';
3636 + number = -number;
3637 + }
3638 + do_decimal(temp, DIM(temp), (unsigned int) number, str);
3639 + fmax = 0;
3640 + break;
3641 +
3642 + case 'U' :
3643 + case 'u' :
3644 + number = va_arg(argptr, int);
3645 + do_decimal(temp, DIM(temp), (unsigned int) number, str);
3646 + fmax = 0;
3647 + break;
3648 +
3649 + case 'O' :
3650 + case 'o' :
3651 + number = va_arg(argptr, int);
3652 + do_octal(temp, (unsigned int) number, str);
3653 + fmax = 0;
3654 + break;
3655 +
3656 + case 'X' :
3657 + case 'x' :
3658 + number = va_arg(argptr, int);
3659 + do_hex(temp, (unsigned int) number, str);
3660 + fmax = 0;
3661 + break;
3662 +
3663 + case 'H' :
3664 + case 'h' :
3665 + buff_ptr = va_arg(argptr, char *);
3666 + buff_len = va_arg(argptr, int);
3667 + do_buffer(buff_ptr, buff_len, str);
3668 + fmax = 0;
3669 + break;
3670 +
3671 + default :
3672 + WRITE_CHAR(buffer, size, ((char) f));
3673 + break;
3674 + }
3675 +
3676 + /* get the length of the string */
3677 +
3678 + length = 0;
3679 + while (str[length])
3680 + {
3681 + length++;
3682 + }
3683 +
3684 + /* make sure we have fmax and fmin values that are O.K. */
3685 +
3686 + if (fmin > DIM(string) || fmin < 0)
3687 + {
3688 + fmin = 0;
3689 + }
3690 +
3691 + if (fmax > DIM(string) || fmax < 0)
3692 + {
3693 + fmax = 0;
3694 + }
3695 +
3696 + /* figure out how many leading characters thare are */
3697 +
3698 + leading = 0;
3699 +
3700 + if (fmax || fmin)
3701 + {
3702 + if (fmax)
3703 + {
3704 + if (length > fmax)
3705 + {
3706 + length = fmax;
3707 + }
3708 + }
3709 +
3710 + if (fmin)
3711 + {
3712 + leading = fmin - length;
3713 + }
3714 +
3715 + if (sign == '-')
3716 + {
3717 + leading--;
3718 + }
3719 + }
3720 +
3721 + /* output sign now, if fill is numeric */
3722 +
3723 + if (sign == '-' && fill == '0')
3724 + {
3725 + WRITE_CHAR(buffer, size, '-');
3726 + }
3727 +
3728 + /* if right justified, output fill characters */
3729 +
3730 + if (!leftjust)
3731 + {
3732 + for (i = 0; i < leading; i++)
3733 + {
3734 + WRITE_CHAR(buffer, size, fill);
3735 + }
3736 + }
3737 +
3738 + /* output sign now, if fill is spaces */
3739 +
3740 + if (sign == '-' && fill == ' ')
3741 + {
3742 + WRITE_CHAR(buffer, size, '-');
3743 + }
3744 +
3745 + /* now the actual value */
3746 +
3747 + for (i = 0; i < length; i++)
3748 + {
3749 + WRITE_CHAR(buffer, size, str[i]);
3750 + }
3751 +
3752 + /* if left justified, fill out with the fill character */
3753 +
3754 + if (leftjust)
3755 + {
3756 + for (i = 0; i < leading; i++)
3757 + {
3758 + WRITE_CHAR(buffer, size, fill);
3759 + }
3760 + }
3761 + }
3762 +}
3763 +
3764 +/*
3765 + * sprintf for kernel
3766 + *
3767 + * call our vsprintf assuming user has a big buffer....
3768 + */
3769 +
3770 +void DivasSprintf(char *buffer, char *fmt, ...)
3771 +
3772 +{
3773 + va_list argptr; /* pointer to additional args */
3774 +
3775 + va_start(argptr, fmt);
3776 +
3777 + Divas_vsprintf(buffer, 1024, fmt, argptr);
3778 +
3779 + va_end(argptr);
3780 +
3781 + return;
3782 +}
3783 +
3784 void DivasPrintf(char *fmt, ...)
3785
3786 {
3787 @@ -40,7 +502,7 @@ void DivasPrintf(char *fmt, ...)
3788
3789 /* call vsprintf to format the user's information */
3790
3791 - vsnprintf(log.buffer, DIM(log.buffer), fmt, argptr);
3792 + Divas_vsprintf(log.buffer, DIM(log.buffer), fmt, argptr);
3793
3794 va_end(argptr);
3795
3796 Index: linux-2.4.35.4/drivers/isdn/eicon/lincfg.c
3797 ===================================================================
3798 --- linux-2.4.35.4.orig/drivers/isdn/eicon/lincfg.c
3799 +++ linux-2.4.35.4/drivers/isdn/eicon/lincfg.c
3800 @@ -26,6 +26,9 @@
3801 #include "uxio.h"
3802
3803 #include <linux/pci.h>
3804 +#ifndef COMPAT_HAS_2_2_PCI
3805 +#include <linux/pci_ids.h>
3806 +#endif
3807 #include <linux/kernel.h>
3808 #include <linux/ioport.h>
3809
3810 Index: linux-2.4.35.4/drivers/isdn/eicon/linchr.c
3811 ===================================================================
3812 --- linux-2.4.35.4.orig/drivers/isdn/eicon/linchr.c
3813 +++ linux-2.4.35.4/drivers/isdn/eicon/linchr.c
3814 @@ -154,17 +154,17 @@ ssize_t do_read(struct file *pFile, char
3815 klog_t *pHeadItem;
3816
3817 if (BufferSize < sizeof(klog_t))
3818 + {
3819 + printk(KERN_WARNING "Divas: Divalog buffer specifed a size that is too small (%d - %d required)\n",
3820 + BufferSize, sizeof(klog_t));
3821 return -EIO;
3822 + }
3823
3824 pHeadItem = (klog_t *) DivasLogFifoRead();
3825
3826 if (pHeadItem)
3827 {
3828 - if(copy_to_user(pClientLogBuffer, pHeadItem, sizeof(klog_t)))
3829 - {
3830 - kfree(pHeadItem);
3831 - return -EFAULT;
3832 - }
3833 + memcpy(pClientLogBuffer, pHeadItem, sizeof(klog_t));
3834 kfree(pHeadItem);
3835 return sizeof(klog_t);
3836 }
3837 Index: linux-2.4.35.4/drivers/isdn/eicon/linio.c
3838 ===================================================================
3839 --- linux-2.4.35.4.orig/drivers/isdn/eicon/linio.c
3840 +++ linux-2.4.35.4/drivers/isdn/eicon/linio.c
3841 @@ -15,6 +15,7 @@
3842 #include <linux/slab.h>
3843 #include <linux/pci.h>
3844 #include <linux/delay.h>
3845 +#include <linux/isdn_compat.h>
3846 #undef N_DATA
3847
3848 #include "uxio.h"
3849 Index: linux-2.4.35.4/drivers/isdn/hisax/Makefile
3850 ===================================================================
3851 --- linux-2.4.35.4.orig/drivers/isdn/hisax/Makefile
3852 +++ linux-2.4.35.4/drivers/isdn/hisax/Makefile
3853 @@ -4,20 +4,17 @@
3854
3855 O_TARGET := vmlinux-obj.o
3856
3857 -# Define maximum number of cards
3858 -
3859 -EXTRA_CFLAGS += -DHISAX_MAX_CARDS=$(CONFIG_HISAX_MAX_CARDS)
3860 -
3861 # Objects that export symbols.
3862
3863 -export-objs := config.o hisax_isac.o isdnhdlc.o
3864 +export-objs := config.o fsm.o hisax_isac.o
3865
3866 # Multipart objects.
3867
3868 list-multi := hisax.o hisax_st5481.o
3869 hisax-objs := config.o isdnl1.o tei.o isdnl2.o isdnl3.o \
3870 lmgr.o q931.o callc.o fsm.o cert.o
3871 -hisax_st5481-objs := st5481_init.o st5481_usb.o st5481_d.o st5481_b.o
3872 +hisax_st5481-objs := st5481_init.o st5481_usb.o st5481_d.o st5481_b.o \
3873 + st5481_hdlc.o
3874
3875 # Optional parts of multipart objects.
3876 hisax-objs-$(CONFIG_HISAX_EURO) += l3dss1.o
3877 @@ -33,7 +30,7 @@ hisax-objs-$(CONFIG_HISAX_AVM_A1_PCMCIA)
3878 hisax-objs-$(CONFIG_HISAX_FRITZPCI) += avm_pci.o isac.o arcofi.o
3879 hisax-objs-$(CONFIG_HISAX_ELSA) += elsa.o isac.o arcofi.o hscx.o
3880 hisax-objs-$(CONFIG_HISAX_IX1MICROR2) += ix1_micro.o isac.o arcofi.o hscx.o
3881 -hisax-objs-$(CONFIG_HISAX_DIEHLDIVA) += diva.o isac.o arcofi.o hscx.o ipacx.o
3882 +hisax-objs-$(CONFIG_HISAX_DIEHLDIVA) += diva.o isac.o arcofi.o hscx.o
3883 hisax-objs-$(CONFIG_HISAX_ASUSCOM) += asuscom.o isac.o arcofi.o hscx.o
3884 hisax-objs-$(CONFIG_HISAX_TELEINT) += teleint.o isac.o arcofi.o hfc_2bs0.o
3885 hisax-objs-$(CONFIG_HISAX_SEDLBAUER) += sedlbauer.o isac.o arcofi.o hscx.o isar.o
3886 @@ -44,6 +41,7 @@ hisax-objs-$(CONFIG_HISAX_NETJET_U) += n
3887 hisax-objs-$(CONFIG_HISAX_HFCS) += hfcscard.o hfc_2bds0.o
3888 hisax-objs-$(CONFIG_HISAX_HFC_PCI) += hfc_pci.o
3889 hisax-objs-$(CONFIG_HISAX_HFC_SX) += hfc_sx.o
3890 +hisax-objs-$(CONFIG_HISAX_HFC_USB) += hfc_usbr.o
3891 hisax-objs-$(CONFIG_HISAX_NICCY) += niccy.o isac.o arcofi.o hscx.o
3892 hisax-objs-$(CONFIG_HISAX_ISURF) += isurf.o isac.o arcofi.o isar.o
3893 hisax-objs-$(CONFIG_HISAX_HSTSAPHIR) += saphir.o isac.o arcofi.o hscx.o
3894 @@ -51,7 +49,6 @@ hisax-objs-$(CONFIG_HISAX_BKM_A4T) += bk
3895 hisax-objs-$(CONFIG_HISAX_SCT_QUADRO) += bkm_a8.o isac.o arcofi.o hscx.o
3896 hisax-objs-$(CONFIG_HISAX_GAZEL) += gazel.o isac.o arcofi.o hscx.o
3897 hisax-objs-$(CONFIG_HISAX_W6692) += w6692.o
3898 -hisax-objs-$(CONFIG_HISAX_ENTERNOW_PCI) += enternow_pci.o amd7930_fn.o
3899 #hisax-objs-$(CONFIG_HISAX_TESTEMU) += testemu.o
3900
3901 hisax-objs += $(sort $(hisax-objs-y))
3902 @@ -61,10 +58,9 @@ hisax-objs += $(sort $(hisax-objs-y))
3903 obj-$(CONFIG_ISDN_DRV_HISAX) += hisax.o
3904 obj-$(CONFIG_HISAX_SEDLBAUER_CS) += sedlbauer_cs.o
3905 obj-$(CONFIG_HISAX_ELSA_CS) += elsa_cs.o
3906 -obj-$(CONFIG_HISAX_AVM_A1_CS) += avma1_cs.o
3907 -obj-$(CONFIG_HISAX_ST5481) += hisax_st5481.o isdnhdlc.o
3908 -obj-$(CONFIG_HISAX_FRITZ_PCIPNP) += hisax_isac.o hisax_fcpcipnp.o
3909 -obj-$(CONFIG_USB_AUERISDN) += isdnhdlc.o
3910 +obj-$(CONFIG_HISAX_HFC_USB_CS) += hfc_usb.o
3911 +obj-$(CONFIG_HISAX_ST5481) += hisax_st5481.o
3912 +obj-$(CONFIG_HISAX_FRITZ_PCIPNP) += hisax_fcpcipnp.o hisax_isac.o
3913
3914 CERT := $(shell md5sum -c md5sums.asc >> /dev/null;echo $$?)
3915 CFLAGS_cert.o := -DCERTIFICATION=$(CERT)
3916 Index: linux-2.4.35.4/drivers/isdn/hisax/amd7930.c
3917 ===================================================================
3918 --- /dev/null
3919 +++ linux-2.4.35.4/drivers/isdn/hisax/amd7930.c
3920 @@ -0,0 +1,755 @@
3921 +/* $Id: amd7930.c,v 1.8 2001/09/24 13:22:55 kai Exp $
3922 + *
3923 + * HiSax ISDN driver - chip specific routines for AMD 7930
3924 + *
3925 + * Author Brent Baccala
3926 + * Copyright by Brent Baccala <baccala@FreeSoft.org>
3927 + *
3928 + * This software may be used and distributed according to the terms
3929 + * of the GNU General Public License, incorporated herein by reference.
3930 + *
3931 + * - Existing ISDN HiSax driver provides all the smarts
3932 + * - it compiles, runs, talks to an isolated phone switch, connects
3933 + * to a Cisco, pings go through
3934 + * - AMD 7930 support only (no DBRI yet)
3935 + * - no US NI-1 support (may not work on US phone system - untested)
3936 + * - periodic packet loss, apparently due to lost interrupts
3937 + * - ISDN sometimes freezes, requiring reboot before it will work again
3938 + *
3939 + * The code is unreliable enough to be consider alpha
3940 + *
3941 + * This file is (c) under GNU General Public License
3942 + *
3943 + * Advanced Micro Devices' Am79C30A is an ISDN/audio chip used in the
3944 + * SparcStation 1+. The chip provides microphone and speaker interfaces
3945 + * which provide mono-channel audio at 8K samples per second via either
3946 + * 8-bit A-law or 8-bit mu-law encoding. Also, the chip features an
3947 + * ISDN BRI Line Interface Unit (LIU), I.430 S/T physical interface,
3948 + * which performs basic D channel LAPD processing and provides raw
3949 + * B channel data. The digital audio channel, the two ISDN B channels,
3950 + * and two 64 Kbps channels to the microprocessor are all interconnected
3951 + * via a multiplexer.
3952 + *
3953 + * This driver interfaces to the Linux HiSax ISDN driver, which performs
3954 + * all high-level Q.921 and Q.931 ISDN functions. The file is not
3955 + * itself a hardware driver; rather it uses functions exported by
3956 + * the AMD7930 driver in the sparcaudio subsystem (drivers/sbus/audio),
3957 + * allowing the chip to be simultaneously used for both audio and ISDN data.
3958 + * The hardware driver does _no_ buffering, but provides several callbacks
3959 + * which are called during interrupt service and should therefore run quickly.
3960 + *
3961 + * D channel transmission is performed by passing the hardware driver the
3962 + * address and size of an skb's data area, then waiting for a callback
3963 + * to signal successful transmission of the packet. A task is then
3964 + * queued to notify the HiSax driver that another packet may be transmitted.
3965 + *
3966 + * D channel reception is quite simple, mainly because of:
3967 + * 1) the slow speed of the D channel - 16 kbps, and
3968 + * 2) the presence of an 8- or 32-byte (depending on chip version) FIFO
3969 + * to buffer the D channel data on the chip
3970 + * Worst case scenario of back-to-back packets with the 8 byte buffer
3971 + * at 16 kbps yields an service time of 4 ms - long enough to preclude
3972 + * the need for fancy buffering. We queue a background task that copies
3973 + * data out of the receive buffer into an skb, and the hardware driver
3974 + * simply does nothing until we're done with the receive buffer and
3975 + * reset it for a new packet.
3976 + *
3977 + * B channel processing is more complex, because of:
3978 + * 1) the faster speed - 64 kbps,
3979 + * 2) the lack of any on-chip buffering (it interrupts for every byte), and
3980 + * 3) the lack of any chip support for HDLC encapsulation
3981 + *
3982 + * The HiSax driver can put each B channel into one of three modes -
3983 + * L1_MODE_NULL (channel disabled), L1_MODE_TRANS (transparent data relay),
3984 + * and L1_MODE_HDLC (HDLC encapsulation by low-level driver).
3985 + * L1_MODE_HDLC is the most common, used for almost all "pure" digital
3986 + * data sessions. L1_MODE_TRANS is used for ISDN audio.
3987 + *
3988 + * HDLC B channel transmission is performed via a large buffer into
3989 + * which the skb is copied while performing HDLC bit-stuffing. A CRC
3990 + * is computed and attached to the end of the buffer, which is then
3991 + * passed to the low-level routines for raw transmission. Once
3992 + * transmission is complete, the hardware driver is set to enter HDLC
3993 + * idle by successive transmission of mark (all 1) bytes, waiting for
3994 + * the ISDN driver to prepare another packet for transmission and
3995 + * deliver it.
3996 + *
3997 + * HDLC B channel reception is performed via an X-byte ring buffer
3998 + * divided into N sections of X/N bytes each. Defaults: X=256 bytes, N=4.
3999 + * As the hardware driver notifies us that each section is full, we
4000 + * hand it the next section and schedule a background task to peruse
4001 + * the received section, bit-by-bit, with an HDLC decoder. As
4002 + * packets are detected, they are copied into a large buffer while
4003 + * decoding HDLC bit-stuffing. The ending CRC is verified, and if
4004 + * it is correct, we alloc a new skb of the correct length (which we
4005 + * now know), copy the packet into it, and hand it to the upper layers.
4006 + * Optimization: for large packets, we hand the buffer (which also
4007 + * happens to be an skb) directly to the upper layer after an skb_trim,
4008 + * and alloc a new large buffer for future packets, thus avoiding a copy.
4009 + * Then we return to HDLC processing; state is saved between calls.
4010 + *
4011 + */
4012 +
4013 +#define __NO_VERSION__
4014 +#include "hisax.h"
4015 +#include "../../sbus/audio/amd7930.h"
4016 +#include "isac.h"
4017 +#include "isdnl1.h"
4018 +#include "rawhdlc.h"
4019 +#include <linux/interrupt.h>
4020 +
4021 +static const char *amd7930_revision = "$Revision: 1.8 $";
4022 +
4023 +#define RCV_BUFSIZE 1024 /* Size of raw receive buffer in bytes */
4024 +#define RCV_BUFBLKS 4 /* Number of blocks to divide buffer into
4025 + * (must divide RCV_BUFSIZE) */
4026 +
4027 +static void Bchan_fill_fifo(struct BCState *, struct sk_buff *);
4028 +
4029 +static void
4030 +Bchan_xmt_bh(struct BCState *bcs)
4031 +{
4032 + struct sk_buff *skb;
4033 +
4034 + if (bcs->hw.amd7930.tx_skb != NULL) {
4035 + dev_kfree_skb(bcs->hw.amd7930.tx_skb);
4036 + bcs->hw.amd7930.tx_skb = NULL;
4037 + }
4038 +
4039 + if ((skb = skb_dequeue(&bcs->squeue))) {
4040 + Bchan_fill_fifo(bcs, skb);
4041 + } else {
4042 + clear_bit(BC_FLG_BUSY, &bcs->Flag);
4043 + bcs->event |= 1 << B_XMTBUFREADY;
4044 + queue_task(&bcs->tqueue, &tq_immediate);
4045 + mark_bh(IMMEDIATE_BH);
4046 + }
4047 +}
4048 +
4049 +static void
4050 +Bchan_xmit_callback(struct BCState *bcs)
4051 +{
4052 + queue_task(&bcs->hw.amd7930.tq_xmt, &tq_immediate);
4053 + mark_bh(IMMEDIATE_BH);
4054 +}
4055 +
4056 +/* B channel transmission: two modes (three, if you count L1_MODE_NULL)
4057 + *
4058 + * L1_MODE_HDLC - We need to do HDLC encapsulation before transmiting
4059 + * the packet (i.e. make_raw_hdlc_data). Since this can be a
4060 + * time-consuming operation, our completion callback just schedules
4061 + * a bottom half to do encapsulation for the next packet. In between,
4062 + * the link will just idle
4063 + *
4064 + * L1_MODE_TRANS - Data goes through, well, transparent. No HDLC encap,
4065 + * and we can't just let the link idle, so the "bottom half" actually
4066 + * gets called during the top half (it's our callback routine in this case),
4067 + * but it's a lot faster now since we don't call make_raw_hdlc_data
4068 + */
4069 +
4070 +static void
4071 +Bchan_fill_fifo(struct BCState *bcs, struct sk_buff *skb)
4072 +{
4073 + struct IsdnCardState *cs = bcs->cs;
4074 + int len;
4075 +
4076 + if ((cs->debug & L1_DEB_HSCX) || (cs->debug & L1_DEB_HSCX_FIFO)) {
4077 + char tmp[1024];
4078 + char *t = tmp;
4079 +
4080 + t += sprintf(t, "amd7930_fill_fifo %c cnt %d",
4081 + bcs->channel ? 'B' : 'A', skb->len);
4082 + if (cs->debug & L1_DEB_HSCX_FIFO)
4083 + QuickHex(t, skb->data, skb->len);
4084 + debugl1(cs, tmp);
4085 + }
4086 +
4087 + if (bcs->mode == L1_MODE_HDLC) {
4088 + len = make_raw_hdlc_data(skb->data, skb->len,
4089 + bcs->hw.amd7930.tx_buff, RAW_BUFMAX);
4090 + if (len > 0)
4091 + amd7930_bxmit(0, bcs->channel,
4092 + bcs->hw.amd7930.tx_buff, len,
4093 + (void *) &Bchan_xmit_callback,
4094 + (void *) bcs);
4095 + dev_kfree_skb(skb);
4096 + } else if (bcs->mode == L1_MODE_TRANS) {
4097 + amd7930_bxmit(0, bcs->channel,
4098 + bcs->hw.amd7930.tx_buff, skb->len,
4099 + (void *) &Bchan_xmt_bh,
4100 + (void *) bcs);
4101 + bcs->hw.amd7930.tx_skb = skb;
4102 + } else {
4103 + dev_kfree_skb(skb);
4104 + }
4105 +}
4106 +
4107 +static void
4108 +Bchan_mode(struct BCState *bcs, int mode, int bc)
4109 +{
4110 + struct IsdnCardState *cs = bcs->cs;
4111 +
4112 + if (cs->debug & L1_DEB_HSCX) {
4113 + char tmp[40];
4114 + sprintf(tmp, "AMD 7930 mode %d bchan %d/%d",
4115 + mode, bc, bcs->channel);
4116 + debugl1(cs, tmp);
4117 + }
4118 + bcs->mode = mode;
4119 +}
4120 +
4121 +/* Bchan_l2l1 is the entry point for upper layer routines that want to
4122 + * transmit on the B channel. PH_DATA_REQ is a normal packet that
4123 + * we either start transmitting (if idle) or queue (if busy).
4124 + * PH_PULL_REQ can be called to request a callback message (PH_PULL_CNF)
4125 + * once the link is idle. After a "pull" callback, the upper layer
4126 + * routines can use PH_PULL_IND to send data.
4127 + */
4128 +
4129 +static void
4130 +Bchan_l2l1(struct PStack *st, int pr, void *arg)
4131 +{
4132 + struct sk_buff *skb = arg;
4133 +
4134 + switch (pr) {
4135 + case (PH_DATA_REQ):
4136 + if (test_bit(BC_FLG_BUSY, &st->l1.bcs->Flag)) {
4137 + skb_queue_tail(&st->l1.bcs->squeue, skb);
4138 + } else {
4139 + test_and_set_bit(BC_FLG_BUSY, &st->l1.bcs->Flag);
4140 + Bchan_fill_fifo(st->l1.bcs, skb);
4141 + }
4142 + break;
4143 + case (PH_PULL_IND):
4144 + if (test_bit(BC_FLG_BUSY, &st->l1.bcs->Flag)) {
4145 + printk(KERN_WARNING "amd7930: this shouldn't happen\n");
4146 + break;
4147 + }
4148 + test_and_set_bit(BC_FLG_BUSY, &st->l1.bcs->Flag);
4149 + Bchan_fill_fifo(st->l1.bcs, skb);
4150 + break;
4151 + case (PH_PULL_REQ):
4152 + if (!test_bit(BC_FLG_BUSY, &st->l1.bcs->Flag)) {
4153 + clear_bit(FLG_L1_PULL_REQ, &st->l1.Flags);
4154 + st->l1.l1l2(st, PH_PULL_CNF, NULL);
4155 + } else
4156 + set_bit(FLG_L1_PULL_REQ, &st->l1.Flags);
4157 + break;
4158 + }
4159 +}
4160 +
4161 +/* Receiver callback and bottom half - decodes HDLC at leisure (if
4162 + * L1_MODE_HDLC) and passes newly received skb on via bcs->rqueue. If
4163 + * a large packet is received, stick rv_skb (the buffer that the
4164 + * packet has been decoded into) on the receive queue and alloc a new
4165 + * (large) skb to act as buffer for future receives. If a small
4166 + * packet is received, leave rv_skb alone, alloc a new skb of the
4167 + * correct size, and copy the packet into it
4168 + */
4169 +
4170 +static void
4171 +Bchan_recv_callback(struct BCState *bcs)
4172 +{
4173 + struct amd7930_hw *hw = &bcs->hw.amd7930;
4174 +
4175 + hw->rv_buff_in += RCV_BUFSIZE/RCV_BUFBLKS;
4176 + hw->rv_buff_in %= RCV_BUFSIZE;
4177 +
4178 + if (hw->rv_buff_in != hw->rv_buff_out) {
4179 + amd7930_brecv(0, bcs->channel,
4180 + hw->rv_buff + hw->rv_buff_in,
4181 + RCV_BUFSIZE/RCV_BUFBLKS,
4182 + (void *) &Bchan_recv_callback, (void *) bcs);
4183 + }
4184 +
4185 + queue_task(&hw->tq_rcv, &tq_immediate);
4186 + mark_bh(IMMEDIATE_BH);
4187 +}
4188 +
4189 +static void
4190 +Bchan_rcv_bh(struct BCState *bcs)
4191 +{
4192 + struct IsdnCardState *cs = bcs->cs;
4193 + struct amd7930_hw *hw = &bcs->hw.amd7930;
4194 + struct sk_buff *skb;
4195 + int len;
4196 +
4197 + if (cs->debug & L1_DEB_HSCX) {
4198 + char tmp[1024];
4199 +
4200 + sprintf(tmp, "amd7930_Bchan_rcv (%d/%d)",
4201 + hw->rv_buff_in, hw->rv_buff_out);
4202 + debugl1(cs, tmp);
4203 + QuickHex(tmp, hw->rv_buff + hw->rv_buff_out,
4204 + RCV_BUFSIZE/RCV_BUFBLKS);
4205 + debugl1(cs, tmp);
4206 + }
4207 +
4208 + do {
4209 + if (bcs->mode == L1_MODE_HDLC) {
4210 + while ((len = read_raw_hdlc_data(hw->hdlc_state,
4211 + hw->rv_buff + hw->rv_buff_out, RCV_BUFSIZE/RCV_BUFBLKS,
4212 + hw->rv_skb->tail, HSCX_BUFMAX))) {
4213 + if (len > 0 && (cs->debug & L1_DEB_HSCX_FIFO)) {
4214 + char tmp[1024];
4215 + char *t = tmp;
4216 +
4217 + t += sprintf(t, "amd7930_Bchan_rcv %c cnt %d", bcs->channel ? 'B' : 'A', len);
4218 + QuickHex(t, hw->rv_skb->tail, len);
4219 + debugl1(cs, tmp);
4220 + }
4221 +
4222 + if (len > HSCX_BUFMAX/2) {
4223 + /* Large packet received */
4224 +
4225 + if (!(skb = dev_alloc_skb(HSCX_BUFMAX))) {
4226 + printk(KERN_WARNING "amd7930: receive out of memory");
4227 + } else {
4228 + skb_put(hw->rv_skb, len);
4229 + skb_queue_tail(&bcs->rqueue, hw->rv_skb);
4230 + hw->rv_skb = skb;
4231 + bcs->event |= 1 << B_RCVBUFREADY;
4232 + queue_task(&bcs->tqueue, &tq_immediate);
4233 + }
4234 + } else if (len > 0) {
4235 + /* Small packet received */
4236 +
4237 + if (!(skb = dev_alloc_skb(len))) {
4238 + printk(KERN_WARNING "amd7930: receive out of memory\n");
4239 + } else {
4240 + memcpy(skb_put(skb, len), hw->rv_skb->tail, len);
4241 + skb_queue_tail(&bcs->rqueue, skb);
4242 + bcs->event |= 1 << B_RCVBUFREADY;
4243 + queue_task(&bcs->tqueue, &tq_immediate);
4244 + mark_bh(IMMEDIATE_BH);
4245 + }
4246 + } else {
4247 + /* Reception Error */
4248 + /* printk("amd7930: B channel receive error\n"); */
4249 + }
4250 + }
4251 + } else if (bcs->mode == L1_MODE_TRANS) {
4252 + if (!(skb = dev_alloc_skb(RCV_BUFSIZE/RCV_BUFBLKS))) {
4253 + printk(KERN_WARNING "amd7930: receive out of memory\n");
4254 + } else {
4255 + memcpy(skb_put(skb, RCV_BUFSIZE/RCV_BUFBLKS),
4256 + hw->rv_buff + hw->rv_buff_out,
4257 + RCV_BUFSIZE/RCV_BUFBLKS);
4258 + skb_queue_tail(&bcs->rqueue, skb);
4259 + bcs->event |= 1 << B_RCVBUFREADY;
4260 + queue_task(&bcs->tqueue, &tq_immediate);
4261 + mark_bh(IMMEDIATE_BH);
4262 + }
4263 + }
4264 +
4265 + if (hw->rv_buff_in == hw->rv_buff_out) {
4266 + /* Buffer was filled up - need to restart receiver */
4267 + amd7930_brecv(0, bcs->channel,
4268 + hw->rv_buff + hw->rv_buff_in,
4269 + RCV_BUFSIZE/RCV_BUFBLKS,
4270 + (void *) &Bchan_recv_callback,
4271 + (void *) bcs);
4272 + }
4273 +
4274 + hw->rv_buff_out += RCV_BUFSIZE/RCV_BUFBLKS;
4275 + hw->rv_buff_out %= RCV_BUFSIZE;
4276 +
4277 + } while (hw->rv_buff_in != hw->rv_buff_out);
4278 +}
4279 +
4280 +static void
4281 +Bchan_close(struct BCState *bcs)
4282 +{
4283 + struct sk_buff *skb;
4284 +
4285 + Bchan_mode(bcs, 0, 0);
4286 + amd7930_bclose(0, bcs->channel);
4287 +
4288 + if (test_bit(BC_FLG_INIT, &bcs->Flag)) {
4289 + skb_queue_purge(&bcs->rqueue);
4290 + skb_queue_purge(&bcs->squeue);
4291 + }
4292 + test_and_clear_bit(BC_FLG_INIT, &bcs->Flag);
4293 +}
4294 +
4295 +static int
4296 +Bchan_open(struct BCState *bcs)
4297 +{
4298 + struct amd7930_hw *hw = &bcs->hw.amd7930;
4299 +
4300 + if (!test_and_set_bit(BC_FLG_INIT, &bcs->Flag)) {
4301 + skb_queue_head_init(&bcs->rqueue);
4302 + skb_queue_head_init(&bcs->squeue);
4303 + }
4304 + test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag);
4305 +
4306 + amd7930_bopen(0, bcs->channel, 0xff);
4307 + hw->rv_buff_in = 0;
4308 + hw->rv_buff_out = 0;
4309 + hw->tx_skb = NULL;
4310 + init_hdlc_state(hw->hdlc_state, 0);
4311 + amd7930_brecv(0, bcs->channel,
4312 + hw->rv_buff + hw->rv_buff_in, RCV_BUFSIZE/RCV_BUFBLKS,
4313 + (void *) &Bchan_recv_callback, (void *) bcs);
4314 +
4315 + bcs->event = 0;
4316 + bcs->tx_cnt = 0;
4317 + return (0);
4318 +}
4319 +
4320 +static void
4321 +Bchan_init(struct BCState *bcs)
4322 +{
4323 + if (!(bcs->hw.amd7930.tx_buff = kmalloc(RAW_BUFMAX, GFP_ATOMIC))) {
4324 + printk(KERN_WARNING
4325 + "HiSax: No memory for amd7930.tx_buff\n");
4326 + return;
4327 + }
4328 + if (!(bcs->hw.amd7930.rv_buff = kmalloc(RCV_BUFSIZE, GFP_ATOMIC))) {
4329 + printk(KERN_WARNING
4330 + "HiSax: No memory for amd7930.rv_buff\n");
4331 + return;
4332 + }
4333 + if (!(bcs->hw.amd7930.rv_skb = dev_alloc_skb(HSCX_BUFMAX))) {
4334 + printk(KERN_WARNING
4335 + "HiSax: No memory for amd7930.rv_skb\n");
4336 + return;
4337 + }
4338 + if (!(bcs->hw.amd7930.hdlc_state = kmalloc(sizeof(struct hdlc_state),
4339 + GFP_ATOMIC))) {
4340 + printk(KERN_WARNING
4341 + "HiSax: No memory for amd7930.hdlc_state\n");
4342 + return;
4343 + }
4344 +
4345 + bcs->hw.amd7930.tq_rcv.sync = 0;
4346 + bcs->hw.amd7930.tq_rcv.routine = (void (*)(void *)) &Bchan_rcv_bh;
4347 + bcs->hw.amd7930.tq_rcv.data = (void *) bcs;
4348 +
4349 + bcs->hw.amd7930.tq_xmt.sync = 0;
4350 + bcs->hw.amd7930.tq_xmt.routine = (void (*)(void *)) &Bchan_xmt_bh;
4351 + bcs->hw.amd7930.tq_xmt.data = (void *) bcs;
4352 +}
4353 +
4354 +static void
4355 +Bchan_manl1(struct PStack *st, int pr,
4356 + void *arg)
4357 +{
4358 + switch (pr) {
4359 + case (PH_ACTIVATE_REQ):
4360 + test_and_set_bit(BC_FLG_ACTIV, &st->l1.bcs->Flag);
4361 + Bchan_mode(st->l1.bcs, st->l1.mode, st->l1.bc);
4362 + st->l1.l1man(st, PH_ACTIVATE_CNF, NULL);
4363 + break;
4364 + case (PH_DEACTIVATE_REQ):
4365 + if (!test_bit(BC_FLG_BUSY, &st->l1.bcs->Flag))
4366 + Bchan_mode(st->l1.bcs, 0, 0);
4367 + test_and_clear_bit(BC_FLG_ACTIV, &st->l1.bcs->Flag);
4368 + break;
4369 + }
4370 +}
4371 +
4372 +int
4373 +setstack_amd7930(struct PStack *st, struct BCState *bcs)
4374 +{
4375 + if (Bchan_open(bcs))
4376 + return (-1);
4377 + st->l1.bcs = bcs;
4378 + st->l2.l2l1 = Bchan_l2l1;
4379 + st->ma.manl1 = Bchan_manl1;
4380 + setstack_manager(st);
4381 + bcs->st = st;
4382 + return (0);
4383 +}
4384 +
4385 +
4386 +static void
4387 +amd7930_drecv_callback(void *arg, int error, unsigned int count)
4388 +{
4389 + struct IsdnCardState *cs = (struct IsdnCardState *) arg;
4390 + static struct tq_struct task;
4391 + struct sk_buff *skb;
4392 +
4393 + /* NOTE: This function is called directly from an interrupt handler */
4394 +
4395 + if (1) {
4396 + if (!(skb = alloc_skb(count, GFP_ATOMIC)))
4397 + printk(KERN_WARNING "HiSax: D receive out of memory\n");
4398 + else {
4399 + memcpy(skb_put(skb, count), cs->rcvbuf, count);
4400 + skb_queue_tail(&cs->rq, skb);
4401 + }
4402 +
4403 + task.routine = (void *) DChannel_proc_rcv;
4404 + task.data = (void *) cs;
4405 + queue_task(&task, &tq_immediate);
4406 + mark_bh(IMMEDIATE_BH);
4407 + }
4408 +
4409 + if (cs->debug & L1_DEB_ISAC_FIFO) {
4410 + char tmp[128];
4411 + char *t = tmp;
4412 +
4413 + t += sprintf(t, "amd7930 Drecv cnt %d", count);
4414 + if (error) t += sprintf(t, " ERR %x", error);
4415 + QuickHex(t, cs->rcvbuf, count);
4416 + debugl1(cs, tmp);
4417 + }
4418 +
4419 + amd7930_drecv(0, cs->rcvbuf, MAX_DFRAME_LEN,
4420 + &amd7930_drecv_callback, cs);
4421 +}
4422 +
4423 +static void
4424 +amd7930_dxmit_callback(void *arg, int error)
4425 +{
4426 + struct IsdnCardState *cs = (struct IsdnCardState *) arg;
4427 + static struct tq_struct task;
4428 +
4429 + /* NOTE: This function is called directly from an interrupt handler */
4430 +
4431 + /* may wish to do retransmission here, if error indicates collision */
4432 +
4433 + if (cs->debug & L1_DEB_ISAC_FIFO) {
4434 + char tmp[128];
4435 + char *t = tmp;
4436 +
4437 + t += sprintf(t, "amd7930 Dxmit cnt %d", cs->tx_skb->len);
4438 + if (error) t += sprintf(t, " ERR %x", error);
4439 + QuickHex(t, cs->tx_skb->data, cs->tx_skb->len);
4440 + debugl1(cs, tmp);
4441 + }
4442 +
4443 + cs->tx_skb = NULL;
4444 +
4445 + task.routine = (void *) DChannel_proc_xmt;
4446 + task.data = (void *) cs;
4447 + queue_task(&task, &tq_immediate);
4448 + mark_bh(IMMEDIATE_BH);
4449 +}
4450 +
4451 +static void
4452 +amd7930_Dchan_l2l1(struct PStack *st, int pr, void *arg)
4453 +{
4454 + struct IsdnCardState *cs = (struct IsdnCardState *) st->l1.hardware;
4455 + struct sk_buff *skb = arg;
4456 + char str[64];
4457 +
4458 + switch (pr) {
4459 + case (PH_DATA_REQ):
4460 + if (cs->tx_skb) {
4461 + skb_queue_tail(&cs->sq, skb);
4462 +#ifdef L2FRAME_DEBUG /* psa */
4463 + if (cs->debug & L1_DEB_LAPD)
4464 + Logl2Frame(cs, skb, "PH_DATA Queued", 0);
4465 +#endif
4466 + } else {
4467 + if ((cs->dlogflag) && (!(skb->data[2] & 1))) {
4468 + /* I-FRAME */
4469 + LogFrame(cs, skb->data, skb->len);
4470 + sprintf(str, "Q.931 frame user->network tei %d", st->l2.tei);
4471 + dlogframe(cs, skb->data+4, skb->len-4,
4472 + str);
4473 + }
4474 + cs->tx_skb = skb;
4475 + cs->tx_cnt = 0;
4476 +#ifdef L2FRAME_DEBUG /* psa */
4477 + if (cs->debug & L1_DEB_LAPD)
4478 + Logl2Frame(cs, skb, "PH_DATA", 0);
4479 +#endif
4480 + amd7930_dxmit(0, skb->data, skb->len,
4481 + &amd7930_dxmit_callback, cs);
4482 + }
4483 + break;
4484 + case (PH_PULL_IND):
4485 + if (cs->tx_skb) {
4486 + if (cs->debug & L1_DEB_WARN)
4487 + debugl1(cs, " l2l1 tx_skb exist this shouldn't happen");
4488 + skb_queue_tail(&cs->sq, skb);
4489 + break;
4490 + }
4491 + if ((cs->dlogflag) && (!(skb->data[2] & 1))) { /* I-FRAME */
4492 + LogFrame(cs, skb->data, skb->len);
4493 + sprintf(str, "Q.931 frame user->network tei %d", st->l2.tei);
4494 + dlogframe(cs, skb->data + 4, skb->len - 4,
4495 + str);
4496 + }
4497 + cs->tx_skb = skb;
4498 + cs->tx_cnt = 0;
4499 +#ifdef L2FRAME_DEBUG /* psa */
4500 + if (cs->debug & L1_DEB_LAPD)
4501 + Logl2Frame(cs, skb, "PH_DATA_PULLED", 0);
4502 +#endif
4503 + amd7930_dxmit(0, cs->tx_skb->data, cs->tx_skb->len,
4504 + &amd7930_dxmit_callback, cs);
4505 + break;
4506 + case (PH_PULL_REQ):
4507 +#ifdef L2FRAME_DEBUG /* psa */
4508 + if (cs->debug & L1_DEB_LAPD)
4509 + debugl1(cs, "-> PH_REQUEST_PULL");
4510 +#endif
4511 + if (!cs->tx_skb) {
4512 + test_and_clear_bit(FLG_L1_PULL_REQ, &st->l1.Flags);
4513 + st->l1.l1l2(st, PH_PULL_CNF, NULL);
4514 + } else
4515 + test_and_set_bit(FLG_L1_PULL_REQ, &st->l1.Flags);
4516 + break;
4517 + }
4518 +}
4519 +
4520 +int
4521 +setDstack_amd7930(struct PStack *st, struct IsdnCardState *cs)
4522 +{
4523 + st->l2.l2l1 = amd7930_Dchan_l2l1;
4524 + if (! cs->rcvbuf) {
4525 + printk("setDstack_amd7930: No cs->rcvbuf!\n");
4526 + } else {
4527 + amd7930_drecv(0, cs->rcvbuf, MAX_DFRAME_LEN,
4528 + &amd7930_drecv_callback, cs);
4529 + }
4530 + return (0);
4531 +}
4532 +
4533 +static void
4534 +manl1_msg(struct IsdnCardState *cs, int msg, void *arg) {
4535 + struct PStack *st;
4536 +
4537 + st = cs->stlist;
4538 + while (st) {
4539 + st->ma.manl1(st, msg, arg);
4540 + st = st->next;
4541 + }
4542 +}
4543 +
4544 +static void
4545 +amd7930_new_ph(struct IsdnCardState *cs)
4546 +{
4547 + switch (amd7930_get_liu_state(0)) {
4548 + case 3:
4549 + manl1_msg(cs, PH_POWERUP_CNF, NULL);
4550 + break;
4551 +
4552 + case 7:
4553 + manl1_msg(cs, PH_I4_P8_IND, NULL);
4554 + break;
4555 +
4556 + case 8:
4557 + manl1_msg(cs, PH_RSYNC_IND, NULL);
4558 + break;
4559 + }
4560 +}
4561 +
4562 +/* amd7930 LIU state change callback */
4563 +
4564 +static void
4565 +amd7930_liu_callback(struct IsdnCardState *cs)
4566 +{
4567 + static struct tq_struct task;
4568 +
4569 + if (!cs)
4570 + return;
4571 +
4572 + if (cs->debug & L1_DEB_ISAC) {
4573 + char tmp[32];
4574 + sprintf(tmp, "amd7930_liu state %d", amd7930_get_liu_state(0));
4575 + debugl1(cs, tmp);
4576 + }
4577 +
4578 + task.sync = 0;
4579 + task.routine = (void *) &amd7930_new_ph;
4580 + task.data = (void *) cs;
4581 + queue_task(&task, &tq_immediate);
4582 + mark_bh(IMMEDIATE_BH);
4583 +}
4584 +
4585 +void
4586 +amd7930_l1cmd(struct IsdnCardState *cs, int msg, void *arg)
4587 +{
4588 + u_char val;
4589 + char tmp[32];
4590 +
4591 + if (cs->debug & L1_DEB_ISAC) {
4592 + char tmp[32];
4593 + sprintf(tmp, "amd7930_l1cmd msg %x", msg);
4594 + debugl1(cs, tmp);
4595 + }
4596 +
4597 + switch(msg) {
4598 + case PH_RESET_REQ:
4599 + if (amd7930_get_liu_state(0) <= 3)
4600 + amd7930_liu_activate(0,0);
4601 + else
4602 + amd7930_liu_deactivate(0);
4603 + break;
4604 + case PH_ENABLE_REQ:
4605 + break;
4606 + case PH_INFO3_REQ:
4607 + amd7930_liu_activate(0,0);
4608 + break;
4609 + case PH_TESTLOOP_REQ:
4610 + break;
4611 + default:
4612 + if (cs->debug & L1_DEB_WARN) {
4613 + sprintf(tmp, "amd7930_l1cmd unknown %4x", msg);
4614 + debugl1(cs, tmp);
4615 + }
4616 + break;
4617 + }
4618 +}
4619 +
4620 +static void init_amd7930(struct IsdnCardState *cs)
4621 +{
4622 + Bchan_init(&cs->bcs[0]);
4623 + Bchan_init(&cs->bcs[1]);
4624 + cs->bcs[0].BC_SetStack = setstack_amd7930;
4625 + cs->bcs[1].BC_SetStack = setstack_amd7930;
4626 + cs->bcs[0].BC_Close = Bchan_close;
4627 + cs->bcs[1].BC_Close = Bchan_close;
4628 + Bchan_mode(cs->bcs, 0, 0);
4629 + Bchan_mode(cs->bcs + 1, 0, 0);
4630 +}
4631 +
4632 +void
4633 +release_amd7930(struct IsdnCardState *cs)
4634 +{
4635 +}
4636 +
4637 +static int
4638 +amd7930_card_msg(struct IsdnCardState *cs, int mt, void *arg)
4639 +{
4640 + switch (mt) {
4641 + case CARD_RESET:
4642 + return(0);
4643 + case CARD_RELEASE:
4644 + release_amd7930(cs);
4645 + return(0);
4646 + case CARD_INIT:
4647 + cs->l1cmd = amd7930_l1cmd;
4648 + amd7930_liu_init(0, &amd7930_liu_callback, (void *)cs);
4649 + init_amd7930(cs);
4650 + return(0);
4651 + case CARD_TEST:
4652 + return(0);
4653 + }
4654 + return(0);
4655 +}
4656 +
4657 +int __init
4658 +setup_amd7930(struct IsdnCard *card)
4659 +{
4660 + struct IsdnCardState *cs = card->cs;
4661 + char tmp[64];
4662 +
4663 + strcpy(tmp, amd7930_revision);
4664 + printk(KERN_INFO "HiSax: AMD7930 driver Rev. %s\n", HiSax_getrev(tmp));
4665 + if (cs->typ != ISDN_CTYPE_AMD7930)
4666 + return (0);
4667 +
4668 + cs->irq = amd7930_get_irqnum(0);
4669 + if (cs->irq == 0)
4670 + return (0);
4671 +
4672 + cs->cardmsg = &amd7930_card_msg;
4673 +
4674 + return (1);
4675 +}
4676 Index: linux-2.4.35.4/drivers/isdn/hisax/arcofi.c
4677 ===================================================================
4678 --- linux-2.4.35.4.orig/drivers/isdn/hisax/arcofi.c
4679 +++ linux-2.4.35.4/drivers/isdn/hisax/arcofi.c
4680 @@ -1,4 +1,4 @@
4681 -/* $Id: arcofi.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4682 +/* $Id: arcofi.c,v 1.14 2001/09/24 13:22:55 kai Exp $
4683 *
4684 * Ansteuerung ARCOFI 2165
4685 *
4686 Index: linux-2.4.35.4/drivers/isdn/hisax/arcofi.h
4687 ===================================================================
4688 --- linux-2.4.35.4.orig/drivers/isdn/hisax/arcofi.h
4689 +++ linux-2.4.35.4/drivers/isdn/hisax/arcofi.h
4690 @@ -1,4 +1,4 @@
4691 -/* $Id: arcofi.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4692 +/* $Id$
4693 *
4694 * Ansteuerung ARCOFI 2165
4695 *
4696 Index: linux-2.4.35.4/drivers/isdn/hisax/asuscom.c
4697 ===================================================================
4698 --- linux-2.4.35.4.orig/drivers/isdn/hisax/asuscom.c
4699 +++ linux-2.4.35.4/drivers/isdn/hisax/asuscom.c
4700 @@ -1,4 +1,4 @@
4701 -/* $Id: asuscom.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4702 +/* $Id: asuscom.c,v 1.14 2001/09/24 13:22:55 kai Exp $
4703 *
4704 * low level stuff for ASUSCOM NETWORK INC. ISDNLink cards
4705 *
4706 @@ -14,7 +14,6 @@
4707
4708 #define __NO_VERSION__
4709 #include <linux/init.h>
4710 -#include <linux/isapnp.h>
4711 #include "hisax.h"
4712 #include "isac.h"
4713 #include "ipac.h"
4714 @@ -23,7 +22,7 @@
4715
4716 extern const char *CardType[];
4717
4718 -const char *Asuscom_revision = "$Revision: 1.1.4.1 $";
4719 +const char *Asuscom_revision = "$Revision: 1.14 $";
4720
4721 #define byteout(addr,val) outb(val,addr)
4722 #define bytein(addr) inb(addr)
4723 @@ -310,27 +309,6 @@ Asus_card_msg(struct IsdnCardState *cs,
4724 return(0);
4725 }
4726
4727 -#ifdef __ISAPNP__
4728 -static struct isapnp_device_id asus_ids[] __initdata = {
4729 - { ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1688),
4730 - ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1688),
4731 - (unsigned long) "Asus1688 PnP" },
4732 - { ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1690),
4733 - ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1690),
4734 - (unsigned long) "Asus1690 PnP" },
4735 - { ISAPNP_VENDOR('S', 'I', 'E'), ISAPNP_FUNCTION(0x0020),
4736 - ISAPNP_VENDOR('S', 'I', 'E'), ISAPNP_FUNCTION(0x0020),
4737 - (unsigned long) "Isurf2 PnP" },
4738 - { ISAPNP_VENDOR('E', 'L', 'F'), ISAPNP_FUNCTION(0x0000),
4739 - ISAPNP_VENDOR('E', 'L', 'F'), ISAPNP_FUNCTION(0x0000),
4740 - (unsigned long) "Iscas TE320" },
4741 - { 0, }
4742 -};
4743 -
4744 -static struct isapnp_device_id *adev = &asus_ids[0];
4745 -static struct pci_bus *pnp_c __devinitdata = NULL;
4746 -#endif
4747 -
4748 int __init
4749 setup_asuscom(struct IsdnCard *card)
4750 {
4751 @@ -343,45 +321,7 @@ setup_asuscom(struct IsdnCard *card)
4752 printk(KERN_INFO "HiSax: Asuscom ISDNLink driver Rev. %s\n", HiSax_getrev(tmp));
4753 if (cs->typ != ISDN_CTYPE_ASUSCOM)
4754 return (0);
4755 -#ifdef __ISAPNP__
4756 - if (!card->para[1] && isapnp_present()) {
4757 - struct pci_bus *pb;
4758 - struct pci_dev *pd;
4759 -
4760 - while(adev->card_vendor) {
4761 - if ((pb = isapnp_find_card(adev->card_vendor,
4762 - adev->card_device, pnp_c))) {
4763 - pnp_c = pb;
4764 - pd = NULL;
4765 - if ((pd = isapnp_find_dev(pnp_c,
4766 - adev->vendor, adev->function, pd))) {
4767 - printk(KERN_INFO "HiSax: %s detected\n",
4768 - (char *)adev->driver_data);
4769 - pd->prepare(pd);
4770 - pd->deactivate(pd);
4771 - pd->activate(pd);
4772 - card->para[1] = pd->resource[0].start;
4773 - card->para[0] = pd->irq_resource[0].start;
4774 - if (!card->para[0] || !card->para[1]) {
4775 - printk(KERN_ERR "AsusPnP:some resources are missing %ld/%lx\n",
4776 - card->para[0], card->para[1]);
4777 - pd->deactivate(pd);
4778 - return(0);
4779 - }
4780 - break;
4781 - } else {
4782 - printk(KERN_ERR "AsusPnP: PnP error card found, no device\n");
4783 - }
4784 - }
4785 - adev++;
4786 - pnp_c=NULL;
4787 - }
4788 - if (!adev->card_vendor) {
4789 - printk(KERN_INFO "AsusPnP: no ISAPnP card found\n");
4790 - return(0);
4791 - }
4792 - }
4793 -#endif
4794 +
4795 bytecnt = 8;
4796 cs->hw.asus.cfg_reg = card->para[1];
4797 cs->irq = card->para[0];
4798 Index: linux-2.4.35.4/drivers/isdn/hisax/avm_a1.c
4799 ===================================================================
4800 --- linux-2.4.35.4.orig/drivers/isdn/hisax/avm_a1.c
4801 +++ linux-2.4.35.4/drivers/isdn/hisax/avm_a1.c
4802 @@ -1,4 +1,4 @@
4803 -/* $Id: avm_a1.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4804 +/* $Id: avm_a1.c,v 2.15 2001/09/24 13:22:55 kai Exp $
4805 *
4806 * low level stuff for AVM A1 (Fritz) isdn cards
4807 *
4808 @@ -18,7 +18,7 @@
4809 #include "isdnl1.h"
4810
4811 extern const char *CardType[];
4812 -static const char *avm_revision = "$Revision: 1.1.4.1 $";
4813 +static const char *avm_revision = "$Revision: 2.15 $";
4814
4815 #define AVM_A1_STAT_ISAC 0x01
4816 #define AVM_A1_STAT_HSCX 0x02
4817 Index: linux-2.4.35.4/drivers/isdn/hisax/avm_a1p.c
4818 ===================================================================
4819 --- linux-2.4.35.4.orig/drivers/isdn/hisax/avm_a1p.c
4820 +++ linux-2.4.35.4/drivers/isdn/hisax/avm_a1p.c
4821 @@ -1,4 +1,4 @@
4822 -/* $Id: avm_a1p.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4823 +/* $Id: avm_a1p.c,v 2.9 2001/09/24 13:22:55 kai Exp $
4824 *
4825 * low level stuff for the following AVM cards:
4826 * A1 PCMCIA
4827 @@ -57,7 +57,7 @@
4828 #define byteout(addr,val) outb(val,addr)
4829 #define bytein(addr) inb(addr)
4830
4831 -static const char *avm_revision = "$Revision: 1.1.4.1 $";
4832 +static const char *avm_revision = "$Revision: 2.9 $";
4833
4834 static inline u_char
4835 ReadISAC(struct IsdnCardState *cs, u_char offset)
4836 Index: linux-2.4.35.4/drivers/isdn/hisax/avm_pci.c
4837 ===================================================================
4838 --- linux-2.4.35.4.orig/drivers/isdn/hisax/avm_pci.c
4839 +++ linux-2.4.35.4/drivers/isdn/hisax/avm_pci.c
4840 @@ -1,4 +1,4 @@
4841 -/* $Id: avm_pci.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4842 +/* $Id: avm_pci.c,v 1.29 2001/09/24 13:22:55 kai Exp $
4843 *
4844 * low level stuff for AVM Fritz!PCI and ISA PnP isdn cards
4845 *
4846 @@ -19,11 +19,11 @@
4847 #include "isac.h"
4848 #include "isdnl1.h"
4849 #include <linux/pci.h>
4850 -#include <linux/isapnp.h>
4851 +#include <linux/isdn_compat.h>
4852 #include <linux/interrupt.h>
4853
4854 extern const char *CardType[];
4855 -static const char *avm_pci_rev = "$Revision: 1.1.4.1 $";
4856 +static const char *avm_pci_rev = "$Revision: 1.29 $";
4857
4858 #define AVM_FRITZ_PCI 1
4859 #define AVM_FRITZ_PNP 2
4860 @@ -291,8 +291,7 @@ hdlc_empty_fifo(struct BCState *bcs, int
4861 debugl1(cs, "hdlc_empty_fifo: incoming packet too large");
4862 return;
4863 }
4864 - p = bcs->hw.hdlc.rcvbuf + bcs->hw.hdlc.rcvidx;
4865 - ptr = (u_int *)p;
4866 + ptr = (u_int *) p = bcs->hw.hdlc.rcvbuf + bcs->hw.hdlc.rcvidx;
4867 bcs->hw.hdlc.rcvidx += count;
4868 if (cs->subtyp == AVM_FRITZ_PCI) {
4869 outl(idx, cs->hw.avm.cfg_reg + 4);
4870 @@ -353,8 +352,7 @@ hdlc_fill_fifo(struct BCState *bcs)
4871 }
4872 if ((cs->debug & L1_DEB_HSCX) && !(cs->debug & L1_DEB_HSCX_FIFO))
4873 debugl1(cs, "hdlc_fill_fifo %d/%ld", count, bcs->tx_skb->len);
4874 - p = bcs->tx_skb->data;
4875 - ptr = (u_int *)p;
4876 + ptr = (u_int *) p = bcs->tx_skb->data;
4877 skb_pull(bcs->tx_skb, count);
4878 bcs->tx_cnt -= count;
4879 bcs->hw.hdlc.count += count;
4880 @@ -766,10 +764,6 @@ AVM_card_msg(struct IsdnCardState *cs, i
4881 }
4882
4883 static struct pci_dev *dev_avm __initdata = NULL;
4884 -#ifdef __ISAPNP__
4885 -static struct pci_bus *bus_avm __initdata = NULL;
4886 -static struct pci_dev *pnp_avm __initdata = NULL;
4887 -#endif
4888
4889 int __init
4890 setup_avm_pcipnp(struct IsdnCard *card)
4891 @@ -783,47 +777,10 @@ setup_avm_pcipnp(struct IsdnCard *card)
4892 if (cs->typ != ISDN_CTYPE_FRITZPCI)
4893 return (0);
4894 if (card->para[1]) {
4895 - /* old manual method */
4896 cs->hw.avm.cfg_reg = card->para[1];
4897 cs->irq = card->para[0];
4898 cs->subtyp = AVM_FRITZ_PNP;
4899 } else {
4900 -#ifdef __ISAPNP__
4901 - if (isapnp_present()) {
4902 - struct pci_bus *ba;
4903 - if ((ba = isapnp_find_card(
4904 - ISAPNP_VENDOR('A', 'V', 'M'),
4905 - ISAPNP_FUNCTION(0x0900), bus_avm))) {
4906 - bus_avm = ba;
4907 - pnp_avm = NULL;
4908 - if ((pnp_avm = isapnp_find_dev(bus_avm,
4909 - ISAPNP_VENDOR('A', 'V', 'M'),
4910 - ISAPNP_FUNCTION(0x0900), pnp_avm))) {
4911 - pnp_avm->prepare(pnp_avm);
4912 - pnp_avm->deactivate(pnp_avm);
4913 - pnp_avm->activate(pnp_avm);
4914 - cs->hw.avm.cfg_reg =
4915 - pnp_avm->resource[0].start;
4916 - cs->irq =
4917 - pnp_avm->irq_resource[0].start;
4918 - if (!cs->irq) {
4919 - printk(KERN_ERR "FritzPnP:No IRQ\n");
4920 - pnp_avm->deactivate(pnp_avm);
4921 - return(0);
4922 - }
4923 - if (!cs->hw.avm.cfg_reg) {
4924 - printk(KERN_ERR "FritzPnP:No IO address\n");
4925 - pnp_avm->deactivate(pnp_avm);
4926 - return(0);
4927 - }
4928 - cs->subtyp = AVM_FRITZ_PNP;
4929 - goto ready;
4930 - }
4931 - }
4932 - } else {
4933 - printk(KERN_INFO "FritzPnP: no ISA PnP present\n");
4934 - }
4935 -#endif
4936 #if CONFIG_PCI
4937 if (!pci_present()) {
4938 printk(KERN_ERR "FritzPCI: no PCI bus present\n");
4939 @@ -838,7 +795,7 @@ setup_avm_pcipnp(struct IsdnCard *card)
4940 }
4941 if (pci_enable_device(dev_avm))
4942 return(0);
4943 - cs->hw.avm.cfg_reg = pci_resource_start(dev_avm, 1);
4944 + cs->hw.avm.cfg_reg = pci_resource_start_io(dev_avm, 1);
4945 if (!cs->hw.avm.cfg_reg) {
4946 printk(KERN_ERR "FritzPCI: No IO-Adr for PCI card found\n");
4947 return(0);
4948 @@ -854,7 +811,6 @@ setup_avm_pcipnp(struct IsdnCard *card)
4949 return (0);
4950 #endif /* CONFIG_PCI */
4951 }
4952 -ready:
4953 cs->hw.avm.isac = cs->hw.avm.cfg_reg + 0x10;
4954 if (check_region((cs->hw.avm.cfg_reg), 32)) {
4955 printk(KERN_WARNING
4956 Index: linux-2.4.35.4/drivers/isdn/hisax/bkm_a4t.c
4957 ===================================================================
4958 --- linux-2.4.35.4.orig/drivers/isdn/hisax/bkm_a4t.c
4959 +++ linux-2.4.35.4/drivers/isdn/hisax/bkm_a4t.c
4960 @@ -1,4 +1,4 @@
4961 -/* $Id: bkm_a4t.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4962 +/* $Id: bkm_a4t.c,v 1.22 2001/09/24 13:22:55 kai Exp $
4963 *
4964 * low level stuff for T-Berkom A4T
4965 *
4966 @@ -20,11 +20,12 @@
4967 #include "jade.h"
4968 #include "isdnl1.h"
4969 #include <linux/pci.h>
4970 +#include <linux/isdn_compat.h>
4971 #include "bkm_ax.h"
4972
4973 extern const char *CardType[];
4974
4975 -const char *bkm_a4t_revision = "$Revision: 1.1.4.1 $";
4976 +const char *bkm_a4t_revision = "$Revision: 1.22 $";
4977
4978
4979 static inline u_char
4980 @@ -293,13 +294,13 @@ setup_bkm_a4t(struct IsdnCard *card)
4981 u16 sub_sys;
4982 u16 sub_vendor;
4983
4984 - sub_vendor = dev_a4t->subsystem_vendor;
4985 - sub_sys = dev_a4t->subsystem_device;
4986 + pci_get_sub_vendor(dev_a4t,sub_vendor);
4987 + pci_get_sub_system(dev_a4t,sub_sys);
4988 if ((sub_sys == PCI_DEVICE_ID_BERKOM_A4T) && (sub_vendor == PCI_VENDOR_ID_BERKOM)) {
4989 if (pci_enable_device(dev_a4t))
4990 return(0);
4991 found = 1;
4992 - pci_memaddr = pci_resource_start(dev_a4t, 0);
4993 + pci_memaddr = pci_resource_start_mem(dev_a4t, 0);
4994 cs->irq = dev_a4t->irq;
4995 break;
4996 }
4997 Index: linux-2.4.35.4/drivers/isdn/hisax/bkm_a8.c
4998 ===================================================================
4999 --- linux-2.4.35.4.orig/drivers/isdn/hisax/bkm_a8.c
5000 +++ linux-2.4.35.4/drivers/isdn/hisax/bkm_a8.c
5001 @@ -1,4 +1,4 @@
5002 -/* $Id: bkm_a8.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
5003 +/* $Id: bkm_a8.c,v 1.22 2001/09/24 13:22:55 kai Exp $
5004 *
5005 * low level stuff for Scitel Quadro (4*S0, passive)
5006 *
5007 @@ -20,6 +20,7 @@
5008 #include "hscx.h"
5009 #include "isdnl1.h"
5010 #include <linux/pci.h>
5011 +#include <linux/isdn_compat.h>
5012 #include "bkm_ax.h"
5013
5014 #if CONFIG_PCI
5015 @@ -28,7 +29,7 @@
5016
5017 extern const char *CardType[];
5018
5019 -const char sct_quadro_revision[] = "$Revision: 1.1.4.1 $";
5020 +const char sct_quadro_revision[] = "$Revision: 1.22 $";
5021
5022 static const char *sct_quadro_subtypes[] =
5023 {
5024 @@ -329,13 +330,13 @@ setup_sct_quadro(struct IsdnCard *card)
5025 while ((dev_a8 = pci_find_device(PCI_VENDOR_ID_PLX,
5026 PCI_DEVICE_ID_PLX_9050, dev_a8))) {
5027
5028 - sub_vendor_id = dev_a8->subsystem_vendor;
5029 - sub_sys_id = dev_a8->subsystem_device;
5030 + pci_get_sub_vendor(dev_a8,sub_vendor_id);
5031 + pci_get_sub_system(dev_a8,sub_sys_id);
5032 if ((sub_sys_id == PCI_DEVICE_ID_BERKOM_SCITEL_QUADRO) &&
5033 (sub_vendor_id == PCI_VENDOR_ID_BERKOM)) {
5034 if (pci_enable_device(dev_a8))
5035 return(0);
5036 - pci_ioaddr1 = pci_resource_start(dev_a8, 1);
5037 + pci_ioaddr1 = pci_resource_start_io(dev_a8, 1);
5038 pci_irq = dev_a8->irq;
5039 pci_bus = dev_a8->bus->number;
5040 pci_device_fn = dev_a8->devfn;
5041 @@ -365,7 +366,7 @@ setup_sct_quadro(struct IsdnCard *card)
5042 pci_ioaddr1 &= PCI_BASE_ADDRESS_IO_MASK;
5043 pcibios_write_config_dword(pci_bus, pci_device_fn,
5044 PCI_BASE_ADDRESS_1, pci_ioaddr1);
5045 - dev_a8->resource[ 1].start = pci_ioaddr1;
5046 + get_pcibase(dev_a8, 1) = pci_ioaddr1;
5047 }
5048 #endif /* End HACK */
5049 }
5050 Index: linux-2.4.35.4/drivers/isdn/hisax/bkm_ax.h
5051 ===================================================================
5052 --- linux-2.4.35.4.orig/drivers/isdn/hisax/bkm_ax.h
5053 +++ linux-2.4.35.4/drivers/isdn/hisax/bkm_ax.h
5054 @@ -1,4 +1,4 @@
5055 -/* $Id: bkm_ax.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
5056 +/* $Id$
5057 *
5058 * low level decls for T-Berkom cards A4T and Scitel Quadro (4*S0, passive)
5059 *
5060 Index: linux-2.4.35.4/drivers/isdn/hisax/callc.c
5061 ===================================================================
5062 --- linux-2.4.35.4.orig/drivers/isdn/hisax/callc.c
5063 +++ linux-2.4.35.4/drivers/isdn/hisax/callc.c
5064 @@ -1,4 +1,4 @@
5065 -/* $Id: callc.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
5066 +/* $Id: callc.c,v 2.59 2002/02/09 21:19:11 keil Exp $
5067 *
5068 * Author Karsten Keil
5069 * Copyright by Karsten Keil <keil@isdn4linux.de>
5070 @@ -26,7 +26,7 @@
5071 #define MOD_USE_COUNT ( GET_USE_COUNT (&__this_module))
5072 #endif /* MODULE */
5073
5074 -const char *lli_revision = "$Revision: 1.1.4.1 $";
5075 +const char *lli_revision = "$Revision: 2.59 $";
5076
5077 extern struct IsdnCard cards[];
5078 extern int nrcards;
5079 @@ -145,9 +145,11 @@ enum {
5080 EV_PROCEED, /* 20 */
5081 EV_ALERT, /* 21 */
5082 EV_REDIR, /* 22 */
5083 + EV_ALERTING, /* 23 */
5084 + EV_PROCEEDING, /* 24 */
5085 };
5086
5087 -#define EVENT_COUNT (EV_REDIR + 1)
5088 +#define EVENT_COUNT (EV_PROCEEDING + 1)
5089
5090 static char *strEvent[] =
5091 {
5092 @@ -174,6 +176,8 @@ static char *strEvent[] =
5093 "EV_PROCEED",
5094 "EV_ALERT",
5095 "EV_REDIR",
5096 + "EV_ALERTING",
5097 + "EV_PROCEEDING",
5098 };
5099
5100
5101 @@ -286,6 +290,22 @@ lli_prep_dialout(struct FsmInst *fi, int
5102 }
5103
5104 static void
5105 +lli_alerting(struct FsmInst *fi, int event, void *arg)
5106 +{
5107 + struct Channel *chanp = fi->userdata;
5108 +
5109 + HL_LL(chanp, ISDN_STAT_ALERT);
5110 +}
5111 +
5112 +static void
5113 +lli_proceeding(struct FsmInst *fi, int event, void *arg)
5114 +{
5115 + struct Channel *chanp = fi->userdata;
5116 +
5117 + HL_LL(chanp, ISDN_STAT_PROCEED);
5118 +}
5119 +
5120 +static void
5121 lli_resume(struct FsmInst *fi, int event, void *arg)
5122 {
5123 struct Channel *chanp = fi->userdata;
5124 @@ -784,6 +804,8 @@ static struct FsmNode fnlist[] __initdat
5125 {ST_OUT_DIAL, EV_DISCONNECT_IND, lli_release_req},
5126 {ST_OUT_DIAL, EV_RELEASE, lli_dhup_close},
5127 {ST_OUT_DIAL, EV_NOSETUP_RSP, lli_no_setup_rsp},
5128 + {ST_OUT_DIAL, EV_PROCEEDING, lli_proceeding},
5129 + {ST_OUT_DIAL, EV_ALERTING, lli_alerting},
5130 {ST_OUT_DIAL, EV_SETUP_ERR, lli_error},
5131 {ST_IN_WAIT_LL, EV_LEASED_REL, lli_failure_l},
5132 {ST_IN_WAIT_LL, EV_ACCEPTD, lli_setup_rsp},
5133 @@ -925,7 +947,7 @@ static void stat_redir_result(struct Isd
5134 ic.driver = cs->myid;
5135 ic.command = ISDN_STAT_REDIR;
5136 ic.arg = chan;
5137 - ic.parm.num[0] = result;
5138 + (ulong)(ic.parm.num[0]) = result;
5139 cs->iif.statcallb(&ic);
5140 } /* stat_redir_result */
5141
5142 @@ -997,8 +1019,13 @@ dchan_l3l4(struct PStack *st, int pr, vo
5143 FsmEvent(&chanp->fi, EV_RELEASE, NULL);
5144 break;
5145 case (CC_PROCEED_SEND | INDICATION):
5146 + break;
5147 case (CC_PROCEEDING | INDICATION):
5148 + FsmEvent(&chanp->fi, EV_PROCEEDING, NULL);
5149 + break;
5150 case (CC_ALERTING | INDICATION):
5151 + FsmEvent(&chanp->fi, EV_ALERTING, NULL);
5152 + break;
5153 case (CC_PROGRESS | INDICATION):
5154 case (CC_NOTIFY | INDICATION):
5155 break;
5156 Index: linux-2.4.35.4/drivers/isdn/hisax/cert.c
5157 ===================================================================
5158 --- linux-2.4.35.4.orig/drivers/isdn/hisax/cert.c
5159 +++ linux-2.4.35.4/drivers/isdn/hisax/cert.c
5160 @@ -1,4 +1,4 @@
5161 -/* $Id: cert.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
5162 +/* $Id: cert.c,v 2.6 2001/09/24 13:22:56 kai Exp $
5163 *
5164 * Author Karsten Keil
5165 * Copyright by Karsten Keil <keil@isdn4linux.de>
5166 Index: linux-2.4.35.4/drivers/isdn/hisax/config.c
5167 ===================================================================
5168 --- linux-2.4.35.4.orig/drivers/isdn/hisax/config.c
5169 +++ linux-2.4.35.4/drivers/isdn/hisax/config.c
5170 @@ -1,4 +1,4 @@
5171 -/* $Id: config.c,v 1.1.4.5 2001/12/09 19:19:26 kai Exp $
5172 +/* $Id: config.c,v 2.84 2002/08/13 09:55:29 keil Exp $
5173 *
5174 * Author Karsten Keil
5175 * Copyright by Karsten Keil <keil@isdn4linux.de>
5176 @@ -24,6 +24,11 @@
5177 #include <linux/kernel_stat.h>
5178 #include <linux/tqueue.h>
5179 #include <linux/interrupt.h>
5180 +
5181 +#ifdef CONFIG_HISAX_HFC_USB
5182 +#include "hisax_loadable.h"
5183 +#endif
5184 +
5185 #define HISAX_STATUS_BUFSIZE 4096
5186 #define INCLUDE_INLINE_FUNCS
5187
5188 @@ -75,8 +80,7 @@
5189 * 37 HFC 2BDS0 S+/SP p0=irq p1=iobase
5190 * 38 Travers Technologies NETspider-U PCI card
5191 * 39 HFC 2BDS0-SP PCMCIA p0=irq p1=iobase
5192 - * 40 hotplug interface
5193 - * 41 Formula-n enter:now ISDN PCI a/b none
5194 + * 40 HFC-S USB none
5195 *
5196 * protocol can be either ISDN_PTYPE_EURO or ISDN_PTYPE_1TR6 or ISDN_PTYPE_NI1
5197 *
5198 @@ -95,11 +99,17 @@ const char *CardType[] = {
5199 "Siemens I-Surf", "Acer P10", "HST Saphir", "Telekom A4T",
5200 "Scitel Quadro", "Gazel", "HFC 2BDS0 PCI", "Winbond 6692",
5201 "HFC 2BDS0 SX", "NETspider-U", "HFC-2BDS0-SP PCMCIA",
5202 - "Hotplug", "Formula-n enter:now PCI a/b",
5203 + "HFC-S USB",
5204 };
5205
5206 void HiSax_closecard(int cardnr);
5207
5208 +#ifdef CONFIG_HISAX_HFC_USB
5209 +#define DEFAULT_CARD ISDN_CTYPE_HFC_USB
5210 +#define DEFAULT_CFG {0,0,0,0}
5211 +EXPORT_SYMBOL(hisax_register_hfcusb);
5212 +#endif
5213 +
5214 #ifdef CONFIG_HISAX_ELSA
5215 #define DEFAULT_CARD ISDN_CTYPE_ELSA
5216 #define DEFAULT_CFG {0,0,0,0}
5217 @@ -339,19 +349,27 @@ EXPORT_SYMBOL(HiSax_closecard);
5218 NULL, \
5219 }
5220
5221 -struct IsdnCard cards[HISAX_MAX_CARDS] = {
5222 +#define EMPTY_CARD {0, DEFAULT_PROTO, {0, 0, 0, 0}, NULL}
5223 +
5224 +struct IsdnCard cards[] = {
5225 FIRST_CARD,
5226 + EMPTY_CARD,
5227 + EMPTY_CARD,
5228 + EMPTY_CARD,
5229 + EMPTY_CARD,
5230 + EMPTY_CARD,
5231 + EMPTY_CARD,
5232 + EMPTY_CARD,
5233 };
5234
5235 -#define HISAX_IDSIZE (HISAX_MAX_CARDS*8)
5236 -static char HiSaxID[HISAX_IDSIZE] __devinitdata = { 0, };
5237 +static char HiSaxID[64] __devinitdata = { 0, };
5238
5239 char *HiSax_id __devinitdata = HiSaxID;
5240 #ifdef MODULE
5241 /* Variables for insmod */
5242 -static int type[HISAX_MAX_CARDS] __devinitdata = { 0, };
5243 -static int protocol[HISAX_MAX_CARDS] __devinitdata = { 0, };
5244 -static int io[HISAX_MAX_CARDS] __devinitdata = { 0, };
5245 +static int type[8] __devinitdata = { 0, };
5246 +static int protocol[8] __devinitdata = { 0, };
5247 +static int io[8] __devinitdata = { 0, };
5248 #undef IO0_IO1
5249 #ifdef CONFIG_HISAX_16_3
5250 #define IO0_IO1
5251 @@ -361,27 +379,23 @@ static int io[HISAX_MAX_CARDS] __devinit
5252 #define IO0_IO1
5253 #endif
5254 #ifdef IO0_IO1
5255 -static int io0[HISAX_MAX_CARDS] __devinitdata = { 0, };
5256 -static int io1[HISAX_MAX_CARDS] __devinitdata = { 0, };
5257 +static int io0[8] __devinitdata = { 0, };
5258 +static int io1[8] __devinitdata = { 0, };
5259 #endif
5260 -static int irq[HISAX_MAX_CARDS] __devinitdata = { 0, };
5261 -static int mem[HISAX_MAX_CARDS] __devinitdata = { 0, };
5262 +static int irq[8] __devinitdata = { 0, };
5263 +static int mem[8] __devinitdata = { 0, };
5264 static char *id __devinitdata = HiSaxID;
5265
5266 -#define PARM_PARA "1-" __MODULE_STRING(HISAX_MAX_CARDS) "i"
5267 -
5268 -MODULE_DESCRIPTION("ISDN4Linux: Driver for passive ISDN cards");
5269 MODULE_AUTHOR("Karsten Keil");
5270 -MODULE_LICENSE("GPL");
5271 -MODULE_PARM(type, PARM_PARA);
5272 -MODULE_PARM(protocol, PARM_PARA);
5273 -MODULE_PARM(io, PARM_PARA);
5274 -MODULE_PARM(irq, PARM_PARA);
5275 -MODULE_PARM(mem, PARM_PARA);
5276 +MODULE_PARM(type, "1-8i");
5277 +MODULE_PARM(protocol, "1-8i");
5278 +MODULE_PARM(io, "1-8i");
5279 +MODULE_PARM(irq, "1-8i");
5280 +MODULE_PARM(mem, "1-8i");
5281 MODULE_PARM(id, "s");
5282 #ifdef IO0_IO1
5283 -MODULE_PARM(io0, PARM_PARA);
5284 -MODULE_PARM(io1, PARM_PARA);
5285 +MODULE_PARM(io0, "1-8i");
5286 +MODULE_PARM(io1, "1-8i");
5287 #endif
5288 #endif /* MODULE */
5289
5290 @@ -432,6 +446,7 @@ void __init HiSaxVersion(void)
5291 }
5292
5293 #ifndef MODULE
5294 +#ifdef COMPAT_HAS_NEW_SETUP
5295 #define MAX_ARG (HISAX_MAX_CARDS*5)
5296 static int __init HiSax_setup(char *line)
5297 {
5298 @@ -440,12 +455,16 @@ static int __init HiSax_setup(char *line
5299 char *str;
5300
5301 str = get_options(line, MAX_ARG, ints);
5302 +#else
5303 +void __init HiSax_setup(char *str, int *ints)
5304 +{
5305 + int i, j, argc;
5306 +#endif
5307 argc = ints[0];
5308 printk(KERN_DEBUG "HiSax_setup: argc(%d) str(%s)\n", argc, str);
5309 i = 0;
5310 j = 1;
5311 while (argc && (i < HISAX_MAX_CARDS)) {
5312 - cards[i].protocol = DEFAULT_PROTO;
5313 if (argc) {
5314 cards[i].typ = ints[j];
5315 j++;
5316 @@ -473,19 +492,21 @@ static int __init HiSax_setup(char *line
5317 }
5318 i++;
5319 }
5320 - if (str && *str) {
5321 - if (strlen(str) < HISAX_IDSIZE)
5322 - strcpy(HiSaxID, str);
5323 - else
5324 - printk(KERN_WARNING "HiSax: ID too long!");
5325 - } else
5326 + if (str && *str) {
5327 + strcpy(HiSaxID, str);
5328 + HiSax_id = HiSaxID;
5329 + } else {
5330 strcpy(HiSaxID, "HiSax");
5331 -
5332 - HiSax_id = HiSaxID;
5333 + HiSax_id = HiSaxID;
5334 + }
5335 +#ifdef COMPAT_HAS_NEW_SETUP
5336 return 1;
5337 }
5338
5339 __setup("hisax=", HiSax_setup);
5340 +#else
5341 +}
5342 +#endif /* COMPAT_HAS_NEW_SETUP */
5343 #endif /* MODULES */
5344
5345 #if CARD_TELES0
5346 @@ -560,6 +581,10 @@ extern int setup_hfcs(struct IsdnCard *c
5347 extern int setup_hfcpci(struct IsdnCard *card);
5348 #endif
5349
5350 +#if CONFIG_HISAX_HFC_USB
5351 +extern int setup_hfc_usb(struct IsdnCard *card);
5352 +#endif
5353 +
5354 #if CARD_HFC_SX
5355 extern int setup_hfcsx(struct IsdnCard *card);
5356 #endif
5357 @@ -604,10 +629,6 @@ extern int setup_w6692(struct IsdnCard *
5358 extern int setup_netjet_u(struct IsdnCard *card);
5359 #endif
5360
5361 -#if CARD_FN_ENTERNOW_PCI
5362 -extern int setup_enternow_pci(struct IsdnCard *card);
5363 -#endif
5364 -
5365 /*
5366 * Find card with given driverId
5367 */
5368 @@ -899,7 +920,8 @@ static int __devinit init_card(struct Is
5369 return 3;
5370 }
5371
5372 -static int __devinit checkcard(int cardnr, char *id, int *busy_flag)
5373 +static int __devinit checkcard(int cardnr, char *id, int *busy_flag,
5374 + void *load_drv)
5375 {
5376 long flags;
5377 int ret = 0;
5378 @@ -1093,6 +1115,12 @@ static int __devinit checkcard(int cardn
5379 ret = setup_hfcsx(card);
5380 break;
5381 #endif
5382 +#if CONFIG_HISAX_HFC_USB
5383 + case ISDN_CTYPE_HFC_USB:
5384 + cs->hw.hfcusb.drv = load_drv;
5385 + ret = setup_hfc_usb(card);
5386 + break;
5387 +#endif
5388 #if CARD_NICCY
5389 case ISDN_CTYPE_NICCY:
5390 ret = setup_niccy(card);
5391 @@ -1143,11 +1171,6 @@ static int __devinit checkcard(int cardn
5392 ret = setup_netjet_u(card);
5393 break;
5394 #endif
5395 -#if CARD_FN_ENTERNOW_PCI
5396 - case ISDN_CTYPE_ENTERNOW:
5397 - ret = setup_enternow_pci(card);
5398 - break;
5399 -#endif
5400 case ISDN_CTYPE_DYNAMIC:
5401 ret = 2;
5402 break;
5403 @@ -1186,6 +1209,9 @@ static int __devinit checkcard(int cardn
5404 case ISDN_CTYPE_DYNAMIC:
5405 ret = 0;
5406 break;
5407 + case ISDN_CTYPE_HFC_USB:
5408 + ret = cs->cardmsg(cs, CARD_INIT, NULL);
5409 + break;
5410 default:
5411 ret = init_card(cs);
5412 break;
5413 @@ -1257,16 +1283,13 @@ int __devinit HiSax_inithardware(int *bu
5414 else
5415 sprintf(ids, "%s%d", id, i);
5416 }
5417 - if (checkcard(i, ids, busy_flag)) {
5418 + if (checkcard(i, ids, busy_flag, NULL)) {
5419 foundcards++;
5420 i++;
5421 } else {
5422 - /* make sure we don't oops the module */
5423 - if (cards[i].typ > 0 && cards[i].typ <= ISDN_CTYPE_COUNT) {
5424 - printk(KERN_WARNING
5425 - "HiSax: Card %s not installed !\n",
5426 - CardType[cards[i].typ]);
5427 - }
5428 + printk(KERN_WARNING
5429 + "HiSax: Card %s not installed !\n",
5430 + CardType[cards[i].typ]);
5431 HiSax_shiftcards(i);
5432 nrcards--;
5433 }
5434 @@ -1342,6 +1365,49 @@ void HiSax_reportcard(int cardnr, int se
5435 #endif
5436 }
5437
5438 +#ifdef CONFIG_HISAX_HFC_USB
5439 +int
5440 +hisax_register_hfcusb(struct hisax_drvreg *l1drv)
5441 +{
5442 + int i;
5443 + char ids[30];
5444 +
5445 + if (l1drv->version != HISAX_LOAD_VERSION)
5446 + return 1;
5447 +
5448 + switch (l1drv->cmd) {
5449 + case HISAX_LOAD_CHKVER:
5450 + break; /* success */
5451 +
5452 + case HISAX_LOAD_REGISTER:
5453 + for (i = 0; i < HISAX_MAX_CARDS; i++) {
5454 + if (!cards[i].typ)
5455 + break;
5456 + }
5457 + if (i >= HISAX_MAX_CARDS)
5458 + return 1; /* no space */
5459 + cards[i].typ = ISDN_CTYPE_HFC_USB; /* setup type */
5460 + cards[i].protocol = DEFAULT_PROTO;
5461 + sprintf(ids, "%s%d", l1drv->drvname, i);
5462 + if (checkcard(i, ids, NULL, (void *) l1drv)) {
5463 + nrcards++;
5464 + return 0;
5465 + }
5466 + if (cards[i].cs)
5467 + kfree((void *) cards[i].cs);
5468 + cards[i].cs = NULL;
5469 + cards[i].typ = 0; /* no card present */
5470 + return 1;
5471 + break;
5472 +
5473 + default:
5474 + return 1; /* unknown command */
5475 + }
5476 +
5477 + return 0;
5478 +} /* hisax_register_hfcusb */
5479 +#endif
5480 +
5481 static int __init HiSax_init(void)
5482 {
5483 int i, retval;
5484 @@ -1408,8 +1474,6 @@ static int __init HiSax_init(void)
5485 if (protocol[i]) {
5486 cards[j].protocol = protocol[i];
5487 nzproto++;
5488 - } else {
5489 - cards[j].protocol = DEFAULT_PROTO;
5490 }
5491 switch (type[i]) {
5492 case ISDN_CTYPE_16_0:
5493 @@ -1487,22 +1551,15 @@ static int __init HiSax_init(void)
5494 } else {
5495 /* QUADRO is a 4 BRI card */
5496 cards[j++].para[0] = 1;
5497 - /* we need to check if further cards can be added */
5498 - if (j < HISAX_MAX_CARDS) {
5499 - cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
5500 - cards[j].protocol = protocol[i];
5501 - cards[j++].para[0] = 2;
5502 - }
5503 - if (j < HISAX_MAX_CARDS) {
5504 - cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
5505 - cards[j].protocol = protocol[i];
5506 - cards[j++].para[0] = 3;
5507 - }
5508 - if (j < HISAX_MAX_CARDS) {
5509 - cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
5510 - cards[j].protocol = protocol[i];
5511 - cards[j].para[0] = 4;
5512 - }
5513 + cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
5514 + cards[j].protocol = protocol[i];
5515 + cards[j++].para[0] = 2;
5516 + cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
5517 + cards[j].protocol = protocol[i];
5518 + cards[j++].para[0] = 3;
5519 + cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
5520 + cards[j].protocol = protocol[i];
5521 + cards[j].para[0] = 4;
5522 }
5523 break;
5524 }
5525 @@ -1526,10 +1583,15 @@ static int __init HiSax_init(void)
5526 nrcards, (nrcards > 1) ? "s" : "");
5527
5528 /* Install only, if at least one card found */
5529 - if (!HiSax_inithardware(NULL))
5530 - return -ENODEV;
5531 + if (!HiSax_inithardware(NULL)) {
5532 + retval = -EIO;
5533 + goto out_isdnl1;
5534 + }
5535 +
5536 return 0;
5537
5538 + out_isdnl1:
5539 + Isdnl1Free();
5540 out_tei:
5541 TeiFree();
5542 out_isdnl2:
5543 @@ -1576,8 +1638,6 @@ int elsa_init_pcmcia(void *pcm_iob, int
5544 cards[i].typ = type[i];
5545 if (protocol[i]) {
5546 cards[i].protocol = protocol[i];
5547 - } else {
5548 - cards[i].protocol = DEFAULT_PROTO;
5549 }
5550 }
5551 cards[0].para[0] = pcm_irq;
5552 @@ -1595,8 +1655,7 @@ int elsa_init_pcmcia(void *pcm_iob, int
5553 printk(KERN_DEBUG "HiSax: Total %d card%s defined\n",
5554 nrcards, (nrcards > 1) ? "s" : "");
5555
5556 - if (!HiSax_inithardware(busy_flag))
5557 - return -ENODEV;
5558 + HiSax_inithardware(busy_flag);
5559 printk(KERN_NOTICE "HiSax: module installed\n");
5560 #endif
5561 return 0;
5562 @@ -1619,8 +1678,6 @@ int hfc_init_pcmcia(void *pcm_iob, int p
5563 cards[i].typ = type[i];
5564 if (protocol[i]) {
5565 cards[i].protocol = protocol[i];
5566 - } else {
5567 - cards[i].protocol = DEFAULT_PROTO;
5568 }
5569 }
5570 cards[0].para[0] = pcm_irq;
5571 @@ -1638,8 +1695,7 @@ int hfc_init_pcmcia(void *pcm_iob, int p
5572 printk(KERN_DEBUG "HiSax: Total %d card%s defined\n",
5573 nrcards, (nrcards > 1) ? "s" : "");
5574
5575 - if (!HiSax_inithardware(busy_flag))
5576 - return -ENODEV;
5577 + HiSax_inithardware(busy_flag);
5578 printk(KERN_NOTICE "HiSax: module installed\n");
5579 #endif
5580 return 0;
5581 @@ -1662,8 +1718,6 @@ int sedl_init_pcmcia(void *pcm_iob, int
5582 cards[i].typ = type[i];
5583 if (protocol[i]) {
5584 cards[i].protocol = protocol[i];
5585 - } else {
5586 - cards[i].protocol = DEFAULT_PROTO;
5587 }
5588 }
5589 cards[0].para[0] = pcm_irq;
5590 @@ -1681,8 +1735,7 @@ int sedl_init_pcmcia(void *pcm_iob, int
5591 printk(KERN_DEBUG "HiSax: Total %d card%s defined\n",
5592 nrcards, (nrcards > 1) ? "s" : "");
5593
5594 - if (!HiSax_inithardware(busy_flag))
5595 - return -ENODEV;
5596 + HiSax_inithardware(busy_flag);
5597 printk(KERN_NOTICE "HiSax: module installed\n");
5598 #endif
5599 return 0;
5600 @@ -1705,8 +1758,6 @@ int avm_a1_init_pcmcia(void *pcm_iob, in
5601 cards[i].typ = type[i];
5602 if (protocol[i]) {
5603 cards[i].protocol = protocol[i];
5604 - } else {
5605 - cards[i].protocol = DEFAULT_PROTO;
5606 }
5607 }
5608 cards[0].para[0] = pcm_irq;
5609 @@ -1724,8 +1775,7 @@ int avm_a1_init_pcmcia(void *pcm_iob, in
5610 printk(KERN_DEBUG "HiSax: Total %d card%s defined\n",
5611 nrcards, (nrcards > 1) ? "s" : "");
5612
5613 - if (!HiSax_inithardware(busy_flag))
5614 - return -ENODEV;
5615 + HiSax_inithardware(busy_flag);
5616 printk(KERN_NOTICE "HiSax: module installed\n");
5617 #endif
5618 return 0;
5619 @@ -1743,7 +1793,7 @@ int __devinit hisax_init_pcmcia(void *pc
5620 sprintf(ids, "HiSax%d", nrcards);
5621 else
5622 sprintf(ids, "HiSax");
5623 - if (!checkcard(nrcards, ids, busy_flag)) {
5624 + if (!checkcard(nrcards, ids, busy_flag, NULL)) {
5625 return -1;
5626 }
5627 ret = nrcards;
5628 @@ -1785,7 +1835,7 @@ int hisax_register(struct hisax_d_if *hi
5629 cards[i].protocol = protocol;
5630 sprintf(id, "%s%d", name, i);
5631 nrcards++;
5632 - retval = checkcard(i, id, 0);
5633 + retval = checkcard(i, id, 0, NULL);
5634 if (retval == 0) { // yuck
5635 cards[i].typ = 0;
5636 nrcards--;
5637 @@ -2117,9 +2167,6 @@ static struct pci_device_id hisax_pci_tb
5638 {PCI_VENDOR_ID_EICON, PCI_DEVICE_ID_EICON_DIVA20, PCI_ANY_ID, PCI_ANY_ID},
5639 {PCI_VENDOR_ID_EICON, PCI_DEVICE_ID_EICON_DIVA20_U, PCI_ANY_ID, PCI_ANY_ID},
5640 {PCI_VENDOR_ID_EICON, PCI_DEVICE_ID_EICON_DIVA201, PCI_ANY_ID, PCI_ANY_ID},
5641 -//#########################################################################################
5642 - {PCI_VENDOR_ID_EICON, PCI_DEVICE_ID_EICON_DIVA202, PCI_ANY_ID, PCI_ANY_ID},
5643 -//#########################################################################################
5644 #endif
5645 #ifdef CONFIG_HISAX_ELSA
5646 {PCI_VENDOR_ID_ELSA, PCI_DEVICE_ID_ELSA_MICROLINK, PCI_ANY_ID, PCI_ANY_ID},
5647 @@ -2178,11 +2225,3 @@ MODULE_DEVICE_TABLE(pci, hisax_pci_tbl);
5648
5649 module_init(HiSax_init);
5650 module_exit(HiSax_exit);
5651 -
5652 -EXPORT_SYMBOL(FsmNew);
5653 -EXPORT_SYMBOL(FsmFree);
5654 -EXPORT_SYMBOL(FsmEvent);
5655 -EXPORT_SYMBOL(FsmChangeState);
5656 -EXPORT_SYMBOL(FsmInitTimer);
5657 -EXPORT_SYMBOL(FsmDelTimer);
5658 -EXPORT_SYMBOL(FsmRestartTimer);
5659 Index: linux-2.4.35.4/drivers/isdn/hisax/diva.c
5660 ===================================================================
5661 --- linux-2.4.35.4.orig/drivers/isdn/hisax/diva.c
5662 +++ linux-2.4.35.4/drivers/isdn/hisax/diva.c
5663 @@ -1,4 +1,4 @@
5664 -/* $Id: diva.c,v 1.1.4.2 2002/08/30 11:21:00 keil Exp $
5665 +/* $Id: diva.c,v 1.33 2001/09/24 13:22:56 kai Exp $
5666 *
5667 * low level stuff for Eicon.Diehl Diva Family ISDN cards
5668 *
5669 @@ -22,14 +22,13 @@
5670 #include "isac.h"
5671 #include "hscx.h"
5672 #include "ipac.h"
5673 -#include "ipacx.h"
5674 #include "isdnl1.h"
5675 #include <linux/pci.h>
5676 -#include <linux/isapnp.h>
5677 +#include <linux/isdn_compat.h>
5678
5679 extern const char *CardType[];
5680
5681 -const char *Diva_revision = "$Revision: 1.1.4.2 $";
5682 +const char *Diva_revision = "$Revision: 1.33 $";
5683
5684 #define byteout(addr,val) outb(val,addr)
5685 #define bytein(addr) inb(addr)
5686 @@ -51,7 +50,6 @@ const char *Diva_revision = "$Revision:
5687 #define DIVA_PCI 2
5688 #define DIVA_IPAC_ISA 3
5689 #define DIVA_IPAC_PCI 4
5690 -#define DIVA_IPACX_PCI 5
5691
5692 /* CTRL (Read) */
5693 #define DIVA_IRQ_STAT 0x01
5694 @@ -71,12 +69,10 @@ const char *Diva_revision = "$Revision:
5695 #define PITA_MISC_REG 0x1c
5696 #ifdef __BIG_ENDIAN
5697 #define PITA_PARA_SOFTRESET 0x00000001
5698 -#define PITA_SER_SOFTRESET 0x00000002
5699 #define PITA_PARA_MPX_MODE 0x00000004
5700 #define PITA_INT0_ENABLE 0x00000200
5701 #else
5702 #define PITA_PARA_SOFTRESET 0x01000000
5703 -#define PITA_SER_SOFTRESET 0x02000000
5704 #define PITA_PARA_MPX_MODE 0x04000000
5705 #define PITA_INT0_ENABLE 0x00020000
5706 #endif
5707 @@ -244,47 +240,6 @@ MemWriteHSCX(struct IsdnCardState *cs, i
5708 memwritereg(cs->hw.diva.cfg_reg, offset + (hscx ? 0x40 : 0), value);
5709 }
5710
5711 -/* IO-Functions for IPACX type cards */
5712 -static u_char
5713 -MemReadISAC_IPACX(struct IsdnCardState *cs, u_char offset)
5714 -{
5715 - return (memreadreg(cs->hw.diva.cfg_reg, offset));
5716 -}
5717 -
5718 -static void
5719 -MemWriteISAC_IPACX(struct IsdnCardState *cs, u_char offset, u_char value)
5720 -{
5721 - memwritereg(cs->hw.diva.cfg_reg, offset, value);
5722 -}
5723 -
5724 -static void
5725 -MemReadISACfifo_IPACX(struct IsdnCardState *cs, u_char * data, int size)
5726 -{
5727 - while(size--)
5728 - *data++ = memreadreg(cs->hw.diva.cfg_reg, 0);
5729 -}
5730 -
5731 -static void
5732 -MemWriteISACfifo_IPACX(struct IsdnCardState *cs, u_char * data, int size)
5733 -{
5734 - while(size--)
5735 - memwritereg(cs->hw.diva.cfg_reg, 0, *data++);
5736 -}
5737 -
5738 -static u_char
5739 -MemReadHSCX_IPACX(struct IsdnCardState *cs, int hscx, u_char offset)
5740 -{
5741 - return(memreadreg(cs->hw.diva.cfg_reg, offset +
5742 - (hscx ? IPACX_OFF_B2 : IPACX_OFF_B1)));
5743 -}
5744 -
5745 -static void
5746 -MemWriteHSCX_IPACX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value)
5747 -{
5748 - memwritereg(cs->hw.diva.cfg_reg, offset +
5749 - (hscx ? IPACX_OFF_B2 : IPACX_OFF_B1), value);
5750 -}
5751 -
5752 /*
5753 * fast interrupt HSCX stuff goes here
5754 */
5755 @@ -595,7 +550,7 @@ Memhscx_int_main(struct IsdnCardState *c
5756 u_char exval;
5757 struct BCState *bcs;
5758
5759 - if (val & 0x01) { // EXB
5760 + if (val & 0x01) {
5761 bcs = cs->bcs + 1;
5762 exval = MemReadHSCX(cs, 1, HSCX_EXIR);
5763 if (exval & 0x40) {
5764 @@ -622,7 +577,7 @@ Memhscx_int_main(struct IsdnCardState *c
5765 debugl1(cs, "HSCX B interrupt %x", val);
5766 Memhscx_interrupt(cs, val, 1);
5767 }
5768 - if (val & 0x02) { // EXA
5769 + if (val & 0x02) {
5770 bcs = cs->bcs;
5771 exval = MemReadHSCX(cs, 0, HSCX_EXIR);
5772 if (exval & 0x40) {
5773 @@ -644,7 +599,7 @@ Memhscx_int_main(struct IsdnCardState *c
5774 } else if (cs->debug & L1_DEB_HSCX)
5775 debugl1(cs, "HSCX A EXIR %x", exval);
5776 }
5777 - if (val & 0x04) { // ICA
5778 + if (val & 0x04) {
5779 exval = MemReadHSCX(cs, 0, HSCX_ISTA);
5780 if (cs->debug & L1_DEB_HSCX)
5781 debugl1(cs, "HSCX A interrupt %x", exval);
5782 @@ -705,31 +660,12 @@ Start_IPACPCI:
5783 memwritereg(cs->hw.diva.cfg_reg, IPAC_MASK, 0xC0);
5784 }
5785
5786 -static void
5787 -diva_irq_ipacx_pci(int intno, void *dev_id, struct pt_regs *regs)
5788 -{
5789 - struct IsdnCardState *cs = dev_id;
5790 - u_char val;
5791 - u_char *cfg;
5792 -
5793 - if (!cs) {
5794 - printk(KERN_WARNING "Diva: Spurious interrupt!\n");
5795 - return;
5796 - }
5797 - cfg = (u_char *) cs->hw.diva.pci_cfg;
5798 - val = *cfg;
5799 - if (!(val &PITA_INT0_STATUS)) return; // other shared IRQ
5800 - interrupt_ipacx(cs); // handler for chip
5801 - *cfg = PITA_INT0_STATUS; // Reset PLX interrupt
5802 -}
5803 -
5804 void
5805 release_io_diva(struct IsdnCardState *cs)
5806 {
5807 int bytecnt;
5808
5809 - if ((cs->subtyp == DIVA_IPAC_PCI) ||
5810 - (cs->subtyp == DIVA_IPACX_PCI) ) {
5811 + if (cs->subtyp == DIVA_IPAC_PCI) {
5812 u_int *cfg = (unsigned int *)cs->hw.diva.pci_cfg;
5813
5814 *cfg = 0; /* disable INT0/1 */
5815 @@ -776,16 +712,6 @@ reset_diva(struct IsdnCardState *cs)
5816 set_current_state(TASK_UNINTERRUPTIBLE);
5817 schedule_timeout((10*HZ)/1000);
5818 memwritereg(cs->hw.diva.cfg_reg, IPAC_MASK, 0xc0);
5819 - } else if (cs->subtyp == DIVA_IPACX_PCI) {
5820 - unsigned int *ireg = (unsigned int *)(cs->hw.diva.pci_cfg +
5821 - PITA_MISC_REG);
5822 - *ireg = PITA_PARA_SOFTRESET | PITA_PARA_MPX_MODE;
5823 - set_current_state(TASK_UNINTERRUPTIBLE);
5824 - schedule_timeout((10*HZ)/1000);
5825 - *ireg = PITA_PARA_MPX_MODE | PITA_SER_SOFTRESET;
5826 - set_current_state(TASK_UNINTERRUPTIBLE);
5827 - schedule_timeout((10*HZ)/1000);
5828 - MemWriteISAC_IPACX(cs, IPACX_MASK, 0xff); // Interrupts off
5829 } else { /* DIVA 2.0 */
5830 cs->hw.diva.ctrl_reg = 0; /* Reset On */
5831 byteout(cs->hw.diva.ctrl, cs->hw.diva.ctrl_reg);
5832 @@ -814,9 +740,7 @@ diva_led_handler(struct IsdnCardState *c
5833 {
5834 int blink = 0;
5835
5836 - if ((cs->subtyp == DIVA_IPAC_ISA) ||
5837 - (cs->subtyp == DIVA_IPAC_PCI) ||
5838 - (cs->subtyp == DIVA_IPACX_PCI) )
5839 + if ((cs->subtyp == DIVA_IPAC_ISA) || (cs->subtyp == DIVA_IPAC_PCI))
5840 return;
5841 del_timer(&cs->hw.diva.tl);
5842 if (cs->hw.diva.status & DIVA_ASSIGN)
5843 @@ -859,12 +783,6 @@ Diva_card_msg(struct IsdnCardState *cs,
5844 release_io_diva(cs);
5845 return(0);
5846 case CARD_INIT:
5847 - if (cs->subtyp == DIVA_IPACX_PCI) {
5848 - ireg = (unsigned int *)cs->hw.diva.pci_cfg;
5849 - *ireg = PITA_INT0_ENABLE;
5850 - init_ipacx(cs, 3); // init chip and enable interrupts
5851 - return (0);
5852 - }
5853 if (cs->subtyp == DIVA_IPAC_PCI) {
5854 ireg = (unsigned int *)cs->hw.diva.pci_cfg;
5855 *ireg = PITA_INT0_ENABLE;
5856 @@ -901,9 +819,7 @@ Diva_card_msg(struct IsdnCardState *cs,
5857 }
5858 break;
5859 }
5860 - if ((cs->subtyp != DIVA_IPAC_ISA) &&
5861 - (cs->subtyp != DIVA_IPAC_PCI) &&
5862 - (cs->subtyp != DIVA_IPACX_PCI) )
5863 + if ((cs->subtyp != DIVA_IPAC_ISA) && (cs->subtyp != DIVA_IPAC_PCI))
5864 diva_led_handler(cs);
5865 return(0);
5866 }
5867 @@ -911,40 +827,11 @@ Diva_card_msg(struct IsdnCardState *cs,
5868 static struct pci_dev *dev_diva __initdata = NULL;
5869 static struct pci_dev *dev_diva_u __initdata = NULL;
5870 static struct pci_dev *dev_diva201 __initdata = NULL;
5871 -static struct pci_dev *dev_diva202 __initdata = NULL;
5872 -
5873 -#ifdef __ISAPNP__
5874 -static struct isapnp_device_id diva_ids[] __initdata = {
5875 - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51),
5876 - ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51),
5877 - (unsigned long) "Diva picola" },
5878 - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51),
5879 - ISAPNP_VENDOR('E', 'I', 'C'), ISAPNP_FUNCTION(0x51),
5880 - (unsigned long) "Diva picola" },
5881 - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x71),
5882 - ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x71),
5883 - (unsigned long) "Diva 2.0" },
5884 - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x71),
5885 - ISAPNP_VENDOR('E', 'I', 'C'), ISAPNP_FUNCTION(0x71),
5886 - (unsigned long) "Diva 2.0" },
5887 - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0xA1),
5888 - ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0xA1),
5889 - (unsigned long) "Diva 2.01" },
5890 - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0xA1),
5891 - ISAPNP_VENDOR('E', 'I', 'C'), ISAPNP_FUNCTION(0xA1),
5892 - (unsigned long) "Diva 2.01" },
5893 - { 0, }
5894 -};
5895 -
5896 -static struct isapnp_device_id *pdev = &diva_ids[0];
5897 -static struct pci_bus *pnp_c __devinitdata = NULL;
5898 -#endif
5899 -
5900
5901 int __init
5902 setup_diva(struct IsdnCard *card)
5903 {
5904 - int bytecnt = 8;
5905 + int bytecnt;
5906 u_char val;
5907 struct IsdnCardState *cs = card->cs;
5908 char tmp[64];
5909 @@ -977,75 +864,8 @@ setup_diva(struct IsdnCard *card)
5910 cs->hw.diva.hscx_adr = card->para[1] + DIVA_HSCX_ADR;
5911 }
5912 cs->irq = card->para[0];
5913 + bytecnt = 8;
5914 } else {
5915 -#ifdef __ISAPNP__
5916 - if (isapnp_present()) {
5917 - struct pci_bus *pb;
5918 - struct pci_dev *pd;
5919 -
5920 - while(pdev->card_vendor) {
5921 - if ((pb = isapnp_find_card(pdev->card_vendor,
5922 - pdev->card_device, pnp_c))) {
5923 - pnp_c = pb;
5924 - pd = NULL;
5925 - if ((pd = isapnp_find_dev(pnp_c,
5926 - pdev->vendor, pdev->function, pd))) {
5927 - printk(KERN_INFO "HiSax: %s detected\n",
5928 - (char *)pdev->driver_data);
5929 - pd->prepare(pd);
5930 - pd->deactivate(pd);
5931 - pd->activate(pd);
5932 - card->para[1] =
5933 - pd->resource[0].start;
5934 - card->para[0] =
5935 - pd->irq_resource[0].start;
5936 - if (!card->para[0] || !card->para[1]) {
5937 - printk(KERN_ERR "Diva PnP:some resources are missing %ld/%lx\n",
5938 - card->para[0], card->para[1]);
5939 - pd->deactivate(pd);
5940 - return(0);
5941 - }
5942 - cs->hw.diva.cfg_reg = card->para[1];
5943 - cs->irq = card->para[0];
5944 - if (pdev->function == ISAPNP_FUNCTION(0xA1)) {
5945 - cs->subtyp = DIVA_IPAC_ISA;
5946 - cs->hw.diva.ctrl = 0;
5947 - cs->hw.diva.isac =
5948 - card->para[1] + DIVA_IPAC_DATA;
5949 - cs->hw.diva.hscx =
5950 - card->para[1] + DIVA_IPAC_DATA;
5951 - cs->hw.diva.isac_adr =
5952 - card->para[1] + DIVA_IPAC_ADR;
5953 - cs->hw.diva.hscx_adr =
5954 - card->para[1] + DIVA_IPAC_ADR;
5955 - test_and_set_bit(HW_IPAC, &cs->HW_Flags);
5956 - } else {
5957 - cs->subtyp = DIVA_ISA;
5958 - cs->hw.diva.ctrl =
5959 - card->para[1] + DIVA_ISA_CTRL;
5960 - cs->hw.diva.isac =
5961 - card->para[1] + DIVA_ISA_ISAC_DATA;
5962 - cs->hw.diva.hscx =
5963 - card->para[1] + DIVA_HSCX_DATA;
5964 - cs->hw.diva.isac_adr =
5965 - card->para[1] + DIVA_ISA_ISAC_ADR;
5966 - cs->hw.diva.hscx_adr =
5967 - card->para[1] + DIVA_HSCX_ADR;
5968 - }
5969 - goto ready;
5970 - } else {
5971 - printk(KERN_ERR "Diva PnP: PnP error card found, no device\n");
5972 - return(0);
5973 - }
5974 - }
5975 - pdev++;
5976 - pnp_c=NULL;
5977 - }
5978 - if (!pdev->card_vendor) {
5979 - printk(KERN_INFO "Diva PnP: no ISAPnP card found\n");
5980 - }
5981 - }
5982 -#endif
5983 #if CONFIG_PCI
5984 if (!pci_present()) {
5985 printk(KERN_ERR "Diva: no PCI bus present\n");
5986 @@ -1059,14 +879,14 @@ setup_diva(struct IsdnCard *card)
5987 return(0);
5988 cs->subtyp = DIVA_PCI;
5989 cs->irq = dev_diva->irq;
5990 - cs->hw.diva.cfg_reg = pci_resource_start(dev_diva, 2);
5991 + cs->hw.diva.cfg_reg = pci_resource_start_io(dev_diva, 2);
5992 } else if ((dev_diva_u = pci_find_device(PCI_VENDOR_ID_EICON,
5993 PCI_DEVICE_ID_EICON_DIVA20_U, dev_diva_u))) {
5994 if (pci_enable_device(dev_diva_u))
5995 return(0);
5996 cs->subtyp = DIVA_PCI;
5997 cs->irq = dev_diva_u->irq;
5998 - cs->hw.diva.cfg_reg = pci_resource_start(dev_diva_u, 2);
5999 + cs->hw.diva.cfg_reg = pci_resource_start_io(dev_diva_u, 2);
6000 } else if ((dev_diva201 = pci_find_device(PCI_VENDOR_ID_EICON,
6001 PCI_DEVICE_ID_EICON_DIVA201, dev_diva201))) {
6002 if (pci_enable_device(dev_diva201))
6003 @@ -1074,19 +894,9 @@ setup_diva(struct IsdnCard *card)
6004 cs->subtyp = DIVA_IPAC_PCI;
6005 cs->irq = dev_diva201->irq;
6006 cs->hw.diva.pci_cfg =
6007 - (ulong) ioremap(pci_resource_start(dev_diva201, 0), 4096);
6008 + (ulong) ioremap(pci_resource_start_mem(dev_diva201, 0), 4096);
6009 cs->hw.diva.cfg_reg =
6010 - (ulong) ioremap(pci_resource_start(dev_diva201, 1), 4096);
6011 - } else if ((dev_diva202 = pci_find_device(PCI_VENDOR_ID_EICON,
6012 - PCI_DEVICE_ID_EICON_DIVA202, dev_diva202))) {
6013 - if (pci_enable_device(dev_diva202))
6014 - return(0);
6015 - cs->subtyp = DIVA_IPACX_PCI;
6016 - cs->irq = dev_diva202->irq;
6017 - cs->hw.diva.pci_cfg =
6018 - (ulong) ioremap(pci_resource_start(dev_diva202, 0), 4096);
6019 - cs->hw.diva.cfg_reg =
6020 - (ulong) ioremap(pci_resource_start(dev_diva202, 1), 4096);
6021 + (ulong) ioremap(pci_resource_start_mem(dev_diva201, 1), 4096);
6022 } else {
6023 printk(KERN_WARNING "Diva: No PCI card found\n");
6024 return(0);
6025 @@ -1107,8 +917,7 @@ setup_diva(struct IsdnCard *card)
6026 printk(KERN_WARNING "Diva: unable to config DIVA PCI\n");
6027 return (0);
6028 #endif /* CONFIG_PCI */
6029 - if ((cs->subtyp == DIVA_IPAC_PCI) ||
6030 - (cs->subtyp == DIVA_IPACX_PCI) ) {
6031 + if (cs->subtyp == DIVA_IPAC_PCI) {
6032 cs->hw.diva.ctrl = 0;
6033 cs->hw.diva.isac = 0;
6034 cs->hw.diva.hscx = 0;
6035 @@ -1125,23 +934,18 @@ setup_diva(struct IsdnCard *card)
6036 bytecnt = 32;
6037 }
6038 }
6039 -ready:
6040 +
6041 printk(KERN_INFO
6042 "Diva: %s card configured at %#lx IRQ %d\n",
6043 (cs->subtyp == DIVA_PCI) ? "PCI" :
6044 (cs->subtyp == DIVA_ISA) ? "ISA" :
6045 - (cs->subtyp == DIVA_IPAC_ISA) ? "IPAC ISA" :
6046 - (cs->subtyp == DIVA_IPAC_PCI) ? "IPAC PCI" : "IPACX PCI",
6047 + (cs->subtyp == DIVA_IPAC_ISA) ? "IPAC ISA" : "IPAC PCI",
6048 cs->hw.diva.cfg_reg, cs->irq);
6049 - if ((cs->subtyp == DIVA_IPAC_PCI) ||
6050 - (cs->subtyp == DIVA_IPACX_PCI) ||
6051 - (cs->subtyp == DIVA_PCI) )
6052 - printk(KERN_INFO "Diva: %s space at %#lx\n",
6053 - (cs->subtyp == DIVA_PCI) ? "PCI" :
6054 - (cs->subtyp == DIVA_IPAC_PCI) ? "IPAC PCI" : "IPACX PCI",
6055 + if ((cs->subtyp == DIVA_IPAC_PCI) || (cs->subtyp == DIVA_PCI))
6056 + printk(KERN_INFO "Diva: %s PCI space at %#lx\n",
6057 + (cs->subtyp == DIVA_PCI) ? "PCI" : "IPAC PCI",
6058 cs->hw.diva.pci_cfg);
6059 - if ((cs->subtyp != DIVA_IPAC_PCI) &&
6060 - (cs->subtyp != DIVA_IPACX_PCI) ) {
6061 + if (cs->subtyp != DIVA_IPAC_PCI) {
6062 if (check_region(cs->hw.diva.cfg_reg, bytecnt)) {
6063 printk(KERN_WARNING
6064 "HiSax: %s config port %lx-%lx already in use\n",
6065 @@ -1177,17 +981,6 @@ ready:
6066 cs->irq_func = &diva_irq_ipac_pci;
6067 val = memreadreg(cs->hw.diva.cfg_reg, IPAC_ID);
6068 printk(KERN_INFO "Diva: IPAC version %x\n", val);
6069 - } else if (cs->subtyp == DIVA_IPACX_PCI) {
6070 - cs->readisac = &MemReadISAC_IPACX;
6071 - cs->writeisac = &MemWriteISAC_IPACX;
6072 - cs->readisacfifo = &MemReadISACfifo_IPACX;
6073 - cs->writeisacfifo = &MemWriteISACfifo_IPACX;
6074 - cs->BC_Read_Reg = &MemReadHSCX_IPACX;
6075 - cs->BC_Write_Reg = &MemWriteHSCX_IPACX;
6076 - cs->BC_Send_Data = 0; // function located in ipacx module
6077 - cs->irq_func = &diva_irq_ipacx_pci;
6078 - printk(KERN_INFO "Diva: IPACX Design Id: %x\n",
6079 - MemReadISAC_IPACX(cs, IPACX_ID) &0x3F);
6080 } else { /* DIVA 2.0 */
6081 cs->hw.diva.tl.function = (void *) diva_led_handler;
6082 cs->hw.diva.tl.data = (long) cs;
6083 Index: linux-2.4.35.4/drivers/isdn/hisax/elsa.c
6084 ===================================================================
6085 --- linux-2.4.35.4.orig/drivers/isdn/hisax/elsa.c
6086 +++ linux-2.4.35.4/drivers/isdn/hisax/elsa.c
6087 @@ -1,4 +1,4 @@
6088 -/* $Id: elsa.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6089 +/* $Id: elsa.c,v 2.32 2001/09/24 13:22:56 kai Exp $
6090 *
6091 * low level stuff for Elsa isdn cards
6092 *
6093 @@ -28,13 +28,13 @@
6094 #include "hscx.h"
6095 #include "isdnl1.h"
6096 #include <linux/pci.h>
6097 -#include <linux/isapnp.h>
6098 +#include <linux/isdn_compat.h>
6099 #include <linux/serial.h>
6100 #include <linux/serial_reg.h>
6101
6102 extern const char *CardType[];
6103
6104 -const char *Elsa_revision = "$Revision: 1.1.4.1 $";
6105 +const char *Elsa_revision = "$Revision: 2.32 $";
6106 const char *Elsa_Types[] =
6107 {"None", "PC", "PCC-8", "PCC-16", "PCF", "PCF-Pro",
6108 "PCMCIA", "QS 1000", "QS 3000", "Microlink PCI", "QS 3000 PCI",
6109 @@ -864,21 +864,6 @@ probe_elsa(struct IsdnCardState *cs)
6110 static struct pci_dev *dev_qs1000 __devinitdata = NULL;
6111 static struct pci_dev *dev_qs3000 __devinitdata = NULL;
6112
6113 -#ifdef __ISAPNP__
6114 -static struct isapnp_device_id elsa_ids[] __initdata = {
6115 - { ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0133),
6116 - ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0133),
6117 - (unsigned long) "Elsa QS1000" },
6118 - { ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0134),
6119 - ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0134),
6120 - (unsigned long) "Elsa QS3000" },
6121 - { 0, }
6122 -};
6123 -
6124 -static struct isapnp_device_id *pdev = &elsa_ids[0];
6125 -static struct pci_bus *pnp_c __devinitdata = NULL;
6126 -#endif
6127 -
6128 int __devinit
6129 setup_elsa(struct IsdnCard *card)
6130 {
6131 @@ -893,7 +878,6 @@ setup_elsa(struct IsdnCard *card)
6132 cs->hw.elsa.ctrl_reg = 0;
6133 cs->hw.elsa.status = 0;
6134 cs->hw.elsa.MFlag = 0;
6135 - cs->subtyp = 0;
6136 if (cs->typ == ISDN_CTYPE_ELSA) {
6137 cs->hw.elsa.base = card->para[0];
6138 printk(KERN_INFO "Elsa: Microlink IO probing\n");
6139 @@ -955,60 +939,9 @@ setup_elsa(struct IsdnCard *card)
6140 return (0);
6141 }
6142 } else if (cs->typ == ISDN_CTYPE_ELSA_PNP) {
6143 -#ifdef __ISAPNP__
6144 - if (!card->para[1] && isapnp_present()) {
6145 - struct pci_bus *pb;
6146 - struct pci_dev *pd;
6147 -
6148 - while(pdev->card_vendor) {
6149 - if ((pb = isapnp_find_card(pdev->card_vendor,
6150 - pdev->card_device, pnp_c))) {
6151 - pnp_c = pb;
6152 - pd = NULL;
6153 - if ((pd = isapnp_find_dev(pnp_c,
6154 - pdev->vendor, pdev->function, pd))) {
6155 - printk(KERN_INFO "HiSax: %s detected\n",
6156 - (char *)pdev->driver_data);
6157 - pd->prepare(pd);
6158 - pd->deactivate(pd);
6159 - pd->activate(pd);
6160 - card->para[1] =
6161 - pd->resource[0].start;
6162 - card->para[0] =
6163 - pd->irq_resource[0].start;
6164 - if (!card->para[0] || !card->para[1]) {
6165 - printk(KERN_ERR "Elsa PnP:some resources are missing %ld/%lx\n",
6166 - card->para[0], card->para[1]);
6167 - pd->deactivate(pd);
6168 - return(0);
6169 - }
6170 - if (pdev->function == ISAPNP_FUNCTION(0x133))
6171 - cs->subtyp = ELSA_QS1000;
6172 - else
6173 - cs->subtyp = ELSA_QS3000;
6174 - break;
6175 - } else {
6176 - printk(KERN_ERR "Elsa PnP: PnP error card found, no device\n");
6177 - return(0);
6178 - }
6179 - }
6180 - pdev++;
6181 - pnp_c=NULL;
6182 - }
6183 - if (!pdev->card_vendor) {
6184 - printk(KERN_INFO "Elsa PnP: no ISAPnP card found\n");
6185 - return(0);
6186 - }
6187 - }
6188 -#endif
6189 - if (card->para[1] && card->para[0]) {
6190 - cs->hw.elsa.base = card->para[1];
6191 - cs->irq = card->para[0];
6192 - if (!cs->subtyp)
6193 - cs->subtyp = ELSA_QS1000;
6194 - } else {
6195 - printk(KERN_ERR "Elsa PnP: no parameter\n");
6196 - }
6197 + cs->hw.elsa.base = card->para[1];
6198 + cs->irq = card->para[0];
6199 + cs->subtyp = ELSA_QS1000;
6200 cs->hw.elsa.cfg = cs->hw.elsa.base + ELSA_CONFIG;
6201 cs->hw.elsa.ale = cs->hw.elsa.base + ELSA_ALE;
6202 cs->hw.elsa.isac = cs->hw.elsa.base + ELSA_ISAC;
6203 @@ -1058,16 +991,16 @@ setup_elsa(struct IsdnCard *card)
6204 return(0);
6205 cs->subtyp = ELSA_QS1000PCI;
6206 cs->irq = dev_qs1000->irq;
6207 - cs->hw.elsa.cfg = pci_resource_start(dev_qs1000, 1);
6208 - cs->hw.elsa.base = pci_resource_start(dev_qs1000, 3);
6209 + cs->hw.elsa.cfg = pci_resource_start_io(dev_qs1000, 1);
6210 + cs->hw.elsa.base = pci_resource_start_io(dev_qs1000, 3);
6211 } else if ((dev_qs3000 = pci_find_device(PCI_VENDOR_ID_ELSA,
6212 PCI_DEVICE_ID_ELSA_QS3000, dev_qs3000))) {
6213 if (pci_enable_device(dev_qs3000))
6214 return(0);
6215 cs->subtyp = ELSA_QS3000PCI;
6216 cs->irq = dev_qs3000->irq;
6217 - cs->hw.elsa.cfg = pci_resource_start(dev_qs3000, 1);
6218 - cs->hw.elsa.base = pci_resource_start(dev_qs3000, 3);
6219 + cs->hw.elsa.cfg = pci_resource_start_io(dev_qs3000, 1);
6220 + cs->hw.elsa.base = pci_resource_start_io(dev_qs3000, 3);
6221 } else {
6222 printk(KERN_WARNING "Elsa: No PCI card found\n");
6223 return(0);
6224 @@ -1123,7 +1056,6 @@ setup_elsa(struct IsdnCard *card)
6225 break;
6226 case ELSA_PCFPRO:
6227 case ELSA_PCF:
6228 - case ELSA_QS3000:
6229 case ELSA_QS3000PCI:
6230 bytecnt = 16;
6231 break;
6232 Index: linux-2.4.35.4/drivers/isdn/hisax/elsa_cs.c
6233 ===================================================================
6234 --- linux-2.4.35.4.orig/drivers/isdn/hisax/elsa_cs.c
6235 +++ linux-2.4.35.4/drivers/isdn/hisax/elsa_cs.c
6236 @@ -72,7 +72,7 @@ static int pc_debug = PCMCIA_DEBUG;
6237 MODULE_PARM(pc_debug, "i");
6238 #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args);
6239 static char *version =
6240 -"elsa_cs.c $Revision: 1.1.4.1 $ $Date: 2001/11/20 14:19:35 $ (K.Lichtenwalder)";
6241 +"elsa_cs.c $Revision: 1.2 $ $Date: 2001/09/24 13:22:56 $ (K.Lichtenwalder)";
6242 #else
6243 #define DEBUG(n, args...)
6244 #endif
6245 Index: linux-2.4.35.4/drivers/isdn/hisax/elsa_ser.c
6246 ===================================================================
6247 --- linux-2.4.35.4.orig/drivers/isdn/hisax/elsa_ser.c
6248 +++ linux-2.4.35.4/drivers/isdn/hisax/elsa_ser.c
6249 @@ -1,4 +1,4 @@
6250 -/* $Id: elsa_ser.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6251 +/* $Id: elsa_ser.c,v 2.14 2001/09/24 13:22:56 kai Exp $
6252 *
6253 * stuff for the serial modem on ELSA cards
6254 *
6255 @@ -396,6 +396,74 @@ static inline void transmit_chars(struct
6256 }
6257 }
6258
6259 +#if 0
6260 +static inline void check_modem_status(struct IsdnCardState *cs)
6261 +{
6262 + int status;
6263 + struct async_struct *info = cs->hw.elsa.info;
6264 + struct async_icount *icount;
6265 +
6266 + status = serial_inp(info, UART_MSR);
6267 +
6268 + if (status & UART_MSR_ANY_DELTA) {
6269 + icount = &info->state->icount;
6270 + /* update input line counters */
6271 + if (status & UART_MSR_TERI)
6272 + icount->rng++;
6273 + if (status & UART_MSR_DDSR)
6274 + icount->dsr++;
6275 + if (status & UART_MSR_DDCD) {
6276 + icount->dcd++;
6277 + }
6278 + if (status & UART_MSR_DCTS)
6279 + icount->cts++;
6280 +// wake_up(&info->delta_msr_wait);
6281 + }
6282 +
6283 + if ((info->flags & ASYNC_CHECK_CD) && (status & UART_MSR_DDCD)) {
6284 +#if (defined(SERIAL_DEBUG_OPEN) || defined(SERIAL_DEBUG_INTR))
6285 + printk("ttys%d CD now %s...", info->line,
6286 + (status & UART_MSR_DCD) ? "on" : "off");
6287 +#endif
6288 + if (status & UART_MSR_DCD)
6289 +// wake_up(&info->open_wait);
6290 +;
6291 + else if (!((info->flags & ASYNC_CALLOUT_ACTIVE) &&
6292 + (info->flags & ASYNC_CALLOUT_NOHUP))) {
6293 +#ifdef SERIAL_DEBUG_OPEN
6294 + printk("doing serial hangup...");
6295 +#endif
6296 + if (info->tty)
6297 + tty_hangup(info->tty);
6298 + }
6299 + }
6300 +#if 0
6301 + if (info->flags & ASYNC_CTS_FLOW) {
6302 + if (info->tty->hw_stopped) {
6303 + if (status & UART_MSR_CTS) {
6304 +#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW))
6305 + printk("CTS tx start...");
6306 +#endif
6307 + info->tty->hw_stopped = 0;
6308 + info->IER |= UART_IER_THRI;
6309 + serial_outp(info, UART_IER, info->IER);
6310 +// rs_sched_event(info, RS_EVENT_WRITE_WAKEUP);
6311 + return;
6312 + }
6313 + } else {
6314 + if (!(status & UART_MSR_CTS)) {
6315 +#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW))
6316 + printk("CTS tx stop...");
6317 +#endif
6318 + info->tty->hw_stopped = 1;
6319 + info->IER &= ~UART_IER_THRI;
6320 + serial_outp(info, UART_IER, info->IER);
6321 + }
6322 + }
6323 + }
6324 +#endif 0
6325 +}
6326 +#endif
6327
6328 static void rs_interrupt_elsa(int irq, struct IsdnCardState *cs)
6329 {
6330 Index: linux-2.4.35.4/drivers/isdn/hisax/fsm.c
6331 ===================================================================
6332 --- linux-2.4.35.4.orig/drivers/isdn/hisax/fsm.c
6333 +++ linux-2.4.35.4/drivers/isdn/hisax/fsm.c
6334 @@ -1,4 +1,4 @@
6335 -/* $Id: fsm.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6336 +/* $Id$
6337 *
6338 * Finite state machine
6339 *
6340 @@ -21,6 +21,14 @@
6341
6342 #define FSM_TIMER_DEBUG 0
6343
6344 +EXPORT_SYMBOL(FsmNew);
6345 +EXPORT_SYMBOL(FsmFree);
6346 +EXPORT_SYMBOL(FsmEvent);
6347 +EXPORT_SYMBOL(FsmChangeState);
6348 +EXPORT_SYMBOL(FsmInitTimer);
6349 +EXPORT_SYMBOL(FsmDelTimer);
6350 +EXPORT_SYMBOL(FsmRestartTimer);
6351 +
6352 int __init
6353 FsmNew(struct Fsm *fsm, struct FsmNode *fnlist, int fncount)
6354 {
6355 Index: linux-2.4.35.4/drivers/isdn/hisax/fsm.h
6356 ===================================================================
6357 --- linux-2.4.35.4.orig/drivers/isdn/hisax/fsm.h
6358 +++ linux-2.4.35.4/drivers/isdn/hisax/fsm.h
6359 @@ -1,4 +1,4 @@
6360 -/* $Id: fsm.h,v 1.1.2.1 2001/11/20 14:19:35 kai Exp $
6361 +/* $Id$
6362 *
6363 * Finite state machine
6364 *
6365 Index: linux-2.4.35.4/drivers/isdn/hisax/gazel.c
6366 ===================================================================
6367 --- linux-2.4.35.4.orig/drivers/isdn/hisax/gazel.c
6368 +++ linux-2.4.35.4/drivers/isdn/hisax/gazel.c
6369 @@ -1,4 +1,4 @@
6370 -/* $Id: gazel.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6371 +/* $Id: gazel.c,v 2.19 2001/09/24 13:22:56 kai Exp $
6372 *
6373 * low level stuff for Gazel isdn cards
6374 *
6375 @@ -20,9 +20,10 @@
6376 #include "isdnl1.h"
6377 #include "ipac.h"
6378 #include <linux/pci.h>
6379 +#include <linux/isdn_compat.h>
6380
6381 extern const char *CardType[];
6382 -const char *gazel_revision = "$Revision: 1.1.4.1 $";
6383 +const char *gazel_revision = "$Revision: 2.19 $";
6384
6385 #define R647 1
6386 #define R685 2
6387 @@ -563,8 +564,8 @@ setup_gazelpci(struct IsdnCardState *cs)
6388 if (pci_enable_device(dev_tel))
6389 return 1;
6390 pci_irq = dev_tel->irq;
6391 - pci_ioaddr0 = pci_resource_start(dev_tel, 1);
6392 - pci_ioaddr1 = pci_resource_start(dev_tel, 2);
6393 + pci_ioaddr0 = pci_resource_start_io(dev_tel, 1);
6394 + pci_ioaddr1 = pci_resource_start_io(dev_tel, 2);
6395 found = 1;
6396 }
6397 if (found)
6398 Index: linux-2.4.35.4/drivers/isdn/hisax/hfc_2bds0.c
6399 ===================================================================
6400 --- linux-2.4.35.4.orig/drivers/isdn/hisax/hfc_2bds0.c
6401 +++ linux-2.4.35.4/drivers/isdn/hisax/hfc_2bds0.c
6402 @@ -1,4 +1,4 @@
6403 -/* $Id: hfc_2bds0.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6404 +/* $Id: hfc_2bds0.c,v 1.18 2001/09/24 13:22:56 kai Exp $
6405 *
6406 * specific routines for CCD's HFC 2BDS0
6407 *
6408 @@ -616,6 +616,17 @@ hfcd_bh(struct IsdnCardState *cs)
6409 */
6410 if (!cs)
6411 return;
6412 +#if 0
6413 + if (test_and_clear_bit(D_CLEARBUSY, &cs->event)) {
6414 + if (cs->debug)
6415 + debugl1(cs, "D-Channel Busy cleared");
6416 + stptr = cs->stlist;
6417 + while (stptr != NULL) {
6418 + stptr->l1.l1l2(stptr, PH_PAUSE | CONFIRM, NULL);
6419 + stptr = stptr->next;
6420 + }
6421 + }
6422 +#endif
6423 if (test_and_clear_bit(D_L1STATECHANGE, &cs->event)) {
6424 switch (cs->dc.hfcd.ph_state) {
6425 case (0):
6426 @@ -1090,6 +1101,32 @@ HFCD_l1hw(struct PStack *st, int pr, voi
6427 cs->hw.hfcD.mst_m |= HFCD_MASTER;
6428 cs->writeisac(cs, HFCD_MST_MODE, cs->hw.hfcD.mst_m);
6429 break;
6430 +#if 0
6431 + case (HW_TESTLOOP | REQUEST):
6432 + u_char val = 0;
6433 + if (1 & (int) arg)
6434 + val |= 0x0c;
6435 + if (2 & (int) arg)
6436 + val |= 0x3;
6437 + if (test_bit(HW_IOM1, &cs->HW_Flags)) {
6438 + /* IOM 1 Mode */
6439 + if (!val) {
6440 + cs->writeisac(cs, ISAC_SPCR, 0xa);
6441 + cs->writeisac(cs, ISAC_ADF1, 0x2);
6442 + } else {
6443 + cs->writeisac(cs, ISAC_SPCR, val);
6444 + cs->writeisac(cs, ISAC_ADF1, 0xa);
6445 + }
6446 + } else {
6447 + /* IOM 2 Mode */
6448 + cs->writeisac(cs, ISAC_SPCR, val);
6449 + if (val)
6450 + cs->writeisac(cs, ISAC_ADF1, 0x8);
6451 + else
6452 + cs->writeisac(cs, ISAC_ADF1, 0x0);
6453 + }
6454 + break;
6455 +#endif
6456 default:
6457 if (cs->debug & L1_DEB_WARN)
6458 debugl1(cs, "hfcd_l1hw unknown pr %4x", pr);
6459 @@ -1106,6 +1143,20 @@ setstack_hfcd(struct PStack *st, struct
6460 static void
6461 hfc_dbusy_timer(struct IsdnCardState *cs)
6462 {
6463 +#if 0
6464 + struct PStack *stptr;
6465 + if (test_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) {
6466 + if (cs->debug)
6467 + debugl1(cs, "D-Channel Busy");
6468 + test_and_set_bit(FLG_L1_DBUSY, &cs->HW_Flags);
6469 + stptr = cs->stlist;
6470 +
6471 + while (stptr != NULL) {
6472 + stptr->l1.l1l2(stptr, PH_PAUSE | INDICATION, NULL);
6473 + stptr = stptr->next;
6474 + }
6475 + }
6476 +#endif
6477 }
6478
6479 unsigned int __init
6480 Index: linux-2.4.35.4/drivers/isdn/hisax/hfc_2bds0.h
6481 ===================================================================
6482 --- linux-2.4.35.4.orig/drivers/isdn/hisax/hfc_2bds0.h
6483 +++ linux-2.4.35.4/drivers/isdn/hisax/hfc_2bds0.h
6484 @@ -1,4 +1,4 @@
6485 -/* $Id: hfc_2bds0.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6486 +/* $Id: hfc_2bds0.h,v 1.6 2001/09/24 13:22:56 kai Exp $
6487 *
6488 * specific defines for CCD's HFC 2BDS0
6489 *
6490 Index: linux-2.4.35.4/drivers/isdn/hisax/hfc_2bs0.c
6491 ===================================================================
6492 --- linux-2.4.35.4.orig/drivers/isdn/hisax/hfc_2bs0.c
6493 +++ linux-2.4.35.4/drivers/isdn/hisax/hfc_2bs0.c
6494 @@ -1,4 +1,4 @@
6495 -/* $Id: hfc_2bs0.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6496 +/* $Id: hfc_2bs0.c,v 1.20 2001/09/24 13:22:56 kai Exp $
6497 *
6498 * specific routines for CCD's HFC 2BS0
6499 *
6500 Index: linux-2.4.35.4/drivers/isdn/hisax/hfc_2bs0.h
6501 ===================================================================
6502 --- linux-2.4.35.4.orig/drivers/isdn/hisax/hfc_2bs0.h
6503 +++ linux-2.4.35.4/drivers/isdn/hisax/hfc_2bs0.h
6504 @@ -1,4 +1,4 @@
6505 -/* $Id: hfc_2bs0.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6506 +/* $Id: hfc_2bs0.h,v 1.5 2001/09/24 13:22:56 kai Exp $
6507 *
6508 * specific defines for CCD's HFC 2BS0
6509 *
6510 Index: linux-2.4.35.4/drivers/isdn/hisax/hfc_pci.c
6511 ===================================================================
6512 --- linux-2.4.35.4.orig/drivers/isdn/hisax/hfc_pci.c
6513 +++ linux-2.4.35.4/drivers/isdn/hisax/hfc_pci.c
6514 @@ -1,4 +1,4 @@
6515 -/* $Id: hfc_pci.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6516 +/* $Id: hfc_pci.c,v 1.48 2001/09/24 13:22:56 kai Exp $
6517 *
6518 * low level driver for CCD´s hfc-pci based cards
6519 *
6520 @@ -22,11 +22,12 @@
6521 #include "hfc_pci.h"
6522 #include "isdnl1.h"
6523 #include <linux/pci.h>
6524 +#include <linux/isdn_compat.h>
6525 #include <linux/interrupt.h>
6526
6527 extern const char *CardType[];
6528
6529 -static const char *hfcpci_revision = "$Revision: 1.1.4.1 $";
6530 +static const char *hfcpci_revision = "$Revision: 1.48 $";
6531
6532 /* table entry in the PCI devices list */
6533 typedef struct {
6534 @@ -76,8 +77,6 @@ release_io_hfcpci(struct IsdnCardState *
6535 {
6536 unsigned long flags;
6537
6538 - printk(KERN_INFO "HiSax: release hfcpci at %p\n",
6539 - cs->hw.hfcpci.pci_io);
6540 save_flags(flags);
6541 cli();
6542 cs->hw.hfcpci.int_m2 = 0; /* interrupt output off ! */
6543 @@ -88,11 +87,13 @@ release_io_hfcpci(struct IsdnCardState *
6544 set_current_state(TASK_UNINTERRUPTIBLE);
6545 schedule_timeout((30 * HZ) / 1000); /* Timeout 30ms */
6546 Write_hfc(cs, HFCPCI_CIRM, 0); /* Reset Off */
6547 +#if CONFIG_PCI
6548 pcibios_write_config_word(cs->hw.hfcpci.pci_bus, cs->hw.hfcpci.pci_device_fn, PCI_COMMAND, 0); /* disable memory mapped ports + busmaster */
6549 +#endif /* CONFIG_PCI */
6550 del_timer(&cs->hw.hfcpci.timer);
6551 kfree(cs->hw.hfcpci.share_start);
6552 cs->hw.hfcpci.share_start = NULL;
6553 - iounmap((void *)cs->hw.hfcpci.pci_io);
6554 + vfree(cs->hw.hfcpci.pci_io);
6555 }
6556
6557 /********************************************************************************/
6558 @@ -687,10 +688,6 @@ hfcpci_fill_fifo(struct BCState *bcs)
6559 debugl1(cs, "hfcpci_fill_fifo_trans %d frame length %d discarded",
6560 bcs->channel, bcs->tx_skb->len);
6561
6562 - if (bcs->st->lli.l1writewakeup &&
6563 - (PACKET_NOACK != bcs->tx_skb->pkt_type))
6564 - bcs->st->lli.l1writewakeup(bcs->st, bcs->tx_skb->len);
6565 -
6566 dev_kfree_skb_any(bcs->tx_skb);
6567 cli();
6568 bcs->tx_skb = skb_dequeue(&bcs->squeue); /* fetch next data */
6569 @@ -1146,6 +1143,20 @@ hfcpci_interrupt(int intno, void *dev_id
6570 static void
6571 hfcpci_dbusy_timer(struct IsdnCardState *cs)
6572 {
6573 +#if 0
6574 + struct PStack *stptr;
6575 + if (test_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) {
6576 + if (cs->debug)
6577 + debugl1(cs, "D-Channel Busy");
6578 + test_and_set_bit(FLG_L1_DBUSY, &cs->HW_Flags);
6579 + stptr = cs->stlist;
6580 +
6581 + while (stptr != NULL) {
6582 + stptr->l1.l1l2(stptr, PH_PAUSE | INDICATION, NULL);
6583 + stptr = stptr->next;
6584 + }
6585 + }
6586 +#endif
6587 }
6588
6589 /*************************************/
6590 @@ -1550,6 +1561,17 @@ hfcpci_bh(struct IsdnCardState *cs)
6591 */
6592 if (!cs)
6593 return;
6594 +#if 0
6595 + if (test_and_clear_bit(D_CLEARBUSY, &cs->event)) {
6596 + if (cs->debug)
6597 + debugl1(cs, "D-Channel Busy cleared");
6598 + stptr = cs->stlist;
6599 + while (stptr != NULL) {
6600 + stptr->l1.l1l2(stptr, PH_PAUSE | CONFIRM, NULL);
6601 + stptr = stptr->next;
6602 + }
6603 + }
6604 +#endif
6605 if (test_and_clear_bit(D_L1STATECHANGE, &cs->event)) {
6606 if (!cs->hw.hfcpci.nt_mode)
6607 switch (cs->dc.hfcpci.ph_state) {
6608 @@ -1712,7 +1734,7 @@ setup_hfcpci(struct IsdnCard *card)
6609 if (pci_enable_device(tmp_hfcpci))
6610 continue;
6611 pci_set_master(tmp_hfcpci);
6612 - if ((card->para[0]) && (card->para[0] != (tmp_hfcpci->resource[ 0].start & PCI_BASE_ADDRESS_IO_MASK)))
6613 + if ((card->para[0]) && (card->para[0] != (get_pcibase(tmp_hfcpci, 0) & PCI_BASE_ADDRESS_IO_MASK)))
6614 continue;
6615 else
6616 break;
6617 @@ -1729,7 +1751,7 @@ setup_hfcpci(struct IsdnCard *card)
6618 printk(KERN_WARNING "HFC-PCI: No IRQ for PCI card found\n");
6619 return (0);
6620 }
6621 - cs->hw.hfcpci.pci_io = (char *) dev_hfcpci->resource[ 1].start;
6622 + cs->hw.hfcpci.pci_io = (char *) get_pcibase(dev_hfcpci, 1);
6623 printk(KERN_INFO "HiSax: HFC-PCI card manufacturer: %s card name: %s\n", id_list[i].vendor_name, id_list[i].card_name);
6624 } else {
6625 printk(KERN_WARNING "HFC-PCI: No PCI card found\n");
6626 @@ -1746,7 +1768,7 @@ setup_hfcpci(struct IsdnCard *card)
6627 printk(KERN_WARNING "HFC-PCI: Error allocating memory for FIFO!\n");
6628 return 0;
6629 }
6630 - cs->hw.hfcpci.fifos = (void *)
6631 + (ulong) cs->hw.hfcpci.fifos =
6632 (((ulong) cs->hw.hfcpci.share_start) & ~0x7FFF) + 0x8000;
6633 pcibios_write_config_dword(cs->hw.hfcpci.pci_bus,
6634 cs->hw.hfcpci.pci_device_fn, 0x80,
6635 Index: linux-2.4.35.4/drivers/isdn/hisax/hfc_pci.h
6636 ===================================================================
6637 --- linux-2.4.35.4.orig/drivers/isdn/hisax/hfc_pci.h
6638 +++ linux-2.4.35.4/drivers/isdn/hisax/hfc_pci.h
6639 @@ -1,4 +1,4 @@
6640 -/* $Id: hfc_pci.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6641 +/* $Id: hfc_pci.h,v 1.10 2001/09/24 13:22:56 kai Exp $
6642 *
6643 * specific defines for CCD's HFC 2BDS0 PCI chips
6644 *
6645 Index: linux-2.4.35.4/drivers/isdn/hisax/hfc_sx.c
6646 ===================================================================
6647 --- linux-2.4.35.4.orig/drivers/isdn/hisax/hfc_sx.c
6648 +++ linux-2.4.35.4/drivers/isdn/hisax/hfc_sx.c
6649 @@ -1,4 +1,4 @@
6650 -/* $Id: hfc_sx.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6651 +/* $Id: hfc_sx.c,v 1.12 2001/09/24 13:22:56 kai Exp $
6652 *
6653 * level driver for CCD´s hfc-s+/sp based cards
6654 *
6655 @@ -17,11 +17,10 @@
6656 #include "hfc_sx.h"
6657 #include "isdnl1.h"
6658 #include <linux/interrupt.h>
6659 -#include <linux/isapnp.h>
6660
6661 extern const char *CardType[];
6662
6663 -static const char *hfcsx_revision = "$Revision: 1.1.4.1 $";
6664 +static const char *hfcsx_revision = "$Revision: 1.12 $";
6665
6666 /***************************************/
6667 /* IRQ-table for CCDs demo board */
6668 @@ -940,6 +939,20 @@ hfcsx_interrupt(int intno, void *dev_id,
6669 static void
6670 hfcsx_dbusy_timer(struct IsdnCardState *cs)
6671 {
6672 +#if 0
6673 + struct PStack *stptr;
6674 + if (test_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) {
6675 + if (cs->debug)
6676 + debugl1(cs, "D-Channel Busy");
6677 + test_and_set_bit(FLG_L1_DBUSY, &cs->HW_Flags);
6678 + stptr = cs->stlist;
6679 +
6680 + while (stptr != NULL) {
6681 + stptr->l1.l1l2(stptr, PH_PAUSE | INDICATION, NULL);
6682 + stptr = stptr->next;
6683 + }
6684 + }
6685 +#endif
6686 }
6687
6688 /*************************************/
6689 @@ -1333,6 +1346,17 @@ hfcsx_bh(struct IsdnCardState *cs)
6690 */
6691 if (!cs)
6692 return;
6693 +#if 0
6694 + if (test_and_clear_bit(D_CLEARBUSY, &cs->event)) {
6695 + if (cs->debug)
6696 + debugl1(cs, "D-Channel Busy cleared");
6697 + stptr = cs->stlist;
6698 + while (stptr != NULL) {
6699 + stptr->l1.l1l2(stptr, PH_PAUSE | CONFIRM, NULL);
6700 + stptr = stptr->next;
6701 + }
6702 + }
6703 +#endif
6704 if (test_and_clear_bit(D_L1STATECHANGE, &cs->event)) {
6705 if (!cs->hw.hfcsx.nt_mode)
6706 switch (cs->dc.hfcsx.ph_state) {
6707 @@ -1461,17 +1485,7 @@ hfcsx_card_msg(struct IsdnCardState *cs,
6708 return (0);
6709 }
6710
6711 -#ifdef __ISAPNP__
6712 -static struct isapnp_device_id hfc_ids[] __initdata = {
6713 - { ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2620),
6714 - ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2620),
6715 - (unsigned long) "Teles 16.3c2" },
6716 - { 0, }
6717 -};
6718
6719 -static struct isapnp_device_id *hdev = &hfc_ids[0];
6720 -static struct pci_bus *pnp_c __devinitdata = NULL;
6721 -#endif
6722
6723 int __devinit
6724 setup_hfcsx(struct IsdnCard *card)
6725 @@ -1482,45 +1496,6 @@ setup_hfcsx(struct IsdnCard *card)
6726
6727 strcpy(tmp, hfcsx_revision);
6728 printk(KERN_INFO "HiSax: HFC-SX driver Rev. %s\n", HiSax_getrev(tmp));
6729 -#ifdef __ISAPNP__
6730 - if (!card->para[1] && isapnp_present()) {
6731 - struct pci_bus *pb;
6732 - struct pci_dev *pd;
6733 -
6734 - while(hdev->card_vendor) {
6735 - if ((pb = isapnp_find_card(hdev->card_vendor,
6736 - hdev->card_device, pnp_c))) {
6737 - pnp_c = pb;
6738 - pd = NULL;
6739 - if ((pd = isapnp_find_dev(pnp_c,
6740 - hdev->vendor, hdev->function, pd))) {
6741 - printk(KERN_INFO "HiSax: %s detected\n",
6742 - (char *)hdev->driver_data);
6743 - pd->prepare(pd);
6744 - pd->deactivate(pd);
6745 - pd->activate(pd);
6746 - card->para[1] = pd->resource[0].start;
6747 - card->para[0] = pd->irq_resource[0].start;
6748 - if (!card->para[0] || !card->para[1]) {
6749 - printk(KERN_ERR "HFC PnP:some resources are missing %ld/%lx\n",
6750 - card->para[0], card->para[1]);
6751 - pd->deactivate(pd);
6752 - return(0);
6753 - }
6754 - break;
6755 - } else {
6756 - printk(KERN_ERR "HFC PnP: PnP error card found, no device\n");
6757 - }
6758 - }
6759 - hdev++;
6760 - pnp_c=NULL;
6761 - }
6762 - if (!hdev->card_vendor) {
6763 - printk(KERN_INFO "HFC PnP: no ISAPnP card found\n");
6764 - return(0);
6765 - }
6766 - }
6767 -#endif
6768 cs->hw.hfcsx.base = card->para[1] & 0xfffe;
6769 cs->irq = card->para[0];
6770 cs->hw.hfcsx.int_s1 = 0;
6771 @@ -1603,3 +1578,7 @@ setup_hfcsx(struct IsdnCard *card)
6772 cs->auxcmd = &hfcsx_auxcmd;
6773 return (1);
6774 }
6775 +
6776 +
6777 +
6778 +
6779 Index: linux-2.4.35.4/drivers/isdn/hisax/hfc_sx.h
6780 ===================================================================
6781 --- linux-2.4.35.4.orig/drivers/isdn/hisax/hfc_sx.h
6782 +++ linux-2.4.35.4/drivers/isdn/hisax/hfc_sx.h
6783 @@ -1,4 +1,4 @@
6784 -/* $Id: hfc_sx.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6785 +/* $Id$
6786 *
6787 * specific defines for CCD's HFC 2BDS0 S+,SP chips
6788 *
6789 Index: linux-2.4.35.4/drivers/isdn/hisax/hfc_usb.c
6790 ===================================================================
6791 --- /dev/null
6792 +++ linux-2.4.35.4/drivers/isdn/hisax/hfc_usb.c
6793 @@ -0,0 +1,1189 @@
6794 +/* $Id: hfc_usb.c,v 2.3 2001/07/06 21:30:11 werner Exp $
6795 + *
6796 + *
6797 + *
6798 + * Author (C) 2001 Werner Cornelius (werner@isdn-development.de)
6799 + * modular driver for Colognechip HFC-USB chip
6800 + * as plugin for HiSax isdn driver
6801 + * type approval valid for HFC-S USB based TAs
6802 + *
6803 + * Copyright 2001 by Werner Cornelius (werner@isdn-development.de)
6804 + *
6805 + * This program is free software; you can redistribute it and/or modify
6806 + * it under the terms of the GNU General Public License as published by
6807 + * the Free Software Foundation; either version 2, or (at your option)
6808 + * any later version.
6809 + *
6810 + * This program is distributed in the hope that it will be useful,
6811 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
6812 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6813 + * GNU General Public License for more details.
6814 + *
6815 + * You should have received a copy of the GNU General Public License
6816 + * along with this program; if not, write to the Free Software
6817 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
6818 + *
6819 + */
6820 +
6821 +#include <linux/types.h>
6822 +#include <linux/stddef.h>
6823 +#include <linux/timer.h>
6824 +#include <linux/config.h>
6825 +#include <linux/isdn_compat.h>
6826 +#include <linux/init.h>
6827 +#include "hisax.h"
6828 +#include <linux/module.h>
6829 +#include <linux/kernel_stat.h>
6830 +#include <linux/tqueue.h>
6831 +#include <linux/usb.h>
6832 +#include <linux/kernel.h>
6833 +#include <linux/smp_lock.h>
6834 +#include <linux/sched.h>
6835 +#include "hisax_loadable.h"
6836 +
6837 +#define INCLUDE_INLINE_FUNCS
6838 +
6839 +/***********/
6840 +/* defines */
6841 +/***********/
6842 +#define HFC_CTRL_TIMEOUT 5 /* 5ms timeout writing/reading regs */
6843 +#define HFC_TIMER_T3 7000 /* timeout for l1 activation timer */
6844 +
6845 +#define HFCUSB_L1_STATECHANGE 0 /* L1 state changed */
6846 +#define HFCUSB_L1_DRX 1 /* D-frame received */
6847 +#define HFCUSB_L1_ERX 2 /* E-frame received */
6848 +#define HFCUSB_L1_DTX 4 /* D-frames completed */
6849 +
6850 +#define MAX_BCH_SIZE 2048 /* allowed B-channel packet size */
6851 +
6852 +#define HFCUSB_RX_THRESHOLD 64 /* threshold for fifo report bit rx */
6853 +#define HFCUSB_TX_THRESHOLD 64 /* threshold for fifo report bit tx */
6854 +
6855 +#define HFCUSB_CHIP_ID 0x16 /* Chip ID register index */
6856 +#define HFCUSB_CIRM 0x00 /* cirm register index */
6857 +#define HFCUSB_USB_SIZE 0x07 /* int length register */
6858 +#define HFCUSB_USB_SIZE_I 0x06 /* iso length register */
6859 +#define HFCUSB_F_CROSS 0x0b /* bit order register */
6860 +#define HFCUSB_CLKDEL 0x37 /* bit delay register */
6861 +#define HFCUSB_CON_HDLC 0xfa /* channel connect register */
6862 +#define HFCUSB_HDLC_PAR 0xfb
6863 +#define HFCUSB_SCTRL 0x31 /* S-bus control register (tx) */
6864 +#define HFCUSB_SCTRL_E 0x32 /* same for E and special funcs */
6865 +#define HFCUSB_SCTRL_R 0x33 /* S-bus control register (rx) */
6866 +#define HFCUSB_F_THRES 0x0c /* threshold register */
6867 +#define HFCUSB_FIFO 0x0f /* fifo select register */
6868 +#define HFCUSB_F_USAGE 0x1a /* fifo usage register */
6869 +#define HFCUSB_MST_MODE0 0x14
6870 +#define HFCUSB_MST_MODE1 0x15
6871 +#define HFCUSB_P_DATA 0x1f
6872 +#define HFCUSB_INC_RES_F 0x0e
6873 +#define HFCUSB_STATES 0x30
6874 +
6875 +#define HFCUSB_CHIPID 0x40 /* ID value of HFC-USB */
6876 +
6877 +/******************/
6878 +/* fifo registers */
6879 +/******************/
6880 +#define HFCUSB_NUM_FIFOS 8 /* maximum number of fifos */
6881 +#define HFCUSB_B1_TX 0 /* index for B1 transmit bulk/int */
6882 +#define HFCUSB_B1_RX 1 /* index for B1 receive bulk/int */
6883 +#define HFCUSB_B2_TX 2
6884 +#define HFCUSB_B2_RX 3
6885 +#define HFCUSB_D_TX 4
6886 +#define HFCUSB_D_RX 5
6887 +#define HFCUSB_PCM_TX 6
6888 +#define HFCUSB_PCM_RX 7
6889 +
6890 +/************/
6891 +/* LED mask */
6892 +/************/
6893 +#define LED_DRIVER 0x1
6894 +#define LED_L1 0x2
6895 +#define LED_BCH 0x4
6896 +
6897 +/**********/
6898 +/* macros */
6899 +/**********/
6900 +#define Write_hfc(a,b,c) usb_control_msg((a)->dev,(a)->ctrl_out_pipe,0,0x40,(c),(b),0,0,HFC_CTRL_TIMEOUT)
6901 +#define Read_hfc(a,b,c) usb_control_msg((a)->dev,(a)->ctrl_in_pipe,1,0xC0,0,(b),(c),1,HFC_CTRL_TIMEOUT)
6902 +
6903 +#ifdef COMPAT_HAS_USB_IDTAB
6904 +/****************************************/
6905 +/* data defining the devices to be used */
6906 +/****************************************/
6907 +static __devinitdata const struct usb_device_id hfc_usb_idtab[3] = {
6908 + {USB_DEVICE(0x959, 0x2bd0)}, /* Colognechip ROM */
6909 + {USB_DEVICE(0x7b0, 0x0006)}, /* USB TA 128 */
6910 + {} /* end with an all-zeroes entry */
6911 +};
6912 +#endif
6913 +
6914 +/*************************************************/
6915 +/* entry and size of output/input control buffer */
6916 +/*************************************************/
6917 +#define HFC_CTRL_BUFSIZE 32
6918 +typedef struct {
6919 + __u8 hfc_reg; /* register number */
6920 + __u8 reg_val; /* value to be written (or read) */
6921 +} ctrl_buft;
6922 +
6923 +/***************************************************************/
6924 +/* structure defining input+output fifos (interrupt/bulk mode) */
6925 +/***************************************************************/
6926 +struct hfcusb_data; /* forward definition */
6927 +typedef struct {
6928 + int fifonum; /* fifo index attached to this structure */
6929 + __u8 fifo_mask; /* mask for this fifo */
6930 + int active; /* fifo is currently active */
6931 + struct hfcusb_data *hfc; /* pointer to main structure */
6932 + int pipe; /* address of endpoint */
6933 + __u8 usb_maxlen; /* maximum length for usb transfer */
6934 + int max_size; /* maximum size of receive/send packet */
6935 + int transmode; /* transparent mode selected */
6936 + int framenum; /* number of frame when last tx completed */
6937 + int rx_offset; /* offset inside rx buffer */
6938 + int next_complete; /* complete marker */
6939 + __u8 *act_ptr; /* pointer to next data */
6940 + __u8 intervall; /* interrupt interval */
6941 + struct sk_buff *buff; /* actual used buffer */
6942 + urb_t urb; /* transfer structure for usb routines */
6943 + __u8 buffer[128]; /* buffer incoming/outgoing data */
6944 +} usb_fifo;
6945 +
6946 +/*********************************************/
6947 +/* structure holding all data for one device */
6948 +/*********************************************/
6949 +typedef struct hfcusb_data {
6950 + struct hisax_drvreg regd; /* register data and callbacks */
6951 + struct usb_device *dev; /* our device */
6952 + int if_used; /* used interface number */
6953 + int alt_used; /* used alternate config */
6954 + int ctrl_paksize; /* control pipe packet size */
6955 + int ctrl_in_pipe, ctrl_out_pipe; /* handles for control pipe */
6956 +
6957 + /* control pipe background handling */
6958 + ctrl_buft ctrl_buff[HFC_CTRL_BUFSIZE]; /* buffer holding queued data */
6959 + volatile int ctrl_in_idx, ctrl_out_idx, ctrl_cnt; /* input/output pointer + count */
6960 + urb_t ctrl_urb; /* transfer structure for control channel */
6961 + devrequest ctrl_write; /* buffer for control write request */
6962 + devrequest ctrl_read; /* same for read request */
6963 +
6964 + volatile __u8 dfifo_fill; /* value read from tx d-fifo */
6965 + volatile __u8 active_fifos; /* fifos currently active as bit mask */
6966 + volatile __u8 threshold_mask; /* threshold actually reported */
6967 + volatile __u8 service_request; /* fifo needs service from task */
6968 + volatile __u8 ctrl_fifo; /* last selected fifo */
6969 + volatile __u8 bch_enables; /* or mask for sctrl_r and sctrl register values */
6970 + volatile __u8 led_req; /* request status of adapters leds */
6971 + volatile __u8 led_act; /* active status of adapters leds */
6972 + usb_fifo fifos[HFCUSB_NUM_FIFOS]; /* structure holding all fifo data */
6973 +
6974 + /* layer 1 activation/deactivation handling */
6975 + volatile __u8 l1_state; /* actual l1 state */
6976 + volatile ulong l1_event; /* event mask */
6977 + struct tq_struct l1_tq; /* l1 bh structure */
6978 + struct timer_list t3_timer; /* timer for activation/deactivation */
6979 + struct timer_list t4_timer; /* timer for activation/deactivation */
6980 +} hfcusb_data;
6981 +
6982 +#if 0
6983 +static void
6984 +usb_dump_urb(purb_t purb)
6985 +{
6986 + printk("urb :%p\n", purb);
6987 + printk("next :%p\n", purb->next);
6988 + printk("dev :%p\n", purb->dev);
6989 + printk("pipe :%08X\n", purb->pipe);
6990 + printk("status :%d\n", purb->status);
6991 + printk("transfer_flags :%08X\n", purb->transfer_flags);
6992 + printk("transfer_buffer :%p\n", purb->transfer_buffer);
6993 + printk("transfer_buffer_length:%d\n",
6994 + purb->transfer_buffer_length);
6995 + printk("actual_length :%d\n", purb->actual_length);
6996 + printk("setup_packet :%p\n", purb->setup_packet);
6997 + printk("start_frame :%d\n", purb->start_frame);
6998 + printk("number_of_packets :%d\n", purb->number_of_packets);
6999 + printk("interval :%d\n", purb->interval);
7000 + printk("error_count :%d\n", purb->error_count);
7001 + printk("context :%p\n", purb->context);
7002 + printk("complete :%p\n", purb->complete);
7003 +}
7004 +#endif
7005 +
7006 +/*************************************************************************/
7007 +/* bottom half handler for L1 activation/deactiavtaion + D-chan + E-chan */
7008 +/*************************************************************************/
7009 +static void
7010 +usb_l1d_bh(hfcusb_data * hfc)
7011 +{
7012 +
7013 + while (hfc->l1_event) {
7014 + if (test_and_clear_bit
7015 + (HFCUSB_L1_STATECHANGE, &hfc->l1_event)) {
7016 + if (hfc->l1_state == 7)
7017 + hfc->led_req |= LED_L1;
7018 + else
7019 + hfc->led_req &= ~LED_L1;
7020 + if ((hfc->l1_state == 7) ||
7021 + (hfc->l1_state == 3))
7022 + hfc->regd.dch_l1l2(hfc->regd.arg_hisax,
7023 + (hfc->l1_state ==
7024 + 7) ? (PH_ACTIVATE |
7025 + INDICATION)
7026 + : (PH_DEACTIVATE | INDICATION),
7027 + NULL);
7028 + }
7029 + if (test_and_clear_bit(HFCUSB_L1_DRX, &hfc->l1_event)) {
7030 + hfc->regd.dch_l1l2(hfc->regd.arg_hisax,
7031 + PH_DATA | INDICATION,
7032 + (void *) 0);
7033 + }
7034 + if (test_and_clear_bit(HFCUSB_L1_ERX, &hfc->l1_event)) {
7035 + hfc->regd.dch_l1l2(hfc->regd.arg_hisax,
7036 + PH_DATA | INDICATION,
7037 + (void *) 1);
7038 + }
7039 + if (test_and_clear_bit(HFCUSB_L1_DTX, &hfc->l1_event)) {
7040 + hfc->regd.dch_l1l2(hfc->regd.arg_hisax,
7041 + PH_DATA | CONFIRM, NULL);
7042 + }
7043 + } /* while */
7044 +} /* usb_l1d_bh */
7045 +
7046 +/******************************************************/
7047 +/* start next background transfer for control channel */
7048 +/******************************************************/
7049 +static void
7050 +ctrl_start_transfer(hfcusb_data * hfc)
7051 +{
7052 +
7053 + if (hfc->ctrl_cnt) {
7054 + switch (hfc->ctrl_buff[hfc->ctrl_out_idx].hfc_reg) {
7055 + case HFCUSB_F_USAGE:
7056 + hfc->ctrl_urb.pipe = hfc->ctrl_in_pipe;
7057 + hfc->ctrl_urb.setup_packet =
7058 + (u_char *) & hfc->ctrl_read;
7059 + hfc->ctrl_urb.transfer_buffer_length = 1;
7060 + hfc->ctrl_read.index =
7061 + hfc->ctrl_buff[hfc->ctrl_out_idx].
7062 + hfc_reg;
7063 + hfc->ctrl_urb.transfer_buffer =
7064 + (char *) &hfc->dfifo_fill;
7065 + break;
7066 +
7067 + default: /* write register */
7068 + hfc->ctrl_urb.pipe = hfc->ctrl_out_pipe;
7069 + hfc->ctrl_urb.setup_packet =
7070 + (u_char *) & hfc->ctrl_write;
7071 + hfc->ctrl_urb.transfer_buffer = NULL;
7072 + hfc->ctrl_urb.transfer_buffer_length = 0;
7073 + hfc->ctrl_write.index =
7074 + hfc->ctrl_buff[hfc->ctrl_out_idx].
7075 + hfc_reg;
7076 + hfc->ctrl_write.value =
7077 + hfc->ctrl_buff[hfc->ctrl_out_idx].
7078 + reg_val;
7079 + break;
7080 + }
7081 + usb_submit_urb(&hfc->ctrl_urb); /* start transfer */
7082 + }
7083 +} /* ctrl_start_transfer */
7084 +
7085 +/************************************/
7086 +/* queue a control transfer request */
7087 +/* return 0 on success. */
7088 +/************************************/
7089 +static int
7090 +queue_control_request(hfcusb_data * hfc, __u8 reg, __u8 val)
7091 +{
7092 + ctrl_buft *buf;
7093 +
7094 + if (hfc->ctrl_cnt >= HFC_CTRL_BUFSIZE)
7095 + return (1); /* no space left */
7096 + buf = hfc->ctrl_buff + hfc->ctrl_in_idx; /* pointer to new index */
7097 + buf->hfc_reg = reg;
7098 + buf->reg_val = val;
7099 + if (++hfc->ctrl_in_idx >= HFC_CTRL_BUFSIZE)
7100 + hfc->ctrl_in_idx = 0; /* pointer wrap */
7101 + if (++hfc->ctrl_cnt == 1)
7102 + ctrl_start_transfer(hfc);
7103 + return (0);
7104 +} /* queue_control_request */
7105 +
7106 +/**************************************/
7107 +/* called when timer t3 or t4 expires */
7108 +/**************************************/
7109 +static void
7110 +l1_timer_expire(hfcusb_data * hfc)
7111 +{
7112 + if (timer_pending(&hfc->t4_timer))
7113 + del_timer(&hfc->t4_timer);
7114 + queue_control_request(hfc, HFCUSB_STATES, 0x40);
7115 + test_and_set_bit(HFCUSB_L1_STATECHANGE,
7116 + &hfc->l1_event);
7117 + queue_task(&hfc->l1_tq, &tq_immediate);
7118 + mark_bh(IMMEDIATE_BH);
7119 +} /* l1_timer_expire */
7120 +
7121 +/**************************************************/
7122 +/* (re)fills a tx-fifo urb. Queuing is done later */
7123 +/**************************************************/
7124 +static void
7125 +fill_tx_urb(usb_fifo * fifo)
7126 +{
7127 + struct sk_buff *skb;
7128 + long flags;
7129 + int i, ii = 0;
7130 +
7131 + fifo->urb.dev = fifo->hfc->dev;
7132 + if ((fifo->buff)
7133 + && (fifo->urb.transfer_buffer_length < fifo->usb_maxlen)) {
7134 + switch (fifo->fifonum) {
7135 + case HFCUSB_B1_TX:
7136 + case HFCUSB_B2_TX:
7137 + skb = fifo->buff;
7138 + fifo->buff = NULL;
7139 + fifo->hfc->regd.bch_l1l2(fifo->hfc->regd.
7140 + arg_hisax,
7141 + (fifo->fifonum ==
7142 + HFCUSB_B1_TX) ? 0
7143 + : 1,
7144 + (PH_DATA |
7145 + CONFIRM),
7146 + (void *) skb);
7147 + fifo->hfc->service_request |=
7148 + fifo->fifo_mask;
7149 + return;
7150 + case HFCUSB_D_TX:
7151 + dev_kfree_skb_any(fifo->buff);
7152 + fifo->buff = NULL;
7153 + save_flags(flags);
7154 + cli();
7155 + fifo->hfc->dfifo_fill = 0xff; /* currently invalid data */
7156 + queue_control_request(fifo->hfc,
7157 + HFCUSB_FIFO,
7158 + HFCUSB_D_TX);
7159 + queue_control_request(fifo->hfc,
7160 + HFCUSB_F_USAGE, 0);
7161 + restore_flags(flags);
7162 + return;
7163 + default:
7164 + return; /* error, invalid fifo */
7165 + }
7166 + }
7167 +
7168 + /* check if new buffer needed */
7169 + if (!fifo->buff) {
7170 + switch (fifo->fifonum) {
7171 + case HFCUSB_B1_TX:
7172 + if (fifo->hfc->regd.bsk[0])
7173 + fifo->buff = *fifo->hfc->regd.bsk[0]; /* B1-channel tx buffer */
7174 + break;
7175 + case HFCUSB_B2_TX:
7176 + if (fifo->hfc->regd.bsk[1])
7177 + fifo->buff = *fifo->hfc->regd.bsk[1]; /* B2-channel tx buffer */
7178 + break;
7179 + case HFCUSB_D_TX:
7180 + if (fifo->hfc->regd.dsq)
7181 + fifo->buff = skb_dequeue(fifo->hfc->regd.dsq); /* D-channel tx queue */
7182 + break;
7183 + default:
7184 + return; /* error, invalid fifo */
7185 + }
7186 + if (!fifo->buff) {
7187 + fifo->active = 0; /* we are inactive now */
7188 + fifo->hfc->active_fifos &= ~fifo->fifo_mask;
7189 + if (fifo->fifonum == HFCUSB_D_TX) {
7190 + test_and_set_bit(HFCUSB_L1_DTX,
7191 + &fifo->hfc->l1_event);
7192 + queue_task(&fifo->hfc->l1_tq,
7193 + &tq_immediate);
7194 + mark_bh(IMMEDIATE_BH);
7195 + }
7196 + return;
7197 + }
7198 + fifo->act_ptr = fifo->buff->data; /* start of data */
7199 + fifo->active = 1;
7200 + ii = 1;
7201 + fifo->hfc->active_fifos |= fifo->fifo_mask;
7202 + fifo->hfc->service_request &= ~fifo->fifo_mask;
7203 + }
7204 + /* fillup the send buffer */
7205 + i = fifo->buff->len - (fifo->act_ptr - fifo->buff->data); /* remaining length */
7206 + fifo->buffer[0] = !fifo->transmode; /* not eof */
7207 + if (i > (fifo->usb_maxlen - ii)) {
7208 + i = fifo->usb_maxlen - ii;
7209 + }
7210 + if (i)
7211 + memcpy(fifo->buffer + ii, fifo->act_ptr, i);
7212 + fifo->urb.transfer_buffer_length = i + ii;
7213 + fifo->rx_offset = ii;
7214 +} /* fill_tx_urb */
7215 +
7216 +/************************************************/
7217 +/* transmit completion routine for all tx fifos */
7218 +/************************************************/
7219 +static void
7220 +tx_complete(purb_t urb)
7221 +{
7222 + usb_fifo *fifo = (usb_fifo *) urb->context; /* pointer to our fifo */
7223 +
7224 + fifo->hfc->service_request &= ~fifo->fifo_mask; /* no further handling */
7225 + fifo->framenum = usb_get_current_frame_number(fifo->hfc->dev);
7226 +
7227 + /* check for deactivation or error */
7228 + if ((!fifo->active) || (urb->status)) {
7229 + fifo->hfc->active_fifos &= ~fifo->fifo_mask; /* we are inactive */
7230 + fifo->active = 0;
7231 + if ((fifo->buff) && (fifo->fifonum == HFCUSB_D_TX)) {
7232 + dev_kfree_skb_any(fifo->buff);
7233 + }
7234 + fifo->buff = NULL;
7235 + return;
7236 + }
7237 + fifo->act_ptr += (urb->transfer_buffer_length - fifo->rx_offset); /* adjust pointer */
7238 + fill_tx_urb(fifo); /* refill the urb */
7239 + fifo->hfc->threshold_mask |= fifo->fifo_mask; /* assume threshold reached */
7240 + if (fifo->buff)
7241 + fifo->hfc->service_request |= fifo->fifo_mask; /* need to restart */
7242 +} /* tx_complete */
7243 +
7244 +/***********************************************/
7245 +/* receive completion routine for all rx fifos */
7246 +/***********************************************/
7247 +static void
7248 +rx_complete(purb_t urb)
7249 +{
7250 + usb_fifo *fifo = (usb_fifo *) urb->context; /* pointer to our fifo */
7251 + hfcusb_data *hfc = fifo->hfc;
7252 + usb_fifo *txfifo;
7253 + __u8 last_state;
7254 + int i, ii, currcnt, hdlci;
7255 + struct sk_buff *skb;
7256 +
7257 + urb->dev = hfc->dev; /* security init */
7258 + if ((!fifo->active) || (urb->status)) {
7259 + hfc->service_request &= ~fifo->fifo_mask; /* no further handling */
7260 + hfc->active_fifos &= ~fifo->fifo_mask; /* we are inactive */
7261 + fifo->urb.interval = 0; /* cancel automatic rescheduling */
7262 + if (fifo->buff) {
7263 + dev_kfree_skb_any(fifo->buff);
7264 + fifo->buff = NULL;
7265 + }
7266 + return;
7267 + }
7268 +
7269 + /* first check for any status changes */
7270 + if ((urb->actual_length < fifo->rx_offset)
7271 + || (urb->actual_length > fifo->usb_maxlen))
7272 + return; /* error condition */
7273 +
7274 + if (fifo->rx_offset) {
7275 + hfc->threshold_mask = fifo->buffer[1]; /* update threshold status */
7276 + fifo->next_complete = fifo->buffer[0] & 1;
7277 + if ((fifo->fifonum == HFCUSB_D_RX) &&
7278 + (hfc->led_req != hfc->led_act))
7279 + queue_control_request(hfc, HFCUSB_P_DATA, hfc->led_req);
7280 +
7281 + /* check if rescheduling needed */
7282 + if ((i =
7283 + hfc->service_request & hfc->active_fifos & ~hfc->
7284 + threshold_mask)) {
7285 + currcnt =
7286 + usb_get_current_frame_number(hfc->dev);
7287 + txfifo = hfc->fifos + HFCUSB_B1_TX;
7288 + ii = 3;
7289 + while (ii--) {
7290 + if ((i & txfifo->fifo_mask)
7291 + && (currcnt != txfifo->framenum)) {
7292 + hfc->service_request &=
7293 + ~txfifo->fifo_mask;
7294 + if (!txfifo->buff)
7295 + fill_tx_urb(txfifo);
7296 + if (txfifo->buff)
7297 + usb_submit_urb(&txfifo->
7298 + urb);
7299 + }
7300 + txfifo += 2;
7301 + }
7302 + }
7303 +
7304 + /* handle l1 events */
7305 + if ((fifo->buffer[0] >> 4) != hfc->l1_state) {
7306 + last_state = hfc->l1_state;
7307 + hfc->l1_state = fifo->buffer[0] >> 4; /* update status */
7308 + if (timer_pending(&hfc->t4_timer))
7309 + del_timer(&hfc->t4_timer);
7310 + if (((hfc->l1_state == 3) &&
7311 + ((last_state == 7) ||
7312 + (last_state == 8))) ||
7313 + ((timer_pending(&hfc->t3_timer) &&
7314 + (hfc->l1_state == 8)))) {
7315 + hfc->t4_timer.expires = jiffies + 2;
7316 + add_timer(&hfc->t4_timer);
7317 + } else {
7318 + if (timer_pending(&hfc->t3_timer)
7319 + && (hfc->l1_state == 7))
7320 + del_timer(&hfc->t3_timer); /* no longer needed */
7321 + test_and_set_bit(HFCUSB_L1_STATECHANGE,
7322 + &hfc->l1_event);
7323 + queue_task(&hfc->l1_tq, &tq_immediate);
7324 + mark_bh(IMMEDIATE_BH);
7325 + }
7326 + }
7327 + }
7328 +
7329 + /* check the length for data and move if present */
7330 + if (fifo->next_complete || (urb->actual_length > fifo->rx_offset)) {
7331 + i = fifo->buff->len + urb->actual_length - fifo->rx_offset; /* new total length */
7332 + hdlci = (fifo->transmode) ? 0 : 3;
7333 + if (i <= (fifo->max_size + hdlci)) {
7334 + memcpy(fifo->act_ptr,
7335 + fifo->buffer + fifo->rx_offset,
7336 + urb->actual_length - fifo->rx_offset);
7337 + fifo->act_ptr +=
7338 + (urb->actual_length - fifo->rx_offset);
7339 + fifo->buff->len +=
7340 + (urb->actual_length - fifo->rx_offset);
7341 + } else
7342 + fifo->buff->len = fifo->max_size + 4; /* mark frame as to long */
7343 + if (fifo->next_complete && (urb->actual_length < fifo->usb_maxlen)) {
7344 + /* the frame is complete */
7345 + fifo->next_complete = 0;
7346 + if (((!*(fifo->act_ptr - 1)) || fifo->transmode) &&
7347 + (fifo->buff->len >= (hdlci + 1))
7348 + && (fifo->buff->len <=
7349 + (fifo->max_size + hdlci)) &&
7350 + ((skb = dev_alloc_skb(fifo->max_size + hdlci)) != NULL)) {
7351 + fifo->buff->len -= hdlci; /* adjust size */
7352 + switch (fifo->fifonum) {
7353 + case HFCUSB_D_RX:
7354 + skb_queue_tail(hfc->regd.
7355 + drq,
7356 + fifo->buff);
7357 + test_and_set_bit
7358 + (HFCUSB_L1_DRX,
7359 + &hfc->l1_event);
7360 + queue_task(&hfc->l1_tq,
7361 + &tq_immediate);
7362 + mark_bh(IMMEDIATE_BH);
7363 + break;
7364 +
7365 + case HFCUSB_B1_RX:
7366 + if (hfc->regd.brq[0]) {
7367 + skb_queue_tail
7368 + (hfc->regd.
7369 + brq[0],
7370 + fifo->buff);
7371 + hfc->regd.
7372 + bch_l1l2(hfc->
7373 + regd.
7374 + arg_hisax,
7375 + 0,
7376 + PH_DATA
7377 + |
7378 + INDICATION,
7379 + (void *)
7380 + fifo->
7381 + buff);
7382 + } else
7383 + dev_kfree_skb_any
7384 + (fifo->buff);
7385 + break;
7386 +
7387 + case HFCUSB_B2_RX:
7388 + if (hfc->regd.brq[1]) {
7389 + skb_queue_tail
7390 + (hfc->regd.
7391 + brq[1],
7392 + fifo->buff);
7393 + hfc->regd.
7394 + bch_l1l2(hfc->
7395 + regd.
7396 + arg_hisax,
7397 + 1,
7398 + PH_DATA
7399 + |
7400 + INDICATION,
7401 + (void
7402 + *)
7403 + fifo->
7404 + buff);
7405 + } else
7406 + dev_kfree_skb_any
7407 + (fifo->buff);
7408 + break;
7409 +
7410 + case HFCUSB_PCM_RX:
7411 + skb_queue_tail(&hfc->regd.
7412 + erq,
7413 + fifo->buff);
7414 + test_and_set_bit
7415 + (HFCUSB_L1_ERX,
7416 + &hfc->l1_event);
7417 + queue_task(&hfc->l1_tq,
7418 + &tq_immediate);
7419 + mark_bh(IMMEDIATE_BH);
7420 + break;
7421 +
7422 + default:
7423 + dev_kfree_skb_any(fifo->
7424 + buff);
7425 + break;
7426 + }
7427 + fifo->buff = skb;
7428 + }
7429 + fifo->buff->len = 0; /* reset counter */
7430 + fifo->act_ptr = fifo->buff->data; /* and pointer */
7431 + }
7432 + }
7433 + fifo->rx_offset = (urb->actual_length < fifo->usb_maxlen) ? 2 : 0;
7434 +} /* rx_complete */
7435 +
7436 +/***************************************************/
7437 +/* start the interrupt transfer for the given fifo */
7438 +/***************************************************/
7439 +static void
7440 +start_rx_fifo(usb_fifo * fifo)
7441 +{
7442 + if (fifo->buff)
7443 + return; /* still active */
7444 + if (!
7445 + (fifo->buff =
7446 + dev_alloc_skb(fifo->max_size + (fifo->transmode ? 0 : 3))))
7447 + return;
7448 + fifo->act_ptr = fifo->buff->data;
7449 + FILL_INT_URB(&fifo->urb, fifo->hfc->dev, fifo->pipe, fifo->buffer,
7450 + fifo->usb_maxlen, rx_complete, fifo, fifo->intervall);
7451 + fifo->next_complete = 0;
7452 + fifo->rx_offset = 2;
7453 + fifo->active = 1; /* must be marked active */
7454 + fifo->hfc->active_fifos |= fifo->fifo_mask;
7455 + if (usb_submit_urb(&fifo->urb)) {
7456 + fifo->active = 0;
7457 + fifo->hfc->active_fifos &= ~fifo->fifo_mask;
7458 + dev_kfree_skb_any(fifo->buff);
7459 + fifo->buff = NULL;
7460 + }
7461 +} /* start_rx_fifo */
7462 +
7463 +/***************************************************************/
7464 +/* control completion routine handling background control cmds */
7465 +/***************************************************************/
7466 +static void
7467 +ctrl_complete(purb_t urb)
7468 +{
7469 + hfcusb_data *hfc = (hfcusb_data *) urb->context;
7470 +
7471 + urb->dev = hfc->dev;
7472 + if (hfc->ctrl_cnt) {
7473 + switch (hfc->ctrl_buff[hfc->ctrl_out_idx].hfc_reg) {
7474 + case HFCUSB_FIFO:
7475 + hfc->ctrl_fifo =
7476 + hfc->ctrl_buff[hfc->ctrl_out_idx].
7477 + reg_val;
7478 + break;
7479 + case HFCUSB_F_USAGE:
7480 + if (!hfc->dfifo_fill) {
7481 + fill_tx_urb(hfc->fifos +
7482 + HFCUSB_D_TX);
7483 + if (hfc->fifos[HFCUSB_D_TX].buff)
7484 + usb_submit_urb(&hfc->
7485 + fifos
7486 + [HFCUSB_D_TX].
7487 + urb);
7488 + } else {
7489 + queue_control_request(hfc,
7490 + HFCUSB_FIFO,
7491 + HFCUSB_D_TX);
7492 + queue_control_request(hfc,
7493 + HFCUSB_F_USAGE,
7494 + 0);
7495 + }
7496 + break;
7497 + case HFCUSB_SCTRL_R:
7498 + switch (hfc->ctrl_fifo) {
7499 + case HFCUSB_B1_RX:
7500 + if (hfc->bch_enables & 1)
7501 + start_rx_fifo(hfc->
7502 + fifos
7503 + +
7504 + HFCUSB_B1_RX);
7505 + break;
7506 + case HFCUSB_B2_RX:
7507 + if (hfc->bch_enables & 2)
7508 + start_rx_fifo(hfc->
7509 + fifos
7510 + +
7511 + HFCUSB_B2_RX);
7512 + break;
7513 + }
7514 + if (hfc->bch_enables & 3)
7515 + hfc->led_req |= LED_BCH;
7516 + else
7517 + hfc->led_req &= ~LED_BCH;
7518 + break;
7519 + case HFCUSB_P_DATA:
7520 + hfc->led_act =
7521 + hfc->ctrl_buff[hfc->ctrl_out_idx].
7522 + reg_val;
7523 + break;
7524 + }
7525 + hfc->ctrl_cnt--; /* decrement actual count */
7526 + if (++hfc->ctrl_out_idx >= HFC_CTRL_BUFSIZE)
7527 + hfc->ctrl_out_idx = 0; /* pointer wrap */
7528 + ctrl_start_transfer(hfc); /* start next transfer */
7529 + }
7530 +} /* ctrl_complete */
7531 +
7532 +/*****************************************/
7533 +/* Layer 1 + D channel access from HiSax */
7534 +/*****************************************/
7535 +static void
7536 +hfcusb_l1_access(void *drvarg, int pr, void *arg)
7537 +{
7538 + hfcusb_data *hfc = (hfcusb_data *) drvarg;
7539 +
7540 + switch (pr) {
7541 + case (PH_DATA | REQUEST):
7542 + case (PH_PULL | INDICATION):
7543 + skb_queue_tail(hfc->regd.dsq,
7544 + (struct sk_buff *) arg);
7545 + if (!hfc->fifos[HFCUSB_D_TX].active
7546 + && !hfc->dfifo_fill) {
7547 + fill_tx_urb(hfc->fifos + HFCUSB_D_TX);
7548 + hfc->active_fifos |=
7549 + hfc->fifos[HFCUSB_D_TX].fifo_mask;
7550 + usb_submit_urb(&hfc->fifos[HFCUSB_D_TX].
7551 + urb);
7552 + }
7553 + break;
7554 + case (PH_ACTIVATE | REQUEST):
7555 + switch (hfc->l1_state) {
7556 + case 6:
7557 + case 8:
7558 + hfc->regd.dch_l1l2(hfc->regd.arg_hisax,
7559 + (PH_DEACTIVATE |
7560 + INDICATION), NULL);
7561 +
7562 + break;
7563 + case 7:
7564 + hfc->regd.dch_l1l2(hfc->regd.arg_hisax,
7565 + (PH_ACTIVATE |
7566 + INDICATION), NULL);
7567 +
7568 + break;
7569 + default:
7570 + queue_control_request(hfc, HFCUSB_STATES, 0x60); /* start activation */
7571 + hfc->t3_timer.expires =
7572 + jiffies + (HFC_TIMER_T3 * HZ) / 1000;
7573 + if (!timer_pending(&hfc->t3_timer))
7574 + add_timer(&hfc->t3_timer);
7575 + break;
7576 + }
7577 + break;
7578 +
7579 + case (PH_DEACTIVATE | REQUEST):
7580 + queue_control_request(hfc, HFCUSB_STATES, 0x40); /* start deactivation */
7581 + break;
7582 + default:
7583 + printk(KERN_INFO "unknown hfcusb l1_access 0x%x\n",
7584 + pr);
7585 + break;
7586 + }
7587 +} /* hfcusb_l1_access */
7588 +
7589 +/*******************************/
7590 +/* B channel access from HiSax */
7591 +/*******************************/
7592 +static void
7593 +hfcusb_bch_access(void *drvarg, int chan, int pr, void *arg)
7594 +{
7595 + hfcusb_data *hfc = (hfcusb_data *) drvarg;
7596 + usb_fifo *fifo = hfc->fifos + (chan ? HFCUSB_B2_TX : HFCUSB_B1_TX);
7597 + long flags;
7598 +
7599 + switch (pr) {
7600 + case (PH_DATA | REQUEST):
7601 + case (PH_PULL | INDICATION):
7602 + save_flags(flags);
7603 + cli();
7604 + if (!fifo->active) {
7605 + fill_tx_urb(fifo);
7606 + hfc->active_fifos |= fifo->fifo_mask;
7607 + usb_submit_urb(&fifo->urb);
7608 + }
7609 + restore_flags(flags);
7610 + break;
7611 + case (PH_ACTIVATE | REQUEST):
7612 + if (!((int) arg)) {
7613 + hfc->bch_enables &= ~(1 << chan);
7614 + if (fifo->active) {
7615 + fifo->active = 0;
7616 + usb_unlink_urb(&fifo->urb);
7617 + }
7618 + save_flags(flags);
7619 + cli();
7620 + queue_control_request(hfc, HFCUSB_FIFO,
7621 + fifo->fifonum);
7622 + queue_control_request(hfc,
7623 + HFCUSB_INC_RES_F, 2);
7624 + queue_control_request(hfc, HFCUSB_CON_HDLC,
7625 + 9);
7626 + queue_control_request(hfc, HFCUSB_SCTRL,
7627 + 0x40 +
7628 + hfc->bch_enables);
7629 + queue_control_request(hfc, HFCUSB_SCTRL_R,
7630 + hfc->bch_enables);
7631 + restore_flags(flags);
7632 + fifo++;
7633 + if (fifo->active) {
7634 + fifo->active = 0;
7635 + usb_unlink_urb(&fifo->urb);
7636 + }
7637 + return; /* fifo deactivated */
7638 + }
7639 + fifo->transmode = ((int) arg == L1_MODE_TRANS);
7640 + fifo->max_size =
7641 + ((fifo->transmode) ? fifo->
7642 + usb_maxlen : MAX_BCH_SIZE);
7643 + (fifo + 1)->transmode = fifo->transmode;
7644 + (fifo + 1)->max_size = fifo->max_size;
7645 + hfc->bch_enables |= (1 << chan);
7646 + save_flags(flags);
7647 + cli();
7648 + queue_control_request(hfc, HFCUSB_FIFO,
7649 + fifo->fifonum);
7650 + queue_control_request(hfc, HFCUSB_CON_HDLC,
7651 + ((!fifo->
7652 + transmode) ? 9 : 11));
7653 + queue_control_request(hfc, HFCUSB_INC_RES_F, 2);
7654 + queue_control_request(hfc, HFCUSB_SCTRL,
7655 + 0x40 + hfc->bch_enables);
7656 + if ((int) arg == L1_MODE_HDLC)
7657 + queue_control_request(hfc, HFCUSB_CON_HDLC,
7658 + 8);
7659 + queue_control_request(hfc, HFCUSB_FIFO,
7660 + fifo->fifonum + 1);
7661 + queue_control_request(hfc, HFCUSB_CON_HDLC,
7662 + ((!fifo->
7663 + transmode) ? 8 : 10));
7664 + queue_control_request(hfc, HFCUSB_INC_RES_F, 2);
7665 + queue_control_request(hfc, HFCUSB_SCTRL_R,
7666 + hfc->bch_enables);
7667 + restore_flags(flags);
7668 +
7669 + break;
7670 +
7671 + default:
7672 + printk(KERN_INFO
7673 + "unknown hfcusb bch_access chan %d 0x%x\n",
7674 + chan, pr);
7675 + break;
7676 + }
7677 +} /* hfcusb_bch_access */
7678 +
7679 +/***************************************************************************/
7680 +/* usb_init is called once when a new matching device is detected to setup */
7681 +/* main parmeters. It registers the driver at the main hisax module. */
7682 +/* on success 0 is returned. */
7683 +/***************************************************************************/
7684 +static int
7685 +usb_init(hfcusb_data * hfc)
7686 +{
7687 + usb_fifo *fifo;
7688 + int i;
7689 + u_char b;
7690 +
7691 + /* check the chip id */
7692 + if ((Read_hfc(hfc, HFCUSB_CHIP_ID, &b) != 1) ||
7693 + (b != HFCUSB_CHIPID)) {
7694 + printk(KERN_INFO "HFC-USB: Invalid chip id 0x%02x\n", b);
7695 + return (1);
7696 + }
7697 +
7698 + /* first set the needed config, interface and alternate */
7699 + usb_set_configuration(hfc->dev, 1);
7700 + usb_set_interface(hfc->dev, hfc->if_used, hfc->alt_used);
7701 +
7702 + /* init the led state request */
7703 + hfc->led_req = LED_DRIVER;
7704 +
7705 + /* now we initialise the chip */
7706 + Write_hfc(hfc, HFCUSB_CIRM, 0x10); /* aux = output, reset off */
7707 + Write_hfc(hfc, HFCUSB_P_DATA, 0); /* leds = off */
7708 + Write_hfc(hfc, HFCUSB_USB_SIZE,
7709 + (hfc->fifos[HFCUSB_B1_TX].usb_maxlen >> 3) |
7710 + ((hfc->fifos[HFCUSB_B1_RX].usb_maxlen >> 3) << 4));
7711 +
7712 + /* enable PCM/GCI master mode */
7713 + Write_hfc(hfc, HFCUSB_MST_MODE1, 0); /* set default values */
7714 + Write_hfc(hfc, HFCUSB_MST_MODE0, 1); /* enable master mode */
7715 +
7716 + /* init the fifos */
7717 + Write_hfc(hfc, HFCUSB_F_THRES, (HFCUSB_TX_THRESHOLD >> 3) |
7718 + ((HFCUSB_RX_THRESHOLD >> 3) << 4));
7719 +
7720 + for (i = 0, fifo = hfc->fifos + i; i < HFCUSB_NUM_FIFOS;
7721 + i++, fifo++) {
7722 + Write_hfc(hfc, HFCUSB_FIFO, i); /* select the desired fifo */
7723 +
7724 + fifo->transmode = 0; /* hdlc mode selected */
7725 + fifo->buff = NULL; /* init buffer pointer */
7726 + fifo->max_size =
7727 + (i <= HFCUSB_B2_RX) ? MAX_BCH_SIZE : MAX_DFRAME_LEN;
7728 + Write_hfc(hfc, HFCUSB_HDLC_PAR, ((i <= HFCUSB_B2_RX) ? 0 : 2)); /* data length */
7729 + Write_hfc(hfc, HFCUSB_CON_HDLC, ((i & 1) ? 0x08 : 0x09)); /* rx hdlc, tx fill 1 */
7730 + Write_hfc(hfc, HFCUSB_INC_RES_F, 2); /* reset the fifo */
7731 + }
7732 +
7733 + Write_hfc(hfc, HFCUSB_CLKDEL, 0x0f); /* clock delay value */
7734 + Write_hfc(hfc, HFCUSB_STATES, 3 | 0x10); /* set deactivated mode */
7735 + Write_hfc(hfc, HFCUSB_STATES, 3); /* enable state machine */
7736 +
7737 + Write_hfc(hfc, HFCUSB_SCTRL_R, 0); /* disable both B receivers */
7738 + Write_hfc(hfc, HFCUSB_SCTRL, 0x40); /* disable B transmitters + cap mode */
7739 +
7740 + /* init the l1 timer */
7741 + init_timer(&hfc->t3_timer);
7742 + hfc->t3_timer.data = (long) hfc;
7743 + hfc->t3_timer.function = (void *) l1_timer_expire;
7744 + hfc->t4_timer.data = (long) hfc;
7745 + hfc->t4_timer.function = (void *) l1_timer_expire;
7746 + hfc->l1_tq.routine = (void *) (void *) usb_l1d_bh;
7747 + hfc->l1_tq.sync = 0;
7748 + hfc->l1_tq.data = hfc;
7749 +
7750 + /* init the background control machinery */
7751 + hfc->ctrl_read.requesttype = 0xc0;
7752 + hfc->ctrl_read.request = 1;
7753 + hfc->ctrl_read.length = 1;
7754 + hfc->ctrl_write.requesttype = 0x40;
7755 + hfc->ctrl_write.request = 0;
7756 + hfc->ctrl_write.length = 0;
7757 + FILL_CONTROL_URB(&hfc->ctrl_urb, hfc->dev, hfc->ctrl_out_pipe,
7758 + (u_char *) & hfc->ctrl_write, NULL, 0,
7759 + ctrl_complete, hfc);
7760 +
7761 + /* init the TX-urbs */
7762 + fifo = hfc->fifos + HFCUSB_D_TX;
7763 + FILL_BULK_URB(&fifo->urb, hfc->dev, fifo->pipe,
7764 + (u_char *) fifo->buffer, 0, tx_complete, fifo);
7765 + fifo = hfc->fifos + HFCUSB_B1_TX;
7766 + FILL_BULK_URB(&fifo->urb, hfc->dev, fifo->pipe,
7767 + (u_char *) fifo->buffer, 0, tx_complete, fifo);
7768 + fifo = hfc->fifos + HFCUSB_B2_TX;
7769 + FILL_BULK_URB(&fifo->urb, hfc->dev, fifo->pipe,
7770 + (u_char *) fifo->buffer, 0, tx_complete, fifo);
7771 +
7772 + /* init the E-buffer */
7773 + skb_queue_head_init(&hfc->regd.erq);
7774 +
7775 + /* now register ourself at hisax */
7776 + hfc->regd.version = HISAX_LOAD_VERSION; /* set our version */
7777 + hfc->regd.cmd = HISAX_LOAD_REGISTER; /* register command */
7778 + hfc->regd.argl1 = (void *) hfc; /* argument for our local routine */
7779 + hfc->regd.dch_l2l1 = hfcusb_l1_access;
7780 + hfc->regd.bch_l2l1 = hfcusb_bch_access;
7781 + hfc->regd.drvname = "hfc_usb";
7782 + if (hisax_register_hfcusb(&hfc->regd)) {
7783 + printk(KERN_INFO "HFC-USB failed to register at hisax\n");
7784 + Write_hfc(hfc, HFCUSB_CIRM, 0x08); /* aux = input, reset on */
7785 + return (1);
7786 + }
7787 +
7788 + /* startup the D- and E-channel fifos */
7789 + start_rx_fifo(hfc->fifos + HFCUSB_D_RX); /* D-fifo */
7790 + if (hfc->fifos[HFCUSB_PCM_RX].pipe)
7791 + start_rx_fifo(hfc->fifos + HFCUSB_PCM_RX); /* E-fifo */
7792 +
7793 + return (0);
7794 +} /* usb_init */
7795 +
7796 +/*************************************************/
7797 +/* function called to probe a new plugged device */
7798 +/*************************************************/
7799 +static void *
7800 +hfc_usb_probe(struct usb_device *dev, unsigned int interface
7801 +#ifdef COMPAT_HAS_USB_IDTAB
7802 + , const struct usb_device_id *id_table)
7803 +#else
7804 + )
7805 +#endif
7806 +{
7807 + hfcusb_data *context;
7808 + struct usb_interface *ifp = dev->actconfig->interface + interface;
7809 + struct usb_interface_descriptor *ifdp =
7810 + ifp->altsetting + ifp->act_altsetting;
7811 + struct usb_endpoint_descriptor *epd;
7812 + int i, idx, ep_msk;
7813 +
7814 +#ifdef COMPAT_HAS_USB_IDTAB
7815 + if (id_table && (dev->descriptor.idVendor == id_table->idVendor) &&
7816 + (dev->descriptor.idProduct == id_table->idProduct) &&
7817 +#else
7818 + if ((((dev->descriptor.idVendor == 0x959) &&
7819 + (dev->descriptor.idProduct == 0x2bd0)) ||
7820 + ((dev->descriptor.idVendor == 0x7b0) &&
7821 + (dev->descriptor.idProduct == 0x0006))) &&
7822 +#endif
7823 + (ifdp->bNumEndpoints >= 6) && (ifdp->bNumEndpoints <= 16)) {
7824 + if (!(context = kmalloc(sizeof(hfcusb_data), GFP_KERNEL))) {
7825 + return (NULL); /* got no mem */
7826 + };
7827 + memset(context, 0, sizeof(hfcusb_data)); /* clear the structure */
7828 + i = ifdp->bNumEndpoints; /* get number of endpoints */
7829 + ep_msk = 0; /* none found */
7830 + epd = ifdp->endpoint; /* first endpoint descriptor */
7831 + while (i-- && ((ep_msk & 0xcf) != 0xcf)) {
7832 +
7833 + idx = (((epd->bEndpointAddress & 0x7f) - 1) << 1); /* get endpoint base */
7834 + if (idx < 7) {
7835 + switch (epd->bmAttributes) {
7836 + case USB_ENDPOINT_XFER_INT:
7837 + if (!
7838 + (epd->
7839 + bEndpointAddress &
7840 + 0x80))
7841 + break; /* only interrupt in allowed */
7842 + idx++; /* input index is odd */
7843 + context->fifos[idx].pipe =
7844 + usb_rcvintpipe(dev,
7845 + epd->
7846 + bEndpointAddress);
7847 + break;
7848 +
7849 + case USB_ENDPOINT_XFER_BULK:
7850 + if (epd->
7851 + bEndpointAddress &
7852 + 0x80)
7853 + break; /* only bulk out allowed */
7854 + context->fifos[idx].pipe =
7855 + usb_sndbulkpipe(dev,
7856 + epd->
7857 + bEndpointAddress);
7858 + break;
7859 + default:
7860 + context->fifos[idx].pipe = 0; /* reset data */
7861 + } /* switch attribute */
7862 +
7863 + if (context->fifos[idx].pipe) {
7864 + context->fifos[idx].fifonum = idx;
7865 + context->fifos[idx].fifo_mask =
7866 + 1 << idx;
7867 + context->fifos[idx].hfc = context;
7868 + context->fifos[idx].usb_maxlen =
7869 + epd->wMaxPacketSize;
7870 + context->fifos[idx].intervall =
7871 + epd->bInterval;
7872 + ep_msk |= (1 << idx);
7873 + } else
7874 + ep_msk &= ~(1 << idx);
7875 + } /* idx < 7 */
7876 + epd++;
7877 + }
7878 +
7879 + if ((ep_msk & 0x3f) != 0x3f) {
7880 + kfree(context);
7881 + return (NULL);
7882 + }
7883 + MOD_INC_USE_COUNT; /* lock our module */
7884 + context->dev = dev; /* save device */
7885 + context->if_used = interface; /* save used interface */
7886 + context->alt_used = ifp->act_altsetting; /* and alternate config */
7887 + context->ctrl_paksize = dev->descriptor.bMaxPacketSize0; /* control size */
7888 +
7889 + /* create the control pipes needed for register access */
7890 + context->ctrl_in_pipe = usb_rcvctrlpipe(context->dev, 0);
7891 + context->ctrl_out_pipe = usb_sndctrlpipe(context->dev, 0);
7892 +
7893 + /* init the chip and register the driver */
7894 + if (usb_init(context)) {
7895 + kfree(context);
7896 + MOD_DEC_USE_COUNT;
7897 + return (NULL);
7898 + }
7899 +
7900 + printk(KERN_INFO
7901 + "HFC-USB: New device if=%d alt=%d registered\n",
7902 + context->if_used, context->alt_used);
7903 + return (context);
7904 + }
7905 +
7906 + return (NULL); /* no matching entry */
7907 +} /* hfc_usb_probe */
7908 +
7909 +/****************************************************/
7910 +/* function called when an active device is removed */
7911 +/****************************************************/
7912 +static void
7913 +hfc_usb_disconnect(struct usb_device *usbdev, void *drv_context)
7914 +{
7915 + hfcusb_data *context = drv_context;
7916 + int i;
7917 + struct sk_buff *skb;
7918 +
7919 + /* tell all fifos to terminate */
7920 + for (i = 0; i < HFCUSB_NUM_FIFOS; i++)
7921 + if (context->fifos[i].active) {
7922 + context->fifos[i].active = 0;
7923 + usb_unlink_urb(&context->fifos[i].urb);
7924 + }
7925 + while (context->active_fifos) {
7926 + set_current_state(TASK_INTERRUPTIBLE);
7927 + /* Timeout 10ms */
7928 + schedule_timeout((10 * HZ) / 1000);
7929 + }
7930 + if (timer_pending(&context->t3_timer))
7931 + del_timer(&context->t3_timer);
7932 + context->regd.release_driver(context->regd.arg_hisax);
7933 + while ((skb = skb_dequeue(&context->regd.erq)) != NULL)
7934 + dev_kfree_skb_any(skb);
7935 +
7936 + kfree(context); /* free our structure again */
7937 + MOD_DEC_USE_COUNT; /* and decrement the usage counter */
7938 +} /* hfc_usb_disconnect */
7939 +
7940 +/************************************/
7941 +/* our driver information structure */
7942 +/************************************/
7943 +static struct usb_driver hfc_drv = {
7944 + name:"hfc_usb",
7945 +#ifdef COMPAT_HAS_USB_IDTAB
7946 + id_table:hfc_usb_idtab,
7947 +#endif
7948 + probe:hfc_usb_probe,
7949 + disconnect:hfc_usb_disconnect,
7950 +};
7951 +
7952 +static void __exit
7953 +hfc_usb_exit(void)
7954 +{
7955 +
7956 + usb_deregister(&hfc_drv); /* release our driver */
7957 + printk(KERN_INFO "HFC-USB module removed\n");
7958 +}
7959 +
7960 +static int __init
7961 +hfc_usb_init(void)
7962 +{
7963 + struct hisax_drvreg drv;
7964 +
7965 + drv.version = HISAX_LOAD_VERSION; /* set our version */
7966 + drv.cmd = HISAX_LOAD_CHKVER; /* check command only */
7967 + if (hisax_register_hfcusb(&drv)) {
7968 + printk(KERN_INFO "HFC-USB <-> hisax version conflict\n");
7969 + return (-1); /* unable to register */
7970 + }
7971 + if (usb_register(&hfc_drv)) {
7972 + printk(KERN_INFO
7973 + "Unable to register HFC-USB module at usb stack\n");
7974 + return (-1); /* unable to register */
7975 + }
7976 +
7977 + printk(KERN_INFO "HFC-USB module loaded\n");
7978 + return (0);
7979 +}
7980 +
7981 +module_init(hfc_usb_init);
7982 +module_exit(hfc_usb_exit);
7983 Index: linux-2.4.35.4/drivers/isdn/hisax/hfc_usbr.c
7984 ===================================================================
7985 --- /dev/null
7986 +++ linux-2.4.35.4/drivers/isdn/hisax/hfc_usbr.c
7987 @@ -0,0 +1,471 @@
7988 +/* $Id: hfc_usbr.c,v 2.5 2001/07/06 21:30:11 werner Exp $
7989 +
7990 + * hfc_usb.c low level driver for CCD´s hfc-usb single chip controllers
7991 + * type approval valid for HFC-S USB based TAs
7992 + *
7993 + * Author Werner Cornelius (werner@isdn-development.de)
7994 + *
7995 + * Copyright 2001 by Werner Cornelius (werner@isdn4linux.de)
7996 + *
7997 + * This program is free software; you can redistribute it and/or modify
7998 + * it under the terms of the GNU General Public License as published by
7999 + * the Free Software Foundation; either version 2, or (at your option)
8000 + * any later version.
8001 + *
8002 + * This program is distributed in the hope that it will be useful,
8003 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
8004 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8005 + * GNU General Public License for more details.
8006 + *
8007 + * You should have received a copy of the GNU General Public License
8008 + * along with this program; if not, write to the Free Software
8009 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
8010 + *
8011 + */
8012 +
8013 +#define __NO_VERSION__
8014 +#include <linux/init.h>
8015 +#include "hisax.h"
8016 +#include "isdnl1.h"
8017 +#include "hisax_loadable.h"
8018 +
8019 +extern const char *CardType[];
8020 +
8021 +static const char *hfcusb_revision = "$Revision: 2.5 $";
8022 +
8023 +/*********************************/
8024 +/* schedule a new b_channel task */
8025 +/*********************************/
8026 +static void
8027 +hfcusb_sched_event(struct BCState *bcs, int event)
8028 +{
8029 + bcs->event |= 1 << event;
8030 + queue_task(&bcs->tqueue, &tq_immediate);
8031 + mark_bh(IMMEDIATE_BH);
8032 +}
8033 +
8034 +/************************************************/
8035 +/* select a b-channel entry matching and active */
8036 +/************************************************/
8037 +static
8038 +struct BCState *
8039 +Sel_BCS(struct IsdnCardState *cs, int channel)
8040 +{
8041 + if (cs->bcs[0].mode && (cs->bcs[0].channel == channel))
8042 + return (&cs->bcs[0]);
8043 + else if (cs->bcs[1].mode && (cs->bcs[1].channel == channel))
8044 + return (&cs->bcs[1]);
8045 + else
8046 + return (NULL);
8047 +}
8048 +
8049 +/**********************************************/
8050 +/* transfer function (D-channel from l2 to l1 */
8051 +/**********************************************/
8052 +static void
8053 +hfcusb_d_l2l1(struct PStack *st, int pr, void *arg)
8054 +{
8055 + struct IsdnCardState *cs = st->l1.hardware;
8056 + struct hisax_drvreg *drv = cs->hw.hfcusb.drv;
8057 +
8058 + if (drv) {
8059 + switch (pr) {
8060 + case (PH_DATA | REQUEST):
8061 + case (PH_PULL | INDICATION):
8062 + cs->hw.hfcusb.dch_tx_busy = 1;
8063 + break;
8064 + case (PH_PULL | REQUEST):
8065 + if (!cs->hw.hfcusb.dch_tx_busy) {
8066 + test_and_clear_bit(FLG_L1_PULL_REQ,
8067 + &st->l1.Flags);
8068 + st->l1.l1l2(st, PH_PULL | CONFIRM,
8069 + NULL);
8070 + } else
8071 + test_and_set_bit(FLG_L1_PULL_REQ,
8072 + &st->l1.Flags);
8073 + return;
8074 + }
8075 + drv->dch_l2l1(drv, pr, arg);
8076 + } else
8077 + debugl1(cs, "hfcusb l2l1 called without existing driver");
8078 +} /* hfcusb_d_l2l1 */
8079 +
8080 +/*****************************/
8081 +/* E-channel receive routine */
8082 +/*****************************/
8083 +static void
8084 +EChannel_proc_rcv(struct IsdnCardState *cs)
8085 +{
8086 + u_char *ptr;
8087 + struct sk_buff *skb;
8088 + struct hisax_drvreg *usbdrv =
8089 + (struct hisax_drvreg *) cs->hw.hfcusb.drv;
8090 +
8091 +
8092 + while ((skb = skb_dequeue(&usbdrv->erq)) != NULL) {
8093 + if (cs->debug & DEB_DLOG_HEX) {
8094 + ptr = cs->dlog;
8095 + if ((skb->len) < MAX_DLOG_SPACE / 3 - 10) {
8096 + *ptr++ = 'E';
8097 + *ptr++ = 'C';
8098 + *ptr++ = 'H';
8099 + *ptr++ = 'O';
8100 + *ptr++ = ':';
8101 + ptr += QuickHex(ptr, skb->data, skb->len);
8102 + ptr--;
8103 + *ptr++ = '\n';
8104 + *ptr = 0;
8105 + HiSax_putstatus(cs, NULL, cs->dlog);
8106 + } else
8107 + HiSax_putstatus(cs, "LogEcho: ",
8108 + "warning Frame too big (%d)",
8109 + skb->len);
8110 + }
8111 + dev_kfree_skb_any(skb);
8112 + }
8113 +}
8114 +
8115 +/******************************************/
8116 +/* transfer function called from L1 to L2 */
8117 +/******************************************/
8118 +static void
8119 +hfcusb_d_l1l2(void *cs1, int pr, void *arg)
8120 +{
8121 + struct IsdnCardState *cs = (struct IsdnCardState *) cs1;
8122 +
8123 + switch (pr) {
8124 + case (PH_DATA | INDICATION):
8125 + if (!((int) arg))
8126 + DChannel_proc_rcv(cs);
8127 + else
8128 + EChannel_proc_rcv(cs);
8129 + break;
8130 +
8131 + case (PH_DATA | CONFIRM):
8132 + cs->hw.hfcusb.dch_tx_busy = 0;
8133 + DChannel_proc_xmt(cs);
8134 + break;
8135 +
8136 + case (PH_ACTIVATE | INDICATION):
8137 + case (PH_ACTIVATE | CONFIRM):
8138 + cs->stlist->l1.l1l2(cs->stlist, pr, arg);
8139 + if (cs->debug & L1_DEB_ISAC)
8140 + debugl1(cs, "layer 1 activated");
8141 + break;
8142 +
8143 + case (PH_DEACTIVATE | INDICATION):
8144 + case (PH_DEACTIVATE | CONFIRM):
8145 + cs->stlist->l1.l1l2(cs->stlist, pr, arg);
8146 + if (cs->debug & L1_DEB_ISAC)
8147 + debugl1(cs, "layer 1 deactivated");
8148 + break;
8149 +
8150 + default:
8151 + debugl1(cs, "unknown l1 msg 0x%x ", pr);
8152 + }
8153 +} /* hfcusb_d_l1l2 */
8154 +
8155 +
8156 +/******************************************/
8157 +/* transfer function called from L1 to L2 */
8158 +/******************************************/
8159 +static void
8160 +hfcusb_b_l1l2(void *cs1, int chan, int pr, void *arg)
8161 +{
8162 + struct IsdnCardState *cs = (struct IsdnCardState *) cs1;
8163 + struct BCState *bcs = Sel_BCS(cs, chan);
8164 +
8165 + switch (pr) {
8166 + case (PH_DATA | INDICATION):
8167 + if (!bcs)
8168 + return;
8169 + hfcusb_sched_event(bcs, B_RCVBUFREADY);
8170 + break;
8171 +
8172 + case (PH_DATA | CONFIRM):
8173 + if (!bcs)
8174 + return;
8175 + bcs->tx_cnt -= bcs->tx_skb->len;
8176 + if (bcs->st->lli.l1writewakeup &&
8177 + (PACKET_NOACK != bcs->tx_skb->pkt_type))
8178 + bcs->st->lli.l1writewakeup(bcs->st,
8179 + bcs->tx_skb->
8180 + len);
8181 + dev_kfree_skb_any(bcs->tx_skb);
8182 + bcs->tx_skb = skb_dequeue(&bcs->squeue);
8183 + break;
8184 +
8185 + case (PH_ACTIVATE | INDICATION):
8186 + case (PH_ACTIVATE | CONFIRM):
8187 + cs->stlist->l1.l1l2(cs->stlist, pr, arg);
8188 + if (cs->debug & L1_DEB_ISAC)
8189 + debugl1(cs, "layer 1 activated");
8190 + break;
8191 +
8192 + case (PH_DEACTIVATE | INDICATION):
8193 + case (PH_DEACTIVATE | CONFIRM):
8194 + cs->stlist->l1.l1l2(cs->stlist, pr, arg);
8195 + if (cs->debug & L1_DEB_ISAC)
8196 + debugl1(cs, "layer 1 deactivated");
8197 + break;
8198 +
8199 + default:
8200 + debugl1(cs, "unknown l1 b msg 0x%x ", pr);
8201 + }
8202 +} /* hfcusb_b_l1l2 */
8203 +
8204 +
8205 +/***********************************************/
8206 +/* called during init setting l1 stack pointer */
8207 +/***********************************************/
8208 +void
8209 +setstack_hfcusb(struct PStack *st, struct IsdnCardState *cs)
8210 +{
8211 + st->l2.l2l1 = hfcusb_d_l2l1;
8212 +}
8213 +
8214 +/**************************************/
8215 +/* send B-channel data if not blocked */
8216 +/**************************************/
8217 +static void
8218 +hfcusb_send_data(struct BCState *bcs)
8219 +{
8220 + struct IsdnCardState *cs = bcs->cs;
8221 + struct hisax_drvreg *drv =
8222 + (struct hisax_drvreg *) cs->hw.hfcusb.drv;
8223 +
8224 + if (!drv)
8225 + return;
8226 + drv->bch_l2l1(drv->argl1, bcs->channel, PH_DATA | REQUEST,
8227 + bcs->tx_skb);
8228 +}
8229 +
8230 +/***************************************************************/
8231 +/* activate/deactivate hardware for selected channels and mode */
8232 +/***************************************************************/
8233 +void
8234 +mode_hfcusb(struct BCState *bcs, int mode, int bc)
8235 +{
8236 + struct IsdnCardState *cs = bcs->cs;
8237 + struct hisax_drvreg *drv = cs->hw.hfcusb.drv;
8238 +
8239 + if (!drv)
8240 + return;
8241 + if (cs->debug & L1_DEB_HSCX)
8242 + debugl1(cs, "HFCUSB bchannel mode %d bchan %d/%d",
8243 + mode, bc, bcs->channel);
8244 + bcs->mode = mode;
8245 + bcs->channel = bc;
8246 + if (mode) {
8247 + drv->bsk[bc] = &bcs->tx_skb;
8248 + drv->brq[bc] = &bcs->rqueue;
8249 + }
8250 + drv->bch_l2l1(drv->argl1, bc, PH_ACTIVATE | REQUEST,
8251 + (void *) mode);
8252 + if (!mode) {
8253 + drv->bsk[bc] = NULL;
8254 + drv->brq[bc] = NULL;
8255 + }
8256 +}
8257 +
8258 +/******************************/
8259 +/* Layer2 -> Layer 1 Transfer */
8260 +/******************************/
8261 +static void
8262 +hfcusb_b_l2l1(struct PStack *st, int pr, void *arg)
8263 +{
8264 + struct sk_buff *skb = arg;
8265 + struct hisax_drvreg *drv = st->l1.bcs->cs->hw.hfcusb.drv;
8266 + long flags;
8267 +
8268 + switch (pr) {
8269 + case (PH_DATA | REQUEST):
8270 + save_flags(flags);
8271 + cli();
8272 + if (st->l1.bcs->tx_skb) {
8273 + skb_queue_tail(&st->l1.bcs->squeue, skb);
8274 + restore_flags(flags);
8275 + } else {
8276 + st->l1.bcs->tx_skb = skb;
8277 + st->l1.bcs->cs->BC_Send_Data(st->l1.bcs);
8278 + restore_flags(flags);
8279 + }
8280 + break;
8281 + case (PH_PULL | INDICATION):
8282 + if (st->l1.bcs->tx_skb) {
8283 + printk(KERN_WARNING
8284 + "hfc_l2l1: this shouldn't happen\n");
8285 + break;
8286 + }
8287 + save_flags(flags);
8288 + cli();
8289 + st->l1.bcs->tx_skb = skb;
8290 + st->l1.bcs->cs->BC_Send_Data(st->l1.bcs);
8291 + restore_flags(flags);
8292 + break;
8293 + case (PH_PULL | REQUEST):
8294 + if (!st->l1.bcs->tx_skb) {
8295 + test_and_clear_bit(FLG_L1_PULL_REQ,
8296 + &st->l1.Flags);
8297 + st->l1.l1l2(st, PH_PULL | CONFIRM, NULL);
8298 + } else
8299 + test_and_set_bit(FLG_L1_PULL_REQ,
8300 + &st->l1.Flags);
8301 + break;
8302 + case (PH_ACTIVATE | REQUEST):
8303 + if (drv) {
8304 + test_and_set_bit(BC_FLG_ACTIV,
8305 + &st->l1.bcs->Flag);
8306 + mode_hfcusb(st->l1.bcs, st->l1.mode,
8307 + st->l1.bc);
8308 + l1_msg_b(st, pr, arg);
8309 + }
8310 + break;
8311 + case (PH_DEACTIVATE | REQUEST):
8312 + l1_msg_b(st, pr, arg);
8313 + break;
8314 + case (PH_DEACTIVATE | CONFIRM):
8315 + test_and_clear_bit(BC_FLG_ACTIV,
8316 + &st->l1.bcs->Flag);
8317 + test_and_clear_bit(BC_FLG_BUSY, &st->l1.bcs->Flag);
8318 + mode_hfcusb(st->l1.bcs, 0, st->l1.bc);
8319 + st->l1.l1l2(st, PH_DEACTIVATE | CONFIRM, NULL);
8320 + break;
8321 + }
8322 +}
8323 +
8324 +/******************************************/
8325 +/* deactivate B-channel access and queues */
8326 +/******************************************/
8327 +static void
8328 +close_hfcusb(struct BCState *bcs)
8329 +{
8330 + mode_hfcusb(bcs, 0, bcs->channel);
8331 + if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) {
8332 + skb_queue_purge(&bcs->rqueue);
8333 + skb_queue_purge(&bcs->squeue);
8334 + if (bcs->tx_skb) {
8335 + dev_kfree_skb_any(bcs->tx_skb);
8336 + bcs->tx_skb = NULL;
8337 + test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag);
8338 + }
8339 + }
8340 +}
8341 +
8342 +/*************************************/
8343 +/* init B-channel queues and control */
8344 +/*************************************/
8345 +static int
8346 +open_hfcusbstate(struct IsdnCardState *cs, struct BCState *bcs)
8347 +{
8348 + if (!test_and_set_bit(BC_FLG_INIT, &bcs->Flag)) {
8349 + skb_queue_head_init(&bcs->rqueue);
8350 + skb_queue_head_init(&bcs->squeue);
8351 + }
8352 + bcs->tx_skb = NULL;
8353 + test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag);
8354 + bcs->event = 0;
8355 + bcs->tx_cnt = 0;
8356 + return (0);
8357 +}
8358 +
8359 +/*********************************/
8360 +/* inits the stack for B-channel */
8361 +/*********************************/
8362 +static int
8363 +setstack_2b(struct PStack *st, struct BCState *bcs)
8364 +{
8365 + bcs->channel = st->l1.bc;
8366 + if (open_hfcusbstate(st->l1.hardware, bcs))
8367 + return (-1);
8368 + st->l1.bcs = bcs;
8369 + st->l2.l2l1 = hfcusb_b_l2l1;
8370 + setstack_manager(st);
8371 + bcs->st = st;
8372 + setstack_l1_B(st);
8373 + return (0);
8374 +}
8375 +
8376 +/********************************/
8377 +/* called for card init message */
8378 +/********************************/
8379 +void __devinit
8380 +inithfcusb(struct IsdnCardState *cs)
8381 +{
8382 + cs->setstack_d = setstack_hfcusb;
8383 + cs->BC_Send_Data = &hfcusb_send_data;
8384 + cs->bcs[0].BC_SetStack = setstack_2b;
8385 + cs->bcs[1].BC_SetStack = setstack_2b;
8386 + cs->bcs[0].BC_Close = close_hfcusb;
8387 + cs->bcs[1].BC_Close = close_hfcusb;
8388 + mode_hfcusb(cs->bcs, 0, 0);
8389 + mode_hfcusb(cs->bcs + 1, 0, 1);
8390 +}
8391 +
8392 +
8393 +
8394 +/*******************************************/
8395 +/* handle card messages from control layer */
8396 +/*******************************************/
8397 +static int
8398 +hfcusb_card_msg(struct IsdnCardState *cs, int mt, void *arg)
8399 +{
8400 + if (cs->debug & L1_DEB_ISAC)
8401 + debugl1(cs, "HFCUSB: card_msg %x", mt);
8402 + switch (mt) {
8403 + case CARD_INIT:
8404 + inithfcusb(cs);
8405 + return (0);
8406 + case CARD_RELEASE:
8407 + case CARD_RESET:
8408 + case CARD_TEST:
8409 + return (0);
8410 + }
8411 + return (0);
8412 +}
8413 +
8414 +
8415 +extern void
8416 + HiSax_closecard(int cardnr);
8417 +/*****************************/
8418 +/* release a driver instance */
8419 +/* called when hardware is */
8420 +/* no longer present. */
8421 +/*****************************/
8422 +static void
8423 +release_hfcdrv(void *arg)
8424 +{
8425 + struct IsdnCardState *cs = (struct IsdnCardState *) arg;
8426 +
8427 + cs->hw.hfcusb.drv = NULL; /* disable any further use of driver */
8428 + HiSax_closecard(cs->cardnr);
8429 +} /* release_hfcdrv */
8430 +
8431 +/*********************************************/
8432 +/* called once when a new device is detected */
8433 +/* initialises local data */
8434 +/*********************************************/
8435 +int
8436 +setup_hfc_usb(struct IsdnCard *card)
8437 +{
8438 + struct IsdnCardState *cs = card->cs;
8439 + char tmp[64];
8440 + struct hisax_drvreg *usbdrv =
8441 + (struct hisax_drvreg *) cs->hw.hfcusb.drv;
8442 +
8443 + if (!usbdrv)
8444 + return (0); /* no driver data present */
8445 +
8446 + strcpy(tmp, hfcusb_revision);
8447 + printk(KERN_INFO "HiSax: HFC-USB driver Rev. %s\n",
8448 + HiSax_getrev(tmp));
8449 +
8450 + usbdrv->release_driver = &release_hfcdrv; /* release routine */
8451 + usbdrv->arg_hisax = (void *) cs; /* parameter for calling */
8452 + usbdrv->dch_l1l2 = &hfcusb_d_l1l2; /* access from L1 to HiSax */
8453 + usbdrv->bch_l1l2 = &hfcusb_b_l1l2;
8454 + usbdrv->drq = &cs->rq;
8455 + usbdrv->dsq = &cs->sq;
8456 + cs->cardmsg = &hfcusb_card_msg;
8457 + return (1); /* success */
8458 +}
8459 Index: linux-2.4.35.4/drivers/isdn/hisax/hfcscard.c
8460 ===================================================================
8461 --- linux-2.4.35.4.orig/drivers/isdn/hisax/hfcscard.c
8462 +++ linux-2.4.35.4/drivers/isdn/hisax/hfcscard.c
8463 @@ -1,4 +1,4 @@
8464 -/* $Id: hfcscard.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
8465 +/* $Id: hfcscard.c,v 1.10 2001/09/24 13:22:56 kai Exp $
8466 *
8467 * low level stuff for hfcs based cards (Teles3c, ACER P10)
8468 *
8469 @@ -12,14 +12,13 @@
8470
8471 #define __NO_VERSION__
8472 #include <linux/init.h>
8473 -#include <linux/isapnp.h>
8474 #include "hisax.h"
8475 #include "hfc_2bds0.h"
8476 #include "isdnl1.h"
8477
8478 extern const char *CardType[];
8479
8480 -static const char *hfcs_revision = "$Revision: 1.1.4.1 $";
8481 +static const char *hfcs_revision = "$Revision: 1.10 $";
8482
8483 static void
8484 hfcs_interrupt(int intno, void *dev_id, struct pt_regs *regs)
8485 @@ -140,36 +139,6 @@ hfcs_card_msg(struct IsdnCardState *cs,
8486 return(0);
8487 }
8488
8489 -#ifdef __ISAPNP__
8490 -static struct isapnp_device_id hfc_ids[] __initdata = {
8491 - { ISAPNP_VENDOR('A', 'N', 'X'), ISAPNP_FUNCTION(0x1114),
8492 - ISAPNP_VENDOR('A', 'N', 'X'), ISAPNP_FUNCTION(0x1114),
8493 - (unsigned long) "Acer P10" },
8494 - { ISAPNP_VENDOR('B', 'I', 'L'), ISAPNP_FUNCTION(0x0002),
8495 - ISAPNP_VENDOR('B', 'I', 'L'), ISAPNP_FUNCTION(0x0002),
8496 - (unsigned long) "Billion 2" },
8497 - { ISAPNP_VENDOR('B', 'I', 'L'), ISAPNP_FUNCTION(0x0001),
8498 - ISAPNP_VENDOR('B', 'I', 'L'), ISAPNP_FUNCTION(0x0001),
8499 - (unsigned long) "Billion 1" },
8500 - { ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x7410),
8501 - ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x7410),
8502 - (unsigned long) "IStar PnP" },
8503 - { ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2610),
8504 - ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2610),
8505 - (unsigned long) "Teles 16.3c" },
8506 - { ISAPNP_VENDOR('S', 'F', 'M'), ISAPNP_FUNCTION(0x0001),
8507 - ISAPNP_VENDOR('S', 'F', 'M'), ISAPNP_FUNCTION(0x0001),
8508 - (unsigned long) "Tornado Tipa C" },
8509 - { ISAPNP_VENDOR('K', 'Y', 'E'), ISAPNP_FUNCTION(0x0001),
8510 - ISAPNP_VENDOR('K', 'Y', 'E'), ISAPNP_FUNCTION(0x0001),
8511 - (unsigned long) "Genius Speed Surfer" },
8512 - { 0, }
8513 -};
8514 -
8515 -static struct isapnp_device_id *hdev = &hfc_ids[0];
8516 -static struct pci_bus *pnp_c __devinitdata = NULL;
8517 -#endif
8518 -
8519 int __init
8520 setup_hfcs(struct IsdnCard *card)
8521 {
8522 @@ -178,46 +147,6 @@ setup_hfcs(struct IsdnCard *card)
8523
8524 strcpy(tmp, hfcs_revision);
8525 printk(KERN_INFO "HiSax: HFC-S driver Rev. %s\n", HiSax_getrev(tmp));
8526 -
8527 -#ifdef __ISAPNP__
8528 - if (!card->para[1] && isapnp_present()) {
8529 - struct pci_bus *pb;
8530 - struct pci_dev *pd;
8531 -
8532 - while(hdev->card_vendor) {
8533 - if ((pb = isapnp_find_card(hdev->card_vendor,
8534 - hdev->card_device, pnp_c))) {
8535 - pnp_c = pb;
8536 - pd = NULL;
8537 - if ((pd = isapnp_find_dev(pnp_c,
8538 - hdev->vendor, hdev->function, pd))) {
8539 - printk(KERN_INFO "HiSax: %s detected\n",
8540 - (char *)hdev->driver_data);
8541 - pd->prepare(pd);
8542 - pd->deactivate(pd);
8543 - pd->activate(pd);
8544 - card->para[1] = pd->resource[0].start;
8545 - card->para[0] = pd->irq_resource[0].start;
8546 - if (!card->para[0] || !card->para[1]) {
8547 - printk(KERN_ERR "HFC PnP:some resources are missing %ld/%lx\n",
8548 - card->para[0], card->para[1]);
8549 - pd->deactivate(pd);
8550 - return(0);
8551 - }
8552 - break;
8553 - } else {
8554 - printk(KERN_ERR "HFC PnP: PnP error card found, no device\n");
8555 - }
8556 - }
8557 - hdev++;
8558 - pnp_c=NULL;
8559 - }
8560 - if (!hdev->card_vendor) {
8561 - printk(KERN_INFO "HFC PnP: no ISAPnP card found\n");
8562 - return(0);
8563 - }
8564 - }
8565 -#endif
8566 cs->hw.hfcD.addr = card->para[1] & 0xfffe;
8567 cs->irq = card->para[0];
8568 cs->hw.hfcD.cip = 0;
8569 Index: linux-2.4.35.4/drivers/isdn/hisax/hisax.h
8570 ===================================================================
8571 --- linux-2.4.35.4.orig/drivers/isdn/hisax/hisax.h
8572 +++ linux-2.4.35.4/drivers/isdn/hisax/hisax.h
8573 @@ -1,4 +1,4 @@
8574 -/* $Id: hisax.h,v 1.1.4.2 2001/12/09 19:15:28 kai Exp $
8575 +/* $Id: hisax.h,v 2.64 2001/09/24 13:22:56 kai Exp $
8576 *
8577 * Basic declarations, defines and prototypes
8578 *
8579 @@ -24,7 +24,9 @@
8580 #include <linux/isdnif.h>
8581 #include <linux/tty.h>
8582 #include <linux/serial_reg.h>
8583 +#ifndef COMPAT_NO_SOFTNET
8584 #include <linux/netdevice.h>
8585 +#endif
8586
8587 #define ERROR_STATISTIC
8588
8589 @@ -68,9 +70,6 @@
8590 #define DL_DATA 0x0220
8591 #define DL_FLUSH 0x0224
8592 #define DL_UNIT_DATA 0x0230
8593 -
8594 -#define MDL_BC_RELEASE 0x0278 // Formula-n enter:now
8595 -#define MDL_BC_ASSIGN 0x027C // Formula-n enter:now
8596 #define MDL_ASSIGN 0x0280
8597 #define MDL_REMOVE 0x0284
8598 #define MDL_ERROR 0x0288
8599 @@ -472,8 +471,6 @@ struct amd7930_hw {
8600 #define BC_FLG_FTI_RUN 13
8601 #define BC_FLG_LL_OK 14
8602 #define BC_FLG_LL_CONN 15
8603 -#define BC_FLG_FTI_FTS 16
8604 -#define BC_FLG_FRH_WAIT 17
8605
8606 #define L1_MODE_NULL 0
8607 #define L1_MODE_TRANS 1
8608 @@ -695,6 +692,13 @@ struct hfcPCI_hw {
8609 struct timer_list timer;
8610 };
8611
8612 +#ifdef CONFIG_HISAX_HFC_USB
8613 +struct hfcUSB_hw {
8614 + void *drv; /* pointer to driver structure */
8615 + int dch_tx_busy;
8616 +};
8617 +#endif
8618 +
8619 struct hfcSX_hw {
8620 unsigned long base;
8621 unsigned char cirm;
8622 @@ -838,17 +842,6 @@ struct w6692_chip {
8623 int ph_state;
8624 };
8625
8626 -struct amd7930_chip {
8627 - u_char lmr1;
8628 - u_char ph_state;
8629 - u_char old_state;
8630 - u_char flg_t3;
8631 - unsigned int tx_xmtlen;
8632 - struct timer_list timer3;
8633 - void (*ph_command) (struct IsdnCardState *, u_char, char *);
8634 - void (*setIrqMask) (struct IsdnCardState *, u_char);
8635 -};
8636 -
8637 struct icc_chip {
8638 int ph_state;
8639 u_char *mon_tx;
8640 @@ -902,6 +895,9 @@ struct IsdnCardState {
8641 struct njet_hw njet;
8642 struct hfcD_hw hfcD;
8643 struct hfcPCI_hw hfcpci;
8644 +#ifdef CONFIG_HISAX_HFC_USB
8645 + struct hfcUSB_hw hfcusb;
8646 +#endif
8647 struct hfcSX_hw hfcsx;
8648 struct ix1_hw niccy;
8649 struct isurf_hw isurf;
8650 @@ -945,7 +941,6 @@ struct IsdnCardState {
8651 struct hfcpci_chip hfcpci;
8652 struct hfcsx_chip hfcsx;
8653 struct w6692_chip w6692;
8654 - struct amd7930_chip amd7930;
8655 struct icc_chip icc;
8656 } dc;
8657 u_char *rcvbuf;
8658 @@ -967,6 +962,8 @@ struct IsdnCardState {
8659 #define MON0_TX 4
8660 #define MON1_TX 8
8661
8662 +#define HISAX_MAX_CARDS 8
8663 +
8664 #define ISDN_CTYPE_16_0 1
8665 #define ISDN_CTYPE_8_0 2
8666 #define ISDN_CTYPE_16_3 3
8667 @@ -1006,8 +1003,8 @@ struct IsdnCardState {
8668 #define ISDN_CTYPE_HFC_SX 37
8669 #define ISDN_CTYPE_NETJET_U 38
8670 #define ISDN_CTYPE_HFC_SP_PCMCIA 39
8671 -#define ISDN_CTYPE_DYNAMIC 40
8672 -#define ISDN_CTYPE_ENTERNOW 41
8673 +#define ISDN_CTYPE_HFC_USB 40
8674 +#define ISDN_CTYPE_DYNAMIC 41
8675 #define ISDN_CTYPE_COUNT 41
8676
8677
8678 @@ -1267,10 +1264,6 @@ struct IsdnCardState {
8679 #define CARD_NETJET_U 0
8680 #endif
8681
8682 -#ifdef CONFIG_HISAX_ENTERNOW_PCI
8683 -#define CARD_FN_ENTERNOW_PCI 1
8684 -#endif
8685 -
8686 #define TEI_PER_CARD 1
8687
8688 /* L1 Debug */
8689 Index: linux-2.4.35.4/drivers/isdn/hisax/hisax_debug.h
8690 ===================================================================
8691 --- linux-2.4.35.4.orig/drivers/isdn/hisax/hisax_debug.h
8692 +++ linux-2.4.35.4/drivers/isdn/hisax/hisax_debug.h
8693 @@ -28,7 +28,7 @@
8694
8695 #define DBG(level, format, arg...) do { \
8696 if (level & __debug_variable) \
8697 -printk(KERN_DEBUG "%s: " format "\n" , __FUNCTION__ , ## arg); \
8698 +printk(KERN_DEBUG __FUNCTION__ ": " format "\n" , ## arg); \
8699 } while (0)
8700
8701 #define DBG_PACKET(level,data,count) \
8702 Index: linux-2.4.35.4/drivers/isdn/hisax/hisax_fcpcipnp.c
8703 ===================================================================
8704 --- linux-2.4.35.4.orig/drivers/isdn/hisax/hisax_fcpcipnp.c
8705 +++ linux-2.4.35.4/drivers/isdn/hisax/hisax_fcpcipnp.c
8706 @@ -20,22 +20,19 @@
8707 *
8708 * o POWER PC
8709 * o clean up debugging
8710 - * o tx_skb at PH_DEACTIVATE time
8711 */
8712
8713 #include <linux/version.h>
8714 #include <linux/module.h>
8715 #include <linux/init.h>
8716 #include <linux/pci.h>
8717 -#include <linux/isapnp.h>
8718 +#include "hisax_isapnp.h"
8719 #include <linux/kmod.h>
8720 #include <linux/slab.h>
8721 #include <linux/skbuff.h>
8722 #include <linux/netdevice.h>
8723 -
8724 -#include <asm/io.h>
8725 -
8726 #include "hisax_fcpcipnp.h"
8727 +#include "hisax_isac.h"
8728
8729 // debugging cruft
8730 #define __debug_variable debug
8731 @@ -46,10 +43,14 @@ static int debug = 0;
8732 MODULE_PARM(debug, "i");
8733 #endif
8734
8735 -MODULE_AUTHOR("Kai Germaschewski <kai.germaschewski@gmx.de>/Karsten Keil <kkeil@suse.de>");
8736 +MODULE_AUTHOR("Kai Germaschewski <kai.germaschewski@gmx.de>");
8737 MODULE_DESCRIPTION("AVM Fritz!PCI/PnP ISDN driver");
8738
8739 -static struct pci_device_id fcpci_ids[] __devinitdata = {
8740 +#ifndef PCI_DEVICE_ID_AVM_A1_V2
8741 +#define PCI_DEVICE_ID_AVM_A1_V2 0x0e00
8742 +#endif
8743 +
8744 +static struct pci_device_id fcpci_ids[] __initdata = {
8745 { PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_A1 , PCI_ANY_ID, PCI_ANY_ID,
8746 0, 0, (unsigned long) "Fritz!Card PCI" },
8747 { PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_A1_V2, PCI_ANY_ID, PCI_ANY_ID,
8748 @@ -58,7 +59,7 @@ static struct pci_device_id fcpci_ids[]
8749 };
8750 MODULE_DEVICE_TABLE(pci, fcpci_ids);
8751
8752 -static struct isapnp_device_id fcpnp_ids[] __devinitdata = {
8753 +static struct isapnp_device_id fcpnp_ids[] __initdata = {
8754 { ISAPNP_VENDOR('A', 'V', 'M'), ISAPNP_FUNCTION(0x0900),
8755 ISAPNP_VENDOR('A', 'V', 'M'), ISAPNP_FUNCTION(0x0900),
8756 (unsigned long) "Fritz!Card PnP" },
8757 @@ -68,7 +69,8 @@ MODULE_DEVICE_TABLE(isapnp, fcpnp_ids);
8758
8759 static int protocol = 2; /* EURO-ISDN Default */
8760 MODULE_PARM(protocol, "i");
8761 -MODULE_LICENSE("GPL");
8762 +
8763 +static LIST_HEAD(adapter_list);
8764
8765 // ----------------------------------------------------------------------
8766
8767 @@ -147,7 +149,7 @@ static unsigned char fcpci_read_isac(str
8768 outb(idx, adapter->io + AVM_INDEX);
8769 val = inb(adapter->io + AVM_DATA + (offset & 0xf));
8770 spin_unlock_irqrestore(&adapter->hw_lock, flags);
8771 - DBG(0x1000, " port %#x, value %#x",
8772 + DBG(0x1000, __FUNCTION__ " port %#x, value %#x",
8773 offset, val);
8774 return val;
8775 }
8776 @@ -160,7 +162,7 @@ static void fcpci_write_isac(struct isac
8777 AVM_IDX_ISAC_REG_HIGH : AVM_IDX_ISAC_REG_LOW;
8778 unsigned long flags;
8779
8780 - DBG(0x1000, " port %#x, value %#x",
8781 + DBG(0x1000, __FUNCTION__ " port %#x, value %#x",
8782 offset, value);
8783 spin_lock_irqsave(&adapter->hw_lock, flags);
8784 outb(idx, adapter->io + AVM_INDEX);
8785 @@ -240,7 +242,7 @@ static unsigned char fcpci2_read_isac(st
8786 outl(offset, adapter->io + AVM_ISACSX_INDEX);
8787 val = inl(adapter->io + AVM_ISACSX_DATA);
8788 spin_unlock_irqrestore(&adapter->hw_lock, flags);
8789 - DBG(0x1000, " port %#x, value %#x",
8790 + DBG(0x1000, __FUNCTION__ " port %#x, value %#x",
8791 offset, val);
8792
8793 return val;
8794 @@ -252,7 +254,7 @@ static void fcpci2_write_isac(struct isa
8795 struct fritz_adapter *adapter = isac->priv;
8796 unsigned long flags;
8797
8798 - DBG(0x1000, " port %#x, value %#x",
8799 + DBG(0x1000, __FUNCTION__ " port %#x, value %#x",
8800 offset, value);
8801 spin_lock_irqsave(&adapter->hw_lock, flags);
8802 outl(offset, adapter->io + AVM_ISACSX_INDEX);
8803 @@ -375,6 +377,9 @@ static void hdlc_fill_fifo(struct fritz_
8804
8805 DBG(0x40, "hdlc_fill_fifo");
8806
8807 + if (!skb)
8808 + BUG();
8809 +
8810 if (skb->len == 0)
8811 BUG();
8812
8813 @@ -515,7 +520,6 @@ static inline void hdlc_xdu_irq(struct f
8814 }
8815 skb_push(bcs->tx_skb, bcs->tx_cnt);
8816 bcs->tx_cnt = 0;
8817 - hdlc_fill_fifo(bcs);
8818 }
8819
8820 static inline void hdlc_xpr_irq(struct fritz_bcs *bcs)
8821 @@ -536,7 +540,7 @@ static inline void hdlc_xpr_irq(struct f
8822 dev_kfree_skb_irq(skb);
8823 }
8824
8825 -static void hdlc_irq_one(struct fritz_bcs *bcs, u32 stat)
8826 +static void hdlc_irq(struct fritz_bcs *bcs, u32 stat)
8827 {
8828 DBG(0x10, "ch%d stat %#x", bcs->channel, stat);
8829 if (stat & HDLC_INT_RPR) {
8830 @@ -553,7 +557,7 @@ static void hdlc_irq_one(struct fritz_bc
8831 }
8832 }
8833
8834 -static inline void hdlc_irq(struct fritz_adapter *adapter)
8835 +static inline void hdlc_interrupt(struct fritz_adapter *adapter)
8836 {
8837 int nr;
8838 u32 stat;
8839 @@ -562,7 +566,7 @@ static inline void hdlc_irq(struct fritz
8840 stat = adapter->read_hdlc_status(adapter, nr);
8841 DBG(0x10, "HDLC %c stat %#x", 'A' + nr, stat);
8842 if (stat & HDLC_INT_MASK)
8843 - hdlc_irq_one(&adapter->bcs[nr], stat);
8844 + hdlc_irq(&adapter->bcs[nr], stat);
8845 }
8846 }
8847
8848 @@ -584,14 +588,14 @@ static void modehdlc(struct fritz_bcs *b
8849 adapter->write_ctrl(bcs, 5);
8850 break;
8851 case L1_MODE_TRANS:
8852 + bcs->ctrl.sr.mode = HDLC_MODE_TRANS;
8853 + adapter->write_ctrl(bcs, 5);
8854 + bcs->ctrl.sr.cmd = HDLC_CMD_XRS;
8855 + adapter->write_ctrl(bcs, 1);
8856 + bcs->ctrl.sr.cmd = 0;
8857 + break;
8858 case L1_MODE_HDLC:
8859 - bcs->rcvidx = 0;
8860 - bcs->tx_cnt = 0;
8861 - bcs->tx_skb = NULL;
8862 - if (mode == L1_MODE_TRANS)
8863 - bcs->ctrl.sr.mode = HDLC_MODE_TRANS;
8864 - else
8865 - bcs->ctrl.sr.mode = HDLC_MODE_ITF_FLG;
8866 + bcs->ctrl.sr.mode = HDLC_MODE_ITF_FLG;
8867 adapter->write_ctrl(bcs, 5);
8868 bcs->ctrl.sr.cmd = HDLC_CMD_XRS;
8869 adapter->write_ctrl(bcs, 1);
8870 @@ -645,10 +649,10 @@ static void fcpci2_irq(int intno, void *
8871 return;
8872 DBG(2, "STATUS0 %#x", val);
8873 if (val & AVM_STATUS0_IRQ_ISAC)
8874 - isacsx_irq(&adapter->isac);
8875 + isacsx_interrupt(&adapter->isac);
8876
8877 if (val & AVM_STATUS0_IRQ_HDLC)
8878 - hdlc_irq(adapter);
8879 + hdlc_interrupt(adapter);
8880 }
8881
8882 static void fcpci_irq(int intno, void *dev, struct pt_regs *regs)
8883 @@ -662,10 +666,10 @@ static void fcpci_irq(int intno, void *d
8884 return;
8885 DBG(2, "sval %#x", sval);
8886 if (!(sval & AVM_STATUS0_IRQ_ISAC))
8887 - isac_irq(&adapter->isac);
8888 + isac_interrupt(&adapter->isac);
8889
8890 if (!(sval & AVM_STATUS0_IRQ_HDLC))
8891 - hdlc_irq(adapter);
8892 + hdlc_interrupt(adapter);
8893 }
8894
8895 // ----------------------------------------------------------------------
8896 @@ -681,11 +685,6 @@ static inline void fcpci_init(struct fri
8897 {
8898 outb(AVM_STATUS0_DIS_TIMER | AVM_STATUS0_RES_TIMER |
8899 AVM_STATUS0_ENA_IRQ, adapter->io + AVM_STATUS0);
8900 -
8901 - outb(AVM_STATUS1_ENA_IOM | adapter->irq,
8902 - adapter->io + AVM_STATUS1);
8903 - set_current_state(TASK_UNINTERRUPTIBLE);
8904 - schedule_timeout(50*HZ / 1000); /* Timeout 50ms */
8905 }
8906
8907 // ----------------------------------------------------------------------
8908 @@ -693,6 +692,7 @@ static inline void fcpci_init(struct fri
8909 static int __devinit fcpcipnp_setup(struct fritz_adapter *adapter)
8910 {
8911 u32 val = 0;
8912 + struct pci_dev *pdev = adapter->pci_dev;
8913 int retval;
8914
8915 DBG(1,"");
8916 @@ -700,21 +700,21 @@ static int __devinit fcpcipnp_setup(stru
8917 isac_init(&adapter->isac); // FIXME is this okay now
8918
8919 retval = -EBUSY;
8920 - if (!request_region(adapter->io, 32, "fcpcipnp"))
8921 + if (!request_region(adapter->io, 32, "hisax_fcpcipnp"))
8922 goto err;
8923
8924 switch (adapter->type) {
8925 case AVM_FRITZ_PCIV2:
8926 - retval = request_irq(adapter->irq, fcpci2_irq, SA_SHIRQ,
8927 - "fcpcipnp", adapter);
8928 + retval = request_irq(pdev->irq, fcpci2_irq, SA_SHIRQ,
8929 + "hisax_fcpcipnp", adapter);
8930 break;
8931 case AVM_FRITZ_PCI:
8932 - retval = request_irq(adapter->irq, fcpci_irq, SA_SHIRQ,
8933 - "fcpcipnp", adapter);
8934 + retval = request_irq(pdev->irq, fcpci_irq, SA_SHIRQ,
8935 + "hisax_fcpcipnp", adapter);
8936 break;
8937 case AVM_FRITZ_PNP:
8938 - retval = request_irq(adapter->irq, fcpci_irq, 0,
8939 - "fcpcipnp", adapter);
8940 + retval = request_irq(pdev->irq, fcpci_irq, 0,
8941 + "hisax_fcpcipnp", adapter);
8942 break;
8943 }
8944 if (retval)
8945 @@ -808,11 +808,23 @@ static int __devinit fcpcipnp_setup(stru
8946
8947 static void __devexit fcpcipnp_release(struct fritz_adapter *adapter)
8948 {
8949 + struct pci_dev *pdev = adapter->pci_dev;
8950 +
8951 DBG(1,"");
8952
8953 outb(0, adapter->io + AVM_STATUS0);
8954 - free_irq(adapter->irq, adapter);
8955 + free_irq(pdev->irq, adapter);
8956 release_region(adapter->io, 32);
8957 +
8958 + switch (adapter->type) {
8959 + case AVM_FRITZ_PCI:
8960 + case AVM_FRITZ_PCIV2:
8961 + pci_disable_device(pdev);
8962 + break;
8963 + case AVM_FRITZ_PNP:
8964 + pdev->deactivate(pdev);
8965 + break;
8966 + }
8967 }
8968
8969 // ----------------------------------------------------------------------
8970 @@ -830,6 +842,8 @@ new_adapter(struct pci_dev *pdev)
8971
8972 memset(adapter, 0, sizeof(struct fritz_adapter));
8973
8974 + adapter->pci_dev = pdev;
8975 +
8976 SET_MODULE_OWNER(&adapter->isac.hisax_d_if);
8977 adapter->isac.hisax_d_if.ifc.priv = &adapter->isac;
8978 adapter->isac.hisax_d_if.ifc.l2l1 = isac_d_l2l1;
8979 @@ -840,6 +854,7 @@ new_adapter(struct pci_dev *pdev)
8980 adapter->bcs[i].b_if.ifc.priv = &adapter->bcs[i];
8981 adapter->bcs[i].b_if.ifc.l2l1 = fritz_b_l2l1;
8982 }
8983 + list_add(&adapter->list, &adapter_list);
8984
8985 pci_set_drvdata(pdev, adapter);
8986
8987 @@ -854,6 +869,7 @@ new_adapter(struct pci_dev *pdev)
8988 static void delete_adapter(struct fritz_adapter *adapter)
8989 {
8990 hisax_unregister(&adapter->isac.hisax_d_if);
8991 + list_del(&adapter->list);
8992 kfree(adapter);
8993 }
8994
8995 @@ -863,12 +879,15 @@ static int __devinit fcpci_probe(struct
8996 struct fritz_adapter *adapter;
8997 int retval;
8998
8999 + printk(KERN_INFO "hisax_fcpcipnp: found adapter %s at %s\n",
9000 + (char *) ent->driver_data, pdev->slot_name);
9001 +
9002 retval = -ENOMEM;
9003 adapter = new_adapter(pdev);
9004 if (!adapter)
9005 goto err;
9006
9007 - if (pdev->device == PCI_DEVICE_ID_AVM_A1_V2)
9008 + if (pdev->device == 0x0e00)
9009 adapter->type = AVM_FRITZ_PCIV2;
9010 else
9011 adapter->type = AVM_FRITZ_PCI;
9012 @@ -876,12 +895,7 @@ static int __devinit fcpci_probe(struct
9013 retval = pci_enable_device(pdev);
9014 if (retval)
9015 goto err_free;
9016 -
9017 adapter->io = pci_resource_start(pdev, 1);
9018 - adapter->irq = pdev->irq;
9019 -
9020 - printk(KERN_INFO "hisax_fcpcipnp: found adapter %s at %s\n",
9021 - (char *) ent->driver_data, pdev->slot_name);
9022
9023 retval = fcpcipnp_setup(adapter);
9024 if (retval)
9025 @@ -901,6 +915,9 @@ static int __devinit fcpnp_probe(struct
9026 struct fritz_adapter *adapter;
9027 int retval;
9028
9029 + printk(KERN_INFO "hisax_fcpcipnp: found adapter %s\n",
9030 + (char *) ent->driver_data);
9031 +
9032 retval = -ENOMEM;
9033 adapter = new_adapter(pdev);
9034 if (!adapter)
9035 @@ -912,11 +929,8 @@ static int __devinit fcpnp_probe(struct
9036 pdev->deactivate(pdev); // why?
9037 pdev->activate(pdev);
9038 adapter->io = pdev->resource[0].start;
9039 - adapter->irq = pdev->irq_resource[0].start;
9040 -
9041 - printk(KERN_INFO "hisax_fcpcipnp: found adapter %s at IO %#x irq %d\n",
9042 - (char *) ent->driver_data, adapter->io, adapter->irq);
9043 -
9044 + pdev->irq = pdev->irq_resource[0].start;
9045 +
9046 retval = fcpcipnp_setup(adapter);
9047 if (retval)
9048 goto err_free;
9049 @@ -929,43 +943,35 @@ static int __devinit fcpnp_probe(struct
9050 return retval;
9051 }
9052
9053 -static void __devexit fcpci_remove(struct pci_dev *pdev)
9054 -{
9055 - struct fritz_adapter *adapter = pci_get_drvdata(pdev);
9056 -
9057 - fcpcipnp_release(adapter);
9058 - pci_disable_device(pdev);
9059 - delete_adapter(adapter);
9060 -}
9061 -
9062 -static void __devexit fcpnp_remove(struct pci_dev *pdev)
9063 +static void __devexit fcpcipnp_remove(struct pci_dev *pdev)
9064 {
9065 struct fritz_adapter *adapter = pci_get_drvdata(pdev);
9066
9067 fcpcipnp_release(adapter);
9068 - pdev->deactivate(pdev);
9069 delete_adapter(adapter);
9070 }
9071
9072 static struct pci_driver fcpci_driver = {
9073 - name: "fcpci",
9074 - probe: fcpci_probe,
9075 - remove: __devexit_p(fcpci_remove),
9076 + name: "fcpci",
9077 + probe: fcpci_probe,
9078 + remove: fcpcipnp_remove,
9079 id_table: fcpci_ids,
9080 };
9081
9082 static struct isapnp_driver fcpnp_driver = {
9083 - name: "fcpnp",
9084 - probe: fcpnp_probe,
9085 - remove: __devexit_p(fcpnp_remove),
9086 + name: "fcpnp",
9087 + probe: fcpnp_probe,
9088 + remove: fcpcipnp_remove,
9089 id_table: fcpnp_ids,
9090 };
9091
9092 -static int __init hisax_fcpcipnp_init(void)
9093 +static LIST_HEAD(isapnp_drivers);
9094 +
9095 +static int __init hisax_fcpci_init(void)
9096 {
9097 int retval, pci_nr_found;
9098
9099 - printk(KERN_INFO "hisax_fcpcipnp: Fritz!Card PCI/PCIv2/PnP ISDN driver v0.0.1\n");
9100 + printk(KERN_INFO "hisax_fcpcipnp: Fritz!PCI/PnP ISDN driver v0.0.1\n");
9101
9102 retval = pci_register_driver(&fcpci_driver);
9103 if (retval < 0)
9104 @@ -976,15 +982,14 @@ static int __init hisax_fcpcipnp_init(vo
9105 if (retval < 0)
9106 goto out_unregister_pci;
9107
9108 -#if !defined(CONFIG_HOTPLUG) || defined(MODULE)
9109 +#if !defined(CONFIG_HOTPLUG) && defined(MODULE)
9110 if (pci_nr_found + retval == 0) {
9111 retval = -ENODEV;
9112 goto out_unregister_isapnp;
9113 - }
9114 #endif
9115 return 0;
9116
9117 -#if !defined(CONFIG_HOTPLUG) || defined(MODULE)
9118 +#if !defined(CONFIG_HOTPLUG) && defined(MODULE)
9119 out_unregister_isapnp:
9120 isapnp_unregister_driver(&fcpnp_driver);
9121 #endif
9122 @@ -994,11 +999,15 @@ static int __init hisax_fcpcipnp_init(vo
9123 return retval;
9124 }
9125
9126 -static void __exit hisax_fcpcipnp_exit(void)
9127 +static void __exit hisax_fcpci_exit(void)
9128 {
9129 isapnp_unregister_driver(&fcpnp_driver);
9130 pci_unregister_driver(&fcpci_driver);
9131 }
9132
9133 -module_init(hisax_fcpcipnp_init);
9134 -module_exit(hisax_fcpcipnp_exit);
9135 +module_init(hisax_fcpci_init);
9136 +module_exit(hisax_fcpci_exit);
9137 +
9138 +#ifdef __ISAPNP__
9139 +#include "hisax_isapnp.c"
9140 +#endif
9141 Index: linux-2.4.35.4/drivers/isdn/hisax/hisax_fcpcipnp.h
9142 ===================================================================
9143 --- linux-2.4.35.4.orig/drivers/isdn/hisax/hisax_fcpcipnp.h
9144 +++ linux-2.4.35.4/drivers/isdn/hisax/hisax_fcpcipnp.h
9145 @@ -43,10 +43,12 @@ struct fritz_bcs {
9146 };
9147
9148 struct fritz_adapter {
9149 + struct list_head list;
9150 + struct pci_dev *pci_dev;
9151 +
9152 int type;
9153 spinlock_t hw_lock;
9154 unsigned int io;
9155 - unsigned int irq;
9156 struct isac isac;
9157
9158 struct fritz_bcs bcs[2];
9159 Index: linux-2.4.35.4/drivers/isdn/hisax/hisax_isac.c
9160 ===================================================================
9161 --- linux-2.4.35.4.orig/drivers/isdn/hisax/hisax_isac.c
9162 +++ linux-2.4.35.4/drivers/isdn/hisax/hisax_isac.c
9163 @@ -34,7 +34,7 @@
9164 static int debug = 1;
9165 MODULE_PARM(debug, "i");
9166
9167 -static char *ISACVer[] = {
9168 +static char *ISACVer[] __devinitdata = {
9169 "2086/2186 V1.1",
9170 "2085 B1",
9171 "2085 B2",
9172 @@ -42,10 +42,6 @@ static char *ISACVer[] = {
9173 };
9174 #endif
9175
9176 -MODULE_AUTHOR("Kai Germaschewski <kai.germaschewski@gmx.de>/Karsten Keil <kkeil@suse.de>");
9177 -MODULE_DESCRIPTION("ISAC/ISAC-SX driver");
9178 -MODULE_LICENSE("GPL");
9179 -
9180 #define DBG_WARN 0x0001
9181 #define DBG_IRQ 0x0002
9182 #define DBG_L1M 0x0004
9183 @@ -438,7 +434,7 @@ static void l1m_debug(struct FsmInst *fi
9184 va_end(args);
9185 }
9186
9187 -static void isac_version(struct isac *cs)
9188 +static void __devinit isac_version(struct isac *cs)
9189 {
9190 int val;
9191
9192 @@ -602,7 +598,7 @@ static inline void isac_exi_interrupt(st
9193 }
9194 }
9195
9196 -void isac_irq(struct isac *isac)
9197 +void isac_interrupt(struct isac *isac)
9198 {
9199 unsigned char val;
9200
9201 @@ -635,8 +631,6 @@ void isac_irq(struct isac *isac)
9202 if (val & ISAC_ISTA_SIN) {
9203 DBG(DBG_WARN, "SIN");
9204 }
9205 - isac->write_isac(isac, ISAC_MASK, 0xff);
9206 - isac->write_isac(isac, ISAC_MASK, 0x00);
9207 }
9208
9209 // ======================================================================
9210 @@ -742,7 +736,7 @@ static inline void isacsx_icd_interrupt(
9211 }
9212 }
9213
9214 -void isacsx_irq(struct isac *isac)
9215 +void isacsx_interrupt(struct isac *isac)
9216 {
9217 unsigned char val;
9218
9219 @@ -755,7 +749,7 @@ void isacsx_irq(struct isac *isac)
9220 isacsx_cic_interrupt(isac);
9221 }
9222
9223 -void isac_init(struct isac *isac)
9224 +void __devinit isac_init(struct isac *isac)
9225 {
9226 isac->tx_skb = NULL;
9227 isac->l1m.fsm = &l1fsm;
9228 @@ -770,7 +764,7 @@ void isac_init(struct isac *isac)
9229 FsmInitTimer(&isac->l1m, &isac->timer);
9230 }
9231
9232 -void isac_setup(struct isac *isac)
9233 +void __devinit isac_setup(struct isac *isac)
9234 {
9235 int val, eval;
9236
9237 @@ -781,7 +775,7 @@ void isac_setup(struct isac *isac)
9238
9239 isac->write_isac(isac, ISAC_MASK, 0xff);
9240 isac->mocr = 0xaa;
9241 - if (test_bit(ISAC_IOM1, &isac->flags)) {
9242 + if (test_bit(HW_IOM1, &isac->flags)) {
9243 /* IOM 1 Mode */
9244 isac->write_isac(isac, ISAC_ADF2, 0x0);
9245 isac->write_isac(isac, ISAC_SPCR, 0xa);
9246 @@ -817,7 +811,7 @@ void isac_setup(struct isac *isac)
9247 FsmEvent(&isac->l1m, (val >> 2) & 0xf, NULL);
9248
9249 isac->write_isac(isac, ISAC_MASK, 0x0);
9250 - // RESET Receiver and Transmitter
9251 + /* RESET Receiver and Transmitter */
9252 isac->write_isac(isac, ISAC_CMDR, ISAC_CMDR_XRES | ISAC_CMDR_RRES);
9253 }
9254
9255 @@ -888,10 +882,10 @@ EXPORT_SYMBOL(isac_init);
9256 EXPORT_SYMBOL(isac_d_l2l1);
9257
9258 EXPORT_SYMBOL(isacsx_setup);
9259 -EXPORT_SYMBOL(isacsx_irq);
9260 +EXPORT_SYMBOL(isacsx_interrupt);
9261
9262 EXPORT_SYMBOL(isac_setup);
9263 -EXPORT_SYMBOL(isac_irq);
9264 +EXPORT_SYMBOL(isac_interrupt);
9265
9266 module_init(hisax_isac_init);
9267 module_exit(hisax_isac_exit);
9268 Index: linux-2.4.35.4/drivers/isdn/hisax/hisax_isac.h
9269 ===================================================================
9270 --- linux-2.4.35.4.orig/drivers/isdn/hisax/hisax_isac.h
9271 +++ linux-2.4.35.4/drivers/isdn/hisax/hisax_isac.h
9272 @@ -8,7 +8,7 @@
9273 #define TIMER3_VALUE 7000
9274 #define MAX_DFRAME_LEN_L1 300
9275
9276 -#define ISAC_IOM1 0
9277 +#define HW_IOM1 0
9278
9279 struct isac {
9280 void *priv;
9281 @@ -37,9 +37,9 @@ void isac_init(struct isac *isac);
9282 void isac_d_l2l1(struct hisax_if *hisax_d_if, int pr, void *arg);
9283
9284 void isac_setup(struct isac *isac);
9285 -void isac_irq(struct isac *isac);
9286 +void isac_interrupt(struct isac *isac);
9287
9288 void isacsx_setup(struct isac *isac);
9289 -void isacsx_irq(struct isac *isac);
9290 +void isacsx_interrupt(struct isac *isac);
9291
9292 #endif
9293 Index: linux-2.4.35.4/drivers/isdn/hisax/hisax_isapnp.c
9294 ===================================================================
9295 --- /dev/null
9296 +++ linux-2.4.35.4/drivers/isdn/hisax/hisax_isapnp.c
9297 @@ -0,0 +1,105 @@
9298 +// FIXME copied
9299 +static const struct isapnp_device_id *
9300 +isapnp_match_device(const struct isapnp_device_id *ids, struct pci_dev *dev)
9301 +{
9302 + DBG(1,"");
9303 +
9304 + while (ids->card_vendor || ids->card_device) {
9305 + if ((ids->card_vendor == ISAPNP_ANY_ID || ids->card_vendor == dev->bus->vendor) &&
9306 + (ids->card_device == ISAPNP_ANY_ID || ids->card_device == dev->bus->device) &&
9307 + (ids->vendor == ISAPNP_ANY_ID || ids->vendor == dev->vendor) &&
9308 + (ids->function == ISAPNP_ANY_ID || ids->function == dev->device))
9309 + return ids;
9310 + ids++;
9311 + }
9312 + return NULL;
9313 +}
9314 +
9315 +/**
9316 + * pci_dev_driver - get the pci_driver of a device
9317 + * @dev: the device to query
9318 + *
9319 + * Returns the appropriate pci_driver structure or %NULL if there is no
9320 + * registered driver for the device.
9321 + */
9322 +struct pci_driver *isapnp_dev_driver(const struct pci_dev *dev)
9323 +{
9324 + return dev->driver;
9325 +}
9326 +
9327 +static int isapnp_announce_device(struct isapnp_driver *drv, struct pci_dev *dev)
9328 +{
9329 + const struct isapnp_device_id *id;
9330 + int ret = 0;
9331 +
9332 + DBG(1,"");
9333 +
9334 + if (drv->id_table) {
9335 + id = isapnp_match_device(drv->id_table, dev);
9336 + if (!id) {
9337 + ret = 0;
9338 + goto out;
9339 + }
9340 + } else
9341 + id = NULL;
9342 +
9343 +// dev_probe_lock();
9344 + if (drv->probe(dev, id) >= 0) {
9345 + dev->driver = (struct pci_driver *) drv;
9346 + ret = 1;
9347 + }
9348 +// dev_probe_unlock();
9349 +out:
9350 + return ret;
9351 +}
9352 +
9353 +/**
9354 + * FIXME pci_register_driver - register a new pci driver
9355 + * @drv: the driver structure to register
9356 + *
9357 + * Adds the driver structure to the list of registered drivers
9358 + * Returns the number of pci devices which were claimed by the driver
9359 + * during registration. The driver remains registered even if the
9360 + * return value is zero.
9361 + */
9362 +int isapnp_register_driver(struct isapnp_driver *drv)
9363 +{
9364 + struct pci_dev *dev;
9365 + int count = 0;
9366 +
9367 + DBG(1,"");
9368 +
9369 + list_add_tail(&drv->node, &isapnp_drivers);
9370 + isapnp_for_each_dev(dev) {
9371 + if (!isapnp_dev_driver(dev))
9372 + count += isapnp_announce_device(drv, dev);
9373 + }
9374 + return count;
9375 +}
9376 +
9377 +/**
9378 + * pci_unregister_driver - unregister a pci driver
9379 + * @drv: the driver structure to unregister
9380 + *
9381 + * Deletes the driver structure from the list of registered PCI drivers,
9382 + * gives it a chance to clean up by calling its remove() function for
9383 + * each device it was responsible for, and marks those devices as
9384 + * driverless.
9385 + */
9386 +
9387 +void isapnp_unregister_driver(struct isapnp_driver *drv)
9388 +{
9389 + struct pci_dev *dev;
9390 +
9391 + DBG(1,"");
9392 +
9393 + list_del(&drv->node);
9394 + isapnp_for_each_dev(dev) {
9395 + if (dev->driver == (struct pci_driver *) drv) {
9396 + if (drv->remove)
9397 + drv->remove(dev);
9398 + dev->driver = NULL;
9399 + }
9400 + }
9401 +}
9402 +
9403 Index: linux-2.4.35.4/drivers/isdn/hisax/hisax_isapnp.h
9404 ===================================================================
9405 --- /dev/null
9406 +++ linux-2.4.35.4/drivers/isdn/hisax/hisax_isapnp.h
9407 @@ -0,0 +1,33 @@
9408 +#ifndef __HISAX_ISAPNP_H__
9409 +#define __HISAX_ISAPNP_H__
9410 +
9411 +#include <linux/isapnp.h>
9412 +
9413 +#ifdef COMPAT_NEED_ISAPNP_DRIVER
9414 +struct isapnp_driver {
9415 + struct list_head node;
9416 + char *name;
9417 + const struct isapnp_device_id *id_table; /* NULL if wants all devices */
9418 + int (*probe) (struct pci_dev *dev, const struct isapnp_device_id *id); /* New device inserted */
9419 + void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */
9420 +};
9421 +#endif
9422 +#ifdef __ISAPNP__
9423 +
9424 +int isapnp_register_driver(struct isapnp_driver *drv);
9425 +void isapnp_unregister_driver(struct isapnp_driver *drv);
9426 +
9427 +#else
9428 +
9429 +static inline int isapnp_register_driver(struct isapnp_driver *drv)
9430 +{
9431 + return 0;
9432 +}
9433 +
9434 +static inline void isapnp_unregister_driver(struct isapnp_driver *drv)
9435 +{
9436 +}
9437 +
9438 +#endif
9439 +
9440 +#endif
9441 Index: linux-2.4.35.4/drivers/isdn/hisax/hisax_loadable.h
9442 ===================================================================
9443 --- /dev/null
9444 +++ linux-2.4.35.4/drivers/isdn/hisax/hisax_loadable.h
9445 @@ -0,0 +1,74 @@
9446 +/* $Id: hisax_loadable.h,v 2.1 2001/06/08 22:19:16 werner Exp $
9447 + *
9448 + *
9449 + * Author (C) 2001 Werner Cornelius (werner@isdn-development.de)
9450 + * modular driver for Colognechip HFC-USB chip
9451 + * as plugin for HiSax isdn driver
9452 + *
9453 + * Copyright 2001 by Werner Cornelius (werner@isdn4linux.de)
9454 + *
9455 + * This program is free software; you can redistribute it and/or modify
9456 + * it under the terms of the GNU General Public License as published by
9457 + * the Free Software Foundation; either version 2, or (at your option)
9458 + * any later version.
9459 + *
9460 + * This program is distributed in the hope that it will be useful,
9461 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
9462 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9463 + * GNU General Public License for more details.
9464 + *
9465 + * You should have received a copy of the GNU General Public License
9466 + * along with this program; if not, write to the Free Software
9467 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
9468 + *
9469 + */
9470 +
9471 +#include <linux/types.h>
9472 +#include <linux/skbuff.h>
9473 +
9474 +/***************************************/
9475 +/* additional defines for l1 constants */
9476 +/***************************************/
9477 +#define B1_DATA 0x1f0
9478 +#define B1_SETMODE 0x1f4
9479 +#define B2_DATA 0x1f8
9480 +#define B2_SETMODE 0x1fc
9481 +
9482 +
9483 +/********************************************************/
9484 +/* structure used for register and release of L1 driver */
9485 +/********************************************************/
9486 +struct hisax_drvreg {
9487 + int version; /* actual version for check */
9488 + int cmd; /* command code */
9489 +
9490 + /* function pointers set by hisax during register call */
9491 + void (*release_driver) (void *arg_hisax); /* set by hisax, release function for driver */
9492 + void (*dch_l1l2) (void *arg_hisax, int pr, void *arg); /* set by hisax, notify dch+l1 events */
9493 + void (*bch_l1l2) (void *arg_hisax, int chan, int pr, void *arg); /* set by hisax, notify bch events */
9494 + void *arg_hisax; /* argument when calling hisax main */
9495 + struct sk_buff_head *drq; /* pointer to D-receive queue */
9496 + struct sk_buff_head *dsq; /* pointer to D-send queue */
9497 + struct sk_buff_head erq; /* E-receive queue */
9498 + struct sk_buff_head *brq[2]; /* pointer to B-receive queues */
9499 + struct sk_buff **bsk[2]; /* pointer to B-transmit buffer */
9500 +
9501 + /* function pointers set by l1 driver before calling the register function */
9502 + void (*dch_l2l1) (void *argl1, int pr, void *arg); /* function dch+l1 from hisax -> l1 */
9503 + void (*bch_l2l1) (void *argl1, int chan, int pr, void *arg); /* function bch from hisax -> l1 */
9504 + void *argl1; /* pointer to l1 data structure when calling l1 */
9505 +
9506 + char *drvname; /* driver name for hisax usage */
9507 +};
9508 +
9509 +/**************************/
9510 +/* constants and commands */
9511 +/**************************/
9512 +#define HISAX_LOAD_VERSION 4 /* change when interface changes */
9513 +#define HISAX_LOAD_CHKVER 0 /* check version command (returns 0 on success) */
9514 +#define HISAX_LOAD_REGISTER 1 /* register the L1 driver and return 0 on success */
9515 +
9516 +/***************************************/
9517 +/* definition of the register function */
9518 +/***************************************/
9519 +extern int hisax_register_hfcusb(struct hisax_drvreg *l1drv);
9520 Index: linux-2.4.35.4/drivers/isdn/hisax/hscx.c
9521 ===================================================================
9522 --- linux-2.4.35.4.orig/drivers/isdn/hisax/hscx.c
9523 +++ linux-2.4.35.4/drivers/isdn/hisax/hscx.c
9524 @@ -1,4 +1,4 @@
9525 -/* $Id: hscx.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9526 +/* $Id: hscx.c,v 1.24 2001/09/24 13:22:56 kai Exp $
9527 *
9528 * HSCX specific routines
9529 *
9530 Index: linux-2.4.35.4/drivers/isdn/hisax/hscx.h
9531 ===================================================================
9532 --- linux-2.4.35.4.orig/drivers/isdn/hisax/hscx.h
9533 +++ linux-2.4.35.4/drivers/isdn/hisax/hscx.h
9534 @@ -1,4 +1,4 @@
9535 -/* $Id: hscx.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9536 +/* $Id: hscx.h,v 1.8 2001/09/24 13:22:56 kai Exp $
9537 *
9538 * HSCX specific defines
9539 *
9540 Index: linux-2.4.35.4/drivers/isdn/hisax/hscx_irq.c
9541 ===================================================================
9542 --- linux-2.4.35.4.orig/drivers/isdn/hisax/hscx_irq.c
9543 +++ linux-2.4.35.4/drivers/isdn/hisax/hscx_irq.c
9544 @@ -1,4 +1,4 @@
9545 -/* $Id: hscx_irq.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9546 +/* $Id: hscx_irq.c,v 1.18 2001/09/24 13:22:56 kai Exp $
9547 *
9548 * low level b-channel stuff for Siemens HSCX
9549 *
9550 Index: linux-2.4.35.4/drivers/isdn/hisax/icc.c
9551 ===================================================================
9552 --- linux-2.4.35.4.orig/drivers/isdn/hisax/icc.c
9553 +++ linux-2.4.35.4/drivers/isdn/hisax/icc.c
9554 @@ -1,4 +1,4 @@
9555 -/* $Id: icc.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9556 +/* $Id: icc.c,v 1.8 2001/09/24 13:22:56 kai Exp $
9557 *
9558 * ICC specific routines
9559 *
9560 Index: linux-2.4.35.4/drivers/isdn/hisax/icc.h
9561 ===================================================================
9562 --- linux-2.4.35.4.orig/drivers/isdn/hisax/icc.h
9563 +++ linux-2.4.35.4/drivers/isdn/hisax/icc.h
9564 @@ -1,4 +1,4 @@
9565 -/* $Id: icc.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9566 +/* $Id: icc.h,v 1.4 2001/09/24 13:22:56 kai Exp $
9567 *
9568 * ICC specific routines
9569 *
9570 Index: linux-2.4.35.4/drivers/isdn/hisax/ipac.h
9571 ===================================================================
9572 --- linux-2.4.35.4.orig/drivers/isdn/hisax/ipac.h
9573 +++ linux-2.4.35.4/drivers/isdn/hisax/ipac.h
9574 @@ -1,4 +1,4 @@
9575 -/* $Id: ipac.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9576 +/* $Id: ipac.h,v 1.7 2001/09/24 13:22:56 kai Exp $
9577 *
9578 * IPAC specific defines
9579 *
9580 Index: linux-2.4.35.4/drivers/isdn/hisax/isac.c
9581 ===================================================================
9582 --- linux-2.4.35.4.orig/drivers/isdn/hisax/isac.c
9583 +++ linux-2.4.35.4/drivers/isdn/hisax/isac.c
9584 @@ -1,4 +1,4 @@
9585 -/* $Id: isac.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9586 +/* $Id: isac.c,v 1.31 2001/09/24 13:22:56 kai Exp $
9587 *
9588 * ISAC specific routines
9589 *
9590 Index: linux-2.4.35.4/drivers/isdn/hisax/isac.h
9591 ===================================================================
9592 --- linux-2.4.35.4.orig/drivers/isdn/hisax/isac.h
9593 +++ linux-2.4.35.4/drivers/isdn/hisax/isac.h
9594 @@ -1,4 +1,4 @@
9595 -/* $Id: isac.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9596 +/* $Id: isac.h,v 1.9 2001/09/24 13:22:56 kai Exp $
9597 *
9598 * ISAC specific defines
9599 *
9600 Index: linux-2.4.35.4/drivers/isdn/hisax/isar.c
9601 ===================================================================
9602 --- linux-2.4.35.4.orig/drivers/isdn/hisax/isar.c
9603 +++ linux-2.4.35.4/drivers/isdn/hisax/isar.c
9604 @@ -1,4 +1,4 @@
9605 -/* $Id: isar.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9606 +/* $Id: isar.c,v 1.22 2001/09/23 12:00:05 keil Exp $
9607 *
9608 * isar.c ISAR (Siemens PSB 7110) specific routines
9609 *
9610 @@ -21,12 +21,10 @@
9611 #define DLE 0x10
9612 #define ETX 0x03
9613
9614 -#define FAXMODCNT 13
9615 -const u_char faxmodulation[] = {3,24,48,72,73,74,96,97,98,121,122,145,146};
9616 -static u_int modmask = 0x1fff;
9617 -static int frm_extra_delay = 2;
9618 -static int para_TOA = 6;
9619 -const u_char *FC1_CMD[] = {"FAE", "FTS", "FRS", "FTM", "FRM", "FTH", "FRH", "CTRL" };
9620 +
9621 +const u_char faxmodulation_s[] = "3,24,48,72,73,74,96,97,98,121,122,145,146";
9622 +const u_char faxmodulation[] = {3,24,48,72,73,74,96,97,98,121,122,145,146};
9623 +#define FAXMODCNT 13
9624
9625 void isar_setup(struct IsdnCardState *cs);
9626 static void isar_pump_cmd(struct BCState *bcs, u_char cmd, u_char para);
9627 @@ -127,7 +125,7 @@ get_irq_infos(struct IsdnCardState *cs,
9628 ireg->clsb = cs->BC_Read_Reg(cs, 1, ISAR_CTRL_L);
9629 #if DUMP_MBOXFRAME
9630 if (cs->debug & L1_DEB_HSCX)
9631 - debugl1(cs, "irq_stat(%02x,%02x,%d)", ireg->iis, ireg->cmsb,
9632 + debugl1(cs, "rcv_mbox(%02x,%02x,%d)", ireg->iis, ireg->cmsb,
9633 ireg->clsb);
9634 #endif
9635 }
9636 @@ -414,7 +412,6 @@ isar_load_firmware(struct IsdnCardState
9637 }
9638 cs->debug = debug;
9639 isar_setup(cs);
9640 -
9641 ret = 0;
9642 reterrflg:
9643 restore_flags(flags);
9644 @@ -428,21 +425,6 @@ reterror:
9645 return(ret);
9646 }
9647
9648 -static inline void
9649 -ll_deliver_faxstat(struct BCState *bcs, u_char status)
9650 -{
9651 - isdn_ctrl ic;
9652 - struct Channel *chanp = (struct Channel *) bcs->st->lli.userdata;
9653 -
9654 - if (bcs->cs->debug & L1_DEB_HSCX)
9655 - debugl1(bcs->cs, "HL->LL FAXIND %x", status);
9656 - ic.driver = bcs->cs->myid;
9657 - ic.command = ISDN_STAT_FAXIND;
9658 - ic.arg = chanp->chan;
9659 - ic.parm.aux.cmd = status;
9660 - bcs->cs->iif.statcallb(&ic);
9661 -}
9662 -
9663 extern void BChannel_bh(struct BCState *);
9664 #define B_LL_NOCARRIER 8
9665 #define B_LL_CONNECT 9
9666 @@ -599,6 +581,7 @@ isar_rcv_frame(struct IsdnCardState *cs,
9667 if (ireg->cmsb & SART_NMD) { /* ABORT */
9668 if (cs->debug & L1_DEB_WARN)
9669 debugl1(cs, "isar_rcv_frame: no more data");
9670 + cs->BC_Write_Reg(cs, 1, ISAR_IIA, 0);
9671 bcs->hw.isar.rcvidx = 0;
9672 send_DLE_ETX(bcs);
9673 sendmsg(cs, SET_DPS(bcs->hw.isar.dpath) |
9674 @@ -609,6 +592,7 @@ isar_rcv_frame(struct IsdnCardState *cs,
9675 }
9676 } else {
9677 printk(KERN_WARNING "HiSax: skb out of memory\n");
9678 + cs->BC_Write_Reg(cs, 1, ISAR_IIA, 0);
9679 }
9680 break;
9681 }
9682 @@ -633,9 +617,8 @@ isar_rcv_frame(struct IsdnCardState *cs,
9683 bcs->hw.isar.rcvidx = 0;
9684 cs->BC_Write_Reg(cs, 1, ISAR_IIA, 0);
9685 } else {
9686 - if (ireg->cmsb & HDLC_FSD) {
9687 + if (ireg->cmsb & HDLC_FSD)
9688 bcs->hw.isar.rcvidx = 0;
9689 - }
9690 ptr = bcs->hw.isar.rcvbuf + bcs->hw.isar.rcvidx;
9691 bcs->hw.isar.rcvidx += ireg->clsb;
9692 rcv_mbox(cs, ireg, ptr);
9693 @@ -646,8 +629,6 @@ isar_rcv_frame(struct IsdnCardState *cs,
9694 if (cs->debug & L1_DEB_WARN)
9695 debugl1(cs, "isar frame to short %d",
9696 bcs->hw.isar.rcvidx);
9697 - printk(KERN_WARNING "ISAR: frame to short %d\n",
9698 - bcs->hw.isar.rcvidx);
9699 } else if (!(skb = dev_alloc_skb(bcs->hw.isar.rcvidx))) {
9700 printk(KERN_WARNING "ISAR: receive out of memory\n");
9701 } else {
9702 @@ -658,7 +639,6 @@ isar_rcv_frame(struct IsdnCardState *cs,
9703 isar_sched_event(bcs, B_RCVBUFREADY);
9704 send_DLE_ETX(bcs);
9705 isar_sched_event(bcs, B_LL_OK);
9706 - test_and_clear_bit(BC_FLG_FRH_WAIT, &bcs->Flag);
9707 }
9708 bcs->hw.isar.rcvidx = 0;
9709 }
9710 @@ -666,14 +646,13 @@ isar_rcv_frame(struct IsdnCardState *cs,
9711 if (ireg->cmsb & SART_NMD) { /* ABORT */
9712 if (cs->debug & L1_DEB_WARN)
9713 debugl1(cs, "isar_rcv_frame: no more data");
9714 + cs->BC_Write_Reg(cs, 1, ISAR_IIA, 0);
9715 bcs->hw.isar.rcvidx = 0;
9716 + send_DLE_ETX(bcs);
9717 sendmsg(cs, SET_DPS(bcs->hw.isar.dpath) |
9718 ISAR_HIS_PUMPCTRL, PCTRL_CMD_ESC, 0, NULL);
9719 bcs->hw.isar.state = STFAX_ESCAPE;
9720 - if (test_and_clear_bit(BC_FLG_FRH_WAIT, &bcs->Flag)) {
9721 - send_DLE_ETX(bcs);
9722 - isar_sched_event(bcs, B_LL_NOCARRIER);
9723 - }
9724 + isar_sched_event(bcs, B_LL_NOCARRIER);
9725 }
9726 break;
9727 default:
9728 @@ -977,6 +956,21 @@ isar_pump_statev_modem(struct BCState *b
9729 }
9730 }
9731
9732 +static inline void
9733 +ll_deliver_faxstat(struct BCState *bcs, u_char status)
9734 +{
9735 + isdn_ctrl ic;
9736 + struct Channel *chanp = (struct Channel *) bcs->st->lli.userdata;
9737 +
9738 + if (bcs->cs->debug & L1_DEB_HSCX)
9739 + debugl1(bcs->cs, "HL->LL FAXIND %x", status);
9740 + ic.driver = bcs->cs->myid;
9741 + ic.command = ISDN_STAT_FAXIND;
9742 + ic.arg = chanp->chan;
9743 + ic.parm.aux.cmd = status;
9744 + bcs->cs->iif.statcallb(&ic);
9745 +}
9746 +
9747 static void
9748 isar_pump_statev_fax(struct BCState *bcs, u_char devt) {
9749 struct IsdnCardState *cs = bcs->cs;
9750 @@ -1081,22 +1075,19 @@ isar_pump_statev_fax(struct BCState *bcs
9751 if (cs->debug & L1_DEB_HSCX)
9752 debugl1(cs, "pump stev RSP_DISC");
9753 if (bcs->hw.isar.state == STFAX_ESCAPE) {
9754 - p1 = 5;
9755 switch(bcs->hw.isar.newcmd) {
9756 case 0:
9757 bcs->hw.isar.state = STFAX_READY;
9758 break;
9759 - case PCTRL_CMD_FTM:
9760 - p1 = 2;
9761 case PCTRL_CMD_FTH:
9762 + case PCTRL_CMD_FTM:
9763 + p1 = 10;
9764 sendmsg(cs, dps | ISAR_HIS_PUMPCTRL,
9765 PCTRL_CMD_SILON, 1, &p1);
9766 bcs->hw.isar.state = STFAX_SILDET;
9767 break;
9768 - case PCTRL_CMD_FRM:
9769 - if (frm_extra_delay)
9770 - mdelay(frm_extra_delay);
9771 case PCTRL_CMD_FRH:
9772 + case PCTRL_CMD_FRM:
9773 p1 = bcs->hw.isar.mod = bcs->hw.isar.newmod;
9774 bcs->hw.isar.newmod = 0;
9775 bcs->hw.isar.cmd = bcs->hw.isar.newcmd;
9776 @@ -1215,9 +1206,6 @@ isar_int_main(struct IsdnCardState *cs)
9777 isar_pump_statev_modem(bcs, ireg->cmsb);
9778 } else if (bcs->mode == L1_MODE_FAX) {
9779 isar_pump_statev_fax(bcs, ireg->cmsb);
9780 - } else if (ireg->cmsb == PSEV_10MS_TIMER) {
9781 - if (cs->debug & L1_DEB_HSCX)
9782 - debugl1(cs, "pump stev TIMER");
9783 } else {
9784 if (cs->debug & L1_DEB_WARN)
9785 debugl1(cs, "isar IIS_PSTEV pmode %d stat %x",
9786 @@ -1278,9 +1266,6 @@ ftimer_handler(struct BCState *bcs) {
9787 if (test_and_clear_bit(BC_FLG_LL_CONN, &bcs->Flag)) {
9788 isar_sched_event(bcs, B_LL_CONNECT);
9789 }
9790 - if (test_and_clear_bit(BC_FLG_FTI_FTS, &bcs->Flag)) {
9791 - isar_sched_event(bcs, B_LL_OK);
9792 - }
9793 }
9794
9795 static void
9796 @@ -1303,7 +1288,7 @@ setup_pump(struct BCState *bcs) {
9797 } else {
9798 param[5] = PV32P6_ATN;
9799 }
9800 - param[0] = para_TOA; /* 6 db */
9801 + param[0] = 6; /* 6 db */
9802 param[1] = PV32P2_V23R | PV32P2_V22A | PV32P2_V22B |
9803 PV32P2_V22C | PV32P2_V21 | PV32P2_BEL;
9804 param[2] = PV32P3_AMOD | PV32P3_V32B | PV32P3_V23B;
9805 @@ -1319,7 +1304,7 @@ setup_pump(struct BCState *bcs) {
9806 } else {
9807 param[1] = PFAXP2_ATN;
9808 }
9809 - param[0] = para_TOA; /* 6 db */
9810 + param[0] = 6; /* 6 db */
9811 sendmsg(cs, dps | ISAR_HIS_PUMPCFG, ctrl, 2, param);
9812 bcs->hw.isar.state = STFAX_NULL;
9813 bcs->hw.isar.newcmd = 0;
9814 @@ -1348,6 +1333,7 @@ setup_sart(struct BCState *bcs) {
9815 "\0\0");
9816 break;
9817 case L1_MODE_HDLC:
9818 + case L1_MODE_FAX:
9819 param[0] = 0;
9820 sendmsg(cs, dps | ISAR_HIS_SARTCFG, SMODE_HDLC, 1,
9821 param);
9822 @@ -1359,9 +1345,6 @@ setup_sart(struct BCState *bcs) {
9823 sendmsg(cs, dps | ISAR_HIS_SARTCFG, ctrl, 2,
9824 param);
9825 break;
9826 - case L1_MODE_FAX:
9827 - /* SART must not configured with FAX */
9828 - break;
9829 }
9830 udelay(1000);
9831 sendmsg(cs, dps | ISAR_HIS_BSTREQ, 0, 0, NULL);
9832 @@ -1465,7 +1448,6 @@ isar_pump_cmd(struct BCState *bcs, u_cha
9833
9834 switch(cmd) {
9835 case ISDN_FAX_CLASS1_FTM:
9836 - test_and_clear_bit(BC_FLG_FRH_WAIT, &bcs->Flag);
9837 if (bcs->hw.isar.state == STFAX_READY) {
9838 p1 = para;
9839 ctrl = PCTRL_CMD_FTM;
9840 @@ -1489,7 +1471,6 @@ isar_pump_cmd(struct BCState *bcs, u_cha
9841 }
9842 break;
9843 case ISDN_FAX_CLASS1_FTH:
9844 - test_and_clear_bit(BC_FLG_FRH_WAIT, &bcs->Flag);
9845 if (bcs->hw.isar.state == STFAX_READY) {
9846 p1 = para;
9847 ctrl = PCTRL_CMD_FTH;
9848 @@ -1513,7 +1494,6 @@ isar_pump_cmd(struct BCState *bcs, u_cha
9849 }
9850 break;
9851 case ISDN_FAX_CLASS1_FRM:
9852 - test_and_clear_bit(BC_FLG_FRH_WAIT, &bcs->Flag);
9853 if (bcs->hw.isar.state == STFAX_READY) {
9854 p1 = para;
9855 ctrl = PCTRL_CMD_FRM;
9856 @@ -1537,7 +1517,6 @@ isar_pump_cmd(struct BCState *bcs, u_cha
9857 }
9858 break;
9859 case ISDN_FAX_CLASS1_FRH:
9860 - test_and_set_bit(BC_FLG_FRH_WAIT, &bcs->Flag);
9861 if (bcs->hw.isar.state == STFAX_READY) {
9862 p1 = para;
9863 ctrl = PCTRL_CMD_FRH;
9864 @@ -1560,11 +1539,6 @@ isar_pump_cmd(struct BCState *bcs, u_cha
9865 bcs->hw.isar.state = STFAX_ESCAPE;
9866 }
9867 break;
9868 - case ISDN_FAXPUMP_HALT:
9869 - bcs->hw.isar.state = STFAX_NULL;
9870 - nom = 0;
9871 - ctrl = PCTRL_CMD_HALT;
9872 - break;
9873 }
9874 if (ctrl)
9875 sendmsg(cs, dps | ISAR_HIS_PUMPCTRL, ctrl, nom, &p1);
9876 @@ -1658,15 +1632,6 @@ isar_l2l1(struct PStack *st, int pr, voi
9877 l1_msg_b(st, pr, arg);
9878 break;
9879 case (PH_DEACTIVATE | CONFIRM):
9880 - switch(st->l1.mode) {
9881 - case L1_MODE_TRANS:
9882 - case L1_MODE_HDLC:
9883 - case L1_MODE_V32:
9884 - break;
9885 - case L1_MODE_FAX:
9886 - isar_pump_cmd(st->l1.bcs, ISDN_FAXPUMP_HALT, 0);
9887 - break;
9888 - }
9889 test_and_clear_bit(BC_FLG_ACTIV, &st->l1.bcs->Flag);
9890 test_and_clear_bit(BC_FLG_BUSY, &st->l1.bcs->Flag);
9891 if (st->l1.bcs->cs->debug & L1_DEB_HSCX)
9892 @@ -1758,51 +1723,6 @@ isar_auxcmd(struct IsdnCardState *cs, is
9893 test_and_set_bit(BC_FLG_DLEETX,
9894 &bcs->Flag);
9895 break;
9896 - case ISDN_FAX_CLASS1_FTS:
9897 - if (ic->parm.aux.subcmd == AT_QUERY) {
9898 - ic->command = ISDN_STAT_FAXIND;
9899 - ic->parm.aux.cmd = ISDN_FAX_CLASS1_OK;
9900 - cs->iif.statcallb(ic);
9901 - return(0);
9902 - } else if (ic->parm.aux.subcmd == AT_EQ_QUERY) {
9903 - strcpy(ic->parm.aux.para, "0-255");
9904 - ic->command = ISDN_STAT_FAXIND;
9905 - ic->parm.aux.cmd = ISDN_FAX_CLASS1_QUERY;
9906 - cs->iif.statcallb(ic);
9907 - return(0);
9908 - } else if (ic->parm.aux.subcmd == AT_EQ_VALUE) {
9909 - if (cs->debug & L1_DEB_HSCX)
9910 - debugl1(cs, "isar_auxcmd %s=%d",
9911 - FC1_CMD[ic->parm.aux.cmd], ic->parm.aux.para[0]);
9912 - if (bcs->hw.isar.state == STFAX_READY) {
9913 - if (! ic->parm.aux.para[0]) {
9914 - ic->command = ISDN_STAT_FAXIND;
9915 - ic->parm.aux.cmd = ISDN_FAX_CLASS1_OK;
9916 - cs->iif.statcallb(ic);
9917 - return(0);
9918 - }
9919 - if (! test_and_set_bit(BC_FLG_FTI_RUN, &bcs->Flag)) {
9920 - /* n*10 ms */
9921 - bcs->hw.isar.ftimer.expires =
9922 - jiffies + ((ic->parm.aux.para[0] * 10 * HZ)/1000);
9923 - test_and_set_bit(BC_FLG_FTI_FTS, &bcs->Flag);
9924 - add_timer(&bcs->hw.isar.ftimer);
9925 - return(0);
9926 - } else {
9927 - if (cs->debug)
9928 - debugl1(cs, "isar FTS=%d and FTI busy",
9929 - ic->parm.aux.para[0]);
9930 - }
9931 - } else {
9932 - if (cs->debug)
9933 - debugl1(cs, "isar FTS=%d and isar.state not ready(%x)",
9934 - ic->parm.aux.para[0],bcs->hw.isar.state);
9935 - }
9936 - ic->command = ISDN_STAT_FAXIND;
9937 - ic->parm.aux.cmd = ISDN_FAX_CLASS1_ERROR;
9938 - cs->iif.statcallb(ic);
9939 - }
9940 - break;
9941 case ISDN_FAX_CLASS1_FRM:
9942 case ISDN_FAX_CLASS1_FRH:
9943 case ISDN_FAX_CLASS1_FTM:
9944 @@ -1815,24 +1735,16 @@ isar_auxcmd(struct IsdnCardState *cs, is
9945 cs->iif.statcallb(ic);
9946 return(0);
9947 } else if (ic->parm.aux.subcmd == AT_EQ_QUERY) {
9948 - char *p = ic->parm.aux.para;
9949 - for(i=0;i<FAXMODCNT;i++)
9950 - if ((1<<i) & modmask)
9951 - p += sprintf(p, "%d,", faxmodulation[i]);
9952 - p--;
9953 - *p=0;
9954 + strcpy(ic->parm.aux.para, faxmodulation_s);
9955 ic->command = ISDN_STAT_FAXIND;
9956 ic->parm.aux.cmd = ISDN_FAX_CLASS1_QUERY;
9957 cs->iif.statcallb(ic);
9958 return(0);
9959 } else if (ic->parm.aux.subcmd == AT_EQ_VALUE) {
9960 - if (cs->debug & L1_DEB_HSCX)
9961 - debugl1(cs, "isar_auxcmd %s=%d",
9962 - FC1_CMD[ic->parm.aux.cmd], ic->parm.aux.para[0]);
9963 for(i=0;i<FAXMODCNT;i++)
9964 if (faxmodulation[i]==ic->parm.aux.para[0])
9965 break;
9966 - if ((i < FAXMODCNT) && ((1<<i) & modmask) &&
9967 + if ((FAXMODCNT > i) &&
9968 test_bit(BC_FLG_INIT, &bcs->Flag)) {
9969 isar_pump_cmd(bcs,
9970 ic->parm.aux.cmd,
9971 @@ -1850,7 +1762,7 @@ isar_auxcmd(struct IsdnCardState *cs, is
9972 break;
9973 case (ISDN_CMD_IOCTL):
9974 switch (ic->arg) {
9975 - case 9: /* load firmware */
9976 + case (9): /* load firmware */
9977 features = ISDN_FEATURE_L2_MODEM |
9978 ISDN_FEATURE_L2_FAX |
9979 ISDN_FEATURE_L3_FCLASS1;
9980 @@ -1860,26 +1772,6 @@ isar_auxcmd(struct IsdnCardState *cs, is
9981 else
9982 ll_run(cs, features);
9983 break;
9984 - case 20:
9985 - features = *(unsigned int *) ic->parm.num;
9986 - printk(KERN_DEBUG "HiSax: max modulation old(%04x) new(%04x)\n",
9987 - modmask, features);
9988 - modmask = features;
9989 - break;
9990 - case 21:
9991 - features = *(unsigned int *) ic->parm.num;
9992 - printk(KERN_DEBUG "HiSax: FRM extra delay old(%d) new(%d) ms\n",
9993 - frm_extra_delay, features);
9994 - if (features >= 0)
9995 - frm_extra_delay = features;
9996 - break;
9997 - case 22:
9998 - features = *(unsigned int *) ic->parm.num;
9999 - printk(KERN_DEBUG "HiSax: TOA old(%d) new(%d) db\n",
10000 - para_TOA, features);
10001 - if (features >= 0 && features < 32)
10002 - para_TOA = features;
10003 - break;
10004 default:
10005 printk(KERN_DEBUG "HiSax: invalid ioctl %d\n",
10006 (int) ic->arg);
10007 Index: linux-2.4.35.4/drivers/isdn/hisax/isar.h
10008 ===================================================================
10009 --- linux-2.4.35.4.orig/drivers/isdn/hisax/isar.h
10010 +++ linux-2.4.35.4/drivers/isdn/hisax/isar.h
10011 @@ -1,4 +1,4 @@
10012 -/* $Id: isar.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10013 +/* $Id: isar.h,v 1.11 2001/09/24 13:22:56 kai Exp $
10014 *
10015 * ISAR (Siemens PSB 7110) specific defines
10016 *
10017 @@ -28,8 +28,6 @@
10018 #define ISAR_HIS_FIRM 0x1e
10019 #define ISAR_HIS_STDSP 0x08
10020 #define ISAR_HIS_DIAG 0x05
10021 -#define ISAR_HIS_WAITSTATE 0x27
10022 -#define ISAR_HIS_TIMERIRQ 0x25
10023 #define ISAR_HIS_P0CFG 0x3c
10024 #define ISAR_HIS_P12CFG 0x24
10025 #define ISAR_HIS_SARTCFG 0x25
10026 @@ -45,10 +43,6 @@
10027 #define ISAR_HIS_DPS2 0x80
10028 #define SET_DPS(x) ((x<<6) & 0xc0)
10029
10030 -#define ISAR_CMD_TIMERIRQ_OFF 0x20
10031 -#define ISAR_CMD_TIMERIRQ_ON 0x21
10032 -
10033 -
10034 #define ISAR_IIS_MSCMSD 0x3f
10035 #define ISAR_IIS_VNR 0x15
10036 #define ISAR_IIS_DKEY 0x03
10037 @@ -213,8 +207,6 @@
10038 #define STFAX_ESCAPE 5
10039 #define STFAX_SILDET 6
10040
10041 -#define ISDN_FAXPUMP_HALT 100
10042 -
10043 extern int ISARVersion(struct IsdnCardState *cs, char *s);
10044 extern void isar_int_main(struct IsdnCardState *cs);
10045 extern void initisar(struct IsdnCardState *cs);
10046 Index: linux-2.4.35.4/drivers/isdn/hisax/isdnl1.c
10047 ===================================================================
10048 --- linux-2.4.35.4.orig/drivers/isdn/hisax/isdnl1.c
10049 +++ linux-2.4.35.4/drivers/isdn/hisax/isdnl1.c
10050 @@ -1,4 +1,4 @@
10051 -/* $Id: isdnl1.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10052 +/* $Id: isdnl1.c,v 2.46 2001/09/24 13:22:56 kai Exp $
10053 *
10054 * common low level stuff for Siemens Chipsetbased isdn cards
10055 *
10056 @@ -18,7 +18,7 @@
10057 *
10058 */
10059
10060 -const char *l1_revision = "$Revision: 1.1.4.1 $";
10061 +const char *l1_revision = "$Revision: 2.46 $";
10062
10063 #define __NO_VERSION__
10064 #include <linux/init.h>
10065 Index: linux-2.4.35.4/drivers/isdn/hisax/isdnl1.h
10066 ===================================================================
10067 --- linux-2.4.35.4.orig/drivers/isdn/hisax/isdnl1.h
10068 +++ linux-2.4.35.4/drivers/isdn/hisax/isdnl1.h
10069 @@ -1,4 +1,4 @@
10070 -/* $Id: isdnl1.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10071 +/* $Id: isdnl1.h,v 2.12 2001/09/24 13:22:56 kai Exp $
10072 *
10073 * Layer 1 defines
10074 *
10075 Index: linux-2.4.35.4/drivers/isdn/hisax/isdnl2.c
10076 ===================================================================
10077 --- linux-2.4.35.4.orig/drivers/isdn/hisax/isdnl2.c
10078 +++ linux-2.4.35.4/drivers/isdn/hisax/isdnl2.c
10079 @@ -1,4 +1,4 @@
10080 -/* $Id: isdnl2.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10081 +/* $Id: isdnl2.c,v 2.30 2001/09/24 13:22:56 kai Exp $
10082 *
10083 * Author Karsten Keil
10084 * based on the teles driver from Jan den Ouden
10085 @@ -20,7 +20,7 @@
10086 #include "hisax.h"
10087 #include "isdnl2.h"
10088
10089 -const char *l2_revision = "$Revision: 1.1.4.1 $";
10090 +const char *l2_revision = "$Revision: 2.30 $";
10091
10092 static void l2m_debug(struct FsmInst *fi, char *fmt, ...);
10093
10094 @@ -1418,8 +1418,8 @@ l2_st5_tei_remove(struct FsmInst *fi, in
10095 freewin(st);
10096 st->l2.tei = -1;
10097 stop_t200(st, 17);
10098 - st5_dl_release_l2l3(st);
10099 FsmChangeState(fi, ST_L2_1);
10100 + st5_dl_release_l2l3(st);
10101 }
10102
10103 static void
10104 Index: linux-2.4.35.4/drivers/isdn/hisax/isdnl2.h
10105 ===================================================================
10106 --- linux-2.4.35.4.orig/drivers/isdn/hisax/isdnl2.h
10107 +++ linux-2.4.35.4/drivers/isdn/hisax/isdnl2.h
10108 @@ -1,4 +1,4 @@
10109 -/* $Id: isdnl2.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10110 +/* $Id$
10111 *
10112 * Layer 2 defines
10113 *
10114 Index: linux-2.4.35.4/drivers/isdn/hisax/isdnl3.c
10115 ===================================================================
10116 --- linux-2.4.35.4.orig/drivers/isdn/hisax/isdnl3.c
10117 +++ linux-2.4.35.4/drivers/isdn/hisax/isdnl3.c
10118 @@ -1,4 +1,4 @@
10119 -/* $Id: isdnl3.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10120 +/* $Id: isdnl3.c,v 2.22 2001/09/24 13:22:56 kai Exp $
10121 *
10122 * Author Karsten Keil
10123 * based on the teles driver from Jan den Ouden
10124 @@ -21,7 +21,7 @@
10125 #include "isdnl3.h"
10126 #include <linux/config.h>
10127
10128 -const char *l3_revision = "$Revision: 1.1.4.1 $";
10129 +const char *l3_revision = "$Revision: 2.22 $";
10130
10131 static struct Fsm l3fsm;
10132
10133 Index: linux-2.4.35.4/drivers/isdn/hisax/isdnl3.h
10134 ===================================================================
10135 --- linux-2.4.35.4.orig/drivers/isdn/hisax/isdnl3.h
10136 +++ linux-2.4.35.4/drivers/isdn/hisax/isdnl3.h
10137 @@ -1,4 +1,4 @@
10138 -/* $Id: isdnl3.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10139 +/* $Id$
10140 *
10141 * This software may be used and distributed according to the terms
10142 * of the GNU General Public License, incorporated herein by reference.
10143 Index: linux-2.4.35.4/drivers/isdn/hisax/isurf.c
10144 ===================================================================
10145 --- linux-2.4.35.4.orig/drivers/isdn/hisax/isurf.c
10146 +++ linux-2.4.35.4/drivers/isdn/hisax/isurf.c
10147 @@ -1,4 +1,4 @@
10148 -/* $Id: isurf.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10149 +/* $Id: isurf.c,v 1.12 2001/09/24 13:22:56 kai Exp $
10150 *
10151 * low level stuff for Siemens I-Surf/I-Talk cards
10152 *
10153 @@ -16,11 +16,10 @@
10154 #include "isac.h"
10155 #include "isar.h"
10156 #include "isdnl1.h"
10157 -#include <linux/isapnp.h>
10158
10159 extern const char *CardType[];
10160
10161 -static const char *ISurf_revision = "$Revision: 1.1.4.1 $";
10162 +static const char *ISurf_revision = "$Revision: 1.12 $";
10163
10164 #define byteout(addr,val) outb(val,addr)
10165 #define bytein(addr) inb(addr)
10166 @@ -128,8 +127,10 @@ void
10167 release_io_isurf(struct IsdnCardState *cs)
10168 {
10169 release_region(cs->hw.isurf.reset, 1);
10170 +#ifdef COMPAT_HAS_ISA_IOREMAP
10171 iounmap((unsigned char *)cs->hw.isurf.isar);
10172 release_mem_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE);
10173 +#endif
10174 }
10175
10176 static void
10177 @@ -194,10 +195,6 @@ isurf_auxcmd(struct IsdnCardState *cs, i
10178 return(isar_auxcmd(cs, ic));
10179 }
10180
10181 -#ifdef __ISAPNP__
10182 -static struct pci_bus *pnp_surf __devinitdata = NULL;
10183 -#endif
10184 -
10185 int __init
10186 setup_isurf(struct IsdnCard *card)
10187 {
10188 @@ -215,58 +212,9 @@ setup_isurf(struct IsdnCard *card)
10189 cs->hw.isurf.phymem = card->para[2];
10190 cs->irq = card->para[0];
10191 } else {
10192 -#ifdef __ISAPNP__
10193 - struct pci_bus *pb;
10194 - struct pci_dev *pd;
10195 -
10196 - if (isapnp_present()) {
10197 - cs->subtyp = 0;
10198 - if ((pb = isapnp_find_card(
10199 - ISAPNP_VENDOR('S', 'I', 'E'),
10200 - ISAPNP_FUNCTION(0x0010), pnp_surf))) {
10201 - pnp_surf = pb;
10202 - pd = NULL;
10203 - if (!(pd = isapnp_find_dev(pnp_surf,
10204 - ISAPNP_VENDOR('S', 'I', 'E'),
10205 - ISAPNP_FUNCTION(0x0010), pd))) {
10206 - printk(KERN_ERR "ISurfPnP: PnP error card found, no device\n");
10207 - return (0);
10208 - }
10209 - pd->prepare(pd);
10210 - pd->deactivate(pd);
10211 - pd->activate(pd);
10212 - /* The ISA-PnP logic apparently
10213 - * expects upper limit address to be
10214 - * set. Since the isa-pnp module
10215 - * doesn't do this, so we have to make
10216 - * up for it.
10217 - */
10218 - isapnp_cfg_begin(pd->bus->number, pd->devfn);
10219 - isapnp_write_word(ISAPNP_CFG_MEM+3,
10220 - pd->resource[8].end >> 8);
10221 - isapnp_cfg_end();
10222 - cs->hw.isurf.reset = pd->resource[0].start;
10223 - cs->hw.isurf.phymem = pd->resource[8].start;
10224 - cs->irq = pd->irq_resource[0].start;
10225 - if (!cs->irq || !cs->hw.isurf.reset || !cs->hw.isurf.phymem) {
10226 - printk(KERN_ERR "ISurfPnP:some resources are missing %d/%x/%lx\n",
10227 - cs->irq, cs->hw.isurf.reset, cs->hw.isurf.phymem);
10228 - pd->deactivate(pd);
10229 - return(0);
10230 - }
10231 - } else {
10232 - printk(KERN_INFO "ISurfPnP: no ISAPnP card found\n");
10233 - return(0);
10234 - }
10235 - } else {
10236 - printk(KERN_INFO "ISurfPnP: no ISAPnP bus found\n");
10237 - return(0);
10238 - }
10239 -#else
10240 printk(KERN_WARNING "HiSax: %s port/mem not set\n",
10241 CardType[card->typ]);
10242 return (0);
10243 -#endif
10244 }
10245 if (check_region(cs->hw.isurf.reset, 1)) {
10246 printk(KERN_WARNING
10247 @@ -277,6 +225,7 @@ setup_isurf(struct IsdnCard *card)
10248 } else {
10249 request_region(cs->hw.isurf.reset, 1, "isurf isdn");
10250 }
10251 +#ifdef COMPAT_HAS_ISA_IOREMAP
10252 if (check_mem_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE)) {
10253 printk(KERN_WARNING
10254 "HiSax: %s memory region %lx-%lx already in use\n",
10255 @@ -292,6 +241,10 @@ setup_isurf(struct IsdnCard *card)
10256 cs->hw.isurf.isar =
10257 (unsigned long) ioremap(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE);
10258 cs->hw.isurf.isac = cs->hw.isurf.isar + ISURF_ISAC_OFFSET;
10259 +#else
10260 + cs->hw.isurf.isar = cs->hw.isurf.phymem + ISURF_ISAR_OFFSET;
10261 + cs->hw.isurf.isac = cs->hw.isurf.phymem + ISURF_ISAC_OFFSET;
10262 +#endif
10263 printk(KERN_INFO
10264 "ISurf: defined at 0x%x 0x%lx IRQ %d\n",
10265 cs->hw.isurf.reset,
10266 Index: linux-2.4.35.4/drivers/isdn/hisax/ix1_micro.c
10267 ===================================================================
10268 --- linux-2.4.35.4.orig/drivers/isdn/hisax/ix1_micro.c
10269 +++ linux-2.4.35.4/drivers/isdn/hisax/ix1_micro.c
10270 @@ -1,4 +1,4 @@
10271 -/* $Id: ix1_micro.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10272 +/* $Id: ix1_micro.c,v 2.12 2001/09/24 13:22:56 kai Exp $
10273 *
10274 * low level stuff for ITK ix1-micro Rev.2 isdn cards
10275 * derived from the original file teles3.c from Karsten Keil
10276 @@ -19,14 +19,13 @@
10277
10278 #define __NO_VERSION__
10279 #include <linux/init.h>
10280 -#include <linux/isapnp.h>
10281 #include "hisax.h"
10282 #include "isac.h"
10283 #include "hscx.h"
10284 #include "isdnl1.h"
10285
10286 extern const char *CardType[];
10287 -const char *ix1_revision = "$Revision: 1.1.4.1 $";
10288 +const char *ix1_revision = "$Revision: 2.12 $";
10289
10290 #define byteout(addr,val) outb(val,addr)
10291 #define bytein(addr) inb(addr)
10292 @@ -219,21 +218,6 @@ ix1_card_msg(struct IsdnCardState *cs, i
10293 return(0);
10294 }
10295
10296 -#ifdef __ISAPNP__
10297 -static struct isapnp_device_id itk_ids[] __initdata = {
10298 - { ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x25),
10299 - ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x25),
10300 - (unsigned long) "ITK micro 2" },
10301 - { ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x29),
10302 - ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x29),
10303 - (unsigned long) "ITK micro 2." },
10304 - { 0, }
10305 -};
10306 -
10307 -static struct isapnp_device_id *idev = &itk_ids[0];
10308 -static struct pci_bus *pnp_c __devinitdata = NULL;
10309 -#endif
10310 -
10311
10312 int __init
10313 setup_ix1micro(struct IsdnCard *card)
10314 @@ -246,45 +230,6 @@ setup_ix1micro(struct IsdnCard *card)
10315 if (cs->typ != ISDN_CTYPE_IX1MICROR2)
10316 return (0);
10317
10318 -#ifdef __ISAPNP__
10319 - if (!card->para[1] && isapnp_present()) {
10320 - struct pci_bus *pb;
10321 - struct pci_dev *pd;
10322 -
10323 - while(idev->card_vendor) {
10324 - if ((pb = isapnp_find_card(idev->card_vendor,
10325 - idev->card_device, pnp_c))) {
10326 - pnp_c = pb;
10327 - pd = NULL;
10328 - if ((pd = isapnp_find_dev(pnp_c,
10329 - idev->vendor, idev->function, pd))) {
10330 - printk(KERN_INFO "HiSax: %s detected\n",
10331 - (char *)idev->driver_data);
10332 - pd->prepare(pd);
10333 - pd->deactivate(pd);
10334 - pd->activate(pd);
10335 - card->para[1] = pd->resource[0].start;
10336 - card->para[0] = pd->irq_resource[0].start;
10337 - if (!card->para[0] || !card->para[1]) {
10338 - printk(KERN_ERR "ITK PnP:some resources are missing %ld/%lx\n",
10339 - card->para[0], card->para[1]);
10340 - pd->deactivate(pd);
10341 - return(0);
10342 - }
10343 - break;
10344 - } else {
10345 - printk(KERN_ERR "ITK PnP: PnP error card found, no device\n");
10346 - }
10347 - }
10348 - idev++;
10349 - pnp_c=NULL;
10350 - }
10351 - if (!idev->card_vendor) {
10352 - printk(KERN_INFO "ITK PnP: no ISAPnP card found\n");
10353 - return(0);
10354 - }
10355 - }
10356 -#endif
10357 /* IO-Ports */
10358 cs->hw.ix1.isac_ale = card->para[1] + ISAC_COMMAND_OFFSET;
10359 cs->hw.ix1.hscx_ale = card->para[1] + HSCX_COMMAND_OFFSET;
10360 Index: linux-2.4.35.4/drivers/isdn/hisax/jade.c
10361 ===================================================================
10362 --- linux-2.4.35.4.orig/drivers/isdn/hisax/jade.c
10363 +++ linux-2.4.35.4/drivers/isdn/hisax/jade.c
10364 @@ -1,4 +1,4 @@
10365 -/* $Id: jade.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10366 +/* $Id: jade.c,v 1.9 2001/09/24 13:22:56 kai Exp $
10367 *
10368 * JADE stuff (derived from original hscx.c)
10369 *
10370 Index: linux-2.4.35.4/drivers/isdn/hisax/jade.h
10371 ===================================================================
10372 --- linux-2.4.35.4.orig/drivers/isdn/hisax/jade.h
10373 +++ linux-2.4.35.4/drivers/isdn/hisax/jade.h
10374 @@ -1,4 +1,4 @@
10375 -/* $Id: jade.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10376 +/* $Id: jade.h,v 1.5 2001/09/24 13:22:56 kai Exp $
10377 *
10378 * JADE specific defines
10379 *
10380 Index: linux-2.4.35.4/drivers/isdn/hisax/jade_irq.c
10381 ===================================================================
10382 --- linux-2.4.35.4.orig/drivers/isdn/hisax/jade_irq.c
10383 +++ linux-2.4.35.4/drivers/isdn/hisax/jade_irq.c
10384 @@ -1,4 +1,4 @@
10385 -/* $Id: jade_irq.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10386 +/* $Id: jade_irq.c,v 1.7 2001/09/24 13:22:56 kai Exp $
10387 *
10388 * Low level JADE IRQ stuff (derived from original hscx_irq.c)
10389 *
10390 Index: linux-2.4.35.4/drivers/isdn/hisax/l3_1tr6.c
10391 ===================================================================
10392 --- linux-2.4.35.4.orig/drivers/isdn/hisax/l3_1tr6.c
10393 +++ linux-2.4.35.4/drivers/isdn/hisax/l3_1tr6.c
10394 @@ -1,4 +1,4 @@
10395 -/* $Id: l3_1tr6.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10396 +/* $Id: l3_1tr6.c,v 2.15 2001/09/24 13:22:56 kai Exp $
10397 *
10398 * German 1TR6 D-channel protocol
10399 *
10400 @@ -20,7 +20,7 @@
10401 #include <linux/ctype.h>
10402
10403 extern char *HiSax_getrev(const char *revision);
10404 -const char *l3_1tr6_revision = "$Revision: 1.1.4.1 $";
10405 +const char *l3_1tr6_revision = "$Revision: 2.15 $";
10406
10407 #define MsgHead(ptr, cref, mty, dis) \
10408 *ptr++ = dis; \
10409 Index: linux-2.4.35.4/drivers/isdn/hisax/l3_1tr6.h
10410 ===================================================================
10411 --- linux-2.4.35.4.orig/drivers/isdn/hisax/l3_1tr6.h
10412 +++ linux-2.4.35.4/drivers/isdn/hisax/l3_1tr6.h
10413 @@ -1,4 +1,4 @@
10414 -/* $Id: l3_1tr6.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10415 +/* $Id$
10416 *
10417 * German 1TR6 D-channel protocol defines
10418 *
10419 Index: linux-2.4.35.4/drivers/isdn/hisax/l3dss1.c
10420 ===================================================================
10421 --- linux-2.4.35.4.orig/drivers/isdn/hisax/l3dss1.c
10422 +++ linux-2.4.35.4/drivers/isdn/hisax/l3dss1.c
10423 @@ -1,4 +1,4 @@
10424 -/* $Id: l3dss1.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10425 +/* $Id: l3dss1.c,v 2.32 2001/09/24 13:22:56 kai Exp $
10426 *
10427 * EURO/DSS1 D-channel protocol
10428 *
10429 @@ -27,7 +27,7 @@
10430 #include <linux/config.h>
10431
10432 extern char *HiSax_getrev(const char *revision);
10433 -const char *dss1_revision = "$Revision: 1.1.4.1 $";
10434 +const char *dss1_revision = "$Revision: 2.32 $";
10435
10436 #define EXT_BEARER_CAPS 1
10437
10438 Index: linux-2.4.35.4/drivers/isdn/hisax/l3dss1.h
10439 ===================================================================
10440 --- linux-2.4.35.4.orig/drivers/isdn/hisax/l3dss1.h
10441 +++ linux-2.4.35.4/drivers/isdn/hisax/l3dss1.h
10442 @@ -1,4 +1,4 @@
10443 -/* $Id: l3dss1.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10444 +/* $Id$
10445 *
10446 * DSS1 (Euro) D-channel protocol defines
10447 *
10448 Index: linux-2.4.35.4/drivers/isdn/hisax/l3ni1.c
10449 ===================================================================
10450 --- linux-2.4.35.4.orig/drivers/isdn/hisax/l3ni1.c
10451 +++ linux-2.4.35.4/drivers/isdn/hisax/l3ni1.c
10452 @@ -1,4 +1,4 @@
10453 -/* $Id: l3ni1.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10454 +/* $Id: l3ni1.c,v 2.8 2001/09/24 13:22:56 kai Exp $
10455 *
10456 * NI1 D-channel protocol
10457 *
10458 @@ -25,7 +25,7 @@
10459 #include <linux/ctype.h>
10460
10461 extern char *HiSax_getrev(const char *revision);
10462 -const char *ni1_revision = "$Revision: 1.1.4.1 $";
10463 +const char *ni1_revision = "$Revision: 2.8 $";
10464
10465 #define EXT_BEARER_CAPS 1
10466
10467 Index: linux-2.4.35.4/drivers/isdn/hisax/l3ni1.h
10468 ===================================================================
10469 --- linux-2.4.35.4.orig/drivers/isdn/hisax/l3ni1.h
10470 +++ linux-2.4.35.4/drivers/isdn/hisax/l3ni1.h
10471 @@ -1,4 +1,4 @@
10472 -/* $Id: l3ni1.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10473 +/* $Id$
10474 *
10475 * NI1 D-channel protocol
10476 *
10477 Index: linux-2.4.35.4/drivers/isdn/hisax/lmgr.c
10478 ===================================================================
10479 --- linux-2.4.35.4.orig/drivers/isdn/hisax/lmgr.c
10480 +++ linux-2.4.35.4/drivers/isdn/hisax/lmgr.c
10481 @@ -1,4 +1,4 @@
10482 -/* $Id: lmgr.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10483 +/* $Id$
10484 *
10485 * Layermanagement module
10486 *
10487 Index: linux-2.4.35.4/drivers/isdn/hisax/md5sums.asc
10488 ===================================================================
10489 --- linux-2.4.35.4.orig/drivers/isdn/hisax/md5sums.asc
10490 +++ linux-2.4.35.4/drivers/isdn/hisax/md5sums.asc
10491 @@ -1,33 +1,22 @@
10492 ------BEGIN PGP SIGNED MESSAGE-----
10493 -Hash: SHA1
10494 -
10495 # This are valid md5sums for certificated HiSax driver.
10496 # The certification is valid only if the md5sums of all files match.
10497 # The certification is valid only for ELSA Microlink PCI,
10498 -# Eicon Technology Diva 2.01 PCI, Sedlbauer SpeedFax+,
10499 -# HFC-S PCI A based cards and HFC-S USB based ISDN
10500 -# terminal adapters in the moment.
10501 +# Eicon Technology Diva 2.01 PCI, Sedlbauer SpeedFax+,
10502 +# HFC-S PCI A based cards and HFC-S USB based isdn tas
10503 +# in the moment.
10504 # Read ../../../Documentation/isdn/HiSax.cert for more informations.
10505 #
10506 -cd4a9917e1147039d5dfc66440d42054 isac.c
10507 -211840e78b56c9d4753be9c85da21a50 isdnl1.c
10508 -5ce9b1fff42a02f9c2eb4fb81c701b1f isdnl2.c
10509 -6948de0c43513dd23c6706feb5fc2209 isdnl3.c
10510 -3730780b69368218d756024165efea79 tei.c
10511 -16e72710eb58da01415b877490f5d2ac callc.c
10512 -6abc55c77e0f3149ae9334f3257a1a1a cert.c
10513 -27bdb2800d4590e00da20eff241edc47 l3dss1.c
10514 -df8bb877b854c4302d396b554e4e84ef l3_1tr6.c
10515 -9d8b4bed15370063d1b16e47080f50e1 elsa.c
10516 -210f4a3f1eebca70229d786b15cf3e90 diva.c
10517 -4ddf21079dd77e892380f789bae250a7 sedlbauer.c
10518 -8200d818771e3cbdef2a3c3e818d25ac hfc_pci.c
10519 +6f9433a8b696076562562d090e3c420f isac.c
10520 +13c3eed869f5139f44c563e3a8fea1f5 isdnl1.c
10521 +addcff863b0ff1e366c0f2ae9fa6e81e isdnl2.c
10522 +7076deb94a363945c21ea27aca4a720a isdnl3.c
10523 +51c603829b6cc4f8421f744ad657ceff tei.c
10524 +669050ab5079f02887ed0239d86e5474 callc.c
10525 +ecacd146b8f8881ef9349935dab3df4a cert.c
10526 +fadeb3b85bb23bc1ac48470c0848d6fa l3dss1.c
10527 +cf7dec9fac6283716904d26b99188476 l3_1tr6.c
10528 +2f75c8765e1be13d114d5f4433cf364b elsa.c
10529 +b4cf8a4dceed9ea6dcba65a85b4eecc7 diva.c
10530 +dee3f8f40c6fe78a4b57729804b7e6cd sedlbauer.c
10531 +0d79fe6dfc5bfaa4826970c41a6d273d hfc_pci.c
10532 # end of md5sums
10533 ------BEGIN PGP SIGNATURE-----
10534 -Version: GnuPG v1.0.6 (GNU/Linux)
10535 -Comment: For info see http://www.gnupg.org
10536 -
10537 -iD8DBQE9rE91DiY0VZsg4ukRAkKfAJ4xWUfqjc0hW+V+JPue5yr7mrt+RwCdGdSf
10538 -GIKgAEdRLzERmpt/bCCwAbY=
10539 -=FaHw
10540 ------END PGP SIGNATURE-----
10541 Index: linux-2.4.35.4/drivers/isdn/hisax/mic.c
10542 ===================================================================
10543 --- linux-2.4.35.4.orig/drivers/isdn/hisax/mic.c
10544 +++ linux-2.4.35.4/drivers/isdn/hisax/mic.c
10545 @@ -1,4 +1,4 @@
10546 -/* $Id: mic.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10547 +/* $Id: mic.c,v 1.12 2001/09/24 13:22:56 kai Exp $
10548 *
10549 * low level stuff for mic cards
10550 *
10551 @@ -19,7 +19,7 @@
10552
10553 extern const char *CardType[];
10554
10555 -const char *mic_revision = "$Revision: 1.1.4.1 $";
10556 +const char *mic_revision = "$Revision: 1.12 $";
10557
10558 #define byteout(addr,val) outb(val,addr)
10559 #define bytein(addr) inb(addr)
10560 Index: linux-2.4.35.4/drivers/isdn/hisax/netjet.c
10561 ===================================================================
10562 --- linux-2.4.35.4.orig/drivers/isdn/hisax/netjet.c
10563 +++ linux-2.4.35.4/drivers/isdn/hisax/netjet.c
10564 @@ -1,4 +1,4 @@
10565 -/* $Id: netjet.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10566 +/* $Id: netjet.c,v 1.29 2001/09/24 13:22:56 kai Exp $
10567 *
10568 * low level stuff for Traverse Technologie NETJet ISDN cards
10569 *
10570 @@ -8,9 +8,7 @@
10571 * This software may be used and distributed according to the terms
10572 * of the GNU General Public License, incorporated herein by reference.
10573 *
10574 - * Thanks to Traverse Technologies Australia for documents and information
10575 - *
10576 - * 16-Apr-2002 - led code added - Guy Ellis (guy@traverse.com.au)
10577 + * Thanks to Traverse Technologie Australia for documents and information
10578 *
10579 */
10580
10581 @@ -26,7 +24,7 @@
10582 #include <asm/io.h>
10583 #include "netjet.h"
10584
10585 -const char *NETjet_revision = "$Revision: 1.1.4.1 $";
10586 +const char *NETjet_revision = "$Revision: 1.29 $";
10587
10588 /* Interface functions */
10589
10590 @@ -135,7 +133,6 @@ void
10591 mode_tiger(struct BCState *bcs, int mode, int bc)
10592 {
10593 struct IsdnCardState *cs = bcs->cs;
10594 - u_char led;
10595
10596 if (cs->debug & L1_DEB_HSCX)
10597 debugl1(cs, "Tiger mode %d bchan %d/%d",
10598 @@ -157,15 +154,6 @@ mode_tiger(struct BCState *bcs, int mode
10599 cs->hw.njet.dmactrl);
10600 byteout(cs->hw.njet.base + NETJET_IRQMASK0, 0);
10601 }
10602 - if (cs->typ == ISDN_CTYPE_NETJET_S)
10603 - {
10604 - // led off
10605 - led = bc & 0x01;
10606 - led = 0x01 << (6 + led); // convert to mask
10607 - led = ~led;
10608 - cs->hw.njet.auxd &= led;
10609 - byteout(cs->hw.njet.auxa, cs->hw.njet.auxd);
10610 - }
10611 break;
10612 case (L1_MODE_TRANS):
10613 break;
10614 @@ -191,14 +179,6 @@ mode_tiger(struct BCState *bcs, int mode
10615 bcs->hw.tiger.sendp = bcs->hw.tiger.send;
10616 bcs->hw.tiger.free = NETJET_DMA_TXSIZE;
10617 test_and_set_bit(BC_FLG_EMPTY, &bcs->Flag);
10618 - if (cs->typ == ISDN_CTYPE_NETJET_S)
10619 - {
10620 - // led on
10621 - led = bc & 0x01;
10622 - led = 0x01 << (6 + led); // convert to mask
10623 - cs->hw.njet.auxd |= led;
10624 - byteout(cs->hw.njet.auxa, cs->hw.njet.auxd);
10625 - }
10626 break;
10627 }
10628 if (cs->debug & L1_DEB_HSCX)
10629 @@ -874,13 +854,9 @@ tiger_l2l1(struct PStack *st, int pr, vo
10630 case (PH_ACTIVATE | REQUEST):
10631 test_and_set_bit(BC_FLG_ACTIV, &st->l1.bcs->Flag);
10632 mode_tiger(st->l1.bcs, st->l1.mode, st->l1.bc);
10633 - /* 2001/10/04 Christoph Ersfeld, Formula-n Europe AG */
10634 - st->l1.bcs->cs->cardmsg(st->l1.bcs->cs, MDL_BC_ASSIGN, (void *)(&st->l1.bc));
10635 l1_msg_b(st, pr, arg);
10636 break;
10637 case (PH_DEACTIVATE | REQUEST):
10638 - /* 2001/10/04 Christoph Ersfeld, Formula-n Europe AG */
10639 - st->l1.bcs->cs->cardmsg(st->l1.bcs->cs, MDL_BC_RELEASE, (void *)(&st->l1.bc));
10640 l1_msg_b(st, pr, arg);
10641 break;
10642 case (PH_DEACTIVATE | CONFIRM):
10643 Index: linux-2.4.35.4/drivers/isdn/hisax/netjet.h
10644 ===================================================================
10645 --- linux-2.4.35.4.orig/drivers/isdn/hisax/netjet.h
10646 +++ linux-2.4.35.4/drivers/isdn/hisax/netjet.h
10647 @@ -1,4 +1,4 @@
10648 -/* $Id: netjet.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10649 +/* $Id: netjet.h,v 2.8 2001/09/24 13:22:56 kai Exp $
10650 *
10651 * NETjet common header file
10652 *
10653 Index: linux-2.4.35.4/drivers/isdn/hisax/niccy.c
10654 ===================================================================
10655 --- linux-2.4.35.4.orig/drivers/isdn/hisax/niccy.c
10656 +++ linux-2.4.35.4/drivers/isdn/hisax/niccy.c
10657 @@ -1,4 +1,4 @@
10658 -/* $Id: niccy.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10659 +/* $Id: niccy.c,v 1.21 2001/10/20 22:05:00 kai Exp $
10660 *
10661 * low level stuff for Dr. Neuhaus NICCY PnP and NICCY PCI and
10662 * compatible (SAGEM cybermodem)
10663 @@ -22,10 +22,10 @@
10664 #include "hscx.h"
10665 #include "isdnl1.h"
10666 #include <linux/pci.h>
10667 -#include <linux/isapnp.h>
10668 +#include <linux/isdn_compat.h>
10669
10670 extern const char *CardType[];
10671 -const char *niccy_revision = "$Revision: 1.1.4.1 $";
10672 +const char *niccy_revision = "$Revision: 1.21 $";
10673
10674 #define byteout(addr,val) outb(val,addr)
10675 #define bytein(addr) inb(addr)
10676 @@ -239,9 +239,6 @@ niccy_card_msg(struct IsdnCardState *cs,
10677 }
10678
10679 static struct pci_dev *niccy_dev __initdata = NULL;
10680 -#ifdef __ISAPNP__
10681 -static struct pci_bus *pnp_c __devinitdata = NULL;
10682 -#endif
10683
10684 int __init
10685 setup_niccy(struct IsdnCard *card)
10686 @@ -253,39 +250,7 @@ setup_niccy(struct IsdnCard *card)
10687 printk(KERN_INFO "HiSax: Niccy driver Rev. %s\n", HiSax_getrev(tmp));
10688 if (cs->typ != ISDN_CTYPE_NICCY)
10689 return (0);
10690 -#ifdef __ISAPNP__
10691 - if (!card->para[1] && isapnp_present()) {
10692 - struct pci_bus *pb;
10693 - struct pci_dev *pd;
10694 -
10695 - if ((pb = isapnp_find_card(
10696 - ISAPNP_VENDOR('S', 'D', 'A'),
10697 - ISAPNP_FUNCTION(0x0150), pnp_c))) {
10698 - pnp_c = pb;
10699 - pd = NULL;
10700 - if (!(pd = isapnp_find_dev(pnp_c,
10701 - ISAPNP_VENDOR('S', 'D', 'A'),
10702 - ISAPNP_FUNCTION(0x0150), pd))) {
10703 - printk(KERN_ERR "NiccyPnP: PnP error card found, no device\n");
10704 - return (0);
10705 - }
10706 - pd->prepare(pd);
10707 - pd->deactivate(pd);
10708 - pd->activate(pd);
10709 - card->para[1] = pd->resource[0].start;
10710 - card->para[2] = pd->resource[1].start;
10711 - card->para[0] = pd->irq_resource[0].start;
10712 - if (!card->para[0] || !card->para[1] || !card->para[2]) {
10713 - printk(KERN_ERR "NiccyPnP:some resources are missing %ld/%lx/%lx\n",
10714 - card->para[0], card->para[1], card->para[2]);
10715 - pd->deactivate(pd);
10716 - return(0);
10717 - }
10718 - } else {
10719 - printk(KERN_INFO "NiccyPnP: no ISAPnP card found\n");
10720 - }
10721 - }
10722 -#endif
10723 +
10724 if (card->para[1]) {
10725 cs->hw.niccy.isac = card->para[1] + ISAC_PNP;
10726 cs->hw.niccy.hscx = card->para[1] + HSCX_PNP;
10727 @@ -331,12 +296,12 @@ setup_niccy(struct IsdnCard *card)
10728 return(0);
10729 }
10730 cs->irq = niccy_dev->irq;
10731 - cs->hw.niccy.cfg_reg = pci_resource_start(niccy_dev, 0);
10732 + cs->hw.niccy.cfg_reg = pci_resource_start_io(niccy_dev, 0);
10733 if (!cs->hw.niccy.cfg_reg) {
10734 printk(KERN_WARNING "Niccy: No IO-Adr for PCI cfg found\n");
10735 return(0);
10736 }
10737 - pci_ioaddr = pci_resource_start(niccy_dev, 1);
10738 + pci_ioaddr = pci_resource_start_io(niccy_dev, 1);
10739 if (!pci_ioaddr) {
10740 printk(KERN_WARNING "Niccy: No IO-Adr for PCI card found\n");
10741 return(0);
10742 Index: linux-2.4.35.4/drivers/isdn/hisax/nj_s.c
10743 ===================================================================
10744 --- linux-2.4.35.4.orig/drivers/isdn/hisax/nj_s.c
10745 +++ linux-2.4.35.4/drivers/isdn/hisax/nj_s.c
10746 @@ -1,4 +1,4 @@
10747 -/* $Id: nj_s.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10748 +/* $Id: nj_s.c,v 2.13 2001/09/24 13:22:56 kai Exp $
10749 *
10750 * This software may be used and distributed according to the terms
10751 * of the GNU General Public License, incorporated herein by reference.
10752 @@ -12,11 +12,12 @@
10753 #include "isac.h"
10754 #include "isdnl1.h"
10755 #include <linux/pci.h>
10756 +#include <linux/isdn_compat.h>
10757 #include <linux/interrupt.h>
10758 #include <linux/ppp_defs.h>
10759 #include "netjet.h"
10760
10761 -const char *NETjet_S_revision = "$Revision: 1.1.4.1 $";
10762 +const char *NETjet_S_revision = "$Revision: 2.13 $";
10763
10764 static u_char dummyrr(struct IsdnCardState *cs, int chan, u_char off)
10765 {
10766 @@ -130,7 +131,6 @@ NETjet_S_card_msg(struct IsdnCardState *
10767 release_io_netjet(cs);
10768 return(0);
10769 case CARD_INIT:
10770 - reset_netjet_s(cs);
10771 inittiger(cs);
10772 clear_pending_isac_ints(cs);
10773 initisac(cs);
10774 @@ -180,19 +180,11 @@ setup_netjet_s(struct IsdnCard *card)
10775 printk(KERN_WARNING "NETjet-S: No IRQ for PCI card found\n");
10776 return(0);
10777 }
10778 - cs->hw.njet.base = pci_resource_start(dev_netjet, 0);
10779 + cs->hw.njet.base = pci_resource_start_io(dev_netjet, 0);
10780 if (!cs->hw.njet.base) {
10781 printk(KERN_WARNING "NETjet-S: No IO-Adr for PCI card found\n");
10782 return(0);
10783 }
10784 - /* 2001/10/04 Christoph Ersfeld, Formula-n Europe AG www.formula-n.com */
10785 - if ((dev_netjet->subsystem_vendor == 0x55) &&
10786 - (dev_netjet->subsystem_device == 0x02)) {
10787 - printk(KERN_WARNING "Netjet: You tried to load this driver with an incompatible TigerJet-card\n");
10788 - printk(KERN_WARNING "Use type=41 for Formula-n enter:now ISDN PCI and compatible\n");
10789 - return(0);
10790 - }
10791 - /* end new code */
10792 } else {
10793 printk(KERN_WARNING "NETjet-S: No PCI card found\n");
10794 return(0);
10795 @@ -263,6 +255,7 @@ setup_netjet_s(struct IsdnCard *card)
10796 } else {
10797 request_region(cs->hw.njet.base, bytecnt, "netjet-s isdn");
10798 }
10799 + reset_netjet_s(cs);
10800 cs->readisac = &NETjet_ReadIC;
10801 cs->writeisac = &NETjet_WriteIC;
10802 cs->readisacfifo = &NETjet_ReadICfifo;
10803 Index: linux-2.4.35.4/drivers/isdn/hisax/nj_u.c
10804 ===================================================================
10805 --- linux-2.4.35.4.orig/drivers/isdn/hisax/nj_u.c
10806 +++ linux-2.4.35.4/drivers/isdn/hisax/nj_u.c
10807 @@ -1,4 +1,4 @@
10808 -/* $Id: nj_u.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10809 +/* $Id: nj_u.c,v 2.14 2001/09/24 13:22:56 kai Exp $
10810 *
10811 * This software may be used and distributed according to the terms
10812 * of the GNU General Public License, incorporated herein by reference.
10813 @@ -12,11 +12,12 @@
10814 #include "icc.h"
10815 #include "isdnl1.h"
10816 #include <linux/pci.h>
10817 +#include <linux/isdn_compat.h>
10818 #include <linux/interrupt.h>
10819 #include <linux/ppp_defs.h>
10820 #include "netjet.h"
10821
10822 -const char *NETjet_U_revision = "$Revision: 1.1.4.1 $";
10823 +const char *NETjet_U_revision = "$Revision: 2.14 $";
10824
10825 static u_char dummyrr(struct IsdnCardState *cs, int chan, u_char off)
10826 {
10827 @@ -181,7 +182,7 @@ setup_netjet_u(struct IsdnCard *card)
10828 printk(KERN_WARNING "NETspider-U: No IRQ for PCI card found\n");
10829 return(0);
10830 }
10831 - cs->hw.njet.base = pci_resource_start(dev_netjet, 0);
10832 + cs->hw.njet.base = pci_resource_start_io(dev_netjet, 0);
10833 if (!cs->hw.njet.base) {
10834 printk(KERN_WARNING "NETspider-U: No IO-Adr for PCI card found\n");
10835 return(0);
10836 Index: linux-2.4.35.4/drivers/isdn/hisax/q931.c
10837 ===================================================================
10838 --- linux-2.4.35.4.orig/drivers/isdn/hisax/q931.c
10839 +++ linux-2.4.35.4/drivers/isdn/hisax/q931.c
10840 @@ -1,4 +1,4 @@
10841 -/* $Id: q931.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10842 +/* $Id: q931.c,v 1.12 2001/09/24 13:22:56 kai Exp $
10843 *
10844 * code to decode ITU Q.931 call control messages
10845 *
10846 @@ -197,6 +197,31 @@ struct MessageType mt_n1[] =
10847
10848 #define MT_N1_LEN (sizeof(mt_n1) / sizeof(struct MessageType))
10849
10850 +#if 0
10851 +static struct MessageType fac_1tr6[] =
10852 +{
10853 + {FAC_Sperre, "Sperre"},
10854 + {FAC_Forward1, "Forward 1"},
10855 + {FAC_Forward2, "Forward 2"},
10856 + {FAC_Konferenz, "Konferenz"},
10857 + {FAC_GrabBchan, "Grab Bchannel"},
10858 + {FAC_Reactivate, "Reactivate"},
10859 + {FAC_Konferenz3, "Dreier Konferenz"},
10860 + {FAC_Dienstwechsel1, "Einseitiger Dienstwechsel"},
10861 + {FAC_Dienstwechsel2, "Zweiseitiger Dienstwechsel"},
10862 + {FAC_NummernIdent, "Rufnummer-Identifizierung"},
10863 + {FAC_GBG, "GBG"},
10864 + {FAC_DisplayUebergeben, "Display Uebergeben"},
10865 + {FAC_DisplayUmgeleitet, "Display Umgeleitet"},
10866 + {FAC_Unterdruecke, "Unterdruecke Rufnummer"},
10867 + {FAC_Deactivate, "Deactivate"},
10868 + {FAC_Activate, "Activate"},
10869 + {FAC_SPV, "SPV"},
10870 + {FAC_Rueckwechsel, "Rueckwechsel"},
10871 + {FAC_Umleitung, "Umleitung"}
10872 +};
10873 +#define FAC_1TR6_LEN (sizeof(fac_1tr6) / sizeof(struct MessageType))
10874 +#endif
10875
10876 static int
10877 prbits(char *dest, u_char b, int start, int len)
10878 Index: linux-2.4.35.4/drivers/isdn/hisax/rawhdlc.c
10879 ===================================================================
10880 --- /dev/null
10881 +++ linux-2.4.35.4/drivers/isdn/hisax/rawhdlc.c
10882 @@ -0,0 +1,543 @@
10883 +/* $Id: rawhdlc.c,v 1.7 2001/09/24 13:22:57 kai Exp $
10884 + *
10885 + * support routines for cards that don't support HDLC
10886 + *
10887 + * Author Brent Baccala
10888 + * Copyright by Karsten Keil <keil@isdn4linux.de>
10889 + * by Brent Baccala <baccala@FreeSoft.org>
10890 + *
10891 + * This software may be used and distributed according to the terms
10892 + * of the GNU General Public License, incorporated herein by reference.
10893 + *
10894 + *
10895 + * Some passive ISDN cards, such as the Traverse NETJet and the AMD 7930,
10896 + * don't perform HDLC encapsulation over the B channel. Drivers for
10897 + * such cards use support routines in this file to perform B channel HDLC.
10898 + *
10899 + * Bit-synchronous HDLC encapsulation is a means of encapsulating packets
10900 + * over a continuously transmitting serial communications link.
10901 + * It looks like this:
10902 + *
10903 + * 11111111101111110...........0111111011111111111
10904 + * iiiiiiiiiffffffffdddddddddddffffffffiiiiiiiiiii
10905 + *
10906 + * i = idle f = flag d = data
10907 + *
10908 + * When idle, the channel sends a continuous string of ones (mark
10909 + * idle; illustrated), or a continuous string of flag characters (flag
10910 + * idle). The beginning of a data frame is marked by a flag character
10911 + * (01111110), then comes the actual data, followed by another flag
10912 + * character, after which another frame may be sent immediately (a
10913 + * single flag may serve as both the end of one frame and the start of
10914 + * the next), or the link may return to idle. Obviously, the flag
10915 + * character can not appear anywhere in the data (or a false
10916 + * end-of-frame would occur), so the transmitter performs
10917 + * "bit-stuffing" - inserting a zero bit after every five one bits,
10918 + * irregardless of the original bit after the five ones. Byte
10919 + * ordering is irrelevent at this point - the data is treated as a
10920 + * string of bits, not bytes. Since no more than 5 ones may now occur
10921 + * in a row, the flag sequence, with its 6 ones, is unique.
10922 + *
10923 + * Upon reception, a zero bit that occur after 5 one bits is simply
10924 + * discarded. A series of 6 one bits is end-of-frame, and a series of
10925 + * 7 one bits is an abort. Once bit-stuffing has been corrected for,
10926 + * an integer number of bytes should now be present. The last two
10927 + * of these bytes form the Frame Check Sequence, a CRC that is verified
10928 + * and then discarded. Note that bit-stuffing is performed on the FCS
10929 + * just as if it were regular data.
10930 + *
10931 + *
10932 + *
10933 + * int make_raw_hdlc_data(u_char *src, u_int slen,
10934 + * u_char *dst, u_int dsize)
10935 + *
10936 + * Used for transmission. Copies slen bytes from src to dst, performing
10937 + * HDLC encapsulation (flag bytes, bit-stuffing, CRC) in the process.
10938 + * dsize is size of destination buffer, and should be at least
10939 + * ((6*slen)/5)+5 bytes to ensure adequate space will be available.
10940 + * Function returns length (in bytes) of valid destination buffer, or
10941 + * 0 upon destination overflow.
10942 + *
10943 + * void init_hdlc_state(struct hdlc_state *stateptr, int mode)
10944 + *
10945 + * Initializes hdlc_state structure before first call to read_raw_hdlc_data
10946 + *
10947 + * mode = 0: Sane mode
10948 + * mode = 1/2:
10949 + * Insane mode; NETJet use a shared unsigned int memory block (
10950 + * with busmaster DMA), the bit pattern of every word is
10951 + * <8 B1> <8 B2> <8 Mon> <2 D> <4 C/I> <MX> <MR>
10952 + * according to Siemens IOM-2 interface, so we have to handle
10953 + * the src buffer as unsigned int and have to shift/mask the
10954 + * B-channel bytes.
10955 + * mode 1 -> B1 mode 2 -> B2 data is used
10956 + *
10957 + * int read_raw_hdlc_data(struct hdlc_state *saved_state,
10958 + * u_char *src, u_int slen,
10959 + * u_char *dst, u_int dsize)
10960 + *
10961 + * Used for reception. Scans source buffer bit-by-bit looking for
10962 + * valid HDLC frames, which are copied to destination buffer. HDLC
10963 + * state information is stored in a structure, which allows this
10964 + * function to process frames spread across several blocks of raw
10965 + * HDLC data. Part of the state information is bit offsets into
10966 + * the source and destination buffers.
10967 + *
10968 + * A return value >0 indicates the length of a valid frame, now
10969 + * stored in the destination buffer. In this case, the source
10970 + * buffer might not be completely processed, so this function should
10971 + * be called again with the same source buffer, possibly with a
10972 + * different destination buffer.
10973 + *
10974 + * A return value of zero indicates that the source buffer was
10975 + * completely processed without finding a valid end-of-packet;
10976 + * however, we might be in the middle of packet reception, so
10977 + * the function should be called again with the next block of
10978 + * raw HDLC data and the same destination buffer. It is NOT
10979 + * permitted to change the destination buffer in this case,
10980 + * since data may already have begun to be stored there.
10981 + *
10982 + * A return value of -1 indicates some kind of error - destination
10983 + * buffer overflow, CRC check failed, frame not a multiple of 8
10984 + * bits. Destination buffer probably contains invalid data, which
10985 + * should be discarded. Call function again with same source buffer
10986 + * and a new (or same) destination buffer.
10987 + *
10988 + * Suggested calling sequence:
10989 + *
10990 + * init_hdlc_state(...);
10991 + * for (EACH_RAW_DATA_BLOCK) {
10992 + * while (len = read_raw_hdlc_data(...)) {
10993 + * if (len == -1) DISCARD_FRAME;
10994 + * else PROCESS_FRAME;
10995 + * }
10996 + * }
10997 + *
10998 + *
10999 + * Test the code in this file as follows:
11000 + * gcc -DDEBUGME -o rawhdlctest rawhdlc.c
11001 + * ./rawhdlctest < rawdata
11002 + *
11003 + * The file "rawdata" can be easily generated from a HISAX B-channel
11004 + * hex dump (CF CF CF 02 ...) using the following perl script:
11005 + *
11006 + * while(<>) {
11007 + * @hexlist = split ' ';
11008 + * while ($hexstr = shift(@hexlist)) {
11009 + * printf "%c", hex($hexstr);
11010 + * }
11011 + * }
11012 + *
11013 + */
11014 +
11015 +#ifdef DEBUGME
11016 +#include <stdio.h>
11017 +#endif
11018 +
11019 +#include <linux/types.h>
11020 +#include <linux/ppp_defs.h>
11021 +#include "rawhdlc.h"
11022 +
11023 +/* There's actually an identical copy of this table in the PPP code
11024 + * (ppp_crc16_table), but I don't want this code dependent on PPP
11025 + */
11026 +
11027 +// static
11028 +__u16 fcstab[256] =
11029 +{
11030 + 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
11031 + 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7,
11032 + 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e,
11033 + 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876,
11034 + 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd,
11035 + 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5,
11036 + 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c,
11037 + 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974,
11038 + 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb,
11039 + 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3,
11040 + 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a,
11041 + 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72,
11042 + 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9,
11043 + 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1,
11044 + 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738,
11045 + 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70,
11046 + 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7,
11047 + 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff,
11048 + 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036,
11049 + 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e,
11050 + 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5,
11051 + 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd,
11052 + 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134,
11053 + 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c,
11054 + 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3,
11055 + 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb,
11056 + 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232,
11057 + 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a,
11058 + 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1,
11059 + 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9,
11060 + 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330,
11061 + 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78
11062 +};
11063 +
11064 +#define HDLC_ZERO_SEARCH 0
11065 +#define HDLC_FLAG_SEARCH 1
11066 +#define HDLC_FLAG_FOUND 2
11067 +#define HDLC_FRAME_FOUND 3
11068 +#define HDLC_NULL 4
11069 +#define HDLC_PART 5
11070 +#define HDLC_FULL 6
11071 +
11072 +#define HDLC_FLAG_VALUE 0x7e
11073 +
11074 +
11075 +#define MAKE_RAW_BYTE for (j=0; j<8; j++) { \
11076 + bitcnt++;\
11077 + out_val >>= 1;\
11078 + if (val & 1) {\
11079 + s_one++;\
11080 + out_val |= 0x80;\
11081 + } else {\
11082 + s_one = 0;\
11083 + out_val &= 0x7f;\
11084 + }\
11085 + if (bitcnt==8) {\
11086 + if (d_cnt == dsize) return 0;\
11087 + dst[d_cnt++] = out_val;\
11088 + bitcnt = 0;\
11089 + }\
11090 + if (s_one == 5) {\
11091 + out_val >>= 1;\
11092 + out_val &= 0x7f;\
11093 + bitcnt++;\
11094 + s_one = 0;\
11095 + }\
11096 + if (bitcnt==8) {\
11097 + if (d_cnt == dsize) return 0;\
11098 + dst[d_cnt++] = out_val;\
11099 + bitcnt = 0;\
11100 + }\
11101 + val >>= 1;\
11102 + }
11103 +
11104 +/* Optimization suggestion: If needed, this function could be
11105 + * dramatically sped up using a state machine. Each state would
11106 + * correspond to having seen N one bits, and being offset M bits into
11107 + * the current output byte. N ranges from 0 to 4, M from 0 to 7, so
11108 + * we need 5*8 = 35 states. Each state would have a table with 256
11109 + * entries, one for each input character. Each entry would contain
11110 + * three output characters, an output state, an a byte increment
11111 + * that's either 1 or 2. All this could fit in four bytes; so we need
11112 + * 4 bytes * 256 characters = 1 KB for each state (35 KB total). Zero
11113 + * the output buffer before you start. For each character in your
11114 + * input, you look it up in the current state's table and get three
11115 + * bytes to be or'ed into the output at the current byte offset, and
11116 + * an byte increment to move your pointer forward. A simple Perl
11117 + * script could generate the tables. Given HDLC semantics, probably
11118 + * would be better to set output to all 1s, then use ands instead of ors.
11119 + * A smaller state machine could operate on nibbles instead of bytes.
11120 + * A state machine for 32-bit architectures could use word offsets
11121 + * instead of byte offsets, requiring 5*32 = 160 states; probably
11122 + * best to work on nibbles in such a case.
11123 + */
11124 +
11125 +
11126 +int make_raw_hdlc_data(u_char *src, u_int slen, u_char *dst, u_int dsize)
11127 +{
11128 + register u_int i,d_cnt=0;
11129 + register u_char j;
11130 + register u_char val;
11131 + register u_char s_one = 0;
11132 + register u_char out_val = 0;
11133 + register u_char bitcnt = 0;
11134 + u_int fcs;
11135 +
11136 +
11137 + dst[d_cnt++] = HDLC_FLAG_VALUE;
11138 + fcs = PPP_INITFCS;
11139 + for (i=0; i<slen; i++) {
11140 + val = src[i];
11141 + fcs = PPP_FCS (fcs, val);
11142 + MAKE_RAW_BYTE;
11143 + }
11144 + fcs ^= 0xffff;
11145 + val = fcs & 0xff;
11146 + MAKE_RAW_BYTE;
11147 + val = (fcs>>8) & 0xff;
11148 + MAKE_RAW_BYTE;
11149 + val = HDLC_FLAG_VALUE;
11150 + for (j=0; j<8; j++) {
11151 + bitcnt++;
11152 + out_val >>= 1;
11153 + if (val & 1)
11154 + out_val |= 0x80;
11155 + else
11156 + out_val &= 0x7f;
11157 + if (bitcnt==8) {
11158 + if (d_cnt == dsize) return 0;
11159 + dst[d_cnt++] = out_val;
11160 + bitcnt = 0;
11161 + }
11162 + val >>= 1;
11163 + }
11164 + if (bitcnt) {
11165 + while (8>bitcnt++) {
11166 + out_val >>= 1;
11167 + out_val |= 0x80;
11168 + }
11169 + if (d_cnt == dsize) return 0;
11170 + dst[d_cnt++] = out_val;
11171 + }
11172 +
11173 + return d_cnt;
11174 +}
11175 +
11176 +void init_hdlc_state(struct hdlc_state *stateptr, int mode)
11177 +{
11178 + stateptr->state = HDLC_ZERO_SEARCH;
11179 + stateptr->r_one = 0;
11180 + stateptr->r_val = 0;
11181 + stateptr->o_bitcnt = 0;
11182 + stateptr->i_bitcnt = 0;
11183 + stateptr->insane_mode = mode;
11184 +}
11185 +
11186 +/* Optimization suggestion: A similar state machine could surely
11187 + * be developed for this function as well.
11188 + */
11189 +
11190 +int read_raw_hdlc_data(struct hdlc_state *saved_state,
11191 + u_char *src, u_int slen, u_char *dst, u_int dsize)
11192 +{
11193 + int retval=0;
11194 + register u_char val;
11195 + register u_char state = saved_state->state;
11196 + register u_char r_one = saved_state->r_one;
11197 + register u_char r_val = saved_state->r_val;
11198 + register u_int o_bitcnt = saved_state->o_bitcnt;
11199 + register u_int i_bitcnt = saved_state->i_bitcnt;
11200 + register u_int fcs = saved_state->fcs;
11201 + register u_int *isrc = (u_int *) src;
11202 +
11203 + /* Use i_bitcnt (bit offset into source buffer) to reload "val"
11204 + * in case we're starting up again partway through a source buffer
11205 + */
11206 +
11207 + if ((i_bitcnt >> 3) < slen) {
11208 + if (saved_state->insane_mode==1) {
11209 + val = isrc[(i_bitcnt >> 3)] & 0xff;
11210 + } else if (saved_state->insane_mode==2) {
11211 + val = (isrc[i_bitcnt >> 3] >>8) & 0xff;
11212 + } else {
11213 + val = src[i_bitcnt >> 3];
11214 + }
11215 + val >>= i_bitcnt & 7;
11216 + }
11217 +
11218 + /* One bit per loop. Keep going until we've got something to
11219 + * report (retval != 0), or we exhaust the source buffer
11220 + */
11221 +
11222 + while ((retval == 0) && ((i_bitcnt >> 3) < slen)) {
11223 + if ((i_bitcnt & 7) == 0) {
11224 + if (saved_state->insane_mode==1) {
11225 + val = isrc[(i_bitcnt >> 3)] & 0xff;
11226 + } else if (saved_state->insane_mode==2) {
11227 + val = (isrc[i_bitcnt >> 3] >>8) & 0xff;
11228 + } else {
11229 + val = src[i_bitcnt >> 3];
11230 + }
11231 +#ifdef DEBUGME
11232 + printf("Input byte %d: 0x%2x\n", i_bitcnt>>3, val);
11233 +#endif
11234 + if (val == 0xff) {
11235 + state = HDLC_ZERO_SEARCH;
11236 + o_bitcnt = 0;
11237 + r_one = 0;
11238 + i_bitcnt += 8;
11239 + continue;
11240 + }
11241 + }
11242 +
11243 +#ifdef DEBUGME
11244 + /* printf("Data bit=%d (%d/%d)\n", val&1, i_bitcnt>>3, i_bitcnt&7);*/
11245 +#endif
11246 +
11247 + if (state == HDLC_ZERO_SEARCH) {
11248 + if (val & 1) {
11249 + r_one++;
11250 + } else {
11251 + r_one=0;
11252 + state= HDLC_FLAG_SEARCH;
11253 + }
11254 + } else if (state == HDLC_FLAG_SEARCH) {
11255 + if (val & 1) {
11256 + r_one++;
11257 + if (r_one>6) {
11258 + state=HDLC_ZERO_SEARCH;
11259 + }
11260 + } else {
11261 + if (r_one==6) {
11262 + o_bitcnt=0;
11263 + r_val=0;
11264 + state=HDLC_FLAG_FOUND;
11265 + }
11266 + r_one=0;
11267 + }
11268 + } else if (state == HDLC_FLAG_FOUND) {
11269 + if (val & 1) {
11270 + r_one++;
11271 + if (r_one>6) {
11272 + state=HDLC_ZERO_SEARCH;
11273 + } else {
11274 + r_val >>= 1;
11275 + r_val |= 0x80;
11276 + o_bitcnt++;
11277 + }
11278 + } else {
11279 + if (r_one==6) {
11280 + o_bitcnt=0;
11281 + r_val=0;
11282 + r_one=0;
11283 + i_bitcnt++;
11284 + val >>= 1;
11285 + continue;
11286 + } else if (r_one!=5) {
11287 + r_val >>= 1;
11288 + r_val &= 0x7f;
11289 + o_bitcnt++;
11290 + }
11291 + r_one=0;
11292 + }
11293 + if ((state != HDLC_ZERO_SEARCH) &&
11294 + !(o_bitcnt & 7)) {
11295 +#ifdef DEBUGME
11296 + printf("HDLC_FRAME_FOUND at i_bitcnt:%d\n",i_bitcnt);
11297 +#endif
11298 + state=HDLC_FRAME_FOUND;
11299 + fcs = PPP_INITFCS;
11300 + dst[0] = r_val;
11301 + fcs = PPP_FCS (fcs, r_val);
11302 + }
11303 + } else if (state == HDLC_FRAME_FOUND) {
11304 + if (val & 1) {
11305 + r_one++;
11306 + if (r_one>6) {
11307 + state=HDLC_ZERO_SEARCH;
11308 + o_bitcnt=0;
11309 + } else {
11310 + r_val >>= 1;
11311 + r_val |= 0x80;
11312 + o_bitcnt++;
11313 + }
11314 + } else {
11315 + if (r_one==6) {
11316 + r_val=0;
11317 + r_one=0;
11318 + o_bitcnt++;
11319 + if (o_bitcnt & 7) {
11320 + /* Alignment error */
11321 +#ifdef DEBUGME
11322 + printf("Alignment error\n");
11323 +#endif
11324 + state=HDLC_FLAG_SEARCH;
11325 + retval = -1;
11326 + } else if (fcs==PPP_GOODFCS) {
11327 + /* Valid frame */
11328 + state=HDLC_FLAG_FOUND;
11329 + retval = (o_bitcnt>>3)-3;
11330 + } else {
11331 + /* CRC error */
11332 +#ifdef DEBUGME
11333 + printf("CRC error; fcs was 0x%x, should have been 0x%x\n", fcs, PPP_GOODFCS);
11334 +#endif
11335 + state=HDLC_FLAG_FOUND;
11336 + retval = -1;
11337 + }
11338 + } else if (r_one==5) {
11339 + r_one=0;
11340 + i_bitcnt++;
11341 + val >>= 1;
11342 + continue;
11343 + } else {
11344 + r_val >>= 1;
11345 + r_val &= 0x7f;
11346 + o_bitcnt++;
11347 + }
11348 + r_one=0;
11349 + }
11350 + if ((state == HDLC_FRAME_FOUND) &&
11351 + !(o_bitcnt & 7)) {
11352 + if ((o_bitcnt>>3)>=dsize) {
11353 + /* Buffer overflow error */
11354 +#ifdef DEBUGME
11355 + printf("Buffer overflow error\n");
11356 +#endif
11357 + r_val=0;
11358 + state=HDLC_FLAG_SEARCH;
11359 + retval = -1;
11360 + } else {
11361 + dst[(o_bitcnt>>3)-1] = r_val;
11362 + fcs = PPP_FCS (fcs, r_val);
11363 +#ifdef DEBUGME
11364 + printf("Output byte %d: 0x%02x; FCS 0x%04x\n", (o_bitcnt>>3)-1, r_val, fcs);
11365 +#endif
11366 + }
11367 + }
11368 + }
11369 + i_bitcnt ++;
11370 + val >>= 1;
11371 + }
11372 +
11373 + /* We exhausted the source buffer before anything else happened
11374 + * (retval==0). Reset i_bitcnt in expectation of a new source
11375 + * buffer. Other, we either had an error or a valid frame, so
11376 + * reset o_bitcnt in expectation of a new destination buffer.
11377 + */
11378 +
11379 + if (retval == 0) {
11380 + i_bitcnt = 0;
11381 + } else {
11382 + o_bitcnt = 0;
11383 + }
11384 +
11385 + saved_state->state = state;
11386 + saved_state->r_one = r_one;
11387 + saved_state->r_val = r_val;
11388 + saved_state->fcs = fcs;
11389 + saved_state->o_bitcnt = o_bitcnt;
11390 + saved_state->i_bitcnt = i_bitcnt;
11391 +
11392 + return (retval);
11393 +}
11394 +
11395 +
11396 +
11397 +#ifdef DEBUGME
11398 +
11399 +char buffer[1024];
11400 +char obuffer[1024];
11401 +
11402 +main()
11403 +{
11404 + int buflen=0;
11405 + int len;
11406 + struct hdlc_state hdlc_state;
11407 +
11408 + while((buffer[buflen] = getc(stdin)) != EOF && buflen<1024) buflen++;
11409 +
11410 + printf("buflen = %d\n", buflen);
11411 +
11412 + init_hdlc_state(&hdlc_state, 0);
11413 +
11414 + while (len = read_raw_hdlc_data(&hdlc_state,buffer,buflen,obuffer,1024)) {
11415 + if (len == -1) printf("Error @ byte %d/bit %d\n",
11416 + hdlc_state.i_bitcnt>>3, hdlc_state.i_bitcnt & 7);
11417 + else {
11418 + printf("Frame received: len %d\n", len);
11419 + }
11420 + }
11421 +
11422 + printf("Done\n");
11423 +}
11424 +
11425 +#endif
11426 Index: linux-2.4.35.4/drivers/isdn/hisax/rawhdlc.h
11427 ===================================================================
11428 --- /dev/null
11429 +++ linux-2.4.35.4/drivers/isdn/hisax/rawhdlc.h
11430 @@ -0,0 +1,28 @@
11431 +/* $Id: rawhdlc.h,v 1.5 2001/09/24 13:22:57 kai Exp $
11432 + *
11433 + * Author Brent Baccala
11434 + * Copyright by Brent Baccala <baccala@FreeSoft.org>
11435 + *
11436 + * This software may be used and distributed according to the terms
11437 + * of the GNU General Public License, incorporated herein by reference.
11438 + *
11439 + */
11440 +
11441 +#ifndef RAWHDLC_H
11442 +struct hdlc_state {
11443 + char insane_mode;
11444 + u_char state;
11445 + u_char r_one;
11446 + u_char r_val;
11447 + u_int o_bitcnt;
11448 + u_int i_bitcnt;
11449 + u_int fcs;
11450 +};
11451 +
11452 +
11453 +int make_raw_hdlc_data(u_char *src, u_int slen, u_char *dst, u_int dsize);
11454 +void init_hdlc_state(struct hdlc_state *stateptr, int mode);
11455 +int read_raw_hdlc_data(struct hdlc_state *saved_state,
11456 + u_char *src, u_int slen, u_char *dst, u_int dsize);
11457 +#define RAWHDLC_H
11458 +#endif
11459 Index: linux-2.4.35.4/drivers/isdn/hisax/s0box.c
11460 ===================================================================
11461 --- linux-2.4.35.4.orig/drivers/isdn/hisax/s0box.c
11462 +++ linux-2.4.35.4/drivers/isdn/hisax/s0box.c
11463 @@ -1,4 +1,4 @@
11464 -/* $Id: s0box.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
11465 +/* $Id: s0box.c,v 2.6 2001/09/24 13:22:57 kai Exp $
11466 *
11467 * low level stuff for Creatix S0BOX
11468 *
11469 @@ -18,7 +18,7 @@
11470 #include "isdnl1.h"
11471
11472 extern const char *CardType[];
11473 -const char *s0box_revision = "$Revision: 1.1.4.1 $";
11474 +const char *s0box_revision = "$Revision: 2.6 $";
11475
11476 static inline void
11477 writereg(unsigned int padr, signed int addr, u_char off, u_char val) {
11478 Index: linux-2.4.35.4/drivers/isdn/hisax/saphir.c
11479 ===================================================================
11480 --- linux-2.4.35.4.orig/drivers/isdn/hisax/saphir.c
11481 +++ linux-2.4.35.4/drivers/isdn/hisax/saphir.c
11482 @@ -1,4 +1,4 @@
11483 -/* $Id: saphir.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
11484 +/* $Id: saphir.c,v 1.10 2001/09/24 13:22:57 kai Exp $
11485 *
11486 * low level stuff for HST Saphir 1
11487 *
11488 @@ -20,7 +20,7 @@
11489 #include "isdnl1.h"
11490
11491 extern const char *CardType[];
11492 -static char *saphir_rev = "$Revision: 1.1.4.1 $";
11493 +static char *saphir_rev = "$Revision: 1.10 $";
11494
11495 #define byteout(addr,val) outb(val,addr)
11496 #define bytein(addr) inb(addr)
11497 Index: linux-2.4.35.4/drivers/isdn/hisax/sedlbauer.c
11498 ===================================================================
11499 --- linux-2.4.35.4.orig/drivers/isdn/hisax/sedlbauer.c
11500 +++ linux-2.4.35.4/drivers/isdn/hisax/sedlbauer.c
11501 @@ -1,4 +1,4 @@
11502 -/* $Id: sedlbauer.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
11503 +/* $Id: sedlbauer.c,v 1.34 2002/02/09 21:00:57 keil Exp $
11504 *
11505 * low level stuff for Sedlbauer cards
11506 * includes support for the Sedlbauer speed star (speed star II),
11507 @@ -48,18 +48,19 @@
11508 #include "isar.h"
11509 #include "isdnl1.h"
11510 #include <linux/pci.h>
11511 -#include <linux/isapnp.h>
11512 +#include <linux/isdn_compat.h>
11513
11514 extern const char *CardType[];
11515
11516 -const char *Sedlbauer_revision = "$Revision: 1.1.4.1 $";
11517 +const char *Sedlbauer_revision = "$Revision: 1.34 $";
11518
11519 const char *Sedlbauer_Types[] =
11520 {"None", "speed card/win", "speed star", "speed fax+",
11521 "speed win II / ISDN PC/104", "speed star II", "speed pci",
11522 - "speed fax+ pyramid", "speed fax+ pci"};
11523 + "speed fax+ pyramid", "speed fax+ pci", "HST Saphir III"};
11524
11525 #define PCI_SUBVENDOR_SPEEDFAX_PYRAMID 0x51
11526 +#define PCI_SUBVENDOR_HST_SAPHIR3 0x52
11527 #define PCI_SUBVENDOR_SEDLBAUER_PCI 0x53
11528 #define PCI_SUBVENDOR_SPEEDFAX_PCI 0x54
11529 #define PCI_SUB_ID_SEDLBAUER 0x01
11530 @@ -72,6 +73,7 @@ const char *Sedlbauer_Types[] =
11531 #define SEDL_SPEED_PCI 6
11532 #define SEDL_SPEEDFAX_PYRAMID 7
11533 #define SEDL_SPEEDFAX_PCI 8
11534 +#define HST_SAPHIR3 9
11535
11536 #define SEDL_CHIP_TEST 0
11537 #define SEDL_CHIP_ISAC_HSCX 1
11538 @@ -531,21 +533,6 @@ Sedl_card_msg(struct IsdnCardState *cs,
11539
11540 static struct pci_dev *dev_sedl __devinitdata = NULL;
11541
11542 -#ifdef __ISAPNP__
11543 -static struct isapnp_device_id sedl_ids[] __initdata = {
11544 - { ISAPNP_VENDOR('S', 'A', 'G'), ISAPNP_FUNCTION(0x01),
11545 - ISAPNP_VENDOR('S', 'A', 'G'), ISAPNP_FUNCTION(0x01),
11546 - (unsigned long) "Speed win" },
11547 - { ISAPNP_VENDOR('S', 'A', 'G'), ISAPNP_FUNCTION(0x02),
11548 - ISAPNP_VENDOR('S', 'A', 'G'), ISAPNP_FUNCTION(0x02),
11549 - (unsigned long) "Speed Fax+" },
11550 - { 0, }
11551 -};
11552 -
11553 -static struct isapnp_device_id *pdev = &sedl_ids[0];
11554 -static struct pci_bus *pnp_c __devinitdata = NULL;
11555 -#endif
11556 -
11557 int __devinit
11558 setup_sedlbauer(struct IsdnCard *card)
11559 {
11560 @@ -581,57 +568,6 @@ setup_sedlbauer(struct IsdnCard *card)
11561 bytecnt = 16;
11562 }
11563 } else {
11564 -#ifdef __ISAPNP__
11565 - if (isapnp_present()) {
11566 - struct pci_bus *pb;
11567 - struct pci_dev *pd;
11568 -
11569 - while(pdev->card_vendor) {
11570 - if ((pb = isapnp_find_card(pdev->card_vendor,
11571 - pdev->card_device, pnp_c))) {
11572 - pnp_c = pb;
11573 - pd = NULL;
11574 - if ((pd = isapnp_find_dev(pnp_c,
11575 - pdev->vendor, pdev->function, pd))) {
11576 - printk(KERN_INFO "HiSax: %s detected\n",
11577 - (char *)pdev->driver_data);
11578 - pd->prepare(pd);
11579 - pd->deactivate(pd);
11580 - pd->activate(pd);
11581 - card->para[1] =
11582 - pd->resource[0].start;
11583 - card->para[0] =
11584 - pd->irq_resource[0].start;
11585 - if (!card->para[0] || !card->para[1]) {
11586 - printk(KERN_ERR "Sedlbauer PnP:some resources are missing %ld/%lx\n",
11587 - card->para[0], card->para[1]);
11588 - pd->deactivate(pd);
11589 - return(0);
11590 - }
11591 - cs->hw.sedl.cfg_reg = card->para[1];
11592 - cs->irq = card->para[0];
11593 - if (pdev->function == ISAPNP_FUNCTION(0x2)) {
11594 - cs->subtyp = SEDL_SPEED_FAX;
11595 - cs->hw.sedl.chip = SEDL_CHIP_ISAC_ISAR;
11596 - bytecnt = 16;
11597 - } else {
11598 - cs->subtyp = SEDL_SPEED_CARD_WIN;
11599 - cs->hw.sedl.chip = SEDL_CHIP_TEST;
11600 - }
11601 - goto ready;
11602 - } else {
11603 - printk(KERN_ERR "Sedlbauer PnP: PnP error card found, no device\n");
11604 - return(0);
11605 - }
11606 - }
11607 - pdev++;
11608 - pnp_c=NULL;
11609 - }
11610 - if (!pdev->card_vendor) {
11611 - printk(KERN_INFO "Sedlbauer PnP: no ISAPnP card found\n");
11612 - }
11613 - }
11614 -#endif
11615 /* Probe for Sedlbauer speed pci */
11616 #if CONFIG_PCI
11617 if (!pci_present()) {
11618 @@ -647,15 +583,15 @@ setup_sedlbauer(struct IsdnCard *card)
11619 printk(KERN_WARNING "Sedlbauer: No IRQ for PCI card found\n");
11620 return(0);
11621 }
11622 - cs->hw.sedl.cfg_reg = pci_resource_start(dev_sedl, 0);
11623 + cs->hw.sedl.cfg_reg = pci_resource_start_io(dev_sedl, 0);
11624 } else {
11625 printk(KERN_WARNING "Sedlbauer: No PCI card found\n");
11626 return(0);
11627 }
11628 cs->irq_flags |= SA_SHIRQ;
11629 cs->hw.sedl.bus = SEDL_BUS_PCI;
11630 - sub_vendor_id = dev_sedl->subsystem_vendor;
11631 - sub_id = dev_sedl->subsystem_device;
11632 + pci_get_sub_vendor(dev_sedl,sub_vendor_id);
11633 + pci_get_sub_system(dev_sedl,sub_id);
11634 printk(KERN_INFO "Sedlbauer: PCI subvendor:%x subid %x\n",
11635 sub_vendor_id, sub_id);
11636 printk(KERN_INFO "Sedlbauer: PCI base adr %#x\n",
11637 @@ -670,6 +606,9 @@ setup_sedlbauer(struct IsdnCard *card)
11638 } else if (sub_vendor_id == PCI_SUBVENDOR_SPEEDFAX_PCI) {
11639 cs->hw.sedl.chip = SEDL_CHIP_ISAC_ISAR;
11640 cs->subtyp = SEDL_SPEEDFAX_PCI;
11641 + } else if (sub_vendor_id == PCI_SUBVENDOR_HST_SAPHIR3) {
11642 + cs->hw.sedl.chip = SEDL_CHIP_IPAC;
11643 + cs->subtyp = HST_SAPHIR3;
11644 } else if (sub_vendor_id == PCI_SUBVENDOR_SEDLBAUER_PCI) {
11645 cs->hw.sedl.chip = SEDL_CHIP_IPAC;
11646 cs->subtyp = SEDL_SPEED_PCI;
11647 @@ -683,8 +622,8 @@ setup_sedlbauer(struct IsdnCard *card)
11648 cs->hw.sedl.reset_off = SEDL_ISAR_PCI_ISAR_RESET_OFF;
11649 byteout(cs->hw.sedl.cfg_reg, 0xff);
11650 byteout(cs->hw.sedl.cfg_reg, 0x00);
11651 - byteout(cs->hw.sedl.cfg_reg+ 2, 0xdd);
11652 - byteout(cs->hw.sedl.cfg_reg+ 5, 0x02);
11653 + byteout(cs->hw.sedl.cfg_reg +2, 0xdd);
11654 + byteout(cs->hw.sedl.cfg_reg +5, 0x02);
11655 byteout(cs->hw.sedl.cfg_reg +3, cs->hw.sedl.reset_on);
11656 save_flags(flags);
11657 sti();
11658 @@ -697,7 +636,7 @@ setup_sedlbauer(struct IsdnCard *card)
11659 return (0);
11660 #endif /* CONFIG_PCI */
11661 }
11662 -ready:
11663 +
11664 /* In case of the sedlbauer pcmcia card, this region is in use,
11665 * reserved for us by the card manager. So we do not check it
11666 * here, it would fail.
11667 Index: linux-2.4.35.4/drivers/isdn/hisax/sportster.c
11668 ===================================================================
11669 --- linux-2.4.35.4.orig/drivers/isdn/hisax/sportster.c
11670 +++ linux-2.4.35.4/drivers/isdn/hisax/sportster.c
11671 @@ -1,4 +1,4 @@
11672 -/* $Id: sportster.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
11673 +/* $Id: sportster.c,v 1.16 2001/09/24 13:22:57 kai Exp $
11674 *
11675 * low level stuff for USR Sportster internal TA
11676 *
11677 @@ -20,7 +20,7 @@
11678 #include "isdnl1.h"
11679
11680 extern const char *CardType[];
11681 -const char *sportster_revision = "$Revision: 1.1.4.1 $";
11682 +const char *sportster_revision = "$Revision: 1.16 $";
11683
11684 #define byteout(addr,val) outb(val,addr)
11685 #define bytein(addr) inb(addr)
11686 Index: linux-2.4.35.4/drivers/isdn/hisax/st5481-debug.h
11687 ===================================================================
11688 --- /dev/null
11689 +++ linux-2.4.35.4/drivers/isdn/hisax/st5481-debug.h
11690 @@ -0,0 +1,103 @@
11691 +#define ST5481_DEBUG 0x0
11692 +
11693 +#if ST5481_DEBUG
11694 +
11695 +
11696 +/*
11697 + DEBUG flags. Set compile option ST5481_DEBUG with the following bits set to trace
11698 + the given subsections:
11699 +
11700 + 0x01: USB
11701 + 0x02: D
11702 + 0x04: B
11703 + 0x08: PH
11704 + 0x10: PACKET_DUMP D out
11705 + 0x20: ISO_DUMP D out
11706 + 0x40: PACKET_DUMP D in
11707 + 0x80: ISO_DUMP in
11708 + 0x100: PACKET_DUMP B out
11709 + 0x200: ISO_DUMP B out
11710 + 0x400: PACKET_DUMP B in
11711 +*/
11712 +
11713 +#define DBG(level, format, arg...) \
11714 +if (level & ST5481_DEBUG) \
11715 +printk(KERN_DEBUG __FUNCTION__ ": " format "\n" , ## arg) \
11716 +
11717 +static inline void
11718 +dump_packet(const char *name,const u_char *data,int pkt_len)
11719 +{
11720 +#define DUMP_HDR_SIZE 200
11721 +#define DUMP_TLR_SIZE 8
11722 + if (pkt_len) {
11723 + int i,len1,len2;
11724 +
11725 + printk(KERN_DEBUG "%s: length=%d,data=",name,pkt_len);
11726 +
11727 + if (pkt_len > DUMP_HDR_SIZE+ DUMP_TLR_SIZE) {
11728 + len1 = DUMP_HDR_SIZE;
11729 + len2 = DUMP_TLR_SIZE;
11730 + } else {
11731 + len1 = pkt_len > DUMP_HDR_SIZE ? DUMP_HDR_SIZE : pkt_len;
11732 + len2 = 0;
11733 + }
11734 + for (i = 0; i < len1; ++i) {
11735 + printk ("%.2x", data[i]);
11736 + }
11737 + if (len2) {
11738 + printk ("..");
11739 + for (i = pkt_len-DUMP_TLR_SIZE; i < pkt_len; ++i) {
11740 + printk ("%.2x", data[i]);
11741 + }
11742 + }
11743 + printk ("\n");
11744 + }
11745 +#undef DUMP_HDR_SIZE
11746 +#undef DUMP_TLR_SIZE
11747 +}
11748 +
11749 +static inline void
11750 +dump_iso_packet(const char *name,urb_t *urb)
11751 +{
11752 + int i,j;
11753 + int len,ofs;
11754 + u_char *data;
11755 +
11756 + printk(KERN_DEBUG "%s: packets=%d,errors=%d\n",
11757 + name,urb->number_of_packets,urb->error_count);
11758 + for (i = 0; i < urb->number_of_packets; ++i) {
11759 + if (urb->pipe & USB_DIR_IN) {
11760 + len = urb->iso_frame_desc[i].actual_length;
11761 + } else {
11762 + len = urb->iso_frame_desc[i].length;
11763 + }
11764 + ofs = urb->iso_frame_desc[i].offset;
11765 + printk(KERN_DEBUG "len=%.2d,ofs=%.3d ",len,ofs);
11766 + if (len) {
11767 + data = urb->transfer_buffer+ofs;
11768 + for (j=0; j < len; j++) {
11769 + printk ("%.2x", data[j]);
11770 + }
11771 + }
11772 + printk("\n");
11773 + }
11774 +}
11775 +
11776 +#define DUMP_PACKET(level,data,count) \
11777 + if (level & ST5481_DEBUG) dump_packet(__FUNCTION__,data,count)
11778 +#define DUMP_SKB(level,skb) \
11779 + if ((level & ST5481_DEBUG) && skb) dump_packet(__FUNCTION__,skb->data,skb->len)
11780 +#define DUMP_ISO_PACKET(level,urb) \
11781 + if (level & ST5481_DEBUG) dump_iso_packet(__FUNCTION__,urb)
11782 +
11783 +#else
11784 +
11785 +#define DBG(level,format, arg...) do {} while (0)
11786 +#define DUMP_PACKET(level,data,count) do {} while (0)
11787 +#define DUMP_SKB(level,skb) do {} while (0)
11788 +#define DUMP_ISO_PACKET(level,urb) do {} while (0)
11789 +
11790 +#endif
11791 +
11792 +
11793 +
11794 Index: linux-2.4.35.4/drivers/isdn/hisax/st5481.h
11795 ===================================================================
11796 --- linux-2.4.35.4.orig/drivers/isdn/hisax/st5481.h
11797 +++ linux-2.4.35.4/drivers/isdn/hisax/st5481.h
11798 @@ -219,15 +219,15 @@ enum {
11799 #define L1_EVENT_COUNT (EV_TIMER3 + 1)
11800
11801 #define ERR(format, arg...) \
11802 -printk(KERN_ERR "%s:%s: " format "\n" , __FILE__, __FUNCTION__ , ## arg)
11803 +printk(KERN_ERR __FILE__ ": " __FUNCTION__ ": " format "\n" , ## arg)
11804
11805 #define WARN(format, arg...) \
11806 -printk(KERN_WARNING "%s:%s: " format "\n" , __FILE__, __FUNCTION__ , ## arg)
11807 +printk(KERN_WARNING __FILE__ ": " __FUNCTION__ ": " format "\n" , ## arg)
11808
11809 #define INFO(format, arg...) \
11810 -printk(KERN_INFO "%s:%s: " format "\n" , __FILE__, __FUNCTION__ , ## arg)
11811 +printk(KERN_INFO __FILE__ ": " __FUNCTION__ ": " format "\n" , ## arg)
11812
11813 -#include "isdnhdlc.h"
11814 +#include "st5481_hdlc.h"
11815 #include "fsm.h"
11816 #include "hisax_if.h"
11817 #include <linux/skbuff.h>
11818 @@ -236,7 +236,7 @@ printk(KERN_INFO "%s:%s: " format "\n" ,
11819 * FIFO handling
11820 */
11821
11822 -/* Generic FIFO structure */
11823 +/* Generic FIFO structure */
11824 struct fifo {
11825 u_char r,w,count,size;
11826 spinlock_t lock;
11827 @@ -270,7 +270,7 @@ static inline int fifo_add(struct fifo *
11828 index = -1;
11829 } else {
11830 // Return index where to get the next data to add to the FIFO
11831 - index = fifo->w++ & (fifo->size-1);
11832 + index = fifo->w++ & (fifo->size-1);
11833 fifo->count++;
11834 }
11835 spin_unlock_irqrestore(&fifo->lock, flags);
11836 @@ -289,13 +289,13 @@ static inline int fifo_remove(struct fif
11837 return -1;
11838 }
11839
11840 - spin_lock_irqsave(&fifo->lock, flags);
11841 + spin_lock_irqsave(&fifo->lock, flags);
11842 if (!fifo->count) {
11843 // FIFO empty
11844 index = -1;
11845 } else {
11846 // Return index where to get the next data from the FIFO
11847 - index = fifo->r++ & (fifo->size-1);
11848 + index = fifo->r++ & (fifo->size-1);
11849 fifo->count--;
11850 }
11851 spin_unlock_irqrestore(&fifo->lock, flags);
11852 @@ -309,7 +309,7 @@ static inline int fifo_remove(struct fif
11853 typedef void (*ctrl_complete_t)(void *);
11854
11855 typedef struct ctrl_msg {
11856 - struct usb_ctrlrequest dr;
11857 + devrequest dr;
11858 ctrl_complete_t complete;
11859 void *context;
11860 } ctrl_msg;
11861 @@ -336,7 +336,7 @@ struct st5481_intr {
11862 };
11863
11864 struct st5481_d_out {
11865 - struct isdnhdlc_vars hdlc_state;
11866 + struct hdlc_vars hdlc_state;
11867 struct urb *urb[2]; /* double buffering */
11868 unsigned long busy;
11869 struct sk_buff *tx_skb;
11870 @@ -344,7 +344,7 @@ struct st5481_d_out {
11871 };
11872
11873 struct st5481_b_out {
11874 - struct isdnhdlc_vars hdlc_state;
11875 + struct hdlc_vars hdlc_state;
11876 struct urb *urb[2]; /* double buffering */
11877 u_char flow_event;
11878 u_long busy;
11879 @@ -352,7 +352,7 @@ struct st5481_b_out {
11880 };
11881
11882 struct st5481_in {
11883 - struct isdnhdlc_vars hdlc_state;
11884 + struct hdlc_vars hdlc_state;
11885 struct urb *urb[2]; /* double buffering */
11886 int mode;
11887 int bufsize;
11888 @@ -478,7 +478,7 @@ extern int st5481_debug;
11889 if (level & __debug_variable) dump_iso_packet(__FUNCTION__,urb)
11890
11891 static void __attribute__((unused))
11892 -dump_iso_packet(const char *name,struct urb *urb)
11893 +dump_iso_packet(const char *name,urb_t *urb)
11894 {
11895 int i,j;
11896 int len,ofs;
11897 Index: linux-2.4.35.4/drivers/isdn/hisax/st5481_b.c
11898 ===================================================================
11899 --- linux-2.4.35.4.orig/drivers/isdn/hisax/st5481_b.c
11900 +++ linux-2.4.35.4/drivers/isdn/hisax/st5481_b.c
11901 @@ -67,28 +67,24 @@ static void usb_b_out(struct st5481_bcs
11902 bytes_sent = buf_size - len;
11903 if (skb->len < bytes_sent)
11904 bytes_sent = skb->len;
11905 - { /* swap tx bytes to get hearable audio data */
11906 - register unsigned char *src = skb->data;
11907 - register unsigned char *dest = urb->transfer_buffer+len;
11908 - register unsigned int count;
11909 - for (count = 0; count < bytes_sent; count++)
11910 - *dest++ = isdnhdlc_bit_rev_tab[*src++];
11911 - }
11912 +
11913 + memcpy(urb->transfer_buffer+len, skb->data, bytes_sent);
11914 +
11915 len += bytes_sent;
11916 } else {
11917 - len += isdnhdlc_encode(&b_out->hdlc_state,
11918 - skb->data, skb->len, &bytes_sent,
11919 - urb->transfer_buffer+len, buf_size-len);
11920 + len += hdlc_encode(&b_out->hdlc_state,
11921 + skb->data, skb->len, &bytes_sent,
11922 + urb->transfer_buffer+len, buf_size-len);
11923 }
11924
11925 skb_pull(skb, bytes_sent);
11926 -
11927 +
11928 if (!skb->len) {
11929 // Frame sent
11930 b_out->tx_skb = NULL;
11931 B_L1L2(bcs, PH_DATA | CONFIRM, (void *) skb->truesize);
11932 dev_kfree_skb_any(skb);
11933 -
11934 +
11935 /* if (!(bcs->tx_skb = skb_dequeue(&bcs->sq))) { */
11936 /* st5481B_sched_event(bcs, B_XMTBUFREADY); */
11937 /* } */
11938 @@ -99,9 +95,9 @@ static void usb_b_out(struct st5481_bcs
11939 len = buf_size;
11940 } else {
11941 // Send flags
11942 - len += isdnhdlc_encode(&b_out->hdlc_state,
11943 - NULL, 0, &bytes_sent,
11944 - urb->transfer_buffer+len, buf_size-len);
11945 + len += hdlc_encode(&b_out->hdlc_state,
11946 + NULL, 0, &bytes_sent,
11947 + urb->transfer_buffer+len, buf_size-len);
11948 }
11949 }
11950 }
11951 @@ -213,7 +209,7 @@ static void st5481B_mode(struct st5481_b
11952 if (bcs->mode != L1_MODE_NULL) {
11953 // Open the B channel
11954 if (bcs->mode != L1_MODE_TRANS) {
11955 - isdnhdlc_out_init(&b_out->hdlc_state, 0, bcs->mode == L1_MODE_HDLC_56K);
11956 + hdlc_out_init(&b_out->hdlc_state, 0, bcs->mode == L1_MODE_HDLC_56K);
11957 }
11958 st5481_usb_pipe_reset(adapter, (bcs->channel+1)*2, NULL, NULL);
11959
11960 @@ -279,7 +275,7 @@ static int __devinit st5481_setup_b_out(
11961 usb_b_out_complete, bcs);
11962 }
11963
11964 -static void st5481_release_b_out(struct st5481_bcs *bcs)
11965 +static void __devexit st5481_release_b_out(struct st5481_bcs *bcs)
11966 {
11967 struct st5481_b_out *b_out = &bcs->b_out;
11968
11969 @@ -320,7 +316,7 @@ int __devinit st5481_setup_b(struct st54
11970 /*
11971 * Release buffers and URBs for the B channels
11972 */
11973 -void st5481_release_b(struct st5481_bcs *bcs)
11974 +void __devexit st5481_release_b(struct st5481_bcs *bcs)
11975 {
11976 DBG(4,"");
11977
11978 Index: linux-2.4.35.4/drivers/isdn/hisax/st5481_d.c
11979 ===================================================================
11980 --- linux-2.4.35.4.orig/drivers/isdn/hisax/st5481_d.c
11981 +++ linux-2.4.35.4/drivers/isdn/hisax/st5481_d.c
11982 @@ -162,8 +162,8 @@ static struct FsmNode L1FnList[] __initd
11983 {ST_L1_F8, EV_TIMER3, l1_timer3},
11984 {ST_L1_F8, EV_IND_DP, l1_go_f3},
11985 {ST_L1_F8, EV_IND_AP, l1_go_f6},
11986 - {ST_L1_F8, EV_IND_AI8, l1_go_f7},
11987 - {ST_L1_F8, EV_IND_AI10, l1_go_f7},
11988 + {ST_L1_F8, EV_IND_AI8, l1_go_f8},
11989 + {ST_L1_F8, EV_IND_AI10, l1_go_f8},
11990 {ST_L1_F8, EV_IND_RSY, l1_ignore},
11991 };
11992
11993 @@ -297,7 +297,7 @@ static void usb_d_out(struct st5481_adap
11994 unsigned int num_packets, packet_offset;
11995 int len, buf_size, bytes_sent;
11996 struct sk_buff *skb;
11997 - struct iso_packet_descriptor *desc;
11998 + iso_packet_descriptor_t *desc;
11999
12000 if (d_out->fsm.state != ST_DOUT_NORMAL)
12001 return;
12002 @@ -313,15 +313,15 @@ static void usb_d_out(struct st5481_adap
12003 buf_size = NUM_ISO_PACKETS_D * SIZE_ISO_PACKETS_D_OUT;
12004
12005 if (skb) {
12006 - len = isdnhdlc_encode(&d_out->hdlc_state,
12007 - skb->data, skb->len, &bytes_sent,
12008 - urb->transfer_buffer, buf_size);
12009 + len = hdlc_encode(&d_out->hdlc_state,
12010 + skb->data, skb->len, &bytes_sent,
12011 + urb->transfer_buffer, buf_size);
12012 skb_pull(skb,bytes_sent);
12013 } else {
12014 // Send flags or idle
12015 - len = isdnhdlc_encode(&d_out->hdlc_state,
12016 - NULL, 0, &bytes_sent,
12017 - urb->transfer_buffer, buf_size);
12018 + len = hdlc_encode(&d_out->hdlc_state,
12019 + NULL, 0, &bytes_sent,
12020 + urb->transfer_buffer, buf_size);
12021 }
12022
12023 if (len < buf_size) {
12024 @@ -413,7 +413,7 @@ static void dout_start_xmit(struct FsmIn
12025
12026 DBG(2,"len=%d",skb->len);
12027
12028 - isdnhdlc_out_init(&d_out->hdlc_state, 1, 0);
12029 + hdlc_out_init(&d_out->hdlc_state, 1, 0);
12030
12031 if (test_and_set_bit(buf_nr, &d_out->busy)) {
12032 WARN("ep %d urb %d busy %#lx", EP_D_OUT, buf_nr, d_out->busy);
12033 @@ -422,9 +422,9 @@ static void dout_start_xmit(struct FsmIn
12034 urb = d_out->urb[buf_nr];
12035
12036 DBG_SKB(0x10, skb);
12037 - len = isdnhdlc_encode(&d_out->hdlc_state,
12038 - skb->data, skb->len, &bytes_sent,
12039 - urb->transfer_buffer, 16);
12040 + len = hdlc_encode(&d_out->hdlc_state,
12041 + skb->data, skb->len, &bytes_sent,
12042 + urb->transfer_buffer, 16);
12043 skb_pull(skb, bytes_sent);
12044
12045 if(len < 16)
12046 @@ -673,7 +673,7 @@ static int __devinit st5481_setup_d_out(
12047 usb_d_out_complete, adapter);
12048 }
12049
12050 -static void st5481_release_d_out(struct st5481_adapter *adapter)
12051 +static void __devexit st5481_release_d_out(struct st5481_adapter *adapter)
12052 {
12053 struct st5481_d_out *d_out = &adapter->d_out;
12054
12055 @@ -723,7 +723,7 @@ int __devinit st5481_setup_d(struct st54
12056 return retval;
12057 }
12058
12059 -void st5481_release_d(struct st5481_adapter *adapter)
12060 +void __devexit st5481_release_d(struct st5481_adapter *adapter)
12061 {
12062 DBG(2,"");
12063
12064 Index: linux-2.4.35.4/drivers/isdn/hisax/st5481_init.c
12065 ===================================================================
12066 --- linux-2.4.35.4.orig/drivers/isdn/hisax/st5481_init.c
12067 +++ linux-2.4.35.4/drivers/isdn/hisax/st5481_init.c
12068 @@ -14,6 +14,7 @@
12069 * TODO:
12070 *
12071 * b layer1 delay?
12072 + * hdlc as module
12073 * hotplug / unregister issues
12074 * mod_inc/dec_use_count
12075 * unify parts of d/b channel usb handling
12076 @@ -177,7 +178,7 @@ MODULE_DEVICE_TABLE (usb, st5481_ids);
12077 static struct usb_driver st5481_usb_driver = {
12078 name: "st5481_usb",
12079 probe: probe_st5481,
12080 - disconnect: __devexit_p(disconnect_st5481),
12081 + disconnect: disconnect_st5481,
12082 id_table: st5481_ids,
12083 };
12084
12085 Index: linux-2.4.35.4/drivers/isdn/hisax/st5481_usb.c
12086 ===================================================================
12087 --- linux-2.4.35.4.orig/drivers/isdn/hisax/st5481_usb.c
12088 +++ linux-2.4.35.4/drivers/isdn/hisax/st5481_usb.c
12089 @@ -41,9 +41,9 @@ static void usb_next_ctrl_msg(struct urb
12090 (unsigned char *)&ctrl->msg_fifo.data[r_index];
12091
12092 DBG(1,"request=0x%02x,value=0x%04x,index=%x",
12093 - ((struct ctrl_msg *)urb->setup_packet)->dr.bRequest,
12094 - ((struct ctrl_msg *)urb->setup_packet)->dr.wValue,
12095 - ((struct ctrl_msg *)urb->setup_packet)->dr.wIndex);
12096 + ((struct ctrl_msg *)urb->setup_packet)->dr.request,
12097 + ((struct ctrl_msg *)urb->setup_packet)->dr.value,
12098 + ((struct ctrl_msg *)urb->setup_packet)->dr.index);
12099
12100 // Prepare the URB
12101 urb->dev = adapter->usb_dev;
12102 @@ -69,11 +69,11 @@ void usb_ctrl_msg(struct st5481_adapter
12103 }
12104 ctrl_msg = &ctrl->msg_fifo.data[w_index];
12105
12106 - ctrl_msg->dr.bRequestType = requesttype;
12107 - ctrl_msg->dr.bRequest = request;
12108 - ctrl_msg->dr.wValue = cpu_to_le16p(&value);
12109 - ctrl_msg->dr.wIndex = cpu_to_le16p(&index);
12110 - ctrl_msg->dr.wLength = 0;
12111 + ctrl_msg->dr.requesttype = requesttype;
12112 + ctrl_msg->dr.request = request;
12113 + ctrl_msg->dr.value = cpu_to_le16p(&value);
12114 + ctrl_msg->dr.index = cpu_to_le16p(&index);
12115 + ctrl_msg->dr.length = 0;
12116 ctrl_msg->complete = complete;
12117 ctrl_msg->context = context;
12118
12119 @@ -140,17 +140,17 @@ static void usb_ctrl_complete(struct urb
12120
12121 ctrl_msg = (struct ctrl_msg *)urb->setup_packet;
12122
12123 - if (ctrl_msg->dr.bRequest == USB_REQ_CLEAR_FEATURE) {
12124 + if (ctrl_msg->dr.request == USB_REQ_CLEAR_FEATURE) {
12125 /* Special case handling for pipe reset */
12126 - le16_to_cpus(&ctrl_msg->dr.wIndex);
12127 + le16_to_cpus(&ctrl_msg->dr.index);
12128 usb_endpoint_running(adapter->usb_dev,
12129 - ctrl_msg->dr.wIndex & ~USB_DIR_IN,
12130 - (ctrl_msg->dr.wIndex & USB_DIR_IN) == 0);
12131 + ctrl_msg->dr.index & ~USB_DIR_IN,
12132 + (ctrl_msg->dr.index & USB_DIR_IN) == 0);
12133
12134 /* toggle is reset on clear */
12135 usb_settoggle(adapter->usb_dev,
12136 - ctrl_msg->dr.wIndex & ~USB_DIR_IN,
12137 - (ctrl_msg->dr.wIndex & USB_DIR_IN) == 0,
12138 + ctrl_msg->dr.index & ~USB_DIR_IN,
12139 + (ctrl_msg->dr.index & USB_DIR_IN) == 0,
12140 0);
12141
12142
12143 @@ -235,7 +235,7 @@ int __devinit st5481_setup_usb(struct st
12144 struct usb_interface_descriptor *altsetting;
12145 struct usb_endpoint_descriptor *endpoint;
12146 int status;
12147 - struct urb *urb;
12148 + urb_t *urb;
12149 u_char *buf;
12150
12151 DBG(1,"");
12152 @@ -307,7 +307,7 @@ int __devinit st5481_setup_usb(struct st
12153 * Release buffers and URBs for the interrupt and control
12154 * endpoint.
12155 */
12156 -void st5481_release_usb(struct st5481_adapter *adapter)
12157 +void __devexit st5481_release_usb(struct st5481_adapter *adapter)
12158 {
12159 struct st5481_intr *intr = &adapter->intr;
12160 struct st5481_ctrl *ctrl = &adapter->ctrl;
12161 @@ -443,7 +443,7 @@ st5481_setup_isocpipes(struct urb* urb[2
12162 return retval;
12163 }
12164
12165 -void st5481_release_isocpipes(struct urb* urb[2])
12166 +void __devexit st5481_release_isocpipes(struct urb* urb[2])
12167 {
12168 int j;
12169
12170 @@ -484,18 +484,16 @@ static void usb_in_complete(struct urb *
12171 ptr = urb->transfer_buffer;
12172 while (len > 0) {
12173 if (in->mode == L1_MODE_TRANS) {
12174 - /* swap rx bytes to get hearable audio */
12175 - register unsigned char *dest = in->rcvbuf;
12176 + memcpy(in->rcvbuf, ptr, len);
12177 status = len;
12178 - for (; len; len--)
12179 - *dest++ = isdnhdlc_bit_rev_tab[*ptr++];
12180 + len = 0;
12181 } else {
12182 - status = isdnhdlc_decode(&in->hdlc_state, ptr, len, &count,
12183 - in->rcvbuf, in->bufsize);
12184 + status = hdlc_decode(&in->hdlc_state, ptr, len, &count,
12185 + in->rcvbuf, in->bufsize);
12186 ptr += count;
12187 len -= count;
12188 }
12189 -
12190 +
12191 if (status > 0) {
12192 // Good frame received
12193 DBG(4,"count=%d",status);
12194 @@ -549,7 +547,7 @@ int __devinit st5481_setup_in(struct st5
12195 return retval;
12196 }
12197
12198 -void st5481_release_in(struct st5481_in *in)
12199 +void __devexit st5481_release_in(struct st5481_in *in)
12200 {
12201 DBG(2,"");
12202
12203 @@ -562,8 +560,7 @@ void st5481_release_in(struct st5481_in
12204 */
12205 int st5481_isoc_flatten(struct urb *urb)
12206 {
12207 - struct iso_packet_descriptor *pipd;
12208 - struct iso_packet_descriptor *pend;
12209 + piso_packet_descriptor_t pipd,pend;
12210 unsigned char *src,*dst;
12211 unsigned int len;
12212
12213 @@ -624,10 +621,15 @@ void st5481_in_mode(struct st5481_in *in
12214
12215 if (in->mode != L1_MODE_NULL) {
12216 if (in->mode != L1_MODE_TRANS)
12217 - isdnhdlc_rcv_init(&in->hdlc_state,
12218 - in->mode == L1_MODE_HDLC_56K);
12219 + hdlc_rcv_init(&in->hdlc_state,
12220 + in->mode == L1_MODE_HDLC_56K);
12221
12222 st5481_usb_pipe_reset(in->adapter, in->ep, NULL, NULL);
12223 +#if 0
12224 + st5481_usb_device_ctrl_msg(in->adapter, in->counter,
12225 + in->packet_size,
12226 + st5481_start_rcv, in);
12227 +#endif
12228 st5481_usb_device_ctrl_msg(in->adapter, in->counter,
12229 in->packet_size,
12230 NULL, NULL);
12231 Index: linux-2.4.35.4/drivers/isdn/hisax/tei.c
12232 ===================================================================
12233 --- linux-2.4.35.4.orig/drivers/isdn/hisax/tei.c
12234 +++ linux-2.4.35.4/drivers/isdn/hisax/tei.c
12235 @@ -1,4 +1,4 @@
12236 -/* $Id: tei.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
12237 +/* $Id: tei.c,v 2.20 2001/09/24 13:22:57 kai Exp $
12238 *
12239 * Author Karsten Keil
12240 * based on the teles driver from Jan den Ouden
12241 @@ -21,7 +21,7 @@
12242 #include <linux/init.h>
12243 #include <linux/random.h>
12244
12245 -const char *tei_revision = "$Revision: 1.1.4.1 $";
12246 +const char *tei_revision = "$Revision: 2.20 $";
12247
12248 #define ID_REQUEST 1
12249 #define ID_ASSIGNED 2
12250 Index: linux-2.4.35.4/drivers/isdn/hisax/teleint.c
12251 ===================================================================
12252 --- linux-2.4.35.4.orig/drivers/isdn/hisax/teleint.c
12253 +++ linux-2.4.35.4/drivers/isdn/hisax/teleint.c
12254 @@ -1,4 +1,4 @@
12255 -/* $Id: teleint.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
12256 +/* $Id: teleint.c,v 1.16 2001/09/24 13:22:57 kai Exp $
12257 *
12258 * low level stuff for TeleInt isdn cards
12259 *
12260 @@ -19,7 +19,7 @@
12261
12262 extern const char *CardType[];
12263
12264 -const char *TeleInt_revision = "$Revision: 1.1.4.1 $";
12265 +const char *TeleInt_revision = "$Revision: 1.16 $";
12266
12267 #define byteout(addr,val) outb(val,addr)
12268 #define bytein(addr) inb(addr)
12269 Index: linux-2.4.35.4/drivers/isdn/hisax/teles0.c
12270 ===================================================================
12271 --- linux-2.4.35.4.orig/drivers/isdn/hisax/teles0.c
12272 +++ linux-2.4.35.4/drivers/isdn/hisax/teles0.c
12273 @@ -1,4 +1,4 @@
12274 -/* $Id: teles0.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
12275 +/* $Id: teles0.c,v 2.15 2001/09/24 13:22:57 kai Exp $
12276 *
12277 * low level stuff for Teles Memory IO isdn cards
12278 *
12279 @@ -24,7 +24,7 @@
12280
12281 extern const char *CardType[];
12282
12283 -const char *teles0_revision = "$Revision: 1.1.4.1 $";
12284 +const char *teles0_revision = "$Revision: 2.15 $";
12285
12286 #define TELES_IOMEM_SIZE 0x400
12287 #define byteout(addr,val) outb(val,addr)
12288 @@ -189,8 +189,10 @@ release_io_teles0(struct IsdnCardState *
12289 {
12290 if (cs->hw.teles0.cfg_reg)
12291 release_region(cs->hw.teles0.cfg_reg, 8);
12292 +#ifdef COMPAT_HAS_ISA_IOREMAP
12293 iounmap((unsigned char *)cs->hw.teles0.membase);
12294 release_mem_region(cs->hw.teles0.phymem, TELES_IOMEM_SIZE);
12295 +#endif
12296 }
12297
12298 static int
12299 @@ -327,6 +329,7 @@ setup_teles0(struct IsdnCard *card)
12300 /* 16.0 and 8.0 designed for IOM1 */
12301 test_and_set_bit(HW_IOM1, &cs->HW_Flags);
12302 cs->hw.teles0.phymem = card->para[1];
12303 +#ifdef COMPAT_HAS_ISA_IOREMAP
12304 if (check_mem_region(cs->hw.teles0.phymem, TELES_IOMEM_SIZE)) {
12305 printk(KERN_WARNING
12306 "HiSax: %s memory region %lx-%lx already in use\n",
12307 @@ -342,6 +345,9 @@ setup_teles0(struct IsdnCard *card)
12308 }
12309 cs->hw.teles0.membase =
12310 (unsigned long) ioremap(cs->hw.teles0.phymem, TELES_IOMEM_SIZE);
12311 +#else
12312 + cs->hw.teles0.membase = cs->hw.teles0.phymem;
12313 +#endif
12314 printk(KERN_INFO
12315 "HiSax: %s config irq:%d mem:0x%lX cfg:0x%X\n",
12316 CardType[cs->typ], cs->irq,
12317 Index: linux-2.4.35.4/drivers/isdn/hisax/teles3.c
12318 ===================================================================
12319 --- linux-2.4.35.4.orig/drivers/isdn/hisax/teles3.c
12320 +++ linux-2.4.35.4/drivers/isdn/hisax/teles3.c
12321 @@ -1,4 +1,4 @@
12322 -/* $Id: teles3.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
12323 +/* $Id: teles3.c,v 2.19 2001/09/24 13:22:57 kai Exp $
12324 *
12325 * low level stuff for Teles 16.3 & PNP isdn cards
12326 *
12327 @@ -15,14 +15,13 @@
12328 */
12329 #define __NO_VERSION__
12330 #include <linux/init.h>
12331 -#include <linux/isapnp.h>
12332 #include "hisax.h"
12333 #include "isac.h"
12334 #include "hscx.h"
12335 #include "isdnl1.h"
12336
12337 extern const char *CardType[];
12338 -const char *teles3_revision = "$Revision: 1.1.4.1 $";
12339 +const char *teles3_revision = "$Revision: 2.19 $";
12340
12341 #define byteout(addr,val) outb(val,addr)
12342 #define bytein(addr) inb(addr)
12343 @@ -255,24 +254,6 @@ Teles_card_msg(struct IsdnCardState *cs,
12344 return(0);
12345 }
12346
12347 -#ifdef __ISAPNP__
12348 -static struct isapnp_device_id teles_ids[] __initdata = {
12349 - { ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2110),
12350 - ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2110),
12351 - (unsigned long) "Teles 16.3 PnP" },
12352 - { ISAPNP_VENDOR('C', 'T', 'X'), ISAPNP_FUNCTION(0x0),
12353 - ISAPNP_VENDOR('C', 'T', 'X'), ISAPNP_FUNCTION(0x0),
12354 - (unsigned long) "Creatix 16.3 PnP" },
12355 - { ISAPNP_VENDOR('C', 'P', 'Q'), ISAPNP_FUNCTION(0x1002),
12356 - ISAPNP_VENDOR('C', 'P', 'Q'), ISAPNP_FUNCTION(0x1002),
12357 - (unsigned long) "Compaq ISDN S0" },
12358 - { 0, }
12359 -};
12360 -
12361 -static struct isapnp_device_id *tdev = &teles_ids[0];
12362 -static struct pci_bus *pnp_c __devinitdata = NULL;
12363 -#endif
12364 -
12365 int __devinit
12366 setup_teles3(struct IsdnCard *card)
12367 {
12368 @@ -286,47 +267,6 @@ setup_teles3(struct IsdnCard *card)
12369 && (cs->typ != ISDN_CTYPE_TELESPCMCIA) && (cs->typ != ISDN_CTYPE_COMPAQ_ISA))
12370 return (0);
12371
12372 -#ifdef __ISAPNP__
12373 - if (!card->para[1] && isapnp_present()) {
12374 - struct pci_bus *pb;
12375 - struct pci_dev *pd;
12376 -
12377 - while(tdev->card_vendor) {
12378 - if ((pb = isapnp_find_card(tdev->card_vendor,
12379 - tdev->card_device, pnp_c))) {
12380 - pnp_c = pb;
12381 - pd = NULL;
12382 - if ((pd = isapnp_find_dev(pnp_c,
12383 - tdev->vendor, tdev->function, pd))) {
12384 - printk(KERN_INFO "HiSax: %s detected\n",
12385 - (char *)tdev->driver_data);
12386 - pd->prepare(pd);
12387 - pd->deactivate(pd);
12388 - pd->activate(pd);
12389 - card->para[3] = pd->resource[2].start;
12390 - card->para[2] = pd->resource[1].start;
12391 - card->para[1] = pd->resource[0].start;
12392 - card->para[0] = pd->irq_resource[0].start;
12393 - if (!card->para[0] || !card->para[1] || !card->para[2]) {
12394 - printk(KERN_ERR "Teles PnP:some resources are missing %ld/%lx/%lx\n",
12395 - card->para[0], card->para[1], card->para[2]);
12396 - pd->deactivate(pd);
12397 - return(0);
12398 - }
12399 - break;
12400 - } else {
12401 - printk(KERN_ERR "Teles PnP: PnP error card found, no device\n");
12402 - }
12403 - }
12404 - tdev++;
12405 - pnp_c=NULL;
12406 - }
12407 - if (!tdev->card_vendor) {
12408 - printk(KERN_INFO "Teles PnP: no ISAPnP card found\n");
12409 - return(0);
12410 - }
12411 - }
12412 -#endif
12413 if (cs->typ == ISDN_CTYPE_16_3) {
12414 cs->hw.teles3.cfg_reg = card->para[1];
12415 switch (cs->hw.teles3.cfg_reg) {
12416 Index: linux-2.4.35.4/drivers/isdn/hisax/telespci.c
12417 ===================================================================
12418 --- linux-2.4.35.4.orig/drivers/isdn/hisax/telespci.c
12419 +++ linux-2.4.35.4/drivers/isdn/hisax/telespci.c
12420 @@ -1,4 +1,4 @@
12421 -/* $Id: telespci.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
12422 +/* $Id: telespci.c,v 2.23 2001/09/24 13:22:57 kai Exp $
12423 *
12424 * low level stuff for Teles PCI isdn cards
12425 *
12426 @@ -20,9 +20,10 @@
12427 #include "hscx.h"
12428 #include "isdnl1.h"
12429 #include <linux/pci.h>
12430 +#include <linux/isdn_compat.h>
12431
12432 extern const char *CardType[];
12433 -const char *telespci_revision = "$Revision: 1.1.4.1 $";
12434 +const char *telespci_revision = "$Revision: 2.23 $";
12435
12436 #define ZORAN_PO_RQ_PEN 0x02000000
12437 #define ZORAN_PO_WR 0x00800000
12438 @@ -307,10 +308,10 @@ setup_telespci(struct IsdnCard *card)
12439 printk(KERN_WARNING "Teles: No IRQ for PCI card found\n");
12440 return(0);
12441 }
12442 - cs->hw.teles0.membase = (u_long) ioremap(pci_resource_start(dev_tel, 0),
12443 + cs->hw.teles0.membase = (u_long) ioremap(pci_resource_start_mem(dev_tel, 0),
12444 PAGE_SIZE);
12445 printk(KERN_INFO "Found: Zoran, base-address: 0x%lx, irq: 0x%x\n",
12446 - pci_resource_start(dev_tel, 0), dev_tel->irq);
12447 + pci_resource_start_mem(dev_tel, 0), dev_tel->irq);
12448 } else {
12449 printk(KERN_WARNING "TelesPCI: No PCI card found\n");
12450 return(0);
12451 Index: linux-2.4.35.4/drivers/isdn/hisax/w6692.c
12452 ===================================================================
12453 --- linux-2.4.35.4.orig/drivers/isdn/hisax/w6692.c
12454 +++ linux-2.4.35.4/drivers/isdn/hisax/w6692.c
12455 @@ -1,4 +1,4 @@
12456 -/* $Id: w6692.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
12457 +/* $Id: w6692.c,v 1.18 2001/09/24 13:22:57 kai Exp $
12458 *
12459 * Winbond W6692 specific routines
12460 *
12461 @@ -18,6 +18,7 @@
12462 #include "isdnl1.h"
12463 #include <linux/interrupt.h>
12464 #include <linux/pci.h>
12465 +#include <linux/isdn_compat.h>
12466
12467 /* table entry in the PCI devices list */
12468 typedef struct {
12469 @@ -29,20 +30,14 @@ typedef struct {
12470
12471 static const PCI_ENTRY id_list[] =
12472 {
12473 - {PCI_VENDOR_ID_WINBOND2, PCI_DEVICE_ID_WINBOND2_6692, "Winbond", "W6692"},
12474 {PCI_VENDOR_ID_DYNALINK, PCI_DEVICE_ID_DYNALINK_IS64PH, "Dynalink/AsusCom", "IS64PH"},
12475 - {0, 0, "U.S.Robotics", "ISDN PCI Card TA"}
12476 + {PCI_VENDOR_ID_WINBOND2, PCI_DEVICE_ID_WINBOND2_6692, "Winbond", "W6692"},
12477 + {0, 0, NULL, NULL}
12478 };
12479
12480 -#define W6692_SV_USR 0x16ec
12481 -#define W6692_SD_USR 0x3409
12482 -#define W6692_WINBOND 0
12483 -#define W6692_DYNALINK 1
12484 -#define W6692_USR 2
12485 -
12486 extern const char *CardType[];
12487
12488 -const char *w6692_revision = "$Revision: 1.1.4.1 $";
12489 +const char *w6692_revision = "$Revision: 1.18 $";
12490
12491 #define DBUSY_TIMER_VALUE 80
12492
12493 @@ -675,6 +670,16 @@ setstack_W6692(struct PStack *st, struct
12494 static void
12495 DC_Close_W6692(struct IsdnCardState *cs)
12496 {
12497 +#if 0
12498 + if (cs->dc.w6692.mon_rx) {
12499 + kfree(cs->dc.w6692.mon_rx);
12500 + cs->dc.w6692.mon_rx = NULL;
12501 + }
12502 + if (cs->dc.w6692.mon_tx) {
12503 + kfree(cs->dc.w6692.mon_tx);
12504 + cs->dc.w6692.mon_tx = NULL;
12505 + }
12506 +#endif
12507 }
12508
12509 static void
12510 @@ -865,38 +870,31 @@ setstack_w6692(struct PStack *st, struct
12511 return (0);
12512 }
12513
12514 -void resetW6692(struct IsdnCardState *cs)
12515 -{
12516 - cs->writeW6692(cs, W_D_CTL, W_D_CTL_SRST);
12517 - schedule_timeout((10*HZ)/1000);
12518 - cs->writeW6692(cs, W_D_CTL, 0x00);
12519 - schedule_timeout((10*HZ)/1000);
12520 - cs->writeW6692(cs, W_IMASK, 0xff);
12521 - cs->writeW6692(cs, W_D_SAM, 0xff);
12522 - cs->writeW6692(cs, W_D_TAM, 0xff);
12523 - cs->writeW6692(cs, W_D_EXIM, 0x00);
12524 - cs->writeW6692(cs, W_D_MODE, W_D_MODE_RACT);
12525 - cs->writeW6692(cs, W_IMASK, 0x18);
12526 - if (cs->subtyp == W6692_USR) {
12527 - /* seems that USR implemented some power control features
12528 - * Pin 79 is connected to the oscilator circuit so we
12529 - * have to handle it here
12530 - */
12531 - cs->writeW6692(cs, W_PCTL, 0x80);
12532 - cs->writeW6692(cs, W_XDATA, 0x00);
12533 - }
12534 -}
12535 -
12536 void __init initW6692(struct IsdnCardState *cs, int part)
12537 {
12538 if (part & 1) {
12539 cs->tqueue.routine = (void *) (void *) W6692_bh;
12540 cs->setstack_d = setstack_W6692;
12541 cs->DC_Close = DC_Close_W6692;
12542 +#if 0
12543 + cs->dc.w6692.mon_tx = NULL;
12544 + cs->dc.w6692.mon_rx = NULL;
12545 +#endif
12546 cs->dbusytimer.function = (void *) dbusy_timer_handler;
12547 cs->dbusytimer.data = (long) cs;
12548 init_timer(&cs->dbusytimer);
12549 - resetW6692(cs);
12550 +
12551 + cs->writeW6692(cs, W_D_CTL, W_D_CTL_SRST);
12552 + cs->writeW6692(cs, W_D_CTL, 0x00);
12553 + cs->writeW6692(cs, W_IMASK, 0xff);
12554 +#if 0
12555 + cs->dc.w6692.mocr = 0xaa;
12556 +#endif
12557 + cs->writeW6692(cs, W_D_SAM, 0xff);
12558 + cs->writeW6692(cs, W_D_TAM, 0xff);
12559 + cs->writeW6692(cs, W_D_EXIM, 0x00);
12560 + cs->writeW6692(cs, W_D_MODE, W_D_MODE_RACT);
12561 + cs->writeW6692(cs, W_IMASK, 0x18);
12562 ph_command(cs, W_L1CMD_RST);
12563 cs->dc.w6692.ph_state = W_L1CMD_RST;
12564 W6692_new_ph(cs);
12565 @@ -963,14 +961,9 @@ w6692_card_msg(struct IsdnCardState *cs,
12566 {
12567 switch (mt) {
12568 case CARD_RESET:
12569 - resetW6692(cs);
12570 return (0);
12571 case CARD_RELEASE:
12572 - cs->writeW6692(cs, W_IMASK, 0xff);
12573 release_region(cs->hw.w6692.iobase, 256);
12574 - if (cs->subtyp == W6692_USR) {
12575 - cs->writeW6692(cs, W_XDATA, 0x04);
12576 - }
12577 return (0);
12578 case CARD_INIT:
12579 initW6692(cs, 3);
12580 @@ -1013,7 +1006,6 @@ setup_w6692(struct IsdnCard *card)
12581 if (dev_w6692) {
12582 if (pci_enable_device(dev_w6692))
12583 continue;
12584 - cs->subtyp = id_idx;
12585 break;
12586 }
12587 id_idx++;
12588 @@ -1023,14 +1015,7 @@ setup_w6692(struct IsdnCard *card)
12589 pci_irq = dev_w6692->irq;
12590 /* I think address 0 is allways the configuration area */
12591 /* and address 1 is the real IO space KKe 03.09.99 */
12592 - pci_ioaddr = pci_resource_start(dev_w6692, 1);
12593 - /* USR ISDN PCI card TA need some special handling */
12594 - if (cs->subtyp == W6692_WINBOND) {
12595 - if ((W6692_SV_USR == dev_w6692->subsystem_vendor) &&
12596 - (W6692_SD_USR == dev_w6692->subsystem_device)) {
12597 - cs->subtyp = W6692_USR;
12598 - }
12599 - }
12600 + pci_ioaddr = pci_resource_start_io(dev_w6692, 1);
12601 }
12602 if (!found) {
12603 printk(KERN_WARNING "W6692: No PCI card found\n");
12604 @@ -1047,18 +1032,18 @@ setup_w6692(struct IsdnCard *card)
12605 }
12606 cs->hw.w6692.iobase = pci_ioaddr;
12607 printk(KERN_INFO "Found: %s %s, I/O base: 0x%x, irq: %d\n",
12608 - id_list[cs->subtyp].vendor_name, id_list[cs->subtyp].card_name,
12609 - pci_ioaddr, pci_irq);
12610 + id_list[id_idx].vendor_name, id_list[id_idx].card_name,
12611 + pci_ioaddr, dev_w6692->irq);
12612 if (check_region((cs->hw.w6692.iobase), 256)) {
12613 printk(KERN_WARNING
12614 "HiSax: %s I/O ports %x-%x already in use\n",
12615 - id_list[cs->subtyp].card_name,
12616 + id_list[id_idx].card_name,
12617 cs->hw.w6692.iobase,
12618 cs->hw.w6692.iobase + 255);
12619 return (0);
12620 } else {
12621 request_region(cs->hw.w6692.iobase, 256,
12622 - id_list[cs->subtyp].card_name);
12623 + id_list[id_idx].card_name);
12624 }
12625 #else
12626 printk(KERN_WARNING "HiSax: W6692 and NO_PCI_BIOS\n");
12627 @@ -1068,7 +1053,7 @@ setup_w6692(struct IsdnCard *card)
12628
12629 printk(KERN_INFO
12630 "HiSax: %s config irq:%d I/O:%x\n",
12631 - id_list[cs->subtyp].card_name, cs->irq,
12632 + id_list[id_idx].card_name, cs->irq,
12633 cs->hw.w6692.iobase);
12634
12635 cs->readW6692 = &ReadW6692;
12636 Index: linux-2.4.35.4/drivers/isdn/hisax/w6692.h
12637 ===================================================================
12638 --- linux-2.4.35.4.orig/drivers/isdn/hisax/w6692.h
12639 +++ linux-2.4.35.4/drivers/isdn/hisax/w6692.h
12640 @@ -1,4 +1,4 @@
12641 -/* $Id: w6692.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
12642 +/* $Id: w6692.h,v 1.4 2001/09/24 13:22:57 kai Exp $
12643 *
12644 * Winbond W6692 specific defines
12645 *
12646 Index: linux-2.4.35.4/drivers/isdn/hysdn/boardergo.c
12647 ===================================================================
12648 --- linux-2.4.35.4.orig/drivers/isdn/hysdn/boardergo.c
12649 +++ linux-2.4.35.4/drivers/isdn/hysdn/boardergo.c
12650 @@ -1,27 +1,41 @@
12651 -/* $Id: boardergo.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12652 - *
12653 +/* $Id: boardergo.c,v 1.9 2001/07/19 20:39:51 kai Exp $
12654 +
12655 * Linux driver for HYSDN cards, specific routines for ergo type boards.
12656 *
12657 - * Author Werner Cornelius (werner@titro.de) for Hypercope GmbH
12658 - * Copyright 1999 by Werner Cornelius (werner@titro.de)
12659 - *
12660 - * This software may be used and distributed according to the terms
12661 - * of the GNU General Public License, incorporated herein by reference.
12662 - *
12663 * As all Linux supported cards Champ2, Ergo and Metro2/4 use the same
12664 * DPRAM interface and layout with only minor differences all related
12665 * stuff is done here, not in separate modules.
12666 *
12667 + * written by Werner Cornelius (werner@titro.de) for Hypercope GmbH
12668 + *
12669 + * Copyright 1999 by Werner Cornelius (werner@titro.de)
12670 + *
12671 + * This program is free software; you can redistribute it and/or modify
12672 + * it under the terms of the GNU General Public License as published by
12673 + * the Free Software Foundation; either version 2, or (at your option)
12674 + * any later version.
12675 + *
12676 + * This program is distributed in the hope that it will be useful,
12677 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
12678 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12679 + * GNU General Public License for more details.
12680 + *
12681 + * You should have received a copy of the GNU General Public License
12682 + * along with this program; if not, write to the Free Software
12683 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
12684 + *
12685 */
12686
12687 +#define __NO_VERSION__
12688 #include <linux/config.h>
12689 -#include <linux/sched.h>
12690 +#include <linux/module.h>
12691 +#include <linux/version.h>
12692 +#include <asm/io.h>
12693 #include <linux/signal.h>
12694 #include <linux/kernel.h>
12695 #include <linux/ioport.h>
12696 #include <linux/interrupt.h>
12697 #include <linux/vmalloc.h>
12698 -#include <asm/io.h>
12699
12700 #include "hysdn_defs.h"
12701 #include "boardergo.h"
12702 @@ -45,11 +59,10 @@ ergo_interrupt(int intno, void *dev_id,
12703 if (!card->irq_enabled)
12704 return; /* other device interrupting or irq switched off */
12705
12706 - save_flags(flags);
12707 - cli(); /* no further irqs allowed */
12708 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
12709
12710 if (!(bytein(card->iobase + PCI9050_INTR_REG) & PCI9050_INTR_REG_STAT1)) {
12711 - restore_flags(flags); /* restore old state */
12712 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12713 return; /* no interrupt requested by E1 */
12714 }
12715 /* clear any pending ints on the board */
12716 @@ -63,7 +76,7 @@ ergo_interrupt(int intno, void *dev_id,
12717 queue_task(&card->irq_queue, &tq_immediate);
12718 mark_bh(IMMEDIATE_BH);
12719 }
12720 - restore_flags(flags);
12721 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12722 } /* ergo_interrupt */
12723
12724 /******************************************************************************/
12725 @@ -83,17 +96,15 @@ ergo_irq_bh(hysdn_card * card)
12726 return; /* invalid call */
12727
12728 dpr = card->dpram; /* point to DPRAM */
12729 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
12730
12731 - save_flags(flags);
12732 - cli();
12733 if (card->hw_lock) {
12734 - restore_flags(flags); /* hardware currently unavailable */
12735 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12736 return;
12737 }
12738 card->hw_lock = 1; /* we now lock the hardware */
12739
12740 do {
12741 - sti(); /* reenable other ints */
12742 again = 0; /* assume loop not to be repeated */
12743
12744 if (!dpr->ToHyFlag) {
12745 @@ -113,15 +124,13 @@ ergo_irq_bh(hysdn_card * card)
12746 again = 1; /* restart loop */
12747 }
12748 } /* a message has arrived for us */
12749 - cli(); /* no further ints */
12750 if (again) {
12751 dpr->ToHyInt = 1;
12752 dpr->ToPcInt = 1; /* interrupt to E1 for all cards */
12753 } else
12754 card->hw_lock = 0; /* free hardware again */
12755 } while (again); /* until nothing more to do */
12756 -
12757 - restore_flags(flags);
12758 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12759 } /* ergo_irq_bh */
12760
12761
12762 @@ -138,8 +147,7 @@ ergo_stopcard(hysdn_card * card)
12763 #ifdef CONFIG_HYSDN_CAPI
12764 hycapi_capi_stop(card);
12765 #endif /* CONFIG_HYSDN_CAPI */
12766 - save_flags(flags);
12767 - cli();
12768 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
12769 val = bytein(card->iobase + PCI9050_INTR_REG); /* get actual value */
12770 val &= ~(PCI9050_INTR_REG_ENPCI | PCI9050_INTR_REG_EN1); /* mask irq */
12771 byteout(card->iobase + PCI9050_INTR_REG, val);
12772 @@ -147,8 +155,7 @@ ergo_stopcard(hysdn_card * card)
12773 byteout(card->iobase + PCI9050_USER_IO, PCI9050_E1_RESET); /* reset E1 processor */
12774 card->state = CARD_STATE_UNUSED;
12775 card->err_log_state = ERRLOG_STATE_OFF; /* currently no log active */
12776 -
12777 - restore_flags(flags);
12778 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12779 } /* ergo_stopcard */
12780
12781 /**************************************************************************/
12782 @@ -163,20 +170,17 @@ ergo_set_errlog_state(hysdn_card * card,
12783 card->err_log_state = ERRLOG_STATE_OFF; /* must be off */
12784 return;
12785 }
12786 - save_flags(flags);
12787 - cli();
12788 -
12789 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
12790 if (((card->err_log_state == ERRLOG_STATE_OFF) && !on) ||
12791 ((card->err_log_state == ERRLOG_STATE_ON) && on)) {
12792 - restore_flags(flags);
12793 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12794 return; /* nothing to do */
12795 }
12796 if (on)
12797 card->err_log_state = ERRLOG_STATE_START; /* request start */
12798 else
12799 card->err_log_state = ERRLOG_STATE_STOP; /* request stop */
12800 -
12801 - restore_flags(flags);
12802 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12803 queue_task(&card->irq_queue, &tq_immediate);
12804 mark_bh(IMMEDIATE_BH);
12805 } /* ergo_set_errlog_state */
12806 @@ -245,9 +249,6 @@ ergo_writebootimg(struct HYSDN_CARD *car
12807 while (!dpram->ToHyNoDpramErrLog); /* reread volatile register to flush PCI */
12808
12809 byteout(card->iobase + PCI9050_USER_IO, PCI9050_E1_RUN); /* start E1 processor */
12810 - /* the interrupts are still masked */
12811 -
12812 - sti();
12813 set_current_state(TASK_INTERRUPTIBLE);
12814 schedule_timeout((20 * HZ) / 1000); /* Timeout 20ms */
12815
12816 @@ -282,7 +283,6 @@ ergo_writebootseq(struct HYSDN_CARD *car
12817 dst = sp->Data; /* point to data in spool structure */
12818 buflen = sp->Len; /* maximum len of spooled data */
12819 wr_mirror = sp->WrPtr; /* only once read */
12820 - sti();
12821
12822 /* try until all bytes written or error */
12823 i = 0x1000; /* timeout value */
12824 @@ -358,9 +358,7 @@ ergo_waitpofready(struct HYSDN_CARD *car
12825
12826 if (card->debug_flags & LOG_POF_RECORD)
12827 hysdn_addlog(card, "ERGO: pof boot success");
12828 - save_flags(flags);
12829 - cli();
12830 -
12831 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
12832 card->state = CARD_STATE_RUN; /* now card is running */
12833 /* enable the cards interrupt */
12834 byteout(card->iobase + PCI9050_INTR_REG,
12835 @@ -371,8 +369,7 @@ ergo_waitpofready(struct HYSDN_CARD *car
12836 dpr->ToPcFlag = 0; /* reset data indicator */
12837 dpr->ToHyInt = 1;
12838 dpr->ToPcInt = 1; /* interrupt to E1 for all cards */
12839 -
12840 - restore_flags(flags);
12841 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12842 if ((hynet_enable & (1 << card->myid))
12843 && (i = hysdn_net_create(card)))
12844 {
12845 @@ -387,7 +384,6 @@ ergo_waitpofready(struct HYSDN_CARD *car
12846 #endif /* CONFIG_HYSDN_CAPI */
12847 return (0); /* success */
12848 } /* data has arrived */
12849 - sti();
12850 set_current_state(TASK_INTERRUPTIBLE);
12851 schedule_timeout((50 * HZ) / 1000); /* Timeout 50ms */
12852 } /* wait until timeout */
12853 Index: linux-2.4.35.4/drivers/isdn/hysdn/boardergo.h
12854 ===================================================================
12855 --- linux-2.4.35.4.orig/drivers/isdn/hysdn/boardergo.h
12856 +++ linux-2.4.35.4/drivers/isdn/hysdn/boardergo.h
12857 @@ -1,4 +1,4 @@
12858 -/* $Id: boardergo.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12859 +/* $Id$
12860 *
12861 * Linux driver for HYSDN cards, definitions for ergo type boards (buffers..).
12862 *
12863 @@ -10,6 +10,7 @@
12864 *
12865 */
12866
12867 +#include <linux/isdn_compat.h>
12868
12869 /************************************************/
12870 /* defines for the dual port memory of the card */
12871 Index: linux-2.4.35.4/drivers/isdn/hysdn/hycapi.c
12872 ===================================================================
12873 --- linux-2.4.35.4.orig/drivers/isdn/hysdn/hycapi.c
12874 +++ linux-2.4.35.4/drivers/isdn/hysdn/hycapi.c
12875 @@ -1,4 +1,4 @@
12876 -/* $Id: hycapi.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12877 +/* $Id$
12878 *
12879 * Linux driver for HYSDN cards, CAPI2.0-Interface.
12880 *
12881 @@ -29,7 +29,7 @@
12882 #include "hysdn_defs.h"
12883 #include <linux/kernelcapi.h>
12884
12885 -static char hycapi_revision[]="$Revision: 1.1.4.1 $";
12886 +static char hycapi_revision[]="$Revision$";
12887
12888 unsigned int hycapi_enable = 0xffffffff;
12889 MODULE_PARM(hycapi_enable, "i");
12890 Index: linux-2.4.35.4/drivers/isdn/hysdn/hysdn_boot.c
12891 ===================================================================
12892 --- linux-2.4.35.4.orig/drivers/isdn/hysdn/hysdn_boot.c
12893 +++ linux-2.4.35.4/drivers/isdn/hysdn/hysdn_boot.c
12894 @@ -1,4 +1,4 @@
12895 -/* $Id: hysdn_boot.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12896 +/* $Id$
12897 *
12898 * Linux driver for HYSDN cards
12899 * specific routines for booting and pof handling
12900 @@ -143,7 +143,7 @@ pof_handle_data(hysdn_card * card, int d
12901 (boot->pof_recid == TAG_CABSDATA) ? "CABSDATA" : "ABSDATA",
12902 datlen, boot->pof_recoffset);
12903
12904 - if ((boot->last_error = card->writebootseq(card, boot->buf.BootBuf, datlen)) < 0)
12905 + if ((boot->last_error = card->writebootseq(card, boot->buf.BootBuf, datlen) < 0))
12906 return (boot->last_error); /* error writing data */
12907
12908 if (boot->pof_recoffset + datlen >= boot->pof_reclen)
12909 Index: linux-2.4.35.4/drivers/isdn/hysdn/hysdn_defs.h
12910 ===================================================================
12911 --- linux-2.4.35.4.orig/drivers/isdn/hysdn/hysdn_defs.h
12912 +++ linux-2.4.35.4/drivers/isdn/hysdn/hysdn_defs.h
12913 @@ -1,4 +1,4 @@
12914 -/* $Id: hysdn_defs.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12915 +/* $Id: hysdn_defs.h,v 1.10 2001/09/24 13:23:03 kai Exp $
12916 *
12917 * Linux driver for HYSDN cards
12918 * global definitions and exported vars and functions.
12919 @@ -19,6 +19,11 @@
12920 #include <linux/interrupt.h>
12921 #include <linux/tqueue.h>
12922 #include <linux/skbuff.h>
12923 +#include <linux/isdn_compat.h>
12924 +#include <linux/spinlock.h>
12925 +
12926 +#define HYSDN_SPIN_LOCK(a,b) spin_lock(a)
12927 +#define HYSDN_SPIN_UNLOCK(a,b) spin_unlock(a)
12928
12929 /****************************/
12930 /* storage type definitions */
12931 @@ -176,6 +181,7 @@ typedef struct HYSDN_CARD {
12932 struct tq_struct irq_queue; /* interrupt task queue */
12933 uchar volatile irq_enabled; /* interrupt enabled if != 0 */
12934 uchar volatile hw_lock; /* hardware is currently locked -> no access */
12935 + spinlock_t irq_lock;
12936
12937 /* boot process */
12938 void *boot; /* pointer to boot private data */
12939 Index: linux-2.4.35.4/drivers/isdn/hysdn/hysdn_init.c
12940 ===================================================================
12941 --- linux-2.4.35.4.orig/drivers/isdn/hysdn/hysdn_init.c
12942 +++ linux-2.4.35.4/drivers/isdn/hysdn/hysdn_init.c
12943 @@ -1,4 +1,4 @@
12944 -/* $Id: hysdn_init.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12945 +/* $Id$
12946 *
12947 * Linux driver for HYSDN cards, init functions.
12948 *
12949 @@ -21,6 +21,7 @@
12950
12951 #include "hysdn_defs.h"
12952
12953 +#ifndef COMPAT_HAS_2_2_PCI
12954 static struct pci_device_id hysdn_pci_tbl[] __initdata = {
12955 {PCI_VENDOR_ID_HYPERCOPE, PCI_DEVICE_ID_HYPERCOPE_PLX, PCI_ANY_ID, PCI_SUBDEVICE_ID_HYPERCOPE_METRO},
12956 {PCI_VENDOR_ID_HYPERCOPE, PCI_DEVICE_ID_HYPERCOPE_PLX, PCI_ANY_ID, PCI_SUBDEVICE_ID_HYPERCOPE_CHAMP2},
12957 @@ -29,11 +30,12 @@ static struct pci_device_id hysdn_pci_tb
12958 { } /* Terminating entry */
12959 };
12960 MODULE_DEVICE_TABLE(pci, hysdn_pci_tbl);
12961 +#endif
12962 MODULE_DESCRIPTION("ISDN4Linux: Driver for HYSDN cards");
12963 MODULE_AUTHOR("Werner Cornelius");
12964 MODULE_LICENSE("GPL");
12965
12966 -static char *hysdn_init_revision = "$Revision: 1.1.4.1 $";
12967 +static char *hysdn_init_revision = "$Revision$";
12968 int cardmax; /* number of found cards */
12969 hysdn_card *card_root = NULL; /* pointer to first card */
12970
12971 @@ -91,11 +93,11 @@ search_cards(void)
12972 card->myid = cardmax; /* set own id */
12973 card->bus = akt_pcidev->bus->number;
12974 card->devfn = akt_pcidev->devfn; /* slot + function */
12975 - card->subsysid = akt_pcidev->subsystem_device;
12976 + pci_get_sub_system(akt_pcidev,card->subsysid);
12977 card->irq = akt_pcidev->irq;
12978 - card->iobase = pci_resource_start(akt_pcidev, PCI_REG_PLX_IO_BASE);
12979 - card->plxbase = pci_resource_start(akt_pcidev, PCI_REG_PLX_MEM_BASE);
12980 - card->membase = pci_resource_start(akt_pcidev, PCI_REG_MEMORY_BASE);
12981 + card->iobase = pci_resource_start_io(akt_pcidev, PCI_REG_PLX_IO_BASE);
12982 + card->plxbase = pci_resource_start_mem(akt_pcidev, PCI_REG_PLX_MEM_BASE);
12983 + card->membase = pci_resource_start_mem(akt_pcidev, PCI_REG_MEMORY_BASE);
12984 card->brdtype = BD_NONE; /* unknown */
12985 card->debug_flags = DEF_DEB_FLAGS; /* set default debug */
12986 card->faxchans = 0; /* default no fax channels */
12987 Index: linux-2.4.35.4/drivers/isdn/hysdn/hysdn_net.c
12988 ===================================================================
12989 --- linux-2.4.35.4.orig/drivers/isdn/hysdn/hysdn_net.c
12990 +++ linux-2.4.35.4/drivers/isdn/hysdn/hysdn_net.c
12991 @@ -1,4 +1,4 @@
12992 -/* $Id: hysdn_net.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12993 +/* $Id$
12994 *
12995 * Linux driver for HYSDN cards, net (ethernet type) handling routines.
12996 *
12997 @@ -29,7 +29,7 @@ unsigned int hynet_enable = 0xffffffff;
12998 MODULE_PARM(hynet_enable, "i");
12999
13000 /* store the actual version for log reporting */
13001 -char *hysdn_net_revision = "$Revision: 1.1.4.1 $";
13002 +char *hysdn_net_revision = "$Revision$";
13003
13004 #define MAX_SKB_BUFFERS 20 /* number of buffers for keeping TX-data */
13005
13006 @@ -45,6 +45,10 @@ struct net_local {
13007 /* additional vars may be added here */
13008 char dev_name[9]; /* our own device name */
13009
13010 +#ifdef COMPAT_NO_SOFTNET
13011 + struct sk_buff *tx_skb; /* buffer for tx operation */
13012 +
13013 +#else
13014 /* Tx control lock. This protects the transmit buffer ring
13015 * state along with the "tx full" state of the driver. This
13016 * means all netif_queue flow control actions are protected
13017 @@ -56,6 +60,7 @@ struct net_local {
13018 int sk_count; /* number of buffers currently in ring */
13019
13020 int is_open; /* flag controlling module locking */
13021 +#endif
13022 }; /* net_local */
13023
13024
13025 @@ -83,11 +88,19 @@ net_open(struct net_device *dev)
13026 hysdn_card *card = dev->priv;
13027 int i;
13028
13029 +#ifdef COMPAT_NO_SOFTNET
13030 + dev->tbusy = 0; /* non busy state */
13031 + dev->interrupt = 0;
13032 + if (!dev->start)
13033 + MOD_INC_USE_COUNT; /* increment only if device is down */
13034 + dev->start = 1; /* and started */
13035 +#else
13036 if (!((struct net_local *) dev)->is_open)
13037 MOD_INC_USE_COUNT; /* increment only if interface is actually down */
13038 ((struct net_local *) dev)->is_open = 1; /* device actually open */
13039
13040 netif_start_queue(dev); /* start tx-queueing */
13041 +#endif
13042
13043 /* Fill in the MAC-level header (if not already set) */
13044 if (!card->mac_addr[0]) {
13045 @@ -104,6 +117,7 @@ net_open(struct net_device *dev)
13046 return (0);
13047 } /* net_open */
13048
13049 +#ifndef COMPAT_NO_SOFTNET
13050 /*******************************************/
13051 /* flush the currently occupied tx-buffers */
13052 /* must only be called when device closed */
13053 @@ -119,6 +133,7 @@ flush_tx_buffers(struct net_local *nl)
13054 nl->sk_count--;
13055 }
13056 } /* flush_tx_buffers */
13057 +#endif
13058
13059
13060 /*********************************************************************/
13061 @@ -129,6 +144,15 @@ static int
13062 net_close(struct net_device *dev)
13063 {
13064
13065 +#ifdef COMPAT_NO_SOFTNET
13066 + dev->tbusy = 1; /* we are busy */
13067 +
13068 + if (dev->start)
13069 + MOD_DEC_USE_COUNT; /* dec only if device has been active */
13070 +
13071 + dev->start = 0; /* and not started */
13072 +
13073 +#else
13074 netif_stop_queue(dev); /* disable queueing */
13075
13076 if (((struct net_local *) dev)->is_open)
13077 @@ -136,9 +160,52 @@ net_close(struct net_device *dev)
13078 ((struct net_local *) dev)->is_open = 0;
13079 flush_tx_buffers((struct net_local *) dev);
13080
13081 +#endif
13082 return (0); /* success */
13083 } /* net_close */
13084
13085 +#ifdef COMPAT_NO_SOFTNET
13086 +/************************************/
13087 +/* send a packet on this interface. */
13088 +/* only for kernel versions < 2.3.33 */
13089 +/************************************/
13090 +static int
13091 +net_send_packet(struct sk_buff *skb, struct net_device *dev)
13092 +{
13093 + struct net_local *lp = (struct net_local *) dev;
13094 +
13095 + if (dev->tbusy) {
13096 + /*
13097 + * If we get here, some higher level has decided we are broken.
13098 + * There should really be a "kick me" function call instead.
13099 + * As ISDN may have higher timeouts than real ethernet 10s timeout
13100 + */
13101 + int tickssofar = jiffies - dev->trans_start;
13102 + if (tickssofar < (10000 * HZ) / 1000)
13103 + return 1;
13104 + printk(KERN_WARNING "%s: transmit timed out. \n", dev->name);
13105 + dev->tbusy = 0;
13106 + dev->trans_start = jiffies;
13107 + }
13108 + /*
13109 + * Block a timer-based transmit from overlapping. This could better be
13110 + * done with atomic_swap(1, dev->tbusy), but set_bit() works as well.
13111 + */
13112 + if (test_and_set_bit(0, (void *) &dev->tbusy) != 0)
13113 + printk(KERN_WARNING "%s: Transmitter access conflict.\n", dev->name);
13114 +
13115 + else {
13116 + lp->stats.tx_bytes += skb->len;
13117 + dev->trans_start = jiffies;
13118 + lp->tx_skb = skb; /* remember skb pointer */
13119 + queue_task(&((hysdn_card *) dev->priv)->irq_queue, &tq_immediate);
13120 + mark_bh(IMMEDIATE_BH);
13121 + }
13122 +
13123 + return (0); /* success */
13124 +} /* net_send_packet */
13125 +
13126 +#else
13127 /************************************/
13128 /* send a packet on this interface. */
13129 /* new style for kernel >= 2.3.33 */
13130 @@ -176,6 +243,7 @@ net_send_packet(struct sk_buff *skb, str
13131 return (0); /* success */
13132 } /* net_send_packet */
13133
13134 +#endif
13135
13136
13137 /***********************************************************************/
13138 @@ -190,6 +258,15 @@ hysdn_tx_netack(hysdn_card * card)
13139 if (!lp)
13140 return; /* non existing device */
13141
13142 +#ifdef COMPAT_NO_SOFTNET
13143 + if (lp->tx_skb)
13144 + dev_kfree_skb(lp->tx_skb); /* free tx pointer */
13145 + lp->tx_skb = NULL; /* reset pointer */
13146 +
13147 + lp->stats.tx_packets++;
13148 + lp->netdev.tbusy = 0;
13149 + mark_bh(NET_BH); /* Inform upper layers. */
13150 +#else
13151
13152 if (!lp->sk_count)
13153 return; /* error condition */
13154 @@ -203,6 +280,7 @@ hysdn_tx_netack(hysdn_card * card)
13155
13156 if (lp->sk_count-- == MAX_SKB_BUFFERS) /* dec usage count */
13157 netif_start_queue((struct net_device *) lp);
13158 +#endif
13159 } /* hysdn_tx_netack */
13160
13161 /*****************************************************/
13162 @@ -250,10 +328,15 @@ hysdn_tx_netget(hysdn_card * card)
13163 if (!lp)
13164 return (NULL); /* non existing device */
13165
13166 +#ifdef COMPAT_NO_SOFTNET
13167 + return (lp->tx_skb); /* return packet pointer */
13168 +
13169 +#else
13170 if (!lp->sk_count)
13171 return (NULL); /* nothing available */
13172
13173 return (lp->skbs[lp->out_idx]); /* next packet to send */
13174 +#endif
13175 } /* hysdn_tx_netget */
13176
13177
13178 @@ -296,15 +379,21 @@ hysdn_net_create(hysdn_card * card)
13179 }
13180 memset(dev, 0, sizeof(struct net_local)); /* clean the structure */
13181
13182 +#ifndef COMPAT_NO_SOFTNET
13183 spin_lock_init(&((struct net_local *) dev)->lock);
13184 +#endif
13185
13186 /* initialise necessary or informing fields */
13187 dev->base_addr = card->iobase; /* IO address */
13188 dev->irq = card->irq; /* irq */
13189 dev->init = net_init; /* the init function of the device */
13190 +#ifdef COMPAT_NO_SOFTNET
13191 + dev->name = ((struct net_local *) dev)->dev_name; /* device name */
13192 +#else
13193 if(dev->name) {
13194 strcpy(dev->name, ((struct net_local *) dev)->dev_name);
13195 }
13196 +#endif
13197 if ((i = register_netdev(dev))) {
13198 printk(KERN_WARNING "HYSDN: unable to create network device\n");
13199 kfree(dev);
13200 @@ -333,7 +422,9 @@ hysdn_net_release(hysdn_card * card)
13201 card->netif = NULL; /* clear out pointer */
13202 dev->stop(dev); /* close the device */
13203
13204 +#ifndef COMPAT_NO_SOFTNET
13205 flush_tx_buffers((struct net_local *) dev); /* empty buffers */
13206 +#endif
13207
13208 unregister_netdev(dev); /* release the device */
13209 kfree(dev); /* release the memory allocated */
13210 Index: linux-2.4.35.4/drivers/isdn/hysdn/hysdn_pof.h
13211 ===================================================================
13212 --- linux-2.4.35.4.orig/drivers/isdn/hysdn/hysdn_pof.h
13213 +++ linux-2.4.35.4/drivers/isdn/hysdn/hysdn_pof.h
13214 @@ -1,4 +1,4 @@
13215 -/* $Id: hysdn_pof.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
13216 +/* $Id$
13217 *
13218 * Linux driver for HYSDN cards, definitions used for handling pof-files.
13219 *
13220 Index: linux-2.4.35.4/drivers/isdn/hysdn/hysdn_procconf.c
13221 ===================================================================
13222 --- linux-2.4.35.4.orig/drivers/isdn/hysdn/hysdn_procconf.c
13223 +++ linux-2.4.35.4/drivers/isdn/hysdn/hysdn_procconf.c
13224 @@ -1,4 +1,4 @@
13225 -/* $Id: hysdn_procconf.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
13226 +/* $Id$
13227 *
13228 * Linux driver for HYSDN cards, /proc/net filesystem dir and conf functions.
13229 *
13230 @@ -17,11 +17,13 @@
13231 #include <linux/poll.h>
13232 #include <linux/proc_fs.h>
13233 #include <linux/pci.h>
13234 +#ifndef COMPAT_USE_MODCOUNT_LOCK
13235 #include <linux/smp_lock.h>
13236 +#endif
13237
13238 #include "hysdn_defs.h"
13239
13240 -static char *hysdn_procconf_revision = "$Revision: 1.1.4.1 $";
13241 +static char *hysdn_procconf_revision = "$Revision$";
13242
13243 #define INFO_OUT_LEN 80 /* length of info line including lf */
13244
13245 @@ -212,32 +214,29 @@ hysdn_conf_write(struct file *file, cons
13246 static ssize_t
13247 hysdn_conf_read(struct file *file, char *buf, size_t count, loff_t * off)
13248 {
13249 - loff_t pos = *off;
13250 char *cp;
13251 int i;
13252
13253 if (off != &file->f_pos) /* fs error check */
13254 return -ESPIPE;
13255
13256 - if (!(file->f_mode & FMODE_READ))
13257 - return -EPERM;
13258 -
13259 - if (!(cp = file->private_data))
13260 - return (-EFAULT); /* should never happen */
13261 -
13262 - i = strlen(cp); /* get total string length */
13263 -
13264 - if (pos != (unsigned)pos || pos >= i)
13265 - return 0;
13266 -
13267 - /* still bytes to transfer */
13268 - cp += pos; /* point to desired data offset */
13269 - i -= pos; /* remaining length */
13270 - if (i > count)
13271 - i = count; /* limit length to transfer */
13272 - if (copy_to_user(buf, cp, i))
13273 - return (-EFAULT); /* copy error */
13274 - *off = pos + i; /* adjust offset */
13275 + if (file->f_mode & FMODE_READ) {
13276 + if (!(cp = file->private_data))
13277 + return (-EFAULT); /* should never happen */
13278 + i = strlen(cp); /* get total string length */
13279 + if (*off < i) {
13280 + /* still bytes to transfer */
13281 + cp += *off; /* point to desired data offset */
13282 + i -= *off; /* remaining length */
13283 + if (i > count)
13284 + i = count; /* limit length to transfer */
13285 + if (copy_to_user(buf, cp, i))
13286 + return (-EFAULT); /* copy error */
13287 + *off += i; /* adjust offset */
13288 + } else
13289 + return (0);
13290 + } else
13291 + return (-EPERM); /* no permission to read */
13292
13293 return (i);
13294 } /* hysdn_conf_read */
13295 @@ -254,7 +253,11 @@ hysdn_conf_open(struct inode *ino, struc
13296 char *cp, *tmp;
13297
13298 /* now search the addressed card */
13299 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13300 + MOD_INC_USE_COUNT;
13301 +#else
13302 lock_kernel();
13303 +#endif
13304 card = card_root;
13305 while (card) {
13306 pd = card->procconf;
13307 @@ -263,7 +266,11 @@ hysdn_conf_open(struct inode *ino, struc
13308 card = card->next; /* search next entry */
13309 }
13310 if (!card) {
13311 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13312 + MOD_DEC_USE_COUNT;
13313 +#else
13314 unlock_kernel();
13315 +#endif
13316 return (-ENODEV); /* device is unknown/invalid */
13317 }
13318 if (card->debug_flags & (LOG_PROC_OPEN | LOG_PROC_ALL))
13319 @@ -274,7 +281,11 @@ hysdn_conf_open(struct inode *ino, struc
13320 /* write only access -> write boot file or conf line */
13321
13322 if (!(cnf = kmalloc(sizeof(struct conf_writedata), GFP_KERNEL))) {
13323 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13324 + MOD_DEC_USE_COUNT;
13325 +#else
13326 unlock_kernel();
13327 +#endif
13328 return (-EFAULT);
13329 }
13330 cnf->card = card;
13331 @@ -286,7 +297,11 @@ hysdn_conf_open(struct inode *ino, struc
13332 /* read access -> output card info data */
13333
13334 if (!(tmp = (char *) kmalloc(INFO_OUT_LEN * 2 + 2, GFP_KERNEL))) {
13335 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13336 + MOD_DEC_USE_COUNT;
13337 +#else
13338 unlock_kernel();
13339 +#endif
13340 return (-EFAULT); /* out of memory */
13341 }
13342 filep->private_data = tmp; /* start of string */
13343 @@ -320,10 +335,16 @@ hysdn_conf_open(struct inode *ino, struc
13344 *cp++ = '\n';
13345 *cp = 0; /* end of string */
13346 } else { /* simultaneous read/write access forbidden ! */
13347 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13348 + MOD_DEC_USE_COUNT;
13349 +#else
13350 unlock_kernel();
13351 +#endif
13352 return (-EPERM); /* no permission this time */
13353 }
13354 +#ifndef COMPAT_USE_MODCOUNT_LOCK
13355 unlock_kernel();
13356 +#endif
13357 return (0);
13358 } /* hysdn_conf_open */
13359
13360 @@ -338,7 +359,9 @@ hysdn_conf_close(struct inode *ino, stru
13361 int retval = 0;
13362 struct proc_dir_entry *pd;
13363
13364 +#ifndef COMPAT_USE_MODCOUNT_LOCK
13365 lock_kernel();
13366 +#endif
13367 /* search the addressed card */
13368 card = card_root;
13369 while (card) {
13370 @@ -348,7 +371,9 @@ hysdn_conf_close(struct inode *ino, stru
13371 card = card->next; /* search next entry */
13372 }
13373 if (!card) {
13374 +#ifndef COMPAT_USE_MODCOUNT_LOCK
13375 unlock_kernel();
13376 +#endif
13377 return (-ENODEV); /* device is unknown/invalid */
13378 }
13379 if (card->debug_flags & (LOG_PROC_OPEN | LOG_PROC_ALL))
13380 @@ -371,7 +396,11 @@ hysdn_conf_close(struct inode *ino, stru
13381 if (filep->private_data)
13382 kfree(filep->private_data); /* release memory */
13383 }
13384 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13385 + MOD_DEC_USE_COUNT;
13386 +#else
13387 unlock_kernel();
13388 +#endif
13389 return (retval);
13390 } /* hysdn_conf_close */
13391
13392 @@ -387,6 +416,9 @@ static struct file_operations conf_fops
13393 release: hysdn_conf_close,
13394 };
13395
13396 +#ifdef COMPAT_NO_SOFTNET
13397 +static struct inode_operations conf_inode_operations;
13398 +#endif
13399 /*****************************/
13400 /* hysdn subdir in /proc/net */
13401 /*****************************/
13402 @@ -415,8 +447,17 @@ hysdn_procconf_init(void)
13403 if ((card->procconf = (void *) create_proc_entry(conf_name,
13404 S_IFREG | S_IRUGO | S_IWUSR,
13405 hysdn_proc_entry)) != NULL) {
13406 +#ifdef COMPAT_NO_SOFTNET
13407 + memset(&conf_inode_operations, 0, sizeof(struct inode_operations));
13408 + conf_inode_operations.default_file_ops = &conf_fops;
13409 +
13410 + ((struct proc_dir_entry *) card->procconf)->ops = &conf_inode_operations;
13411 +#else
13412 ((struct proc_dir_entry *) card->procconf)->proc_fops = &conf_fops;
13413 +#ifdef COMPAT_HAS_FILEOP_OWNER
13414 ((struct proc_dir_entry *) card->procconf)->owner = THIS_MODULE;
13415 +#endif
13416 +#endif
13417 hysdn_proclog_init(card); /* init the log file entry */
13418 }
13419 card = card->next; /* next entry */
13420 Index: linux-2.4.35.4/drivers/isdn/hysdn/hysdn_proclog.c
13421 ===================================================================
13422 --- linux-2.4.35.4.orig/drivers/isdn/hysdn/hysdn_proclog.c
13423 +++ linux-2.4.35.4/drivers/isdn/hysdn/hysdn_proclog.c
13424 @@ -1,4 +1,4 @@
13425 -/* $Id: hysdn_proclog.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
13426 +/* $Id$
13427 *
13428 * Linux driver for HYSDN cards, /proc/net filesystem log functions.
13429 *
13430 @@ -16,7 +16,9 @@
13431 #include <linux/poll.h>
13432 #include <linux/proc_fs.h>
13433 #include <linux/pci.h>
13434 +#ifndef COMPAT_USE_MODCOUNT_LOCK
13435 #include <linux/smp_lock.h>
13436 +#endif
13437
13438 #include "hysdn_defs.h"
13439
13440 @@ -115,8 +117,7 @@ put_log_buffer(hysdn_card * card, char *
13441 strcpy(ib->log_start, cp); /* set output string */
13442 ib->next = NULL;
13443 ib->proc_ctrl = pd; /* point to own control structure */
13444 - save_flags(flags);
13445 - cli();
13446 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13447 ib->usage_cnt = pd->if_used;
13448 if (!pd->log_head)
13449 pd->log_head = ib; /* new head */
13450 @@ -124,7 +125,7 @@ put_log_buffer(hysdn_card * card, char *
13451 pd->log_tail->next = ib; /* follows existing messages */
13452 pd->log_tail = ib; /* new tail */
13453 i = pd->del_lock++; /* get lock state */
13454 - restore_flags(flags);
13455 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13456
13457 /* delete old entrys */
13458 if (!i)
13459 @@ -210,7 +211,6 @@ hysdn_log_read(struct file *file, char *
13460 word ino;
13461 struct procdata *pd = NULL;
13462 hysdn_card *card;
13463 - loff_t pos = *off;
13464
13465 if (!*((struct log_data **) file->private_data)) {
13466 if (file->f_flags & O_NONBLOCK)
13467 @@ -235,11 +235,11 @@ hysdn_log_read(struct file *file, char *
13468 return (0);
13469
13470 inf->usage_cnt--; /* new usage count */
13471 - file->private_data = &inf->next; /* next structure */
13472 + (struct log_data **) file->private_data = &inf->next; /* next structure */
13473 if ((len = strlen(inf->log_start)) <= count) {
13474 if (copy_to_user(buf, inf->log_start, len))
13475 return -EFAULT;
13476 - *off = pos + len;
13477 + file->f_pos += len;
13478 return (len);
13479 }
13480 return (0);
13481 @@ -255,7 +255,11 @@ hysdn_log_open(struct inode *ino, struct
13482 struct procdata *pd = NULL;
13483 ulong flags;
13484
13485 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13486 + MOD_INC_USE_COUNT;
13487 +#else
13488 lock_kernel();
13489 +#endif
13490 card = card_root;
13491 while (card) {
13492 pd = card->proclog;
13493 @@ -264,7 +268,11 @@ hysdn_log_open(struct inode *ino, struct
13494 card = card->next; /* search next entry */
13495 }
13496 if (!card) {
13497 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13498 + MOD_DEC_USE_COUNT;
13499 +#else
13500 unlock_kernel();
13501 +#endif
13502 return (-ENODEV); /* device is unknown/invalid */
13503 }
13504 filep->private_data = card; /* remember our own card */
13505 @@ -274,19 +282,24 @@ hysdn_log_open(struct inode *ino, struct
13506 } else if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) {
13507
13508 /* read access -> log/debug read */
13509 - save_flags(flags);
13510 - cli();
13511 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13512 pd->if_used++;
13513 if (pd->log_head)
13514 - filep->private_data = &(pd->log_tail->next);
13515 + (struct log_data **) filep->private_data = &(pd->log_tail->next);
13516 else
13517 - filep->private_data = &(pd->log_head);
13518 - restore_flags(flags);
13519 + (struct log_data **) filep->private_data = &(pd->log_head);
13520 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13521 } else { /* simultaneous read/write access forbidden ! */
13522 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13523 + MOD_DEC_USE_COUNT;
13524 +#else
13525 unlock_kernel();
13526 +#endif
13527 return (-EPERM); /* no permission this time */
13528 }
13529 +#ifndef COMPAT_USE_MODCOUNT_LOCK
13530 unlock_kernel();
13531 +#endif
13532 return (0);
13533 } /* hysdn_log_open */
13534
13535 @@ -306,7 +319,9 @@ hysdn_log_close(struct inode *ino, struc
13536 int flags, retval = 0;
13537
13538
13539 +#ifndef COMPAT_USE_MODCOUNT_LOCK
13540 lock_kernel();
13541 +#endif
13542 if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_WRITE) {
13543 /* write only access -> write debug level written */
13544 retval = 0; /* success */
13545 @@ -314,8 +329,7 @@ hysdn_log_close(struct inode *ino, struc
13546 /* read access -> log/debug read, mark one further file as closed */
13547
13548 pd = NULL;
13549 - save_flags(flags);
13550 - cli();
13551 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13552 inf = *((struct log_data **) filep->private_data); /* get first log entry */
13553 if (inf)
13554 pd = (struct procdata *) inf->proc_ctrl; /* still entries there */
13555 @@ -338,7 +352,7 @@ hysdn_log_close(struct inode *ino, struc
13556 inf->usage_cnt--; /* decrement usage count for buffers */
13557 inf = inf->next;
13558 }
13559 - restore_flags(flags);
13560 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13561
13562 if (pd)
13563 if (pd->if_used <= 0) /* delete buffers if last file closed */
13564 @@ -348,7 +362,11 @@ hysdn_log_close(struct inode *ino, struc
13565 kfree(inf);
13566 }
13567 } /* read access */
13568 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13569 + MOD_DEC_USE_COUNT;
13570 +#else
13571 unlock_kernel();
13572 +#endif
13573
13574 return (retval);
13575 } /* hysdn_log_close */
13576 @@ -400,6 +418,9 @@ static struct file_operations log_fops =
13577 release: hysdn_log_close,
13578 };
13579
13580 +#ifdef COMPAT_NO_SOFTNET
13581 +struct inode_operations log_inode_operations;
13582 +#endif
13583
13584 /***********************************************************************************/
13585 /* hysdn_proclog_init is called when the module is loaded after creating the cards */
13586 @@ -414,10 +435,20 @@ hysdn_proclog_init(hysdn_card * card)
13587
13588 if ((pd = (struct procdata *) kmalloc(sizeof(struct procdata), GFP_KERNEL)) != NULL) {
13589 memset(pd, 0, sizeof(struct procdata));
13590 +#ifdef COMPAT_NO_SOFTNET
13591 + memset(&log_inode_operations, 0, sizeof(struct inode_operations));
13592 + log_inode_operations.default_file_ops = &log_fops;
13593 +#endif
13594 sprintf(pd->log_name, "%s%d", PROC_LOG_BASENAME, card->myid);
13595 if ((pd->log = create_proc_entry(pd->log_name, S_IFREG | S_IRUGO | S_IWUSR, hysdn_proc_entry)) != NULL) {
13596 +#ifdef COMPAT_NO_SOFTNET
13597 + pd->log->ops = &log_inode_operations; /* set new operations table */
13598 +#else
13599 pd->log->proc_fops = &log_fops;
13600 +#ifdef COMPAT_HAS_FILEOP_OWNER
13601 pd->log->owner = THIS_MODULE;
13602 +#endif
13603 +#endif
13604 }
13605
13606 init_waitqueue_head(&(pd->rd_queue));
13607 Index: linux-2.4.35.4/drivers/isdn/hysdn/hysdn_sched.c
13608 ===================================================================
13609 --- linux-2.4.35.4.orig/drivers/isdn/hysdn/hysdn_sched.c
13610 +++ linux-2.4.35.4/drivers/isdn/hysdn/hysdn_sched.c
13611 @@ -1,4 +1,4 @@
13612 -/* $Id: hysdn_sched.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
13613 +/* $Id: hysdn_sched.c,v 1.9 2001/09/24 13:23:03 kai Exp $
13614 *
13615 * Linux driver for HYSDN cards
13616 * scheduler routines for handling exchange card <-> pc.
13617 @@ -12,11 +12,9 @@
13618 */
13619
13620 #include <linux/config.h>
13621 -#include <linux/sched.h>
13622 #include <linux/signal.h>
13623 #include <linux/kernel.h>
13624 #include <linux/ioport.h>
13625 -#include <linux/interrupt.h>
13626 #include <asm/io.h>
13627
13628 #include "hysdn_defs.h"
13629 @@ -151,22 +149,19 @@ hysdn_tx_cfgline(hysdn_card * card, ucha
13630
13631 if (card->debug_flags & LOG_SCHED_ASYN)
13632 hysdn_addlog(card, "async tx-cfg chan=%d len=%d", chan, strlen(line) + 1);
13633 -
13634 - save_flags(flags);
13635 - cli();
13636 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13637 while (card->async_busy) {
13638 - sti();
13639 -
13640 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13641 if (card->debug_flags & LOG_SCHED_ASYN)
13642 hysdn_addlog(card, "async tx-cfg delayed");
13643
13644 set_current_state(TASK_INTERRUPTIBLE);
13645 schedule_timeout((20 * HZ) / 1000); /* Timeout 20ms */
13646 if (!--cnt) {
13647 - restore_flags(flags);
13648 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13649 return (-ERR_ASYNC_TIME); /* timed out */
13650 }
13651 - cli();
13652 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13653 } /* wait for buffer to become free */
13654
13655 strcpy(card->async_data, line);
13656 @@ -177,31 +172,26 @@ hysdn_tx_cfgline(hysdn_card * card, ucha
13657 /* now queue the task */
13658 queue_task(&card->irq_queue, &tq_immediate);
13659 mark_bh(IMMEDIATE_BH);
13660 - sti();
13661 -
13662 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13663 if (card->debug_flags & LOG_SCHED_ASYN)
13664 hysdn_addlog(card, "async tx-cfg data queued");
13665
13666 cnt++; /* short delay */
13667 - cli();
13668 -
13669 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13670 while (card->async_busy) {
13671 - sti();
13672 -
13673 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13674 if (card->debug_flags & LOG_SCHED_ASYN)
13675 hysdn_addlog(card, "async tx-cfg waiting for tx-ready");
13676
13677 set_current_state(TASK_INTERRUPTIBLE);
13678 schedule_timeout((20 * HZ) / 1000); /* Timeout 20ms */
13679 if (!--cnt) {
13680 - restore_flags(flags);
13681 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13682 return (-ERR_ASYNC_TIME); /* timed out */
13683 }
13684 - cli();
13685 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13686 } /* wait for buffer to become free again */
13687 -
13688 - restore_flags(flags);
13689 -
13690 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13691 if (card->debug_flags & LOG_SCHED_ASYN)
13692 hysdn_addlog(card, "async tx-cfg data send");
13693
13694 Index: linux-2.4.35.4/drivers/isdn/icn/icn.c
13695 ===================================================================
13696 --- linux-2.4.35.4.orig/drivers/isdn/icn/icn.c
13697 +++ linux-2.4.35.4/drivers/isdn/icn/icn.c
13698 @@ -1,4 +1,4 @@
13699 -/* $Id: icn.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
13700 +/* $Id$
13701 *
13702 * ISDN low-level module for the ICN active ISDN-Card.
13703 *
13704 @@ -41,7 +41,7 @@ MODULE_PARM_DESC(icn_id2, "ID-String of
13705 #undef MAP_DEBUG
13706
13707 static char
13708 -*revision = "$Revision: 1.1.4.1 $";
13709 +*revision = "$Revision$";
13710
13711 static int icn_addcard(int, char *, char *);
13712
13713 @@ -1634,6 +1634,7 @@ icn_addcard(int port, char *id1, char *i
13714 }
13715
13716 #ifndef MODULE
13717 +#ifdef COMPAT_HAS_NEW_SETUP
13718 static int __init
13719 icn_setup(char *line)
13720 {
13721 @@ -1643,6 +1644,14 @@ icn_setup(char *line)
13722 static char sid2[20];
13723
13724 str = get_options(line, 2, ints);
13725 +#else
13726 +void
13727 +icn_setup(char *str, int *ints)
13728 +{
13729 + char *p;
13730 + static char sid[20];
13731 + static char sid2[20];
13732 +#endif
13733 if (ints[0])
13734 portbase = ints[1];
13735 if (ints[0] > 1)
13736 @@ -1656,9 +1665,13 @@ icn_setup(char *line)
13737 icn_id2 = sid2;
13738 }
13739 }
13740 +#ifdef COMPAT_HAS_NEW_SETUP
13741 return(1);
13742 }
13743 __setup("icn=", icn_setup);
13744 +#else
13745 +}
13746 +#endif
13747 #endif /* MODULE */
13748
13749 static int __init icn_init(void)
13750 Index: linux-2.4.35.4/drivers/isdn/icn/icn.h
13751 ===================================================================
13752 --- linux-2.4.35.4.orig/drivers/isdn/icn/icn.h
13753 +++ linux-2.4.35.4/drivers/isdn/icn/icn.h
13754 @@ -1,4 +1,4 @@
13755 -/* $Id: icn.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
13756 +/* $Id$
13757 *
13758 * ISDN lowlevel-module for the ICN active ISDN-Card.
13759 *
13760 Index: linux-2.4.35.4/drivers/isdn/isdn_audio.c
13761 ===================================================================
13762 --- linux-2.4.35.4.orig/drivers/isdn/isdn_audio.c
13763 +++ linux-2.4.35.4/drivers/isdn/isdn_audio.c
13764 @@ -1,9 +1,9 @@
13765 -/* $Id: isdn_audio.c,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
13766 +/* $Id: isdn_audio.c,v 1.24 2002/08/13 09:57:26 keil Exp $
13767 *
13768 * Linux ISDN subsystem, audio conversion and compression (linklevel).
13769 *
13770 * Copyright 1994-1999 by Fritz Elfert (fritz@isdn4linux.de)
13771 - * DTMF code (c) 1996 by Christian Mock (cm@kukuruz.ping.at)
13772 + * DTMF code (c) 1996 by Christian Mock (cm@tahina.priv.at)
13773 * Silence detection (c) 1998 by Armin Schindler (mac@gismo.telekom.de)
13774 *
13775 * This software may be used and distributed according to the terms
13776 @@ -15,7 +15,7 @@
13777 #include "isdn_audio.h"
13778 #include "isdn_common.h"
13779
13780 -char *isdn_audio_revision = "$Revision: 1.1.4.1 $";
13781 +char *isdn_audio_revision = "$Revision: 1.24 $";
13782
13783 /*
13784 * Misc. lookup-tables.
13785 @@ -169,19 +169,39 @@ static char isdn_audio_ulaw_to_alaw[] =
13786 0x8a, 0x8a, 0x6a, 0x6a, 0xea, 0xea, 0x2a, 0x2a
13787 };
13788
13789 -#define NCOEFF 8 /* number of frequencies to be analyzed */
13790 -#define DTMF_TRESH 4000 /* above this is dtmf */
13791 +#define NCOEFF 16 /* number of frequencies to be analyzed */
13792 +#define DTMF_TRESH 25000 /* above this is dtmf */
13793 #define SILENCE_TRESH 200 /* below this is silence */
13794 +#define H2_TRESH 20000 /* 2nd harmonic */
13795 #define AMP_BITS 9 /* bits per sample, reduced to avoid overflow */
13796 #define LOGRP 0
13797 #define HIGRP 1
13798
13799 +typedef struct {
13800 + int grp; /* low/high group */
13801 + int k; /* k */
13802 + int k2; /* k fuer 2. harmonic */
13803 +} dtmf_t;
13804 +
13805 /* For DTMF recognition:
13806 * 2 * cos(2 * PI * k / N) precalculated for all k
13807 */
13808 static int cos2pik[NCOEFF] =
13809 {
13810 - 55813, 53604, 51193, 48591, 38114, 33057, 25889, 18332
13811 + 55812, 29528, 53603, 24032, 51193, 14443, 48590, 6517,
13812 + 38113, -21204, 33057, -32186, 25889, -45081, 18332, -55279
13813 +};
13814 +
13815 +static dtmf_t dtmf_tones[8] =
13816 +{
13817 + {LOGRP, 0, 1}, /* 697 Hz */
13818 + {LOGRP, 2, 3}, /* 770 Hz */
13819 + {LOGRP, 4, 5}, /* 852 Hz */
13820 + {LOGRP, 6, 7}, /* 941 Hz */
13821 + {HIGRP, 8, 9}, /* 1209 Hz */
13822 + {HIGRP, 10, 11}, /* 1336 Hz */
13823 + {HIGRP, 12, 13}, /* 1477 Hz */
13824 + {HIGRP, 14, 15} /* 1633 Hz */
13825 };
13826
13827 static char dtmf_matrix[4][4] =
13828 @@ -208,7 +228,7 @@ isdn_audio_tlookup(const u_char *table,
13829 : "memory", "ax");
13830 #else
13831 while (n--)
13832 - *buff = table[*(unsigned char *)buff], buff++;
13833 + *buff++ = table[*(unsigned char *)buff];
13834 #endif
13835 }
13836
13837 @@ -479,18 +499,6 @@ isdn_audio_goertzel(int *sample, modem_i
13838 sk2 = sk1;
13839 sk1 = sk;
13840 }
13841 - /* Avoid overflows */
13842 - sk >>= 1;
13843 - sk2 >>= 1;
13844 - /* compute |X(k)|**2 */
13845 - /* report overflows. This should not happen. */
13846 - /* Comment this out if desired */
13847 - if (sk < -32768 || sk > 32767)
13848 - printk(KERN_DEBUG
13849 - "isdn_audio: dtmf goertzel overflow, sk=%d\n", sk);
13850 - if (sk2 < -32768 || sk2 > 32767)
13851 - printk(KERN_DEBUG
13852 - "isdn_audio: dtmf goertzel overflow, sk2=%d\n", sk2);
13853 result[k] =
13854 ((sk * sk) >> AMP_BITS) -
13855 ((((cos2pik[k] * sk) >> 15) * sk2) >> AMP_BITS) +
13856 @@ -514,58 +522,28 @@ isdn_audio_eval_dtmf(modem_info * info)
13857 int grp[2];
13858 char what;
13859 char *p;
13860 - int thresh;
13861
13862 while ((skb = skb_dequeue(&info->dtmf_queue))) {
13863 result = (int *) skb->data;
13864 s = info->dtmf_state;
13865 - grp[LOGRP] = grp[HIGRP] = -1;
13866 + grp[LOGRP] = grp[HIGRP] = -2;
13867 silence = 0;
13868 - thresh = 0;
13869 - for (i = 0; i < NCOEFF; i++) {
13870 - if (result[i] > DTMF_TRESH) {
13871 - if (result[i] > thresh)
13872 - thresh = result[i];
13873 - }
13874 - else if (result[i] < SILENCE_TRESH)
13875 + for (i = 0; i < 8; i++) {
13876 + if ((result[dtmf_tones[i].k] > DTMF_TRESH) &&
13877 + (result[dtmf_tones[i].k2] < H2_TRESH))
13878 + grp[dtmf_tones[i].grp] = (grp[dtmf_tones[i].grp] == -2) ? i : -1;
13879 + else if ((result[dtmf_tones[i].k] < SILENCE_TRESH) &&
13880 + (result[dtmf_tones[i].k2] < SILENCE_TRESH))
13881 silence++;
13882 }
13883 - if (silence == NCOEFF)
13884 + if (silence == 8)
13885 what = ' ';
13886 else {
13887 - if (thresh > 0) {
13888 - thresh = thresh >> 4; /* touchtones must match within 12 dB */
13889 - for (i = 0; i < NCOEFF; i++) {
13890 - if (result[i] < thresh)
13891 - continue; /* ignore */
13892 - /* good level found. This is allowed only one time per group */
13893 - if (i < NCOEFF / 2) {
13894 - /* lowgroup*/
13895 - if (grp[LOGRP] >= 0) {
13896 - // Bad. Another tone found. */
13897 - grp[LOGRP] = -1;
13898 - break;
13899 - }
13900 - else
13901 - grp[LOGRP] = i;
13902 - }
13903 - else { /* higroup */
13904 - if (grp[HIGRP] >= 0) { // Bad. Another tone found. */
13905 - grp[HIGRP] = -1;
13906 - break;
13907 - }
13908 - else
13909 - grp[HIGRP] = i - NCOEFF/2;
13910 - }
13911 - }
13912 - if ((grp[LOGRP] >= 0) && (grp[HIGRP] >= 0)) {
13913 - what = dtmf_matrix[grp[LOGRP]][grp[HIGRP]];
13914 - if (s->last != ' ' && s->last != '.')
13915 - s->last = what; /* min. 1 non-DTMF between DTMF */
13916 - } else
13917 - what = '.';
13918 - }
13919 - else
13920 + if ((grp[LOGRP] >= 0) && (grp[HIGRP] >= 0)) {
13921 + what = dtmf_matrix[grp[LOGRP]][grp[HIGRP] - 4];
13922 + if (s->last != ' ' && s->last != '.')
13923 + s->last = what; /* min. 1 non-DTMF between DTMF */
13924 + } else
13925 what = '.';
13926 }
13927 if ((what != s->last) && (what != ' ') && (what != '.')) {
13928 Index: linux-2.4.35.4/drivers/isdn/isdn_audio.h
13929 ===================================================================
13930 --- linux-2.4.35.4.orig/drivers/isdn/isdn_audio.h
13931 +++ linux-2.4.35.4/drivers/isdn/isdn_audio.h
13932 @@ -1,4 +1,4 @@
13933 -/* $Id: isdn_audio.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
13934 +/* $Id: isdn_audio.h,v 1.10 2001/09/24 13:22:42 kai Exp $
13935 *
13936 * Linux ISDN subsystem, audio conversion and compression (linklevel).
13937 *
13938 @@ -20,7 +20,6 @@ typedef struct adpcm_state {
13939
13940 typedef struct dtmf_state {
13941 char last;
13942 - char llast;
13943 int idx;
13944 int buf[DTMF_NPOINTS];
13945 } dtmf_state;
13946 Index: linux-2.4.35.4/drivers/isdn/isdn_bsdcomp.c
13947 ===================================================================
13948 --- linux-2.4.35.4.orig/drivers/isdn/isdn_bsdcomp.c
13949 +++ linux-2.4.35.4/drivers/isdn/isdn_bsdcomp.c
13950 @@ -105,6 +105,14 @@ MODULE_LICENSE("Dual BSD/GPL");
13951
13952 #define DEBUG 1
13953
13954 +#ifdef CONFIG_ISDN_WITH_ABC
13955 +#define BSD_C_MALLOC(x) kmalloc((x),GFP_ATOMIC)
13956 +#define BSD_C_FREE(x) kfree(x)
13957 +#else
13958 +#define BSD_C_MALLOC(x) vmalloc(x)
13959 +#define BSD_C_FREE(x) vfree(x)
13960 +#endif
13961 +
13962 /*
13963 * A dictionary for doing BSD compress.
13964 */
13965 @@ -285,7 +293,7 @@ static void bsd_free (void *state)
13966 * Release the dictionary
13967 */
13968 if (db->dict) {
13969 - vfree (db->dict);
13970 + BSD_C_FREE (db->dict);
13971 db->dict = NULL;
13972 }
13973
13974 @@ -293,7 +301,7 @@ static void bsd_free (void *state)
13975 * Release the string buffer
13976 */
13977 if (db->lens) {
13978 - vfree (db->lens);
13979 + BSD_C_FREE (db->lens);
13980 db->lens = NULL;
13981 }
13982
13983 @@ -350,14 +358,19 @@ static void *bsd_alloc (struct isdn_ppp_
13984 * Allocate space for the dictionary. This may be more than one page in
13985 * length.
13986 */
13987 - db->dict = (struct bsd_dict *) vmalloc (hsize * sizeof (struct bsd_dict));
13988 + db->dict = (struct bsd_dict *) BSD_C_MALLOC (hsize * sizeof (struct bsd_dict));
13989 +
13990 + MOD_INC_USE_COUNT;
13991 + /*
13992 + ** MOD_INC_USE_COUNT must be before bsd_free
13993 + ** bsd_free make MOD_DEC_USE_COUNT if db != NULL
13994 + */
13995 +
13996 if (!db->dict) {
13997 bsd_free (db);
13998 return NULL;
13999 }
14000
14001 - MOD_INC_USE_COUNT;
14002 -
14003 /*
14004 * If this is the compression buffer then there is no length data.
14005 * For decompression, the length information is needed as well.
14006 @@ -365,7 +378,7 @@ static void *bsd_alloc (struct isdn_ppp_
14007 if (!decomp)
14008 db->lens = NULL;
14009 else {
14010 - db->lens = (unsigned short *) vmalloc ((maxmaxcode + 1) *
14011 + db->lens = (unsigned short *) BSD_C_MALLOC ((maxmaxcode + 1) *
14012 sizeof (db->lens[0]));
14013 if (!db->lens) {
14014 bsd_free (db); /* calls MOD_DEC_USE_COUNT; */
14015 @@ -478,7 +491,11 @@ static int bsd_compress (void *state, st
14016 int hval,disp,ilen,mxcode;
14017 unsigned char *rptr = skb_in->data;
14018 int isize = skb_in->len;
14019 +#ifdef CONFIG_ISDN_WITH_ABC
14020 + long secure = 0;
14021 +#endif
14022
14023 +#ifndef CONFIG_ISDN_WITH_ABC
14024 #define OUTPUT(ent) \
14025 { \
14026 bitno -= n_bits; \
14027 @@ -490,17 +507,45 @@ static int bsd_compress (void *state, st
14028 bitno += 8; \
14029 } while (bitno <= 24); \
14030 }
14031 +#else
14032 +#define OUTPUT(ent) \
14033 + { \
14034 + secure = 0; \
14035 + bitno -= n_bits; \
14036 + accm |= ((ent) << bitno); \
14037 + do { \
14038 + if(skb_out && skb_tailroom(skb_out) > 0) \
14039 + *(skb_put(skb_out,1)) = (unsigned char) (accm>>24); \
14040 + accm <<= 8; \
14041 + bitno += 8; \
14042 + } while (bitno <= 24 && ++secure < 10000); \
14043 + if(secure >= 10000) { \
14044 + printk(KERN_DEBUG "BSD in OUTPUT secure counter reached\n"); \
14045 + return 0; \
14046 + } \
14047 + }
14048 +#endif
14049
14050 /*
14051 * If the protocol is not in the range we're interested in,
14052 * just return without compressing the packet. If it is,
14053 * the protocol becomes the first byte to compress.
14054 */
14055 +#ifdef CONFIG_ISDN_WITH_ABC
14056 + ent = proto;
14057 +
14058 + if (proto < 0x21 || proto > 0xf9 || !(proto & 0x1) ) {
14059 +
14060 + printk(KERN_DEBUG "bsd_compress called with %x\n",proto);
14061 + return 0;
14062 + }
14063 +#else
14064 printk(KERN_DEBUG "bsd_compress called with %x\n",proto);
14065
14066 ent = proto;
14067 if (proto < 0x21 || proto > 0xf9 || !(proto & 0x1) )
14068 return 0;
14069 +#endif
14070
14071 db = (struct bsd_db *) state;
14072 hshift = db->hshift;
14073 @@ -538,6 +583,9 @@ static int bsd_compress (void *state, st
14074
14075 /* continue probing until a match or invalid entry */
14076 disp = (hval == 0) ? 1 : hval;
14077 +#ifdef CONFIG_ISDN_WITH_ABC
14078 + secure = 0;
14079 +#endif
14080
14081 do {
14082 hval += disp;
14083 @@ -546,7 +594,15 @@ static int bsd_compress (void *state, st
14084 dictp = dict_ptr (db, hval);
14085 if (dictp->codem1 >= max_ent)
14086 goto nomatch;
14087 +#ifndef CONFIG_ISDN_WITH_ABC
14088 } while (dictp->fcode != fcode);
14089 +#else
14090 + } while (dictp->fcode != fcode && ++secure < 100000);
14091 + if(secure >= 100000) {
14092 + printk(KERN_DEBUG "BSD: compress while dictp->fcode != fcode secure-counter reached\n");
14093 + return 0;
14094 + }
14095 +#endif
14096
14097 ent = dictp->codem1 + 1; /* finally found (prefix,suffix) */
14098 continue;
14099 @@ -669,6 +725,9 @@ static int bsd_decompress (void *state,
14100 int ilen;
14101 int codelen;
14102 int extra;
14103 +#ifdef CONFIG_ISDN_WITH_ABC
14104 + unsigned long secure = 0;
14105 +#endif
14106
14107 db = (struct bsd_db *) state;
14108 max_ent = db->max_ent;
14109 @@ -677,7 +736,9 @@ static int bsd_decompress (void *state,
14110 n_bits = db->n_bits;
14111 tgtbitno = 32 - n_bits; /* bitno when we have a code */
14112
14113 +#ifndef CONFIG_ISDN_WITH_ABC
14114 printk(KERN_DEBUG "bsd_decompress called\n");
14115 +#endif
14116
14117 if(!skb_in || !skb_out) {
14118 printk(KERN_ERR "bsd_decompress called with NULL parameter\n");
14119 @@ -795,7 +856,11 @@ static int bsd_decompress (void *state,
14120
14121 p = skb_put(skb_out,codelen);
14122 p += codelen;
14123 +#ifdef CONFIG_ISDN_WITH_ABC
14124 + for(secure = 0; finchar > LAST && secure < 50000;secure++) {
14125 +#else
14126 while (finchar > LAST) {
14127 +#endif
14128 struct bsd_dict *dictp2 = dict_ptr (db, finchar);
14129
14130 dictp = dict_ptr (db, dictp2->cptr);
14131 @@ -822,6 +887,12 @@ static int bsd_decompress (void *state,
14132 }
14133 }
14134 *--p = finchar;
14135 +#ifdef CONFIG_ISDN_WITH_ABC
14136 + if(secure >= 50000) {
14137 + printk(KERN_DEBUG "BSD: decompress secure-counter reached\n");
14138 + return DECOMP_FATALERROR;
14139 + }
14140 +#endif
14141
14142 #ifdef DEBUG
14143 if (--codelen != 0)
14144 @@ -851,12 +922,23 @@ static int bsd_decompress (void *state,
14145 /* look for a free hash table entry */
14146 if (dictp->codem1 < max_ent) {
14147 disp = (hval == 0) ? 1 : hval;
14148 +#ifdef CONFIG_ISDN_WITH_ABC
14149 + secure = 0;
14150 +#endif
14151 do {
14152 hval += disp;
14153 if (hval >= db->hsize)
14154 hval -= db->hsize;
14155 dictp = dict_ptr (db, hval);
14156 +#ifndef CONFIG_ISDN_WITH_ABC
14157 } while (dictp->codem1 < max_ent);
14158 +#else
14159 + } while (dictp->codem1 < max_ent && ++secure < 50000);
14160 + if(secure >= 50000) {
14161 + printk(KERN_DEBUG "BSD: decomp while (dictp->codem1 < max_ent) secure-counter reached\n");
14162 + return DECOMP_FATALERROR;
14163 + }
14164 +#endif
14165 }
14166
14167 /*
14168 @@ -895,11 +977,21 @@ static int bsd_decompress (void *state,
14169 db->comp_bytes += skb_in->len - BSD_OVHD;
14170 db->uncomp_bytes += skb_out->len;
14171
14172 +#ifdef CONFIG_ISDN_WITH_ABC
14173 + /*
14174 + ** bsd_check will call bsd_clear
14175 + ** and so on the internal tables will be cleared.
14176 + **
14177 + ** I think that's not what we will at this point ?????
14178 + ** For me at works without bsd_check.
14179 + */
14180 +#else
14181 if (bsd_check(db)) {
14182 if (db->debug)
14183 printk(KERN_DEBUG "bsd_decomp%d: peer should have cleared dictionary on %d\n",
14184 db->unit, db->seqno - 1);
14185 }
14186 +#endif
14187 return skb_out->len;
14188 }
14189
14190 Index: linux-2.4.35.4/drivers/isdn/isdn_common.c
14191 ===================================================================
14192 --- linux-2.4.35.4.orig/drivers/isdn/isdn_common.c
14193 +++ linux-2.4.35.4/drivers/isdn/isdn_common.c
14194 @@ -1,4 +1,4 @@
14195 -/* $Id: isdn_common.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
14196 +/* $Id: isdn_common.c,v 1.137 2002/02/09 21:19:11 keil Exp $
14197 *
14198 * Linux ISDN subsystem, common used functions (linklevel).
14199 *
14200 @@ -19,6 +19,7 @@
14201 #include <linux/vmalloc.h>
14202 #include <linux/isdn.h>
14203 #include <linux/smp_lock.h>
14204 +#include <linux/list.h>
14205 #include "isdn_common.h"
14206 #include "isdn_tty.h"
14207 #include "isdn_net.h"
14208 @@ -33,7 +34,9 @@
14209 #include <linux/isdn_divertif.h>
14210 #endif /* CONFIG_ISDN_DIVERSION */
14211 #include "isdn_v110.h"
14212 +#ifdef HAVE_DEVFS_FS
14213 #include <linux/devfs_fs_kernel.h>
14214 +#endif /* HAVE_DEVFS_FS */
14215
14216 /* Debugflags */
14217 #undef ISDN_DEBUG_STATCALLB
14218 @@ -44,7 +47,7 @@ MODULE_LICENSE("GPL");
14219
14220 isdn_dev *dev;
14221
14222 -static char *isdn_revision = "$Revision: 1.1.4.1 $";
14223 +static char *isdn_revision = "$Revision: 1.137 $";
14224
14225 extern char *isdn_net_revision;
14226 extern char *isdn_tty_revision;
14227 @@ -67,19 +70,19 @@ static isdn_divert_if *divert_if; /* = N
14228
14229 static int isdn_writebuf_stub(int, int, const u_char *, int, int);
14230 static void set_global_features(void);
14231 +#ifdef HAVE_DEVFS_FS
14232 static void isdn_register_devfs(int);
14233 static void isdn_unregister_devfs(int);
14234 +#endif /* HAVE_DEVFS_FS */
14235 static int isdn_wildmat(char *s, char *p);
14236
14237 void
14238 isdn_lock_drivers(void)
14239 {
14240 int i;
14241 - isdn_ctrl cmd;
14242
14243 - for (i = 0; i < ISDN_MAX_DRIVERS; i++) {
14244 - if (!dev->drv[i])
14245 - continue;
14246 + for (i = 0; i < dev->drivers; i++) {
14247 + isdn_ctrl cmd;
14248
14249 cmd.driver = i;
14250 cmd.arg = 0;
14251 @@ -101,10 +104,7 @@ isdn_unlock_drivers(void)
14252 {
14253 int i;
14254
14255 - for (i = 0; i < ISDN_MAX_DRIVERS; i++) {
14256 - if (!dev->drv[i])
14257 - continue;
14258 -
14259 + for (i = 0; i < dev->drivers; i++)
14260 if (dev->drv[i]->locks > 0) {
14261 isdn_ctrl cmd;
14262
14263 @@ -114,7 +114,6 @@ isdn_unlock_drivers(void)
14264 isdn_command(&cmd);
14265 dev->drv[i]->locks--;
14266 }
14267 - }
14268 }
14269
14270 void
14271 @@ -473,6 +472,7 @@ isdn_status_callback(isdn_ctrl * c)
14272 dev->drv[di]->flags &= ~DRV_FLAG_RUNNING;
14273 break;
14274 case ISDN_STAT_ICALL:
14275 + case ISDN_STAT_ICALLW:
14276 if (i < 0)
14277 return -1;
14278 #ifdef ISDN_DEBUG_STATCALLB
14279 @@ -718,7 +718,9 @@ isdn_status_callback(isdn_ctrl * c)
14280 dev->drvmap[i] = -1;
14281 dev->chanmap[i] = -1;
14282 dev->usage[i] &= ~ISDN_USAGE_DISABLED;
14283 +#ifdef HAVE_DEVFS_FS
14284 isdn_unregister_devfs(i);
14285 +#endif /* HAVE_DEVFS_FS */
14286 }
14287 dev->drivers--;
14288 dev->channels -= dev->drv[di]->channels;
14289 @@ -755,6 +757,10 @@ isdn_status_callback(isdn_ctrl * c)
14290 if (divert_if)
14291 return(divert_if->stat_callback(c));
14292 #endif /* CONFIG_ISDN_DIVERSION */
14293 + case ISDN_STAT_ALERT:
14294 + case ISDN_STAT_PROCEED:
14295 + isdn_tty_stat_callback(i, c);
14296 + break;
14297 default:
14298 return -1;
14299 }
14300 @@ -900,72 +906,239 @@ isdn_minor2chan(int minor)
14301 return (dev->chanmap[minor]);
14302 }
14303
14304 -static char *
14305 -isdn_statstr(void)
14306 +// ----------------------------------------------------------------------
14307 +// /dev/isdninfo
14308 +//
14309 +// This device has somewhat insane semantics, but we need to support
14310 +// them for the sake of compatibility.
14311 +//
14312 +// After opening, the first read will succeed and return the current state
14313 +// Then, unless O_NONBLOCK is set, it will block until a state change happens
14314 +// and then return the new state.
14315 +// Also, if the buffer size for the read is too small, we'll just return
14316 +// EOF
14317 +
14318 +struct isdnstatus_dev {
14319 + struct list_head list;
14320 + int update;
14321 +};
14322 +
14323 +static DECLARE_WAIT_QUEUE_HEAD(isdnstatus_waitq);
14324 +static LIST_HEAD(isdnstatus_devs);
14325 +static spinlock_t isdnstatus_devs_lock = SPIN_LOCK_UNLOCKED;
14326 +
14327 +void
14328 +isdn_info_update(void)
14329 +{
14330 + struct list_head *p;
14331 + struct isdnstatus_dev *idev;
14332 +
14333 + spin_lock(&isdnstatus_devs_lock);
14334 + list_for_each(p, &isdnstatus_devs) {
14335 + idev = list_entry(p, struct isdnstatus_dev, list);
14336 + idev->update = 1;
14337 + }
14338 + spin_unlock(&isdnstatus_devs_lock);
14339 + wake_up_interruptible(&isdnstatus_waitq);
14340 +}
14341 +
14342 +static int
14343 +isdnstatus_open(struct inode *ino, struct file *filep)
14344 +{
14345 + struct isdnstatus_dev *p;
14346 +
14347 + p = kmalloc(sizeof(struct isdnstatus_dev), GFP_USER);
14348 + if (!p)
14349 + return -ENOMEM;
14350 +
14351 + /* At opening time we allow a single update */
14352 + p->update = 1;
14353 + spin_lock(&isdnstatus_devs_lock);
14354 + list_add(&p->list, &isdnstatus_devs);
14355 + spin_unlock(&isdnstatus_devs_lock);
14356 + filep->private_data = p;
14357 +
14358 + return 0;
14359 +}
14360 +
14361 +static void
14362 +isdnstatus_close(struct inode *ino, struct file *filep)
14363 +{
14364 + struct isdnstatus_dev *p = filep->private_data;
14365 +
14366 + spin_lock(&isdnstatus_devs_lock);
14367 + list_del(&p->list);
14368 + spin_unlock(&isdnstatus_devs_lock);
14369 + kfree(p);
14370 +}
14371 +
14372 +// FIXME we don't lock against the state changing whilst being
14373 +// printed
14374 +
14375 +void
14376 +isdn_statstr(char *buf)
14377 {
14378 - static char istatbuf[2048];
14379 char *p;
14380 int i;
14381
14382 - sprintf(istatbuf, "idmap:\t");
14383 - p = istatbuf + strlen(istatbuf);
14384 + p = buf;
14385 + p += sprintf(p, "idmap:\t");
14386 for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
14387 - sprintf(p, "%s ", (dev->drvmap[i] < 0) ? "-" : dev->drvid[dev->drvmap[i]]);
14388 - p = istatbuf + strlen(istatbuf);
14389 + p += sprintf(p, "%s ", (dev->drvmap[i] < 0) ? "-" : dev->drvid[dev->drvmap[i]]);
14390 }
14391 - sprintf(p, "\nchmap:\t");
14392 - p = istatbuf + strlen(istatbuf);
14393 + p += sprintf(p, "\nchmap:\t");
14394 for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
14395 - sprintf(p, "%d ", dev->chanmap[i]);
14396 - p = istatbuf + strlen(istatbuf);
14397 + p += sprintf(p, "%d ", dev->chanmap[i]);
14398 }
14399 - sprintf(p, "\ndrmap:\t");
14400 - p = istatbuf + strlen(istatbuf);
14401 + p += sprintf(p, "\ndrmap:\t");
14402 for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
14403 - sprintf(p, "%d ", dev->drvmap[i]);
14404 - p = istatbuf + strlen(istatbuf);
14405 + p += sprintf(p, "%d ", dev->drvmap[i]);
14406 }
14407 - sprintf(p, "\nusage:\t");
14408 - p = istatbuf + strlen(istatbuf);
14409 + p += sprintf(p, "\nusage:\t");
14410 for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
14411 - sprintf(p, "%d ", dev->usage[i]);
14412 - p = istatbuf + strlen(istatbuf);
14413 + p += sprintf(p, "%d ", dev->usage[i]);
14414 }
14415 - sprintf(p, "\nflags:\t");
14416 - p = istatbuf + strlen(istatbuf);
14417 + p += sprintf(p, "\nflags:\t");
14418 for (i = 0; i < ISDN_MAX_DRIVERS; i++) {
14419 if (dev->drv[i]) {
14420 - sprintf(p, "%ld ", dev->drv[i]->online);
14421 - p = istatbuf + strlen(istatbuf);
14422 + p += sprintf(p, "%ld ", dev->drv[i]->online);
14423 } else {
14424 - sprintf(p, "? ");
14425 - p = istatbuf + strlen(istatbuf);
14426 + p += sprintf(p, "? ");
14427 }
14428 }
14429 - sprintf(p, "\nphone:\t");
14430 - p = istatbuf + strlen(istatbuf);
14431 + p += sprintf(p, "\nphone:\t");
14432 for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
14433 - sprintf(p, "%s ", dev->num[i]);
14434 - p = istatbuf + strlen(istatbuf);
14435 + p += sprintf(p, "%s ", dev->num[i]);
14436 }
14437 - sprintf(p, "\n");
14438 - return istatbuf;
14439 + p += sprintf(p, "\n");
14440 }
14441
14442 -/* Module interface-code */
14443 +static ssize_t
14444 +isdnstatus_read(struct file *file, char *buf, size_t count, loff_t * off)
14445 +{
14446 + static DECLARE_MUTEX(istatbuf_mutex);
14447 + static char istatbuf[2048];
14448
14449 -void
14450 -isdn_info_update(void)
14451 + DECLARE_WAITQUEUE(wait, current);
14452 + struct isdnstatus_dev *idev;
14453 + int retval = 0;
14454 + unsigned int len;
14455 +
14456 + idev = file->private_data;
14457 +
14458 + if (off != &file->f_pos)
14459 + return -ESPIPE;
14460 +
14461 + add_wait_queue(&isdnstatus_waitq, &wait);
14462 + for (;;) {
14463 + set_current_state(TASK_INTERRUPTIBLE);
14464 +
14465 + if (idev->update)
14466 + break;
14467 +
14468 + retval = -EAGAIN;
14469 + if (file->f_flags & O_NONBLOCK)
14470 + break;
14471 +
14472 + retval = -ERESTARTSYS;
14473 + if (signal_pending(current))
14474 + break;
14475 +
14476 + schedule();
14477 + }
14478 + __set_current_state(TASK_RUNNING);
14479 + remove_wait_queue(&isdnstatus_waitq, &wait);
14480 +
14481 + if (!idev->update)
14482 + goto out;
14483 +
14484 + idev->update = 0;
14485 + down(&istatbuf_mutex);
14486 + isdn_statstr(istatbuf);
14487 + len = strlen(istatbuf);
14488 + if (len > count) {
14489 + retval = 0;
14490 + goto out_unlock;
14491 + }
14492 + if (copy_to_user(buf, istatbuf, len)) {
14493 + retval = -EFAULT;
14494 + goto out_unlock;
14495 + }
14496 + *off += len;
14497 + retval = len;
14498 +
14499 + out_unlock:
14500 + up(&istatbuf_mutex);
14501 + out:
14502 + return retval;
14503 +}
14504 +
14505 +static ssize_t
14506 +isdnstatus_write(struct file *file, const char *buf, size_t count, loff_t * off)
14507 {
14508 - infostruct *p = dev->infochain;
14509 + return -EINVAL;
14510 +}
14511 +
14512 +static unsigned int
14513 +isdnstatus_poll(struct file *file, poll_table * wait)
14514 +{
14515 + struct isdnstatus_dev *idev;
14516 + unsigned int mask = 0;
14517 +
14518 + idev = file->private_data;
14519
14520 - while (p) {
14521 - *(p->private) = 1;
14522 - p = (infostruct *) p->next;
14523 + poll_wait(file, &isdnstatus_waitq, wait);
14524 + if (idev->update) {
14525 + mask |= POLLIN | POLLRDNORM;
14526 }
14527 - wake_up_interruptible(&(dev->info_waitq));
14528 + return mask;
14529 }
14530
14531 +static int
14532 +isdnstatus_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
14533 +{
14534 + int retval;
14535 + isdn_net_ioctl_phone phone;
14536 +
14537 + switch (cmd) {
14538 + case IIOCGETDVR:
14539 + return (TTY_DV +
14540 + (NET_DV << 8) +
14541 + (INF_DV << 16));
14542 + case IIOCGETCPS:
14543 + if (arg) {
14544 + ulong *p = (ulong *) arg;
14545 + int i;
14546 + if ((retval = verify_area(VERIFY_WRITE, (void *) arg,
14547 + sizeof(ulong) * ISDN_MAX_CHANNELS * 2)))
14548 + return retval;
14549 + for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
14550 + put_user(dev->ibytes[i], p++);
14551 + put_user(dev->obytes[i], p++);
14552 + }
14553 + return 0;
14554 + } else
14555 + return -EINVAL;
14556 + break;
14557 +#ifdef CONFIG_NETDEVICES
14558 + case IIOCNETGPN:
14559 + /* Get peer phone number of a connected
14560 + * isdn network interface */
14561 + if (arg) {
14562 + if (copy_from_user((char *) &phone, (char *) arg, sizeof(phone)))
14563 + return -EFAULT;
14564 + return isdn_net_getpeer(&phone, (isdn_net_ioctl_phone *) arg);
14565 + } else
14566 + return -EINVAL;
14567 +#endif
14568 + default:
14569 + return -EINVAL;
14570 + }
14571 +}
14572 +
14573 +// ----------------------------------------------------------------------
14574 +
14575 +
14576 static ssize_t
14577 isdn_read(struct file *file, char *buf, size_t count, loff_t * off)
14578 {
14579 @@ -976,37 +1149,16 @@ isdn_read(struct file *file, char *buf,
14580 int chidx;
14581 int retval;
14582 char *p;
14583 - loff_t pos = *off;
14584
14585 if (off != &file->f_pos)
14586 return -ESPIPE;
14587
14588 - if (pos != (unsigned) pos)
14589 - return -EINVAL;
14590 -
14591 +#ifndef COMPAT_HAVE_READ_LOCK_KERNEL
14592 lock_kernel();
14593 - if (minor == ISDN_MINOR_STATUS) {
14594 - if (!file->private_data) {
14595 - if (file->f_flags & O_NONBLOCK) {
14596 - retval = -EAGAIN;
14597 - goto out;
14598 - }
14599 - interruptible_sleep_on(&(dev->info_waitq));
14600 - }
14601 - p = isdn_statstr();
14602 - file->private_data = 0;
14603 - if ((len = strlen(p)) <= count) {
14604 - if (copy_to_user(buf, p, len)) {
14605 - retval = -EFAULT;
14606 - goto out;
14607 - }
14608 - *off = pos + len;
14609 - retval = len;
14610 - goto out;
14611 - }
14612 - retval = 0;
14613 - goto out;
14614 - }
14615 +#endif
14616 + if (minor == ISDN_MINOR_STATUS)
14617 + return isdnstatus_read(file, buf, count, off);
14618 +
14619 if (!dev->drivers) {
14620 retval = -ENODEV;
14621 goto out;
14622 @@ -1031,7 +1183,7 @@ isdn_read(struct file *file, char *buf,
14623 cli();
14624 len = isdn_readbchan(drvidx, chidx, p, 0, count,
14625 &dev->drv[drvidx]->rcv_waitq[chidx]);
14626 - *off = pos + len;
14627 + *off += len;
14628 restore_flags(flags);
14629 if (copy_to_user(buf,p,len))
14630 len = -EFAULT;
14631 @@ -1052,6 +1204,9 @@ isdn_read(struct file *file, char *buf,
14632 }
14633 interruptible_sleep_on(&(dev->drv[drvidx]->st_waitq));
14634 }
14635 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
14636 + if(drvidx || (len = isdn_dw_abc_lcr_readstat(buf,count)) < 1) {
14637 +#endif
14638 if (dev->drv[drvidx]->interface->readstat) {
14639 if (count > dev->drv[drvidx]->stavail)
14640 count = dev->drv[drvidx]->stavail;
14641 @@ -1065,6 +1220,9 @@ isdn_read(struct file *file, char *buf,
14642 } else {
14643 len = 0;
14644 }
14645 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
14646 + }
14647 +#endif
14648 save_flags(flags);
14649 cli();
14650 if (len)
14651 @@ -1072,7 +1230,7 @@ isdn_read(struct file *file, char *buf,
14652 else
14653 dev->drv[drvidx]->stavail = 0;
14654 restore_flags(flags);
14655 - *off = pos + len;
14656 + *off += len;
14657 retval = len;
14658 goto out;
14659 }
14660 @@ -1084,7 +1242,9 @@ isdn_read(struct file *file, char *buf,
14661 #endif
14662 retval = -ENODEV;
14663 out:
14664 +#ifndef COMPAT_HAVE_READ_LOCK_KERNEL
14665 unlock_kernel();
14666 +#endif
14667 return retval;
14668 }
14669
14670 @@ -1096,15 +1256,18 @@ isdn_write(struct file *file, const char
14671 int chidx;
14672 int retval;
14673
14674 + if (minor == ISDN_MINOR_STATUS)
14675 + return isdnstatus_write(file, buf, count, off);
14676 +
14677 if (off != &file->f_pos)
14678 return -ESPIPE;
14679
14680 - if (minor == ISDN_MINOR_STATUS)
14681 - return -EPERM;
14682 if (!dev->drivers)
14683 return -ENODEV;
14684
14685 +#ifndef COMPAT_HAVE_WRITE_LOCK_KERNEL
14686 lock_kernel();
14687 +#endif
14688 if (minor <= ISDN_MINOR_BMAX) {
14689 printk(KERN_WARNING "isdn_write minor %d obsolete!\n", minor);
14690 drvidx = isdn_minor2drv(minor);
14691 @@ -1149,7 +1312,9 @@ isdn_write(struct file *file, const char
14692 #endif
14693 retval = -ENODEV;
14694 out:
14695 +#ifndef COMPAT_HAVE_WRITE_LOCK_KERNEL
14696 unlock_kernel();
14697 +#endif
14698 return retval;
14699 }
14700
14701 @@ -1160,15 +1325,12 @@ isdn_poll(struct file *file, poll_table
14702 unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev);
14703 int drvidx = isdn_minor2drv(minor - ISDN_MINOR_CTRL);
14704
14705 +#ifndef COMPAT_HAVE_POLL_LOCK_KERNEL
14706 lock_kernel();
14707 - if (minor == ISDN_MINOR_STATUS) {
14708 - poll_wait(file, &(dev->info_waitq), wait);
14709 - /* mask = POLLOUT | POLLWRNORM; */
14710 - if (file->private_data) {
14711 - mask |= POLLIN | POLLRDNORM;
14712 - }
14713 - goto out;
14714 - }
14715 +#endif
14716 + if (minor == ISDN_MINOR_STATUS)
14717 + return isdnstatus_poll(file, wait);
14718 +
14719 if (minor >= ISDN_MINOR_CTRL && minor <= ISDN_MINOR_CTRLMAX) {
14720 if (drvidx < 0) {
14721 /* driver deregistered while file open */
14722 @@ -1190,7 +1352,9 @@ isdn_poll(struct file *file, poll_table
14723 #endif
14724 mask = POLLERR;
14725 out:
14726 +#ifndef COMPAT_HAVE_POLL_LOCK_KERNEL
14727 unlock_kernel();
14728 +#endif
14729 return mask;
14730 }
14731
14732 @@ -1220,42 +1384,9 @@ isdn_ioctl(struct inode *inode, struct f
14733 #define phone iocpar.phone
14734 #define cfg iocpar.cfg
14735
14736 - if (minor == ISDN_MINOR_STATUS) {
14737 - switch (cmd) {
14738 - case IIOCGETDVR:
14739 - return (TTY_DV +
14740 - (NET_DV << 8) +
14741 - (INF_DV << 16));
14742 - case IIOCGETCPS:
14743 - if (arg) {
14744 - ulong *p = (ulong *) arg;
14745 - int i;
14746 - if ((ret = verify_area(VERIFY_WRITE, (void *) arg,
14747 - sizeof(ulong) * ISDN_MAX_CHANNELS * 2)))
14748 - return ret;
14749 - for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
14750 - put_user(dev->ibytes[i], p++);
14751 - put_user(dev->obytes[i], p++);
14752 - }
14753 - return 0;
14754 - } else
14755 - return -EINVAL;
14756 - break;
14757 -#ifdef CONFIG_NETDEVICES
14758 - case IIOCNETGPN:
14759 - /* Get peer phone number of a connected
14760 - * isdn network interface */
14761 - if (arg) {
14762 - if (copy_from_user((char *) &phone, (char *) arg, sizeof(phone)))
14763 - return -EFAULT;
14764 - return isdn_net_getpeer(&phone, (isdn_net_ioctl_phone *) arg);
14765 - } else
14766 - return -EINVAL;
14767 -#endif
14768 - default:
14769 - return -EINVAL;
14770 - }
14771 - }
14772 + if (minor == ISDN_MINOR_STATUS)
14773 + return isdnstatus_ioctl(inode, file, cmd, arg);
14774 +
14775 if (!dev->drivers)
14776 return -ENODEV;
14777 if (minor <= ISDN_MINOR_BMAX) {
14778 @@ -1277,11 +1408,34 @@ isdn_ioctl(struct inode *inode, struct f
14779 */
14780 switch (cmd) {
14781 case IIOCNETDWRSET:
14782 +#ifdef CONFIG_ISDN_WITH_ABC
14783 + if (arg) {
14784 +
14785 + if (copy_from_user(name, (char *) arg, sizeof(name))) {
14786 +
14787 + return(-EFAULT);
14788 +
14789 + } else {
14790 +
14791 + isdn_net_dev *p = isdn_net_findif(name);
14792 +
14793 + if(p == NULL)
14794 + return(-EINVAL);
14795 +
14796 + return(isdn_dw_abc_reset_interface(p->local,1));
14797 + }
14798 + }
14799 +#else
14800 printk(KERN_INFO "INFO: ISDN_DW_ABC_EXTENSION not enabled\n");
14801 +#endif
14802 return(-EINVAL);
14803 case IIOCNETLCR:
14804 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
14805 + return(isdn_dw_abc_lcr_ioctl(arg));
14806 +#else
14807 printk(KERN_INFO "INFO: ISDN_ABC_LCR_SUPPORT not enabled\n");
14808 return -ENODEV;
14809 +#endif
14810 #ifdef CONFIG_NETDEVICES
14811 case IIOCNETAIF:
14812 /* Add a network-interface */
14813 @@ -1654,22 +1808,12 @@ isdn_open(struct inode *ino, struct file
14814 int chidx;
14815 int retval = -ENODEV;
14816
14817 +#ifdef COMPAT_USE_MODCOUNT_LOCK
14818 + MOD_INC_USE_COUNT;
14819 +#endif
14820
14821 if (minor == ISDN_MINOR_STATUS) {
14822 - infostruct *p;
14823 -
14824 - if ((p = kmalloc(sizeof(infostruct), GFP_KERNEL))) {
14825 - p->next = (char *) dev->infochain;
14826 - p->private = (char *) &(filep->private_data);
14827 - dev->infochain = p;
14828 - /* At opening we allow a single update */
14829 - filep->private_data = (char *) 1;
14830 - retval = 0;
14831 - goto out;
14832 - } else {
14833 - retval = -ENOMEM;
14834 - goto out;
14835 - }
14836 + return isdnstatus_open(ino, filep);
14837 }
14838 if (!dev->channels)
14839 goto out;
14840 @@ -1692,6 +1836,9 @@ isdn_open(struct inode *ino, struct file
14841 if (drvidx < 0)
14842 goto out;
14843 isdn_lock_drivers();
14844 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
14845 + if(!drvidx) isdn_dw_abc_lcr_open();
14846 +#endif
14847 retval = 0;
14848 goto out;
14849 }
14850 @@ -1704,6 +1851,10 @@ isdn_open(struct inode *ino, struct file
14851 }
14852 #endif
14853 out:
14854 +#ifdef COMPAT_USE_MODCOUNT_LOCK
14855 + if (retval)
14856 + MOD_DEC_USE_COUNT;
14857 +#endif
14858 return retval;
14859 }
14860
14861 @@ -1712,25 +1863,11 @@ isdn_close(struct inode *ino, struct fil
14862 {
14863 uint minor = MINOR(ino->i_rdev);
14864
14865 +#ifndef COMPAT_USE_MODCOUNT_LOCK
14866 lock_kernel();
14867 +#endif
14868 if (minor == ISDN_MINOR_STATUS) {
14869 - infostruct *p = dev->infochain;
14870 - infostruct *q = NULL;
14871 -
14872 - while (p) {
14873 - if (p->private == (char *) &(filep->private_data)) {
14874 - if (q)
14875 - q->next = p->next;
14876 - else
14877 - dev->infochain = (infostruct *) (p->next);
14878 - kfree(p);
14879 - goto out;
14880 - }
14881 - q = p;
14882 - p = (infostruct *) (p->next);
14883 - }
14884 - printk(KERN_WARNING "isdn: No private data while closing isdnctrl\n");
14885 - goto out;
14886 + isdnstatus_close(ino, filep);
14887 }
14888 isdn_unlock_drivers();
14889 if (minor <= ISDN_MINOR_BMAX)
14890 @@ -1738,6 +1875,12 @@ isdn_close(struct inode *ino, struct fil
14891 if (minor <= ISDN_MINOR_CTRLMAX) {
14892 if (dev->profd == current)
14893 dev->profd = NULL;
14894 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
14895 + {
14896 + int drvidx = isdn_minor2drv(minor - ISDN_MINOR_CTRL);
14897 + if(!drvidx) isdn_dw_abc_lcr_close();
14898 + }
14899 +#endif
14900 goto out;
14901 }
14902 #ifdef CONFIG_ISDN_PPP
14903 @@ -1746,13 +1889,19 @@ isdn_close(struct inode *ino, struct fil
14904 #endif
14905
14906 out:
14907 +#ifdef COMPAT_USE_MODCOUNT_LOCK
14908 + MOD_DEC_USE_COUNT;
14909 +#else
14910 unlock_kernel();
14911 +#endif
14912 return 0;
14913 }
14914
14915 static struct file_operations isdn_fops =
14916 {
14917 +#ifdef COMPAT_HAS_FILEOP_OWNER
14918 owner: THIS_MODULE,
14919 +#endif
14920 llseek: no_llseek,
14921 read: isdn_read,
14922 write: isdn_write,
14923 @@ -1805,6 +1954,15 @@ isdn_get_free_channel(int usage, int l2_
14924 if (USG_NONE(dev->usage[i]) &&
14925 (dev->drvmap[i] != -1)) {
14926 int d = dev->drvmap[i];
14927 +#ifdef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
14928 + if(jiffies < dev->dwabc_chan_external_inuse[i]) {
14929 +
14930 + if((dev->dwabc_chan_external_inuse[i] - jiffies) > (HZ * 120))
14931 + dev->dwabc_chan_external_inuse[i] = 0;
14932 + else
14933 + continue;
14934 + }
14935 +#endif
14936 if ((dev->usage[i] & ISDN_USAGE_EXCLUSIVE) &&
14937 ((pre_dev != d) || (pre_chan != dev->chanmap[i])))
14938 continue;
14939 @@ -1823,7 +1981,11 @@ isdn_get_free_channel(int usage, int l2_
14940 restore_flags(flags);
14941 return i;
14942 } else {
14943 +#ifdef CONFIG_ISDN_WITH_ABC
14944 + if ((pre_dev == d) && ((pre_chan == dev->chanmap[i]) || pre_chan > 1000)) {
14945 +#else
14946 if ((pre_dev == d) && (pre_chan == dev->chanmap[i])) {
14947 +#endif
14948 dev->usage[i] &= ISDN_USAGE_EXCLUSIVE;
14949 dev->usage[i] |= usage;
14950 isdn_info_update();
14951 @@ -2010,7 +2172,7 @@ isdn_add_channels(driver *d, int drvidx,
14952
14953 if ((adding) && (d->rcverr))
14954 kfree(d->rcverr);
14955 - if (!(d->rcverr = kmalloc(sizeof(int) * m, GFP_KERNEL))) {
14956 + if (!(d->rcverr = (int *) kmalloc(sizeof(int) * m, GFP_KERNEL))) {
14957 printk(KERN_WARNING "register_isdn: Could not alloc rcverr\n");
14958 return -1;
14959 }
14960 @@ -2018,7 +2180,7 @@ isdn_add_channels(driver *d, int drvidx,
14961
14962 if ((adding) && (d->rcvcount))
14963 kfree(d->rcvcount);
14964 - if (!(d->rcvcount = kmalloc(sizeof(int) * m, GFP_KERNEL))) {
14965 + if (!(d->rcvcount = (int *) kmalloc(sizeof(int) * m, GFP_KERNEL))) {
14966 printk(KERN_WARNING "register_isdn: Could not alloc rcvcount\n");
14967 if (!adding) kfree(d->rcverr);
14968 return -1;
14969 @@ -2030,7 +2192,8 @@ isdn_add_channels(driver *d, int drvidx,
14970 skb_queue_purge(&d->rpqueue[j]);
14971 kfree(d->rpqueue);
14972 }
14973 - if (!(d->rpqueue = kmalloc(sizeof(struct sk_buff_head) * m, GFP_KERNEL))) {
14974 + if (!(d->rpqueue =
14975 + (struct sk_buff_head *) kmalloc(sizeof(struct sk_buff_head) * m, GFP_KERNEL))) {
14976 printk(KERN_WARNING "register_isdn: Could not alloc rpqueue\n");
14977 if (!adding) {
14978 kfree(d->rcvcount);
14979 @@ -2044,7 +2207,8 @@ isdn_add_channels(driver *d, int drvidx,
14980
14981 if ((adding) && (d->rcv_waitq))
14982 kfree(d->rcv_waitq);
14983 - d->rcv_waitq = kmalloc(sizeof(wait_queue_head_t) * 2 * m, GFP_KERNEL);
14984 + d->rcv_waitq = (wait_queue_head_t *)
14985 + kmalloc(sizeof(wait_queue_head_t) * 2 * m, GFP_KERNEL);
14986 if (!d->rcv_waitq) {
14987 printk(KERN_WARNING "register_isdn: Could not alloc rcv_waitq\n");
14988 if (!adding) {
14989 @@ -2068,7 +2232,9 @@ isdn_add_channels(driver *d, int drvidx,
14990 if (dev->chanmap[k] < 0) {
14991 dev->chanmap[k] = j;
14992 dev->drvmap[k] = drvidx;
14993 +#ifdef HAVE_DEVFS_FS
14994 isdn_register_devfs(k);
14995 +#endif /* HAVE_DEVFS_FS */
14996 break;
14997 }
14998 restore_flags(flags);
14999 @@ -2132,6 +2298,7 @@ int DIVERT_REG_NAME(isdn_divert_if *i_di
15000 i_div->ll_cmd = isdn_command; /* set command function */
15001 i_div->drv_to_name = map_drvname;
15002 i_div->name_to_drv = map_namedrv;
15003 + i_div->dial_net_name = isdn_net_force_dial;
15004 MOD_INC_USE_COUNT;
15005 divert_if = i_div; /* remember interface */
15006 return(DIVERT_NO_ERR);
15007 @@ -2169,7 +2336,7 @@ register_isdn(isdn_if * i)
15008 printk(KERN_WARNING "register_isdn: No write routine given.\n");
15009 return 0;
15010 }
15011 - if (!(d = kmalloc(sizeof(driver), GFP_KERNEL))) {
15012 + if (!(d = (driver *) kmalloc(sizeof(driver), GFP_KERNEL))) {
15013 printk(KERN_WARNING "register_isdn: Could not alloc driver-struct\n");
15014 return 0;
15015 }
15016 @@ -2229,6 +2396,7 @@ isdn_getrev(const char *revision)
15017 return rev;
15018 }
15019
15020 +#ifdef HAVE_DEVFS_FS
15021 #ifdef CONFIG_DEVFS_FS
15022
15023 static devfs_handle_t devfs_handle;
15024 @@ -2318,6 +2486,7 @@ static void isdn_cleanup_devfs(void)
15025 }
15026
15027 #endif /* CONFIG_DEVFS_FS */
15028 +#endif /* HAVE_DEVFS_FS */
15029
15030 /*
15031 * Allocate and initialize all data, register modem-devices
15032 @@ -2335,7 +2504,6 @@ static int __init isdn_init(void)
15033 init_timer(&dev->timer);
15034 dev->timer.function = isdn_timer_funct;
15035 init_MUTEX(&dev->sem);
15036 - init_waitqueue_head(&dev->info_waitq);
15037 for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
15038 dev->drvmap[i] = -1;
15039 dev->chanmap[i] = -1;
15040 @@ -2349,7 +2517,9 @@ static int __init isdn_init(void)
15041 vfree(dev);
15042 return -EIO;
15043 }
15044 +#ifdef HAVE_DEVFS_FS
15045 isdn_init_devfs();
15046 +#endif /* HAVE_DEVFS_FS */
15047 if ((i = isdn_tty_modem_init()) < 0) {
15048 printk(KERN_WARNING "isdn: Could not register tty devices\n");
15049 if (i == -3)
15050 @@ -2357,7 +2527,9 @@ static int __init isdn_init(void)
15051 if (i <= -2)
15052 tty_unregister_driver(&dev->mdm.tty_modem);
15053 vfree(dev);
15054 +#ifdef HAVE_DEVFS_FS
15055 isdn_cleanup_devfs();
15056 +#endif /* HAVE_DEVFS_FS */
15057 devfs_unregister_chrdev(ISDN_MAJOR, "isdn");
15058 return -EIO;
15059 }
15060 @@ -2368,7 +2540,9 @@ static int __init isdn_init(void)
15061 tty_unregister_driver(&dev->mdm.cua_modem);
15062 for (i = 0; i < ISDN_MAX_CHANNELS; i++)
15063 kfree(dev->mdm.info[i].xmit_buf - 4);
15064 +#ifdef HAVE_DEVFS_FS
15065 isdn_cleanup_devfs();
15066 +#endif /* HAVE_DEVFS_FS */
15067 devfs_unregister_chrdev(ISDN_MAJOR, "isdn");
15068 vfree(dev);
15069 return -EIO;
15070 @@ -2394,6 +2568,9 @@ static int __init isdn_init(void)
15071 printk("\n");
15072 #endif
15073 isdn_info_update();
15074 +#ifdef CONFIG_ISDN_WITH_ABC
15075 + isdn_dw_abc_init_func();
15076 +#endif
15077 return 0;
15078 }
15079
15080 @@ -2402,7 +2579,7 @@ static int __init isdn_init(void)
15081 */
15082 static void __exit isdn_exit(void)
15083 {
15084 - unsigned long flags;
15085 + int flags;
15086 int i;
15087
15088 #ifdef CONFIG_ISDN_PPP
15089 @@ -2436,13 +2613,18 @@ static void __exit isdn_exit(void)
15090 printk(KERN_WARNING "isdn: controldevice busy, remove cancelled\n");
15091 restore_flags(flags);
15092 } else {
15093 +#ifdef HAVE_DEVFS_FS
15094 isdn_cleanup_devfs();
15095 +#endif /* HAVE_DEVFS_FS */
15096 del_timer(&dev->timer);
15097 restore_flags(flags);
15098 /* call vfree with interrupts enabled, else it will hang */
15099 vfree(dev);
15100 printk(KERN_NOTICE "ISDN-subsystem unloaded\n");
15101 }
15102 +#ifdef CONFIG_ISDN_WITH_ABC
15103 + isdn_dw_abc_release_func();
15104 +#endif
15105 }
15106
15107 module_init(isdn_init);
15108 Index: linux-2.4.35.4/drivers/isdn/isdn_common.h
15109 ===================================================================
15110 --- linux-2.4.35.4.orig/drivers/isdn/isdn_common.h
15111 +++ linux-2.4.35.4/drivers/isdn/isdn_common.h
15112 @@ -1,4 +1,4 @@
15113 -/* $Id: isdn_common.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
15114 +/* $Id: isdn_common.h,v 1.22 2001/09/24 13:22:42 kai Exp $
15115 *
15116 * header for Linux ISDN subsystem
15117 * common used functions and debugging-switches (linklevel).
15118 @@ -24,6 +24,9 @@
15119 #undef ISDN_DEBUG_NET_DIAL
15120 #undef ISDN_DEBUG_NET_ICALL
15121
15122 +#ifdef CONFIG_ISDN_WITH_ABC
15123 +int isdn_net_force_dial_lp(isdn_net_local *);
15124 +#endif
15125 /* Prototypes */
15126 extern void isdn_MOD_INC_USE_COUNT(void);
15127 extern void isdn_MOD_DEC_USE_COUNT(void);
15128 Index: linux-2.4.35.4/drivers/isdn/isdn_concap.c
15129 ===================================================================
15130 --- linux-2.4.35.4.orig/drivers/isdn/isdn_concap.c
15131 +++ linux-2.4.35.4/drivers/isdn/isdn_concap.c
15132 @@ -1,4 +1,4 @@
15133 -/* $Id: isdn_concap.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
15134 +/* $Id: isdn_concap.c,v 1.9 2001/09/24 13:22:42 kai Exp $
15135 *
15136 * Linux ISDN subsystem, protocol encapsulation
15137 *
15138 Index: linux-2.4.35.4/drivers/isdn/isdn_concap.h
15139 ===================================================================
15140 --- linux-2.4.35.4.orig/drivers/isdn/isdn_concap.h
15141 +++ linux-2.4.35.4/drivers/isdn/isdn_concap.h
15142 @@ -1,4 +1,4 @@
15143 -/* $Id: isdn_concap.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
15144 +/* $Id: isdn_concap.h,v 1.4 2001/09/24 13:22:42 kai Exp $
15145 *
15146 * Linux ISDN subsystem, protocol encapsulation
15147 *
15148 Index: linux-2.4.35.4/drivers/isdn/isdn_dwabc.c
15149 ===================================================================
15150 --- /dev/null
15151 +++ linux-2.4.35.4/drivers/isdn/isdn_dwabc.c
15152 @@ -0,0 +1,1053 @@
15153 +
15154 +/* $Id: isdn_dwabc.c,v 1.27 2001/12/01 23:18:21 detabc Exp $
15155 +
15156 + * Linux ISDN subsystem, abc-extension releated funktions.
15157 + *
15158 + * Copyright by abc GmbH
15159 + * written by Detlef Wengorz <detlefw@isdn4linux.de>
15160 + *
15161 + * This program is free software; you can redistribute it and/or modify
15162 + * it under the terms of the GNU General Public License as published by
15163 + * the Free Software Foundation; either version 2, or (at your option)
15164 + * any later version.
15165 + *
15166 + */
15167 +
15168 +#include <linux/config.h>
15169 +#define __NO_VERSION__
15170 +
15171 +#ifdef CONFIG_ISDN_WITH_ABC
15172 +
15173 +static char *dwabcrevison = "$Revision: 1.27 $";
15174 +
15175 +#include <asm/semaphore.h>
15176 +#define CONFIG_ISDN_WITH_ABC_NEED_DWSJIFFIES 1
15177 +#include <linux/list.h>
15178 +#include <linux/isdn.h>
15179 +#include "isdn_common.h"
15180 +#include "isdn_net.h"
15181 +
15182 +#include <linux/skbuff.h>
15183 +
15184 +#include <net/udp.h>
15185 +#include <net/checksum.h>
15186 +#include <linux/isdn_dwabc.h>
15187 +
15188 +
15189 +#if CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS && CONFIG_ISDN_PPP
15190 +#include <linux/isdn_ppp.h>
15191 +extern struct isdn_ppp_compressor *isdn_ippp_comp_head;
15192 +#define ipc_head isdn_ippp_comp_head
15193 +#ifndef CI_BSD_COMPRESS
15194 +#define CI_BSD_COMPRESS 21
15195 +#endif
15196 +#endif
15197 +
15198 +#define NBYTEORDER_30BYTES 0x1e00
15199 +#define DWABC_TMRES (HZ / 10)
15200 +
15201 +#define VERBLEVEL (dev->net_verbose > 2)
15202 +
15203 +static struct timer_list dw_abc_timer;
15204 +
15205 +
15206 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
15207 +static ISDN_DWSPINLOCK lcr_spin = ISDN_DWSPIN_UNLOCKED;
15208 +#define LCR_LOCK() isdn_dwspin_trylock(&lcr_spin)
15209 +#define LCR_ULOCK() isdn_dwspin_unlock(&lcr_spin)
15210 +
15211 +typedef struct ISDN_DW_ABC_LCR {
15212 +
15213 + struct list_head dll;
15214 + char lcr_printbuf[64 + ISDN_MSNLEN + ISDN_MSNLEN];
15215 + char *lcr_poin;
15216 + char *lcr_epoin;
15217 +
15218 +} ISDN_DW_ABC_LCR;
15219 +
15220 +static LIST_HEAD(lcr_dll);
15221 +static atomic_t lcr_open_count = ATOMIC_INIT(0);
15222 +static volatile ulong lcr_call_counter = 0;
15223 +
15224 +
15225 +static int myjiftime(char *p,u_long nj)
15226 +{
15227 + sprintf(p,"%02ld:%02ld.%02ld",
15228 + ((nj / 100) / 60) % 100, (nj / 100) % 60,nj % 100);
15229 +
15230 + return(8);
15231 +}
15232 +
15233 +
15234 +static void dw_lcr_clear_all(void)
15235 +{
15236 + struct list_head *lh;
15237 +
15238 + if(!LCR_LOCK()) {
15239 +
15240 + while((lh = lcr_dll.next) != &lcr_dll) {
15241 +
15242 + ISDN_DW_ABC_LCR *p = list_entry(lh,ISDN_DW_ABC_LCR,dll);
15243 + list_del(&p->dll);
15244 + kfree(p);
15245 + }
15246 +
15247 + LCR_ULOCK();
15248 + }
15249 +}
15250 +
15251 +void isdn_dw_abc_lcr_open(void)
15252 +{ atomic_inc(&lcr_open_count); }
15253 +
15254 +void isdn_dw_abc_lcr_close(void)
15255 +{
15256 + if(atomic_dec_and_test(&lcr_open_count))
15257 + dw_lcr_clear_all();
15258 +}
15259 +
15260 +int isdn_dw_abc_lcr_lock(void)
15261 +{ return(LCR_LOCK()); }
15262 +
15263 +void isdn_dw_abc_lcr_ulock(void)
15264 +{ LCR_ULOCK(); }
15265 +
15266 +
15267 +size_t isdn_dw_abc_lcr_readstat(char *buf,size_t count)
15268 +{
15269 + size_t retw = 0;
15270 +
15271 + while(buf != NULL && count > 0) {
15272 +
15273 + struct list_head *lh = NULL;
15274 + ISDN_DW_ABC_LCR *p = NULL;
15275 + char *dp = NULL;
15276 + size_t n;
15277 +
15278 + if((n = LCR_LOCK())) {
15279 +
15280 + if(!retw)
15281 + retw = n;
15282 +
15283 + break;
15284 + }
15285 +
15286 +
15287 + while((lh = lcr_dll.next) != &lcr_dll) {
15288 +
15289 + p = list_entry(lh,ISDN_DW_ABC_LCR,dll);
15290 +
15291 + if(p->lcr_poin >= p->lcr_epoin) {
15292 +
15293 + list_del(&p->dll);
15294 + kfree(p);
15295 + p = NULL;
15296 +
15297 + } else break;
15298 + }
15299 +
15300 + if(p == NULL) {
15301 +
15302 + LCR_ULOCK();
15303 + break;
15304 + }
15305 +
15306 + n = p->lcr_epoin - p->lcr_poin;
15307 +
15308 + if(n > count)
15309 + n = count;
15310 +
15311 + dp = p->lcr_poin;
15312 + p->lcr_poin += n;
15313 + retw += n;
15314 + LCR_ULOCK();
15315 + copy_to_user(buf,dp,n);
15316 + buf += n;
15317 + }
15318 +
15319 + return(retw);
15320 +}
15321 +
15322 +
15323 +static void isdn_dw_abc_lcr_clear_helper(isdn_net_local *lp)
15324 +{
15325 + if(lp != NULL) {
15326 +
15327 + void *a,*b;
15328 +
15329 + a = lp->dw_abc_lcr_cmd;
15330 + b = lp->dw_abc_lcr_io;
15331 + lp->dw_abc_lcr_io = NULL;
15332 + lp->dw_abc_lcr_cmd = NULL;
15333 + lp->dw_abc_lcr_callid =
15334 + lp->dw_abc_lcr_start_request =
15335 + lp->dw_abc_lcr_end_request = 0;
15336 +
15337 + if(a) kfree(a);
15338 + if(b) kfree(b);
15339 + }
15340 +}
15341 +
15342 +void isdn_dw_abc_lcr_clear(isdn_net_local *lp)
15343 +{
15344 + if(!LCR_LOCK()) {
15345 + isdn_dw_abc_lcr_clear_helper(lp);
15346 + LCR_ULOCK();
15347 + }
15348 +}
15349 +
15350 +
15351 +u_long isdn_dw_abc_lcr_call_number( isdn_net_local *lp,isdn_ctrl *call_cmd)
15352 +{
15353 + u_long mid = 0;
15354 +
15355 + if(LCR_LOCK())
15356 + return(0);
15357 +
15358 + isdn_dw_abc_lcr_clear_helper(lp);
15359 +
15360 + if( atomic_read(&lcr_open_count) > 0 &&
15361 + lp != NULL &&
15362 + call_cmd != NULL) {
15363 +
15364 + ISDN_DW_ABC_LCR *lc = NULL;
15365 + int ab = 0;
15366 +
15367 + if((lp->dw_abc_lcr_cmd =
15368 + ( isdn_ctrl *)kmalloc(sizeof(isdn_ctrl),GFP_ATOMIC)) == NULL) {
15369 +
15370 +no_mem_out:;
15371 + isdn_dw_abc_lcr_clear_helper(lp);
15372 + LCR_ULOCK();
15373 + printk(KERN_DEBUG "%s %d : LCR no memory\n",__FILE__,__LINE__);
15374 + return(0);
15375 + }
15376 +
15377 + memcpy(lp->dw_abc_lcr_cmd,call_cmd,sizeof(*call_cmd));
15378 + while(!(lp->dw_abc_lcr_callid = mid = lcr_call_counter++));
15379 +
15380 + lp->dw_abc_lcr_end_request = lp->dw_abc_lcr_start_request = jiffies;
15381 + lp->dw_abc_lcr_end_request += HZ * 3;
15382 +
15383 + if((lc = (ISDN_DW_ABC_LCR *)kmalloc(sizeof(*lc),GFP_KERNEL)) == NULL)
15384 + goto no_mem_out;
15385 +
15386 + lc->lcr_poin = lc->lcr_epoin = lc->lcr_printbuf;
15387 + lc->lcr_epoin += myjiftime(lc->lcr_epoin,jiffies);
15388 +
15389 + sprintf(lc->lcr_epoin," DW_ABC_LCR\t%lu\t%.*s\t%.*s\n",
15390 + mid,
15391 + (int)ISDN_MSNLEN,
15392 + call_cmd->parm.setup.eazmsn,
15393 + (int)ISDN_MSNLEN,
15394 + call_cmd->parm.setup.phone);
15395 +
15396 + lc->lcr_epoin += strlen(lc->lcr_epoin);
15397 + ab = lc->lcr_epoin - lc->lcr_poin;
15398 +
15399 + list_add_tail(&lc->dll,&lcr_dll);
15400 + LCR_ULOCK();
15401 +
15402 + if(ab > 0) {
15403 +
15404 + if(dev->drv[0] != NULL ) {
15405 +
15406 + dev->drv[0]->stavail += ab;
15407 + wake_up_interruptible(&dev->drv[0]->st_waitq);
15408 + }
15409 + }
15410 +
15411 + } else LCR_ULOCK();
15412 +
15413 + return(mid);
15414 +}
15415 +
15416 +
15417 +int isdn_dw_abc_lcr_ioctl(u_long arg)
15418 +{
15419 + struct ISDN_DWABC_LCR_IOCTL i;
15420 + int need = sizeof(struct ISDN_DWABC_LCR_IOCTL);
15421 + isdn_net_dev *p;
15422 +
15423 + memset(&i,0,sizeof(struct ISDN_DWABC_LCR_IOCTL));
15424 + copy_from_user(&i,(char *)arg,sizeof(int));
15425 +
15426 + if(i.lcr_ioctl_sizeof < need)
15427 + need = i.lcr_ioctl_sizeof;
15428 +
15429 + if(need > 0)
15430 + copy_from_user(&i,(char *)arg,need);
15431 +
15432 + if(LCR_LOCK())
15433 + return(-EAGAIN);
15434 +
15435 + p = dev->netdev;
15436 +
15437 + for(;p ; p = p->next) {
15438 +
15439 + isdn_net_local *lp = p->local;
15440 +
15441 + if( lp->dw_abc_lcr_callid != i.lcr_ioctl_callid)
15442 + continue;
15443 +
15444 + if(lp->dw_abc_lcr_cmd == NULL)
15445 + continue;
15446 +
15447 + if(lp->dw_abc_lcr_io == NULL)
15448 + lp->dw_abc_lcr_io = (struct ISDN_DWABC_LCR_IOCTL *)
15449 + kmalloc(sizeof(struct ISDN_DWABC_LCR_IOCTL),GFP_ATOMIC);
15450 +
15451 + if(lp->dw_abc_lcr_io == NULL) {
15452 +
15453 + printk(KERN_DEBUG "%s %d : no memory\n",__FILE__,__LINE__);
15454 + continue;
15455 + }
15456 +
15457 + memcpy(lp->dw_abc_lcr_io,&i,sizeof(struct ISDN_DWABC_LCR_IOCTL));
15458 +
15459 + if(i.lcr_ioctl_flags & DWABC_LCR_FLG_NEWNUMBER) {
15460 +
15461 + char *xx = i.lcr_ioctl_nr;
15462 + char *exx = xx + sizeof(i.lcr_ioctl_nr);
15463 + char *d = lp->dw_abc_lcr_cmd->parm.setup.phone;
15464 + char *ed = d + sizeof(lp->dw_abc_lcr_cmd->parm.setup.phone) - 1;
15465 +
15466 + while(d < ed && xx < exx && *xx) *(d++) = *(xx++);
15467 + while(d < ed) *(d++) = 0;
15468 + *d = 0;
15469 + }
15470 + }
15471 +
15472 + LCR_ULOCK();
15473 + return(0);
15474 +}
15475 +
15476 +#endif
15477 +
15478 +
15479 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK
15480 +int dw_abc_udp_test(struct sk_buff *skb,struct net_device *ndev)
15481 +{
15482 + if(ndev != NULL && skb != NULL && skb->protocol == htons(ETH_P_IP)) {
15483 +
15484 + struct iphdr *iph = (struct iphdr *)skb->data;
15485 + isdn_net_local *lp = (isdn_net_local *) ndev->priv;
15486 + int rklen = skb->len;
15487 +
15488 + if (skb->nh.raw > skb->data && skb->nh.raw < skb->tail) {
15489 +
15490 + rklen -= (char *)skb->nh.raw - (char *)skb->data;
15491 + iph = (struct iphdr *)skb->nh.raw;
15492 + }
15493 +
15494 + if(rklen >= 20 && iph->version == 4 &&
15495 + !(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_UDP_CHECK)) {
15496 +
15497 + if( iph->tot_len == NBYTEORDER_30BYTES &&
15498 + iph->protocol == IPPROTO_UDP) {
15499 +
15500 + struct udphdr *udp =
15501 + (struct udphdr *)((char *)iph + (iph->ihl << 2));
15502 +
15503 + ushort usrc = ntohs(udp->source);
15504 +
15505 + if( udp->dest == htons(25001) &&
15506 + usrc >= 20000 && usrc < 25000) {
15507 +
15508 + char *p = (char *)(udp + 1);
15509 +
15510 + if(p[0] == p[1]) {
15511 +
15512 + char mc = 0;
15513 +
15514 + switch(*p) {
15515 + case 0x30:
15516 +
15517 + mc = *p;
15518 +
15519 + if((lp->flags & ISDN_NET_CONNECTED) && (!lp->dialstate))
15520 + mc++;
15521 +
15522 + break;
15523 +
15524 + case 0x32:
15525 +
15526 + mc = *p;
15527 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL
15528 + if((lp->flags & ISDN_NET_CONNECTED) && (!lp->dialstate)) {
15529 +
15530 + mc++;
15531 + break;
15532 + }
15533 +
15534 + if(!isdn_net_force_dial_lp(lp)) mc++;
15535 +#endif
15536 + break;
15537 +
15538 + case 0x11:
15539 + mc = *p + 1;
15540 + isdn_dw_abc_reset_interface(lp,1);
15541 + break;
15542 +
15543 + case 0x28: mc = *p + 1; break;
15544 + case 0x2a:
15545 + case 0x2c:
15546 +
15547 + mc = *p;
15548 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP
15549 + if(!(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_UDP_HANGUP)) {
15550 +
15551 + if(lp->isdn_device >= 0) {
15552 +
15553 + isdn_net_hangup(ndev);
15554 + mc = *p + 1;
15555 + }
15556 + }
15557 +#endif
15558 + break;
15559 + }
15560 +
15561 + if(mc) {
15562 +
15563 + struct sk_buff *nskb;
15564 + int need = 2+sizeof(struct iphdr)+sizeof(struct udphdr);
15565 + int hneed = need + ndev->hard_header_len;
15566 +
15567 + if((nskb = (struct sk_buff *)dev_alloc_skb(hneed)) != NULL) {
15568 +
15569 + ushort n = sizeof(struct udphdr) + 2;
15570 + struct iphdr *niph;
15571 + struct udphdr *nup;
15572 + skb_reserve(nskb,ndev->hard_header_len);
15573 +
15574 + if((niph = (struct iphdr *)skb_put(nskb,need))==NULL){
15575 +
15576 + printk(KERN_DEBUG "%s: skb_put failt (%d bytes)\n", lp->name,hneed);
15577 + dev_kfree_skb(nskb);
15578 + return(0);
15579 + }
15580 +
15581 + nup = (struct udphdr *)(niph + 1);
15582 + ((char *)(nup + 1))[0] = mc;
15583 + ((char *)(nup + 1))[1] = mc;
15584 + nup->source=udp->dest;
15585 + nup->dest=udp->source;
15586 + nup->len=htons(n);
15587 + nup->check=0; /* dont need checksum */
15588 + memset((void *)niph,0,sizeof(*niph));
15589 + niph->version=4;
15590 + niph->ihl=5;
15591 + niph->tot_len=NBYTEORDER_30BYTES;
15592 + niph->ttl = 32;
15593 + niph->protocol = IPPROTO_UDP;
15594 + niph->saddr=iph->daddr;
15595 + niph->daddr=iph->saddr;
15596 + niph->id=iph->id;
15597 + niph->check=ip_fast_csum((unsigned char *)niph,niph->ihl);
15598 + nskb->dev = ndev;
15599 + nskb->pkt_type = PACKET_HOST;
15600 + nskb->protocol = htons(ETH_P_IP);
15601 + nskb->mac.raw = nskb->data;
15602 + netif_rx(nskb);
15603 + }
15604 +
15605 + return(1);
15606 + }
15607 + }
15608 + }
15609 + }
15610 + }
15611 + }
15612 +
15613 + return(0);
15614 +}
15615 +#endif
15616 +
15617 +
15618 +void isdn_dw_clear_if(ulong pm,isdn_net_local *lp)
15619 +{
15620 + if(lp != NULL) {
15621 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
15622 + isdn_dw_abc_lcr_clear(lp);
15623 +#endif
15624 + }
15625 +}
15626 +
15627 +
15628 +
15629 +static void dw_abc_timer_func(u_long dont_need_yet)
15630 +{
15631 + register u_long t;
15632 +
15633 + if(!((t = ++isdn_dwabc_jiffies.msec_100) & 1))
15634 + if(isdn_dwabc_jiffies.msec_200++ & 1)
15635 + isdn_dwabc_jiffies.msec_400++;
15636 +
15637 + if(!(t % 5))
15638 + if(isdn_dwabc_jiffies.msec_500++ & 1)
15639 + isdn_dwabc_jiffies.msec_1000++;
15640 +
15641 + dw_abc_timer.expires = jiffies + DWABC_TMRES;
15642 + add_timer(&dw_abc_timer);
15643 +}
15644 +
15645 +
15646 +void isdn_dw_abc_init_func(void)
15647 +{
15648 +
15649 + init_timer(&dw_abc_timer);
15650 + dw_abc_timer.function = dw_abc_timer_func;
15651 +
15652 +
15653 + printk( KERN_INFO
15654 + "abc-extension %s Kernel 0x%06X\n"
15655 + "written by\nDetlef Wengorz <detlefw@isdn4linux.de>\n"
15656 + "Installed options:\n"
15657 +#ifdef CONFIG_ISDN_WITH_ABC_CALLB
15658 + "CONFIG_ISDN_WITH_ABC_CALLB\n"
15659 +#endif
15660 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK
15661 + "CONFIG_ISDN_WITH_ABC_UDP_CHECK\n"
15662 +#endif
15663 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP
15664 + "CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP\n"
15665 +#endif
15666 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL
15667 + "CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL\n"
15668 +#endif
15669 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
15670 + "CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ\n"
15671 +#endif
15672 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
15673 + "CONFIG_ISDN_WITH_ABC_LCR_SUPPORT\n"
15674 +#endif
15675 +#ifdef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
15676 + "CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER\n"
15677 +#endif
15678 +#ifdef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
15679 + "CONFIG_ISDN_WITH_ABC_CH_EXTINUSE\n"
15680 +#endif
15681 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
15682 + "CONFIG_ISDN_WITH_ABC_CONN_ERROR\n"
15683 +#endif
15684 +#ifdef CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS
15685 + "CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS\n"
15686 +#endif
15687 + "loaded\n",
15688 + dwabcrevison,LINUX_VERSION_CODE);
15689 + dwsjiffies = 0;
15690 + dw_abc_timer.expires = jiffies + DWABC_TMRES;
15691 + add_timer(&dw_abc_timer);
15692 +}
15693 +
15694 +void isdn_dw_abc_release_func(void)
15695 +{
15696 + del_timer(&dw_abc_timer);
15697 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
15698 + dw_lcr_clear_all();
15699 +#endif
15700 + printk( KERN_INFO
15701 + "abc-extension %s Kernel 0x%06X\n"
15702 + "written by\n"
15703 + "Detlef Wengorz <detlefw@isdn4linux.de>\n"
15704 + "unloaded\n",
15705 + dwabcrevison,LINUX_VERSION_CODE);
15706 +}
15707 +
15708 +
15709 +void isdn_dwabc_test_phone(isdn_net_local *lp)
15710 +{
15711 + if(lp != NULL) {
15712 +
15713 + isdn_net_phone *h = lp->phone[0];
15714 + ulong oflags = lp->dw_abc_flags;
15715 + int secure = 0;
15716 +
15717 + lp->dw_abc_flags = 0;
15718 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
15719 + *lp->dw_out_msn = 0;
15720 +#endif
15721 +
15722 + for(;h != NULL && secure < 1000;secure++,h = h->next) {
15723 +
15724 + char *p = h->num;
15725 + char *ep = p + ISDN_MSNLEN;
15726 +
15727 + for(;p < ep && *p && (*p <= ' ' || *p == '"' || *p == '\'');p++);
15728 +
15729 + if(p >= ep)
15730 + continue;
15731 +
15732 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
15733 + if(*p == '>') {
15734 +
15735 + if(++p < ep && *p != '<' && *p != '>') {
15736 +
15737 + char *d = lp->dw_out_msn;
15738 +
15739 + for(;*p && (p < ep) && (*p == ' ' || *p == '\t');p++);
15740 + for(ep--;*p && (p < ep);) *(d++) = *(p++);
15741 + *d = 0;
15742 + continue;
15743 + }
15744 + }
15745 +#endif
15746 +
15747 + if(*p == '~') {
15748 +
15749 + /* abc switch's */
15750 +
15751 + for(p++;p < ep && *p;p++) switch(*p) {
15752 + case 'u': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_NO_UDP_CHECK; break;
15753 + case 'h': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_NO_UDP_HANGUP; break;
15754 + case 'd': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_NO_UDP_DIAL; break;
15755 + case 'c': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_NO_CH_EXTINUSE; break;
15756 + case 'e': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_NO_CONN_ERROR; break;
15757 + case 'l': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_NO_LCR; break;
15758 +
15759 + case 'x':
15760 + case 'X': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_RCV_NO_HUPTIMER; break;
15761 +
15762 + case 'B': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_BSD_COMPRESS; break;
15763 + case 'L': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_LEASED_LINE; break;
15764 +
15765 + case '"':
15766 + case ' ':
15767 + case '\t':
15768 + case '\'': break;
15769 +
15770 + default:
15771 + printk(KERN_DEBUG"isdn_net: %s abc-switch <~%c> unknown\n",lp->name,*p);
15772 + break;
15773 + }
15774 + }
15775 + }
15776 +
15777 + if(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_LEASED_LINE) {
15778 +
15779 + lp->dw_abc_flags |=
15780 + ISDN_DW_ABC_FLAG_NO_UDP_CHECK |
15781 + ISDN_DW_ABC_FLAG_NO_UDP_HANGUP |
15782 + ISDN_DW_ABC_FLAG_NO_UDP_DIAL |
15783 + ISDN_DW_ABC_FLAG_NO_CH_EXTINUSE |
15784 + ISDN_DW_ABC_FLAG_NO_CONN_ERROR |
15785 + ISDN_DW_ABC_FLAG_NO_LCR;
15786 + }
15787 +
15788 + if(dev->net_verbose && (lp->dw_abc_flags != oflags || dev->net_verbose > 4))
15789 + printk(KERN_DEBUG "isdn_net %s abc-flags 0x%lx\n",lp->name,lp->dw_abc_flags);
15790 +
15791 + }
15792 +}
15793 +
15794 +
15795 +int isdn_dw_abc_reset_interface(isdn_net_local *lp,int with_message)
15796 +{
15797 + int r = -EINVAL;
15798 +
15799 + if(lp != NULL) {
15800 +
15801 + r = 0;
15802 +
15803 + lp->dw_abc_bchan_last_connect = 0;
15804 + lp->dw_abc_dialstart = 0;
15805 + lp->dw_abc_inuse_secure = 0;
15806 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
15807 + lp->dw_abc_bchan_errcnt = 0;
15808 +#endif
15809 +
15810 + if(with_message && dev->net_verbose > 0)
15811 + printk(KERN_INFO
15812 + "%s: NOTE: reset (clear) abc-interface-secure-counter\n",
15813 + lp->name);
15814 + }
15815 +
15816 + return(r);
15817 +}
15818 +
15819 +
15820 +#if CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS && CONFIG_ISDN_PPP
15821 +
15822 +#define DWBSD_PKT_FIRST_LEN 16
15823 +#define DWBSD_PKT_SWITCH 165
15824 +#define DWBSD_PKT_BSD 189
15825 +
15826 +#define DWBSD_VERSION 0x2
15827 +
15828 +void dwabc_bsd_first_gen(isdn_net_local *lp)
15829 +{
15830 + if(lp != NULL && lp->p_encap == ISDN_NET_ENCAP_RAWIP &&
15831 + (lp->dw_abc_flags & ISDN_DW_ABC_FLAG_BSD_COMPRESS)) {
15832 +
15833 + struct sk_buff *skb = NULL;
15834 + char *p = NULL;
15835 + char *ep = NULL;
15836 +
15837 + if((skb =(struct sk_buff *)dev_alloc_skb(128)) == NULL) {
15838 +
15839 + printk(KERN_INFO "%s: dwabc: alloc-skb failed for 128 bytes\n",lp->name);
15840 + return;
15841 + }
15842 +
15843 + skb_reserve(skb,64);
15844 + p = skb_put(skb,DWBSD_PKT_FIRST_LEN);
15845 + ep = p + DWBSD_PKT_FIRST_LEN;
15846 +
15847 + *(p++) = DWBSD_PKT_SWITCH;
15848 + *(p++) = DWBSD_VERSION;
15849 + for(;p < ep;p++) *(p++) = 0;
15850 +
15851 + isdn_net_write_super(lp, skb);
15852 +
15853 + if(dev->net_verbose > 2)
15854 + printk(KERN_INFO "%s: dwabc: sending comm-header version 0x%x\n",lp->name,DWBSD_VERSION);
15855 + }
15856 +}
15857 +
15858 +
15859 +void dwabc_bsd_free(isdn_net_local *lp)
15860 +{
15861 + if(lp != NULL) {
15862 +
15863 + if(lp->dw_abc_bsd_stat_rx || lp->dw_abc_bsd_stat_tx) {
15864 +
15865 + struct isdn_ppp_compressor *c = NULL;
15866 +
15867 + if(!(c = (struct isdn_ppp_compressor *)lp->dw_abc_bsd_compressor)) {
15868 +
15869 + printk(KERN_WARNING
15870 + "%s: PANIC: freeing bsd compressmemory without compressor\n",
15871 + lp->name);
15872 +
15873 + } else {
15874 +
15875 + if(lp->dw_abc_bsd_stat_rx) (*c->free)(lp->dw_abc_bsd_stat_rx);
15876 + if(lp->dw_abc_bsd_stat_tx) (*c->free)(lp->dw_abc_bsd_stat_tx);
15877 +
15878 + if(dev->net_verbose > 2)
15879 + printk(KERN_INFO
15880 + "%s: free bsd compress-memory\n",
15881 + lp->name);
15882 + }
15883 + }
15884 +
15885 + lp->dw_abc_bsd_compressor = NULL;
15886 + lp->dw_abc_bsd_stat_rx = NULL;
15887 + lp->dw_abc_bsd_stat_tx = NULL;
15888 + lp->dw_abc_if_flags &= ~ISDN_DW_ABC_IFFLAG_BSDAKTIV;
15889 +
15890 + if(dev->net_verbose > 0) {
15891 +
15892 + if(lp->dw_abc_bsd_rcv != lp->dw_abc_bsd_bsd_rcv) {
15893 +
15894 + printk(KERN_INFO "%s: Receive %lu<-%lu kb\n",lp->name,
15895 + lp->dw_abc_bsd_rcv >> 10 , lp->dw_abc_bsd_bsd_rcv >> 10);
15896 + }
15897 +
15898 +
15899 + if(lp->dw_abc_bsd_snd != lp->dw_abc_bsd_bsd_snd) {
15900 +
15901 + printk(KERN_INFO "%s: Send %lu->%lu kb\n",lp->name,
15902 + lp->dw_abc_bsd_snd >> 10 , lp->dw_abc_bsd_bsd_snd >> 10);
15903 + }
15904 + }
15905 +
15906 + lp->dw_abc_bsd_rcv =
15907 + lp->dw_abc_bsd_bsd_rcv =
15908 + lp->dw_abc_bsd_snd =
15909 + lp->dw_abc_bsd_bsd_snd = 0;
15910 + }
15911 +}
15912 +
15913 +
15914 +int dwabc_bsd_init(isdn_net_local *lp)
15915 +{
15916 + int r = 1;
15917 +
15918 + if(lp != NULL) {
15919 +
15920 + dwabc_bsd_free(lp);
15921 +
15922 + if(lp->p_encap == ISDN_NET_ENCAP_RAWIP) {
15923 +
15924 + void *rx = NULL;
15925 + void *tx = NULL;
15926 + struct isdn_ppp_comp_data *cp = NULL;
15927 + struct isdn_ppp_compressor *c = NULL;
15928 +
15929 + if(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_BSD_COMPRESS) do {
15930 +
15931 + for(c = ipc_head ;
15932 + c != NULL && c->num != CI_BSD_COMPRESS; c = c->next);
15933 +
15934 + if(c == NULL) {
15935 +
15936 + printk(KERN_INFO
15937 + "%s: Module isdn_bsdcompress not loaded\n",
15938 + lp->name);
15939 +
15940 + break;
15941 + }
15942 +
15943 + cp = (struct isdn_ppp_comp_data *)
15944 + kmalloc(sizeof(struct isdn_ppp_comp_data),GFP_ATOMIC);
15945 +
15946 + if(cp == NULL) {
15947 +
15948 + printk(KERN_INFO
15949 + "%s: allocation of isdn_ppp_comp_data failed\n",
15950 + lp->name);
15951 +
15952 + break;
15953 + }
15954 +
15955 + memset(cp,0,sizeof(*cp));
15956 + cp->num = CI_BSD_COMPRESS;
15957 + cp->optlen = 1;
15958 +
15959 + /*
15960 + ** set BSD_VERSION 1 and 12 bits compressmode
15961 + */
15962 + *cp->options = (1 << 5) | 12;
15963 +
15964 + if((rx = (*c->alloc)(cp)) == NULL) {
15965 +
15966 + printk(KERN_INFO
15967 + "%s: allocation of bsd rx-memory failed\n",
15968 + lp->name);
15969 +
15970 + break;
15971 + }
15972 +
15973 + if(!(*c->init)(rx,cp,0,1)) {
15974 +
15975 + printk(KERN_INFO
15976 + "%s: init of bsd rx-stream failed\n",lp->name);
15977 +
15978 + break;
15979 + }
15980 +
15981 + cp->flags = IPPP_COMP_FLAG_XMIT;
15982 +
15983 + if((tx = (*c->alloc)(cp)) == NULL) {
15984 +
15985 + printk(KERN_INFO
15986 + "%s: allocation of bsd tx-memory failed\n",
15987 + lp->name);
15988 +
15989 + break;
15990 + }
15991 +
15992 + if(!(*c->init)(tx,cp,0,1)) {
15993 +
15994 + printk(KERN_INFO
15995 + "%s: init of bsd tx-stream failed\n",
15996 + lp->name);
15997 +
15998 + break;
15999 + }
16000 +
16001 + lp->dw_abc_bsd_compressor = (void *)c;
16002 + lp->dw_abc_bsd_stat_rx = rx;
16003 + lp->dw_abc_bsd_stat_tx = tx;
16004 + rx = tx = NULL;
16005 + r = 0;
16006 +
16007 + if(dev->net_verbose > 2)
16008 + printk(KERN_INFO
16009 + "%s: bsd compress-memory and init ok\n",
16010 + lp->name);
16011 +
16012 + } while(0);
16013 +
16014 + if(cp != NULL)
16015 + kfree(cp);
16016 +
16017 + if(c != NULL) {
16018 +
16019 + if(tx != NULL) (*c->free)(tx);
16020 + if(rx != NULL) (*c->free)(rx);
16021 + }
16022 +
16023 + } else if(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_BSD_COMPRESS) {
16024 +
16025 + printk(KERN_INFO
16026 + "%s: bsd-compress only with encapsulation rawip allowed\n",
16027 + lp->name);
16028 + }
16029 + }
16030 +
16031 + return(r);
16032 +}
16033 +
16034 +struct sk_buff *dwabc_bsd_compress( isdn_net_local *lp,
16035 + struct sk_buff *skb,
16036 + struct net_device *ndev)
16037 +{
16038 + if(lp != NULL && lp->p_encap == ISDN_NET_ENCAP_RAWIP &&
16039 + (lp->dw_abc_flags & ISDN_DW_ABC_FLAG_BSD_COMPRESS) &&
16040 + (lp->dw_abc_if_flags & ISDN_DW_ABC_IFFLAG_BSDAKTIV)) {
16041 +
16042 + if(lp->dw_abc_bsd_stat_tx != NULL && lp->dw_abc_bsd_compressor) {
16043 +
16044 + struct isdn_ppp_compressor *cp =
16045 + (struct isdn_ppp_compressor *)lp->dw_abc_bsd_compressor;
16046 +
16047 + struct sk_buff *nskb = (struct sk_buff *)
16048 + dev_alloc_skb(skb->len * 2 + ndev->hard_header_len);
16049 +
16050 + int l = 0;
16051 +
16052 + if(nskb == NULL) {
16053 +
16054 + (void)(*cp->reset)(lp->dw_abc_bsd_stat_tx,0,0,NULL,0,NULL);
16055 + printk(KERN_INFO "%s: dwabc-compress no memory\n",lp->name);
16056 +
16057 + } else {
16058 +
16059 + skb_reserve(nskb,ndev->hard_header_len);
16060 + *(unsigned char *)skb_put(nskb,1) = DWBSD_PKT_BSD;
16061 + l = (*cp->compress)(lp->dw_abc_bsd_stat_tx,skb,nskb,0x21);
16062 +
16063 + if(l < 1 || l > skb->len) {
16064 +
16065 + (void)(*cp->reset)(lp->dw_abc_bsd_stat_tx,0,0,NULL,0,NULL);
16066 + dev_kfree_skb(nskb);
16067 +
16068 + } else {
16069 +
16070 + u_short sqnr;
16071 +
16072 + dev_kfree_skb(skb);
16073 + skb = nskb;
16074 + sqnr = ((*(u_char *)skb->data) << 8) +
16075 + ((u_char)skb->data[1]);
16076 +
16077 + if(sqnr > 65500)
16078 + (void)(*cp->reset)
16079 + (lp->dw_abc_bsd_stat_tx,0,0,NULL,0,NULL);
16080 + }
16081 + }
16082 + }
16083 + }
16084 +
16085 + return(skb);
16086 +}
16087 +
16088 +struct sk_buff *dwabc_bsd_rx_pkt( isdn_net_local *lp,
16089 + struct sk_buff *skb,
16090 + struct net_device *ndev)
16091 +{
16092 + struct sk_buff *r = skb;
16093 +
16094 + if(lp != NULL && lp->p_encap == ISDN_NET_ENCAP_RAWIP &&
16095 + (lp->dw_abc_flags & ISDN_DW_ABC_FLAG_BSD_COMPRESS)) {
16096 +
16097 + unsigned char *p = (unsigned char *)skb->data;
16098 + struct isdn_ppp_compressor *cp =
16099 + (struct isdn_ppp_compressor *)lp->dw_abc_bsd_compressor;
16100 +
16101 + if(*p == DWBSD_PKT_SWITCH) {
16102 +
16103 + if(skb->len == DWBSD_PKT_FIRST_LEN) {
16104 +
16105 + if((lp->dw_abc_remote_version = p[1]) < 0x2) {
16106 +
16107 + printk(KERN_INFO
16108 + "%s: I can't really talk with remote version 0x%x\n"
16109 + "Please upgrade remote or disable rawip-compression\n",
16110 + lp->name,
16111 + p[1]);
16112 + }
16113 +
16114 + lp->dw_abc_if_flags |= ISDN_DW_ABC_IFFLAG_BSDAKTIV;
16115 + dev_kfree_skb(skb);
16116 +
16117 + if(cp && lp->dw_abc_bsd_stat_tx)
16118 + (void)(*cp->reset)(lp->dw_abc_bsd_stat_tx,0,0,NULL,0,NULL);
16119 +
16120 + if(dev->net_verbose > 2)
16121 + printk(KERN_INFO
16122 + "%s: receive comm-header rem-version 0x%02x\n",
16123 + lp->name,
16124 + lp->dw_abc_remote_version);
16125 +
16126 + return(NULL);
16127 + }
16128 +
16129 + } else if(*p == DWBSD_PKT_BSD && lp->dw_abc_bsd_stat_rx != NULL && cp) {
16130 +
16131 + struct sk_buff *nskb = NULL;
16132 +
16133 + if(test_and_set_bit(ISDN_DW_ABC_BITLOCK_RECEIVE,
16134 + &lp->dw_abc_bitlocks)) {
16135 +
16136 + printk(KERN_INFO "%s: bsd-decomp called recursivly\n",lp->name);
16137 + dev_kfree_skb(skb);
16138 + dwabc_bsd_first_gen(lp);
16139 + return(NULL);
16140 + }
16141 +
16142 + nskb = (struct sk_buff *)
16143 + dev_alloc_skb(2048 + ndev->hard_header_len);
16144 +
16145 + if(nskb != NULL) {
16146 +
16147 + int l = 0;
16148 + u_short sqnr;
16149 +
16150 + skb_reserve(nskb,ndev->hard_header_len);
16151 + skb_pull(skb, 1);
16152 + sqnr = ((*(u_char *)skb->data) << 8) | ((u_char)skb->data[1]);
16153 +
16154 + if(!sqnr && cp && lp->dw_abc_bsd_stat_rx)
16155 + (void)(*cp->reset)(lp->dw_abc_bsd_stat_rx,0,0,NULL,0,NULL);
16156 +
16157 + if((l = (*cp->decompress)
16158 + (lp->dw_abc_bsd_stat_rx,skb,nskb,NULL)) < 1 || l>8000) {
16159 +
16160 + printk(KERN_INFO "%s: abc-decomp failed\n",lp->name);
16161 + dev_kfree_skb(nskb);
16162 + dev_kfree_skb(skb);
16163 + nskb = NULL;
16164 + dwabc_bsd_first_gen(lp);
16165 +
16166 + } else {
16167 +
16168 + if (nskb->data[0] & 0x1)
16169 + skb_pull(nskb, 1); /* protocol ID is only 8 bit */
16170 + else
16171 + skb_pull(nskb, 2);
16172 +
16173 + nskb->dev = skb->dev;
16174 + nskb->pkt_type = skb->pkt_type;
16175 + nskb->mac.raw = nskb->data;
16176 + dev_kfree_skb(skb);
16177 + }
16178 +
16179 + } else {
16180 +
16181 + printk(KERN_INFO "%s: PANIC abc-decomp no memory\n",lp->name);
16182 + dev_kfree_skb(skb);
16183 + dwabc_bsd_first_gen(lp);
16184 + }
16185 +
16186 + clear_bit(ISDN_DW_ABC_BITLOCK_RECEIVE,&lp->dw_abc_bitlocks);
16187 + r = nskb;
16188 + }
16189 + }
16190 +
16191 + return(r);
16192 +}
16193 +
16194 +#else
16195 +int dwabc_bsd_init(isdn_net_local *lp) { return(1); }
16196 +void dwabc_bsd_free(isdn_net_local *lp) { return; }
16197 +void dwabc_bsd_first_gen(isdn_net_local *lp) { return ; }
16198 +
16199 +struct sk_buff *dwabc_bsd_compress(isdn_net_local *lp,struct sk_buff *skb,struct net_device *ndev)
16200 +{ return(skb); }
16201 +
16202 +struct sk_buff *dwabc_bsd_rx_pkt(isdn_net_local *lp,struct sk_buff *skb,struct net_device *ndev)
16203 +{ return(skb); }
16204 +#endif
16205 +#endif
16206 Index: linux-2.4.35.4/drivers/isdn/isdn_net.c
16207 ===================================================================
16208 --- linux-2.4.35.4.orig/drivers/isdn/isdn_net.c
16209 +++ linux-2.4.35.4/drivers/isdn/isdn_net.c
16210 @@ -1,4 +1,4 @@
16211 -/* $Id: isdn_net.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
16212 +/* $Id: isdn_net.c,v 1.153 2002/08/17 18:35:23 detabc Exp $
16213 *
16214 * Linux ISDN subsystem, network interfaces and related functions (linklevel).
16215 *
16216 @@ -9,14 +9,6 @@
16217 * This software may be used and distributed according to the terms
16218 * of the GNU General Public License, incorporated herein by reference.
16219 *
16220 - * Data Over Voice (DOV) support added - Guy Ellis 23-Mar-02
16221 - * guy@traverse.com.au
16222 - * Outgoing calls - looks for a 'V' in first char of dialed number
16223 - * Incoming calls - checks first character of eaz as follows:
16224 - * Numeric - accept DATA only - original functionality
16225 - * 'V' - accept VOICE (DOV) only
16226 - * 'B' - accept BOTH DATA and DOV types
16227 - *
16228 * Jan 2001: fix CISCO HDLC Bjoern A. Zeeb <i4l@zabbadoz.net>
16229 * for info on the protocol, see
16230 * http://i4l.zabbadoz.net/i4l/cisco-hdlc.txt
16231 @@ -38,6 +30,10 @@
16232 #include "isdn_concap.h"
16233 #endif
16234
16235 +#ifdef CONFIG_ISDN_WITH_ABC
16236 +#include <linux/isdn_dwabc.h>
16237 +#define isdn_net_log_skb(skb,lp) isdn_net_log_skb_dwabc(skb,lp,NULL)
16238 +#endif
16239
16240 /*
16241 * Outline of new tbusy handling:
16242 @@ -79,7 +75,11 @@ static __inline__ int isdn_net_device_st
16243 dev = lp->master;
16244 else
16245 dev = &n->dev;
16246 +#ifdef COMPAT_NO_SOFTNET
16247 + return dev->start;
16248 +#else
16249 return netif_running(dev);
16250 +#endif
16251 }
16252
16253 /*
16254 @@ -143,6 +143,10 @@ static __inline__ void isdn_net_inc_fram
16255 atomic_inc(&lp->frame_cnt);
16256 if (isdn_net_device_busy(lp))
16257 isdn_net_device_stop_queue(lp);
16258 +#if 0
16259 + printk(KERN_DEBUG "%s: inc_frame_cnt now %d\n", lp->name,
16260 + atomic_read(&lp->frame_cnt));
16261 +#endif
16262 }
16263
16264 static __inline__ void isdn_net_dec_frame_cnt(isdn_net_local *lp)
16265 @@ -157,11 +161,19 @@ static __inline__ void isdn_net_dec_fram
16266 isdn_net_device_wake_queue(lp);
16267 }
16268 }
16269 +#if 0
16270 + printk(KERN_DEBUG "%s: dec_frame_cnt now %d\n", lp->name,
16271 + atomic_read(&lp->frame_cnt));
16272 +#endif
16273 }
16274
16275 static __inline__ void isdn_net_zero_frame_cnt(isdn_net_local *lp)
16276 {
16277 atomic_set(&lp->frame_cnt, 0);
16278 +#if 0
16279 + printk(KERN_DEBUG "%s: zero_frame_cnt now %d\n", lp->name,
16280 + atomic_read(&lp->frame_cnt));
16281 +#endif
16282 }
16283
16284 /* For 2.2.x we leave the transmitter busy timeout at 2 secs, just
16285 @@ -173,23 +185,101 @@ static __inline__ void isdn_net_zero_fra
16286 * which might rely on the tx timeout. If so, we'll find out this way...
16287 */
16288
16289 +#ifdef COMPAT_NO_SOFTNET
16290 +#define ISDN_NET_TX_TIMEOUT (2*HZ)
16291 +#else
16292 #define ISDN_NET_TX_TIMEOUT (20*HZ)
16293 +#endif
16294
16295 /* Prototypes */
16296
16297 +#ifndef CONFIG_ISDN_WITH_ABC
16298 int isdn_net_force_dial_lp(isdn_net_local *);
16299 +#endif
16300 static int isdn_net_start_xmit(struct sk_buff *, struct net_device *);
16301
16302 static void isdn_net_ciscohdlck_connected(isdn_net_local *lp);
16303 static void isdn_net_ciscohdlck_disconnected(isdn_net_local *lp);
16304
16305 -char *isdn_net_revision = "$Revision: 1.1.4.1 $";
16306 +char *isdn_net_revision = "$Revision: 1.153 $";
16307
16308 /*
16309 * Code for raw-networking over ISDN
16310 */
16311 +#ifdef CONFIG_ISDN_WITH_ABC
16312 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
16313 +static int isdn_dwabc_encap_with_conerr(isdn_net_local *lp)
16314 +{
16315 + if(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_CONN_ERROR)
16316 + return(0);
16317 +
16318 + return(
16319 + lp->p_encap == ISDN_NET_ENCAP_SYNCPPP ||
16320 + lp->p_encap == ISDN_NET_ENCAP_RAWIP ||
16321 + lp->p_encap == ISDN_NET_ENCAP_CISCOHDLCK ||
16322 + lp->p_encap == ISDN_NET_ENCAP_UIHDLC );
16323 +}
16324 +
16325 +static int isdn_dwabc_conerr_ippktok(struct sk_buff *skb)
16326 +{
16327 + struct iphdr *iph = (struct iphdr *)skb->data;
16328 + return(iph->version == 6 || (skb->len >= 20 && iph->version == 4));
16329 +}
16330 +
16331 +#endif
16332 +
16333 +static int isdn_dwabc_is_interface_disabled(isdn_net_local *lp)
16334 +{
16335 + if(lp == NULL)
16336 + return(0);
16337 +
16338 + lp->dw_abc_inuse_secure = 0;
16339 + lp->dw_abc_dialstart = 0;
16340 +
16341 + /*
16342 + ** check for jiffies overflow
16343 + */
16344 + if(lp->dw_abc_bchan_last_connect > jiffies) {
16345 +
16346 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
16347 + lp->dw_abc_bchan_errcnt = 0;
16348 +#endif
16349 + lp->dw_abc_bchan_last_connect = 0;
16350 + }
16351 +
16352 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
16353 + if(!(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_CONN_ERROR) && isdn_dwabc_encap_with_conerr(lp)) {
16354 +
16355 + if(lp->dw_abc_bchan_errcnt > 3 && !(lp->dw_abc_bchan_errcnt & 3)) {
16356
16357 + ulong nj = jiffies;
16358 + ulong delay = lp->dw_abc_bchan_errcnt *
16359 + lp->dw_abc_bchan_errcnt *
16360 + lp->dw_abc_bchan_errcnt;
16361 +
16362 + if(delay > 86400) delay = 86400;
16363 + delay = (lp->dw_abc_bchan_last_connect + delay * HZ);
16364 +
16365 + if(delay > nj) {
16366 +
16367 + printk(KERN_INFO
16368 + "%s: interface auto-disabled (bchannel connect-error %lu seconds left)\n",
16369 + lp->name,(delay - nj) / HZ);
16370 +
16371 + return(1);
16372 + }
16373 + }
16374 + }
16375 +#endif
16376 + return(0);
16377 +}
16378 +#endif
16379 +
16380 +#ifdef CONFIG_ISDN_WITH_ABC
16381 +void
16382 +#else
16383 static void
16384 +#endif
16385 isdn_net_unreachable(struct net_device *dev, struct sk_buff *skb, char *reason)
16386 {
16387 if(skb) {
16388 @@ -297,6 +387,12 @@ isdn_net_unbind_channel(isdn_net_local *
16389
16390 save_flags(flags);
16391 cli();
16392 +#ifdef CONFIG_ISDN_WITH_ABC
16393 + isdn_dw_clear_if(0l,lp);
16394 + lp->dw_abc_if_flags &= ~ISDN_DW_ABC_IFFLAG_NODCHAN;
16395 + lp->dw_abc_inuse_secure = 0;
16396 + dwabc_bsd_free(lp);
16397 +#endif
16398 skb_queue_purge(&lp->super_tx_queue);
16399
16400 if (!lp->master) { /* reset only master device */
16401 @@ -351,6 +447,26 @@ isdn_net_autohup()
16402 if ((l->flags & ISDN_NET_CONNECTED) && (!l->dialstate)) {
16403 anymore = 1;
16404 l->huptimer++;
16405 +#ifdef CONFIG_ISDN_WITH_ABC
16406 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
16407 + if( isdn_dwabc_encap_with_conerr(l) && l->dw_abc_bchan_errcnt > 0) {
16408 +
16409 + int n = 180;
16410 +
16411 + if(l->dw_abc_bchan_errcnt > 3) n = 120;
16412 + if(l->dw_abc_bchan_errcnt > 6) n = 90;
16413 + if(l->dw_abc_bchan_errcnt > 9) n = 60;
16414 +
16415 + if(l->huptimer > n) {
16416 +
16417 + printk(KERN_INFO "%s: bchan conf-error auto-secure-hangup\n",l->name);
16418 + isdn_net_hangup(&p->dev);
16419 + p = (isdn_net_dev *) p->next;
16420 + continue;
16421 + }
16422 + }
16423 +#endif
16424 +#endif
16425 /*
16426 * if there is some dialmode where timeout-hangup
16427 * should _not_ be done, check for that here
16428 @@ -465,8 +581,32 @@ isdn_net_stat_callback(int idx, isdn_ctr
16429 printk(KERN_INFO "%s: Chargesum is %d\n", lp->name,
16430 lp->charge);
16431 isdn_net_unbind_channel(lp);
16432 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
16433 + if(lp->dw_abc_bchan_errcnt) {
16434 +
16435 + printk(KERN_INFO
16436 + "%s: Note: bchannel-error-counter is %hd\n",
16437 + lp->name,
16438 + lp->dw_abc_bchan_errcnt);
16439 + }
16440 +#endif
16441 return 1;
16442 }
16443 +#ifdef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
16444 + if(!(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_CH_EXTINUSE)) {
16445 + if((lp->dialstate == 4 || lp->dialstate == 12) &&
16446 + lp->dw_abc_dialstart && (idx < ISDN_MAX_CHANNELS)) {
16447 +
16448 + if((jiffies - lp->dw_abc_dialstart) < (HZ >>2)) {
16449 +
16450 + lp->dw_abc_if_flags |= ISDN_DW_ABC_IFFLAG_NODCHAN;
16451 + lp->dialstate = 1;
16452 + dev->dwabc_chan_external_inuse[idx] = jiffies + HZ * 30;
16453 + printk(KERN_INFO "%s: Channel %d look like external in use\n",lp->name,idx);
16454 + }
16455 + }
16456 + }
16457 +#endif
16458 break;
16459 #ifdef CONFIG_ISDN_X25
16460 case ISDN_STAT_BHUP:
16461 @@ -507,6 +647,19 @@ isdn_net_stat_callback(int idx, isdn_ctr
16462 }
16463 }
16464 printk(KERN_INFO "isdn_net: %s connected\n", lp->name);
16465 +#ifdef CONFIG_ISDN_WITH_ABC
16466 + if(!dwabc_bsd_init(lp)) dwabc_bsd_first_gen(lp);
16467 + lp->dw_abc_bchan_last_connect = jiffies;
16468 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
16469 + if(!(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_CONN_ERROR)) {
16470 +
16471 + lp->dw_abc_bchan_errcnt += isdn_dwabc_encap_with_conerr(lp);
16472 +
16473 + if(lp->dw_abc_bchan_errcnt > 32000)
16474 + lp->dw_abc_bchan_errcnt = 32000;
16475 + }
16476 +#endif
16477 +#endif
16478 /* If first Chargeinfo comes before B-Channel connect,
16479 * we correct the timestamp here.
16480 */
16481 @@ -578,7 +731,6 @@ isdn_net_dial(void)
16482 int i;
16483 unsigned long flags;
16484 isdn_ctrl cmd;
16485 - u_char *phone_number;
16486
16487 while (p) {
16488 isdn_net_local *lp = p->local;
16489 @@ -597,6 +749,47 @@ isdn_net_dial(void)
16490 */
16491 save_flags(flags);
16492 cli();
16493 +#ifdef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
16494 + if(!(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_CH_EXTINUSE) &&
16495 + (lp->dw_abc_if_flags & ISDN_DW_ABC_IFFLAG_NODCHAN)) {
16496 +
16497 + int chi = 0;
16498 + short lsecure = 0;
16499 +
16500 + lsecure = lp->dw_abc_inuse_secure;
16501 + isdn_net_unbind_channel(lp);
16502 + lp->dw_abc_inuse_secure = lsecure + 1;
16503 +
16504 + /* Grab a free ISDN-Channel */
16505 + if ((lsecure >= ISDN_MAX_CHANNELS ) || (chi =
16506 + isdn_get_free_channel(
16507 + ISDN_USAGE_NET,
16508 + lp->l2_proto,
16509 + lp->l3_proto,
16510 + lp->pre_device,
16511 + lp->pre_channel,
16512 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
16513 + (*lp->dw_out_msn) ? lp->dw_out_msn : lp->msn)
16514 +#else
16515 + lp->msn)
16516 +#endif
16517 + ) < 0) {
16518 +
16519 + restore_flags(flags);
16520 + isdn_net_unreachable(&p->dev, NULL,
16521 + "DWABC: redial-external-inuse NO FREE CHANNEL\n");
16522 + isdn_net_hangup(&p->dev);
16523 + break;
16524 + }
16525 +
16526 + isdn_net_bind_channel(lp, chi);
16527 + lp->dialstate = 1;
16528 + lp->dialstarted = 0;
16529 + lp->dialwait_timer = 0;
16530 + }
16531 +
16532 + lp->dw_abc_if_flags &= ~ISDN_DW_ABC_IFFLAG_NODCHAN;
16533 +#endif
16534 lp->dial = lp->phone[1];
16535 restore_flags(flags);
16536 if (!lp->dial) {
16537 @@ -621,18 +814,69 @@ isdn_net_dial(void)
16538 cmd.arg = lp->isdn_channel;
16539 cmd.command = ISDN_CMD_CLREAZ;
16540 isdn_command(&cmd);
16541 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
16542 + sprintf(cmd.parm.num, "%s",
16543 + isdn_map_eaz2msn((*lp->dw_out_msn) ? lp->dw_out_msn : lp->msn, cmd.driver));
16544 +#else
16545 sprintf(cmd.parm.num, "%s", isdn_map_eaz2msn(lp->msn, cmd.driver));
16546 +#endif
16547 cmd.command = ISDN_CMD_SETEAZ;
16548 isdn_command(&cmd);
16549 lp->dialretry = 0;
16550 anymore = 1;
16551 lp->dialstate++;
16552 +#ifdef CONFIG_ISDN_WITH_ABC
16553 + lp->onhtime = lp->dw_abc_old_onhtime;
16554 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
16555 + isdn_dw_abc_lcr_clear(lp);
16556 +#endif
16557 +#endif
16558 /* Fall through */
16559 case 3:
16560 /* Setup interface, dial current phone-number, switch to next number.
16561 * If list of phone-numbers is exhausted, increment
16562 * retry-counter.
16563 */
16564 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
16565 + if(!isdn_dw_abc_lcr_lock()) {
16566 +
16567 + if( lp->dw_abc_lcr_cmd != NULL &&
16568 + lp->dw_abc_lcr_start_request !=
16569 + lp->dw_abc_lcr_end_request) {
16570 +
16571 + if( lp->dw_abc_lcr_io == NULL &&
16572 + lp->dw_abc_lcr_start_request <= jiffies &&
16573 + lp->dw_abc_lcr_end_request > jiffies) {
16574 +
16575 + isdn_dw_abc_lcr_ulock();
16576 + anymore = 1;
16577 + break;
16578 + }
16579 +
16580 + if(lp->dw_abc_lcr_io != NULL) {
16581 +
16582 + if(lp->dw_abc_lcr_io->lcr_ioctl_flags &
16583 + DWABC_LCR_FLG_DISABLE) {
16584 +
16585 + isdn_dw_abc_lcr_ulock();
16586 + isdn_net_hangup(&p->dev);
16587 + break;
16588 + }
16589 +
16590 + if(lp->dw_abc_lcr_io->lcr_ioctl_flags &
16591 + DWABC_LCR_FLG_NEWHUPTIME) {
16592 + lp->onhtime = lp->dw_abc_lcr_io->lcr_ioctl_onhtime;
16593 + }
16594 + }
16595 +
16596 + memcpy(&cmd,lp->dw_abc_lcr_cmd,sizeof(cmd));
16597 + isdn_dw_abc_lcr_ulock();
16598 + goto dw_abc_lcr_next_click;
16599 + }
16600 +
16601 + isdn_dw_abc_lcr_ulock();
16602 + }
16603 +#endif
16604 if(dev->global_flags & ISDN_GLOBAL_STOPPED || (ISDN_NET_DIALMODE(*lp) == ISDN_NET_DM_OFF)) {
16605 char *s;
16606 if (dev->global_flags & ISDN_GLOBAL_STOPPED)
16607 @@ -677,20 +921,7 @@ isdn_net_dial(void)
16608 break;
16609 }
16610
16611 - cmd.driver = lp->isdn_device;
16612 - cmd.command = ISDN_CMD_DIAL;
16613 - cmd.parm.setup.si2 = 0;
16614 -
16615 - /* check for DOV */
16616 - phone_number = lp->dial->num;
16617 - if ((*phone_number == 'v') ||
16618 - (*phone_number == 'V')) { /* DOV call */
16619 - cmd.parm.setup.si1 = 1;
16620 - } else { /* DATA call */
16621 - cmd.parm.setup.si1 = 7;
16622 - }
16623 -
16624 - strcpy(cmd.parm.setup.phone, phone_number);
16625 + sprintf(cmd.parm.setup.phone, "%s", lp->dial->num);
16626 /*
16627 * Switch to next number or back to start if at end of list.
16628 */
16629 @@ -710,17 +941,70 @@ isdn_net_dial(void)
16630 }
16631 }
16632 restore_flags(flags);
16633 + cmd.driver = lp->isdn_device;
16634 + cmd.command = ISDN_CMD_DIAL;
16635 + cmd.parm.setup.si1 = 7;
16636 + cmd.parm.setup.si2 = 0;
16637 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
16638 + sprintf(cmd.parm.setup.eazmsn, "%s",
16639 + isdn_map_eaz2msn((*lp->dw_out_msn) ? lp->dw_out_msn : lp->msn, cmd.driver));
16640 +#else
16641 sprintf(cmd.parm.setup.eazmsn, "%s",
16642 isdn_map_eaz2msn(lp->msn, cmd.driver));
16643 +#endif
16644 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
16645 + /*
16646 + ** if callback-out we dont need
16647 + ** low-cost-routing LCR
16648 + */
16649 + if(!(lp->flags & ISDN_NET_CBOUT) &&
16650 + !(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_LCR)) {
16651 +
16652 + isdn_dw_abc_lcr_call_number(lp,&cmd);
16653 +
16654 + if(lp->dw_abc_lcr_start_request != lp->dw_abc_lcr_end_request) {
16655 +
16656 + if(dev->net_verbose > 2) {
16657 +
16658 + printk(KERN_INFO
16659 + "%s: Waiting for LCR-response from isdnlog %s -> %s...\n",
16660 + lp->name,
16661 + cmd.parm.setup.eazmsn,
16662 + cmd.parm.setup.phone);
16663 + }
16664 +
16665 + anymore = 1;
16666 + break;
16667 + }
16668 + }
16669 +
16670 +dw_abc_lcr_next_click:;
16671 + isdn_dw_abc_lcr_clear(lp);
16672 +#endif
16673 i = isdn_dc2minor(lp->isdn_device, lp->isdn_channel);
16674 if (i >= 0) {
16675 strcpy(dev->num[i], cmd.parm.setup.phone);
16676 dev->usage[i] |= ISDN_USAGE_OUTGOING;
16677 isdn_info_update();
16678 }
16679 - printk(KERN_INFO "%s: dialing %d %s... %s\n", lp->name,
16680 - lp->dialretry, cmd.parm.setup.phone,
16681 - (cmd.parm.setup.si1 == 1) ? "DOV" : "");
16682 +#ifdef CONFIG_ISDN_WITH_ABC
16683 + printk(KERN_INFO "%s: dialing %d %s -> %s...\n", lp->name,
16684 + lp->dialretry,
16685 + cmd.parm.setup.eazmsn,
16686 + cmd.parm.setup.phone);
16687 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
16688 + if(lp->dw_abc_bchan_errcnt) {
16689 +
16690 + printk(KERN_INFO
16691 + "%s: Note: bchannel-error-counter is %hd\n",
16692 + lp->name,
16693 + lp->dw_abc_bchan_errcnt);
16694 + }
16695 +#endif
16696 +#else
16697 + printk(KERN_INFO "%s: dialing %d %s...\n", lp->name,
16698 + lp->dialretry, cmd.parm.setup.phone);
16699 +#endif
16700 lp->dtimer = 0;
16701 #ifdef ISDN_DEBUG_NET_DIAL
16702 printk(KERN_DEBUG "dial: d=%d c=%d\n", lp->isdn_device,
16703 @@ -741,6 +1025,10 @@ isdn_net_dial(void)
16704 lp->dialstate =
16705 (lp->cbdelay &&
16706 (lp->flags & ISDN_NET_CBOUT)) ? 12 : 4;
16707 +#ifdef CONFIG_ISDN_WITH_ABC
16708 + lp->dw_abc_if_flags &= ~ISDN_DW_ABC_IFFLAG_NODCHAN;
16709 + lp->dw_abc_dialstart = jiffies;
16710 +#endif
16711 break;
16712 case 4:
16713 /* Wait for D-Channel-connect.
16714 @@ -890,6 +1178,15 @@ isdn_net_hangup(struct net_device *d)
16715 isdn_command(&cmd);
16716 printk(KERN_INFO "%s: Chargesum is %d\n", lp->name, lp->charge);
16717 isdn_all_eaz(lp->isdn_device, lp->isdn_channel);
16718 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
16719 + if(lp->dw_abc_bchan_errcnt) {
16720 +
16721 + printk(KERN_INFO
16722 + "%s: Note: bchannel-error-counter is %hd\n",
16723 + lp->name,
16724 + lp->dw_abc_bchan_errcnt);
16725 + }
16726 +#endif
16727 }
16728 isdn_net_unbind_channel(lp);
16729 }
16730 @@ -899,8 +1196,13 @@ typedef struct {
16731 unsigned short dest;
16732 } ip_ports;
16733
16734 +#ifdef CONFIG_ISDN_WITH_ABC
16735 +void
16736 +isdn_net_log_skb_dwabc(struct sk_buff * skb, isdn_net_local * lp,char *reason)
16737 +#else
16738 static void
16739 isdn_net_log_skb(struct sk_buff * skb, isdn_net_local * lp)
16740 +#endif
16741 {
16742 u_char *p = skb->nh.raw; /* hopefully, this was set correctly */
16743 unsigned short proto = ntohs(skb->protocol);
16744 @@ -972,7 +1274,13 @@ isdn_net_log_skb(struct sk_buff * skb, i
16745 break;
16746 }
16747 printk(KERN_INFO
16748 +#ifdef CONFIG_ISDN_WITH_ABC
16749 + "%s %s: %d.%d.%d.%d -> %d.%d.%d.%d%s\n",
16750 + (reason == NULL) ? "OPEN" : reason,
16751 + (lp != NULL) ? lp->name : "",
16752 +#else
16753 "OPEN: %d.%d.%d.%d -> %d.%d.%d.%d%s\n",
16754 +#endif
16755
16756 p[12], p[13], p[14], p[15],
16757 p[16], p[17], p[18], p[19],
16758 @@ -980,7 +1288,13 @@ isdn_net_log_skb(struct sk_buff * skb, i
16759 break;
16760 case ETH_P_ARP:
16761 printk(KERN_INFO
16762 +#ifdef CONFIG_ISDN_WITH_ABC
16763 + "%s %s: ARP %d.%d.%d.%d -> *.*.*.* ?%d.%d.%d.%d\n",
16764 + (reason == NULL) ? "OPEN" : reason,
16765 + (lp != NULL) ? lp->name : "",
16766 +#else
16767 "OPEN: ARP %d.%d.%d.%d -> *.*.*.* ?%d.%d.%d.%d\n",
16768 +#endif
16769 p[14], p[15], p[16], p[17],
16770 p[24], p[25], p[26], p[27]);
16771 break;
16772 @@ -1004,11 +1318,22 @@ void isdn_net_write_super(isdn_net_local
16773 }
16774
16775 spin_lock_bh(&lp->xmit_lock);
16776 +
16777 if (!isdn_net_lp_busy(lp)) {
16778 +#ifdef CONFIG_ISDN_WITH_ABC
16779 + if(!skb_queue_empty(&lp->super_tx_queue)) {
16780 + /*
16781 + ** don't reverse the frame flow
16782 + ** compression need frames in order and maybe other's too
16783 + */
16784 + skb_queue_tail(&lp->super_tx_queue, skb);
16785 + skb = skb_dequeue(&lp->super_tx_queue);
16786 + }
16787 +#endif
16788 isdn_net_writebuf_skb(lp, skb);
16789 - } else {
16790 - skb_queue_tail(&lp->super_tx_queue, skb);
16791 - }
16792 +
16793 + } else skb_queue_tail(&lp->super_tx_queue, skb);
16794 +
16795 spin_unlock_bh(&lp->xmit_lock);
16796 }
16797
16798 @@ -1056,7 +1381,6 @@ void isdn_net_writebuf_skb(isdn_net_loca
16799 printk(KERN_WARNING "%s: HL driver queue full\n", lp->name);
16800 goto error;
16801 }
16802 -
16803 lp->transcount += len;
16804 isdn_net_inc_frame_cnt(lp);
16805 return;
16806 @@ -1064,9 +1388,19 @@ void isdn_net_writebuf_skb(isdn_net_loca
16807 error:
16808 dev_kfree_skb(skb);
16809 lp->stats.tx_errors++;
16810 -
16811 }
16812
16813 +#if 0
16814 +int isdn_net_send_skb(struct net_device *ndev, isdn_net_local * lp,struct sk_buff *skb)
16815 +{
16816 + if (isdn_net_lp_busy(lp)) {
16817 + printk(KERN_WARNING "isdn_net_send_skb: HL channel busy\n");
16818 + return 1;
16819 + }
16820 + isdn_net_writebuf_skb(lp, skb);
16821 + return 0;
16822 +}
16823 +#endif
16824
16825 /*
16826 * Helper function for isdn_net_start_xmit.
16827 @@ -1109,7 +1443,54 @@ isdn_net_xmit(struct net_device *ndev, s
16828
16829 /* Reset hangup-timeout */
16830 lp->huptimer = 0; // FIXME?
16831 +#ifdef CONFIG_ISDN_WITH_ABC
16832 +
16833 + if(test_and_set_bit(ISDN_DW_ABC_BITLOCK_SEND,&lp->dw_abc_bitlocks)) {
16834 +
16835 + if(dev->net_verbose > 2)
16836 + printk(KERN_INFO "%s: isdn_net_xmit called recursivly\n",lp->name);
16837 +
16838 + spin_unlock_bh(&lp->xmit_lock);
16839 + return(1);
16840 + }
16841 +
16842 + if(skb != NULL) {
16843 +
16844 + int l = skb->len;
16845 + int nl = l;
16846 +
16847 + if( lp->p_encap == ISDN_NET_ENCAP_RAWIP &&
16848 + (lp->dw_abc_if_flags & ISDN_DW_ABC_IFFLAG_BSDAKTIV)) {
16849 +
16850 + if((skb = dwabc_bsd_compress(lp,skb,ndev)) != NULL) {
16851 +
16852 + int r = 0;
16853 + nl = skb->len;
16854 + skb_queue_tail(&lp->super_tx_queue,skb);
16855 +
16856 + if(l != nl && (r = isdn_dc2minor(lp->isdn_device,lp->isdn_channel)) >= 0) {
16857 +
16858 + dev->obytes[r] += l - nl;
16859 + lp->stats.tx_bytes += l - nl;
16860 + }
16861 + }
16862 +
16863 + } else skb_queue_tail(&lp->super_tx_queue,skb);
16864 +
16865 + if(lp->p_encap == ISDN_NET_ENCAP_RAWIP) {
16866 +
16867 + lp->dw_abc_bsd_snd += l;
16868 + lp->dw_abc_bsd_bsd_snd += nl;
16869 + }
16870 + }
16871 + clear_bit(ISDN_DW_ABC_BITLOCK_SEND,&lp->dw_abc_bitlocks);
16872 +
16873 + while(!isdn_net_lp_busy(lp) && (skb = skb_dequeue(&lp->super_tx_queue)))
16874 + isdn_net_writebuf_skb(lp, skb);
16875 +
16876 +#else
16877 isdn_net_writebuf_skb(lp, skb);
16878 +#endif
16879 spin_unlock_bh(&lp->xmit_lock);
16880
16881 /* the following stuff is here for backwards compatibility.
16882 @@ -1143,6 +1524,69 @@ isdn_net_xmit(struct net_device *ndev, s
16883
16884 return retv;
16885
16886 +#if 0
16887 + if (lp->cps > lp->triggercps) {
16888 + /* Device overloaded */
16889 +
16890 + /*
16891 + * Packet-delivery via round-robin over master
16892 + * and all connected slaves.
16893 + */
16894 + if (lp->master) {
16895 + /* Slaves always deliver themselves */
16896 + spin_lock_bh(&lp->xmit_lock);
16897 + if (!isdn_net_lp_busy(lp)) {
16898 + isdn_net_writebuf_skb(lp, skb);
16899 + ret = 0;
16900 + } else {
16901 + isdn_net_device_stop_queue(lp);
16902 + ret = 1;
16903 + }
16904 + ret = isdn_net_send_skb(ndev, lp, skb);
16905 + spin_unlock_bh(&lp->xmit_lock);
16906 + } else {
16907 + isdn_net_local *slp = (isdn_net_local *) (lp->srobin->priv);
16908 + /* Master delivers via srobin and maintains srobin */
16909 + if (lp->srobin == ndev) {
16910 + spin_lock_bh(&lp->xmit_lock);
16911 + ret = isdn_net_send_skb(ndev, lp, skb);
16912 + spin_unlock_bh(&lp->xmit_lock);
16913 + } else {
16914 + ret = isdn_net_start_xmit(skb, lp->srobin);
16915 + }
16916 + lp->srobin = (slp->slave) ? slp->slave : ndev;
16917 + slp = (isdn_net_local *) (lp->srobin->priv);
16918 + if (!((slp->flags & ISDN_NET_CONNECTED) && (slp->dialstate == 0)))
16919 + lp->srobin = ndev;
16920 + }
16921 + /* Slave-startup using delay-variable */
16922 + if (lp->slave) {
16923 + if (!lp->sqfull) {
16924 + /* First time overload: set timestamp only */
16925 + lp->sqfull = 1;
16926 + lp->sqfull_stamp = jiffies;
16927 + } else {
16928 + /* subsequent overload: if slavedelay exceeded, start dialing */
16929 + if ((jiffies - lp->sqfull_stamp) > lp->slavedelay)
16930 + isdn_net_force_dial_lp((isdn_net_local *) lp->slave->priv);
16931 + }
16932 + }
16933 + } else {
16934 + /* Not overloaded, deliver locally */
16935 + spin_lock_bh(&lp->xmit_lock);
16936 + if (!isdn_net_lp_busy(lp)) {
16937 + isdn_net_writebuf_skb(lp, skb);
16938 + ret = 0;
16939 + } else {
16940 + isdn_net_device_stop_queue(lp);
16941 + ret = 1;
16942 + }
16943 + spin_unlock_bh(&lp->xmit_lock);
16944 + if (lp->sqfull && ((jiffies - lp->sqfull_stamp) > (lp->slavedelay + (10 * HZ))))
16945 + lp->sqfull = 0;
16946 + }
16947 + return ret;
16948 +#endif
16949 }
16950
16951 static void
16952 @@ -1161,6 +1605,7 @@ isdn_net_adjust_hdr(struct sk_buff *skb,
16953 }
16954
16955
16956 +#ifndef COMPAT_NO_SOFTNET
16957 void isdn_net_tx_timeout(struct net_device * ndev)
16958 {
16959 isdn_net_local *lp = (isdn_net_local *) ndev->priv;
16960 @@ -1188,19 +1633,206 @@ void isdn_net_tx_timeout(struct net_devi
16961 ndev->trans_start = jiffies;
16962 netif_wake_queue(ndev);
16963 }
16964 +#endif
16965
16966 /*
16967 * Try sending a packet.
16968 * If this interface isn't connected to a ISDN-Channel, find a free channel,
16969 * and start dialing.
16970 */
16971 +#ifdef CONFIG_ISDN_WITH_ABC
16972 +static int dwabc_isdn_net_start_xmit(struct sk_buff *,struct net_device *);
16973 +
16974 +static int isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
16975 +{
16976 + if(skb == NULL || ndev == NULL)
16977 + return(dwabc_isdn_net_start_xmit(skb,ndev));
16978 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK
16979 + if(!(((isdn_net_local *)ndev->priv)->dw_abc_flags &
16980 + ISDN_DW_ABC_FLAG_NO_UDP_CHECK)) {
16981 +
16982 + if(dw_abc_udp_test(skb,ndev)) {
16983 + dev_kfree_skb(skb);
16984 + return(0);
16985 + }
16986 + }
16987 +#endif
16988 + return(dwabc_isdn_net_start_xmit(skb,ndev));
16989 +}
16990 +
16991 +
16992 +#ifdef CONFIG_ISDN_WITH_ABC
16993 +int isdn_auto_dial_helper( isdn_net_local *lp,
16994 + struct sk_buff *skb,
16995 + int dm_manual_allowed)
16996 +/**********************************************************************
16997 + return's:
16998 + -1 dial not allowed or impossible
16999 + 0 interface is connected
17000 + 1 dial is started
17001 +***********************************************************************/
17002 +{
17003 + int retw = -1;
17004 + int chi;
17005 + ulong flags;
17006 + char *errmsg = NULL;
17007 +
17008 +#ifdef ISDN_DEBUG_NET_DUMP
17009 + {
17010 + char *buf = skb->data;
17011 + isdn_dumppkt("S:", buf, skb->len, 40);
17012 + }
17013 +#endif
17014 + if (lp->flags & ISDN_NET_CONNECTED)
17015 + return(0);
17016 +
17017 + save_flags(flags);
17018 + cli();
17019 +
17020 + do {
17021 +
17022 + /* Log packet, which triggered dialing */
17023 + if (dev->net_verbose)
17024 + isdn_net_log_skb(skb, lp);
17025 + /* only do autodial if allowed by config */
17026 + if (!(ISDN_NET_DIALMODE(*lp) == ISDN_NET_DM_AUTO)) {
17027 + errmsg = "dial rejected: interface not in dialmode `auto'";
17028 +
17029 + if(dm_manual_allowed &&
17030 + !(ISDN_NET_DIALMODE(*lp) == ISDN_NET_DM_MANUAL)) {
17031 +
17032 + errmsg =
17033 + "dial rejected: interface not in dialmode `auto or manual'";
17034 + }
17035 + break;
17036 + }
17037 +
17038 + if (!lp->phone[1]) {
17039 +
17040 + errmsg = "No phone number";
17041 + break;
17042 + }
17043 +
17044 + if(lp->dialwait_timer <= 0) {
17045 +
17046 + if( lp->dialstarted > 0 &&
17047 + lp->dialtimeout > 0 &&
17048 + jiffies < (lp->dialstarted + lp->dialtimeout + lp->dialwait)) {
17049 +
17050 + lp->dialwait_timer =
17051 + lp->dialstarted + lp->dialtimeout + lp->dialwait;
17052 + }
17053 + }
17054 +
17055 + if(lp->dialwait_timer > 0) {
17056 +
17057 + if(jiffies < lp->dialwait_timer) {
17058 +
17059 + errmsg = "dial rejected: retry-time not reached";
17060 + break;
17061 +
17062 + } else lp->dialwait_timer = 0;
17063 + }
17064 +#ifdef CONFIG_ISDN_WITH_ABC
17065 + if(isdn_dwabc_is_interface_disabled(lp))
17066 + break;
17067 +#endif
17068 + /* Grab a free ISDN-Channel */
17069 + if (((chi =
17070 + isdn_get_free_channel(
17071 + ISDN_USAGE_NET,
17072 + lp->l2_proto,
17073 + lp->l3_proto,
17074 + lp->pre_device,
17075 + lp->pre_channel,
17076 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
17077 + (*lp->dw_out_msn) ? lp->dw_out_msn :
17078 +#endif
17079 + lp->msn)
17080 + ) < 0) &&
17081 + ((chi =
17082 + isdn_get_free_channel(
17083 + ISDN_USAGE_NET,
17084 + lp->l2_proto,
17085 + lp->l3_proto,
17086 + lp->pre_device,
17087 + lp->pre_channel^1,
17088 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
17089 + (*lp->dw_out_msn) ? lp->dw_out_msn :
17090 +#endif
17091 + lp->msn)
17092 + ) < 0)) {
17093 +
17094 + errmsg = "No channel";
17095 + break;
17096 + }
17097 +
17098 + lp->dialstate = 1;
17099 + /* Connect interface with channel */
17100 + isdn_net_bind_channel(lp, chi);
17101 +#ifdef CONFIG_ISDN_PPP
17102 + if (lp->p_encap == ISDN_NET_ENCAP_SYNCPPP) {
17103 + /* no 'first_skb' handling for syncPPP */
17104 + if (isdn_ppp_bind(lp) < 0) {
17105 + isdn_net_unbind_channel(lp);
17106 + break;
17107 + }
17108 +
17109 + isdn_net_dial(); /* Initiate dialing */
17110 + netif_stop_queue(&lp->netdev->dev);
17111 + retw = 1;
17112 + break;
17113 + /* let upper layer requeue skb packet */
17114 + }
17115 +#endif
17116 + /* Initiate dialing */
17117 + isdn_net_dial();
17118 + isdn_net_device_stop_queue(lp);
17119 + retw = 1;
17120 +
17121 + } while(0);
17122 +
17123 + if(retw < 0 && errmsg != NULL)
17124 + isdn_net_unreachable(&lp->netdev->dev, skb, errmsg);
17125 +
17126 + restore_flags(flags);
17127 + return(retw);
17128 +}
17129 +#endif
17130 +
17131 +
17132 +
17133 +static int
17134 +dwabc_isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
17135 +#else
17136 static int
17137 isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
17138 +#endif
17139 {
17140 isdn_net_local *lp = (isdn_net_local *) ndev->priv;
17141 #ifdef CONFIG_ISDN_X25
17142 struct concap_proto * cprot = lp -> netdev -> cprot;
17143 #endif
17144 +#ifdef COMPAT_NO_SOFTNET
17145 + /* some comment as with the softnet TX timeout
17146 + when this happens, it's a bug in the HL card driver
17147 + and should be fixed there, so we can supposedly get rid of
17148 + this here at all.
17149 + I added a debugging message to find out if it ever occurs --KG
17150 + */
17151 +
17152 + if (ndev->tbusy) {
17153 + if (jiffies - ndev->trans_start < ISDN_NET_TX_TIMEOUT)
17154 + return 1;
17155 + if (!lp->dialstate){
17156 + lp->stats.tx_errors++;
17157 + printk(KERN_WARNING "isdn_tx_timeout dev %s dialstate %d\n",
17158 + ndev->name, lp->dialstate);
17159 + }
17160 + ndev->trans_start = jiffies;
17161 + netif_wake_queue(ndev);
17162 + }
17163 +#endif
17164 #ifdef CONFIG_ISDN_X25
17165 /* At this point hard_start_xmit() passes control to the encapsulation
17166 protocol (if present).
17167 @@ -1220,6 +1852,40 @@ isdn_net_start_xmit(struct sk_buff *skb,
17168 } else
17169 #endif
17170 /* auto-dialing xmit function */
17171 +#ifdef CONFIG_ISDN_WITH_ABC
17172 + {
17173 + int r;
17174 +
17175 + isdn_net_adjust_hdr(skb, ndev);
17176 +
17177 + if(!(r = isdn_auto_dial_helper(lp,skb,0))) {
17178 +
17179 + /*
17180 + ** Device is connected to an ISDN channel
17181 + */
17182 + ndev->trans_start = jiffies;
17183 +
17184 + if (!lp->dialstate) {
17185 +
17186 + /*
17187 + ** ISDN connection is established, try sending
17188 + */
17189 + r = isdn_net_xmit(ndev, skb);
17190 +
17191 + } else r = 1;
17192 +
17193 + if(r)
17194 + netif_stop_queue(ndev);
17195 +
17196 + } else if(r < 0) {
17197 +
17198 + dev_kfree_skb(skb);
17199 + r = 0;
17200 + }
17201 +
17202 + return(r);
17203 + }
17204 +#else
17205 {
17206 #ifdef ISDN_DEBUG_NET_DUMP
17207 u_char *buf;
17208 @@ -1256,6 +1922,14 @@ isdn_net_start_xmit(struct sk_buff *skb,
17209 } else
17210 lp->dialwait_timer = 0;
17211 }
17212 +#ifdef CONFIG_ISDN_WITH_ABC
17213 + if(isdn_dwabc_is_interface_disabled(lp)) {
17214 +
17215 + dev_kfree_skb(skb);
17216 + restore_flags(flags);
17217 + return(0);
17218 + }
17219 +#endif
17220 /* Grab a free ISDN-Channel */
17221 if (((chi =
17222 isdn_get_free_channel(
17223 @@ -1264,6 +1938,9 @@ isdn_net_start_xmit(struct sk_buff *skb,
17224 lp->l3_proto,
17225 lp->pre_device,
17226 lp->pre_channel,
17227 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
17228 + (*lp->dw_out_msn) ? lp->dw_out_msn :
17229 +#endif
17230 lp->msn)
17231 ) < 0) &&
17232 ((chi =
17233 @@ -1273,6 +1950,9 @@ isdn_net_start_xmit(struct sk_buff *skb,
17234 lp->l3_proto,
17235 lp->pre_device,
17236 lp->pre_channel^1,
17237 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
17238 + (*lp->dw_out_msn) ? lp->dw_out_msn :
17239 +#endif
17240 lp->msn)
17241 ) < 0)) {
17242 restore_flags(flags);
17243 @@ -1296,16 +1976,6 @@ isdn_net_start_xmit(struct sk_buff *skb,
17244 restore_flags(flags);
17245 return 0; /* STN (skb to nirvana) ;) */
17246 }
17247 -#ifdef CONFIG_IPPP_FILTER
17248 - if (isdn_ppp_autodial_filter(skb, lp)) {
17249 - isdn_ppp_free(lp);
17250 - isdn_net_unbind_channel(lp);
17251 - restore_flags(flags);
17252 - isdn_net_unreachable(ndev, skb, "dial rejected: packet filtered");
17253 - dev_kfree_skb(skb);
17254 - return 0;
17255 - }
17256 -#endif
17257 restore_flags(flags);
17258 isdn_net_dial(); /* Initiate dialing */
17259 netif_stop_queue(ndev);
17260 @@ -1337,6 +2007,7 @@ isdn_net_start_xmit(struct sk_buff *skb,
17261 }
17262 }
17263 return 1;
17264 +#endif
17265 }
17266
17267 /*
17268 @@ -1356,6 +2027,9 @@ isdn_net_close(struct net_device *dev)
17269 if( cprot && cprot -> pops ) cprot -> pops -> close( cprot );
17270 #endif
17271 netif_stop_queue(dev);
17272 +#ifdef COMPAT_NO_SOFTNET
17273 + dev->start = 0;
17274 +#endif
17275 if ((p = (((isdn_net_local *) dev->priv)->slave))) {
17276 /* If this interface has slaves, stop them also */
17277 while (p) {
17278 @@ -1776,6 +2450,10 @@ isdn_net_ciscohdlck_receive(isdn_net_loc
17279 }
17280
17281 switch (type) {
17282 + case CISCO_TYPE_INET:
17283 + skb->protocol = htons(ETH_P_IP);
17284 + netif_rx(skb);
17285 + break;
17286 case CISCO_TYPE_SLARP:
17287 isdn_net_ciscohdlck_slarp_in(lp, skb);
17288 goto out_free;
17289 @@ -1785,11 +2463,11 @@ isdn_net_ciscohdlck_receive(isdn_net_loc
17290 "\"no cdp enable\" on cisco.\n", lp->name);
17291 goto out_free;
17292 default:
17293 - /* no special cisco protocol */
17294 - skb->protocol = htons(type);
17295 - netif_rx(skb);
17296 - return;
17297 + printk(KERN_WARNING "%s: Unknown Cisco type 0x%04x\n",
17298 + lp->name, type);
17299 + goto out_free;
17300 }
17301 + return;
17302
17303 out_free:
17304 kfree_skb(skb);
17305 @@ -1803,9 +2481,19 @@ isdn_net_receive(struct net_device *ndev
17306 {
17307 isdn_net_local *lp = (isdn_net_local *) ndev->priv;
17308 isdn_net_local *olp = lp; /* original 'lp' */
17309 +#ifdef CONFIG_ISDN_PPP
17310 + int proto = PPP_PROTOCOL(skb->data);
17311 +#endif
17312 #ifdef CONFIG_ISDN_X25
17313 struct concap_proto *cprot = lp -> netdev -> cprot;
17314 #endif
17315 +#ifdef CONFIG_ISDN_WITH_ABC
17316 + struct net_device *ondev = ndev;
17317 +#ifdef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
17318 + ulong lp_huptimer = 0;
17319 + ulong olp_huptimer = 0;
17320 +#endif
17321 +#endif
17322 lp->transcount += skb->len;
17323
17324 lp->stats.rx_packets++;
17325 @@ -1819,6 +2507,10 @@ isdn_net_receive(struct net_device *ndev
17326 lp->stats.rx_packets++;
17327 lp->stats.rx_bytes += skb->len;
17328 }
17329 +#ifdef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
17330 + lp_huptimer = lp->huptimer;
17331 + olp_huptimer = olp->huptimer;
17332 +#endif
17333 skb->dev = ndev;
17334 skb->pkt_type = PACKET_HOST;
17335 skb->mac.raw = skb->data;
17336 @@ -1840,9 +2532,40 @@ isdn_net_receive(struct net_device *ndev
17337 /* Fall through */
17338 case ISDN_NET_ENCAP_RAWIP:
17339 /* RAW-IP without MAC-Header */
17340 +#ifdef CONFIG_ISDN_WITH_ABC
17341 + if(olp->p_encap == ISDN_NET_ENCAP_RAWIP) {
17342 +
17343 + ushort l = skb->len;
17344 + short r = 0;
17345 +
17346 + olp->dw_abc_bsd_bsd_rcv += l;
17347 +
17348 + if((skb = dwabc_bsd_rx_pkt(olp,skb,ondev)) == NULL) {
17349 +
17350 + olp->dw_abc_bsd_rcv += l;
17351 + return;
17352 + }
17353 +
17354 + olp->dw_abc_bsd_rcv += skb->len;
17355 +
17356 + if( l != skb->len &&
17357 + (r=isdn_dc2minor(olp->isdn_device,olp->isdn_channel))>=0) {
17358 +
17359 + dev->ibytes[r] += skb->len - l;
17360 + olp->stats.rx_bytes += skb->len - l;
17361 +
17362 + if(olp != lp)
17363 + lp->stats.rx_bytes += skb->len - l;
17364 + }
17365 + }
17366 +#endif
17367 olp->huptimer = 0;
17368 lp->huptimer = 0;
17369 skb->protocol = htons(ETH_P_IP);
17370 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
17371 + if(isdn_dwabc_conerr_ippktok(skb))
17372 + lp->dw_abc_bchan_errcnt = 0;
17373 +#endif
17374 break;
17375 case ISDN_NET_ENCAP_CISCOHDLCK:
17376 isdn_net_ciscohdlck_receive(lp, skb);
17377 @@ -1862,8 +2585,22 @@ isdn_net_receive(struct net_device *ndev
17378 break;
17379 #ifdef CONFIG_ISDN_PPP
17380 case ISDN_NET_ENCAP_SYNCPPP:
17381 - /* huptimer is done in isdn_ppp_push_higher */
17382 + /*
17383 + * If encapsulation is syncppp, don't reset
17384 + * huptimer on LCP packets.
17385 + */
17386 + if (proto != PPP_LCP) {
17387 + olp->huptimer = 0;
17388 + lp->huptimer = 0;
17389 + }
17390 isdn_ppp_receive(lp->netdev, olp, skb);
17391 +#ifdef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
17392 + if(olp->dw_abc_flags & ISDN_DW_ABC_FLAG_RCV_NO_HUPTIMER) {
17393 +
17394 + lp->huptimer = lp_huptimer + 1;
17395 + olp->huptimer = olp_huptimer+ 1;
17396 + }
17397 +#endif
17398 return;
17399 #endif
17400
17401 @@ -1873,6 +2610,15 @@ isdn_net_receive(struct net_device *ndev
17402 if(cprot) if(cprot -> pops)
17403 if( cprot -> pops -> data_ind){
17404 cprot -> pops -> data_ind(cprot,skb);
17405 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
17406 + lp->dw_abc_bchan_errcnt = 0;
17407 +#ifdef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
17408 + if(olp->dw_abc_flags & ISDN_DW_ABC_FLAG_RCV_NO_HUPTIMER) {
17409 + lp->huptimer = lp_huptimer;
17410 + olp->huptimer = olp_huptimer;
17411 + }
17412 +#endif
17413 +#endif
17414 return;
17415 };
17416 #endif /* CONFIG_ISDN_X25 */
17417 @@ -1882,6 +2628,15 @@ isdn_net_receive(struct net_device *ndev
17418 return;
17419 }
17420
17421 +#ifdef CONFIG_ISDN_WITH_ABC
17422 +#ifdef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
17423 + if(olp->dw_abc_flags & ISDN_DW_ABC_FLAG_RCV_NO_HUPTIMER) {
17424 +
17425 + lp->huptimer = lp_huptimer;
17426 + olp->huptimer = olp_huptimer;
17427 + }
17428 +#endif
17429 +#endif
17430 netif_rx(skb);
17431 return;
17432 }
17433 @@ -2160,8 +2915,10 @@ isdn_net_find_icall(int di, int ch, int
17434 isdn_net_phone *n;
17435 ulong flags;
17436 char nr[32];
17437 - char *my_eaz;
17438 -
17439 +#ifdef CONFIG_ISDN_WITH_ABC
17440 + if(dev->net_verbose > 2)
17441 + printk(KERN_DEBUG "n_fi: di=%d ch=%d idx=%d usg=0x%04X\n", di, ch, idx,dev->usage[idx]);
17442 +#endif
17443 /* Search name in netdev-chain */
17444 save_flags(flags);
17445 cli();
17446 @@ -2180,17 +2937,15 @@ isdn_net_find_icall(int di, int ch, int
17447 eaz = setup->eazmsn;
17448 if (dev->net_verbose > 1)
17449 printk(KERN_INFO "isdn_net: call from %s,%d,%d -> %s\n", nr, si1, si2, eaz);
17450 - /* Accept DATA and VOICE calls at this stage
17451 - local eaz is checked later for allowed call types */
17452 - if ((si1 != 7) && (si1 != 1)) {
17453 - restore_flags(flags);
17454 - if (dev->net_verbose > 1)
17455 - printk(KERN_INFO "isdn_net: Service-Indicator not 1 or 7, ignored\n");
17456 - return 0;
17457 - }
17458 -
17459 -n = (isdn_net_phone *) 0;
17460 -p = dev->netdev;
17461 + /* Accept only calls with Si1 = 7 (Data-Transmission) */
17462 + if (si1 != 7) {
17463 + restore_flags(flags);
17464 + if (dev->net_verbose > 1)
17465 + printk(KERN_INFO "isdn_net: Service-Indicator not 7, ignored\n");
17466 + return 0;
17467 + }
17468 + n = (isdn_net_phone *) 0;
17469 + p = dev->netdev;
17470 ematch = wret = swapped = 0;
17471 #ifdef ISDN_DEBUG_NET_ICALL
17472 printk(KERN_DEBUG "n_fi: di=%d ch=%d idx=%d usg=%d\n", di, ch, idx,
17473 @@ -2210,25 +2965,8 @@ p = dev->netdev;
17474 break;
17475 }
17476 swapped = 0;
17477 - /* check acceptable call types for DOV */
17478 - my_eaz = isdn_map_eaz2msn(lp->msn, di);
17479 - if (si1 == 1) { /* it's a DOV call, check if we allow it */
17480 - if (*my_eaz == 'v' || *my_eaz == 'V' ||
17481 - *my_eaz == 'b' || *my_eaz == 'B')
17482 - my_eaz++; /* skip to allow a match */
17483 - else
17484 - my_eaz = 0; /* force non match */
17485 - } else { /* it's a DATA call, check if we allow it */
17486 - if (*my_eaz == 'b' || *my_eaz == 'B')
17487 - my_eaz++; /* skip to allow a match */
17488 - }
17489 - if (my_eaz)
17490 - matchret = isdn_msncmp(eaz, my_eaz);
17491 - else
17492 - matchret = 1;
17493 - if (!matchret)
17494 - ematch = 1;
17495 -
17496 + if (!(matchret = isdn_msncmp(eaz, isdn_map_eaz2msn(lp->msn, di))))
17497 + ematch = 1;
17498 /* Remember if more numbers eventually can match */
17499 if (matchret > wret)
17500 wret = matchret;
17501 @@ -2236,17 +2974,122 @@ p = dev->netdev;
17502 printk(KERN_DEBUG "n_fi: if='%s', l.msn=%s, l.flags=%d, l.dstate=%d\n",
17503 lp->name, lp->msn, lp->flags, lp->dialstate);
17504 #endif
17505 +#ifdef CONFIG_ISDN_WITH_ABC_CALLB
17506 + if ((!matchret) && /* EAZ is matching */
17507 + (((!(lp->flags & ISDN_NET_CONNECTED)) && /* but not connected */
17508 + (USG_NONE(dev->usage[idx]))) || /* and ch. unused or */
17509 + (lp->dialstate == 4) || (lp->dialstate == 12) || /* if dialing */
17510 + ((lp->flags & ISDN_NET_CBOUT) != 0 && /* init a callback */
17511 + lp->outgoing != 0 )))
17512 +
17513 + /*
17514 + ** we dont stop call's anymore (both sides call's syncron)
17515 + ** it will be problem in any case.
17516 + ** both sides will make the same.
17517 + ** i try later to make a switch (check the phon-numbers)
17518 + ** to detect with side must be stop the call.
17519 + */
17520 +#else
17521 if ((!matchret) && /* EAZ is matching */
17522 (((!(lp->flags & ISDN_NET_CONNECTED)) && /* but not connected */
17523 (USG_NONE(dev->usage[idx]))) || /* and ch. unused or */
17524 ((((lp->dialstate == 4) || (lp->dialstate == 12)) && /* if dialing */
17525 (!(lp->flags & ISDN_NET_CALLBACK))) /* but no callback */
17526 )))
17527 +#endif
17528 {
17529 #ifdef ISDN_DEBUG_NET_ICALL
17530 printk(KERN_DEBUG "n_fi: match1, pdev=%d pch=%d\n",
17531 lp->pre_device, lp->pre_channel);
17532 #endif
17533 +#ifdef CONFIG_ISDN_WITH_ABC
17534 +#ifdef CONFIG_ISDN_WITH_ABC_CALLB
17535 + {
17536 + int use_this_call = 0;
17537 +
17538 + if(!(lp->flags & ISDN_NET_CBOUT) && ((lp->dialstate == 4) || (lp->dialstate == 12))) {
17539 +
17540 + /*
17541 + ** searching for a diff. in the calling-number and the EAZ
17542 + ** the remote will make the same
17543 + */
17544 +
17545 + char *pnr = nr;
17546 + char *pea = eaz;
17547 +
17548 + for(;*pnr;pnr++);
17549 + for(;*pea;pea++);
17550 + for(pnr--,pea--;pnr >= nr && pea >= eaz && *pea != *pnr;pnr--,pea--);
17551 +
17552 + if(pnr < nr || pea < eaz || *pea > *pnr) {
17553 +
17554 + p = (isdn_net_dev *) p->next;
17555 + continue;
17556 + }
17557 +
17558 + use_this_call = 1;
17559 + }
17560 +
17561 + if( use_this_call ||
17562 + ((lp->flags & ISDN_NET_CBOUT) && (lp->flags & ISDN_NET_CONNECTED))) {
17563 +
17564 + /*
17565 + ** the incoming call was to quick.
17566 + ** the callback-delay-time ist not reached.
17567 + ** in that case we can stop the call
17568 + */
17569 +
17570 + if(lp->isdn_device > -1 && lp->isdn_channel > -1) {
17571 +
17572 + int minor = isdn_dc2minor(lp->isdn_device,lp->isdn_channel);
17573 +
17574 + if(lp->isdn_device != di || lp->isdn_channel != ch) {
17575 +
17576 + isdn_ctrl cmd;
17577 +
17578 + memset((void *)&cmd,0,sizeof(cmd));
17579 + cmd.driver = lp->isdn_device;
17580 + cmd.command = ISDN_CMD_HANGUP;
17581 + cmd.arg = lp->isdn_channel;
17582 + (void) dev->drv[cmd.driver]->interface->command(&cmd);
17583 + isdn_all_eaz(lp->isdn_device, lp->isdn_channel);
17584 +
17585 + if(dev->net_verbose > 1) {
17586 +
17587 + printk(KERN_INFO
17588 + "%s: found outgoing call hangup old call on di %d ch %d\n",
17589 + lp->name,lp->isdn_device,lp->isdn_channel);
17590 + }
17591 +
17592 + } else if (dev->net_verbose > 1) {
17593 +
17594 + printk(KERN_INFO "%s: found outgoing call on same di %d ch %d\n",
17595 + lp->name,lp->isdn_device,lp->isdn_channel);
17596 + }
17597 +
17598 + if(minor >= 0) {
17599 +
17600 + dev->rx_netdev[minor] = NULL;
17601 + dev->st_netdev[minor] = NULL;
17602 + }
17603 +
17604 + isdn_free_channel(lp->isdn_device,
17605 + lp->isdn_channel, ISDN_USAGE_NET);
17606 +
17607 + } else if (dev->net_verbose > 1) {
17608 +
17609 + printk(KERN_INFO "%s: found outgoing call reset callstate \n",lp->name);
17610 + }
17611 +
17612 + lp->flags &= ~ISDN_NET_CONNECTED;
17613 + lp->isdn_device = -1;
17614 + lp->isdn_channel = -1;
17615 + lp->dtimer = 0;
17616 + lp->dialstate = 0;
17617 + }
17618 + }
17619 +#endif
17620 +#endif
17621 if (dev->usage[idx] & ISDN_USAGE_EXCLUSIVE) {
17622 if ((lp->pre_channel != ch) ||
17623 (lp->pre_device != di)) {
17624 @@ -2375,6 +3218,12 @@ p = dev->netdev;
17625 continue;
17626 }
17627 }
17628 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
17629 + if(isdn_dwabc_is_interface_disabled(lp)) {
17630 + restore_flags(flags);
17631 + return 3;
17632 + }
17633 +#endif
17634 if (lp->flags & ISDN_NET_CALLBACK) {
17635 int chi;
17636 /*
17637 @@ -2427,6 +3276,47 @@ p = dev->netdev;
17638 restore_flags(flags);
17639 return 0;
17640 } else {
17641 +#ifdef CONFIG_ISDN_WITH_ABC_CALLB
17642 + {
17643 + /*
17644 + ** this is a sanity-check.
17645 + ** check for double use (device and channel)
17646 + ** will be very near to a kernel-crash in that case
17647 + */
17648 + isdn_net_dev *sp = dev->netdev;
17649 + int s_shl;
17650 + isdn_net_local *ml;
17651 +
17652 + for(s_shl=0; s_shl < 2048 && sp != NULL; sp = (isdn_net_dev *)sp->next, s_shl++) {
17653 +
17654 + if(sp == p || (ml = sp->local) == NULL)
17655 + continue;
17656 +
17657 + if(ml->isdn_device != di || ml->isdn_channel != ch)
17658 + continue;
17659 +
17660 + if(ml->dialstate != 4 && ml->dialstate != 12) {
17661 +
17662 + /*
17663 + ** wrong situation
17664 + */
17665 + break;
17666 + }
17667 +
17668 + isdn_net_unbind_channel(ml);
17669 + }
17670 +
17671 + if(sp != NULL) {
17672 +
17673 + printk(KERN_DEBUG
17674 +"%s: call from %s -> %s (drv %d chan %d duplicated with %s) \n",
17675 + lp->name, nr, eaz,di,ch,
17676 + sp->local->name );
17677 +
17678 + restore_flags(flags);
17679 + return 3;
17680 + }}
17681 +#endif
17682 printk(KERN_DEBUG "%s: call from %s -> %s accepted\n", lp->name, nr,
17683 eaz);
17684 /* if this interface is dialing, it does it probably on a different
17685 @@ -2516,7 +3406,11 @@ isdn_net_force_dial_lp(isdn_net_local *
17686 lp->l3_proto,
17687 lp->pre_device,
17688 lp->pre_channel,
17689 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
17690 + (*lp->dw_out_msn) ? lp->dw_out_msn : lp->msn)
17691 +#else
17692 lp->msn)
17693 +#endif
17694 ) < 0) {
17695 printk(KERN_WARNING "isdn_net_force_dial: No channel for %s\n", lp->name);
17696 restore_flags(flags);
17697 @@ -2599,7 +3493,11 @@ isdn_net_new(char *name, struct net_devi
17698 strcpy(netdev->local->name, " ");
17699 else
17700 strcpy(netdev->local->name, name);
17701 +#ifdef COMPAT_NO_SOFTNET
17702 + netdev->dev.name = netdev->local->name;
17703 +#else
17704 strcpy(netdev->dev.name, netdev->local->name);
17705 +#endif
17706 netdev->dev.priv = netdev->local;
17707 netdev->dev.init = isdn_net_init;
17708 netdev->local->p_encap = ISDN_NET_ENCAP_RAWIP;
17709 @@ -2617,11 +3515,13 @@ isdn_net_new(char *name, struct net_devi
17710 ((isdn_net_local *) q->priv)->slave = &(netdev->dev);
17711 } else {
17712 /* Device shall be a master */
17713 +#ifndef COMPAT_NO_SOFTNET
17714 /*
17715 * Watchdog timer (currently) for master only.
17716 */
17717 netdev->dev.tx_timeout = isdn_net_tx_timeout;
17718 netdev->dev.watchdog_timeo = ISDN_NET_TX_TIMEOUT;
17719 +#endif
17720 if (register_netdev(&netdev->dev) != 0) {
17721 printk(KERN_WARNING "isdn_net: Could not register net-device\n");
17722 kfree(netdev->local);
17723 @@ -2658,6 +3558,9 @@ isdn_net_new(char *name, struct net_devi
17724 netdev->local->hupflags = ISDN_INHUP; /* Do hangup even on incoming calls */
17725 netdev->local->onhtime = 10; /* Default hangup-time for saving costs
17726 of those who forget configuring this */
17727 +#ifdef CONFIG_ISDN_WITH_ABC
17728 + netdev->local->dw_abc_old_onhtime = netdev->local->onhtime;
17729 +#endif
17730 netdev->local->dialmax = 1;
17731 netdev->local->flags = ISDN_NET_CBHUP | ISDN_NET_DM_MANUAL; /* Hangup before Callback, manual dial */
17732 netdev->local->cbdelay = 25; /* Wait 5 secs before Callback */
17733 @@ -2831,7 +3734,6 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg
17734
17735 /* If binding is exclusive, try to grab the channel */
17736 save_flags(flags);
17737 - cli();
17738 if ((i = isdn_get_free_channel(ISDN_USAGE_NET,
17739 lp->l2_proto, lp->l3_proto, drvidx,
17740 chidx, lp->msn)) < 0) {
17741 @@ -2859,6 +3761,9 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg
17742 lp->pre_device = drvidx;
17743 lp->pre_channel = chidx;
17744 lp->onhtime = cfg->onhtime;
17745 +#ifdef CONFIG_ISDN_WITH_ABC
17746 + lp->dw_abc_old_onhtime = lp->onhtime;
17747 +#endif
17748 lp->charge = cfg->charge;
17749 lp->l2_proto = cfg->l2_proto;
17750 lp->l3_proto = cfg->l3_proto;
17751 @@ -2932,6 +3837,9 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg
17752 }
17753 }
17754 lp->p_encap = cfg->p_encap;
17755 +#ifdef CONFIG_ISDN_WITH_ABC
17756 + isdn_dw_abc_reset_interface(lp,0);
17757 +#endif
17758 return 0;
17759 }
17760 return -ENODEV;
17761 @@ -3007,6 +3915,9 @@ isdn_net_addphone(isdn_net_ioctl_phone *
17762 strcpy(n->num, phone->phone);
17763 n->next = p->local->phone[phone->outgoing & 1];
17764 p->local->phone[phone->outgoing & 1] = n;
17765 +#ifdef CONFIG_ISDN_WITH_ABC
17766 + isdn_dwabc_test_phone(p->local);
17767 +#endif
17768 return 0;
17769 }
17770 return -ENODEV;
17771 @@ -3100,6 +4011,9 @@ isdn_net_delphone(isdn_net_ioctl_phone *
17772 else
17773 p->local->phone[inout] = n->next;
17774 kfree(n);
17775 +#ifdef CONFIG_ISDN_WITH_ABC
17776 + isdn_dwabc_test_phone(p->local);
17777 +#endif
17778 restore_flags(flags);
17779 return 0;
17780 }
17781 @@ -3135,6 +4049,9 @@ isdn_net_rmallphone(isdn_net_dev * p)
17782 p->local->phone[i] = NULL;
17783 }
17784 p->local->dial = NULL;
17785 +#ifdef CONFIG_ISDN_WITH_ABC
17786 + isdn_dwabc_test_phone(p->local);
17787 +#endif
17788 restore_flags(flags);
17789 return 0;
17790 }
17791 @@ -3218,6 +4135,10 @@ isdn_net_realrm(isdn_net_dev * p, isdn_n
17792 /* If no more net-devices remain, disable auto-hangup timer */
17793 if (dev->netdev == NULL)
17794 isdn_timer_ctrl(ISDN_TIMER_NETHANGUP, 0);
17795 +#ifdef CONFIG_ISDN_WITH_ABC
17796 + isdn_dw_clear_if(~0l,p->local);
17797 + dwabc_bsd_free(p->local);
17798 +#endif
17799 restore_flags(flags);
17800 kfree(p->local);
17801 kfree(p);
17802 Index: linux-2.4.35.4/drivers/isdn/isdn_net.h
17803 ===================================================================
17804 --- linux-2.4.35.4.orig/drivers/isdn/isdn_net.h
17805 +++ linux-2.4.35.4/drivers/isdn/isdn_net.h
17806 @@ -1,4 +1,4 @@
17807 -/* $Id: isdn_net.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
17808 +/* $Id: isdn_net.h,v 1.23 2001/11/07 22:35:48 kai Exp $
17809 *
17810 * header for Linux ISDN subsystem, network related functions (linklevel).
17811 *
17812 @@ -26,6 +26,7 @@
17813 #define CISCO_ADDR_BROADCAST 0x8f
17814 #define CISCO_CTRL 0x00
17815 #define CISCO_TYPE_CDP 0x2000
17816 +#define CISCO_TYPE_INET 0x0800
17817 #define CISCO_TYPE_SLARP 0x8035
17818 #define CISCO_SLARP_REQUEST 0
17819 #define CISCO_SLARP_REPLY 1
17820 @@ -106,8 +107,6 @@ static __inline__ void isdn_net_add_to_b
17821 spin_lock_irqsave(&nd->queue_lock, flags);
17822
17823 lp = nd->queue;
17824 -// printk(KERN_DEBUG __FUNCTION__": lp:%s(%p) nlp:%s(%p) last(%p)\n",
17825 -// lp->name, lp, nlp->name, nlp, lp->last);
17826 nlp->last = lp->last;
17827 lp->last->next = nlp;
17828 lp->last = nlp;
17829 @@ -127,20 +126,12 @@ static __inline__ void isdn_net_rm_from_
17830 if (lp->master)
17831 master_lp = (isdn_net_local *) lp->master->priv;
17832
17833 -// printk(KERN_DEBUG __FUNCTION__": lp:%s(%p) mlp:%s(%p) last(%p) next(%p) mndq(%p)\n",
17834 -// lp->name, lp, master_lp->name, master_lp, lp->last, lp->next, master_lp->netdev->queue);
17835 spin_lock_irqsave(&master_lp->netdev->queue_lock, flags);
17836 lp->last->next = lp->next;
17837 lp->next->last = lp->last;
17838 - if (master_lp->netdev->queue == lp) {
17839 + if (master_lp->netdev->queue == lp)
17840 master_lp->netdev->queue = lp->next;
17841 - if (lp->next == lp) { /* last in queue */
17842 - master_lp->netdev->queue = master_lp->netdev->local;
17843 - }
17844 - }
17845 lp->next = lp->last = lp; /* (re)set own pointers */
17846 -// printk(KERN_DEBUG __FUNCTION__": mndq(%p)\n",
17847 -// master_lp->netdev->queue);
17848 spin_unlock_irqrestore(&master_lp->netdev->queue_lock, flags);
17849 }
17850
17851 Index: linux-2.4.35.4/drivers/isdn/isdn_ppp.c
17852 ===================================================================
17853 --- linux-2.4.35.4.orig/drivers/isdn/isdn_ppp.c
17854 +++ linux-2.4.35.4/drivers/isdn/isdn_ppp.c
17855 @@ -1,4 +1,4 @@
17856 -/* $Id: isdn_ppp.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
17857 +/* $Id: isdn_ppp.c,v 1.94 2001/11/07 22:35:48 kai Exp $
17858 *
17859 * Linux ISDN subsystem, functions for synchronous PPP (linklevel).
17860 *
17861 @@ -13,9 +13,6 @@
17862 #include <linux/isdn.h>
17863 #include <linux/poll.h>
17864 #include <linux/ppp-comp.h>
17865 -#ifdef CONFIG_IPPP_FILTER
17866 -#include <linux/filter.h>
17867 -#endif
17868
17869 #include "isdn_common.h"
17870 #include "isdn_ppp.h"
17871 @@ -72,11 +69,19 @@ static void isdn_ppp_mp_cleanup( isdn_ne
17872 static int isdn_ppp_bundle(struct ippp_struct *, int unit);
17873 #endif /* CONFIG_ISDN_MPP */
17874
17875 -char *isdn_ppp_revision = "$Revision: 1.1.4.1 $";
17876 +char *isdn_ppp_revision = "$Revision: 1.94 $";
17877
17878 static struct ippp_struct *ippp_table[ISDN_MAX_CHANNELS];
17879
17880 +#ifndef CONFIG_ISDN_WITH_ABC
17881 static struct isdn_ppp_compressor *ipc_head = NULL;
17882 +#else
17883 + /*
17884 + ** make compressor's common usable
17885 + */
17886 +struct isdn_ppp_compressor *isdn_ippp_comp_head = NULL;
17887 +#define ipc_head isdn_ippp_comp_head
17888 +#endif
17889
17890 /*
17891 * frame log (debug)
17892 @@ -110,11 +115,8 @@ isdn_ppp_free(isdn_net_local * lp)
17893 unsigned long flags;
17894 struct ippp_struct *is;
17895
17896 - if (lp->ppp_slot < 0 || lp->ppp_slot > ISDN_MAX_CHANNELS) {
17897 - printk(KERN_ERR "%s: ppp_slot(%d) out of range\n",
17898 - __FUNCTION__, lp->ppp_slot);
17899 + if (lp->ppp_slot < 0 || lp->ppp_slot > ISDN_MAX_CHANNELS)
17900 return 0;
17901 - }
17902
17903 save_flags(flags);
17904 cli();
17905 @@ -130,12 +132,7 @@ isdn_ppp_free(isdn_net_local * lp)
17906 lp->netdev->pb->ref_ct--;
17907 spin_unlock(&lp->netdev->pb->lock);
17908 #endif /* CONFIG_ISDN_MPP */
17909 - if (lp->ppp_slot < 0 || lp->ppp_slot > ISDN_MAX_CHANNELS) {
17910 - printk(KERN_ERR "%s: ppp_slot(%d) now invalid\n",
17911 - __FUNCTION__, lp->ppp_slot);
17912 - restore_flags(flags);
17913 - return 0;
17914 - }
17915 +
17916 is = ippp_table[lp->ppp_slot];
17917 if ((is->state & IPPP_CONNECT))
17918 isdn_ppp_closewait(lp->ppp_slot); /* force wakeup on ippp device */
17919 @@ -231,13 +228,12 @@ isdn_ppp_bind(isdn_net_local * lp)
17920 void
17921 isdn_ppp_wakeup_daemon(isdn_net_local * lp)
17922 {
17923 - if (lp->ppp_slot < 0 || lp->ppp_slot >= ISDN_MAX_CHANNELS) {
17924 - printk(KERN_ERR "%s: ppp_slot(%d) out of range\n",
17925 - __FUNCTION__, lp->ppp_slot);
17926 + if (lp->ppp_slot < 0 || lp->ppp_slot >= ISDN_MAX_CHANNELS)
17927 return;
17928 - }
17929 +
17930 ippp_table[lp->ppp_slot]->state = IPPP_OPEN | IPPP_CONNECT | IPPP_NOBLOCK;
17931 - wake_up_interruptible(&ippp_table[lp->ppp_slot]->wq);
17932 +
17933 + wake_up_interruptible(&ippp_table[lp->ppp_slot]->wq);
17934 }
17935
17936 /*
17937 @@ -250,14 +246,13 @@ isdn_ppp_closewait(int slot)
17938 {
17939 struct ippp_struct *is;
17940
17941 - if (slot < 0 || slot >= ISDN_MAX_CHANNELS) {
17942 - printk(KERN_ERR "%s: slot(%d) out of range\n",
17943 - __FUNCTION__, slot);
17944 + if (slot < 0 || slot >= ISDN_MAX_CHANNELS)
17945 return 0;
17946 - }
17947 is = ippp_table[slot];
17948 +
17949 if (is->state)
17950 wake_up_interruptible(&is->wq);
17951 +
17952 is->state = IPPP_CLOSEWAIT;
17953 return 1;
17954 }
17955 @@ -295,9 +290,11 @@ isdn_ppp_open(int min, struct file *file
17956 return -EBUSY;
17957 }
17958 is = file->private_data = ippp_table[slot];
17959 -
17960 - printk(KERN_DEBUG "ippp, open, slot: %d, minor: %d, state: %04x\n",
17961 - slot, min, is->state);
17962 +
17963 +#if 0
17964 + if (is->debug & 0x1)
17965 +#endif
17966 + printk(KERN_DEBUG "ippp, open, slot: %d, minor: %d, state: %04x\n", slot, min, is->state);
17967
17968 /* compression stuff */
17969 is->link_compressor = is->compressor = NULL;
17970 @@ -327,10 +324,7 @@ isdn_ppp_open(int min, struct file *file
17971 */
17972 is->slcomp = slhc_init(16, 16); /* not necessary for 2. link in bundle */
17973 #endif
17974 -#ifdef CONFIG_IPPP_FILTER
17975 - is->pass_filter.filter = NULL;
17976 - is->active_filter.filter = NULL;
17977 -#endif
17978 +
17979 is->state = IPPP_OPEN;
17980
17981 return 0;
17982 @@ -349,20 +343,12 @@ isdn_ppp_release(int min, struct file *f
17983 return;
17984 is = file->private_data;
17985
17986 - if (!is) {
17987 - printk(KERN_ERR "%s: no file->private_data\n", __FUNCTION__);
17988 - return;
17989 - }
17990 if (is->debug & 0x1)
17991 printk(KERN_DEBUG "ippp: release, minor: %d %lx\n", min, (long) is->lp);
17992
17993 if (is->lp) { /* a lp address says: this link is still up */
17994 isdn_net_dev *p = is->lp->netdev;
17995
17996 - if (!p) {
17997 - printk(KERN_ERR "%s: no lp->netdev\n", __FUNCTION__);
17998 - return;
17999 - }
18000 is->state &= ~IPPP_CONNECT; /* -> effect: no call of wakeup */
18001 /*
18002 * isdn_net_hangup() calls isdn_ppp_free()
18003 @@ -385,18 +371,8 @@ isdn_ppp_release(int min, struct file *f
18004 slhc_free(is->slcomp);
18005 is->slcomp = NULL;
18006 #endif
18007 -#ifdef CONFIG_IPPP_FILTER
18008 - if (is->pass_filter.filter) {
18009 - kfree(is->pass_filter.filter);
18010 - is->pass_filter.filter = NULL;
18011 - }
18012 - if (is->active_filter.filter) {
18013 - kfree(is->active_filter.filter);
18014 - is->active_filter.filter = NULL;
18015 - }
18016 -#endif
18017
18018 -/* TODO: if this was the previous master: link the stuff to the new master */
18019 +/* TODO: if this was the previous master: link the the stuff to the new master */
18020 if(is->comp_stat)
18021 is->compressor->free(is->comp_stat);
18022 if(is->link_comp_stat)
18023 @@ -509,13 +485,15 @@ isdn_ppp_ioctl(int min, struct file *fil
18024 if (val & SC_ENABLE_IP && !(is->pppcfg & SC_ENABLE_IP) && (is->state & IPPP_CONNECT)) {
18025 if (lp) {
18026 /* OK .. we are ready to send buffers */
18027 - is->pppcfg = val; /* isdn_ppp_xmit test for SC_ENABLE_IP !!! */
18028 netif_wake_queue(&lp->netdev->dev);
18029 - break;
18030 }
18031 }
18032 is->pppcfg = val;
18033 break;
18034 +#if 0
18035 + case PPPIOCGSTAT: /* read PPP statistic information */
18036 + break;
18037 +#endif
18038 case PPPIOCGIDLE: /* get idle time information */
18039 if (lp) {
18040 struct ppp_idle pidle;
18041 @@ -604,39 +582,6 @@ isdn_ppp_ioctl(int min, struct file *fil
18042 }
18043 return set_arg((void *)arg,&pci,sizeof(struct pppcallinfo));
18044 }
18045 -#ifdef CONFIG_IPPP_FILTER
18046 - case PPPIOCSPASS:
18047 - case PPPIOCSACTIVE:
18048 - {
18049 - struct sock_fprog uprog, *filtp;
18050 - struct sock_filter *code = NULL;
18051 - int len, err;
18052 -
18053 - if (copy_from_user(&uprog, (void *) arg, sizeof(uprog)))
18054 - return -EFAULT;
18055 - if (uprog.len > 0 && uprog.len < 65536) {
18056 - len = uprog.len * sizeof(struct sock_filter);
18057 - code = kmalloc(len, GFP_KERNEL);
18058 - if (code == NULL)
18059 - return -ENOMEM;
18060 - if (copy_from_user(code, uprog.filter, len)) {
18061 - kfree(code);
18062 - return -EFAULT;
18063 - }
18064 - err = sk_chk_filter(code, uprog.len);
18065 - if (err) {
18066 - kfree(code);
18067 - return err;
18068 - }
18069 - }
18070 - filtp = (cmd == PPPIOCSPASS) ? &is->pass_filter : &is->active_filter;
18071 - if (filtp->filter)
18072 - kfree(filtp->filter);
18073 - filtp->filter = code;
18074 - filtp->len = uprog.len;
18075 - break;
18076 - }
18077 -#endif /* CONFIG_IPPP_FILTER */
18078 default:
18079 break;
18080 }
18081 @@ -699,7 +644,7 @@ isdn_ppp_fill_rq(unsigned char *buf, int
18082 struct ippp_struct *is;
18083
18084 if (slot < 0 || slot >= ISDN_MAX_CHANNELS) {
18085 - printk(KERN_WARNING "ippp: illegal slot(%d).\n", slot);
18086 + printk(KERN_WARNING "ippp: illegal slot.\n");
18087 return 0;
18088 }
18089 is = ippp_table[slot];
18090 @@ -976,8 +921,7 @@ void isdn_ppp_receive(isdn_net_dev * net
18091
18092 slot = lp->ppp_slot;
18093 if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
18094 - printk(KERN_ERR "isdn_ppp_receive: lp->ppp_slot(%d)\n",
18095 - lp->ppp_slot);
18096 + printk(KERN_ERR "isdn_ppp_receive: lp->ppp_slot %d\n", lp->ppp_slot);
18097 kfree_skb(skb);
18098 return;
18099 }
18100 @@ -1026,23 +970,19 @@ isdn_ppp_push_higher(isdn_net_dev * net_
18101 {
18102 struct net_device *dev = &net_dev->dev;
18103 struct ippp_struct *is, *mis;
18104 - isdn_net_local *mlp = NULL;
18105 int slot;
18106
18107 slot = lp->ppp_slot;
18108 if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
18109 - printk(KERN_ERR "isdn_ppp_push_higher: lp->ppp_slot(%d)\n",
18110 - lp->ppp_slot);
18111 + printk(KERN_ERR "isdn_ppp_push_higher: lp->ppp_slot %d\n", lp->ppp_slot);
18112 goto drop_packet;
18113 }
18114 is = ippp_table[slot];
18115
18116 if (lp->master) { // FIXME?
18117 - mlp = (isdn_net_local *) lp->master->priv;
18118 - slot = mlp->ppp_slot;
18119 + slot = ((isdn_net_local *) (lp->master->priv))->ppp_slot;
18120 if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
18121 - printk(KERN_ERR "isdn_ppp_push_higher: master->ppp_slot(%d)\n",
18122 - lp->ppp_slot);
18123 + printk(KERN_ERR "isdn_ppp_push_higher: master->ppp_slot %d\n", lp->ppp_slot);
18124 goto drop_packet;
18125 }
18126 }
18127 @@ -1076,11 +1016,6 @@ isdn_ppp_push_higher(isdn_net_dev * net_
18128 case PPP_VJC_UNCOMP:
18129 if (is->debug & 0x20)
18130 printk(KERN_DEBUG "isdn_ppp: VJC_UNCOMP\n");
18131 - if (net_dev->local->ppp_slot < 0) {
18132 - printk(KERN_ERR "%s: net_dev->local->ppp_slot(%d) out of range\n",
18133 - __FUNCTION__, net_dev->local->ppp_slot);
18134 - goto drop_packet;
18135 - }
18136 if (slhc_remember(ippp_table[net_dev->local->ppp_slot]->slcomp, skb->data, skb->len) <= 0) {
18137 printk(KERN_WARNING "isdn_ppp: received illegal VJC_UNCOMP frame!\n");
18138 goto drop_packet;
18139 @@ -1102,11 +1037,6 @@ isdn_ppp_push_higher(isdn_net_dev * net_
18140 }
18141 skb_put(skb, skb_old->len + 128);
18142 memcpy(skb->data, skb_old->data, skb_old->len);
18143 - if (net_dev->local->ppp_slot < 0) {
18144 - printk(KERN_ERR "%s: net_dev->local->ppp_slot(%d) out of range\n",
18145 - __FUNCTION__, net_dev->local->ppp_slot);
18146 - goto drop_packet;
18147 - }
18148 pkt_len = slhc_uncompress(ippp_table[net_dev->local->ppp_slot]->slcomp,
18149 skb->data, skb_old->len);
18150 kfree_skb(skb_old);
18151 @@ -1133,36 +1063,12 @@ isdn_ppp_push_higher(isdn_net_dev * net_
18152 return;
18153 }
18154
18155 -#ifdef CONFIG_IPPP_FILTER
18156 - /* check if the packet passes the pass and active filters
18157 - * the filter instructions are constructed assuming
18158 - * a four-byte PPP header on each packet (which is still present) */
18159 - skb_push(skb, 4);
18160 - skb->data[0] = 0; /* indicate inbound */
18161 -
18162 - if (is->pass_filter.filter
18163 - && sk_run_filter(skb, is->pass_filter.filter,
18164 - is->pass_filter.len) == 0) {
18165 - if (is->debug & 0x2)
18166 - printk(KERN_DEBUG "IPPP: inbound frame filtered.\n");
18167 - kfree_skb(skb);
18168 - return;
18169 - }
18170 - if (!(is->active_filter.filter
18171 - && sk_run_filter(skb, is->active_filter.filter,
18172 - is->active_filter.len) == 0)) {
18173 - if (is->debug & 0x2)
18174 - printk(KERN_DEBUG "IPPP: link-active filter: reseting huptimer.\n");
18175 - lp->huptimer = 0;
18176 - if (mlp)
18177 - mlp->huptimer = 0;
18178 - }
18179 - skb_pull(skb, 4);
18180 -#else /* CONFIG_IPPP_FILTER */
18181 - lp->huptimer = 0;
18182 - if (mlp)
18183 - mlp->huptimer = 0;
18184 -#endif /* CONFIG_IPPP_FILTER */
18185 + /* Reset hangup-timer */
18186 + lp->huptimer = 0;
18187 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
18188 + lp->dw_abc_bchan_errcnt = 0;
18189 +#endif
18190 +
18191 skb->dev = dev;
18192 skb->mac.raw = skb->data;
18193 netif_rx(skb);
18194 @@ -1199,6 +1105,7 @@ static unsigned char *isdn_ppp_skb_push(
18195 return skb_push(skb,len);
18196 }
18197
18198 +
18199 /*
18200 * send ppp frame .. we expect a PIDCOMPressable proto --
18201 * (here: currently always PPP_IP,PPP_VJC_COMP,PPP_VJC_UNCOMP)
18202 @@ -1214,25 +1121,23 @@ isdn_ppp_xmit(struct sk_buff *skb, struc
18203 isdn_net_dev *nd;
18204 unsigned int proto = PPP_IP; /* 0x21 */
18205 struct ippp_struct *ipt,*ipts;
18206 - int slot, retval = 0;
18207 + int slot;
18208
18209 mlp = (isdn_net_local *) (netdev->priv);
18210 nd = mlp->netdev; /* get master lp */
18211
18212 slot = mlp->ppp_slot;
18213 if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
18214 - printk(KERN_ERR "isdn_ppp_xmit: lp->ppp_slot(%d)\n",
18215 - mlp->ppp_slot);
18216 + printk(KERN_ERR "isdn_ppp_xmit: lp->ppp_slot %d\n", mlp->ppp_slot);
18217 kfree_skb(skb);
18218 - goto out;
18219 + return 0;
18220 }
18221 ipts = ippp_table[slot];
18222
18223 if (!(ipts->pppcfg & SC_ENABLE_IP)) { /* PPP connected ? */
18224 if (ipts->debug & 0x1)
18225 printk(KERN_INFO "%s: IP frame delayed.\n", netdev->name);
18226 - retval = 1;
18227 - goto out;
18228 + return 1;
18229 }
18230
18231 switch (ntohs(skb->protocol)) {
18232 @@ -1246,25 +1151,24 @@ isdn_ppp_xmit(struct sk_buff *skb, struc
18233 printk(KERN_ERR "isdn_ppp: skipped unsupported protocol: %#x.\n",
18234 skb->protocol);
18235 dev_kfree_skb(skb);
18236 - goto out;
18237 + return 0;
18238 }
18239
18240 lp = isdn_net_get_locked_lp(nd);
18241 if (!lp) {
18242 printk(KERN_WARNING "%s: all channels busy - requeuing!\n", netdev->name);
18243 - retval = 1;
18244 - goto out;
18245 + return 1;
18246 }
18247 /* we have our lp locked from now on */
18248
18249 slot = lp->ppp_slot;
18250 if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
18251 - printk(KERN_ERR "isdn_ppp_xmit: lp->ppp_slot(%d)\n",
18252 - lp->ppp_slot);
18253 + printk(KERN_ERR "isdn_ppp_xmit: lp->ppp_slot %d\n", lp->ppp_slot);
18254 kfree_skb(skb);
18255 - goto unlock;
18256 + return 0;
18257 }
18258 ipt = ippp_table[slot];
18259 + lp->huptimer = 0;
18260
18261 /*
18262 * after this line .. requeueing in the device queue is no longer allowed!!!
18263 @@ -1275,34 +1179,6 @@ isdn_ppp_xmit(struct sk_buff *skb, struc
18264 */
18265 skb_pull(skb,IPPP_MAX_HEADER);
18266
18267 -#ifdef CONFIG_IPPP_FILTER
18268 - /* check if we should pass this packet
18269 - * the filter instructions are constructed assuming
18270 - * a four-byte PPP header on each packet */
18271 - skb_push(skb, 4);
18272 - skb->data[0] = 1; /* indicate outbound */
18273 - *(u_int16_t *)(skb->data + 2) = htons(proto);
18274 -
18275 - if (ipt->pass_filter.filter
18276 - && sk_run_filter(skb, ipt->pass_filter.filter,
18277 - ipt->pass_filter.len) == 0) {
18278 - if (ipt->debug & 0x4)
18279 - printk(KERN_DEBUG "IPPP: outbound frame filtered.\n");
18280 - kfree_skb(skb);
18281 - goto unlock;
18282 - }
18283 - if (!(ipt->active_filter.filter
18284 - && sk_run_filter(skb, ipt->active_filter.filter,
18285 - ipt->active_filter.len) == 0)) {
18286 - if (ipt->debug & 0x4)
18287 - printk(KERN_DEBUG "IPPP: link-active filter: reseting huptimer.\n");
18288 - lp->huptimer = 0;
18289 - }
18290 - skb_pull(skb, 4);
18291 -#else /* CONFIG_IPPP_FILTER */
18292 - lp->huptimer = 0;
18293 -#endif /* CONFIG_IPPP_FILTER */
18294 -
18295 if (ipt->debug & 0x4)
18296 printk(KERN_DEBUG "xmit skb, len %d\n", (int) skb->len);
18297 if (ipts->debug & 0x40)
18298 @@ -1440,54 +1316,9 @@ isdn_ppp_xmit(struct sk_buff *skb, struc
18299
18300 unlock:
18301 spin_unlock_bh(&lp->xmit_lock);
18302 - out:
18303 - return retval;
18304 + return 0;
18305 }
18306
18307 -#ifdef CONFIG_IPPP_FILTER
18308 -/*
18309 - * check if this packet may trigger auto-dial.
18310 - */
18311 -
18312 -int isdn_ppp_autodial_filter(struct sk_buff *skb, isdn_net_local *lp)
18313 -{
18314 - struct ippp_struct *is = ippp_table[lp->ppp_slot];
18315 - u_int16_t proto;
18316 - int drop = 0;
18317 -
18318 - switch (ntohs(skb->protocol)) {
18319 - case ETH_P_IP:
18320 - proto = PPP_IP;
18321 - break;
18322 - case ETH_P_IPX:
18323 - proto = PPP_IPX;
18324 - break;
18325 - default:
18326 - printk(KERN_ERR "isdn_ppp_autodial_filter: unsupported protocol 0x%x.\n",
18327 - skb->protocol);
18328 - return 1;
18329 - }
18330 -
18331 - /* the filter instructions are constructed assuming
18332 - * a four-byte PPP header on each packet. we have to
18333 - * temporarily remove part of the fake header stuck on
18334 - * earlier.
18335 - */
18336 - skb_pull(skb, IPPP_MAX_HEADER - 4);
18337 - skb->data[0] = 1; /* indicate outbound */
18338 - *(u_int16_t *)(skb->data + 2) = htons(proto);
18339 -
18340 - drop |= is->pass_filter.filter
18341 - && sk_run_filter(skb, is->pass_filter.filter,
18342 - is->pass_filter.len) == 0;
18343 - drop |= is->active_filter.filter
18344 - && sk_run_filter(skb, is->active_filter.filter,
18345 - is->active_filter.len) == 0;
18346 -
18347 - skb_push(skb, IPPP_MAX_HEADER - 4);
18348 - return drop;
18349 -}
18350 -#endif
18351 #ifdef CONFIG_ISDN_MPP
18352
18353 /* this is _not_ rfc1990 header, but something we convert both short and long
18354 @@ -1537,15 +1368,8 @@ static ippp_bundle * isdn_ppp_mp_bundle_
18355
18356 static int isdn_ppp_mp_init( isdn_net_local * lp, ippp_bundle * add_to )
18357 {
18358 - struct ippp_struct * is;
18359 -
18360 - if (lp->ppp_slot < 0) {
18361 - printk(KERN_ERR "%s: lp->ppp_slot(%d) out of range\n",
18362 - __FUNCTION__, lp->ppp_slot);
18363 - return(-EINVAL);
18364 - }
18365 -
18366 - is = ippp_table[lp->ppp_slot];
18367 + struct ippp_struct * is = ippp_table[lp->ppp_slot];
18368 +
18369 if (add_to) {
18370 if( lp->netdev->pb )
18371 lp->netdev->pb->ref_ct--;
18372 @@ -1591,8 +1415,7 @@ static void isdn_ppp_mp_receive(isdn_net
18373 stats = &mp->stats;
18374 slot = lp->ppp_slot;
18375 if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
18376 - printk(KERN_ERR "%s: lp->ppp_slot(%d)\n",
18377 - __FUNCTION__, lp->ppp_slot);
18378 + printk(KERN_ERR "isdn_ppp_mp_receive: lp->ppp_slot %d\n", lp->ppp_slot);
18379 stats->frame_drops++;
18380 dev_kfree_skb(skb);
18381 spin_unlock_irqrestore(&mp->lock, flags);
18382 @@ -1628,8 +1451,7 @@ static void isdn_ppp_mp_receive(isdn_net
18383 for (lpq = net_dev->queue;;) {
18384 slot = lpq->ppp_slot;
18385 if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
18386 - printk(KERN_ERR "%s: lpq->ppp_slot(%d)\n",
18387 - __FUNCTION__, lpq->ppp_slot);
18388 + printk(KERN_ERR "isdn_ppp_mp_receive: lpq->ppp_slot %d\n", lpq->ppp_slot);
18389 } else {
18390 u32 lls = ippp_table[slot]->last_link_seqno;
18391 if (MP_LT(lls, minseq))
18392 @@ -1861,14 +1683,9 @@ void isdn_ppp_mp_reassembly( isdn_net_de
18393 struct sk_buff * skb;
18394 unsigned int tot_len;
18395
18396 - if (lp->ppp_slot < 0 || lp->ppp_slot > ISDN_MAX_CHANNELS) {
18397 - printk(KERN_ERR "%s: lp->ppp_slot(%d) out of range\n",
18398 - __FUNCTION__, lp->ppp_slot);
18399 - return;
18400 - }
18401 if( MP_FLAGS(from) == (MP_BEGIN_FRAG | MP_END_FRAG) ) {
18402 if( ippp_table[lp->ppp_slot]->debug & 0x40 )
18403 - printk(KERN_DEBUG "isdn_mppp: reassembly: frame %d, "
18404 + printk(KERN_DEBUG"isdn_mppp: reassembly: frame %d, "
18405 "len %d\n", MP_SEQ(from), from->len );
18406 skb = from;
18407 skb_pull(skb, MP_HEADER_LEN);
18408 @@ -1987,10 +1804,8 @@ isdn_ppp_dev_ioctl_stats(int slot, struc
18409 memset(&t, 0, sizeof(struct ppp_stats));
18410 if (dev->flags & IFF_UP) {
18411 t.p.ppp_ipackets = lp->stats.rx_packets;
18412 - t.p.ppp_ibytes = lp->stats.rx_bytes;
18413 t.p.ppp_ierrors = lp->stats.rx_errors;
18414 t.p.ppp_opackets = lp->stats.tx_packets;
18415 - t.p.ppp_obytes = lp->stats.tx_bytes;
18416 t.p.ppp_oerrors = lp->stats.tx_errors;
18417 #ifdef CONFIG_ISDN_PPP_VJ
18418 if (slot >= 0 && ippp_table[slot]->slcomp) {
18419 @@ -2018,6 +1833,9 @@ isdn_ppp_dev_ioctl(struct net_device *de
18420 int len;
18421 isdn_net_local *lp = (isdn_net_local *) dev->priv;
18422
18423 +#if 0
18424 + printk(KERN_DEBUG "ippp, dev_ioctl: cmd %#08x , %d \n", cmd, lp->ppp_slot);
18425 +#endif
18426
18427 if (lp->p_encap != ISDN_NET_ENCAP_SYNCPPP)
18428 return -EINVAL;
18429 @@ -2432,7 +2250,7 @@ static void isdn_ppp_ccp_reset_trans(str
18430 return;
18431 }
18432 rs->state = CCPResetSentReq;
18433 - /* We always expect an Ack if the decompressor doesn't
18434 + /* We always expect an Ack if the decompressor doesnt
18435 know better */
18436 rs->expra = 1;
18437 rs->dlen = 0;
18438 @@ -2583,7 +2401,13 @@ static struct sk_buff *isdn_ppp_compress
18439 }
18440
18441 if(type) { /* type=1 => Link compression */
18442 +#if 0
18443 + compressor = is->link_compressor;
18444 + stat = is->link_comp_stat;
18445 + new_proto = PPP_LINK_COMP;
18446 +#else
18447 return skb_in;
18448 +#endif
18449 }
18450 else {
18451 if(!master) {
18452 @@ -2631,31 +2455,18 @@ static struct sk_buff *isdn_ppp_compress
18453 static void isdn_ppp_receive_ccp(isdn_net_dev *net_dev, isdn_net_local *lp,
18454 struct sk_buff *skb,int proto)
18455 {
18456 - struct ippp_struct *is;
18457 + struct ippp_struct *is = ippp_table[lp->ppp_slot];
18458 struct ippp_struct *mis;
18459 int len;
18460 struct isdn_ppp_resetparams rsparm;
18461 unsigned char rsdata[IPPP_RESET_MAXDATABYTES];
18462
18463 - printk(KERN_DEBUG "Received CCP frame from peer slot(%d)\n",
18464 - lp->ppp_slot);
18465 - if (lp->ppp_slot < 0 || lp->ppp_slot > ISDN_MAX_CHANNELS) {
18466 - printk(KERN_ERR "%s: lp->ppp_slot(%d) out of range\n",
18467 - __FUNCTION__, lp->ppp_slot);
18468 - return;
18469 - }
18470 - is = ippp_table[lp->ppp_slot];
18471 + printk(KERN_DEBUG "Received CCP frame from peer\n");
18472 isdn_ppp_frame_log("ccp-rcv", skb->data, skb->len, 32, is->unit,lp->ppp_slot);
18473
18474 - if(lp->master) {
18475 - int slot = ((isdn_net_local *) (lp->master->priv))->ppp_slot;
18476 - if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
18477 - printk(KERN_ERR "%s: slot(%d) out of range\n",
18478 - __FUNCTION__, slot);
18479 - return;
18480 - }
18481 - mis = ippp_table[slot];
18482 - } else
18483 + if(lp->master)
18484 + mis = ippp_table[((isdn_net_local *) (lp->master->priv))->ppp_slot];
18485 + else
18486 mis = is;
18487
18488 switch(skb->data[0]) {
18489 @@ -2807,18 +2618,13 @@ static void isdn_ppp_receive_ccp(isdn_ne
18490
18491 static void isdn_ppp_send_ccp(isdn_net_dev *net_dev, isdn_net_local *lp, struct sk_buff *skb)
18492 {
18493 - struct ippp_struct *mis,*is;
18494 - int proto, slot = lp->ppp_slot;
18495 + struct ippp_struct *mis,*is = ippp_table[lp->ppp_slot];
18496 + int proto;
18497 unsigned char *data;
18498
18499 if(!skb || skb->len < 3)
18500 return;
18501 - if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
18502 - printk(KERN_ERR "%s: lp->ppp_slot(%d) out of range\n",
18503 - __FUNCTION__, slot);
18504 - return;
18505 - }
18506 - is = ippp_table[slot];
18507 +
18508 /* Daemon may send with or without address and control field comp */
18509 data = skb->data;
18510 if(!(is->pppcfg & SC_COMP_AC) && data[0] == 0xff && data[1] == 0x03) {
18511 @@ -2834,17 +2640,12 @@ static void isdn_ppp_send_ccp(isdn_net_d
18512 printk(KERN_DEBUG "Received CCP frame from daemon:\n");
18513 isdn_ppp_frame_log("ccp-xmit", skb->data, skb->len, 32, is->unit,lp->ppp_slot);
18514
18515 - if (lp->master) {
18516 - slot = ((isdn_net_local *) (lp->master->priv))->ppp_slot;
18517 - if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
18518 - printk(KERN_ERR "%s: slot(%d) out of range\n",
18519 - __FUNCTION__, slot);
18520 - return;
18521 - }
18522 - mis = ippp_table[slot];
18523 - } else
18524 - mis = is;
18525 - if (mis != is)
18526 + if(lp->master)
18527 + mis = ippp_table[((isdn_net_local *) (lp->master->priv))->ppp_slot];
18528 + else
18529 + mis = is;
18530 +
18531 + if(mis != is)
18532 printk(KERN_DEBUG "isdn_ppp: Ouch! Master CCP sends on slave slot!\n");
18533
18534 switch(data[2]) {
18535 Index: linux-2.4.35.4/drivers/isdn/isdn_ppp.h
18536 ===================================================================
18537 --- linux-2.4.35.4.orig/drivers/isdn/isdn_ppp.h
18538 +++ linux-2.4.35.4/drivers/isdn/isdn_ppp.h
18539 @@ -1,4 +1,4 @@
18540 -/* $Id: isdn_ppp.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
18541 +/* $Id: isdn_ppp.h,v 1.18 2001/09/24 13:22:42 kai Exp $
18542 *
18543 * header for Linux ISDN subsystem, functions for synchronous PPP (linklevel).
18544 *
18545 @@ -19,7 +19,6 @@ extern int isdn_ppp_init(void);
18546 extern void isdn_ppp_cleanup(void);
18547 extern int isdn_ppp_free(isdn_net_local *);
18548 extern int isdn_ppp_bind(isdn_net_local *);
18549 -extern int isdn_ppp_autodial_filter(struct sk_buff *, isdn_net_local *);
18550 extern int isdn_ppp_xmit(struct sk_buff *, struct net_device *);
18551 extern void isdn_ppp_receive(isdn_net_dev *, isdn_net_local *, struct sk_buff *);
18552 extern int isdn_ppp_dev_ioctl(struct net_device *, struct ifreq *, int);
18553 Index: linux-2.4.35.4/drivers/isdn/isdn_tty.c
18554 ===================================================================
18555 --- linux-2.4.35.4.orig/drivers/isdn/isdn_tty.c
18556 +++ linux-2.4.35.4/drivers/isdn/isdn_tty.c
18557 @@ -1,4 +1,4 @@
18558 -/* $Id: isdn_tty.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
18559 +/* $Id: isdn_tty.c,v 1.104 2002/02/09 21:19:11 keil Exp $
18560 *
18561 * Linux ISDN subsystem, tty functions and AT-command emulator (linklevel).
18562 *
18563 @@ -53,7 +53,7 @@ static int bit2si[8] =
18564 static int si2bit[8] =
18565 {4, 1, 4, 4, 4, 4, 4, 4};
18566
18567 -char *isdn_tty_revision = "$Revision: 1.1.4.1 $";
18568 +char *isdn_tty_revision = "$Revision: 1.104 $";
18569
18570
18571 /* isdn_tty_try_read() is called from within isdn_tty_rcv_skb()
18572 @@ -321,7 +321,10 @@ isdn_tty_tint(modem_info * info)
18573 info->send_outstanding++;
18574 info->msr &= ~UART_MSR_CTS;
18575 info->lsr &= ~UART_LSR_TEMT;
18576 - tty_wakeup(tty);
18577 + if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
18578 + tty->ldisc.write_wakeup)
18579 + (tty->ldisc.write_wakeup) (tty);
18580 + wake_up_interruptible(&tty->write_wait);
18581 return;
18582 }
18583 if (slen < 0) {
18584 @@ -1211,7 +1214,10 @@ isdn_tty_write(struct tty_struct *tty, i
18585 /* If DLE decoding results in zero-transmit, but
18586 * c originally was non-zero, do a wakeup.
18587 */
18588 - tty_wakeup(tty);
18589 + if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
18590 + tty->ldisc.write_wakeup)
18591 + (tty->ldisc.write_wakeup) (tty);
18592 + wake_up_interruptible(&tty->write_wait);
18593 info->msr |= UART_MSR_CTS;
18594 info->lsr |= UART_LSR_TEMT;
18595 }
18596 @@ -1232,6 +1238,7 @@ isdn_tty_write(struct tty_struct *tty, i
18597 }
18598 }
18599 } else
18600 +#ifdef ISDN_TTY_FCLASS1
18601 if (TTY_IS_FCLASS1(info)) {
18602 int cc = isdn_tty_handleDLEdown(info, m, c);
18603
18604 @@ -1252,6 +1259,7 @@ isdn_tty_write(struct tty_struct *tty, i
18605 info->xmit_count += cc;
18606 } else
18607 #endif
18608 +#endif
18609 info->xmit_count += c;
18610 } else {
18611 info->msr |= UART_MSR_CTS;
18612 @@ -1329,7 +1337,10 @@ isdn_tty_flush_buffer(struct tty_struct
18613 isdn_tty_cleanup_xmit(info);
18614 info->xmit_count = 0;
18615 restore_flags(flags);
18616 - tty_wakeup(tty);
18617 + wake_up_interruptible(&tty->write_wait);
18618 + if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
18619 + tty->ldisc.write_wakeup)
18620 + (tty->ldisc.write_wakeup) (tty);
18621 }
18622
18623 static void
18624 @@ -1858,7 +1869,8 @@ isdn_tty_close(struct tty_struct *tty, s
18625 isdn_tty_shutdown(info);
18626 if (tty->driver.flush_buffer)
18627 tty->driver.flush_buffer(tty);
18628 - tty_ldisc_flush(tty);
18629 + if (tty->ldisc.flush_buffer)
18630 + tty->ldisc.flush_buffer(tty);
18631 info->tty = 0;
18632 info->ncarrier = 0;
18633 tty->closing = 0;
18634 @@ -2306,6 +2318,22 @@ isdn_tty_stat_callback(int i, isdn_ctrl
18635 isdn_tty_at_cout("\r\n", info);
18636 }
18637 return 1;
18638 + case ISDN_STAT_ALERT:
18639 +#ifdef ISDN_TTY_STAT_DEBUG
18640 + printk(KERN_DEBUG "tty_STAT_ALERT ttyI%d\n", info->line);
18641 +#endif
18642 + /* Signal RINGING to tty-device if requested */
18643 + if (info->emu.mdmreg[REG_ALERT] & BIT_ALERT)
18644 + isdn_tty_modem_result(RESULT_RINGING, info);
18645 + return 1;
18646 + case ISDN_STAT_PROCEED:
18647 +#ifdef ISDN_TTY_STAT_DEBUG
18648 + printk(KERN_DEBUG "tty_STAT_PROCEED ttyI%d\n", info->line);
18649 +#endif
18650 + /* Signal PROCEEDING to tty-device if requested */
18651 + if (info->emu.mdmreg[REG_PROCEED] & BIT_PROCEED)
18652 + isdn_tty_modem_result(RESULT_PROCEEDING, info);
18653 + return 1;
18654 case ISDN_STAT_DCONN:
18655 #ifdef ISDN_TTY_STAT_DEBUG
18656 printk(KERN_DEBUG "tty_STAT_DCONN ttyI%d\n", info->line);
18657 @@ -2618,7 +2646,7 @@ isdn_tty_modem_result(int code, modem_in
18658 static char *msg[] =
18659 {"OK", "CONNECT", "RING", "NO CARRIER", "ERROR",
18660 "CONNECT 64000", "NO DIALTONE", "BUSY", "NO ANSWER",
18661 - "RINGING", "NO MSN/EAZ", "VCON", "RUNG"};
18662 + "RINGING", "NO MSN/EAZ", "VCON", "RUNG", "PROCEEDING"};
18663 ulong flags;
18664 char s[ISDN_MSNLEN+10];
18665
18666 @@ -2781,7 +2809,8 @@ isdn_tty_modem_result(int code, modem_in
18667 restore_flags(flags);
18668 return;
18669 }
18670 - tty_ldisc_flush(info->tty);
18671 + if (info->tty->ldisc.flush_buffer)
18672 + info->tty->ldisc.flush_buffer(info->tty);
18673 if ((info->flags & ISDN_ASYNC_CHECK_CD) &&
18674 (!((info->flags & ISDN_ASYNC_CALLOUT_ACTIVE) &&
18675 (info->flags & ISDN_ASYNC_CALLOUT_NOHUP)))) {
18676 @@ -3296,9 +3325,11 @@ isdn_tty_cmd_PLUSF(char **p, modem_info
18677 #ifdef CONFIG_ISDN_TTY_FAX
18678 if (TTY_IS_FCLASS2(info))
18679 sprintf(rs, "\r\n2");
18680 +#ifdef ISDN_TTY_FCLASS1
18681 else if (TTY_IS_FCLASS1(info))
18682 sprintf(rs, "\r\n1");
18683 #endif
18684 +#endif
18685 isdn_tty_at_cout(rs, info);
18686 break;
18687 case '=':
18688 @@ -3313,6 +3344,7 @@ isdn_tty_cmd_PLUSF(char **p, modem_info
18689 m->mdmreg[REG_PSIZE] * 16;
18690 break;
18691 #ifdef CONFIG_ISDN_TTY_FAX
18692 +#ifdef ISDN_TTY_FCLASS1
18693 case '1':
18694 p[0]++;
18695 if (!(dev->global_features &
18696 @@ -3324,6 +3356,7 @@ isdn_tty_cmd_PLUSF(char **p, modem_info
18697 info->xmit_size =
18698 m->mdmreg[REG_PSIZE] * 16;
18699 break;
18700 +#endif
18701 case '2':
18702 p[0]++;
18703 if (!(dev->global_features &
18704 @@ -3348,9 +3381,11 @@ isdn_tty_cmd_PLUSF(char **p, modem_info
18705 p[0]++;
18706 strcpy(rs, "\r\n0,");
18707 #ifdef CONFIG_ISDN_TTY_FAX
18708 +#ifdef ISDN_TTY_FCLASS1
18709 if (dev->global_features &
18710 ISDN_FEATURE_L3_FCLASS1)
18711 strcat(rs, "1,");
18712 +#endif
18713 if (dev->global_features &
18714 ISDN_FEATURE_L3_FCLASS2)
18715 strcat(rs, "2,");
18716 Index: linux-2.4.35.4/drivers/isdn/isdn_tty.h
18717 ===================================================================
18718 --- linux-2.4.35.4.orig/drivers/isdn/isdn_tty.h
18719 +++ linux-2.4.35.4/drivers/isdn/isdn_tty.h
18720 @@ -1,4 +1,4 @@
18721 -/* $Id: isdn_tty.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
18722 +/* $Id: isdn_tty.h,v 1.25 2002/02/09 21:19:11 keil Exp $
18723 *
18724 * header for Linux ISDN subsystem, tty related functions (linklevel).
18725 *
18726 @@ -78,6 +78,10 @@
18727 #define BIT_CPNFCON 2
18728 #define REG_CDN 23
18729 #define BIT_CDN 4
18730 +#define REG_ALERT 23
18731 +#define BIT_ALERT 8
18732 +#define REG_PROCEED 23
18733 +#define BIT_PROCEED 16
18734
18735 /* defines for result codes */
18736 #define RESULT_OK 0
18737 @@ -93,10 +97,13 @@
18738 #define RESULT_NO_MSN_EAZ 10
18739 #define RESULT_VCON 11
18740 #define RESULT_RUNG 12
18741 +#define RESULT_PROCEEDING 13
18742
18743 +#ifdef ISDN_TTY_FCLASS1
18744 #define TTY_IS_FCLASS1(info) \
18745 ((info->emu.mdmreg[REG_L2PROT] == ISDN_PROTO_L2_FAX) && \
18746 (info->emu.mdmreg[REG_L3PROT] == ISDN_PROTO_L3_FCLASS1))
18747 +#endif
18748 #define TTY_IS_FCLASS2(info) \
18749 ((info->emu.mdmreg[REG_L2PROT] == ISDN_PROTO_L2_FAX) && \
18750 (info->emu.mdmreg[REG_L3PROT] == ISDN_PROTO_L3_FCLASS2))
18751 Index: linux-2.4.35.4/drivers/isdn/isdn_ttyfax.c
18752 ===================================================================
18753 --- linux-2.4.35.4.orig/drivers/isdn/isdn_ttyfax.c
18754 +++ linux-2.4.35.4/drivers/isdn/isdn_ttyfax.c
18755 @@ -1,4 +1,4 @@
18756 -/* $Id: isdn_ttyfax.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
18757 +/* $Id: isdn_ttyfax.c,v 1.9 2001/09/24 13:22:43 kai Exp $
18758 *
18759 * Linux ISDN subsystem, tty_fax AT-command emulator (linklevel).
18760 *
18761 @@ -20,7 +20,7 @@
18762 #include "isdn_ttyfax.h"
18763
18764
18765 -static char *isdn_tty_fax_revision = "$Revision: 1.1.4.1 $";
18766 +static char *isdn_tty_fax_revision = "$Revision: 1.9 $";
18767
18768 #define PARSE_ERROR1 { isdn_tty_fax_modem_result(1, info); return 1; }
18769
18770 @@ -148,6 +148,7 @@ isdn_tty_fax_modem_result(int code, mode
18771 }
18772 }
18773
18774 +#ifdef ISDN_TTY_FCLASS1
18775 int
18776 isdn_tty_fax_command1(modem_info * info, isdn_ctrl * c)
18777 {
18778 @@ -186,6 +187,7 @@ isdn_tty_fax_command1(modem_info * info,
18779 }
18780 return (0);
18781 }
18782 +#endif
18783
18784 int
18785 isdn_tty_fax_command(modem_info * info, isdn_ctrl * c)
18786 @@ -193,8 +195,10 @@ isdn_tty_fax_command(modem_info * info,
18787 T30_s *f = info->fax;
18788 char rs[10];
18789
18790 +#ifdef ISDN_TTY_FCLASS1
18791 if (TTY_IS_FCLASS1(info))
18792 return (isdn_tty_fax_command1(info, c));
18793 +#endif
18794
18795 #ifdef ISDN_TTY_FAX_CMD_DEBUG
18796 printk(KERN_DEBUG "isdn_tty: Fax cmd %d on ttyI%d\n",
18797 @@ -312,6 +316,7 @@ isdn_tty_fax_bitorder(modem_info * info,
18798 }
18799 }
18800
18801 +#ifdef ISDN_TTY_FCLASS1
18802 /*
18803 * Parse AT+F.. FAX class 1 commands
18804 */
18805 @@ -403,6 +408,7 @@ isdn_tty_cmd_FCLASS1(char **p, modem_inf
18806 }
18807 return 1;
18808 }
18809 +#endif
18810
18811 /*
18812 * Parse AT+F.. FAX class 2 commands
18813 @@ -970,6 +976,70 @@ isdn_tty_cmd_FCLASS2(char **p, modem_inf
18814 }
18815 return 0;
18816 }
18817 +#if 0
18818 + /* LO=n - Flow control opts */
18819 + if (!strncmp(p[0], "LO", 2)) { /* TODO */
18820 + p[0] += 2;
18821 + switch (*p[0]) {
18822 + case '?':
18823 + p[0]++;
18824 + sprintf(rs, "\r\n%d", f->lo);
18825 + isdn_tty_at_cout(rs, info);
18826 + break;
18827 + case '=':
18828 + p[0]++;
18829 + if (*p[0] == '?') {
18830 + p[0]++;
18831 + sprintf(rs, "\r\n0,1,2");
18832 + isdn_tty_at_cout(rs, info);
18833 + } else {
18834 + par = isdn_getnum(p);
18835 + if ((par < 0) || (par > 2))
18836 + PARSE_ERROR1;
18837 + f->lo = par;
18838 +#ifdef ISDN_TTY_FAX_STAT_DEBUG
18839 + printk(KERN_DEBUG "isdn_tty: Fax FLO=%d\n", par);
18840 +#endif
18841 + }
18842 + break;
18843 + default:
18844 + PARSE_ERROR1;
18845 + }
18846 + return 0;
18847 + }
18848 +#endif
18849 +#if 0
18850 + /* LPL=n - Doc for polling cmd */
18851 + if (!strncmp(p[0], "LPL", 3)) { /* TODO */
18852 + p[0] += 3;
18853 + switch (*p[0]) {
18854 + case '?':
18855 + p[0]++;
18856 + sprintf(rs, "\r\n%d", f->lpl);
18857 + isdn_tty_at_cout(rs, info);
18858 + break;
18859 + case '=':
18860 + p[0]++;
18861 + if (*p[0] == '?') {
18862 + p[0]++;
18863 + sprintf(rs, "\r\n0,1");
18864 + isdn_tty_at_cout(rs, info);
18865 + } else {
18866 + par = isdn_getnum(p);
18867 + if ((par < 0) || (par > 1))
18868 + PARSE_ERROR1;
18869 + f->lpl = par;
18870 +#ifdef ISDN_TTY_FAX_STAT_DEBUG
18871 + printk(KERN_DEBUG "isdn_tty: Fax FLPL=%d\n", par);
18872 +#endif
18873 + }
18874 + break;
18875 + default:
18876 + PARSE_ERROR1;
18877 + }
18878 + return 0;
18879 + }
18880 +#endif
18881
18882 /* MDL? - DCE Model */
18883 if (!strncmp(p[0], "MDL?", 4)) {
18884 @@ -1049,6 +1119,38 @@ isdn_tty_cmd_FCLASS2(char **p, modem_inf
18885 }
18886 return 0;
18887 }
18888 +#if 0
18889 + /* PTS=n - Page transfer status */
18890 + if (!strncmp(p[0], "PTS", 3)) { /* TODO */
18891 + p[0] += 3;
18892 + switch (*p[0]) {
18893 + case '?':
18894 + p[0]++;
18895 + sprintf(rs, "\r\n%d", f->pts);
18896 + isdn_tty_at_cout(rs, info);
18897 + break;
18898 + case '=':
18899 + p[0]++;
18900 + if (*p[0] == '?') {
18901 + p[0]++;
18902 + sprintf(rs, "\r\n0-5");
18903 + isdn_tty_at_cout(rs, info);
18904 + } else {
18905 + par = isdn_getnum(p);
18906 + if ((par < 0) || (par > 5))
18907 + PARSE_ERROR1;
18908 + f->pts = par;
18909 +#ifdef ISDN_TTY_FAX_STAT_DEBUG
18910 + printk(KERN_DEBUG "isdn_tty: Fax FPTS=%d\n", par);
18911 +#endif
18912 + }
18913 + break;
18914 + default:
18915 + PARSE_ERROR1;
18916 + }
18917 + return 0;
18918 + }
18919 +#endif
18920
18921 /* REL=n - Phase C received EOL alignment */
18922 if (!strncmp(p[0], "REL", 3)) {
18923 @@ -1091,6 +1193,38 @@ isdn_tty_cmd_FCLASS2(char **p, modem_inf
18924 isdn_tty_at_cout(rs, info);
18925 return 0;
18926 }
18927 +#if 0
18928 + /* SPL=n - Enable polling */
18929 + if (!strncmp(p[0], "SPL", 3)) { /* TODO */
18930 + p[0] += 3;
18931 + switch (*p[0]) {
18932 + case '?':
18933 + p[0]++;
18934 + sprintf(rs, "\r\n%d", f->spl);
18935 + isdn_tty_at_cout(rs, info);
18936 + break;
18937 + case '=':
18938 + p[0]++;
18939 + if (*p[0] == '?') {
18940 + p[0]++;
18941 + sprintf(rs, "\r\n0,1");
18942 + isdn_tty_at_cout(rs, info);
18943 + } else {
18944 + par = isdn_getnum(p);
18945 + if ((par < 0) || (par > 1))
18946 + PARSE_ERROR1;
18947 + f->spl = par;
18948 +#ifdef ISDN_TTY_FAX_STAT_DEBUG
18949 + printk(KERN_DEBUG "isdn_tty: Fax FSPL=%d\n", par);
18950 +#endif
18951 + }
18952 + break;
18953 + default:
18954 + PARSE_ERROR1;
18955 + }
18956 + return 0;
18957 + }
18958 +#endif
18959
18960 /* Phase C Transmit Data Block Size */
18961 if (!strncmp(p[0], "TBC=", 4)) { /* dummy, not used */
18962 @@ -1116,7 +1250,9 @@ isdn_tty_cmd_PLUSF_FAX(char **p, modem_i
18963 {
18964 if (TTY_IS_FCLASS2(info))
18965 return (isdn_tty_cmd_FCLASS2(p, info));
18966 +#ifdef ISDN_TTY_FCLASS1
18967 else if (TTY_IS_FCLASS1(info))
18968 return (isdn_tty_cmd_FCLASS1(p, info));
18969 +#endif
18970 PARSE_ERROR1;
18971 }
18972 Index: linux-2.4.35.4/drivers/isdn/isdn_ttyfax.h
18973 ===================================================================
18974 --- linux-2.4.35.4.orig/drivers/isdn/isdn_ttyfax.h
18975 +++ linux-2.4.35.4/drivers/isdn/isdn_ttyfax.h
18976 @@ -1,4 +1,4 @@
18977 -/* $Id: isdn_ttyfax.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
18978 +/* $Id: isdn_ttyfax.h,v 1.3 2001/09/24 13:22:43 kai Exp $
18979 *
18980 * header for Linux ISDN subsystem, tty_fax related functions (linklevel).
18981 *
18982 Index: linux-2.4.35.4/drivers/isdn/isdn_v110.c
18983 ===================================================================
18984 --- linux-2.4.35.4.orig/drivers/isdn/isdn_v110.c
18985 +++ linux-2.4.35.4/drivers/isdn/isdn_v110.c
18986 @@ -1,4 +1,4 @@
18987 -/* $Id: isdn_v110.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
18988 +/* $Id: isdn_v110.c,v 1.8 2001/09/24 13:22:43 kai Exp $
18989 *
18990 * Linux ISDN subsystem, V.110 related functions (linklevel).
18991 *
18992 @@ -19,7 +19,7 @@
18993
18994 #undef ISDN_V110_DEBUG
18995
18996 -char *isdn_v110_revision = "$Revision: 1.1.4.1 $";
18997 +char *isdn_v110_revision = "$Revision: 1.8 $";
18998
18999 #define V110_38400 255
19000 #define V110_19200 15
19001 @@ -138,6 +138,14 @@ isdn_v110_close(isdn_v110_stream * v)
19002 return;
19003 #ifdef ISDN_V110_DEBUG
19004 printk(KERN_DEBUG "v110 close\n");
19005 +#if 0
19006 + printk(KERN_DEBUG "isdn_v110_close: nbytes=%d\n", v->nbytes);
19007 + printk(KERN_DEBUG "isdn_v110_close: nbits=%d\n", v->nbits);
19008 + printk(KERN_DEBUG "isdn_v110_close: key=%d\n", v->key);
19009 + printk(KERN_DEBUG "isdn_v110_close: SyncInit=%d\n", v->SyncInit);
19010 + printk(KERN_DEBUG "isdn_v110:close: decodelen=%d\n", v->decodelen);
19011 + printk(KERN_DEBUG "isdn_v110_close: framelen=%d\n", v->framelen);
19012 +#endif
19013 #endif
19014 kfree(v->encodebuf);
19015 kfree(v);
19016 Index: linux-2.4.35.4/drivers/isdn/isdn_v110.h
19017 ===================================================================
19018 --- linux-2.4.35.4.orig/drivers/isdn/isdn_v110.h
19019 +++ linux-2.4.35.4/drivers/isdn/isdn_v110.h
19020 @@ -1,4 +1,4 @@
19021 -/* $Id: isdn_v110.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
19022 +/* $Id: isdn_v110.h,v 1.5 2001/09/24 13:22:43 kai Exp $
19023 *
19024 * Linux ISDN subsystem, V.110 related functions (linklevel).
19025 *
19026 Index: linux-2.4.35.4/drivers/isdn/isdn_x25iface.c
19027 ===================================================================
19028 --- linux-2.4.35.4.orig/drivers/isdn/isdn_x25iface.c
19029 +++ linux-2.4.35.4/drivers/isdn/isdn_x25iface.c
19030 @@ -1,4 +1,4 @@
19031 -/* $Id: isdn_x25iface.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
19032 +/* $Id: isdn_x25iface.c,v 1.10 2001/09/24 13:22:43 kai Exp $
19033 *
19034 * Linux ISDN subsystem, X.25 related functions
19035 *
19036 Index: linux-2.4.35.4/drivers/isdn/isdn_x25iface.h
19037 ===================================================================
19038 --- linux-2.4.35.4.orig/drivers/isdn/isdn_x25iface.h
19039 +++ linux-2.4.35.4/drivers/isdn/isdn_x25iface.h
19040 @@ -1,4 +1,4 @@
19041 -/* $Id: isdn_x25iface.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
19042 +/* $Id: isdn_x25iface.h,v 1.4 2001/09/24 13:22:43 kai Exp $
19043 *
19044 * header for Linux ISDN subsystem, x.25 related functions
19045 *
19046 Index: linux-2.4.35.4/drivers/isdn/isdnloop/isdnloop.c
19047 ===================================================================
19048 --- linux-2.4.35.4.orig/drivers/isdn/isdnloop/isdnloop.c
19049 +++ linux-2.4.35.4/drivers/isdn/isdnloop/isdnloop.c
19050 @@ -1,4 +1,4 @@
19051 -/* $Id: isdnloop.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19052 +/* $Id: isdnloop.c,v 1.17 2001/08/30 10:45:42 kai Exp $
19053 *
19054 * ISDN low-level module implementing a dummy loop driver.
19055 *
19056 @@ -14,7 +14,7 @@
19057 #include <linux/init.h>
19058 #include "isdnloop.h"
19059
19060 -static char *revision = "$Revision: 1.1.4.1 $";
19061 +static char *revision = "$Revision$";
19062 static char *isdnloop_id;
19063
19064 MODULE_DESCRIPTION("ISDN4Linux: Pseudo Driver that simulates an ISDN card");
19065 @@ -22,8 +22,8 @@ MODULE_AUTHOR("Fritz Elfert");
19066 MODULE_LICENSE("GPL");
19067 MODULE_PARM(isdnloop_id, "s");
19068 MODULE_PARM_DESC(isdnloop_id, "ID-String of first card");
19069 -
19070 -static int isdnloop_addcard(char *);
19071 +
19072 + static int isdnloop_addcard(char *);
19073
19074 /*
19075 * Free queue completely.
19076 @@ -1542,11 +1542,7 @@ isdnloop_init(void)
19077 } else
19078 strcpy(rev, " ??? ");
19079 printk(KERN_NOTICE "isdnloop-ISDN-driver Rev%s\n", rev);
19080 -
19081 - if (isdnloop_id)
19082 - return (isdnloop_addcard(isdnloop_id));
19083 -
19084 - return 0;
19085 + return (isdnloop_addcard(isdnloop_id));
19086 }
19087
19088 static void __exit
19089 Index: linux-2.4.35.4/drivers/isdn/isdnloop/isdnloop.h
19090 ===================================================================
19091 --- linux-2.4.35.4.orig/drivers/isdn/isdnloop/isdnloop.h
19092 +++ linux-2.4.35.4/drivers/isdn/isdnloop/isdnloop.h
19093 @@ -1,4 +1,4 @@
19094 -/* $Id: isdnloop.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19095 +/* $Id$
19096 *
19097 * Loopback lowlevel module for testing of linklevel.
19098 *
19099 Index: linux-2.4.35.4/drivers/isdn/pcbit/callbacks.c
19100 ===================================================================
19101 --- linux-2.4.35.4.orig/drivers/isdn/pcbit/callbacks.c
19102 +++ linux-2.4.35.4/drivers/isdn/pcbit/callbacks.c
19103 @@ -3,7 +3,7 @@
19104 *
19105 * Copyright (C) 1996 Universidade de Lisboa
19106 *
19107 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19108 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
19109 *
19110 * This software may be used and distributed according to the terms of
19111 * the GNU General Public License, incorporated herein by reference.
19112 Index: linux-2.4.35.4/drivers/isdn/pcbit/callbacks.h
19113 ===================================================================
19114 --- linux-2.4.35.4.orig/drivers/isdn/pcbit/callbacks.h
19115 +++ linux-2.4.35.4/drivers/isdn/pcbit/callbacks.h
19116 @@ -3,7 +3,7 @@
19117 *
19118 * Copyright (C) 1996 Universidade de Lisboa
19119 *
19120 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19121 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
19122 *
19123 * This software may be used and distributed according to the terms of
19124 * the GNU General Public License, incorporated herein by reference.
19125 Index: linux-2.4.35.4/drivers/isdn/pcbit/capi.c
19126 ===================================================================
19127 --- linux-2.4.35.4.orig/drivers/isdn/pcbit/capi.c
19128 +++ linux-2.4.35.4/drivers/isdn/pcbit/capi.c
19129 @@ -4,7 +4,7 @@
19130 *
19131 * Copyright (C) 1996 Universidade de Lisboa
19132 *
19133 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19134 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
19135 *
19136 * This software may be used and distributed according to the terms of
19137 * the GNU General Public License, incorporated herein by reference.
19138 Index: linux-2.4.35.4/drivers/isdn/pcbit/capi.h
19139 ===================================================================
19140 --- linux-2.4.35.4.orig/drivers/isdn/pcbit/capi.h
19141 +++ linux-2.4.35.4/drivers/isdn/pcbit/capi.h
19142 @@ -3,7 +3,7 @@
19143 *
19144 * Copyright (C) 1996 Universidade de Lisboa
19145 *
19146 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19147 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
19148 *
19149 * This software may be used and distributed according to the terms of
19150 * the GNU General Public License, incorporated herein by reference.
19151 @@ -63,7 +63,8 @@ extern int capi_disc_resp(struct pcbit_c
19152 extern int capi_decode_debug_188(u_char *hdr, ushort hdrlen);
19153 #endif
19154
19155 -static inline struct pcbit_chan *
19156 +extern __inline__
19157 +struct pcbit_chan *
19158 capi_channel(struct pcbit_dev *dev, struct sk_buff *skb)
19159 {
19160 ushort callref;
19161 Index: linux-2.4.35.4/drivers/isdn/pcbit/drv.c
19162 ===================================================================
19163 --- linux-2.4.35.4.orig/drivers/isdn/pcbit/drv.c
19164 +++ linux-2.4.35.4/drivers/isdn/pcbit/drv.c
19165 @@ -3,7 +3,7 @@
19166 *
19167 * Copyright (C) 1996 Universidade de Lisboa
19168 *
19169 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19170 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
19171 *
19172 * This software may be used and distributed according to the terms of
19173 * the GNU General Public License, incorporated herein by reference.
19174 @@ -35,7 +35,9 @@
19175 #include <linux/isdnif.h>
19176 #include <asm/string.h>
19177 #include <asm/io.h>
19178 +#ifdef COMPAT_HAS_ISA_IOREMAP
19179 #include <linux/ioport.h>
19180 +#endif
19181
19182 #include "pcbit.h"
19183 #include "edss1.h"
19184 @@ -89,6 +91,7 @@ int pcbit_init_dev(int board, int mem_ba
19185
19186 if (mem_base >= 0xA0000 && mem_base <= 0xFFFFF ) {
19187 dev->ph_mem = mem_base;
19188 +#ifdef COMPAT_HAS_ISA_IOREMAP
19189 if (check_mem_region(dev->ph_mem, 4096)) {
19190 printk(KERN_WARNING
19191 "PCBIT: memory region %lx-%lx already in use\n",
19192 @@ -100,6 +103,9 @@ int pcbit_init_dev(int board, int mem_ba
19193 request_mem_region(dev->ph_mem, 4096, "PCBIT mem");
19194 }
19195 dev->sh_mem = (unsigned char*)ioremap(dev->ph_mem, 4096);
19196 +#else
19197 + dev->sh_mem = (unsigned char*) mem_base;
19198 +#endif
19199 }
19200 else
19201 {
19202 @@ -112,8 +118,10 @@ int pcbit_init_dev(int board, int mem_ba
19203 dev->b1 = kmalloc(sizeof(struct pcbit_chan), GFP_KERNEL);
19204 if (!dev->b1) {
19205 printk("pcbit_init: couldn't malloc pcbit_chan struct\n");
19206 +#ifdef COMPAT_HAS_ISA_IOREMAP
19207 iounmap((unsigned char*)dev->sh_mem);
19208 release_mem_region(dev->ph_mem, 4096);
19209 +#endif
19210 kfree(dev);
19211 return -ENOMEM;
19212 }
19213 @@ -122,8 +130,10 @@ int pcbit_init_dev(int board, int mem_ba
19214 if (!dev->b2) {
19215 printk("pcbit_init: couldn't malloc pcbit_chan struct\n");
19216 kfree(dev->b1);
19217 +#ifdef COMPAT_HAS_ISA_IOREMAP
19218 iounmap((unsigned char*)dev->sh_mem);
19219 release_mem_region(dev->ph_mem, 4096);
19220 +#endif
19221 kfree(dev);
19222 return -ENOMEM;
19223 }
19224 @@ -144,8 +154,10 @@ int pcbit_init_dev(int board, int mem_ba
19225 {
19226 kfree(dev->b1);
19227 kfree(dev->b2);
19228 +#ifdef COMPAT_HAS_ISA_IOREMAP
19229 iounmap((unsigned char*)dev->sh_mem);
19230 release_mem_region(dev->ph_mem, 4096);
19231 +#endif
19232 kfree(dev);
19233 dev_pcbit[board] = NULL;
19234 return -EIO;
19235 @@ -166,8 +178,10 @@ int pcbit_init_dev(int board, int mem_ba
19236 free_irq(irq, dev);
19237 kfree(dev->b1);
19238 kfree(dev->b2);
19239 +#ifdef COMPAT_HAS_ISA_IOREMAP
19240 iounmap((unsigned char*)dev->sh_mem);
19241 release_mem_region(dev->ph_mem, 4096);
19242 +#endif
19243 kfree(dev);
19244 dev_pcbit[board] = NULL;
19245 return -EIO;
19246 @@ -197,8 +211,10 @@ int pcbit_init_dev(int board, int mem_ba
19247 free_irq(irq, dev);
19248 kfree(dev->b1);
19249 kfree(dev->b2);
19250 +#ifdef COMPAT_HAS_ISA_IOREMAP
19251 iounmap((unsigned char*)dev->sh_mem);
19252 release_mem_region(dev->ph_mem, 4096);
19253 +#endif
19254 kfree(dev);
19255 dev_pcbit[board] = NULL;
19256 return -EIO;
19257 @@ -235,8 +251,10 @@ void pcbit_terminate(int board)
19258 del_timer(&dev->b2->fsm_timer);
19259 kfree(dev->b1);
19260 kfree(dev->b2);
19261 +#ifdef COMPAT_HAS_ISA_IOREMAP
19262 iounmap((unsigned char*)dev->sh_mem);
19263 release_mem_region(dev->ph_mem, 4096);
19264 +#endif
19265 kfree(dev);
19266 }
19267 }
19268 @@ -430,7 +448,7 @@ int pcbit_writecmd(const u_char* buf, in
19269 switch(dev->l2_state) {
19270 case L2_LWMODE:
19271 /* check (size <= rdp_size); write buf into board */
19272 - if (len < 0 || len > BANK4 + 1)
19273 + if (len > BANK4 + 1)
19274 {
19275 printk("pcbit_writecmd: invalid length %d\n", len);
19276 return -EINVAL;
19277 @@ -609,6 +627,20 @@ void pcbit_l3_receive(struct pcbit_dev *
19278 dev->b1->s_refnum,
19279 dev->b2->s_refnum);
19280 #endif
19281 +#if 0
19282 + if (dev->b1->s_refnum == refnum)
19283 + chan = dev->b1;
19284 + else {
19285 +
19286 + if (dev->b2->s_refnum == refnum)
19287 + chan = dev->b2;
19288 + else {
19289 + chan = NULL;
19290 + printk(KERN_WARNING "Connection Confirm - refnum doesn't match chan\n");
19291 + break;
19292 + }
19293 + }
19294 +#else
19295 /* We just try to find a channel in the right state */
19296
19297 if (dev->b1->fsm_state == ST_CALL_INIT)
19298 @@ -622,6 +654,7 @@ void pcbit_l3_receive(struct pcbit_dev *
19299 break;
19300 }
19301 }
19302 +#endif
19303 if (capi_decode_conn_conf(chan, skb, &complete)) {
19304 printk(KERN_DEBUG "conn_conf indicates error\n");
19305 pcbit_fsm_event(dev, chan, EV_ERROR, NULL);
19306 Index: linux-2.4.35.4/drivers/isdn/pcbit/edss1.c
19307 ===================================================================
19308 --- linux-2.4.35.4.orig/drivers/isdn/pcbit/edss1.c
19309 +++ linux-2.4.35.4/drivers/isdn/pcbit/edss1.c
19310 @@ -4,7 +4,7 @@
19311 *
19312 * Copyright (C) 1996 Universidade de Lisboa
19313 *
19314 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19315 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
19316 *
19317 * This software may be used and distributed according to the terms of
19318 * the GNU General Public License, incorporated herein by reference.
19319 Index: linux-2.4.35.4/drivers/isdn/pcbit/edss1.h
19320 ===================================================================
19321 --- linux-2.4.35.4.orig/drivers/isdn/pcbit/edss1.h
19322 +++ linux-2.4.35.4/drivers/isdn/pcbit/edss1.h
19323 @@ -3,7 +3,7 @@
19324 *
19325 * Copyright (C) 1996 Universidade de Lisboa
19326 *
19327 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19328 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
19329 *
19330 * This software may be used and distributed according to the terms of
19331 * the GNU General Public License, incorporated herein by reference.
19332 Index: linux-2.4.35.4/drivers/isdn/pcbit/layer2.c
19333 ===================================================================
19334 --- linux-2.4.35.4.orig/drivers/isdn/pcbit/layer2.c
19335 +++ linux-2.4.35.4/drivers/isdn/pcbit/layer2.c
19336 @@ -3,7 +3,7 @@
19337 *
19338 * Copyright (C) 1996 Universidade de Lisboa
19339 *
19340 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19341 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
19342 *
19343 * This software may be used and distributed according to the terms of
19344 * the GNU General Public License, incorporated herein by reference.
19345 @@ -369,11 +369,16 @@ pcbit_receive(struct pcbit_dev *dev)
19346
19347 if (dev->read_frame) {
19348 printk(KERN_DEBUG "pcbit_receive: Type 0 frame and read_frame != NULL\n");
19349 +#if 0
19350 + pcbit_l2_error(dev);
19351 + return;
19352 +#else
19353 /* discard previous queued frame */
19354 if (dev->read_frame->skb)
19355 kfree_skb(dev->read_frame->skb);
19356 kfree(dev->read_frame);
19357 dev->read_frame = NULL;
19358 +#endif
19359 }
19360 frame = kmalloc(sizeof(struct frame_buf), GFP_ATOMIC);
19361
19362 @@ -449,10 +454,14 @@ pcbit_receive(struct pcbit_dev *dev)
19363
19364 if (!(frame = dev->read_frame)) {
19365 printk("Type 1 frame and no frame queued\n");
19366 +#if 1
19367 /* usually after an error: toss frame */
19368 dev->readptr += tt;
19369 if (dev->readptr > dev->sh_mem + BANK2 + BANKLEN)
19370 dev->readptr -= BANKLEN;
19371 +#else
19372 + pcbit_l2_error(dev);
19373 +#endif
19374 return;
19375
19376 }
19377 Index: linux-2.4.35.4/drivers/isdn/pcbit/layer2.h
19378 ===================================================================
19379 --- linux-2.4.35.4.orig/drivers/isdn/pcbit/layer2.h
19380 +++ linux-2.4.35.4/drivers/isdn/pcbit/layer2.h
19381 @@ -3,7 +3,7 @@
19382 *
19383 * Copyright (C) 1996 Universidade de Lisboa
19384 *
19385 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19386 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
19387 *
19388 * This software may be used and distributed according to the terms of
19389 * the GNU General Public License, incorporated herein by reference.
19390 Index: linux-2.4.35.4/drivers/isdn/pcbit/module.c
19391 ===================================================================
19392 --- linux-2.4.35.4.orig/drivers/isdn/pcbit/module.c
19393 +++ linux-2.4.35.4/drivers/isdn/pcbit/module.c
19394 @@ -3,7 +3,7 @@
19395 *
19396 * Copyright (C) 1996 Universidade de Lisboa
19397 *
19398 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19399 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
19400 *
19401 * This software may be used and distributed according to the terms of
19402 * the GNU General Public License, incorporated herein by reference.
19403 @@ -92,6 +92,7 @@ static void __exit pcbit_exit(void)
19404 }
19405
19406 #ifndef MODULE
19407 +#ifdef COMPAT_HAS_NEW_SETUP
19408 #define MAX_PARA (MAX_PCBIT_CARDS * 2)
19409 static int __init pcbit_setup(char *line)
19410 {
19411 @@ -100,6 +101,11 @@ static int __init pcbit_setup(char *line
19412 int ints[MAX_PARA+1];
19413
19414 str = get_options(line, MAX_PARA, ints);
19415 +#else
19416 +void pcbit_setup(char *str, int *ints)
19417 +{
19418 + int i, j, argc;
19419 +#endif
19420 argc = ints[0];
19421 i = 0;
19422 j = 1;
19423 @@ -118,9 +124,13 @@ static int __init pcbit_setup(char *line
19424
19425 i++;
19426 }
19427 +#ifdef COMPAT_HAS_NEW_SETUP
19428 return(1);
19429 }
19430 __setup("pcbit=", pcbit_setup);
19431 +#else
19432 +}
19433 +#endif
19434 #endif
19435
19436 module_init(pcbit_init);
19437 Index: linux-2.4.35.4/drivers/isdn/pcbit/pcbit.h
19438 ===================================================================
19439 --- linux-2.4.35.4.orig/drivers/isdn/pcbit/pcbit.h
19440 +++ linux-2.4.35.4/drivers/isdn/pcbit/pcbit.h
19441 @@ -3,7 +3,7 @@
19442 *
19443 * Copyright (C) 1996 Universidade de Lisboa
19444 *
19445 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19446 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
19447 *
19448 * This software may be used and distributed according to the terms of
19449 * the GNU General Public License, incorporated herein by reference.
19450 Index: linux-2.4.35.4/drivers/isdn/sc/card.h
19451 ===================================================================
19452 --- linux-2.4.35.4.orig/drivers/isdn/sc/card.h
19453 +++ linux-2.4.35.4/drivers/isdn/sc/card.h
19454 @@ -1,4 +1,4 @@
19455 -/* $Id: card.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19456 +/* $Id$
19457 *
19458 * Driver parameters for SpellCaster ISA ISDN adapters
19459 *
19460 Index: linux-2.4.35.4/drivers/isdn/sc/command.c
19461 ===================================================================
19462 --- linux-2.4.35.4.orig/drivers/isdn/sc/command.c
19463 +++ linux-2.4.35.4/drivers/isdn/sc/command.c
19464 @@ -1,4 +1,4 @@
19465 -/* $Id: command.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19466 +/* $Id$
19467 *
19468 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19469 *
19470 @@ -95,7 +95,7 @@ int get_card_from_id(int driver)
19471 if(adapter[i]->driverId == driver)
19472 return i;
19473 }
19474 - return -ENODEV;
19475 + return -NODEV;
19476 }
19477
19478 /*
19479 Index: linux-2.4.35.4/drivers/isdn/sc/debug.c
19480 ===================================================================
19481 --- linux-2.4.35.4.orig/drivers/isdn/sc/debug.c
19482 +++ linux-2.4.35.4/drivers/isdn/sc/debug.c
19483 @@ -1,4 +1,4 @@
19484 -/* $Id: debug.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19485 +/* $Id$
19486 *
19487 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19488 *
19489 Index: linux-2.4.35.4/drivers/isdn/sc/debug.h
19490 ===================================================================
19491 --- linux-2.4.35.4.orig/drivers/isdn/sc/debug.h
19492 +++ linux-2.4.35.4/drivers/isdn/sc/debug.h
19493 @@ -1,4 +1,4 @@
19494 -/* $Id: debug.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19495 +/* $Id$
19496 *
19497 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19498 *
19499 Index: linux-2.4.35.4/drivers/isdn/sc/event.c
19500 ===================================================================
19501 --- linux-2.4.35.4.orig/drivers/isdn/sc/event.c
19502 +++ linux-2.4.35.4/drivers/isdn/sc/event.c
19503 @@ -1,4 +1,4 @@
19504 -/* $Id: event.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19505 +/* $Id$
19506 *
19507 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19508 *
19509 Index: linux-2.4.35.4/drivers/isdn/sc/init.c
19510 ===================================================================
19511 --- linux-2.4.35.4.orig/drivers/isdn/sc/init.c
19512 +++ linux-2.4.35.4/drivers/isdn/sc/init.c
19513 @@ -514,6 +514,15 @@ int identify_board(unsigned long rambase
19514 schedule_timeout(HZ);
19515 sig = readl(rambase + SIG_OFFSET);
19516 pr_debug("Looking for a signature, got 0x%x\n", sig);
19517 +#if 0
19518 +/*
19519 + * For Gary:
19520 + * If it's a timing problem, it should be gone with the above schedule()
19521 + * Another possible reason may be the missing volatile in the original
19522 + * code. readl() does this for us.
19523 + */
19524 + printk(""); /* Hack! Doesn't work without this !!!??? */
19525 +#endif
19526 if(sig == SIGNATURE)
19527 return PRI_BOARD;
19528
19529 @@ -525,6 +534,9 @@ int identify_board(unsigned long rambase
19530 schedule_timeout(HZ);
19531 sig = readl(rambase + SIG_OFFSET);
19532 pr_debug("Looking for a signature, got 0x%x\n", sig);
19533 +#if 0
19534 + printk(""); /* Hack! Doesn't work without this !!!??? */
19535 +#endif
19536 if(sig == SIGNATURE)
19537 return BRI_BOARD;
19538
19539 Index: linux-2.4.35.4/drivers/isdn/sc/interrupt.c
19540 ===================================================================
19541 --- linux-2.4.35.4.orig/drivers/isdn/sc/interrupt.c
19542 +++ linux-2.4.35.4/drivers/isdn/sc/interrupt.c
19543 @@ -1,4 +1,4 @@
19544 -/* $Id: interrupt.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19545 +/* $Id$
19546 *
19547 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19548 *
19549 Index: linux-2.4.35.4/drivers/isdn/sc/ioctl.c
19550 ===================================================================
19551 --- linux-2.4.35.4.orig/drivers/isdn/sc/ioctl.c
19552 +++ linux-2.4.35.4/drivers/isdn/sc/ioctl.c
19553 @@ -23,6 +23,9 @@ extern int send_and_receive(int, unsigne
19554
19555 extern board *adapter[];
19556
19557 +#if 0
19558 +static char *ChannelStates[] = { "Idle", "Ready", "Connecting", "Connected", "Disconnecting" };
19559 +#endif
19560
19561 int GetStatus(int card, boardInfo *);
19562
19563 Index: linux-2.4.35.4/drivers/isdn/sc/message.c
19564 ===================================================================
19565 --- linux-2.4.35.4.orig/drivers/isdn/sc/message.c
19566 +++ linux-2.4.35.4/drivers/isdn/sc/message.c
19567 @@ -1,4 +1,4 @@
19568 -/* $Id: message.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19569 +/* $Id$
19570 *
19571 * functions for sending and receiving control messages
19572 *
19573 Index: linux-2.4.35.4/drivers/isdn/sc/message.h
19574 ===================================================================
19575 --- linux-2.4.35.4.orig/drivers/isdn/sc/message.h
19576 +++ linux-2.4.35.4/drivers/isdn/sc/message.h
19577 @@ -1,4 +1,4 @@
19578 -/* $Id: message.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19579 +/* $Id$
19580 *
19581 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19582 *
19583 Index: linux-2.4.35.4/drivers/isdn/sc/packet.c
19584 ===================================================================
19585 --- linux-2.4.35.4.orig/drivers/isdn/sc/packet.c
19586 +++ linux-2.4.35.4/drivers/isdn/sc/packet.c
19587 @@ -1,4 +1,4 @@
19588 -/* $Id: packet.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19589 +/* $Id$
19590 *
19591 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19592 *
19593 Index: linux-2.4.35.4/drivers/isdn/sc/shmem.c
19594 ===================================================================
19595 --- linux-2.4.35.4.orig/drivers/isdn/sc/shmem.c
19596 +++ linux-2.4.35.4/drivers/isdn/sc/shmem.c
19597 @@ -1,4 +1,4 @@
19598 -/* $Id: shmem.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19599 +/* $Id$
19600 *
19601 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19602 *
19603 Index: linux-2.4.35.4/drivers/isdn/sc/timer.c
19604 ===================================================================
19605 --- linux-2.4.35.4.orig/drivers/isdn/sc/timer.c
19606 +++ linux-2.4.35.4/drivers/isdn/sc/timer.c
19607 @@ -1,4 +1,4 @@
19608 -/* $Id: timer.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19609 +/* $Id$
19610 *
19611 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19612 *
19613 Index: linux-2.4.35.4/drivers/isdn/tpam/tpam.h
19614 ===================================================================
19615 --- linux-2.4.35.4.orig/drivers/isdn/tpam/tpam.h
19616 +++ linux-2.4.35.4/drivers/isdn/tpam/tpam.h
19617 @@ -1,4 +1,4 @@
19618 -/* $Id: tpam.h,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
19619 +/* $Id: tpam.h,v 1.3 2001/09/24 13:23:12 kai Exp $
19620 *
19621 * Turbo PAM ISDN driver for Linux. (Kernel Driver)
19622 *
19623 Index: linux-2.4.35.4/drivers/isdn/tpam/tpam_commands.c
19624 ===================================================================
19625 --- linux-2.4.35.4.orig/drivers/isdn/tpam/tpam_commands.c
19626 +++ linux-2.4.35.4/drivers/isdn/tpam/tpam_commands.c
19627 @@ -1,4 +1,4 @@
19628 -/* $Id: tpam_commands.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
19629 +/* $Id: tpam_commands.c,v 1.3 2001/09/24 13:23:12 kai Exp $
19630 *
19631 * Turbo PAM ISDN driver for Linux. (Kernel Driver - ISDN commands)
19632 *
19633 Index: linux-2.4.35.4/drivers/isdn/tpam/tpam_crcpc.c
19634 ===================================================================
19635 --- linux-2.4.35.4.orig/drivers/isdn/tpam/tpam_crcpc.c
19636 +++ linux-2.4.35.4/drivers/isdn/tpam/tpam_crcpc.c
19637 @@ -1,4 +1,4 @@
19638 -/* $Id: tpam_crcpc.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
19639 +/* $Id$
19640 *
19641 * Turbo PAM ISDN driver for Linux. (Kernel Driver - CRC encoding)
19642 *
19643 Index: linux-2.4.35.4/drivers/isdn/tpam/tpam_hdlc.c
19644 ===================================================================
19645 --- linux-2.4.35.4.orig/drivers/isdn/tpam/tpam_hdlc.c
19646 +++ linux-2.4.35.4/drivers/isdn/tpam/tpam_hdlc.c
19647 @@ -1,4 +1,4 @@
19648 -/* $Id: tpam_hdlc.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
19649 +/* $Id: tpam_hdlc.c,v 1.3 2001/09/24 13:23:12 kai Exp $
19650 *
19651 * Turbo PAM ISDN driver for Linux. (Kernel Driver - HDLC encoding)
19652 *
19653 Index: linux-2.4.35.4/drivers/isdn/tpam/tpam_main.c
19654 ===================================================================
19655 --- linux-2.4.35.4.orig/drivers/isdn/tpam/tpam_main.c
19656 +++ linux-2.4.35.4/drivers/isdn/tpam/tpam_main.c
19657 @@ -1,4 +1,4 @@
19658 -/* $Id: tpam_main.c,v 1.1.2.2 2001/12/09 18:45:14 kai Exp $
19659 +/* $Id$
19660 *
19661 * Turbo PAM ISDN driver for Linux. (Kernel Driver - main routines)
19662 *
19663 @@ -254,7 +254,7 @@ static struct pci_driver tpam_driver = {
19664 name: "tpam",
19665 id_table: tpam_pci_tbl,
19666 probe: tpam_probe,
19667 - remove: __devexit_p(tpam_remove),
19668 + remove: tpam_remove,
19669 };
19670
19671 static int __init tpam_init(void) {
19672 Index: linux-2.4.35.4/drivers/isdn/tpam/tpam_memory.c
19673 ===================================================================
19674 --- linux-2.4.35.4.orig/drivers/isdn/tpam/tpam_memory.c
19675 +++ linux-2.4.35.4/drivers/isdn/tpam/tpam_memory.c
19676 @@ -1,4 +1,4 @@
19677 -/* $Id: tpam_memory.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
19678 +/* $Id$
19679 *
19680 * Turbo PAM ISDN driver for Linux. (Kernel Driver - Board Memory Access)
19681 *
19682 Index: linux-2.4.35.4/drivers/isdn/tpam/tpam_nco.c
19683 ===================================================================
19684 --- linux-2.4.35.4.orig/drivers/isdn/tpam/tpam_nco.c
19685 +++ linux-2.4.35.4/drivers/isdn/tpam/tpam_nco.c
19686 @@ -1,4 +1,4 @@
19687 -/* $Id: tpam_nco.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
19688 +/* $Id$
19689 *
19690 * Turbo PAM ISDN driver for Linux.
19691 * (Kernel Driver - Low Level NCO Manipulation)
19692 Index: linux-2.4.35.4/drivers/isdn/tpam/tpam_queues.c
19693 ===================================================================
19694 --- linux-2.4.35.4.orig/drivers/isdn/tpam/tpam_queues.c
19695 +++ linux-2.4.35.4/drivers/isdn/tpam/tpam_queues.c
19696 @@ -1,4 +1,4 @@
19697 -/* $Id: tpam_queues.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
19698 +/* $Id$
19699 *
19700 * Turbo PAM ISDN driver for Linux. (Kernel Driver)
19701 *
19702 @@ -146,7 +146,6 @@ void tpam_irq(int irq, void *dev_id, str
19703 do {
19704 hpic = readl(card->bar0 + TPAM_HPIC_REGISTER);
19705 if (waiting_too_long++ > 0xfffffff) {
19706 - kfree_skb(skb);
19707 spin_unlock(&card->lock);
19708 printk(KERN_ERR "TurboPAM(tpam_irq): "
19709 "waiting too long...\n");
19710 Index: linux-2.4.35.4/include/linux/b1lli.h
19711 ===================================================================
19712 --- linux-2.4.35.4.orig/include/linux/b1lli.h
19713 +++ linux-2.4.35.4/include/linux/b1lli.h
19714 @@ -1,4 +1,4 @@
19715 -/* $Id: b1lli.h,v 1.8.8.3 2001/09/23 22:25:05 kai Exp $
19716 +/* $Id$
19717 *
19718 * ISDN lowlevel-module for AVM B1-card.
19719 *
19720 Index: linux-2.4.35.4/include/linux/b1pcmcia.h
19721 ===================================================================
19722 --- linux-2.4.35.4.orig/include/linux/b1pcmcia.h
19723 +++ linux-2.4.35.4/include/linux/b1pcmcia.h
19724 @@ -1,4 +1,4 @@
19725 -/* $Id: b1pcmcia.h,v 1.1.8.2 2001/09/23 22:25:05 kai Exp $
19726 +/* $Id$
19727 *
19728 * Exported functions of module b1pcmcia to be called by
19729 * avm_cs card services module.
19730 Index: linux-2.4.35.4/include/linux/capi.h
19731 ===================================================================
19732 --- linux-2.4.35.4.orig/include/linux/capi.h
19733 +++ linux-2.4.35.4/include/linux/capi.h
19734 @@ -1,4 +1,4 @@
19735 -/* $Id: capi.h,v 1.1.4.1 2001/11/20 14:19:38 kai Exp $
19736 +/* $Id$
19737 *
19738 * CAPI 2.0 Interface for Linux
19739 *
19740 Index: linux-2.4.35.4/include/linux/concap.h
19741 ===================================================================
19742 --- linux-2.4.35.4.orig/include/linux/concap.h
19743 +++ linux-2.4.35.4/include/linux/concap.h
19744 @@ -1,4 +1,4 @@
19745 -/* $Id: concap.h,v 1.2.8.1 2001/09/23 22:25:05 kai Exp $
19746 +/* $Id: concap.h,v 1.3 2001/09/24 13:23:13 kai Exp $
19747 *
19748 * Copyright 1997 by Henner Eisen <eis@baty.hanse.de>
19749 *
19750 @@ -11,6 +11,7 @@
19751 #ifdef __KERNEL__
19752 #include <linux/skbuff.h>
19753 #include <linux/netdevice.h>
19754 +#include <linux/isdn_compat.h>
19755
19756 /* Stuff to support encapsulation protocols genericly. The encapsulation
19757 protocol is processed at the uppermost layer of the network interface.
19758 Index: linux-2.4.35.4/include/linux/hysdn_if.h
19759 ===================================================================
19760 --- linux-2.4.35.4.orig/include/linux/hysdn_if.h
19761 +++ linux-2.4.35.4/include/linux/hysdn_if.h
19762 @@ -1,4 +1,4 @@
19763 -/* $Id: hysdn_if.h,v 1.1.8.3 2001/09/23 22:25:05 kai Exp $
19764 +/* $Id$
19765 *
19766 * Linux driver for HYSDN cards
19767 * ioctl definitions shared by hynetmgr and driver.
19768 Index: linux-2.4.35.4/include/linux/isdn/tpam.h
19769 ===================================================================
19770 --- linux-2.4.35.4.orig/include/linux/isdn/tpam.h
19771 +++ linux-2.4.35.4/include/linux/isdn/tpam.h
19772 @@ -1,4 +1,4 @@
19773 -/* $Id: tpam.h,v 1.1.2.1 2001/11/20 14:19:38 kai Exp $
19774 +/* $Id$
19775 *
19776 * Turbo PAM ISDN driver for Linux. (Kernel Driver)
19777 *
19778 Index: linux-2.4.35.4/include/linux/isdn.h
19779 ===================================================================
19780 --- linux-2.4.35.4.orig/include/linux/isdn.h
19781 +++ linux-2.4.35.4/include/linux/isdn.h
19782 @@ -1,4 +1,4 @@
19783 -/* $Id: isdn.h,v 1.1.4.1 2001/11/20 14:19:38 kai Exp $
19784 +/* $Id: isdn.h,v 1.125 2001/12/01 23:18:21 detabc Exp $
19785 *
19786 * Main header for the Linux ISDN subsystem (linklevel).
19787 *
19788 @@ -14,6 +14,7 @@
19789 #ifndef __ISDN_H__
19790 #define __ISDN_H__
19791
19792 +#include <linux/isdn_compat.h>
19793 #include <linux/ioctl.h>
19794
19795 #ifdef CONFIG_COBALT_MICRO_SERVER
19796 @@ -93,9 +94,15 @@
19797 #define ISDN_LMSNLEN 255 /* Length of tty's Listen-MSN string */
19798 #define ISDN_CMSGLEN 50 /* Length of CONNECT-Message to add for Modem */
19799
19800 +#ifdef BIG_PHONE_NUMBERS
19801 #define ISDN_MSNLEN 32
19802 #define NET_DV 0x06 /* Data version for isdn_net_ioctl_cfg */
19803 #define TTY_DV 0x06 /* Data version for iprofd etc. */
19804 +#else
19805 +#define ISDN_MSNLEN 20
19806 +#define NET_DV 0x05 /* Data version for isdn_net_ioctl_cfg */
19807 +#define TTY_DV 0x05 /* Data version for iprofd etc. */
19808 +#endif
19809
19810 #define INF_DV 0x01 /* Data version for /dev/isdninfo */
19811
19812 @@ -187,6 +194,61 @@ typedef struct {
19813 #define ISDN_MINOR_PPPMAX (128 + (ISDN_MAX_CHANNELS-1))
19814 #define ISDN_MINOR_STATUS 255
19815
19816 +#ifndef CONFIG_ISDN_WITH_ABC
19817 +#undef CONFIG_ISDN_WITH_ABC_CALLB
19818 +#undef CONFIG_ISDN_WITH_ABC_UDP_CHECK
19819 +#undef CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP
19820 +#undef CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL
19821 +#undef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
19822 +#undef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
19823 +#undef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
19824 +#undef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
19825 +#undef CONFIG_ISDN_WITH_ABC_CONN_ERROR
19826 +#undef CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS
19827 +#else /* CONFIG_ISDN_WITH_ABC */
19828 +#include <linux/isdn_dwabc.h>
19829 +
19830 +
19831 +typedef struct DWABCJIFFIES {
19832 +
19833 + u_long msec_1000;
19834 + u_long msec_500;
19835 + u_long msec_400;
19836 + u_long msec_200;
19837 + u_long msec_100;
19838 +
19839 +} DWABCJIFFIES;
19840 +
19841 +
19842 +#ifdef CONFIG_ISDN_WITH_ABC_NEED_DWSJIFFIES
19843 +DWABCJIFFIES isdn_dwabc_jiffies;
19844 +#else
19845 +extern DWABCJIFFIES isdn_dwabc_jiffies;
19846 +#endif
19847 +#define dwsjiffies (isdn_dwabc_jiffies.msec_1000)
19848 +
19849 +#define ISDN_DW_ABC_FLAG_UNUSED00001 0x00000001L
19850 +#define ISDN_DW_ABC_FLAG_NO_UDP_CHECK 0x00000002L
19851 +#define ISDN_DW_ABC_FLAG_NO_UDP_HANGUP 0x00000004L
19852 +#define ISDN_DW_ABC_FLAG_NO_UDP_DIAL 0x00000008L
19853 +#define ISDN_DW_ABC_FLAG_UNUSED00010 0x00000010L
19854 +#define ISDN_DW_ABC_FLAG_RCV_NO_HUPTIMER 0x00000020L
19855 +#define ISDN_DW_ABC_FLAG_NO_CH_EXTINUSE 0x00000040L
19856 +#define ISDN_DW_ABC_FLAG_NO_CONN_ERROR 0x00000080L
19857 +#define ISDN_DW_ABC_FLAG_BSD_COMPRESS 0x00000100L
19858 +#define ISDN_DW_ABC_FLAG_NO_LCR 0x00000200L
19859 +#define ISDN_DW_ABC_FLAG_LEASED_LINE 0x00001000L
19860 +
19861 +#define ISDN_DW_ABC_IFFLAG_NODCHAN 0x00000001L
19862 +#define ISDN_DW_ABC_IFFLAG_BSDAKTIV 0x00000002L
19863 +
19864 +#define ISDN_DW_ABC_BITLOCK_SEND 0
19865 +#define ISDN_DW_ABC_BITLOCK_RECEIVE 1
19866 +
19867 +#endif /* CONFIG_ISDN_WITH_ABC */
19868 +
19869 +
19870 +
19871 #ifdef CONFIG_ISDN_PPP
19872
19873 #ifdef CONFIG_ISDN_PPP_VJ
19874 @@ -204,9 +266,11 @@ typedef struct {
19875 # include <linux/concap.h>
19876 #endif
19877
19878 +#ifdef HAVE_DEVFS_FS
19879 #ifdef CONFIG_DEVFS_FS
19880 # include <linux/devfs_fs_kernel.h>
19881 #endif
19882 +#endif /* HAVE_DEVFS_FS */
19883
19884 #include <linux/isdnif.h>
19885
19886 @@ -272,6 +336,12 @@ typedef struct {
19887 #define ISDN_NET_CALLBACK 0x04 /* activate callback */
19888 #define ISDN_NET_CBHUP 0x08 /* hangup before callback */
19889 #define ISDN_NET_CBOUT 0x10 /* remote machine does callback */
19890 +#if 0
19891 +/* Unused??? */
19892 +#define ISDN_NET_CLONE 0x08 /* clone a tmp interface when called */
19893 +#define ISDN_NET_TMP 0x10 /* tmp interface until getting an IP */
19894 +#define ISDN_NET_DYNAMIC 0x20 /* this link is dynamically allocated */
19895 +#endif
19896
19897 #define ISDN_NET_MAGIC 0x49344C02 /* for paranoia-checking */
19898
19899 @@ -386,6 +456,38 @@ typedef struct isdn_net_local_s {
19900 char cisco_debserint; /* debugging flag of cisco hdlc with slarp */
19901 struct timer_list cisco_timer;
19902 struct tq_struct tqueue;
19903 +#ifdef CONFIG_ISDN_WITH_ABC
19904 + ulong dw_abc_flags;
19905 + ulong dw_abc_if_flags;
19906 + int dw_abc_inuse_secure;
19907 + ulong dw_abc_dialstart;
19908 + int dw_abc_old_onhtime;
19909 + int dw_abc_remote_version;
19910 + int dw_abc_bitlocks;
19911 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
19912 + char dw_out_msn[ISDN_MSNLEN]; /* eaz for outgoing call if *out_msn != 0 */
19913 +#endif
19914 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
19915 + ulong dw_abc_lcr_callid;
19916 + ulong dw_abc_lcr_start_request;
19917 + ulong dw_abc_lcr_end_request;
19918 + isdn_ctrl *dw_abc_lcr_cmd;
19919 + struct ISDN_DWABC_LCR_IOCTL *dw_abc_lcr_io;
19920 +#endif
19921 + ulong dw_abc_bchan_last_connect;
19922 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
19923 + short dw_abc_bchan_errcnt;
19924 +#endif
19925 +#ifdef CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS
19926 + void *dw_abc_bsd_compressor;
19927 + void *dw_abc_bsd_stat_rx;
19928 + void *dw_abc_bsd_stat_tx;
19929 +#endif
19930 + ulong dw_abc_bsd_snd;
19931 + ulong dw_abc_bsd_bsd_snd;
19932 + ulong dw_abc_bsd_rcv;
19933 + ulong dw_abc_bsd_bsd_rcv;
19934 +#endif
19935 } isdn_net_local;
19936
19937 /* the interface itself */
19938 @@ -608,12 +710,13 @@ typedef struct isdn_devt {
19939 int tflags; /* Timer-Flags: */
19940 /* see ISDN_TIMER_..defines */
19941 int global_flags;
19942 - infostruct *infochain; /* List of open info-devs. */
19943 - wait_queue_head_t info_waitq; /* Wait-Queue for isdninfo */
19944 struct timer_list timer; /* Misc.-function Timer */
19945 int chanmap[ISDN_MAX_CHANNELS];/* Map minor->device-channel */
19946 int drvmap[ISDN_MAX_CHANNELS]; /* Map minor->driver-index */
19947 int usage[ISDN_MAX_CHANNELS]; /* Used by tty/ip/voice */
19948 +#ifdef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
19949 + ulong dwabc_chan_external_inuse[ISDN_MAX_CHANNELS];
19950 +#endif
19951 char num[ISDN_MAX_CHANNELS][ISDN_MSNLEN];
19952 /* Remote number of active ch.*/
19953 int m_idx[ISDN_MAX_CHANNELS]; /* Index for mdm.... */
19954 @@ -631,6 +734,7 @@ typedef struct isdn_devt {
19955 isdn_v110_stream *v110[ISDN_MAX_CHANNELS]; /* V.110 private data */
19956 struct semaphore sem; /* serialize list access*/
19957 unsigned long global_features;
19958 +#ifdef HAVE_DEVFS_FS
19959 #ifdef CONFIG_DEVFS_FS
19960 devfs_handle_t devfs_handle_isdninfo;
19961 devfs_handle_t devfs_handle_isdnctrl;
19962 @@ -640,10 +744,41 @@ typedef struct isdn_devt {
19963 devfs_handle_t devfs_handle_ipppX[ISDN_MAX_CHANNELS];
19964 #endif
19965 #endif /* CONFIG_DEVFS_FS */
19966 +#endif /* HAVE_DEVFS_FS */
19967 } isdn_dev;
19968
19969 extern isdn_dev *dev;
19970
19971 +#ifdef CONFIG_ISDN_WITH_ABC
19972 +extern int isdn_auto_dial_helper(isdn_net_local *,struct sk_buff *,int);
19973 +extern void dwisdn_nfw_send(isdn_net_local *lp,int drop_only);
19974 +extern void isdn_net_unreachable(struct net_device *,struct sk_buff *,char *);
19975 +extern void isdn_net_log_skb_dwabc(struct sk_buff *,isdn_net_local *,char *);
19976 +extern void isdn_net_hangup(struct net_device *d);
19977 +extern void isdn_dw_clear_if(ulong pm,isdn_net_local *);
19978 +extern void isdn_dwabc_test_phone(isdn_net_local *);
19979 +extern void isdn_dw_abc_init_func(void);
19980 +extern void isdn_dw_abc_release_func(void);
19981 +extern int isdn_dw_abc_reset_interface(isdn_net_local *,int);
19982 +extern int dwabc_bsd_init(isdn_net_local *lp);
19983 +extern void dwabc_bsd_free(isdn_net_local *lp);
19984 +extern struct sk_buff *dwabc_bsd_compress(isdn_net_local *,struct sk_buff *,struct net_device *);
19985 +extern void dwabc_bsd_first_gen(isdn_net_local *);
19986 +extern struct sk_buff *dwabc_bsd_rx_pkt(isdn_net_local *,struct sk_buff *,struct net_device *);
19987 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
19988 +extern size_t isdn_dw_abc_lcr_readstat(char *,size_t);
19989 +extern ulong isdn_dw_abc_lcr_call_number(isdn_net_local *,isdn_ctrl *);
19990 +extern void isdn_dw_abc_lcr_open(void);
19991 +extern void isdn_dw_abc_lcr_close(void);
19992 +extern int isdn_dw_abc_lcr_ioctl(ulong);
19993 +extern void isdn_dw_abc_lcr_clear(isdn_net_local *);
19994 +extern int isdn_dw_abc_lcr_lock(void);
19995 +extern void isdn_dw_abc_lcr_ulock(void);
19996 +#endif
19997 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK
19998 +extern int dw_abc_udp_test(struct sk_buff *skb,struct net_device *ndev);
19999 +#endif
20000 +#endif
20001
20002 #endif /* __KERNEL__ */
20003
20004 Index: linux-2.4.35.4/include/linux/isdn_compat.h
20005 ===================================================================
20006 --- /dev/null
20007 +++ linux-2.4.35.4/include/linux/isdn_compat.h
20008 @@ -0,0 +1,261 @@
20009 +/* $Id: isdn_compat.h,v 1.53 2001/09/24 13:23:13 kai Exp $
20010 + *
20011 + * Linux ISDN subsystem
20012 + * Compatibility for various Linux kernel versions
20013 + *
20014 + * This software may be used and distributed according to the terms
20015 + * of the GNU General Public License, incorporated herein by reference.
20016 + *
20017 + */
20018 +
20019 +#ifndef _LINUX_ISDN_COMPAT_H
20020 +#define _LINUX_ISDN_COMPAT_H
20021 +
20022 +#ifdef __KERNEL__
20023 +
20024 +#ifndef ISDN_COMPAT_NOT_GENERIC
20025 +/* when using std2kern -u, this part is left out and instead provided
20026 + by the .ctrl files */
20027 +
20028 +#include <linux/version.h>
20029 +
20030 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)
20031 +
20032 +#define set_current_state(sta) (current->state = sta)
20033 +#define module_init(x) int init_module(void) { return x(); }
20034 +#define module_exit(x) void cleanup_module(void) { x(); }
20035 +#define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); *(int *)0 = 0; } while (0)
20036 +#define init_MUTEX(x) *(x)=MUTEX
20037 +#define init_MUTEX_LOCKED(x) *(x)=MUTEX_LOCKED
20038 +#define __devinit
20039 +#define __devinitdata
20040 +
20041 +#else /* 2.2.18 and later */
20042 +
20043 +#define COMPAT_HAS_NEW_SETUP
20044 +#define COMPAT_HAS_NEW_WAITQ
20045 +
20046 +#endif
20047 +
20048 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
20049 +
20050 +#define dev_kfree_skb_irq(a) dev_kfree_skb(a)
20051 +#define dev_kfree_skb_any(a) dev_kfree_skb(a)
20052 +#define COMPAT_HAS_2_2_PCI
20053 +#define get_pcibase(ps, nr) ps->base_address[nr]
20054 +#define pci_resource_start_io(pdev, nr) ((pdev)->base_address[nr] & PCI_BASE_ADDRESS_IO_MASK)
20055 +#define pci_resource_start_mem(pdev, nr) ((pdev)->base_address[nr] & PCI_BASE_ADDRESS_MEM_MASK)
20056 +#define pci_get_sub_vendor(pdev, id) pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, &id)
20057 +#define pci_get_sub_system(pdev, id) pci_read_config_word(pdev, PCI_SUBSYSTEM_ID, &id)
20058 +
20059 +#define __exit
20060 +#define __devinit
20061 +#define __devinitdata
20062 +
20063 +#define net_device device
20064 +#define COMPAT_NO_SOFTNET
20065 +#define netif_running(d) test_bit(LINK_STATE_START, &d->state)
20066 +#define COMPAT_NEED_MPPP_DEFS
20067 +#define spin_lock_bh(lock)
20068 +#define spin_unlock_bh(lock)
20069 +#define COMPAT_NEED_SPIN_LOCK_BH
20070 +#define i_count_read(ic) ic
20071 +#define i_count_inc(ic) ic++
20072 +#define COMPAT_USE_MODCOUNT_LOCK
20073 +#define devfs_register_chrdev(m,n,f) register_chrdev(m,n,f)
20074 +#define devfs_unregister_chrdev(m,n) unregister_chrdev(m,n)
20075 +#define COMPAT_NEED_PCI_IDS
20076 +#define in_irq() (local_irq_count[smp_processor_id()] != 0)
20077 +
20078 +#else /* 2.4.0 and later */
20079 +
20080 +#define pci_resource_start_io(pdev, nr) pci_resource_start(pdev, nr)
20081 +#define pci_resource_start_mem(pdev, nr) pci_resource_start(pdev, nr)
20082 +#define get_pcibase(ps, nr) ps->resource[nr].start
20083 +#define pci_get_sub_system(pdev, id) id = pdev->subsystem_device
20084 +#define pci_get_sub_vendor(pdev, id) id = pdev->subsystem_vendor
20085 +
20086 +#define BIG_PHONE_NUMBERS
20087 +#define COMPAT_HAS_ISA_IOREMAP
20088 +#define i_count_read(ic) atomic_read(&ic)
20089 +#define i_count_inc(ic) atomic_inc(&ic)
20090 +#define COMPAT_HAS_FILEOP_OWNER
20091 +#define COMPAT_HAVE_NEW_FILLDIR
20092 +#define COMPAT_has_fileops_in_inode
20093 +#define COMPAT_HAS_init_special_inode
20094 +#define COMPAT_d_alloc_root_one_parameter
20095 +#define HAVE_DEVFS_FS
20096 +#define COMPAT_HAS_SCHEDULE_TASK
20097 +#define COMPAT_HAS_USB_IDTAB
20098 +
20099 +#endif
20100 +
20101 +#endif /* ISDN_COMPAT_GENERIC */
20102 +
20103 +#ifdef COMPAT_HAS_2_2_PCI
20104 +#include <linux/pci.h>
20105 +#ifdef __powerpc__
20106 +static inline int pci_enable_device(struct pci_dev *dev)
20107 +{
20108 + u16 cmd;
20109 + pci_read_config_word(dev, PCI_COMMAND, &cmd);
20110 + cmd |= PCI_COMMAND_MEMORY | PCI_COMMAND_IO | PCI_COMMAND_SERR;
20111 + cmd &= ~PCI_COMMAND_FAST_BACK;
20112 + pci_write_config_word(dev, PCI_COMMAND, cmd);
20113 + return(0);
20114 +}
20115 +#else
20116 +static inline int pci_enable_device(struct pci_dev *dev)
20117 +{
20118 + return 0;
20119 +}
20120 +#endif /* __powerpc__ */
20121 +
20122 +#define PCI_ANY_ID (~0)
20123 +
20124 +/* as this is included multiple times, we make it inline */
20125 +
20126 +static inline struct pci_dev * pci_find_subsys(unsigned int vendor, unsigned int device,
20127 + unsigned int ss_vendor, unsigned int ss_device,
20128 + struct pci_dev *from)
20129 +{
20130 + unsigned short subsystem_vendor, subsystem_device;
20131 +
20132 + while ((from = pci_find_device(vendor, device, from))) {
20133 + pci_read_config_word(from, PCI_SUBSYSTEM_VENDOR_ID, &subsystem_vendor);
20134 + pci_read_config_word(from, PCI_SUBSYSTEM_ID, &subsystem_device);
20135 + if ((ss_vendor == PCI_ANY_ID || subsystem_vendor == ss_vendor) &&
20136 + (ss_device == PCI_ANY_ID || subsystem_device == ss_device))
20137 + return from;
20138 + }
20139 + return NULL;
20140 +}
20141 +#endif
20142 +
20143 +#ifdef COMPAT_NO_SOFTNET
20144 +#include <linux/netdevice.h>
20145 +
20146 +/*
20147 + * Tell upper layers that the network device is ready to xmit more frames.
20148 + */
20149 +static void __inline__ netif_wake_queue(struct net_device * dev)
20150 +{
20151 + dev->tbusy = 0;
20152 + mark_bh(NET_BH);
20153 +}
20154 +
20155 +/*
20156 + * called during net_device open()
20157 + */
20158 +static void __inline__ netif_start_queue(struct net_device * dev)
20159 +{
20160 + dev->tbusy = 0;
20161 + /* actually, we never use the interrupt flag at all */
20162 + dev->interrupt = 0;
20163 + dev->start = 1;
20164 +}
20165 +
20166 +/*
20167 + * Ask upper layers to temporarily cease passing us more xmit frames.
20168 + */
20169 +static void __inline__ netif_stop_queue(struct net_device * dev)
20170 +{
20171 + dev->tbusy = 1;
20172 +}
20173 +
20174 +#endif /* COMPAT_NO_SOFTNET */
20175 +
20176 +#ifndef COMPAT_HAS_NEW_WAITQ
20177 +typedef struct wait_queue wait_queue_t;
20178 +typedef struct wait_queue *wait_queue_head_t;
20179 +
20180 +#define DECLARE_WAITQUEUE(wait, current) struct wait_queue wait = { current, NULL }
20181 +#define DECLARE_WAIT_QUEUE_HEAD(wait) wait_queue_head_t wait
20182 +#define init_waitqueue_head(x) *(x)=NULL
20183 +#define init_waitqueue_entry(q,p) ((q)->task)=(p)
20184 +#endif /* COMPAT_HAS_NEW_WAITQ */
20185 +
20186 +#ifdef COMPAT_NEED_PCI_IDS
20187 +
20188 +#define PCI_ANY_ID (~0)
20189 +
20190 +#define PCI_VENDOR_ID_DYNALINK 0x0675
20191 +#define PCI_DEVICE_ID_DYNALINK_IS64PH 0x1702
20192 +
20193 +#define PCI_DEVICE_ID_WINBOND2_6692 0x6692
20194 +
20195 +#define PCI_DEVICE_ID_PLX_R685 0x1030
20196 +#define PCI_DEVICE_ID_PLX_DJINN_ITOO 0x1151
20197 +#define PCI_DEVICE_ID_PLX_R753 0x1152
20198 +
20199 +#define PCI_VENDOR_ID_ELSA 0x1048
20200 +#define PCI_DEVICE_ID_ELSA_MICROLINK 0x1000
20201 +#define PCI_DEVICE_ID_ELSA_QS3000 0x3000
20202 +
20203 +#define PCI_VENDOR_ID_EICON 0x1133
20204 +#define PCI_DEVICE_ID_EICON_DIVA20PRO 0xe001
20205 +#define PCI_DEVICE_ID_EICON_DIVA20 0xe002
20206 +#define PCI_DEVICE_ID_EICON_DIVA20PRO_U 0xe003
20207 +#define PCI_DEVICE_ID_EICON_DIVA20_U 0xe004
20208 +#define PCI_DEVICE_ID_EICON_DIVA201 0xe005
20209 +#define PCI_DEVICE_ID_EICON_MAESTRA 0xe010
20210 +#define PCI_DEVICE_ID_EICON_MAESTRAQ 0xe012
20211 +#define PCI_DEVICE_ID_EICON_MAESTRAQ_U 0xe013
20212 +#define PCI_DEVICE_ID_EICON_MAESTRAP 0xe014
20213 +
20214 +#define PCI_VENDOR_ID_CCD 0x1397
20215 +#define PCI_DEVICE_ID_CCD_2BD0 0x2BD0
20216 +#define PCI_DEVICE_ID_CCD_B000 0xB000
20217 +#define PCI_DEVICE_ID_CCD_B006 0xB006
20218 +#define PCI_DEVICE_ID_CCD_B007 0xB007
20219 +#define PCI_DEVICE_ID_CCD_B008 0xB008
20220 +#define PCI_DEVICE_ID_CCD_B009 0xB009
20221 +#define PCI_DEVICE_ID_CCD_B00A 0xB00A
20222 +#define PCI_DEVICE_ID_CCD_B00B 0xB00B
20223 +#define PCI_DEVICE_ID_CCD_B00C 0xB00C
20224 +#define PCI_DEVICE_ID_CCD_B100 0xB100
20225 +
20226 +#define PCI_VENDOR_ID_ASUSTEK 0x1043
20227 +#define PCI_DEVICE_ID_ASUSTEK_0675 0x0675
20228 +
20229 +#define PCI_VENDOR_ID_BERKOM 0x0871
20230 +#define PCI_DEVICE_ID_BERKOM_A1T 0xFFA1
20231 +#define PCI_DEVICE_ID_BERKOM_T_CONCEPT 0xFFA2
20232 +#define PCI_DEVICE_ID_BERKOM_A4T 0xFFA4
20233 +#define PCI_DEVICE_ID_BERKOM_SCITEL_QUADRO 0xFFA8
20234 +
20235 +#define PCI_DEVICE_ID_SATSAGEM_NICCY 0x1016
20236 +
20237 +#define PCI_DEVICE_ID_TIGERJET_100 0x0002
20238 +
20239 +#define PCI_VENDOR_ID_ANIGMA 0x1051
20240 +#define PCI_DEVICE_ID_ANIGMA_MC145575 0x0100
20241 +
20242 +#define PCI_VENDOR_ID_ZOLTRIX 0x15b0
20243 +#define PCI_DEVICE_ID_ZOLTRIX_2BD0 0x2BD0
20244 +
20245 +#define PCI_DEVICE_ID_DIGI_DF_M_IOM2_E 0x0070
20246 +#define PCI_DEVICE_ID_DIGI_DF_M_E 0x0071
20247 +#define PCI_DEVICE_ID_DIGI_DF_M_IOM2_A 0x0072
20248 +#define PCI_DEVICE_ID_DIGI_DF_M_A 0x0073
20249 +
20250 +#define PCI_DEVICE_ID_AVM_B1 0x0700
20251 +#define PCI_DEVICE_ID_AVM_C4 0x0800
20252 +#define PCI_DEVICE_ID_AVM_C2 0x1100
20253 +#define PCI_DEVICE_ID_AVM_T1 0x1200
20254 +
20255 +#define PCI_VENDOR_ID_HYPERCOPE 0x1365
20256 +#define PCI_DEVICE_ID_HYPERCOPE_PLX 0x9050
20257 +#define PCI_SUBDEVICE_ID_HYPERCOPE_OLD_ERGO 0x0104
20258 +#define PCI_SUBDEVICE_ID_HYPERCOPE_ERGO 0x0106
20259 +#define PCI_SUBDEVICE_ID_HYPERCOPE_METRO 0x0107
20260 +#define PCI_SUBDEVICE_ID_HYPERCOPE_CHAMP2 0x0108
20261 +#define PCI_SUBDEVICE_ID_HYPERCOPE_PLEXUS 0x0109
20262 +
20263 +#define PCI_VENDOR_ID_ABOCOM 0x13D1
20264 +#define PCI_DEVICE_ID_ABOCOM_2BD1 0x2BD1
20265 +
20266 +#endif /* COMPAT_NEED_PCI_IDS */
20267 +
20268 +#endif /* __KERNEL__ */
20269 +#endif /* _LINUX_ISDN_COMPAT_H */
20270 Index: linux-2.4.35.4/include/linux/isdn_divertif.h
20271 ===================================================================
20272 --- linux-2.4.35.4.orig/include/linux/isdn_divertif.h
20273 +++ linux-2.4.35.4/include/linux/isdn_divertif.h
20274 @@ -1,4 +1,4 @@
20275 -/* $Id: isdn_divertif.h,v 1.1.4.1 2001/11/20 14:19:38 kai Exp $
20276 +/* $Id$
20277 *
20278 * Header for the diversion supplementary interface for i4l.
20279 *
20280 @@ -14,7 +14,7 @@
20281 /***********************************************************/
20282 /* magic value is also used to control version information */
20283 /***********************************************************/
20284 -#define DIVERT_IF_MAGIC 0x25873401
20285 +#define DIVERT_IF_MAGIC 0x25873402
20286 #define DIVERT_CMD_REG 0x00 /* register command */
20287 #define DIVERT_CMD_REL 0x01 /* release command */
20288 #define DIVERT_NO_ERR 0x00 /* return value no error */
20289 @@ -34,6 +34,7 @@ typedef struct
20290 int (*ll_cmd)(isdn_ctrl *); /* supplied by hl on return */
20291 char * (*drv_to_name)(int); /* map a driver id to name, supplied by hl */
20292 int (*name_to_drv)(char *); /* map a driver id to name, supplied by hl */
20293 + int (*dial_net_name)(char *); /* force dial of a ll net interface */
20294 } isdn_divert_if;
20295
20296 /*********************/
20297 Index: linux-2.4.35.4/include/linux/isdn_dwabc.h
20298 ===================================================================
20299 --- /dev/null
20300 +++ linux-2.4.35.4/include/linux/isdn_dwabc.h
20301 @@ -0,0 +1,84 @@
20302 +/* $Id: isdn_dwabc.h,v 1.9 2001/09/26 20:32:08 detabc Exp $
20303 + *
20304 + * Header for the Linux ISDN abc-extension.
20305 + *
20306 + * Copyright by abc GmbH
20307 + * written by Detlef Wengorz <detlefw@isdn4linux.de>
20308 + *
20309 + * This software may be used and distributed according to the terms
20310 + * of the GNU General Public License, incorporated herein by reference.
20311 + *
20312 + */
20313 +
20314 +#ifndef ISDN_DWABC_H
20315 +#define ISDN_DWABC_H
20316 +
20317 +#ifdef __KERNEL__
20318 +#include <linux/types.h>
20319 +#include <linux/kernel.h>
20320 +#include <linux/sched.h>
20321 +#include <linux/smp.h>
20322 +#include <linux/spinlock.h>
20323 +#include <linux/errno.h>
20324 +
20325 +
20326 +typedef struct ISDN_DWSPINLOCK {
20327 +
20328 + spinlock_t spin;
20329 + short owner;
20330 + short my_flags;
20331 + ulong irq_flags;
20332 +
20333 +} ISDN_DWSPINLOCK;
20334 +
20335 +#define ISDN_DWSPIN_UNLOCKED \
20336 + (ISDN_DWSPINLOCK) { \
20337 + spin: SPIN_LOCK_UNLOCKED, \
20338 + owner: -1, \
20339 + my_flags: 0, \
20340 + irq_flags: 0, \
20341 + }
20342 +
20343 +#define ISDN_DWSPIN_INIT(x) \
20344 + do { *(x) = ISDN_DWSPIN_UNLOCKED; } while(0);
20345 +
20346 +static __inline__ int isdn_dwspin_trylock(ISDN_DWSPINLOCK *spin)
20347 +{
20348 + if(!spin_trylock(&spin->spin)) {
20349 +
20350 + if(spin->owner == smp_processor_id())
20351 + return(-EAGAIN);
20352 +
20353 + spin_lock(&spin->spin);
20354 + }
20355 +
20356 + spin->owner = smp_processor_id();
20357 + return(0);
20358 +}
20359 +
20360 +static __inline__ void isdn_dwspin_unlock(ISDN_DWSPINLOCK *spin)
20361 +{
20362 + spin->owner = -1;
20363 + spin_unlock(&spin->spin);
20364 +}
20365 +
20366 +
20367 +#else
20368 +#include <sys/types.h>
20369 +#endif
20370 +
20371 +#define DWABC_LCR_FLG_NEWNUMBER 0x00000001L
20372 +#define DWABC_LCR_FLG_DISABLE 0x00000002L
20373 +#define DWABC_LCR_FLG_NEWHUPTIME 0x00000004L
20374 +
20375 +
20376 +struct ISDN_DWABC_LCR_IOCTL {
20377 +
20378 + int lcr_ioctl_sizeof; /* mustbe sizeof(ISDN_DWABC_LCR_IOCTL) */
20379 + u_short lcr_ioctl_onhtime; /* new hanguptime */
20380 + u_long lcr_ioctl_callid; /* callid from lcr-subsystem */
20381 + u_long lcr_ioctl_flags; /* see above */
20382 + char lcr_ioctl_nr[32]; /* new destination phonenumber */
20383 +};
20384 +
20385 +#endif
20386 Index: linux-2.4.35.4/include/linux/isdn_lzscomp.h
20387 ===================================================================
20388 --- linux-2.4.35.4.orig/include/linux/isdn_lzscomp.h
20389 +++ linux-2.4.35.4/include/linux/isdn_lzscomp.h
20390 @@ -1,4 +1,4 @@
20391 -/* $Id: isdn_lzscomp.h,v 1.1.4.1 2001/11/20 14:19:38 kai Exp $
20392 +/* $Id$
20393 *
20394 * Header for isdn_lzscomp.c
20395 * Concentrated here to not mess up half a dozen kernel headers with code
20396 Index: linux-2.4.35.4/include/linux/isdn_ppp.h
20397 ===================================================================
20398 --- linux-2.4.35.4.orig/include/linux/isdn_ppp.h
20399 +++ linux-2.4.35.4/include/linux/isdn_ppp.h
20400 @@ -8,6 +8,7 @@
20401 #ifndef _LINUX_ISDN_PPP_H
20402 #define _LINUX_ISDN_PPP_H
20403
20404 +#include <linux/isdn_compat.h>
20405
20406 #define CALLTYPE_INCOMING 0x1
20407 #define CALLTYPE_OUTGOING 0x2
20408 @@ -33,6 +34,11 @@ struct pppcallinfo
20409 #define PPPIOCSCOMPRESSOR _IOW('t',135,int)
20410 #define PPPIOCGIFNAME _IOR('t',136, char [IFNAMSIZ] )
20411
20412 +#ifdef COMPAT_NEED_MPPP_DEFS
20413 +#define PPP_MP 0x003d
20414 +#define PPP_COMPFRAG 0x00fb
20415 +#define PPP_CCPFRAG 0x80fb
20416 +#endif
20417
20418 #define SC_MP_PROT 0x00000200
20419 #define SC_REJ_MP_PROT 0x00000400
20420 @@ -65,9 +71,6 @@ struct isdn_ppp_comp_data {
20421
20422 #include <linux/config.h>
20423
20424 -#ifdef CONFIG_IPPP_FILTER
20425 -#include <linux/filter.h>
20426 -#endif
20427
20428 #define DECOMP_ERR_NOMEM (-10)
20429
20430 @@ -226,10 +229,6 @@ struct ippp_struct {
20431 unsigned char *cbuf;
20432 struct slcompress *slcomp;
20433 #endif
20434 -#ifdef CONFIG_IPPP_FILTER
20435 - struct sock_fprog pass_filter; /* filter for packets to pass */
20436 - struct sock_fprog active_filter; /* filter for pkts to reset idle */
20437 -#endif
20438 unsigned long debug;
20439 struct isdn_ppp_compressor *compressor,*decompressor;
20440 struct isdn_ppp_compressor *link_compressor,*link_decompressor;
20441 Index: linux-2.4.35.4/include/linux/isdnif.h
20442 ===================================================================
20443 --- linux-2.4.35.4.orig/include/linux/isdnif.h
20444 +++ linux-2.4.35.4/include/linux/isdnif.h
20445 @@ -1,4 +1,4 @@
20446 -/* $Id: isdnif.h,v 1.1.4.1 2001/11/20 14:19:38 kai Exp $
20447 +/* $Id: isdnif.h,v 1.43 2002/02/09 21:19:11 keil Exp $
20448 *
20449 * Linux ISDN subsystem
20450 * Definition of the interface between the subsystem and its low-level drivers.
20451 @@ -14,6 +14,7 @@
20452 #ifndef __ISDNIF_H__
20453 #define __ISDNIF_H__
20454
20455 +#include <linux/isdn_compat.h>
20456
20457 /*
20458 * Values for general protocol-selection
20459 @@ -213,6 +214,8 @@ typedef struct
20460 #define ISDN_STAT_FAXIND 276 /* FAX indications from HL-driver */
20461 #define ISDN_STAT_AUDIO 277 /* DTMF, DSP indications */
20462 #define ISDN_STAT_DISCH 278 /* Disable/Enable channel usage */
20463 +#define ISDN_STAT_ALERT 279 /* Signal alerting */
20464 +#define ISDN_STAT_PROCEED 280 /* Signal proceeding */
20465
20466 /*
20467 * Audio commands
20468 Index: linux-2.4.35.4/include/linux/kernelcapi.h
20469 ===================================================================
20470 --- linux-2.4.35.4.orig/include/linux/kernelcapi.h
20471 +++ linux-2.4.35.4/include/linux/kernelcapi.h
20472 @@ -1,12 +1,10 @@
20473 -/* $Id: kernelcapi.h,v 1.1.4.2 2002/01/28 18:25:10 kai Exp $
20474 +/*
20475 + * $Id: kernelcapi.h,v 1.9 2000/11/28 09:34:02 kai Exp $
20476 *
20477 * Kernel CAPI 2.0 Interface for Linux
20478 *
20479 * (c) Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
20480 *
20481 - * This software may be used and distributed according to the terms
20482 - * of the GNU General Public License, incorporated herein by reference.
20483 - *
20484 */
20485
20486 #ifndef __KERNELCAPI_H__
This page took 0.838422 seconds and 5 git commands to generate.