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
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.
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
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
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 $
35 Description of the Interface between Linklevel and Hardwarelevel
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)
41 - ISDN_CMD_GETL2: (currently unused)
42 + ISDN_CMD_GETL3: (currently unused)
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)
52 + With this call, the HL-driver signals the receive of an ALERTING message to the LL.
56 + command = ISDN_STAT_ALERT
57 + arg = channel-number, locally to the driver. (starting with 0)
61 + With this call, the HL-driver signals the receive of an CALL PROCEEDING message
66 + command = ISDN_STAT_PROCEED
67 + arg = channel-number, locally to the driver. (starting with 0)
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
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 $
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
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
104 -Eicon Diva 2.0 ISA and PCI (S0 and U interface, no PRO version)
105 -Eicon Diva 2.01 ISA and PCI
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)
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
124 Winbond W6692 based cards
125 HFC-S+, HFC-SP/PCMCIA cards
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
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
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.
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.
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.
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.
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
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
168 modprobe hisax type=4 protocol=2 irq=10 io0=0x580 io1=0x180
170 - In the current version of HiSax, you can instead simply use
172 - modprobe hisax type=4 protocol=2
174 - if you configured your kernel for ISAPnP. Don't run isapnp in
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
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
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 $
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
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 $
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
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 $
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
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
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 $
239 You can get the ICN-ISDN-card from:
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
251 Index: linux-2.4.35.4/Documentation/isdn/abcext_kernel.help
252 ===================================================================
254 +++ linux-2.4.35.4/Documentation/isdn/abcext_kernel.help
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
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.
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.
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"
276 + Please Report Bugs to "mario@mediatronix.de" or
277 + "delefw@isdn4linux.de"
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.
285 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
286 + for more Information
288 + In most case answer with "Yes" when you have Callback devices,
289 + otherwise leave it "No"
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.
296 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
297 + for more Information
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
306 + So in most situations let the Option off.
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
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.
321 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
322 + for more Information
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
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.
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.
355 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
356 + for more Information
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.
366 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
367 + for more Information
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
375 + "linux/Documentation/isdn/dw-abc-extension-howto.txt"
376 + for more Information.
379 +CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP
381 + Sorry no more Information!
383 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
384 + for more Information
387 +CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL
389 + Sorry no more Information!
391 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
392 + for more Information
394 +Limit on the line frames to two
395 +CONFIG_ISDN_WITH_ABC_FRAME_LIMIT
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.
403 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
404 + for more Information
406 +Compression with RAWIP and X75I
407 +CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS
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.
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".
419 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
420 + for more Information
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
428 # only included if CONFIG_ISDN != n
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
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
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
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" ];
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
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
529 bool ' HiSax debugging' CONFIG_HISAX_DEBUG
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
543 + if [ "$CONFIG_HISAX_SEDLBAUER_CS" != "n" ]; then
544 + define_bool CONFIG_HISAX_SEDLBAUER y
546 + if [ "$CONFIG_HISAX_ELSA_CS" != "n" ]; then
547 + define_bool CONFIG_HISAX_ELSA y
549 + if [ "$CONFIG_HISAX_HFC_USB_CS" != "n" ]; then
550 + define_bool CONFIG_HISAX_HFC_USB y
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
561 # The target object and module list name.
563 -O_TARGET := vmlinux-obj.o
566 # Objects that export symbols.
568 @@ -32,9 +32,9 @@ obj-$(CONFIG_ISDN_PPP_BSDCOMP) += isdn_
570 # Object files in subdirectories
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
585 -/* $Id: act2000.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
588 * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
590 @@ -178,19 +178,19 @@ typedef struct act2000_card {
591 char regname[35]; /* Name used for request_region */
594 -static inline void act2000_schedule_tx(act2000_card *card)
595 +extern __inline__ void act2000_schedule_tx(act2000_card *card)
597 queue_task(&card->snd_tq, &tq_immediate);
598 mark_bh(IMMEDIATE_BH);
601 -static inline void act2000_schedule_rx(act2000_card *card)
602 +extern __inline__ void act2000_schedule_rx(act2000_card *card)
604 queue_task(&card->rcv_tq, &tq_immediate);
605 mark_bh(IMMEDIATE_BH);
608 -static inline void act2000_schedule_poll(act2000_card *card)
609 +extern __inline__ void act2000_schedule_poll(act2000_card *card)
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
618 -/* $Id: act2000_isa.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
621 * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000 (ISA-Version).
623 @@ -178,8 +178,7 @@ act2000_isa_config_port(act2000_card * c
624 card->flags &= ~ACT2000_FLAGS_PVALID;
626 if (!check_region(portbase, ISA_REGION)) {
627 - if (request_region(portbase, ACT2000_PORTLEN, card->regname) == NULL)
629 + request_region(portbase, ACT2000_PORTLEN, card->regname);
630 card->port = portbase;
631 card->flags |= ACT2000_FLAGS_PVALID;
633 @@ -341,6 +340,9 @@ act2000_isa_send(act2000_card * card)
635 if (act2000_isa_writeb(card, *(skb->data))) {
636 /* Fifo is full, but more data to send */
638 + printk(KERN_DEBUG "act2000_isa_send: %d bytes\n", l);
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)
648 + printk(KERN_DEBUG "act2000_isa_send: %d bytes\n", l);
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
658 -/* $Id: act2000_isa.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
661 * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000 (ISA-Version).
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
668 -/* $Id: capi.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
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"},
679 + {{ 0x05, 0x80}, "LISTEN_REQ (CAPI 2.0)"},
682 {{ 0x00, 0x00}, NULL},
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
689 -/* $Id: capi.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
692 * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
694 @@ -294,6 +294,19 @@ typedef struct actcapi_msg {
697 } select_b3_protocol_conf;
699 + struct listen_req {
704 + __u16 dummy; /* 2 Length-bytes of 2 Structs MUST always be 0!!! */
706 + struct listen_conf {
713 __u32 infomask __attribute__ ((packed));
714 @@ -304,6 +317,7 @@ typedef struct actcapi_msg {
716 __u16 info __attribute__ ((packed));
722 @@ -330,7 +344,7 @@ typedef struct actcapi_msg {
726 -static inline unsigned short
727 +extern __inline__ unsigned short
728 actcapi_nextsmsg(act2000_card *card)
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
736 -/* $Id: module.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
739 * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
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 |
746 +/* Not yet! New Firmware is on the way ... */
747 + ISDN_FEATURE_L2_TRANS |
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)
754 printk(KERN_INFO "%s unloaded\n", DRIVERNAME);
759 +act2000_setup(char *str, int *ints)
761 + int i, j, argc, port, irq, bus;
784 + act2000_addcard(bus, port, irq, act_id);
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
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 $
800 * A PCMCIA client driver for AVM B1/M1/M2
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
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 $
810 * Copyright 1999 by Carsten Paeth <calle@calle.de>
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
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 $
820 * Common module for AVM B1 cards.
823 #include <linux/kernelcapi.h>
825 #include <linux/init.h>
826 +#include <linux/isdn_compat.h>
827 #include <asm/uaccess.h>
828 #include <linux/netdevice.h>
832 #include "capiutil.h"
834 -static char *revision = "$Revision: 1.1.4.1 $";
835 +static char *revision = "$Revision: 1.26 $";
837 /* ------------------------------------------------------------- */
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
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 $
847 * Common module for AVM B1 cards that support dma with AMCC
850 #include <linux/kernelcapi.h>
852 #include <linux/init.h>
853 +#include <linux/isdn_compat.h>
854 #include <asm/uaccess.h>
855 #include <linux/netdevice.h>
859 #include "capiutil.h"
861 -static char *revision = "$Revision: 1.1.4.1 $";
862 +#if BITS_PER_LONG != 32
863 +#error FIXME: driver requires 32-bit platform
866 +static char *revision = "$Revision: 1.18 $";
868 /* ------------------------------------------------------------- */
870 @@ -851,7 +856,7 @@ int b1dmactl_read_proc(char *page, char
874 - u_long txaddr, txlen, rxaddr, rxlen, csr;
875 + __u32 txaddr, txlen, rxaddr, rxlen, csr;
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
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);
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);
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
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 $
904 * Module for AVM B1 ISA-card.
907 #include <linux/capi.h>
908 #include <linux/init.h>
910 +#include <linux/isdn_compat.h>
912 #include "capiutil.h"
916 -static char *revision = "$Revision: 1.1.4.1 $";
917 +static char *revision = "$Revision: 1.14 $";
919 /* ------------------------------------------------------------- */
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
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 $
929 * Module for AVM B1 PCI-card.
932 #include <linux/capi.h>
934 #include <linux/init.h>
935 +#include <linux/isdn_compat.h>
937 #include "capiutil.h"
941 -static char *revision = "$Revision: 1.1.4.1 $";
942 +static char *revision = "$Revision: 1.40 $";
944 /* ------------------------------------------------------------- */
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 */
952 MODULE_DEVICE_TABLE(pci, b1pci_pci_tbl);
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)
959 param.irq = dev->irq;
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;
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);
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)
979 - param.port = pci_resource_start(dev, 1);
980 + param.port = pci_resource_start_io(dev, 1);
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
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 $
992 * Module for AVM B1/M1/M2 PCMCIA-card.
998 -static char *revision = "$Revision: 1.1.4.1 $";
999 +static char *revision = "$Revision: 1.17 $";
1001 /* ------------------------------------------------------------- */
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
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 $
1011 * Module for AVM C4 & C2 card.
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>
1022 #include "capilli.h"
1023 #include "avmcard.h"
1025 -static char *revision = "$Revision: 1.1.4.1 $";
1026 +static char *revision = "$Revision: 1.38 $";
1028 #undef CONFIG_C4_DEBUG
1029 #undef CONFIG_C4_POLLDEBUG
1030 @@ -39,6 +40,7 @@ static char *revision = "$Revision: 1.1.
1032 static int suppress_pollack;
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[]
1041 MODULE_DEVICE_TABLE(pci, c4_pci_tbl);
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
1048 pci_set_master(dev);
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);
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
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 $
1066 * CAPI 2.0 Interface for Linux
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>
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>
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)
1099 -static char *revision = "$Revision: 1.1.4.2 $";
1100 +static char *revision = "$Revision: 1.59 $";
1102 MODULE_DESCRIPTION("CAPI4Linux: Userspace /dev/capi20 interface");
1103 MODULE_AUTHOR("Carsten Paeth");
1104 @@ -87,10 +93,10 @@ struct capiminor {
1105 struct capincci *nccip;
1118 struct tty_struct *tty;
1119 @@ -112,16 +118,22 @@ struct capiminor {
1121 struct datahandle_queue {
1122 struct datahandle_queue *next;
1128 +#ifdef CAPI_PPP_ON_RAW_DEVICE
1129 + /* interface to generic ppp layer */
1130 + struct ppp_channel chan;
1131 + int chan_connected;
1135 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1138 struct capincci *next;
1141 struct capidev *cdev;
1142 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1143 struct capiminor *minorp;
1144 @@ -131,8 +143,8 @@ struct capincci {
1146 struct capidev *next;
1155 @@ -156,22 +168,28 @@ static struct capidev *capidev_openlist
1156 static struct capiminor *minors = 0;
1157 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
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 */
1168 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1169 /* -------- datahandles --------------------------------------------- */
1171 -static int capincci_add_ack(struct capiminor *mp, u16 datahandle)
1172 +int capincci_add_ack(struct capiminor *mp, __u16 datahandle)
1174 struct datahandle_queue *n, **pp;
1176 n = (struct datahandle_queue *)
1177 +#ifdef COMPAT_HAS_kmem_cache
1178 kmem_cache_alloc(capidh_cachep, GFP_ATOMIC);
1180 + kmalloc(sizeof(struct datahandle_queue), GFP_ATOMIC);
1183 printk(KERN_ERR "capi: alloc datahandle failed\n");
1185 @@ -184,7 +202,7 @@ static int capincci_add_ack(struct capim
1189 -static int capiminor_del_ack(struct capiminor *mp, u16 datahandle)
1190 +int capiminor_del_ack(struct capiminor *mp, __u16 datahandle)
1192 struct datahandle_queue **pp, *p;
1194 @@ -192,7 +210,11 @@ static int capiminor_del_ack(struct capi
1195 if ((*pp)->datahandle == datahandle) {
1198 +#ifdef COMPAT_HAS_kmem_cache
1199 kmem_cache_free(capidh_cachep, p);
1206 @@ -200,7 +222,7 @@ static int capiminor_del_ack(struct capi
1210 -static void capiminor_del_all_ack(struct capiminor *mp)
1211 +void capiminor_del_all_ack(struct capiminor *mp)
1213 struct datahandle_queue **pp, *p;
1215 @@ -208,7 +230,11 @@ static void capiminor_del_all_ack(struct
1219 +#ifdef COMPAT_HAS_kmem_cache
1220 kmem_cache_free(capidh_cachep, p);
1227 @@ -216,13 +242,17 @@ static void capiminor_del_all_ack(struct
1229 /* -------- struct capiminor ---------------------------------------- */
1231 -static struct capiminor *capiminor_alloc(u16 applid, u32 ncci)
1232 +struct capiminor *capiminor_alloc(__u16 applid, __u32 ncci)
1234 struct capiminor *mp, **pp;
1235 unsigned int minor = 0;
1238 +#ifdef COMPAT_HAS_kmem_cache
1239 mp = (struct capiminor *)kmem_cache_alloc(capiminor_cachep, GFP_ATOMIC);
1241 + mp = (struct capiminor *)kmalloc(sizeof(struct capiminor), GFP_ATOMIC);
1245 printk(KERN_ERR "capi: can't alloc capiminor\n");
1246 @@ -257,7 +287,7 @@ static struct capiminor *capiminor_alloc
1250 -static void capiminor_free(struct capiminor *mp)
1251 +void capiminor_free(struct capiminor *mp)
1253 struct capiminor **pp;
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);
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
1271 -static struct capiminor *capiminor_find(unsigned int minor)
1272 +struct capiminor *capiminor_find(unsigned int minor)
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(
1278 /* -------- struct capincci ----------------------------------------- */
1280 -static struct capincci *capincci_alloc(struct capidev *cdev, u32 ncci)
1281 +static struct capincci *capincci_alloc(struct capidev *cdev, __u32 ncci)
1283 struct capincci *np, **pp;
1284 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1285 @@ -302,7 +336,11 @@ static struct capincci *capincci_alloc(s
1287 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1289 +#ifdef COMPAT_HAS_kmem_cache
1290 np = (struct capincci *)kmem_cache_alloc(capincci_cachep, GFP_ATOMIC);
1292 + np = (struct capincci *)kmalloc(sizeof(struct capincci), GFP_ATOMIC);
1296 memset(np, 0, sizeof(struct capincci));
1297 @@ -331,7 +369,7 @@ static struct capincci *capincci_alloc(s
1301 -static void capincci_free(struct capidev *cdev, u32 ncci)
1302 +static void capincci_free(struct capidev *cdev, __u32 ncci)
1304 struct capincci *np, **pp;
1305 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1306 @@ -367,7 +405,11 @@ static void capincci_free(struct capidev
1309 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1310 +#ifdef COMPAT_HAS_kmem_cache
1311 kmem_cache_free(capincci_cachep, np);
1315 if (*pp == 0) return;
1318 @@ -375,7 +417,7 @@ static void capincci_free(struct capidev
1322 -static struct capincci *capincci_find(struct capidev *cdev, u32 ncci)
1323 +struct capincci *capincci_find(struct capidev *cdev, __u32 ncci)
1327 @@ -393,7 +435,11 @@ static struct capidev *capidev_alloc(str
1328 struct capidev *cdev;
1329 struct capidev **pp;
1331 +#ifdef COMPAT_HAS_kmem_cache
1332 cdev = (struct capidev *)kmem_cache_alloc(capidev_cachep, GFP_KERNEL);
1334 + cdev = (struct capidev *)kmalloc(sizeof(struct capidev), GFP_KERNEL);
1338 memset(cdev, 0, sizeof(struct capidev));
1339 @@ -423,10 +469,14 @@ static void capidev_free(struct capidev
1343 +#ifdef COMPAT_HAS_kmem_cache
1344 kmem_cache_free(capidev_cachep, cdev);
1350 -static struct capidev *capidev_find(u16 applid)
1351 +static struct capidev *capidev_find(__u16 applid)
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 --------------------------------------- */
1359 -static struct sk_buff *
1361 gen_data_b3_resp_for(struct capiminor *mp, struct sk_buff *skb)
1363 struct sk_buff *nskb;
1364 nskb = alloc_skb(CAPI_DATA_B3_RESP_LEN, GFP_ATOMIC);
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
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)
1378 struct sk_buff *nskb;
1379 unsigned int datalen;
1380 - u16 errcode, datahandle;
1381 + __u16 errcode, datahandle;
1383 datalen = skb->len - CAPIMSG_LEN(skb->data);
1385 @@ -504,6 +554,28 @@ static int handle_recv_skb(struct capimi
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");
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",
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);
1408 + ppp_input(&mp->chan, skb);
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
1418 -static void handle_minor_recv(struct capiminor *mp)
1419 +void handle_minor_recv(struct capiminor *mp)
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
1427 -static int handle_minor_send(struct capiminor *mp)
1428 +int handle_minor_send(struct capiminor *mp)
1430 struct sk_buff *skb;
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
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 -------------------------- */
1463 -static void capi_signal(u16 applid, void *param)
1464 +static void capi_signal(__u16 applid, void *param)
1466 struct capidev *cdev = (struct capidev *)param;
1467 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1468 struct capiminor *mp;
1471 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1472 struct capincci *np;
1473 struct sk_buff *skb = 0;
1477 (void) (*capifuncs->capi_get_message) (applid, &skb);
1479 @@ -683,6 +755,12 @@ static void capi_signal(u16 applid, void
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);
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;
1499 if (ppos != &file->f_pos)
1501 @@ -998,7 +1076,7 @@ capi_ioctl(struct inode *inode, struct f
1505 - nccip = capincci_find(cdev, (u32) ncci);
1506 + nccip = capincci_find(cdev, (__u32) ncci);
1509 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1510 @@ -1023,7 +1101,7 @@ capi_ioctl(struct inode *inode, struct f
1514 - nccip = capincci_find(cdev, (u32) ncci);
1515 + nccip = capincci_find(cdev, (__u32) ncci);
1516 if (!nccip || (mp = nccip->minorp) == 0)
1519 @@ -1070,7 +1148,9 @@ capi_release(struct inode *inode, struct
1521 static struct file_operations capi_fops =
1523 +#ifdef COMPAT_HAS_FILEOP_OWNER
1529 @@ -1233,6 +1313,45 @@ capinc_raw_ioctl(struct inode *inode, st
1533 +#ifdef CAPI_PPP_ON_RAW_DEVICE
1534 + case PPPIOCATTACH:
1537 + if (get_user(val, (int *) arg))
1539 + if (mp->chan_connected)
1541 + mp->chan.private = mp;
1545 + mp->chan.ops = &ppp_ops;
1548 + retval = ppp_register_channel(&mp->chan, val);
1551 + mp->chan_connected = 1;
1552 + mp->chan_index = val;
1555 + case PPPIOCDETACH:
1557 + if (!mp->chan_connected)
1559 + ppp_unregister_channel(&mp->chan);
1560 + mp->chan_connected = 0;
1565 + if (!mp->chan_connected)
1567 + if (put_user(mp->chan_index, (int *) arg))
1575 @@ -1260,7 +1379,9 @@ capinc_raw_release(struct inode *inode,
1577 static struct file_operations capinc_raw_fops =
1579 +#ifdef COMPAT_HAS_FILEOP_OWNER
1583 read: capinc_raw_read,
1584 write: capinc_raw_write,
1585 @@ -1272,7 +1393,7 @@ static struct file_operations capinc_raw
1587 /* -------- tty_operations for capincci ----------------------------- */
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)
1592 struct capiminor *mp;
1594 @@ -1300,7 +1421,7 @@ static int capinc_tty_open(struct tty_st
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)
1601 struct capiminor *mp;
1603 @@ -1325,8 +1446,8 @@ static void capinc_tty_close(struct tty_
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)
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
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)
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
1627 -static void capinc_tty_flush_chars(struct tty_struct *tty)
1628 +void capinc_tty_flush_chars(struct tty_struct *tty)
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);
1636 -static int capinc_tty_write_room(struct tty_struct *tty)
1637 +int capinc_tty_write_room(struct tty_struct *tty)
1639 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1641 @@ -1458,7 +1579,7 @@ static int capinc_tty_write_room(struct
1645 -static int capinc_tty_chars_in_buffer(struct tty_struct *tty)
1646 +int capinc_tty_chars_in_buffer(struct tty_struct *tty)
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;
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)
1659 @@ -1488,14 +1609,14 @@ static int capinc_tty_ioctl(struct tty_s
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)
1666 #ifdef _DEBUG_TTYFUNCS
1667 printk(KERN_DEBUG "capinc_tty_set_termios\n");
1671 -static void capinc_tty_throttle(struct tty_struct * tty)
1672 +void capinc_tty_throttle(struct tty_struct * tty)
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
1680 -static void capinc_tty_unthrottle(struct tty_struct * tty)
1681 +void capinc_tty_unthrottle(struct tty_struct * tty)
1683 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1684 #ifdef _DEBUG_TTYFUNCS
1685 @@ -1517,7 +1638,7 @@ static void capinc_tty_unthrottle(struct
1689 -static void capinc_tty_stop(struct tty_struct *tty)
1690 +void capinc_tty_stop(struct tty_struct *tty)
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
1698 -static void capinc_tty_start(struct tty_struct *tty)
1699 +void capinc_tty_start(struct tty_struct *tty)
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_
1707 -static void capinc_tty_hangup(struct tty_struct *tty)
1708 +void capinc_tty_hangup(struct tty_struct *tty)
1710 #ifdef _DEBUG_TTYFUNCS
1711 printk(KERN_DEBUG "capinc_tty_hangup\n");
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)
1718 #ifdef _DEBUG_TTYFUNCS
1719 printk(KERN_DEBUG "capinc_tty_break_ctl(%d)\n", state);
1723 -static void capinc_tty_flush_buffer(struct tty_struct *tty)
1724 +void capinc_tty_flush_buffer(struct tty_struct *tty)
1726 #ifdef _DEBUG_TTYFUNCS
1727 printk(KERN_DEBUG "capinc_tty_flush_buffer\n");
1731 -static void capinc_tty_set_ldisc(struct tty_struct *tty)
1732 +void capinc_tty_set_ldisc(struct tty_struct *tty)
1734 #ifdef _DEBUG_TTYFUNCS
1735 printk(KERN_DEBUG "capinc_tty_set_ldisc\n");
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)
1742 #ifdef _DEBUG_TTYFUNCS
1743 printk(KERN_DEBUG "capinc_tty_send_xchar(%d)\n", ch);
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)
1755 +int capinc_write_proc(struct file *file, const char *buffer,
1756 + unsigned long count, void *data)
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];
1764 -static int capinc_tty_init(void)
1765 +int capinc_tty_init(void)
1767 struct tty_driver *drv = &capinc_tty_driver;
1769 @@ -1646,7 +1773,7 @@ static int capinc_tty_init(void)
1773 -static void capinc_tty_exit(void)
1774 +void capinc_tty_exit(void)
1776 struct tty_driver *drv = &capinc_tty_driver;
1778 @@ -1771,8 +1898,9 @@ static void __exit proc_exit(void)
1780 /* -------- init function and module interface ---------------------- */
1782 +#ifdef COMPAT_HAS_kmem_cache
1784 -static void alloc_exit(void)
1785 +static void __exit alloc_exit(void)
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 */
1795 -static void lower_callback(unsigned int cmd, u32 contr, void *data)
1796 +static void lower_callback(unsigned int cmd, __u32 contr, void *data)
1798 struct capi_ncciinfo *np;
1799 struct capidev *cdev;
1800 @@ -1900,15 +2029,19 @@ static int __init capi_init(void)
1804 +#ifdef HAVE_DEVFS_FS
1805 devfs_register_series (NULL, "capi/r%u", CAPINC_NR_PORTS,
1808 S_IFCHR | S_IRUSR | S_IWUSR,
1809 &capinc_raw_fops, NULL);
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,
1817 printk(KERN_NOTICE "capi20: started up with major %d\n", capi_major);
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",
1827 DEVFS_SPECIAL_CHR, 0));
1832 @@ -1934,8 +2069,10 @@ static int __init capi_init(void)
1834 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1836 +#ifdef COMPAT_HAS_kmem_cache
1837 if (alloc_init() < 0) {
1838 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1839 +#ifdef HAVE_DEVFS_FS
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));
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",
1855 DEVFS_SPECIAL_CHR, 0));
1860 +#endif /* COMPAT_HAS_kmem_cache */
1864 @@ -1975,23 +2116,31 @@ static int __init capi_init(void)
1865 static void __exit capi_exit(void)
1867 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1868 +#ifdef HAVE_DEVFS_FS
1872 +#ifdef COMPAT_HAS_kmem_cache
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));
1882 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1884 devfs_unregister_chrdev(capi_rawmajor, "capi/r%d");
1885 +#ifdef HAVE_DEVFS_FS
1886 for (j = 0; j < CAPINC_NR_PORTS; j++) {
1888 sprintf(devname, "capi/r%u", j);
1889 devfs_unregister(devfs_find_handle(NULL, devname, capi_rawmajor, j, DEVFS_SPECIAL_CHR, 0));
1893 (void) detach_capi_interface(&cuser);
1894 printk(KERN_NOTICE "capi: Rev %s: unloaded\n", rev);
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
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 $
1904 * CAPI 2.0 Interface for Linux
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
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 $
1914 * CAPI 2.0 Interface for Linux
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
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 $
1924 * ISDN4Linux Driver, using capi20 interface (kernelcapi)
1927 #include "capicmd.h"
1928 #include "capidrv.h"
1930 -static char *revision = "$Revision: 1.1.4.1 $";
1931 +static char *revision = "$Revision: 1.45 $";
1932 static int debugmode = 0;
1934 MODULE_DESCRIPTION("CAPI4Linux: Interface to ISDN4Linux");
1935 @@ -105,7 +105,6 @@ struct capidrv_contr {
1940 struct ncci_datahandle_queue {
1941 struct ncci_datahandle_queue *next;
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;
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)
1954 struct ncci_datahandle_queue *n, **pp;
1955 - unsigned long flags;
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
1961 n->datahandle = datahandle;
1963 - spin_lock_irqsave(&nccip->lock, flags);
1964 for (pp = &nccip->ackqueue; *pp; pp = &(*pp)->next) ;
1966 - spin_unlock_irqrestore(&nccip->lock, flags);
1970 static int capidrv_del_ack(struct capidrv_ncci *nccip, __u16 datahandle)
1972 struct ncci_datahandle_queue **pp, *p;
1973 - unsigned long flags;
1976 - spin_lock_irqsave(&nccip->lock, flags);
1977 for (pp = &nccip->ackqueue; *pp; pp = &(*pp)->next) {
1978 if ((*pp)->datahandle == datahandle) {
1982 - spin_unlock_irqrestore(&nccip->lock, flags);
1987 - spin_unlock_irqrestore(&nccip->lock, flags);
1991 @@ -523,25 +514,13 @@ static int capidrv_del_ack(struct capidr
1993 static void send_message(capidrv_contr * card, _cmsg * cmsg)
1995 - struct sk_buff *skb;
1999 + struct sk_buff *skb;
2001 capi_cmsg2message(cmsg, cmsg->buf);
2002 len = CAPIMSG_LEN(cmsg->buf);
2003 skb = alloc_skb(len, GFP_ATOMIC);
2005 - printk(KERN_ERR "no skb len(%d) memory\n", len);
2008 memcpy(skb_put(skb, len), cmsg->buf, len);
2009 - err = (*capifuncs->capi_put_message) (global.appid, skb);
2011 - printk(KERN_WARNING "%s: capi_put_message error: %04x\n",
2012 - __FUNCTION__, err);
2016 + (*capifuncs->capi_put_message) (global.appid, skb);
2017 global.nsentctlpkt++;
2020 @@ -1932,8 +1911,10 @@ static int if_sendbuf(int id, int channe
2021 (void)capidrv_del_ack(nccip, datahandle);
2025 printk(KERN_DEBUG "capidrv-%d: only %d bytes headroom, need %d\n",
2026 card->contrnr, skb_headroom(skb), msglen);
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);
2036 +static void disable_dchannel_trace(capidrv_contr *card)
2038 + __u8 manufacturer[CAPI_MANUFACTURER_LEN];
2039 + capi_version version;
2040 + __u16 contr = card->contrnr;
2042 + __u16 avmversion[3];
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);
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);
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);
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;
2066 + if (avmversion[0] > 3 || (avmversion[0] == 3 && avmversion[1] > 5)) {
2067 + printk(KERN_INFO "%s: D2 trace disabled\n", card->name);
2069 + printk(KERN_INFO "%s: D3 trace disabled\n", card->name);
2071 + capi_fill_MANUFACTURER_REQ(&cmdcmsg, global.appid,
2074 + 0x214D5641, /* ManuID */
2077 + (_cstruct)"\004\000\000\000\000");
2078 + send_message(card, &cmdcmsg);
2082 static void send_listen(capidrv_contr *card)
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");
2092 - if (card->plci_list)
2093 - printk(KERN_ERR "capidrv: bug in free_plci()\n");
2094 kfree(card->bchans);
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
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 $
2105 * ISDN4Linux Driver, using capi20 interface (kernelcapi)
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
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 $
2115 * Copyright 2000 by Carsten Paeth <calle@calle.de>
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>
2125 @@ -32,7 +33,7 @@ MODULE_DESCRIPTION("CAPI4Linux: /dev/cap
2126 MODULE_AUTHOR("Carsten Paeth");
2127 MODULE_LICENSE("GPL");
2129 -static char *revision = "$Revision: 1.1.4.1 $";
2130 +static char *revision = "$Revision: 1.22 $";
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);
2142 static struct file_operations capifs_root_operations = {
2143 +#ifdef COMPAT_VFS_2_4
2144 read: generic_read_dir,
2146 readdir: capifs_root_readdir,
2149 struct inode_operations capifs_root_inode_operations = {
2150 +#ifndef COMPAT_VFS_2_4
2151 + default_file_ops: &capifs_root_operations, /* file operations */
2153 lookup: capifs_root_lookup,
2156 @@ -101,12 +109,20 @@ static int capifs_root_readdir(struct fi
2160 +#ifdef COMPAT_VFS_2_4
2161 if (filldir(dirent, ".", 1, nr, inode->i_ino, DT_DIR) < 0)
2163 + if (filldir(dirent, ".", 1, nr, inode->i_ino) < 0)
2169 +#ifdef COMPAT_VFS_2_4
2170 if (filldir(dirent, "..", 2, nr, inode->i_ino, DT_DIR) < 0)
2172 + if (filldir(dirent, "..", 2, nr, inode->i_ino) < 0)
2177 @@ -118,7 +134,11 @@ static int capifs_root_readdir(struct fi
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 )
2184 + if ( filldir(dirent, numbuf, strlen(numbuf), nr, nr) < 0 )
2189 @@ -180,7 +200,7 @@ static struct dentry *capifs_root_lookup
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);
2196 d_add(dentry, dentry->d_inode);
2198 @@ -199,9 +219,9 @@ static void capifs_put_super(struct supe
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));
2210 @@ -213,11 +233,24 @@ static void capifs_put_super(struct supe
2214 +#ifndef COMPAT_VFS_2_4
2215 + MOD_DEC_USE_COUNT;
2219 +#ifdef COMPAT_VFS_2_4
2220 static int capifs_statfs(struct super_block *sb, struct statfs *buf);
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);
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,
2232 put_super: capifs_put_super,
2233 statfs: capifs_statfs,
2235 @@ -288,6 +321,10 @@ struct super_block *capifs_read_super(st
2236 struct dentry * root;
2237 struct capifs_sb_info *sbi;
2239 +#ifndef COMPAT_VFS_2_4
2240 + MOD_INC_USE_COUNT;
2243 /* Super block already completed? */
2246 @@ -322,6 +359,7 @@ struct super_block *capifs_read_super(st
2248 * Get the root inode and dentry, but defer checking for errors.
2250 +#ifdef COMPAT_VFS_2_4
2251 root_inode = capifs_new_inode(s);
2253 root_inode->i_ino = 1;
2254 @@ -331,6 +369,10 @@ struct super_block *capifs_read_super(st
2255 root_inode->i_nlink = 2;
2257 root = d_alloc_root(root_inode);
2259 + root_inode = iget(s, 1); /* inode 1 == root directory */
2260 + root = d_alloc_root(root_inode, NULL);
2264 * Check whether somebody else completed the super block.
2265 @@ -370,11 +412,34 @@ struct super_block *capifs_read_super(st
2268 out: /* Success ... somebody else completed the super block for us. */
2269 +#ifndef COMPAT_VFS_2_4
2274 +#ifndef COMPAT_VFS_2_4
2276 + MOD_DEC_USE_COUNT;
2281 +#ifndef COMPAT_VFS_2_4
2282 +static int capifs_statfs(struct super_block *sb, struct statfs *buf, int bufsiz)
2284 + struct statfs tmp;
2286 + tmp.f_type = CAPIFS_SUPER_MAGIC;
2287 + tmp.f_bsize = 1024;
2293 + tmp.f_namelen = NAME_MAX;
2294 + return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0;
2297 static int capifs_statfs(struct super_block *sb, struct statfs *buf)
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;
2306 +#ifdef COMPAT_VFS_2_4
2307 static struct inode *capifs_new_inode(struct super_block *sb)
2309 struct inode *inode = new_inode(sb);
2310 @@ -399,8 +466,51 @@ static struct inode *capifs_new_inode(st
2315 +static void capifs_read_inode(struct inode *inode)
2317 + ino_t ino = inode->i_ino;
2318 + struct capifs_sb_info *sbi = SBI(inode->i_sb);
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;
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;
2335 + if ( ino >= sbi->max_ncci )
2336 + return; /* Bogus */
2338 +#ifdef COMPAT_VFS_2_4
2339 + init_special_inode(inode, S_IFCHR, 0);
2341 + inode->i_mode = S_IFCHR;
2342 + inode->i_op = &chrdev_inode_operations;
2349 +#ifndef COMPAT_VFS_2_4
2350 +static struct file_system_type capifs_fs_type = {
2353 + capifs_read_super,
2357 static DECLARE_FSTYPE(capifs_fs_type, "capifs", capifs_read_super, 0);
2360 void capifs_new_ncci(char type, unsigned int num, kdev_t device)
2362 @@ -421,16 +531,26 @@ void capifs_new_ncci(char type, unsigned
2366 +#ifdef COMPAT_VFS_2_4
2367 if ( ino >= sbi->max_ncci )
2370 if ((np->inode = capifs_new_inode(sb)) != NULL) {
2372 + if ((np->inode = iget(sb, ino+2)) != NULL) {
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
2379 inode->i_ino = ino + 2;
2380 init_special_inode(inode, sbi->mode|S_IFCHR, np->kdev);
2382 + inode->i_mode = sbi->mode | S_IFCHR;
2383 + inode->i_rdev = np->kdev;
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
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 $
2397 * Copyright 2000 by Carsten Paeth <calle@calle.de>
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
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 $
2407 * Kernel CAPI 2.0 Driver Interface for Linux
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
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 $
2417 * CAPI 2.0 convert capi message to capi message struct
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"
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
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 $
2435 * CAPI 2.0 defines & types
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
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 $
2445 * Kernel CAPI 2.0 Module
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>
2456 #include <linux/b1lli.h>
2459 -static char *revision = "$Revision: 1.1.4.1 $";
2460 +static char *revision = "$Revision: 1.28 $";
2462 /* ------------------------------------------------------------- */
2464 @@ -64,7 +65,6 @@ struct capi_ncci {
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);
2481 #define NCCI2CTRL(ncci) (((ncci) >> 24) & 0x7f)
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)
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.
2494 +#ifdef COMPAT_HAS_SCHEDULE_TASK
2496 if (schedule_task(&tq_state_notify) == 0)
2499 + queue_task(&tq_state_notify, &tq_scheduler);
2504 @@ -546,13 +550,7 @@ static int notify_push(unsigned int cmd,
2505 static void notify_up(__u32 contr)
2507 struct capi_interface_user *p;
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);
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)
2522 +#ifdef COMPAT_HAS_SCHEDULE_TASK
2527 /* -------- NCCI Handling ------------------------------------- */
2528 @@ -647,7 +647,6 @@ static void notify_handler(void *dummy)
2529 static inline void mq_init(struct capi_ncci * np)
2532 - np->lock = SPIN_LOCK_UNLOCKED;
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)
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)
2546 np->msgidfree = mq->next;
2549 @@ -676,14 +672,12 @@ static inline int mq_enqueue(struct capi
2550 if (!np->msgidqueue)
2551 np->msgidqueue = mq;
2553 - spin_unlock_bh(&np->lock);
2557 static inline int mq_dequeue(struct capi_ncci * np, __u16 msgid)
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;
2568 - spin_unlock_bh(&np->lock);
2572 - spin_unlock_bh(&np->lock);
2576 @@ -720,16 +712,12 @@ static void controllercb_appl_released(s
2577 nextpp = &(*pp)->next;
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);
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);
2599 @@ -882,7 +870,16 @@ error:
2601 static void controllercb_ready(struct capi_ctr * card)
2605 card->cardstate = CARD_RUNNING;
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);
2613 printk(KERN_NOTICE "kcapi: card %d \"%s\" ready.\n",
2614 CARDNR(card), card->name);
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
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 $
2624 * Module for AVM T1 HEMA-card.
2627 #include <linux/capi.h>
2628 #include <linux/kernelcapi.h>
2629 #include <linux/init.h>
2630 +#include <linux/isdn_compat.h>
2632 #include "capicmd.h"
2633 #include "capiutil.h"
2634 #include "capilli.h"
2635 #include "avmcard.h"
2637 -static char *revision = "$Revision: 1.1.4.1 $";
2638 +static char *revision = "$Revision: 1.22 $";
2640 /* ------------------------------------------------------------- */
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
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 $
2650 * Module for AVM T1 PCI-card.
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>
2661 #include "capilli.h"
2662 #include "avmcard.h"
2664 -static char *revision = "$Revision: 1.1.4.1 $";
2665 +static char *revision = "$Revision: 1.25 $";
2667 #undef CONFIG_T1PCI_DEBUG
2668 #undef CONFIG_T1PCI_POLLDEBUG
2670 /* ------------------------------------------------------------- */
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 */
2678 MODULE_DEVICE_TABLE(pci, t1pci_pci_tbl);
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)
2685 pci_set_master(dev);
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);
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
2700 -/* $Id: divert_procfs.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
2703 * Filesystem handling for the diversion supplementary services.
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>
2712 #ifdef CONFIG_PROC_FS
2713 #include <linux/proc_fs.h>
2715 #include <linux/fs.h>
2717 #include <linux/isdnif.h>
2718 +#include <linux/isdn_compat.h>
2719 #include "isdn_divert.h"
2721 /*********************************/
2722 @@ -80,7 +83,6 @@ static ssize_t
2723 isdn_divert_read(struct file *file, char *buf, size_t count, loff_t * off)
2725 struct divert_info *inf;
2726 - loff_t pos = *off;
2729 if (!*((struct divert_info **) file->private_data)) {
2730 @@ -92,11 +94,11 @@ isdn_divert_read(struct file *file, char
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))
2740 + file->f_pos += len;
2744 @@ -136,17 +138,23 @@ isdn_divert_open(struct inode *ino, stru
2746 unsigned long flags;
2748 +#ifdef COMPAT_USE_MODCOUNT_LOCK
2749 + MOD_INC_USE_COUNT;
2756 if (divert_info_head)
2757 - filep->private_data = &(divert_info_tail->next);
2758 + (struct divert_info **) filep->private_data = &(divert_info_tail->next);
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
2768 } /* isdn_divert_open */
2770 @@ -159,7 +167,9 @@ isdn_divert_close(struct inode *ino, str
2771 struct divert_info *inf;
2772 unsigned long flags;
2774 +#ifndef COMPAT_USE_MODCOUNT_LOCK
2780 @@ -175,7 +185,11 @@ isdn_divert_close(struct inode *ino, str
2781 divert_info_head = divert_info_head->next;
2784 +#ifdef COMPAT_USE_MODCOUNT_LOCK
2785 + MOD_DEC_USE_COUNT;
2790 } /* isdn_divert_close */
2792 @@ -276,6 +290,9 @@ static struct file_operations isdn_fops
2793 open: isdn_divert_open,
2794 release: isdn_divert_close,
2796 +#ifdef COMPAT_NO_SOFTNET
2797 +struct inode_operations divert_file_inode_operations;
2800 /****************************/
2801 /* isdn subdir in /proc/net */
2802 @@ -302,8 +319,16 @@ divert_dev_init(void)
2803 remove_proc_entry("isdn", proc_net);
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;
2811 isdn_divert_entry->proc_fops = &isdn_fops;
2812 +#ifdef COMPAT_HAS_FILEOP_OWNER
2813 isdn_divert_entry->owner = THIS_MODULE;
2815 +#endif /* COMPAT_NO_SOFTNET */
2816 #endif /* CONFIG_PROC_FS */
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
2824 -/* $Id: isdn_divert.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
2827 * DSS1 main diversion supplementary handling for i4l.
2829 @@ -84,6 +84,9 @@ static void deflect_timer_expire(ulong a
2830 restore_flags(flags);
2833 + case NETWORK_DIAL:
2834 + divert_if.dial_net_name(cs->deflect_dest);
2836 case DEFLECT_AUTODEL:
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)
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;
2857 sprintf(cs->info,"%d 0x%lx %s %s %s %s 0x%x 0x%x %d %d %s\n",
2859 @@ -739,6 +748,18 @@ int prot_stat_callback(isdn_ctrl *ic)
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);
2873 + put_info_buffer(st);
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
2883 -/* $Id: isdn_divert.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
2886 * Header for the diversion supplementary ioctl interface.
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 */
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
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
2915 #include "adapter.h"
2918 +#include <linux/isdn_compat.h>
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)
2930 - if (card->state == DIA_RUNNING)
2931 - DivaDoCardDpc(card);
2933 + DivaDoCardDpc(card++);
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
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 $
2945 * ISDN low-level module for Eicon active ISDN-Cards.
2947 @@ -347,19 +347,19 @@ typedef struct eicon_card {
2948 extern char *eicon_ctype_name[];
2951 -static inline void eicon_schedule_tx(eicon_card *card)
2952 +extern __inline__ void eicon_schedule_tx(eicon_card *card)
2954 queue_task(&card->snd_tq, &tq_immediate);
2955 mark_bh(IMMEDIATE_BH);
2958 -static inline void eicon_schedule_rx(eicon_card *card)
2959 +extern __inline__ void eicon_schedule_rx(eicon_card *card)
2961 queue_task(&card->rcv_tq, &tq_immediate);
2962 mark_bh(IMMEDIATE_BH);
2965 -static inline void eicon_schedule_ack(eicon_card *card)
2966 +extern __inline__ void eicon_schedule_ack(eicon_card *card)
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
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 $
2978 * ISDN lowlevel-module for Eicon active cards.
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
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 $
2988 * ISDN lowlevel-module for Eicon active cards.
2992 #undef EICON_FULL_SERVICE_OKTETT
2994 -char *eicon_idi_revision = "$Revision: 1.1.4.1 $";
2995 +char *eicon_idi_revision = "$Revision: 1.45 $";
2997 eicon_manifbuf *manbuf;
2999 @@ -1583,6 +1583,37 @@ idi_faxdata_rcv(eicon_card *ccard, eicon
3004 + eicon_sff_dochead *doc = (eicon_sff_dochead *)skb->data;
3005 + eicon_sff_pagehead *page = (eicon_sff_pagehead *)skb->data + sizeof(eicon_sff_dochead);
3007 + printk(KERN_DEBUG"SFF: doc %d / page %d (skb : %d)\n",
3008 + sizeof(eicon_sff_dochead),
3009 + sizeof(eicon_sff_pagehead), skb->len);
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);
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);
3036 if (chan->fax->direction == ISDN_TTY_FAX_CONN_IN) {
3037 @@ -2054,8 +2085,7 @@ idi_faxdata_send(eicon_card *ccard, eico
3041 - *(__u16 *) OutBuf.Next = (__u16) LineBuf.Len;
3042 - OutBuf.Next += sizeof(__u16);
3043 + *((__u16 *) OutBuf.Next)++ = (__u16) LineBuf.Len;
3046 memcpy(OutBuf.Next, LineBuf.Data, LineBuf.Len);
3047 @@ -2385,6 +2415,12 @@ idi_handle_ind(eicon_card *ccard, struct
3050 idi_do_req(ccard, chan, REMOVE, 1);
3052 + if (chan->e.D3Id) {
3053 + idi_do_req(ccard, chan, REMOVE, 0);
3054 + idi_do_req(ccard, chan, ASSIGN, 0);
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
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 $
3068 * ISDN lowlevel-module for the Eicon active cards.
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
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 $
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
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 $
3088 * ISDN low-level module for Eicon active ISDN-Cards.
3089 * Hardware-specific code for old ISA cards.
3091 #define release_shmem release_region
3092 #define request_shmem request_region
3094 -char *eicon_isa_revision = "$Revision: 1.1.4.1 $";
3095 +char *eicon_isa_revision = "$Revision: 1.18 $";
3097 #undef EICON_MCA_DEBUG
3099 @@ -38,8 +38,12 @@ static int eicon_isa_valid_irq[] = {
3101 eicon_isa_release_shmem(eicon_isa_card *card) {
3103 +#ifdef COMPAT_HAS_ISA_IOREMAP
3104 iounmap(card->shmem);
3105 release_mem_region(card->physmem, card->ramsize);
3107 + release_shmem((unsigned long)card->shmem, card->ramsize);
3112 @@ -94,12 +98,20 @@ eicon_isa_find_card(int Mem, int Irq, ch
3116 +#ifdef COMPAT_HAS_ISA_IOREMAP
3117 if (check_mem_region(Mem, RAMSIZE)) {
3119 + if (check_shmem(Mem, RAMSIZE)) {
3121 printk(KERN_WARNING "eicon_isa_boot: memory at 0x%x already in use.\n", Mem);
3125 +#ifdef COMPAT_HAS_ISA_IOREMAP
3126 amem = (unsigned long) ioremap(Mem, RAMSIZE);
3128 + amem = (unsigned long) Mem;
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
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);
3140 return EICON_CTYPE_ISAPRI;
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);
3147 return EICON_CTYPE_ISABRI;
3150 @@ -151,6 +167,7 @@ eicon_isa_bootload(eicon_isa_card *card,
3152 card->ramsize = RAMSIZE;
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",
3158 @@ -159,6 +176,16 @@ eicon_isa_bootload(eicon_isa_card *card,
3160 request_mem_region(card->physmem, card->ramsize, "Eicon ISA ISDN");
3161 card->shmem = (eicon_isa_shmem *) ioremap(card->physmem, card->ramsize);
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);
3170 + request_shmem((unsigned long)card->shmem, card->ramsize, "Eicon ISA ISDN");
3172 #ifdef EICON_MCA_DEBUG
3173 printk(KERN_INFO "eicon_isa_boot: card->ramsize = %d.\n", card->ramsize);
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
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 $
3183 * ISDN low-level module for Eicon active ISDN-Cards.
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
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 $
3193 * ISDN lowlevel-module for Eicon active cards.
3196 static eicon_card *cards = (eicon_card *) NULL; /* glob. var , contains
3197 start of card-list */
3199 -static char *eicon_revision = "$Revision: 1.1.4.1 $";
3200 +static char *eicon_revision = "$Revision: 1.44 $";
3202 extern char *eicon_pci_revision;
3203 extern char *eicon_isa_revision;
3204 @@ -639,6 +639,18 @@ if_command(isdn_ctrl * c)
3206 if_writecmd(const u_char * buf, int len, int user, int id, int channel)
3209 + /* Not yet used */
3210 + eicon_card *card = eicon_findcard(id);
3213 + if (!card->flags & EICON_FLAGS_RUNNING)
3218 + "eicon: if_writecmd called with invalid driverId!\n");
3223 @@ -665,11 +677,8 @@ if_readstatus(u_char * buf, int len, int
3228 - spin_unlock_irqrestore(&eicon_lock, flags);
3230 copy_to_user(p, skb->data, cnt);
3231 - spin_lock_irqsave(&eicon_lock, flags);
3234 memcpy(p, skb->data, cnt);
3236 @@ -1459,6 +1468,7 @@ eicon_exit(void)
3240 +#ifdef COMPAT_HAS_NEW_SETUP
3242 eicon_setup(char *line)
3244 @@ -1467,6 +1477,12 @@ eicon_setup(char *line)
3247 str = get_options(line, 4, ints);
3250 +eicon_setup(char *str, int *ints)
3257 @@ -1494,9 +1510,13 @@ eicon_setup(char *line)
3259 printk(KERN_INFO "Eicon ISDN active driver setup\n");
3261 +#ifdef COMPAT_HAS_NEW_SETUP
3264 __setup("eicon=", eicon_setup);
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
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 $
3279 * ISDN low-level module for Eicon active ISDN-Cards.
3280 * Hardware-specific code for PCI cards.
3282 #include "adapter.h"
3285 -char *eicon_pci_revision = "$Revision: 1.1.4.1 $";
3286 +char *eicon_pci_revision = "$Revision: 1.18 $";
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
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 $
3298 * ISDN low-level module for Eicon active ISDN-Cards (PCI part).
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)
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
3319 #include "divalog.h"
3323 + * Implementation of printf and sprintf for kernel
3326 +#define MAX_BUFF (80) /* limit size of temporary buffers */
3328 +#define WRITE_CHAR(BUFFER, SIZE, C) \
3329 + if (--(SIZE) < 0) { (BUFFER)--; *(BUFFER) = '\0'; return; } *(BUFFER)++ = (C)
3333 + * convert a number to decimal ASCII
3337 +void do_decimal( char *temp,
3339 + unsigned int value,
3347 + for (i = 1; i < temp_len; i++)
3349 + temp[i] = (char) ((value % 10) + (int) '0');
3353 + for (i = (temp_len - 1); temp[i] == '0'; i--)
3372 + * convert a number to octal ASCII
3376 +void do_octal( char *temp,
3377 + unsigned int value,
3385 + for (i = 1; i <= 11; i++)
3387 + temp[i] = (char) ((value & 07) + (int) '0');
3392 + for (i = 11; temp[i] == '0'; i--)
3411 + * convert a number to hex ASCII
3415 +void do_hex( char *temp,
3416 + unsigned int value,
3422 + char *dec_to_hex = "0123456789abcdef";
3426 + for (i = 1; i <= 8; i++)
3428 + temp[i] = dec_to_hex[value & 0x0f];
3432 + for (i = 8; temp[i] == '0'; i--)
3451 + * convert a buffer to ASCII HEX
3455 +void do_buffer( char *buffer,
3461 + char hex_char [] = "0123456789abcdef";
3466 + length = (length >= ((MAX_BUFF / 3) + 1)) ? (MAX_BUFF / 3) : length;
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];
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
3489 +void Divas_vsprintf( char *buffer,
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 */
3509 + char *buff_ptr; /* pointer to user's buffer of hex data */
3510 + int buff_len; /* length of hex data */
3512 + /* make sure we have somthing to write into */
3514 + if ((!buffer) || (size <= 0))
3521 + /* echo characters until end or '%' encountered */
3523 + while ((c = *fmt++) != '%')
3530 + WRITE_CHAR(buffer, size, c);
3533 + /* echo %% as % */
3537 + WRITE_CHAR(buffer, size, *fmt);
3541 + /* %- turns on left-justify */
3543 + if ((leftjust = (boolean_t) ((*fmt == '-') ? TRUE : FALSE)))
3548 + /* %0 turns on zero filling */
3559 + /* minium field width specifier for %d, u, x, c, s */
3565 + fmin = va_arg(argptr, int);
3570 + while ('0' <= *fmt && *fmt <= '9')
3572 + fmin = (fmin * 10) + (*fmt++ - '0');
3576 + /* maximum string width specifier for %s */
3582 + if (*(++fmt) == '*')
3584 + fmax = va_arg(argptr, int);
3589 + while ('0' <= *fmt && *fmt <= '9')
3591 + fmax = (fmax * 10) + (*fmt++ - '0');
3596 + /* skip over 'l' option (ints are assumed same size as longs) */
3603 + /* get the format chacater */
3605 + if (!(f = *fmt++))
3607 + WRITE_CHAR(buffer, size, '%');
3612 + sign = '\0'; /* sign == '-' for negative decimal */
3619 + string[0] = (char) va_arg(argptr, int);
3626 + str = va_arg(argptr, char *);
3632 + number = va_arg(argptr, int);
3638 + do_decimal(temp, DIM(temp), (unsigned int) number, str);
3644 + number = va_arg(argptr, int);
3645 + do_decimal(temp, DIM(temp), (unsigned int) number, str);
3651 + number = va_arg(argptr, int);
3652 + do_octal(temp, (unsigned int) number, str);
3658 + number = va_arg(argptr, int);
3659 + do_hex(temp, (unsigned int) number, str);
3665 + buff_ptr = va_arg(argptr, char *);
3666 + buff_len = va_arg(argptr, int);
3667 + do_buffer(buff_ptr, buff_len, str);
3672 + WRITE_CHAR(buffer, size, ((char) f));
3676 + /* get the length of the string */
3679 + while (str[length])
3684 + /* make sure we have fmax and fmin values that are O.K. */
3686 + if (fmin > DIM(string) || fmin < 0)
3691 + if (fmax > DIM(string) || fmax < 0)
3696 + /* figure out how many leading characters thare are */
3704 + if (length > fmax)
3712 + leading = fmin - length;
3721 + /* output sign now, if fill is numeric */
3723 + if (sign == '-' && fill == '0')
3725 + WRITE_CHAR(buffer, size, '-');
3728 + /* if right justified, output fill characters */
3732 + for (i = 0; i < leading; i++)
3734 + WRITE_CHAR(buffer, size, fill);
3738 + /* output sign now, if fill is spaces */
3740 + if (sign == '-' && fill == ' ')
3742 + WRITE_CHAR(buffer, size, '-');
3745 + /* now the actual value */
3747 + for (i = 0; i < length; i++)
3749 + WRITE_CHAR(buffer, size, str[i]);
3752 + /* if left justified, fill out with the fill character */
3756 + for (i = 0; i < leading; i++)
3758 + WRITE_CHAR(buffer, size, fill);
3765 + * sprintf for kernel
3767 + * call our vsprintf assuming user has a big buffer....
3770 +void DivasSprintf(char *buffer, char *fmt, ...)
3773 + va_list argptr; /* pointer to additional args */
3775 + va_start(argptr, fmt);
3777 + Divas_vsprintf(buffer, 1024, fmt, argptr);
3784 void DivasPrintf(char *fmt, ...)
3787 @@ -40,7 +502,7 @@ void DivasPrintf(char *fmt, ...)
3789 /* call vsprintf to format the user's information */
3791 - vsnprintf(log.buffer, DIM(log.buffer), fmt, argptr);
3792 + Divas_vsprintf(log.buffer, DIM(log.buffer), fmt, argptr);
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
3803 #include <linux/pci.h>
3804 +#ifndef COMPAT_HAS_2_2_PCI
3805 +#include <linux/pci_ids.h>
3807 #include <linux/kernel.h>
3808 #include <linux/ioport.h>
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
3817 if (BufferSize < sizeof(klog_t))
3819 + printk(KERN_WARNING "Divas: Divalog buffer specifed a size that is too small (%d - %d required)\n",
3820 + BufferSize, sizeof(klog_t));
3824 pHeadItem = (klog_t *) DivasLogFifoRead();
3828 - if(copy_to_user(pClientLogBuffer, pHeadItem, sizeof(klog_t)))
3833 + memcpy(pClientLogBuffer, pHeadItem, sizeof(klog_t));
3835 return sizeof(klog_t);
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
3842 #include <linux/slab.h>
3843 #include <linux/pci.h>
3844 #include <linux/delay.h>
3845 +#include <linux/isdn_compat.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
3855 O_TARGET := vmlinux-obj.o
3857 -# Define maximum number of cards
3859 -EXTRA_CFLAGS += -DHISAX_MAX_CARDS=$(CONFIG_HISAX_MAX_CARDS)
3861 # Objects that export symbols.
3863 -export-objs := config.o hisax_isac.o isdnhdlc.o
3864 +export-objs := config.o fsm.o hisax_isac.o
3866 # Multipart objects.
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 \
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
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
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 ===================================================================
3919 +++ linux-2.4.35.4/drivers/isdn/hisax/amd7930.c
3921 +/* $Id: amd7930.c,v 1.8 2001/09/24 13:22:55 kai Exp $
3923 + * HiSax ISDN driver - chip specific routines for AMD 7930
3925 + * Author Brent Baccala
3926 + * Copyright by Brent Baccala <baccala@FreeSoft.org>
3928 + * This software may be used and distributed according to the terms
3929 + * of the GNU General Public License, incorporated herein by reference.
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
3939 + * The code is unreliable enough to be consider alpha
3941 + * This file is (c) under GNU General Public License
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.
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.
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.
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.
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
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.
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
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.
4013 +#define __NO_VERSION__
4015 +#include "../../sbus/audio/amd7930.h"
4017 +#include "isdnl1.h"
4018 +#include "rawhdlc.h"
4019 +#include <linux/interrupt.h>
4021 +static const char *amd7930_revision = "$Revision: 1.8 $";
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) */
4027 +static void Bchan_fill_fifo(struct BCState *, struct sk_buff *);
4030 +Bchan_xmt_bh(struct BCState *bcs)
4032 + struct sk_buff *skb;
4034 + if (bcs->hw.amd7930.tx_skb != NULL) {
4035 + dev_kfree_skb(bcs->hw.amd7930.tx_skb);
4036 + bcs->hw.amd7930.tx_skb = NULL;
4039 + if ((skb = skb_dequeue(&bcs->squeue))) {
4040 + Bchan_fill_fifo(bcs, skb);
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);
4050 +Bchan_xmit_callback(struct BCState *bcs)
4052 + queue_task(&bcs->hw.amd7930.tq_xmt, &tq_immediate);
4053 + mark_bh(IMMEDIATE_BH);
4056 +/* B channel transmission: two modes (three, if you count L1_MODE_NULL)
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
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
4071 +Bchan_fill_fifo(struct BCState *bcs, struct sk_buff *skb)
4073 + struct IsdnCardState *cs = bcs->cs;
4076 + if ((cs->debug & L1_DEB_HSCX) || (cs->debug & L1_DEB_HSCX_FIFO)) {
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);
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);
4091 + amd7930_bxmit(0, bcs->channel,
4092 + bcs->hw.amd7930.tx_buff, len,
4093 + (void *) &Bchan_xmit_callback,
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,
4101 + bcs->hw.amd7930.tx_skb = skb;
4103 + dev_kfree_skb(skb);
4108 +Bchan_mode(struct BCState *bcs, int mode, int bc)
4110 + struct IsdnCardState *cs = bcs->cs;
4112 + if (cs->debug & L1_DEB_HSCX) {
4114 + sprintf(tmp, "AMD 7930 mode %d bchan %d/%d",
4115 + mode, bc, bcs->channel);
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.
4130 +Bchan_l2l1(struct PStack *st, int pr, void *arg)
4132 + struct sk_buff *skb = arg;
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);
4139 + test_and_set_bit(BC_FLG_BUSY, &st->l1.bcs->Flag);
4140 + Bchan_fill_fifo(st->l1.bcs, skb);
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");
4148 + test_and_set_bit(BC_FLG_BUSY, &st->l1.bcs->Flag);
4149 + Bchan_fill_fifo(st->l1.bcs, skb);
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);
4156 + set_bit(FLG_L1_PULL_REQ, &st->l1.Flags);
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
4171 +Bchan_recv_callback(struct BCState *bcs)
4173 + struct amd7930_hw *hw = &bcs->hw.amd7930;
4175 + hw->rv_buff_in += RCV_BUFSIZE/RCV_BUFBLKS;
4176 + hw->rv_buff_in %= RCV_BUFSIZE;
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);
4185 + queue_task(&hw->tq_rcv, &tq_immediate);
4186 + mark_bh(IMMEDIATE_BH);
4190 +Bchan_rcv_bh(struct BCState *bcs)
4192 + struct IsdnCardState *cs = bcs->cs;
4193 + struct amd7930_hw *hw = &bcs->hw.amd7930;
4194 + struct sk_buff *skb;
4197 + if (cs->debug & L1_DEB_HSCX) {
4200 + sprintf(tmp, "amd7930_Bchan_rcv (%d/%d)",
4201 + hw->rv_buff_in, hw->rv_buff_out);
4203 + QuickHex(tmp, hw->rv_buff + hw->rv_buff_out,
4204 + RCV_BUFSIZE/RCV_BUFBLKS);
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)) {
4217 + t += sprintf(t, "amd7930_Bchan_rcv %c cnt %d", bcs->channel ? 'B' : 'A', len);
4218 + QuickHex(t, hw->rv_skb->tail, len);
4222 + if (len > HSCX_BUFMAX/2) {
4223 + /* Large packet received */
4225 + if (!(skb = dev_alloc_skb(HSCX_BUFMAX))) {
4226 + printk(KERN_WARNING "amd7930: receive out of memory");
4228 + skb_put(hw->rv_skb, len);
4229 + skb_queue_tail(&bcs->rqueue, hw->rv_skb);
4231 + bcs->event |= 1 << B_RCVBUFREADY;
4232 + queue_task(&bcs->tqueue, &tq_immediate);
4234 + } else if (len > 0) {
4235 + /* Small packet received */
4237 + if (!(skb = dev_alloc_skb(len))) {
4238 + printk(KERN_WARNING "amd7930: receive out of memory\n");
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);
4247 + /* Reception Error */
4248 + /* printk("amd7930: B channel receive error\n"); */
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");
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);
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,
4274 + hw->rv_buff_out += RCV_BUFSIZE/RCV_BUFBLKS;
4275 + hw->rv_buff_out %= RCV_BUFSIZE;
4277 + } while (hw->rv_buff_in != hw->rv_buff_out);
4281 +Bchan_close(struct BCState *bcs)
4283 + struct sk_buff *skb;
4285 + Bchan_mode(bcs, 0, 0);
4286 + amd7930_bclose(0, bcs->channel);
4288 + if (test_bit(BC_FLG_INIT, &bcs->Flag)) {
4289 + skb_queue_purge(&bcs->rqueue);
4290 + skb_queue_purge(&bcs->squeue);
4292 + test_and_clear_bit(BC_FLG_INIT, &bcs->Flag);
4296 +Bchan_open(struct BCState *bcs)
4298 + struct amd7930_hw *hw = &bcs->hw.amd7930;
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);
4304 + test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag);
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);
4321 +Bchan_init(struct BCState *bcs)
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");
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");
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");
4338 + if (!(bcs->hw.amd7930.hdlc_state = kmalloc(sizeof(struct hdlc_state),
4340 + printk(KERN_WARNING
4341 + "HiSax: No memory for amd7930.hdlc_state\n");
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;
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;
4355 +Bchan_manl1(struct PStack *st, int 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);
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);
4373 +setstack_amd7930(struct PStack *st, struct BCState *bcs)
4375 + if (Bchan_open(bcs))
4378 + st->l2.l2l1 = Bchan_l2l1;
4379 + st->ma.manl1 = Bchan_manl1;
4380 + setstack_manager(st);
4387 +amd7930_drecv_callback(void *arg, int error, unsigned int count)
4389 + struct IsdnCardState *cs = (struct IsdnCardState *) arg;
4390 + static struct tq_struct task;
4391 + struct sk_buff *skb;
4393 + /* NOTE: This function is called directly from an interrupt handler */
4396 + if (!(skb = alloc_skb(count, GFP_ATOMIC)))
4397 + printk(KERN_WARNING "HiSax: D receive out of memory\n");
4399 + memcpy(skb_put(skb, count), cs->rcvbuf, count);
4400 + skb_queue_tail(&cs->rq, skb);
4403 + task.routine = (void *) DChannel_proc_rcv;
4404 + task.data = (void *) cs;
4405 + queue_task(&task, &tq_immediate);
4406 + mark_bh(IMMEDIATE_BH);
4409 + if (cs->debug & L1_DEB_ISAC_FIFO) {
4413 + t += sprintf(t, "amd7930 Drecv cnt %d", count);
4414 + if (error) t += sprintf(t, " ERR %x", error);
4415 + QuickHex(t, cs->rcvbuf, count);
4419 + amd7930_drecv(0, cs->rcvbuf, MAX_DFRAME_LEN,
4420 + &amd7930_drecv_callback, cs);
4424 +amd7930_dxmit_callback(void *arg, int error)
4426 + struct IsdnCardState *cs = (struct IsdnCardState *) arg;
4427 + static struct tq_struct task;
4429 + /* NOTE: This function is called directly from an interrupt handler */
4431 + /* may wish to do retransmission here, if error indicates collision */
4433 + if (cs->debug & L1_DEB_ISAC_FIFO) {
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);
4443 + cs->tx_skb = NULL;
4445 + task.routine = (void *) DChannel_proc_xmt;
4446 + task.data = (void *) cs;
4447 + queue_task(&task, &tq_immediate);
4448 + mark_bh(IMMEDIATE_BH);
4452 +amd7930_Dchan_l2l1(struct PStack *st, int pr, void *arg)
4454 + struct IsdnCardState *cs = (struct IsdnCardState *) st->l1.hardware;
4455 + struct sk_buff *skb = arg;
4459 + case (PH_DATA_REQ):
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);
4467 + if ((cs->dlogflag) && (!(skb->data[2] & 1))) {
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,
4476 +#ifdef L2FRAME_DEBUG /* psa */
4477 + if (cs->debug & L1_DEB_LAPD)
4478 + Logl2Frame(cs, skb, "PH_DATA", 0);
4480 + amd7930_dxmit(0, skb->data, skb->len,
4481 + &amd7930_dxmit_callback, cs);
4484 + case (PH_PULL_IND):
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);
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,
4499 +#ifdef L2FRAME_DEBUG /* psa */
4500 + if (cs->debug & L1_DEB_LAPD)
4501 + Logl2Frame(cs, skb, "PH_DATA_PULLED", 0);
4503 + amd7930_dxmit(0, cs->tx_skb->data, cs->tx_skb->len,
4504 + &amd7930_dxmit_callback, cs);
4506 + case (PH_PULL_REQ):
4507 +#ifdef L2FRAME_DEBUG /* psa */
4508 + if (cs->debug & L1_DEB_LAPD)
4509 + debugl1(cs, "-> PH_REQUEST_PULL");
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);
4515 + test_and_set_bit(FLG_L1_PULL_REQ, &st->l1.Flags);
4521 +setDstack_amd7930(struct PStack *st, struct IsdnCardState *cs)
4523 + st->l2.l2l1 = amd7930_Dchan_l2l1;
4524 + if (! cs->rcvbuf) {
4525 + printk("setDstack_amd7930: No cs->rcvbuf!\n");
4527 + amd7930_drecv(0, cs->rcvbuf, MAX_DFRAME_LEN,
4528 + &amd7930_drecv_callback, cs);
4534 +manl1_msg(struct IsdnCardState *cs, int msg, void *arg) {
4535 + struct PStack *st;
4539 + st->ma.manl1(st, msg, arg);
4545 +amd7930_new_ph(struct IsdnCardState *cs)
4547 + switch (amd7930_get_liu_state(0)) {
4549 + manl1_msg(cs, PH_POWERUP_CNF, NULL);
4553 + manl1_msg(cs, PH_I4_P8_IND, NULL);
4557 + manl1_msg(cs, PH_RSYNC_IND, NULL);
4562 +/* amd7930 LIU state change callback */
4565 +amd7930_liu_callback(struct IsdnCardState *cs)
4567 + static struct tq_struct task;
4572 + if (cs->debug & L1_DEB_ISAC) {
4574 + sprintf(tmp, "amd7930_liu state %d", amd7930_get_liu_state(0));
4579 + task.routine = (void *) &amd7930_new_ph;
4580 + task.data = (void *) cs;
4581 + queue_task(&task, &tq_immediate);
4582 + mark_bh(IMMEDIATE_BH);
4586 +amd7930_l1cmd(struct IsdnCardState *cs, int msg, void *arg)
4591 + if (cs->debug & L1_DEB_ISAC) {
4593 + sprintf(tmp, "amd7930_l1cmd msg %x", msg);
4598 + case PH_RESET_REQ:
4599 + if (amd7930_get_liu_state(0) <= 3)
4600 + amd7930_liu_activate(0,0);
4602 + amd7930_liu_deactivate(0);
4604 + case PH_ENABLE_REQ:
4606 + case PH_INFO3_REQ:
4607 + amd7930_liu_activate(0,0);
4609 + case PH_TESTLOOP_REQ:
4612 + if (cs->debug & L1_DEB_WARN) {
4613 + sprintf(tmp, "amd7930_l1cmd unknown %4x", msg);
4620 +static void init_amd7930(struct IsdnCardState *cs)
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);
4633 +release_amd7930(struct IsdnCardState *cs)
4638 +amd7930_card_msg(struct IsdnCardState *cs, int mt, void *arg)
4643 + case CARD_RELEASE:
4644 + release_amd7930(cs);
4647 + cs->l1cmd = amd7930_l1cmd;
4648 + amd7930_liu_init(0, &amd7930_liu_callback, (void *)cs);
4658 +setup_amd7930(struct IsdnCard *card)
4660 + struct IsdnCardState *cs = card->cs;
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)
4668 + cs->irq = amd7930_get_irqnum(0);
4672 + cs->cardmsg = &amd7930_card_msg;
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
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 $
4684 * Ansteuerung ARCOFI 2165
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
4691 -/* $Id: arcofi.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4694 * Ansteuerung ARCOFI 2165
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
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 $
4704 * low level stuff for ASUSCOM NETWORK INC. ISDNLink cards
4708 #define __NO_VERSION__
4709 #include <linux/init.h>
4710 -#include <linux/isapnp.h>
4716 extern const char *CardType[];
4718 -const char *Asuscom_revision = "$Revision: 1.1.4.1 $";
4719 +const char *Asuscom_revision = "$Revision: 1.14 $";
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,
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" },
4744 -static struct isapnp_device_id *adev = &asus_ids[0];
4745 -static struct pci_bus *pnp_c __devinitdata = NULL;
4749 setup_asuscom(struct IsdnCard *card)
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)
4756 - if (!card->para[1] && isapnp_present()) {
4757 - struct pci_bus *pb;
4758 - struct pci_dev *pd;
4760 - while(adev->card_vendor) {
4761 - if ((pb = isapnp_find_card(adev->card_vendor,
4762 - adev->card_device, pnp_c))) {
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);
4770 - pd->deactivate(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);
4782 - printk(KERN_ERR "AsusPnP: PnP error card found, no device\n");
4788 - if (!adev->card_vendor) {
4789 - printk(KERN_INFO "AsusPnP: no ISAPnP card found\n");
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
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 $
4806 * low level stuff for AVM A1 (Fritz) isdn cards
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 $";
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
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 $
4825 * low level stuff for the following AVM cards:
4828 #define byteout(addr,val) outb(val,addr)
4829 #define bytein(addr) inb(addr)
4831 -static const char *avm_revision = "$Revision: 1.1.4.1 $";
4832 +static const char *avm_revision = "$Revision: 2.9 $";
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
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 $
4844 * low level stuff for AVM Fritz!PCI and ISA PnP isdn cards
4849 #include <linux/pci.h>
4850 -#include <linux/isapnp.h>
4851 +#include <linux/isdn_compat.h>
4852 #include <linux/interrupt.h>
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 $";
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");
4864 - p = bcs->hw.hdlc.rcvbuf + bcs->hw.hdlc.rcvidx;
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)
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;
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
4883 static struct pci_dev *dev_avm __initdata = NULL;
4885 -static struct pci_bus *bus_avm __initdata = NULL;
4886 -static struct pci_dev *pnp_avm __initdata = NULL;
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)
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;
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))) {
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;
4917 - pnp_avm->irq_resource[0].start;
4919 - printk(KERN_ERR "FritzPnP:No IRQ\n");
4920 - pnp_avm->deactivate(pnp_avm);
4923 - if (!cs->hw.avm.cfg_reg) {
4924 - printk(KERN_ERR "FritzPnP:No IO address\n");
4925 - pnp_avm->deactivate(pnp_avm);
4928 - cs->subtyp = AVM_FRITZ_PNP;
4933 - printk(KERN_INFO "FritzPnP: no ISA PnP present\n");
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)
4941 if (pci_enable_device(dev_avm))
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");
4948 @@ -854,7 +811,6 @@ setup_avm_pcipnp(struct IsdnCard *card)
4950 #endif /* CONFIG_PCI */
4953 cs->hw.avm.isac = cs->hw.avm.cfg_reg + 0x10;
4954 if (check_region((cs->hw.avm.cfg_reg), 32)) {
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
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 $
4964 * low level stuff for T-Berkom A4T
4969 #include <linux/pci.h>
4970 +#include <linux/isdn_compat.h>
4973 extern const char *CardType[];
4975 -const char *bkm_a4t_revision = "$Revision: 1.1.4.1 $";
4976 +const char *bkm_a4t_revision = "$Revision: 1.22 $";
4979 static inline u_char
4980 @@ -293,13 +294,13 @@ setup_bkm_a4t(struct IsdnCard *card)
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))
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;
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
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 $
5005 * low level stuff for Scitel Quadro (4*S0, passive)
5010 #include <linux/pci.h>
5011 +#include <linux/isdn_compat.h>
5017 extern const char *CardType[];
5019 -const char sct_quadro_revision[] = "$Revision: 1.1.4.1 $";
5020 +const char sct_quadro_revision[] = "$Revision: 1.22 $";
5022 static const char *sct_quadro_subtypes[] =
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))) {
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))
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;
5048 #endif /* End HACK */
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
5055 -/* $Id: bkm_ax.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
5058 * low level decls for T-Berkom cards A4T and Scitel Quadro (4*S0, passive)
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
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 $
5068 * Author Karsten Keil
5069 * Copyright by Karsten Keil <keil@isdn4linux.de>
5071 #define MOD_USE_COUNT ( GET_USE_COUNT (&__this_module))
5074 -const char *lli_revision = "$Revision: 1.1.4.1 $";
5075 +const char *lli_revision = "$Revision: 2.59 $";
5077 extern struct IsdnCard cards[];
5079 @@ -145,9 +145,11 @@ enum {
5080 EV_PROCEED, /* 20 */
5083 + EV_ALERTING, /* 23 */
5084 + EV_PROCEEDING, /* 24 */
5087 -#define EVENT_COUNT (EV_REDIR + 1)
5088 +#define EVENT_COUNT (EV_PROCEEDING + 1)
5090 static char *strEvent[] =
5092 @@ -174,6 +176,8 @@ static char *strEvent[] =
5101 @@ -286,6 +290,22 @@ lli_prep_dialout(struct FsmInst *fi, int
5105 +lli_alerting(struct FsmInst *fi, int event, void *arg)
5107 + struct Channel *chanp = fi->userdata;
5109 + HL_LL(chanp, ISDN_STAT_ALERT);
5113 +lli_proceeding(struct FsmInst *fi, int event, void *arg)
5115 + struct Channel *chanp = fi->userdata;
5117 + HL_LL(chanp, ISDN_STAT_PROCEED);
5121 lli_resume(struct FsmInst *fi, int event, void *arg)
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;
5137 - ic.parm.num[0] = result;
5138 + (ulong)(ic.parm.num[0]) = result;
5139 cs->iif.statcallb(&ic);
5140 } /* stat_redir_result */
5142 @@ -997,8 +1019,13 @@ dchan_l3l4(struct PStack *st, int pr, vo
5143 FsmEvent(&chanp->fi, EV_RELEASE, NULL);
5145 case (CC_PROCEED_SEND | INDICATION):
5147 case (CC_PROCEEDING | INDICATION):
5148 + FsmEvent(&chanp->fi, EV_PROCEEDING, NULL);
5150 case (CC_ALERTING | INDICATION):
5151 + FsmEvent(&chanp->fi, EV_ALERTING, NULL);
5153 case (CC_PROGRESS | INDICATION):
5154 case (CC_NOTIFY | INDICATION):
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
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 $
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
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 $
5174 * Author Karsten Keil
5175 * Copyright by Karsten Keil <keil@isdn4linux.de>
5177 #include <linux/kernel_stat.h>
5178 #include <linux/tqueue.h>
5179 #include <linux/interrupt.h>
5181 +#ifdef CONFIG_HISAX_HFC_USB
5182 +#include "hisax_loadable.h"
5185 #define HISAX_STATUS_BUFSIZE 4096
5186 #define INCLUDE_INLINE_FUNCS
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
5196 * protocol can be either ISDN_PTYPE_EURO or ISDN_PTYPE_1TR6 or ISDN_PTYPE_NI1
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",
5206 void HiSax_closecard(int cardnr);
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);
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);
5221 -struct IsdnCard cards[HISAX_MAX_CARDS] = {
5222 +#define EMPTY_CARD {0, DEFAULT_PROTO, {0, 0, 0, 0}, NULL}
5224 +struct IsdnCard cards[] = {
5235 -#define HISAX_IDSIZE (HISAX_MAX_CARDS*8)
5236 -static char HiSaxID[HISAX_IDSIZE] __devinitdata = { 0, };
5237 +static char HiSaxID[64] __devinitdata = { 0, };
5239 char *HiSax_id __devinitdata = HiSaxID;
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, };
5249 #ifdef CONFIG_HISAX_16_3
5251 @@ -361,27 +379,23 @@ static int io[HISAX_MAX_CARDS] __devinit
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, };
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;
5266 -#define PARM_PARA "1-" __MODULE_STRING(HISAX_MAX_CARDS) "i"
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");
5283 -MODULE_PARM(io0, PARM_PARA);
5284 -MODULE_PARM(io1, PARM_PARA);
5285 +MODULE_PARM(io0, "1-8i");
5286 +MODULE_PARM(io1, "1-8i");
5290 @@ -432,6 +446,7 @@ void __init HiSaxVersion(void)
5294 +#ifdef COMPAT_HAS_NEW_SETUP
5295 #define MAX_ARG (HISAX_MAX_CARDS*5)
5296 static int __init HiSax_setup(char *line)
5298 @@ -440,12 +455,16 @@ static int __init HiSax_setup(char *line
5301 str = get_options(line, MAX_ARG, ints);
5303 +void __init HiSax_setup(char *str, int *ints)
5308 printk(KERN_DEBUG "HiSax_setup: argc(%d) str(%s)\n", argc, str);
5311 while (argc && (i < HISAX_MAX_CARDS)) {
5312 - cards[i].protocol = DEFAULT_PROTO;
5314 cards[i].typ = ints[j];
5316 @@ -473,19 +492,21 @@ static int __init HiSax_setup(char *line
5320 - if (str && *str) {
5321 - if (strlen(str) < HISAX_IDSIZE)
5322 - strcpy(HiSaxID, str);
5324 - printk(KERN_WARNING "HiSax: ID too long!");
5326 + if (str && *str) {
5327 + strcpy(HiSaxID, str);
5328 + HiSax_id = HiSaxID;
5330 strcpy(HiSaxID, "HiSax");
5332 - HiSax_id = HiSaxID;
5333 + HiSax_id = HiSaxID;
5335 +#ifdef COMPAT_HAS_NEW_SETUP
5339 __setup("hisax=", HiSax_setup);
5342 +#endif /* COMPAT_HAS_NEW_SETUP */
5343 #endif /* MODULES */
5346 @@ -560,6 +581,10 @@ extern int setup_hfcs(struct IsdnCard *c
5347 extern int setup_hfcpci(struct IsdnCard *card);
5350 +#if CONFIG_HISAX_HFC_USB
5351 +extern int setup_hfc_usb(struct IsdnCard *card);
5355 extern int setup_hfcsx(struct IsdnCard *card);
5357 @@ -604,10 +629,6 @@ extern int setup_w6692(struct IsdnCard *
5358 extern int setup_netjet_u(struct IsdnCard *card);
5361 -#if CARD_FN_ENTERNOW_PCI
5362 -extern int setup_enternow_pci(struct IsdnCard *card);
5366 * Find card with given driverId
5368 @@ -899,7 +920,8 @@ static int __devinit init_card(struct Is
5372 -static int __devinit checkcard(int cardnr, char *id, int *busy_flag)
5373 +static int __devinit checkcard(int cardnr, char *id, int *busy_flag,
5378 @@ -1093,6 +1115,12 @@ static int __devinit checkcard(int cardn
5379 ret = setup_hfcsx(card);
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);
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);
5395 -#if CARD_FN_ENTERNOW_PCI
5396 - case ISDN_CTYPE_ENTERNOW:
5397 - ret = setup_enternow_pci(card);
5400 case ISDN_CTYPE_DYNAMIC:
5403 @@ -1186,6 +1209,9 @@ static int __devinit checkcard(int cardn
5404 case ISDN_CTYPE_DYNAMIC:
5407 + case ISDN_CTYPE_HFC_USB:
5408 + ret = cs->cardmsg(cs, CARD_INIT, NULL);
5411 ret = init_card(cs);
5413 @@ -1257,16 +1283,13 @@ int __devinit HiSax_inithardware(int *bu
5415 sprintf(ids, "%s%d", id, i);
5417 - if (checkcard(i, ids, busy_flag)) {
5418 + if (checkcard(i, ids, busy_flag, NULL)) {
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]);
5428 + printk(KERN_WARNING
5429 + "HiSax: Card %s not installed !\n",
5430 + CardType[cards[i].typ]);
5431 HiSax_shiftcards(i);
5434 @@ -1342,6 +1365,49 @@ void HiSax_reportcard(int cardnr, int se
5438 +#ifdef CONFIG_HISAX_HFC_USB
5440 +hisax_register_hfcusb(struct hisax_drvreg *l1drv)
5445 + if (l1drv->version != HISAX_LOAD_VERSION)
5448 + switch (l1drv->cmd) {
5449 + case HISAX_LOAD_CHKVER:
5450 + break; /* success */
5452 + case HISAX_LOAD_REGISTER:
5453 + for (i = 0; i < HISAX_MAX_CARDS; i++) {
5454 + if (!cards[i].typ)
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)) {
5467 + kfree((void *) cards[i].cs);
5468 + cards[i].cs = NULL;
5469 + cards[i].typ = 0; /* no card present */
5474 + return 1; /* unknown command */
5478 +} /* hisax_register_hfcusb */
5481 static int __init HiSax_init(void)
5484 @@ -1408,8 +1474,6 @@ static int __init HiSax_init(void)
5486 cards[j].protocol = protocol[i];
5489 - cards[j].protocol = DEFAULT_PROTO;
5492 case ISDN_CTYPE_16_0:
5493 @@ -1487,22 +1551,15 @@ static int __init HiSax_init(void)
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;
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;
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;
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;
5525 @@ -1526,10 +1583,15 @@ static int __init HiSax_init(void)
5526 nrcards, (nrcards > 1) ? "s" : "");
5528 /* Install only, if at least one card found */
5529 - if (!HiSax_inithardware(NULL))
5531 + if (!HiSax_inithardware(NULL)) {
5543 @@ -1576,8 +1638,6 @@ int elsa_init_pcmcia(void *pcm_iob, int
5544 cards[i].typ = type[i];
5546 cards[i].protocol = protocol[i];
5548 - cards[i].protocol = DEFAULT_PROTO;
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" : "");
5556 - if (!HiSax_inithardware(busy_flag))
5558 + HiSax_inithardware(busy_flag);
5559 printk(KERN_NOTICE "HiSax: module installed\n");
5562 @@ -1619,8 +1678,6 @@ int hfc_init_pcmcia(void *pcm_iob, int p
5563 cards[i].typ = type[i];
5565 cards[i].protocol = protocol[i];
5567 - cards[i].protocol = DEFAULT_PROTO;
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" : "");
5575 - if (!HiSax_inithardware(busy_flag))
5577 + HiSax_inithardware(busy_flag);
5578 printk(KERN_NOTICE "HiSax: module installed\n");
5581 @@ -1662,8 +1718,6 @@ int sedl_init_pcmcia(void *pcm_iob, int
5582 cards[i].typ = type[i];
5584 cards[i].protocol = protocol[i];
5586 - cards[i].protocol = DEFAULT_PROTO;
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" : "");
5594 - if (!HiSax_inithardware(busy_flag))
5596 + HiSax_inithardware(busy_flag);
5597 printk(KERN_NOTICE "HiSax: module installed\n");
5600 @@ -1705,8 +1758,6 @@ int avm_a1_init_pcmcia(void *pcm_iob, in
5601 cards[i].typ = type[i];
5603 cards[i].protocol = protocol[i];
5605 - cards[i].protocol = DEFAULT_PROTO;
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" : "");
5613 - if (!HiSax_inithardware(busy_flag))
5615 + HiSax_inithardware(busy_flag);
5616 printk(KERN_NOTICE "HiSax: module installed\n");
5619 @@ -1743,7 +1793,7 @@ int __devinit hisax_init_pcmcia(void *pc
5620 sprintf(ids, "HiSax%d", nrcards);
5622 sprintf(ids, "HiSax");
5623 - if (!checkcard(nrcards, ids, busy_flag)) {
5624 + if (!checkcard(nrcards, ids, busy_flag, NULL)) {
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);
5632 - retval = checkcard(i, id, 0);
5633 + retval = checkcard(i, id, 0, NULL);
5634 if (retval == 0) { // yuck
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 -//#########################################################################################
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);
5649 module_init(HiSax_init);
5650 module_exit(HiSax_exit);
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
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 $
5667 * low level stuff for Eicon.Diehl Diva Family ISDN cards
5675 #include <linux/pci.h>
5676 -#include <linux/isapnp.h>
5677 +#include <linux/isdn_compat.h>
5679 extern const char *CardType[];
5681 -const char *Diva_revision = "$Revision: 1.1.4.2 $";
5682 +const char *Diva_revision = "$Revision: 1.33 $";
5684 #define byteout(addr,val) outb(val,addr)
5685 #define bytein(addr) inb(addr)
5686 @@ -51,7 +50,6 @@ const char *Diva_revision = "$Revision:
5688 #define DIVA_IPAC_ISA 3
5689 #define DIVA_IPAC_PCI 4
5690 -#define DIVA_IPACX_PCI 5
5693 #define DIVA_IRQ_STAT 0x01
5694 @@ -71,12 +69,10 @@ const char *Diva_revision = "$Revision:
5695 #define PITA_MISC_REG 0x1c
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
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
5707 @@ -244,47 +240,6 @@ MemWriteHSCX(struct IsdnCardState *cs, i
5708 memwritereg(cs->hw.diva.cfg_reg, offset + (hscx ? 0x40 : 0), value);
5711 -/* IO-Functions for IPACX type cards */
5713 -MemReadISAC_IPACX(struct IsdnCardState *cs, u_char offset)
5715 - return (memreadreg(cs->hw.diva.cfg_reg, offset));
5719 -MemWriteISAC_IPACX(struct IsdnCardState *cs, u_char offset, u_char value)
5721 - memwritereg(cs->hw.diva.cfg_reg, offset, value);
5725 -MemReadISACfifo_IPACX(struct IsdnCardState *cs, u_char * data, int size)
5728 - *data++ = memreadreg(cs->hw.diva.cfg_reg, 0);
5732 -MemWriteISACfifo_IPACX(struct IsdnCardState *cs, u_char * data, int size)
5735 - memwritereg(cs->hw.diva.cfg_reg, 0, *data++);
5739 -MemReadHSCX_IPACX(struct IsdnCardState *cs, int hscx, u_char offset)
5741 - return(memreadreg(cs->hw.diva.cfg_reg, offset +
5742 - (hscx ? IPACX_OFF_B2 : IPACX_OFF_B1)));
5746 -MemWriteHSCX_IPACX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value)
5748 - memwritereg(cs->hw.diva.cfg_reg, offset +
5749 - (hscx ? IPACX_OFF_B2 : IPACX_OFF_B1), value);
5753 * fast interrupt HSCX stuff goes here
5755 @@ -595,7 +550,7 @@ Memhscx_int_main(struct IsdnCardState *c
5757 struct BCState *bcs;
5759 - if (val & 0x01) { // EXB
5762 exval = MemReadHSCX(cs, 1, HSCX_EXIR);
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);
5768 - if (val & 0x02) { // EXA
5771 exval = MemReadHSCX(cs, 0, HSCX_EXIR);
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);
5777 - if (val & 0x04) { // ICA
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);
5787 -diva_irq_ipacx_pci(int intno, void *dev_id, struct pt_regs *regs)
5789 - struct IsdnCardState *cs = dev_id;
5794 - printk(KERN_WARNING "Diva: Spurious interrupt!\n");
5797 - cfg = (u_char *) cs->hw.diva.pci_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
5805 release_io_diva(struct IsdnCardState *cs)
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;
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 +
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
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))
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);
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
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,
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);
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;
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" },
5896 -static struct isapnp_device_id *pdev = &diva_ids[0];
5897 -static struct pci_bus *pnp_c __devinitdata = NULL;
5902 setup_diva(struct IsdnCard *card)
5907 struct IsdnCardState *cs = card->cs;
5909 @@ -977,75 +864,8 @@ setup_diva(struct IsdnCard *card)
5910 cs->hw.diva.hscx_adr = card->para[1] + DIVA_HSCX_ADR;
5912 cs->irq = card->para[0];
5916 - if (isapnp_present()) {
5917 - struct pci_bus *pb;
5918 - struct pci_dev *pd;
5920 - while(pdev->card_vendor) {
5921 - if ((pb = isapnp_find_card(pdev->card_vendor,
5922 - pdev->card_device, pnp_c))) {
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);
5930 - pd->deactivate(pd);
5933 - pd->resource[0].start;
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);
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);
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;
5971 - printk(KERN_ERR "Diva PnP: PnP error card found, no device\n");
5978 - if (!pdev->card_vendor) {
5979 - printk(KERN_INFO "Diva PnP: no ISAPnP card found\n");
5984 if (!pci_present()) {
5985 printk(KERN_ERR "Diva: no PCI bus present\n");
5986 @@ -1059,14 +879,14 @@ setup_diva(struct IsdnCard *card)
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))
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))
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);
6023 printk(KERN_WARNING "Diva: No PCI card found\n");
6025 @@ -1107,8 +917,7 @@ setup_diva(struct IsdnCard *card)
6026 printk(KERN_WARNING "Diva: unable to config DIVA PCI\n");
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)
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)) {
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
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 $
6091 * low level stuff for Elsa isdn cards
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>
6102 extern const char *CardType[];
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;
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" },
6124 -static struct isapnp_device_id *pdev = &elsa_ids[0];
6125 -static struct pci_bus *pnp_c __devinitdata = NULL;
6129 setup_elsa(struct IsdnCard *card)
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;
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)
6142 } else if (cs->typ == ISDN_CTYPE_ELSA_PNP) {
6144 - if (!card->para[1] && isapnp_present()) {
6145 - struct pci_bus *pb;
6146 - struct pci_dev *pd;
6148 - while(pdev->card_vendor) {
6149 - if ((pb = isapnp_find_card(pdev->card_vendor,
6150 - pdev->card_device, pnp_c))) {
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);
6158 - pd->deactivate(pd);
6161 - pd->resource[0].start;
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);
6170 - if (pdev->function == ISAPNP_FUNCTION(0x133))
6171 - cs->subtyp = ELSA_QS1000;
6173 - cs->subtyp = ELSA_QS3000;
6176 - printk(KERN_ERR "Elsa PnP: PnP error card found, no device\n");
6183 - if (!pdev->card_vendor) {
6184 - printk(KERN_INFO "Elsa PnP: no ISAPnP card found\n");
6189 - if (card->para[1] && card->para[0]) {
6190 - cs->hw.elsa.base = card->para[1];
6191 - cs->irq = card->para[0];
6193 - cs->subtyp = ELSA_QS1000;
6195 - printk(KERN_ERR "Elsa PnP: no parameter\n");
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)
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))
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);
6222 printk(KERN_WARNING "Elsa: No PCI card found\n");
6224 @@ -1123,7 +1056,6 @@ setup_elsa(struct IsdnCard *card)
6229 case ELSA_QS3000PCI:
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)";
6243 #define DEBUG(n, args...)
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
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 $
6253 * stuff for the serial modem on ELSA cards
6255 @@ -396,6 +396,74 @@ static inline void transmit_chars(struct
6260 +static inline void check_modem_status(struct IsdnCardState *cs)
6263 + struct async_struct *info = cs->hw.elsa.info;
6264 + struct async_icount *icount;
6266 + status = serial_inp(info, UART_MSR);
6268 + if (status & UART_MSR_ANY_DELTA) {
6269 + icount = &info->state->icount;
6270 + /* update input line counters */
6271 + if (status & UART_MSR_TERI)
6273 + if (status & UART_MSR_DDSR)
6275 + if (status & UART_MSR_DDCD) {
6278 + if (status & UART_MSR_DCTS)
6280 +// wake_up(&info->delta_msr_wait);
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");
6288 + if (status & UART_MSR_DCD)
6289 +// wake_up(&info->open_wait);
6291 + else if (!((info->flags & ASYNC_CALLOUT_ACTIVE) &&
6292 + (info->flags & ASYNC_CALLOUT_NOHUP))) {
6293 +#ifdef SERIAL_DEBUG_OPEN
6294 + printk("doing serial hangup...");
6297 + tty_hangup(info->tty);
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...");
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);
6314 + if (!(status & UART_MSR_CTS)) {
6315 +#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW))
6316 + printk("CTS tx stop...");
6318 + info->tty->hw_stopped = 1;
6319 + info->IER &= ~UART_IER_THRI;
6320 + serial_outp(info, UART_IER, info->IER);
6328 static void rs_interrupt_elsa(int irq, struct IsdnCardState *cs)
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
6335 -/* $Id: fsm.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6338 * Finite state machine
6342 #define FSM_TIMER_DEBUG 0
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);
6353 FsmNew(struct Fsm *fsm, struct FsmNode *fnlist, int fncount)
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
6360 -/* $Id: fsm.h,v 1.1.2.1 2001/11/20 14:19:35 kai Exp $
6363 * Finite state machine
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
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 $
6373 * low level stuff for Gazel isdn cards
6378 #include <linux/pci.h>
6379 +#include <linux/isdn_compat.h>
6381 extern const char *CardType[];
6382 -const char *gazel_revision = "$Revision: 1.1.4.1 $";
6383 +const char *gazel_revision = "$Revision: 2.19 $";
6387 @@ -563,8 +564,8 @@ setup_gazelpci(struct IsdnCardState *cs)
6388 if (pci_enable_device(dev_tel))
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);
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
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 $
6406 * specific routines for CCD's HFC 2BDS0
6408 @@ -616,6 +616,17 @@ hfcd_bh(struct IsdnCardState *cs)
6413 + if (test_and_clear_bit(D_CLEARBUSY, &cs->event)) {
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;
6423 if (test_and_clear_bit(D_L1STATECHANGE, &cs->event)) {
6424 switch (cs->dc.hfcd.ph_state) {
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);
6431 + case (HW_TESTLOOP | REQUEST):
6433 + if (1 & (int) arg)
6435 + if (2 & (int) arg)
6437 + if (test_bit(HW_IOM1, &cs->HW_Flags)) {
6440 + cs->writeisac(cs, ISAC_SPCR, 0xa);
6441 + cs->writeisac(cs, ISAC_ADF1, 0x2);
6443 + cs->writeisac(cs, ISAC_SPCR, val);
6444 + cs->writeisac(cs, ISAC_ADF1, 0xa);
6448 + cs->writeisac(cs, ISAC_SPCR, val);
6450 + cs->writeisac(cs, ISAC_ADF1, 0x8);
6452 + cs->writeisac(cs, ISAC_ADF1, 0x0);
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
6461 hfc_dbusy_timer(struct IsdnCardState *cs)
6464 + struct PStack *stptr;
6465 + if (test_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) {
6467 + debugl1(cs, "D-Channel Busy");
6468 + test_and_set_bit(FLG_L1_DBUSY, &cs->HW_Flags);
6469 + stptr = cs->stlist;
6471 + while (stptr != NULL) {
6472 + stptr->l1.l1l2(stptr, PH_PAUSE | INDICATION, NULL);
6473 + stptr = stptr->next;
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
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 $
6488 * specific defines for CCD's HFC 2BDS0
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
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 $
6498 * specific routines for CCD's HFC 2BS0
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
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 $
6508 * specific defines for CCD's HFC 2BS0
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
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 $
6518 * low level driver for CCD´s hfc-pci based cards
6521 #include "hfc_pci.h"
6523 #include <linux/pci.h>
6524 +#include <linux/isdn_compat.h>
6525 #include <linux/interrupt.h>
6527 extern const char *CardType[];
6529 -static const char *hfcpci_revision = "$Revision: 1.1.4.1 $";
6530 +static const char *hfcpci_revision = "$Revision: 1.48 $";
6532 /* table entry in the PCI devices list */
6534 @@ -76,8 +77,6 @@ release_io_hfcpci(struct IsdnCardState *
6536 unsigned long flags;
6538 - printk(KERN_INFO "HiSax: release hfcpci at %p\n",
6539 - cs->hw.hfcpci.pci_io);
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 */
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);
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);
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);
6566 dev_kfree_skb_any(bcs->tx_skb);
6568 bcs->tx_skb = skb_dequeue(&bcs->squeue); /* fetch next data */
6569 @@ -1146,6 +1143,20 @@ hfcpci_interrupt(int intno, void *dev_id
6571 hfcpci_dbusy_timer(struct IsdnCardState *cs)
6574 + struct PStack *stptr;
6575 + if (test_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) {
6577 + debugl1(cs, "D-Channel Busy");
6578 + test_and_set_bit(FLG_L1_DBUSY, &cs->HW_Flags);
6579 + stptr = cs->stlist;
6581 + while (stptr != NULL) {
6582 + stptr->l1.l1l2(stptr, PH_PAUSE | INDICATION, NULL);
6583 + stptr = stptr->next;
6589 /*************************************/
6590 @@ -1550,6 +1561,17 @@ hfcpci_bh(struct IsdnCardState *cs)
6595 + if (test_and_clear_bit(D_CLEARBUSY, &cs->event)) {
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;
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))
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)))
6617 @@ -1729,7 +1751,7 @@ setup_hfcpci(struct IsdnCard *card)
6618 printk(KERN_WARNING "HFC-PCI: No IRQ for PCI card found\n");
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);
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");
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
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 $
6643 * specific defines for CCD's HFC 2BDS0 PCI chips
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
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 $
6653 * level driver for CCD´s hfc-s+/sp based cards
6658 #include <linux/interrupt.h>
6659 -#include <linux/isapnp.h>
6661 extern const char *CardType[];
6663 -static const char *hfcsx_revision = "$Revision: 1.1.4.1 $";
6664 +static const char *hfcsx_revision = "$Revision: 1.12 $";
6666 /***************************************/
6667 /* IRQ-table for CCDs demo board */
6668 @@ -940,6 +939,20 @@ hfcsx_interrupt(int intno, void *dev_id,
6670 hfcsx_dbusy_timer(struct IsdnCardState *cs)
6673 + struct PStack *stptr;
6674 + if (test_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) {
6676 + debugl1(cs, "D-Channel Busy");
6677 + test_and_set_bit(FLG_L1_DBUSY, &cs->HW_Flags);
6678 + stptr = cs->stlist;
6680 + while (stptr != NULL) {
6681 + stptr->l1.l1l2(stptr, PH_PAUSE | INDICATION, NULL);
6682 + stptr = stptr->next;
6688 /*************************************/
6689 @@ -1333,6 +1346,17 @@ hfcsx_bh(struct IsdnCardState *cs)
6694 + if (test_and_clear_bit(D_CLEARBUSY, &cs->event)) {
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;
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,
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" },
6719 -static struct isapnp_device_id *hdev = &hfc_ids[0];
6720 -static struct pci_bus *pnp_c __devinitdata = NULL;
6724 setup_hfcsx(struct IsdnCard *card)
6725 @@ -1482,45 +1496,6 @@ setup_hfcsx(struct IsdnCard *card)
6727 strcpy(tmp, hfcsx_revision);
6728 printk(KERN_INFO "HiSax: HFC-SX driver Rev. %s\n", HiSax_getrev(tmp));
6730 - if (!card->para[1] && isapnp_present()) {
6731 - struct pci_bus *pb;
6732 - struct pci_dev *pd;
6734 - while(hdev->card_vendor) {
6735 - if ((pb = isapnp_find_card(hdev->card_vendor,
6736 - hdev->card_device, pnp_c))) {
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);
6744 - pd->deactivate(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);
6756 - printk(KERN_ERR "HFC PnP: PnP error card found, no device\n");
6762 - if (!hdev->card_vendor) {
6763 - printk(KERN_INFO "HFC PnP: no ISAPnP card found\n");
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;
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
6784 -/* $Id: hfc_sx.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6787 * specific defines for CCD's HFC 2BDS0 S+,SP chips
6789 Index: linux-2.4.35.4/drivers/isdn/hisax/hfc_usb.c
6790 ===================================================================
6792 +++ linux-2.4.35.4/drivers/isdn/hisax/hfc_usb.c
6794 +/* $Id: hfc_usb.c,v 2.3 2001/07/06 21:30:11 werner Exp $
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
6803 + * Copyright 2001 by Werner Cornelius (werner@isdn-development.de)
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.
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.
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.
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>
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"
6837 +#define INCLUDE_INLINE_FUNCS
6842 +#define HFC_CTRL_TIMEOUT 5 /* 5ms timeout writing/reading regs */
6843 +#define HFC_TIMER_T3 7000 /* timeout for l1 activation timer */
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 */
6850 +#define MAX_BCH_SIZE 2048 /* allowed B-channel packet size */
6852 +#define HFCUSB_RX_THRESHOLD 64 /* threshold for fifo report bit rx */
6853 +#define HFCUSB_TX_THRESHOLD 64 /* threshold for fifo report bit tx */
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
6875 +#define HFCUSB_CHIPID 0x40 /* ID value of HFC-USB */
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
6893 +#define LED_DRIVER 0x1
6895 +#define LED_BCH 0x4
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)
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 */
6914 +/*************************************************/
6915 +/* entry and size of output/input control buffer */
6916 +/*************************************************/
6917 +#define HFC_CTRL_BUFSIZE 32
6919 + __u8 hfc_reg; /* register number */
6920 + __u8 reg_val; /* value to be written (or read) */
6923 +/***************************************************************/
6924 +/* structure defining input+output fifos (interrupt/bulk mode) */
6925 +/***************************************************************/
6926 +struct hfcusb_data; /* forward definition */
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 */
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 */
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 */
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 */
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 */
6984 +usb_dump_urb(purb_t purb)
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);
7006 +/*************************************************************************/
7007 +/* bottom half handler for L1 activation/deactiavtaion + D-chan + E-chan */
7008 +/*************************************************************************/
7010 +usb_l1d_bh(hfcusb_data * hfc)
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;
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,
7024 + 7) ? (PH_ACTIVATE |
7026 + : (PH_DEACTIVATE | INDICATION),
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,
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,
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);
7046 +/******************************************************/
7047 +/* start next background transfer for control channel */
7048 +/******************************************************/
7050 +ctrl_start_transfer(hfcusb_data * hfc)
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].
7063 + hfc->ctrl_urb.transfer_buffer =
7064 + (char *) &hfc->dfifo_fill;
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].
7076 + hfc->ctrl_write.value =
7077 + hfc->ctrl_buff[hfc->ctrl_out_idx].
7081 + usb_submit_urb(&hfc->ctrl_urb); /* start transfer */
7083 +} /* ctrl_start_transfer */
7085 +/************************************/
7086 +/* queue a control transfer request */
7087 +/* return 0 on success. */
7088 +/************************************/
7090 +queue_control_request(hfcusb_data * hfc, __u8 reg, __u8 val)
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);
7104 +} /* queue_control_request */
7106 +/**************************************/
7107 +/* called when timer t3 or t4 expires */
7108 +/**************************************/
7110 +l1_timer_expire(hfcusb_data * hfc)
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,
7117 + queue_task(&hfc->l1_tq, &tq_immediate);
7118 + mark_bh(IMMEDIATE_BH);
7119 +} /* l1_timer_expire */
7121 +/**************************************************/
7122 +/* (re)fills a tx-fifo urb. Queuing is done later */
7123 +/**************************************************/
7125 +fill_tx_urb(usb_fifo * fifo)
7127 + struct sk_buff *skb;
7131 + fifo->urb.dev = fifo->hfc->dev;
7133 + && (fifo->urb.transfer_buffer_length < fifo->usb_maxlen)) {
7134 + switch (fifo->fifonum) {
7135 + case HFCUSB_B1_TX:
7136 + case HFCUSB_B2_TX:
7138 + fifo->buff = NULL;
7139 + fifo->hfc->regd.bch_l1l2(fifo->hfc->regd.
7147 + fifo->hfc->service_request |=
7151 + dev_kfree_skb_any(fifo->buff);
7152 + fifo->buff = NULL;
7153 + save_flags(flags);
7155 + fifo->hfc->dfifo_fill = 0xff; /* currently invalid data */
7156 + queue_control_request(fifo->hfc,
7159 + queue_control_request(fifo->hfc,
7160 + HFCUSB_F_USAGE, 0);
7161 + restore_flags(flags);
7164 + return; /* error, invalid fifo */
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 */
7175 + case HFCUSB_B2_TX:
7176 + if (fifo->hfc->regd.bsk[1])
7177 + fifo->buff = *fifo->hfc->regd.bsk[1]; /* B2-channel tx buffer */
7180 + if (fifo->hfc->regd.dsq)
7181 + fifo->buff = skb_dequeue(fifo->hfc->regd.dsq); /* D-channel tx queue */
7184 + return; /* error, invalid fifo */
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,
7194 + mark_bh(IMMEDIATE_BH);
7198 + fifo->act_ptr = fifo->buff->data; /* start of data */
7201 + fifo->hfc->active_fifos |= fifo->fifo_mask;
7202 + fifo->hfc->service_request &= ~fifo->fifo_mask;
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;
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 */
7216 +/************************************************/
7217 +/* transmit completion routine for all tx fifos */
7218 +/************************************************/
7220 +tx_complete(purb_t urb)
7222 + usb_fifo *fifo = (usb_fifo *) urb->context; /* pointer to our fifo */
7224 + fifo->hfc->service_request &= ~fifo->fifo_mask; /* no further handling */
7225 + fifo->framenum = usb_get_current_frame_number(fifo->hfc->dev);
7227 + /* check for deactivation or error */
7228 + if ((!fifo->active) || (urb->status)) {
7229 + fifo->hfc->active_fifos &= ~fifo->fifo_mask; /* we are inactive */
7231 + if ((fifo->buff) && (fifo->fifonum == HFCUSB_D_TX)) {
7232 + dev_kfree_skb_any(fifo->buff);
7234 + fifo->buff = NULL;
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 */
7241 + fifo->hfc->service_request |= fifo->fifo_mask; /* need to restart */
7242 +} /* tx_complete */
7244 +/***********************************************/
7245 +/* receive completion routine for all rx fifos */
7246 +/***********************************************/
7248 +rx_complete(purb_t urb)
7250 + usb_fifo *fifo = (usb_fifo *) urb->context; /* pointer to our fifo */
7251 + hfcusb_data *hfc = fifo->hfc;
7254 + int i, ii, currcnt, hdlci;
7255 + struct sk_buff *skb;
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 */
7263 + dev_kfree_skb_any(fifo->buff);
7264 + fifo->buff = NULL;
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 */
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);
7281 + /* check if rescheduling needed */
7283 + hfc->service_request & hfc->active_fifos & ~hfc->
7284 + threshold_mask)) {
7286 + usb_get_current_frame_number(hfc->dev);
7287 + txfifo = hfc->fifos + HFCUSB_B1_TX;
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);
7297 + usb_submit_urb(&txfifo->
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);
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,
7323 + queue_task(&hfc->l1_tq, &tq_immediate);
7324 + mark_bh(IMMEDIATE_BH);
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);
7338 + (urb->actual_length - fifo->rx_offset);
7339 + fifo->buff->len +=
7340 + (urb->actual_length - fifo->rx_offset);
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) {
7354 + skb_queue_tail(hfc->regd.
7360 + queue_task(&hfc->l1_tq,
7362 + mark_bh(IMMEDIATE_BH);
7365 + case HFCUSB_B1_RX:
7366 + if (hfc->regd.brq[0]) {
7387 + case HFCUSB_B2_RX:
7388 + if (hfc->regd.brq[1]) {
7410 + case HFCUSB_PCM_RX:
7411 + skb_queue_tail(&hfc->regd.
7417 + queue_task(&hfc->l1_tq,
7419 + mark_bh(IMMEDIATE_BH);
7423 + dev_kfree_skb_any(fifo->
7429 + fifo->buff->len = 0; /* reset counter */
7430 + fifo->act_ptr = fifo->buff->data; /* and pointer */
7433 + fifo->rx_offset = (urb->actual_length < fifo->usb_maxlen) ? 2 : 0;
7434 +} /* rx_complete */
7436 +/***************************************************/
7437 +/* start the interrupt transfer for the given fifo */
7438 +/***************************************************/
7440 +start_rx_fifo(usb_fifo * fifo)
7443 + return; /* still active */
7446 + dev_alloc_skb(fifo->max_size + (fifo->transmode ? 0 : 3))))
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)) {
7457 + fifo->hfc->active_fifos &= ~fifo->fifo_mask;
7458 + dev_kfree_skb_any(fifo->buff);
7459 + fifo->buff = NULL;
7461 +} /* start_rx_fifo */
7463 +/***************************************************************/
7464 +/* control completion routine handling background control cmds */
7465 +/***************************************************************/
7467 +ctrl_complete(purb_t urb)
7469 + hfcusb_data *hfc = (hfcusb_data *) urb->context;
7471 + urb->dev = hfc->dev;
7472 + if (hfc->ctrl_cnt) {
7473 + switch (hfc->ctrl_buff[hfc->ctrl_out_idx].hfc_reg) {
7476 + hfc->ctrl_buff[hfc->ctrl_out_idx].
7479 + case HFCUSB_F_USAGE:
7480 + if (!hfc->dfifo_fill) {
7481 + fill_tx_urb(hfc->fifos +
7483 + if (hfc->fifos[HFCUSB_D_TX].buff)
7484 + usb_submit_urb(&hfc->
7489 + queue_control_request(hfc,
7492 + queue_control_request(hfc,
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->
7506 + case HFCUSB_B2_RX:
7507 + if (hfc->bch_enables & 2)
7508 + start_rx_fifo(hfc->
7514 + if (hfc->bch_enables & 3)
7515 + hfc->led_req |= LED_BCH;
7517 + hfc->led_req &= ~LED_BCH;
7519 + case HFCUSB_P_DATA:
7521 + hfc->ctrl_buff[hfc->ctrl_out_idx].
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 */
7530 +} /* ctrl_complete */
7532 +/*****************************************/
7533 +/* Layer 1 + D channel access from HiSax */
7534 +/*****************************************/
7536 +hfcusb_l1_access(void *drvarg, int pr, void *arg)
7538 + hfcusb_data *hfc = (hfcusb_data *) drvarg;
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].
7554 + case (PH_ACTIVATE | REQUEST):
7555 + switch (hfc->l1_state) {
7558 + hfc->regd.dch_l1l2(hfc->regd.arg_hisax,
7560 + INDICATION), NULL);
7564 + hfc->regd.dch_l1l2(hfc->regd.arg_hisax,
7566 + INDICATION), NULL);
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);
7579 + case (PH_DEACTIVATE | REQUEST):
7580 + queue_control_request(hfc, HFCUSB_STATES, 0x40); /* start deactivation */
7583 + printk(KERN_INFO "unknown hfcusb l1_access 0x%x\n",
7587 +} /* hfcusb_l1_access */
7589 +/*******************************/
7590 +/* B channel access from HiSax */
7591 +/*******************************/
7593 +hfcusb_bch_access(void *drvarg, int chan, int pr, void *arg)
7595 + hfcusb_data *hfc = (hfcusb_data *) drvarg;
7596 + usb_fifo *fifo = hfc->fifos + (chan ? HFCUSB_B2_TX : HFCUSB_B1_TX);
7600 + case (PH_DATA | REQUEST):
7601 + case (PH_PULL | INDICATION):
7602 + save_flags(flags);
7604 + if (!fifo->active) {
7605 + fill_tx_urb(fifo);
7606 + hfc->active_fifos |= fifo->fifo_mask;
7607 + usb_submit_urb(&fifo->urb);
7609 + restore_flags(flags);
7611 + case (PH_ACTIVATE | REQUEST):
7612 + if (!((int) arg)) {
7613 + hfc->bch_enables &= ~(1 << chan);
7614 + if (fifo->active) {
7616 + usb_unlink_urb(&fifo->urb);
7618 + save_flags(flags);
7620 + queue_control_request(hfc, HFCUSB_FIFO,
7622 + queue_control_request(hfc,
7623 + HFCUSB_INC_RES_F, 2);
7624 + queue_control_request(hfc, HFCUSB_CON_HDLC,
7626 + queue_control_request(hfc, HFCUSB_SCTRL,
7628 + hfc->bch_enables);
7629 + queue_control_request(hfc, HFCUSB_SCTRL_R,
7630 + hfc->bch_enables);
7631 + restore_flags(flags);
7633 + if (fifo->active) {
7635 + usb_unlink_urb(&fifo->urb);
7637 + return; /* fifo deactivated */
7639 + fifo->transmode = ((int) arg == L1_MODE_TRANS);
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);
7648 + queue_control_request(hfc, HFCUSB_FIFO,
7650 + queue_control_request(hfc, HFCUSB_CON_HDLC,
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,
7659 + queue_control_request(hfc, HFCUSB_FIFO,
7660 + fifo->fifonum + 1);
7661 + queue_control_request(hfc, HFCUSB_CON_HDLC,
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);
7673 + "unknown hfcusb bch_access chan %d 0x%x\n",
7677 +} /* hfcusb_bch_access */
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 +/***************************************************************************/
7685 +usb_init(hfcusb_data * hfc)
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);
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);
7702 + /* init the led state request */
7703 + hfc->led_req = LED_DRIVER;
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));
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 */
7716 + /* init the fifos */
7717 + Write_hfc(hfc, HFCUSB_F_THRES, (HFCUSB_TX_THRESHOLD >> 3) |
7718 + ((HFCUSB_RX_THRESHOLD >> 3) << 4));
7720 + for (i = 0, fifo = hfc->fifos + i; i < HFCUSB_NUM_FIFOS;
7722 + Write_hfc(hfc, HFCUSB_FIFO, i); /* select the desired fifo */
7724 + fifo->transmode = 0; /* hdlc mode selected */
7725 + fifo->buff = NULL; /* init buffer pointer */
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 */
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 */
7737 + Write_hfc(hfc, HFCUSB_SCTRL_R, 0); /* disable both B receivers */
7738 + Write_hfc(hfc, HFCUSB_SCTRL, 0x40); /* disable B transmitters + cap mode */
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;
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);
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);
7772 + /* init the E-buffer */
7773 + skb_queue_head_init(&hfc->regd.erq);
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 */
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 */
7796 +/*************************************************/
7797 +/* function called to probe a new plugged device */
7798 +/*************************************************/
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)
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;
7814 +#ifdef COMPAT_HAS_USB_IDTAB
7815 + if (id_table && (dev->descriptor.idVendor == id_table->idVendor) &&
7816 + (dev->descriptor.idProduct == id_table->idProduct) &&
7818 + if ((((dev->descriptor.idVendor == 0x959) &&
7819 + (dev->descriptor.idProduct == 0x2bd0)) ||
7820 + ((dev->descriptor.idVendor == 0x7b0) &&
7821 + (dev->descriptor.idProduct == 0x0006))) &&
7823 + (ifdp->bNumEndpoints >= 6) && (ifdp->bNumEndpoints <= 16)) {
7824 + if (!(context = kmalloc(sizeof(hfcusb_data), GFP_KERNEL))) {
7825 + return (NULL); /* got no mem */
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)) {
7833 + idx = (((epd->bEndpointAddress & 0x7f) - 1) << 1); /* get endpoint base */
7835 + switch (epd->bmAttributes) {
7836 + case USB_ENDPOINT_XFER_INT:
7839 + bEndpointAddress &
7841 + break; /* only interrupt in allowed */
7842 + idx++; /* input index is odd */
7843 + context->fifos[idx].pipe =
7844 + usb_rcvintpipe(dev,
7846 + bEndpointAddress);
7849 + case USB_ENDPOINT_XFER_BULK:
7851 + bEndpointAddress &
7853 + break; /* only bulk out allowed */
7854 + context->fifos[idx].pipe =
7855 + usb_sndbulkpipe(dev,
7857 + bEndpointAddress);
7860 + context->fifos[idx].pipe = 0; /* reset data */
7861 + } /* switch attribute */
7863 + if (context->fifos[idx].pipe) {
7864 + context->fifos[idx].fifonum = idx;
7865 + context->fifos[idx].fifo_mask =
7867 + context->fifos[idx].hfc = context;
7868 + context->fifos[idx].usb_maxlen =
7869 + epd->wMaxPacketSize;
7870 + context->fifos[idx].intervall =
7872 + ep_msk |= (1 << idx);
7874 + ep_msk &= ~(1 << idx);
7879 + if ((ep_msk & 0x3f) != 0x3f) {
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 */
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);
7893 + /* init the chip and register the driver */
7894 + if (usb_init(context)) {
7896 + MOD_DEC_USE_COUNT;
7901 + "HFC-USB: New device if=%d alt=%d registered\n",
7902 + context->if_used, context->alt_used);
7906 + return (NULL); /* no matching entry */
7907 +} /* hfc_usb_probe */
7909 +/****************************************************/
7910 +/* function called when an active device is removed */
7911 +/****************************************************/
7913 +hfc_usb_disconnect(struct usb_device *usbdev, void *drv_context)
7915 + hfcusb_data *context = drv_context;
7917 + struct sk_buff *skb;
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);
7925 + while (context->active_fifos) {
7926 + set_current_state(TASK_INTERRUPTIBLE);
7927 + /* Timeout 10ms */
7928 + schedule_timeout((10 * HZ) / 1000);
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);
7936 + kfree(context); /* free our structure again */
7937 + MOD_DEC_USE_COUNT; /* and decrement the usage counter */
7938 +} /* hfc_usb_disconnect */
7940 +/************************************/
7941 +/* our driver information structure */
7942 +/************************************/
7943 +static struct usb_driver hfc_drv = {
7945 +#ifdef COMPAT_HAS_USB_IDTAB
7946 + id_table:hfc_usb_idtab,
7948 + probe:hfc_usb_probe,
7949 + disconnect:hfc_usb_disconnect,
7956 + usb_deregister(&hfc_drv); /* release our driver */
7957 + printk(KERN_INFO "HFC-USB module removed\n");
7963 + struct hisax_drvreg drv;
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 */
7971 + if (usb_register(&hfc_drv)) {
7973 + "Unable to register HFC-USB module at usb stack\n");
7974 + return (-1); /* unable to register */
7977 + printk(KERN_INFO "HFC-USB module loaded\n");
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 ===================================================================
7986 +++ linux-2.4.35.4/drivers/isdn/hisax/hfc_usbr.c
7988 +/* $Id: hfc_usbr.c,v 2.5 2001/07/06 21:30:11 werner Exp $
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
7993 + * Author Werner Cornelius (werner@isdn-development.de)
7995 + * Copyright 2001 by Werner Cornelius (werner@isdn4linux.de)
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.
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.
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.
8013 +#define __NO_VERSION__
8014 +#include <linux/init.h>
8016 +#include "isdnl1.h"
8017 +#include "hisax_loadable.h"
8019 +extern const char *CardType[];
8021 +static const char *hfcusb_revision = "$Revision: 2.5 $";
8023 +/*********************************/
8024 +/* schedule a new b_channel task */
8025 +/*********************************/
8027 +hfcusb_sched_event(struct BCState *bcs, int event)
8029 + bcs->event |= 1 << event;
8030 + queue_task(&bcs->tqueue, &tq_immediate);
8031 + mark_bh(IMMEDIATE_BH);
8034 +/************************************************/
8035 +/* select a b-channel entry matching and active */
8036 +/************************************************/
8039 +Sel_BCS(struct IsdnCardState *cs, int channel)
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]);
8049 +/**********************************************/
8050 +/* transfer function (D-channel from l2 to l1 */
8051 +/**********************************************/
8053 +hfcusb_d_l2l1(struct PStack *st, int pr, void *arg)
8055 + struct IsdnCardState *cs = st->l1.hardware;
8056 + struct hisax_drvreg *drv = cs->hw.hfcusb.drv;
8060 + case (PH_DATA | REQUEST):
8061 + case (PH_PULL | INDICATION):
8062 + cs->hw.hfcusb.dch_tx_busy = 1;
8064 + case (PH_PULL | REQUEST):
8065 + if (!cs->hw.hfcusb.dch_tx_busy) {
8066 + test_and_clear_bit(FLG_L1_PULL_REQ,
8068 + st->l1.l1l2(st, PH_PULL | CONFIRM,
8071 + test_and_set_bit(FLG_L1_PULL_REQ,
8075 + drv->dch_l2l1(drv, pr, arg);
8077 + debugl1(cs, "hfcusb l2l1 called without existing driver");
8078 +} /* hfcusb_d_l2l1 */
8080 +/*****************************/
8081 +/* E-channel receive routine */
8082 +/*****************************/
8084 +EChannel_proc_rcv(struct IsdnCardState *cs)
8087 + struct sk_buff *skb;
8088 + struct hisax_drvreg *usbdrv =
8089 + (struct hisax_drvreg *) cs->hw.hfcusb.drv;
8092 + while ((skb = skb_dequeue(&usbdrv->erq)) != NULL) {
8093 + if (cs->debug & DEB_DLOG_HEX) {
8095 + if ((skb->len) < MAX_DLOG_SPACE / 3 - 10) {
8101 + ptr += QuickHex(ptr, skb->data, skb->len);
8105 + HiSax_putstatus(cs, NULL, cs->dlog);
8107 + HiSax_putstatus(cs, "LogEcho: ",
8108 + "warning Frame too big (%d)",
8111 + dev_kfree_skb_any(skb);
8115 +/******************************************/
8116 +/* transfer function called from L1 to L2 */
8117 +/******************************************/
8119 +hfcusb_d_l1l2(void *cs1, int pr, void *arg)
8121 + struct IsdnCardState *cs = (struct IsdnCardState *) cs1;
8124 + case (PH_DATA | INDICATION):
8126 + DChannel_proc_rcv(cs);
8128 + EChannel_proc_rcv(cs);
8131 + case (PH_DATA | CONFIRM):
8132 + cs->hw.hfcusb.dch_tx_busy = 0;
8133 + DChannel_proc_xmt(cs);
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");
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");
8151 + debugl1(cs, "unknown l1 msg 0x%x ", pr);
8153 +} /* hfcusb_d_l1l2 */
8156 +/******************************************/
8157 +/* transfer function called from L1 to L2 */
8158 +/******************************************/
8160 +hfcusb_b_l1l2(void *cs1, int chan, int pr, void *arg)
8162 + struct IsdnCardState *cs = (struct IsdnCardState *) cs1;
8163 + struct BCState *bcs = Sel_BCS(cs, chan);
8166 + case (PH_DATA | INDICATION):
8169 + hfcusb_sched_event(bcs, B_RCVBUFREADY);
8172 + case (PH_DATA | CONFIRM):
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,
8181 + dev_kfree_skb_any(bcs->tx_skb);
8182 + bcs->tx_skb = skb_dequeue(&bcs->squeue);
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");
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");
8200 + debugl1(cs, "unknown l1 b msg 0x%x ", pr);
8202 +} /* hfcusb_b_l1l2 */
8205 +/***********************************************/
8206 +/* called during init setting l1 stack pointer */
8207 +/***********************************************/
8209 +setstack_hfcusb(struct PStack *st, struct IsdnCardState *cs)
8211 + st->l2.l2l1 = hfcusb_d_l2l1;
8214 +/**************************************/
8215 +/* send B-channel data if not blocked */
8216 +/**************************************/
8218 +hfcusb_send_data(struct BCState *bcs)
8220 + struct IsdnCardState *cs = bcs->cs;
8221 + struct hisax_drvreg *drv =
8222 + (struct hisax_drvreg *) cs->hw.hfcusb.drv;
8226 + drv->bch_l2l1(drv->argl1, bcs->channel, PH_DATA | REQUEST,
8230 +/***************************************************************/
8231 +/* activate/deactivate hardware for selected channels and mode */
8232 +/***************************************************************/
8234 +mode_hfcusb(struct BCState *bcs, int mode, int bc)
8236 + struct IsdnCardState *cs = bcs->cs;
8237 + struct hisax_drvreg *drv = cs->hw.hfcusb.drv;
8241 + if (cs->debug & L1_DEB_HSCX)
8242 + debugl1(cs, "HFCUSB bchannel mode %d bchan %d/%d",
8243 + mode, bc, bcs->channel);
8245 + bcs->channel = bc;
8247 + drv->bsk[bc] = &bcs->tx_skb;
8248 + drv->brq[bc] = &bcs->rqueue;
8250 + drv->bch_l2l1(drv->argl1, bc, PH_ACTIVATE | REQUEST,
8253 + drv->bsk[bc] = NULL;
8254 + drv->brq[bc] = NULL;
8258 +/******************************/
8259 +/* Layer2 -> Layer 1 Transfer */
8260 +/******************************/
8262 +hfcusb_b_l2l1(struct PStack *st, int pr, void *arg)
8264 + struct sk_buff *skb = arg;
8265 + struct hisax_drvreg *drv = st->l1.bcs->cs->hw.hfcusb.drv;
8269 + case (PH_DATA | REQUEST):
8270 + save_flags(flags);
8272 + if (st->l1.bcs->tx_skb) {
8273 + skb_queue_tail(&st->l1.bcs->squeue, skb);
8274 + restore_flags(flags);
8276 + st->l1.bcs->tx_skb = skb;
8277 + st->l1.bcs->cs->BC_Send_Data(st->l1.bcs);
8278 + restore_flags(flags);
8281 + case (PH_PULL | INDICATION):
8282 + if (st->l1.bcs->tx_skb) {
8283 + printk(KERN_WARNING
8284 + "hfc_l2l1: this shouldn't happen\n");
8287 + save_flags(flags);
8289 + st->l1.bcs->tx_skb = skb;
8290 + st->l1.bcs->cs->BC_Send_Data(st->l1.bcs);
8291 + restore_flags(flags);
8293 + case (PH_PULL | REQUEST):
8294 + if (!st->l1.bcs->tx_skb) {
8295 + test_and_clear_bit(FLG_L1_PULL_REQ,
8297 + st->l1.l1l2(st, PH_PULL | CONFIRM, NULL);
8299 + test_and_set_bit(FLG_L1_PULL_REQ,
8302 + case (PH_ACTIVATE | REQUEST):
8304 + test_and_set_bit(BC_FLG_ACTIV,
8305 + &st->l1.bcs->Flag);
8306 + mode_hfcusb(st->l1.bcs, st->l1.mode,
8308 + l1_msg_b(st, pr, arg);
8311 + case (PH_DEACTIVATE | REQUEST):
8312 + l1_msg_b(st, pr, arg);
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);
8324 +/******************************************/
8325 +/* deactivate B-channel access and queues */
8326 +/******************************************/
8328 +close_hfcusb(struct BCState *bcs)
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);
8342 +/*************************************/
8343 +/* init B-channel queues and control */
8344 +/*************************************/
8346 +open_hfcusbstate(struct IsdnCardState *cs, struct BCState *bcs)
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);
8352 + bcs->tx_skb = NULL;
8353 + test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag);
8359 +/*********************************/
8360 +/* inits the stack for B-channel */
8361 +/*********************************/
8363 +setstack_2b(struct PStack *st, struct BCState *bcs)
8365 + bcs->channel = st->l1.bc;
8366 + if (open_hfcusbstate(st->l1.hardware, bcs))
8369 + st->l2.l2l1 = hfcusb_b_l2l1;
8370 + setstack_manager(st);
8372 + setstack_l1_B(st);
8376 +/********************************/
8377 +/* called for card init message */
8378 +/********************************/
8380 +inithfcusb(struct IsdnCardState *cs)
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);
8394 +/*******************************************/
8395 +/* handle card messages from control layer */
8396 +/*******************************************/
8398 +hfcusb_card_msg(struct IsdnCardState *cs, int mt, void *arg)
8400 + if (cs->debug & L1_DEB_ISAC)
8401 + debugl1(cs, "HFCUSB: card_msg %x", mt);
8406 + case CARD_RELEASE:
8416 + HiSax_closecard(int cardnr);
8417 +/*****************************/
8418 +/* release a driver instance */
8419 +/* called when hardware is */
8420 +/* no longer present. */
8421 +/*****************************/
8423 +release_hfcdrv(void *arg)
8425 + struct IsdnCardState *cs = (struct IsdnCardState *) arg;
8427 + cs->hw.hfcusb.drv = NULL; /* disable any further use of driver */
8428 + HiSax_closecard(cs->cardnr);
8429 +} /* release_hfcdrv */
8431 +/*********************************************/
8432 +/* called once when a new device is detected */
8433 +/* initialises local data */
8434 +/*********************************************/
8436 +setup_hfc_usb(struct IsdnCard *card)
8438 + struct IsdnCardState *cs = card->cs;
8440 + struct hisax_drvreg *usbdrv =
8441 + (struct hisax_drvreg *) cs->hw.hfcusb.drv;
8444 + return (0); /* no driver data present */
8446 + strcpy(tmp, hfcusb_revision);
8447 + printk(KERN_INFO "HiSax: HFC-USB driver Rev. %s\n",
8448 + HiSax_getrev(tmp));
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 */
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
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 $
8467 * low level stuff for hfcs based cards (Teles3c, ACER P10)
8471 #define __NO_VERSION__
8472 #include <linux/init.h>
8473 -#include <linux/isapnp.h>
8475 #include "hfc_2bds0.h"
8478 extern const char *CardType[];
8480 -static const char *hfcs_revision = "$Revision: 1.1.4.1 $";
8481 +static const char *hfcs_revision = "$Revision: 1.10 $";
8484 hfcs_interrupt(int intno, void *dev_id, struct pt_regs *regs)
8485 @@ -140,36 +139,6 @@ hfcs_card_msg(struct IsdnCardState *cs,
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" },
8515 -static struct isapnp_device_id *hdev = &hfc_ids[0];
8516 -static struct pci_bus *pnp_c __devinitdata = NULL;
8520 setup_hfcs(struct IsdnCard *card)
8522 @@ -178,46 +147,6 @@ setup_hfcs(struct IsdnCard *card)
8524 strcpy(tmp, hfcs_revision);
8525 printk(KERN_INFO "HiSax: HFC-S driver Rev. %s\n", HiSax_getrev(tmp));
8528 - if (!card->para[1] && isapnp_present()) {
8529 - struct pci_bus *pb;
8530 - struct pci_dev *pd;
8532 - while(hdev->card_vendor) {
8533 - if ((pb = isapnp_find_card(hdev->card_vendor,
8534 - hdev->card_device, pnp_c))) {
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);
8542 - pd->deactivate(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);
8554 - printk(KERN_ERR "HFC PnP: PnP error card found, no device\n");
8560 - if (!hdev->card_vendor) {
8561 - printk(KERN_INFO "HFC PnP: no ISAPnP card found\n");
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
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 $
8577 * Basic declarations, defines and prototypes
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>
8587 #define ERROR_STATISTIC
8590 #define DL_DATA 0x0220
8591 #define DL_FLUSH 0x0224
8592 #define DL_UNIT_DATA 0x0230
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
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;
8612 +#ifdef CONFIG_HISAX_HFC_USB
8614 + void *drv; /* pointer to driver structure */
8622 @@ -838,17 +842,6 @@ struct w6692_chip {
8626 -struct amd7930_chip {
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);
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;
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;
8658 @@ -967,6 +962,8 @@ struct IsdnCardState {
8662 +#define HISAX_MAX_CARDS 8
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
8678 @@ -1267,10 +1264,6 @@ struct IsdnCardState {
8679 #define CARD_NETJET_U 0
8682 -#ifdef CONFIG_HISAX_ENTERNOW_PCI
8683 -#define CARD_FN_ENTERNOW_PCI 1
8686 #define TEI_PER_CARD 1
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
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); \
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
8709 * o clean up debugging
8710 - * o tx_skb at PH_DEACTIVATE time
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>
8724 -#include <asm/io.h>
8726 #include "hisax_fcpcipnp.h"
8727 +#include "hisax_isac.h"
8730 #define __debug_variable debug
8731 @@ -46,10 +43,14 @@ static int debug = 0;
8732 MODULE_PARM(debug, "i");
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");
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
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[]
8750 MODULE_DEVICE_TABLE(pci, fcpci_ids);
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);
8759 static int protocol = 2; /* EURO-ISDN Default */
8760 MODULE_PARM(protocol, "i");
8761 -MODULE_LICENSE("GPL");
8763 +static LIST_HEAD(adapter_list);
8765 // ----------------------------------------------------------------------
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",
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;
8780 - DBG(0x1000, " port %#x, value %#x",
8781 + DBG(0x1000, __FUNCTION__ " port %#x, value %#x",
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",
8794 @@ -252,7 +254,7 @@ static void fcpci2_write_isac(struct isa
8795 struct fritz_adapter *adapter = isac->priv;
8796 unsigned long flags;
8798 - DBG(0x1000, " port %#x, value %#x",
8799 + DBG(0x1000, __FUNCTION__ " port %#x, value %#x",
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_
8805 DBG(0x40, "hdlc_fill_fifo");
8813 @@ -515,7 +520,6 @@ static inline void hdlc_xdu_irq(struct f
8815 skb_push(bcs->tx_skb, bcs->tx_cnt);
8817 - hdlc_fill_fifo(bcs);
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);
8825 -static void hdlc_irq_one(struct fritz_bcs *bcs, u32 stat)
8826 +static void hdlc_irq(struct fritz_bcs *bcs, u32 stat)
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
8834 -static inline void hdlc_irq(struct fritz_adapter *adapter)
8835 +static inline void hdlc_interrupt(struct fritz_adapter *adapter)
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);
8848 @@ -584,14 +588,14 @@ static void modehdlc(struct fritz_bcs *b
8849 adapter->write_ctrl(bcs, 5);
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;
8861 - bcs->tx_skb = NULL;
8862 - if (mode == L1_MODE_TRANS)
8863 - bcs->ctrl.sr.mode = HDLC_MODE_TRANS;
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 *
8872 DBG(2, "STATUS0 %#x", val);
8873 if (val & AVM_STATUS0_IRQ_ISAC)
8874 - isacsx_irq(&adapter->isac);
8875 + isacsx_interrupt(&adapter->isac);
8877 if (val & AVM_STATUS0_IRQ_HDLC)
8878 - hdlc_irq(adapter);
8879 + hdlc_interrupt(adapter);
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
8885 DBG(2, "sval %#x", sval);
8886 if (!(sval & AVM_STATUS0_IRQ_ISAC))
8887 - isac_irq(&adapter->isac);
8888 + isac_interrupt(&adapter->isac);
8890 if (!(sval & AVM_STATUS0_IRQ_HDLC))
8891 - hdlc_irq(adapter);
8892 + hdlc_interrupt(adapter);
8895 // ----------------------------------------------------------------------
8896 @@ -681,11 +685,6 @@ static inline void fcpci_init(struct fri
8898 outb(AVM_STATUS0_DIS_TIMER | AVM_STATUS0_RES_TIMER |
8899 AVM_STATUS0_ENA_IRQ, adapter->io + AVM_STATUS0);
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 */
8907 // ----------------------------------------------------------------------
8908 @@ -693,6 +692,7 @@ static inline void fcpci_init(struct fri
8909 static int __devinit fcpcipnp_setup(struct fritz_adapter *adapter)
8912 + struct pci_dev *pdev = adapter->pci_dev;
8916 @@ -700,21 +700,21 @@ static int __devinit fcpcipnp_setup(stru
8917 isac_init(&adapter->isac); // FIXME is this okay now
8920 - if (!request_region(adapter->io, 32, "fcpcipnp"))
8921 + if (!request_region(adapter->io, 32, "hisax_fcpcipnp"))
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);
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);
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);
8945 @@ -808,11 +808,23 @@ static int __devinit fcpcipnp_setup(stru
8947 static void __devexit fcpcipnp_release(struct fritz_adapter *adapter)
8949 + struct pci_dev *pdev = adapter->pci_dev;
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);
8958 + switch (adapter->type) {
8959 + case AVM_FRITZ_PCI:
8960 + case AVM_FRITZ_PCIV2:
8961 + pci_disable_device(pdev);
8963 + case AVM_FRITZ_PNP:
8964 + pdev->deactivate(pdev);
8969 // ----------------------------------------------------------------------
8970 @@ -830,6 +842,8 @@ new_adapter(struct pci_dev *pdev)
8972 memset(adapter, 0, sizeof(struct fritz_adapter));
8974 + adapter->pci_dev = pdev;
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;
8983 + list_add(&adapter->list, &adapter_list);
8985 pci_set_drvdata(pdev, adapter);
8987 @@ -854,6 +869,7 @@ new_adapter(struct pci_dev *pdev)
8988 static void delete_adapter(struct fritz_adapter *adapter)
8990 hisax_unregister(&adapter->isac.hisax_d_if);
8991 + list_del(&adapter->list);
8995 @@ -863,12 +879,15 @@ static int __devinit fcpci_probe(struct
8996 struct fritz_adapter *adapter;
8999 + printk(KERN_INFO "hisax_fcpcipnp: found adapter %s at %s\n",
9000 + (char *) ent->driver_data, pdev->slot_name);
9003 adapter = new_adapter(pdev);
9007 - if (pdev->device == PCI_DEVICE_ID_AVM_A1_V2)
9008 + if (pdev->device == 0x0e00)
9009 adapter->type = AVM_FRITZ_PCIV2;
9011 adapter->type = AVM_FRITZ_PCI;
9012 @@ -876,12 +895,7 @@ static int __devinit fcpci_probe(struct
9013 retval = pci_enable_device(pdev);
9017 adapter->io = pci_resource_start(pdev, 1);
9018 - adapter->irq = pdev->irq;
9020 - printk(KERN_INFO "hisax_fcpcipnp: found adapter %s at %s\n",
9021 - (char *) ent->driver_data, pdev->slot_name);
9023 retval = fcpcipnp_setup(adapter);
9025 @@ -901,6 +915,9 @@ static int __devinit fcpnp_probe(struct
9026 struct fritz_adapter *adapter;
9029 + printk(KERN_INFO "hisax_fcpcipnp: found adapter %s\n",
9030 + (char *) ent->driver_data);
9033 adapter = new_adapter(pdev);
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;
9041 - printk(KERN_INFO "hisax_fcpcipnp: found adapter %s at IO %#x irq %d\n",
9042 - (char *) ent->driver_data, adapter->io, adapter->irq);
9044 + pdev->irq = pdev->irq_resource[0].start;
9046 retval = fcpcipnp_setup(adapter);
9049 @@ -929,43 +943,35 @@ static int __devinit fcpnp_probe(struct
9053 -static void __devexit fcpci_remove(struct pci_dev *pdev)
9055 - struct fritz_adapter *adapter = pci_get_drvdata(pdev);
9057 - fcpcipnp_release(adapter);
9058 - pci_disable_device(pdev);
9059 - delete_adapter(adapter);
9062 -static void __devexit fcpnp_remove(struct pci_dev *pdev)
9063 +static void __devexit fcpcipnp_remove(struct pci_dev *pdev)
9065 struct fritz_adapter *adapter = pci_get_drvdata(pdev);
9067 fcpcipnp_release(adapter);
9068 - pdev->deactivate(pdev);
9069 delete_adapter(adapter);
9072 static struct pci_driver fcpci_driver = {
9074 - probe: fcpci_probe,
9075 - remove: __devexit_p(fcpci_remove),
9077 + probe: fcpci_probe,
9078 + remove: fcpcipnp_remove,
9079 id_table: fcpci_ids,
9082 static struct isapnp_driver fcpnp_driver = {
9084 - probe: fcpnp_probe,
9085 - remove: __devexit_p(fcpnp_remove),
9087 + probe: fcpnp_probe,
9088 + remove: fcpcipnp_remove,
9089 id_table: fcpnp_ids,
9092 -static int __init hisax_fcpcipnp_init(void)
9093 +static LIST_HEAD(isapnp_drivers);
9095 +static int __init hisax_fcpci_init(void)
9097 int retval, pci_nr_found;
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");
9102 retval = pci_register_driver(&fcpci_driver);
9104 @@ -976,15 +982,14 @@ static int __init hisax_fcpcipnp_init(vo
9106 goto out_unregister_pci;
9108 -#if !defined(CONFIG_HOTPLUG) || defined(MODULE)
9109 +#if !defined(CONFIG_HOTPLUG) && defined(MODULE)
9110 if (pci_nr_found + retval == 0) {
9112 goto out_unregister_isapnp;
9117 -#if !defined(CONFIG_HOTPLUG) || defined(MODULE)
9118 +#if !defined(CONFIG_HOTPLUG) && defined(MODULE)
9119 out_unregister_isapnp:
9120 isapnp_unregister_driver(&fcpnp_driver);
9122 @@ -994,11 +999,15 @@ static int __init hisax_fcpcipnp_init(vo
9126 -static void __exit hisax_fcpcipnp_exit(void)
9127 +static void __exit hisax_fcpci_exit(void)
9129 isapnp_unregister_driver(&fcpnp_driver);
9130 pci_unregister_driver(&fcpci_driver);
9133 -module_init(hisax_fcpcipnp_init);
9134 -module_exit(hisax_fcpcipnp_exit);
9135 +module_init(hisax_fcpci_init);
9136 +module_exit(hisax_fcpci_exit);
9139 +#include "hisax_isapnp.c"
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 {
9148 struct fritz_adapter {
9149 + struct list_head list;
9150 + struct pci_dev *pci_dev;
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
9164 static int debug = 1;
9165 MODULE_PARM(debug, "i");
9167 -static char *ISACVer[] = {
9168 +static char *ISACVer[] __devinitdata = {
9172 @@ -42,10 +42,6 @@ static char *ISACVer[] = {
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");
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
9187 -static void isac_version(struct isac *cs)
9188 +static void __devinit isac_version(struct isac *cs)
9192 @@ -602,7 +598,7 @@ static inline void isac_exi_interrupt(st
9196 -void isac_irq(struct isac *isac)
9197 +void isac_interrupt(struct isac *isac)
9201 @@ -635,8 +631,6 @@ void isac_irq(struct isac *isac)
9202 if (val & ISAC_ISTA_SIN) {
9203 DBG(DBG_WARN, "SIN");
9205 - isac->write_isac(isac, ISAC_MASK, 0xff);
9206 - isac->write_isac(isac, ISAC_MASK, 0x00);
9209 // ======================================================================
9210 @@ -742,7 +736,7 @@ static inline void isacsx_icd_interrupt(
9214 -void isacsx_irq(struct isac *isac)
9215 +void isacsx_interrupt(struct isac *isac)
9219 @@ -755,7 +749,7 @@ void isacsx_irq(struct isac *isac)
9220 isacsx_cic_interrupt(isac);
9223 -void isac_init(struct isac *isac)
9224 +void __devinit isac_init(struct isac *isac)
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);
9232 -void isac_setup(struct isac *isac)
9233 +void __devinit isac_setup(struct isac *isac)
9237 @@ -781,7 +775,7 @@ void isac_setup(struct isac *isac)
9239 isac->write_isac(isac, ISAC_MASK, 0xff);
9241 - if (test_bit(ISAC_IOM1, &isac->flags)) {
9242 + if (test_bit(HW_IOM1, &isac->flags)) {
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);
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);
9255 @@ -888,10 +882,10 @@ EXPORT_SYMBOL(isac_init);
9256 EXPORT_SYMBOL(isac_d_l2l1);
9258 EXPORT_SYMBOL(isacsx_setup);
9259 -EXPORT_SYMBOL(isacsx_irq);
9260 +EXPORT_SYMBOL(isacsx_interrupt);
9262 EXPORT_SYMBOL(isac_setup);
9263 -EXPORT_SYMBOL(isac_irq);
9264 +EXPORT_SYMBOL(isac_interrupt);
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
9273 #define TIMER3_VALUE 7000
9274 #define MAX_DFRAME_LEN_L1 300
9276 -#define ISAC_IOM1 0
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);
9284 void isac_setup(struct isac *isac);
9285 -void isac_irq(struct isac *isac);
9286 +void isac_interrupt(struct isac *isac);
9288 void isacsx_setup(struct isac *isac);
9289 -void isacsx_irq(struct isac *isac);
9290 +void isacsx_interrupt(struct isac *isac);
9293 Index: linux-2.4.35.4/drivers/isdn/hisax/hisax_isapnp.c
9294 ===================================================================
9296 +++ linux-2.4.35.4/drivers/isdn/hisax/hisax_isapnp.c
9299 +static const struct isapnp_device_id *
9300 +isapnp_match_device(const struct isapnp_device_id *ids, struct pci_dev *dev)
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))
9316 + * pci_dev_driver - get the pci_driver of a device
9317 + * @dev: the device to query
9319 + * Returns the appropriate pci_driver structure or %NULL if there is no
9320 + * registered driver for the device.
9322 +struct pci_driver *isapnp_dev_driver(const struct pci_dev *dev)
9324 + return dev->driver;
9327 +static int isapnp_announce_device(struct isapnp_driver *drv, struct pci_dev *dev)
9329 + const struct isapnp_device_id *id;
9334 + if (drv->id_table) {
9335 + id = isapnp_match_device(drv->id_table, dev);
9343 +// dev_probe_lock();
9344 + if (drv->probe(dev, id) >= 0) {
9345 + dev->driver = (struct pci_driver *) drv;
9348 +// dev_probe_unlock();
9354 + * FIXME pci_register_driver - register a new pci driver
9355 + * @drv: the driver structure to register
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.
9362 +int isapnp_register_driver(struct isapnp_driver *drv)
9364 + struct pci_dev *dev;
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);
9378 + * pci_unregister_driver - unregister a pci driver
9379 + * @drv: the driver structure to unregister
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
9387 +void isapnp_unregister_driver(struct isapnp_driver *drv)
9389 + struct pci_dev *dev;
9393 + list_del(&drv->node);
9394 + isapnp_for_each_dev(dev) {
9395 + if (dev->driver == (struct pci_driver *) drv) {
9398 + dev->driver = NULL;
9403 Index: linux-2.4.35.4/drivers/isdn/hisax/hisax_isapnp.h
9404 ===================================================================
9406 +++ linux-2.4.35.4/drivers/isdn/hisax/hisax_isapnp.h
9408 +#ifndef __HISAX_ISAPNP_H__
9409 +#define __HISAX_ISAPNP_H__
9411 +#include <linux/isapnp.h>
9413 +#ifdef COMPAT_NEED_ISAPNP_DRIVER
9414 +struct isapnp_driver {
9415 + struct list_head node;
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) */
9424 +int isapnp_register_driver(struct isapnp_driver *drv);
9425 +void isapnp_unregister_driver(struct isapnp_driver *drv);
9429 +static inline int isapnp_register_driver(struct isapnp_driver *drv)
9434 +static inline void isapnp_unregister_driver(struct isapnp_driver *drv)
9441 Index: linux-2.4.35.4/drivers/isdn/hisax/hisax_loadable.h
9442 ===================================================================
9444 +++ linux-2.4.35.4/drivers/isdn/hisax/hisax_loadable.h
9446 +/* $Id: hisax_loadable.h,v 2.1 2001/06/08 22:19:16 werner Exp $
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
9453 + * Copyright 2001 by Werner Cornelius (werner@isdn4linux.de)
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.
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.
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.
9471 +#include <linux/types.h>
9472 +#include <linux/skbuff.h>
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
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 */
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 */
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 */
9506 + char *drvname; /* driver name for hisax usage */
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 */
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
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 $
9528 * HSCX specific routines
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
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 $
9538 * HSCX specific defines
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
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 $
9548 * low level b-channel stuff for Siemens HSCX
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
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 $
9558 * ICC specific routines
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
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 $
9568 * ICC specific routines
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
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 $
9578 * IPAC specific defines
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
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 $
9588 * ISAC specific routines
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
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 $
9598 * ISAC specific defines
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
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 $
9608 * isar.c ISAR (Siemens PSB 7110) specific routines
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" };
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
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);
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,
9636 @@ -414,7 +412,6 @@ isar_load_firmware(struct IsdnCardState
9643 restore_flags(flags);
9644 @@ -428,21 +425,6 @@ reterror:
9649 -ll_deliver_faxstat(struct BCState *bcs, u_char status)
9652 - struct Channel *chanp = (struct Channel *) bcs->st->lli.userdata;
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);
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;
9673 sendmsg(cs, SET_DPS(bcs->hw.isar.dpath) |
9674 @@ -609,6 +592,7 @@ isar_rcv_frame(struct IsdnCardState *cs,
9677 printk(KERN_WARNING "HiSax: skb out of memory\n");
9678 + cs->BC_Write_Reg(cs, 1, ISAR_IIA, 0);
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);
9686 - if (ireg->cmsb & HDLC_FSD) {
9687 + if (ireg->cmsb & HDLC_FSD)
9688 bcs->hw.isar.rcvidx = 0;
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");
9702 @@ -658,7 +639,6 @@ isar_rcv_frame(struct IsdnCardState *cs,
9703 isar_sched_event(bcs, B_RCVBUFREADY);
9705 isar_sched_event(bcs, B_LL_OK);
9706 - test_and_clear_bit(BC_FLG_FRH_WAIT, &bcs->Flag);
9708 bcs->hw.isar.rcvidx = 0;
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);
9724 + isar_sched_event(bcs, B_LL_NOCARRIER);
9728 @@ -977,6 +956,21 @@ isar_pump_statev_modem(struct BCState *b
9733 +ll_deliver_faxstat(struct BCState *bcs, u_char status)
9736 + struct Channel *chanp = (struct Channel *) bcs->st->lli.userdata;
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);
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) {
9755 switch(bcs->hw.isar.newcmd) {
9757 bcs->hw.isar.state = STFAX_READY;
9759 - case PCTRL_CMD_FTM:
9762 + case PCTRL_CMD_FTM:
9764 sendmsg(cs, dps | ISAR_HIS_PUMPCTRL,
9765 PCTRL_CMD_SILON, 1, &p1);
9766 bcs->hw.isar.state = STFAX_SILDET;
9768 - case PCTRL_CMD_FRM:
9769 - if (frm_extra_delay)
9770 - mdelay(frm_extra_delay);
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");
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);
9790 - if (test_and_clear_bit(BC_FLG_FTI_FTS, &bcs->Flag)) {
9791 - isar_sched_event(bcs, B_LL_OK);
9796 @@ -1303,7 +1288,7 @@ setup_pump(struct BCState *bcs) {
9798 param[5] = PV32P6_ATN;
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) {
9807 param[1] = PFAXP2_ATN;
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) {
9820 sendmsg(cs, dps | ISAR_HIS_SARTCFG, SMODE_HDLC, 1,
9822 @@ -1359,9 +1345,6 @@ setup_sart(struct BCState *bcs) {
9823 sendmsg(cs, dps | ISAR_HIS_SARTCFG, ctrl, 2,
9827 - /* SART must not configured with FAX */
9831 sendmsg(cs, dps | ISAR_HIS_BSTREQ, 0, 0, NULL);
9832 @@ -1465,7 +1448,6 @@ isar_pump_cmd(struct BCState *bcs, u_cha
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) {
9839 ctrl = PCTRL_CMD_FTM;
9840 @@ -1489,7 +1471,6 @@ isar_pump_cmd(struct BCState *bcs, u_cha
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) {
9847 ctrl = PCTRL_CMD_FTH;
9848 @@ -1513,7 +1494,6 @@ isar_pump_cmd(struct BCState *bcs, u_cha
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) {
9855 ctrl = PCTRL_CMD_FRM;
9856 @@ -1537,7 +1517,6 @@ isar_pump_cmd(struct BCState *bcs, u_cha
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) {
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;
9868 - case ISDN_FAXPUMP_HALT:
9869 - bcs->hw.isar.state = STFAX_NULL;
9871 - ctrl = PCTRL_CMD_HALT;
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);
9879 case (PH_DEACTIVATE | CONFIRM):
9880 - switch(st->l1.mode) {
9881 - case L1_MODE_TRANS:
9882 - case L1_MODE_HDLC:
9886 - isar_pump_cmd(st->l1.bcs, ISDN_FAXPUMP_HALT, 0);
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,
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);
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);
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);
9919 - if (! test_and_set_bit(BC_FLG_FTI_RUN, &bcs->Flag)) {
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);
9928 - debugl1(cs, "isar FTS=%d and FTI busy",
9929 - ic->parm.aux.para[0]);
9933 - debugl1(cs, "isar FTS=%d and isar.state not ready(%x)",
9934 - ic->parm.aux.para[0],bcs->hw.isar.state);
9936 - ic->command = ISDN_STAT_FAXIND;
9937 - ic->parm.aux.cmd = ISDN_FAX_CLASS1_ERROR;
9938 - cs->iif.statcallb(ic);
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);
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]);
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);
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])
9966 - if ((i < FAXMODCNT) && ((1<<i) & modmask) &&
9967 + if ((FAXMODCNT > i) &&
9968 test_bit(BC_FLG_INIT, &bcs->Flag)) {
9971 @@ -1850,7 +1762,7 @@ isar_auxcmd(struct IsdnCardState *cs, is
9973 case (ISDN_CMD_IOCTL):
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
9982 ll_run(cs, features);
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;
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;
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;
10005 printk(KERN_DEBUG "HiSax: invalid ioctl %d\n",
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
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 $
10015 * ISAR (Siemens PSB 7110) specific defines
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
10027 #define ISAR_HIS_DPS2 0x80
10028 #define SET_DPS(x) ((x<<6) & 0xc0)
10030 -#define ISAR_CMD_TIMERIRQ_OFF 0x20
10031 -#define ISAR_CMD_TIMERIRQ_ON 0x21
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
10041 -#define ISDN_FAXPUMP_HALT 100
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
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 $
10054 * common low level stuff for Siemens Chipsetbased isdn cards
10060 -const char *l1_revision = "$Revision: 1.1.4.1 $";
10061 +const char *l1_revision = "$Revision: 2.46 $";
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
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 $
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
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 $
10083 * Author Karsten Keil
10084 * based on the teles driver from Jan den Ouden
10087 #include "isdnl2.h"
10089 -const char *l2_revision = "$Revision: 1.1.4.1 $";
10090 +const char *l2_revision = "$Revision: 2.30 $";
10092 static void l2m_debug(struct FsmInst *fi, char *fmt, ...);
10094 @@ -1418,8 +1418,8 @@ l2_st5_tei_remove(struct FsmInst *fi, in
10098 - st5_dl_release_l2l3(st);
10099 FsmChangeState(fi, ST_L2_1);
10100 + st5_dl_release_l2l3(st);
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
10109 -/* $Id: isdnl2.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
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
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 $
10122 * Author Karsten Keil
10123 * based on the teles driver from Jan den Ouden
10125 #include "isdnl3.h"
10126 #include <linux/config.h>
10128 -const char *l3_revision = "$Revision: 1.1.4.1 $";
10129 +const char *l3_revision = "$Revision: 2.22 $";
10131 static struct Fsm l3fsm;
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
10138 -/* $Id: isdnl3.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
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
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 $
10151 * low level stuff for Siemens I-Surf/I-Talk cards
10153 @@ -16,11 +16,10 @@
10156 #include "isdnl1.h"
10157 -#include <linux/isapnp.h>
10159 extern const char *CardType[];
10161 -static const char *ISurf_revision = "$Revision: 1.1.4.1 $";
10162 +static const char *ISurf_revision = "$Revision: 1.12 $";
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)
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);
10177 @@ -194,10 +195,6 @@ isurf_auxcmd(struct IsdnCardState *cs, i
10178 return(isar_auxcmd(cs, ic));
10182 -static struct pci_bus *pnp_surf __devinitdata = NULL;
10186 setup_isurf(struct IsdnCard *card)
10188 @@ -215,58 +212,9 @@ setup_isurf(struct IsdnCard *card)
10189 cs->hw.isurf.phymem = card->para[2];
10190 cs->irq = card->para[0];
10193 - struct pci_bus *pb;
10194 - struct pci_dev *pd;
10196 - if (isapnp_present()) {
10198 - if ((pb = isapnp_find_card(
10199 - ISAPNP_VENDOR('S', 'I', 'E'),
10200 - ISAPNP_FUNCTION(0x0010), pnp_surf))) {
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");
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
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);
10232 - printk(KERN_INFO "ISurfPnP: no ISAPnP card found\n");
10236 - printk(KERN_INFO "ISurfPnP: no ISAPnP bus found\n");
10240 printk(KERN_WARNING "HiSax: %s port/mem not set\n",
10241 CardType[card->typ]);
10245 if (check_region(cs->hw.isurf.reset, 1)) {
10246 printk(KERN_WARNING
10247 @@ -277,6 +225,7 @@ setup_isurf(struct IsdnCard *card)
10249 request_region(cs->hw.isurf.reset, 1, "isurf isdn");
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;
10260 + cs->hw.isurf.isar = cs->hw.isurf.phymem + ISURF_ISAR_OFFSET;
10261 + cs->hw.isurf.isac = cs->hw.isurf.phymem + ISURF_ISAC_OFFSET;
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
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 $
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 @@
10278 #define __NO_VERSION__
10279 #include <linux/init.h>
10280 -#include <linux/isapnp.h>
10284 #include "isdnl1.h"
10286 extern const char *CardType[];
10287 -const char *ix1_revision = "$Revision: 1.1.4.1 $";
10288 +const char *ix1_revision = "$Revision: 2.12 $";
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
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." },
10307 -static struct isapnp_device_id *idev = &itk_ids[0];
10308 -static struct pci_bus *pnp_c __devinitdata = NULL;
10313 setup_ix1micro(struct IsdnCard *card)
10314 @@ -246,45 +230,6 @@ setup_ix1micro(struct IsdnCard *card)
10315 if (cs->typ != ISDN_CTYPE_IX1MICROR2)
10319 - if (!card->para[1] && isapnp_present()) {
10320 - struct pci_bus *pb;
10321 - struct pci_dev *pd;
10323 - while(idev->card_vendor) {
10324 - if ((pb = isapnp_find_card(idev->card_vendor,
10325 - idev->card_device, pnp_c))) {
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);
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);
10345 - printk(KERN_ERR "ITK PnP: PnP error card found, no device\n");
10351 - if (!idev->card_vendor) {
10352 - printk(KERN_INFO "ITK PnP: no ISAPnP card found\n");
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
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 $
10368 * JADE stuff (derived from original hscx.c)
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
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 $
10378 * JADE specific defines
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
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 $
10388 * Low level JADE IRQ stuff (derived from original hscx_irq.c)
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
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 $
10398 * German 1TR6 D-channel protocol
10401 #include <linux/ctype.h>
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 $";
10407 #define MsgHead(ptr, cref, mty, 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
10414 -/* $Id: l3_1tr6.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10417 * German 1TR6 D-channel protocol defines
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
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 $
10427 * EURO/DSS1 D-channel protocol
10430 #include <linux/config.h>
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 $";
10436 #define EXT_BEARER_CAPS 1
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
10443 -/* $Id: l3dss1.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10446 * DSS1 (Euro) D-channel protocol defines
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
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 $
10456 * NI1 D-channel protocol
10459 #include <linux/ctype.h>
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 $";
10465 #define EXT_BEARER_CAPS 1
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
10472 -/* $Id: l3ni1.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10475 * NI1 D-channel protocol
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
10482 -/* $Id: lmgr.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10485 * Layermanagement module
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
10492 ------BEGIN PGP SIGNED MESSAGE-----
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
10504 # Read ../../../Documentation/isdn/HiSax.cert for more informations.
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
10533 ------BEGIN PGP SIGNATURE-----
10534 -Version: GnuPG v1.0.6 (GNU/Linux)
10535 -Comment: For info see http://www.gnupg.org
10537 -iD8DBQE9rE91DiY0VZsg4ukRAkKfAJ4xWUfqjc0hW+V+JPue5yr7mrt+RwCdGdSf
10538 -GIKgAEdRLzERmpt/bCCwAbY=
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
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 $
10549 * low level stuff for mic cards
10553 extern const char *CardType[];
10555 -const char *mic_revision = "$Revision: 1.1.4.1 $";
10556 +const char *mic_revision = "$Revision: 1.12 $";
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
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 $
10568 * low level stuff for Traverse Technologie NETJet ISDN cards
10571 * This software may be used and distributed according to the terms
10572 * of the GNU General Public License, incorporated herein by reference.
10574 - * Thanks to Traverse Technologies Australia for documents and information
10576 - * 16-Apr-2002 - led code added - Guy Ellis (guy@traverse.com.au)
10577 + * Thanks to Traverse Technologie Australia for documents and information
10582 #include <asm/io.h>
10583 #include "netjet.h"
10585 -const char *NETjet_revision = "$Revision: 1.1.4.1 $";
10586 +const char *NETjet_revision = "$Revision: 1.29 $";
10588 /* Interface functions */
10590 @@ -135,7 +133,6 @@ void
10591 mode_tiger(struct BCState *bcs, int mode, int bc)
10593 struct IsdnCardState *cs = bcs->cs;
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);
10602 - if (cs->typ == ISDN_CTYPE_NETJET_S)
10606 - led = 0x01 << (6 + led); // convert to mask
10608 - cs->hw.njet.auxd &= led;
10609 - byteout(cs->hw.njet.auxa, cs->hw.njet.auxd);
10612 case (L1_MODE_TRANS):
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)
10622 - led = 0x01 << (6 + led); // convert to mask
10623 - cs->hw.njet.auxd |= led;
10624 - byteout(cs->hw.njet.auxa, cs->hw.njet.auxd);
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);
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);
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
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 $
10651 * NETjet common header file
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
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 $
10661 * low level stuff for Dr. Neuhaus NICCY PnP and NICCY PCI and
10662 * compatible (SAGEM cybermodem)
10663 @@ -22,10 +22,10 @@
10665 #include "isdnl1.h"
10666 #include <linux/pci.h>
10667 -#include <linux/isapnp.h>
10668 +#include <linux/isdn_compat.h>
10670 extern const char *CardType[];
10671 -const char *niccy_revision = "$Revision: 1.1.4.1 $";
10672 +const char *niccy_revision = "$Revision: 1.21 $";
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,
10679 static struct pci_dev *niccy_dev __initdata = NULL;
10681 -static struct pci_bus *pnp_c __devinitdata = NULL;
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)
10691 - if (!card->para[1] && isapnp_present()) {
10692 - struct pci_bus *pb;
10693 - struct pci_dev *pd;
10695 - if ((pb = isapnp_find_card(
10696 - ISAPNP_VENDOR('S', 'D', 'A'),
10697 - ISAPNP_FUNCTION(0x0150), pnp_c))) {
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");
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);
10719 - printk(KERN_INFO "NiccyPnP: no ISAPnP card found\n");
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)
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");
10737 - pci_ioaddr = pci_resource_start(niccy_dev, 1);
10738 + pci_ioaddr = pci_resource_start_io(niccy_dev, 1);
10740 printk(KERN_WARNING "Niccy: No IO-Adr for PCI card found\n");
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
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 $
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 @@
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"
10761 -const char *NETjet_S_revision = "$Revision: 1.1.4.1 $";
10762 +const char *NETjet_S_revision = "$Revision: 2.13 $";
10764 static u_char dummyrr(struct IsdnCardState *cs, int chan, u_char off)
10766 @@ -130,7 +131,6 @@ NETjet_S_card_msg(struct IsdnCardState *
10767 release_io_netjet(cs);
10770 - reset_netjet_s(cs);
10772 clear_pending_isac_ints(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");
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");
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");
10791 - /* end new code */
10793 printk(KERN_WARNING "NETjet-S: No PCI card found\n");
10795 @@ -263,6 +255,7 @@ setup_netjet_s(struct IsdnCard *card)
10797 request_region(cs->hw.njet.base, bytecnt, "netjet-s isdn");
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
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 $
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 @@
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"
10822 -const char *NETjet_U_revision = "$Revision: 1.1.4.1 $";
10823 +const char *NETjet_U_revision = "$Revision: 2.14 $";
10825 static u_char dummyrr(struct IsdnCardState *cs, int chan, u_char off)
10827 @@ -181,7 +182,7 @@ setup_netjet_u(struct IsdnCard *card)
10828 printk(KERN_WARNING "NETspider-U: No IRQ for PCI card found\n");
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");
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
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 $
10844 * code to decode ITU Q.931 call control messages
10846 @@ -197,6 +197,31 @@ struct MessageType mt_n1[] =
10848 #define MT_N1_LEN (sizeof(mt_n1) / sizeof(struct MessageType))
10851 +static struct MessageType fac_1tr6[] =
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"}
10873 +#define FAC_1TR6_LEN (sizeof(fac_1tr6) / sizeof(struct MessageType))
10877 prbits(char *dest, u_char b, int start, int len)
10878 Index: linux-2.4.35.4/drivers/isdn/hisax/rawhdlc.c
10879 ===================================================================
10881 +++ linux-2.4.35.4/drivers/isdn/hisax/rawhdlc.c
10883 +/* $Id: rawhdlc.c,v 1.7 2001/09/24 13:22:57 kai Exp $
10885 + * support routines for cards that don't support HDLC
10887 + * Author Brent Baccala
10888 + * Copyright by Karsten Keil <keil@isdn4linux.de>
10889 + * by Brent Baccala <baccala@FreeSoft.org>
10891 + * This software may be used and distributed according to the terms
10892 + * of the GNU General Public License, incorporated herein by reference.
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.
10899 + * Bit-synchronous HDLC encapsulation is a means of encapsulating packets
10900 + * over a continuously transmitting serial communications link.
10901 + * It looks like this:
10903 + * 11111111101111110...........0111111011111111111
10904 + * iiiiiiiiiffffffffdddddddddddffffffffiiiiiiiiiii
10906 + * i = idle f = flag d = data
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.
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.
10933 + * int make_raw_hdlc_data(u_char *src, u_int slen,
10934 + * u_char *dst, u_int dsize)
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.
10943 + * void init_hdlc_state(struct hdlc_state *stateptr, int mode)
10945 + * Initializes hdlc_state structure before first call to read_raw_hdlc_data
10947 + * mode = 0: Sane mode
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
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)
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.
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.
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.
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.
10988 + * Suggested calling sequence:
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;
10999 + * Test the code in this file as follows:
11000 + * gcc -DDEBUGME -o rawhdlctest rawhdlc.c
11001 + * ./rawhdlctest < rawdata
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:
11007 + * @hexlist = split ' ';
11008 + * while ($hexstr = shift(@hexlist)) {
11009 + * printf "%c", hex($hexstr);
11016 +#include <stdio.h>
11019 +#include <linux/types.h>
11020 +#include <linux/ppp_defs.h>
11021 +#include "rawhdlc.h"
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
11028 +__u16 fcstab[256] =
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
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
11072 +#define HDLC_FLAG_VALUE 0x7e
11075 +#define MAKE_RAW_BYTE for (j=0; j<8; j++) { \
11080 + out_val |= 0x80;\
11083 + out_val &= 0x7f;\
11085 + if (bitcnt==8) {\
11086 + if (d_cnt == dsize) return 0;\
11087 + dst[d_cnt++] = out_val;\
11090 + if (s_one == 5) {\
11092 + out_val &= 0x7f;\
11096 + if (bitcnt==8) {\
11097 + if (d_cnt == dsize) return 0;\
11098 + dst[d_cnt++] = out_val;\
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.
11126 +int make_raw_hdlc_data(u_char *src, u_int slen, u_char *dst, u_int dsize)
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;
11137 + dst[d_cnt++] = HDLC_FLAG_VALUE;
11138 + fcs = PPP_INITFCS;
11139 + for (i=0; i<slen; i++) {
11141 + fcs = PPP_FCS (fcs, val);
11145 + val = fcs & 0xff;
11147 + val = (fcs>>8) & 0xff;
11149 + val = HDLC_FLAG_VALUE;
11150 + for (j=0; j<8; j++) {
11158 + if (d_cnt == dsize) return 0;
11159 + dst[d_cnt++] = out_val;
11165 + while (8>bitcnt++) {
11169 + if (d_cnt == dsize) return 0;
11170 + dst[d_cnt++] = out_val;
11176 +void init_hdlc_state(struct hdlc_state *stateptr, int mode)
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;
11186 +/* Optimization suggestion: A similar state machine could surely
11187 + * be developed for this function as well.
11190 +int read_raw_hdlc_data(struct hdlc_state *saved_state,
11191 + u_char *src, u_int slen, u_char *dst, u_int dsize)
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;
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
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;
11213 + val = src[i_bitcnt >> 3];
11215 + val >>= i_bitcnt & 7;
11218 + /* One bit per loop. Keep going until we've got something to
11219 + * report (retval != 0), or we exhaust the source buffer
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;
11229 + val = src[i_bitcnt >> 3];
11232 + printf("Input byte %d: 0x%2x\n", i_bitcnt>>3, val);
11234 + if (val == 0xff) {
11235 + state = HDLC_ZERO_SEARCH;
11244 + /* printf("Data bit=%d (%d/%d)\n", val&1, i_bitcnt>>3, i_bitcnt&7);*/
11247 + if (state == HDLC_ZERO_SEARCH) {
11252 + state= HDLC_FLAG_SEARCH;
11254 + } else if (state == HDLC_FLAG_SEARCH) {
11258 + state=HDLC_ZERO_SEARCH;
11264 + state=HDLC_FLAG_FOUND;
11268 + } else if (state == HDLC_FLAG_FOUND) {
11272 + state=HDLC_ZERO_SEARCH;
11286 + } else if (r_one!=5) {
11293 + if ((state != HDLC_ZERO_SEARCH) &&
11294 + !(o_bitcnt & 7)) {
11296 + printf("HDLC_FRAME_FOUND at i_bitcnt:%d\n",i_bitcnt);
11298 + state=HDLC_FRAME_FOUND;
11299 + fcs = PPP_INITFCS;
11301 + fcs = PPP_FCS (fcs, r_val);
11303 + } else if (state == HDLC_FRAME_FOUND) {
11307 + state=HDLC_ZERO_SEARCH;
11319 + if (o_bitcnt & 7) {
11320 + /* Alignment error */
11322 + printf("Alignment error\n");
11324 + state=HDLC_FLAG_SEARCH;
11326 + } else if (fcs==PPP_GOODFCS) {
11327 + /* Valid frame */
11328 + state=HDLC_FLAG_FOUND;
11329 + retval = (o_bitcnt>>3)-3;
11333 + printf("CRC error; fcs was 0x%x, should have been 0x%x\n", fcs, PPP_GOODFCS);
11335 + state=HDLC_FLAG_FOUND;
11338 + } else if (r_one==5) {
11350 + if ((state == HDLC_FRAME_FOUND) &&
11351 + !(o_bitcnt & 7)) {
11352 + if ((o_bitcnt>>3)>=dsize) {
11353 + /* Buffer overflow error */
11355 + printf("Buffer overflow error\n");
11358 + state=HDLC_FLAG_SEARCH;
11361 + dst[(o_bitcnt>>3)-1] = r_val;
11362 + fcs = PPP_FCS (fcs, r_val);
11364 + printf("Output byte %d: 0x%02x; FCS 0x%04x\n", (o_bitcnt>>3)-1, r_val, fcs);
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.
11379 + if (retval == 0) {
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;
11399 +char buffer[1024];
11400 +char obuffer[1024];
11406 + struct hdlc_state hdlc_state;
11408 + while((buffer[buflen] = getc(stdin)) != EOF && buflen<1024) buflen++;
11410 + printf("buflen = %d\n", buflen);
11412 + init_hdlc_state(&hdlc_state, 0);
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);
11418 + printf("Frame received: len %d\n", len);
11422 + printf("Done\n");
11426 Index: linux-2.4.35.4/drivers/isdn/hisax/rawhdlc.h
11427 ===================================================================
11429 +++ linux-2.4.35.4/drivers/isdn/hisax/rawhdlc.h
11431 +/* $Id: rawhdlc.h,v 1.5 2001/09/24 13:22:57 kai Exp $
11433 + * Author Brent Baccala
11434 + * Copyright by Brent Baccala <baccala@FreeSoft.org>
11436 + * This software may be used and distributed according to the terms
11437 + * of the GNU General Public License, incorporated herein by reference.
11442 +struct hdlc_state {
11443 + char insane_mode;
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);
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
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 $
11467 * low level stuff for Creatix S0BOX
11470 #include "isdnl1.h"
11472 extern const char *CardType[];
11473 -const char *s0box_revision = "$Revision: 1.1.4.1 $";
11474 +const char *s0box_revision = "$Revision: 2.6 $";
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
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 $
11486 * low level stuff for HST Saphir 1
11489 #include "isdnl1.h"
11491 extern const char *CardType[];
11492 -static char *saphir_rev = "$Revision: 1.1.4.1 $";
11493 +static char *saphir_rev = "$Revision: 1.10 $";
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
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 $
11505 * low level stuff for Sedlbauer cards
11506 * includes support for the Sedlbauer speed star (speed star II),
11507 @@ -48,18 +48,19 @@
11509 #include "isdnl1.h"
11510 #include <linux/pci.h>
11511 -#include <linux/isapnp.h>
11512 +#include <linux/isdn_compat.h>
11514 extern const char *CardType[];
11516 -const char *Sedlbauer_revision = "$Revision: 1.1.4.1 $";
11517 +const char *Sedlbauer_revision = "$Revision: 1.34 $";
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"};
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
11536 #define SEDL_CHIP_TEST 0
11537 #define SEDL_CHIP_ISAC_HSCX 1
11538 @@ -531,21 +533,6 @@ Sedl_card_msg(struct IsdnCardState *cs,
11540 static struct pci_dev *dev_sedl __devinitdata = NULL;
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+" },
11553 -static struct isapnp_device_id *pdev = &sedl_ids[0];
11554 -static struct pci_bus *pnp_c __devinitdata = NULL;
11558 setup_sedlbauer(struct IsdnCard *card)
11560 @@ -581,57 +568,6 @@ setup_sedlbauer(struct IsdnCard *card)
11565 - if (isapnp_present()) {
11566 - struct pci_bus *pb;
11567 - struct pci_dev *pd;
11569 - while(pdev->card_vendor) {
11570 - if ((pb = isapnp_find_card(pdev->card_vendor,
11571 - pdev->card_device, pnp_c))) {
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);
11579 - pd->deactivate(pd);
11580 - pd->activate(pd);
11582 - pd->resource[0].start;
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);
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;
11598 - cs->subtyp = SEDL_SPEED_CARD_WIN;
11599 - cs->hw.sedl.chip = SEDL_CHIP_TEST;
11603 - printk(KERN_ERR "Sedlbauer PnP: PnP error card found, no device\n");
11610 - if (!pdev->card_vendor) {
11611 - printk(KERN_INFO "Sedlbauer PnP: no ISAPnP card found\n");
11615 /* Probe for Sedlbauer speed 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");
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);
11625 printk(KERN_WARNING "Sedlbauer: No PCI card found\n");
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);
11658 @@ -697,7 +636,7 @@ setup_sedlbauer(struct IsdnCard *card)
11660 #endif /* CONFIG_PCI */
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
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 $
11675 * low level stuff for USR Sportster internal TA
11678 #include "isdnl1.h"
11680 extern const char *CardType[];
11681 -const char *sportster_revision = "$Revision: 1.1.4.1 $";
11682 +const char *sportster_revision = "$Revision: 1.16 $";
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 ===================================================================
11689 +++ linux-2.4.35.4/drivers/isdn/hisax/st5481-debug.h
11691 +#define ST5481_DEBUG 0x0
11697 + DEBUG flags. Set compile option ST5481_DEBUG with the following bits set to trace
11698 + the given subsections:
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
11713 +#define DBG(level, format, arg...) \
11714 +if (level & ST5481_DEBUG) \
11715 +printk(KERN_DEBUG __FUNCTION__ ": " format "\n" , ## arg) \
11717 +static inline void
11718 +dump_packet(const char *name,const u_char *data,int pkt_len)
11720 +#define DUMP_HDR_SIZE 200
11721 +#define DUMP_TLR_SIZE 8
11725 + printk(KERN_DEBUG "%s: length=%d,data=",name,pkt_len);
11727 + if (pkt_len > DUMP_HDR_SIZE+ DUMP_TLR_SIZE) {
11728 + len1 = DUMP_HDR_SIZE;
11729 + len2 = DUMP_TLR_SIZE;
11731 + len1 = pkt_len > DUMP_HDR_SIZE ? DUMP_HDR_SIZE : pkt_len;
11734 + for (i = 0; i < len1; ++i) {
11735 + printk ("%.2x", data[i]);
11739 + for (i = pkt_len-DUMP_TLR_SIZE; i < pkt_len; ++i) {
11740 + printk ("%.2x", data[i]);
11745 +#undef DUMP_HDR_SIZE
11746 +#undef DUMP_TLR_SIZE
11749 +static inline void
11750 +dump_iso_packet(const char *name,urb_t *urb)
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;
11762 + len = urb->iso_frame_desc[i].length;
11764 + ofs = urb->iso_frame_desc[i].offset;
11765 + printk(KERN_DEBUG "len=%.2d,ofs=%.3d ",len,ofs);
11767 + data = urb->transfer_buffer+ofs;
11768 + for (j=0; j < len; j++) {
11769 + printk ("%.2x", data[j]);
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)
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)
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)
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)
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)
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)
11813 -#include "isdnhdlc.h"
11814 +#include "st5481_hdlc.h"
11816 #include "hisax_if.h"
11817 #include <linux/skbuff.h>
11818 @@ -236,7 +236,7 @@ printk(KERN_INFO "%s:%s: " format "\n" ,
11822 -/* Generic FIFO structure */
11823 +/* Generic FIFO structure */
11825 u_char r,w,count,size;
11827 @@ -270,7 +270,7 @@ static inline int fifo_add(struct fifo *
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);
11835 spin_unlock_irqrestore(&fifo->lock, flags);
11836 @@ -289,13 +289,13 @@ static inline int fifo_remove(struct fif
11840 - spin_lock_irqsave(&fifo->lock, flags);
11841 + spin_lock_irqsave(&fifo->lock, flags);
11842 if (!fifo->count) {
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);
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 *);
11855 typedef struct ctrl_msg {
11856 - struct usb_ctrlrequest dr;
11858 ctrl_complete_t complete;
11861 @@ -336,7 +336,7 @@ struct st5481_intr {
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 {
11873 struct st5481_b_out {
11874 - struct isdnhdlc_vars hdlc_state;
11875 + struct hdlc_vars hdlc_state;
11876 struct urb *urb[2]; /* double buffering */
11879 @@ -352,7 +352,7 @@ struct st5481_b_out {
11883 - struct isdnhdlc_vars hdlc_state;
11884 + struct hdlc_vars hdlc_state;
11885 struct urb *urb[2]; /* double buffering */
11888 @@ -478,7 +478,7 @@ extern int st5481_debug;
11889 if (level & __debug_variable) dump_iso_packet(__FUNCTION__,urb)
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)
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++];
11913 + memcpy(urb->transfer_buffer+len, skb->data, bytes_sent);
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);
11925 skb_pull(skb, bytes_sent);
11930 b_out->tx_skb = NULL;
11931 B_L1L2(bcs, PH_DATA | CONFIRM, (void *) skb->truesize);
11932 dev_kfree_skb_any(skb);
11935 /* if (!(bcs->tx_skb = skb_dequeue(&bcs->sq))) { */
11936 /* st5481B_sched_event(bcs, B_XMTBUFREADY); */
11938 @@ -99,9 +95,9 @@ static void usb_b_out(struct st5481_bcs
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);
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);
11958 st5481_usb_pipe_reset(adapter, (bcs->channel+1)*2, NULL, NULL);
11960 @@ -279,7 +275,7 @@ static int __devinit st5481_setup_b_out(
11961 usb_b_out_complete, bcs);
11964 -static void st5481_release_b_out(struct st5481_bcs *bcs)
11965 +static void __devexit st5481_release_b_out(struct st5481_bcs *bcs)
11967 struct st5481_b_out *b_out = &bcs->b_out;
11969 @@ -320,7 +316,7 @@ int __devinit st5481_setup_b(struct st54
11971 * Release buffers and URBs for the B channels
11973 -void st5481_release_b(struct st5481_bcs *bcs)
11974 +void __devexit st5481_release_b(struct st5481_bcs *bcs)
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},
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;
12000 if (d_out->fsm.state != ST_DOUT_NORMAL)
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;
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);
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);
12023 if (len < buf_size) {
12024 @@ -413,7 +413,7 @@ static void dout_start_xmit(struct FsmIn
12026 DBG(2,"len=%d",skb->len);
12028 - isdnhdlc_out_init(&d_out->hdlc_state, 1, 0);
12029 + hdlc_out_init(&d_out->hdlc_state, 1, 0);
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];
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);
12046 @@ -673,7 +673,7 @@ static int __devinit st5481_setup_d_out(
12047 usb_d_out_complete, adapter);
12050 -static void st5481_release_d_out(struct st5481_adapter *adapter)
12051 +static void __devexit st5481_release_d_out(struct st5481_adapter *adapter)
12053 struct st5481_d_out *d_out = &adapter->d_out;
12055 @@ -723,7 +723,7 @@ int __devinit st5481_setup_d(struct st54
12059 -void st5481_release_d(struct st5481_adapter *adapter)
12060 +void __devexit st5481_release_d(struct st5481_adapter *adapter)
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
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,
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];
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);
12101 urb->dev = adapter->usb_dev;
12102 @@ -69,11 +69,11 @@ void usb_ctrl_msg(struct st5481_adapter
12104 ctrl_msg = &ctrl->msg_fifo.data[w_index];
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;
12119 @@ -140,17 +140,17 @@ static void usb_ctrl_complete(struct urb
12121 ctrl_msg = (struct ctrl_msg *)urb->setup_packet;
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);
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,
12143 @@ -235,7 +235,7 @@ int __devinit st5481_setup_usb(struct st
12144 struct usb_interface_descriptor *altsetting;
12145 struct usb_endpoint_descriptor *endpoint;
12152 @@ -307,7 +307,7 @@ int __devinit st5481_setup_usb(struct st
12153 * Release buffers and URBs for the interrupt and control
12156 -void st5481_release_usb(struct st5481_adapter *adapter)
12157 +void __devexit st5481_release_usb(struct st5481_adapter *adapter)
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
12165 -void st5481_release_isocpipes(struct urb* urb[2])
12166 +void __devexit st5481_release_isocpipes(struct urb* urb[2])
12170 @@ -484,18 +484,16 @@ static void usb_in_complete(struct urb *
12171 ptr = urb->transfer_buffer;
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);
12178 - for (; len; len--)
12179 - *dest++ = isdnhdlc_bit_rev_tab[*ptr++];
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);
12192 // Good frame received
12193 DBG(4,"count=%d",status);
12194 @@ -549,7 +547,7 @@ int __devinit st5481_setup_in(struct st5
12198 -void st5481_release_in(struct st5481_in *in)
12199 +void __devexit st5481_release_in(struct st5481_in *in)
12203 @@ -562,8 +560,7 @@ void st5481_release_in(struct st5481_in
12205 int st5481_isoc_flatten(struct urb *urb)
12207 - struct iso_packet_descriptor *pipd;
12208 - struct iso_packet_descriptor *pend;
12209 + piso_packet_descriptor_t pipd,pend;
12210 unsigned char *src,*dst;
12213 @@ -624,10 +621,15 @@ void st5481_in_mode(struct st5481_in *in
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);
12222 st5481_usb_pipe_reset(in->adapter, in->ep, NULL, NULL);
12224 + st5481_usb_device_ctrl_msg(in->adapter, in->counter,
12226 + st5481_start_rcv, in);
12228 st5481_usb_device_ctrl_msg(in->adapter, in->counter,
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
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 $
12239 * Author Karsten Keil
12240 * based on the teles driver from Jan den Ouden
12242 #include <linux/init.h>
12243 #include <linux/random.h>
12245 -const char *tei_revision = "$Revision: 1.1.4.1 $";
12246 +const char *tei_revision = "$Revision: 2.20 $";
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
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 $
12258 * low level stuff for TeleInt isdn cards
12262 extern const char *CardType[];
12264 -const char *TeleInt_revision = "$Revision: 1.1.4.1 $";
12265 +const char *TeleInt_revision = "$Revision: 1.16 $";
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
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 $
12277 * low level stuff for Teles Memory IO isdn cards
12281 extern const char *CardType[];
12283 -const char *teles0_revision = "$Revision: 1.1.4.1 $";
12284 +const char *teles0_revision = "$Revision: 2.15 $";
12286 #define TELES_IOMEM_SIZE 0x400
12287 #define byteout(addr,val) outb(val,addr)
12288 @@ -189,8 +189,10 @@ release_io_teles0(struct IsdnCardState *
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);
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)
12309 cs->hw.teles0.membase =
12310 (unsigned long) ioremap(cs->hw.teles0.phymem, TELES_IOMEM_SIZE);
12312 + cs->hw.teles0.membase = cs->hw.teles0.phymem;
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
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 $
12325 * low level stuff for Teles 16.3 & PNP isdn cards
12327 @@ -15,14 +15,13 @@
12329 #define __NO_VERSION__
12330 #include <linux/init.h>
12331 -#include <linux/isapnp.h>
12335 #include "isdnl1.h"
12337 extern const char *CardType[];
12338 -const char *teles3_revision = "$Revision: 1.1.4.1 $";
12339 +const char *teles3_revision = "$Revision: 2.19 $";
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,
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" },
12361 -static struct isapnp_device_id *tdev = &teles_ids[0];
12362 -static struct pci_bus *pnp_c __devinitdata = NULL;
12366 setup_teles3(struct IsdnCard *card)
12368 @@ -286,47 +267,6 @@ setup_teles3(struct IsdnCard *card)
12369 && (cs->typ != ISDN_CTYPE_TELESPCMCIA) && (cs->typ != ISDN_CTYPE_COMPAQ_ISA))
12373 - if (!card->para[1] && isapnp_present()) {
12374 - struct pci_bus *pb;
12375 - struct pci_dev *pd;
12377 - while(tdev->card_vendor) {
12378 - if ((pb = isapnp_find_card(tdev->card_vendor,
12379 - tdev->card_device, pnp_c))) {
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);
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);
12401 - printk(KERN_ERR "Teles PnP: PnP error card found, no device\n");
12407 - if (!tdev->card_vendor) {
12408 - printk(KERN_INFO "Teles PnP: no ISAPnP card found\n");
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
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 $
12424 * low level stuff for Teles PCI isdn cards
12428 #include "isdnl1.h"
12429 #include <linux/pci.h>
12430 +#include <linux/isdn_compat.h>
12432 extern const char *CardType[];
12433 -const char *telespci_revision = "$Revision: 1.1.4.1 $";
12434 +const char *telespci_revision = "$Revision: 2.23 $";
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");
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),
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);
12449 printk(KERN_WARNING "TelesPCI: No PCI card found\n");
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
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 $
12459 * Winbond W6692 specific routines
12462 #include "isdnl1.h"
12463 #include <linux/interrupt.h>
12464 #include <linux/pci.h>
12465 +#include <linux/isdn_compat.h>
12467 /* table entry in the PCI devices list */
12469 @@ -29,20 +30,14 @@ typedef struct {
12471 static const PCI_ENTRY id_list[] =
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}
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
12486 extern const char *CardType[];
12488 -const char *w6692_revision = "$Revision: 1.1.4.1 $";
12489 +const char *w6692_revision = "$Revision: 1.18 $";
12491 #define DBUSY_TIMER_VALUE 80
12493 @@ -675,6 +670,16 @@ setstack_W6692(struct PStack *st, struct
12495 DC_Close_W6692(struct IsdnCardState *cs)
12498 + if (cs->dc.w6692.mon_rx) {
12499 + kfree(cs->dc.w6692.mon_rx);
12500 + cs->dc.w6692.mon_rx = NULL;
12502 + if (cs->dc.w6692.mon_tx) {
12503 + kfree(cs->dc.w6692.mon_tx);
12504 + cs->dc.w6692.mon_tx = NULL;
12510 @@ -865,38 +870,31 @@ setstack_w6692(struct PStack *st, struct
12514 -void resetW6692(struct IsdnCardState *cs)
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
12531 - cs->writeW6692(cs, W_PCTL, 0x80);
12532 - cs->writeW6692(cs, W_XDATA, 0x00);
12536 void __init initW6692(struct IsdnCardState *cs, int part)
12539 cs->tqueue.routine = (void *) (void *) W6692_bh;
12540 cs->setstack_d = setstack_W6692;
12541 cs->DC_Close = DC_Close_W6692;
12543 + cs->dc.w6692.mon_tx = NULL;
12544 + cs->dc.w6692.mon_rx = NULL;
12546 cs->dbusytimer.function = (void *) dbusy_timer_handler;
12547 cs->dbusytimer.data = (long) cs;
12548 init_timer(&cs->dbusytimer);
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);
12555 + cs->dc.w6692.mocr = 0xaa;
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;
12565 @@ -963,14 +961,9 @@ w6692_card_msg(struct IsdnCardState *cs,
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);
12580 @@ -1013,7 +1006,6 @@ setup_w6692(struct IsdnCard *card)
12582 if (pci_enable_device(dev_w6692))
12584 - cs->subtyp = 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;
12600 + pci_ioaddr = pci_resource_start_io(dev_w6692, 1);
12603 printk(KERN_WARNING "W6692: No PCI card found\n");
12604 @@ -1047,18 +1032,18 @@ setup_w6692(struct IsdnCard *card)
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);
12621 request_region(cs->hw.w6692.iobase, 256,
12622 - id_list[cs->subtyp].card_name);
12623 + id_list[id_idx].card_name);
12626 printk(KERN_WARNING "HiSax: W6692 and NO_PCI_BIOS\n");
12627 @@ -1068,7 +1053,7 @@ setup_w6692(struct IsdnCard *card)
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);
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
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 $
12644 * Winbond W6692 specific defines
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
12651 -/* $Id: boardergo.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12653 +/* $Id: boardergo.c,v 1.9 2001/07/19 20:39:51 kai Exp $
12655 * Linux driver for HYSDN cards, specific routines for ergo type boards.
12657 - * Author Werner Cornelius (werner@titro.de) for Hypercope GmbH
12658 - * Copyright 1999 by Werner Cornelius (werner@titro.de)
12660 - * This software may be used and distributed according to the terms
12661 - * of the GNU General Public License, incorporated herein by reference.
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.
12667 + * written by Werner Cornelius (werner@titro.de) for Hypercope GmbH
12669 + * Copyright 1999 by Werner Cornelius (werner@titro.de)
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.
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.
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.
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>
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 */
12706 - save_flags(flags);
12707 - cli(); /* no further irqs allowed */
12708 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
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 */
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);
12720 - restore_flags(flags);
12721 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12722 } /* ergo_interrupt */
12724 /******************************************************************************/
12725 @@ -83,17 +96,15 @@ ergo_irq_bh(hysdn_card * card)
12726 return; /* invalid call */
12728 dpr = card->dpram; /* point to DPRAM */
12729 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
12731 - save_flags(flags);
12733 if (card->hw_lock) {
12734 - restore_flags(flags); /* hardware currently unavailable */
12735 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12738 card->hw_lock = 1; /* we now lock the hardware */
12741 - sti(); /* reenable other ints */
12742 again = 0; /* assume loop not to be repeated */
12744 if (!dpr->ToHyFlag) {
12745 @@ -113,15 +124,13 @@ ergo_irq_bh(hysdn_card * card)
12746 again = 1; /* restart loop */
12748 } /* a message has arrived for us */
12749 - cli(); /* no further ints */
12752 dpr->ToPcInt = 1; /* interrupt to E1 for all cards */
12754 card->hw_lock = 0; /* free hardware again */
12755 } while (again); /* until nothing more to do */
12757 - restore_flags(flags);
12758 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12759 } /* ergo_irq_bh */
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);
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 */
12777 - restore_flags(flags);
12778 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12779 } /* ergo_stopcard */
12781 /**************************************************************************/
12782 @@ -163,20 +170,17 @@ ergo_set_errlog_state(hysdn_card * card,
12783 card->err_log_state = ERRLOG_STATE_OFF; /* must be off */
12786 - save_flags(flags);
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 */
12797 card->err_log_state = ERRLOG_STATE_START; /* request start */
12799 card->err_log_state = ERRLOG_STATE_STOP; /* request stop */
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 */
12809 byteout(card->iobase + PCI9050_USER_IO, PCI9050_E1_RUN); /* start E1 processor */
12810 - /* the interrupts are still masked */
12813 set_current_state(TASK_INTERRUPTIBLE);
12814 schedule_timeout((20 * HZ) / 1000); /* Timeout 20ms */
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 */
12822 /* try until all bytes written or error */
12823 i = 0x1000; /* timeout value */
12824 @@ -358,9 +358,7 @@ ergo_waitpofready(struct HYSDN_CARD *car
12826 if (card->debug_flags & LOG_POF_RECORD)
12827 hysdn_addlog(card, "ERGO: pof boot success");
12828 - save_flags(flags);
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 */
12838 dpr->ToPcInt = 1; /* interrupt to E1 for all cards */
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)))
12845 @@ -387,7 +384,6 @@ ergo_waitpofready(struct HYSDN_CARD *car
12846 #endif /* CONFIG_HYSDN_CAPI */
12847 return (0); /* success */
12848 } /* data has arrived */
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
12858 -/* $Id: boardergo.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12861 * Linux driver for HYSDN cards, definitions for ergo type boards (buffers..).
12867 +#include <linux/isdn_compat.h>
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
12876 -/* $Id: hycapi.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12879 * Linux driver for HYSDN cards, CAPI2.0-Interface.
12882 #include "hysdn_defs.h"
12883 #include <linux/kernelcapi.h>
12885 -static char hycapi_revision[]="$Revision: 1.1.4.1 $";
12886 +static char hycapi_revision[]="$Revision$";
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
12895 -/* $Id: hysdn_boot.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
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);
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 */
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
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 $
12917 * Linux driver for HYSDN cards
12918 * global definitions and exported vars and functions.
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>
12926 +#define HYSDN_SPIN_LOCK(a,b) spin_lock(a)
12927 +#define HYSDN_SPIN_UNLOCK(a,b) spin_unlock(a)
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;
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
12944 -/* $Id: hysdn_init.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12947 * Linux driver for HYSDN cards, init functions.
12951 #include "hysdn_defs.h"
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 */
12960 MODULE_DEVICE_TABLE(pci, hysdn_pci_tbl);
12962 MODULE_DESCRIPTION("ISDN4Linux: Driver for HYSDN cards");
12963 MODULE_AUTHOR("Werner Cornelius");
12964 MODULE_LICENSE("GPL");
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 */
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
12992 -/* $Id: hysdn_net.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12995 * Linux driver for HYSDN cards, net (ethernet type) handling routines.
12997 @@ -29,7 +29,7 @@ unsigned int hynet_enable = 0xffffffff;
12998 MODULE_PARM(hynet_enable, "i");
13000 /* store the actual version for log reporting */
13001 -char *hysdn_net_revision = "$Revision: 1.1.4.1 $";
13002 +char *hysdn_net_revision = "$Revision$";
13004 #define MAX_SKB_BUFFERS 20 /* number of buffers for keeping TX-data */
13006 @@ -45,6 +45,10 @@ struct net_local {
13007 /* additional vars may be added here */
13008 char dev_name[9]; /* our own device name */
13010 +#ifdef COMPAT_NO_SOFTNET
13011 + struct sk_buff *tx_skb; /* buffer for tx operation */
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 */
13020 int is_open; /* flag controlling module locking */
13025 @@ -83,11 +88,19 @@ net_open(struct net_device *dev)
13026 hysdn_card *card = dev->priv;
13029 +#ifdef COMPAT_NO_SOFTNET
13030 + dev->tbusy = 0; /* non busy state */
13031 + dev->interrupt = 0;
13033 + MOD_INC_USE_COUNT; /* increment only if device is down */
13034 + dev->start = 1; /* and started */
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 */
13040 netif_start_queue(dev); /* start tx-queueing */
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)
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)
13056 } /* flush_tx_buffers */
13060 /*********************************************************************/
13061 @@ -129,6 +144,15 @@ static int
13062 net_close(struct net_device *dev)
13065 +#ifdef COMPAT_NO_SOFTNET
13066 + dev->tbusy = 1; /* we are busy */
13069 + MOD_DEC_USE_COUNT; /* dec only if device has been active */
13071 + dev->start = 0; /* and not started */
13074 netif_stop_queue(dev); /* disable queueing */
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);
13082 return (0); /* success */
13085 +#ifdef COMPAT_NO_SOFTNET
13086 +/************************************/
13087 +/* send a packet on this interface. */
13088 +/* only for kernel versions < 2.3.33 */
13089 +/************************************/
13091 +net_send_packet(struct sk_buff *skb, struct net_device *dev)
13093 + struct net_local *lp = (struct net_local *) dev;
13095 + if (dev->tbusy) {
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
13101 + int tickssofar = jiffies - dev->trans_start;
13102 + if (tickssofar < (10000 * HZ) / 1000)
13104 + printk(KERN_WARNING "%s: transmit timed out. \n", dev->name);
13106 + dev->trans_start = jiffies;
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.
13112 + if (test_and_set_bit(0, (void *) &dev->tbusy) != 0)
13113 + printk(KERN_WARNING "%s: Transmitter access conflict.\n", dev->name);
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);
13123 + return (0); /* success */
13124 +} /* net_send_packet */
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 */
13137 /***********************************************************************/
13138 @@ -190,6 +258,15 @@ hysdn_tx_netack(hysdn_card * card)
13140 return; /* non existing device */
13142 +#ifdef COMPAT_NO_SOFTNET
13144 + dev_kfree_skb(lp->tx_skb); /* free tx pointer */
13145 + lp->tx_skb = NULL; /* reset pointer */
13147 + lp->stats.tx_packets++;
13148 + lp->netdev.tbusy = 0;
13149 + mark_bh(NET_BH); /* Inform upper layers. */
13153 return; /* error condition */
13154 @@ -203,6 +280,7 @@ hysdn_tx_netack(hysdn_card * card)
13156 if (lp->sk_count-- == MAX_SKB_BUFFERS) /* dec usage count */
13157 netif_start_queue((struct net_device *) lp);
13159 } /* hysdn_tx_netack */
13161 /*****************************************************/
13162 @@ -250,10 +328,15 @@ hysdn_tx_netget(hysdn_card * card)
13164 return (NULL); /* non existing device */
13166 +#ifdef COMPAT_NO_SOFTNET
13167 + return (lp->tx_skb); /* return packet pointer */
13171 return (NULL); /* nothing available */
13173 return (lp->skbs[lp->out_idx]); /* next packet to send */
13175 } /* hysdn_tx_netget */
13178 @@ -296,15 +379,21 @@ hysdn_net_create(hysdn_card * card)
13180 memset(dev, 0, sizeof(struct net_local)); /* clean the structure */
13182 +#ifndef COMPAT_NO_SOFTNET
13183 spin_lock_init(&((struct net_local *) dev)->lock);
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 */
13194 strcpy(dev->name, ((struct net_local *) dev)->dev_name);
13197 if ((i = register_netdev(dev))) {
13198 printk(KERN_WARNING "HYSDN: unable to create network device\n");
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 */
13204 +#ifndef COMPAT_NO_SOFTNET
13205 flush_tx_buffers((struct net_local *) dev); /* empty buffers */
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
13215 -/* $Id: hysdn_pof.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
13218 * Linux driver for HYSDN cards, definitions used for handling pof-files.
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
13225 -/* $Id: hysdn_procconf.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
13228 * Linux driver for HYSDN cards, /proc/net filesystem dir and conf functions.
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>
13238 #include "hysdn_defs.h"
13240 -static char *hysdn_procconf_revision = "$Revision: 1.1.4.1 $";
13241 +static char *hysdn_procconf_revision = "$Revision$";
13243 #define INFO_OUT_LEN 80 /* length of info line including lf */
13245 @@ -212,32 +214,29 @@ hysdn_conf_write(struct file *file, cons
13247 hysdn_conf_read(struct file *file, char *buf, size_t count, loff_t * off)
13249 - loff_t pos = *off;
13253 if (off != &file->f_pos) /* fs error check */
13256 - if (!(file->f_mode & FMODE_READ))
13259 - if (!(cp = file->private_data))
13260 - return (-EFAULT); /* should never happen */
13262 - i = strlen(cp); /* get total string length */
13264 - if (pos != (unsigned)pos || pos >= i)
13267 - /* still bytes to transfer */
13268 - cp += pos; /* point to desired data offset */
13269 - i -= pos; /* remaining length */
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 */
13280 + /* still bytes to transfer */
13281 + cp += *off; /* point to desired data offset */
13282 + i -= *off; /* remaining length */
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 */
13291 + return (-EPERM); /* no permission to read */
13294 } /* hysdn_conf_read */
13295 @@ -254,7 +253,11 @@ hysdn_conf_open(struct inode *ino, struc
13298 /* now search the addressed card */
13299 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13300 + MOD_INC_USE_COUNT;
13306 pd = card->procconf;
13307 @@ -263,7 +266,11 @@ hysdn_conf_open(struct inode *ino, struc
13308 card = card->next; /* search next entry */
13311 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13312 + MOD_DEC_USE_COUNT;
13316 return (-ENODEV); /* device is unknown/invalid */
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 */
13322 if (!(cnf = kmalloc(sizeof(struct conf_writedata), GFP_KERNEL))) {
13323 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13324 + MOD_DEC_USE_COUNT;
13331 @@ -286,7 +297,11 @@ hysdn_conf_open(struct inode *ino, struc
13332 /* read access -> output card info data */
13334 if (!(tmp = (char *) kmalloc(INFO_OUT_LEN * 2 + 2, GFP_KERNEL))) {
13335 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13336 + MOD_DEC_USE_COUNT;
13340 return (-EFAULT); /* out of memory */
13342 filep->private_data = tmp; /* start of string */
13343 @@ -320,10 +335,16 @@ hysdn_conf_open(struct inode *ino, struc
13345 *cp = 0; /* end of string */
13346 } else { /* simultaneous read/write access forbidden ! */
13347 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13348 + MOD_DEC_USE_COUNT;
13352 return (-EPERM); /* no permission this time */
13354 +#ifndef COMPAT_USE_MODCOUNT_LOCK
13358 } /* hysdn_conf_open */
13360 @@ -338,7 +359,9 @@ hysdn_conf_close(struct inode *ino, stru
13362 struct proc_dir_entry *pd;
13364 +#ifndef COMPAT_USE_MODCOUNT_LOCK
13367 /* search the addressed card */
13370 @@ -348,7 +371,9 @@ hysdn_conf_close(struct inode *ino, stru
13371 card = card->next; /* search next entry */
13374 +#ifndef COMPAT_USE_MODCOUNT_LOCK
13377 return (-ENODEV); /* device is unknown/invalid */
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 */
13384 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13385 + MOD_DEC_USE_COUNT;
13390 } /* hysdn_conf_close */
13392 @@ -387,6 +416,9 @@ static struct file_operations conf_fops
13393 release: hysdn_conf_close,
13396 +#ifdef COMPAT_NO_SOFTNET
13397 +static struct inode_operations conf_inode_operations;
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;
13410 + ((struct proc_dir_entry *) card->procconf)->ops = &conf_inode_operations;
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;
13417 hysdn_proclog_init(card); /* init the log file entry */
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
13425 -/* $Id: hysdn_proclog.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
13428 * Linux driver for HYSDN cards, /proc/net filesystem log functions.
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>
13438 #include "hysdn_defs.h"
13440 @@ -115,8 +117,7 @@ put_log_buffer(hysdn_card * card, char *
13441 strcpy(ib->log_start, cp); /* set output string */
13443 ib->proc_ctrl = pd; /* point to own control structure */
13444 - save_flags(flags);
13446 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13447 ib->usage_cnt = pd->if_used;
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);
13457 /* delete old entrys */
13459 @@ -210,7 +211,6 @@ hysdn_log_read(struct file *file, char *
13461 struct procdata *pd = NULL;
13463 - loff_t pos = *off;
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 *
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))
13476 - *off = pos + len;
13477 + file->f_pos += len;
13481 @@ -255,7 +255,11 @@ hysdn_log_open(struct inode *ino, struct
13482 struct procdata *pd = NULL;
13485 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13486 + MOD_INC_USE_COUNT;
13492 pd = card->proclog;
13493 @@ -264,7 +268,11 @@ hysdn_log_open(struct inode *ino, struct
13494 card = card->next; /* search next entry */
13497 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13498 + MOD_DEC_USE_COUNT;
13502 return (-ENODEV); /* device is unknown/invalid */
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) {
13508 /* read access -> log/debug read */
13509 - save_flags(flags);
13511 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13514 - filep->private_data = &(pd->log_tail->next);
13515 + (struct log_data **) filep->private_data = &(pd->log_tail->next);
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;
13527 return (-EPERM); /* no permission this time */
13529 +#ifndef COMPAT_USE_MODCOUNT_LOCK
13533 } /* hysdn_log_open */
13535 @@ -306,7 +319,9 @@ hysdn_log_close(struct inode *ino, struc
13536 int flags, retval = 0;
13539 +#ifndef COMPAT_USE_MODCOUNT_LOCK
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 */
13549 - save_flags(flags);
13551 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13552 inf = *((struct log_data **) filep->private_data); /* get first log entry */
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 */
13559 - restore_flags(flags);
13560 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13563 if (pd->if_used <= 0) /* delete buffers if last file closed */
13564 @@ -348,7 +362,11 @@ hysdn_log_close(struct inode *ino, struc
13567 } /* read access */
13568 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13569 + MOD_DEC_USE_COUNT;
13575 } /* hysdn_log_close */
13576 @@ -400,6 +418,9 @@ static struct file_operations log_fops =
13577 release: hysdn_log_close,
13580 +#ifdef COMPAT_NO_SOFTNET
13581 +struct inode_operations log_inode_operations;
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)
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;
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 */
13599 pd->log->proc_fops = &log_fops;
13600 +#ifdef COMPAT_HAS_FILEOP_OWNER
13601 pd->log->owner = THIS_MODULE;
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
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 $
13615 * Linux driver for HYSDN cards
13616 * scheduler routines for handling exchange card <-> pc.
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>
13628 #include "hysdn_defs.h"
13629 @@ -151,22 +149,19 @@ hysdn_tx_cfgline(hysdn_card * card, ucha
13631 if (card->debug_flags & LOG_SCHED_ASYN)
13632 hysdn_addlog(card, "async tx-cfg chan=%d len=%d", chan, strlen(line) + 1);
13634 - save_flags(flags);
13636 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13637 while (card->async_busy) {
13640 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13641 if (card->debug_flags & LOG_SCHED_ASYN)
13642 hysdn_addlog(card, "async tx-cfg delayed");
13644 set_current_state(TASK_INTERRUPTIBLE);
13645 schedule_timeout((20 * HZ) / 1000); /* Timeout 20ms */
13647 - restore_flags(flags);
13648 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13649 return (-ERR_ASYNC_TIME); /* timed out */
13652 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13653 } /* wait for buffer to become free */
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);
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");
13666 cnt++; /* short delay */
13669 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13670 while (card->async_busy) {
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");
13677 set_current_state(TASK_INTERRUPTIBLE);
13678 schedule_timeout((20 * HZ) / 1000); /* Timeout 20ms */
13680 - restore_flags(flags);
13681 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13682 return (-ERR_ASYNC_TIME); /* timed out */
13685 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13686 } /* wait for buffer to become free again */
13688 - restore_flags(flags);
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");
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
13699 -/* $Id: icn.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
13702 * ISDN low-level module for the ICN active ISDN-Card.
13704 @@ -41,7 +41,7 @@ MODULE_PARM_DESC(icn_id2, "ID-String of
13708 -*revision = "$Revision: 1.1.4.1 $";
13709 +*revision = "$Revision$";
13711 static int icn_addcard(int, char *, char *);
13713 @@ -1634,6 +1634,7 @@ icn_addcard(int port, char *id1, char *i
13717 +#ifdef COMPAT_HAS_NEW_SETUP
13719 icn_setup(char *line)
13721 @@ -1643,6 +1644,14 @@ icn_setup(char *line)
13722 static char sid2[20];
13724 str = get_options(line, 2, ints);
13727 +icn_setup(char *str, int *ints)
13730 + static char sid[20];
13731 + static char sid2[20];
13734 portbase = ints[1];
13736 @@ -1656,9 +1665,13 @@ icn_setup(char *line)
13740 +#ifdef COMPAT_HAS_NEW_SETUP
13743 __setup("icn=", icn_setup);
13747 #endif /* MODULE */
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
13755 -/* $Id: icn.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
13758 * ISDN lowlevel-module for the ICN active ISDN-Card.
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
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 $
13768 * Linux ISDN subsystem, audio conversion and compression (linklevel).
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)
13775 * This software may be used and distributed according to the terms
13777 #include "isdn_audio.h"
13778 #include "isdn_common.h"
13780 -char *isdn_audio_revision = "$Revision: 1.1.4.1 $";
13781 +char *isdn_audio_revision = "$Revision: 1.24 $";
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
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 */
13800 + int grp; /* low/high group */
13802 + int k2; /* k fuer 2. harmonic */
13805 /* For DTMF recognition:
13806 * 2 * cos(2 * PI * k / N) precalculated for all k
13808 static int cos2pik[NCOEFF] =
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
13815 +static dtmf_t dtmf_tones[8] =
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 */
13827 static char dtmf_matrix[4][4] =
13828 @@ -208,7 +228,7 @@ isdn_audio_tlookup(const u_char *table,
13832 - *buff = table[*(unsigned char *)buff], buff++;
13833 + *buff++ = table[*(unsigned char *)buff];
13837 @@ -479,18 +499,6 @@ isdn_audio_goertzel(int *sample, modem_i
13841 - /* Avoid overflows */
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);
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)
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;
13869 - for (i = 0; i < NCOEFF; i++) {
13870 - if (result[i] > DTMF_TRESH) {
13871 - if (result[i] > thresh)
13872 - thresh = result[i];
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))
13883 - if (silence == NCOEFF)
13884 + if (silence == 8)
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) {
13895 - if (grp[LOGRP] >= 0) {
13896 - // Bad. Another tone found. */
13903 - else { /* higroup */
13904 - if (grp[HIGRP] >= 0) { // Bad. Another tone found. */
13909 - grp[HIGRP] = i - NCOEFF/2;
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 */
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 */
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
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 $
13936 * Linux ISDN subsystem, audio conversion and compression (linklevel).
13938 @@ -20,7 +20,6 @@ typedef struct adpcm_state {
13940 typedef struct dtmf_state {
13944 int buf[DTMF_NPOINTS];
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");
13954 +#ifdef CONFIG_ISDN_WITH_ABC
13955 +#define BSD_C_MALLOC(x) kmalloc((x),GFP_ATOMIC)
13956 +#define BSD_C_FREE(x) kfree(x)
13958 +#define BSD_C_MALLOC(x) vmalloc(x)
13959 +#define BSD_C_FREE(x) vfree(x)
13963 * A dictionary for doing BSD compress.
13965 @@ -285,7 +293,7 @@ static void bsd_free (void *state)
13966 * Release the dictionary
13969 - vfree (db->dict);
13970 + BSD_C_FREE (db->dict);
13974 @@ -293,7 +301,7 @@ static void bsd_free (void *state)
13975 * Release the string buffer
13978 - vfree (db->lens);
13979 + BSD_C_FREE (db->lens);
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
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));
13990 + MOD_INC_USE_COUNT;
13992 + ** MOD_INC_USE_COUNT must be before bsd_free
13993 + ** bsd_free make MOD_DEC_USE_COUNT if db != NULL
14001 - MOD_INC_USE_COUNT;
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_
14010 - db->lens = (unsigned short *) vmalloc ((maxmaxcode + 1) *
14011 + db->lens = (unsigned short *) BSD_C_MALLOC ((maxmaxcode + 1) *
14012 sizeof (db->lens[0]));
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
14023 +#ifndef CONFIG_ISDN_WITH_ABC
14024 #define OUTPUT(ent) \
14027 @@ -490,17 +507,45 @@ static int bsd_compress (void *state, st
14029 } while (bitno <= 24); \
14032 +#define OUTPUT(ent) \
14035 + bitno -= n_bits; \
14036 + accm |= ((ent) << bitno); \
14038 + if(skb_out && skb_tailroom(skb_out) > 0) \
14039 + *(skb_put(skb_out,1)) = (unsigned char) (accm>>24); \
14042 + } while (bitno <= 24 && ++secure < 10000); \
14043 + if(secure >= 10000) { \
14044 + printk(KERN_DEBUG "BSD in OUTPUT secure counter reached\n"); \
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.
14055 +#ifdef CONFIG_ISDN_WITH_ABC
14058 + if (proto < 0x21 || proto > 0xf9 || !(proto & 0x1) ) {
14060 + printk(KERN_DEBUG "bsd_compress called with %x\n",proto);
14064 printk(KERN_DEBUG "bsd_compress called with %x\n",proto);
14067 if (proto < 0x21 || proto > 0xf9 || !(proto & 0x1) )
14071 db = (struct bsd_db *) state;
14072 hshift = db->hshift;
14073 @@ -538,6 +583,9 @@ static int bsd_compress (void *state, st
14075 /* continue probing until a match or invalid entry */
14076 disp = (hval == 0) ? 1 : hval;
14077 +#ifdef CONFIG_ISDN_WITH_ABC
14083 @@ -546,7 +594,15 @@ static int bsd_compress (void *state, st
14084 dictp = dict_ptr (db, hval);
14085 if (dictp->codem1 >= max_ent)
14087 +#ifndef CONFIG_ISDN_WITH_ABC
14088 } while (dictp->fcode != fcode);
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");
14097 ent = dictp->codem1 + 1; /* finally found (prefix,suffix) */
14099 @@ -669,6 +725,9 @@ static int bsd_decompress (void *state,
14103 +#ifdef CONFIG_ISDN_WITH_ABC
14104 + unsigned long secure = 0;
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 */
14113 +#ifndef CONFIG_ISDN_WITH_ABC
14114 printk(KERN_DEBUG "bsd_decompress called\n");
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,
14121 p = skb_put(skb_out,codelen);
14123 +#ifdef CONFIG_ISDN_WITH_ABC
14124 + for(secure = 0; finchar > LAST && secure < 50000;secure++) {
14126 while (finchar > LAST) {
14128 struct bsd_dict *dictp2 = dict_ptr (db, finchar);
14130 dictp = dict_ptr (db, dictp2->cptr);
14131 @@ -822,6 +887,12 @@ static int bsd_decompress (void *state,
14135 +#ifdef CONFIG_ISDN_WITH_ABC
14136 + if(secure >= 50000) {
14137 + printk(KERN_DEBUG "BSD: decompress secure-counter reached\n");
14138 + return DECOMP_FATALERROR;
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
14153 if (hval >= db->hsize)
14155 dictp = dict_ptr (db, hval);
14156 +#ifndef CONFIG_ISDN_WITH_ABC
14157 } while (dictp->codem1 < max_ent);
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;
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;
14172 +#ifdef CONFIG_ISDN_WITH_ABC
14174 + ** bsd_check will call bsd_clear
14175 + ** and so on the internal tables will be cleared.
14177 + ** I think that's not what we will at this point ?????
14178 + ** For me at works without bsd_check.
14181 if (bsd_check(db)) {
14183 printk(KERN_DEBUG "bsd_decomp%d: peer should have cleared dictionary on %d\n",
14184 db->unit, db->seqno - 1);
14187 return skb_out->len;
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
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 $
14198 * Linux ISDN subsystem, common used functions (linklevel).
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"
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 */
14217 #undef ISDN_DEBUG_STATCALLB
14218 @@ -44,7 +47,7 @@ MODULE_LICENSE("GPL");
14222 -static char *isdn_revision = "$Revision: 1.1.4.1 $";
14223 +static char *isdn_revision = "$Revision: 1.137 $";
14225 extern char *isdn_net_revision;
14226 extern char *isdn_tty_revision;
14227 @@ -67,19 +70,19 @@ static isdn_divert_if *divert_if; /* = N
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);
14238 isdn_lock_drivers(void)
14243 - for (i = 0; i < ISDN_MAX_DRIVERS; i++) {
14244 - if (!dev->drv[i])
14246 + for (i = 0; i < dev->drivers; i++) {
14251 @@ -101,10 +104,7 @@ isdn_unlock_drivers(void)
14255 - for (i = 0; i < ISDN_MAX_DRIVERS; i++) {
14256 - if (!dev->drv[i])
14259 + for (i = 0; i < dev->drivers; i++)
14260 if (dev->drv[i]->locks > 0) {
14263 @@ -114,7 +114,6 @@ isdn_unlock_drivers(void)
14264 isdn_command(&cmd);
14265 dev->drv[i]->locks--;
14271 @@ -473,6 +472,7 @@ isdn_status_callback(isdn_ctrl * c)
14272 dev->drv[di]->flags &= ~DRV_FLAG_RUNNING;
14274 case ISDN_STAT_ICALL:
14275 + case ISDN_STAT_ICALLW:
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 */
14288 dev->channels -= dev->drv[di]->channels;
14289 @@ -755,6 +757,10 @@ isdn_status_callback(isdn_ctrl * c)
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);
14300 @@ -900,72 +906,239 @@ isdn_minor2chan(int minor)
14301 return (dev->chanmap[minor]);
14305 -isdn_statstr(void)
14306 +// ----------------------------------------------------------------------
14309 +// This device has somewhat insane semantics, but we need to support
14310 +// them for the sake of compatibility.
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
14318 +struct isdnstatus_dev {
14319 + struct list_head list;
14323 +static DECLARE_WAIT_QUEUE_HEAD(isdnstatus_waitq);
14324 +static LIST_HEAD(isdnstatus_devs);
14325 +static spinlock_t isdnstatus_devs_lock = SPIN_LOCK_UNLOCKED;
14328 +isdn_info_update(void)
14330 + struct list_head *p;
14331 + struct isdnstatus_dev *idev;
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;
14338 + spin_unlock(&isdnstatus_devs_lock);
14339 + wake_up_interruptible(&isdnstatus_waitq);
14343 +isdnstatus_open(struct inode *ino, struct file *filep)
14345 + struct isdnstatus_dev *p;
14347 + p = kmalloc(sizeof(struct isdnstatus_dev), GFP_USER);
14351 + /* At opening time we allow a single update */
14353 + spin_lock(&isdnstatus_devs_lock);
14354 + list_add(&p->list, &isdnstatus_devs);
14355 + spin_unlock(&isdnstatus_devs_lock);
14356 + filep->private_data = p;
14362 +isdnstatus_close(struct inode *ino, struct file *filep)
14364 + struct isdnstatus_dev *p = filep->private_data;
14366 + spin_lock(&isdnstatus_devs_lock);
14367 + list_del(&p->list);
14368 + spin_unlock(&isdnstatus_devs_lock);
14372 +// FIXME we don't lock against the state changing whilst being
14376 +isdn_statstr(char *buf)
14378 - static char istatbuf[2048];
14382 - sprintf(istatbuf, "idmap:\t");
14383 - p = istatbuf + strlen(istatbuf);
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]]);
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]);
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]);
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]);
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++) {
14420 - sprintf(p, "%ld ", dev->drv[i]->online);
14421 - p = istatbuf + strlen(istatbuf);
14422 + p += sprintf(p, "%ld ", dev->drv[i]->online);
14424 - sprintf(p, "? ");
14425 - p = istatbuf + strlen(istatbuf);
14426 + p += sprintf(p, "? ");
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]);
14437 - sprintf(p, "\n");
14439 + p += sprintf(p, "\n");
14442 -/* Module interface-code */
14444 +isdnstatus_read(struct file *file, char *buf, size_t count, loff_t * off)
14446 + static DECLARE_MUTEX(istatbuf_mutex);
14447 + static char istatbuf[2048];
14450 -isdn_info_update(void)
14451 + DECLARE_WAITQUEUE(wait, current);
14452 + struct isdnstatus_dev *idev;
14454 + unsigned int len;
14456 + idev = file->private_data;
14458 + if (off != &file->f_pos)
14461 + add_wait_queue(&isdnstatus_waitq, &wait);
14463 + set_current_state(TASK_INTERRUPTIBLE);
14465 + if (idev->update)
14468 + retval = -EAGAIN;
14469 + if (file->f_flags & O_NONBLOCK)
14472 + retval = -ERESTARTSYS;
14473 + if (signal_pending(current))
14478 + __set_current_state(TASK_RUNNING);
14479 + remove_wait_queue(&isdnstatus_waitq, &wait);
14481 + if (!idev->update)
14484 + idev->update = 0;
14485 + down(&istatbuf_mutex);
14486 + isdn_statstr(istatbuf);
14487 + len = strlen(istatbuf);
14488 + if (len > count) {
14492 + if (copy_to_user(buf, istatbuf, len)) {
14493 + retval = -EFAULT;
14500 + up(&istatbuf_mutex);
14506 +isdnstatus_write(struct file *file, const char *buf, size_t count, loff_t * off)
14508 - infostruct *p = dev->infochain;
14512 +static unsigned int
14513 +isdnstatus_poll(struct file *file, poll_table * wait)
14515 + struct isdnstatus_dev *idev;
14516 + unsigned int mask = 0;
14518 + idev = file->private_data;
14521 - *(p->private) = 1;
14522 - p = (infostruct *) p->next;
14523 + poll_wait(file, &isdnstatus_waitq, wait);
14524 + if (idev->update) {
14525 + mask |= POLLIN | POLLRDNORM;
14527 - wake_up_interruptible(&(dev->info_waitq));
14532 +isdnstatus_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
14535 + isdn_net_ioctl_phone phone;
14544 + ulong *p = (ulong *) arg;
14546 + if ((retval = verify_area(VERIFY_WRITE, (void *) arg,
14547 + sizeof(ulong) * ISDN_MAX_CHANNELS * 2)))
14549 + for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
14550 + put_user(dev->ibytes[i], p++);
14551 + put_user(dev->obytes[i], p++);
14557 +#ifdef CONFIG_NETDEVICES
14559 + /* Get peer phone number of a connected
14560 + * isdn network interface */
14562 + if (copy_from_user((char *) &phone, (char *) arg, sizeof(phone)))
14564 + return isdn_net_getpeer(&phone, (isdn_net_ioctl_phone *) arg);
14573 +// ----------------------------------------------------------------------
14577 isdn_read(struct file *file, char *buf, size_t count, loff_t * off)
14579 @@ -976,37 +1149,16 @@ isdn_read(struct file *file, char *buf,
14583 - loff_t pos = *off;
14585 if (off != &file->f_pos)
14588 - if (pos != (unsigned) pos)
14591 +#ifndef COMPAT_HAVE_READ_LOCK_KERNEL
14593 - if (minor == ISDN_MINOR_STATUS) {
14594 - if (!file->private_data) {
14595 - if (file->f_flags & O_NONBLOCK) {
14596 - retval = -EAGAIN;
14599 - interruptible_sleep_on(&(dev->info_waitq));
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;
14608 - *off = pos + len;
14616 + if (minor == ISDN_MINOR_STATUS)
14617 + return isdnstatus_read(file, buf, count, off);
14619 if (!dev->drivers) {
14622 @@ -1031,7 +1183,7 @@ isdn_read(struct file *file, char *buf,
14624 len = isdn_readbchan(drvidx, chidx, p, 0, count,
14625 &dev->drv[drvidx]->rcv_waitq[chidx]);
14626 - *off = pos + len;
14628 restore_flags(flags);
14629 if (copy_to_user(buf,p,len))
14631 @@ -1052,6 +1204,9 @@ isdn_read(struct file *file, char *buf,
14633 interruptible_sleep_on(&(dev->drv[drvidx]->st_waitq));
14635 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
14636 + if(drvidx || (len = isdn_dw_abc_lcr_readstat(buf,count)) < 1) {
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,
14645 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
14651 @@ -1072,7 +1230,7 @@ isdn_read(struct file *file, char *buf,
14653 dev->drv[drvidx]->stavail = 0;
14654 restore_flags(flags);
14655 - *off = pos + len;
14660 @@ -1084,7 +1242,9 @@ isdn_read(struct file *file, char *buf,
14664 +#ifndef COMPAT_HAVE_READ_LOCK_KERNEL
14670 @@ -1096,15 +1256,18 @@ isdn_write(struct file *file, const char
14674 + if (minor == ISDN_MINOR_STATUS)
14675 + return isdnstatus_write(file, buf, count, off);
14677 if (off != &file->f_pos)
14680 - if (minor == ISDN_MINOR_STATUS)
14685 +#ifndef COMPAT_HAVE_WRITE_LOCK_KERNEL
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
14695 +#ifndef COMPAT_HAVE_WRITE_LOCK_KERNEL
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);
14705 +#ifndef COMPAT_HAVE_POLL_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;
14716 + if (minor == ISDN_MINOR_STATUS)
14717 + return isdnstatus_poll(file, wait);
14719 if (minor >= ISDN_MINOR_CTRL && minor <= ISDN_MINOR_CTRLMAX) {
14721 /* driver deregistered while file open */
14722 @@ -1190,7 +1352,9 @@ isdn_poll(struct file *file, poll_table
14726 +#ifndef COMPAT_HAVE_POLL_LOCK_KERNEL
14732 @@ -1220,42 +1384,9 @@ isdn_ioctl(struct inode *inode, struct f
14733 #define phone iocpar.phone
14734 #define cfg iocpar.cfg
14736 - if (minor == ISDN_MINOR_STATUS) {
14744 - ulong *p = (ulong *) arg;
14746 - if ((ret = verify_area(VERIFY_WRITE, (void *) arg,
14747 - sizeof(ulong) * ISDN_MAX_CHANNELS * 2)))
14749 - for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
14750 - put_user(dev->ibytes[i], p++);
14751 - put_user(dev->obytes[i], p++);
14757 -#ifdef CONFIG_NETDEVICES
14759 - /* Get peer phone number of a connected
14760 - * isdn network interface */
14762 - if (copy_from_user((char *) &phone, (char *) arg, sizeof(phone)))
14764 - return isdn_net_getpeer(&phone, (isdn_net_ioctl_phone *) arg);
14772 + if (minor == ISDN_MINOR_STATUS)
14773 + return isdnstatus_ioctl(inode, file, cmd, arg);
14777 if (minor <= ISDN_MINOR_BMAX) {
14778 @@ -1277,11 +1408,34 @@ isdn_ioctl(struct inode *inode, struct f
14781 case IIOCNETDWRSET:
14782 +#ifdef CONFIG_ISDN_WITH_ABC
14785 + if (copy_from_user(name, (char *) arg, sizeof(name))) {
14791 + isdn_net_dev *p = isdn_net_findif(name);
14796 + return(isdn_dw_abc_reset_interface(p->local,1));
14800 printk(KERN_INFO "INFO: ISDN_DW_ABC_EXTENSION not enabled\n");
14804 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
14805 + return(isdn_dw_abc_lcr_ioctl(arg));
14807 printk(KERN_INFO "INFO: ISDN_ABC_LCR_SUPPORT not enabled\n");
14810 #ifdef CONFIG_NETDEVICES
14812 /* Add a network-interface */
14813 @@ -1654,22 +1808,12 @@ isdn_open(struct inode *ino, struct file
14815 int retval = -ENODEV;
14817 +#ifdef COMPAT_USE_MODCOUNT_LOCK
14818 + MOD_INC_USE_COUNT;
14821 if (minor == ISDN_MINOR_STATUS) {
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;
14833 - retval = -ENOMEM;
14836 + return isdnstatus_open(ino, filep);
14838 if (!dev->channels)
14840 @@ -1692,6 +1836,9 @@ isdn_open(struct inode *ino, struct file
14843 isdn_lock_drivers();
14844 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
14845 + if(!drvidx) isdn_dw_abc_lcr_open();
14850 @@ -1704,6 +1851,10 @@ isdn_open(struct inode *ino, struct file
14854 +#ifdef COMPAT_USE_MODCOUNT_LOCK
14856 + MOD_DEC_USE_COUNT;
14861 @@ -1712,25 +1863,11 @@ isdn_close(struct inode *ino, struct fil
14863 uint minor = MINOR(ino->i_rdev);
14865 +#ifndef COMPAT_USE_MODCOUNT_LOCK
14868 if (minor == ISDN_MINOR_STATUS) {
14869 - infostruct *p = dev->infochain;
14870 - infostruct *q = NULL;
14873 - if (p->private == (char *) &(filep->private_data)) {
14875 - q->next = p->next;
14877 - dev->infochain = (infostruct *) (p->next);
14882 - p = (infostruct *) (p->next);
14884 - printk(KERN_WARNING "isdn: No private data while closing isdnctrl\n");
14886 + isdnstatus_close(ino, filep);
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)
14894 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
14896 + int drvidx = isdn_minor2drv(minor - ISDN_MINOR_CTRL);
14897 + if(!drvidx) isdn_dw_abc_lcr_close();
14902 #ifdef CONFIG_ISDN_PPP
14903 @@ -1746,13 +1889,19 @@ isdn_close(struct inode *ino, struct fil
14907 +#ifdef COMPAT_USE_MODCOUNT_LOCK
14908 + MOD_DEC_USE_COUNT;
14915 static struct file_operations isdn_fops =
14917 +#ifdef COMPAT_HAS_FILEOP_OWNER
14918 owner: THIS_MODULE,
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]) {
14930 + if((dev->dwabc_chan_external_inuse[i] - jiffies) > (HZ * 120))
14931 + dev->dwabc_chan_external_inuse[i] = 0;
14936 if ((dev->usage[i] & ISDN_USAGE_EXCLUSIVE) &&
14937 ((pre_dev != d) || (pre_chan != dev->chanmap[i])))
14939 @@ -1823,7 +1981,11 @@ isdn_get_free_channel(int usage, int l2_
14940 restore_flags(flags);
14943 +#ifdef CONFIG_ISDN_WITH_ABC
14944 + if ((pre_dev == d) && ((pre_chan == dev->chanmap[i]) || pre_chan > 1000)) {
14946 if ((pre_dev == d) && (pre_chan == dev->chanmap[i])) {
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,
14953 if ((adding) && (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");
14960 @@ -2018,7 +2180,7 @@ isdn_add_channels(driver *d, int drvidx,
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);
14969 @@ -2030,7 +2192,8 @@ isdn_add_channels(driver *d, int drvidx,
14970 skb_queue_purge(&d->rpqueue[j]);
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");
14978 kfree(d->rcvcount);
14979 @@ -2044,7 +2207,8 @@ isdn_add_channels(driver *d, int drvidx,
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");
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 */
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;
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");
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");
15016 @@ -2229,6 +2396,7 @@ isdn_getrev(const char *revision)
15020 +#ifdef HAVE_DEVFS_FS
15021 #ifdef CONFIG_DEVFS_FS
15023 static devfs_handle_t devfs_handle;
15024 @@ -2318,6 +2486,7 @@ static void isdn_cleanup_devfs(void)
15027 #endif /* CONFIG_DEVFS_FS */
15028 +#endif /* HAVE_DEVFS_FS */
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)
15044 +#ifdef HAVE_DEVFS_FS
15046 +#endif /* HAVE_DEVFS_FS */
15047 if ((i = isdn_tty_modem_init()) < 0) {
15048 printk(KERN_WARNING "isdn: Could not register tty devices\n");
15050 @@ -2357,7 +2527,9 @@ static int __init isdn_init(void)
15052 tty_unregister_driver(&dev->mdm.tty_modem);
15054 +#ifdef HAVE_DEVFS_FS
15055 isdn_cleanup_devfs();
15056 +#endif /* HAVE_DEVFS_FS */
15057 devfs_unregister_chrdev(ISDN_MAJOR, "isdn");
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");
15070 @@ -2394,6 +2568,9 @@ static int __init isdn_init(void)
15073 isdn_info_update();
15074 +#ifdef CONFIG_ISDN_WITH_ABC
15075 + isdn_dw_abc_init_func();
15080 @@ -2402,7 +2579,7 @@ static int __init isdn_init(void)
15082 static void __exit isdn_exit(void)
15084 - unsigned long flags;
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);
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 */
15100 printk(KERN_NOTICE "ISDN-subsystem unloaded\n");
15102 +#ifdef CONFIG_ISDN_WITH_ABC
15103 + isdn_dw_abc_release_func();
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
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 $
15116 * header for Linux ISDN subsystem
15117 * common used functions and debugging-switches (linklevel).
15119 #undef ISDN_DEBUG_NET_DIAL
15120 #undef ISDN_DEBUG_NET_ICALL
15122 +#ifdef CONFIG_ISDN_WITH_ABC
15123 +int isdn_net_force_dial_lp(isdn_net_local *);
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
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 $
15136 * Linux ISDN subsystem, protocol encapsulation
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
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 $
15146 * Linux ISDN subsystem, protocol encapsulation
15148 Index: linux-2.4.35.4/drivers/isdn/isdn_dwabc.c
15149 ===================================================================
15151 +++ linux-2.4.35.4/drivers/isdn/isdn_dwabc.c
15154 +/* $Id: isdn_dwabc.c,v 1.27 2001/12/01 23:18:21 detabc Exp $
15156 + * Linux ISDN subsystem, abc-extension releated funktions.
15158 + * Copyright by abc GmbH
15159 + * written by Detlef Wengorz <detlefw@isdn4linux.de>
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.
15168 +#include <linux/config.h>
15169 +#define __NO_VERSION__
15171 +#ifdef CONFIG_ISDN_WITH_ABC
15173 +static char *dwabcrevison = "$Revision: 1.27 $";
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"
15182 +#include <linux/skbuff.h>
15184 +#include <net/udp.h>
15185 +#include <net/checksum.h>
15186 +#include <linux/isdn_dwabc.h>
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
15198 +#define NBYTEORDER_30BYTES 0x1e00
15199 +#define DWABC_TMRES (HZ / 10)
15201 +#define VERBLEVEL (dev->net_verbose > 2)
15203 +static struct timer_list dw_abc_timer;
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)
15211 +typedef struct ISDN_DW_ABC_LCR {
15213 + struct list_head dll;
15214 + char lcr_printbuf[64 + ISDN_MSNLEN + ISDN_MSNLEN];
15218 +} ISDN_DW_ABC_LCR;
15220 +static LIST_HEAD(lcr_dll);
15221 +static atomic_t lcr_open_count = ATOMIC_INIT(0);
15222 +static volatile ulong lcr_call_counter = 0;
15225 +static int myjiftime(char *p,u_long nj)
15227 + sprintf(p,"%02ld:%02ld.%02ld",
15228 + ((nj / 100) / 60) % 100, (nj / 100) % 60,nj % 100);
15234 +static void dw_lcr_clear_all(void)
15236 + struct list_head *lh;
15238 + if(!LCR_LOCK()) {
15240 + while((lh = lcr_dll.next) != &lcr_dll) {
15242 + ISDN_DW_ABC_LCR *p = list_entry(lh,ISDN_DW_ABC_LCR,dll);
15243 + list_del(&p->dll);
15251 +void isdn_dw_abc_lcr_open(void)
15252 +{ atomic_inc(&lcr_open_count); }
15254 +void isdn_dw_abc_lcr_close(void)
15256 + if(atomic_dec_and_test(&lcr_open_count))
15257 + dw_lcr_clear_all();
15260 +int isdn_dw_abc_lcr_lock(void)
15261 +{ return(LCR_LOCK()); }
15263 +void isdn_dw_abc_lcr_ulock(void)
15267 +size_t isdn_dw_abc_lcr_readstat(char *buf,size_t count)
15271 + while(buf != NULL && count > 0) {
15273 + struct list_head *lh = NULL;
15274 + ISDN_DW_ABC_LCR *p = NULL;
15278 + if((n = LCR_LOCK())) {
15287 + while((lh = lcr_dll.next) != &lcr_dll) {
15289 + p = list_entry(lh,ISDN_DW_ABC_LCR,dll);
15291 + if(p->lcr_poin >= p->lcr_epoin) {
15293 + list_del(&p->dll);
15306 + n = p->lcr_epoin - p->lcr_poin;
15311 + dp = p->lcr_poin;
15312 + p->lcr_poin += n;
15315 + copy_to_user(buf,dp,n);
15323 +static void isdn_dw_abc_lcr_clear_helper(isdn_net_local *lp)
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;
15342 +void isdn_dw_abc_lcr_clear(isdn_net_local *lp)
15344 + if(!LCR_LOCK()) {
15345 + isdn_dw_abc_lcr_clear_helper(lp);
15351 +u_long isdn_dw_abc_lcr_call_number( isdn_net_local *lp,isdn_ctrl *call_cmd)
15358 + isdn_dw_abc_lcr_clear_helper(lp);
15360 + if( atomic_read(&lcr_open_count) > 0 &&
15362 + call_cmd != NULL) {
15364 + ISDN_DW_ABC_LCR *lc = NULL;
15367 + if((lp->dw_abc_lcr_cmd =
15368 + ( isdn_ctrl *)kmalloc(sizeof(isdn_ctrl),GFP_ATOMIC)) == NULL) {
15371 + isdn_dw_abc_lcr_clear_helper(lp);
15373 + printk(KERN_DEBUG "%s %d : LCR no memory\n",__FILE__,__LINE__);
15377 + memcpy(lp->dw_abc_lcr_cmd,call_cmd,sizeof(*call_cmd));
15378 + while(!(lp->dw_abc_lcr_callid = mid = lcr_call_counter++));
15380 + lp->dw_abc_lcr_end_request = lp->dw_abc_lcr_start_request = jiffies;
15381 + lp->dw_abc_lcr_end_request += HZ * 3;
15383 + if((lc = (ISDN_DW_ABC_LCR *)kmalloc(sizeof(*lc),GFP_KERNEL)) == NULL)
15386 + lc->lcr_poin = lc->lcr_epoin = lc->lcr_printbuf;
15387 + lc->lcr_epoin += myjiftime(lc->lcr_epoin,jiffies);
15389 + sprintf(lc->lcr_epoin," DW_ABC_LCR\t%lu\t%.*s\t%.*s\n",
15391 + (int)ISDN_MSNLEN,
15392 + call_cmd->parm.setup.eazmsn,
15393 + (int)ISDN_MSNLEN,
15394 + call_cmd->parm.setup.phone);
15396 + lc->lcr_epoin += strlen(lc->lcr_epoin);
15397 + ab = lc->lcr_epoin - lc->lcr_poin;
15399 + list_add_tail(&lc->dll,&lcr_dll);
15404 + if(dev->drv[0] != NULL ) {
15406 + dev->drv[0]->stavail += ab;
15407 + wake_up_interruptible(&dev->drv[0]->st_waitq);
15411 + } else LCR_ULOCK();
15417 +int isdn_dw_abc_lcr_ioctl(u_long arg)
15419 + struct ISDN_DWABC_LCR_IOCTL i;
15420 + int need = sizeof(struct ISDN_DWABC_LCR_IOCTL);
15423 + memset(&i,0,sizeof(struct ISDN_DWABC_LCR_IOCTL));
15424 + copy_from_user(&i,(char *)arg,sizeof(int));
15426 + if(i.lcr_ioctl_sizeof < need)
15427 + need = i.lcr_ioctl_sizeof;
15430 + copy_from_user(&i,(char *)arg,need);
15437 + for(;p ; p = p->next) {
15439 + isdn_net_local *lp = p->local;
15441 + if( lp->dw_abc_lcr_callid != i.lcr_ioctl_callid)
15444 + if(lp->dw_abc_lcr_cmd == NULL)
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);
15451 + if(lp->dw_abc_lcr_io == NULL) {
15453 + printk(KERN_DEBUG "%s %d : no memory\n",__FILE__,__LINE__);
15457 + memcpy(lp->dw_abc_lcr_io,&i,sizeof(struct ISDN_DWABC_LCR_IOCTL));
15459 + if(i.lcr_ioctl_flags & DWABC_LCR_FLG_NEWNUMBER) {
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;
15466 + while(d < ed && xx < exx && *xx) *(d++) = *(xx++);
15467 + while(d < ed) *(d++) = 0;
15479 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK
15480 +int dw_abc_udp_test(struct sk_buff *skb,struct net_device *ndev)
15482 + if(ndev != NULL && skb != NULL && skb->protocol == htons(ETH_P_IP)) {
15484 + struct iphdr *iph = (struct iphdr *)skb->data;
15485 + isdn_net_local *lp = (isdn_net_local *) ndev->priv;
15486 + int rklen = skb->len;
15488 + if (skb->nh.raw > skb->data && skb->nh.raw < skb->tail) {
15490 + rklen -= (char *)skb->nh.raw - (char *)skb->data;
15491 + iph = (struct iphdr *)skb->nh.raw;
15494 + if(rklen >= 20 && iph->version == 4 &&
15495 + !(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_UDP_CHECK)) {
15497 + if( iph->tot_len == NBYTEORDER_30BYTES &&
15498 + iph->protocol == IPPROTO_UDP) {
15500 + struct udphdr *udp =
15501 + (struct udphdr *)((char *)iph + (iph->ihl << 2));
15503 + ushort usrc = ntohs(udp->source);
15505 + if( udp->dest == htons(25001) &&
15506 + usrc >= 20000 && usrc < 25000) {
15508 + char *p = (char *)(udp + 1);
15510 + if(p[0] == p[1]) {
15519 + if((lp->flags & ISDN_NET_CONNECTED) && (!lp->dialstate))
15527 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL
15528 + if((lp->flags & ISDN_NET_CONNECTED) && (!lp->dialstate)) {
15534 + if(!isdn_net_force_dial_lp(lp)) mc++;
15540 + isdn_dw_abc_reset_interface(lp,1);
15543 + case 0x28: mc = *p + 1; break;
15548 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP
15549 + if(!(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_UDP_HANGUP)) {
15551 + if(lp->isdn_device >= 0) {
15553 + isdn_net_hangup(ndev);
15563 + struct sk_buff *nskb;
15564 + int need = 2+sizeof(struct iphdr)+sizeof(struct udphdr);
15565 + int hneed = need + ndev->hard_header_len;
15567 + if((nskb = (struct sk_buff *)dev_alloc_skb(hneed)) != NULL) {
15569 + ushort n = sizeof(struct udphdr) + 2;
15570 + struct iphdr *niph;
15571 + struct udphdr *nup;
15572 + skb_reserve(nskb,ndev->hard_header_len);
15574 + if((niph = (struct iphdr *)skb_put(nskb,need))==NULL){
15576 + printk(KERN_DEBUG "%s: skb_put failt (%d bytes)\n", lp->name,hneed);
15577 + dev_kfree_skb(nskb);
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));
15591 + niph->tot_len=NBYTEORDER_30BYTES;
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;
15618 +void isdn_dw_clear_if(ulong pm,isdn_net_local *lp)
15621 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
15622 + isdn_dw_abc_lcr_clear(lp);
15629 +static void dw_abc_timer_func(u_long dont_need_yet)
15631 + register u_long t;
15633 + if(!((t = ++isdn_dwabc_jiffies.msec_100) & 1))
15634 + if(isdn_dwabc_jiffies.msec_200++ & 1)
15635 + isdn_dwabc_jiffies.msec_400++;
15638 + if(isdn_dwabc_jiffies.msec_500++ & 1)
15639 + isdn_dwabc_jiffies.msec_1000++;
15641 + dw_abc_timer.expires = jiffies + DWABC_TMRES;
15642 + add_timer(&dw_abc_timer);
15646 +void isdn_dw_abc_init_func(void)
15649 + init_timer(&dw_abc_timer);
15650 + dw_abc_timer.function = dw_abc_timer_func;
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"
15660 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK
15661 + "CONFIG_ISDN_WITH_ABC_UDP_CHECK\n"
15663 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP
15664 + "CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP\n"
15666 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL
15667 + "CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL\n"
15669 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
15670 + "CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ\n"
15672 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
15673 + "CONFIG_ISDN_WITH_ABC_LCR_SUPPORT\n"
15675 +#ifdef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
15676 + "CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER\n"
15678 +#ifdef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
15679 + "CONFIG_ISDN_WITH_ABC_CH_EXTINUSE\n"
15681 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
15682 + "CONFIG_ISDN_WITH_ABC_CONN_ERROR\n"
15684 +#ifdef CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS
15685 + "CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS\n"
15688 + dwabcrevison,LINUX_VERSION_CODE);
15690 + dw_abc_timer.expires = jiffies + DWABC_TMRES;
15691 + add_timer(&dw_abc_timer);
15694 +void isdn_dw_abc_release_func(void)
15696 + del_timer(&dw_abc_timer);
15697 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
15698 + dw_lcr_clear_all();
15700 + printk( KERN_INFO
15701 + "abc-extension %s Kernel 0x%06X\n"
15703 + "Detlef Wengorz <detlefw@isdn4linux.de>\n"
15705 + dwabcrevison,LINUX_VERSION_CODE);
15709 +void isdn_dwabc_test_phone(isdn_net_local *lp)
15713 + isdn_net_phone *h = lp->phone[0];
15714 + ulong oflags = lp->dw_abc_flags;
15717 + lp->dw_abc_flags = 0;
15718 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
15719 + *lp->dw_out_msn = 0;
15722 + for(;h != NULL && secure < 1000;secure++,h = h->next) {
15724 + char *p = h->num;
15725 + char *ep = p + ISDN_MSNLEN;
15727 + for(;p < ep && *p && (*p <= ' ' || *p == '"' || *p == '\'');p++);
15732 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
15735 + if(++p < ep && *p != '<' && *p != '>') {
15737 + char *d = lp->dw_out_msn;
15739 + for(;*p && (p < ep) && (*p == ' ' || *p == '\t');p++);
15740 + for(ep--;*p && (p < ep);) *(d++) = *(p++);
15749 + /* abc switch's */
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;
15760 + case 'X': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_RCV_NO_HUPTIMER; break;
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;
15768 + case '\'': break;
15771 + printk(KERN_DEBUG"isdn_net: %s abc-switch <~%c> unknown\n",lp->name,*p);
15777 + if(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_LEASED_LINE) {
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;
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);
15795 +int isdn_dw_abc_reset_interface(isdn_net_local *lp,int with_message)
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;
15810 + if(with_message && dev->net_verbose > 0)
15812 + "%s: NOTE: reset (clear) abc-interface-secure-counter\n",
15820 +#if CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS && CONFIG_ISDN_PPP
15822 +#define DWBSD_PKT_FIRST_LEN 16
15823 +#define DWBSD_PKT_SWITCH 165
15824 +#define DWBSD_PKT_BSD 189
15826 +#define DWBSD_VERSION 0x2
15828 +void dwabc_bsd_first_gen(isdn_net_local *lp)
15830 + if(lp != NULL && lp->p_encap == ISDN_NET_ENCAP_RAWIP &&
15831 + (lp->dw_abc_flags & ISDN_DW_ABC_FLAG_BSD_COMPRESS)) {
15833 + struct sk_buff *skb = NULL;
15837 + if((skb =(struct sk_buff *)dev_alloc_skb(128)) == NULL) {
15839 + printk(KERN_INFO "%s: dwabc: alloc-skb failed for 128 bytes\n",lp->name);
15843 + skb_reserve(skb,64);
15844 + p = skb_put(skb,DWBSD_PKT_FIRST_LEN);
15845 + ep = p + DWBSD_PKT_FIRST_LEN;
15847 + *(p++) = DWBSD_PKT_SWITCH;
15848 + *(p++) = DWBSD_VERSION;
15849 + for(;p < ep;p++) *(p++) = 0;
15851 + isdn_net_write_super(lp, skb);
15853 + if(dev->net_verbose > 2)
15854 + printk(KERN_INFO "%s: dwabc: sending comm-header version 0x%x\n",lp->name,DWBSD_VERSION);
15859 +void dwabc_bsd_free(isdn_net_local *lp)
15863 + if(lp->dw_abc_bsd_stat_rx || lp->dw_abc_bsd_stat_tx) {
15865 + struct isdn_ppp_compressor *c = NULL;
15867 + if(!(c = (struct isdn_ppp_compressor *)lp->dw_abc_bsd_compressor)) {
15869 + printk(KERN_WARNING
15870 + "%s: PANIC: freeing bsd compressmemory without compressor\n",
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);
15878 + if(dev->net_verbose > 2)
15880 + "%s: free bsd compress-memory\n",
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;
15890 + if(dev->net_verbose > 0) {
15892 + if(lp->dw_abc_bsd_rcv != lp->dw_abc_bsd_bsd_rcv) {
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);
15899 + if(lp->dw_abc_bsd_snd != lp->dw_abc_bsd_bsd_snd) {
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);
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;
15914 +int dwabc_bsd_init(isdn_net_local *lp)
15920 + dwabc_bsd_free(lp);
15922 + if(lp->p_encap == ISDN_NET_ENCAP_RAWIP) {
15926 + struct isdn_ppp_comp_data *cp = NULL;
15927 + struct isdn_ppp_compressor *c = NULL;
15929 + if(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_BSD_COMPRESS) do {
15931 + for(c = ipc_head ;
15932 + c != NULL && c->num != CI_BSD_COMPRESS; c = c->next);
15937 + "%s: Module isdn_bsdcompress not loaded\n",
15943 + cp = (struct isdn_ppp_comp_data *)
15944 + kmalloc(sizeof(struct isdn_ppp_comp_data),GFP_ATOMIC);
15949 + "%s: allocation of isdn_ppp_comp_data failed\n",
15955 + memset(cp,0,sizeof(*cp));
15956 + cp->num = CI_BSD_COMPRESS;
15960 + ** set BSD_VERSION 1 and 12 bits compressmode
15962 + *cp->options = (1 << 5) | 12;
15964 + if((rx = (*c->alloc)(cp)) == NULL) {
15967 + "%s: allocation of bsd rx-memory failed\n",
15973 + if(!(*c->init)(rx,cp,0,1)) {
15976 + "%s: init of bsd rx-stream failed\n",lp->name);
15981 + cp->flags = IPPP_COMP_FLAG_XMIT;
15983 + if((tx = (*c->alloc)(cp)) == NULL) {
15986 + "%s: allocation of bsd tx-memory failed\n",
15992 + if(!(*c->init)(tx,cp,0,1)) {
15995 + "%s: init of bsd tx-stream failed\n",
16001 + lp->dw_abc_bsd_compressor = (void *)c;
16002 + lp->dw_abc_bsd_stat_rx = rx;
16003 + lp->dw_abc_bsd_stat_tx = tx;
16007 + if(dev->net_verbose > 2)
16009 + "%s: bsd compress-memory and init ok\n",
16019 + if(tx != NULL) (*c->free)(tx);
16020 + if(rx != NULL) (*c->free)(rx);
16023 + } else if(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_BSD_COMPRESS) {
16026 + "%s: bsd-compress only with encapsulation rawip allowed\n",
16034 +struct sk_buff *dwabc_bsd_compress( isdn_net_local *lp,
16035 + struct sk_buff *skb,
16036 + struct net_device *ndev)
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)) {
16042 + if(lp->dw_abc_bsd_stat_tx != NULL && lp->dw_abc_bsd_compressor) {
16044 + struct isdn_ppp_compressor *cp =
16045 + (struct isdn_ppp_compressor *)lp->dw_abc_bsd_compressor;
16047 + struct sk_buff *nskb = (struct sk_buff *)
16048 + dev_alloc_skb(skb->len * 2 + ndev->hard_header_len);
16052 + if(nskb == NULL) {
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);
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);
16063 + if(l < 1 || l > skb->len) {
16065 + (void)(*cp->reset)(lp->dw_abc_bsd_stat_tx,0,0,NULL,0,NULL);
16066 + dev_kfree_skb(nskb);
16072 + dev_kfree_skb(skb);
16074 + sqnr = ((*(u_char *)skb->data) << 8) +
16075 + ((u_char)skb->data[1]);
16078 + (void)(*cp->reset)
16079 + (lp->dw_abc_bsd_stat_tx,0,0,NULL,0,NULL);
16088 +struct sk_buff *dwabc_bsd_rx_pkt( isdn_net_local *lp,
16089 + struct sk_buff *skb,
16090 + struct net_device *ndev)
16092 + struct sk_buff *r = skb;
16094 + if(lp != NULL && lp->p_encap == ISDN_NET_ENCAP_RAWIP &&
16095 + (lp->dw_abc_flags & ISDN_DW_ABC_FLAG_BSD_COMPRESS)) {
16097 + unsigned char *p = (unsigned char *)skb->data;
16098 + struct isdn_ppp_compressor *cp =
16099 + (struct isdn_ppp_compressor *)lp->dw_abc_bsd_compressor;
16101 + if(*p == DWBSD_PKT_SWITCH) {
16103 + if(skb->len == DWBSD_PKT_FIRST_LEN) {
16105 + if((lp->dw_abc_remote_version = p[1]) < 0x2) {
16108 + "%s: I can't really talk with remote version 0x%x\n"
16109 + "Please upgrade remote or disable rawip-compression\n",
16114 + lp->dw_abc_if_flags |= ISDN_DW_ABC_IFFLAG_BSDAKTIV;
16115 + dev_kfree_skb(skb);
16117 + if(cp && lp->dw_abc_bsd_stat_tx)
16118 + (void)(*cp->reset)(lp->dw_abc_bsd_stat_tx,0,0,NULL,0,NULL);
16120 + if(dev->net_verbose > 2)
16122 + "%s: receive comm-header rem-version 0x%02x\n",
16124 + lp->dw_abc_remote_version);
16129 + } else if(*p == DWBSD_PKT_BSD && lp->dw_abc_bsd_stat_rx != NULL && cp) {
16131 + struct sk_buff *nskb = NULL;
16133 + if(test_and_set_bit(ISDN_DW_ABC_BITLOCK_RECEIVE,
16134 + &lp->dw_abc_bitlocks)) {
16136 + printk(KERN_INFO "%s: bsd-decomp called recursivly\n",lp->name);
16137 + dev_kfree_skb(skb);
16138 + dwabc_bsd_first_gen(lp);
16142 + nskb = (struct sk_buff *)
16143 + dev_alloc_skb(2048 + ndev->hard_header_len);
16145 + if(nskb != NULL) {
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]);
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);
16157 + if((l = (*cp->decompress)
16158 + (lp->dw_abc_bsd_stat_rx,skb,nskb,NULL)) < 1 || l>8000) {
16160 + printk(KERN_INFO "%s: abc-decomp failed\n",lp->name);
16161 + dev_kfree_skb(nskb);
16162 + dev_kfree_skb(skb);
16164 + dwabc_bsd_first_gen(lp);
16168 + if (nskb->data[0] & 0x1)
16169 + skb_pull(nskb, 1); /* protocol ID is only 8 bit */
16171 + skb_pull(nskb, 2);
16173 + nskb->dev = skb->dev;
16174 + nskb->pkt_type = skb->pkt_type;
16175 + nskb->mac.raw = nskb->data;
16176 + dev_kfree_skb(skb);
16181 + printk(KERN_INFO "%s: PANIC abc-decomp no memory\n",lp->name);
16182 + dev_kfree_skb(skb);
16183 + dwabc_bsd_first_gen(lp);
16186 + clear_bit(ISDN_DW_ABC_BITLOCK_RECEIVE,&lp->dw_abc_bitlocks);
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 ; }
16199 +struct sk_buff *dwabc_bsd_compress(isdn_net_local *lp,struct sk_buff *skb,struct net_device *ndev)
16202 +struct sk_buff *dwabc_bsd_rx_pkt(isdn_net_local *lp,struct sk_buff *skb,struct net_device *ndev)
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
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 $
16214 * Linux ISDN subsystem, network interfaces and related functions (linklevel).
16217 * This software may be used and distributed according to the terms
16218 * of the GNU General Public License, incorporated herein by reference.
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
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
16232 #include "isdn_concap.h"
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)
16241 * Outline of new tbusy handling:
16242 @@ -79,7 +75,11 @@ static __inline__ int isdn_net_device_st
16246 +#ifdef COMPAT_NO_SOFTNET
16247 + return dev->start;
16249 return netif_running(dev);
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);
16259 + printk(KERN_DEBUG "%s: inc_frame_cnt now %d\n", lp->name,
16260 + atomic_read(&lp->frame_cnt));
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);
16270 + printk(KERN_DEBUG "%s: dec_frame_cnt now %d\n", lp->name,
16271 + atomic_read(&lp->frame_cnt));
16275 static __inline__ void isdn_net_zero_frame_cnt(isdn_net_local *lp)
16277 atomic_set(&lp->frame_cnt, 0);
16279 + printk(KERN_DEBUG "%s: zero_frame_cnt now %d\n", lp->name,
16280 + atomic_read(&lp->frame_cnt));
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...
16289 +#ifdef COMPAT_NO_SOFTNET
16290 +#define ISDN_NET_TX_TIMEOUT (2*HZ)
16292 #define ISDN_NET_TX_TIMEOUT (20*HZ)
16297 +#ifndef CONFIG_ISDN_WITH_ABC
16298 int isdn_net_force_dial_lp(isdn_net_local *);
16300 static int isdn_net_start_xmit(struct sk_buff *, struct net_device *);
16302 static void isdn_net_ciscohdlck_connected(isdn_net_local *lp);
16303 static void isdn_net_ciscohdlck_disconnected(isdn_net_local *lp);
16305 -char *isdn_net_revision = "$Revision: 1.1.4.1 $";
16306 +char *isdn_net_revision = "$Revision: 1.153 $";
16309 * Code for raw-networking over ISDN
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)
16315 + if(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_CONN_ERROR)
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 );
16325 +static int isdn_dwabc_conerr_ippktok(struct sk_buff *skb)
16327 + struct iphdr *iph = (struct iphdr *)skb->data;
16328 + return(iph->version == 6 || (skb->len >= 20 && iph->version == 4));
16333 +static int isdn_dwabc_is_interface_disabled(isdn_net_local *lp)
16338 + lp->dw_abc_inuse_secure = 0;
16339 + lp->dw_abc_dialstart = 0;
16342 + ** check for jiffies overflow
16344 + if(lp->dw_abc_bchan_last_connect > jiffies) {
16346 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
16347 + lp->dw_abc_bchan_errcnt = 0;
16349 + lp->dw_abc_bchan_last_connect = 0;
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)) {
16355 + if(lp->dw_abc_bchan_errcnt > 3 && !(lp->dw_abc_bchan_errcnt & 3)) {
16357 + ulong nj = jiffies;
16358 + ulong delay = lp->dw_abc_bchan_errcnt *
16359 + lp->dw_abc_bchan_errcnt *
16360 + lp->dw_abc_bchan_errcnt;
16362 + if(delay > 86400) delay = 86400;
16363 + delay = (lp->dw_abc_bchan_last_connect + delay * HZ);
16368 + "%s: interface auto-disabled (bchannel connect-error %lu seconds left)\n",
16369 + lp->name,(delay - nj) / HZ);
16380 +#ifdef CONFIG_ISDN_WITH_ABC
16385 isdn_net_unreachable(struct net_device *dev, struct sk_buff *skb, char *reason)
16388 @@ -297,6 +387,12 @@ isdn_net_unbind_channel(isdn_net_local *
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);
16398 skb_queue_purge(&lp->super_tx_queue);
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)) {
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) {
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;
16415 + if(l->huptimer > n) {
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;
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,
16431 isdn_net_unbind_channel(lp);
16432 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
16433 + if(lp->dw_abc_bchan_errcnt) {
16436 + "%s: Note: bchannel-error-counter is %hd\n",
16438 + lp->dw_abc_bchan_errcnt);
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)) {
16448 + if((jiffies - lp->dw_abc_dialstart) < (HZ >>2)) {
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);
16459 #ifdef CONFIG_ISDN_X25
16460 case ISDN_STAT_BHUP:
16461 @@ -507,6 +647,19 @@ isdn_net_stat_callback(int idx, isdn_ctr
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)) {
16471 + lp->dw_abc_bchan_errcnt += isdn_dwabc_encap_with_conerr(lp);
16473 + if(lp->dw_abc_bchan_errcnt > 32000)
16474 + lp->dw_abc_bchan_errcnt = 32000;
16478 /* If first Chargeinfo comes before B-Channel connect,
16479 * we correct the timestamp here.
16481 @@ -578,7 +731,6 @@ isdn_net_dial(void)
16483 unsigned long flags;
16485 - u_char *phone_number;
16488 isdn_net_local *lp = p->local;
16489 @@ -597,6 +749,47 @@ isdn_net_dial(void)
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)) {
16498 + short lsecure = 0;
16500 + lsecure = lp->dw_abc_inuse_secure;
16501 + isdn_net_unbind_channel(lp);
16502 + lp->dw_abc_inuse_secure = lsecure + 1;
16504 + /* Grab a free ISDN-Channel */
16505 + if ((lsecure >= ISDN_MAX_CHANNELS ) || (chi =
16506 + isdn_get_free_channel(
16512 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
16513 + (*lp->dw_out_msn) ? lp->dw_out_msn : lp->msn)
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);
16526 + isdn_net_bind_channel(lp, chi);
16527 + lp->dialstate = 1;
16528 + lp->dialstarted = 0;
16529 + lp->dialwait_timer = 0;
16532 + lp->dw_abc_if_flags &= ~ISDN_DW_ABC_IFFLAG_NODCHAN;
16534 lp->dial = lp->phone[1];
16535 restore_flags(flags);
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));
16545 sprintf(cmd.parm.num, "%s", isdn_map_eaz2msn(lp->msn, cmd.driver));
16547 cmd.command = ISDN_CMD_SETEAZ;
16548 isdn_command(&cmd);
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);
16560 /* Setup interface, dial current phone-number, switch to next number.
16561 * If list of phone-numbers is exhausted, increment
16564 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
16565 + if(!isdn_dw_abc_lcr_lock()) {
16567 + if( lp->dw_abc_lcr_cmd != NULL &&
16568 + lp->dw_abc_lcr_start_request !=
16569 + lp->dw_abc_lcr_end_request) {
16571 + if( lp->dw_abc_lcr_io == NULL &&
16572 + lp->dw_abc_lcr_start_request <= jiffies &&
16573 + lp->dw_abc_lcr_end_request > jiffies) {
16575 + isdn_dw_abc_lcr_ulock();
16580 + if(lp->dw_abc_lcr_io != NULL) {
16582 + if(lp->dw_abc_lcr_io->lcr_ioctl_flags &
16583 + DWABC_LCR_FLG_DISABLE) {
16585 + isdn_dw_abc_lcr_ulock();
16586 + isdn_net_hangup(&p->dev);
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;
16596 + memcpy(&cmd,lp->dw_abc_lcr_cmd,sizeof(cmd));
16597 + isdn_dw_abc_lcr_ulock();
16598 + goto dw_abc_lcr_next_click;
16601 + isdn_dw_abc_lcr_ulock();
16604 if(dev->global_flags & ISDN_GLOBAL_STOPPED || (ISDN_NET_DIALMODE(*lp) == ISDN_NET_DM_OFF)) {
16606 if (dev->global_flags & ISDN_GLOBAL_STOPPED)
16607 @@ -677,20 +921,7 @@ isdn_net_dial(void)
16611 - cmd.driver = lp->isdn_device;
16612 - cmd.command = ISDN_CMD_DIAL;
16613 - cmd.parm.setup.si2 = 0;
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;
16624 - strcpy(cmd.parm.setup.phone, phone_number);
16625 + sprintf(cmd.parm.setup.phone, "%s", lp->dial->num);
16627 * Switch to next number or back to start if at end of list.
16629 @@ -710,17 +941,70 @@ isdn_net_dial(void)
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));
16641 sprintf(cmd.parm.setup.eazmsn, "%s",
16642 isdn_map_eaz2msn(lp->msn, cmd.driver));
16644 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
16646 + ** if callback-out we dont need
16647 + ** low-cost-routing LCR
16649 + if(!(lp->flags & ISDN_NET_CBOUT) &&
16650 + !(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_LCR)) {
16652 + isdn_dw_abc_lcr_call_number(lp,&cmd);
16654 + if(lp->dw_abc_lcr_start_request != lp->dw_abc_lcr_end_request) {
16656 + if(dev->net_verbose > 2) {
16659 + "%s: Waiting for LCR-response from isdnlog %s -> %s...\n",
16661 + cmd.parm.setup.eazmsn,
16662 + cmd.parm.setup.phone);
16670 +dw_abc_lcr_next_click:;
16671 + isdn_dw_abc_lcr_clear(lp);
16673 i = isdn_dc2minor(lp->isdn_device, lp->isdn_channel);
16675 strcpy(dev->num[i], cmd.parm.setup.phone);
16676 dev->usage[i] |= ISDN_USAGE_OUTGOING;
16677 isdn_info_update();
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,
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) {
16691 + "%s: Note: bchannel-error-counter is %hd\n",
16693 + lp->dw_abc_bchan_errcnt);
16697 + printk(KERN_INFO "%s: dialing %d %s...\n", lp->name,
16698 + lp->dialretry, cmd.parm.setup.phone);
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)
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;
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) {
16722 + "%s: Note: bchannel-error-counter is %hd\n",
16724 + lp->dw_abc_bchan_errcnt);
16728 isdn_net_unbind_channel(lp);
16730 @@ -899,8 +1196,13 @@ typedef struct {
16731 unsigned short dest;
16734 +#ifdef CONFIG_ISDN_WITH_ABC
16736 +isdn_net_log_skb_dwabc(struct sk_buff * skb, isdn_net_local * lp,char *reason)
16739 isdn_net_log_skb(struct sk_buff * skb, isdn_net_local * lp)
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
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 : "",
16753 "OPEN: %d.%d.%d.%d -> %d.%d.%d.%d%s\n",
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
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 : "",
16767 "OPEN: ARP %d.%d.%d.%d -> *.*.*.* ?%d.%d.%d.%d\n",
16769 p[14], p[15], p[16], p[17],
16770 p[24], p[25], p[26], p[27]);
16772 @@ -1004,11 +1318,22 @@ void isdn_net_write_super(isdn_net_local
16775 spin_lock_bh(&lp->xmit_lock);
16777 if (!isdn_net_lp_busy(lp)) {
16778 +#ifdef CONFIG_ISDN_WITH_ABC
16779 + if(!skb_queue_empty(&lp->super_tx_queue)) {
16781 + ** don't reverse the frame flow
16782 + ** compression need frames in order and maybe other's too
16784 + skb_queue_tail(&lp->super_tx_queue, skb);
16785 + skb = skb_dequeue(&lp->super_tx_queue);
16788 isdn_net_writebuf_skb(lp, skb);
16790 - skb_queue_tail(&lp->super_tx_queue, skb);
16793 + } else skb_queue_tail(&lp->super_tx_queue, skb);
16795 spin_unlock_bh(&lp->xmit_lock);
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);
16803 lp->transcount += len;
16804 isdn_net_inc_frame_cnt(lp);
16806 @@ -1064,9 +1388,19 @@ void isdn_net_writebuf_skb(isdn_net_loca
16808 dev_kfree_skb(skb);
16809 lp->stats.tx_errors++;
16814 +int isdn_net_send_skb(struct net_device *ndev, isdn_net_local * lp,struct sk_buff *skb)
16816 + if (isdn_net_lp_busy(lp)) {
16817 + printk(KERN_WARNING "isdn_net_send_skb: HL channel busy\n");
16820 + isdn_net_writebuf_skb(lp, skb);
16826 * Helper function for isdn_net_start_xmit.
16827 @@ -1109,7 +1443,54 @@ isdn_net_xmit(struct net_device *ndev, s
16829 /* Reset hangup-timeout */
16830 lp->huptimer = 0; // FIXME?
16831 +#ifdef CONFIG_ISDN_WITH_ABC
16833 + if(test_and_set_bit(ISDN_DW_ABC_BITLOCK_SEND,&lp->dw_abc_bitlocks)) {
16835 + if(dev->net_verbose > 2)
16836 + printk(KERN_INFO "%s: isdn_net_xmit called recursivly\n",lp->name);
16838 + spin_unlock_bh(&lp->xmit_lock);
16842 + if(skb != NULL) {
16844 + int l = skb->len;
16847 + if( lp->p_encap == ISDN_NET_ENCAP_RAWIP &&
16848 + (lp->dw_abc_if_flags & ISDN_DW_ABC_IFFLAG_BSDAKTIV)) {
16850 + if((skb = dwabc_bsd_compress(lp,skb,ndev)) != NULL) {
16854 + skb_queue_tail(&lp->super_tx_queue,skb);
16856 + if(l != nl && (r = isdn_dc2minor(lp->isdn_device,lp->isdn_channel)) >= 0) {
16858 + dev->obytes[r] += l - nl;
16859 + lp->stats.tx_bytes += l - nl;
16863 + } else skb_queue_tail(&lp->super_tx_queue,skb);
16865 + if(lp->p_encap == ISDN_NET_ENCAP_RAWIP) {
16867 + lp->dw_abc_bsd_snd += l;
16868 + lp->dw_abc_bsd_bsd_snd += nl;
16871 + clear_bit(ISDN_DW_ABC_BITLOCK_SEND,&lp->dw_abc_bitlocks);
16873 + while(!isdn_net_lp_busy(lp) && (skb = skb_dequeue(&lp->super_tx_queue)))
16874 + isdn_net_writebuf_skb(lp, skb);
16877 isdn_net_writebuf_skb(lp, skb);
16879 spin_unlock_bh(&lp->xmit_lock);
16881 /* the following stuff is here for backwards compatibility.
16882 @@ -1143,6 +1524,69 @@ isdn_net_xmit(struct net_device *ndev, s
16887 + if (lp->cps > lp->triggercps) {
16888 + /* Device overloaded */
16891 + * Packet-delivery via round-robin over master
16892 + * and all connected slaves.
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);
16901 + isdn_net_device_stop_queue(lp);
16904 + ret = isdn_net_send_skb(ndev, lp, skb);
16905 + spin_unlock_bh(&lp->xmit_lock);
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);
16914 + ret = isdn_net_start_xmit(skb, lp->srobin);
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;
16921 + /* Slave-startup using delay-variable */
16923 + if (!lp->sqfull) {
16924 + /* First time overload: set timestamp only */
16926 + lp->sqfull_stamp = jiffies;
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);
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);
16940 + isdn_net_device_stop_queue(lp);
16943 + spin_unlock_bh(&lp->xmit_lock);
16944 + if (lp->sqfull && ((jiffies - lp->sqfull_stamp) > (lp->slavedelay + (10 * HZ))))
16952 @@ -1161,6 +1605,7 @@ isdn_net_adjust_hdr(struct sk_buff *skb,
16956 +#ifndef COMPAT_NO_SOFTNET
16957 void isdn_net_tx_timeout(struct net_device * ndev)
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);
16967 * Try sending a packet.
16968 * If this interface isn't connected to a ISDN-Channel, find a free channel,
16969 * and start dialing.
16971 +#ifdef CONFIG_ISDN_WITH_ABC
16972 +static int dwabc_isdn_net_start_xmit(struct sk_buff *,struct net_device *);
16974 +static int isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
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)) {
16982 + if(dw_abc_udp_test(skb,ndev)) {
16983 + dev_kfree_skb(skb);
16988 + return(dwabc_isdn_net_start_xmit(skb,ndev));
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 +/**********************************************************************
16998 + -1 dial not allowed or impossible
16999 + 0 interface is connected
17000 + 1 dial is started
17001 +***********************************************************************/
17006 + char *errmsg = NULL;
17008 +#ifdef ISDN_DEBUG_NET_DUMP
17010 + char *buf = skb->data;
17011 + isdn_dumppkt("S:", buf, skb->len, 40);
17014 + if (lp->flags & ISDN_NET_CONNECTED)
17017 + save_flags(flags);
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'";
17029 + if(dm_manual_allowed &&
17030 + !(ISDN_NET_DIALMODE(*lp) == ISDN_NET_DM_MANUAL)) {
17033 + "dial rejected: interface not in dialmode `auto or manual'";
17038 + if (!lp->phone[1]) {
17040 + errmsg = "No phone number";
17044 + if(lp->dialwait_timer <= 0) {
17046 + if( lp->dialstarted > 0 &&
17047 + lp->dialtimeout > 0 &&
17048 + jiffies < (lp->dialstarted + lp->dialtimeout + lp->dialwait)) {
17050 + lp->dialwait_timer =
17051 + lp->dialstarted + lp->dialtimeout + lp->dialwait;
17055 + if(lp->dialwait_timer > 0) {
17057 + if(jiffies < lp->dialwait_timer) {
17059 + errmsg = "dial rejected: retry-time not reached";
17062 + } else lp->dialwait_timer = 0;
17064 +#ifdef CONFIG_ISDN_WITH_ABC
17065 + if(isdn_dwabc_is_interface_disabled(lp))
17068 + /* Grab a free ISDN-Channel */
17070 + isdn_get_free_channel(
17076 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
17077 + (*lp->dw_out_msn) ? lp->dw_out_msn :
17082 + isdn_get_free_channel(
17087 + lp->pre_channel^1,
17088 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
17089 + (*lp->dw_out_msn) ? lp->dw_out_msn :
17094 + errmsg = "No channel";
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);
17109 + isdn_net_dial(); /* Initiate dialing */
17110 + netif_stop_queue(&lp->netdev->dev);
17113 + /* let upper layer requeue skb packet */
17116 + /* Initiate dialing */
17118 + isdn_net_device_stop_queue(lp);
17123 + if(retw < 0 && errmsg != NULL)
17124 + isdn_net_unreachable(&lp->netdev->dev, skb, errmsg);
17126 + restore_flags(flags);
17134 +dwabc_isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
17137 isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
17140 isdn_net_local *lp = (isdn_net_local *) ndev->priv;
17141 #ifdef CONFIG_ISDN_X25
17142 struct concap_proto * cprot = lp -> netdev -> cprot;
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
17152 + if (ndev->tbusy) {
17153 + if (jiffies - ndev->trans_start < ISDN_NET_TX_TIMEOUT)
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);
17160 + ndev->trans_start = jiffies;
17161 + netif_wake_queue(ndev);
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,
17170 /* auto-dialing xmit function */
17171 +#ifdef CONFIG_ISDN_WITH_ABC
17175 + isdn_net_adjust_hdr(skb, ndev);
17177 + if(!(r = isdn_auto_dial_helper(lp,skb,0))) {
17180 + ** Device is connected to an ISDN channel
17182 + ndev->trans_start = jiffies;
17184 + if (!lp->dialstate) {
17187 + ** ISDN connection is established, try sending
17189 + r = isdn_net_xmit(ndev, skb);
17194 + netif_stop_queue(ndev);
17196 + } else if(r < 0) {
17198 + dev_kfree_skb(skb);
17206 #ifdef ISDN_DEBUG_NET_DUMP
17208 @@ -1256,6 +1922,14 @@ isdn_net_start_xmit(struct sk_buff *skb,
17210 lp->dialwait_timer = 0;
17212 +#ifdef CONFIG_ISDN_WITH_ABC
17213 + if(isdn_dwabc_is_interface_disabled(lp)) {
17215 + dev_kfree_skb(skb);
17216 + restore_flags(flags);
17220 /* Grab a free ISDN-Channel */
17222 isdn_get_free_channel(
17223 @@ -1264,6 +1938,9 @@ isdn_net_start_xmit(struct sk_buff *skb,
17227 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
17228 + (*lp->dw_out_msn) ? lp->dw_out_msn :
17233 @@ -1273,6 +1950,9 @@ isdn_net_start_xmit(struct sk_buff *skb,
17237 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
17238 + (*lp->dw_out_msn) ? lp->dw_out_msn :
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) ;) */
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);
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,
17268 @@ -1356,6 +2027,9 @@ isdn_net_close(struct net_device *dev)
17269 if( cprot && cprot -> pops ) cprot -> pops -> close( cprot );
17271 netif_stop_queue(dev);
17272 +#ifdef COMPAT_NO_SOFTNET
17275 if ((p = (((isdn_net_local *) dev->priv)->slave))) {
17276 /* If this interface has slaves, stop them also */
17278 @@ -1776,6 +2450,10 @@ isdn_net_ciscohdlck_receive(isdn_net_loc
17282 + case CISCO_TYPE_INET:
17283 + skb->protocol = htons(ETH_P_IP);
17286 case CISCO_TYPE_SLARP:
17287 isdn_net_ciscohdlck_slarp_in(lp, skb);
17289 @@ -1785,11 +2463,11 @@ isdn_net_ciscohdlck_receive(isdn_net_loc
17290 "\"no cdp enable\" on cisco.\n", lp->name);
17293 - /* no special cisco protocol */
17294 - skb->protocol = htons(type);
17297 + printk(KERN_WARNING "%s: Unknown Cisco type 0x%04x\n",
17305 @@ -1803,9 +2481,19 @@ isdn_net_receive(struct net_device *ndev
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);
17312 #ifdef CONFIG_ISDN_X25
17313 struct concap_proto *cprot = lp -> netdev -> cprot;
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;
17322 lp->transcount += skb->len;
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;
17329 +#ifdef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
17330 + lp_huptimer = lp->huptimer;
17331 + olp_huptimer = olp->huptimer;
17334 skb->pkt_type = PACKET_HOST;
17335 skb->mac.raw = skb->data;
17336 @@ -1840,9 +2532,40 @@ isdn_net_receive(struct net_device *ndev
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) {
17343 + ushort l = skb->len;
17346 + olp->dw_abc_bsd_bsd_rcv += l;
17348 + if((skb = dwabc_bsd_rx_pkt(olp,skb,ondev)) == NULL) {
17350 + olp->dw_abc_bsd_rcv += l;
17354 + olp->dw_abc_bsd_rcv += skb->len;
17356 + if( l != skb->len &&
17357 + (r=isdn_dc2minor(olp->isdn_device,olp->isdn_channel))>=0) {
17359 + dev->ibytes[r] += skb->len - l;
17360 + olp->stats.rx_bytes += skb->len - l;
17363 + lp->stats.rx_bytes += skb->len - l;
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;
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
17379 #ifdef CONFIG_ISDN_PPP
17380 case ISDN_NET_ENCAP_SYNCPPP:
17381 - /* huptimer is done in isdn_ppp_push_higher */
17383 + * If encapsulation is syncppp, don't reset
17384 + * huptimer on LCP packets.
17386 + if (proto != PPP_LCP) {
17387 + olp->huptimer = 0;
17388 + lp->huptimer = 0;
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) {
17394 + lp->huptimer = lp_huptimer + 1;
17395 + olp->huptimer = olp_huptimer+ 1;
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;
17416 #endif /* CONFIG_ISDN_X25 */
17417 @@ -1882,6 +2628,15 @@ isdn_net_receive(struct net_device *ndev
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) {
17425 + lp->huptimer = lp_huptimer;
17426 + olp->huptimer = olp_huptimer;
17433 @@ -2160,8 +2915,10 @@ isdn_net_find_icall(int di, int ch, int
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]);
17443 /* Search name in netdev-chain */
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");
17459 -n = (isdn_net_phone *) 0;
17461 + /* Accept only calls with Si1 = 7 (Data-Transmission) */
17463 + restore_flags(flags);
17464 + if (dev->net_verbose > 1)
17465 + printk(KERN_INFO "isdn_net: Service-Indicator not 7, ignored\n");
17468 + n = (isdn_net_phone *) 0;
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;
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 */
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 */
17490 - matchret = isdn_msncmp(eaz, my_eaz);
17496 + if (!(matchret = isdn_msncmp(eaz, isdn_map_eaz2msn(lp->msn, di))))
17498 /* Remember if more numbers eventually can match */
17499 if (matchret > wret)
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);
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 )))
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.
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 */
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);
17533 +#ifdef CONFIG_ISDN_WITH_ABC
17534 +#ifdef CONFIG_ISDN_WITH_ABC_CALLB
17536 + int use_this_call = 0;
17538 + if(!(lp->flags & ISDN_NET_CBOUT) && ((lp->dialstate == 4) || (lp->dialstate == 12))) {
17541 + ** searching for a diff. in the calling-number and the EAZ
17542 + ** the remote will make the same
17548 + for(;*pnr;pnr++);
17549 + for(;*pea;pea++);
17550 + for(pnr--,pea--;pnr >= nr && pea >= eaz && *pea != *pnr;pnr--,pea--);
17552 + if(pnr < nr || pea < eaz || *pea > *pnr) {
17554 + p = (isdn_net_dev *) p->next;
17558 + use_this_call = 1;
17561 + if( use_this_call ||
17562 + ((lp->flags & ISDN_NET_CBOUT) && (lp->flags & ISDN_NET_CONNECTED))) {
17565 + ** the incoming call was to quick.
17566 + ** the callback-delay-time ist not reached.
17567 + ** in that case we can stop the call
17570 + if(lp->isdn_device > -1 && lp->isdn_channel > -1) {
17572 + int minor = isdn_dc2minor(lp->isdn_device,lp->isdn_channel);
17574 + if(lp->isdn_device != di || lp->isdn_channel != ch) {
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);
17585 + if(dev->net_verbose > 1) {
17588 + "%s: found outgoing call hangup old call on di %d ch %d\n",
17589 + lp->name,lp->isdn_device,lp->isdn_channel);
17592 + } else if (dev->net_verbose > 1) {
17594 + printk(KERN_INFO "%s: found outgoing call on same di %d ch %d\n",
17595 + lp->name,lp->isdn_device,lp->isdn_channel);
17600 + dev->rx_netdev[minor] = NULL;
17601 + dev->st_netdev[minor] = NULL;
17604 + isdn_free_channel(lp->isdn_device,
17605 + lp->isdn_channel, ISDN_USAGE_NET);
17607 + } else if (dev->net_verbose > 1) {
17609 + printk(KERN_INFO "%s: found outgoing call reset callstate \n",lp->name);
17612 + lp->flags &= ~ISDN_NET_CONNECTED;
17613 + lp->isdn_device = -1;
17614 + lp->isdn_channel = -1;
17616 + lp->dialstate = 0;
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;
17628 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
17629 + if(isdn_dwabc_is_interface_disabled(lp)) {
17630 + restore_flags(flags);
17634 if (lp->flags & ISDN_NET_CALLBACK) {
17637 @@ -2427,6 +3276,47 @@ p = dev->netdev;
17638 restore_flags(flags);
17641 +#ifdef CONFIG_ISDN_WITH_ABC_CALLB
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
17648 + isdn_net_dev *sp = dev->netdev;
17650 + isdn_net_local *ml;
17652 + for(s_shl=0; s_shl < 2048 && sp != NULL; sp = (isdn_net_dev *)sp->next, s_shl++) {
17654 + if(sp == p || (ml = sp->local) == NULL)
17657 + if(ml->isdn_device != di || ml->isdn_channel != ch)
17660 + if(ml->dialstate != 4 && ml->dialstate != 12) {
17663 + ** wrong situation
17668 + isdn_net_unbind_channel(ml);
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 );
17678 + restore_flags(flags);
17682 printk(KERN_DEBUG "%s: call from %s -> %s accepted\n", lp->name, nr,
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 *
17689 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
17690 + (*lp->dw_out_msn) ? lp->dw_out_msn : lp->msn)
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, " ");
17700 strcpy(netdev->local->name, name);
17701 +#ifdef COMPAT_NO_SOFTNET
17702 + netdev->dev.name = netdev->local->name;
17704 strcpy(netdev->dev.name, netdev->local->name);
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);
17712 /* Device shall be a master */
17713 +#ifndef COMPAT_NO_SOFTNET
17715 * Watchdog timer (currently) for master only.
17717 netdev->dev.tx_timeout = isdn_net_tx_timeout;
17718 netdev->dev.watchdog_timeo = ISDN_NET_TX_TIMEOUT;
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;
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
17735 /* If binding is exclusive, try to grab the channel */
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;
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
17754 lp->p_encap = cfg->p_encap;
17755 +#ifdef CONFIG_ISDN_WITH_ABC
17756 + isdn_dw_abc_reset_interface(lp,0);
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);
17771 @@ -3100,6 +4011,9 @@ isdn_net_delphone(isdn_net_ioctl_phone *
17773 p->local->phone[inout] = n->next;
17775 +#ifdef CONFIG_ISDN_WITH_ABC
17776 + isdn_dwabc_test_phone(p->local);
17778 restore_flags(flags);
17781 @@ -3135,6 +4049,9 @@ isdn_net_rmallphone(isdn_net_dev * p)
17782 p->local->phone[i] = NULL;
17784 p->local->dial = NULL;
17785 +#ifdef CONFIG_ISDN_WITH_ABC
17786 + isdn_dwabc_test_phone(p->local);
17788 restore_flags(flags);
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);
17799 restore_flags(flags);
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
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 $
17810 * header for Linux ISDN subsystem, network related functions (linklevel).
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);
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;
17829 @@ -127,20 +126,12 @@ static __inline__ void isdn_net_rm_from_
17831 master_lp = (isdn_net_local *) lp->master->priv;
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;
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);
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
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 $
17859 * Linux ISDN subsystem, functions for synchronous PPP (linklevel).
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>
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 */
17875 -char *isdn_ppp_revision = "$Revision: 1.1.4.1 $";
17876 +char *isdn_ppp_revision = "$Revision: 1.94 $";
17878 static struct ippp_struct *ippp_table[ISDN_MAX_CHANNELS];
17880 +#ifndef CONFIG_ISDN_WITH_ABC
17881 static struct isdn_ppp_compressor *ipc_head = NULL;
17884 + ** make compressor's common usable
17886 +struct isdn_ppp_compressor *isdn_ippp_comp_head = NULL;
17887 +#define ipc_head isdn_ippp_comp_head
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;
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)
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);
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)
17921 isdn_ppp_wakeup_daemon(isdn_net_local * lp)
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)
17930 ippp_table[lp->ppp_slot]->state = IPPP_OPEN | IPPP_CONNECT | IPPP_NOBLOCK;
17931 - wake_up_interruptible(&ippp_table[lp->ppp_slot]->wq);
17933 + wake_up_interruptible(&ippp_table[lp->ppp_slot]->wq);
17937 @@ -250,14 +246,13 @@ isdn_ppp_closewait(int slot)
17939 struct ippp_struct *is;
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)
17947 is = ippp_table[slot];
17950 wake_up_interruptible(&is->wq);
17952 is->state = IPPP_CLOSEWAIT;
17955 @@ -295,9 +290,11 @@ isdn_ppp_open(int min, struct file *file
17958 is = file->private_data = ippp_table[slot];
17960 - printk(KERN_DEBUG "ippp, open, slot: %d, minor: %d, state: %04x\n",
17961 - slot, min, is->state);
17964 + if (is->debug & 0x1)
17966 + printk(KERN_DEBUG "ippp, open, slot: %d, minor: %d, state: %04x\n", slot, min, is->state);
17968 /* compression stuff */
17969 is->link_compressor = is->compressor = NULL;
17970 @@ -327,10 +324,7 @@ isdn_ppp_open(int min, struct file *file
17972 is->slcomp = slhc_init(16, 16); /* not necessary for 2. link in bundle */
17974 -#ifdef CONFIG_IPPP_FILTER
17975 - is->pass_filter.filter = NULL;
17976 - is->active_filter.filter = NULL;
17979 is->state = IPPP_OPEN;
17982 @@ -349,20 +343,12 @@ isdn_ppp_release(int min, struct file *f
17984 is = file->private_data;
17987 - printk(KERN_ERR "%s: no file->private_data\n", __FUNCTION__);
17990 if (is->debug & 0x1)
17991 printk(KERN_DEBUG "ippp: release, minor: %d %lx\n", min, (long) is->lp);
17993 if (is->lp) { /* a lp address says: this link is still up */
17994 isdn_net_dev *p = is->lp->netdev;
17997 - printk(KERN_ERR "%s: no lp->netdev\n", __FUNCTION__);
18000 is->state &= ~IPPP_CONNECT; /* -> effect: no call of wakeup */
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);
18007 -#ifdef CONFIG_IPPP_FILTER
18008 - if (is->pass_filter.filter) {
18009 - kfree(is->pass_filter.filter);
18010 - is->pass_filter.filter = NULL;
18012 - if (is->active_filter.filter) {
18013 - kfree(is->active_filter.filter);
18014 - is->active_filter.filter = NULL;
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 */
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)) {
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);
18035 + case PPPIOCGSTAT: /* read PPP statistic information */
18038 case PPPIOCGIDLE: /* get idle time information */
18040 struct ppp_idle pidle;
18041 @@ -604,39 +582,6 @@ isdn_ppp_ioctl(int min, struct file *fil
18043 return set_arg((void *)arg,&pci,sizeof(struct pppcallinfo));
18045 -#ifdef CONFIG_IPPP_FILTER
18046 - case PPPIOCSPASS:
18047 - case PPPIOCSACTIVE:
18049 - struct sock_fprog uprog, *filtp;
18050 - struct sock_filter *code = NULL;
18053 - if (copy_from_user(&uprog, (void *) arg, sizeof(uprog)))
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)
18060 - if (copy_from_user(code, uprog.filter, len)) {
18064 - err = sk_chk_filter(code, uprog.len);
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;
18077 -#endif /* CONFIG_IPPP_FILTER */
18081 @@ -699,7 +644,7 @@ isdn_ppp_fill_rq(unsigned char *buf, int
18082 struct ippp_struct *is;
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");
18089 is = ippp_table[slot];
18090 @@ -976,8 +921,7 @@ void isdn_ppp_receive(isdn_net_dev * net
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",
18096 + printk(KERN_ERR "isdn_ppp_receive: lp->ppp_slot %d\n", lp->ppp_slot);
18100 @@ -1026,23 +970,19 @@ isdn_ppp_push_higher(isdn_net_dev * net_
18102 struct net_device *dev = &net_dev->dev;
18103 struct ippp_struct *is, *mis;
18104 - isdn_net_local *mlp = NULL;
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",
18111 + printk(KERN_ERR "isdn_ppp_push_higher: lp->ppp_slot %d\n", lp->ppp_slot);
18114 is = ippp_table[slot];
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",
18123 + printk(KERN_ERR "isdn_ppp_push_higher: master->ppp_slot %d\n", lp->ppp_slot);
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;
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");
18139 @@ -1102,11 +1037,6 @@ isdn_ppp_push_higher(isdn_net_dev * net_
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;
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_
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 */
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");
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;
18177 - mlp->huptimer = 0;
18179 - skb_pull(skb, 4);
18180 -#else /* CONFIG_IPPP_FILTER */
18181 - lp->huptimer = 0;
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;
18192 skb->mac.raw = skb->data;
18194 @@ -1199,6 +1105,7 @@ static unsigned char *isdn_ppp_skb_push(
18195 return skb_push(skb,len);
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
18204 unsigned int proto = PPP_IP; /* 0x21 */
18205 struct ippp_struct *ipt,*ipts;
18206 - int slot, retval = 0;
18209 mlp = (isdn_net_local *) (netdev->priv);
18210 nd = mlp->netdev; /* get master lp */
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",
18216 + printk(KERN_ERR "isdn_ppp_xmit: lp->ppp_slot %d\n", mlp->ppp_slot);
18221 ipts = ippp_table[slot];
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);
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",
18235 dev_kfree_skb(skb);
18240 lp = isdn_net_get_locked_lp(nd);
18242 printk(KERN_WARNING "%s: all channels busy - requeuing!\n", netdev->name);
18247 /* we have our lp locked from now on */
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",
18253 + printk(KERN_ERR "isdn_ppp_xmit: lp->ppp_slot %d\n", lp->ppp_slot);
18258 ipt = ippp_table[slot];
18259 + lp->huptimer = 0;
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
18265 skb_pull(skb,IPPP_MAX_HEADER);
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);
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");
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;
18290 - skb_pull(skb, 4);
18291 -#else /* CONFIG_IPPP_FILTER */
18292 - lp->huptimer = 0;
18293 -#endif /* CONFIG_IPPP_FILTER */
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
18301 spin_unlock_bh(&lp->xmit_lock);
18307 -#ifdef CONFIG_IPPP_FILTER
18309 - * check if this packet may trigger auto-dial.
18312 -int isdn_ppp_autodial_filter(struct sk_buff *skb, isdn_net_local *lp)
18314 - struct ippp_struct *is = ippp_table[lp->ppp_slot];
18318 - switch (ntohs(skb->protocol)) {
18326 - printk(KERN_ERR "isdn_ppp_autodial_filter: unsupported protocol 0x%x.\n",
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
18336 - skb_pull(skb, IPPP_MAX_HEADER - 4);
18337 - skb->data[0] = 1; /* indicate outbound */
18338 - *(u_int16_t *)(skb->data + 2) = htons(proto);
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;
18347 - skb_push(skb, IPPP_MAX_HEADER - 4);
18351 #ifdef CONFIG_ISDN_MPP
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_
18356 static int isdn_ppp_mp_init( isdn_net_local * lp, ippp_bundle * add_to )
18358 - struct ippp_struct * is;
18360 - if (lp->ppp_slot < 0) {
18361 - printk(KERN_ERR "%s: lp->ppp_slot(%d) out of range\n",
18362 - __FUNCTION__, lp->ppp_slot);
18366 - is = ippp_table[lp->ppp_slot];
18367 + struct ippp_struct * is = ippp_table[lp->ppp_slot];
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);
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;
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);
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 );
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
18421 isdn_net_local *lp = (isdn_net_local *) dev->priv;
18424 + printk(KERN_DEBUG "ippp, dev_ioctl: cmd %#08x , %d \n", cmd, lp->ppp_slot);
18427 if (lp->p_encap != ISDN_NET_ENCAP_SYNCPPP)
18429 @@ -2432,7 +2250,7 @@ static void isdn_ppp_ccp_reset_trans(str
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
18438 @@ -2583,7 +2401,13 @@ static struct sk_buff *isdn_ppp_compress
18441 if(type) { /* type=1 => Link compression */
18443 + compressor = is->link_compressor;
18444 + stat = is->link_comp_stat;
18445 + new_proto = PPP_LINK_COMP;
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)
18456 - struct ippp_struct *is;
18457 + struct ippp_struct *is = ippp_table[lp->ppp_slot];
18458 struct ippp_struct *mis;
18460 struct isdn_ppp_resetparams rsparm;
18461 unsigned char rsdata[IPPP_RESET_MAXDATABYTES];
18463 - printk(KERN_DEBUG "Received CCP frame from peer slot(%d)\n",
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);
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);
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);
18481 - mis = ippp_table[slot];
18484 + mis = ippp_table[((isdn_net_local *) (lp->master->priv))->ppp_slot];
18488 switch(skb->data[0]) {
18489 @@ -2807,18 +2618,13 @@ static void isdn_ppp_receive_ccp(isdn_ne
18491 static void isdn_ppp_send_ccp(isdn_net_dev *net_dev, isdn_net_local *lp, struct sk_buff *skb)
18493 - struct ippp_struct *mis,*is;
18494 - int proto, slot = lp->ppp_slot;
18495 + struct ippp_struct *mis,*is = ippp_table[lp->ppp_slot];
18497 unsigned char *data;
18499 if(!skb || skb->len < 3)
18501 - if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
18502 - printk(KERN_ERR "%s: lp->ppp_slot(%d) out of range\n",
18503 - __FUNCTION__, slot);
18506 - is = ippp_table[slot];
18508 /* Daemon may send with or without address and control field comp */
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);
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);
18522 - mis = ippp_table[slot];
18527 + mis = ippp_table[((isdn_net_local *) (lp->master->priv))->ppp_slot];
18532 printk(KERN_DEBUG "isdn_ppp: Ouch! Master CCP sends on slave slot!\n");
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
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 $
18543 * header for Linux ISDN subsystem, functions for synchronous PPP (linklevel).
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
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 $
18561 * Linux ISDN subsystem, tty functions and AT-command emulator (linklevel).
18563 @@ -53,7 +53,7 @@ static int bit2si[8] =
18564 static int si2bit[8] =
18565 {4, 1, 4, 4, 4, 4, 4, 4};
18567 -char *isdn_tty_revision = "$Revision: 1.1.4.1 $";
18568 +char *isdn_tty_revision = "$Revision: 1.104 $";
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;
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);
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.
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;
18596 @@ -1232,6 +1238,7 @@ isdn_tty_write(struct tty_struct *tty, i
18600 +#ifdef ISDN_TTY_FCLASS1
18601 if (TTY_IS_FCLASS1(info)) {
18602 int cc = isdn_tty_handleDLEdown(info, m, c);
18604 @@ -1252,6 +1259,7 @@ isdn_tty_write(struct tty_struct *tty, i
18605 info->xmit_count += cc;
18609 info->xmit_count += c;
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);
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);
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);
18632 info->ncarrier = 0;
18634 @@ -2306,6 +2318,22 @@ isdn_tty_stat_callback(int i, isdn_ctrl
18635 isdn_tty_at_cout("\r\n", info);
18638 + case ISDN_STAT_ALERT:
18639 +#ifdef ISDN_TTY_STAT_DEBUG
18640 + printk(KERN_DEBUG "tty_STAT_ALERT ttyI%d\n", info->line);
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);
18646 + case ISDN_STAT_PROCEED:
18647 +#ifdef ISDN_TTY_STAT_DEBUG
18648 + printk(KERN_DEBUG "tty_STAT_PROCEED ttyI%d\n", info->line);
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);
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"};
18664 char s[ISDN_MSNLEN+10];
18666 @@ -2781,7 +2809,8 @@ isdn_tty_modem_result(int code, modem_in
18667 restore_flags(flags);
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");
18685 isdn_tty_at_cout(rs, info);
18688 @@ -3313,6 +3344,7 @@ isdn_tty_cmd_PLUSF(char **p, modem_info
18689 m->mdmreg[REG_PSIZE] * 16;
18691 #ifdef CONFIG_ISDN_TTY_FAX
18692 +#ifdef ISDN_TTY_FCLASS1
18695 if (!(dev->global_features &
18696 @@ -3324,6 +3356,7 @@ isdn_tty_cmd_PLUSF(char **p, modem_info
18698 m->mdmreg[REG_PSIZE] * 16;
18703 if (!(dev->global_features &
18704 @@ -3348,9 +3381,11 @@ isdn_tty_cmd_PLUSF(char **p, modem_info
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)
18713 if (dev->global_features &
18714 ISDN_FEATURE_L3_FCLASS2)
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
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 $
18724 * header for Linux ISDN subsystem, tty related functions (linklevel).
18727 #define BIT_CPNFCON 2
18730 +#define REG_ALERT 23
18731 +#define BIT_ALERT 8
18732 +#define REG_PROCEED 23
18733 +#define BIT_PROCEED 16
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
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))
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
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 $
18759 * Linux ISDN subsystem, tty_fax AT-command emulator (linklevel).
18762 #include "isdn_ttyfax.h"
18765 -static char *isdn_tty_fax_revision = "$Revision: 1.1.4.1 $";
18766 +static char *isdn_tty_fax_revision = "$Revision: 1.9 $";
18768 #define PARSE_ERROR1 { isdn_tty_fax_modem_result(1, info); return 1; }
18770 @@ -148,6 +148,7 @@ isdn_tty_fax_modem_result(int code, mode
18774 +#ifdef ISDN_TTY_FCLASS1
18776 isdn_tty_fax_command1(modem_info * info, isdn_ctrl * c)
18778 @@ -186,6 +187,7 @@ isdn_tty_fax_command1(modem_info * info,
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;
18790 +#ifdef ISDN_TTY_FCLASS1
18791 if (TTY_IS_FCLASS1(info))
18792 return (isdn_tty_fax_command1(info, c));
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,
18801 +#ifdef ISDN_TTY_FCLASS1
18803 * Parse AT+F.. FAX class 1 commands
18805 @@ -403,6 +408,7 @@ isdn_tty_cmd_FCLASS1(char **p, modem_inf
18812 * Parse AT+F.. FAX class 2 commands
18813 @@ -970,6 +976,70 @@ isdn_tty_cmd_FCLASS2(char **p, modem_inf
18818 + /* LO=n - Flow control opts */
18819 + if (!strncmp(p[0], "LO", 2)) { /* TODO */
18824 + sprintf(rs, "\r\n%d", f->lo);
18825 + isdn_tty_at_cout(rs, info);
18829 + if (*p[0] == '?') {
18831 + sprintf(rs, "\r\n0,1,2");
18832 + isdn_tty_at_cout(rs, info);
18834 + par = isdn_getnum(p);
18835 + if ((par < 0) || (par > 2))
18838 +#ifdef ISDN_TTY_FAX_STAT_DEBUG
18839 + printk(KERN_DEBUG "isdn_tty: Fax FLO=%d\n", par);
18850 + /* LPL=n - Doc for polling cmd */
18851 + if (!strncmp(p[0], "LPL", 3)) { /* TODO */
18856 + sprintf(rs, "\r\n%d", f->lpl);
18857 + isdn_tty_at_cout(rs, info);
18861 + if (*p[0] == '?') {
18863 + sprintf(rs, "\r\n0,1");
18864 + isdn_tty_at_cout(rs, info);
18866 + par = isdn_getnum(p);
18867 + if ((par < 0) || (par > 1))
18870 +#ifdef ISDN_TTY_FAX_STAT_DEBUG
18871 + printk(KERN_DEBUG "isdn_tty: Fax FLPL=%d\n", par);
18882 /* MDL? - DCE Model */
18883 if (!strncmp(p[0], "MDL?", 4)) {
18884 @@ -1049,6 +1119,38 @@ isdn_tty_cmd_FCLASS2(char **p, modem_inf
18889 + /* PTS=n - Page transfer status */
18890 + if (!strncmp(p[0], "PTS", 3)) { /* TODO */
18895 + sprintf(rs, "\r\n%d", f->pts);
18896 + isdn_tty_at_cout(rs, info);
18900 + if (*p[0] == '?') {
18902 + sprintf(rs, "\r\n0-5");
18903 + isdn_tty_at_cout(rs, info);
18905 + par = isdn_getnum(p);
18906 + if ((par < 0) || (par > 5))
18909 +#ifdef ISDN_TTY_FAX_STAT_DEBUG
18910 + printk(KERN_DEBUG "isdn_tty: Fax FPTS=%d\n", par);
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);
18928 + /* SPL=n - Enable polling */
18929 + if (!strncmp(p[0], "SPL", 3)) { /* TODO */
18934 + sprintf(rs, "\r\n%d", f->spl);
18935 + isdn_tty_at_cout(rs, info);
18939 + if (*p[0] == '?') {
18941 + sprintf(rs, "\r\n0,1");
18942 + isdn_tty_at_cout(rs, info);
18944 + par = isdn_getnum(p);
18945 + if ((par < 0) || (par > 1))
18948 +#ifdef ISDN_TTY_FAX_STAT_DEBUG
18949 + printk(KERN_DEBUG "isdn_tty: Fax FSPL=%d\n", par);
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
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));
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
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 $
18980 * header for Linux ISDN subsystem, tty_fax related functions (linklevel).
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
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 $
18990 * Linux ISDN subsystem, V.110 related functions (linklevel).
18994 #undef ISDN_V110_DEBUG
18996 -char *isdn_v110_revision = "$Revision: 1.1.4.1 $";
18997 +char *isdn_v110_revision = "$Revision: 1.8 $";
18999 #define V110_38400 255
19000 #define V110_19200 15
19001 @@ -138,6 +138,14 @@ isdn_v110_close(isdn_v110_stream * v)
19003 #ifdef ISDN_V110_DEBUG
19004 printk(KERN_DEBUG "v110 close\n");
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);
19014 kfree(v->encodebuf);
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
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 $
19024 * Linux ISDN subsystem, V.110 related functions (linklevel).
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
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 $
19034 * Linux ISDN subsystem, X.25 related functions
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
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 $
19044 * header for Linux ISDN subsystem, x.25 related functions
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
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 $
19054 * ISDN low-level module implementing a dummy loop driver.
19057 #include <linux/init.h>
19058 #include "isdnloop.h"
19060 -static char *revision = "$Revision: 1.1.4.1 $";
19061 +static char *revision = "$Revision$";
19062 static char *isdnloop_id;
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");
19070 -static int isdnloop_addcard(char *);
19072 + static int isdnloop_addcard(char *);
19075 * Free queue completely.
19076 @@ -1542,11 +1542,7 @@ isdnloop_init(void)
19078 strcpy(rev, " ??? ");
19079 printk(KERN_NOTICE "isdnloop-ISDN-driver Rev%s\n", rev);
19082 - return (isdnloop_addcard(isdnloop_id));
19085 + return (isdnloop_addcard(isdnloop_id));
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
19094 -/* $Id: isdnloop.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19097 * Loopback lowlevel module for testing of linklevel.
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
19105 * Copyright (C) 1996 Universidade de Lisboa
19107 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19108 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
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
19118 * Copyright (C) 1996 Universidade de Lisboa
19120 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19121 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
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
19131 * Copyright (C) 1996 Universidade de Lisboa
19133 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19134 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
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
19144 * Copyright (C) 1996 Universidade de Lisboa
19146 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19147 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
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);
19155 -static inline struct pcbit_chan *
19157 +struct pcbit_chan *
19158 capi_channel(struct pcbit_dev *dev, struct sk_buff *skb)
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
19167 * Copyright (C) 1996 Universidade de Lisboa
19169 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19170 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
19172 * This software may be used and distributed according to the terms of
19173 * the GNU General Public License, incorporated herein by reference.
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>
19184 @@ -89,6 +91,7 @@ int pcbit_init_dev(int board, int mem_ba
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");
19195 dev->sh_mem = (unsigned char*)ioremap(dev->ph_mem, 4096);
19197 + dev->sh_mem = (unsigned char*) mem_base;
19202 @@ -112,8 +118,10 @@ int pcbit_init_dev(int board, int mem_ba
19203 dev->b1 = kmalloc(sizeof(struct pcbit_chan), GFP_KERNEL);
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);
19213 @@ -122,8 +130,10 @@ int pcbit_init_dev(int board, int mem_ba
19215 printk("pcbit_init: couldn't malloc pcbit_chan struct\n");
19217 +#ifdef COMPAT_HAS_ISA_IOREMAP
19218 iounmap((unsigned char*)dev->sh_mem);
19219 release_mem_region(dev->ph_mem, 4096);
19224 @@ -144,8 +154,10 @@ int pcbit_init_dev(int board, int mem_ba
19228 +#ifdef COMPAT_HAS_ISA_IOREMAP
19229 iounmap((unsigned char*)dev->sh_mem);
19230 release_mem_region(dev->ph_mem, 4096);
19233 dev_pcbit[board] = NULL;
19235 @@ -166,8 +178,10 @@ int pcbit_init_dev(int board, int mem_ba
19236 free_irq(irq, dev);
19239 +#ifdef COMPAT_HAS_ISA_IOREMAP
19240 iounmap((unsigned char*)dev->sh_mem);
19241 release_mem_region(dev->ph_mem, 4096);
19244 dev_pcbit[board] = NULL;
19246 @@ -197,8 +211,10 @@ int pcbit_init_dev(int board, int mem_ba
19247 free_irq(irq, dev);
19250 +#ifdef COMPAT_HAS_ISA_IOREMAP
19251 iounmap((unsigned char*)dev->sh_mem);
19252 release_mem_region(dev->ph_mem, 4096);
19255 dev_pcbit[board] = NULL;
19257 @@ -235,8 +251,10 @@ void pcbit_terminate(int board)
19258 del_timer(&dev->b2->fsm_timer);
19261 +#ifdef COMPAT_HAS_ISA_IOREMAP
19262 iounmap((unsigned char*)dev->sh_mem);
19263 release_mem_region(dev->ph_mem, 4096);
19268 @@ -430,7 +448,7 @@ int pcbit_writecmd(const u_char* buf, in
19269 switch(dev->l2_state) {
19271 /* check (size <= rdp_size); write buf into board */
19272 - if (len < 0 || len > BANK4 + 1)
19273 + if (len > BANK4 + 1)
19275 printk("pcbit_writecmd: invalid length %d\n", len);
19277 @@ -609,6 +627,20 @@ void pcbit_l3_receive(struct pcbit_dev *
19279 dev->b2->s_refnum);
19282 + if (dev->b1->s_refnum == refnum)
19286 + if (dev->b2->s_refnum == refnum)
19290 + printk(KERN_WARNING "Connection Confirm - refnum doesn't match chan\n");
19295 /* We just try to find a channel in the right state */
19297 if (dev->b1->fsm_state == ST_CALL_INIT)
19298 @@ -622,6 +654,7 @@ void pcbit_l3_receive(struct pcbit_dev *
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
19312 * Copyright (C) 1996 Universidade de Lisboa
19314 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19315 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
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
19325 * Copyright (C) 1996 Universidade de Lisboa
19327 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19328 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
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
19338 * Copyright (C) 1996 Universidade de Lisboa
19340 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19341 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
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)
19347 if (dev->read_frame) {
19348 printk(KERN_DEBUG "pcbit_receive: Type 0 frame and read_frame != NULL\n");
19350 + pcbit_l2_error(dev);
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;
19360 frame = kmalloc(sizeof(struct frame_buf), GFP_ATOMIC);
19362 @@ -449,10 +454,14 @@ pcbit_receive(struct pcbit_dev *dev)
19364 if (!(frame = dev->read_frame)) {
19365 printk("Type 1 frame and no frame queued\n");
19367 /* usually after an error: toss frame */
19368 dev->readptr += tt;
19369 if (dev->readptr > dev->sh_mem + BANK2 + BANKLEN)
19370 dev->readptr -= BANKLEN;
19372 + pcbit_l2_error(dev);
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
19383 * Copyright (C) 1996 Universidade de Lisboa
19385 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19386 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
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
19396 * Copyright (C) 1996 Universidade de Lisboa
19398 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19399 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
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)
19407 +#ifdef COMPAT_HAS_NEW_SETUP
19408 #define MAX_PARA (MAX_PCBIT_CARDS * 2)
19409 static int __init pcbit_setup(char *line)
19411 @@ -100,6 +101,11 @@ static int __init pcbit_setup(char *line
19412 int ints[MAX_PARA+1];
19414 str = get_options(line, MAX_PARA, ints);
19416 +void pcbit_setup(char *str, int *ints)
19423 @@ -118,9 +124,13 @@ static int __init pcbit_setup(char *line
19427 +#ifdef COMPAT_HAS_NEW_SETUP
19430 __setup("pcbit=", pcbit_setup);
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
19443 * Copyright (C) 1996 Universidade de Lisboa
19445 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19446 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
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
19455 -/* $Id: card.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19458 * Driver parameters for SpellCaster ISA ISDN adapters
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
19465 -/* $Id: command.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19468 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19470 @@ -95,7 +95,7 @@ int get_card_from_id(int driver)
19471 if(adapter[i]->driverId == driver)
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
19484 -/* $Id: debug.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19487 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
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
19494 -/* $Id: debug.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19497 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
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
19504 -/* $Id: event.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19507 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
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);
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.
19524 + printk(""); /* Hack! Doesn't work without this !!!??? */
19526 if(sig == SIGNATURE)
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);
19534 + printk(""); /* Hack! Doesn't work without this !!!??? */
19536 if(sig == SIGNATURE)
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
19544 -/* $Id: interrupt.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19547 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
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
19555 extern board *adapter[];
19558 +static char *ChannelStates[] = { "Idle", "Ready", "Connecting", "Connected", "Disconnecting" };
19561 int GetStatus(int card, boardInfo *);
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
19568 -/* $Id: message.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19571 * functions for sending and receiving control messages
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
19578 -/* $Id: message.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19581 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
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
19588 -/* $Id: packet.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19591 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
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
19598 -/* $Id: shmem.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19601 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
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
19608 -/* $Id: timer.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19611 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
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
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 $
19621 * Turbo PAM ISDN driver for Linux. (Kernel Driver)
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
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 $
19631 * Turbo PAM ISDN driver for Linux. (Kernel Driver - ISDN commands)
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
19638 -/* $Id: tpam_crcpc.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
19641 * Turbo PAM ISDN driver for Linux. (Kernel Driver - CRC encoding)
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
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 $
19651 * Turbo PAM ISDN driver for Linux. (Kernel Driver - HDLC encoding)
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
19658 -/* $Id: tpam_main.c,v 1.1.2.2 2001/12/09 18:45:14 kai Exp $
19661 * Turbo PAM ISDN driver for Linux. (Kernel Driver - main routines)
19663 @@ -254,7 +254,7 @@ static struct pci_driver tpam_driver = {
19665 id_table: tpam_pci_tbl,
19667 - remove: __devexit_p(tpam_remove),
19668 + remove: tpam_remove,
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
19677 -/* $Id: tpam_memory.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
19680 * Turbo PAM ISDN driver for Linux. (Kernel Driver - Board Memory Access)
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
19687 -/* $Id: tpam_nco.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
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
19697 -/* $Id: tpam_queues.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
19700 * Turbo PAM ISDN driver for Linux. (Kernel Driver)
19702 @@ -146,7 +146,6 @@ void tpam_irq(int irq, void *dev_id, str
19704 hpic = readl(card->bar0 + TPAM_HPIC_REGISTER);
19705 if (waiting_too_long++ > 0xfffffff) {
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
19715 -/* $Id: b1lli.h,v 1.8.8.3 2001/09/23 22:25:05 kai Exp $
19718 * ISDN lowlevel-module for AVM B1-card.
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
19725 -/* $Id: b1pcmcia.h,v 1.1.8.2 2001/09/23 22:25:05 kai Exp $
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
19735 -/* $Id: capi.h,v 1.1.4.1 2001/11/20 14:19:38 kai Exp $
19738 * CAPI 2.0 Interface for Linux
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
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 $
19748 * Copyright 1997 by Henner Eisen <eis@baty.hanse.de>
19752 #include <linux/skbuff.h>
19753 #include <linux/netdevice.h>
19754 +#include <linux/isdn_compat.h>
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
19763 -/* $Id: hysdn_if.h,v 1.1.8.3 2001/09/23 22:25:05 kai Exp $
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
19773 -/* $Id: tpam.h,v 1.1.2.1 2001/11/20 14:19:38 kai Exp $
19776 * Turbo PAM ISDN driver for Linux. (Kernel Driver)
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
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 $
19786 * Main header for the Linux ISDN subsystem (linklevel).
19792 +#include <linux/isdn_compat.h>
19793 #include <linux/ioctl.h>
19795 #ifdef CONFIG_COBALT_MICRO_SERVER
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 */
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. */
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. */
19810 #define INF_DV 0x01 /* Data version for /dev/isdninfo */
19812 @@ -187,6 +194,61 @@ typedef struct {
19813 #define ISDN_MINOR_PPPMAX (128 + (ISDN_MAX_CHANNELS-1))
19814 #define ISDN_MINOR_STATUS 255
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>
19831 +typedef struct DWABCJIFFIES {
19833 + u_long msec_1000;
19842 +#ifdef CONFIG_ISDN_WITH_ABC_NEED_DWSJIFFIES
19843 +DWABCJIFFIES isdn_dwabc_jiffies;
19845 +extern DWABCJIFFIES isdn_dwabc_jiffies;
19847 +#define dwsjiffies (isdn_dwabc_jiffies.msec_1000)
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
19861 +#define ISDN_DW_ABC_IFFLAG_NODCHAN 0x00000001L
19862 +#define ISDN_DW_ABC_IFFLAG_BSDAKTIV 0x00000002L
19864 +#define ISDN_DW_ABC_BITLOCK_SEND 0
19865 +#define ISDN_DW_ABC_BITLOCK_RECEIVE 1
19867 +#endif /* CONFIG_ISDN_WITH_ABC */
19871 #ifdef CONFIG_ISDN_PPP
19873 #ifdef CONFIG_ISDN_PPP_VJ
19874 @@ -204,9 +266,11 @@ typedef struct {
19875 # include <linux/concap.h>
19878 +#ifdef HAVE_DEVFS_FS
19879 #ifdef CONFIG_DEVFS_FS
19880 # include <linux/devfs_fs_kernel.h>
19882 +#endif /* HAVE_DEVFS_FS */
19884 #include <linux/isdnif.h>
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 */
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 */
19897 #define ISDN_NET_MAGIC 0x49344C02 /* for paranoia-checking */
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 */
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;
19921 + ulong dw_abc_bchan_last_connect;
19922 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
19923 + short dw_abc_bchan_errcnt;
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;
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;
19937 /* the interface itself */
19938 @@ -608,12 +710,13 @@ typedef struct isdn_devt {
19939 int tflags; /* Timer-Flags: */
19940 /* see ISDN_TIMER_..defines */
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];
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];
19965 #endif /* CONFIG_DEVFS_FS */
19966 +#endif /* HAVE_DEVFS_FS */
19969 extern isdn_dev *dev;
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);
19997 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK
19998 +extern int dw_abc_udp_test(struct sk_buff *skb,struct net_device *ndev);
20002 #endif /* __KERNEL__ */
20004 Index: linux-2.4.35.4/include/linux/isdn_compat.h
20005 ===================================================================
20007 +++ linux-2.4.35.4/include/linux/isdn_compat.h
20009 +/* $Id: isdn_compat.h,v 1.53 2001/09/24 13:23:13 kai Exp $
20011 + * Linux ISDN subsystem
20012 + * Compatibility for various Linux kernel versions
20014 + * This software may be used and distributed according to the terms
20015 + * of the GNU General Public License, incorporated herein by reference.
20019 +#ifndef _LINUX_ISDN_COMPAT_H
20020 +#define _LINUX_ISDN_COMPAT_H
20024 +#ifndef ISDN_COMPAT_NOT_GENERIC
20025 +/* when using std2kern -u, this part is left out and instead provided
20026 + by the .ctrl files */
20028 +#include <linux/version.h>
20030 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)
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
20039 +#define __devinitdata
20041 +#else /* 2.2.18 and later */
20043 +#define COMPAT_HAS_NEW_SETUP
20044 +#define COMPAT_HAS_NEW_WAITQ
20048 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
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)
20061 +#define __devinitdata
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)
20078 +#else /* 2.4.0 and later */
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
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
20101 +#endif /* ISDN_COMPAT_GENERIC */
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)
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);
20116 +static inline int pci_enable_device(struct pci_dev *dev)
20120 +#endif /* __powerpc__ */
20122 +#define PCI_ANY_ID (~0)
20124 +/* as this is included multiple times, we make it inline */
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)
20130 + unsigned short subsystem_vendor, subsystem_device;
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))
20143 +#ifdef COMPAT_NO_SOFTNET
20144 +#include <linux/netdevice.h>
20147 + * Tell upper layers that the network device is ready to xmit more frames.
20149 +static void __inline__ netif_wake_queue(struct net_device * dev)
20156 + * called during net_device open()
20158 +static void __inline__ netif_start_queue(struct net_device * dev)
20161 + /* actually, we never use the interrupt flag at all */
20162 + dev->interrupt = 0;
20167 + * Ask upper layers to temporarily cease passing us more xmit frames.
20169 +static void __inline__ netif_stop_queue(struct net_device * dev)
20174 +#endif /* COMPAT_NO_SOFTNET */
20176 +#ifndef COMPAT_HAS_NEW_WAITQ
20177 +typedef struct wait_queue wait_queue_t;
20178 +typedef struct wait_queue *wait_queue_head_t;
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 */
20186 +#ifdef COMPAT_NEED_PCI_IDS
20188 +#define PCI_ANY_ID (~0)
20190 +#define PCI_VENDOR_ID_DYNALINK 0x0675
20191 +#define PCI_DEVICE_ID_DYNALINK_IS64PH 0x1702
20193 +#define PCI_DEVICE_ID_WINBOND2_6692 0x6692
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
20199 +#define PCI_VENDOR_ID_ELSA 0x1048
20200 +#define PCI_DEVICE_ID_ELSA_MICROLINK 0x1000
20201 +#define PCI_DEVICE_ID_ELSA_QS3000 0x3000
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
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
20226 +#define PCI_VENDOR_ID_ASUSTEK 0x1043
20227 +#define PCI_DEVICE_ID_ASUSTEK_0675 0x0675
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
20235 +#define PCI_DEVICE_ID_SATSAGEM_NICCY 0x1016
20237 +#define PCI_DEVICE_ID_TIGERJET_100 0x0002
20239 +#define PCI_VENDOR_ID_ANIGMA 0x1051
20240 +#define PCI_DEVICE_ID_ANIGMA_MC145575 0x0100
20242 +#define PCI_VENDOR_ID_ZOLTRIX 0x15b0
20243 +#define PCI_DEVICE_ID_ZOLTRIX_2BD0 0x2BD0
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
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
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
20263 +#define PCI_VENDOR_ID_ABOCOM 0x13D1
20264 +#define PCI_DEVICE_ID_ABOCOM_2BD1 0x2BD1
20266 +#endif /* COMPAT_NEED_PCI_IDS */
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
20275 -/* $Id: isdn_divertif.h,v 1.1.4.1 2001/11/20 14:19:38 kai Exp $
20278 * Header for the diversion supplementary interface for i4l.
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 */
20296 /*********************/
20297 Index: linux-2.4.35.4/include/linux/isdn_dwabc.h
20298 ===================================================================
20300 +++ linux-2.4.35.4/include/linux/isdn_dwabc.h
20302 +/* $Id: isdn_dwabc.h,v 1.9 2001/09/26 20:32:08 detabc Exp $
20304 + * Header for the Linux ISDN abc-extension.
20306 + * Copyright by abc GmbH
20307 + * written by Detlef Wengorz <detlefw@isdn4linux.de>
20309 + * This software may be used and distributed according to the terms
20310 + * of the GNU General Public License, incorporated herein by reference.
20314 +#ifndef ISDN_DWABC_H
20315 +#define ISDN_DWABC_H
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>
20326 +typedef struct ISDN_DWSPINLOCK {
20333 +} ISDN_DWSPINLOCK;
20335 +#define ISDN_DWSPIN_UNLOCKED \
20336 + (ISDN_DWSPINLOCK) { \
20337 + spin: SPIN_LOCK_UNLOCKED, \
20343 +#define ISDN_DWSPIN_INIT(x) \
20344 + do { *(x) = ISDN_DWSPIN_UNLOCKED; } while(0);
20346 +static __inline__ int isdn_dwspin_trylock(ISDN_DWSPINLOCK *spin)
20348 + if(!spin_trylock(&spin->spin)) {
20350 + if(spin->owner == smp_processor_id())
20353 + spin_lock(&spin->spin);
20356 + spin->owner = smp_processor_id();
20360 +static __inline__ void isdn_dwspin_unlock(ISDN_DWSPINLOCK *spin)
20362 + spin->owner = -1;
20363 + spin_unlock(&spin->spin);
20368 +#include <sys/types.h>
20371 +#define DWABC_LCR_FLG_NEWNUMBER 0x00000001L
20372 +#define DWABC_LCR_FLG_DISABLE 0x00000002L
20373 +#define DWABC_LCR_FLG_NEWHUPTIME 0x00000004L
20376 +struct ISDN_DWABC_LCR_IOCTL {
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 */
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
20391 -/* $Id: isdn_lzscomp.h,v 1.1.4.1 2001/11/20 14:19:38 kai Exp $
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
20401 #ifndef _LINUX_ISDN_PPP_H
20402 #define _LINUX_ISDN_PPP_H
20404 +#include <linux/isdn_compat.h>
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] )
20412 +#ifdef COMPAT_NEED_MPPP_DEFS
20413 +#define PPP_MP 0x003d
20414 +#define PPP_COMPFRAG 0x00fb
20415 +#define PPP_CCPFRAG 0x80fb
20418 #define SC_MP_PROT 0x00000200
20419 #define SC_REJ_MP_PROT 0x00000400
20420 @@ -65,9 +71,6 @@ struct isdn_ppp_comp_data {
20422 #include <linux/config.h>
20424 -#ifdef CONFIG_IPPP_FILTER
20425 -#include <linux/filter.h>
20428 #define DECOMP_ERR_NOMEM (-10)
20430 @@ -226,10 +229,6 @@ struct ippp_struct {
20431 unsigned char *cbuf;
20432 struct slcompress *slcomp;
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 */
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
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 $
20449 * Linux ISDN subsystem
20450 * Definition of the interface between the subsystem and its low-level drivers.
20452 #ifndef __ISDNIF_H__
20453 #define __ISDNIF_H__
20455 +#include <linux/isdn_compat.h>
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 */
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
20473 -/* $Id: kernelcapi.h,v 1.1.4.2 2002/01/28 18:25:10 kai Exp $
20475 + * $Id: kernelcapi.h,v 1.9 2000/11/28 09:34:02 kai Exp $
20477 * Kernel CAPI 2.0 Interface for Linux
20479 * (c) Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
20481 - * This software may be used and distributed according to the terms
20482 - * of the GNU General Public License, incorporated herein by reference.
20486 #ifndef __KERNELCAPI_H__