1 --- a/Documentation/isdn/CREDITS
2 +++ b/Documentation/isdn/CREDITS
3 @@ -37,7 +37,7 @@ Michael Knigge (knick@cove.han.de)
4 Andreas Kool (akool@Kool.f.EUnet.de)
5 For contribution of the isdnlog/isdnrep-tool
7 -Pedro Roque Marques (pedro_m@yahoo.com)
8 +Pedro Roque Marques (roque@di.fc.ul.pt)
9 For lot of new ideas and the pcbit driver.
11 Eberhard Moenkeberg (emoenke@gwdg.de)
12 --- a/Documentation/isdn/HiSax.cert
13 +++ b/Documentation/isdn/HiSax.cert
14 @@ -68,6 +68,8 @@ drivers/isdn/hisax/cert.c
15 drivers/isdn/hisax/elsa.c
16 drivers/isdn/hisax/diva.c
17 drivers/isdn/hisax/hfc_pci.c
18 +drivers/isdn/hisax/hfc_usbr.c
19 +drivers/isdn/hisax/hfc_usb.c
21 Please send any changes, bugfixes and patches to me rather than implementing
22 them directly into the HiSax sources.
23 --- a/Documentation/isdn/INTERFACE
24 +++ b/Documentation/isdn/INTERFACE
26 -$Id: INTERFACE,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
27 +$Id: INTERFACE,v 1.17 2002/01/31 13:26:35 keil Exp $
29 Description of the Interface between Linklevel and Hardwarelevel
31 @@ -399,7 +399,7 @@ Description of the Interface between Lin
32 protocol-Id is one of the constants ISDN_PROTO_L3...
33 parm.fax = Pointer to T30_s fax struct. (fax usage only)
35 - ISDN_CMD_GETL2: (currently unused)
36 + ISDN_CMD_GETL3: (currently unused)
38 With this command, the HL-driver is told to return the current
39 setting of the Layer-3-protocol.
40 @@ -781,3 +781,22 @@ Description of the Interface between Lin
41 arg = channel-number, locally to the driver. (starting with 0)
46 + With this call, the HL-driver signals the receive of an ALERTING message to the LL.
50 + command = ISDN_STAT_ALERT
51 + arg = channel-number, locally to the driver. (starting with 0)
55 + With this call, the HL-driver signals the receive of an CALL PROCEEDING message
60 + command = ISDN_STAT_PROCEED
61 + arg = channel-number, locally to the driver. (starting with 0)
63 --- a/Documentation/isdn/INTERFACE.fax
64 +++ b/Documentation/isdn/INTERFACE.fax
66 -$Id: INTERFACE.fax,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
67 +$Id: INTERFACE.fax,v 1.2 2000/08/06 09:22:50 armin Exp $
70 Description of the fax-subinterface between linklevel and hardwarelevel of
71 --- a/Documentation/isdn/README
72 +++ b/Documentation/isdn/README
73 @@ -278,6 +278,12 @@ README for the ISDN-subsystem
74 1 = Add CPN to FCON message on
75 Bit 2: 0 = Add CDN to RING/FCON message off
76 1 = Add CDN to RING/FCON message on
77 + Bit 3: 0 = Do not signal RINGING
78 + 1 = Signal RINGING if ALERT was received
79 + Bit 4: 0 = Do not signal PROCEEDING
80 + 1 = Signal PROCEEDING if CALL PROCEEDING
84 Last but not least a (at the moment fairly primitive) device to request
85 the line-status (/dev/isdninfo) is made available.
86 --- a/Documentation/isdn/README.HiSax
87 +++ b/Documentation/isdn/README.HiSax
88 @@ -41,10 +41,9 @@ ELSA Quickstep 3000 (same settings as QS
89 ELSA Quickstep 3000PCI
92 -Eicon Diva 2.0 ISA and PCI (S0 and U interface, no PRO version)
93 -Eicon Diva 2.01 ISA and PCI
96 +Eicon.Diehl Diva 2.0 ISA and PCI (S0 and U interface, no PRO version)
97 +Eicon.Diehl Diva 2.01 ISA and PCI
98 +Eicon.Diehl Diva Piccola
99 ASUSCOM NETWORK INC. ISDNLink 128K PC adapter (order code I-IN100-ST-D)
100 Dynalink IS64PH (OEM version of ASUSCOM NETWORK INC. ISDNLink 128K adapter)
101 PCBIT-DP (OEM version of ASUSCOM NETWORK INC. ISDNLink)
102 @@ -53,7 +52,6 @@ Sedlbauer Speed Card (Speed Win, Teledat
103 Sedlbauer Speed Star/Speed Star2 (PCMCIA)
104 Sedlbauer ISDN-Controller PC/104
105 USR Sportster internal TA (compatible Stollmann tina-pp V3)
107 ith Kommunikationstechnik GmbH MIC 16 ISA card
108 Traverse Technologie NETjet PCI S0 card and NETspider U card
109 Ovislink ISDN sc100-p card (NETjet driver)
110 @@ -68,14 +66,14 @@ Gazel ISDN cards
112 Winbond W6692 based cards
113 HFC-S+, HFC-SP/PCMCIA cards
118 Note: PCF, PCF-Pro: up to now, only the ISDN part is supported
119 PCC-8: not tested yet
120 Eicon.Diehl Diva U interface not tested
122 If you know other passive cards with the Siemens chipset, please let me know.
123 +To use the PNP cards you need the isapnptools.
124 You can combine any card, if there is no conflict between the resources
127 @@ -91,15 +89,8 @@ There is also some config needed before
128 modules. It is included in the normal "make [menu]config" target at the
129 kernel. Don't forget it, especially to select the right D-channel protocol.
131 -Please note: In older versions of the HiSax driver, all PnP cards
132 -needed to be configured with isapnp and worked only with the HiSax
133 -driver used as a module.
135 -In the current version, HiSax will automatically use the in-kernel
136 -ISAPnP support, provided you selected it during kernel configuration
137 -(CONFIG_ISAPNP), if you don't give the io=, irq= command line parameters.
139 -The affected card types are: 4,7,12,14,19,27-30
140 +Please note: All PnP cards need to be configured with isapnp and will work
141 +only with the HiSax driver used as a module.
143 a) when built as a module
144 -------------------------
145 @@ -200,8 +191,6 @@ Card types:
146 37 HFC 2BDS0 S+, SP irq,io
147 38 NETspider U PCI card none
148 39 HFC 2BDS0 SP/PCMCIA irq,io (set with cardmgr)
149 - 40 hotplug interface
150 - 41 Formula-n enter:now PCI none
152 At the moment IRQ sharing is only possible with PCI cards. Please make sure
153 that your IRQ is free and enabled for ISA use.
154 @@ -227,13 +216,6 @@ Examples for module loading
156 modprobe hisax type=4 protocol=2 irq=10 io0=0x580 io1=0x180
158 - In the current version of HiSax, you can instead simply use
160 - modprobe hisax type=4 protocol=2
162 - if you configured your kernel for ISAPnP. Don't run isapnp in
165 6. Teles 16.3, Euro ISDN, I/O base 280 hex, IRQ 12 and
166 Teles 16.0, 1TR6, IRQ 5, Memory d0000 hex
167 modprobe hisax type=3,1 protocol=2,1 io=0x280 mem=0,0xd0000
168 @@ -314,9 +296,7 @@ type
169 36 W6692 based PCI cards none
170 37 HFC 2BDS0 S+,SP/PCMCIA ONLY WORKS AS A MODULE !
171 38 NETspider U PCI card none
172 - 39 HFC 2BDS0 SP/PCMCIA ONLY WORKS AS A MODULE !
173 - 40 hotplug interface ONLY WORKS AS A MODULE !
174 - 41 Formula-n enter:now PCI none
179 --- a/Documentation/isdn/README.act2000
180 +++ b/Documentation/isdn/README.act2000
182 -$Id: README.act2000,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
183 +$Id: README.act2000,v 1.3 2000/08/06 09:22:51 armin Exp $
185 This document describes the ACT2000 driver for the
186 IBM Active 2000 ISDN card.
187 --- a/Documentation/isdn/README.audio
188 +++ b/Documentation/isdn/README.audio
190 -$Id: README.audio,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
191 +$Id: README.audio,v 1.8 1999/07/11 17:17:29 armin Exp $
193 ISDN subsystem for Linux.
194 Description of audio mode.
195 --- a/Documentation/isdn/README.eicon
196 +++ b/Documentation/isdn/README.eicon
198 -$Id: README.eicon,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
199 +$Id: README.eicon,v 1.10 2000/08/13 12:19:15 armin Exp $
201 (c) 1999,2000 Armin Schindler (mac@melware.de)
202 (c) 1999,2000 Cytronics & Melware (info@melware.de)
203 --- a/Documentation/isdn/README.hysdn
204 +++ b/Documentation/isdn/README.hysdn
206 -$Id: README.hysdn,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
207 +$Id: README.hysdn,v 1.3.6.1 2001/02/10 14:41:19 kai Exp $
208 The hysdn driver has been written by
209 by Werner Cornelius (werner@isdn4linux.de or werner@titro.de)
210 for Hypercope GmbH Aachen Germany. Hypercope agreed to publish this driver
211 --- a/Documentation/isdn/README.icn
212 +++ b/Documentation/isdn/README.icn
214 -$Id: README.icn,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
215 +$Id: README.icn,v 1.7 2000/08/06 09:22:51 armin Exp $
217 You can get the ICN-ISDN-card from:
219 --- a/Documentation/isdn/README.pcbit
220 +++ b/Documentation/isdn/README.pcbit
221 @@ -37,4 +37,4 @@ mailing list (isdn4linux@listserv.isdn4l
228 +++ b/Documentation/isdn/abcext_kernel.help
231 +ISDN-ABC-DW Extension
232 +CONFIG_ISDN_WITH_ABC
233 + These are many brand new Options and Features for the
234 + ISDN SUBSYSTEM. Including Logical Device bindings,
235 + Compression and other good stuff for Optimizing your
238 + To Use this Extensions you MUST HAVE THE NEWEST
239 + ISDN4K-UTILS. You must have Version 3.1-Beta6 or
240 + higher. Elsewhere you can not configure this Extensions.
242 + WARNING ! THIS STUF IS NOT PRODUCTION RELEASE THE
243 + FUNCTION ARE UNDER DEVELOPMENT. This ist BETA-CODE.
244 + You can use it at you Own Risk.
246 + For more Information on these Extensions take a look at
247 + "linux/Documentation/isdn/dw-abc-extension-howto.txt or
248 + Online at the Web "http://www.mediatronix.de/i4l/index.html"
250 + Please Report Bugs to "mario@mediatronix.de" or
251 + "delefw@isdn4linux.de"
253 +D-Channel-Callback with Channel in use check
254 +CONFIG_ISDN_WITH_ABC_CALLB
255 + When a Interface is declared as an Callback Interface,
256 + the Interface is checking that the other Side is not
257 + Calling on the same time before the Interface is Dialing.
259 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
260 + for more Information
262 + In most case answer with "Yes" when you have Callback devices,
263 + otherwise leave it "No"
265 +Outgoing-EAZ-Support
266 +CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
267 + Enables the Feature to Define an other EAZ or MSN for
268 + Outgoing calls on an Interface.
270 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
271 + for more Information
273 +Least Cost Router Support
274 +CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
275 + This is the final Kernel Code for configuring an Least
276 + Cost Router Softwarebased. The other Job is to do the
277 + action in ISDNLOG. You need the ISDNLOG to use this
278 + function. Currently the ISDNLOG have not the Support for
280 + So in most situations let the Option off.
282 +TCP keepalive detect and response
283 +CONFIG_ISDN_WITH_ABC_IPV4_TCP_KEEPALIVE
284 + This Option works only with the TCP/IP V4. It enables
285 + the Function that ISDN Devices are Answering TCP_KEEPALIVE Pakets
286 + localy. So that TCP KEEPALIVE Pakets not longer takes the Line
289 +Drop frames Sourceadresse is not Interfaceadress
290 +CONFIG_ISDN_WITH_ABC_IPV4_DYNADDR
291 + This Option works only with the TCP/IP V4. It will allow only
292 + the Transmitt of Pakets where the Sourceadresse is the Interface
293 + adress. It is usefull when you have Lines with Dynamic IP.
295 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
296 + for more Information
298 +Receive do not reset the Hanguptimer
299 +CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
300 + When you activate this option than the reiceive of pakets do
301 + not reset the Hanguptimer. It is very usefull because if the
302 + Paket vor your Network your Network generate an Response and
303 + the Transmit is reseting the HUPTIMER. But when the Paket is
304 + Rejected at your firewall your network generate no Response
305 + and no Sendtraffic is generated. So in this case there is no
306 + need to Reset the Huptimer because you have only received Data.
307 + With that option only Transmitted Data/Pakets will reset the
310 +Support of (device-channel) and Binding Groups
311 +CONFIG_ISDN_WITH_ABC_ICALL_BIND
312 + This Option enables the Feature to Bind logical ISDN Interfaces
313 + to an prefered ISDN Card or ISDN Card plus Channel. So you have
314 + the Chance to keep Channels exclusively for one (or more)
315 + Connection. Very usefull when you have more channels and Use
316 + Calling Line Identification, because you can organize that your
317 + call is going out over the Line with the right EAZ for the CLI.
319 +Skip channel if used external (Dial Only)
320 +CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
321 + When you have more than One ISDN Card in your System and you
322 + will Dialout with an Interface you can become the Situation
323 + that an External Device such a Telephone or Fax is Using the
324 + B-Channels. Normaly ISDN4Linux does not detect this Situation
325 + and dial everytime of the "External Busy" line out. With this
326 + Option Enabled the I4L will detect that he can not dialout on
327 + This Card and dial over the next Card out.
329 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
330 + for more Information
332 +Interface autodisable if Config error
333 +CONFIG_ISDN_WITH_ABC_CONN_ERROR
334 + This Option will detect an Device which generate Telephone
335 + Cost but does not Function correctly because there are
336 + Configerrors on one of the Site. In this Situation the
337 + Interface will be marked as Unsuably for some time to do
338 + not call every time this Site.
340 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
341 + for more Information
344 +CONFIG_ISDN_WITH_ABC_UDP_CHECK
345 + This is the Mainoption to Enable or Disable the UDP
346 + Info Support. An Option to Controll ISDN-Interfaces
347 + Remotely. For this very Complex thing take a look at
349 + "linux/Documentation/isdn/dw-abc-extension-howto.txt"
350 + for more Information.
353 +CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP
355 + Sorry no more Information!
357 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
358 + for more Information
361 +CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL
363 + Sorry no more Information!
365 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
366 + for more Information
368 +Limit on the line frames to two
369 +CONFIG_ISDN_WITH_ABC_FRAME_LIMIT
371 + This Option enables support for sending only 2 Pakets on
372 + the Fly to the ISDN Driver. It is very usefull when you
373 + will use the new RAW-IP Compression. Because of sending
374 + Only 2 Pakets on the Fly makes the risk of overflowing
375 + the ISDN Driver very smaller.
377 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
378 + for more Information
380 +Compression with RAWIP and X75I
381 +CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS
383 + With this Option you have the ability to make Datacompression
384 + on RAW-IP Lines. It is function on HDLC and X75I Connection,
385 + but the Prefered L2-Protocol for Compression is X75I because
386 + the HDLC Protocol have no Errorcorrection.
388 + To Use this Option YOU MUST HAVE ENABLED THE OPTION:
389 + Support synchronous PPP
390 + and must load after loading the main isdndrivers the
391 + Modul "isdn_bsdcomp".
393 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
394 + for more Information
396 --- a/drivers/isdn/Config.in
397 +++ b/drivers/isdn/Config.in
400 # only included if CONFIG_ISDN != n
402 -define_bool CONFIG_ISDN_BOOL y
403 if [ "$CONFIG_INET" != "n" ]; then
404 bool ' Support synchronous PPP' CONFIG_ISDN_PPP
405 if [ "$CONFIG_ISDN_PPP" != "n" ]; then
406 - dep_bool ' PPP filtering for ISDN' CONFIG_IPPP_FILTER $CONFIG_FILTER
407 bool ' Use VJ-compression with synchronous PPP' CONFIG_ISDN_PPP_VJ
408 bool ' Support generic MP (RFC 1717)' CONFIG_ISDN_MPP
409 dep_tristate ' Support BSD compression' CONFIG_ISDN_PPP_BSDCOMP $CONFIG_ISDN
410 @@ -23,6 +21,30 @@ if [ "$CONFIG_X25" != "n" ]; then
413 mainmenu_option next_comment
414 +comment 'ISDN abc-dw-extension'
415 +bool 'Enable isdn-abc-dw-extension' CONFIG_ISDN_WITH_ABC
416 +if [ "$CONFIG_ISDN_WITH_ABC" != "n" ]; then
417 + bool ' Use D-Channel-Callback with Channel in use check' CONFIG_ISDN_WITH_ABC_CALLB
418 + bool ' Enable Outgoing-EAZ-Support' CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
419 + bool ' Enable LCR-Support (need isdnlog)' CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
420 + bool ' RX dont reset hanguptimeout' CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
421 + if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then
422 + bool ' Enable UDP-Info-Support' CONFIG_ISDN_WITH_ABC_UDP_CHECK
423 + if [ "$CONFIG_ISDN_WITH_ABC_UDP_CHECK" != "n" ]; then
424 + bool ' Enable Hangup-Support with UDP-INFO' CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP
425 + bool ' Enable Dial-Support with UDP-INFO' CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL
429 + bool ' Skip channel if used external (dial only)' CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
430 + bool ' Support interface-auto-disable if config-error' CONFIG_ISDN_WITH_ABC_CONN_ERROR
431 + if [ "$CONFIG_ISDN_PPP" != "n" ]; then
432 + bool ' Enable Compression with rawip and x75i' CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS
437 +mainmenu_option next_comment
438 comment 'ISDN feature submodules'
439 dep_tristate 'isdnloop support' CONFIG_ISDN_DRV_LOOP $CONFIG_ISDN
440 dep_tristate 'Support isdn diversion services' CONFIG_ISDN_DIVERSION $CONFIG_ISDN
441 @@ -34,7 +56,6 @@ mainmenu_option next_comment
442 comment 'Passive ISDN cards'
443 dep_tristate 'HiSax SiemensChipSet driver support' CONFIG_ISDN_DRV_HISAX $CONFIG_ISDN
444 if [ "$CONFIG_ISDN_DRV_HISAX" != "n" ]; then
445 - define_bool CONFIG_ISDN_HISAX y
446 comment ' D-channel protocol features'
447 bool ' HiSax Support for EURO/DSS1' CONFIG_HISAX_EURO
448 if [ "$CONFIG_HISAX_EURO" != "n" ]; then
449 @@ -45,31 +66,28 @@ if [ "$CONFIG_ISDN_DRV_HISAX" != "n" ];
451 bool ' HiSax Support for german 1TR6' CONFIG_HISAX_1TR6
452 bool ' HiSax Support for US NI1' CONFIG_HISAX_NI1
453 - int ' Maximum number of cards supported by HiSax' CONFIG_HISAX_MAX_CARDS 8
454 comment ' HiSax supported cards'
455 - if [ "$CONFIG_ISA" != "n" ]; then
456 - bool ' Teles 16.0/8.0' CONFIG_HISAX_16_0
457 - bool ' Teles 16.3 or PNP or PCMCIA' CONFIG_HISAX_16_3
458 - bool ' AVM A1 (Fritz)' CONFIG_HISAX_AVM_A1
459 - bool ' ITK ix1-micro Revision 2' CONFIG_HISAX_IX1MICROR2
460 - bool ' ASUSCOM ISA cards' CONFIG_HISAX_ASUSCOM
461 - bool ' TELEINT cards' CONFIG_HISAX_TELEINT
462 - bool ' HFC-S based cards' CONFIG_HISAX_HFCS
463 - bool ' USR Sportster internal TA' CONFIG_HISAX_SPORTSTER
464 - bool ' MIC card' CONFIG_HISAX_MIC
465 - bool ' Siemens I-Surf card' CONFIG_HISAX_ISURF
466 - bool ' HST Saphir card' CONFIG_HISAX_HSTSAPHIR
468 + bool ' Teles 16.0/8.0' CONFIG_HISAX_16_0
469 + bool ' Teles 16.3 or PNP or PCMCIA' CONFIG_HISAX_16_3
470 bool ' Teles PCI' CONFIG_HISAX_TELESPCI
471 bool ' Teles S0Box' CONFIG_HISAX_S0BOX
472 + bool ' AVM A1 (Fritz)' CONFIG_HISAX_AVM_A1
473 bool ' AVM PnP/PCI (Fritz!PnP/PCI)' CONFIG_HISAX_FRITZPCI
474 bool ' AVM A1 PCMCIA (Fritz)' CONFIG_HISAX_AVM_A1_PCMCIA
475 bool ' Elsa cards' CONFIG_HISAX_ELSA
476 + bool ' ITK ix1-micro Revision 2' CONFIG_HISAX_IX1MICROR2
477 bool ' Eicon.Diehl Diva cards' CONFIG_HISAX_DIEHLDIVA
478 + bool ' ASUSCOM ISA cards' CONFIG_HISAX_ASUSCOM
479 + bool ' TELEINT cards' CONFIG_HISAX_TELEINT
480 + bool ' HFC-S based cards' CONFIG_HISAX_HFCS
481 bool ' Sedlbauer cards' CONFIG_HISAX_SEDLBAUER
482 + bool ' USR Sportster internal TA' CONFIG_HISAX_SPORTSTER
483 + bool ' MIC card' CONFIG_HISAX_MIC
484 bool ' NETjet card' CONFIG_HISAX_NETJET
485 bool ' NETspider U card' CONFIG_HISAX_NETJET_U
486 bool ' Niccy PnP/PCI card' CONFIG_HISAX_NICCY
487 + bool ' Siemens I-Surf card' CONFIG_HISAX_ISURF
488 + bool ' HST Saphir card' CONFIG_HISAX_HSTSAPHIR
489 bool ' Telekom A4T card' CONFIG_HISAX_BKM_A4T
490 bool ' Scitel Quadro card' CONFIG_HISAX_SCT_QUADRO
491 bool ' Gazel cards' CONFIG_HISAX_GAZEL
492 @@ -78,20 +96,27 @@ if [ "$CONFIG_ISDN_DRV_HISAX" != "n" ];
493 bool ' HFC-S+, HFC-SP, HFC-PCMCIA cards' CONFIG_HISAX_HFC_SX
494 if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then
495 # bool ' TESTEMULATOR (EXPERIMENTAL)' CONFIG_HISAX_TESTEMU
496 - bool ' Formula-n enter:now PCI card' CONFIG_HISAX_ENTERNOW_PCI
497 if [ "$ARCH" = "sparc" -o "$ARCH" = "sparc64" ]; then
498 bool ' Am7930' CONFIG_HISAX_AMD7930
501 bool ' HiSax debugging' CONFIG_HISAX_DEBUG
503 - dep_tristate 'Sedlbauer PCMCIA cards' CONFIG_HISAX_SEDLBAUER_CS $CONFIG_ISDN_DRV_HISAX $CONFIG_PCMCIA
504 - dep_tristate 'ELSA PCMCIA MicroLink cards' CONFIG_HISAX_ELSA_CS $CONFIG_ISDN_DRV_HISAX $CONFIG_PCMCIA
505 - dep_tristate 'AVM A1 PCMCIA cards' CONFIG_HISAX_AVM_A1_CS $CONFIG_ISDN_DRV_HISAX $CONFIG_PCMCIA $CONFIG_HISAX_AVM_A1_PCMCIA
506 - dep_tristate 'ST5481 USB ISDN modem (EXPERIMENTAL)' CONFIG_HISAX_ST5481 $CONFIG_ISDN_DRV_HISAX $CONFIG_EXPERIMENTAL
507 - dep_tristate 'AVM Fritz!Card PCI/PCIv2/PnP support (EXPERIMENTAL)' CONFIG_HISAX_FRITZ_PCIPNP $CONFIG_ISDN_DRV_HISAX $CONFIG_EXPERIMENTAL
508 - dep_tristate 'Auerswald devices ISDN support' CONFIG_USB_AUERISDN $CONFIG_ISDN_DRV_HISAX
509 + dep_tristate 'Sedlbauer PCMCIA cards' CONFIG_HISAX_SEDLBAUER_CS $CONFIG_PCMCIA
510 + dep_tristate 'ELSA PCMCIA MicroLink cards' CONFIG_HISAX_ELSA_CS $CONFIG_PCMCIA
511 + dep_tristate 'Colognechip HFC-USB support' CONFIG_HISAX_HFC_USB_CS $CONFIG_HISAX $CONFIG_USB
512 + dep_tristate 'ST5481 USB ISDN modem (EXPERIMENTAL)' CONFIG_HISAX_ST5481 $CONFIG_HISAX $CONFIG_USB $CONFIG_EXPERIMENTAL
513 + dep_tristate 'Fritz!PCIv2 support (EXPERIMENTAL)' CONFIG_HISAX_FRITZ_PCIPNP $CONFIG_HISAX $CONFIG_EXPERIMENTAL
515 + if [ "$CONFIG_HISAX_SEDLBAUER_CS" != "n" ]; then
516 + define_bool CONFIG_HISAX_SEDLBAUER y
518 + if [ "$CONFIG_HISAX_ELSA_CS" != "n" ]; then
519 + define_bool CONFIG_HISAX_ELSA y
521 + if [ "$CONFIG_HISAX_HFC_USB_CS" != "n" ]; then
522 + define_bool CONFIG_HISAX_HFC_USB y
527 --- a/drivers/isdn/Makefile
528 +++ b/drivers/isdn/Makefile
531 # The target object and module list name.
533 -O_TARGET := vmlinux-obj.o
536 # Objects that export symbols.
538 @@ -32,9 +32,9 @@ obj-$(CONFIG_ISDN_PPP_BSDCOMP) += isdn_
540 # Object files in subdirectories
542 -mod-subdirs := avmb1 eicon hisax
543 +mod-subdirs := avmb1 eicon
544 subdir-$(CONFIG_ISDN_DIVERSION) += divert
545 -subdir-$(CONFIG_ISDN_HISAX) += hisax
546 +subdir-$(CONFIG_ISDN_DRV_HISAX) += hisax
547 subdir-$(CONFIG_ISDN_DRV_ICN) += icn
548 subdir-$(CONFIG_ISDN_DRV_PCBIT) += pcbit
549 subdir-$(CONFIG_ISDN_DRV_SC) += sc
550 --- a/drivers/isdn/act2000/act2000.h
551 +++ b/drivers/isdn/act2000/act2000.h
553 -/* $Id: act2000.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
556 * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
558 @@ -178,19 +178,19 @@ typedef struct act2000_card {
559 char regname[35]; /* Name used for request_region */
562 -static inline void act2000_schedule_tx(act2000_card *card)
563 +extern __inline__ void act2000_schedule_tx(act2000_card *card)
565 queue_task(&card->snd_tq, &tq_immediate);
566 mark_bh(IMMEDIATE_BH);
569 -static inline void act2000_schedule_rx(act2000_card *card)
570 +extern __inline__ void act2000_schedule_rx(act2000_card *card)
572 queue_task(&card->rcv_tq, &tq_immediate);
573 mark_bh(IMMEDIATE_BH);
576 -static inline void act2000_schedule_poll(act2000_card *card)
577 +extern __inline__ void act2000_schedule_poll(act2000_card *card)
579 queue_task(&card->poll_tq, &tq_immediate);
580 mark_bh(IMMEDIATE_BH);
581 --- a/drivers/isdn/act2000/act2000_isa.c
582 +++ b/drivers/isdn/act2000/act2000_isa.c
584 -/* $Id: act2000_isa.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
587 * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000 (ISA-Version).
589 @@ -178,8 +178,7 @@ act2000_isa_config_port(act2000_card * c
590 card->flags &= ~ACT2000_FLAGS_PVALID;
592 if (!check_region(portbase, ISA_REGION)) {
593 - if (request_region(portbase, ACT2000_PORTLEN, card->regname) == NULL)
595 + request_region(portbase, ACT2000_PORTLEN, card->regname);
596 card->port = portbase;
597 card->flags |= ACT2000_FLAGS_PVALID;
599 @@ -341,6 +340,9 @@ act2000_isa_send(act2000_card * card)
601 if (act2000_isa_writeb(card, *(skb->data))) {
602 /* Fifo is full, but more data to send */
604 + printk(KERN_DEBUG "act2000_isa_send: %d bytes\n", l);
606 test_and_clear_bit(ACT2000_LOCK_TX, (void *) &card->ilock);
607 /* Schedule myself */
608 act2000_schedule_tx(card);
609 @@ -363,6 +365,9 @@ act2000_isa_send(act2000_card * card)
614 + printk(KERN_DEBUG "act2000_isa_send: %d bytes\n", l);
619 --- a/drivers/isdn/act2000/act2000_isa.h
620 +++ b/drivers/isdn/act2000/act2000_isa.h
622 -/* $Id: act2000_isa.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
625 * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000 (ISA-Version).
627 --- a/drivers/isdn/act2000/capi.c
628 +++ b/drivers/isdn/act2000/capi.c
630 -/* $Id: capi.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
633 * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
634 * CAPI encoder/decoder
635 @@ -76,6 +76,10 @@ static actcapi_msgdsc valid_msg[] = {
636 {{ 0x84, 0x03}, "DISCONNECT_B3_RESP"},
637 {{ 0x86, 0x03}, "DATA_B3_RESP"},
638 {{ 0xff, 0x03}, "MANUFACTURER_RESP"},
641 + {{ 0x05, 0x80}, "LISTEN_REQ (CAPI 2.0)"},
644 {{ 0x00, 0x00}, NULL},
646 --- a/drivers/isdn/act2000/capi.h
647 +++ b/drivers/isdn/act2000/capi.h
649 -/* $Id: capi.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
652 * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
654 @@ -294,6 +294,19 @@ typedef struct actcapi_msg {
657 } select_b3_protocol_conf;
659 + struct listen_req {
664 + __u16 dummy; /* 2 Length-bytes of 2 Structs MUST always be 0!!! */
666 + struct listen_conf {
673 __u32 infomask __attribute__ ((packed));
674 @@ -304,6 +317,7 @@ typedef struct actcapi_msg {
676 __u16 info __attribute__ ((packed));
682 @@ -330,7 +344,7 @@ typedef struct actcapi_msg {
686 -static inline unsigned short
687 +extern __inline__ unsigned short
688 actcapi_nextsmsg(act2000_card *card)
691 --- a/drivers/isdn/act2000/module.c
692 +++ b/drivers/isdn/act2000/module.c
694 -/* $Id: module.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
697 * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
699 @@ -630,6 +630,10 @@ act2000_alloccard(int bus, int port, int
700 card->interface.features =
701 ISDN_FEATURE_L2_X75I |
702 ISDN_FEATURE_L2_HDLC |
704 +/* Not yet! New Firmware is on the way ... */
705 + ISDN_FEATURE_L2_TRANS |
707 ISDN_FEATURE_L3_TRANS |
708 ISDN_FEATURE_P_UNKNOWN;
709 card->interface.hl_hdrlen = 20;
710 @@ -843,6 +847,39 @@ static void __exit act2000_exit(void)
712 printk(KERN_INFO "%s unloaded\n", DRIVERNAME);
717 +act2000_setup(char *str, int *ints)
719 + int i, j, argc, port, irq, bus;
742 + act2000_addcard(bus, port, irq, act_id);
748 module_init(act2000_init);
749 module_exit(act2000_exit);
750 --- a/drivers/isdn/avmb1/avm_cs.c
751 +++ b/drivers/isdn/avmb1/avm_cs.c
753 -/* $Id: avm_cs.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
754 +/* $Id: avm_cs.c,v 1.6 2001/09/24 13:22:44 kai Exp $
756 * A PCMCIA client driver for AVM B1/M1/M2
758 --- a/drivers/isdn/avmb1/avmcard.h
759 +++ b/drivers/isdn/avmb1/avmcard.h
761 -/* $Id: avmcard.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
762 +/* $Id: avmcard.h,v 1.12 2001/09/24 13:22:44 kai Exp $
764 * Copyright 1999 by Carsten Paeth <calle@calle.de>
766 --- a/drivers/isdn/avmb1/b1.c
767 +++ b/drivers/isdn/avmb1/b1.c
769 -/* $Id: b1.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
770 +/* $Id: b1.c,v 1.26 2001/09/24 13:22:44 kai Exp $
772 * Common module for AVM B1 cards.
775 #include <linux/kernelcapi.h>
777 #include <linux/init.h>
778 +#include <linux/isdn_compat.h>
779 #include <asm/uaccess.h>
780 #include <linux/netdevice.h>
784 #include "capiutil.h"
786 -static char *revision = "$Revision: 1.1.4.1 $";
787 +static char *revision = "$Revision: 1.26 $";
789 /* ------------------------------------------------------------- */
791 --- a/drivers/isdn/avmb1/b1dma.c
792 +++ b/drivers/isdn/avmb1/b1dma.c
794 -/* $Id: b1dma.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
795 +/* $Id: b1dma.c,v 1.18 2001/09/24 13:22:44 kai Exp $
797 * Common module for AVM B1 cards that support dma with AMCC
800 #include <linux/kernelcapi.h>
802 #include <linux/init.h>
803 +#include <linux/isdn_compat.h>
804 #include <asm/uaccess.h>
805 #include <linux/netdevice.h>
809 #include "capiutil.h"
811 -static char *revision = "$Revision: 1.1.4.1 $";
812 +#if BITS_PER_LONG != 32
813 +#error FIXME: driver requires 32-bit platform
816 +static char *revision = "$Revision: 1.18 $";
818 /* ------------------------------------------------------------- */
820 @@ -851,7 +856,7 @@ int b1dmactl_read_proc(char *page, char
824 - u_long txaddr, txlen, rxaddr, rxlen, csr;
825 + __u32 txaddr, txlen, rxaddr, rxlen, csr;
827 len += sprintf(page+len, "%-16s %s\n", "name", card->name);
828 len += sprintf(page+len, "%-16s 0x%x\n", "io", card->port);
829 @@ -907,12 +912,12 @@ int b1dmactl_read_proc(char *page, char
833 - txaddr = (u_long)phys_to_virt(b1dmainmeml(card->mbase+0x2c));
834 - txaddr -= (u_long)card->dma->sendbuf;
835 + txaddr = (__u32)phys_to_virt(b1dmainmeml(card->mbase+0x2c));
836 + txaddr -= (__u32)card->dma->sendbuf;
837 txlen = b1dmainmeml(card->mbase+0x30);
839 - rxaddr = (u_long)phys_to_virt(b1dmainmeml(card->mbase+0x24));
840 - rxaddr -= (u_long)card->dma->recvbuf;
841 + rxaddr = (__u32)phys_to_virt(b1dmainmeml(card->mbase+0x24));
842 + rxaddr -= (__u32)card->dma->recvbuf;
843 rxlen = b1dmainmeml(card->mbase+0x28);
845 csr = b1dmainmeml(card->mbase+AMCC_INTCSR);
846 --- a/drivers/isdn/avmb1/b1isa.c
847 +++ b/drivers/isdn/avmb1/b1isa.c
849 -/* $Id: b1isa.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
850 +/* $Id: b1isa.c,v 1.14 2001/09/24 13:22:44 kai Exp $
852 * Module for AVM B1 ISA-card.
855 #include <linux/capi.h>
856 #include <linux/init.h>
858 +#include <linux/isdn_compat.h>
860 #include "capiutil.h"
864 -static char *revision = "$Revision: 1.1.4.1 $";
865 +static char *revision = "$Revision: 1.14 $";
867 /* ------------------------------------------------------------- */
869 --- a/drivers/isdn/avmb1/b1pci.c
870 +++ b/drivers/isdn/avmb1/b1pci.c
872 -/* $Id: b1pci.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
873 +/* $Id: b1pci.c,v 1.40 2001/09/24 13:22:44 kai Exp $
875 * Module for AVM B1 PCI-card.
878 #include <linux/capi.h>
880 #include <linux/init.h>
881 +#include <linux/isdn_compat.h>
883 #include "capiutil.h"
887 -static char *revision = "$Revision: 1.1.4.1 $";
888 +static char *revision = "$Revision: 1.40 $";
890 /* ------------------------------------------------------------- */
892 +#ifndef COMPAT_HAS_2_2_PCI
893 static struct pci_device_id b1pci_pci_tbl[] __initdata = {
894 { PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_B1, PCI_ANY_ID, PCI_ANY_ID },
895 { } /* Terminating entry */
898 MODULE_DEVICE_TABLE(pci, b1pci_pci_tbl);
900 MODULE_DESCRIPTION("CAPI4Linux: Driver for AVM B1 PCI card");
901 MODULE_AUTHOR("Carsten Paeth");
902 MODULE_LICENSE("GPL");
903 @@ -416,14 +419,14 @@ static int add_card(struct pci_dev *dev)
905 param.irq = dev->irq;
907 - if (pci_resource_start(dev, 2)) { /* B1 PCI V4 */
908 + if (pci_resource_start_io(dev, 2)) { /* B1 PCI V4 */
909 #ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4
910 driver = &b1pciv4_driver;
914 - param.membase = pci_resource_start(dev, 0);
915 - param.port = pci_resource_start(dev, 2);
916 + param.membase = pci_resource_start_mem(dev, 0);
917 + param.port = pci_resource_start_io(dev, 2);
920 "%s: PCI BIOS reports AVM-B1 V4 at i/o %#x, irq %d, mem %#x\n",
921 @@ -440,7 +443,7 @@ static int add_card(struct pci_dev *dev)
925 - param.port = pci_resource_start(dev, 1);
926 + param.port = pci_resource_start_io(dev, 1);
929 "%s: PCI BIOS reports AVM-B1 at i/o %#x, irq %d\n",
930 --- a/drivers/isdn/avmb1/b1pcmcia.c
931 +++ b/drivers/isdn/avmb1/b1pcmcia.c
933 -/* $Id: b1pcmcia.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
934 +/* $Id: b1pcmcia.c,v 1.17 2001/09/24 13:22:44 kai Exp $
936 * Module for AVM B1/M1/M2 PCMCIA-card.
942 -static char *revision = "$Revision: 1.1.4.1 $";
943 +static char *revision = "$Revision: 1.17 $";
945 /* ------------------------------------------------------------- */
947 --- a/drivers/isdn/avmb1/c4.c
948 +++ b/drivers/isdn/avmb1/c4.c
950 -/* $Id: c4.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
951 +/* $Id: c4.c,v 1.38 2001/09/24 13:22:44 kai Exp $
953 * Module for AVM C4 & C2 card.
956 #include <linux/interrupt.h>
957 #include <linux/ioport.h>
958 #include <linux/pci.h>
959 +#include <linux/isdn_compat.h>
960 #include <linux/capi.h>
961 #include <linux/kernelcapi.h>
962 #include <linux/init.h>
967 -static char *revision = "$Revision: 1.1.4.1 $";
968 +static char *revision = "$Revision: 1.38 $";
970 #undef CONFIG_C4_DEBUG
971 #undef CONFIG_C4_POLLDEBUG
972 @@ -39,6 +40,7 @@ static char *revision = "$Revision: 1.1.
974 static int suppress_pollack;
976 +#ifndef COMPAT_HAS_2_2_PCI
977 static struct pci_device_id c4_pci_tbl[] __initdata = {
978 { PCI_VENDOR_ID_DEC,PCI_DEVICE_ID_DEC_21285, PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_C4 },
979 { PCI_VENDOR_ID_DEC,PCI_DEVICE_ID_DEC_21285, PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_C2 },
980 @@ -46,6 +48,7 @@ static struct pci_device_id c4_pci_tbl[]
983 MODULE_DEVICE_TABLE(pci, c4_pci_tbl);
985 MODULE_DESCRIPTION("CAPI4Linux: Driver for AVM C2/C4 cards");
986 MODULE_AUTHOR("Carsten Paeth");
987 MODULE_LICENSE("GPL");
988 @@ -1332,9 +1335,9 @@ static int __init search_cards(struct ca
992 - param.port = pci_resource_start(dev, 1);
993 + param.port = pci_resource_start_io(dev, 1);
994 param.irq = dev->irq;
995 - param.membase = pci_resource_start(dev, 0);
996 + param.membase = pci_resource_start_mem(dev, 0);
999 "%s: PCI BIOS reports AVM-C%d at i/o %#x, irq %d, mem %#x\n",
1000 --- a/drivers/isdn/avmb1/capi.c
1001 +++ b/drivers/isdn/avmb1/capi.c
1003 -/* $Id: capi.c,v 1.1.4.2 2001/12/09 18:45:13 kai Exp $
1004 +/* $Id: capi.c,v 1.59 2001/11/07 22:35:48 kai Exp $
1006 * CAPI 2.0 Interface for Linux
1009 #include <linux/smp_lock.h>
1010 #include <linux/timer.h>
1011 #include <linux/wait.h>
1012 +#include <linux/isdn_compat.h>
1013 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1014 #include <linux/tty.h>
1017 #include <linux/ppp_defs.h>
1018 #include <linux/if_ppp.h>
1019 #undef CAPI_PPP_ON_RAW_DEVICE
1020 +#ifdef CAPI_PPP_ON_RAW_DEVICE
1021 +#include <linux/ppp_channel.h>
1022 +#endif /* CAPI_PPP_ON_RAW_DEVICE */
1023 #endif /* CONFIG_PPP */
1024 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1025 #include <linux/skbuff.h>
1027 #include <linux/capi.h>
1028 #include <linux/kernelcapi.h>
1029 #include <linux/init.h>
1030 +#ifdef HAVE_DEVFS_FS
1031 #include <linux/devfs_fs_kernel.h>
1032 +#endif /* HAVE_DEVFS_FS */
1033 #include "capiutil.h"
1034 #include "capicmd.h"
1035 #if defined(CONFIG_ISDN_CAPI_CAPIFS) || defined(CONFIG_ISDN_CAPI_CAPIFS_MODULE)
1039 -static char *revision = "$Revision: 1.1.4.2 $";
1040 +static char *revision = "$Revision: 1.59 $";
1042 MODULE_DESCRIPTION("CAPI4Linux: Userspace /dev/capi20 interface");
1043 MODULE_AUTHOR("Carsten Paeth");
1044 @@ -87,10 +93,10 @@ struct capiminor {
1045 struct capincci *nccip;
1058 struct tty_struct *tty;
1059 @@ -112,16 +118,22 @@ struct capiminor {
1061 struct datahandle_queue {
1062 struct datahandle_queue *next;
1068 +#ifdef CAPI_PPP_ON_RAW_DEVICE
1069 + /* interface to generic ppp layer */
1070 + struct ppp_channel chan;
1071 + int chan_connected;
1075 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1078 struct capincci *next;
1081 struct capidev *cdev;
1082 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1083 struct capiminor *minorp;
1084 @@ -131,8 +143,8 @@ struct capincci {
1086 struct capidev *next;
1095 @@ -156,22 +168,28 @@ static struct capidev *capidev_openlist
1096 static struct capiminor *minors = 0;
1097 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1099 +#ifdef COMPAT_HAS_kmem_cache
1100 static kmem_cache_t *capidev_cachep = 0;
1101 static kmem_cache_t *capincci_cachep = 0;
1102 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1103 static kmem_cache_t *capiminor_cachep = 0;
1104 static kmem_cache_t *capidh_cachep = 0;
1105 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1108 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1109 /* -------- datahandles --------------------------------------------- */
1111 -static int capincci_add_ack(struct capiminor *mp, u16 datahandle)
1112 +int capincci_add_ack(struct capiminor *mp, __u16 datahandle)
1114 struct datahandle_queue *n, **pp;
1116 n = (struct datahandle_queue *)
1117 +#ifdef COMPAT_HAS_kmem_cache
1118 kmem_cache_alloc(capidh_cachep, GFP_ATOMIC);
1120 + kmalloc(sizeof(struct datahandle_queue), GFP_ATOMIC);
1123 printk(KERN_ERR "capi: alloc datahandle failed\n");
1125 @@ -184,7 +202,7 @@ static int capincci_add_ack(struct capim
1129 -static int capiminor_del_ack(struct capiminor *mp, u16 datahandle)
1130 +int capiminor_del_ack(struct capiminor *mp, __u16 datahandle)
1132 struct datahandle_queue **pp, *p;
1134 @@ -192,7 +210,11 @@ static int capiminor_del_ack(struct capi
1135 if ((*pp)->datahandle == datahandle) {
1138 +#ifdef COMPAT_HAS_kmem_cache
1139 kmem_cache_free(capidh_cachep, p);
1146 @@ -200,7 +222,7 @@ static int capiminor_del_ack(struct capi
1150 -static void capiminor_del_all_ack(struct capiminor *mp)
1151 +void capiminor_del_all_ack(struct capiminor *mp)
1153 struct datahandle_queue **pp, *p;
1155 @@ -208,7 +230,11 @@ static void capiminor_del_all_ack(struct
1159 +#ifdef COMPAT_HAS_kmem_cache
1160 kmem_cache_free(capidh_cachep, p);
1167 @@ -216,13 +242,17 @@ static void capiminor_del_all_ack(struct
1169 /* -------- struct capiminor ---------------------------------------- */
1171 -static struct capiminor *capiminor_alloc(u16 applid, u32 ncci)
1172 +struct capiminor *capiminor_alloc(__u16 applid, __u32 ncci)
1174 struct capiminor *mp, **pp;
1175 unsigned int minor = 0;
1178 +#ifdef COMPAT_HAS_kmem_cache
1179 mp = (struct capiminor *)kmem_cache_alloc(capiminor_cachep, GFP_ATOMIC);
1181 + mp = (struct capiminor *)kmalloc(sizeof(struct capiminor), GFP_ATOMIC);
1185 printk(KERN_ERR "capi: can't alloc capiminor\n");
1186 @@ -257,7 +287,7 @@ static struct capiminor *capiminor_alloc
1190 -static void capiminor_free(struct capiminor *mp)
1191 +void capiminor_free(struct capiminor *mp)
1193 struct capiminor **pp;
1195 @@ -271,7 +301,11 @@ static void capiminor_free(struct capimi
1196 skb_queue_purge(&mp->inqueue);
1197 skb_queue_purge(&mp->outqueue);
1198 capiminor_del_all_ack(mp);
1199 +#ifdef COMPAT_HAS_kmem_cache
1200 kmem_cache_free(capiminor_cachep, mp);
1205 #ifdef _DEBUG_REFCOUNT
1206 printk(KERN_DEBUG "capiminor_free %d\n", GET_USE_COUNT(THIS_MODULE));
1207 @@ -283,7 +317,7 @@ static void capiminor_free(struct capimi
1211 -static struct capiminor *capiminor_find(unsigned int minor)
1212 +struct capiminor *capiminor_find(unsigned int minor)
1214 struct capiminor *p;
1215 for (p = minors; p && p->minor != minor; p = p->next)
1216 @@ -294,7 +328,7 @@ static struct capiminor *capiminor_find(
1218 /* -------- struct capincci ----------------------------------------- */
1220 -static struct capincci *capincci_alloc(struct capidev *cdev, u32 ncci)
1221 +static struct capincci *capincci_alloc(struct capidev *cdev, __u32 ncci)
1223 struct capincci *np, **pp;
1224 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1225 @@ -302,7 +336,11 @@ static struct capincci *capincci_alloc(s
1227 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1229 +#ifdef COMPAT_HAS_kmem_cache
1230 np = (struct capincci *)kmem_cache_alloc(capincci_cachep, GFP_ATOMIC);
1232 + np = (struct capincci *)kmalloc(sizeof(struct capincci), GFP_ATOMIC);
1236 memset(np, 0, sizeof(struct capincci));
1237 @@ -331,7 +369,7 @@ static struct capincci *capincci_alloc(s
1241 -static void capincci_free(struct capidev *cdev, u32 ncci)
1242 +static void capincci_free(struct capidev *cdev, __u32 ncci)
1244 struct capincci *np, **pp;
1245 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1246 @@ -367,7 +405,11 @@ static void capincci_free(struct capidev
1249 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1250 +#ifdef COMPAT_HAS_kmem_cache
1251 kmem_cache_free(capincci_cachep, np);
1255 if (*pp == 0) return;
1258 @@ -375,7 +417,7 @@ static void capincci_free(struct capidev
1262 -static struct capincci *capincci_find(struct capidev *cdev, u32 ncci)
1263 +struct capincci *capincci_find(struct capidev *cdev, __u32 ncci)
1267 @@ -393,7 +435,11 @@ static struct capidev *capidev_alloc(str
1268 struct capidev *cdev;
1269 struct capidev **pp;
1271 +#ifdef COMPAT_HAS_kmem_cache
1272 cdev = (struct capidev *)kmem_cache_alloc(capidev_cachep, GFP_KERNEL);
1274 + cdev = (struct capidev *)kmalloc(sizeof(struct capidev), GFP_KERNEL);
1278 memset(cdev, 0, sizeof(struct capidev));
1279 @@ -423,10 +469,14 @@ static void capidev_free(struct capidev
1283 +#ifdef COMPAT_HAS_kmem_cache
1284 kmem_cache_free(capidev_cachep, cdev);
1290 -static struct capidev *capidev_find(u16 applid)
1291 +static struct capidev *capidev_find(__u16 applid)
1294 for (p=capidev_openlist; p; p = p->next) {
1295 @@ -439,13 +489,13 @@ static struct capidev *capidev_find(u16
1296 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1297 /* -------- handle data queue --------------------------------------- */
1299 -static struct sk_buff *
1301 gen_data_b3_resp_for(struct capiminor *mp, struct sk_buff *skb)
1303 struct sk_buff *nskb;
1304 nskb = alloc_skb(CAPI_DATA_B3_RESP_LEN, GFP_ATOMIC);
1306 - u16 datahandle = CAPIMSG_U16(skb->data,CAPIMSG_BASELEN+4+4+2);
1307 + __u16 datahandle = CAPIMSG_U16(skb->data,CAPIMSG_BASELEN+4+4+2);
1308 unsigned char *s = skb_put(nskb, CAPI_DATA_B3_RESP_LEN);
1309 capimsg_setu16(s, 0, CAPI_DATA_B3_RESP_LEN);
1310 capimsg_setu16(s, 2, mp->applid);
1311 @@ -458,11 +508,11 @@ gen_data_b3_resp_for(struct capiminor *m
1315 -static int handle_recv_skb(struct capiminor *mp, struct sk_buff *skb)
1316 +int handle_recv_skb(struct capiminor *mp, struct sk_buff *skb)
1318 struct sk_buff *nskb;
1319 unsigned int datalen;
1320 - u16 errcode, datahandle;
1321 + __u16 errcode, datahandle;
1323 datalen = skb->len - CAPIMSG_LEN(skb->data);
1325 @@ -504,6 +554,28 @@ static int handle_recv_skb(struct capimi
1329 +#ifdef CAPI_PPP_ON_RAW_DEVICE
1330 + } else if (mp->chan_connected) {
1331 + if ((nskb = gen_data_b3_resp_for(mp, skb)) == 0) {
1332 + printk(KERN_ERR "capi: gen_data_b3_resp failed\n");
1335 + datahandle = CAPIMSG_U16(skb->data,CAPIMSG_BASELEN+4);
1336 + errcode = (*capifuncs->capi_put_message)(mp->applid, nskb);
1337 + if (errcode != CAPI_NOERROR) {
1338 + printk(KERN_ERR "capi: send DATA_B3_RESP failed=%x\n",
1343 + (void)skb_pull(skb, CAPIMSG_LEN(skb->data));
1344 +#ifdef _DEBUG_DATAFLOW
1345 + printk(KERN_DEBUG "capi: DATA_B3_RESP %u len=%d => ppp\n",
1346 + datahandle, skb->len);
1348 + ppp_input(&mp->chan, skb);
1351 } else if (mp->file) {
1352 if (skb_queue_len(&mp->recvqueue) > CAPINC_MAX_RECVQUEUE) {
1353 #if defined(_DEBUG_DATAFLOW) || defined(_DEBUG_TTYFUNCS)
1354 @@ -538,7 +610,7 @@ static int handle_recv_skb(struct capimi
1358 -static void handle_minor_recv(struct capiminor *mp)
1359 +void handle_minor_recv(struct capiminor *mp)
1361 struct sk_buff *skb;
1362 while ((skb = skb_dequeue(&mp->inqueue)) != 0) {
1363 @@ -552,13 +624,13 @@ static void handle_minor_recv(struct cap
1367 -static int handle_minor_send(struct capiminor *mp)
1368 +int handle_minor_send(struct capiminor *mp)
1370 struct sk_buff *skb;
1379 if (mp->tty && mp->ttyoutstop) {
1380 #if defined(_DEBUG_DATAFLOW) || defined(_DEBUG_TTYFUNCS)
1381 @@ -569,7 +641,7 @@ static int handle_minor_send(struct capi
1383 while ((skb = skb_dequeue(&mp->outqueue)) != 0) {
1384 datahandle = mp->datahandle;
1385 - len = (u16)skb->len;
1386 + len = (__u16)skb->len;
1387 skb_push(skb, CAPI_DATA_B3_REQ_LEN);
1388 memset(skb->data, 0, CAPI_DATA_B3_REQ_LEN);
1389 capimsg_setu16(skb->data, 0, CAPI_DATA_B3_REQ_LEN);
1390 @@ -578,7 +650,7 @@ static int handle_minor_send(struct capi
1391 capimsg_setu8 (skb->data, 5, CAPI_REQ);
1392 capimsg_setu16(skb->data, 6, mp->msgid++);
1393 capimsg_setu32(skb->data, 8, mp->ncci); /* NCCI */
1394 - capimsg_setu32(skb->data, 12, (u32) skb->data); /* Data32 */
1395 + capimsg_setu32(skb->data, 12, (__u32) skb->data); /* Data32 */
1396 capimsg_setu16(skb->data, 16, len); /* Data length */
1397 capimsg_setu16(skb->data, 18, datahandle);
1398 capimsg_setu16(skb->data, 20, 0); /* Flags */
1399 @@ -620,16 +692,16 @@ static int handle_minor_send(struct capi
1400 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1401 /* -------- function called by lower level -------------------------- */
1403 -static void capi_signal(u16 applid, void *param)
1404 +static void capi_signal(__u16 applid, void *param)
1406 struct capidev *cdev = (struct capidev *)param;
1407 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1408 struct capiminor *mp;
1411 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1412 struct capincci *np;
1413 struct sk_buff *skb = 0;
1417 (void) (*capifuncs->capi_get_message) (applid, &skb);
1419 @@ -683,6 +755,12 @@ static void capi_signal(u16 applid, void
1422 (void)capiminor_del_ack(mp, datahandle);
1423 +#ifdef CAPI_PPP_ON_RAW_DEVICE
1424 + if (mp->chan_connected) {
1425 + ppp_output_wakeup(&mp->chan);
1430 if (mp->tty->ldisc.write_wakeup)
1431 mp->tty->ldisc.write_wakeup(mp->tty);
1432 @@ -758,7 +836,7 @@ capi_write(struct file *file, const char
1433 struct capidev *cdev = (struct capidev *)file->private_data;
1434 struct sk_buff *skb;
1439 if (ppos != &file->f_pos)
1441 @@ -998,7 +1076,7 @@ capi_ioctl(struct inode *inode, struct f
1445 - nccip = capincci_find(cdev, (u32) ncci);
1446 + nccip = capincci_find(cdev, (__u32) ncci);
1449 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1450 @@ -1023,7 +1101,7 @@ capi_ioctl(struct inode *inode, struct f
1454 - nccip = capincci_find(cdev, (u32) ncci);
1455 + nccip = capincci_find(cdev, (__u32) ncci);
1456 if (!nccip || (mp = nccip->minorp) == 0)
1459 @@ -1070,7 +1148,9 @@ capi_release(struct inode *inode, struct
1461 static struct file_operations capi_fops =
1463 +#ifdef COMPAT_HAS_FILEOP_OWNER
1469 @@ -1233,6 +1313,45 @@ capinc_raw_ioctl(struct inode *inode, st
1473 +#ifdef CAPI_PPP_ON_RAW_DEVICE
1474 + case PPPIOCATTACH:
1477 + if (get_user(val, (int *) arg))
1479 + if (mp->chan_connected)
1481 + mp->chan.private = mp;
1485 + mp->chan.ops = &ppp_ops;
1488 + retval = ppp_register_channel(&mp->chan, val);
1491 + mp->chan_connected = 1;
1492 + mp->chan_index = val;
1495 + case PPPIOCDETACH:
1497 + if (!mp->chan_connected)
1499 + ppp_unregister_channel(&mp->chan);
1500 + mp->chan_connected = 0;
1505 + if (!mp->chan_connected)
1507 + if (put_user(mp->chan_index, (int *) arg))
1515 @@ -1260,7 +1379,9 @@ capinc_raw_release(struct inode *inode,
1517 static struct file_operations capinc_raw_fops =
1519 +#ifdef COMPAT_HAS_FILEOP_OWNER
1523 read: capinc_raw_read,
1524 write: capinc_raw_write,
1525 @@ -1272,7 +1393,7 @@ static struct file_operations capinc_raw
1527 /* -------- tty_operations for capincci ----------------------------- */
1529 -static int capinc_tty_open(struct tty_struct * tty, struct file * file)
1530 +int capinc_tty_open(struct tty_struct * tty, struct file * file)
1532 struct capiminor *mp;
1534 @@ -1300,7 +1421,7 @@ static int capinc_tty_open(struct tty_st
1538 -static void capinc_tty_close(struct tty_struct * tty, struct file * file)
1539 +void capinc_tty_close(struct tty_struct * tty, struct file * file)
1541 struct capiminor *mp;
1543 @@ -1325,8 +1446,8 @@ static void capinc_tty_close(struct tty_
1547 -static int capinc_tty_write(struct tty_struct * tty, int from_user,
1548 - const unsigned char *buf, int count)
1549 +int capinc_tty_write(struct tty_struct * tty, int from_user,
1550 + const unsigned char *buf, int count)
1552 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1553 struct sk_buff *skb;
1554 @@ -1377,7 +1498,7 @@ static int capinc_tty_write(struct tty_s
1558 -static void capinc_tty_put_char(struct tty_struct *tty, unsigned char ch)
1559 +void capinc_tty_put_char(struct tty_struct *tty, unsigned char ch)
1561 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1562 struct sk_buff *skb;
1563 @@ -1414,7 +1535,7 @@ static void capinc_tty_put_char(struct t
1567 -static void capinc_tty_flush_chars(struct tty_struct *tty)
1568 +void capinc_tty_flush_chars(struct tty_struct *tty)
1570 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1571 struct sk_buff *skb;
1572 @@ -1440,7 +1561,7 @@ static void capinc_tty_flush_chars(struc
1573 (void)handle_minor_recv(mp);
1576 -static int capinc_tty_write_room(struct tty_struct *tty)
1577 +int capinc_tty_write_room(struct tty_struct *tty)
1579 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1581 @@ -1458,7 +1579,7 @@ static int capinc_tty_write_room(struct
1585 -static int capinc_tty_chars_in_buffer(struct tty_struct *tty)
1586 +int capinc_tty_chars_in_buffer(struct tty_struct *tty)
1588 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1589 if (!mp || !mp->nccip) {
1590 @@ -1476,7 +1597,7 @@ static int capinc_tty_chars_in_buffer(st
1591 return mp->outbytes;
1594 -static int capinc_tty_ioctl(struct tty_struct *tty, struct file * file,
1595 +int capinc_tty_ioctl(struct tty_struct *tty, struct file * file,
1596 unsigned int cmd, unsigned long arg)
1599 @@ -1488,14 +1609,14 @@ static int capinc_tty_ioctl(struct tty_s
1603 -static void capinc_tty_set_termios(struct tty_struct *tty, struct termios * old)
1604 +void capinc_tty_set_termios(struct tty_struct *tty, struct termios * old)
1606 #ifdef _DEBUG_TTYFUNCS
1607 printk(KERN_DEBUG "capinc_tty_set_termios\n");
1611 -static void capinc_tty_throttle(struct tty_struct * tty)
1612 +void capinc_tty_throttle(struct tty_struct * tty)
1614 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1615 #ifdef _DEBUG_TTYFUNCS
1616 @@ -1505,7 +1626,7 @@ static void capinc_tty_throttle(struct t
1620 -static void capinc_tty_unthrottle(struct tty_struct * tty)
1621 +void capinc_tty_unthrottle(struct tty_struct * tty)
1623 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1624 #ifdef _DEBUG_TTYFUNCS
1625 @@ -1517,7 +1638,7 @@ static void capinc_tty_unthrottle(struct
1629 -static void capinc_tty_stop(struct tty_struct *tty)
1630 +void capinc_tty_stop(struct tty_struct *tty)
1632 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1633 #ifdef _DEBUG_TTYFUNCS
1634 @@ -1528,7 +1649,7 @@ static void capinc_tty_stop(struct tty_s
1638 -static void capinc_tty_start(struct tty_struct *tty)
1639 +void capinc_tty_start(struct tty_struct *tty)
1641 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1642 #ifdef _DEBUG_TTYFUNCS
1643 @@ -1540,43 +1661,49 @@ static void capinc_tty_start(struct tty_
1647 -static void capinc_tty_hangup(struct tty_struct *tty)
1648 +void capinc_tty_hangup(struct tty_struct *tty)
1650 #ifdef _DEBUG_TTYFUNCS
1651 printk(KERN_DEBUG "capinc_tty_hangup\n");
1655 -static void capinc_tty_break_ctl(struct tty_struct *tty, int state)
1656 +void capinc_tty_break_ctl(struct tty_struct *tty, int state)
1658 #ifdef _DEBUG_TTYFUNCS
1659 printk(KERN_DEBUG "capinc_tty_break_ctl(%d)\n", state);
1663 -static void capinc_tty_flush_buffer(struct tty_struct *tty)
1664 +void capinc_tty_flush_buffer(struct tty_struct *tty)
1666 #ifdef _DEBUG_TTYFUNCS
1667 printk(KERN_DEBUG "capinc_tty_flush_buffer\n");
1671 -static void capinc_tty_set_ldisc(struct tty_struct *tty)
1672 +void capinc_tty_set_ldisc(struct tty_struct *tty)
1674 #ifdef _DEBUG_TTYFUNCS
1675 printk(KERN_DEBUG "capinc_tty_set_ldisc\n");
1679 -static void capinc_tty_send_xchar(struct tty_struct *tty, char ch)
1680 +void capinc_tty_send_xchar(struct tty_struct *tty, char ch)
1682 #ifdef _DEBUG_TTYFUNCS
1683 printk(KERN_DEBUG "capinc_tty_send_xchar(%d)\n", ch);
1687 -static int capinc_tty_read_proc(char *page, char **start, off_t off,
1688 - int count, int *eof, void *data)
1689 +int capinc_tty_read_proc(char *page, char **start, off_t off,
1690 + int count, int *eof, void *data)
1695 +int capinc_write_proc(struct file *file, const char *buffer,
1696 + unsigned long count, void *data)
1700 @@ -1588,7 +1715,7 @@ static struct tty_struct *capinc_tty_tab
1701 static struct termios *capinc_tty_termios[CAPINC_NR_PORTS];
1702 static struct termios *capinc_tty_termios_locked[CAPINC_NR_PORTS];
1704 -static int capinc_tty_init(void)
1705 +int capinc_tty_init(void)
1707 struct tty_driver *drv = &capinc_tty_driver;
1709 @@ -1646,7 +1773,7 @@ static int capinc_tty_init(void)
1713 -static void capinc_tty_exit(void)
1714 +void capinc_tty_exit(void)
1716 struct tty_driver *drv = &capinc_tty_driver;
1718 @@ -1771,8 +1898,9 @@ static void __exit proc_exit(void)
1720 /* -------- init function and module interface ---------------------- */
1722 +#ifdef COMPAT_HAS_kmem_cache
1724 -static void alloc_exit(void)
1725 +static void __exit alloc_exit(void)
1727 if (capidev_cachep) {
1728 (void)kmem_cache_destroy(capidev_cachep);
1729 @@ -1837,8 +1965,9 @@ static int __init alloc_init(void)
1730 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1735 -static void lower_callback(unsigned int cmd, u32 contr, void *data)
1736 +static void lower_callback(unsigned int cmd, __u32 contr, void *data)
1738 struct capi_ncciinfo *np;
1739 struct capidev *cdev;
1740 @@ -1900,15 +2029,19 @@ static int __init capi_init(void)
1744 +#ifdef HAVE_DEVFS_FS
1745 devfs_register_series (NULL, "capi/r%u", CAPINC_NR_PORTS,
1748 S_IFCHR | S_IRUSR | S_IWUSR,
1749 &capinc_raw_fops, NULL);
1751 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1752 +#ifdef HAVE_DEVFS_FS
1753 devfs_register (NULL, "isdn/capi20", DEVFS_FL_DEFAULT,
1754 capi_major, 0, S_IFCHR | S_IRUSR | S_IWUSR,
1757 printk(KERN_NOTICE "capi20: started up with major %d\n", capi_major);
1759 if ((capifuncs = attach_capi_interface(&cuser)) == 0) {
1760 @@ -1918,9 +2051,11 @@ static int __init capi_init(void)
1761 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1762 devfs_unregister_chrdev(capi_rawmajor, "capi/r%d");
1763 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1764 +#ifdef HAVE_DEVFS_FS
1765 devfs_unregister(devfs_find_handle(NULL, "capi20",
1767 DEVFS_SPECIAL_CHR, 0));
1772 @@ -1934,8 +2069,10 @@ static int __init capi_init(void)
1774 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1776 +#ifdef COMPAT_HAS_kmem_cache
1777 if (alloc_init() < 0) {
1778 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1779 +#ifdef HAVE_DEVFS_FS
1781 devfs_unregister_chrdev(capi_rawmajor, "capi/r%d");
1782 for (j = 0; j < CAPINC_NR_PORTS; j++) {
1783 @@ -1943,16 +2080,20 @@ static int __init capi_init(void)
1784 sprintf(devname, "capi/r%u", j);
1785 devfs_unregister(devfs_find_handle(NULL, devname, capi_rawmajor, j, DEVFS_SPECIAL_CHR, 0));
1789 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1790 (void) detach_capi_interface(&cuser);
1791 devfs_unregister_chrdev(capi_major, "capi20");
1792 +#ifdef HAVE_DEVFS_FS
1793 devfs_unregister(devfs_find_handle(NULL, "capi20",
1795 DEVFS_SPECIAL_CHR, 0));
1800 +#endif /* COMPAT_HAS_kmem_cache */
1804 @@ -1975,23 +2116,31 @@ static int __init capi_init(void)
1805 static void __exit capi_exit(void)
1807 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1808 +#ifdef HAVE_DEVFS_FS
1812 +#ifdef COMPAT_HAS_kmem_cache
1817 devfs_unregister_chrdev(capi_major, "capi20");
1818 +#ifdef HAVE_DEVFS_FS
1819 devfs_unregister(devfs_find_handle(NULL, "isdn/capi20", capi_major, 0, DEVFS_SPECIAL_CHR, 0));
1822 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1824 devfs_unregister_chrdev(capi_rawmajor, "capi/r%d");
1825 +#ifdef HAVE_DEVFS_FS
1826 for (j = 0; j < CAPINC_NR_PORTS; j++) {
1828 sprintf(devname, "capi/r%u", j);
1829 devfs_unregister(devfs_find_handle(NULL, devname, capi_rawmajor, j, DEVFS_SPECIAL_CHR, 0));
1833 (void) detach_capi_interface(&cuser);
1834 printk(KERN_NOTICE "capi: Rev %s: unloaded\n", rev);
1836 --- a/drivers/isdn/avmb1/capicmd.h
1837 +++ b/drivers/isdn/avmb1/capicmd.h
1839 -/* $Id: capicmd.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
1840 +/* $Id: capicmd.h,v 1.4 2001/09/24 13:22:44 kai Exp $
1842 * CAPI 2.0 Interface for Linux
1844 --- a/drivers/isdn/avmb1/capidev.h
1845 +++ b/drivers/isdn/avmb1/capidev.h
1847 -/* $Id: capidev.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
1848 +/* $Id: capidev.h,v 1.8 2001/09/24 13:22:44 kai Exp $
1850 * CAPI 2.0 Interface for Linux
1852 --- a/drivers/isdn/avmb1/capidrv.c
1853 +++ b/drivers/isdn/avmb1/capidrv.c
1855 -/* $Id: capidrv.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
1856 +/* $Id: capidrv.c,v 1.45 2001/09/24 13:22:44 kai Exp $
1858 * ISDN4Linux Driver, using capi20 interface (kernelcapi)
1861 #include "capicmd.h"
1862 #include "capidrv.h"
1864 -static char *revision = "$Revision: 1.1.4.1 $";
1865 +static char *revision = "$Revision: 1.45 $";
1866 static int debugmode = 0;
1868 MODULE_DESCRIPTION("CAPI4Linux: Interface to ISDN4Linux");
1869 @@ -105,7 +105,6 @@ struct capidrv_contr {
1874 struct ncci_datahandle_queue {
1875 struct ncci_datahandle_queue *next;
1877 @@ -423,7 +422,6 @@ static inline capidrv_ncci *new_ncci(cap
1878 nccip->plcip = plcip;
1879 nccip->chan = plcip->chan;
1880 nccip->datahandle = 0;
1881 - nccip->lock = SPIN_LOCK_UNLOCKED;
1883 nccip->next = plcip->ncci_list;
1884 plcip->ncci_list = nccip;
1885 @@ -480,7 +478,6 @@ static int capidrv_add_ack(struct capidr
1886 __u16 datahandle, int len)
1888 struct ncci_datahandle_queue *n, **pp;
1889 - unsigned long flags;
1891 n = (struct ncci_datahandle_queue *)
1892 kmalloc(sizeof(struct ncci_datahandle_queue), GFP_ATOMIC);
1893 @@ -491,31 +488,25 @@ static int capidrv_add_ack(struct capidr
1895 n->datahandle = datahandle;
1897 - spin_lock_irqsave(&nccip->lock, flags);
1898 for (pp = &nccip->ackqueue; *pp; pp = &(*pp)->next) ;
1900 - spin_unlock_irqrestore(&nccip->lock, flags);
1904 static int capidrv_del_ack(struct capidrv_ncci *nccip, __u16 datahandle)
1906 struct ncci_datahandle_queue **pp, *p;
1907 - unsigned long flags;
1910 - spin_lock_irqsave(&nccip->lock, flags);
1911 for (pp = &nccip->ackqueue; *pp; pp = &(*pp)->next) {
1912 if ((*pp)->datahandle == datahandle) {
1916 - spin_unlock_irqrestore(&nccip->lock, flags);
1921 - spin_unlock_irqrestore(&nccip->lock, flags);
1925 @@ -523,25 +514,13 @@ static int capidrv_del_ack(struct capidr
1927 static void send_message(capidrv_contr * card, _cmsg * cmsg)
1929 - struct sk_buff *skb;
1933 + struct sk_buff *skb;
1935 capi_cmsg2message(cmsg, cmsg->buf);
1936 len = CAPIMSG_LEN(cmsg->buf);
1937 skb = alloc_skb(len, GFP_ATOMIC);
1939 - printk(KERN_ERR "no skb len(%d) memory\n", len);
1942 memcpy(skb_put(skb, len), cmsg->buf, len);
1943 - err = (*capifuncs->capi_put_message) (global.appid, skb);
1945 - printk(KERN_WARNING "%s: capi_put_message error: %04x\n",
1946 - __FUNCTION__, err);
1950 + (*capifuncs->capi_put_message) (global.appid, skb);
1951 global.nsentctlpkt++;
1954 @@ -1932,8 +1911,10 @@ static int if_sendbuf(int id, int channe
1955 (void)capidrv_del_ack(nccip, datahandle);
1959 printk(KERN_DEBUG "capidrv-%d: only %d bytes headroom, need %d\n",
1960 card->contrnr, skb_headroom(skb), msglen);
1962 memcpy(skb_push(nskb, msglen), sendcmsg.buf, msglen);
1963 errcode = (*capifuncs->capi_put_message) (global.appid, nskb);
1964 if (errcode == CAPI_NOERROR) {
1965 @@ -2035,6 +2016,52 @@ static void enable_dchannel_trace(capidr
1966 send_message(card, &cmdcmsg);
1970 +static void disable_dchannel_trace(capidrv_contr *card)
1972 + __u8 manufacturer[CAPI_MANUFACTURER_LEN];
1973 + capi_version version;
1974 + __u16 contr = card->contrnr;
1976 + __u16 avmversion[3];
1978 + errcode = (*capifuncs->capi_get_manufacturer)(contr, manufacturer);
1979 + if (errcode != CAPI_NOERROR) {
1980 + printk(KERN_ERR "%s: can't get manufacturer (0x%x)\n",
1981 + card->name, errcode);
1984 + if (strstr(manufacturer, "AVM") == 0) {
1985 + printk(KERN_ERR "%s: not from AVM, no d-channel trace possible (%s)\n",
1986 + card->name, manufacturer);
1989 + errcode = (*capifuncs->capi_get_version)(contr, &version);
1990 + if (errcode != CAPI_NOERROR) {
1991 + printk(KERN_ERR "%s: can't get version (0x%x)\n",
1992 + card->name, errcode);
1995 + avmversion[0] = (version.majormanuversion >> 4) & 0x0f;
1996 + avmversion[1] = (version.majormanuversion << 4) & 0xf0;
1997 + avmversion[1] |= (version.minormanuversion >> 4) & 0x0f;
1998 + avmversion[2] |= version.minormanuversion & 0x0f;
2000 + if (avmversion[0] > 3 || (avmversion[0] == 3 && avmversion[1] > 5)) {
2001 + printk(KERN_INFO "%s: D2 trace disabled\n", card->name);
2003 + printk(KERN_INFO "%s: D3 trace disabled\n", card->name);
2005 + capi_fill_MANUFACTURER_REQ(&cmdcmsg, global.appid,
2008 + 0x214D5641, /* ManuID */
2011 + (_cstruct)"\004\000\000\000\000");
2012 + send_message(card, &cmdcmsg);
2016 static void send_listen(capidrv_contr *card)
2018 @@ -2200,10 +2227,10 @@ static int capidrv_delcontr(__u16 contr)
2019 free_ncci(card, card->bchans[card->nbchan-1].nccip);
2020 if (card->bchans[card->nbchan-1].plcip)
2021 free_plci(card, card->bchans[card->nbchan-1].plcip);
2022 + if (card->plci_list)
2023 + printk(KERN_ERR "capidrv: bug in free_plci()\n");
2026 - if (card->plci_list)
2027 - printk(KERN_ERR "capidrv: bug in free_plci()\n");
2028 kfree(card->bchans);
2031 --- a/drivers/isdn/avmb1/capidrv.h
2032 +++ b/drivers/isdn/avmb1/capidrv.h
2034 -/* $Id: capidrv.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
2035 +/* $Id: capidrv.h,v 1.4 2001/09/24 13:22:44 kai Exp $
2037 * ISDN4Linux Driver, using capi20 interface (kernelcapi)
2039 --- a/drivers/isdn/avmb1/capifs.c
2040 +++ b/drivers/isdn/avmb1/capifs.c
2042 -/* $Id: capifs.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
2043 +/* $Id: capifs.c,v 1.22 2001/09/24 13:22:44 kai Exp $
2045 * Copyright 2000 by Carsten Paeth <calle@calle.de>
2048 #include <linux/major.h>
2049 #include <linux/slab.h>
2050 #include <linux/ctype.h>
2051 +#include <linux/isdn_compat.h>
2052 #include <asm/bitops.h>
2053 #include <asm/uaccess.h>
2055 @@ -32,7 +33,7 @@ MODULE_DESCRIPTION("CAPI4Linux: /dev/cap
2056 MODULE_AUTHOR("Carsten Paeth");
2057 MODULE_LICENSE("GPL");
2059 -static char *revision = "$Revision: 1.1.4.1 $";
2060 +static char *revision = "$Revision: 1.22 $";
2062 struct capifs_ncci {
2063 struct inode *inode;
2064 @@ -69,14 +70,21 @@ static inline struct capifs_sb_info *SBI
2065 static int capifs_root_readdir(struct file *,void *,filldir_t);
2066 static struct dentry *capifs_root_lookup(struct inode *,struct dentry *);
2067 static int capifs_revalidate(struct dentry *, int);
2068 +#ifdef COMPAT_VFS_2_4
2069 static struct inode *capifs_new_inode(struct super_block *sb);
2072 static struct file_operations capifs_root_operations = {
2073 +#ifdef COMPAT_VFS_2_4
2074 read: generic_read_dir,
2076 readdir: capifs_root_readdir,
2079 struct inode_operations capifs_root_inode_operations = {
2080 +#ifndef COMPAT_VFS_2_4
2081 + default_file_ops: &capifs_root_operations, /* file operations */
2083 lookup: capifs_root_lookup,
2086 @@ -101,12 +109,20 @@ static int capifs_root_readdir(struct fi
2090 +#ifdef COMPAT_VFS_2_4
2091 if (filldir(dirent, ".", 1, nr, inode->i_ino, DT_DIR) < 0)
2093 + if (filldir(dirent, ".", 1, nr, inode->i_ino) < 0)
2099 +#ifdef COMPAT_VFS_2_4
2100 if (filldir(dirent, "..", 2, nr, inode->i_ino, DT_DIR) < 0)
2102 + if (filldir(dirent, "..", 2, nr, inode->i_ino) < 0)
2107 @@ -118,7 +134,11 @@ static int capifs_root_readdir(struct fi
2109 if (np->type) *p++ = np->type;
2110 sprintf(p, "%u", np->num);
2111 +#ifdef COMPAT_VFS_2_4
2112 if ( filldir(dirent, numbuf, strlen(numbuf), nr, nr, DT_UNKNOWN) < 0 )
2114 + if ( filldir(dirent, numbuf, strlen(numbuf), nr, nr) < 0 )
2119 @@ -180,7 +200,7 @@ static struct dentry *capifs_root_lookup
2121 dentry->d_inode = np->inode;
2122 if ( dentry->d_inode )
2123 - atomic_inc(&dentry->d_inode->i_count);
2124 + i_count_inc(dentry->d_inode->i_count);
2126 d_add(dentry, dentry->d_inode);
2128 @@ -199,9 +219,9 @@ static void capifs_put_super(struct supe
2130 for ( i = 0 ; i < sbi->max_ncci ; i++ ) {
2131 if ( (inode = sbi->nccis[i].inode) ) {
2132 - if (atomic_read(&inode->i_count) != 1 )
2133 + if (i_count_read(inode->i_count) != 1 )
2134 printk("capifs_put_super: badness: entry %d count %d\n",
2135 - i, (unsigned)atomic_read(&inode->i_count));
2136 + i, (unsigned)i_count_read(inode->i_count));
2140 @@ -213,11 +233,24 @@ static void capifs_put_super(struct supe
2144 +#ifndef COMPAT_VFS_2_4
2145 + MOD_DEC_USE_COUNT;
2149 +#ifdef COMPAT_VFS_2_4
2150 static int capifs_statfs(struct super_block *sb, struct statfs *buf);
2152 +static int capifs_statfs(struct super_block *sb, struct statfs *buf, int bufsiz);
2153 +static void capifs_write_inode(struct inode *inode) { };
2154 +static void capifs_read_inode(struct inode *inode);
2157 static struct super_operations capifs_sops = {
2158 +#ifndef COMPAT_VFS_2_4
2159 + read_inode: capifs_read_inode,
2160 + write_inode: capifs_write_inode,
2162 put_super: capifs_put_super,
2163 statfs: capifs_statfs,
2165 @@ -288,6 +321,10 @@ struct super_block *capifs_read_super(st
2166 struct dentry * root;
2167 struct capifs_sb_info *sbi;
2169 +#ifndef COMPAT_VFS_2_4
2170 + MOD_INC_USE_COUNT;
2173 /* Super block already completed? */
2176 @@ -322,6 +359,7 @@ struct super_block *capifs_read_super(st
2178 * Get the root inode and dentry, but defer checking for errors.
2180 +#ifdef COMPAT_VFS_2_4
2181 root_inode = capifs_new_inode(s);
2183 root_inode->i_ino = 1;
2184 @@ -331,6 +369,10 @@ struct super_block *capifs_read_super(st
2185 root_inode->i_nlink = 2;
2187 root = d_alloc_root(root_inode);
2189 + root_inode = iget(s, 1); /* inode 1 == root directory */
2190 + root = d_alloc_root(root_inode, NULL);
2194 * Check whether somebody else completed the super block.
2195 @@ -370,11 +412,34 @@ struct super_block *capifs_read_super(st
2198 out: /* Success ... somebody else completed the super block for us. */
2199 +#ifndef COMPAT_VFS_2_4
2204 +#ifndef COMPAT_VFS_2_4
2206 + MOD_DEC_USE_COUNT;
2211 +#ifndef COMPAT_VFS_2_4
2212 +static int capifs_statfs(struct super_block *sb, struct statfs *buf, int bufsiz)
2214 + struct statfs tmp;
2216 + tmp.f_type = CAPIFS_SUPER_MAGIC;
2217 + tmp.f_bsize = 1024;
2223 + tmp.f_namelen = NAME_MAX;
2224 + return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0;
2227 static int capifs_statfs(struct super_block *sb, struct statfs *buf)
2229 buf->f_type = CAPIFS_SUPER_MAGIC;
2230 @@ -387,7 +452,9 @@ static int capifs_statfs(struct super_bl
2231 buf->f_namelen = NAME_MAX;
2236 +#ifdef COMPAT_VFS_2_4
2237 static struct inode *capifs_new_inode(struct super_block *sb)
2239 struct inode *inode = new_inode(sb);
2240 @@ -399,8 +466,51 @@ static struct inode *capifs_new_inode(st
2245 +static void capifs_read_inode(struct inode *inode)
2247 + ino_t ino = inode->i_ino;
2248 + struct capifs_sb_info *sbi = SBI(inode->i_sb);
2250 + inode->i_mode = 0;
2251 + inode->i_nlink = 0;
2252 + inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
2253 + inode->i_blocks = 0;
2254 + inode->i_blksize = 1024;
2255 + inode->i_uid = inode->i_gid = 0;
2258 + inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR;
2259 + inode->i_op = &capifs_root_inode_operations;
2260 + inode->i_nlink = 2;
2265 + if ( ino >= sbi->max_ncci )
2266 + return; /* Bogus */
2268 +#ifdef COMPAT_VFS_2_4
2269 + init_special_inode(inode, S_IFCHR, 0);
2271 + inode->i_mode = S_IFCHR;
2272 + inode->i_op = &chrdev_inode_operations;
2279 +#ifndef COMPAT_VFS_2_4
2280 +static struct file_system_type capifs_fs_type = {
2283 + capifs_read_super,
2287 static DECLARE_FSTYPE(capifs_fs_type, "capifs", capifs_read_super, 0);
2290 void capifs_new_ncci(char type, unsigned int num, kdev_t device)
2292 @@ -421,16 +531,26 @@ void capifs_new_ncci(char type, unsigned
2296 +#ifdef COMPAT_VFS_2_4
2297 if ( ino >= sbi->max_ncci )
2300 if ((np->inode = capifs_new_inode(sb)) != NULL) {
2302 + if ((np->inode = iget(sb, ino+2)) != NULL) {
2304 struct inode *inode = np->inode;
2305 inode->i_uid = sbi->setuid ? sbi->uid : current->fsuid;
2306 inode->i_gid = sbi->setgid ? sbi->gid : current->fsgid;
2307 +#ifdef COMPAT_VFS_2_4
2309 inode->i_ino = ino + 2;
2310 init_special_inode(inode, sbi->mode|S_IFCHR, np->kdev);
2312 + inode->i_mode = sbi->mode | S_IFCHR;
2313 + inode->i_rdev = np->kdev;
2319 --- a/drivers/isdn/avmb1/capifs.h
2320 +++ b/drivers/isdn/avmb1/capifs.h
2322 -/* $Id: capifs.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
2323 +/* $Id: capifs.h,v 1.4 2001/09/24 13:22:44 kai Exp $
2325 * Copyright 2000 by Carsten Paeth <calle@calle.de>
2327 --- a/drivers/isdn/avmb1/capilli.h
2328 +++ b/drivers/isdn/avmb1/capilli.h
2330 -/* $Id: capilli.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
2331 +/* $Id: capilli.h,v 1.5 2001/09/24 13:22:44 kai Exp $
2333 * Kernel CAPI 2.0 Driver Interface for Linux
2335 --- a/drivers/isdn/avmb1/capiutil.c
2336 +++ b/drivers/isdn/avmb1/capiutil.c
2338 -/* $Id: capiutil.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
2339 +/* $Id: capiutil.c,v 1.16 2001/09/24 13:22:44 kai Exp $
2341 * CAPI 2.0 convert capi message to capi message struct
2344 #include <linux/init.h>
2345 #include <asm/segment.h>
2346 #include <linux/config.h>
2347 +#include <linux/isdn_compat.h>
2348 #include "capiutil.h"
2350 MODULE_DESCRIPTION("CAPI4Linux: CAPI message conversion support");
2351 --- a/drivers/isdn/avmb1/capiutil.h
2352 +++ b/drivers/isdn/avmb1/capiutil.h
2354 -/* $Id: capiutil.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
2355 +/* $Id: capiutil.h,v 1.7 2001/09/24 13:22:44 kai Exp $
2357 * CAPI 2.0 defines & types
2359 --- a/drivers/isdn/avmb1/kcapi.c
2360 +++ b/drivers/isdn/avmb1/kcapi.c
2362 -/* $Id: kcapi.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
2363 +/* $Id: kcapi.c,v 1.28 2001/09/24 13:22:44 kai Exp $
2365 * Kernel CAPI 2.0 Module
2368 #include <linux/proc_fs.h>
2369 #include <linux/skbuff.h>
2370 #include <linux/tqueue.h>
2371 +#include <linux/isdn_compat.h>
2372 #include <linux/capi.h>
2373 #include <linux/kernelcapi.h>
2374 #include <linux/locks.h>
2376 #include <linux/b1lli.h>
2379 -static char *revision = "$Revision: 1.1.4.1 $";
2380 +static char *revision = "$Revision: 1.28 $";
2382 /* ------------------------------------------------------------- */
2384 @@ -64,7 +65,6 @@ struct capi_ncci {
2389 struct msgidqueue *msgidqueue;
2390 struct msgidqueue *msgidlast;
2391 struct msgidqueue *msgidfree;
2392 @@ -104,14 +104,14 @@ static char capi_manufakturer[64] = "AVM
2393 #define APPL(a) (&applications[(a)-1])
2394 #define VALID_APPLID(a) ((a) && (a) <= CAPI_MAXAPPL && APPL(a)->applid == a)
2395 #define APPL_IS_FREE(a) (APPL(a)->applid == 0)
2396 -#define APPL_MARK_FREE(a) do{ APPL(a)->applid=0; MOD_DEC_USE_COUNT; }while(0)
2397 -#define APPL_MARK_USED(a) do{ APPL(a)->applid=(a); MOD_INC_USE_COUNT; }while(0)
2398 +#define APPL_MARK_FREE(a) do{ APPL(a)->applid=0; MOD_DEC_USE_COUNT; }while(0);
2399 +#define APPL_MARK_USED(a) do{ APPL(a)->applid=(a); MOD_INC_USE_COUNT; }while(0);
2401 #define NCCI2CTRL(ncci) (((ncci) >> 24) & 0x7f)
2403 #define VALID_CARD(c) ((c) > 0 && (c) <= CAPI_MAXCONTR)
2404 #define CARD(c) (&cards[(c)-1])
2405 -#define CARDNR(cp) ((((cp)-cards)+1) & 0xff)
2406 +#define CARDNR(cp) (((cp)-cards)+1)
2408 static struct capi_appl applications[CAPI_MAXAPPL];
2409 static struct capi_ctr cards[CAPI_MAXCONTR];
2410 @@ -535,9 +535,13 @@ static int notify_push(unsigned int cmd,
2411 * of devices. Devices can only removed in
2412 * user process, not in bh.
2414 +#ifdef COMPAT_HAS_SCHEDULE_TASK
2416 if (schedule_task(&tq_state_notify) == 0)
2419 + queue_task(&tq_state_notify, &tq_scheduler);
2424 @@ -546,13 +550,7 @@ static int notify_push(unsigned int cmd,
2425 static void notify_up(__u32 contr)
2427 struct capi_interface_user *p;
2430 - for (appl = 1; appl <= CAPI_MAXAPPL; appl++) {
2431 - if (!VALID_APPLID(appl)) continue;
2432 - if (APPL(appl)->releasing) continue;
2433 - CARD(contr)->driver->register_appl(CARD(contr), appl, &APPL(appl)->rparam);
2435 printk(KERN_NOTICE "kcapi: notify up contr %d\n", contr);
2436 spin_lock(&capi_users_lock);
2437 for (p = capi_users; p; p = p->next) {
2438 @@ -639,7 +637,9 @@ static void notify_handler(void *dummy)
2442 +#ifdef COMPAT_HAS_SCHEDULE_TASK
2447 /* -------- NCCI Handling ------------------------------------- */
2448 @@ -647,7 +647,6 @@ static void notify_handler(void *dummy)
2449 static inline void mq_init(struct capi_ncci * np)
2452 - np->lock = SPIN_LOCK_UNLOCKED;
2456 @@ -662,11 +661,8 @@ static inline void mq_init(struct capi_n
2457 static inline int mq_enqueue(struct capi_ncci * np, __u16 msgid)
2459 struct msgidqueue *mq;
2460 - spin_lock_bh(&np->lock);
2461 - if ((mq = np->msgidfree) == 0) {
2462 - spin_unlock_bh(&np->lock);
2463 + if ((mq = np->msgidfree) == 0)
2466 np->msgidfree = mq->next;
2469 @@ -676,14 +672,12 @@ static inline int mq_enqueue(struct capi
2470 if (!np->msgidqueue)
2471 np->msgidqueue = mq;
2473 - spin_unlock_bh(&np->lock);
2477 static inline int mq_dequeue(struct capi_ncci * np, __u16 msgid)
2479 struct msgidqueue **pp;
2480 - spin_lock_bh(&np->lock);
2481 for (pp = &np->msgidqueue; *pp; pp = &(*pp)->next) {
2482 if ((*pp)->msgid == msgid) {
2483 struct msgidqueue *mq = *pp;
2484 @@ -693,11 +687,9 @@ static inline int mq_dequeue(struct capi
2485 mq->next = np->msgidfree;
2488 - spin_unlock_bh(&np->lock);
2492 - spin_unlock_bh(&np->lock);
2496 @@ -720,16 +712,12 @@ static void controllercb_appl_released(s
2497 nextpp = &(*pp)->next;
2500 - if (APPL(appl)->releasing) { /* only release if the application was marked for release */
2501 - printk(KERN_DEBUG "kcapi: appl %d releasing(%d)\n", appl, APPL(appl)->releasing);
2502 - APPL(appl)->releasing--;
2503 - if (APPL(appl)->releasing <= 0) {
2504 - APPL(appl)->signal = 0;
2505 - APPL_MARK_FREE(appl);
2506 - printk(KERN_INFO "kcapi: appl %d down\n", appl);
2509 - printk(KERN_WARNING "kcapi: appl %d card%d released without request\n", appl, card->cnr);
2510 + APPL(appl)->releasing--;
2511 + if (APPL(appl)->releasing <= 0) {
2512 + APPL(appl)->signal = 0;
2513 + APPL_MARK_FREE(appl);
2514 + printk(KERN_INFO "kcapi: appl %d down\n", appl);
2519 @@ -882,7 +870,16 @@ error:
2521 static void controllercb_ready(struct capi_ctr * card)
2525 card->cardstate = CARD_RUNNING;
2527 + for (appl = 1; appl <= CAPI_MAXAPPL; appl++) {
2528 + if (!VALID_APPLID(appl)) continue;
2529 + if (APPL(appl)->releasing) continue;
2530 + card->driver->register_appl(card, appl, &APPL(appl)->rparam);
2533 printk(KERN_NOTICE "kcapi: card %d \"%s\" ready.\n",
2534 CARDNR(card), card->name);
2536 --- a/drivers/isdn/avmb1/t1isa.c
2537 +++ b/drivers/isdn/avmb1/t1isa.c
2539 -/* $Id: t1isa.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
2540 +/* $Id: t1isa.c,v 1.22 2001/09/24 13:22:44 kai Exp $
2542 * Module for AVM T1 HEMA-card.
2545 #include <linux/capi.h>
2546 #include <linux/kernelcapi.h>
2547 #include <linux/init.h>
2548 +#include <linux/isdn_compat.h>
2550 #include "capicmd.h"
2551 #include "capiutil.h"
2552 #include "capilli.h"
2553 #include "avmcard.h"
2555 -static char *revision = "$Revision: 1.1.4.1 $";
2556 +static char *revision = "$Revision: 1.22 $";
2558 /* ------------------------------------------------------------- */
2560 --- a/drivers/isdn/avmb1/t1pci.c
2561 +++ b/drivers/isdn/avmb1/t1pci.c
2563 -/* $Id: t1pci.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
2564 +/* $Id: t1pci.c,v 1.25 2001/09/24 13:22:44 kai Exp $
2566 * Module for AVM T1 PCI-card.
2569 #include <linux/interrupt.h>
2570 #include <linux/ioport.h>
2571 #include <linux/pci.h>
2572 +#include <linux/isdn_compat.h>
2573 #include <linux/capi.h>
2574 #include <linux/init.h>
2577 #include "capilli.h"
2578 #include "avmcard.h"
2580 -static char *revision = "$Revision: 1.1.4.1 $";
2581 +static char *revision = "$Revision: 1.25 $";
2583 #undef CONFIG_T1PCI_DEBUG
2584 #undef CONFIG_T1PCI_POLLDEBUG
2586 /* ------------------------------------------------------------- */
2588 +#ifndef COMPAT_HAS_2_2_PCI
2589 static struct pci_device_id t1pci_pci_tbl[] __initdata = {
2590 { PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_T1, PCI_ANY_ID, PCI_ANY_ID },
2591 { } /* Terminating entry */
2594 MODULE_DEVICE_TABLE(pci, t1pci_pci_tbl);
2596 MODULE_DESCRIPTION("CAPI4Linux: Driver for AVM T1 PCI card");
2597 MODULE_AUTHOR("Carsten Paeth");
2598 MODULE_LICENSE("GPL");
2599 @@ -264,9 +267,9 @@ static int __init t1pci_init(void)
2601 pci_set_master(dev);
2603 - param.port = pci_resource_start(dev, 1);
2604 + param.port = pci_resource_start_io(dev, 1);
2605 param.irq = dev->irq;
2606 - param.membase = pci_resource_start(dev, 0);
2607 + param.membase = pci_resource_start_mem(dev, 0);
2610 "%s: PCI BIOS reports AVM-T1-PCI at i/o %#x, irq %d, mem %#x\n",
2611 --- a/drivers/isdn/divert/divert_procfs.c
2612 +++ b/drivers/isdn/divert/divert_procfs.c
2614 -/* $Id: divert_procfs.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
2617 * Filesystem handling for the diversion supplementary services.
2620 #include <linux/module.h>
2621 #include <linux/version.h>
2622 #include <linux/poll.h>
2623 +#ifndef COMPAT_USE_MODCOUNT_LOCK
2624 #include <linux/smp_lock.h>
2626 #ifdef CONFIG_PROC_FS
2627 #include <linux/proc_fs.h>
2629 #include <linux/fs.h>
2631 #include <linux/isdnif.h>
2632 +#include <linux/isdn_compat.h>
2633 #include "isdn_divert.h"
2635 /*********************************/
2636 @@ -80,7 +83,6 @@ static ssize_t
2637 isdn_divert_read(struct file *file, char *buf, size_t count, loff_t * off)
2639 struct divert_info *inf;
2640 - loff_t pos = *off;
2643 if (!*((struct divert_info **) file->private_data)) {
2644 @@ -92,11 +94,11 @@ isdn_divert_read(struct file *file, char
2647 inf->usage_cnt--; /* new usage count */
2648 - file->private_data = &inf->next; /* next structure */
2649 + (struct divert_info **) file->private_data = &inf->next; /* next structure */
2650 if ((len = strlen(inf->info_start)) <= count) {
2651 if (copy_to_user(buf, inf->info_start, len))
2654 + file->f_pos += len;
2658 @@ -136,17 +138,23 @@ isdn_divert_open(struct inode *ino, stru
2660 unsigned long flags;
2662 +#ifdef COMPAT_USE_MODCOUNT_LOCK
2663 + MOD_INC_USE_COUNT;
2670 if (divert_info_head)
2671 - filep->private_data = &(divert_info_tail->next);
2672 + (struct divert_info **) filep->private_data = &(divert_info_tail->next);
2674 - filep->private_data = &divert_info_head;
2675 + (struct divert_info **) filep->private_data = &divert_info_head;
2676 restore_flags(flags);
2677 /* start_divert(); */
2678 +#ifndef COMPAT_USE_MODCOUNT_LOCK
2682 } /* isdn_divert_open */
2684 @@ -159,7 +167,9 @@ isdn_divert_close(struct inode *ino, str
2685 struct divert_info *inf;
2686 unsigned long flags;
2688 +#ifndef COMPAT_USE_MODCOUNT_LOCK
2694 @@ -175,7 +185,11 @@ isdn_divert_close(struct inode *ino, str
2695 divert_info_head = divert_info_head->next;
2698 +#ifdef COMPAT_USE_MODCOUNT_LOCK
2699 + MOD_DEC_USE_COUNT;
2704 } /* isdn_divert_close */
2706 @@ -276,6 +290,9 @@ static struct file_operations isdn_fops
2707 open: isdn_divert_open,
2708 release: isdn_divert_close,
2710 +#ifdef COMPAT_NO_SOFTNET
2711 +struct inode_operations divert_file_inode_operations;
2714 /****************************/
2715 /* isdn subdir in /proc/net */
2716 @@ -302,8 +319,16 @@ divert_dev_init(void)
2717 remove_proc_entry("isdn", proc_net);
2720 +#ifdef COMPAT_NO_SOFTNET
2721 + memset(&divert_file_inode_operations, 0, sizeof(struct inode_operations));
2722 + divert_file_inode_operations.default_file_ops = &isdn_fops;
2723 + isdn_divert_entry->ops = &divert_file_inode_operations;
2725 isdn_divert_entry->proc_fops = &isdn_fops;
2726 +#ifdef COMPAT_HAS_FILEOP_OWNER
2727 isdn_divert_entry->owner = THIS_MODULE;
2729 +#endif /* COMPAT_NO_SOFTNET */
2730 #endif /* CONFIG_PROC_FS */
2733 --- a/drivers/isdn/divert/isdn_divert.c
2734 +++ b/drivers/isdn/divert/isdn_divert.c
2736 -/* $Id: isdn_divert.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
2739 * DSS1 main diversion supplementary handling for i4l.
2741 @@ -84,6 +84,9 @@ static void deflect_timer_expire(ulong a
2742 restore_flags(flags);
2745 + case NETWORK_DIAL:
2746 + divert_if.dial_net_name(cs->deflect_dest);
2748 case DEFLECT_AUTODEL:
2751 @@ -452,6 +455,7 @@ int isdn_divert_icall(isdn_ctrl *ic)
2752 case DEFLECT_PROCEED:
2753 case DEFLECT_REPORT:
2754 case DEFLECT_REJECT:
2755 + case NETWORK_DIAL:
2756 if (dv->rule.action == DEFLECT_PROCEED)
2757 if ((!if_used) || ((!extern_wait_max) && (!dv->rule.waittime)))
2758 return(0); /* no external deflection needed */
2759 @@ -495,6 +499,11 @@ int isdn_divert_icall(isdn_ctrl *ic)
2761 { cs->deflect_dest[0] = '\0';
2762 retval = 4; /* only proceed */
2763 + if (cs->akt_state == NETWORK_DIAL) {
2764 + strcpy(cs->deflect_dest,dv->rule.to_nr);
2765 + cs->timer.expires = jiffies + 10;
2769 sprintf(cs->info,"%d 0x%lx %s %s %s %s 0x%x 0x%x %d %d %s\n",
2771 @@ -739,6 +748,18 @@ int prot_stat_callback(isdn_ctrl *ic)
2776 + sprintf(st, "0x%lx 0x%lx",ic->arg, ic->parm.dss1_io.ll_id);
2777 + p = st + strlen(st);
2778 + p1 = ic->parm.dss1_io.data;
2779 + i = ic->parm.dss1_io.datalen;
2780 + while ((i > 0) && (p - st < 530))
2781 + { p += sprintf(p," %02x",(*p1++) & 0xFF);
2785 + put_info_buffer(st);
2790 --- a/drivers/isdn/divert/isdn_divert.h
2791 +++ b/drivers/isdn/divert/isdn_divert.h
2793 -/* $Id: isdn_divert.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
2796 * Header for the diversion supplementary ioctl interface.
2799 #define DEFLECT_PROCEED 2 /* deflect when externally triggered */
2800 #define DEFLECT_ALERT 3 /* alert and deflect after delay */
2801 #define DEFLECT_REJECT 4 /* reject immediately */
2802 -#define DIVERT_ACTIVATE 5 /* diversion activate */
2803 -#define DIVERT_DEACTIVATE 6 /* diversion deactivate */
2804 -#define DIVERT_REPORT 7 /* interrogation result */
2805 +#define NETWORK_DIAL 5 /* dial a network interface */
2806 +#define DIVERT_ACTIVATE 16 /* diversion activate */
2807 +#define DIVERT_DEACTIVATE 17 /* diversion deactivate */
2808 +#define DIVERT_REPORT 18 /* interrogation result */
2809 #define DEFLECT_AUTODEL 255 /* only for internal use */
2811 #define DEFLECT_ALL_IDS 0xFFFFFFFF /* all drivers selected */
2812 @@ -60,6 +61,7 @@ typedef struct
2813 2 = report call, send proceed, wait max waittime secs
2814 3 = report call, alert and deflect after waittime
2815 4 = report call, reject immediately
2816 + 5 = dial net interface specified in to_nr
2817 actions 1-2 only take place if interface is opened
2819 u_char waittime; /* maximum wait time for proceeding */
2820 --- a/drivers/isdn/eicon/Divas_mod.c
2821 +++ b/drivers/isdn/eicon/Divas_mod.c
2823 #include "adapter.h"
2826 +#include <linux/isdn_compat.h>
2828 MODULE_DESCRIPTION("ISDN4Linux: Driver for Eicon Diva Server cards");
2829 MODULE_AUTHOR("Armin Schindler");
2830 --- a/drivers/isdn/eicon/common.c
2831 +++ b/drivers/isdn/eicon/common.c
2832 @@ -808,9 +808,7 @@ void DivasDoDpc(void *pData)
2836 - if (card->state == DIA_RUNNING)
2837 - DivaDoCardDpc(card);
2839 + DivaDoCardDpc(card++);
2843 --- a/drivers/isdn/eicon/eicon.h
2844 +++ b/drivers/isdn/eicon/eicon.h
2846 -/* $Id: eicon.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
2847 +/* $Id: eicon.h,v 1.26 2001/09/24 13:22:47 kai Exp $
2849 * ISDN low-level module for Eicon active ISDN-Cards.
2851 @@ -347,19 +347,19 @@ typedef struct eicon_card {
2852 extern char *eicon_ctype_name[];
2855 -static inline void eicon_schedule_tx(eicon_card *card)
2856 +extern __inline__ void eicon_schedule_tx(eicon_card *card)
2858 queue_task(&card->snd_tq, &tq_immediate);
2859 mark_bh(IMMEDIATE_BH);
2862 -static inline void eicon_schedule_rx(eicon_card *card)
2863 +extern __inline__ void eicon_schedule_rx(eicon_card *card)
2865 queue_task(&card->rcv_tq, &tq_immediate);
2866 mark_bh(IMMEDIATE_BH);
2869 -static inline void eicon_schedule_ack(eicon_card *card)
2870 +extern __inline__ void eicon_schedule_ack(eicon_card *card)
2872 queue_task(&card->ack_tq, &tq_immediate);
2873 mark_bh(IMMEDIATE_BH);
2874 --- a/drivers/isdn/eicon/eicon_dsp.h
2875 +++ b/drivers/isdn/eicon/eicon_dsp.h
2877 -/* $Id: eicon_dsp.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
2878 +/* $Id: eicon_dsp.h,v 1.8 2001/09/24 13:22:47 kai Exp $
2880 * ISDN lowlevel-module for Eicon active cards.
2882 --- a/drivers/isdn/eicon/eicon_idi.c
2883 +++ b/drivers/isdn/eicon/eicon_idi.c
2885 -/* $Id: eicon_idi.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
2886 +/* $Id: eicon_idi.c,v 1.45 2001/11/07 22:35:48 kai Exp $
2888 * ISDN lowlevel-module for Eicon active cards.
2892 #undef EICON_FULL_SERVICE_OKTETT
2894 -char *eicon_idi_revision = "$Revision: 1.1.4.1 $";
2895 +char *eicon_idi_revision = "$Revision: 1.45 $";
2897 eicon_manifbuf *manbuf;
2899 @@ -1583,6 +1583,37 @@ idi_faxdata_rcv(eicon_card *ccard, eicon
2904 + eicon_sff_dochead *doc = (eicon_sff_dochead *)skb->data;
2905 + eicon_sff_pagehead *page = (eicon_sff_pagehead *)skb->data + sizeof(eicon_sff_dochead);
2907 + printk(KERN_DEBUG"SFF: doc %d / page %d (skb : %d)\n",
2908 + sizeof(eicon_sff_dochead),
2909 + sizeof(eicon_sff_pagehead), skb->len);
2911 + if (skb->len >= sizeof(eicon_sff_dochead)) {
2912 + printk(KERN_DEBUG"SFF: id = 0x%x\n", doc->id);
2913 + printk(KERN_DEBUG"SFF: version = 0x%x\n", doc->version);
2914 + printk(KERN_DEBUG"SFF: reserved1 = 0x%x\n", doc->reserved1);
2915 + printk(KERN_DEBUG"SFF: userinfo = 0x%x\n", doc->userinfo);
2916 + printk(KERN_DEBUG"SFF: pagecount = 0x%x\n", doc->pagecount);
2917 + printk(KERN_DEBUG"SFF: off1pagehead = 0x%x\n", doc->off1pagehead);
2918 + printk(KERN_DEBUG"SFF: offnpagehead = 0x%x\n", doc->offnpagehead);
2919 + printk(KERN_DEBUG"SFF: offdocend = 0x%x\n", doc->offdocend);
2921 + if (skb->len >= (sizeof(eicon_sff_dochead) + sizeof(eicon_sff_pagehead))) {
2922 + printk(KERN_DEBUG"SFFp: id = 0x%x\n", page->pageheadid);
2923 + printk(KERN_DEBUG"SFFp: len = 0x%x\n", page->pageheadlen);
2924 + printk(KERN_DEBUG"SFFp: resvert = 0x%x\n", page->resvert);
2925 + printk(KERN_DEBUG"SFFp: reshoriz = 0x%x\n", page->reshoriz);
2926 + printk(KERN_DEBUG"SFFp: coding = 0x%x\n", page->coding);
2927 + printk(KERN_DEBUG"SFFp: reserved2 = 0x%x\n", page->reserved2);
2928 + printk(KERN_DEBUG"SFFp: linelength = 0x%x\n", page->linelength);
2929 + printk(KERN_DEBUG"SFFp: pagelength = 0x%x\n", page->pagelength);
2930 + printk(KERN_DEBUG"SFFp: offprevpage = 0x%x\n", page->offprevpage);
2931 + printk(KERN_DEBUG"SFFp: offnextpage = 0x%x\n", page->offnextpage);
2936 if (chan->fax->direction == ISDN_TTY_FAX_CONN_IN) {
2937 @@ -2054,8 +2085,7 @@ idi_faxdata_send(eicon_card *ccard, eico
2941 - *(__u16 *) OutBuf.Next = (__u16) LineBuf.Len;
2942 - OutBuf.Next += sizeof(__u16);
2943 + *((__u16 *) OutBuf.Next)++ = (__u16) LineBuf.Len;
2946 memcpy(OutBuf.Next, LineBuf.Data, LineBuf.Len);
2947 @@ -2385,6 +2415,12 @@ idi_handle_ind(eicon_card *ccard, struct
2950 idi_do_req(ccard, chan, REMOVE, 1);
2952 + if (chan->e.D3Id) {
2953 + idi_do_req(ccard, chan, REMOVE, 0);
2954 + idi_do_req(ccard, chan, ASSIGN, 0);
2957 chan->statectrl &= ~WAITING_FOR_HANGUP;
2958 chan->statectrl &= ~IN_HOLD;
2959 if (chan->statectrl & HAVE_CONN_REQ) {
2960 --- a/drivers/isdn/eicon/eicon_idi.h
2961 +++ b/drivers/isdn/eicon/eicon_idi.h
2963 -/* $Id: eicon_idi.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
2964 +/* $Id: eicon_idi.h,v 1.12 2001/09/24 13:22:47 kai Exp $
2966 * ISDN lowlevel-module for the Eicon active cards.
2968 --- a/drivers/isdn/eicon/eicon_io.c
2969 +++ b/drivers/isdn/eicon/eicon_io.c
2971 -/* $Id: eicon_io.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
2972 +/* $Id: eicon_io.c,v 1.15 2001/09/24 13:22:47 kai Exp $
2974 * ISDN low-level module for Eicon active ISDN-Cards.
2975 * Code for communicating with hardware.
2976 --- a/drivers/isdn/eicon/eicon_isa.c
2977 +++ b/drivers/isdn/eicon/eicon_isa.c
2979 -/* $Id: eicon_isa.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
2980 +/* $Id: eicon_isa.c,v 1.18 2001/11/07 22:35:48 kai Exp $
2982 * ISDN low-level module for Eicon active ISDN-Cards.
2983 * Hardware-specific code for old ISA cards.
2985 #define release_shmem release_region
2986 #define request_shmem request_region
2988 -char *eicon_isa_revision = "$Revision: 1.1.4.1 $";
2989 +char *eicon_isa_revision = "$Revision: 1.18 $";
2991 #undef EICON_MCA_DEBUG
2993 @@ -38,8 +38,12 @@ static int eicon_isa_valid_irq[] = {
2995 eicon_isa_release_shmem(eicon_isa_card *card) {
2997 +#ifdef COMPAT_HAS_ISA_IOREMAP
2998 iounmap(card->shmem);
2999 release_mem_region(card->physmem, card->ramsize);
3001 + release_shmem((unsigned long)card->shmem, card->ramsize);
3006 @@ -94,12 +98,20 @@ eicon_isa_find_card(int Mem, int Irq, ch
3010 +#ifdef COMPAT_HAS_ISA_IOREMAP
3011 if (check_mem_region(Mem, RAMSIZE)) {
3013 + if (check_shmem(Mem, RAMSIZE)) {
3015 printk(KERN_WARNING "eicon_isa_boot: memory at 0x%x already in use.\n", Mem);
3019 +#ifdef COMPAT_HAS_ISA_IOREMAP
3020 amem = (unsigned long) ioremap(Mem, RAMSIZE);
3022 + amem = (unsigned long) Mem;
3024 writew(0x55aa, amem + 0x402);
3025 if (readw(amem + 0x402) != 0x55aa) primary = 0;
3026 writew(0, amem + 0x402);
3027 @@ -109,12 +121,16 @@ eicon_isa_find_card(int Mem, int Irq, ch
3029 printk(KERN_INFO "Eicon: assuming pri card at 0x%x\n", Mem);
3030 writeb(0, amem + 0x3ffe);
3031 +#ifdef COMPAT_HAS_ISA_IOREMAP
3032 iounmap((unsigned char *)amem);
3034 return EICON_CTYPE_ISAPRI;
3036 printk(KERN_INFO "Eicon: assuming bri card at 0x%x\n", Mem);
3037 writeb(0, amem + 0x400);
3038 +#ifdef COMPAT_HAS_ISA_IOREMAP
3039 iounmap((unsigned char *)amem);
3041 return EICON_CTYPE_ISABRI;
3044 @@ -151,6 +167,7 @@ eicon_isa_bootload(eicon_isa_card *card,
3046 card->ramsize = RAMSIZE;
3048 +#ifdef COMPAT_HAS_ISA_IOREMAP
3049 if (check_mem_region(card->physmem, card->ramsize)) {
3050 printk(KERN_WARNING "eicon_isa_boot: memory at 0x%lx already in use.\n",
3052 @@ -159,6 +176,16 @@ eicon_isa_bootload(eicon_isa_card *card,
3054 request_mem_region(card->physmem, card->ramsize, "Eicon ISA ISDN");
3055 card->shmem = (eicon_isa_shmem *) ioremap(card->physmem, card->ramsize);
3057 + /* Register shmem */
3058 + if (check_shmem((unsigned long)card->shmem, card->ramsize)) {
3059 + printk(KERN_WARNING "eicon_isa_boot: memory at 0x%lx already in use.\n",
3060 + (unsigned long)card->shmem);
3064 + request_shmem((unsigned long)card->shmem, card->ramsize, "Eicon ISA ISDN");
3066 #ifdef EICON_MCA_DEBUG
3067 printk(KERN_INFO "eicon_isa_boot: card->ramsize = %d.\n", card->ramsize);
3069 --- a/drivers/isdn/eicon/eicon_isa.h
3070 +++ b/drivers/isdn/eicon/eicon_isa.h
3072 -/* $Id: eicon_isa.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
3073 +/* $Id: eicon_isa.h,v 1.11 2001/09/24 13:22:47 kai Exp $
3075 * ISDN low-level module for Eicon active ISDN-Cards.
3077 --- a/drivers/isdn/eicon/eicon_mod.c
3078 +++ b/drivers/isdn/eicon/eicon_mod.c
3080 -/* $Id: eicon_mod.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
3081 +/* $Id: eicon_mod.c,v 1.44 2001/11/20 09:48:25 armin Exp $
3083 * ISDN lowlevel-module for Eicon active cards.
3086 static eicon_card *cards = (eicon_card *) NULL; /* glob. var , contains
3087 start of card-list */
3089 -static char *eicon_revision = "$Revision: 1.1.4.1 $";
3090 +static char *eicon_revision = "$Revision: 1.44 $";
3092 extern char *eicon_pci_revision;
3093 extern char *eicon_isa_revision;
3094 @@ -639,6 +639,18 @@ if_command(isdn_ctrl * c)
3096 if_writecmd(const u_char * buf, int len, int user, int id, int channel)
3099 + /* Not yet used */
3100 + eicon_card *card = eicon_findcard(id);
3103 + if (!card->flags & EICON_FLAGS_RUNNING)
3108 + "eicon: if_writecmd called with invalid driverId!\n");
3113 @@ -665,11 +677,8 @@ if_readstatus(u_char * buf, int len, int
3118 - spin_unlock_irqrestore(&eicon_lock, flags);
3120 copy_to_user(p, skb->data, cnt);
3121 - spin_lock_irqsave(&eicon_lock, flags);
3124 memcpy(p, skb->data, cnt);
3126 @@ -1459,6 +1468,7 @@ eicon_exit(void)
3130 +#ifdef COMPAT_HAS_NEW_SETUP
3132 eicon_setup(char *line)
3134 @@ -1467,6 +1477,12 @@ eicon_setup(char *line)
3137 str = get_options(line, 4, ints);
3140 +eicon_setup(char *str, int *ints)
3147 @@ -1494,9 +1510,13 @@ eicon_setup(char *line)
3149 printk(KERN_INFO "Eicon ISDN active driver setup\n");
3151 +#ifdef COMPAT_HAS_NEW_SETUP
3154 __setup("eicon=", eicon_setup);
3161 --- a/drivers/isdn/eicon/eicon_pci.c
3162 +++ b/drivers/isdn/eicon/eicon_pci.c
3164 -/* $Id: eicon_pci.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
3165 +/* $Id: eicon_pci.c,v 1.18 2001/09/24 13:22:47 kai Exp $
3167 * ISDN low-level module for Eicon active ISDN-Cards.
3168 * Hardware-specific code for PCI cards.
3170 #include "adapter.h"
3173 -char *eicon_pci_revision = "$Revision: 1.1.4.1 $";
3174 +char *eicon_pci_revision = "$Revision: 1.18 $";
3176 #if CONFIG_PCI /* intire stuff is only for PCI */
3177 #ifdef CONFIG_ISDN_DRV_EICON_PCI
3178 --- a/drivers/isdn/eicon/eicon_pci.h
3179 +++ b/drivers/isdn/eicon/eicon_pci.h
3181 -/* $Id: eicon_pci.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
3182 +/* $Id: eicon_pci.h,v 1.7 2001/09/24 13:22:47 kai Exp $
3184 * ISDN low-level module for Eicon active ISDN-Cards (PCI part).
3186 --- a/drivers/isdn/eicon/fourbri.c
3187 +++ b/drivers/isdn/eicon/fourbri.c
3188 @@ -337,8 +337,7 @@ static int diva_server_4bri_load(card_t
3189 static int diva_server_4bri_start(card_t *card, byte *channels)
3197 DPRINTF(("divas: start Diva Server 4BRI"));
3198 --- a/drivers/isdn/eicon/kprintf.c
3199 +++ b/drivers/isdn/eicon/kprintf.c
3201 #include "divalog.h"
3205 + * Implementation of printf and sprintf for kernel
3208 +#define MAX_BUFF (80) /* limit size of temporary buffers */
3210 +#define WRITE_CHAR(BUFFER, SIZE, C) \
3211 + if (--(SIZE) < 0) { (BUFFER)--; *(BUFFER) = '\0'; return; } *(BUFFER)++ = (C)
3215 + * convert a number to decimal ASCII
3219 +void do_decimal( char *temp,
3221 + unsigned int value,
3229 + for (i = 1; i < temp_len; i++)
3231 + temp[i] = (char) ((value % 10) + (int) '0');
3235 + for (i = (temp_len - 1); temp[i] == '0'; i--)
3254 + * convert a number to octal ASCII
3258 +void do_octal( char *temp,
3259 + unsigned int value,
3267 + for (i = 1; i <= 11; i++)
3269 + temp[i] = (char) ((value & 07) + (int) '0');
3274 + for (i = 11; temp[i] == '0'; i--)
3293 + * convert a number to hex ASCII
3297 +void do_hex( char *temp,
3298 + unsigned int value,
3304 + char *dec_to_hex = "0123456789abcdef";
3308 + for (i = 1; i <= 8; i++)
3310 + temp[i] = dec_to_hex[value & 0x0f];
3314 + for (i = 8; temp[i] == '0'; i--)
3333 + * convert a buffer to ASCII HEX
3337 +void do_buffer( char *buffer,
3343 + char hex_char [] = "0123456789abcdef";
3348 + length = (length >= ((MAX_BUFF / 3) + 1)) ? (MAX_BUFF / 3) : length;
3352 + hex_byte = (int) *b++;
3353 + nybble = (hex_byte >> 4) & 0xf;
3354 + *s++ = hex_char[nybble];
3355 + nybble = hex_byte & 0xf;
3356 + *s++ = hex_char[nybble];
3366 + * Body of sprintf function: behaves just like standard sprintf, except we
3367 + * have an extra argument (buffer size) which we use to ensure we don't
3371 +void Divas_vsprintf( char *buffer,
3377 + char c; /* single character buffer */
3378 + int i; /* handy scratch counter */
3379 + int f; /* format character (after %) */
3380 + char *str; /* pointer into string */
3381 + char temp[20]; /* temp buffer used in printing numbers */
3382 + char string[MAX_BUFF]; /* output from number conversion */
3383 + int length; /* length of string "str" */
3384 + char fill; /* fill character ' ' or '0' */
3385 + boolean_t leftjust; /* TRUE if left justified, else right justified */
3386 + int fmax, fmin; /* field specifiers % MIN . MAX s */
3387 + int leading; /* number of leading/trailing fill characters */
3388 + char sign; /* set to '-' for negative decimals */
3389 + int number; /* numeric argument */
3391 + char *buff_ptr; /* pointer to user's buffer of hex data */
3392 + int buff_len; /* length of hex data */
3394 + /* make sure we have somthing to write into */
3396 + if ((!buffer) || (size <= 0))
3403 + /* echo characters until end or '%' encountered */
3405 + while ((c = *fmt++) != '%')
3412 + WRITE_CHAR(buffer, size, c);
3415 + /* echo %% as % */
3419 + WRITE_CHAR(buffer, size, *fmt);
3423 + /* %- turns on left-justify */
3425 + if ((leftjust = (boolean_t) ((*fmt == '-') ? TRUE : FALSE)))
3430 + /* %0 turns on zero filling */
3441 + /* minium field width specifier for %d, u, x, c, s */
3447 + fmin = va_arg(argptr, int);
3452 + while ('0' <= *fmt && *fmt <= '9')
3454 + fmin = (fmin * 10) + (*fmt++ - '0');
3458 + /* maximum string width specifier for %s */
3464 + if (*(++fmt) == '*')
3466 + fmax = va_arg(argptr, int);
3471 + while ('0' <= *fmt && *fmt <= '9')
3473 + fmax = (fmax * 10) + (*fmt++ - '0');
3478 + /* skip over 'l' option (ints are assumed same size as longs) */
3485 + /* get the format chacater */
3487 + if (!(f = *fmt++))
3489 + WRITE_CHAR(buffer, size, '%');
3494 + sign = '\0'; /* sign == '-' for negative decimal */
3501 + string[0] = (char) va_arg(argptr, int);
3508 + str = va_arg(argptr, char *);
3514 + number = va_arg(argptr, int);
3520 + do_decimal(temp, DIM(temp), (unsigned int) number, str);
3526 + number = va_arg(argptr, int);
3527 + do_decimal(temp, DIM(temp), (unsigned int) number, str);
3533 + number = va_arg(argptr, int);
3534 + do_octal(temp, (unsigned int) number, str);
3540 + number = va_arg(argptr, int);
3541 + do_hex(temp, (unsigned int) number, str);
3547 + buff_ptr = va_arg(argptr, char *);
3548 + buff_len = va_arg(argptr, int);
3549 + do_buffer(buff_ptr, buff_len, str);
3554 + WRITE_CHAR(buffer, size, ((char) f));
3558 + /* get the length of the string */
3561 + while (str[length])
3566 + /* make sure we have fmax and fmin values that are O.K. */
3568 + if (fmin > DIM(string) || fmin < 0)
3573 + if (fmax > DIM(string) || fmax < 0)
3578 + /* figure out how many leading characters thare are */
3586 + if (length > fmax)
3594 + leading = fmin - length;
3603 + /* output sign now, if fill is numeric */
3605 + if (sign == '-' && fill == '0')
3607 + WRITE_CHAR(buffer, size, '-');
3610 + /* if right justified, output fill characters */
3614 + for (i = 0; i < leading; i++)
3616 + WRITE_CHAR(buffer, size, fill);
3620 + /* output sign now, if fill is spaces */
3622 + if (sign == '-' && fill == ' ')
3624 + WRITE_CHAR(buffer, size, '-');
3627 + /* now the actual value */
3629 + for (i = 0; i < length; i++)
3631 + WRITE_CHAR(buffer, size, str[i]);
3634 + /* if left justified, fill out with the fill character */
3638 + for (i = 0; i < leading; i++)
3640 + WRITE_CHAR(buffer, size, fill);
3647 + * sprintf for kernel
3649 + * call our vsprintf assuming user has a big buffer....
3652 +void DivasSprintf(char *buffer, char *fmt, ...)
3655 + va_list argptr; /* pointer to additional args */
3657 + va_start(argptr, fmt);
3659 + Divas_vsprintf(buffer, 1024, fmt, argptr);
3666 void DivasPrintf(char *fmt, ...)
3669 @@ -40,7 +502,7 @@ void DivasPrintf(char *fmt, ...)
3671 /* call vsprintf to format the user's information */
3673 - vsnprintf(log.buffer, DIM(log.buffer), fmt, argptr);
3674 + Divas_vsprintf(log.buffer, DIM(log.buffer), fmt, argptr);
3678 --- a/drivers/isdn/eicon/lincfg.c
3679 +++ b/drivers/isdn/eicon/lincfg.c
3683 #include <linux/pci.h>
3684 +#ifndef COMPAT_HAS_2_2_PCI
3685 +#include <linux/pci_ids.h>
3687 #include <linux/kernel.h>
3688 #include <linux/ioport.h>
3690 --- a/drivers/isdn/eicon/linchr.c
3691 +++ b/drivers/isdn/eicon/linchr.c
3692 @@ -154,17 +154,17 @@ ssize_t do_read(struct file *pFile, char
3695 if (BufferSize < sizeof(klog_t))
3697 + printk(KERN_WARNING "Divas: Divalog buffer specifed a size that is too small (%d - %d required)\n",
3698 + BufferSize, sizeof(klog_t));
3702 pHeadItem = (klog_t *) DivasLogFifoRead();
3706 - if(copy_to_user(pClientLogBuffer, pHeadItem, sizeof(klog_t)))
3711 + memcpy(pClientLogBuffer, pHeadItem, sizeof(klog_t));
3713 return sizeof(klog_t);
3715 --- a/drivers/isdn/eicon/linio.c
3716 +++ b/drivers/isdn/eicon/linio.c
3718 #include <linux/slab.h>
3719 #include <linux/pci.h>
3720 #include <linux/delay.h>
3721 +#include <linux/isdn_compat.h>
3725 --- a/drivers/isdn/hisax/Makefile
3726 +++ b/drivers/isdn/hisax/Makefile
3729 O_TARGET := vmlinux-obj.o
3731 -# Define maximum number of cards
3733 -EXTRA_CFLAGS += -DHISAX_MAX_CARDS=$(CONFIG_HISAX_MAX_CARDS)
3735 # Objects that export symbols.
3737 -export-objs := config.o hisax_isac.o isdnhdlc.o
3738 +export-objs := config.o fsm.o hisax_isac.o
3740 # Multipart objects.
3742 list-multi := hisax.o hisax_st5481.o
3743 hisax-objs := config.o isdnl1.o tei.o isdnl2.o isdnl3.o \
3744 lmgr.o q931.o callc.o fsm.o cert.o
3745 -hisax_st5481-objs := st5481_init.o st5481_usb.o st5481_d.o st5481_b.o
3746 +hisax_st5481-objs := st5481_init.o st5481_usb.o st5481_d.o st5481_b.o \
3749 # Optional parts of multipart objects.
3750 hisax-objs-$(CONFIG_HISAX_EURO) += l3dss1.o
3751 @@ -33,7 +30,7 @@ hisax-objs-$(CONFIG_HISAX_AVM_A1_PCMCIA)
3752 hisax-objs-$(CONFIG_HISAX_FRITZPCI) += avm_pci.o isac.o arcofi.o
3753 hisax-objs-$(CONFIG_HISAX_ELSA) += elsa.o isac.o arcofi.o hscx.o
3754 hisax-objs-$(CONFIG_HISAX_IX1MICROR2) += ix1_micro.o isac.o arcofi.o hscx.o
3755 -hisax-objs-$(CONFIG_HISAX_DIEHLDIVA) += diva.o isac.o arcofi.o hscx.o ipacx.o
3756 +hisax-objs-$(CONFIG_HISAX_DIEHLDIVA) += diva.o isac.o arcofi.o hscx.o
3757 hisax-objs-$(CONFIG_HISAX_ASUSCOM) += asuscom.o isac.o arcofi.o hscx.o
3758 hisax-objs-$(CONFIG_HISAX_TELEINT) += teleint.o isac.o arcofi.o hfc_2bs0.o
3759 hisax-objs-$(CONFIG_HISAX_SEDLBAUER) += sedlbauer.o isac.o arcofi.o hscx.o isar.o
3760 @@ -44,6 +41,7 @@ hisax-objs-$(CONFIG_HISAX_NETJET_U) += n
3761 hisax-objs-$(CONFIG_HISAX_HFCS) += hfcscard.o hfc_2bds0.o
3762 hisax-objs-$(CONFIG_HISAX_HFC_PCI) += hfc_pci.o
3763 hisax-objs-$(CONFIG_HISAX_HFC_SX) += hfc_sx.o
3764 +hisax-objs-$(CONFIG_HISAX_HFC_USB) += hfc_usbr.o
3765 hisax-objs-$(CONFIG_HISAX_NICCY) += niccy.o isac.o arcofi.o hscx.o
3766 hisax-objs-$(CONFIG_HISAX_ISURF) += isurf.o isac.o arcofi.o isar.o
3767 hisax-objs-$(CONFIG_HISAX_HSTSAPHIR) += saphir.o isac.o arcofi.o hscx.o
3768 @@ -51,7 +49,6 @@ hisax-objs-$(CONFIG_HISAX_BKM_A4T) += bk
3769 hisax-objs-$(CONFIG_HISAX_SCT_QUADRO) += bkm_a8.o isac.o arcofi.o hscx.o
3770 hisax-objs-$(CONFIG_HISAX_GAZEL) += gazel.o isac.o arcofi.o hscx.o
3771 hisax-objs-$(CONFIG_HISAX_W6692) += w6692.o
3772 -hisax-objs-$(CONFIG_HISAX_ENTERNOW_PCI) += enternow_pci.o amd7930_fn.o
3773 #hisax-objs-$(CONFIG_HISAX_TESTEMU) += testemu.o
3775 hisax-objs += $(sort $(hisax-objs-y))
3776 @@ -61,10 +58,9 @@ hisax-objs += $(sort $(hisax-objs-y))
3777 obj-$(CONFIG_ISDN_DRV_HISAX) += hisax.o
3778 obj-$(CONFIG_HISAX_SEDLBAUER_CS) += sedlbauer_cs.o
3779 obj-$(CONFIG_HISAX_ELSA_CS) += elsa_cs.o
3780 -obj-$(CONFIG_HISAX_AVM_A1_CS) += avma1_cs.o
3781 -obj-$(CONFIG_HISAX_ST5481) += hisax_st5481.o isdnhdlc.o
3782 -obj-$(CONFIG_HISAX_FRITZ_PCIPNP) += hisax_isac.o hisax_fcpcipnp.o
3783 -obj-$(CONFIG_USB_AUERISDN) += isdnhdlc.o
3784 +obj-$(CONFIG_HISAX_HFC_USB_CS) += hfc_usb.o
3785 +obj-$(CONFIG_HISAX_ST5481) += hisax_st5481.o
3786 +obj-$(CONFIG_HISAX_FRITZ_PCIPNP) += hisax_fcpcipnp.o hisax_isac.o
3788 CERT := $(shell md5sum -c md5sums.asc >> /dev/null;echo $$?)
3789 CFLAGS_cert.o := -DCERTIFICATION=$(CERT)
3791 +++ b/drivers/isdn/hisax/amd7930.c
3793 +/* $Id: amd7930.c,v 1.8 2001/09/24 13:22:55 kai Exp $
3795 + * HiSax ISDN driver - chip specific routines for AMD 7930
3797 + * Author Brent Baccala
3798 + * Copyright by Brent Baccala <baccala@FreeSoft.org>
3800 + * This software may be used and distributed according to the terms
3801 + * of the GNU General Public License, incorporated herein by reference.
3803 + * - Existing ISDN HiSax driver provides all the smarts
3804 + * - it compiles, runs, talks to an isolated phone switch, connects
3805 + * to a Cisco, pings go through
3806 + * - AMD 7930 support only (no DBRI yet)
3807 + * - no US NI-1 support (may not work on US phone system - untested)
3808 + * - periodic packet loss, apparently due to lost interrupts
3809 + * - ISDN sometimes freezes, requiring reboot before it will work again
3811 + * The code is unreliable enough to be consider alpha
3813 + * This file is (c) under GNU General Public License
3815 + * Advanced Micro Devices' Am79C30A is an ISDN/audio chip used in the
3816 + * SparcStation 1+. The chip provides microphone and speaker interfaces
3817 + * which provide mono-channel audio at 8K samples per second via either
3818 + * 8-bit A-law or 8-bit mu-law encoding. Also, the chip features an
3819 + * ISDN BRI Line Interface Unit (LIU), I.430 S/T physical interface,
3820 + * which performs basic D channel LAPD processing and provides raw
3821 + * B channel data. The digital audio channel, the two ISDN B channels,
3822 + * and two 64 Kbps channels to the microprocessor are all interconnected
3823 + * via a multiplexer.
3825 + * This driver interfaces to the Linux HiSax ISDN driver, which performs
3826 + * all high-level Q.921 and Q.931 ISDN functions. The file is not
3827 + * itself a hardware driver; rather it uses functions exported by
3828 + * the AMD7930 driver in the sparcaudio subsystem (drivers/sbus/audio),
3829 + * allowing the chip to be simultaneously used for both audio and ISDN data.
3830 + * The hardware driver does _no_ buffering, but provides several callbacks
3831 + * which are called during interrupt service and should therefore run quickly.
3833 + * D channel transmission is performed by passing the hardware driver the
3834 + * address and size of an skb's data area, then waiting for a callback
3835 + * to signal successful transmission of the packet. A task is then
3836 + * queued to notify the HiSax driver that another packet may be transmitted.
3838 + * D channel reception is quite simple, mainly because of:
3839 + * 1) the slow speed of the D channel - 16 kbps, and
3840 + * 2) the presence of an 8- or 32-byte (depending on chip version) FIFO
3841 + * to buffer the D channel data on the chip
3842 + * Worst case scenario of back-to-back packets with the 8 byte buffer
3843 + * at 16 kbps yields an service time of 4 ms - long enough to preclude
3844 + * the need for fancy buffering. We queue a background task that copies
3845 + * data out of the receive buffer into an skb, and the hardware driver
3846 + * simply does nothing until we're done with the receive buffer and
3847 + * reset it for a new packet.
3849 + * B channel processing is more complex, because of:
3850 + * 1) the faster speed - 64 kbps,
3851 + * 2) the lack of any on-chip buffering (it interrupts for every byte), and
3852 + * 3) the lack of any chip support for HDLC encapsulation
3854 + * The HiSax driver can put each B channel into one of three modes -
3855 + * L1_MODE_NULL (channel disabled), L1_MODE_TRANS (transparent data relay),
3856 + * and L1_MODE_HDLC (HDLC encapsulation by low-level driver).
3857 + * L1_MODE_HDLC is the most common, used for almost all "pure" digital
3858 + * data sessions. L1_MODE_TRANS is used for ISDN audio.
3860 + * HDLC B channel transmission is performed via a large buffer into
3861 + * which the skb is copied while performing HDLC bit-stuffing. A CRC
3862 + * is computed and attached to the end of the buffer, which is then
3863 + * passed to the low-level routines for raw transmission. Once
3864 + * transmission is complete, the hardware driver is set to enter HDLC
3865 + * idle by successive transmission of mark (all 1) bytes, waiting for
3866 + * the ISDN driver to prepare another packet for transmission and
3869 + * HDLC B channel reception is performed via an X-byte ring buffer
3870 + * divided into N sections of X/N bytes each. Defaults: X=256 bytes, N=4.
3871 + * As the hardware driver notifies us that each section is full, we
3872 + * hand it the next section and schedule a background task to peruse
3873 + * the received section, bit-by-bit, with an HDLC decoder. As
3874 + * packets are detected, they are copied into a large buffer while
3875 + * decoding HDLC bit-stuffing. The ending CRC is verified, and if
3876 + * it is correct, we alloc a new skb of the correct length (which we
3877 + * now know), copy the packet into it, and hand it to the upper layers.
3878 + * Optimization: for large packets, we hand the buffer (which also
3879 + * happens to be an skb) directly to the upper layer after an skb_trim,
3880 + * and alloc a new large buffer for future packets, thus avoiding a copy.
3881 + * Then we return to HDLC processing; state is saved between calls.
3885 +#define __NO_VERSION__
3887 +#include "../../sbus/audio/amd7930.h"
3889 +#include "isdnl1.h"
3890 +#include "rawhdlc.h"
3891 +#include <linux/interrupt.h>
3893 +static const char *amd7930_revision = "$Revision: 1.8 $";
3895 +#define RCV_BUFSIZE 1024 /* Size of raw receive buffer in bytes */
3896 +#define RCV_BUFBLKS 4 /* Number of blocks to divide buffer into
3897 + * (must divide RCV_BUFSIZE) */
3899 +static void Bchan_fill_fifo(struct BCState *, struct sk_buff *);
3902 +Bchan_xmt_bh(struct BCState *bcs)
3904 + struct sk_buff *skb;
3906 + if (bcs->hw.amd7930.tx_skb != NULL) {
3907 + dev_kfree_skb(bcs->hw.amd7930.tx_skb);
3908 + bcs->hw.amd7930.tx_skb = NULL;
3911 + if ((skb = skb_dequeue(&bcs->squeue))) {
3912 + Bchan_fill_fifo(bcs, skb);
3914 + clear_bit(BC_FLG_BUSY, &bcs->Flag);
3915 + bcs->event |= 1 << B_XMTBUFREADY;
3916 + queue_task(&bcs->tqueue, &tq_immediate);
3917 + mark_bh(IMMEDIATE_BH);
3922 +Bchan_xmit_callback(struct BCState *bcs)
3924 + queue_task(&bcs->hw.amd7930.tq_xmt, &tq_immediate);
3925 + mark_bh(IMMEDIATE_BH);
3928 +/* B channel transmission: two modes (three, if you count L1_MODE_NULL)
3930 + * L1_MODE_HDLC - We need to do HDLC encapsulation before transmiting
3931 + * the packet (i.e. make_raw_hdlc_data). Since this can be a
3932 + * time-consuming operation, our completion callback just schedules
3933 + * a bottom half to do encapsulation for the next packet. In between,
3934 + * the link will just idle
3936 + * L1_MODE_TRANS - Data goes through, well, transparent. No HDLC encap,
3937 + * and we can't just let the link idle, so the "bottom half" actually
3938 + * gets called during the top half (it's our callback routine in this case),
3939 + * but it's a lot faster now since we don't call make_raw_hdlc_data
3943 +Bchan_fill_fifo(struct BCState *bcs, struct sk_buff *skb)
3945 + struct IsdnCardState *cs = bcs->cs;
3948 + if ((cs->debug & L1_DEB_HSCX) || (cs->debug & L1_DEB_HSCX_FIFO)) {
3952 + t += sprintf(t, "amd7930_fill_fifo %c cnt %d",
3953 + bcs->channel ? 'B' : 'A', skb->len);
3954 + if (cs->debug & L1_DEB_HSCX_FIFO)
3955 + QuickHex(t, skb->data, skb->len);
3959 + if (bcs->mode == L1_MODE_HDLC) {
3960 + len = make_raw_hdlc_data(skb->data, skb->len,
3961 + bcs->hw.amd7930.tx_buff, RAW_BUFMAX);
3963 + amd7930_bxmit(0, bcs->channel,
3964 + bcs->hw.amd7930.tx_buff, len,
3965 + (void *) &Bchan_xmit_callback,
3967 + dev_kfree_skb(skb);
3968 + } else if (bcs->mode == L1_MODE_TRANS) {
3969 + amd7930_bxmit(0, bcs->channel,
3970 + bcs->hw.amd7930.tx_buff, skb->len,
3971 + (void *) &Bchan_xmt_bh,
3973 + bcs->hw.amd7930.tx_skb = skb;
3975 + dev_kfree_skb(skb);
3980 +Bchan_mode(struct BCState *bcs, int mode, int bc)
3982 + struct IsdnCardState *cs = bcs->cs;
3984 + if (cs->debug & L1_DEB_HSCX) {
3986 + sprintf(tmp, "AMD 7930 mode %d bchan %d/%d",
3987 + mode, bc, bcs->channel);
3993 +/* Bchan_l2l1 is the entry point for upper layer routines that want to
3994 + * transmit on the B channel. PH_DATA_REQ is a normal packet that
3995 + * we either start transmitting (if idle) or queue (if busy).
3996 + * PH_PULL_REQ can be called to request a callback message (PH_PULL_CNF)
3997 + * once the link is idle. After a "pull" callback, the upper layer
3998 + * routines can use PH_PULL_IND to send data.
4002 +Bchan_l2l1(struct PStack *st, int pr, void *arg)
4004 + struct sk_buff *skb = arg;
4007 + case (PH_DATA_REQ):
4008 + if (test_bit(BC_FLG_BUSY, &st->l1.bcs->Flag)) {
4009 + skb_queue_tail(&st->l1.bcs->squeue, skb);
4011 + test_and_set_bit(BC_FLG_BUSY, &st->l1.bcs->Flag);
4012 + Bchan_fill_fifo(st->l1.bcs, skb);
4015 + case (PH_PULL_IND):
4016 + if (test_bit(BC_FLG_BUSY, &st->l1.bcs->Flag)) {
4017 + printk(KERN_WARNING "amd7930: this shouldn't happen\n");
4020 + test_and_set_bit(BC_FLG_BUSY, &st->l1.bcs->Flag);
4021 + Bchan_fill_fifo(st->l1.bcs, skb);
4023 + case (PH_PULL_REQ):
4024 + if (!test_bit(BC_FLG_BUSY, &st->l1.bcs->Flag)) {
4025 + clear_bit(FLG_L1_PULL_REQ, &st->l1.Flags);
4026 + st->l1.l1l2(st, PH_PULL_CNF, NULL);
4028 + set_bit(FLG_L1_PULL_REQ, &st->l1.Flags);
4033 +/* Receiver callback and bottom half - decodes HDLC at leisure (if
4034 + * L1_MODE_HDLC) and passes newly received skb on via bcs->rqueue. If
4035 + * a large packet is received, stick rv_skb (the buffer that the
4036 + * packet has been decoded into) on the receive queue and alloc a new
4037 + * (large) skb to act as buffer for future receives. If a small
4038 + * packet is received, leave rv_skb alone, alloc a new skb of the
4039 + * correct size, and copy the packet into it
4043 +Bchan_recv_callback(struct BCState *bcs)
4045 + struct amd7930_hw *hw = &bcs->hw.amd7930;
4047 + hw->rv_buff_in += RCV_BUFSIZE/RCV_BUFBLKS;
4048 + hw->rv_buff_in %= RCV_BUFSIZE;
4050 + if (hw->rv_buff_in != hw->rv_buff_out) {
4051 + amd7930_brecv(0, bcs->channel,
4052 + hw->rv_buff + hw->rv_buff_in,
4053 + RCV_BUFSIZE/RCV_BUFBLKS,
4054 + (void *) &Bchan_recv_callback, (void *) bcs);
4057 + queue_task(&hw->tq_rcv, &tq_immediate);
4058 + mark_bh(IMMEDIATE_BH);
4062 +Bchan_rcv_bh(struct BCState *bcs)
4064 + struct IsdnCardState *cs = bcs->cs;
4065 + struct amd7930_hw *hw = &bcs->hw.amd7930;
4066 + struct sk_buff *skb;
4069 + if (cs->debug & L1_DEB_HSCX) {
4072 + sprintf(tmp, "amd7930_Bchan_rcv (%d/%d)",
4073 + hw->rv_buff_in, hw->rv_buff_out);
4075 + QuickHex(tmp, hw->rv_buff + hw->rv_buff_out,
4076 + RCV_BUFSIZE/RCV_BUFBLKS);
4081 + if (bcs->mode == L1_MODE_HDLC) {
4082 + while ((len = read_raw_hdlc_data(hw->hdlc_state,
4083 + hw->rv_buff + hw->rv_buff_out, RCV_BUFSIZE/RCV_BUFBLKS,
4084 + hw->rv_skb->tail, HSCX_BUFMAX))) {
4085 + if (len > 0 && (cs->debug & L1_DEB_HSCX_FIFO)) {
4089 + t += sprintf(t, "amd7930_Bchan_rcv %c cnt %d", bcs->channel ? 'B' : 'A', len);
4090 + QuickHex(t, hw->rv_skb->tail, len);
4094 + if (len > HSCX_BUFMAX/2) {
4095 + /* Large packet received */
4097 + if (!(skb = dev_alloc_skb(HSCX_BUFMAX))) {
4098 + printk(KERN_WARNING "amd7930: receive out of memory");
4100 + skb_put(hw->rv_skb, len);
4101 + skb_queue_tail(&bcs->rqueue, hw->rv_skb);
4103 + bcs->event |= 1 << B_RCVBUFREADY;
4104 + queue_task(&bcs->tqueue, &tq_immediate);
4106 + } else if (len > 0) {
4107 + /* Small packet received */
4109 + if (!(skb = dev_alloc_skb(len))) {
4110 + printk(KERN_WARNING "amd7930: receive out of memory\n");
4112 + memcpy(skb_put(skb, len), hw->rv_skb->tail, len);
4113 + skb_queue_tail(&bcs->rqueue, skb);
4114 + bcs->event |= 1 << B_RCVBUFREADY;
4115 + queue_task(&bcs->tqueue, &tq_immediate);
4116 + mark_bh(IMMEDIATE_BH);
4119 + /* Reception Error */
4120 + /* printk("amd7930: B channel receive error\n"); */
4123 + } else if (bcs->mode == L1_MODE_TRANS) {
4124 + if (!(skb = dev_alloc_skb(RCV_BUFSIZE/RCV_BUFBLKS))) {
4125 + printk(KERN_WARNING "amd7930: receive out of memory\n");
4127 + memcpy(skb_put(skb, RCV_BUFSIZE/RCV_BUFBLKS),
4128 + hw->rv_buff + hw->rv_buff_out,
4129 + RCV_BUFSIZE/RCV_BUFBLKS);
4130 + skb_queue_tail(&bcs->rqueue, skb);
4131 + bcs->event |= 1 << B_RCVBUFREADY;
4132 + queue_task(&bcs->tqueue, &tq_immediate);
4133 + mark_bh(IMMEDIATE_BH);
4137 + if (hw->rv_buff_in == hw->rv_buff_out) {
4138 + /* Buffer was filled up - need to restart receiver */
4139 + amd7930_brecv(0, bcs->channel,
4140 + hw->rv_buff + hw->rv_buff_in,
4141 + RCV_BUFSIZE/RCV_BUFBLKS,
4142 + (void *) &Bchan_recv_callback,
4146 + hw->rv_buff_out += RCV_BUFSIZE/RCV_BUFBLKS;
4147 + hw->rv_buff_out %= RCV_BUFSIZE;
4149 + } while (hw->rv_buff_in != hw->rv_buff_out);
4153 +Bchan_close(struct BCState *bcs)
4155 + struct sk_buff *skb;
4157 + Bchan_mode(bcs, 0, 0);
4158 + amd7930_bclose(0, bcs->channel);
4160 + if (test_bit(BC_FLG_INIT, &bcs->Flag)) {
4161 + skb_queue_purge(&bcs->rqueue);
4162 + skb_queue_purge(&bcs->squeue);
4164 + test_and_clear_bit(BC_FLG_INIT, &bcs->Flag);
4168 +Bchan_open(struct BCState *bcs)
4170 + struct amd7930_hw *hw = &bcs->hw.amd7930;
4172 + if (!test_and_set_bit(BC_FLG_INIT, &bcs->Flag)) {
4173 + skb_queue_head_init(&bcs->rqueue);
4174 + skb_queue_head_init(&bcs->squeue);
4176 + test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag);
4178 + amd7930_bopen(0, bcs->channel, 0xff);
4179 + hw->rv_buff_in = 0;
4180 + hw->rv_buff_out = 0;
4181 + hw->tx_skb = NULL;
4182 + init_hdlc_state(hw->hdlc_state, 0);
4183 + amd7930_brecv(0, bcs->channel,
4184 + hw->rv_buff + hw->rv_buff_in, RCV_BUFSIZE/RCV_BUFBLKS,
4185 + (void *) &Bchan_recv_callback, (void *) bcs);
4193 +Bchan_init(struct BCState *bcs)
4195 + if (!(bcs->hw.amd7930.tx_buff = kmalloc(RAW_BUFMAX, GFP_ATOMIC))) {
4196 + printk(KERN_WARNING
4197 + "HiSax: No memory for amd7930.tx_buff\n");
4200 + if (!(bcs->hw.amd7930.rv_buff = kmalloc(RCV_BUFSIZE, GFP_ATOMIC))) {
4201 + printk(KERN_WARNING
4202 + "HiSax: No memory for amd7930.rv_buff\n");
4205 + if (!(bcs->hw.amd7930.rv_skb = dev_alloc_skb(HSCX_BUFMAX))) {
4206 + printk(KERN_WARNING
4207 + "HiSax: No memory for amd7930.rv_skb\n");
4210 + if (!(bcs->hw.amd7930.hdlc_state = kmalloc(sizeof(struct hdlc_state),
4212 + printk(KERN_WARNING
4213 + "HiSax: No memory for amd7930.hdlc_state\n");
4217 + bcs->hw.amd7930.tq_rcv.sync = 0;
4218 + bcs->hw.amd7930.tq_rcv.routine = (void (*)(void *)) &Bchan_rcv_bh;
4219 + bcs->hw.amd7930.tq_rcv.data = (void *) bcs;
4221 + bcs->hw.amd7930.tq_xmt.sync = 0;
4222 + bcs->hw.amd7930.tq_xmt.routine = (void (*)(void *)) &Bchan_xmt_bh;
4223 + bcs->hw.amd7930.tq_xmt.data = (void *) bcs;
4227 +Bchan_manl1(struct PStack *st, int pr,
4231 + case (PH_ACTIVATE_REQ):
4232 + test_and_set_bit(BC_FLG_ACTIV, &st->l1.bcs->Flag);
4233 + Bchan_mode(st->l1.bcs, st->l1.mode, st->l1.bc);
4234 + st->l1.l1man(st, PH_ACTIVATE_CNF, NULL);
4236 + case (PH_DEACTIVATE_REQ):
4237 + if (!test_bit(BC_FLG_BUSY, &st->l1.bcs->Flag))
4238 + Bchan_mode(st->l1.bcs, 0, 0);
4239 + test_and_clear_bit(BC_FLG_ACTIV, &st->l1.bcs->Flag);
4245 +setstack_amd7930(struct PStack *st, struct BCState *bcs)
4247 + if (Bchan_open(bcs))
4250 + st->l2.l2l1 = Bchan_l2l1;
4251 + st->ma.manl1 = Bchan_manl1;
4252 + setstack_manager(st);
4259 +amd7930_drecv_callback(void *arg, int error, unsigned int count)
4261 + struct IsdnCardState *cs = (struct IsdnCardState *) arg;
4262 + static struct tq_struct task;
4263 + struct sk_buff *skb;
4265 + /* NOTE: This function is called directly from an interrupt handler */
4268 + if (!(skb = alloc_skb(count, GFP_ATOMIC)))
4269 + printk(KERN_WARNING "HiSax: D receive out of memory\n");
4271 + memcpy(skb_put(skb, count), cs->rcvbuf, count);
4272 + skb_queue_tail(&cs->rq, skb);
4275 + task.routine = (void *) DChannel_proc_rcv;
4276 + task.data = (void *) cs;
4277 + queue_task(&task, &tq_immediate);
4278 + mark_bh(IMMEDIATE_BH);
4281 + if (cs->debug & L1_DEB_ISAC_FIFO) {
4285 + t += sprintf(t, "amd7930 Drecv cnt %d", count);
4286 + if (error) t += sprintf(t, " ERR %x", error);
4287 + QuickHex(t, cs->rcvbuf, count);
4291 + amd7930_drecv(0, cs->rcvbuf, MAX_DFRAME_LEN,
4292 + &amd7930_drecv_callback, cs);
4296 +amd7930_dxmit_callback(void *arg, int error)
4298 + struct IsdnCardState *cs = (struct IsdnCardState *) arg;
4299 + static struct tq_struct task;
4301 + /* NOTE: This function is called directly from an interrupt handler */
4303 + /* may wish to do retransmission here, if error indicates collision */
4305 + if (cs->debug & L1_DEB_ISAC_FIFO) {
4309 + t += sprintf(t, "amd7930 Dxmit cnt %d", cs->tx_skb->len);
4310 + if (error) t += sprintf(t, " ERR %x", error);
4311 + QuickHex(t, cs->tx_skb->data, cs->tx_skb->len);
4315 + cs->tx_skb = NULL;
4317 + task.routine = (void *) DChannel_proc_xmt;
4318 + task.data = (void *) cs;
4319 + queue_task(&task, &tq_immediate);
4320 + mark_bh(IMMEDIATE_BH);
4324 +amd7930_Dchan_l2l1(struct PStack *st, int pr, void *arg)
4326 + struct IsdnCardState *cs = (struct IsdnCardState *) st->l1.hardware;
4327 + struct sk_buff *skb = arg;
4331 + case (PH_DATA_REQ):
4333 + skb_queue_tail(&cs->sq, skb);
4334 +#ifdef L2FRAME_DEBUG /* psa */
4335 + if (cs->debug & L1_DEB_LAPD)
4336 + Logl2Frame(cs, skb, "PH_DATA Queued", 0);
4339 + if ((cs->dlogflag) && (!(skb->data[2] & 1))) {
4341 + LogFrame(cs, skb->data, skb->len);
4342 + sprintf(str, "Q.931 frame user->network tei %d", st->l2.tei);
4343 + dlogframe(cs, skb->data+4, skb->len-4,
4348 +#ifdef L2FRAME_DEBUG /* psa */
4349 + if (cs->debug & L1_DEB_LAPD)
4350 + Logl2Frame(cs, skb, "PH_DATA", 0);
4352 + amd7930_dxmit(0, skb->data, skb->len,
4353 + &amd7930_dxmit_callback, cs);
4356 + case (PH_PULL_IND):
4358 + if (cs->debug & L1_DEB_WARN)
4359 + debugl1(cs, " l2l1 tx_skb exist this shouldn't happen");
4360 + skb_queue_tail(&cs->sq, skb);
4363 + if ((cs->dlogflag) && (!(skb->data[2] & 1))) { /* I-FRAME */
4364 + LogFrame(cs, skb->data, skb->len);
4365 + sprintf(str, "Q.931 frame user->network tei %d", st->l2.tei);
4366 + dlogframe(cs, skb->data + 4, skb->len - 4,
4371 +#ifdef L2FRAME_DEBUG /* psa */
4372 + if (cs->debug & L1_DEB_LAPD)
4373 + Logl2Frame(cs, skb, "PH_DATA_PULLED", 0);
4375 + amd7930_dxmit(0, cs->tx_skb->data, cs->tx_skb->len,
4376 + &amd7930_dxmit_callback, cs);
4378 + case (PH_PULL_REQ):
4379 +#ifdef L2FRAME_DEBUG /* psa */
4380 + if (cs->debug & L1_DEB_LAPD)
4381 + debugl1(cs, "-> PH_REQUEST_PULL");
4383 + if (!cs->tx_skb) {
4384 + test_and_clear_bit(FLG_L1_PULL_REQ, &st->l1.Flags);
4385 + st->l1.l1l2(st, PH_PULL_CNF, NULL);
4387 + test_and_set_bit(FLG_L1_PULL_REQ, &st->l1.Flags);
4393 +setDstack_amd7930(struct PStack *st, struct IsdnCardState *cs)
4395 + st->l2.l2l1 = amd7930_Dchan_l2l1;
4396 + if (! cs->rcvbuf) {
4397 + printk("setDstack_amd7930: No cs->rcvbuf!\n");
4399 + amd7930_drecv(0, cs->rcvbuf, MAX_DFRAME_LEN,
4400 + &amd7930_drecv_callback, cs);
4406 +manl1_msg(struct IsdnCardState *cs, int msg, void *arg) {
4407 + struct PStack *st;
4411 + st->ma.manl1(st, msg, arg);
4417 +amd7930_new_ph(struct IsdnCardState *cs)
4419 + switch (amd7930_get_liu_state(0)) {
4421 + manl1_msg(cs, PH_POWERUP_CNF, NULL);
4425 + manl1_msg(cs, PH_I4_P8_IND, NULL);
4429 + manl1_msg(cs, PH_RSYNC_IND, NULL);
4434 +/* amd7930 LIU state change callback */
4437 +amd7930_liu_callback(struct IsdnCardState *cs)
4439 + static struct tq_struct task;
4444 + if (cs->debug & L1_DEB_ISAC) {
4446 + sprintf(tmp, "amd7930_liu state %d", amd7930_get_liu_state(0));
4451 + task.routine = (void *) &amd7930_new_ph;
4452 + task.data = (void *) cs;
4453 + queue_task(&task, &tq_immediate);
4454 + mark_bh(IMMEDIATE_BH);
4458 +amd7930_l1cmd(struct IsdnCardState *cs, int msg, void *arg)
4463 + if (cs->debug & L1_DEB_ISAC) {
4465 + sprintf(tmp, "amd7930_l1cmd msg %x", msg);
4470 + case PH_RESET_REQ:
4471 + if (amd7930_get_liu_state(0) <= 3)
4472 + amd7930_liu_activate(0,0);
4474 + amd7930_liu_deactivate(0);
4476 + case PH_ENABLE_REQ:
4478 + case PH_INFO3_REQ:
4479 + amd7930_liu_activate(0,0);
4481 + case PH_TESTLOOP_REQ:
4484 + if (cs->debug & L1_DEB_WARN) {
4485 + sprintf(tmp, "amd7930_l1cmd unknown %4x", msg);
4492 +static void init_amd7930(struct IsdnCardState *cs)
4494 + Bchan_init(&cs->bcs[0]);
4495 + Bchan_init(&cs->bcs[1]);
4496 + cs->bcs[0].BC_SetStack = setstack_amd7930;
4497 + cs->bcs[1].BC_SetStack = setstack_amd7930;
4498 + cs->bcs[0].BC_Close = Bchan_close;
4499 + cs->bcs[1].BC_Close = Bchan_close;
4500 + Bchan_mode(cs->bcs, 0, 0);
4501 + Bchan_mode(cs->bcs + 1, 0, 0);
4505 +release_amd7930(struct IsdnCardState *cs)
4510 +amd7930_card_msg(struct IsdnCardState *cs, int mt, void *arg)
4515 + case CARD_RELEASE:
4516 + release_amd7930(cs);
4519 + cs->l1cmd = amd7930_l1cmd;
4520 + amd7930_liu_init(0, &amd7930_liu_callback, (void *)cs);
4530 +setup_amd7930(struct IsdnCard *card)
4532 + struct IsdnCardState *cs = card->cs;
4535 + strcpy(tmp, amd7930_revision);
4536 + printk(KERN_INFO "HiSax: AMD7930 driver Rev. %s\n", HiSax_getrev(tmp));
4537 + if (cs->typ != ISDN_CTYPE_AMD7930)
4540 + cs->irq = amd7930_get_irqnum(0);
4544 + cs->cardmsg = &amd7930_card_msg;
4548 --- a/drivers/isdn/hisax/arcofi.c
4549 +++ b/drivers/isdn/hisax/arcofi.c
4551 -/* $Id: arcofi.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4552 +/* $Id: arcofi.c,v 1.14 2001/09/24 13:22:55 kai Exp $
4554 * Ansteuerung ARCOFI 2165
4556 --- a/drivers/isdn/hisax/arcofi.h
4557 +++ b/drivers/isdn/hisax/arcofi.h
4559 -/* $Id: arcofi.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4562 * Ansteuerung ARCOFI 2165
4564 --- a/drivers/isdn/hisax/asuscom.c
4565 +++ b/drivers/isdn/hisax/asuscom.c
4567 -/* $Id: asuscom.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4568 +/* $Id: asuscom.c,v 1.14 2001/09/24 13:22:55 kai Exp $
4570 * low level stuff for ASUSCOM NETWORK INC. ISDNLink cards
4574 #define __NO_VERSION__
4575 #include <linux/init.h>
4576 -#include <linux/isapnp.h>
4582 extern const char *CardType[];
4584 -const char *Asuscom_revision = "$Revision: 1.1.4.1 $";
4585 +const char *Asuscom_revision = "$Revision: 1.14 $";
4587 #define byteout(addr,val) outb(val,addr)
4588 #define bytein(addr) inb(addr)
4589 @@ -310,27 +309,6 @@ Asus_card_msg(struct IsdnCardState *cs,
4594 -static struct isapnp_device_id asus_ids[] __initdata = {
4595 - { ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1688),
4596 - ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1688),
4597 - (unsigned long) "Asus1688 PnP" },
4598 - { ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1690),
4599 - ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1690),
4600 - (unsigned long) "Asus1690 PnP" },
4601 - { ISAPNP_VENDOR('S', 'I', 'E'), ISAPNP_FUNCTION(0x0020),
4602 - ISAPNP_VENDOR('S', 'I', 'E'), ISAPNP_FUNCTION(0x0020),
4603 - (unsigned long) "Isurf2 PnP" },
4604 - { ISAPNP_VENDOR('E', 'L', 'F'), ISAPNP_FUNCTION(0x0000),
4605 - ISAPNP_VENDOR('E', 'L', 'F'), ISAPNP_FUNCTION(0x0000),
4606 - (unsigned long) "Iscas TE320" },
4610 -static struct isapnp_device_id *adev = &asus_ids[0];
4611 -static struct pci_bus *pnp_c __devinitdata = NULL;
4615 setup_asuscom(struct IsdnCard *card)
4617 @@ -343,45 +321,7 @@ setup_asuscom(struct IsdnCard *card)
4618 printk(KERN_INFO "HiSax: Asuscom ISDNLink driver Rev. %s\n", HiSax_getrev(tmp));
4619 if (cs->typ != ISDN_CTYPE_ASUSCOM)
4622 - if (!card->para[1] && isapnp_present()) {
4623 - struct pci_bus *pb;
4624 - struct pci_dev *pd;
4626 - while(adev->card_vendor) {
4627 - if ((pb = isapnp_find_card(adev->card_vendor,
4628 - adev->card_device, pnp_c))) {
4631 - if ((pd = isapnp_find_dev(pnp_c,
4632 - adev->vendor, adev->function, pd))) {
4633 - printk(KERN_INFO "HiSax: %s detected\n",
4634 - (char *)adev->driver_data);
4636 - pd->deactivate(pd);
4638 - card->para[1] = pd->resource[0].start;
4639 - card->para[0] = pd->irq_resource[0].start;
4640 - if (!card->para[0] || !card->para[1]) {
4641 - printk(KERN_ERR "AsusPnP:some resources are missing %ld/%lx\n",
4642 - card->para[0], card->para[1]);
4643 - pd->deactivate(pd);
4648 - printk(KERN_ERR "AsusPnP: PnP error card found, no device\n");
4654 - if (!adev->card_vendor) {
4655 - printk(KERN_INFO "AsusPnP: no ISAPnP card found\n");
4662 cs->hw.asus.cfg_reg = card->para[1];
4663 cs->irq = card->para[0];
4664 --- a/drivers/isdn/hisax/avm_a1.c
4665 +++ b/drivers/isdn/hisax/avm_a1.c
4667 -/* $Id: avm_a1.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4668 +/* $Id: avm_a1.c,v 2.15 2001/09/24 13:22:55 kai Exp $
4670 * low level stuff for AVM A1 (Fritz) isdn cards
4675 extern const char *CardType[];
4676 -static const char *avm_revision = "$Revision: 1.1.4.1 $";
4677 +static const char *avm_revision = "$Revision: 2.15 $";
4679 #define AVM_A1_STAT_ISAC 0x01
4680 #define AVM_A1_STAT_HSCX 0x02
4681 --- a/drivers/isdn/hisax/avm_a1p.c
4682 +++ b/drivers/isdn/hisax/avm_a1p.c
4684 -/* $Id: avm_a1p.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4685 +/* $Id: avm_a1p.c,v 2.9 2001/09/24 13:22:55 kai Exp $
4687 * low level stuff for the following AVM cards:
4690 #define byteout(addr,val) outb(val,addr)
4691 #define bytein(addr) inb(addr)
4693 -static const char *avm_revision = "$Revision: 1.1.4.1 $";
4694 +static const char *avm_revision = "$Revision: 2.9 $";
4696 static inline u_char
4697 ReadISAC(struct IsdnCardState *cs, u_char offset)
4698 --- a/drivers/isdn/hisax/avm_pci.c
4699 +++ b/drivers/isdn/hisax/avm_pci.c
4701 -/* $Id: avm_pci.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4702 +/* $Id: avm_pci.c,v 1.29 2001/09/24 13:22:55 kai Exp $
4704 * low level stuff for AVM Fritz!PCI and ISA PnP isdn cards
4709 #include <linux/pci.h>
4710 -#include <linux/isapnp.h>
4711 +#include <linux/isdn_compat.h>
4712 #include <linux/interrupt.h>
4714 extern const char *CardType[];
4715 -static const char *avm_pci_rev = "$Revision: 1.1.4.1 $";
4716 +static const char *avm_pci_rev = "$Revision: 1.29 $";
4718 #define AVM_FRITZ_PCI 1
4719 #define AVM_FRITZ_PNP 2
4720 @@ -291,8 +291,7 @@ hdlc_empty_fifo(struct BCState *bcs, int
4721 debugl1(cs, "hdlc_empty_fifo: incoming packet too large");
4724 - p = bcs->hw.hdlc.rcvbuf + bcs->hw.hdlc.rcvidx;
4726 + ptr = (u_int *) p = bcs->hw.hdlc.rcvbuf + bcs->hw.hdlc.rcvidx;
4727 bcs->hw.hdlc.rcvidx += count;
4728 if (cs->subtyp == AVM_FRITZ_PCI) {
4729 outl(idx, cs->hw.avm.cfg_reg + 4);
4730 @@ -353,8 +352,7 @@ hdlc_fill_fifo(struct BCState *bcs)
4732 if ((cs->debug & L1_DEB_HSCX) && !(cs->debug & L1_DEB_HSCX_FIFO))
4733 debugl1(cs, "hdlc_fill_fifo %d/%ld", count, bcs->tx_skb->len);
4734 - p = bcs->tx_skb->data;
4736 + ptr = (u_int *) p = bcs->tx_skb->data;
4737 skb_pull(bcs->tx_skb, count);
4738 bcs->tx_cnt -= count;
4739 bcs->hw.hdlc.count += count;
4740 @@ -766,10 +764,6 @@ AVM_card_msg(struct IsdnCardState *cs, i
4743 static struct pci_dev *dev_avm __initdata = NULL;
4745 -static struct pci_bus *bus_avm __initdata = NULL;
4746 -static struct pci_dev *pnp_avm __initdata = NULL;
4750 setup_avm_pcipnp(struct IsdnCard *card)
4751 @@ -783,47 +777,10 @@ setup_avm_pcipnp(struct IsdnCard *card)
4752 if (cs->typ != ISDN_CTYPE_FRITZPCI)
4754 if (card->para[1]) {
4755 - /* old manual method */
4756 cs->hw.avm.cfg_reg = card->para[1];
4757 cs->irq = card->para[0];
4758 cs->subtyp = AVM_FRITZ_PNP;
4761 - if (isapnp_present()) {
4762 - struct pci_bus *ba;
4763 - if ((ba = isapnp_find_card(
4764 - ISAPNP_VENDOR('A', 'V', 'M'),
4765 - ISAPNP_FUNCTION(0x0900), bus_avm))) {
4768 - if ((pnp_avm = isapnp_find_dev(bus_avm,
4769 - ISAPNP_VENDOR('A', 'V', 'M'),
4770 - ISAPNP_FUNCTION(0x0900), pnp_avm))) {
4771 - pnp_avm->prepare(pnp_avm);
4772 - pnp_avm->deactivate(pnp_avm);
4773 - pnp_avm->activate(pnp_avm);
4774 - cs->hw.avm.cfg_reg =
4775 - pnp_avm->resource[0].start;
4777 - pnp_avm->irq_resource[0].start;
4779 - printk(KERN_ERR "FritzPnP:No IRQ\n");
4780 - pnp_avm->deactivate(pnp_avm);
4783 - if (!cs->hw.avm.cfg_reg) {
4784 - printk(KERN_ERR "FritzPnP:No IO address\n");
4785 - pnp_avm->deactivate(pnp_avm);
4788 - cs->subtyp = AVM_FRITZ_PNP;
4793 - printk(KERN_INFO "FritzPnP: no ISA PnP present\n");
4797 if (!pci_present()) {
4798 printk(KERN_ERR "FritzPCI: no PCI bus present\n");
4799 @@ -838,7 +795,7 @@ setup_avm_pcipnp(struct IsdnCard *card)
4801 if (pci_enable_device(dev_avm))
4803 - cs->hw.avm.cfg_reg = pci_resource_start(dev_avm, 1);
4804 + cs->hw.avm.cfg_reg = pci_resource_start_io(dev_avm, 1);
4805 if (!cs->hw.avm.cfg_reg) {
4806 printk(KERN_ERR "FritzPCI: No IO-Adr for PCI card found\n");
4808 @@ -854,7 +811,6 @@ setup_avm_pcipnp(struct IsdnCard *card)
4810 #endif /* CONFIG_PCI */
4813 cs->hw.avm.isac = cs->hw.avm.cfg_reg + 0x10;
4814 if (check_region((cs->hw.avm.cfg_reg), 32)) {
4816 --- a/drivers/isdn/hisax/bkm_a4t.c
4817 +++ b/drivers/isdn/hisax/bkm_a4t.c
4819 -/* $Id: bkm_a4t.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4820 +/* $Id: bkm_a4t.c,v 1.22 2001/09/24 13:22:55 kai Exp $
4822 * low level stuff for T-Berkom A4T
4827 #include <linux/pci.h>
4828 +#include <linux/isdn_compat.h>
4831 extern const char *CardType[];
4833 -const char *bkm_a4t_revision = "$Revision: 1.1.4.1 $";
4834 +const char *bkm_a4t_revision = "$Revision: 1.22 $";
4837 static inline u_char
4838 @@ -293,13 +294,13 @@ setup_bkm_a4t(struct IsdnCard *card)
4842 - sub_vendor = dev_a4t->subsystem_vendor;
4843 - sub_sys = dev_a4t->subsystem_device;
4844 + pci_get_sub_vendor(dev_a4t,sub_vendor);
4845 + pci_get_sub_system(dev_a4t,sub_sys);
4846 if ((sub_sys == PCI_DEVICE_ID_BERKOM_A4T) && (sub_vendor == PCI_VENDOR_ID_BERKOM)) {
4847 if (pci_enable_device(dev_a4t))
4850 - pci_memaddr = pci_resource_start(dev_a4t, 0);
4851 + pci_memaddr = pci_resource_start_mem(dev_a4t, 0);
4852 cs->irq = dev_a4t->irq;
4855 --- a/drivers/isdn/hisax/bkm_a8.c
4856 +++ b/drivers/isdn/hisax/bkm_a8.c
4858 -/* $Id: bkm_a8.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4859 +/* $Id: bkm_a8.c,v 1.22 2001/09/24 13:22:55 kai Exp $
4861 * low level stuff for Scitel Quadro (4*S0, passive)
4866 #include <linux/pci.h>
4867 +#include <linux/isdn_compat.h>
4873 extern const char *CardType[];
4875 -const char sct_quadro_revision[] = "$Revision: 1.1.4.1 $";
4876 +const char sct_quadro_revision[] = "$Revision: 1.22 $";
4878 static const char *sct_quadro_subtypes[] =
4880 @@ -329,13 +330,13 @@ setup_sct_quadro(struct IsdnCard *card)
4881 while ((dev_a8 = pci_find_device(PCI_VENDOR_ID_PLX,
4882 PCI_DEVICE_ID_PLX_9050, dev_a8))) {
4884 - sub_vendor_id = dev_a8->subsystem_vendor;
4885 - sub_sys_id = dev_a8->subsystem_device;
4886 + pci_get_sub_vendor(dev_a8,sub_vendor_id);
4887 + pci_get_sub_system(dev_a8,sub_sys_id);
4888 if ((sub_sys_id == PCI_DEVICE_ID_BERKOM_SCITEL_QUADRO) &&
4889 (sub_vendor_id == PCI_VENDOR_ID_BERKOM)) {
4890 if (pci_enable_device(dev_a8))
4892 - pci_ioaddr1 = pci_resource_start(dev_a8, 1);
4893 + pci_ioaddr1 = pci_resource_start_io(dev_a8, 1);
4894 pci_irq = dev_a8->irq;
4895 pci_bus = dev_a8->bus->number;
4896 pci_device_fn = dev_a8->devfn;
4897 @@ -365,7 +366,7 @@ setup_sct_quadro(struct IsdnCard *card)
4898 pci_ioaddr1 &= PCI_BASE_ADDRESS_IO_MASK;
4899 pcibios_write_config_dword(pci_bus, pci_device_fn,
4900 PCI_BASE_ADDRESS_1, pci_ioaddr1);
4901 - dev_a8->resource[ 1].start = pci_ioaddr1;
4902 + get_pcibase(dev_a8, 1) = pci_ioaddr1;
4904 #endif /* End HACK */
4906 --- a/drivers/isdn/hisax/bkm_ax.h
4907 +++ b/drivers/isdn/hisax/bkm_ax.h
4909 -/* $Id: bkm_ax.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4912 * low level decls for T-Berkom cards A4T and Scitel Quadro (4*S0, passive)
4914 --- a/drivers/isdn/hisax/callc.c
4915 +++ b/drivers/isdn/hisax/callc.c
4917 -/* $Id: callc.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4918 +/* $Id: callc.c,v 2.59 2002/02/09 21:19:11 keil Exp $
4920 * Author Karsten Keil
4921 * Copyright by Karsten Keil <keil@isdn4linux.de>
4923 #define MOD_USE_COUNT ( GET_USE_COUNT (&__this_module))
4926 -const char *lli_revision = "$Revision: 1.1.4.1 $";
4927 +const char *lli_revision = "$Revision: 2.59 $";
4929 extern struct IsdnCard cards[];
4931 @@ -145,9 +145,11 @@ enum {
4932 EV_PROCEED, /* 20 */
4935 + EV_ALERTING, /* 23 */
4936 + EV_PROCEEDING, /* 24 */
4939 -#define EVENT_COUNT (EV_REDIR + 1)
4940 +#define EVENT_COUNT (EV_PROCEEDING + 1)
4942 static char *strEvent[] =
4944 @@ -174,6 +176,8 @@ static char *strEvent[] =
4953 @@ -286,6 +290,22 @@ lli_prep_dialout(struct FsmInst *fi, int
4957 +lli_alerting(struct FsmInst *fi, int event, void *arg)
4959 + struct Channel *chanp = fi->userdata;
4961 + HL_LL(chanp, ISDN_STAT_ALERT);
4965 +lli_proceeding(struct FsmInst *fi, int event, void *arg)
4967 + struct Channel *chanp = fi->userdata;
4969 + HL_LL(chanp, ISDN_STAT_PROCEED);
4973 lli_resume(struct FsmInst *fi, int event, void *arg)
4975 struct Channel *chanp = fi->userdata;
4976 @@ -784,6 +804,8 @@ static struct FsmNode fnlist[] __initdat
4977 {ST_OUT_DIAL, EV_DISCONNECT_IND, lli_release_req},
4978 {ST_OUT_DIAL, EV_RELEASE, lli_dhup_close},
4979 {ST_OUT_DIAL, EV_NOSETUP_RSP, lli_no_setup_rsp},
4980 + {ST_OUT_DIAL, EV_PROCEEDING, lli_proceeding},
4981 + {ST_OUT_DIAL, EV_ALERTING, lli_alerting},
4982 {ST_OUT_DIAL, EV_SETUP_ERR, lli_error},
4983 {ST_IN_WAIT_LL, EV_LEASED_REL, lli_failure_l},
4984 {ST_IN_WAIT_LL, EV_ACCEPTD, lli_setup_rsp},
4985 @@ -925,7 +947,7 @@ static void stat_redir_result(struct Isd
4986 ic.driver = cs->myid;
4987 ic.command = ISDN_STAT_REDIR;
4989 - ic.parm.num[0] = result;
4990 + (ulong)(ic.parm.num[0]) = result;
4991 cs->iif.statcallb(&ic);
4992 } /* stat_redir_result */
4994 @@ -997,8 +1019,13 @@ dchan_l3l4(struct PStack *st, int pr, vo
4995 FsmEvent(&chanp->fi, EV_RELEASE, NULL);
4997 case (CC_PROCEED_SEND | INDICATION):
4999 case (CC_PROCEEDING | INDICATION):
5000 + FsmEvent(&chanp->fi, EV_PROCEEDING, NULL);
5002 case (CC_ALERTING | INDICATION):
5003 + FsmEvent(&chanp->fi, EV_ALERTING, NULL);
5005 case (CC_PROGRESS | INDICATION):
5006 case (CC_NOTIFY | INDICATION):
5008 --- a/drivers/isdn/hisax/cert.c
5009 +++ b/drivers/isdn/hisax/cert.c
5011 -/* $Id: cert.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
5012 +/* $Id: cert.c,v 2.6 2001/09/24 13:22:56 kai Exp $
5014 * Author Karsten Keil
5015 * Copyright by Karsten Keil <keil@isdn4linux.de>
5016 --- a/drivers/isdn/hisax/config.c
5017 +++ b/drivers/isdn/hisax/config.c
5019 -/* $Id: config.c,v 1.1.4.5 2001/12/09 19:19:26 kai Exp $
5020 +/* $Id: config.c,v 2.84 2002/08/13 09:55:29 keil Exp $
5022 * Author Karsten Keil
5023 * Copyright by Karsten Keil <keil@isdn4linux.de>
5025 #include <linux/kernel_stat.h>
5026 #include <linux/tqueue.h>
5027 #include <linux/interrupt.h>
5029 +#ifdef CONFIG_HISAX_HFC_USB
5030 +#include "hisax_loadable.h"
5033 #define HISAX_STATUS_BUFSIZE 4096
5034 #define INCLUDE_INLINE_FUNCS
5037 * 37 HFC 2BDS0 S+/SP p0=irq p1=iobase
5038 * 38 Travers Technologies NETspider-U PCI card
5039 * 39 HFC 2BDS0-SP PCMCIA p0=irq p1=iobase
5040 - * 40 hotplug interface
5041 - * 41 Formula-n enter:now ISDN PCI a/b none
5042 + * 40 HFC-S USB none
5044 * protocol can be either ISDN_PTYPE_EURO or ISDN_PTYPE_1TR6 or ISDN_PTYPE_NI1
5046 @@ -95,11 +99,17 @@ const char *CardType[] = {
5047 "Siemens I-Surf", "Acer P10", "HST Saphir", "Telekom A4T",
5048 "Scitel Quadro", "Gazel", "HFC 2BDS0 PCI", "Winbond 6692",
5049 "HFC 2BDS0 SX", "NETspider-U", "HFC-2BDS0-SP PCMCIA",
5050 - "Hotplug", "Formula-n enter:now PCI a/b",
5054 void HiSax_closecard(int cardnr);
5056 +#ifdef CONFIG_HISAX_HFC_USB
5057 +#define DEFAULT_CARD ISDN_CTYPE_HFC_USB
5058 +#define DEFAULT_CFG {0,0,0,0}
5059 +EXPORT_SYMBOL(hisax_register_hfcusb);
5062 #ifdef CONFIG_HISAX_ELSA
5063 #define DEFAULT_CARD ISDN_CTYPE_ELSA
5064 #define DEFAULT_CFG {0,0,0,0}
5065 @@ -339,19 +349,27 @@ EXPORT_SYMBOL(HiSax_closecard);
5069 -struct IsdnCard cards[HISAX_MAX_CARDS] = {
5070 +#define EMPTY_CARD {0, DEFAULT_PROTO, {0, 0, 0, 0}, NULL}
5072 +struct IsdnCard cards[] = {
5083 -#define HISAX_IDSIZE (HISAX_MAX_CARDS*8)
5084 -static char HiSaxID[HISAX_IDSIZE] __devinitdata = { 0, };
5085 +static char HiSaxID[64] __devinitdata = { 0, };
5087 char *HiSax_id __devinitdata = HiSaxID;
5089 /* Variables for insmod */
5090 -static int type[HISAX_MAX_CARDS] __devinitdata = { 0, };
5091 -static int protocol[HISAX_MAX_CARDS] __devinitdata = { 0, };
5092 -static int io[HISAX_MAX_CARDS] __devinitdata = { 0, };
5093 +static int type[8] __devinitdata = { 0, };
5094 +static int protocol[8] __devinitdata = { 0, };
5095 +static int io[8] __devinitdata = { 0, };
5097 #ifdef CONFIG_HISAX_16_3
5099 @@ -361,27 +379,23 @@ static int io[HISAX_MAX_CARDS] __devinit
5103 -static int io0[HISAX_MAX_CARDS] __devinitdata = { 0, };
5104 -static int io1[HISAX_MAX_CARDS] __devinitdata = { 0, };
5105 +static int io0[8] __devinitdata = { 0, };
5106 +static int io1[8] __devinitdata = { 0, };
5108 -static int irq[HISAX_MAX_CARDS] __devinitdata = { 0, };
5109 -static int mem[HISAX_MAX_CARDS] __devinitdata = { 0, };
5110 +static int irq[8] __devinitdata = { 0, };
5111 +static int mem[8] __devinitdata = { 0, };
5112 static char *id __devinitdata = HiSaxID;
5114 -#define PARM_PARA "1-" __MODULE_STRING(HISAX_MAX_CARDS) "i"
5116 -MODULE_DESCRIPTION("ISDN4Linux: Driver for passive ISDN cards");
5117 MODULE_AUTHOR("Karsten Keil");
5118 -MODULE_LICENSE("GPL");
5119 -MODULE_PARM(type, PARM_PARA);
5120 -MODULE_PARM(protocol, PARM_PARA);
5121 -MODULE_PARM(io, PARM_PARA);
5122 -MODULE_PARM(irq, PARM_PARA);
5123 -MODULE_PARM(mem, PARM_PARA);
5124 +MODULE_PARM(type, "1-8i");
5125 +MODULE_PARM(protocol, "1-8i");
5126 +MODULE_PARM(io, "1-8i");
5127 +MODULE_PARM(irq, "1-8i");
5128 +MODULE_PARM(mem, "1-8i");
5129 MODULE_PARM(id, "s");
5131 -MODULE_PARM(io0, PARM_PARA);
5132 -MODULE_PARM(io1, PARM_PARA);
5133 +MODULE_PARM(io0, "1-8i");
5134 +MODULE_PARM(io1, "1-8i");
5138 @@ -432,6 +446,7 @@ void __init HiSaxVersion(void)
5142 +#ifdef COMPAT_HAS_NEW_SETUP
5143 #define MAX_ARG (HISAX_MAX_CARDS*5)
5144 static int __init HiSax_setup(char *line)
5146 @@ -440,12 +455,16 @@ static int __init HiSax_setup(char *line
5149 str = get_options(line, MAX_ARG, ints);
5151 +void __init HiSax_setup(char *str, int *ints)
5156 printk(KERN_DEBUG "HiSax_setup: argc(%d) str(%s)\n", argc, str);
5159 while (argc && (i < HISAX_MAX_CARDS)) {
5160 - cards[i].protocol = DEFAULT_PROTO;
5162 cards[i].typ = ints[j];
5164 @@ -473,19 +492,21 @@ static int __init HiSax_setup(char *line
5168 - if (str && *str) {
5169 - if (strlen(str) < HISAX_IDSIZE)
5170 - strcpy(HiSaxID, str);
5172 - printk(KERN_WARNING "HiSax: ID too long!");
5174 + if (str && *str) {
5175 + strcpy(HiSaxID, str);
5176 + HiSax_id = HiSaxID;
5178 strcpy(HiSaxID, "HiSax");
5180 - HiSax_id = HiSaxID;
5181 + HiSax_id = HiSaxID;
5183 +#ifdef COMPAT_HAS_NEW_SETUP
5187 __setup("hisax=", HiSax_setup);
5190 +#endif /* COMPAT_HAS_NEW_SETUP */
5191 #endif /* MODULES */
5194 @@ -560,6 +581,10 @@ extern int setup_hfcs(struct IsdnCard *c
5195 extern int setup_hfcpci(struct IsdnCard *card);
5198 +#if CONFIG_HISAX_HFC_USB
5199 +extern int setup_hfc_usb(struct IsdnCard *card);
5203 extern int setup_hfcsx(struct IsdnCard *card);
5205 @@ -604,10 +629,6 @@ extern int setup_w6692(struct IsdnCard *
5206 extern int setup_netjet_u(struct IsdnCard *card);
5209 -#if CARD_FN_ENTERNOW_PCI
5210 -extern int setup_enternow_pci(struct IsdnCard *card);
5214 * Find card with given driverId
5216 @@ -899,7 +920,8 @@ static int __devinit init_card(struct Is
5220 -static int __devinit checkcard(int cardnr, char *id, int *busy_flag)
5221 +static int __devinit checkcard(int cardnr, char *id, int *busy_flag,
5226 @@ -1093,6 +1115,12 @@ static int __devinit checkcard(int cardn
5227 ret = setup_hfcsx(card);
5230 +#if CONFIG_HISAX_HFC_USB
5231 + case ISDN_CTYPE_HFC_USB:
5232 + cs->hw.hfcusb.drv = load_drv;
5233 + ret = setup_hfc_usb(card);
5237 case ISDN_CTYPE_NICCY:
5238 ret = setup_niccy(card);
5239 @@ -1143,11 +1171,6 @@ static int __devinit checkcard(int cardn
5240 ret = setup_netjet_u(card);
5243 -#if CARD_FN_ENTERNOW_PCI
5244 - case ISDN_CTYPE_ENTERNOW:
5245 - ret = setup_enternow_pci(card);
5248 case ISDN_CTYPE_DYNAMIC:
5251 @@ -1186,6 +1209,9 @@ static int __devinit checkcard(int cardn
5252 case ISDN_CTYPE_DYNAMIC:
5255 + case ISDN_CTYPE_HFC_USB:
5256 + ret = cs->cardmsg(cs, CARD_INIT, NULL);
5259 ret = init_card(cs);
5261 @@ -1257,16 +1283,13 @@ int __devinit HiSax_inithardware(int *bu
5263 sprintf(ids, "%s%d", id, i);
5265 - if (checkcard(i, ids, busy_flag)) {
5266 + if (checkcard(i, ids, busy_flag, NULL)) {
5270 - /* make sure we don't oops the module */
5271 - if (cards[i].typ > 0 && cards[i].typ <= ISDN_CTYPE_COUNT) {
5272 - printk(KERN_WARNING
5273 - "HiSax: Card %s not installed !\n",
5274 - CardType[cards[i].typ]);
5276 + printk(KERN_WARNING
5277 + "HiSax: Card %s not installed !\n",
5278 + CardType[cards[i].typ]);
5279 HiSax_shiftcards(i);
5282 @@ -1342,6 +1365,49 @@ void HiSax_reportcard(int cardnr, int se
5286 +#ifdef CONFIG_HISAX_HFC_USB
5288 +hisax_register_hfcusb(struct hisax_drvreg *l1drv)
5293 + if (l1drv->version != HISAX_LOAD_VERSION)
5296 + switch (l1drv->cmd) {
5297 + case HISAX_LOAD_CHKVER:
5298 + break; /* success */
5300 + case HISAX_LOAD_REGISTER:
5301 + for (i = 0; i < HISAX_MAX_CARDS; i++) {
5302 + if (!cards[i].typ)
5305 + if (i >= HISAX_MAX_CARDS)
5306 + return 1; /* no space */
5307 + cards[i].typ = ISDN_CTYPE_HFC_USB; /* setup type */
5308 + cards[i].protocol = DEFAULT_PROTO;
5309 + sprintf(ids, "%s%d", l1drv->drvname, i);
5310 + if (checkcard(i, ids, NULL, (void *) l1drv)) {
5315 + kfree((void *) cards[i].cs);
5316 + cards[i].cs = NULL;
5317 + cards[i].typ = 0; /* no card present */
5322 + return 1; /* unknown command */
5326 +} /* hisax_register_hfcusb */
5329 static int __init HiSax_init(void)
5332 @@ -1408,8 +1474,6 @@ static int __init HiSax_init(void)
5334 cards[j].protocol = protocol[i];
5337 - cards[j].protocol = DEFAULT_PROTO;
5340 case ISDN_CTYPE_16_0:
5341 @@ -1487,22 +1551,15 @@ static int __init HiSax_init(void)
5343 /* QUADRO is a 4 BRI card */
5344 cards[j++].para[0] = 1;
5345 - /* we need to check if further cards can be added */
5346 - if (j < HISAX_MAX_CARDS) {
5347 - cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
5348 - cards[j].protocol = protocol[i];
5349 - cards[j++].para[0] = 2;
5351 - if (j < HISAX_MAX_CARDS) {
5352 - cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
5353 - cards[j].protocol = protocol[i];
5354 - cards[j++].para[0] = 3;
5356 - if (j < HISAX_MAX_CARDS) {
5357 - cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
5358 - cards[j].protocol = protocol[i];
5359 - cards[j].para[0] = 4;
5361 + cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
5362 + cards[j].protocol = protocol[i];
5363 + cards[j++].para[0] = 2;
5364 + cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
5365 + cards[j].protocol = protocol[i];
5366 + cards[j++].para[0] = 3;
5367 + cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
5368 + cards[j].protocol = protocol[i];
5369 + cards[j].para[0] = 4;
5373 @@ -1526,10 +1583,15 @@ static int __init HiSax_init(void)
5374 nrcards, (nrcards > 1) ? "s" : "");
5376 /* Install only, if at least one card found */
5377 - if (!HiSax_inithardware(NULL))
5379 + if (!HiSax_inithardware(NULL)) {
5391 @@ -1576,8 +1638,6 @@ int elsa_init_pcmcia(void *pcm_iob, int
5392 cards[i].typ = type[i];
5394 cards[i].protocol = protocol[i];
5396 - cards[i].protocol = DEFAULT_PROTO;
5399 cards[0].para[0] = pcm_irq;
5400 @@ -1595,8 +1655,7 @@ int elsa_init_pcmcia(void *pcm_iob, int
5401 printk(KERN_DEBUG "HiSax: Total %d card%s defined\n",
5402 nrcards, (nrcards > 1) ? "s" : "");
5404 - if (!HiSax_inithardware(busy_flag))
5406 + HiSax_inithardware(busy_flag);
5407 printk(KERN_NOTICE "HiSax: module installed\n");
5410 @@ -1619,8 +1678,6 @@ int hfc_init_pcmcia(void *pcm_iob, int p
5411 cards[i].typ = type[i];
5413 cards[i].protocol = protocol[i];
5415 - cards[i].protocol = DEFAULT_PROTO;
5418 cards[0].para[0] = pcm_irq;
5419 @@ -1638,8 +1695,7 @@ int hfc_init_pcmcia(void *pcm_iob, int p
5420 printk(KERN_DEBUG "HiSax: Total %d card%s defined\n",
5421 nrcards, (nrcards > 1) ? "s" : "");
5423 - if (!HiSax_inithardware(busy_flag))
5425 + HiSax_inithardware(busy_flag);
5426 printk(KERN_NOTICE "HiSax: module installed\n");
5429 @@ -1662,8 +1718,6 @@ int sedl_init_pcmcia(void *pcm_iob, int
5430 cards[i].typ = type[i];
5432 cards[i].protocol = protocol[i];
5434 - cards[i].protocol = DEFAULT_PROTO;
5437 cards[0].para[0] = pcm_irq;
5438 @@ -1681,8 +1735,7 @@ int sedl_init_pcmcia(void *pcm_iob, int
5439 printk(KERN_DEBUG "HiSax: Total %d card%s defined\n",
5440 nrcards, (nrcards > 1) ? "s" : "");
5442 - if (!HiSax_inithardware(busy_flag))
5444 + HiSax_inithardware(busy_flag);
5445 printk(KERN_NOTICE "HiSax: module installed\n");
5448 @@ -1705,8 +1758,6 @@ int avm_a1_init_pcmcia(void *pcm_iob, in
5449 cards[i].typ = type[i];
5451 cards[i].protocol = protocol[i];
5453 - cards[i].protocol = DEFAULT_PROTO;
5456 cards[0].para[0] = pcm_irq;
5457 @@ -1724,8 +1775,7 @@ int avm_a1_init_pcmcia(void *pcm_iob, in
5458 printk(KERN_DEBUG "HiSax: Total %d card%s defined\n",
5459 nrcards, (nrcards > 1) ? "s" : "");
5461 - if (!HiSax_inithardware(busy_flag))
5463 + HiSax_inithardware(busy_flag);
5464 printk(KERN_NOTICE "HiSax: module installed\n");
5467 @@ -1743,7 +1793,7 @@ int __devinit hisax_init_pcmcia(void *pc
5468 sprintf(ids, "HiSax%d", nrcards);
5470 sprintf(ids, "HiSax");
5471 - if (!checkcard(nrcards, ids, busy_flag)) {
5472 + if (!checkcard(nrcards, ids, busy_flag, NULL)) {
5476 @@ -1785,7 +1835,7 @@ int hisax_register(struct hisax_d_if *hi
5477 cards[i].protocol = protocol;
5478 sprintf(id, "%s%d", name, i);
5480 - retval = checkcard(i, id, 0);
5481 + retval = checkcard(i, id, 0, NULL);
5482 if (retval == 0) { // yuck
5485 @@ -2117,9 +2167,6 @@ static struct pci_device_id hisax_pci_tb
5486 {PCI_VENDOR_ID_EICON, PCI_DEVICE_ID_EICON_DIVA20, PCI_ANY_ID, PCI_ANY_ID},
5487 {PCI_VENDOR_ID_EICON, PCI_DEVICE_ID_EICON_DIVA20_U, PCI_ANY_ID, PCI_ANY_ID},
5488 {PCI_VENDOR_ID_EICON, PCI_DEVICE_ID_EICON_DIVA201, PCI_ANY_ID, PCI_ANY_ID},
5489 -//#########################################################################################
5490 - {PCI_VENDOR_ID_EICON, PCI_DEVICE_ID_EICON_DIVA202, PCI_ANY_ID, PCI_ANY_ID},
5491 -//#########################################################################################
5493 #ifdef CONFIG_HISAX_ELSA
5494 {PCI_VENDOR_ID_ELSA, PCI_DEVICE_ID_ELSA_MICROLINK, PCI_ANY_ID, PCI_ANY_ID},
5495 @@ -2178,11 +2225,3 @@ MODULE_DEVICE_TABLE(pci, hisax_pci_tbl);
5497 module_init(HiSax_init);
5498 module_exit(HiSax_exit);
5500 -EXPORT_SYMBOL(FsmNew);
5501 -EXPORT_SYMBOL(FsmFree);
5502 -EXPORT_SYMBOL(FsmEvent);
5503 -EXPORT_SYMBOL(FsmChangeState);
5504 -EXPORT_SYMBOL(FsmInitTimer);
5505 -EXPORT_SYMBOL(FsmDelTimer);
5506 -EXPORT_SYMBOL(FsmRestartTimer);
5507 --- a/drivers/isdn/hisax/diva.c
5508 +++ b/drivers/isdn/hisax/diva.c
5510 -/* $Id: diva.c,v 1.1.4.2 2002/08/30 11:21:00 keil Exp $
5511 +/* $Id: diva.c,v 1.33 2001/09/24 13:22:56 kai Exp $
5513 * low level stuff for Eicon.Diehl Diva Family ISDN cards
5521 #include <linux/pci.h>
5522 -#include <linux/isapnp.h>
5523 +#include <linux/isdn_compat.h>
5525 extern const char *CardType[];
5527 -const char *Diva_revision = "$Revision: 1.1.4.2 $";
5528 +const char *Diva_revision = "$Revision: 1.33 $";
5530 #define byteout(addr,val) outb(val,addr)
5531 #define bytein(addr) inb(addr)
5532 @@ -51,7 +50,6 @@ const char *Diva_revision = "$Revision:
5534 #define DIVA_IPAC_ISA 3
5535 #define DIVA_IPAC_PCI 4
5536 -#define DIVA_IPACX_PCI 5
5539 #define DIVA_IRQ_STAT 0x01
5540 @@ -71,12 +69,10 @@ const char *Diva_revision = "$Revision:
5541 #define PITA_MISC_REG 0x1c
5543 #define PITA_PARA_SOFTRESET 0x00000001
5544 -#define PITA_SER_SOFTRESET 0x00000002
5545 #define PITA_PARA_MPX_MODE 0x00000004
5546 #define PITA_INT0_ENABLE 0x00000200
5548 #define PITA_PARA_SOFTRESET 0x01000000
5549 -#define PITA_SER_SOFTRESET 0x02000000
5550 #define PITA_PARA_MPX_MODE 0x04000000
5551 #define PITA_INT0_ENABLE 0x00020000
5553 @@ -244,47 +240,6 @@ MemWriteHSCX(struct IsdnCardState *cs, i
5554 memwritereg(cs->hw.diva.cfg_reg, offset + (hscx ? 0x40 : 0), value);
5557 -/* IO-Functions for IPACX type cards */
5559 -MemReadISAC_IPACX(struct IsdnCardState *cs, u_char offset)
5561 - return (memreadreg(cs->hw.diva.cfg_reg, offset));
5565 -MemWriteISAC_IPACX(struct IsdnCardState *cs, u_char offset, u_char value)
5567 - memwritereg(cs->hw.diva.cfg_reg, offset, value);
5571 -MemReadISACfifo_IPACX(struct IsdnCardState *cs, u_char * data, int size)
5574 - *data++ = memreadreg(cs->hw.diva.cfg_reg, 0);
5578 -MemWriteISACfifo_IPACX(struct IsdnCardState *cs, u_char * data, int size)
5581 - memwritereg(cs->hw.diva.cfg_reg, 0, *data++);
5585 -MemReadHSCX_IPACX(struct IsdnCardState *cs, int hscx, u_char offset)
5587 - return(memreadreg(cs->hw.diva.cfg_reg, offset +
5588 - (hscx ? IPACX_OFF_B2 : IPACX_OFF_B1)));
5592 -MemWriteHSCX_IPACX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value)
5594 - memwritereg(cs->hw.diva.cfg_reg, offset +
5595 - (hscx ? IPACX_OFF_B2 : IPACX_OFF_B1), value);
5599 * fast interrupt HSCX stuff goes here
5601 @@ -595,7 +550,7 @@ Memhscx_int_main(struct IsdnCardState *c
5603 struct BCState *bcs;
5605 - if (val & 0x01) { // EXB
5608 exval = MemReadHSCX(cs, 1, HSCX_EXIR);
5610 @@ -622,7 +577,7 @@ Memhscx_int_main(struct IsdnCardState *c
5611 debugl1(cs, "HSCX B interrupt %x", val);
5612 Memhscx_interrupt(cs, val, 1);
5614 - if (val & 0x02) { // EXA
5617 exval = MemReadHSCX(cs, 0, HSCX_EXIR);
5619 @@ -644,7 +599,7 @@ Memhscx_int_main(struct IsdnCardState *c
5620 } else if (cs->debug & L1_DEB_HSCX)
5621 debugl1(cs, "HSCX A EXIR %x", exval);
5623 - if (val & 0x04) { // ICA
5625 exval = MemReadHSCX(cs, 0, HSCX_ISTA);
5626 if (cs->debug & L1_DEB_HSCX)
5627 debugl1(cs, "HSCX A interrupt %x", exval);
5628 @@ -705,31 +660,12 @@ Start_IPACPCI:
5629 memwritereg(cs->hw.diva.cfg_reg, IPAC_MASK, 0xC0);
5633 -diva_irq_ipacx_pci(int intno, void *dev_id, struct pt_regs *regs)
5635 - struct IsdnCardState *cs = dev_id;
5640 - printk(KERN_WARNING "Diva: Spurious interrupt!\n");
5643 - cfg = (u_char *) cs->hw.diva.pci_cfg;
5645 - if (!(val &PITA_INT0_STATUS)) return; // other shared IRQ
5646 - interrupt_ipacx(cs); // handler for chip
5647 - *cfg = PITA_INT0_STATUS; // Reset PLX interrupt
5651 release_io_diva(struct IsdnCardState *cs)
5655 - if ((cs->subtyp == DIVA_IPAC_PCI) ||
5656 - (cs->subtyp == DIVA_IPACX_PCI) ) {
5657 + if (cs->subtyp == DIVA_IPAC_PCI) {
5658 u_int *cfg = (unsigned int *)cs->hw.diva.pci_cfg;
5660 *cfg = 0; /* disable INT0/1 */
5661 @@ -776,16 +712,6 @@ reset_diva(struct IsdnCardState *cs)
5662 set_current_state(TASK_UNINTERRUPTIBLE);
5663 schedule_timeout((10*HZ)/1000);
5664 memwritereg(cs->hw.diva.cfg_reg, IPAC_MASK, 0xc0);
5665 - } else if (cs->subtyp == DIVA_IPACX_PCI) {
5666 - unsigned int *ireg = (unsigned int *)(cs->hw.diva.pci_cfg +
5668 - *ireg = PITA_PARA_SOFTRESET | PITA_PARA_MPX_MODE;
5669 - set_current_state(TASK_UNINTERRUPTIBLE);
5670 - schedule_timeout((10*HZ)/1000);
5671 - *ireg = PITA_PARA_MPX_MODE | PITA_SER_SOFTRESET;
5672 - set_current_state(TASK_UNINTERRUPTIBLE);
5673 - schedule_timeout((10*HZ)/1000);
5674 - MemWriteISAC_IPACX(cs, IPACX_MASK, 0xff); // Interrupts off
5675 } else { /* DIVA 2.0 */
5676 cs->hw.diva.ctrl_reg = 0; /* Reset On */
5677 byteout(cs->hw.diva.ctrl, cs->hw.diva.ctrl_reg);
5678 @@ -814,9 +740,7 @@ diva_led_handler(struct IsdnCardState *c
5682 - if ((cs->subtyp == DIVA_IPAC_ISA) ||
5683 - (cs->subtyp == DIVA_IPAC_PCI) ||
5684 - (cs->subtyp == DIVA_IPACX_PCI) )
5685 + if ((cs->subtyp == DIVA_IPAC_ISA) || (cs->subtyp == DIVA_IPAC_PCI))
5687 del_timer(&cs->hw.diva.tl);
5688 if (cs->hw.diva.status & DIVA_ASSIGN)
5689 @@ -859,12 +783,6 @@ Diva_card_msg(struct IsdnCardState *cs,
5690 release_io_diva(cs);
5693 - if (cs->subtyp == DIVA_IPACX_PCI) {
5694 - ireg = (unsigned int *)cs->hw.diva.pci_cfg;
5695 - *ireg = PITA_INT0_ENABLE;
5696 - init_ipacx(cs, 3); // init chip and enable interrupts
5699 if (cs->subtyp == DIVA_IPAC_PCI) {
5700 ireg = (unsigned int *)cs->hw.diva.pci_cfg;
5701 *ireg = PITA_INT0_ENABLE;
5702 @@ -901,9 +819,7 @@ Diva_card_msg(struct IsdnCardState *cs,
5706 - if ((cs->subtyp != DIVA_IPAC_ISA) &&
5707 - (cs->subtyp != DIVA_IPAC_PCI) &&
5708 - (cs->subtyp != DIVA_IPACX_PCI) )
5709 + if ((cs->subtyp != DIVA_IPAC_ISA) && (cs->subtyp != DIVA_IPAC_PCI))
5710 diva_led_handler(cs);
5713 @@ -911,40 +827,11 @@ Diva_card_msg(struct IsdnCardState *cs,
5714 static struct pci_dev *dev_diva __initdata = NULL;
5715 static struct pci_dev *dev_diva_u __initdata = NULL;
5716 static struct pci_dev *dev_diva201 __initdata = NULL;
5717 -static struct pci_dev *dev_diva202 __initdata = NULL;
5720 -static struct isapnp_device_id diva_ids[] __initdata = {
5721 - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51),
5722 - ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51),
5723 - (unsigned long) "Diva picola" },
5724 - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51),
5725 - ISAPNP_VENDOR('E', 'I', 'C'), ISAPNP_FUNCTION(0x51),
5726 - (unsigned long) "Diva picola" },
5727 - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x71),
5728 - ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x71),
5729 - (unsigned long) "Diva 2.0" },
5730 - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x71),
5731 - ISAPNP_VENDOR('E', 'I', 'C'), ISAPNP_FUNCTION(0x71),
5732 - (unsigned long) "Diva 2.0" },
5733 - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0xA1),
5734 - ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0xA1),
5735 - (unsigned long) "Diva 2.01" },
5736 - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0xA1),
5737 - ISAPNP_VENDOR('E', 'I', 'C'), ISAPNP_FUNCTION(0xA1),
5738 - (unsigned long) "Diva 2.01" },
5742 -static struct isapnp_device_id *pdev = &diva_ids[0];
5743 -static struct pci_bus *pnp_c __devinitdata = NULL;
5748 setup_diva(struct IsdnCard *card)
5753 struct IsdnCardState *cs = card->cs;
5755 @@ -977,75 +864,8 @@ setup_diva(struct IsdnCard *card)
5756 cs->hw.diva.hscx_adr = card->para[1] + DIVA_HSCX_ADR;
5758 cs->irq = card->para[0];
5762 - if (isapnp_present()) {
5763 - struct pci_bus *pb;
5764 - struct pci_dev *pd;
5766 - while(pdev->card_vendor) {
5767 - if ((pb = isapnp_find_card(pdev->card_vendor,
5768 - pdev->card_device, pnp_c))) {
5771 - if ((pd = isapnp_find_dev(pnp_c,
5772 - pdev->vendor, pdev->function, pd))) {
5773 - printk(KERN_INFO "HiSax: %s detected\n",
5774 - (char *)pdev->driver_data);
5776 - pd->deactivate(pd);
5779 - pd->resource[0].start;
5781 - pd->irq_resource[0].start;
5782 - if (!card->para[0] || !card->para[1]) {
5783 - printk(KERN_ERR "Diva PnP:some resources are missing %ld/%lx\n",
5784 - card->para[0], card->para[1]);
5785 - pd->deactivate(pd);
5788 - cs->hw.diva.cfg_reg = card->para[1];
5789 - cs->irq = card->para[0];
5790 - if (pdev->function == ISAPNP_FUNCTION(0xA1)) {
5791 - cs->subtyp = DIVA_IPAC_ISA;
5792 - cs->hw.diva.ctrl = 0;
5793 - cs->hw.diva.isac =
5794 - card->para[1] + DIVA_IPAC_DATA;
5795 - cs->hw.diva.hscx =
5796 - card->para[1] + DIVA_IPAC_DATA;
5797 - cs->hw.diva.isac_adr =
5798 - card->para[1] + DIVA_IPAC_ADR;
5799 - cs->hw.diva.hscx_adr =
5800 - card->para[1] + DIVA_IPAC_ADR;
5801 - test_and_set_bit(HW_IPAC, &cs->HW_Flags);
5803 - cs->subtyp = DIVA_ISA;
5804 - cs->hw.diva.ctrl =
5805 - card->para[1] + DIVA_ISA_CTRL;
5806 - cs->hw.diva.isac =
5807 - card->para[1] + DIVA_ISA_ISAC_DATA;
5808 - cs->hw.diva.hscx =
5809 - card->para[1] + DIVA_HSCX_DATA;
5810 - cs->hw.diva.isac_adr =
5811 - card->para[1] + DIVA_ISA_ISAC_ADR;
5812 - cs->hw.diva.hscx_adr =
5813 - card->para[1] + DIVA_HSCX_ADR;
5817 - printk(KERN_ERR "Diva PnP: PnP error card found, no device\n");
5824 - if (!pdev->card_vendor) {
5825 - printk(KERN_INFO "Diva PnP: no ISAPnP card found\n");
5830 if (!pci_present()) {
5831 printk(KERN_ERR "Diva: no PCI bus present\n");
5832 @@ -1059,14 +879,14 @@ setup_diva(struct IsdnCard *card)
5834 cs->subtyp = DIVA_PCI;
5835 cs->irq = dev_diva->irq;
5836 - cs->hw.diva.cfg_reg = pci_resource_start(dev_diva, 2);
5837 + cs->hw.diva.cfg_reg = pci_resource_start_io(dev_diva, 2);
5838 } else if ((dev_diva_u = pci_find_device(PCI_VENDOR_ID_EICON,
5839 PCI_DEVICE_ID_EICON_DIVA20_U, dev_diva_u))) {
5840 if (pci_enable_device(dev_diva_u))
5842 cs->subtyp = DIVA_PCI;
5843 cs->irq = dev_diva_u->irq;
5844 - cs->hw.diva.cfg_reg = pci_resource_start(dev_diva_u, 2);
5845 + cs->hw.diva.cfg_reg = pci_resource_start_io(dev_diva_u, 2);
5846 } else if ((dev_diva201 = pci_find_device(PCI_VENDOR_ID_EICON,
5847 PCI_DEVICE_ID_EICON_DIVA201, dev_diva201))) {
5848 if (pci_enable_device(dev_diva201))
5849 @@ -1074,19 +894,9 @@ setup_diva(struct IsdnCard *card)
5850 cs->subtyp = DIVA_IPAC_PCI;
5851 cs->irq = dev_diva201->irq;
5852 cs->hw.diva.pci_cfg =
5853 - (ulong) ioremap(pci_resource_start(dev_diva201, 0), 4096);
5854 + (ulong) ioremap(pci_resource_start_mem(dev_diva201, 0), 4096);
5855 cs->hw.diva.cfg_reg =
5856 - (ulong) ioremap(pci_resource_start(dev_diva201, 1), 4096);
5857 - } else if ((dev_diva202 = pci_find_device(PCI_VENDOR_ID_EICON,
5858 - PCI_DEVICE_ID_EICON_DIVA202, dev_diva202))) {
5859 - if (pci_enable_device(dev_diva202))
5861 - cs->subtyp = DIVA_IPACX_PCI;
5862 - cs->irq = dev_diva202->irq;
5863 - cs->hw.diva.pci_cfg =
5864 - (ulong) ioremap(pci_resource_start(dev_diva202, 0), 4096);
5865 - cs->hw.diva.cfg_reg =
5866 - (ulong) ioremap(pci_resource_start(dev_diva202, 1), 4096);
5867 + (ulong) ioremap(pci_resource_start_mem(dev_diva201, 1), 4096);
5869 printk(KERN_WARNING "Diva: No PCI card found\n");
5871 @@ -1107,8 +917,7 @@ setup_diva(struct IsdnCard *card)
5872 printk(KERN_WARNING "Diva: unable to config DIVA PCI\n");
5874 #endif /* CONFIG_PCI */
5875 - if ((cs->subtyp == DIVA_IPAC_PCI) ||
5876 - (cs->subtyp == DIVA_IPACX_PCI) ) {
5877 + if (cs->subtyp == DIVA_IPAC_PCI) {
5878 cs->hw.diva.ctrl = 0;
5879 cs->hw.diva.isac = 0;
5880 cs->hw.diva.hscx = 0;
5881 @@ -1125,23 +934,18 @@ setup_diva(struct IsdnCard *card)
5888 "Diva: %s card configured at %#lx IRQ %d\n",
5889 (cs->subtyp == DIVA_PCI) ? "PCI" :
5890 (cs->subtyp == DIVA_ISA) ? "ISA" :
5891 - (cs->subtyp == DIVA_IPAC_ISA) ? "IPAC ISA" :
5892 - (cs->subtyp == DIVA_IPAC_PCI) ? "IPAC PCI" : "IPACX PCI",
5893 + (cs->subtyp == DIVA_IPAC_ISA) ? "IPAC ISA" : "IPAC PCI",
5894 cs->hw.diva.cfg_reg, cs->irq);
5895 - if ((cs->subtyp == DIVA_IPAC_PCI) ||
5896 - (cs->subtyp == DIVA_IPACX_PCI) ||
5897 - (cs->subtyp == DIVA_PCI) )
5898 - printk(KERN_INFO "Diva: %s space at %#lx\n",
5899 - (cs->subtyp == DIVA_PCI) ? "PCI" :
5900 - (cs->subtyp == DIVA_IPAC_PCI) ? "IPAC PCI" : "IPACX PCI",
5901 + if ((cs->subtyp == DIVA_IPAC_PCI) || (cs->subtyp == DIVA_PCI))
5902 + printk(KERN_INFO "Diva: %s PCI space at %#lx\n",
5903 + (cs->subtyp == DIVA_PCI) ? "PCI" : "IPAC PCI",
5904 cs->hw.diva.pci_cfg);
5905 - if ((cs->subtyp != DIVA_IPAC_PCI) &&
5906 - (cs->subtyp != DIVA_IPACX_PCI) ) {
5907 + if (cs->subtyp != DIVA_IPAC_PCI) {
5908 if (check_region(cs->hw.diva.cfg_reg, bytecnt)) {
5910 "HiSax: %s config port %lx-%lx already in use\n",
5911 @@ -1177,17 +981,6 @@ ready:
5912 cs->irq_func = &diva_irq_ipac_pci;
5913 val = memreadreg(cs->hw.diva.cfg_reg, IPAC_ID);
5914 printk(KERN_INFO "Diva: IPAC version %x\n", val);
5915 - } else if (cs->subtyp == DIVA_IPACX_PCI) {
5916 - cs->readisac = &MemReadISAC_IPACX;
5917 - cs->writeisac = &MemWriteISAC_IPACX;
5918 - cs->readisacfifo = &MemReadISACfifo_IPACX;
5919 - cs->writeisacfifo = &MemWriteISACfifo_IPACX;
5920 - cs->BC_Read_Reg = &MemReadHSCX_IPACX;
5921 - cs->BC_Write_Reg = &MemWriteHSCX_IPACX;
5922 - cs->BC_Send_Data = 0; // function located in ipacx module
5923 - cs->irq_func = &diva_irq_ipacx_pci;
5924 - printk(KERN_INFO "Diva: IPACX Design Id: %x\n",
5925 - MemReadISAC_IPACX(cs, IPACX_ID) &0x3F);
5926 } else { /* DIVA 2.0 */
5927 cs->hw.diva.tl.function = (void *) diva_led_handler;
5928 cs->hw.diva.tl.data = (long) cs;
5929 --- a/drivers/isdn/hisax/elsa.c
5930 +++ b/drivers/isdn/hisax/elsa.c
5932 -/* $Id: elsa.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
5933 +/* $Id: elsa.c,v 2.32 2001/09/24 13:22:56 kai Exp $
5935 * low level stuff for Elsa isdn cards
5940 #include <linux/pci.h>
5941 -#include <linux/isapnp.h>
5942 +#include <linux/isdn_compat.h>
5943 #include <linux/serial.h>
5944 #include <linux/serial_reg.h>
5946 extern const char *CardType[];
5948 -const char *Elsa_revision = "$Revision: 1.1.4.1 $";
5949 +const char *Elsa_revision = "$Revision: 2.32 $";
5950 const char *Elsa_Types[] =
5951 {"None", "PC", "PCC-8", "PCC-16", "PCF", "PCF-Pro",
5952 "PCMCIA", "QS 1000", "QS 3000", "Microlink PCI", "QS 3000 PCI",
5953 @@ -864,21 +864,6 @@ probe_elsa(struct IsdnCardState *cs)
5954 static struct pci_dev *dev_qs1000 __devinitdata = NULL;
5955 static struct pci_dev *dev_qs3000 __devinitdata = NULL;
5958 -static struct isapnp_device_id elsa_ids[] __initdata = {
5959 - { ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0133),
5960 - ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0133),
5961 - (unsigned long) "Elsa QS1000" },
5962 - { ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0134),
5963 - ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0134),
5964 - (unsigned long) "Elsa QS3000" },
5968 -static struct isapnp_device_id *pdev = &elsa_ids[0];
5969 -static struct pci_bus *pnp_c __devinitdata = NULL;
5973 setup_elsa(struct IsdnCard *card)
5975 @@ -893,7 +878,6 @@ setup_elsa(struct IsdnCard *card)
5976 cs->hw.elsa.ctrl_reg = 0;
5977 cs->hw.elsa.status = 0;
5978 cs->hw.elsa.MFlag = 0;
5980 if (cs->typ == ISDN_CTYPE_ELSA) {
5981 cs->hw.elsa.base = card->para[0];
5982 printk(KERN_INFO "Elsa: Microlink IO probing\n");
5983 @@ -955,60 +939,9 @@ setup_elsa(struct IsdnCard *card)
5986 } else if (cs->typ == ISDN_CTYPE_ELSA_PNP) {
5988 - if (!card->para[1] && isapnp_present()) {
5989 - struct pci_bus *pb;
5990 - struct pci_dev *pd;
5992 - while(pdev->card_vendor) {
5993 - if ((pb = isapnp_find_card(pdev->card_vendor,
5994 - pdev->card_device, pnp_c))) {
5997 - if ((pd = isapnp_find_dev(pnp_c,
5998 - pdev->vendor, pdev->function, pd))) {
5999 - printk(KERN_INFO "HiSax: %s detected\n",
6000 - (char *)pdev->driver_data);
6002 - pd->deactivate(pd);
6005 - pd->resource[0].start;
6007 - pd->irq_resource[0].start;
6008 - if (!card->para[0] || !card->para[1]) {
6009 - printk(KERN_ERR "Elsa PnP:some resources are missing %ld/%lx\n",
6010 - card->para[0], card->para[1]);
6011 - pd->deactivate(pd);
6014 - if (pdev->function == ISAPNP_FUNCTION(0x133))
6015 - cs->subtyp = ELSA_QS1000;
6017 - cs->subtyp = ELSA_QS3000;
6020 - printk(KERN_ERR "Elsa PnP: PnP error card found, no device\n");
6027 - if (!pdev->card_vendor) {
6028 - printk(KERN_INFO "Elsa PnP: no ISAPnP card found\n");
6033 - if (card->para[1] && card->para[0]) {
6034 - cs->hw.elsa.base = card->para[1];
6035 - cs->irq = card->para[0];
6037 - cs->subtyp = ELSA_QS1000;
6039 - printk(KERN_ERR "Elsa PnP: no parameter\n");
6041 + cs->hw.elsa.base = card->para[1];
6042 + cs->irq = card->para[0];
6043 + cs->subtyp = ELSA_QS1000;
6044 cs->hw.elsa.cfg = cs->hw.elsa.base + ELSA_CONFIG;
6045 cs->hw.elsa.ale = cs->hw.elsa.base + ELSA_ALE;
6046 cs->hw.elsa.isac = cs->hw.elsa.base + ELSA_ISAC;
6047 @@ -1058,16 +991,16 @@ setup_elsa(struct IsdnCard *card)
6049 cs->subtyp = ELSA_QS1000PCI;
6050 cs->irq = dev_qs1000->irq;
6051 - cs->hw.elsa.cfg = pci_resource_start(dev_qs1000, 1);
6052 - cs->hw.elsa.base = pci_resource_start(dev_qs1000, 3);
6053 + cs->hw.elsa.cfg = pci_resource_start_io(dev_qs1000, 1);
6054 + cs->hw.elsa.base = pci_resource_start_io(dev_qs1000, 3);
6055 } else if ((dev_qs3000 = pci_find_device(PCI_VENDOR_ID_ELSA,
6056 PCI_DEVICE_ID_ELSA_QS3000, dev_qs3000))) {
6057 if (pci_enable_device(dev_qs3000))
6059 cs->subtyp = ELSA_QS3000PCI;
6060 cs->irq = dev_qs3000->irq;
6061 - cs->hw.elsa.cfg = pci_resource_start(dev_qs3000, 1);
6062 - cs->hw.elsa.base = pci_resource_start(dev_qs3000, 3);
6063 + cs->hw.elsa.cfg = pci_resource_start_io(dev_qs3000, 1);
6064 + cs->hw.elsa.base = pci_resource_start_io(dev_qs3000, 3);
6066 printk(KERN_WARNING "Elsa: No PCI card found\n");
6068 @@ -1123,7 +1056,6 @@ setup_elsa(struct IsdnCard *card)
6073 case ELSA_QS3000PCI:
6076 --- a/drivers/isdn/hisax/elsa_cs.c
6077 +++ b/drivers/isdn/hisax/elsa_cs.c
6078 @@ -72,7 +72,7 @@ static int pc_debug = PCMCIA_DEBUG;
6079 MODULE_PARM(pc_debug, "i");
6080 #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args);
6081 static char *version =
6082 -"elsa_cs.c $Revision: 1.1.4.1 $ $Date: 2001/11/20 14:19:35 $ (K.Lichtenwalder)";
6083 +"elsa_cs.c $Revision: 1.2 $ $Date: 2001/09/24 13:22:56 $ (K.Lichtenwalder)";
6085 #define DEBUG(n, args...)
6087 --- a/drivers/isdn/hisax/elsa_ser.c
6088 +++ b/drivers/isdn/hisax/elsa_ser.c
6090 -/* $Id: elsa_ser.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6091 +/* $Id: elsa_ser.c,v 2.14 2001/09/24 13:22:56 kai Exp $
6093 * stuff for the serial modem on ELSA cards
6095 @@ -396,6 +396,74 @@ static inline void transmit_chars(struct
6100 +static inline void check_modem_status(struct IsdnCardState *cs)
6103 + struct async_struct *info = cs->hw.elsa.info;
6104 + struct async_icount *icount;
6106 + status = serial_inp(info, UART_MSR);
6108 + if (status & UART_MSR_ANY_DELTA) {
6109 + icount = &info->state->icount;
6110 + /* update input line counters */
6111 + if (status & UART_MSR_TERI)
6113 + if (status & UART_MSR_DDSR)
6115 + if (status & UART_MSR_DDCD) {
6118 + if (status & UART_MSR_DCTS)
6120 +// wake_up(&info->delta_msr_wait);
6123 + if ((info->flags & ASYNC_CHECK_CD) && (status & UART_MSR_DDCD)) {
6124 +#if (defined(SERIAL_DEBUG_OPEN) || defined(SERIAL_DEBUG_INTR))
6125 + printk("ttys%d CD now %s...", info->line,
6126 + (status & UART_MSR_DCD) ? "on" : "off");
6128 + if (status & UART_MSR_DCD)
6129 +// wake_up(&info->open_wait);
6131 + else if (!((info->flags & ASYNC_CALLOUT_ACTIVE) &&
6132 + (info->flags & ASYNC_CALLOUT_NOHUP))) {
6133 +#ifdef SERIAL_DEBUG_OPEN
6134 + printk("doing serial hangup...");
6137 + tty_hangup(info->tty);
6141 + if (info->flags & ASYNC_CTS_FLOW) {
6142 + if (info->tty->hw_stopped) {
6143 + if (status & UART_MSR_CTS) {
6144 +#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW))
6145 + printk("CTS tx start...");
6147 + info->tty->hw_stopped = 0;
6148 + info->IER |= UART_IER_THRI;
6149 + serial_outp(info, UART_IER, info->IER);
6150 +// rs_sched_event(info, RS_EVENT_WRITE_WAKEUP);
6154 + if (!(status & UART_MSR_CTS)) {
6155 +#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW))
6156 + printk("CTS tx stop...");
6158 + info->tty->hw_stopped = 1;
6159 + info->IER &= ~UART_IER_THRI;
6160 + serial_outp(info, UART_IER, info->IER);
6168 static void rs_interrupt_elsa(int irq, struct IsdnCardState *cs)
6170 --- a/drivers/isdn/hisax/fsm.c
6171 +++ b/drivers/isdn/hisax/fsm.c
6173 -/* $Id: fsm.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6176 * Finite state machine
6180 #define FSM_TIMER_DEBUG 0
6182 +EXPORT_SYMBOL(FsmNew);
6183 +EXPORT_SYMBOL(FsmFree);
6184 +EXPORT_SYMBOL(FsmEvent);
6185 +EXPORT_SYMBOL(FsmChangeState);
6186 +EXPORT_SYMBOL(FsmInitTimer);
6187 +EXPORT_SYMBOL(FsmDelTimer);
6188 +EXPORT_SYMBOL(FsmRestartTimer);
6191 FsmNew(struct Fsm *fsm, struct FsmNode *fnlist, int fncount)
6193 --- a/drivers/isdn/hisax/fsm.h
6194 +++ b/drivers/isdn/hisax/fsm.h
6196 -/* $Id: fsm.h,v 1.1.2.1 2001/11/20 14:19:35 kai Exp $
6199 * Finite state machine
6201 --- a/drivers/isdn/hisax/gazel.c
6202 +++ b/drivers/isdn/hisax/gazel.c
6204 -/* $Id: gazel.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6205 +/* $Id: gazel.c,v 2.19 2001/09/24 13:22:56 kai Exp $
6207 * low level stuff for Gazel isdn cards
6212 #include <linux/pci.h>
6213 +#include <linux/isdn_compat.h>
6215 extern const char *CardType[];
6216 -const char *gazel_revision = "$Revision: 1.1.4.1 $";
6217 +const char *gazel_revision = "$Revision: 2.19 $";
6221 @@ -563,8 +564,8 @@ setup_gazelpci(struct IsdnCardState *cs)
6222 if (pci_enable_device(dev_tel))
6224 pci_irq = dev_tel->irq;
6225 - pci_ioaddr0 = pci_resource_start(dev_tel, 1);
6226 - pci_ioaddr1 = pci_resource_start(dev_tel, 2);
6227 + pci_ioaddr0 = pci_resource_start_io(dev_tel, 1);
6228 + pci_ioaddr1 = pci_resource_start_io(dev_tel, 2);
6232 --- a/drivers/isdn/hisax/hfc_2bds0.c
6233 +++ b/drivers/isdn/hisax/hfc_2bds0.c
6235 -/* $Id: hfc_2bds0.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6236 +/* $Id: hfc_2bds0.c,v 1.18 2001/09/24 13:22:56 kai Exp $
6238 * specific routines for CCD's HFC 2BDS0
6240 @@ -616,6 +616,17 @@ hfcd_bh(struct IsdnCardState *cs)
6245 + if (test_and_clear_bit(D_CLEARBUSY, &cs->event)) {
6247 + debugl1(cs, "D-Channel Busy cleared");
6248 + stptr = cs->stlist;
6249 + while (stptr != NULL) {
6250 + stptr->l1.l1l2(stptr, PH_PAUSE | CONFIRM, NULL);
6251 + stptr = stptr->next;
6255 if (test_and_clear_bit(D_L1STATECHANGE, &cs->event)) {
6256 switch (cs->dc.hfcd.ph_state) {
6258 @@ -1090,6 +1101,32 @@ HFCD_l1hw(struct PStack *st, int pr, voi
6259 cs->hw.hfcD.mst_m |= HFCD_MASTER;
6260 cs->writeisac(cs, HFCD_MST_MODE, cs->hw.hfcD.mst_m);
6263 + case (HW_TESTLOOP | REQUEST):
6265 + if (1 & (int) arg)
6267 + if (2 & (int) arg)
6269 + if (test_bit(HW_IOM1, &cs->HW_Flags)) {
6272 + cs->writeisac(cs, ISAC_SPCR, 0xa);
6273 + cs->writeisac(cs, ISAC_ADF1, 0x2);
6275 + cs->writeisac(cs, ISAC_SPCR, val);
6276 + cs->writeisac(cs, ISAC_ADF1, 0xa);
6280 + cs->writeisac(cs, ISAC_SPCR, val);
6282 + cs->writeisac(cs, ISAC_ADF1, 0x8);
6284 + cs->writeisac(cs, ISAC_ADF1, 0x0);
6289 if (cs->debug & L1_DEB_WARN)
6290 debugl1(cs, "hfcd_l1hw unknown pr %4x", pr);
6291 @@ -1106,6 +1143,20 @@ setstack_hfcd(struct PStack *st, struct
6293 hfc_dbusy_timer(struct IsdnCardState *cs)
6296 + struct PStack *stptr;
6297 + if (test_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) {
6299 + debugl1(cs, "D-Channel Busy");
6300 + test_and_set_bit(FLG_L1_DBUSY, &cs->HW_Flags);
6301 + stptr = cs->stlist;
6303 + while (stptr != NULL) {
6304 + stptr->l1.l1l2(stptr, PH_PAUSE | INDICATION, NULL);
6305 + stptr = stptr->next;
6312 --- a/drivers/isdn/hisax/hfc_2bds0.h
6313 +++ b/drivers/isdn/hisax/hfc_2bds0.h
6315 -/* $Id: hfc_2bds0.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6316 +/* $Id: hfc_2bds0.h,v 1.6 2001/09/24 13:22:56 kai Exp $
6318 * specific defines for CCD's HFC 2BDS0
6320 --- a/drivers/isdn/hisax/hfc_2bs0.c
6321 +++ b/drivers/isdn/hisax/hfc_2bs0.c
6323 -/* $Id: hfc_2bs0.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6324 +/* $Id: hfc_2bs0.c,v 1.20 2001/09/24 13:22:56 kai Exp $
6326 * specific routines for CCD's HFC 2BS0
6328 --- a/drivers/isdn/hisax/hfc_2bs0.h
6329 +++ b/drivers/isdn/hisax/hfc_2bs0.h
6331 -/* $Id: hfc_2bs0.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6332 +/* $Id: hfc_2bs0.h,v 1.5 2001/09/24 13:22:56 kai Exp $
6334 * specific defines for CCD's HFC 2BS0
6336 --- a/drivers/isdn/hisax/hfc_pci.c
6337 +++ b/drivers/isdn/hisax/hfc_pci.c
6339 -/* $Id: hfc_pci.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6340 +/* $Id: hfc_pci.c,v 1.48 2001/09/24 13:22:56 kai Exp $
6342 * low level driver for CCD´s hfc-pci based cards
6345 #include "hfc_pci.h"
6347 #include <linux/pci.h>
6348 +#include <linux/isdn_compat.h>
6349 #include <linux/interrupt.h>
6351 extern const char *CardType[];
6353 -static const char *hfcpci_revision = "$Revision: 1.1.4.1 $";
6354 +static const char *hfcpci_revision = "$Revision: 1.48 $";
6356 /* table entry in the PCI devices list */
6358 @@ -76,8 +77,6 @@ release_io_hfcpci(struct IsdnCardState *
6360 unsigned long flags;
6362 - printk(KERN_INFO "HiSax: release hfcpci at %p\n",
6363 - cs->hw.hfcpci.pci_io);
6366 cs->hw.hfcpci.int_m2 = 0; /* interrupt output off ! */
6367 @@ -88,11 +87,13 @@ release_io_hfcpci(struct IsdnCardState *
6368 set_current_state(TASK_UNINTERRUPTIBLE);
6369 schedule_timeout((30 * HZ) / 1000); /* Timeout 30ms */
6370 Write_hfc(cs, HFCPCI_CIRM, 0); /* Reset Off */
6372 pcibios_write_config_word(cs->hw.hfcpci.pci_bus, cs->hw.hfcpci.pci_device_fn, PCI_COMMAND, 0); /* disable memory mapped ports + busmaster */
6373 +#endif /* CONFIG_PCI */
6374 del_timer(&cs->hw.hfcpci.timer);
6375 kfree(cs->hw.hfcpci.share_start);
6376 cs->hw.hfcpci.share_start = NULL;
6377 - iounmap((void *)cs->hw.hfcpci.pci_io);
6378 + vfree(cs->hw.hfcpci.pci_io);
6381 /********************************************************************************/
6382 @@ -687,10 +688,6 @@ hfcpci_fill_fifo(struct BCState *bcs)
6383 debugl1(cs, "hfcpci_fill_fifo_trans %d frame length %d discarded",
6384 bcs->channel, bcs->tx_skb->len);
6386 - if (bcs->st->lli.l1writewakeup &&
6387 - (PACKET_NOACK != bcs->tx_skb->pkt_type))
6388 - bcs->st->lli.l1writewakeup(bcs->st, bcs->tx_skb->len);
6390 dev_kfree_skb_any(bcs->tx_skb);
6392 bcs->tx_skb = skb_dequeue(&bcs->squeue); /* fetch next data */
6393 @@ -1146,6 +1143,20 @@ hfcpci_interrupt(int intno, void *dev_id
6395 hfcpci_dbusy_timer(struct IsdnCardState *cs)
6398 + struct PStack *stptr;
6399 + if (test_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) {
6401 + debugl1(cs, "D-Channel Busy");
6402 + test_and_set_bit(FLG_L1_DBUSY, &cs->HW_Flags);
6403 + stptr = cs->stlist;
6405 + while (stptr != NULL) {
6406 + stptr->l1.l1l2(stptr, PH_PAUSE | INDICATION, NULL);
6407 + stptr = stptr->next;
6413 /*************************************/
6414 @@ -1550,6 +1561,17 @@ hfcpci_bh(struct IsdnCardState *cs)
6419 + if (test_and_clear_bit(D_CLEARBUSY, &cs->event)) {
6421 + debugl1(cs, "D-Channel Busy cleared");
6422 + stptr = cs->stlist;
6423 + while (stptr != NULL) {
6424 + stptr->l1.l1l2(stptr, PH_PAUSE | CONFIRM, NULL);
6425 + stptr = stptr->next;
6429 if (test_and_clear_bit(D_L1STATECHANGE, &cs->event)) {
6430 if (!cs->hw.hfcpci.nt_mode)
6431 switch (cs->dc.hfcpci.ph_state) {
6432 @@ -1712,7 +1734,7 @@ setup_hfcpci(struct IsdnCard *card)
6433 if (pci_enable_device(tmp_hfcpci))
6435 pci_set_master(tmp_hfcpci);
6436 - if ((card->para[0]) && (card->para[0] != (tmp_hfcpci->resource[ 0].start & PCI_BASE_ADDRESS_IO_MASK)))
6437 + if ((card->para[0]) && (card->para[0] != (get_pcibase(tmp_hfcpci, 0) & PCI_BASE_ADDRESS_IO_MASK)))
6441 @@ -1729,7 +1751,7 @@ setup_hfcpci(struct IsdnCard *card)
6442 printk(KERN_WARNING "HFC-PCI: No IRQ for PCI card found\n");
6445 - cs->hw.hfcpci.pci_io = (char *) dev_hfcpci->resource[ 1].start;
6446 + cs->hw.hfcpci.pci_io = (char *) get_pcibase(dev_hfcpci, 1);
6447 printk(KERN_INFO "HiSax: HFC-PCI card manufacturer: %s card name: %s\n", id_list[i].vendor_name, id_list[i].card_name);
6449 printk(KERN_WARNING "HFC-PCI: No PCI card found\n");
6450 @@ -1746,7 +1768,7 @@ setup_hfcpci(struct IsdnCard *card)
6451 printk(KERN_WARNING "HFC-PCI: Error allocating memory for FIFO!\n");
6454 - cs->hw.hfcpci.fifos = (void *)
6455 + (ulong) cs->hw.hfcpci.fifos =
6456 (((ulong) cs->hw.hfcpci.share_start) & ~0x7FFF) + 0x8000;
6457 pcibios_write_config_dword(cs->hw.hfcpci.pci_bus,
6458 cs->hw.hfcpci.pci_device_fn, 0x80,
6459 --- a/drivers/isdn/hisax/hfc_pci.h
6460 +++ b/drivers/isdn/hisax/hfc_pci.h
6462 -/* $Id: hfc_pci.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6463 +/* $Id: hfc_pci.h,v 1.10 2001/09/24 13:22:56 kai Exp $
6465 * specific defines for CCD's HFC 2BDS0 PCI chips
6467 --- a/drivers/isdn/hisax/hfc_sx.c
6468 +++ b/drivers/isdn/hisax/hfc_sx.c
6470 -/* $Id: hfc_sx.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6471 +/* $Id: hfc_sx.c,v 1.12 2001/09/24 13:22:56 kai Exp $
6473 * level driver for CCD´s hfc-s+/sp based cards
6478 #include <linux/interrupt.h>
6479 -#include <linux/isapnp.h>
6481 extern const char *CardType[];
6483 -static const char *hfcsx_revision = "$Revision: 1.1.4.1 $";
6484 +static const char *hfcsx_revision = "$Revision: 1.12 $";
6486 /***************************************/
6487 /* IRQ-table for CCDs demo board */
6488 @@ -940,6 +939,20 @@ hfcsx_interrupt(int intno, void *dev_id,
6490 hfcsx_dbusy_timer(struct IsdnCardState *cs)
6493 + struct PStack *stptr;
6494 + if (test_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) {
6496 + debugl1(cs, "D-Channel Busy");
6497 + test_and_set_bit(FLG_L1_DBUSY, &cs->HW_Flags);
6498 + stptr = cs->stlist;
6500 + while (stptr != NULL) {
6501 + stptr->l1.l1l2(stptr, PH_PAUSE | INDICATION, NULL);
6502 + stptr = stptr->next;
6508 /*************************************/
6509 @@ -1333,6 +1346,17 @@ hfcsx_bh(struct IsdnCardState *cs)
6514 + if (test_and_clear_bit(D_CLEARBUSY, &cs->event)) {
6516 + debugl1(cs, "D-Channel Busy cleared");
6517 + stptr = cs->stlist;
6518 + while (stptr != NULL) {
6519 + stptr->l1.l1l2(stptr, PH_PAUSE | CONFIRM, NULL);
6520 + stptr = stptr->next;
6524 if (test_and_clear_bit(D_L1STATECHANGE, &cs->event)) {
6525 if (!cs->hw.hfcsx.nt_mode)
6526 switch (cs->dc.hfcsx.ph_state) {
6527 @@ -1461,17 +1485,7 @@ hfcsx_card_msg(struct IsdnCardState *cs,
6532 -static struct isapnp_device_id hfc_ids[] __initdata = {
6533 - { ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2620),
6534 - ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2620),
6535 - (unsigned long) "Teles 16.3c2" },
6539 -static struct isapnp_device_id *hdev = &hfc_ids[0];
6540 -static struct pci_bus *pnp_c __devinitdata = NULL;
6544 setup_hfcsx(struct IsdnCard *card)
6545 @@ -1482,45 +1496,6 @@ setup_hfcsx(struct IsdnCard *card)
6547 strcpy(tmp, hfcsx_revision);
6548 printk(KERN_INFO "HiSax: HFC-SX driver Rev. %s\n", HiSax_getrev(tmp));
6550 - if (!card->para[1] && isapnp_present()) {
6551 - struct pci_bus *pb;
6552 - struct pci_dev *pd;
6554 - while(hdev->card_vendor) {
6555 - if ((pb = isapnp_find_card(hdev->card_vendor,
6556 - hdev->card_device, pnp_c))) {
6559 - if ((pd = isapnp_find_dev(pnp_c,
6560 - hdev->vendor, hdev->function, pd))) {
6561 - printk(KERN_INFO "HiSax: %s detected\n",
6562 - (char *)hdev->driver_data);
6564 - pd->deactivate(pd);
6566 - card->para[1] = pd->resource[0].start;
6567 - card->para[0] = pd->irq_resource[0].start;
6568 - if (!card->para[0] || !card->para[1]) {
6569 - printk(KERN_ERR "HFC PnP:some resources are missing %ld/%lx\n",
6570 - card->para[0], card->para[1]);
6571 - pd->deactivate(pd);
6576 - printk(KERN_ERR "HFC PnP: PnP error card found, no device\n");
6582 - if (!hdev->card_vendor) {
6583 - printk(KERN_INFO "HFC PnP: no ISAPnP card found\n");
6588 cs->hw.hfcsx.base = card->para[1] & 0xfffe;
6589 cs->irq = card->para[0];
6590 cs->hw.hfcsx.int_s1 = 0;
6591 @@ -1603,3 +1578,7 @@ setup_hfcsx(struct IsdnCard *card)
6592 cs->auxcmd = &hfcsx_auxcmd;
6599 --- a/drivers/isdn/hisax/hfc_sx.h
6600 +++ b/drivers/isdn/hisax/hfc_sx.h
6602 -/* $Id: hfc_sx.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6605 * specific defines for CCD's HFC 2BDS0 S+,SP chips
6608 +++ b/drivers/isdn/hisax/hfc_usb.c
6610 +/* $Id: hfc_usb.c,v 2.3 2001/07/06 21:30:11 werner Exp $
6614 + * Author (C) 2001 Werner Cornelius (werner@isdn-development.de)
6615 + * modular driver for Colognechip HFC-USB chip
6616 + * as plugin for HiSax isdn driver
6617 + * type approval valid for HFC-S USB based TAs
6619 + * Copyright 2001 by Werner Cornelius (werner@isdn-development.de)
6621 + * This program is free software; you can redistribute it and/or modify
6622 + * it under the terms of the GNU General Public License as published by
6623 + * the Free Software Foundation; either version 2, or (at your option)
6624 + * any later version.
6626 + * This program is distributed in the hope that it will be useful,
6627 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
6628 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6629 + * GNU General Public License for more details.
6631 + * You should have received a copy of the GNU General Public License
6632 + * along with this program; if not, write to the Free Software
6633 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
6637 +#include <linux/types.h>
6638 +#include <linux/stddef.h>
6639 +#include <linux/timer.h>
6640 +#include <linux/config.h>
6641 +#include <linux/isdn_compat.h>
6642 +#include <linux/init.h>
6644 +#include <linux/module.h>
6645 +#include <linux/kernel_stat.h>
6646 +#include <linux/tqueue.h>
6647 +#include <linux/usb.h>
6648 +#include <linux/kernel.h>
6649 +#include <linux/smp_lock.h>
6650 +#include <linux/sched.h>
6651 +#include "hisax_loadable.h"
6653 +#define INCLUDE_INLINE_FUNCS
6658 +#define HFC_CTRL_TIMEOUT 5 /* 5ms timeout writing/reading regs */
6659 +#define HFC_TIMER_T3 7000 /* timeout for l1 activation timer */
6661 +#define HFCUSB_L1_STATECHANGE 0 /* L1 state changed */
6662 +#define HFCUSB_L1_DRX 1 /* D-frame received */
6663 +#define HFCUSB_L1_ERX 2 /* E-frame received */
6664 +#define HFCUSB_L1_DTX 4 /* D-frames completed */
6666 +#define MAX_BCH_SIZE 2048 /* allowed B-channel packet size */
6668 +#define HFCUSB_RX_THRESHOLD 64 /* threshold for fifo report bit rx */
6669 +#define HFCUSB_TX_THRESHOLD 64 /* threshold for fifo report bit tx */
6671 +#define HFCUSB_CHIP_ID 0x16 /* Chip ID register index */
6672 +#define HFCUSB_CIRM 0x00 /* cirm register index */
6673 +#define HFCUSB_USB_SIZE 0x07 /* int length register */
6674 +#define HFCUSB_USB_SIZE_I 0x06 /* iso length register */
6675 +#define HFCUSB_F_CROSS 0x0b /* bit order register */
6676 +#define HFCUSB_CLKDEL 0x37 /* bit delay register */
6677 +#define HFCUSB_CON_HDLC 0xfa /* channel connect register */
6678 +#define HFCUSB_HDLC_PAR 0xfb
6679 +#define HFCUSB_SCTRL 0x31 /* S-bus control register (tx) */
6680 +#define HFCUSB_SCTRL_E 0x32 /* same for E and special funcs */
6681 +#define HFCUSB_SCTRL_R 0x33 /* S-bus control register (rx) */
6682 +#define HFCUSB_F_THRES 0x0c /* threshold register */
6683 +#define HFCUSB_FIFO 0x0f /* fifo select register */
6684 +#define HFCUSB_F_USAGE 0x1a /* fifo usage register */
6685 +#define HFCUSB_MST_MODE0 0x14
6686 +#define HFCUSB_MST_MODE1 0x15
6687 +#define HFCUSB_P_DATA 0x1f
6688 +#define HFCUSB_INC_RES_F 0x0e
6689 +#define HFCUSB_STATES 0x30
6691 +#define HFCUSB_CHIPID 0x40 /* ID value of HFC-USB */
6693 +/******************/
6694 +/* fifo registers */
6695 +/******************/
6696 +#define HFCUSB_NUM_FIFOS 8 /* maximum number of fifos */
6697 +#define HFCUSB_B1_TX 0 /* index for B1 transmit bulk/int */
6698 +#define HFCUSB_B1_RX 1 /* index for B1 receive bulk/int */
6699 +#define HFCUSB_B2_TX 2
6700 +#define HFCUSB_B2_RX 3
6701 +#define HFCUSB_D_TX 4
6702 +#define HFCUSB_D_RX 5
6703 +#define HFCUSB_PCM_TX 6
6704 +#define HFCUSB_PCM_RX 7
6709 +#define LED_DRIVER 0x1
6711 +#define LED_BCH 0x4
6716 +#define Write_hfc(a,b,c) usb_control_msg((a)->dev,(a)->ctrl_out_pipe,0,0x40,(c),(b),0,0,HFC_CTRL_TIMEOUT)
6717 +#define Read_hfc(a,b,c) usb_control_msg((a)->dev,(a)->ctrl_in_pipe,1,0xC0,0,(b),(c),1,HFC_CTRL_TIMEOUT)
6719 +#ifdef COMPAT_HAS_USB_IDTAB
6720 +/****************************************/
6721 +/* data defining the devices to be used */
6722 +/****************************************/
6723 +static __devinitdata const struct usb_device_id hfc_usb_idtab[3] = {
6724 + {USB_DEVICE(0x959, 0x2bd0)}, /* Colognechip ROM */
6725 + {USB_DEVICE(0x7b0, 0x0006)}, /* USB TA 128 */
6726 + {} /* end with an all-zeroes entry */
6730 +/*************************************************/
6731 +/* entry and size of output/input control buffer */
6732 +/*************************************************/
6733 +#define HFC_CTRL_BUFSIZE 32
6735 + __u8 hfc_reg; /* register number */
6736 + __u8 reg_val; /* value to be written (or read) */
6739 +/***************************************************************/
6740 +/* structure defining input+output fifos (interrupt/bulk mode) */
6741 +/***************************************************************/
6742 +struct hfcusb_data; /* forward definition */
6744 + int fifonum; /* fifo index attached to this structure */
6745 + __u8 fifo_mask; /* mask for this fifo */
6746 + int active; /* fifo is currently active */
6747 + struct hfcusb_data *hfc; /* pointer to main structure */
6748 + int pipe; /* address of endpoint */
6749 + __u8 usb_maxlen; /* maximum length for usb transfer */
6750 + int max_size; /* maximum size of receive/send packet */
6751 + int transmode; /* transparent mode selected */
6752 + int framenum; /* number of frame when last tx completed */
6753 + int rx_offset; /* offset inside rx buffer */
6754 + int next_complete; /* complete marker */
6755 + __u8 *act_ptr; /* pointer to next data */
6756 + __u8 intervall; /* interrupt interval */
6757 + struct sk_buff *buff; /* actual used buffer */
6758 + urb_t urb; /* transfer structure for usb routines */
6759 + __u8 buffer[128]; /* buffer incoming/outgoing data */
6762 +/*********************************************/
6763 +/* structure holding all data for one device */
6764 +/*********************************************/
6765 +typedef struct hfcusb_data {
6766 + struct hisax_drvreg regd; /* register data and callbacks */
6767 + struct usb_device *dev; /* our device */
6768 + int if_used; /* used interface number */
6769 + int alt_used; /* used alternate config */
6770 + int ctrl_paksize; /* control pipe packet size */
6771 + int ctrl_in_pipe, ctrl_out_pipe; /* handles for control pipe */
6773 + /* control pipe background handling */
6774 + ctrl_buft ctrl_buff[HFC_CTRL_BUFSIZE]; /* buffer holding queued data */
6775 + volatile int ctrl_in_idx, ctrl_out_idx, ctrl_cnt; /* input/output pointer + count */
6776 + urb_t ctrl_urb; /* transfer structure for control channel */
6777 + devrequest ctrl_write; /* buffer for control write request */
6778 + devrequest ctrl_read; /* same for read request */
6780 + volatile __u8 dfifo_fill; /* value read from tx d-fifo */
6781 + volatile __u8 active_fifos; /* fifos currently active as bit mask */
6782 + volatile __u8 threshold_mask; /* threshold actually reported */
6783 + volatile __u8 service_request; /* fifo needs service from task */
6784 + volatile __u8 ctrl_fifo; /* last selected fifo */
6785 + volatile __u8 bch_enables; /* or mask for sctrl_r and sctrl register values */
6786 + volatile __u8 led_req; /* request status of adapters leds */
6787 + volatile __u8 led_act; /* active status of adapters leds */
6788 + usb_fifo fifos[HFCUSB_NUM_FIFOS]; /* structure holding all fifo data */
6790 + /* layer 1 activation/deactivation handling */
6791 + volatile __u8 l1_state; /* actual l1 state */
6792 + volatile ulong l1_event; /* event mask */
6793 + struct tq_struct l1_tq; /* l1 bh structure */
6794 + struct timer_list t3_timer; /* timer for activation/deactivation */
6795 + struct timer_list t4_timer; /* timer for activation/deactivation */
6800 +usb_dump_urb(purb_t purb)
6802 + printk("urb :%p\n", purb);
6803 + printk("next :%p\n", purb->next);
6804 + printk("dev :%p\n", purb->dev);
6805 + printk("pipe :%08X\n", purb->pipe);
6806 + printk("status :%d\n", purb->status);
6807 + printk("transfer_flags :%08X\n", purb->transfer_flags);
6808 + printk("transfer_buffer :%p\n", purb->transfer_buffer);
6809 + printk("transfer_buffer_length:%d\n",
6810 + purb->transfer_buffer_length);
6811 + printk("actual_length :%d\n", purb->actual_length);
6812 + printk("setup_packet :%p\n", purb->setup_packet);
6813 + printk("start_frame :%d\n", purb->start_frame);
6814 + printk("number_of_packets :%d\n", purb->number_of_packets);
6815 + printk("interval :%d\n", purb->interval);
6816 + printk("error_count :%d\n", purb->error_count);
6817 + printk("context :%p\n", purb->context);
6818 + printk("complete :%p\n", purb->complete);
6822 +/*************************************************************************/
6823 +/* bottom half handler for L1 activation/deactiavtaion + D-chan + E-chan */
6824 +/*************************************************************************/
6826 +usb_l1d_bh(hfcusb_data * hfc)
6829 + while (hfc->l1_event) {
6830 + if (test_and_clear_bit
6831 + (HFCUSB_L1_STATECHANGE, &hfc->l1_event)) {
6832 + if (hfc->l1_state == 7)
6833 + hfc->led_req |= LED_L1;
6835 + hfc->led_req &= ~LED_L1;
6836 + if ((hfc->l1_state == 7) ||
6837 + (hfc->l1_state == 3))
6838 + hfc->regd.dch_l1l2(hfc->regd.arg_hisax,
6840 + 7) ? (PH_ACTIVATE |
6842 + : (PH_DEACTIVATE | INDICATION),
6845 + if (test_and_clear_bit(HFCUSB_L1_DRX, &hfc->l1_event)) {
6846 + hfc->regd.dch_l1l2(hfc->regd.arg_hisax,
6847 + PH_DATA | INDICATION,
6850 + if (test_and_clear_bit(HFCUSB_L1_ERX, &hfc->l1_event)) {
6851 + hfc->regd.dch_l1l2(hfc->regd.arg_hisax,
6852 + PH_DATA | INDICATION,
6855 + if (test_and_clear_bit(HFCUSB_L1_DTX, &hfc->l1_event)) {
6856 + hfc->regd.dch_l1l2(hfc->regd.arg_hisax,
6857 + PH_DATA | CONFIRM, NULL);
6862 +/******************************************************/
6863 +/* start next background transfer for control channel */
6864 +/******************************************************/
6866 +ctrl_start_transfer(hfcusb_data * hfc)
6869 + if (hfc->ctrl_cnt) {
6870 + switch (hfc->ctrl_buff[hfc->ctrl_out_idx].hfc_reg) {
6871 + case HFCUSB_F_USAGE:
6872 + hfc->ctrl_urb.pipe = hfc->ctrl_in_pipe;
6873 + hfc->ctrl_urb.setup_packet =
6874 + (u_char *) & hfc->ctrl_read;
6875 + hfc->ctrl_urb.transfer_buffer_length = 1;
6876 + hfc->ctrl_read.index =
6877 + hfc->ctrl_buff[hfc->ctrl_out_idx].
6879 + hfc->ctrl_urb.transfer_buffer =
6880 + (char *) &hfc->dfifo_fill;
6883 + default: /* write register */
6884 + hfc->ctrl_urb.pipe = hfc->ctrl_out_pipe;
6885 + hfc->ctrl_urb.setup_packet =
6886 + (u_char *) & hfc->ctrl_write;
6887 + hfc->ctrl_urb.transfer_buffer = NULL;
6888 + hfc->ctrl_urb.transfer_buffer_length = 0;
6889 + hfc->ctrl_write.index =
6890 + hfc->ctrl_buff[hfc->ctrl_out_idx].
6892 + hfc->ctrl_write.value =
6893 + hfc->ctrl_buff[hfc->ctrl_out_idx].
6897 + usb_submit_urb(&hfc->ctrl_urb); /* start transfer */
6899 +} /* ctrl_start_transfer */
6901 +/************************************/
6902 +/* queue a control transfer request */
6903 +/* return 0 on success. */
6904 +/************************************/
6906 +queue_control_request(hfcusb_data * hfc, __u8 reg, __u8 val)
6910 + if (hfc->ctrl_cnt >= HFC_CTRL_BUFSIZE)
6911 + return (1); /* no space left */
6912 + buf = hfc->ctrl_buff + hfc->ctrl_in_idx; /* pointer to new index */
6913 + buf->hfc_reg = reg;
6914 + buf->reg_val = val;
6915 + if (++hfc->ctrl_in_idx >= HFC_CTRL_BUFSIZE)
6916 + hfc->ctrl_in_idx = 0; /* pointer wrap */
6917 + if (++hfc->ctrl_cnt == 1)
6918 + ctrl_start_transfer(hfc);
6920 +} /* queue_control_request */
6922 +/**************************************/
6923 +/* called when timer t3 or t4 expires */
6924 +/**************************************/
6926 +l1_timer_expire(hfcusb_data * hfc)
6928 + if (timer_pending(&hfc->t4_timer))
6929 + del_timer(&hfc->t4_timer);
6930 + queue_control_request(hfc, HFCUSB_STATES, 0x40);
6931 + test_and_set_bit(HFCUSB_L1_STATECHANGE,
6933 + queue_task(&hfc->l1_tq, &tq_immediate);
6934 + mark_bh(IMMEDIATE_BH);
6935 +} /* l1_timer_expire */
6937 +/**************************************************/
6938 +/* (re)fills a tx-fifo urb. Queuing is done later */
6939 +/**************************************************/
6941 +fill_tx_urb(usb_fifo * fifo)
6943 + struct sk_buff *skb;
6947 + fifo->urb.dev = fifo->hfc->dev;
6949 + && (fifo->urb.transfer_buffer_length < fifo->usb_maxlen)) {
6950 + switch (fifo->fifonum) {
6951 + case HFCUSB_B1_TX:
6952 + case HFCUSB_B2_TX:
6954 + fifo->buff = NULL;
6955 + fifo->hfc->regd.bch_l1l2(fifo->hfc->regd.
6963 + fifo->hfc->service_request |=
6967 + dev_kfree_skb_any(fifo->buff);
6968 + fifo->buff = NULL;
6969 + save_flags(flags);
6971 + fifo->hfc->dfifo_fill = 0xff; /* currently invalid data */
6972 + queue_control_request(fifo->hfc,
6975 + queue_control_request(fifo->hfc,
6976 + HFCUSB_F_USAGE, 0);
6977 + restore_flags(flags);
6980 + return; /* error, invalid fifo */
6984 + /* check if new buffer needed */
6985 + if (!fifo->buff) {
6986 + switch (fifo->fifonum) {
6987 + case HFCUSB_B1_TX:
6988 + if (fifo->hfc->regd.bsk[0])
6989 + fifo->buff = *fifo->hfc->regd.bsk[0]; /* B1-channel tx buffer */
6991 + case HFCUSB_B2_TX:
6992 + if (fifo->hfc->regd.bsk[1])
6993 + fifo->buff = *fifo->hfc->regd.bsk[1]; /* B2-channel tx buffer */
6996 + if (fifo->hfc->regd.dsq)
6997 + fifo->buff = skb_dequeue(fifo->hfc->regd.dsq); /* D-channel tx queue */
7000 + return; /* error, invalid fifo */
7002 + if (!fifo->buff) {
7003 + fifo->active = 0; /* we are inactive now */
7004 + fifo->hfc->active_fifos &= ~fifo->fifo_mask;
7005 + if (fifo->fifonum == HFCUSB_D_TX) {
7006 + test_and_set_bit(HFCUSB_L1_DTX,
7007 + &fifo->hfc->l1_event);
7008 + queue_task(&fifo->hfc->l1_tq,
7010 + mark_bh(IMMEDIATE_BH);
7014 + fifo->act_ptr = fifo->buff->data; /* start of data */
7017 + fifo->hfc->active_fifos |= fifo->fifo_mask;
7018 + fifo->hfc->service_request &= ~fifo->fifo_mask;
7020 + /* fillup the send buffer */
7021 + i = fifo->buff->len - (fifo->act_ptr - fifo->buff->data); /* remaining length */
7022 + fifo->buffer[0] = !fifo->transmode; /* not eof */
7023 + if (i > (fifo->usb_maxlen - ii)) {
7024 + i = fifo->usb_maxlen - ii;
7027 + memcpy(fifo->buffer + ii, fifo->act_ptr, i);
7028 + fifo->urb.transfer_buffer_length = i + ii;
7029 + fifo->rx_offset = ii;
7030 +} /* fill_tx_urb */
7032 +/************************************************/
7033 +/* transmit completion routine for all tx fifos */
7034 +/************************************************/
7036 +tx_complete(purb_t urb)
7038 + usb_fifo *fifo = (usb_fifo *) urb->context; /* pointer to our fifo */
7040 + fifo->hfc->service_request &= ~fifo->fifo_mask; /* no further handling */
7041 + fifo->framenum = usb_get_current_frame_number(fifo->hfc->dev);
7043 + /* check for deactivation or error */
7044 + if ((!fifo->active) || (urb->status)) {
7045 + fifo->hfc->active_fifos &= ~fifo->fifo_mask; /* we are inactive */
7047 + if ((fifo->buff) && (fifo->fifonum == HFCUSB_D_TX)) {
7048 + dev_kfree_skb_any(fifo->buff);
7050 + fifo->buff = NULL;
7053 + fifo->act_ptr += (urb->transfer_buffer_length - fifo->rx_offset); /* adjust pointer */
7054 + fill_tx_urb(fifo); /* refill the urb */
7055 + fifo->hfc->threshold_mask |= fifo->fifo_mask; /* assume threshold reached */
7057 + fifo->hfc->service_request |= fifo->fifo_mask; /* need to restart */
7058 +} /* tx_complete */
7060 +/***********************************************/
7061 +/* receive completion routine for all rx fifos */
7062 +/***********************************************/
7064 +rx_complete(purb_t urb)
7066 + usb_fifo *fifo = (usb_fifo *) urb->context; /* pointer to our fifo */
7067 + hfcusb_data *hfc = fifo->hfc;
7070 + int i, ii, currcnt, hdlci;
7071 + struct sk_buff *skb;
7073 + urb->dev = hfc->dev; /* security init */
7074 + if ((!fifo->active) || (urb->status)) {
7075 + hfc->service_request &= ~fifo->fifo_mask; /* no further handling */
7076 + hfc->active_fifos &= ~fifo->fifo_mask; /* we are inactive */
7077 + fifo->urb.interval = 0; /* cancel automatic rescheduling */
7079 + dev_kfree_skb_any(fifo->buff);
7080 + fifo->buff = NULL;
7085 + /* first check for any status changes */
7086 + if ((urb->actual_length < fifo->rx_offset)
7087 + || (urb->actual_length > fifo->usb_maxlen))
7088 + return; /* error condition */
7090 + if (fifo->rx_offset) {
7091 + hfc->threshold_mask = fifo->buffer[1]; /* update threshold status */
7092 + fifo->next_complete = fifo->buffer[0] & 1;
7093 + if ((fifo->fifonum == HFCUSB_D_RX) &&
7094 + (hfc->led_req != hfc->led_act))
7095 + queue_control_request(hfc, HFCUSB_P_DATA, hfc->led_req);
7097 + /* check if rescheduling needed */
7099 + hfc->service_request & hfc->active_fifos & ~hfc->
7100 + threshold_mask)) {
7102 + usb_get_current_frame_number(hfc->dev);
7103 + txfifo = hfc->fifos + HFCUSB_B1_TX;
7106 + if ((i & txfifo->fifo_mask)
7107 + && (currcnt != txfifo->framenum)) {
7108 + hfc->service_request &=
7109 + ~txfifo->fifo_mask;
7110 + if (!txfifo->buff)
7111 + fill_tx_urb(txfifo);
7113 + usb_submit_urb(&txfifo->
7120 + /* handle l1 events */
7121 + if ((fifo->buffer[0] >> 4) != hfc->l1_state) {
7122 + last_state = hfc->l1_state;
7123 + hfc->l1_state = fifo->buffer[0] >> 4; /* update status */
7124 + if (timer_pending(&hfc->t4_timer))
7125 + del_timer(&hfc->t4_timer);
7126 + if (((hfc->l1_state == 3) &&
7127 + ((last_state == 7) ||
7128 + (last_state == 8))) ||
7129 + ((timer_pending(&hfc->t3_timer) &&
7130 + (hfc->l1_state == 8)))) {
7131 + hfc->t4_timer.expires = jiffies + 2;
7132 + add_timer(&hfc->t4_timer);
7134 + if (timer_pending(&hfc->t3_timer)
7135 + && (hfc->l1_state == 7))
7136 + del_timer(&hfc->t3_timer); /* no longer needed */
7137 + test_and_set_bit(HFCUSB_L1_STATECHANGE,
7139 + queue_task(&hfc->l1_tq, &tq_immediate);
7140 + mark_bh(IMMEDIATE_BH);
7145 + /* check the length for data and move if present */
7146 + if (fifo->next_complete || (urb->actual_length > fifo->rx_offset)) {
7147 + i = fifo->buff->len + urb->actual_length - fifo->rx_offset; /* new total length */
7148 + hdlci = (fifo->transmode) ? 0 : 3;
7149 + if (i <= (fifo->max_size + hdlci)) {
7150 + memcpy(fifo->act_ptr,
7151 + fifo->buffer + fifo->rx_offset,
7152 + urb->actual_length - fifo->rx_offset);
7154 + (urb->actual_length - fifo->rx_offset);
7155 + fifo->buff->len +=
7156 + (urb->actual_length - fifo->rx_offset);
7158 + fifo->buff->len = fifo->max_size + 4; /* mark frame as to long */
7159 + if (fifo->next_complete && (urb->actual_length < fifo->usb_maxlen)) {
7160 + /* the frame is complete */
7161 + fifo->next_complete = 0;
7162 + if (((!*(fifo->act_ptr - 1)) || fifo->transmode) &&
7163 + (fifo->buff->len >= (hdlci + 1))
7164 + && (fifo->buff->len <=
7165 + (fifo->max_size + hdlci)) &&
7166 + ((skb = dev_alloc_skb(fifo->max_size + hdlci)) != NULL)) {
7167 + fifo->buff->len -= hdlci; /* adjust size */
7168 + switch (fifo->fifonum) {
7170 + skb_queue_tail(hfc->regd.
7176 + queue_task(&hfc->l1_tq,
7178 + mark_bh(IMMEDIATE_BH);
7181 + case HFCUSB_B1_RX:
7182 + if (hfc->regd.brq[0]) {
7203 + case HFCUSB_B2_RX:
7204 + if (hfc->regd.brq[1]) {
7226 + case HFCUSB_PCM_RX:
7227 + skb_queue_tail(&hfc->regd.
7233 + queue_task(&hfc->l1_tq,
7235 + mark_bh(IMMEDIATE_BH);
7239 + dev_kfree_skb_any(fifo->
7245 + fifo->buff->len = 0; /* reset counter */
7246 + fifo->act_ptr = fifo->buff->data; /* and pointer */
7249 + fifo->rx_offset = (urb->actual_length < fifo->usb_maxlen) ? 2 : 0;
7250 +} /* rx_complete */
7252 +/***************************************************/
7253 +/* start the interrupt transfer for the given fifo */
7254 +/***************************************************/
7256 +start_rx_fifo(usb_fifo * fifo)
7259 + return; /* still active */
7262 + dev_alloc_skb(fifo->max_size + (fifo->transmode ? 0 : 3))))
7264 + fifo->act_ptr = fifo->buff->data;
7265 + FILL_INT_URB(&fifo->urb, fifo->hfc->dev, fifo->pipe, fifo->buffer,
7266 + fifo->usb_maxlen, rx_complete, fifo, fifo->intervall);
7267 + fifo->next_complete = 0;
7268 + fifo->rx_offset = 2;
7269 + fifo->active = 1; /* must be marked active */
7270 + fifo->hfc->active_fifos |= fifo->fifo_mask;
7271 + if (usb_submit_urb(&fifo->urb)) {
7273 + fifo->hfc->active_fifos &= ~fifo->fifo_mask;
7274 + dev_kfree_skb_any(fifo->buff);
7275 + fifo->buff = NULL;
7277 +} /* start_rx_fifo */
7279 +/***************************************************************/
7280 +/* control completion routine handling background control cmds */
7281 +/***************************************************************/
7283 +ctrl_complete(purb_t urb)
7285 + hfcusb_data *hfc = (hfcusb_data *) urb->context;
7287 + urb->dev = hfc->dev;
7288 + if (hfc->ctrl_cnt) {
7289 + switch (hfc->ctrl_buff[hfc->ctrl_out_idx].hfc_reg) {
7292 + hfc->ctrl_buff[hfc->ctrl_out_idx].
7295 + case HFCUSB_F_USAGE:
7296 + if (!hfc->dfifo_fill) {
7297 + fill_tx_urb(hfc->fifos +
7299 + if (hfc->fifos[HFCUSB_D_TX].buff)
7300 + usb_submit_urb(&hfc->
7305 + queue_control_request(hfc,
7308 + queue_control_request(hfc,
7313 + case HFCUSB_SCTRL_R:
7314 + switch (hfc->ctrl_fifo) {
7315 + case HFCUSB_B1_RX:
7316 + if (hfc->bch_enables & 1)
7317 + start_rx_fifo(hfc->
7322 + case HFCUSB_B2_RX:
7323 + if (hfc->bch_enables & 2)
7324 + start_rx_fifo(hfc->
7330 + if (hfc->bch_enables & 3)
7331 + hfc->led_req |= LED_BCH;
7333 + hfc->led_req &= ~LED_BCH;
7335 + case HFCUSB_P_DATA:
7337 + hfc->ctrl_buff[hfc->ctrl_out_idx].
7341 + hfc->ctrl_cnt--; /* decrement actual count */
7342 + if (++hfc->ctrl_out_idx >= HFC_CTRL_BUFSIZE)
7343 + hfc->ctrl_out_idx = 0; /* pointer wrap */
7344 + ctrl_start_transfer(hfc); /* start next transfer */
7346 +} /* ctrl_complete */
7348 +/*****************************************/
7349 +/* Layer 1 + D channel access from HiSax */
7350 +/*****************************************/
7352 +hfcusb_l1_access(void *drvarg, int pr, void *arg)
7354 + hfcusb_data *hfc = (hfcusb_data *) drvarg;
7357 + case (PH_DATA | REQUEST):
7358 + case (PH_PULL | INDICATION):
7359 + skb_queue_tail(hfc->regd.dsq,
7360 + (struct sk_buff *) arg);
7361 + if (!hfc->fifos[HFCUSB_D_TX].active
7362 + && !hfc->dfifo_fill) {
7363 + fill_tx_urb(hfc->fifos + HFCUSB_D_TX);
7364 + hfc->active_fifos |=
7365 + hfc->fifos[HFCUSB_D_TX].fifo_mask;
7366 + usb_submit_urb(&hfc->fifos[HFCUSB_D_TX].
7370 + case (PH_ACTIVATE | REQUEST):
7371 + switch (hfc->l1_state) {
7374 + hfc->regd.dch_l1l2(hfc->regd.arg_hisax,
7376 + INDICATION), NULL);
7380 + hfc->regd.dch_l1l2(hfc->regd.arg_hisax,
7382 + INDICATION), NULL);
7386 + queue_control_request(hfc, HFCUSB_STATES, 0x60); /* start activation */
7387 + hfc->t3_timer.expires =
7388 + jiffies + (HFC_TIMER_T3 * HZ) / 1000;
7389 + if (!timer_pending(&hfc->t3_timer))
7390 + add_timer(&hfc->t3_timer);
7395 + case (PH_DEACTIVATE | REQUEST):
7396 + queue_control_request(hfc, HFCUSB_STATES, 0x40); /* start deactivation */
7399 + printk(KERN_INFO "unknown hfcusb l1_access 0x%x\n",
7403 +} /* hfcusb_l1_access */
7405 +/*******************************/
7406 +/* B channel access from HiSax */
7407 +/*******************************/
7409 +hfcusb_bch_access(void *drvarg, int chan, int pr, void *arg)
7411 + hfcusb_data *hfc = (hfcusb_data *) drvarg;
7412 + usb_fifo *fifo = hfc->fifos + (chan ? HFCUSB_B2_TX : HFCUSB_B1_TX);
7416 + case (PH_DATA | REQUEST):
7417 + case (PH_PULL | INDICATION):
7418 + save_flags(flags);
7420 + if (!fifo->active) {
7421 + fill_tx_urb(fifo);
7422 + hfc->active_fifos |= fifo->fifo_mask;
7423 + usb_submit_urb(&fifo->urb);
7425 + restore_flags(flags);
7427 + case (PH_ACTIVATE | REQUEST):
7428 + if (!((int) arg)) {
7429 + hfc->bch_enables &= ~(1 << chan);
7430 + if (fifo->active) {
7432 + usb_unlink_urb(&fifo->urb);
7434 + save_flags(flags);
7436 + queue_control_request(hfc, HFCUSB_FIFO,
7438 + queue_control_request(hfc,
7439 + HFCUSB_INC_RES_F, 2);
7440 + queue_control_request(hfc, HFCUSB_CON_HDLC,
7442 + queue_control_request(hfc, HFCUSB_SCTRL,
7444 + hfc->bch_enables);
7445 + queue_control_request(hfc, HFCUSB_SCTRL_R,
7446 + hfc->bch_enables);
7447 + restore_flags(flags);
7449 + if (fifo->active) {
7451 + usb_unlink_urb(&fifo->urb);
7453 + return; /* fifo deactivated */
7455 + fifo->transmode = ((int) arg == L1_MODE_TRANS);
7457 + ((fifo->transmode) ? fifo->
7458 + usb_maxlen : MAX_BCH_SIZE);
7459 + (fifo + 1)->transmode = fifo->transmode;
7460 + (fifo + 1)->max_size = fifo->max_size;
7461 + hfc->bch_enables |= (1 << chan);
7462 + save_flags(flags);
7464 + queue_control_request(hfc, HFCUSB_FIFO,
7466 + queue_control_request(hfc, HFCUSB_CON_HDLC,
7468 + transmode) ? 9 : 11));
7469 + queue_control_request(hfc, HFCUSB_INC_RES_F, 2);
7470 + queue_control_request(hfc, HFCUSB_SCTRL,
7471 + 0x40 + hfc->bch_enables);
7472 + if ((int) arg == L1_MODE_HDLC)
7473 + queue_control_request(hfc, HFCUSB_CON_HDLC,
7475 + queue_control_request(hfc, HFCUSB_FIFO,
7476 + fifo->fifonum + 1);
7477 + queue_control_request(hfc, HFCUSB_CON_HDLC,
7479 + transmode) ? 8 : 10));
7480 + queue_control_request(hfc, HFCUSB_INC_RES_F, 2);
7481 + queue_control_request(hfc, HFCUSB_SCTRL_R,
7482 + hfc->bch_enables);
7483 + restore_flags(flags);
7489 + "unknown hfcusb bch_access chan %d 0x%x\n",
7493 +} /* hfcusb_bch_access */
7495 +/***************************************************************************/
7496 +/* usb_init is called once when a new matching device is detected to setup */
7497 +/* main parmeters. It registers the driver at the main hisax module. */
7498 +/* on success 0 is returned. */
7499 +/***************************************************************************/
7501 +usb_init(hfcusb_data * hfc)
7507 + /* check the chip id */
7508 + if ((Read_hfc(hfc, HFCUSB_CHIP_ID, &b) != 1) ||
7509 + (b != HFCUSB_CHIPID)) {
7510 + printk(KERN_INFO "HFC-USB: Invalid chip id 0x%02x\n", b);
7514 + /* first set the needed config, interface and alternate */
7515 + usb_set_configuration(hfc->dev, 1);
7516 + usb_set_interface(hfc->dev, hfc->if_used, hfc->alt_used);
7518 + /* init the led state request */
7519 + hfc->led_req = LED_DRIVER;
7521 + /* now we initialise the chip */
7522 + Write_hfc(hfc, HFCUSB_CIRM, 0x10); /* aux = output, reset off */
7523 + Write_hfc(hfc, HFCUSB_P_DATA, 0); /* leds = off */
7524 + Write_hfc(hfc, HFCUSB_USB_SIZE,
7525 + (hfc->fifos[HFCUSB_B1_TX].usb_maxlen >> 3) |
7526 + ((hfc->fifos[HFCUSB_B1_RX].usb_maxlen >> 3) << 4));
7528 + /* enable PCM/GCI master mode */
7529 + Write_hfc(hfc, HFCUSB_MST_MODE1, 0); /* set default values */
7530 + Write_hfc(hfc, HFCUSB_MST_MODE0, 1); /* enable master mode */
7532 + /* init the fifos */
7533 + Write_hfc(hfc, HFCUSB_F_THRES, (HFCUSB_TX_THRESHOLD >> 3) |
7534 + ((HFCUSB_RX_THRESHOLD >> 3) << 4));
7536 + for (i = 0, fifo = hfc->fifos + i; i < HFCUSB_NUM_FIFOS;
7538 + Write_hfc(hfc, HFCUSB_FIFO, i); /* select the desired fifo */
7540 + fifo->transmode = 0; /* hdlc mode selected */
7541 + fifo->buff = NULL; /* init buffer pointer */
7543 + (i <= HFCUSB_B2_RX) ? MAX_BCH_SIZE : MAX_DFRAME_LEN;
7544 + Write_hfc(hfc, HFCUSB_HDLC_PAR, ((i <= HFCUSB_B2_RX) ? 0 : 2)); /* data length */
7545 + Write_hfc(hfc, HFCUSB_CON_HDLC, ((i & 1) ? 0x08 : 0x09)); /* rx hdlc, tx fill 1 */
7546 + Write_hfc(hfc, HFCUSB_INC_RES_F, 2); /* reset the fifo */
7549 + Write_hfc(hfc, HFCUSB_CLKDEL, 0x0f); /* clock delay value */
7550 + Write_hfc(hfc, HFCUSB_STATES, 3 | 0x10); /* set deactivated mode */
7551 + Write_hfc(hfc, HFCUSB_STATES, 3); /* enable state machine */
7553 + Write_hfc(hfc, HFCUSB_SCTRL_R, 0); /* disable both B receivers */
7554 + Write_hfc(hfc, HFCUSB_SCTRL, 0x40); /* disable B transmitters + cap mode */
7556 + /* init the l1 timer */
7557 + init_timer(&hfc->t3_timer);
7558 + hfc->t3_timer.data = (long) hfc;
7559 + hfc->t3_timer.function = (void *) l1_timer_expire;
7560 + hfc->t4_timer.data = (long) hfc;
7561 + hfc->t4_timer.function = (void *) l1_timer_expire;
7562 + hfc->l1_tq.routine = (void *) (void *) usb_l1d_bh;
7563 + hfc->l1_tq.sync = 0;
7564 + hfc->l1_tq.data = hfc;
7566 + /* init the background control machinery */
7567 + hfc->ctrl_read.requesttype = 0xc0;
7568 + hfc->ctrl_read.request = 1;
7569 + hfc->ctrl_read.length = 1;
7570 + hfc->ctrl_write.requesttype = 0x40;
7571 + hfc->ctrl_write.request = 0;
7572 + hfc->ctrl_write.length = 0;
7573 + FILL_CONTROL_URB(&hfc->ctrl_urb, hfc->dev, hfc->ctrl_out_pipe,
7574 + (u_char *) & hfc->ctrl_write, NULL, 0,
7575 + ctrl_complete, hfc);
7577 + /* init the TX-urbs */
7578 + fifo = hfc->fifos + HFCUSB_D_TX;
7579 + FILL_BULK_URB(&fifo->urb, hfc->dev, fifo->pipe,
7580 + (u_char *) fifo->buffer, 0, tx_complete, fifo);
7581 + fifo = hfc->fifos + HFCUSB_B1_TX;
7582 + FILL_BULK_URB(&fifo->urb, hfc->dev, fifo->pipe,
7583 + (u_char *) fifo->buffer, 0, tx_complete, fifo);
7584 + fifo = hfc->fifos + HFCUSB_B2_TX;
7585 + FILL_BULK_URB(&fifo->urb, hfc->dev, fifo->pipe,
7586 + (u_char *) fifo->buffer, 0, tx_complete, fifo);
7588 + /* init the E-buffer */
7589 + skb_queue_head_init(&hfc->regd.erq);
7591 + /* now register ourself at hisax */
7592 + hfc->regd.version = HISAX_LOAD_VERSION; /* set our version */
7593 + hfc->regd.cmd = HISAX_LOAD_REGISTER; /* register command */
7594 + hfc->regd.argl1 = (void *) hfc; /* argument for our local routine */
7595 + hfc->regd.dch_l2l1 = hfcusb_l1_access;
7596 + hfc->regd.bch_l2l1 = hfcusb_bch_access;
7597 + hfc->regd.drvname = "hfc_usb";
7598 + if (hisax_register_hfcusb(&hfc->regd)) {
7599 + printk(KERN_INFO "HFC-USB failed to register at hisax\n");
7600 + Write_hfc(hfc, HFCUSB_CIRM, 0x08); /* aux = input, reset on */
7604 + /* startup the D- and E-channel fifos */
7605 + start_rx_fifo(hfc->fifos + HFCUSB_D_RX); /* D-fifo */
7606 + if (hfc->fifos[HFCUSB_PCM_RX].pipe)
7607 + start_rx_fifo(hfc->fifos + HFCUSB_PCM_RX); /* E-fifo */
7612 +/*************************************************/
7613 +/* function called to probe a new plugged device */
7614 +/*************************************************/
7616 +hfc_usb_probe(struct usb_device *dev, unsigned int interface
7617 +#ifdef COMPAT_HAS_USB_IDTAB
7618 + , const struct usb_device_id *id_table)
7623 + hfcusb_data *context;
7624 + struct usb_interface *ifp = dev->actconfig->interface + interface;
7625 + struct usb_interface_descriptor *ifdp =
7626 + ifp->altsetting + ifp->act_altsetting;
7627 + struct usb_endpoint_descriptor *epd;
7628 + int i, idx, ep_msk;
7630 +#ifdef COMPAT_HAS_USB_IDTAB
7631 + if (id_table && (dev->descriptor.idVendor == id_table->idVendor) &&
7632 + (dev->descriptor.idProduct == id_table->idProduct) &&
7634 + if ((((dev->descriptor.idVendor == 0x959) &&
7635 + (dev->descriptor.idProduct == 0x2bd0)) ||
7636 + ((dev->descriptor.idVendor == 0x7b0) &&
7637 + (dev->descriptor.idProduct == 0x0006))) &&
7639 + (ifdp->bNumEndpoints >= 6) && (ifdp->bNumEndpoints <= 16)) {
7640 + if (!(context = kmalloc(sizeof(hfcusb_data), GFP_KERNEL))) {
7641 + return (NULL); /* got no mem */
7643 + memset(context, 0, sizeof(hfcusb_data)); /* clear the structure */
7644 + i = ifdp->bNumEndpoints; /* get number of endpoints */
7645 + ep_msk = 0; /* none found */
7646 + epd = ifdp->endpoint; /* first endpoint descriptor */
7647 + while (i-- && ((ep_msk & 0xcf) != 0xcf)) {
7649 + idx = (((epd->bEndpointAddress & 0x7f) - 1) << 1); /* get endpoint base */
7651 + switch (epd->bmAttributes) {
7652 + case USB_ENDPOINT_XFER_INT:
7655 + bEndpointAddress &
7657 + break; /* only interrupt in allowed */
7658 + idx++; /* input index is odd */
7659 + context->fifos[idx].pipe =
7660 + usb_rcvintpipe(dev,
7662 + bEndpointAddress);
7665 + case USB_ENDPOINT_XFER_BULK:
7667 + bEndpointAddress &
7669 + break; /* only bulk out allowed */
7670 + context->fifos[idx].pipe =
7671 + usb_sndbulkpipe(dev,
7673 + bEndpointAddress);
7676 + context->fifos[idx].pipe = 0; /* reset data */
7677 + } /* switch attribute */
7679 + if (context->fifos[idx].pipe) {
7680 + context->fifos[idx].fifonum = idx;
7681 + context->fifos[idx].fifo_mask =
7683 + context->fifos[idx].hfc = context;
7684 + context->fifos[idx].usb_maxlen =
7685 + epd->wMaxPacketSize;
7686 + context->fifos[idx].intervall =
7688 + ep_msk |= (1 << idx);
7690 + ep_msk &= ~(1 << idx);
7695 + if ((ep_msk & 0x3f) != 0x3f) {
7699 + MOD_INC_USE_COUNT; /* lock our module */
7700 + context->dev = dev; /* save device */
7701 + context->if_used = interface; /* save used interface */
7702 + context->alt_used = ifp->act_altsetting; /* and alternate config */
7703 + context->ctrl_paksize = dev->descriptor.bMaxPacketSize0; /* control size */
7705 + /* create the control pipes needed for register access */
7706 + context->ctrl_in_pipe = usb_rcvctrlpipe(context->dev, 0);
7707 + context->ctrl_out_pipe = usb_sndctrlpipe(context->dev, 0);
7709 + /* init the chip and register the driver */
7710 + if (usb_init(context)) {
7712 + MOD_DEC_USE_COUNT;
7717 + "HFC-USB: New device if=%d alt=%d registered\n",
7718 + context->if_used, context->alt_used);
7722 + return (NULL); /* no matching entry */
7723 +} /* hfc_usb_probe */
7725 +/****************************************************/
7726 +/* function called when an active device is removed */
7727 +/****************************************************/
7729 +hfc_usb_disconnect(struct usb_device *usbdev, void *drv_context)
7731 + hfcusb_data *context = drv_context;
7733 + struct sk_buff *skb;
7735 + /* tell all fifos to terminate */
7736 + for (i = 0; i < HFCUSB_NUM_FIFOS; i++)
7737 + if (context->fifos[i].active) {
7738 + context->fifos[i].active = 0;
7739 + usb_unlink_urb(&context->fifos[i].urb);
7741 + while (context->active_fifos) {
7742 + set_current_state(TASK_INTERRUPTIBLE);
7743 + /* Timeout 10ms */
7744 + schedule_timeout((10 * HZ) / 1000);
7746 + if (timer_pending(&context->t3_timer))
7747 + del_timer(&context->t3_timer);
7748 + context->regd.release_driver(context->regd.arg_hisax);
7749 + while ((skb = skb_dequeue(&context->regd.erq)) != NULL)
7750 + dev_kfree_skb_any(skb);
7752 + kfree(context); /* free our structure again */
7753 + MOD_DEC_USE_COUNT; /* and decrement the usage counter */
7754 +} /* hfc_usb_disconnect */
7756 +/************************************/
7757 +/* our driver information structure */
7758 +/************************************/
7759 +static struct usb_driver hfc_drv = {
7761 +#ifdef COMPAT_HAS_USB_IDTAB
7762 + id_table:hfc_usb_idtab,
7764 + probe:hfc_usb_probe,
7765 + disconnect:hfc_usb_disconnect,
7772 + usb_deregister(&hfc_drv); /* release our driver */
7773 + printk(KERN_INFO "HFC-USB module removed\n");
7779 + struct hisax_drvreg drv;
7781 + drv.version = HISAX_LOAD_VERSION; /* set our version */
7782 + drv.cmd = HISAX_LOAD_CHKVER; /* check command only */
7783 + if (hisax_register_hfcusb(&drv)) {
7784 + printk(KERN_INFO "HFC-USB <-> hisax version conflict\n");
7785 + return (-1); /* unable to register */
7787 + if (usb_register(&hfc_drv)) {
7789 + "Unable to register HFC-USB module at usb stack\n");
7790 + return (-1); /* unable to register */
7793 + printk(KERN_INFO "HFC-USB module loaded\n");
7797 +module_init(hfc_usb_init);
7798 +module_exit(hfc_usb_exit);
7800 +++ b/drivers/isdn/hisax/hfc_usbr.c
7802 +/* $Id: hfc_usbr.c,v 2.5 2001/07/06 21:30:11 werner Exp $
7804 + * hfc_usb.c low level driver for CCD´s hfc-usb single chip controllers
7805 + * type approval valid for HFC-S USB based TAs
7807 + * Author Werner Cornelius (werner@isdn-development.de)
7809 + * Copyright 2001 by Werner Cornelius (werner@isdn4linux.de)
7811 + * This program is free software; you can redistribute it and/or modify
7812 + * it under the terms of the GNU General Public License as published by
7813 + * the Free Software Foundation; either version 2, or (at your option)
7814 + * any later version.
7816 + * This program is distributed in the hope that it will be useful,
7817 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
7818 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7819 + * GNU General Public License for more details.
7821 + * You should have received a copy of the GNU General Public License
7822 + * along with this program; if not, write to the Free Software
7823 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
7827 +#define __NO_VERSION__
7828 +#include <linux/init.h>
7830 +#include "isdnl1.h"
7831 +#include "hisax_loadable.h"
7833 +extern const char *CardType[];
7835 +static const char *hfcusb_revision = "$Revision: 2.5 $";
7837 +/*********************************/
7838 +/* schedule a new b_channel task */
7839 +/*********************************/
7841 +hfcusb_sched_event(struct BCState *bcs, int event)
7843 + bcs->event |= 1 << event;
7844 + queue_task(&bcs->tqueue, &tq_immediate);
7845 + mark_bh(IMMEDIATE_BH);
7848 +/************************************************/
7849 +/* select a b-channel entry matching and active */
7850 +/************************************************/
7853 +Sel_BCS(struct IsdnCardState *cs, int channel)
7855 + if (cs->bcs[0].mode && (cs->bcs[0].channel == channel))
7856 + return (&cs->bcs[0]);
7857 + else if (cs->bcs[1].mode && (cs->bcs[1].channel == channel))
7858 + return (&cs->bcs[1]);
7863 +/**********************************************/
7864 +/* transfer function (D-channel from l2 to l1 */
7865 +/**********************************************/
7867 +hfcusb_d_l2l1(struct PStack *st, int pr, void *arg)
7869 + struct IsdnCardState *cs = st->l1.hardware;
7870 + struct hisax_drvreg *drv = cs->hw.hfcusb.drv;
7874 + case (PH_DATA | REQUEST):
7875 + case (PH_PULL | INDICATION):
7876 + cs->hw.hfcusb.dch_tx_busy = 1;
7878 + case (PH_PULL | REQUEST):
7879 + if (!cs->hw.hfcusb.dch_tx_busy) {
7880 + test_and_clear_bit(FLG_L1_PULL_REQ,
7882 + st->l1.l1l2(st, PH_PULL | CONFIRM,
7885 + test_and_set_bit(FLG_L1_PULL_REQ,
7889 + drv->dch_l2l1(drv, pr, arg);
7891 + debugl1(cs, "hfcusb l2l1 called without existing driver");
7892 +} /* hfcusb_d_l2l1 */
7894 +/*****************************/
7895 +/* E-channel receive routine */
7896 +/*****************************/
7898 +EChannel_proc_rcv(struct IsdnCardState *cs)
7901 + struct sk_buff *skb;
7902 + struct hisax_drvreg *usbdrv =
7903 + (struct hisax_drvreg *) cs->hw.hfcusb.drv;
7906 + while ((skb = skb_dequeue(&usbdrv->erq)) != NULL) {
7907 + if (cs->debug & DEB_DLOG_HEX) {
7909 + if ((skb->len) < MAX_DLOG_SPACE / 3 - 10) {
7915 + ptr += QuickHex(ptr, skb->data, skb->len);
7919 + HiSax_putstatus(cs, NULL, cs->dlog);
7921 + HiSax_putstatus(cs, "LogEcho: ",
7922 + "warning Frame too big (%d)",
7925 + dev_kfree_skb_any(skb);
7929 +/******************************************/
7930 +/* transfer function called from L1 to L2 */
7931 +/******************************************/
7933 +hfcusb_d_l1l2(void *cs1, int pr, void *arg)
7935 + struct IsdnCardState *cs = (struct IsdnCardState *) cs1;
7938 + case (PH_DATA | INDICATION):
7940 + DChannel_proc_rcv(cs);
7942 + EChannel_proc_rcv(cs);
7945 + case (PH_DATA | CONFIRM):
7946 + cs->hw.hfcusb.dch_tx_busy = 0;
7947 + DChannel_proc_xmt(cs);
7950 + case (PH_ACTIVATE | INDICATION):
7951 + case (PH_ACTIVATE | CONFIRM):
7952 + cs->stlist->l1.l1l2(cs->stlist, pr, arg);
7953 + if (cs->debug & L1_DEB_ISAC)
7954 + debugl1(cs, "layer 1 activated");
7957 + case (PH_DEACTIVATE | INDICATION):
7958 + case (PH_DEACTIVATE | CONFIRM):
7959 + cs->stlist->l1.l1l2(cs->stlist, pr, arg);
7960 + if (cs->debug & L1_DEB_ISAC)
7961 + debugl1(cs, "layer 1 deactivated");
7965 + debugl1(cs, "unknown l1 msg 0x%x ", pr);
7967 +} /* hfcusb_d_l1l2 */
7970 +/******************************************/
7971 +/* transfer function called from L1 to L2 */
7972 +/******************************************/
7974 +hfcusb_b_l1l2(void *cs1, int chan, int pr, void *arg)
7976 + struct IsdnCardState *cs = (struct IsdnCardState *) cs1;
7977 + struct BCState *bcs = Sel_BCS(cs, chan);
7980 + case (PH_DATA | INDICATION):
7983 + hfcusb_sched_event(bcs, B_RCVBUFREADY);
7986 + case (PH_DATA | CONFIRM):
7989 + bcs->tx_cnt -= bcs->tx_skb->len;
7990 + if (bcs->st->lli.l1writewakeup &&
7991 + (PACKET_NOACK != bcs->tx_skb->pkt_type))
7992 + bcs->st->lli.l1writewakeup(bcs->st,
7995 + dev_kfree_skb_any(bcs->tx_skb);
7996 + bcs->tx_skb = skb_dequeue(&bcs->squeue);
7999 + case (PH_ACTIVATE | INDICATION):
8000 + case (PH_ACTIVATE | CONFIRM):
8001 + cs->stlist->l1.l1l2(cs->stlist, pr, arg);
8002 + if (cs->debug & L1_DEB_ISAC)
8003 + debugl1(cs, "layer 1 activated");
8006 + case (PH_DEACTIVATE | INDICATION):
8007 + case (PH_DEACTIVATE | CONFIRM):
8008 + cs->stlist->l1.l1l2(cs->stlist, pr, arg);
8009 + if (cs->debug & L1_DEB_ISAC)
8010 + debugl1(cs, "layer 1 deactivated");
8014 + debugl1(cs, "unknown l1 b msg 0x%x ", pr);
8016 +} /* hfcusb_b_l1l2 */
8019 +/***********************************************/
8020 +/* called during init setting l1 stack pointer */
8021 +/***********************************************/
8023 +setstack_hfcusb(struct PStack *st, struct IsdnCardState *cs)
8025 + st->l2.l2l1 = hfcusb_d_l2l1;
8028 +/**************************************/
8029 +/* send B-channel data if not blocked */
8030 +/**************************************/
8032 +hfcusb_send_data(struct BCState *bcs)
8034 + struct IsdnCardState *cs = bcs->cs;
8035 + struct hisax_drvreg *drv =
8036 + (struct hisax_drvreg *) cs->hw.hfcusb.drv;
8040 + drv->bch_l2l1(drv->argl1, bcs->channel, PH_DATA | REQUEST,
8044 +/***************************************************************/
8045 +/* activate/deactivate hardware for selected channels and mode */
8046 +/***************************************************************/
8048 +mode_hfcusb(struct BCState *bcs, int mode, int bc)
8050 + struct IsdnCardState *cs = bcs->cs;
8051 + struct hisax_drvreg *drv = cs->hw.hfcusb.drv;
8055 + if (cs->debug & L1_DEB_HSCX)
8056 + debugl1(cs, "HFCUSB bchannel mode %d bchan %d/%d",
8057 + mode, bc, bcs->channel);
8059 + bcs->channel = bc;
8061 + drv->bsk[bc] = &bcs->tx_skb;
8062 + drv->brq[bc] = &bcs->rqueue;
8064 + drv->bch_l2l1(drv->argl1, bc, PH_ACTIVATE | REQUEST,
8067 + drv->bsk[bc] = NULL;
8068 + drv->brq[bc] = NULL;
8072 +/******************************/
8073 +/* Layer2 -> Layer 1 Transfer */
8074 +/******************************/
8076 +hfcusb_b_l2l1(struct PStack *st, int pr, void *arg)
8078 + struct sk_buff *skb = arg;
8079 + struct hisax_drvreg *drv = st->l1.bcs->cs->hw.hfcusb.drv;
8083 + case (PH_DATA | REQUEST):
8084 + save_flags(flags);
8086 + if (st->l1.bcs->tx_skb) {
8087 + skb_queue_tail(&st->l1.bcs->squeue, skb);
8088 + restore_flags(flags);
8090 + st->l1.bcs->tx_skb = skb;
8091 + st->l1.bcs->cs->BC_Send_Data(st->l1.bcs);
8092 + restore_flags(flags);
8095 + case (PH_PULL | INDICATION):
8096 + if (st->l1.bcs->tx_skb) {
8097 + printk(KERN_WARNING
8098 + "hfc_l2l1: this shouldn't happen\n");
8101 + save_flags(flags);
8103 + st->l1.bcs->tx_skb = skb;
8104 + st->l1.bcs->cs->BC_Send_Data(st->l1.bcs);
8105 + restore_flags(flags);
8107 + case (PH_PULL | REQUEST):
8108 + if (!st->l1.bcs->tx_skb) {
8109 + test_and_clear_bit(FLG_L1_PULL_REQ,
8111 + st->l1.l1l2(st, PH_PULL | CONFIRM, NULL);
8113 + test_and_set_bit(FLG_L1_PULL_REQ,
8116 + case (PH_ACTIVATE | REQUEST):
8118 + test_and_set_bit(BC_FLG_ACTIV,
8119 + &st->l1.bcs->Flag);
8120 + mode_hfcusb(st->l1.bcs, st->l1.mode,
8122 + l1_msg_b(st, pr, arg);
8125 + case (PH_DEACTIVATE | REQUEST):
8126 + l1_msg_b(st, pr, arg);
8128 + case (PH_DEACTIVATE | CONFIRM):
8129 + test_and_clear_bit(BC_FLG_ACTIV,
8130 + &st->l1.bcs->Flag);
8131 + test_and_clear_bit(BC_FLG_BUSY, &st->l1.bcs->Flag);
8132 + mode_hfcusb(st->l1.bcs, 0, st->l1.bc);
8133 + st->l1.l1l2(st, PH_DEACTIVATE | CONFIRM, NULL);
8138 +/******************************************/
8139 +/* deactivate B-channel access and queues */
8140 +/******************************************/
8142 +close_hfcusb(struct BCState *bcs)
8144 + mode_hfcusb(bcs, 0, bcs->channel);
8145 + if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) {
8146 + skb_queue_purge(&bcs->rqueue);
8147 + skb_queue_purge(&bcs->squeue);
8148 + if (bcs->tx_skb) {
8149 + dev_kfree_skb_any(bcs->tx_skb);
8150 + bcs->tx_skb = NULL;
8151 + test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag);
8156 +/*************************************/
8157 +/* init B-channel queues and control */
8158 +/*************************************/
8160 +open_hfcusbstate(struct IsdnCardState *cs, struct BCState *bcs)
8162 + if (!test_and_set_bit(BC_FLG_INIT, &bcs->Flag)) {
8163 + skb_queue_head_init(&bcs->rqueue);
8164 + skb_queue_head_init(&bcs->squeue);
8166 + bcs->tx_skb = NULL;
8167 + test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag);
8173 +/*********************************/
8174 +/* inits the stack for B-channel */
8175 +/*********************************/
8177 +setstack_2b(struct PStack *st, struct BCState *bcs)
8179 + bcs->channel = st->l1.bc;
8180 + if (open_hfcusbstate(st->l1.hardware, bcs))
8183 + st->l2.l2l1 = hfcusb_b_l2l1;
8184 + setstack_manager(st);
8186 + setstack_l1_B(st);
8190 +/********************************/
8191 +/* called for card init message */
8192 +/********************************/
8194 +inithfcusb(struct IsdnCardState *cs)
8196 + cs->setstack_d = setstack_hfcusb;
8197 + cs->BC_Send_Data = &hfcusb_send_data;
8198 + cs->bcs[0].BC_SetStack = setstack_2b;
8199 + cs->bcs[1].BC_SetStack = setstack_2b;
8200 + cs->bcs[0].BC_Close = close_hfcusb;
8201 + cs->bcs[1].BC_Close = close_hfcusb;
8202 + mode_hfcusb(cs->bcs, 0, 0);
8203 + mode_hfcusb(cs->bcs + 1, 0, 1);
8208 +/*******************************************/
8209 +/* handle card messages from control layer */
8210 +/*******************************************/
8212 +hfcusb_card_msg(struct IsdnCardState *cs, int mt, void *arg)
8214 + if (cs->debug & L1_DEB_ISAC)
8215 + debugl1(cs, "HFCUSB: card_msg %x", mt);
8220 + case CARD_RELEASE:
8230 + HiSax_closecard(int cardnr);
8231 +/*****************************/
8232 +/* release a driver instance */
8233 +/* called when hardware is */
8234 +/* no longer present. */
8235 +/*****************************/
8237 +release_hfcdrv(void *arg)
8239 + struct IsdnCardState *cs = (struct IsdnCardState *) arg;
8241 + cs->hw.hfcusb.drv = NULL; /* disable any further use of driver */
8242 + HiSax_closecard(cs->cardnr);
8243 +} /* release_hfcdrv */
8245 +/*********************************************/
8246 +/* called once when a new device is detected */
8247 +/* initialises local data */
8248 +/*********************************************/
8250 +setup_hfc_usb(struct IsdnCard *card)
8252 + struct IsdnCardState *cs = card->cs;
8254 + struct hisax_drvreg *usbdrv =
8255 + (struct hisax_drvreg *) cs->hw.hfcusb.drv;
8258 + return (0); /* no driver data present */
8260 + strcpy(tmp, hfcusb_revision);
8261 + printk(KERN_INFO "HiSax: HFC-USB driver Rev. %s\n",
8262 + HiSax_getrev(tmp));
8264 + usbdrv->release_driver = &release_hfcdrv; /* release routine */
8265 + usbdrv->arg_hisax = (void *) cs; /* parameter for calling */
8266 + usbdrv->dch_l1l2 = &hfcusb_d_l1l2; /* access from L1 to HiSax */
8267 + usbdrv->bch_l1l2 = &hfcusb_b_l1l2;
8268 + usbdrv->drq = &cs->rq;
8269 + usbdrv->dsq = &cs->sq;
8270 + cs->cardmsg = &hfcusb_card_msg;
8271 + return (1); /* success */
8273 --- a/drivers/isdn/hisax/hfcscard.c
8274 +++ b/drivers/isdn/hisax/hfcscard.c
8276 -/* $Id: hfcscard.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
8277 +/* $Id: hfcscard.c,v 1.10 2001/09/24 13:22:56 kai Exp $
8279 * low level stuff for hfcs based cards (Teles3c, ACER P10)
8283 #define __NO_VERSION__
8284 #include <linux/init.h>
8285 -#include <linux/isapnp.h>
8287 #include "hfc_2bds0.h"
8290 extern const char *CardType[];
8292 -static const char *hfcs_revision = "$Revision: 1.1.4.1 $";
8293 +static const char *hfcs_revision = "$Revision: 1.10 $";
8296 hfcs_interrupt(int intno, void *dev_id, struct pt_regs *regs)
8297 @@ -140,36 +139,6 @@ hfcs_card_msg(struct IsdnCardState *cs,
8302 -static struct isapnp_device_id hfc_ids[] __initdata = {
8303 - { ISAPNP_VENDOR('A', 'N', 'X'), ISAPNP_FUNCTION(0x1114),
8304 - ISAPNP_VENDOR('A', 'N', 'X'), ISAPNP_FUNCTION(0x1114),
8305 - (unsigned long) "Acer P10" },
8306 - { ISAPNP_VENDOR('B', 'I', 'L'), ISAPNP_FUNCTION(0x0002),
8307 - ISAPNP_VENDOR('B', 'I', 'L'), ISAPNP_FUNCTION(0x0002),
8308 - (unsigned long) "Billion 2" },
8309 - { ISAPNP_VENDOR('B', 'I', 'L'), ISAPNP_FUNCTION(0x0001),
8310 - ISAPNP_VENDOR('B', 'I', 'L'), ISAPNP_FUNCTION(0x0001),
8311 - (unsigned long) "Billion 1" },
8312 - { ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x7410),
8313 - ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x7410),
8314 - (unsigned long) "IStar PnP" },
8315 - { ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2610),
8316 - ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2610),
8317 - (unsigned long) "Teles 16.3c" },
8318 - { ISAPNP_VENDOR('S', 'F', 'M'), ISAPNP_FUNCTION(0x0001),
8319 - ISAPNP_VENDOR('S', 'F', 'M'), ISAPNP_FUNCTION(0x0001),
8320 - (unsigned long) "Tornado Tipa C" },
8321 - { ISAPNP_VENDOR('K', 'Y', 'E'), ISAPNP_FUNCTION(0x0001),
8322 - ISAPNP_VENDOR('K', 'Y', 'E'), ISAPNP_FUNCTION(0x0001),
8323 - (unsigned long) "Genius Speed Surfer" },
8327 -static struct isapnp_device_id *hdev = &hfc_ids[0];
8328 -static struct pci_bus *pnp_c __devinitdata = NULL;
8332 setup_hfcs(struct IsdnCard *card)
8334 @@ -178,46 +147,6 @@ setup_hfcs(struct IsdnCard *card)
8336 strcpy(tmp, hfcs_revision);
8337 printk(KERN_INFO "HiSax: HFC-S driver Rev. %s\n", HiSax_getrev(tmp));
8340 - if (!card->para[1] && isapnp_present()) {
8341 - struct pci_bus *pb;
8342 - struct pci_dev *pd;
8344 - while(hdev->card_vendor) {
8345 - if ((pb = isapnp_find_card(hdev->card_vendor,
8346 - hdev->card_device, pnp_c))) {
8349 - if ((pd = isapnp_find_dev(pnp_c,
8350 - hdev->vendor, hdev->function, pd))) {
8351 - printk(KERN_INFO "HiSax: %s detected\n",
8352 - (char *)hdev->driver_data);
8354 - pd->deactivate(pd);
8356 - card->para[1] = pd->resource[0].start;
8357 - card->para[0] = pd->irq_resource[0].start;
8358 - if (!card->para[0] || !card->para[1]) {
8359 - printk(KERN_ERR "HFC PnP:some resources are missing %ld/%lx\n",
8360 - card->para[0], card->para[1]);
8361 - pd->deactivate(pd);
8366 - printk(KERN_ERR "HFC PnP: PnP error card found, no device\n");
8372 - if (!hdev->card_vendor) {
8373 - printk(KERN_INFO "HFC PnP: no ISAPnP card found\n");
8378 cs->hw.hfcD.addr = card->para[1] & 0xfffe;
8379 cs->irq = card->para[0];
8380 cs->hw.hfcD.cip = 0;
8381 --- a/drivers/isdn/hisax/hisax.h
8382 +++ b/drivers/isdn/hisax/hisax.h
8384 -/* $Id: hisax.h,v 1.1.4.2 2001/12/09 19:15:28 kai Exp $
8385 +/* $Id: hisax.h,v 2.64 2001/09/24 13:22:56 kai Exp $
8387 * Basic declarations, defines and prototypes
8390 #include <linux/isdnif.h>
8391 #include <linux/tty.h>
8392 #include <linux/serial_reg.h>
8393 +#ifndef COMPAT_NO_SOFTNET
8394 #include <linux/netdevice.h>
8397 #define ERROR_STATISTIC
8400 #define DL_DATA 0x0220
8401 #define DL_FLUSH 0x0224
8402 #define DL_UNIT_DATA 0x0230
8404 -#define MDL_BC_RELEASE 0x0278 // Formula-n enter:now
8405 -#define MDL_BC_ASSIGN 0x027C // Formula-n enter:now
8406 #define MDL_ASSIGN 0x0280
8407 #define MDL_REMOVE 0x0284
8408 #define MDL_ERROR 0x0288
8409 @@ -472,8 +471,6 @@ struct amd7930_hw {
8410 #define BC_FLG_FTI_RUN 13
8411 #define BC_FLG_LL_OK 14
8412 #define BC_FLG_LL_CONN 15
8413 -#define BC_FLG_FTI_FTS 16
8414 -#define BC_FLG_FRH_WAIT 17
8416 #define L1_MODE_NULL 0
8417 #define L1_MODE_TRANS 1
8418 @@ -695,6 +692,13 @@ struct hfcPCI_hw {
8419 struct timer_list timer;
8422 +#ifdef CONFIG_HISAX_HFC_USB
8424 + void *drv; /* pointer to driver structure */
8432 @@ -838,17 +842,6 @@ struct w6692_chip {
8436 -struct amd7930_chip {
8441 - unsigned int tx_xmtlen;
8442 - struct timer_list timer3;
8443 - void (*ph_command) (struct IsdnCardState *, u_char, char *);
8444 - void (*setIrqMask) (struct IsdnCardState *, u_char);
8450 @@ -902,6 +895,9 @@ struct IsdnCardState {
8451 struct njet_hw njet;
8452 struct hfcD_hw hfcD;
8453 struct hfcPCI_hw hfcpci;
8454 +#ifdef CONFIG_HISAX_HFC_USB
8455 + struct hfcUSB_hw hfcusb;
8457 struct hfcSX_hw hfcsx;
8458 struct ix1_hw niccy;
8459 struct isurf_hw isurf;
8460 @@ -945,7 +941,6 @@ struct IsdnCardState {
8461 struct hfcpci_chip hfcpci;
8462 struct hfcsx_chip hfcsx;
8463 struct w6692_chip w6692;
8464 - struct amd7930_chip amd7930;
8465 struct icc_chip icc;
8468 @@ -967,6 +962,8 @@ struct IsdnCardState {
8472 +#define HISAX_MAX_CARDS 8
8474 #define ISDN_CTYPE_16_0 1
8475 #define ISDN_CTYPE_8_0 2
8476 #define ISDN_CTYPE_16_3 3
8477 @@ -1006,8 +1003,8 @@ struct IsdnCardState {
8478 #define ISDN_CTYPE_HFC_SX 37
8479 #define ISDN_CTYPE_NETJET_U 38
8480 #define ISDN_CTYPE_HFC_SP_PCMCIA 39
8481 -#define ISDN_CTYPE_DYNAMIC 40
8482 -#define ISDN_CTYPE_ENTERNOW 41
8483 +#define ISDN_CTYPE_HFC_USB 40
8484 +#define ISDN_CTYPE_DYNAMIC 41
8485 #define ISDN_CTYPE_COUNT 41
8488 @@ -1267,10 +1264,6 @@ struct IsdnCardState {
8489 #define CARD_NETJET_U 0
8492 -#ifdef CONFIG_HISAX_ENTERNOW_PCI
8493 -#define CARD_FN_ENTERNOW_PCI 1
8496 #define TEI_PER_CARD 1
8499 --- a/drivers/isdn/hisax/hisax_debug.h
8500 +++ b/drivers/isdn/hisax/hisax_debug.h
8503 #define DBG(level, format, arg...) do { \
8504 if (level & __debug_variable) \
8505 -printk(KERN_DEBUG "%s: " format "\n" , __FUNCTION__ , ## arg); \
8506 +printk(KERN_DEBUG __FUNCTION__ ": " format "\n" , ## arg); \
8509 #define DBG_PACKET(level,data,count) \
8510 --- a/drivers/isdn/hisax/hisax_fcpcipnp.c
8511 +++ b/drivers/isdn/hisax/hisax_fcpcipnp.c
8515 * o clean up debugging
8516 - * o tx_skb at PH_DEACTIVATE time
8519 #include <linux/version.h>
8520 #include <linux/module.h>
8521 #include <linux/init.h>
8522 #include <linux/pci.h>
8523 -#include <linux/isapnp.h>
8524 +#include "hisax_isapnp.h"
8525 #include <linux/kmod.h>
8526 #include <linux/slab.h>
8527 #include <linux/skbuff.h>
8528 #include <linux/netdevice.h>
8530 -#include <asm/io.h>
8532 #include "hisax_fcpcipnp.h"
8533 +#include "hisax_isac.h"
8536 #define __debug_variable debug
8537 @@ -46,10 +43,14 @@ static int debug = 0;
8538 MODULE_PARM(debug, "i");
8541 -MODULE_AUTHOR("Kai Germaschewski <kai.germaschewski@gmx.de>/Karsten Keil <kkeil@suse.de>");
8542 +MODULE_AUTHOR("Kai Germaschewski <kai.germaschewski@gmx.de>");
8543 MODULE_DESCRIPTION("AVM Fritz!PCI/PnP ISDN driver");
8545 -static struct pci_device_id fcpci_ids[] __devinitdata = {
8546 +#ifndef PCI_DEVICE_ID_AVM_A1_V2
8547 +#define PCI_DEVICE_ID_AVM_A1_V2 0x0e00
8550 +static struct pci_device_id fcpci_ids[] __initdata = {
8551 { PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_A1 , PCI_ANY_ID, PCI_ANY_ID,
8552 0, 0, (unsigned long) "Fritz!Card PCI" },
8553 { PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_A1_V2, PCI_ANY_ID, PCI_ANY_ID,
8554 @@ -58,7 +59,7 @@ static struct pci_device_id fcpci_ids[]
8556 MODULE_DEVICE_TABLE(pci, fcpci_ids);
8558 -static struct isapnp_device_id fcpnp_ids[] __devinitdata = {
8559 +static struct isapnp_device_id fcpnp_ids[] __initdata = {
8560 { ISAPNP_VENDOR('A', 'V', 'M'), ISAPNP_FUNCTION(0x0900),
8561 ISAPNP_VENDOR('A', 'V', 'M'), ISAPNP_FUNCTION(0x0900),
8562 (unsigned long) "Fritz!Card PnP" },
8563 @@ -68,7 +69,8 @@ MODULE_DEVICE_TABLE(isapnp, fcpnp_ids);
8565 static int protocol = 2; /* EURO-ISDN Default */
8566 MODULE_PARM(protocol, "i");
8567 -MODULE_LICENSE("GPL");
8569 +static LIST_HEAD(adapter_list);
8571 // ----------------------------------------------------------------------
8573 @@ -147,7 +149,7 @@ static unsigned char fcpci_read_isac(str
8574 outb(idx, adapter->io + AVM_INDEX);
8575 val = inb(adapter->io + AVM_DATA + (offset & 0xf));
8576 spin_unlock_irqrestore(&adapter->hw_lock, flags);
8577 - DBG(0x1000, " port %#x, value %#x",
8578 + DBG(0x1000, __FUNCTION__ " port %#x, value %#x",
8582 @@ -160,7 +162,7 @@ static void fcpci_write_isac(struct isac
8583 AVM_IDX_ISAC_REG_HIGH : AVM_IDX_ISAC_REG_LOW;
8584 unsigned long flags;
8586 - DBG(0x1000, " port %#x, value %#x",
8587 + DBG(0x1000, __FUNCTION__ " port %#x, value %#x",
8589 spin_lock_irqsave(&adapter->hw_lock, flags);
8590 outb(idx, adapter->io + AVM_INDEX);
8591 @@ -240,7 +242,7 @@ static unsigned char fcpci2_read_isac(st
8592 outl(offset, adapter->io + AVM_ISACSX_INDEX);
8593 val = inl(adapter->io + AVM_ISACSX_DATA);
8594 spin_unlock_irqrestore(&adapter->hw_lock, flags);
8595 - DBG(0x1000, " port %#x, value %#x",
8596 + DBG(0x1000, __FUNCTION__ " port %#x, value %#x",
8600 @@ -252,7 +254,7 @@ static void fcpci2_write_isac(struct isa
8601 struct fritz_adapter *adapter = isac->priv;
8602 unsigned long flags;
8604 - DBG(0x1000, " port %#x, value %#x",
8605 + DBG(0x1000, __FUNCTION__ " port %#x, value %#x",
8607 spin_lock_irqsave(&adapter->hw_lock, flags);
8608 outl(offset, adapter->io + AVM_ISACSX_INDEX);
8609 @@ -375,6 +377,9 @@ static void hdlc_fill_fifo(struct fritz_
8611 DBG(0x40, "hdlc_fill_fifo");
8619 @@ -515,7 +520,6 @@ static inline void hdlc_xdu_irq(struct f
8621 skb_push(bcs->tx_skb, bcs->tx_cnt);
8623 - hdlc_fill_fifo(bcs);
8626 static inline void hdlc_xpr_irq(struct fritz_bcs *bcs)
8627 @@ -536,7 +540,7 @@ static inline void hdlc_xpr_irq(struct f
8628 dev_kfree_skb_irq(skb);
8631 -static void hdlc_irq_one(struct fritz_bcs *bcs, u32 stat)
8632 +static void hdlc_irq(struct fritz_bcs *bcs, u32 stat)
8634 DBG(0x10, "ch%d stat %#x", bcs->channel, stat);
8635 if (stat & HDLC_INT_RPR) {
8636 @@ -553,7 +557,7 @@ static void hdlc_irq_one(struct fritz_bc
8640 -static inline void hdlc_irq(struct fritz_adapter *adapter)
8641 +static inline void hdlc_interrupt(struct fritz_adapter *adapter)
8645 @@ -562,7 +566,7 @@ static inline void hdlc_irq(struct fritz
8646 stat = adapter->read_hdlc_status(adapter, nr);
8647 DBG(0x10, "HDLC %c stat %#x", 'A' + nr, stat);
8648 if (stat & HDLC_INT_MASK)
8649 - hdlc_irq_one(&adapter->bcs[nr], stat);
8650 + hdlc_irq(&adapter->bcs[nr], stat);
8654 @@ -584,14 +588,14 @@ static void modehdlc(struct fritz_bcs *b
8655 adapter->write_ctrl(bcs, 5);
8658 + bcs->ctrl.sr.mode = HDLC_MODE_TRANS;
8659 + adapter->write_ctrl(bcs, 5);
8660 + bcs->ctrl.sr.cmd = HDLC_CMD_XRS;
8661 + adapter->write_ctrl(bcs, 1);
8662 + bcs->ctrl.sr.cmd = 0;
8667 - bcs->tx_skb = NULL;
8668 - if (mode == L1_MODE_TRANS)
8669 - bcs->ctrl.sr.mode = HDLC_MODE_TRANS;
8671 - bcs->ctrl.sr.mode = HDLC_MODE_ITF_FLG;
8672 + bcs->ctrl.sr.mode = HDLC_MODE_ITF_FLG;
8673 adapter->write_ctrl(bcs, 5);
8674 bcs->ctrl.sr.cmd = HDLC_CMD_XRS;
8675 adapter->write_ctrl(bcs, 1);
8676 @@ -645,10 +649,10 @@ static void fcpci2_irq(int intno, void *
8678 DBG(2, "STATUS0 %#x", val);
8679 if (val & AVM_STATUS0_IRQ_ISAC)
8680 - isacsx_irq(&adapter->isac);
8681 + isacsx_interrupt(&adapter->isac);
8683 if (val & AVM_STATUS0_IRQ_HDLC)
8684 - hdlc_irq(adapter);
8685 + hdlc_interrupt(adapter);
8688 static void fcpci_irq(int intno, void *dev, struct pt_regs *regs)
8689 @@ -662,10 +666,10 @@ static void fcpci_irq(int intno, void *d
8691 DBG(2, "sval %#x", sval);
8692 if (!(sval & AVM_STATUS0_IRQ_ISAC))
8693 - isac_irq(&adapter->isac);
8694 + isac_interrupt(&adapter->isac);
8696 if (!(sval & AVM_STATUS0_IRQ_HDLC))
8697 - hdlc_irq(adapter);
8698 + hdlc_interrupt(adapter);
8701 // ----------------------------------------------------------------------
8702 @@ -681,11 +685,6 @@ static inline void fcpci_init(struct fri
8704 outb(AVM_STATUS0_DIS_TIMER | AVM_STATUS0_RES_TIMER |
8705 AVM_STATUS0_ENA_IRQ, adapter->io + AVM_STATUS0);
8707 - outb(AVM_STATUS1_ENA_IOM | adapter->irq,
8708 - adapter->io + AVM_STATUS1);
8709 - set_current_state(TASK_UNINTERRUPTIBLE);
8710 - schedule_timeout(50*HZ / 1000); /* Timeout 50ms */
8713 // ----------------------------------------------------------------------
8714 @@ -693,6 +692,7 @@ static inline void fcpci_init(struct fri
8715 static int __devinit fcpcipnp_setup(struct fritz_adapter *adapter)
8718 + struct pci_dev *pdev = adapter->pci_dev;
8722 @@ -700,21 +700,21 @@ static int __devinit fcpcipnp_setup(stru
8723 isac_init(&adapter->isac); // FIXME is this okay now
8726 - if (!request_region(adapter->io, 32, "fcpcipnp"))
8727 + if (!request_region(adapter->io, 32, "hisax_fcpcipnp"))
8730 switch (adapter->type) {
8731 case AVM_FRITZ_PCIV2:
8732 - retval = request_irq(adapter->irq, fcpci2_irq, SA_SHIRQ,
8733 - "fcpcipnp", adapter);
8734 + retval = request_irq(pdev->irq, fcpci2_irq, SA_SHIRQ,
8735 + "hisax_fcpcipnp", adapter);
8738 - retval = request_irq(adapter->irq, fcpci_irq, SA_SHIRQ,
8739 - "fcpcipnp", adapter);
8740 + retval = request_irq(pdev->irq, fcpci_irq, SA_SHIRQ,
8741 + "hisax_fcpcipnp", adapter);
8744 - retval = request_irq(adapter->irq, fcpci_irq, 0,
8745 - "fcpcipnp", adapter);
8746 + retval = request_irq(pdev->irq, fcpci_irq, 0,
8747 + "hisax_fcpcipnp", adapter);
8751 @@ -808,11 +808,23 @@ static int __devinit fcpcipnp_setup(stru
8753 static void __devexit fcpcipnp_release(struct fritz_adapter *adapter)
8755 + struct pci_dev *pdev = adapter->pci_dev;
8759 outb(0, adapter->io + AVM_STATUS0);
8760 - free_irq(adapter->irq, adapter);
8761 + free_irq(pdev->irq, adapter);
8762 release_region(adapter->io, 32);
8764 + switch (adapter->type) {
8765 + case AVM_FRITZ_PCI:
8766 + case AVM_FRITZ_PCIV2:
8767 + pci_disable_device(pdev);
8769 + case AVM_FRITZ_PNP:
8770 + pdev->deactivate(pdev);
8775 // ----------------------------------------------------------------------
8776 @@ -830,6 +842,8 @@ new_adapter(struct pci_dev *pdev)
8778 memset(adapter, 0, sizeof(struct fritz_adapter));
8780 + adapter->pci_dev = pdev;
8782 SET_MODULE_OWNER(&adapter->isac.hisax_d_if);
8783 adapter->isac.hisax_d_if.ifc.priv = &adapter->isac;
8784 adapter->isac.hisax_d_if.ifc.l2l1 = isac_d_l2l1;
8785 @@ -840,6 +854,7 @@ new_adapter(struct pci_dev *pdev)
8786 adapter->bcs[i].b_if.ifc.priv = &adapter->bcs[i];
8787 adapter->bcs[i].b_if.ifc.l2l1 = fritz_b_l2l1;
8789 + list_add(&adapter->list, &adapter_list);
8791 pci_set_drvdata(pdev, adapter);
8793 @@ -854,6 +869,7 @@ new_adapter(struct pci_dev *pdev)
8794 static void delete_adapter(struct fritz_adapter *adapter)
8796 hisax_unregister(&adapter->isac.hisax_d_if);
8797 + list_del(&adapter->list);
8801 @@ -863,12 +879,15 @@ static int __devinit fcpci_probe(struct
8802 struct fritz_adapter *adapter;
8805 + printk(KERN_INFO "hisax_fcpcipnp: found adapter %s at %s\n",
8806 + (char *) ent->driver_data, pdev->slot_name);
8809 adapter = new_adapter(pdev);
8813 - if (pdev->device == PCI_DEVICE_ID_AVM_A1_V2)
8814 + if (pdev->device == 0x0e00)
8815 adapter->type = AVM_FRITZ_PCIV2;
8817 adapter->type = AVM_FRITZ_PCI;
8818 @@ -876,12 +895,7 @@ static int __devinit fcpci_probe(struct
8819 retval = pci_enable_device(pdev);
8823 adapter->io = pci_resource_start(pdev, 1);
8824 - adapter->irq = pdev->irq;
8826 - printk(KERN_INFO "hisax_fcpcipnp: found adapter %s at %s\n",
8827 - (char *) ent->driver_data, pdev->slot_name);
8829 retval = fcpcipnp_setup(adapter);
8831 @@ -901,6 +915,9 @@ static int __devinit fcpnp_probe(struct
8832 struct fritz_adapter *adapter;
8835 + printk(KERN_INFO "hisax_fcpcipnp: found adapter %s\n",
8836 + (char *) ent->driver_data);
8839 adapter = new_adapter(pdev);
8841 @@ -912,11 +929,8 @@ static int __devinit fcpnp_probe(struct
8842 pdev->deactivate(pdev); // why?
8843 pdev->activate(pdev);
8844 adapter->io = pdev->resource[0].start;
8845 - adapter->irq = pdev->irq_resource[0].start;
8847 - printk(KERN_INFO "hisax_fcpcipnp: found adapter %s at IO %#x irq %d\n",
8848 - (char *) ent->driver_data, adapter->io, adapter->irq);
8850 + pdev->irq = pdev->irq_resource[0].start;
8852 retval = fcpcipnp_setup(adapter);
8855 @@ -929,43 +943,35 @@ static int __devinit fcpnp_probe(struct
8859 -static void __devexit fcpci_remove(struct pci_dev *pdev)
8861 - struct fritz_adapter *adapter = pci_get_drvdata(pdev);
8863 - fcpcipnp_release(adapter);
8864 - pci_disable_device(pdev);
8865 - delete_adapter(adapter);
8868 -static void __devexit fcpnp_remove(struct pci_dev *pdev)
8869 +static void __devexit fcpcipnp_remove(struct pci_dev *pdev)
8871 struct fritz_adapter *adapter = pci_get_drvdata(pdev);
8873 fcpcipnp_release(adapter);
8874 - pdev->deactivate(pdev);
8875 delete_adapter(adapter);
8878 static struct pci_driver fcpci_driver = {
8880 - probe: fcpci_probe,
8881 - remove: __devexit_p(fcpci_remove),
8883 + probe: fcpci_probe,
8884 + remove: fcpcipnp_remove,
8885 id_table: fcpci_ids,
8888 static struct isapnp_driver fcpnp_driver = {
8890 - probe: fcpnp_probe,
8891 - remove: __devexit_p(fcpnp_remove),
8893 + probe: fcpnp_probe,
8894 + remove: fcpcipnp_remove,
8895 id_table: fcpnp_ids,
8898 -static int __init hisax_fcpcipnp_init(void)
8899 +static LIST_HEAD(isapnp_drivers);
8901 +static int __init hisax_fcpci_init(void)
8903 int retval, pci_nr_found;
8905 - printk(KERN_INFO "hisax_fcpcipnp: Fritz!Card PCI/PCIv2/PnP ISDN driver v0.0.1\n");
8906 + printk(KERN_INFO "hisax_fcpcipnp: Fritz!PCI/PnP ISDN driver v0.0.1\n");
8908 retval = pci_register_driver(&fcpci_driver);
8910 @@ -976,15 +982,14 @@ static int __init hisax_fcpcipnp_init(vo
8912 goto out_unregister_pci;
8914 -#if !defined(CONFIG_HOTPLUG) || defined(MODULE)
8915 +#if !defined(CONFIG_HOTPLUG) && defined(MODULE)
8916 if (pci_nr_found + retval == 0) {
8918 goto out_unregister_isapnp;
8923 -#if !defined(CONFIG_HOTPLUG) || defined(MODULE)
8924 +#if !defined(CONFIG_HOTPLUG) && defined(MODULE)
8925 out_unregister_isapnp:
8926 isapnp_unregister_driver(&fcpnp_driver);
8928 @@ -994,11 +999,15 @@ static int __init hisax_fcpcipnp_init(vo
8932 -static void __exit hisax_fcpcipnp_exit(void)
8933 +static void __exit hisax_fcpci_exit(void)
8935 isapnp_unregister_driver(&fcpnp_driver);
8936 pci_unregister_driver(&fcpci_driver);
8939 -module_init(hisax_fcpcipnp_init);
8940 -module_exit(hisax_fcpcipnp_exit);
8941 +module_init(hisax_fcpci_init);
8942 +module_exit(hisax_fcpci_exit);
8945 +#include "hisax_isapnp.c"
8947 --- a/drivers/isdn/hisax/hisax_fcpcipnp.h
8948 +++ b/drivers/isdn/hisax/hisax_fcpcipnp.h
8949 @@ -43,10 +43,12 @@ struct fritz_bcs {
8952 struct fritz_adapter {
8953 + struct list_head list;
8954 + struct pci_dev *pci_dev;
8962 struct fritz_bcs bcs[2];
8963 --- a/drivers/isdn/hisax/hisax_isac.c
8964 +++ b/drivers/isdn/hisax/hisax_isac.c
8966 static int debug = 1;
8967 MODULE_PARM(debug, "i");
8969 -static char *ISACVer[] = {
8970 +static char *ISACVer[] __devinitdata = {
8974 @@ -42,10 +42,6 @@ static char *ISACVer[] = {
8978 -MODULE_AUTHOR("Kai Germaschewski <kai.germaschewski@gmx.de>/Karsten Keil <kkeil@suse.de>");
8979 -MODULE_DESCRIPTION("ISAC/ISAC-SX driver");
8980 -MODULE_LICENSE("GPL");
8982 #define DBG_WARN 0x0001
8983 #define DBG_IRQ 0x0002
8984 #define DBG_L1M 0x0004
8985 @@ -438,7 +434,7 @@ static void l1m_debug(struct FsmInst *fi
8989 -static void isac_version(struct isac *cs)
8990 +static void __devinit isac_version(struct isac *cs)
8994 @@ -602,7 +598,7 @@ static inline void isac_exi_interrupt(st
8998 -void isac_irq(struct isac *isac)
8999 +void isac_interrupt(struct isac *isac)
9003 @@ -635,8 +631,6 @@ void isac_irq(struct isac *isac)
9004 if (val & ISAC_ISTA_SIN) {
9005 DBG(DBG_WARN, "SIN");
9007 - isac->write_isac(isac, ISAC_MASK, 0xff);
9008 - isac->write_isac(isac, ISAC_MASK, 0x00);
9011 // ======================================================================
9012 @@ -742,7 +736,7 @@ static inline void isacsx_icd_interrupt(
9016 -void isacsx_irq(struct isac *isac)
9017 +void isacsx_interrupt(struct isac *isac)
9021 @@ -755,7 +749,7 @@ void isacsx_irq(struct isac *isac)
9022 isacsx_cic_interrupt(isac);
9025 -void isac_init(struct isac *isac)
9026 +void __devinit isac_init(struct isac *isac)
9028 isac->tx_skb = NULL;
9029 isac->l1m.fsm = &l1fsm;
9030 @@ -770,7 +764,7 @@ void isac_init(struct isac *isac)
9031 FsmInitTimer(&isac->l1m, &isac->timer);
9034 -void isac_setup(struct isac *isac)
9035 +void __devinit isac_setup(struct isac *isac)
9039 @@ -781,7 +775,7 @@ void isac_setup(struct isac *isac)
9041 isac->write_isac(isac, ISAC_MASK, 0xff);
9043 - if (test_bit(ISAC_IOM1, &isac->flags)) {
9044 + if (test_bit(HW_IOM1, &isac->flags)) {
9046 isac->write_isac(isac, ISAC_ADF2, 0x0);
9047 isac->write_isac(isac, ISAC_SPCR, 0xa);
9048 @@ -817,7 +811,7 @@ void isac_setup(struct isac *isac)
9049 FsmEvent(&isac->l1m, (val >> 2) & 0xf, NULL);
9051 isac->write_isac(isac, ISAC_MASK, 0x0);
9052 - // RESET Receiver and Transmitter
9053 + /* RESET Receiver and Transmitter */
9054 isac->write_isac(isac, ISAC_CMDR, ISAC_CMDR_XRES | ISAC_CMDR_RRES);
9057 @@ -888,10 +882,10 @@ EXPORT_SYMBOL(isac_init);
9058 EXPORT_SYMBOL(isac_d_l2l1);
9060 EXPORT_SYMBOL(isacsx_setup);
9061 -EXPORT_SYMBOL(isacsx_irq);
9062 +EXPORT_SYMBOL(isacsx_interrupt);
9064 EXPORT_SYMBOL(isac_setup);
9065 -EXPORT_SYMBOL(isac_irq);
9066 +EXPORT_SYMBOL(isac_interrupt);
9068 module_init(hisax_isac_init);
9069 module_exit(hisax_isac_exit);
9070 --- a/drivers/isdn/hisax/hisax_isac.h
9071 +++ b/drivers/isdn/hisax/hisax_isac.h
9073 #define TIMER3_VALUE 7000
9074 #define MAX_DFRAME_LEN_L1 300
9076 -#define ISAC_IOM1 0
9081 @@ -37,9 +37,9 @@ void isac_init(struct isac *isac);
9082 void isac_d_l2l1(struct hisax_if *hisax_d_if, int pr, void *arg);
9084 void isac_setup(struct isac *isac);
9085 -void isac_irq(struct isac *isac);
9086 +void isac_interrupt(struct isac *isac);
9088 void isacsx_setup(struct isac *isac);
9089 -void isacsx_irq(struct isac *isac);
9090 +void isacsx_interrupt(struct isac *isac);
9094 +++ b/drivers/isdn/hisax/hisax_isapnp.c
9097 +static const struct isapnp_device_id *
9098 +isapnp_match_device(const struct isapnp_device_id *ids, struct pci_dev *dev)
9102 + while (ids->card_vendor || ids->card_device) {
9103 + if ((ids->card_vendor == ISAPNP_ANY_ID || ids->card_vendor == dev->bus->vendor) &&
9104 + (ids->card_device == ISAPNP_ANY_ID || ids->card_device == dev->bus->device) &&
9105 + (ids->vendor == ISAPNP_ANY_ID || ids->vendor == dev->vendor) &&
9106 + (ids->function == ISAPNP_ANY_ID || ids->function == dev->device))
9114 + * pci_dev_driver - get the pci_driver of a device
9115 + * @dev: the device to query
9117 + * Returns the appropriate pci_driver structure or %NULL if there is no
9118 + * registered driver for the device.
9120 +struct pci_driver *isapnp_dev_driver(const struct pci_dev *dev)
9122 + return dev->driver;
9125 +static int isapnp_announce_device(struct isapnp_driver *drv, struct pci_dev *dev)
9127 + const struct isapnp_device_id *id;
9132 + if (drv->id_table) {
9133 + id = isapnp_match_device(drv->id_table, dev);
9141 +// dev_probe_lock();
9142 + if (drv->probe(dev, id) >= 0) {
9143 + dev->driver = (struct pci_driver *) drv;
9146 +// dev_probe_unlock();
9152 + * FIXME pci_register_driver - register a new pci driver
9153 + * @drv: the driver structure to register
9155 + * Adds the driver structure to the list of registered drivers
9156 + * Returns the number of pci devices which were claimed by the driver
9157 + * during registration. The driver remains registered even if the
9158 + * return value is zero.
9160 +int isapnp_register_driver(struct isapnp_driver *drv)
9162 + struct pci_dev *dev;
9167 + list_add_tail(&drv->node, &isapnp_drivers);
9168 + isapnp_for_each_dev(dev) {
9169 + if (!isapnp_dev_driver(dev))
9170 + count += isapnp_announce_device(drv, dev);
9176 + * pci_unregister_driver - unregister a pci driver
9177 + * @drv: the driver structure to unregister
9179 + * Deletes the driver structure from the list of registered PCI drivers,
9180 + * gives it a chance to clean up by calling its remove() function for
9181 + * each device it was responsible for, and marks those devices as
9185 +void isapnp_unregister_driver(struct isapnp_driver *drv)
9187 + struct pci_dev *dev;
9191 + list_del(&drv->node);
9192 + isapnp_for_each_dev(dev) {
9193 + if (dev->driver == (struct pci_driver *) drv) {
9196 + dev->driver = NULL;
9202 +++ b/drivers/isdn/hisax/hisax_isapnp.h
9204 +#ifndef __HISAX_ISAPNP_H__
9205 +#define __HISAX_ISAPNP_H__
9207 +#include <linux/isapnp.h>
9209 +#ifdef COMPAT_NEED_ISAPNP_DRIVER
9210 +struct isapnp_driver {
9211 + struct list_head node;
9213 + const struct isapnp_device_id *id_table; /* NULL if wants all devices */
9214 + int (*probe) (struct pci_dev *dev, const struct isapnp_device_id *id); /* New device inserted */
9215 + void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */
9220 +int isapnp_register_driver(struct isapnp_driver *drv);
9221 +void isapnp_unregister_driver(struct isapnp_driver *drv);
9225 +static inline int isapnp_register_driver(struct isapnp_driver *drv)
9230 +static inline void isapnp_unregister_driver(struct isapnp_driver *drv)
9238 +++ b/drivers/isdn/hisax/hisax_loadable.h
9240 +/* $Id: hisax_loadable.h,v 2.1 2001/06/08 22:19:16 werner Exp $
9243 + * Author (C) 2001 Werner Cornelius (werner@isdn-development.de)
9244 + * modular driver for Colognechip HFC-USB chip
9245 + * as plugin for HiSax isdn driver
9247 + * Copyright 2001 by Werner Cornelius (werner@isdn4linux.de)
9249 + * This program is free software; you can redistribute it and/or modify
9250 + * it under the terms of the GNU General Public License as published by
9251 + * the Free Software Foundation; either version 2, or (at your option)
9252 + * any later version.
9254 + * This program is distributed in the hope that it will be useful,
9255 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
9256 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9257 + * GNU General Public License for more details.
9259 + * You should have received a copy of the GNU General Public License
9260 + * along with this program; if not, write to the Free Software
9261 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
9265 +#include <linux/types.h>
9266 +#include <linux/skbuff.h>
9268 +/***************************************/
9269 +/* additional defines for l1 constants */
9270 +/***************************************/
9271 +#define B1_DATA 0x1f0
9272 +#define B1_SETMODE 0x1f4
9273 +#define B2_DATA 0x1f8
9274 +#define B2_SETMODE 0x1fc
9277 +/********************************************************/
9278 +/* structure used for register and release of L1 driver */
9279 +/********************************************************/
9280 +struct hisax_drvreg {
9281 + int version; /* actual version for check */
9282 + int cmd; /* command code */
9284 + /* function pointers set by hisax during register call */
9285 + void (*release_driver) (void *arg_hisax); /* set by hisax, release function for driver */
9286 + void (*dch_l1l2) (void *arg_hisax, int pr, void *arg); /* set by hisax, notify dch+l1 events */
9287 + void (*bch_l1l2) (void *arg_hisax, int chan, int pr, void *arg); /* set by hisax, notify bch events */
9288 + void *arg_hisax; /* argument when calling hisax main */
9289 + struct sk_buff_head *drq; /* pointer to D-receive queue */
9290 + struct sk_buff_head *dsq; /* pointer to D-send queue */
9291 + struct sk_buff_head erq; /* E-receive queue */
9292 + struct sk_buff_head *brq[2]; /* pointer to B-receive queues */
9293 + struct sk_buff **bsk[2]; /* pointer to B-transmit buffer */
9295 + /* function pointers set by l1 driver before calling the register function */
9296 + void (*dch_l2l1) (void *argl1, int pr, void *arg); /* function dch+l1 from hisax -> l1 */
9297 + void (*bch_l2l1) (void *argl1, int chan, int pr, void *arg); /* function bch from hisax -> l1 */
9298 + void *argl1; /* pointer to l1 data structure when calling l1 */
9300 + char *drvname; /* driver name for hisax usage */
9303 +/**************************/
9304 +/* constants and commands */
9305 +/**************************/
9306 +#define HISAX_LOAD_VERSION 4 /* change when interface changes */
9307 +#define HISAX_LOAD_CHKVER 0 /* check version command (returns 0 on success) */
9308 +#define HISAX_LOAD_REGISTER 1 /* register the L1 driver and return 0 on success */
9310 +/***************************************/
9311 +/* definition of the register function */
9312 +/***************************************/
9313 +extern int hisax_register_hfcusb(struct hisax_drvreg *l1drv);
9314 --- a/drivers/isdn/hisax/hscx.c
9315 +++ b/drivers/isdn/hisax/hscx.c
9317 -/* $Id: hscx.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9318 +/* $Id: hscx.c,v 1.24 2001/09/24 13:22:56 kai Exp $
9320 * HSCX specific routines
9322 --- a/drivers/isdn/hisax/hscx.h
9323 +++ b/drivers/isdn/hisax/hscx.h
9325 -/* $Id: hscx.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9326 +/* $Id: hscx.h,v 1.8 2001/09/24 13:22:56 kai Exp $
9328 * HSCX specific defines
9330 --- a/drivers/isdn/hisax/hscx_irq.c
9331 +++ b/drivers/isdn/hisax/hscx_irq.c
9333 -/* $Id: hscx_irq.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9334 +/* $Id: hscx_irq.c,v 1.18 2001/09/24 13:22:56 kai Exp $
9336 * low level b-channel stuff for Siemens HSCX
9338 --- a/drivers/isdn/hisax/icc.c
9339 +++ b/drivers/isdn/hisax/icc.c
9341 -/* $Id: icc.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9342 +/* $Id: icc.c,v 1.8 2001/09/24 13:22:56 kai Exp $
9344 * ICC specific routines
9346 --- a/drivers/isdn/hisax/icc.h
9347 +++ b/drivers/isdn/hisax/icc.h
9349 -/* $Id: icc.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9350 +/* $Id: icc.h,v 1.4 2001/09/24 13:22:56 kai Exp $
9352 * ICC specific routines
9354 --- a/drivers/isdn/hisax/ipac.h
9355 +++ b/drivers/isdn/hisax/ipac.h
9357 -/* $Id: ipac.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9358 +/* $Id: ipac.h,v 1.7 2001/09/24 13:22:56 kai Exp $
9360 * IPAC specific defines
9362 --- a/drivers/isdn/hisax/isac.c
9363 +++ b/drivers/isdn/hisax/isac.c
9365 -/* $Id: isac.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9366 +/* $Id: isac.c,v 1.31 2001/09/24 13:22:56 kai Exp $
9368 * ISAC specific routines
9370 --- a/drivers/isdn/hisax/isac.h
9371 +++ b/drivers/isdn/hisax/isac.h
9373 -/* $Id: isac.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9374 +/* $Id: isac.h,v 1.9 2001/09/24 13:22:56 kai Exp $
9376 * ISAC specific defines
9378 --- a/drivers/isdn/hisax/isar.c
9379 +++ b/drivers/isdn/hisax/isar.c
9381 -/* $Id: isar.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9382 +/* $Id: isar.c,v 1.22 2001/09/23 12:00:05 keil Exp $
9384 * isar.c ISAR (Siemens PSB 7110) specific routines
9390 -#define FAXMODCNT 13
9391 -const u_char faxmodulation[] = {3,24,48,72,73,74,96,97,98,121,122,145,146};
9392 -static u_int modmask = 0x1fff;
9393 -static int frm_extra_delay = 2;
9394 -static int para_TOA = 6;
9395 -const u_char *FC1_CMD[] = {"FAE", "FTS", "FRS", "FTM", "FRM", "FTH", "FRH", "CTRL" };
9397 +const u_char faxmodulation_s[] = "3,24,48,72,73,74,96,97,98,121,122,145,146";
9398 +const u_char faxmodulation[] = {3,24,48,72,73,74,96,97,98,121,122,145,146};
9399 +#define FAXMODCNT 13
9401 void isar_setup(struct IsdnCardState *cs);
9402 static void isar_pump_cmd(struct BCState *bcs, u_char cmd, u_char para);
9403 @@ -127,7 +125,7 @@ get_irq_infos(struct IsdnCardState *cs,
9404 ireg->clsb = cs->BC_Read_Reg(cs, 1, ISAR_CTRL_L);
9406 if (cs->debug & L1_DEB_HSCX)
9407 - debugl1(cs, "irq_stat(%02x,%02x,%d)", ireg->iis, ireg->cmsb,
9408 + debugl1(cs, "rcv_mbox(%02x,%02x,%d)", ireg->iis, ireg->cmsb,
9412 @@ -414,7 +412,6 @@ isar_load_firmware(struct IsdnCardState
9419 restore_flags(flags);
9420 @@ -428,21 +425,6 @@ reterror:
9425 -ll_deliver_faxstat(struct BCState *bcs, u_char status)
9428 - struct Channel *chanp = (struct Channel *) bcs->st->lli.userdata;
9430 - if (bcs->cs->debug & L1_DEB_HSCX)
9431 - debugl1(bcs->cs, "HL->LL FAXIND %x", status);
9432 - ic.driver = bcs->cs->myid;
9433 - ic.command = ISDN_STAT_FAXIND;
9434 - ic.arg = chanp->chan;
9435 - ic.parm.aux.cmd = status;
9436 - bcs->cs->iif.statcallb(&ic);
9439 extern void BChannel_bh(struct BCState *);
9440 #define B_LL_NOCARRIER 8
9441 #define B_LL_CONNECT 9
9442 @@ -599,6 +581,7 @@ isar_rcv_frame(struct IsdnCardState *cs,
9443 if (ireg->cmsb & SART_NMD) { /* ABORT */
9444 if (cs->debug & L1_DEB_WARN)
9445 debugl1(cs, "isar_rcv_frame: no more data");
9446 + cs->BC_Write_Reg(cs, 1, ISAR_IIA, 0);
9447 bcs->hw.isar.rcvidx = 0;
9449 sendmsg(cs, SET_DPS(bcs->hw.isar.dpath) |
9450 @@ -609,6 +592,7 @@ isar_rcv_frame(struct IsdnCardState *cs,
9453 printk(KERN_WARNING "HiSax: skb out of memory\n");
9454 + cs->BC_Write_Reg(cs, 1, ISAR_IIA, 0);
9458 @@ -633,9 +617,8 @@ isar_rcv_frame(struct IsdnCardState *cs,
9459 bcs->hw.isar.rcvidx = 0;
9460 cs->BC_Write_Reg(cs, 1, ISAR_IIA, 0);
9462 - if (ireg->cmsb & HDLC_FSD) {
9463 + if (ireg->cmsb & HDLC_FSD)
9464 bcs->hw.isar.rcvidx = 0;
9466 ptr = bcs->hw.isar.rcvbuf + bcs->hw.isar.rcvidx;
9467 bcs->hw.isar.rcvidx += ireg->clsb;
9468 rcv_mbox(cs, ireg, ptr);
9469 @@ -646,8 +629,6 @@ isar_rcv_frame(struct IsdnCardState *cs,
9470 if (cs->debug & L1_DEB_WARN)
9471 debugl1(cs, "isar frame to short %d",
9472 bcs->hw.isar.rcvidx);
9473 - printk(KERN_WARNING "ISAR: frame to short %d\n",
9474 - bcs->hw.isar.rcvidx);
9475 } else if (!(skb = dev_alloc_skb(bcs->hw.isar.rcvidx))) {
9476 printk(KERN_WARNING "ISAR: receive out of memory\n");
9478 @@ -658,7 +639,6 @@ isar_rcv_frame(struct IsdnCardState *cs,
9479 isar_sched_event(bcs, B_RCVBUFREADY);
9481 isar_sched_event(bcs, B_LL_OK);
9482 - test_and_clear_bit(BC_FLG_FRH_WAIT, &bcs->Flag);
9484 bcs->hw.isar.rcvidx = 0;
9486 @@ -666,14 +646,13 @@ isar_rcv_frame(struct IsdnCardState *cs,
9487 if (ireg->cmsb & SART_NMD) { /* ABORT */
9488 if (cs->debug & L1_DEB_WARN)
9489 debugl1(cs, "isar_rcv_frame: no more data");
9490 + cs->BC_Write_Reg(cs, 1, ISAR_IIA, 0);
9491 bcs->hw.isar.rcvidx = 0;
9492 + send_DLE_ETX(bcs);
9493 sendmsg(cs, SET_DPS(bcs->hw.isar.dpath) |
9494 ISAR_HIS_PUMPCTRL, PCTRL_CMD_ESC, 0, NULL);
9495 bcs->hw.isar.state = STFAX_ESCAPE;
9496 - if (test_and_clear_bit(BC_FLG_FRH_WAIT, &bcs->Flag)) {
9497 - send_DLE_ETX(bcs);
9498 - isar_sched_event(bcs, B_LL_NOCARRIER);
9500 + isar_sched_event(bcs, B_LL_NOCARRIER);
9504 @@ -977,6 +956,21 @@ isar_pump_statev_modem(struct BCState *b
9509 +ll_deliver_faxstat(struct BCState *bcs, u_char status)
9512 + struct Channel *chanp = (struct Channel *) bcs->st->lli.userdata;
9514 + if (bcs->cs->debug & L1_DEB_HSCX)
9515 + debugl1(bcs->cs, "HL->LL FAXIND %x", status);
9516 + ic.driver = bcs->cs->myid;
9517 + ic.command = ISDN_STAT_FAXIND;
9518 + ic.arg = chanp->chan;
9519 + ic.parm.aux.cmd = status;
9520 + bcs->cs->iif.statcallb(&ic);
9524 isar_pump_statev_fax(struct BCState *bcs, u_char devt) {
9525 struct IsdnCardState *cs = bcs->cs;
9526 @@ -1081,22 +1075,19 @@ isar_pump_statev_fax(struct BCState *bcs
9527 if (cs->debug & L1_DEB_HSCX)
9528 debugl1(cs, "pump stev RSP_DISC");
9529 if (bcs->hw.isar.state == STFAX_ESCAPE) {
9531 switch(bcs->hw.isar.newcmd) {
9533 bcs->hw.isar.state = STFAX_READY;
9535 - case PCTRL_CMD_FTM:
9538 + case PCTRL_CMD_FTM:
9540 sendmsg(cs, dps | ISAR_HIS_PUMPCTRL,
9541 PCTRL_CMD_SILON, 1, &p1);
9542 bcs->hw.isar.state = STFAX_SILDET;
9544 - case PCTRL_CMD_FRM:
9545 - if (frm_extra_delay)
9546 - mdelay(frm_extra_delay);
9548 + case PCTRL_CMD_FRM:
9549 p1 = bcs->hw.isar.mod = bcs->hw.isar.newmod;
9550 bcs->hw.isar.newmod = 0;
9551 bcs->hw.isar.cmd = bcs->hw.isar.newcmd;
9552 @@ -1215,9 +1206,6 @@ isar_int_main(struct IsdnCardState *cs)
9553 isar_pump_statev_modem(bcs, ireg->cmsb);
9554 } else if (bcs->mode == L1_MODE_FAX) {
9555 isar_pump_statev_fax(bcs, ireg->cmsb);
9556 - } else if (ireg->cmsb == PSEV_10MS_TIMER) {
9557 - if (cs->debug & L1_DEB_HSCX)
9558 - debugl1(cs, "pump stev TIMER");
9560 if (cs->debug & L1_DEB_WARN)
9561 debugl1(cs, "isar IIS_PSTEV pmode %d stat %x",
9562 @@ -1278,9 +1266,6 @@ ftimer_handler(struct BCState *bcs) {
9563 if (test_and_clear_bit(BC_FLG_LL_CONN, &bcs->Flag)) {
9564 isar_sched_event(bcs, B_LL_CONNECT);
9566 - if (test_and_clear_bit(BC_FLG_FTI_FTS, &bcs->Flag)) {
9567 - isar_sched_event(bcs, B_LL_OK);
9572 @@ -1303,7 +1288,7 @@ setup_pump(struct BCState *bcs) {
9574 param[5] = PV32P6_ATN;
9576 - param[0] = para_TOA; /* 6 db */
9577 + param[0] = 6; /* 6 db */
9578 param[1] = PV32P2_V23R | PV32P2_V22A | PV32P2_V22B |
9579 PV32P2_V22C | PV32P2_V21 | PV32P2_BEL;
9580 param[2] = PV32P3_AMOD | PV32P3_V32B | PV32P3_V23B;
9581 @@ -1319,7 +1304,7 @@ setup_pump(struct BCState *bcs) {
9583 param[1] = PFAXP2_ATN;
9585 - param[0] = para_TOA; /* 6 db */
9586 + param[0] = 6; /* 6 db */
9587 sendmsg(cs, dps | ISAR_HIS_PUMPCFG, ctrl, 2, param);
9588 bcs->hw.isar.state = STFAX_NULL;
9589 bcs->hw.isar.newcmd = 0;
9590 @@ -1348,6 +1333,7 @@ setup_sart(struct BCState *bcs) {
9596 sendmsg(cs, dps | ISAR_HIS_SARTCFG, SMODE_HDLC, 1,
9598 @@ -1359,9 +1345,6 @@ setup_sart(struct BCState *bcs) {
9599 sendmsg(cs, dps | ISAR_HIS_SARTCFG, ctrl, 2,
9603 - /* SART must not configured with FAX */
9607 sendmsg(cs, dps | ISAR_HIS_BSTREQ, 0, 0, NULL);
9608 @@ -1465,7 +1448,6 @@ isar_pump_cmd(struct BCState *bcs, u_cha
9611 case ISDN_FAX_CLASS1_FTM:
9612 - test_and_clear_bit(BC_FLG_FRH_WAIT, &bcs->Flag);
9613 if (bcs->hw.isar.state == STFAX_READY) {
9615 ctrl = PCTRL_CMD_FTM;
9616 @@ -1489,7 +1471,6 @@ isar_pump_cmd(struct BCState *bcs, u_cha
9619 case ISDN_FAX_CLASS1_FTH:
9620 - test_and_clear_bit(BC_FLG_FRH_WAIT, &bcs->Flag);
9621 if (bcs->hw.isar.state == STFAX_READY) {
9623 ctrl = PCTRL_CMD_FTH;
9624 @@ -1513,7 +1494,6 @@ isar_pump_cmd(struct BCState *bcs, u_cha
9627 case ISDN_FAX_CLASS1_FRM:
9628 - test_and_clear_bit(BC_FLG_FRH_WAIT, &bcs->Flag);
9629 if (bcs->hw.isar.state == STFAX_READY) {
9631 ctrl = PCTRL_CMD_FRM;
9632 @@ -1537,7 +1517,6 @@ isar_pump_cmd(struct BCState *bcs, u_cha
9635 case ISDN_FAX_CLASS1_FRH:
9636 - test_and_set_bit(BC_FLG_FRH_WAIT, &bcs->Flag);
9637 if (bcs->hw.isar.state == STFAX_READY) {
9639 ctrl = PCTRL_CMD_FRH;
9640 @@ -1560,11 +1539,6 @@ isar_pump_cmd(struct BCState *bcs, u_cha
9641 bcs->hw.isar.state = STFAX_ESCAPE;
9644 - case ISDN_FAXPUMP_HALT:
9645 - bcs->hw.isar.state = STFAX_NULL;
9647 - ctrl = PCTRL_CMD_HALT;
9651 sendmsg(cs, dps | ISAR_HIS_PUMPCTRL, ctrl, nom, &p1);
9652 @@ -1658,15 +1632,6 @@ isar_l2l1(struct PStack *st, int pr, voi
9653 l1_msg_b(st, pr, arg);
9655 case (PH_DEACTIVATE | CONFIRM):
9656 - switch(st->l1.mode) {
9657 - case L1_MODE_TRANS:
9658 - case L1_MODE_HDLC:
9662 - isar_pump_cmd(st->l1.bcs, ISDN_FAXPUMP_HALT, 0);
9665 test_and_clear_bit(BC_FLG_ACTIV, &st->l1.bcs->Flag);
9666 test_and_clear_bit(BC_FLG_BUSY, &st->l1.bcs->Flag);
9667 if (st->l1.bcs->cs->debug & L1_DEB_HSCX)
9668 @@ -1758,51 +1723,6 @@ isar_auxcmd(struct IsdnCardState *cs, is
9669 test_and_set_bit(BC_FLG_DLEETX,
9672 - case ISDN_FAX_CLASS1_FTS:
9673 - if (ic->parm.aux.subcmd == AT_QUERY) {
9674 - ic->command = ISDN_STAT_FAXIND;
9675 - ic->parm.aux.cmd = ISDN_FAX_CLASS1_OK;
9676 - cs->iif.statcallb(ic);
9678 - } else if (ic->parm.aux.subcmd == AT_EQ_QUERY) {
9679 - strcpy(ic->parm.aux.para, "0-255");
9680 - ic->command = ISDN_STAT_FAXIND;
9681 - ic->parm.aux.cmd = ISDN_FAX_CLASS1_QUERY;
9682 - cs->iif.statcallb(ic);
9684 - } else if (ic->parm.aux.subcmd == AT_EQ_VALUE) {
9685 - if (cs->debug & L1_DEB_HSCX)
9686 - debugl1(cs, "isar_auxcmd %s=%d",
9687 - FC1_CMD[ic->parm.aux.cmd], ic->parm.aux.para[0]);
9688 - if (bcs->hw.isar.state == STFAX_READY) {
9689 - if (! ic->parm.aux.para[0]) {
9690 - ic->command = ISDN_STAT_FAXIND;
9691 - ic->parm.aux.cmd = ISDN_FAX_CLASS1_OK;
9692 - cs->iif.statcallb(ic);
9695 - if (! test_and_set_bit(BC_FLG_FTI_RUN, &bcs->Flag)) {
9697 - bcs->hw.isar.ftimer.expires =
9698 - jiffies + ((ic->parm.aux.para[0] * 10 * HZ)/1000);
9699 - test_and_set_bit(BC_FLG_FTI_FTS, &bcs->Flag);
9700 - add_timer(&bcs->hw.isar.ftimer);
9704 - debugl1(cs, "isar FTS=%d and FTI busy",
9705 - ic->parm.aux.para[0]);
9709 - debugl1(cs, "isar FTS=%d and isar.state not ready(%x)",
9710 - ic->parm.aux.para[0],bcs->hw.isar.state);
9712 - ic->command = ISDN_STAT_FAXIND;
9713 - ic->parm.aux.cmd = ISDN_FAX_CLASS1_ERROR;
9714 - cs->iif.statcallb(ic);
9717 case ISDN_FAX_CLASS1_FRM:
9718 case ISDN_FAX_CLASS1_FRH:
9719 case ISDN_FAX_CLASS1_FTM:
9720 @@ -1815,24 +1735,16 @@ isar_auxcmd(struct IsdnCardState *cs, is
9721 cs->iif.statcallb(ic);
9723 } else if (ic->parm.aux.subcmd == AT_EQ_QUERY) {
9724 - char *p = ic->parm.aux.para;
9725 - for(i=0;i<FAXMODCNT;i++)
9726 - if ((1<<i) & modmask)
9727 - p += sprintf(p, "%d,", faxmodulation[i]);
9730 + strcpy(ic->parm.aux.para, faxmodulation_s);
9731 ic->command = ISDN_STAT_FAXIND;
9732 ic->parm.aux.cmd = ISDN_FAX_CLASS1_QUERY;
9733 cs->iif.statcallb(ic);
9735 } else if (ic->parm.aux.subcmd == AT_EQ_VALUE) {
9736 - if (cs->debug & L1_DEB_HSCX)
9737 - debugl1(cs, "isar_auxcmd %s=%d",
9738 - FC1_CMD[ic->parm.aux.cmd], ic->parm.aux.para[0]);
9739 for(i=0;i<FAXMODCNT;i++)
9740 if (faxmodulation[i]==ic->parm.aux.para[0])
9742 - if ((i < FAXMODCNT) && ((1<<i) & modmask) &&
9743 + if ((FAXMODCNT > i) &&
9744 test_bit(BC_FLG_INIT, &bcs->Flag)) {
9747 @@ -1850,7 +1762,7 @@ isar_auxcmd(struct IsdnCardState *cs, is
9749 case (ISDN_CMD_IOCTL):
9751 - case 9: /* load firmware */
9752 + case (9): /* load firmware */
9753 features = ISDN_FEATURE_L2_MODEM |
9754 ISDN_FEATURE_L2_FAX |
9755 ISDN_FEATURE_L3_FCLASS1;
9756 @@ -1860,26 +1772,6 @@ isar_auxcmd(struct IsdnCardState *cs, is
9758 ll_run(cs, features);
9761 - features = *(unsigned int *) ic->parm.num;
9762 - printk(KERN_DEBUG "HiSax: max modulation old(%04x) new(%04x)\n",
9763 - modmask, features);
9764 - modmask = features;
9767 - features = *(unsigned int *) ic->parm.num;
9768 - printk(KERN_DEBUG "HiSax: FRM extra delay old(%d) new(%d) ms\n",
9769 - frm_extra_delay, features);
9770 - if (features >= 0)
9771 - frm_extra_delay = features;
9774 - features = *(unsigned int *) ic->parm.num;
9775 - printk(KERN_DEBUG "HiSax: TOA old(%d) new(%d) db\n",
9776 - para_TOA, features);
9777 - if (features >= 0 && features < 32)
9778 - para_TOA = features;
9781 printk(KERN_DEBUG "HiSax: invalid ioctl %d\n",
9783 --- a/drivers/isdn/hisax/isar.h
9784 +++ b/drivers/isdn/hisax/isar.h
9786 -/* $Id: isar.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9787 +/* $Id: isar.h,v 1.11 2001/09/24 13:22:56 kai Exp $
9789 * ISAR (Siemens PSB 7110) specific defines
9792 #define ISAR_HIS_FIRM 0x1e
9793 #define ISAR_HIS_STDSP 0x08
9794 #define ISAR_HIS_DIAG 0x05
9795 -#define ISAR_HIS_WAITSTATE 0x27
9796 -#define ISAR_HIS_TIMERIRQ 0x25
9797 #define ISAR_HIS_P0CFG 0x3c
9798 #define ISAR_HIS_P12CFG 0x24
9799 #define ISAR_HIS_SARTCFG 0x25
9801 #define ISAR_HIS_DPS2 0x80
9802 #define SET_DPS(x) ((x<<6) & 0xc0)
9804 -#define ISAR_CMD_TIMERIRQ_OFF 0x20
9805 -#define ISAR_CMD_TIMERIRQ_ON 0x21
9808 #define ISAR_IIS_MSCMSD 0x3f
9809 #define ISAR_IIS_VNR 0x15
9810 #define ISAR_IIS_DKEY 0x03
9812 #define STFAX_ESCAPE 5
9813 #define STFAX_SILDET 6
9815 -#define ISDN_FAXPUMP_HALT 100
9817 extern int ISARVersion(struct IsdnCardState *cs, char *s);
9818 extern void isar_int_main(struct IsdnCardState *cs);
9819 extern void initisar(struct IsdnCardState *cs);
9820 --- a/drivers/isdn/hisax/isdnl1.c
9821 +++ b/drivers/isdn/hisax/isdnl1.c
9823 -/* $Id: isdnl1.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9824 +/* $Id: isdnl1.c,v 2.46 2001/09/24 13:22:56 kai Exp $
9826 * common low level stuff for Siemens Chipsetbased isdn cards
9832 -const char *l1_revision = "$Revision: 1.1.4.1 $";
9833 +const char *l1_revision = "$Revision: 2.46 $";
9835 #define __NO_VERSION__
9836 #include <linux/init.h>
9837 --- a/drivers/isdn/hisax/isdnl1.h
9838 +++ b/drivers/isdn/hisax/isdnl1.h
9840 -/* $Id: isdnl1.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9841 +/* $Id: isdnl1.h,v 2.12 2001/09/24 13:22:56 kai Exp $
9845 --- a/drivers/isdn/hisax/isdnl2.c
9846 +++ b/drivers/isdn/hisax/isdnl2.c
9848 -/* $Id: isdnl2.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9849 +/* $Id: isdnl2.c,v 2.30 2001/09/24 13:22:56 kai Exp $
9851 * Author Karsten Keil
9852 * based on the teles driver from Jan den Ouden
9857 -const char *l2_revision = "$Revision: 1.1.4.1 $";
9858 +const char *l2_revision = "$Revision: 2.30 $";
9860 static void l2m_debug(struct FsmInst *fi, char *fmt, ...);
9862 @@ -1418,8 +1418,8 @@ l2_st5_tei_remove(struct FsmInst *fi, in
9866 - st5_dl_release_l2l3(st);
9867 FsmChangeState(fi, ST_L2_1);
9868 + st5_dl_release_l2l3(st);
9872 --- a/drivers/isdn/hisax/isdnl2.h
9873 +++ b/drivers/isdn/hisax/isdnl2.h
9875 -/* $Id: isdnl2.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9880 --- a/drivers/isdn/hisax/isdnl3.c
9881 +++ b/drivers/isdn/hisax/isdnl3.c
9883 -/* $Id: isdnl3.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9884 +/* $Id: isdnl3.c,v 2.22 2001/09/24 13:22:56 kai Exp $
9886 * Author Karsten Keil
9887 * based on the teles driver from Jan den Ouden
9890 #include <linux/config.h>
9892 -const char *l3_revision = "$Revision: 1.1.4.1 $";
9893 +const char *l3_revision = "$Revision: 2.22 $";
9895 static struct Fsm l3fsm;
9897 --- a/drivers/isdn/hisax/isdnl3.h
9898 +++ b/drivers/isdn/hisax/isdnl3.h
9900 -/* $Id: isdnl3.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9903 * This software may be used and distributed according to the terms
9904 * of the GNU General Public License, incorporated herein by reference.
9905 --- a/drivers/isdn/hisax/isurf.c
9906 +++ b/drivers/isdn/hisax/isurf.c
9908 -/* $Id: isurf.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9909 +/* $Id: isurf.c,v 1.12 2001/09/24 13:22:56 kai Exp $
9911 * low level stuff for Siemens I-Surf/I-Talk cards
9917 -#include <linux/isapnp.h>
9919 extern const char *CardType[];
9921 -static const char *ISurf_revision = "$Revision: 1.1.4.1 $";
9922 +static const char *ISurf_revision = "$Revision: 1.12 $";
9924 #define byteout(addr,val) outb(val,addr)
9925 #define bytein(addr) inb(addr)
9926 @@ -128,8 +127,10 @@ void
9927 release_io_isurf(struct IsdnCardState *cs)
9929 release_region(cs->hw.isurf.reset, 1);
9930 +#ifdef COMPAT_HAS_ISA_IOREMAP
9931 iounmap((unsigned char *)cs->hw.isurf.isar);
9932 release_mem_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE);
9937 @@ -194,10 +195,6 @@ isurf_auxcmd(struct IsdnCardState *cs, i
9938 return(isar_auxcmd(cs, ic));
9942 -static struct pci_bus *pnp_surf __devinitdata = NULL;
9946 setup_isurf(struct IsdnCard *card)
9948 @@ -215,58 +212,9 @@ setup_isurf(struct IsdnCard *card)
9949 cs->hw.isurf.phymem = card->para[2];
9950 cs->irq = card->para[0];
9953 - struct pci_bus *pb;
9954 - struct pci_dev *pd;
9956 - if (isapnp_present()) {
9958 - if ((pb = isapnp_find_card(
9959 - ISAPNP_VENDOR('S', 'I', 'E'),
9960 - ISAPNP_FUNCTION(0x0010), pnp_surf))) {
9963 - if (!(pd = isapnp_find_dev(pnp_surf,
9964 - ISAPNP_VENDOR('S', 'I', 'E'),
9965 - ISAPNP_FUNCTION(0x0010), pd))) {
9966 - printk(KERN_ERR "ISurfPnP: PnP error card found, no device\n");
9970 - pd->deactivate(pd);
9972 - /* The ISA-PnP logic apparently
9973 - * expects upper limit address to be
9974 - * set. Since the isa-pnp module
9975 - * doesn't do this, so we have to make
9978 - isapnp_cfg_begin(pd->bus->number, pd->devfn);
9979 - isapnp_write_word(ISAPNP_CFG_MEM+3,
9980 - pd->resource[8].end >> 8);
9982 - cs->hw.isurf.reset = pd->resource[0].start;
9983 - cs->hw.isurf.phymem = pd->resource[8].start;
9984 - cs->irq = pd->irq_resource[0].start;
9985 - if (!cs->irq || !cs->hw.isurf.reset || !cs->hw.isurf.phymem) {
9986 - printk(KERN_ERR "ISurfPnP:some resources are missing %d/%x/%lx\n",
9987 - cs->irq, cs->hw.isurf.reset, cs->hw.isurf.phymem);
9988 - pd->deactivate(pd);
9992 - printk(KERN_INFO "ISurfPnP: no ISAPnP card found\n");
9996 - printk(KERN_INFO "ISurfPnP: no ISAPnP bus found\n");
10000 printk(KERN_WARNING "HiSax: %s port/mem not set\n",
10001 CardType[card->typ]);
10005 if (check_region(cs->hw.isurf.reset, 1)) {
10006 printk(KERN_WARNING
10007 @@ -277,6 +225,7 @@ setup_isurf(struct IsdnCard *card)
10009 request_region(cs->hw.isurf.reset, 1, "isurf isdn");
10011 +#ifdef COMPAT_HAS_ISA_IOREMAP
10012 if (check_mem_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE)) {
10013 printk(KERN_WARNING
10014 "HiSax: %s memory region %lx-%lx already in use\n",
10015 @@ -292,6 +241,10 @@ setup_isurf(struct IsdnCard *card)
10016 cs->hw.isurf.isar =
10017 (unsigned long) ioremap(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE);
10018 cs->hw.isurf.isac = cs->hw.isurf.isar + ISURF_ISAC_OFFSET;
10020 + cs->hw.isurf.isar = cs->hw.isurf.phymem + ISURF_ISAR_OFFSET;
10021 + cs->hw.isurf.isac = cs->hw.isurf.phymem + ISURF_ISAC_OFFSET;
10024 "ISurf: defined at 0x%x 0x%lx IRQ %d\n",
10025 cs->hw.isurf.reset,
10026 --- a/drivers/isdn/hisax/ix1_micro.c
10027 +++ b/drivers/isdn/hisax/ix1_micro.c
10029 -/* $Id: ix1_micro.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10030 +/* $Id: ix1_micro.c,v 2.12 2001/09/24 13:22:56 kai Exp $
10032 * low level stuff for ITK ix1-micro Rev.2 isdn cards
10033 * derived from the original file teles3.c from Karsten Keil
10034 @@ -19,14 +19,13 @@
10036 #define __NO_VERSION__
10037 #include <linux/init.h>
10038 -#include <linux/isapnp.h>
10042 #include "isdnl1.h"
10044 extern const char *CardType[];
10045 -const char *ix1_revision = "$Revision: 1.1.4.1 $";
10046 +const char *ix1_revision = "$Revision: 2.12 $";
10048 #define byteout(addr,val) outb(val,addr)
10049 #define bytein(addr) inb(addr)
10050 @@ -219,21 +218,6 @@ ix1_card_msg(struct IsdnCardState *cs, i
10055 -static struct isapnp_device_id itk_ids[] __initdata = {
10056 - { ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x25),
10057 - ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x25),
10058 - (unsigned long) "ITK micro 2" },
10059 - { ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x29),
10060 - ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x29),
10061 - (unsigned long) "ITK micro 2." },
10065 -static struct isapnp_device_id *idev = &itk_ids[0];
10066 -static struct pci_bus *pnp_c __devinitdata = NULL;
10071 setup_ix1micro(struct IsdnCard *card)
10072 @@ -246,45 +230,6 @@ setup_ix1micro(struct IsdnCard *card)
10073 if (cs->typ != ISDN_CTYPE_IX1MICROR2)
10077 - if (!card->para[1] && isapnp_present()) {
10078 - struct pci_bus *pb;
10079 - struct pci_dev *pd;
10081 - while(idev->card_vendor) {
10082 - if ((pb = isapnp_find_card(idev->card_vendor,
10083 - idev->card_device, pnp_c))) {
10086 - if ((pd = isapnp_find_dev(pnp_c,
10087 - idev->vendor, idev->function, pd))) {
10088 - printk(KERN_INFO "HiSax: %s detected\n",
10089 - (char *)idev->driver_data);
10091 - pd->deactivate(pd);
10092 - pd->activate(pd);
10093 - card->para[1] = pd->resource[0].start;
10094 - card->para[0] = pd->irq_resource[0].start;
10095 - if (!card->para[0] || !card->para[1]) {
10096 - printk(KERN_ERR "ITK PnP:some resources are missing %ld/%lx\n",
10097 - card->para[0], card->para[1]);
10098 - pd->deactivate(pd);
10103 - printk(KERN_ERR "ITK PnP: PnP error card found, no device\n");
10109 - if (!idev->card_vendor) {
10110 - printk(KERN_INFO "ITK PnP: no ISAPnP card found\n");
10116 cs->hw.ix1.isac_ale = card->para[1] + ISAC_COMMAND_OFFSET;
10117 cs->hw.ix1.hscx_ale = card->para[1] + HSCX_COMMAND_OFFSET;
10118 --- a/drivers/isdn/hisax/jade.c
10119 +++ b/drivers/isdn/hisax/jade.c
10121 -/* $Id: jade.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10122 +/* $Id: jade.c,v 1.9 2001/09/24 13:22:56 kai Exp $
10124 * JADE stuff (derived from original hscx.c)
10126 --- a/drivers/isdn/hisax/jade.h
10127 +++ b/drivers/isdn/hisax/jade.h
10129 -/* $Id: jade.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10130 +/* $Id: jade.h,v 1.5 2001/09/24 13:22:56 kai Exp $
10132 * JADE specific defines
10134 --- a/drivers/isdn/hisax/jade_irq.c
10135 +++ b/drivers/isdn/hisax/jade_irq.c
10137 -/* $Id: jade_irq.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10138 +/* $Id: jade_irq.c,v 1.7 2001/09/24 13:22:56 kai Exp $
10140 * Low level JADE IRQ stuff (derived from original hscx_irq.c)
10142 --- a/drivers/isdn/hisax/l3_1tr6.c
10143 +++ b/drivers/isdn/hisax/l3_1tr6.c
10145 -/* $Id: l3_1tr6.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10146 +/* $Id: l3_1tr6.c,v 2.15 2001/09/24 13:22:56 kai Exp $
10148 * German 1TR6 D-channel protocol
10151 #include <linux/ctype.h>
10153 extern char *HiSax_getrev(const char *revision);
10154 -const char *l3_1tr6_revision = "$Revision: 1.1.4.1 $";
10155 +const char *l3_1tr6_revision = "$Revision: 2.15 $";
10157 #define MsgHead(ptr, cref, mty, dis) \
10159 --- a/drivers/isdn/hisax/l3_1tr6.h
10160 +++ b/drivers/isdn/hisax/l3_1tr6.h
10162 -/* $Id: l3_1tr6.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10165 * German 1TR6 D-channel protocol defines
10167 --- a/drivers/isdn/hisax/l3dss1.c
10168 +++ b/drivers/isdn/hisax/l3dss1.c
10170 -/* $Id: l3dss1.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10171 +/* $Id: l3dss1.c,v 2.32 2001/09/24 13:22:56 kai Exp $
10173 * EURO/DSS1 D-channel protocol
10176 #include <linux/config.h>
10178 extern char *HiSax_getrev(const char *revision);
10179 -const char *dss1_revision = "$Revision: 1.1.4.1 $";
10180 +const char *dss1_revision = "$Revision: 2.32 $";
10182 #define EXT_BEARER_CAPS 1
10184 --- a/drivers/isdn/hisax/l3dss1.h
10185 +++ b/drivers/isdn/hisax/l3dss1.h
10187 -/* $Id: l3dss1.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10190 * DSS1 (Euro) D-channel protocol defines
10192 --- a/drivers/isdn/hisax/l3ni1.c
10193 +++ b/drivers/isdn/hisax/l3ni1.c
10195 -/* $Id: l3ni1.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10196 +/* $Id: l3ni1.c,v 2.8 2001/09/24 13:22:56 kai Exp $
10198 * NI1 D-channel protocol
10201 #include <linux/ctype.h>
10203 extern char *HiSax_getrev(const char *revision);
10204 -const char *ni1_revision = "$Revision: 1.1.4.1 $";
10205 +const char *ni1_revision = "$Revision: 2.8 $";
10207 #define EXT_BEARER_CAPS 1
10209 --- a/drivers/isdn/hisax/l3ni1.h
10210 +++ b/drivers/isdn/hisax/l3ni1.h
10212 -/* $Id: l3ni1.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10215 * NI1 D-channel protocol
10217 --- a/drivers/isdn/hisax/lmgr.c
10218 +++ b/drivers/isdn/hisax/lmgr.c
10220 -/* $Id: lmgr.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10223 * Layermanagement module
10225 --- a/drivers/isdn/hisax/md5sums.asc
10226 +++ b/drivers/isdn/hisax/md5sums.asc
10228 ------BEGIN PGP SIGNED MESSAGE-----
10231 # This are valid md5sums for certificated HiSax driver.
10232 # The certification is valid only if the md5sums of all files match.
10233 # The certification is valid only for ELSA Microlink PCI,
10234 -# Eicon Technology Diva 2.01 PCI, Sedlbauer SpeedFax+,
10235 -# HFC-S PCI A based cards and HFC-S USB based ISDN
10236 -# terminal adapters in the moment.
10237 +# Eicon Technology Diva 2.01 PCI, Sedlbauer SpeedFax+,
10238 +# HFC-S PCI A based cards and HFC-S USB based isdn tas
10240 # Read ../../../Documentation/isdn/HiSax.cert for more informations.
10242 -cd4a9917e1147039d5dfc66440d42054 isac.c
10243 -211840e78b56c9d4753be9c85da21a50 isdnl1.c
10244 -5ce9b1fff42a02f9c2eb4fb81c701b1f isdnl2.c
10245 -6948de0c43513dd23c6706feb5fc2209 isdnl3.c
10246 -3730780b69368218d756024165efea79 tei.c
10247 -16e72710eb58da01415b877490f5d2ac callc.c
10248 -6abc55c77e0f3149ae9334f3257a1a1a cert.c
10249 -27bdb2800d4590e00da20eff241edc47 l3dss1.c
10250 -df8bb877b854c4302d396b554e4e84ef l3_1tr6.c
10251 -9d8b4bed15370063d1b16e47080f50e1 elsa.c
10252 -210f4a3f1eebca70229d786b15cf3e90 diva.c
10253 -4ddf21079dd77e892380f789bae250a7 sedlbauer.c
10254 -8200d818771e3cbdef2a3c3e818d25ac hfc_pci.c
10255 +6f9433a8b696076562562d090e3c420f isac.c
10256 +13c3eed869f5139f44c563e3a8fea1f5 isdnl1.c
10257 +addcff863b0ff1e366c0f2ae9fa6e81e isdnl2.c
10258 +7076deb94a363945c21ea27aca4a720a isdnl3.c
10259 +51c603829b6cc4f8421f744ad657ceff tei.c
10260 +669050ab5079f02887ed0239d86e5474 callc.c
10261 +ecacd146b8f8881ef9349935dab3df4a cert.c
10262 +fadeb3b85bb23bc1ac48470c0848d6fa l3dss1.c
10263 +cf7dec9fac6283716904d26b99188476 l3_1tr6.c
10264 +2f75c8765e1be13d114d5f4433cf364b elsa.c
10265 +b4cf8a4dceed9ea6dcba65a85b4eecc7 diva.c
10266 +dee3f8f40c6fe78a4b57729804b7e6cd sedlbauer.c
10267 +0d79fe6dfc5bfaa4826970c41a6d273d hfc_pci.c
10269 ------BEGIN PGP SIGNATURE-----
10270 -Version: GnuPG v1.0.6 (GNU/Linux)
10271 -Comment: For info see http://www.gnupg.org
10273 -iD8DBQE9rE91DiY0VZsg4ukRAkKfAJ4xWUfqjc0hW+V+JPue5yr7mrt+RwCdGdSf
10274 -GIKgAEdRLzERmpt/bCCwAbY=
10276 ------END PGP SIGNATURE-----
10277 --- a/drivers/isdn/hisax/mic.c
10278 +++ b/drivers/isdn/hisax/mic.c
10280 -/* $Id: mic.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10281 +/* $Id: mic.c,v 1.12 2001/09/24 13:22:56 kai Exp $
10283 * low level stuff for mic cards
10287 extern const char *CardType[];
10289 -const char *mic_revision = "$Revision: 1.1.4.1 $";
10290 +const char *mic_revision = "$Revision: 1.12 $";
10292 #define byteout(addr,val) outb(val,addr)
10293 #define bytein(addr) inb(addr)
10294 --- a/drivers/isdn/hisax/netjet.c
10295 +++ b/drivers/isdn/hisax/netjet.c
10297 -/* $Id: netjet.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10298 +/* $Id: netjet.c,v 1.29 2001/09/24 13:22:56 kai Exp $
10300 * low level stuff for Traverse Technologie NETJet ISDN cards
10303 * This software may be used and distributed according to the terms
10304 * of the GNU General Public License, incorporated herein by reference.
10306 - * Thanks to Traverse Technologies Australia for documents and information
10308 - * 16-Apr-2002 - led code added - Guy Ellis (guy@traverse.com.au)
10309 + * Thanks to Traverse Technologie Australia for documents and information
10314 #include <asm/io.h>
10315 #include "netjet.h"
10317 -const char *NETjet_revision = "$Revision: 1.1.4.1 $";
10318 +const char *NETjet_revision = "$Revision: 1.29 $";
10320 /* Interface functions */
10322 @@ -135,7 +133,6 @@ void
10323 mode_tiger(struct BCState *bcs, int mode, int bc)
10325 struct IsdnCardState *cs = bcs->cs;
10328 if (cs->debug & L1_DEB_HSCX)
10329 debugl1(cs, "Tiger mode %d bchan %d/%d",
10330 @@ -157,15 +154,6 @@ mode_tiger(struct BCState *bcs, int mode
10331 cs->hw.njet.dmactrl);
10332 byteout(cs->hw.njet.base + NETJET_IRQMASK0, 0);
10334 - if (cs->typ == ISDN_CTYPE_NETJET_S)
10338 - led = 0x01 << (6 + led); // convert to mask
10340 - cs->hw.njet.auxd &= led;
10341 - byteout(cs->hw.njet.auxa, cs->hw.njet.auxd);
10344 case (L1_MODE_TRANS):
10346 @@ -191,14 +179,6 @@ mode_tiger(struct BCState *bcs, int mode
10347 bcs->hw.tiger.sendp = bcs->hw.tiger.send;
10348 bcs->hw.tiger.free = NETJET_DMA_TXSIZE;
10349 test_and_set_bit(BC_FLG_EMPTY, &bcs->Flag);
10350 - if (cs->typ == ISDN_CTYPE_NETJET_S)
10354 - led = 0x01 << (6 + led); // convert to mask
10355 - cs->hw.njet.auxd |= led;
10356 - byteout(cs->hw.njet.auxa, cs->hw.njet.auxd);
10360 if (cs->debug & L1_DEB_HSCX)
10361 @@ -874,13 +854,9 @@ tiger_l2l1(struct PStack *st, int pr, vo
10362 case (PH_ACTIVATE | REQUEST):
10363 test_and_set_bit(BC_FLG_ACTIV, &st->l1.bcs->Flag);
10364 mode_tiger(st->l1.bcs, st->l1.mode, st->l1.bc);
10365 - /* 2001/10/04 Christoph Ersfeld, Formula-n Europe AG */
10366 - st->l1.bcs->cs->cardmsg(st->l1.bcs->cs, MDL_BC_ASSIGN, (void *)(&st->l1.bc));
10367 l1_msg_b(st, pr, arg);
10369 case (PH_DEACTIVATE | REQUEST):
10370 - /* 2001/10/04 Christoph Ersfeld, Formula-n Europe AG */
10371 - st->l1.bcs->cs->cardmsg(st->l1.bcs->cs, MDL_BC_RELEASE, (void *)(&st->l1.bc));
10372 l1_msg_b(st, pr, arg);
10374 case (PH_DEACTIVATE | CONFIRM):
10375 --- a/drivers/isdn/hisax/netjet.h
10376 +++ b/drivers/isdn/hisax/netjet.h
10378 -/* $Id: netjet.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10379 +/* $Id: netjet.h,v 2.8 2001/09/24 13:22:56 kai Exp $
10381 * NETjet common header file
10383 --- a/drivers/isdn/hisax/niccy.c
10384 +++ b/drivers/isdn/hisax/niccy.c
10386 -/* $Id: niccy.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10387 +/* $Id: niccy.c,v 1.21 2001/10/20 22:05:00 kai Exp $
10389 * low level stuff for Dr. Neuhaus NICCY PnP and NICCY PCI and
10390 * compatible (SAGEM cybermodem)
10391 @@ -22,10 +22,10 @@
10393 #include "isdnl1.h"
10394 #include <linux/pci.h>
10395 -#include <linux/isapnp.h>
10396 +#include <linux/isdn_compat.h>
10398 extern const char *CardType[];
10399 -const char *niccy_revision = "$Revision: 1.1.4.1 $";
10400 +const char *niccy_revision = "$Revision: 1.21 $";
10402 #define byteout(addr,val) outb(val,addr)
10403 #define bytein(addr) inb(addr)
10404 @@ -239,9 +239,6 @@ niccy_card_msg(struct IsdnCardState *cs,
10407 static struct pci_dev *niccy_dev __initdata = NULL;
10409 -static struct pci_bus *pnp_c __devinitdata = NULL;
10413 setup_niccy(struct IsdnCard *card)
10414 @@ -253,39 +250,7 @@ setup_niccy(struct IsdnCard *card)
10415 printk(KERN_INFO "HiSax: Niccy driver Rev. %s\n", HiSax_getrev(tmp));
10416 if (cs->typ != ISDN_CTYPE_NICCY)
10419 - if (!card->para[1] && isapnp_present()) {
10420 - struct pci_bus *pb;
10421 - struct pci_dev *pd;
10423 - if ((pb = isapnp_find_card(
10424 - ISAPNP_VENDOR('S', 'D', 'A'),
10425 - ISAPNP_FUNCTION(0x0150), pnp_c))) {
10428 - if (!(pd = isapnp_find_dev(pnp_c,
10429 - ISAPNP_VENDOR('S', 'D', 'A'),
10430 - ISAPNP_FUNCTION(0x0150), pd))) {
10431 - printk(KERN_ERR "NiccyPnP: PnP error card found, no device\n");
10435 - pd->deactivate(pd);
10436 - pd->activate(pd);
10437 - card->para[1] = pd->resource[0].start;
10438 - card->para[2] = pd->resource[1].start;
10439 - card->para[0] = pd->irq_resource[0].start;
10440 - if (!card->para[0] || !card->para[1] || !card->para[2]) {
10441 - printk(KERN_ERR "NiccyPnP:some resources are missing %ld/%lx/%lx\n",
10442 - card->para[0], card->para[1], card->para[2]);
10443 - pd->deactivate(pd);
10447 - printk(KERN_INFO "NiccyPnP: no ISAPnP card found\n");
10452 if (card->para[1]) {
10453 cs->hw.niccy.isac = card->para[1] + ISAC_PNP;
10454 cs->hw.niccy.hscx = card->para[1] + HSCX_PNP;
10455 @@ -331,12 +296,12 @@ setup_niccy(struct IsdnCard *card)
10458 cs->irq = niccy_dev->irq;
10459 - cs->hw.niccy.cfg_reg = pci_resource_start(niccy_dev, 0);
10460 + cs->hw.niccy.cfg_reg = pci_resource_start_io(niccy_dev, 0);
10461 if (!cs->hw.niccy.cfg_reg) {
10462 printk(KERN_WARNING "Niccy: No IO-Adr for PCI cfg found\n");
10465 - pci_ioaddr = pci_resource_start(niccy_dev, 1);
10466 + pci_ioaddr = pci_resource_start_io(niccy_dev, 1);
10468 printk(KERN_WARNING "Niccy: No IO-Adr for PCI card found\n");
10470 --- a/drivers/isdn/hisax/nj_s.c
10471 +++ b/drivers/isdn/hisax/nj_s.c
10473 -/* $Id: nj_s.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10474 +/* $Id: nj_s.c,v 2.13 2001/09/24 13:22:56 kai Exp $
10476 * This software may be used and distributed according to the terms
10477 * of the GNU General Public License, incorporated herein by reference.
10478 @@ -12,11 +12,12 @@
10480 #include "isdnl1.h"
10481 #include <linux/pci.h>
10482 +#include <linux/isdn_compat.h>
10483 #include <linux/interrupt.h>
10484 #include <linux/ppp_defs.h>
10485 #include "netjet.h"
10487 -const char *NETjet_S_revision = "$Revision: 1.1.4.1 $";
10488 +const char *NETjet_S_revision = "$Revision: 2.13 $";
10490 static u_char dummyrr(struct IsdnCardState *cs, int chan, u_char off)
10492 @@ -130,7 +131,6 @@ NETjet_S_card_msg(struct IsdnCardState *
10493 release_io_netjet(cs);
10496 - reset_netjet_s(cs);
10498 clear_pending_isac_ints(cs);
10500 @@ -180,19 +180,11 @@ setup_netjet_s(struct IsdnCard *card)
10501 printk(KERN_WARNING "NETjet-S: No IRQ for PCI card found\n");
10504 - cs->hw.njet.base = pci_resource_start(dev_netjet, 0);
10505 + cs->hw.njet.base = pci_resource_start_io(dev_netjet, 0);
10506 if (!cs->hw.njet.base) {
10507 printk(KERN_WARNING "NETjet-S: No IO-Adr for PCI card found\n");
10510 - /* 2001/10/04 Christoph Ersfeld, Formula-n Europe AG www.formula-n.com */
10511 - if ((dev_netjet->subsystem_vendor == 0x55) &&
10512 - (dev_netjet->subsystem_device == 0x02)) {
10513 - printk(KERN_WARNING "Netjet: You tried to load this driver with an incompatible TigerJet-card\n");
10514 - printk(KERN_WARNING "Use type=41 for Formula-n enter:now ISDN PCI and compatible\n");
10517 - /* end new code */
10519 printk(KERN_WARNING "NETjet-S: No PCI card found\n");
10521 @@ -263,6 +255,7 @@ setup_netjet_s(struct IsdnCard *card)
10523 request_region(cs->hw.njet.base, bytecnt, "netjet-s isdn");
10525 + reset_netjet_s(cs);
10526 cs->readisac = &NETjet_ReadIC;
10527 cs->writeisac = &NETjet_WriteIC;
10528 cs->readisacfifo = &NETjet_ReadICfifo;
10529 --- a/drivers/isdn/hisax/nj_u.c
10530 +++ b/drivers/isdn/hisax/nj_u.c
10532 -/* $Id: nj_u.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10533 +/* $Id: nj_u.c,v 2.14 2001/09/24 13:22:56 kai Exp $
10535 * This software may be used and distributed according to the terms
10536 * of the GNU General Public License, incorporated herein by reference.
10537 @@ -12,11 +12,12 @@
10539 #include "isdnl1.h"
10540 #include <linux/pci.h>
10541 +#include <linux/isdn_compat.h>
10542 #include <linux/interrupt.h>
10543 #include <linux/ppp_defs.h>
10544 #include "netjet.h"
10546 -const char *NETjet_U_revision = "$Revision: 1.1.4.1 $";
10547 +const char *NETjet_U_revision = "$Revision: 2.14 $";
10549 static u_char dummyrr(struct IsdnCardState *cs, int chan, u_char off)
10551 @@ -181,7 +182,7 @@ setup_netjet_u(struct IsdnCard *card)
10552 printk(KERN_WARNING "NETspider-U: No IRQ for PCI card found\n");
10555 - cs->hw.njet.base = pci_resource_start(dev_netjet, 0);
10556 + cs->hw.njet.base = pci_resource_start_io(dev_netjet, 0);
10557 if (!cs->hw.njet.base) {
10558 printk(KERN_WARNING "NETspider-U: No IO-Adr for PCI card found\n");
10560 --- a/drivers/isdn/hisax/q931.c
10561 +++ b/drivers/isdn/hisax/q931.c
10563 -/* $Id: q931.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10564 +/* $Id: q931.c,v 1.12 2001/09/24 13:22:56 kai Exp $
10566 * code to decode ITU Q.931 call control messages
10568 @@ -197,6 +197,31 @@ struct MessageType mt_n1[] =
10570 #define MT_N1_LEN (sizeof(mt_n1) / sizeof(struct MessageType))
10573 +static struct MessageType fac_1tr6[] =
10575 + {FAC_Sperre, "Sperre"},
10576 + {FAC_Forward1, "Forward 1"},
10577 + {FAC_Forward2, "Forward 2"},
10578 + {FAC_Konferenz, "Konferenz"},
10579 + {FAC_GrabBchan, "Grab Bchannel"},
10580 + {FAC_Reactivate, "Reactivate"},
10581 + {FAC_Konferenz3, "Dreier Konferenz"},
10582 + {FAC_Dienstwechsel1, "Einseitiger Dienstwechsel"},
10583 + {FAC_Dienstwechsel2, "Zweiseitiger Dienstwechsel"},
10584 + {FAC_NummernIdent, "Rufnummer-Identifizierung"},
10585 + {FAC_GBG, "GBG"},
10586 + {FAC_DisplayUebergeben, "Display Uebergeben"},
10587 + {FAC_DisplayUmgeleitet, "Display Umgeleitet"},
10588 + {FAC_Unterdruecke, "Unterdruecke Rufnummer"},
10589 + {FAC_Deactivate, "Deactivate"},
10590 + {FAC_Activate, "Activate"},
10591 + {FAC_SPV, "SPV"},
10592 + {FAC_Rueckwechsel, "Rueckwechsel"},
10593 + {FAC_Umleitung, "Umleitung"}
10595 +#define FAC_1TR6_LEN (sizeof(fac_1tr6) / sizeof(struct MessageType))
10599 prbits(char *dest, u_char b, int start, int len)
10601 +++ b/drivers/isdn/hisax/rawhdlc.c
10603 +/* $Id: rawhdlc.c,v 1.7 2001/09/24 13:22:57 kai Exp $
10605 + * support routines for cards that don't support HDLC
10607 + * Author Brent Baccala
10608 + * Copyright by Karsten Keil <keil@isdn4linux.de>
10609 + * by Brent Baccala <baccala@FreeSoft.org>
10611 + * This software may be used and distributed according to the terms
10612 + * of the GNU General Public License, incorporated herein by reference.
10615 + * Some passive ISDN cards, such as the Traverse NETJet and the AMD 7930,
10616 + * don't perform HDLC encapsulation over the B channel. Drivers for
10617 + * such cards use support routines in this file to perform B channel HDLC.
10619 + * Bit-synchronous HDLC encapsulation is a means of encapsulating packets
10620 + * over a continuously transmitting serial communications link.
10621 + * It looks like this:
10623 + * 11111111101111110...........0111111011111111111
10624 + * iiiiiiiiiffffffffdddddddddddffffffffiiiiiiiiiii
10626 + * i = idle f = flag d = data
10628 + * When idle, the channel sends a continuous string of ones (mark
10629 + * idle; illustrated), or a continuous string of flag characters (flag
10630 + * idle). The beginning of a data frame is marked by a flag character
10631 + * (01111110), then comes the actual data, followed by another flag
10632 + * character, after which another frame may be sent immediately (a
10633 + * single flag may serve as both the end of one frame and the start of
10634 + * the next), or the link may return to idle. Obviously, the flag
10635 + * character can not appear anywhere in the data (or a false
10636 + * end-of-frame would occur), so the transmitter performs
10637 + * "bit-stuffing" - inserting a zero bit after every five one bits,
10638 + * irregardless of the original bit after the five ones. Byte
10639 + * ordering is irrelevent at this point - the data is treated as a
10640 + * string of bits, not bytes. Since no more than 5 ones may now occur
10641 + * in a row, the flag sequence, with its 6 ones, is unique.
10643 + * Upon reception, a zero bit that occur after 5 one bits is simply
10644 + * discarded. A series of 6 one bits is end-of-frame, and a series of
10645 + * 7 one bits is an abort. Once bit-stuffing has been corrected for,
10646 + * an integer number of bytes should now be present. The last two
10647 + * of these bytes form the Frame Check Sequence, a CRC that is verified
10648 + * and then discarded. Note that bit-stuffing is performed on the FCS
10649 + * just as if it were regular data.
10653 + * int make_raw_hdlc_data(u_char *src, u_int slen,
10654 + * u_char *dst, u_int dsize)
10656 + * Used for transmission. Copies slen bytes from src to dst, performing
10657 + * HDLC encapsulation (flag bytes, bit-stuffing, CRC) in the process.
10658 + * dsize is size of destination buffer, and should be at least
10659 + * ((6*slen)/5)+5 bytes to ensure adequate space will be available.
10660 + * Function returns length (in bytes) of valid destination buffer, or
10661 + * 0 upon destination overflow.
10663 + * void init_hdlc_state(struct hdlc_state *stateptr, int mode)
10665 + * Initializes hdlc_state structure before first call to read_raw_hdlc_data
10667 + * mode = 0: Sane mode
10669 + * Insane mode; NETJet use a shared unsigned int memory block (
10670 + * with busmaster DMA), the bit pattern of every word is
10671 + * <8 B1> <8 B2> <8 Mon> <2 D> <4 C/I> <MX> <MR>
10672 + * according to Siemens IOM-2 interface, so we have to handle
10673 + * the src buffer as unsigned int and have to shift/mask the
10674 + * B-channel bytes.
10675 + * mode 1 -> B1 mode 2 -> B2 data is used
10677 + * int read_raw_hdlc_data(struct hdlc_state *saved_state,
10678 + * u_char *src, u_int slen,
10679 + * u_char *dst, u_int dsize)
10681 + * Used for reception. Scans source buffer bit-by-bit looking for
10682 + * valid HDLC frames, which are copied to destination buffer. HDLC
10683 + * state information is stored in a structure, which allows this
10684 + * function to process frames spread across several blocks of raw
10685 + * HDLC data. Part of the state information is bit offsets into
10686 + * the source and destination buffers.
10688 + * A return value >0 indicates the length of a valid frame, now
10689 + * stored in the destination buffer. In this case, the source
10690 + * buffer might not be completely processed, so this function should
10691 + * be called again with the same source buffer, possibly with a
10692 + * different destination buffer.
10694 + * A return value of zero indicates that the source buffer was
10695 + * completely processed without finding a valid end-of-packet;
10696 + * however, we might be in the middle of packet reception, so
10697 + * the function should be called again with the next block of
10698 + * raw HDLC data and the same destination buffer. It is NOT
10699 + * permitted to change the destination buffer in this case,
10700 + * since data may already have begun to be stored there.
10702 + * A return value of -1 indicates some kind of error - destination
10703 + * buffer overflow, CRC check failed, frame not a multiple of 8
10704 + * bits. Destination buffer probably contains invalid data, which
10705 + * should be discarded. Call function again with same source buffer
10706 + * and a new (or same) destination buffer.
10708 + * Suggested calling sequence:
10710 + * init_hdlc_state(...);
10711 + * for (EACH_RAW_DATA_BLOCK) {
10712 + * while (len = read_raw_hdlc_data(...)) {
10713 + * if (len == -1) DISCARD_FRAME;
10714 + * else PROCESS_FRAME;
10719 + * Test the code in this file as follows:
10720 + * gcc -DDEBUGME -o rawhdlctest rawhdlc.c
10721 + * ./rawhdlctest < rawdata
10723 + * The file "rawdata" can be easily generated from a HISAX B-channel
10724 + * hex dump (CF CF CF 02 ...) using the following perl script:
10727 + * @hexlist = split ' ';
10728 + * while ($hexstr = shift(@hexlist)) {
10729 + * printf "%c", hex($hexstr);
10736 +#include <stdio.h>
10739 +#include <linux/types.h>
10740 +#include <linux/ppp_defs.h>
10741 +#include "rawhdlc.h"
10743 +/* There's actually an identical copy of this table in the PPP code
10744 + * (ppp_crc16_table), but I don't want this code dependent on PPP
10748 +__u16 fcstab[256] =
10750 + 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
10751 + 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7,
10752 + 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e,
10753 + 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876,
10754 + 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd,
10755 + 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5,
10756 + 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c,
10757 + 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974,
10758 + 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb,
10759 + 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3,
10760 + 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a,
10761 + 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72,
10762 + 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9,
10763 + 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1,
10764 + 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738,
10765 + 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70,
10766 + 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7,
10767 + 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff,
10768 + 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036,
10769 + 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e,
10770 + 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5,
10771 + 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd,
10772 + 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134,
10773 + 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c,
10774 + 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3,
10775 + 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb,
10776 + 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232,
10777 + 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a,
10778 + 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1,
10779 + 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9,
10780 + 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330,
10781 + 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78
10784 +#define HDLC_ZERO_SEARCH 0
10785 +#define HDLC_FLAG_SEARCH 1
10786 +#define HDLC_FLAG_FOUND 2
10787 +#define HDLC_FRAME_FOUND 3
10788 +#define HDLC_NULL 4
10789 +#define HDLC_PART 5
10790 +#define HDLC_FULL 6
10792 +#define HDLC_FLAG_VALUE 0x7e
10795 +#define MAKE_RAW_BYTE for (j=0; j<8; j++) { \
10800 + out_val |= 0x80;\
10803 + out_val &= 0x7f;\
10805 + if (bitcnt==8) {\
10806 + if (d_cnt == dsize) return 0;\
10807 + dst[d_cnt++] = out_val;\
10810 + if (s_one == 5) {\
10812 + out_val &= 0x7f;\
10816 + if (bitcnt==8) {\
10817 + if (d_cnt == dsize) return 0;\
10818 + dst[d_cnt++] = out_val;\
10824 +/* Optimization suggestion: If needed, this function could be
10825 + * dramatically sped up using a state machine. Each state would
10826 + * correspond to having seen N one bits, and being offset M bits into
10827 + * the current output byte. N ranges from 0 to 4, M from 0 to 7, so
10828 + * we need 5*8 = 35 states. Each state would have a table with 256
10829 + * entries, one for each input character. Each entry would contain
10830 + * three output characters, an output state, an a byte increment
10831 + * that's either 1 or 2. All this could fit in four bytes; so we need
10832 + * 4 bytes * 256 characters = 1 KB for each state (35 KB total). Zero
10833 + * the output buffer before you start. For each character in your
10834 + * input, you look it up in the current state's table and get three
10835 + * bytes to be or'ed into the output at the current byte offset, and
10836 + * an byte increment to move your pointer forward. A simple Perl
10837 + * script could generate the tables. Given HDLC semantics, probably
10838 + * would be better to set output to all 1s, then use ands instead of ors.
10839 + * A smaller state machine could operate on nibbles instead of bytes.
10840 + * A state machine for 32-bit architectures could use word offsets
10841 + * instead of byte offsets, requiring 5*32 = 160 states; probably
10842 + * best to work on nibbles in such a case.
10846 +int make_raw_hdlc_data(u_char *src, u_int slen, u_char *dst, u_int dsize)
10848 + register u_int i,d_cnt=0;
10849 + register u_char j;
10850 + register u_char val;
10851 + register u_char s_one = 0;
10852 + register u_char out_val = 0;
10853 + register u_char bitcnt = 0;
10857 + dst[d_cnt++] = HDLC_FLAG_VALUE;
10858 + fcs = PPP_INITFCS;
10859 + for (i=0; i<slen; i++) {
10861 + fcs = PPP_FCS (fcs, val);
10865 + val = fcs & 0xff;
10867 + val = (fcs>>8) & 0xff;
10869 + val = HDLC_FLAG_VALUE;
10870 + for (j=0; j<8; j++) {
10878 + if (d_cnt == dsize) return 0;
10879 + dst[d_cnt++] = out_val;
10885 + while (8>bitcnt++) {
10889 + if (d_cnt == dsize) return 0;
10890 + dst[d_cnt++] = out_val;
10896 +void init_hdlc_state(struct hdlc_state *stateptr, int mode)
10898 + stateptr->state = HDLC_ZERO_SEARCH;
10899 + stateptr->r_one = 0;
10900 + stateptr->r_val = 0;
10901 + stateptr->o_bitcnt = 0;
10902 + stateptr->i_bitcnt = 0;
10903 + stateptr->insane_mode = mode;
10906 +/* Optimization suggestion: A similar state machine could surely
10907 + * be developed for this function as well.
10910 +int read_raw_hdlc_data(struct hdlc_state *saved_state,
10911 + u_char *src, u_int slen, u_char *dst, u_int dsize)
10914 + register u_char val;
10915 + register u_char state = saved_state->state;
10916 + register u_char r_one = saved_state->r_one;
10917 + register u_char r_val = saved_state->r_val;
10918 + register u_int o_bitcnt = saved_state->o_bitcnt;
10919 + register u_int i_bitcnt = saved_state->i_bitcnt;
10920 + register u_int fcs = saved_state->fcs;
10921 + register u_int *isrc = (u_int *) src;
10923 + /* Use i_bitcnt (bit offset into source buffer) to reload "val"
10924 + * in case we're starting up again partway through a source buffer
10927 + if ((i_bitcnt >> 3) < slen) {
10928 + if (saved_state->insane_mode==1) {
10929 + val = isrc[(i_bitcnt >> 3)] & 0xff;
10930 + } else if (saved_state->insane_mode==2) {
10931 + val = (isrc[i_bitcnt >> 3] >>8) & 0xff;
10933 + val = src[i_bitcnt >> 3];
10935 + val >>= i_bitcnt & 7;
10938 + /* One bit per loop. Keep going until we've got something to
10939 + * report (retval != 0), or we exhaust the source buffer
10942 + while ((retval == 0) && ((i_bitcnt >> 3) < slen)) {
10943 + if ((i_bitcnt & 7) == 0) {
10944 + if (saved_state->insane_mode==1) {
10945 + val = isrc[(i_bitcnt >> 3)] & 0xff;
10946 + } else if (saved_state->insane_mode==2) {
10947 + val = (isrc[i_bitcnt >> 3] >>8) & 0xff;
10949 + val = src[i_bitcnt >> 3];
10952 + printf("Input byte %d: 0x%2x\n", i_bitcnt>>3, val);
10954 + if (val == 0xff) {
10955 + state = HDLC_ZERO_SEARCH;
10964 + /* printf("Data bit=%d (%d/%d)\n", val&1, i_bitcnt>>3, i_bitcnt&7);*/
10967 + if (state == HDLC_ZERO_SEARCH) {
10972 + state= HDLC_FLAG_SEARCH;
10974 + } else if (state == HDLC_FLAG_SEARCH) {
10978 + state=HDLC_ZERO_SEARCH;
10984 + state=HDLC_FLAG_FOUND;
10988 + } else if (state == HDLC_FLAG_FOUND) {
10992 + state=HDLC_ZERO_SEARCH;
11006 + } else if (r_one!=5) {
11013 + if ((state != HDLC_ZERO_SEARCH) &&
11014 + !(o_bitcnt & 7)) {
11016 + printf("HDLC_FRAME_FOUND at i_bitcnt:%d\n",i_bitcnt);
11018 + state=HDLC_FRAME_FOUND;
11019 + fcs = PPP_INITFCS;
11021 + fcs = PPP_FCS (fcs, r_val);
11023 + } else if (state == HDLC_FRAME_FOUND) {
11027 + state=HDLC_ZERO_SEARCH;
11039 + if (o_bitcnt & 7) {
11040 + /* Alignment error */
11042 + printf("Alignment error\n");
11044 + state=HDLC_FLAG_SEARCH;
11046 + } else if (fcs==PPP_GOODFCS) {
11047 + /* Valid frame */
11048 + state=HDLC_FLAG_FOUND;
11049 + retval = (o_bitcnt>>3)-3;
11053 + printf("CRC error; fcs was 0x%x, should have been 0x%x\n", fcs, PPP_GOODFCS);
11055 + state=HDLC_FLAG_FOUND;
11058 + } else if (r_one==5) {
11070 + if ((state == HDLC_FRAME_FOUND) &&
11071 + !(o_bitcnt & 7)) {
11072 + if ((o_bitcnt>>3)>=dsize) {
11073 + /* Buffer overflow error */
11075 + printf("Buffer overflow error\n");
11078 + state=HDLC_FLAG_SEARCH;
11081 + dst[(o_bitcnt>>3)-1] = r_val;
11082 + fcs = PPP_FCS (fcs, r_val);
11084 + printf("Output byte %d: 0x%02x; FCS 0x%04x\n", (o_bitcnt>>3)-1, r_val, fcs);
11093 + /* We exhausted the source buffer before anything else happened
11094 + * (retval==0). Reset i_bitcnt in expectation of a new source
11095 + * buffer. Other, we either had an error or a valid frame, so
11096 + * reset o_bitcnt in expectation of a new destination buffer.
11099 + if (retval == 0) {
11105 + saved_state->state = state;
11106 + saved_state->r_one = r_one;
11107 + saved_state->r_val = r_val;
11108 + saved_state->fcs = fcs;
11109 + saved_state->o_bitcnt = o_bitcnt;
11110 + saved_state->i_bitcnt = i_bitcnt;
11119 +char buffer[1024];
11120 +char obuffer[1024];
11126 + struct hdlc_state hdlc_state;
11128 + while((buffer[buflen] = getc(stdin)) != EOF && buflen<1024) buflen++;
11130 + printf("buflen = %d\n", buflen);
11132 + init_hdlc_state(&hdlc_state, 0);
11134 + while (len = read_raw_hdlc_data(&hdlc_state,buffer,buflen,obuffer,1024)) {
11135 + if (len == -1) printf("Error @ byte %d/bit %d\n",
11136 + hdlc_state.i_bitcnt>>3, hdlc_state.i_bitcnt & 7);
11138 + printf("Frame received: len %d\n", len);
11142 + printf("Done\n");
11147 +++ b/drivers/isdn/hisax/rawhdlc.h
11149 +/* $Id: rawhdlc.h,v 1.5 2001/09/24 13:22:57 kai Exp $
11151 + * Author Brent Baccala
11152 + * Copyright by Brent Baccala <baccala@FreeSoft.org>
11154 + * This software may be used and distributed according to the terms
11155 + * of the GNU General Public License, incorporated herein by reference.
11160 +struct hdlc_state {
11161 + char insane_mode;
11171 +int make_raw_hdlc_data(u_char *src, u_int slen, u_char *dst, u_int dsize);
11172 +void init_hdlc_state(struct hdlc_state *stateptr, int mode);
11173 +int read_raw_hdlc_data(struct hdlc_state *saved_state,
11174 + u_char *src, u_int slen, u_char *dst, u_int dsize);
11177 --- a/drivers/isdn/hisax/s0box.c
11178 +++ b/drivers/isdn/hisax/s0box.c
11180 -/* $Id: s0box.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
11181 +/* $Id: s0box.c,v 2.6 2001/09/24 13:22:57 kai Exp $
11183 * low level stuff for Creatix S0BOX
11186 #include "isdnl1.h"
11188 extern const char *CardType[];
11189 -const char *s0box_revision = "$Revision: 1.1.4.1 $";
11190 +const char *s0box_revision = "$Revision: 2.6 $";
11193 writereg(unsigned int padr, signed int addr, u_char off, u_char val) {
11194 --- a/drivers/isdn/hisax/saphir.c
11195 +++ b/drivers/isdn/hisax/saphir.c
11197 -/* $Id: saphir.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
11198 +/* $Id: saphir.c,v 1.10 2001/09/24 13:22:57 kai Exp $
11200 * low level stuff for HST Saphir 1
11203 #include "isdnl1.h"
11205 extern const char *CardType[];
11206 -static char *saphir_rev = "$Revision: 1.1.4.1 $";
11207 +static char *saphir_rev = "$Revision: 1.10 $";
11209 #define byteout(addr,val) outb(val,addr)
11210 #define bytein(addr) inb(addr)
11211 --- a/drivers/isdn/hisax/sedlbauer.c
11212 +++ b/drivers/isdn/hisax/sedlbauer.c
11214 -/* $Id: sedlbauer.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
11215 +/* $Id: sedlbauer.c,v 1.34 2002/02/09 21:00:57 keil Exp $
11217 * low level stuff for Sedlbauer cards
11218 * includes support for the Sedlbauer speed star (speed star II),
11219 @@ -48,18 +48,19 @@
11221 #include "isdnl1.h"
11222 #include <linux/pci.h>
11223 -#include <linux/isapnp.h>
11224 +#include <linux/isdn_compat.h>
11226 extern const char *CardType[];
11228 -const char *Sedlbauer_revision = "$Revision: 1.1.4.1 $";
11229 +const char *Sedlbauer_revision = "$Revision: 1.34 $";
11231 const char *Sedlbauer_Types[] =
11232 {"None", "speed card/win", "speed star", "speed fax+",
11233 "speed win II / ISDN PC/104", "speed star II", "speed pci",
11234 - "speed fax+ pyramid", "speed fax+ pci"};
11235 + "speed fax+ pyramid", "speed fax+ pci", "HST Saphir III"};
11237 #define PCI_SUBVENDOR_SPEEDFAX_PYRAMID 0x51
11238 +#define PCI_SUBVENDOR_HST_SAPHIR3 0x52
11239 #define PCI_SUBVENDOR_SEDLBAUER_PCI 0x53
11240 #define PCI_SUBVENDOR_SPEEDFAX_PCI 0x54
11241 #define PCI_SUB_ID_SEDLBAUER 0x01
11242 @@ -72,6 +73,7 @@ const char *Sedlbauer_Types[] =
11243 #define SEDL_SPEED_PCI 6
11244 #define SEDL_SPEEDFAX_PYRAMID 7
11245 #define SEDL_SPEEDFAX_PCI 8
11246 +#define HST_SAPHIR3 9
11248 #define SEDL_CHIP_TEST 0
11249 #define SEDL_CHIP_ISAC_HSCX 1
11250 @@ -531,21 +533,6 @@ Sedl_card_msg(struct IsdnCardState *cs,
11252 static struct pci_dev *dev_sedl __devinitdata = NULL;
11255 -static struct isapnp_device_id sedl_ids[] __initdata = {
11256 - { ISAPNP_VENDOR('S', 'A', 'G'), ISAPNP_FUNCTION(0x01),
11257 - ISAPNP_VENDOR('S', 'A', 'G'), ISAPNP_FUNCTION(0x01),
11258 - (unsigned long) "Speed win" },
11259 - { ISAPNP_VENDOR('S', 'A', 'G'), ISAPNP_FUNCTION(0x02),
11260 - ISAPNP_VENDOR('S', 'A', 'G'), ISAPNP_FUNCTION(0x02),
11261 - (unsigned long) "Speed Fax+" },
11265 -static struct isapnp_device_id *pdev = &sedl_ids[0];
11266 -static struct pci_bus *pnp_c __devinitdata = NULL;
11270 setup_sedlbauer(struct IsdnCard *card)
11272 @@ -581,57 +568,6 @@ setup_sedlbauer(struct IsdnCard *card)
11277 - if (isapnp_present()) {
11278 - struct pci_bus *pb;
11279 - struct pci_dev *pd;
11281 - while(pdev->card_vendor) {
11282 - if ((pb = isapnp_find_card(pdev->card_vendor,
11283 - pdev->card_device, pnp_c))) {
11286 - if ((pd = isapnp_find_dev(pnp_c,
11287 - pdev->vendor, pdev->function, pd))) {
11288 - printk(KERN_INFO "HiSax: %s detected\n",
11289 - (char *)pdev->driver_data);
11291 - pd->deactivate(pd);
11292 - pd->activate(pd);
11294 - pd->resource[0].start;
11296 - pd->irq_resource[0].start;
11297 - if (!card->para[0] || !card->para[1]) {
11298 - printk(KERN_ERR "Sedlbauer PnP:some resources are missing %ld/%lx\n",
11299 - card->para[0], card->para[1]);
11300 - pd->deactivate(pd);
11303 - cs->hw.sedl.cfg_reg = card->para[1];
11304 - cs->irq = card->para[0];
11305 - if (pdev->function == ISAPNP_FUNCTION(0x2)) {
11306 - cs->subtyp = SEDL_SPEED_FAX;
11307 - cs->hw.sedl.chip = SEDL_CHIP_ISAC_ISAR;
11310 - cs->subtyp = SEDL_SPEED_CARD_WIN;
11311 - cs->hw.sedl.chip = SEDL_CHIP_TEST;
11315 - printk(KERN_ERR "Sedlbauer PnP: PnP error card found, no device\n");
11322 - if (!pdev->card_vendor) {
11323 - printk(KERN_INFO "Sedlbauer PnP: no ISAPnP card found\n");
11327 /* Probe for Sedlbauer speed pci */
11329 if (!pci_present()) {
11330 @@ -647,15 +583,15 @@ setup_sedlbauer(struct IsdnCard *card)
11331 printk(KERN_WARNING "Sedlbauer: No IRQ for PCI card found\n");
11334 - cs->hw.sedl.cfg_reg = pci_resource_start(dev_sedl, 0);
11335 + cs->hw.sedl.cfg_reg = pci_resource_start_io(dev_sedl, 0);
11337 printk(KERN_WARNING "Sedlbauer: No PCI card found\n");
11340 cs->irq_flags |= SA_SHIRQ;
11341 cs->hw.sedl.bus = SEDL_BUS_PCI;
11342 - sub_vendor_id = dev_sedl->subsystem_vendor;
11343 - sub_id = dev_sedl->subsystem_device;
11344 + pci_get_sub_vendor(dev_sedl,sub_vendor_id);
11345 + pci_get_sub_system(dev_sedl,sub_id);
11346 printk(KERN_INFO "Sedlbauer: PCI subvendor:%x subid %x\n",
11347 sub_vendor_id, sub_id);
11348 printk(KERN_INFO "Sedlbauer: PCI base adr %#x\n",
11349 @@ -670,6 +606,9 @@ setup_sedlbauer(struct IsdnCard *card)
11350 } else if (sub_vendor_id == PCI_SUBVENDOR_SPEEDFAX_PCI) {
11351 cs->hw.sedl.chip = SEDL_CHIP_ISAC_ISAR;
11352 cs->subtyp = SEDL_SPEEDFAX_PCI;
11353 + } else if (sub_vendor_id == PCI_SUBVENDOR_HST_SAPHIR3) {
11354 + cs->hw.sedl.chip = SEDL_CHIP_IPAC;
11355 + cs->subtyp = HST_SAPHIR3;
11356 } else if (sub_vendor_id == PCI_SUBVENDOR_SEDLBAUER_PCI) {
11357 cs->hw.sedl.chip = SEDL_CHIP_IPAC;
11358 cs->subtyp = SEDL_SPEED_PCI;
11359 @@ -683,8 +622,8 @@ setup_sedlbauer(struct IsdnCard *card)
11360 cs->hw.sedl.reset_off = SEDL_ISAR_PCI_ISAR_RESET_OFF;
11361 byteout(cs->hw.sedl.cfg_reg, 0xff);
11362 byteout(cs->hw.sedl.cfg_reg, 0x00);
11363 - byteout(cs->hw.sedl.cfg_reg+ 2, 0xdd);
11364 - byteout(cs->hw.sedl.cfg_reg+ 5, 0x02);
11365 + byteout(cs->hw.sedl.cfg_reg +2, 0xdd);
11366 + byteout(cs->hw.sedl.cfg_reg +5, 0x02);
11367 byteout(cs->hw.sedl.cfg_reg +3, cs->hw.sedl.reset_on);
11370 @@ -697,7 +636,7 @@ setup_sedlbauer(struct IsdnCard *card)
11372 #endif /* CONFIG_PCI */
11376 /* In case of the sedlbauer pcmcia card, this region is in use,
11377 * reserved for us by the card manager. So we do not check it
11378 * here, it would fail.
11379 --- a/drivers/isdn/hisax/sportster.c
11380 +++ b/drivers/isdn/hisax/sportster.c
11382 -/* $Id: sportster.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
11383 +/* $Id: sportster.c,v 1.16 2001/09/24 13:22:57 kai Exp $
11385 * low level stuff for USR Sportster internal TA
11388 #include "isdnl1.h"
11390 extern const char *CardType[];
11391 -const char *sportster_revision = "$Revision: 1.1.4.1 $";
11392 +const char *sportster_revision = "$Revision: 1.16 $";
11394 #define byteout(addr,val) outb(val,addr)
11395 #define bytein(addr) inb(addr)
11397 +++ b/drivers/isdn/hisax/st5481-debug.h
11399 +#define ST5481_DEBUG 0x0
11405 + DEBUG flags. Set compile option ST5481_DEBUG with the following bits set to trace
11406 + the given subsections:
11412 + 0x10: PACKET_DUMP D out
11413 + 0x20: ISO_DUMP D out
11414 + 0x40: PACKET_DUMP D in
11415 + 0x80: ISO_DUMP in
11416 + 0x100: PACKET_DUMP B out
11417 + 0x200: ISO_DUMP B out
11418 + 0x400: PACKET_DUMP B in
11421 +#define DBG(level, format, arg...) \
11422 +if (level & ST5481_DEBUG) \
11423 +printk(KERN_DEBUG __FUNCTION__ ": " format "\n" , ## arg) \
11425 +static inline void
11426 +dump_packet(const char *name,const u_char *data,int pkt_len)
11428 +#define DUMP_HDR_SIZE 200
11429 +#define DUMP_TLR_SIZE 8
11433 + printk(KERN_DEBUG "%s: length=%d,data=",name,pkt_len);
11435 + if (pkt_len > DUMP_HDR_SIZE+ DUMP_TLR_SIZE) {
11436 + len1 = DUMP_HDR_SIZE;
11437 + len2 = DUMP_TLR_SIZE;
11439 + len1 = pkt_len > DUMP_HDR_SIZE ? DUMP_HDR_SIZE : pkt_len;
11442 + for (i = 0; i < len1; ++i) {
11443 + printk ("%.2x", data[i]);
11447 + for (i = pkt_len-DUMP_TLR_SIZE; i < pkt_len; ++i) {
11448 + printk ("%.2x", data[i]);
11453 +#undef DUMP_HDR_SIZE
11454 +#undef DUMP_TLR_SIZE
11457 +static inline void
11458 +dump_iso_packet(const char *name,urb_t *urb)
11464 + printk(KERN_DEBUG "%s: packets=%d,errors=%d\n",
11465 + name,urb->number_of_packets,urb->error_count);
11466 + for (i = 0; i < urb->number_of_packets; ++i) {
11467 + if (urb->pipe & USB_DIR_IN) {
11468 + len = urb->iso_frame_desc[i].actual_length;
11470 + len = urb->iso_frame_desc[i].length;
11472 + ofs = urb->iso_frame_desc[i].offset;
11473 + printk(KERN_DEBUG "len=%.2d,ofs=%.3d ",len,ofs);
11475 + data = urb->transfer_buffer+ofs;
11476 + for (j=0; j < len; j++) {
11477 + printk ("%.2x", data[j]);
11484 +#define DUMP_PACKET(level,data,count) \
11485 + if (level & ST5481_DEBUG) dump_packet(__FUNCTION__,data,count)
11486 +#define DUMP_SKB(level,skb) \
11487 + if ((level & ST5481_DEBUG) && skb) dump_packet(__FUNCTION__,skb->data,skb->len)
11488 +#define DUMP_ISO_PACKET(level,urb) \
11489 + if (level & ST5481_DEBUG) dump_iso_packet(__FUNCTION__,urb)
11493 +#define DBG(level,format, arg...) do {} while (0)
11494 +#define DUMP_PACKET(level,data,count) do {} while (0)
11495 +#define DUMP_SKB(level,skb) do {} while (0)
11496 +#define DUMP_ISO_PACKET(level,urb) do {} while (0)
11502 --- a/drivers/isdn/hisax/st5481.h
11503 +++ b/drivers/isdn/hisax/st5481.h
11504 @@ -219,15 +219,15 @@ enum {
11505 #define L1_EVENT_COUNT (EV_TIMER3 + 1)
11507 #define ERR(format, arg...) \
11508 -printk(KERN_ERR "%s:%s: " format "\n" , __FILE__, __FUNCTION__ , ## arg)
11509 +printk(KERN_ERR __FILE__ ": " __FUNCTION__ ": " format "\n" , ## arg)
11511 #define WARN(format, arg...) \
11512 -printk(KERN_WARNING "%s:%s: " format "\n" , __FILE__, __FUNCTION__ , ## arg)
11513 +printk(KERN_WARNING __FILE__ ": " __FUNCTION__ ": " format "\n" , ## arg)
11515 #define INFO(format, arg...) \
11516 -printk(KERN_INFO "%s:%s: " format "\n" , __FILE__, __FUNCTION__ , ## arg)
11517 +printk(KERN_INFO __FILE__ ": " __FUNCTION__ ": " format "\n" , ## arg)
11519 -#include "isdnhdlc.h"
11520 +#include "st5481_hdlc.h"
11522 #include "hisax_if.h"
11523 #include <linux/skbuff.h>
11524 @@ -236,7 +236,7 @@ printk(KERN_INFO "%s:%s: " format "\n" ,
11528 -/* Generic FIFO structure */
11529 +/* Generic FIFO structure */
11531 u_char r,w,count,size;
11533 @@ -270,7 +270,7 @@ static inline int fifo_add(struct fifo *
11536 // Return index where to get the next data to add to the FIFO
11537 - index = fifo->w++ & (fifo->size-1);
11538 + index = fifo->w++ & (fifo->size-1);
11541 spin_unlock_irqrestore(&fifo->lock, flags);
11542 @@ -289,13 +289,13 @@ static inline int fifo_remove(struct fif
11546 - spin_lock_irqsave(&fifo->lock, flags);
11547 + spin_lock_irqsave(&fifo->lock, flags);
11548 if (!fifo->count) {
11552 // Return index where to get the next data from the FIFO
11553 - index = fifo->r++ & (fifo->size-1);
11554 + index = fifo->r++ & (fifo->size-1);
11557 spin_unlock_irqrestore(&fifo->lock, flags);
11558 @@ -309,7 +309,7 @@ static inline int fifo_remove(struct fif
11559 typedef void (*ctrl_complete_t)(void *);
11561 typedef struct ctrl_msg {
11562 - struct usb_ctrlrequest dr;
11564 ctrl_complete_t complete;
11567 @@ -336,7 +336,7 @@ struct st5481_intr {
11570 struct st5481_d_out {
11571 - struct isdnhdlc_vars hdlc_state;
11572 + struct hdlc_vars hdlc_state;
11573 struct urb *urb[2]; /* double buffering */
11574 unsigned long busy;
11575 struct sk_buff *tx_skb;
11576 @@ -344,7 +344,7 @@ struct st5481_d_out {
11579 struct st5481_b_out {
11580 - struct isdnhdlc_vars hdlc_state;
11581 + struct hdlc_vars hdlc_state;
11582 struct urb *urb[2]; /* double buffering */
11585 @@ -352,7 +352,7 @@ struct st5481_b_out {
11589 - struct isdnhdlc_vars hdlc_state;
11590 + struct hdlc_vars hdlc_state;
11591 struct urb *urb[2]; /* double buffering */
11594 @@ -478,7 +478,7 @@ extern int st5481_debug;
11595 if (level & __debug_variable) dump_iso_packet(__FUNCTION__,urb)
11597 static void __attribute__((unused))
11598 -dump_iso_packet(const char *name,struct urb *urb)
11599 +dump_iso_packet(const char *name,urb_t *urb)
11603 --- a/drivers/isdn/hisax/st5481_b.c
11604 +++ b/drivers/isdn/hisax/st5481_b.c
11605 @@ -67,28 +67,24 @@ static void usb_b_out(struct st5481_bcs
11606 bytes_sent = buf_size - len;
11607 if (skb->len < bytes_sent)
11608 bytes_sent = skb->len;
11609 - { /* swap tx bytes to get hearable audio data */
11610 - register unsigned char *src = skb->data;
11611 - register unsigned char *dest = urb->transfer_buffer+len;
11612 - register unsigned int count;
11613 - for (count = 0; count < bytes_sent; count++)
11614 - *dest++ = isdnhdlc_bit_rev_tab[*src++];
11617 + memcpy(urb->transfer_buffer+len, skb->data, bytes_sent);
11621 - len += isdnhdlc_encode(&b_out->hdlc_state,
11622 - skb->data, skb->len, &bytes_sent,
11623 - urb->transfer_buffer+len, buf_size-len);
11624 + len += hdlc_encode(&b_out->hdlc_state,
11625 + skb->data, skb->len, &bytes_sent,
11626 + urb->transfer_buffer+len, buf_size-len);
11629 skb_pull(skb, bytes_sent);
11634 b_out->tx_skb = NULL;
11635 B_L1L2(bcs, PH_DATA | CONFIRM, (void *) skb->truesize);
11636 dev_kfree_skb_any(skb);
11639 /* if (!(bcs->tx_skb = skb_dequeue(&bcs->sq))) { */
11640 /* st5481B_sched_event(bcs, B_XMTBUFREADY); */
11642 @@ -99,9 +95,9 @@ static void usb_b_out(struct st5481_bcs
11646 - len += isdnhdlc_encode(&b_out->hdlc_state,
11647 - NULL, 0, &bytes_sent,
11648 - urb->transfer_buffer+len, buf_size-len);
11649 + len += hdlc_encode(&b_out->hdlc_state,
11650 + NULL, 0, &bytes_sent,
11651 + urb->transfer_buffer+len, buf_size-len);
11655 @@ -213,7 +209,7 @@ static void st5481B_mode(struct st5481_b
11656 if (bcs->mode != L1_MODE_NULL) {
11657 // Open the B channel
11658 if (bcs->mode != L1_MODE_TRANS) {
11659 - isdnhdlc_out_init(&b_out->hdlc_state, 0, bcs->mode == L1_MODE_HDLC_56K);
11660 + hdlc_out_init(&b_out->hdlc_state, 0, bcs->mode == L1_MODE_HDLC_56K);
11662 st5481_usb_pipe_reset(adapter, (bcs->channel+1)*2, NULL, NULL);
11664 @@ -279,7 +275,7 @@ static int __devinit st5481_setup_b_out(
11665 usb_b_out_complete, bcs);
11668 -static void st5481_release_b_out(struct st5481_bcs *bcs)
11669 +static void __devexit st5481_release_b_out(struct st5481_bcs *bcs)
11671 struct st5481_b_out *b_out = &bcs->b_out;
11673 @@ -320,7 +316,7 @@ int __devinit st5481_setup_b(struct st54
11675 * Release buffers and URBs for the B channels
11677 -void st5481_release_b(struct st5481_bcs *bcs)
11678 +void __devexit st5481_release_b(struct st5481_bcs *bcs)
11682 --- a/drivers/isdn/hisax/st5481_d.c
11683 +++ b/drivers/isdn/hisax/st5481_d.c
11684 @@ -162,8 +162,8 @@ static struct FsmNode L1FnList[] __initd
11685 {ST_L1_F8, EV_TIMER3, l1_timer3},
11686 {ST_L1_F8, EV_IND_DP, l1_go_f3},
11687 {ST_L1_F8, EV_IND_AP, l1_go_f6},
11688 - {ST_L1_F8, EV_IND_AI8, l1_go_f7},
11689 - {ST_L1_F8, EV_IND_AI10, l1_go_f7},
11690 + {ST_L1_F8, EV_IND_AI8, l1_go_f8},
11691 + {ST_L1_F8, EV_IND_AI10, l1_go_f8},
11692 {ST_L1_F8, EV_IND_RSY, l1_ignore},
11695 @@ -297,7 +297,7 @@ static void usb_d_out(struct st5481_adap
11696 unsigned int num_packets, packet_offset;
11697 int len, buf_size, bytes_sent;
11698 struct sk_buff *skb;
11699 - struct iso_packet_descriptor *desc;
11700 + iso_packet_descriptor_t *desc;
11702 if (d_out->fsm.state != ST_DOUT_NORMAL)
11704 @@ -313,15 +313,15 @@ static void usb_d_out(struct st5481_adap
11705 buf_size = NUM_ISO_PACKETS_D * SIZE_ISO_PACKETS_D_OUT;
11708 - len = isdnhdlc_encode(&d_out->hdlc_state,
11709 - skb->data, skb->len, &bytes_sent,
11710 - urb->transfer_buffer, buf_size);
11711 + len = hdlc_encode(&d_out->hdlc_state,
11712 + skb->data, skb->len, &bytes_sent,
11713 + urb->transfer_buffer, buf_size);
11714 skb_pull(skb,bytes_sent);
11716 // Send flags or idle
11717 - len = isdnhdlc_encode(&d_out->hdlc_state,
11718 - NULL, 0, &bytes_sent,
11719 - urb->transfer_buffer, buf_size);
11720 + len = hdlc_encode(&d_out->hdlc_state,
11721 + NULL, 0, &bytes_sent,
11722 + urb->transfer_buffer, buf_size);
11725 if (len < buf_size) {
11726 @@ -413,7 +413,7 @@ static void dout_start_xmit(struct FsmIn
11728 DBG(2,"len=%d",skb->len);
11730 - isdnhdlc_out_init(&d_out->hdlc_state, 1, 0);
11731 + hdlc_out_init(&d_out->hdlc_state, 1, 0);
11733 if (test_and_set_bit(buf_nr, &d_out->busy)) {
11734 WARN("ep %d urb %d busy %#lx", EP_D_OUT, buf_nr, d_out->busy);
11735 @@ -422,9 +422,9 @@ static void dout_start_xmit(struct FsmIn
11736 urb = d_out->urb[buf_nr];
11738 DBG_SKB(0x10, skb);
11739 - len = isdnhdlc_encode(&d_out->hdlc_state,
11740 - skb->data, skb->len, &bytes_sent,
11741 - urb->transfer_buffer, 16);
11742 + len = hdlc_encode(&d_out->hdlc_state,
11743 + skb->data, skb->len, &bytes_sent,
11744 + urb->transfer_buffer, 16);
11745 skb_pull(skb, bytes_sent);
11748 @@ -673,7 +673,7 @@ static int __devinit st5481_setup_d_out(
11749 usb_d_out_complete, adapter);
11752 -static void st5481_release_d_out(struct st5481_adapter *adapter)
11753 +static void __devexit st5481_release_d_out(struct st5481_adapter *adapter)
11755 struct st5481_d_out *d_out = &adapter->d_out;
11757 @@ -723,7 +723,7 @@ int __devinit st5481_setup_d(struct st54
11761 -void st5481_release_d(struct st5481_adapter *adapter)
11762 +void __devexit st5481_release_d(struct st5481_adapter *adapter)
11766 --- a/drivers/isdn/hisax/st5481_init.c
11767 +++ b/drivers/isdn/hisax/st5481_init.c
11773 * hotplug / unregister issues
11774 * mod_inc/dec_use_count
11775 * unify parts of d/b channel usb handling
11776 @@ -177,7 +178,7 @@ MODULE_DEVICE_TABLE (usb, st5481_ids);
11777 static struct usb_driver st5481_usb_driver = {
11778 name: "st5481_usb",
11779 probe: probe_st5481,
11780 - disconnect: __devexit_p(disconnect_st5481),
11781 + disconnect: disconnect_st5481,
11782 id_table: st5481_ids,
11785 --- a/drivers/isdn/hisax/st5481_usb.c
11786 +++ b/drivers/isdn/hisax/st5481_usb.c
11787 @@ -41,9 +41,9 @@ static void usb_next_ctrl_msg(struct urb
11788 (unsigned char *)&ctrl->msg_fifo.data[r_index];
11790 DBG(1,"request=0x%02x,value=0x%04x,index=%x",
11791 - ((struct ctrl_msg *)urb->setup_packet)->dr.bRequest,
11792 - ((struct ctrl_msg *)urb->setup_packet)->dr.wValue,
11793 - ((struct ctrl_msg *)urb->setup_packet)->dr.wIndex);
11794 + ((struct ctrl_msg *)urb->setup_packet)->dr.request,
11795 + ((struct ctrl_msg *)urb->setup_packet)->dr.value,
11796 + ((struct ctrl_msg *)urb->setup_packet)->dr.index);
11799 urb->dev = adapter->usb_dev;
11800 @@ -69,11 +69,11 @@ void usb_ctrl_msg(struct st5481_adapter
11802 ctrl_msg = &ctrl->msg_fifo.data[w_index];
11804 - ctrl_msg->dr.bRequestType = requesttype;
11805 - ctrl_msg->dr.bRequest = request;
11806 - ctrl_msg->dr.wValue = cpu_to_le16p(&value);
11807 - ctrl_msg->dr.wIndex = cpu_to_le16p(&index);
11808 - ctrl_msg->dr.wLength = 0;
11809 + ctrl_msg->dr.requesttype = requesttype;
11810 + ctrl_msg->dr.request = request;
11811 + ctrl_msg->dr.value = cpu_to_le16p(&value);
11812 + ctrl_msg->dr.index = cpu_to_le16p(&index);
11813 + ctrl_msg->dr.length = 0;
11814 ctrl_msg->complete = complete;
11815 ctrl_msg->context = context;
11817 @@ -140,17 +140,17 @@ static void usb_ctrl_complete(struct urb
11819 ctrl_msg = (struct ctrl_msg *)urb->setup_packet;
11821 - if (ctrl_msg->dr.bRequest == USB_REQ_CLEAR_FEATURE) {
11822 + if (ctrl_msg->dr.request == USB_REQ_CLEAR_FEATURE) {
11823 /* Special case handling for pipe reset */
11824 - le16_to_cpus(&ctrl_msg->dr.wIndex);
11825 + le16_to_cpus(&ctrl_msg->dr.index);
11826 usb_endpoint_running(adapter->usb_dev,
11827 - ctrl_msg->dr.wIndex & ~USB_DIR_IN,
11828 - (ctrl_msg->dr.wIndex & USB_DIR_IN) == 0);
11829 + ctrl_msg->dr.index & ~USB_DIR_IN,
11830 + (ctrl_msg->dr.index & USB_DIR_IN) == 0);
11832 /* toggle is reset on clear */
11833 usb_settoggle(adapter->usb_dev,
11834 - ctrl_msg->dr.wIndex & ~USB_DIR_IN,
11835 - (ctrl_msg->dr.wIndex & USB_DIR_IN) == 0,
11836 + ctrl_msg->dr.index & ~USB_DIR_IN,
11837 + (ctrl_msg->dr.index & USB_DIR_IN) == 0,
11841 @@ -235,7 +235,7 @@ int __devinit st5481_setup_usb(struct st
11842 struct usb_interface_descriptor *altsetting;
11843 struct usb_endpoint_descriptor *endpoint;
11850 @@ -307,7 +307,7 @@ int __devinit st5481_setup_usb(struct st
11851 * Release buffers and URBs for the interrupt and control
11854 -void st5481_release_usb(struct st5481_adapter *adapter)
11855 +void __devexit st5481_release_usb(struct st5481_adapter *adapter)
11857 struct st5481_intr *intr = &adapter->intr;
11858 struct st5481_ctrl *ctrl = &adapter->ctrl;
11859 @@ -443,7 +443,7 @@ st5481_setup_isocpipes(struct urb* urb[2
11863 -void st5481_release_isocpipes(struct urb* urb[2])
11864 +void __devexit st5481_release_isocpipes(struct urb* urb[2])
11868 @@ -484,18 +484,16 @@ static void usb_in_complete(struct urb *
11869 ptr = urb->transfer_buffer;
11871 if (in->mode == L1_MODE_TRANS) {
11872 - /* swap rx bytes to get hearable audio */
11873 - register unsigned char *dest = in->rcvbuf;
11874 + memcpy(in->rcvbuf, ptr, len);
11876 - for (; len; len--)
11877 - *dest++ = isdnhdlc_bit_rev_tab[*ptr++];
11880 - status = isdnhdlc_decode(&in->hdlc_state, ptr, len, &count,
11881 - in->rcvbuf, in->bufsize);
11882 + status = hdlc_decode(&in->hdlc_state, ptr, len, &count,
11883 + in->rcvbuf, in->bufsize);
11890 // Good frame received
11891 DBG(4,"count=%d",status);
11892 @@ -549,7 +547,7 @@ int __devinit st5481_setup_in(struct st5
11896 -void st5481_release_in(struct st5481_in *in)
11897 +void __devexit st5481_release_in(struct st5481_in *in)
11901 @@ -562,8 +560,7 @@ void st5481_release_in(struct st5481_in
11903 int st5481_isoc_flatten(struct urb *urb)
11905 - struct iso_packet_descriptor *pipd;
11906 - struct iso_packet_descriptor *pend;
11907 + piso_packet_descriptor_t pipd,pend;
11908 unsigned char *src,*dst;
11911 @@ -624,10 +621,15 @@ void st5481_in_mode(struct st5481_in *in
11913 if (in->mode != L1_MODE_NULL) {
11914 if (in->mode != L1_MODE_TRANS)
11915 - isdnhdlc_rcv_init(&in->hdlc_state,
11916 - in->mode == L1_MODE_HDLC_56K);
11917 + hdlc_rcv_init(&in->hdlc_state,
11918 + in->mode == L1_MODE_HDLC_56K);
11920 st5481_usb_pipe_reset(in->adapter, in->ep, NULL, NULL);
11922 + st5481_usb_device_ctrl_msg(in->adapter, in->counter,
11924 + st5481_start_rcv, in);
11926 st5481_usb_device_ctrl_msg(in->adapter, in->counter,
11929 --- a/drivers/isdn/hisax/tei.c
11930 +++ b/drivers/isdn/hisax/tei.c
11932 -/* $Id: tei.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
11933 +/* $Id: tei.c,v 2.20 2001/09/24 13:22:57 kai Exp $
11935 * Author Karsten Keil
11936 * based on the teles driver from Jan den Ouden
11938 #include <linux/init.h>
11939 #include <linux/random.h>
11941 -const char *tei_revision = "$Revision: 1.1.4.1 $";
11942 +const char *tei_revision = "$Revision: 2.20 $";
11944 #define ID_REQUEST 1
11945 #define ID_ASSIGNED 2
11946 --- a/drivers/isdn/hisax/teleint.c
11947 +++ b/drivers/isdn/hisax/teleint.c
11949 -/* $Id: teleint.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
11950 +/* $Id: teleint.c,v 1.16 2001/09/24 13:22:57 kai Exp $
11952 * low level stuff for TeleInt isdn cards
11956 extern const char *CardType[];
11958 -const char *TeleInt_revision = "$Revision: 1.1.4.1 $";
11959 +const char *TeleInt_revision = "$Revision: 1.16 $";
11961 #define byteout(addr,val) outb(val,addr)
11962 #define bytein(addr) inb(addr)
11963 --- a/drivers/isdn/hisax/teles0.c
11964 +++ b/drivers/isdn/hisax/teles0.c
11966 -/* $Id: teles0.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
11967 +/* $Id: teles0.c,v 2.15 2001/09/24 13:22:57 kai Exp $
11969 * low level stuff for Teles Memory IO isdn cards
11973 extern const char *CardType[];
11975 -const char *teles0_revision = "$Revision: 1.1.4.1 $";
11976 +const char *teles0_revision = "$Revision: 2.15 $";
11978 #define TELES_IOMEM_SIZE 0x400
11979 #define byteout(addr,val) outb(val,addr)
11980 @@ -189,8 +189,10 @@ release_io_teles0(struct IsdnCardState *
11982 if (cs->hw.teles0.cfg_reg)
11983 release_region(cs->hw.teles0.cfg_reg, 8);
11984 +#ifdef COMPAT_HAS_ISA_IOREMAP
11985 iounmap((unsigned char *)cs->hw.teles0.membase);
11986 release_mem_region(cs->hw.teles0.phymem, TELES_IOMEM_SIZE);
11991 @@ -327,6 +329,7 @@ setup_teles0(struct IsdnCard *card)
11992 /* 16.0 and 8.0 designed for IOM1 */
11993 test_and_set_bit(HW_IOM1, &cs->HW_Flags);
11994 cs->hw.teles0.phymem = card->para[1];
11995 +#ifdef COMPAT_HAS_ISA_IOREMAP
11996 if (check_mem_region(cs->hw.teles0.phymem, TELES_IOMEM_SIZE)) {
11997 printk(KERN_WARNING
11998 "HiSax: %s memory region %lx-%lx already in use\n",
11999 @@ -342,6 +345,9 @@ setup_teles0(struct IsdnCard *card)
12001 cs->hw.teles0.membase =
12002 (unsigned long) ioremap(cs->hw.teles0.phymem, TELES_IOMEM_SIZE);
12004 + cs->hw.teles0.membase = cs->hw.teles0.phymem;
12007 "HiSax: %s config irq:%d mem:0x%lX cfg:0x%X\n",
12008 CardType[cs->typ], cs->irq,
12009 --- a/drivers/isdn/hisax/teles3.c
12010 +++ b/drivers/isdn/hisax/teles3.c
12012 -/* $Id: teles3.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
12013 +/* $Id: teles3.c,v 2.19 2001/09/24 13:22:57 kai Exp $
12015 * low level stuff for Teles 16.3 & PNP isdn cards
12017 @@ -15,14 +15,13 @@
12019 #define __NO_VERSION__
12020 #include <linux/init.h>
12021 -#include <linux/isapnp.h>
12025 #include "isdnl1.h"
12027 extern const char *CardType[];
12028 -const char *teles3_revision = "$Revision: 1.1.4.1 $";
12029 +const char *teles3_revision = "$Revision: 2.19 $";
12031 #define byteout(addr,val) outb(val,addr)
12032 #define bytein(addr) inb(addr)
12033 @@ -255,24 +254,6 @@ Teles_card_msg(struct IsdnCardState *cs,
12038 -static struct isapnp_device_id teles_ids[] __initdata = {
12039 - { ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2110),
12040 - ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2110),
12041 - (unsigned long) "Teles 16.3 PnP" },
12042 - { ISAPNP_VENDOR('C', 'T', 'X'), ISAPNP_FUNCTION(0x0),
12043 - ISAPNP_VENDOR('C', 'T', 'X'), ISAPNP_FUNCTION(0x0),
12044 - (unsigned long) "Creatix 16.3 PnP" },
12045 - { ISAPNP_VENDOR('C', 'P', 'Q'), ISAPNP_FUNCTION(0x1002),
12046 - ISAPNP_VENDOR('C', 'P', 'Q'), ISAPNP_FUNCTION(0x1002),
12047 - (unsigned long) "Compaq ISDN S0" },
12051 -static struct isapnp_device_id *tdev = &teles_ids[0];
12052 -static struct pci_bus *pnp_c __devinitdata = NULL;
12056 setup_teles3(struct IsdnCard *card)
12058 @@ -286,47 +267,6 @@ setup_teles3(struct IsdnCard *card)
12059 && (cs->typ != ISDN_CTYPE_TELESPCMCIA) && (cs->typ != ISDN_CTYPE_COMPAQ_ISA))
12063 - if (!card->para[1] && isapnp_present()) {
12064 - struct pci_bus *pb;
12065 - struct pci_dev *pd;
12067 - while(tdev->card_vendor) {
12068 - if ((pb = isapnp_find_card(tdev->card_vendor,
12069 - tdev->card_device, pnp_c))) {
12072 - if ((pd = isapnp_find_dev(pnp_c,
12073 - tdev->vendor, tdev->function, pd))) {
12074 - printk(KERN_INFO "HiSax: %s detected\n",
12075 - (char *)tdev->driver_data);
12077 - pd->deactivate(pd);
12078 - pd->activate(pd);
12079 - card->para[3] = pd->resource[2].start;
12080 - card->para[2] = pd->resource[1].start;
12081 - card->para[1] = pd->resource[0].start;
12082 - card->para[0] = pd->irq_resource[0].start;
12083 - if (!card->para[0] || !card->para[1] || !card->para[2]) {
12084 - printk(KERN_ERR "Teles PnP:some resources are missing %ld/%lx/%lx\n",
12085 - card->para[0], card->para[1], card->para[2]);
12086 - pd->deactivate(pd);
12091 - printk(KERN_ERR "Teles PnP: PnP error card found, no device\n");
12097 - if (!tdev->card_vendor) {
12098 - printk(KERN_INFO "Teles PnP: no ISAPnP card found\n");
12103 if (cs->typ == ISDN_CTYPE_16_3) {
12104 cs->hw.teles3.cfg_reg = card->para[1];
12105 switch (cs->hw.teles3.cfg_reg) {
12106 --- a/drivers/isdn/hisax/telespci.c
12107 +++ b/drivers/isdn/hisax/telespci.c
12109 -/* $Id: telespci.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
12110 +/* $Id: telespci.c,v 2.23 2001/09/24 13:22:57 kai Exp $
12112 * low level stuff for Teles PCI isdn cards
12116 #include "isdnl1.h"
12117 #include <linux/pci.h>
12118 +#include <linux/isdn_compat.h>
12120 extern const char *CardType[];
12121 -const char *telespci_revision = "$Revision: 1.1.4.1 $";
12122 +const char *telespci_revision = "$Revision: 2.23 $";
12124 #define ZORAN_PO_RQ_PEN 0x02000000
12125 #define ZORAN_PO_WR 0x00800000
12126 @@ -307,10 +308,10 @@ setup_telespci(struct IsdnCard *card)
12127 printk(KERN_WARNING "Teles: No IRQ for PCI card found\n");
12130 - cs->hw.teles0.membase = (u_long) ioremap(pci_resource_start(dev_tel, 0),
12131 + cs->hw.teles0.membase = (u_long) ioremap(pci_resource_start_mem(dev_tel, 0),
12133 printk(KERN_INFO "Found: Zoran, base-address: 0x%lx, irq: 0x%x\n",
12134 - pci_resource_start(dev_tel, 0), dev_tel->irq);
12135 + pci_resource_start_mem(dev_tel, 0), dev_tel->irq);
12137 printk(KERN_WARNING "TelesPCI: No PCI card found\n");
12139 --- a/drivers/isdn/hisax/w6692.c
12140 +++ b/drivers/isdn/hisax/w6692.c
12142 -/* $Id: w6692.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
12143 +/* $Id: w6692.c,v 1.18 2001/09/24 13:22:57 kai Exp $
12145 * Winbond W6692 specific routines
12148 #include "isdnl1.h"
12149 #include <linux/interrupt.h>
12150 #include <linux/pci.h>
12151 +#include <linux/isdn_compat.h>
12153 /* table entry in the PCI devices list */
12155 @@ -29,20 +30,14 @@ typedef struct {
12157 static const PCI_ENTRY id_list[] =
12159 - {PCI_VENDOR_ID_WINBOND2, PCI_DEVICE_ID_WINBOND2_6692, "Winbond", "W6692"},
12160 {PCI_VENDOR_ID_DYNALINK, PCI_DEVICE_ID_DYNALINK_IS64PH, "Dynalink/AsusCom", "IS64PH"},
12161 - {0, 0, "U.S.Robotics", "ISDN PCI Card TA"}
12162 + {PCI_VENDOR_ID_WINBOND2, PCI_DEVICE_ID_WINBOND2_6692, "Winbond", "W6692"},
12163 + {0, 0, NULL, NULL}
12166 -#define W6692_SV_USR 0x16ec
12167 -#define W6692_SD_USR 0x3409
12168 -#define W6692_WINBOND 0
12169 -#define W6692_DYNALINK 1
12170 -#define W6692_USR 2
12172 extern const char *CardType[];
12174 -const char *w6692_revision = "$Revision: 1.1.4.1 $";
12175 +const char *w6692_revision = "$Revision: 1.18 $";
12177 #define DBUSY_TIMER_VALUE 80
12179 @@ -675,6 +670,16 @@ setstack_W6692(struct PStack *st, struct
12181 DC_Close_W6692(struct IsdnCardState *cs)
12184 + if (cs->dc.w6692.mon_rx) {
12185 + kfree(cs->dc.w6692.mon_rx);
12186 + cs->dc.w6692.mon_rx = NULL;
12188 + if (cs->dc.w6692.mon_tx) {
12189 + kfree(cs->dc.w6692.mon_tx);
12190 + cs->dc.w6692.mon_tx = NULL;
12196 @@ -865,38 +870,31 @@ setstack_w6692(struct PStack *st, struct
12200 -void resetW6692(struct IsdnCardState *cs)
12202 - cs->writeW6692(cs, W_D_CTL, W_D_CTL_SRST);
12203 - schedule_timeout((10*HZ)/1000);
12204 - cs->writeW6692(cs, W_D_CTL, 0x00);
12205 - schedule_timeout((10*HZ)/1000);
12206 - cs->writeW6692(cs, W_IMASK, 0xff);
12207 - cs->writeW6692(cs, W_D_SAM, 0xff);
12208 - cs->writeW6692(cs, W_D_TAM, 0xff);
12209 - cs->writeW6692(cs, W_D_EXIM, 0x00);
12210 - cs->writeW6692(cs, W_D_MODE, W_D_MODE_RACT);
12211 - cs->writeW6692(cs, W_IMASK, 0x18);
12212 - if (cs->subtyp == W6692_USR) {
12213 - /* seems that USR implemented some power control features
12214 - * Pin 79 is connected to the oscilator circuit so we
12215 - * have to handle it here
12217 - cs->writeW6692(cs, W_PCTL, 0x80);
12218 - cs->writeW6692(cs, W_XDATA, 0x00);
12222 void __init initW6692(struct IsdnCardState *cs, int part)
12225 cs->tqueue.routine = (void *) (void *) W6692_bh;
12226 cs->setstack_d = setstack_W6692;
12227 cs->DC_Close = DC_Close_W6692;
12229 + cs->dc.w6692.mon_tx = NULL;
12230 + cs->dc.w6692.mon_rx = NULL;
12232 cs->dbusytimer.function = (void *) dbusy_timer_handler;
12233 cs->dbusytimer.data = (long) cs;
12234 init_timer(&cs->dbusytimer);
12237 + cs->writeW6692(cs, W_D_CTL, W_D_CTL_SRST);
12238 + cs->writeW6692(cs, W_D_CTL, 0x00);
12239 + cs->writeW6692(cs, W_IMASK, 0xff);
12241 + cs->dc.w6692.mocr = 0xaa;
12243 + cs->writeW6692(cs, W_D_SAM, 0xff);
12244 + cs->writeW6692(cs, W_D_TAM, 0xff);
12245 + cs->writeW6692(cs, W_D_EXIM, 0x00);
12246 + cs->writeW6692(cs, W_D_MODE, W_D_MODE_RACT);
12247 + cs->writeW6692(cs, W_IMASK, 0x18);
12248 ph_command(cs, W_L1CMD_RST);
12249 cs->dc.w6692.ph_state = W_L1CMD_RST;
12251 @@ -963,14 +961,9 @@ w6692_card_msg(struct IsdnCardState *cs,
12258 - cs->writeW6692(cs, W_IMASK, 0xff);
12259 release_region(cs->hw.w6692.iobase, 256);
12260 - if (cs->subtyp == W6692_USR) {
12261 - cs->writeW6692(cs, W_XDATA, 0x04);
12266 @@ -1013,7 +1006,6 @@ setup_w6692(struct IsdnCard *card)
12268 if (pci_enable_device(dev_w6692))
12270 - cs->subtyp = id_idx;
12274 @@ -1023,14 +1015,7 @@ setup_w6692(struct IsdnCard *card)
12275 pci_irq = dev_w6692->irq;
12276 /* I think address 0 is allways the configuration area */
12277 /* and address 1 is the real IO space KKe 03.09.99 */
12278 - pci_ioaddr = pci_resource_start(dev_w6692, 1);
12279 - /* USR ISDN PCI card TA need some special handling */
12280 - if (cs->subtyp == W6692_WINBOND) {
12281 - if ((W6692_SV_USR == dev_w6692->subsystem_vendor) &&
12282 - (W6692_SD_USR == dev_w6692->subsystem_device)) {
12283 - cs->subtyp = W6692_USR;
12286 + pci_ioaddr = pci_resource_start_io(dev_w6692, 1);
12289 printk(KERN_WARNING "W6692: No PCI card found\n");
12290 @@ -1047,18 +1032,18 @@ setup_w6692(struct IsdnCard *card)
12292 cs->hw.w6692.iobase = pci_ioaddr;
12293 printk(KERN_INFO "Found: %s %s, I/O base: 0x%x, irq: %d\n",
12294 - id_list[cs->subtyp].vendor_name, id_list[cs->subtyp].card_name,
12295 - pci_ioaddr, pci_irq);
12296 + id_list[id_idx].vendor_name, id_list[id_idx].card_name,
12297 + pci_ioaddr, dev_w6692->irq);
12298 if (check_region((cs->hw.w6692.iobase), 256)) {
12299 printk(KERN_WARNING
12300 "HiSax: %s I/O ports %x-%x already in use\n",
12301 - id_list[cs->subtyp].card_name,
12302 + id_list[id_idx].card_name,
12303 cs->hw.w6692.iobase,
12304 cs->hw.w6692.iobase + 255);
12307 request_region(cs->hw.w6692.iobase, 256,
12308 - id_list[cs->subtyp].card_name);
12309 + id_list[id_idx].card_name);
12312 printk(KERN_WARNING "HiSax: W6692 and NO_PCI_BIOS\n");
12313 @@ -1068,7 +1053,7 @@ setup_w6692(struct IsdnCard *card)
12316 "HiSax: %s config irq:%d I/O:%x\n",
12317 - id_list[cs->subtyp].card_name, cs->irq,
12318 + id_list[id_idx].card_name, cs->irq,
12319 cs->hw.w6692.iobase);
12321 cs->readW6692 = &ReadW6692;
12322 --- a/drivers/isdn/hisax/w6692.h
12323 +++ b/drivers/isdn/hisax/w6692.h
12325 -/* $Id: w6692.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
12326 +/* $Id: w6692.h,v 1.4 2001/09/24 13:22:57 kai Exp $
12328 * Winbond W6692 specific defines
12330 --- a/drivers/isdn/hysdn/boardergo.c
12331 +++ b/drivers/isdn/hysdn/boardergo.c
12333 -/* $Id: boardergo.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12335 +/* $Id: boardergo.c,v 1.9 2001/07/19 20:39:51 kai Exp $
12337 * Linux driver for HYSDN cards, specific routines for ergo type boards.
12339 - * Author Werner Cornelius (werner@titro.de) for Hypercope GmbH
12340 - * Copyright 1999 by Werner Cornelius (werner@titro.de)
12342 - * This software may be used and distributed according to the terms
12343 - * of the GNU General Public License, incorporated herein by reference.
12345 * As all Linux supported cards Champ2, Ergo and Metro2/4 use the same
12346 * DPRAM interface and layout with only minor differences all related
12347 * stuff is done here, not in separate modules.
12349 + * written by Werner Cornelius (werner@titro.de) for Hypercope GmbH
12351 + * Copyright 1999 by Werner Cornelius (werner@titro.de)
12353 + * This program is free software; you can redistribute it and/or modify
12354 + * it under the terms of the GNU General Public License as published by
12355 + * the Free Software Foundation; either version 2, or (at your option)
12356 + * any later version.
12358 + * This program is distributed in the hope that it will be useful,
12359 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
12360 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12361 + * GNU General Public License for more details.
12363 + * You should have received a copy of the GNU General Public License
12364 + * along with this program; if not, write to the Free Software
12365 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
12369 +#define __NO_VERSION__
12370 #include <linux/config.h>
12371 -#include <linux/sched.h>
12372 +#include <linux/module.h>
12373 +#include <linux/version.h>
12374 +#include <asm/io.h>
12375 #include <linux/signal.h>
12376 #include <linux/kernel.h>
12377 #include <linux/ioport.h>
12378 #include <linux/interrupt.h>
12379 #include <linux/vmalloc.h>
12380 -#include <asm/io.h>
12382 #include "hysdn_defs.h"
12383 #include "boardergo.h"
12384 @@ -45,11 +59,10 @@ ergo_interrupt(int intno, void *dev_id,
12385 if (!card->irq_enabled)
12386 return; /* other device interrupting or irq switched off */
12388 - save_flags(flags);
12389 - cli(); /* no further irqs allowed */
12390 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
12392 if (!(bytein(card->iobase + PCI9050_INTR_REG) & PCI9050_INTR_REG_STAT1)) {
12393 - restore_flags(flags); /* restore old state */
12394 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12395 return; /* no interrupt requested by E1 */
12397 /* clear any pending ints on the board */
12398 @@ -63,7 +76,7 @@ ergo_interrupt(int intno, void *dev_id,
12399 queue_task(&card->irq_queue, &tq_immediate);
12400 mark_bh(IMMEDIATE_BH);
12402 - restore_flags(flags);
12403 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12404 } /* ergo_interrupt */
12406 /******************************************************************************/
12407 @@ -83,17 +96,15 @@ ergo_irq_bh(hysdn_card * card)
12408 return; /* invalid call */
12410 dpr = card->dpram; /* point to DPRAM */
12411 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
12413 - save_flags(flags);
12415 if (card->hw_lock) {
12416 - restore_flags(flags); /* hardware currently unavailable */
12417 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12420 card->hw_lock = 1; /* we now lock the hardware */
12423 - sti(); /* reenable other ints */
12424 again = 0; /* assume loop not to be repeated */
12426 if (!dpr->ToHyFlag) {
12427 @@ -113,15 +124,13 @@ ergo_irq_bh(hysdn_card * card)
12428 again = 1; /* restart loop */
12430 } /* a message has arrived for us */
12431 - cli(); /* no further ints */
12434 dpr->ToPcInt = 1; /* interrupt to E1 for all cards */
12436 card->hw_lock = 0; /* free hardware again */
12437 } while (again); /* until nothing more to do */
12439 - restore_flags(flags);
12440 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12441 } /* ergo_irq_bh */
12444 @@ -138,8 +147,7 @@ ergo_stopcard(hysdn_card * card)
12445 #ifdef CONFIG_HYSDN_CAPI
12446 hycapi_capi_stop(card);
12447 #endif /* CONFIG_HYSDN_CAPI */
12448 - save_flags(flags);
12450 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
12451 val = bytein(card->iobase + PCI9050_INTR_REG); /* get actual value */
12452 val &= ~(PCI9050_INTR_REG_ENPCI | PCI9050_INTR_REG_EN1); /* mask irq */
12453 byteout(card->iobase + PCI9050_INTR_REG, val);
12454 @@ -147,8 +155,7 @@ ergo_stopcard(hysdn_card * card)
12455 byteout(card->iobase + PCI9050_USER_IO, PCI9050_E1_RESET); /* reset E1 processor */
12456 card->state = CARD_STATE_UNUSED;
12457 card->err_log_state = ERRLOG_STATE_OFF; /* currently no log active */
12459 - restore_flags(flags);
12460 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12461 } /* ergo_stopcard */
12463 /**************************************************************************/
12464 @@ -163,20 +170,17 @@ ergo_set_errlog_state(hysdn_card * card,
12465 card->err_log_state = ERRLOG_STATE_OFF; /* must be off */
12468 - save_flags(flags);
12471 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
12472 if (((card->err_log_state == ERRLOG_STATE_OFF) && !on) ||
12473 ((card->err_log_state == ERRLOG_STATE_ON) && on)) {
12474 - restore_flags(flags);
12475 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12476 return; /* nothing to do */
12479 card->err_log_state = ERRLOG_STATE_START; /* request start */
12481 card->err_log_state = ERRLOG_STATE_STOP; /* request stop */
12483 - restore_flags(flags);
12484 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12485 queue_task(&card->irq_queue, &tq_immediate);
12486 mark_bh(IMMEDIATE_BH);
12487 } /* ergo_set_errlog_state */
12488 @@ -245,9 +249,6 @@ ergo_writebootimg(struct HYSDN_CARD *car
12489 while (!dpram->ToHyNoDpramErrLog); /* reread volatile register to flush PCI */
12491 byteout(card->iobase + PCI9050_USER_IO, PCI9050_E1_RUN); /* start E1 processor */
12492 - /* the interrupts are still masked */
12495 set_current_state(TASK_INTERRUPTIBLE);
12496 schedule_timeout((20 * HZ) / 1000); /* Timeout 20ms */
12498 @@ -282,7 +283,6 @@ ergo_writebootseq(struct HYSDN_CARD *car
12499 dst = sp->Data; /* point to data in spool structure */
12500 buflen = sp->Len; /* maximum len of spooled data */
12501 wr_mirror = sp->WrPtr; /* only once read */
12504 /* try until all bytes written or error */
12505 i = 0x1000; /* timeout value */
12506 @@ -358,9 +358,7 @@ ergo_waitpofready(struct HYSDN_CARD *car
12508 if (card->debug_flags & LOG_POF_RECORD)
12509 hysdn_addlog(card, "ERGO: pof boot success");
12510 - save_flags(flags);
12513 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
12514 card->state = CARD_STATE_RUN; /* now card is running */
12515 /* enable the cards interrupt */
12516 byteout(card->iobase + PCI9050_INTR_REG,
12517 @@ -371,8 +369,7 @@ ergo_waitpofready(struct HYSDN_CARD *car
12518 dpr->ToPcFlag = 0; /* reset data indicator */
12520 dpr->ToPcInt = 1; /* interrupt to E1 for all cards */
12522 - restore_flags(flags);
12523 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12524 if ((hynet_enable & (1 << card->myid))
12525 && (i = hysdn_net_create(card)))
12527 @@ -387,7 +384,6 @@ ergo_waitpofready(struct HYSDN_CARD *car
12528 #endif /* CONFIG_HYSDN_CAPI */
12529 return (0); /* success */
12530 } /* data has arrived */
12532 set_current_state(TASK_INTERRUPTIBLE);
12533 schedule_timeout((50 * HZ) / 1000); /* Timeout 50ms */
12534 } /* wait until timeout */
12535 --- a/drivers/isdn/hysdn/boardergo.h
12536 +++ b/drivers/isdn/hysdn/boardergo.h
12538 -/* $Id: boardergo.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12541 * Linux driver for HYSDN cards, definitions for ergo type boards (buffers..).
12547 +#include <linux/isdn_compat.h>
12549 /************************************************/
12550 /* defines for the dual port memory of the card */
12551 --- a/drivers/isdn/hysdn/hycapi.c
12552 +++ b/drivers/isdn/hysdn/hycapi.c
12554 -/* $Id: hycapi.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12557 * Linux driver for HYSDN cards, CAPI2.0-Interface.
12560 #include "hysdn_defs.h"
12561 #include <linux/kernelcapi.h>
12563 -static char hycapi_revision[]="$Revision: 1.1.4.1 $";
12564 +static char hycapi_revision[]="$Revision$";
12566 unsigned int hycapi_enable = 0xffffffff;
12567 MODULE_PARM(hycapi_enable, "i");
12568 --- a/drivers/isdn/hysdn/hysdn_boot.c
12569 +++ b/drivers/isdn/hysdn/hysdn_boot.c
12571 -/* $Id: hysdn_boot.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12574 * Linux driver for HYSDN cards
12575 * specific routines for booting and pof handling
12576 @@ -143,7 +143,7 @@ pof_handle_data(hysdn_card * card, int d
12577 (boot->pof_recid == TAG_CABSDATA) ? "CABSDATA" : "ABSDATA",
12578 datlen, boot->pof_recoffset);
12580 - if ((boot->last_error = card->writebootseq(card, boot->buf.BootBuf, datlen)) < 0)
12581 + if ((boot->last_error = card->writebootseq(card, boot->buf.BootBuf, datlen) < 0))
12582 return (boot->last_error); /* error writing data */
12584 if (boot->pof_recoffset + datlen >= boot->pof_reclen)
12585 --- a/drivers/isdn/hysdn/hysdn_defs.h
12586 +++ b/drivers/isdn/hysdn/hysdn_defs.h
12588 -/* $Id: hysdn_defs.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12589 +/* $Id: hysdn_defs.h,v 1.10 2001/09/24 13:23:03 kai Exp $
12591 * Linux driver for HYSDN cards
12592 * global definitions and exported vars and functions.
12594 #include <linux/interrupt.h>
12595 #include <linux/tqueue.h>
12596 #include <linux/skbuff.h>
12597 +#include <linux/isdn_compat.h>
12598 +#include <linux/spinlock.h>
12600 +#define HYSDN_SPIN_LOCK(a,b) spin_lock(a)
12601 +#define HYSDN_SPIN_UNLOCK(a,b) spin_unlock(a)
12603 /****************************/
12604 /* storage type definitions */
12605 @@ -176,6 +181,7 @@ typedef struct HYSDN_CARD {
12606 struct tq_struct irq_queue; /* interrupt task queue */
12607 uchar volatile irq_enabled; /* interrupt enabled if != 0 */
12608 uchar volatile hw_lock; /* hardware is currently locked -> no access */
12609 + spinlock_t irq_lock;
12612 void *boot; /* pointer to boot private data */
12613 --- a/drivers/isdn/hysdn/hysdn_init.c
12614 +++ b/drivers/isdn/hysdn/hysdn_init.c
12616 -/* $Id: hysdn_init.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12619 * Linux driver for HYSDN cards, init functions.
12623 #include "hysdn_defs.h"
12625 +#ifndef COMPAT_HAS_2_2_PCI
12626 static struct pci_device_id hysdn_pci_tbl[] __initdata = {
12627 {PCI_VENDOR_ID_HYPERCOPE, PCI_DEVICE_ID_HYPERCOPE_PLX, PCI_ANY_ID, PCI_SUBDEVICE_ID_HYPERCOPE_METRO},
12628 {PCI_VENDOR_ID_HYPERCOPE, PCI_DEVICE_ID_HYPERCOPE_PLX, PCI_ANY_ID, PCI_SUBDEVICE_ID_HYPERCOPE_CHAMP2},
12629 @@ -29,11 +30,12 @@ static struct pci_device_id hysdn_pci_tb
12630 { } /* Terminating entry */
12632 MODULE_DEVICE_TABLE(pci, hysdn_pci_tbl);
12634 MODULE_DESCRIPTION("ISDN4Linux: Driver for HYSDN cards");
12635 MODULE_AUTHOR("Werner Cornelius");
12636 MODULE_LICENSE("GPL");
12638 -static char *hysdn_init_revision = "$Revision: 1.1.4.1 $";
12639 +static char *hysdn_init_revision = "$Revision$";
12640 int cardmax; /* number of found cards */
12641 hysdn_card *card_root = NULL; /* pointer to first card */
12643 @@ -91,11 +93,11 @@ search_cards(void)
12644 card->myid = cardmax; /* set own id */
12645 card->bus = akt_pcidev->bus->number;
12646 card->devfn = akt_pcidev->devfn; /* slot + function */
12647 - card->subsysid = akt_pcidev->subsystem_device;
12648 + pci_get_sub_system(akt_pcidev,card->subsysid);
12649 card->irq = akt_pcidev->irq;
12650 - card->iobase = pci_resource_start(akt_pcidev, PCI_REG_PLX_IO_BASE);
12651 - card->plxbase = pci_resource_start(akt_pcidev, PCI_REG_PLX_MEM_BASE);
12652 - card->membase = pci_resource_start(akt_pcidev, PCI_REG_MEMORY_BASE);
12653 + card->iobase = pci_resource_start_io(akt_pcidev, PCI_REG_PLX_IO_BASE);
12654 + card->plxbase = pci_resource_start_mem(akt_pcidev, PCI_REG_PLX_MEM_BASE);
12655 + card->membase = pci_resource_start_mem(akt_pcidev, PCI_REG_MEMORY_BASE);
12656 card->brdtype = BD_NONE; /* unknown */
12657 card->debug_flags = DEF_DEB_FLAGS; /* set default debug */
12658 card->faxchans = 0; /* default no fax channels */
12659 --- a/drivers/isdn/hysdn/hysdn_net.c
12660 +++ b/drivers/isdn/hysdn/hysdn_net.c
12662 -/* $Id: hysdn_net.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12665 * Linux driver for HYSDN cards, net (ethernet type) handling routines.
12667 @@ -29,7 +29,7 @@ unsigned int hynet_enable = 0xffffffff;
12668 MODULE_PARM(hynet_enable, "i");
12670 /* store the actual version for log reporting */
12671 -char *hysdn_net_revision = "$Revision: 1.1.4.1 $";
12672 +char *hysdn_net_revision = "$Revision$";
12674 #define MAX_SKB_BUFFERS 20 /* number of buffers for keeping TX-data */
12676 @@ -45,6 +45,10 @@ struct net_local {
12677 /* additional vars may be added here */
12678 char dev_name[9]; /* our own device name */
12680 +#ifdef COMPAT_NO_SOFTNET
12681 + struct sk_buff *tx_skb; /* buffer for tx operation */
12684 /* Tx control lock. This protects the transmit buffer ring
12685 * state along with the "tx full" state of the driver. This
12686 * means all netif_queue flow control actions are protected
12687 @@ -56,6 +60,7 @@ struct net_local {
12688 int sk_count; /* number of buffers currently in ring */
12690 int is_open; /* flag controlling module locking */
12695 @@ -83,11 +88,19 @@ net_open(struct net_device *dev)
12696 hysdn_card *card = dev->priv;
12699 +#ifdef COMPAT_NO_SOFTNET
12700 + dev->tbusy = 0; /* non busy state */
12701 + dev->interrupt = 0;
12703 + MOD_INC_USE_COUNT; /* increment only if device is down */
12704 + dev->start = 1; /* and started */
12706 if (!((struct net_local *) dev)->is_open)
12707 MOD_INC_USE_COUNT; /* increment only if interface is actually down */
12708 ((struct net_local *) dev)->is_open = 1; /* device actually open */
12710 netif_start_queue(dev); /* start tx-queueing */
12713 /* Fill in the MAC-level header (if not already set) */
12714 if (!card->mac_addr[0]) {
12715 @@ -104,6 +117,7 @@ net_open(struct net_device *dev)
12719 +#ifndef COMPAT_NO_SOFTNET
12720 /*******************************************/
12721 /* flush the currently occupied tx-buffers */
12722 /* must only be called when device closed */
12723 @@ -119,6 +133,7 @@ flush_tx_buffers(struct net_local *nl)
12726 } /* flush_tx_buffers */
12730 /*********************************************************************/
12731 @@ -129,6 +144,15 @@ static int
12732 net_close(struct net_device *dev)
12735 +#ifdef COMPAT_NO_SOFTNET
12736 + dev->tbusy = 1; /* we are busy */
12739 + MOD_DEC_USE_COUNT; /* dec only if device has been active */
12741 + dev->start = 0; /* and not started */
12744 netif_stop_queue(dev); /* disable queueing */
12746 if (((struct net_local *) dev)->is_open)
12747 @@ -136,9 +160,52 @@ net_close(struct net_device *dev)
12748 ((struct net_local *) dev)->is_open = 0;
12749 flush_tx_buffers((struct net_local *) dev);
12752 return (0); /* success */
12755 +#ifdef COMPAT_NO_SOFTNET
12756 +/************************************/
12757 +/* send a packet on this interface. */
12758 +/* only for kernel versions < 2.3.33 */
12759 +/************************************/
12761 +net_send_packet(struct sk_buff *skb, struct net_device *dev)
12763 + struct net_local *lp = (struct net_local *) dev;
12765 + if (dev->tbusy) {
12767 + * If we get here, some higher level has decided we are broken.
12768 + * There should really be a "kick me" function call instead.
12769 + * As ISDN may have higher timeouts than real ethernet 10s timeout
12771 + int tickssofar = jiffies - dev->trans_start;
12772 + if (tickssofar < (10000 * HZ) / 1000)
12774 + printk(KERN_WARNING "%s: transmit timed out. \n", dev->name);
12776 + dev->trans_start = jiffies;
12779 + * Block a timer-based transmit from overlapping. This could better be
12780 + * done with atomic_swap(1, dev->tbusy), but set_bit() works as well.
12782 + if (test_and_set_bit(0, (void *) &dev->tbusy) != 0)
12783 + printk(KERN_WARNING "%s: Transmitter access conflict.\n", dev->name);
12786 + lp->stats.tx_bytes += skb->len;
12787 + dev->trans_start = jiffies;
12788 + lp->tx_skb = skb; /* remember skb pointer */
12789 + queue_task(&((hysdn_card *) dev->priv)->irq_queue, &tq_immediate);
12790 + mark_bh(IMMEDIATE_BH);
12793 + return (0); /* success */
12794 +} /* net_send_packet */
12797 /************************************/
12798 /* send a packet on this interface. */
12799 /* new style for kernel >= 2.3.33 */
12800 @@ -176,6 +243,7 @@ net_send_packet(struct sk_buff *skb, str
12801 return (0); /* success */
12802 } /* net_send_packet */
12807 /***********************************************************************/
12808 @@ -190,6 +258,15 @@ hysdn_tx_netack(hysdn_card * card)
12810 return; /* non existing device */
12812 +#ifdef COMPAT_NO_SOFTNET
12814 + dev_kfree_skb(lp->tx_skb); /* free tx pointer */
12815 + lp->tx_skb = NULL; /* reset pointer */
12817 + lp->stats.tx_packets++;
12818 + lp->netdev.tbusy = 0;
12819 + mark_bh(NET_BH); /* Inform upper layers. */
12823 return; /* error condition */
12824 @@ -203,6 +280,7 @@ hysdn_tx_netack(hysdn_card * card)
12826 if (lp->sk_count-- == MAX_SKB_BUFFERS) /* dec usage count */
12827 netif_start_queue((struct net_device *) lp);
12829 } /* hysdn_tx_netack */
12831 /*****************************************************/
12832 @@ -250,10 +328,15 @@ hysdn_tx_netget(hysdn_card * card)
12834 return (NULL); /* non existing device */
12836 +#ifdef COMPAT_NO_SOFTNET
12837 + return (lp->tx_skb); /* return packet pointer */
12841 return (NULL); /* nothing available */
12843 return (lp->skbs[lp->out_idx]); /* next packet to send */
12845 } /* hysdn_tx_netget */
12848 @@ -296,15 +379,21 @@ hysdn_net_create(hysdn_card * card)
12850 memset(dev, 0, sizeof(struct net_local)); /* clean the structure */
12852 +#ifndef COMPAT_NO_SOFTNET
12853 spin_lock_init(&((struct net_local *) dev)->lock);
12856 /* initialise necessary or informing fields */
12857 dev->base_addr = card->iobase; /* IO address */
12858 dev->irq = card->irq; /* irq */
12859 dev->init = net_init; /* the init function of the device */
12860 +#ifdef COMPAT_NO_SOFTNET
12861 + dev->name = ((struct net_local *) dev)->dev_name; /* device name */
12864 strcpy(dev->name, ((struct net_local *) dev)->dev_name);
12867 if ((i = register_netdev(dev))) {
12868 printk(KERN_WARNING "HYSDN: unable to create network device\n");
12870 @@ -333,7 +422,9 @@ hysdn_net_release(hysdn_card * card)
12871 card->netif = NULL; /* clear out pointer */
12872 dev->stop(dev); /* close the device */
12874 +#ifndef COMPAT_NO_SOFTNET
12875 flush_tx_buffers((struct net_local *) dev); /* empty buffers */
12878 unregister_netdev(dev); /* release the device */
12879 kfree(dev); /* release the memory allocated */
12880 --- a/drivers/isdn/hysdn/hysdn_pof.h
12881 +++ b/drivers/isdn/hysdn/hysdn_pof.h
12883 -/* $Id: hysdn_pof.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12886 * Linux driver for HYSDN cards, definitions used for handling pof-files.
12888 --- a/drivers/isdn/hysdn/hysdn_procconf.c
12889 +++ b/drivers/isdn/hysdn/hysdn_procconf.c
12891 -/* $Id: hysdn_procconf.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12894 * Linux driver for HYSDN cards, /proc/net filesystem dir and conf functions.
12896 @@ -17,11 +17,13 @@
12897 #include <linux/poll.h>
12898 #include <linux/proc_fs.h>
12899 #include <linux/pci.h>
12900 +#ifndef COMPAT_USE_MODCOUNT_LOCK
12901 #include <linux/smp_lock.h>
12904 #include "hysdn_defs.h"
12906 -static char *hysdn_procconf_revision = "$Revision: 1.1.4.1 $";
12907 +static char *hysdn_procconf_revision = "$Revision$";
12909 #define INFO_OUT_LEN 80 /* length of info line including lf */
12911 @@ -212,32 +214,29 @@ hysdn_conf_write(struct file *file, cons
12913 hysdn_conf_read(struct file *file, char *buf, size_t count, loff_t * off)
12915 - loff_t pos = *off;
12919 if (off != &file->f_pos) /* fs error check */
12922 - if (!(file->f_mode & FMODE_READ))
12925 - if (!(cp = file->private_data))
12926 - return (-EFAULT); /* should never happen */
12928 - i = strlen(cp); /* get total string length */
12930 - if (pos != (unsigned)pos || pos >= i)
12933 - /* still bytes to transfer */
12934 - cp += pos; /* point to desired data offset */
12935 - i -= pos; /* remaining length */
12937 - i = count; /* limit length to transfer */
12938 - if (copy_to_user(buf, cp, i))
12939 - return (-EFAULT); /* copy error */
12940 - *off = pos + i; /* adjust offset */
12941 + if (file->f_mode & FMODE_READ) {
12942 + if (!(cp = file->private_data))
12943 + return (-EFAULT); /* should never happen */
12944 + i = strlen(cp); /* get total string length */
12946 + /* still bytes to transfer */
12947 + cp += *off; /* point to desired data offset */
12948 + i -= *off; /* remaining length */
12950 + i = count; /* limit length to transfer */
12951 + if (copy_to_user(buf, cp, i))
12952 + return (-EFAULT); /* copy error */
12953 + *off += i; /* adjust offset */
12957 + return (-EPERM); /* no permission to read */
12960 } /* hysdn_conf_read */
12961 @@ -254,7 +253,11 @@ hysdn_conf_open(struct inode *ino, struc
12964 /* now search the addressed card */
12965 +#ifdef COMPAT_USE_MODCOUNT_LOCK
12966 + MOD_INC_USE_COUNT;
12972 pd = card->procconf;
12973 @@ -263,7 +266,11 @@ hysdn_conf_open(struct inode *ino, struc
12974 card = card->next; /* search next entry */
12977 +#ifdef COMPAT_USE_MODCOUNT_LOCK
12978 + MOD_DEC_USE_COUNT;
12982 return (-ENODEV); /* device is unknown/invalid */
12984 if (card->debug_flags & (LOG_PROC_OPEN | LOG_PROC_ALL))
12985 @@ -274,7 +281,11 @@ hysdn_conf_open(struct inode *ino, struc
12986 /* write only access -> write boot file or conf line */
12988 if (!(cnf = kmalloc(sizeof(struct conf_writedata), GFP_KERNEL))) {
12989 +#ifdef COMPAT_USE_MODCOUNT_LOCK
12990 + MOD_DEC_USE_COUNT;
12997 @@ -286,7 +297,11 @@ hysdn_conf_open(struct inode *ino, struc
12998 /* read access -> output card info data */
13000 if (!(tmp = (char *) kmalloc(INFO_OUT_LEN * 2 + 2, GFP_KERNEL))) {
13001 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13002 + MOD_DEC_USE_COUNT;
13006 return (-EFAULT); /* out of memory */
13008 filep->private_data = tmp; /* start of string */
13009 @@ -320,10 +335,16 @@ hysdn_conf_open(struct inode *ino, struc
13011 *cp = 0; /* end of string */
13012 } else { /* simultaneous read/write access forbidden ! */
13013 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13014 + MOD_DEC_USE_COUNT;
13018 return (-EPERM); /* no permission this time */
13020 +#ifndef COMPAT_USE_MODCOUNT_LOCK
13024 } /* hysdn_conf_open */
13026 @@ -338,7 +359,9 @@ hysdn_conf_close(struct inode *ino, stru
13028 struct proc_dir_entry *pd;
13030 +#ifndef COMPAT_USE_MODCOUNT_LOCK
13033 /* search the addressed card */
13036 @@ -348,7 +371,9 @@ hysdn_conf_close(struct inode *ino, stru
13037 card = card->next; /* search next entry */
13040 +#ifndef COMPAT_USE_MODCOUNT_LOCK
13043 return (-ENODEV); /* device is unknown/invalid */
13045 if (card->debug_flags & (LOG_PROC_OPEN | LOG_PROC_ALL))
13046 @@ -371,7 +396,11 @@ hysdn_conf_close(struct inode *ino, stru
13047 if (filep->private_data)
13048 kfree(filep->private_data); /* release memory */
13050 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13051 + MOD_DEC_USE_COUNT;
13056 } /* hysdn_conf_close */
13058 @@ -387,6 +416,9 @@ static struct file_operations conf_fops
13059 release: hysdn_conf_close,
13062 +#ifdef COMPAT_NO_SOFTNET
13063 +static struct inode_operations conf_inode_operations;
13065 /*****************************/
13066 /* hysdn subdir in /proc/net */
13067 /*****************************/
13068 @@ -415,8 +447,17 @@ hysdn_procconf_init(void)
13069 if ((card->procconf = (void *) create_proc_entry(conf_name,
13070 S_IFREG | S_IRUGO | S_IWUSR,
13071 hysdn_proc_entry)) != NULL) {
13072 +#ifdef COMPAT_NO_SOFTNET
13073 + memset(&conf_inode_operations, 0, sizeof(struct inode_operations));
13074 + conf_inode_operations.default_file_ops = &conf_fops;
13076 + ((struct proc_dir_entry *) card->procconf)->ops = &conf_inode_operations;
13078 ((struct proc_dir_entry *) card->procconf)->proc_fops = &conf_fops;
13079 +#ifdef COMPAT_HAS_FILEOP_OWNER
13080 ((struct proc_dir_entry *) card->procconf)->owner = THIS_MODULE;
13083 hysdn_proclog_init(card); /* init the log file entry */
13085 card = card->next; /* next entry */
13086 --- a/drivers/isdn/hysdn/hysdn_proclog.c
13087 +++ b/drivers/isdn/hysdn/hysdn_proclog.c
13089 -/* $Id: hysdn_proclog.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
13092 * Linux driver for HYSDN cards, /proc/net filesystem log functions.
13095 #include <linux/poll.h>
13096 #include <linux/proc_fs.h>
13097 #include <linux/pci.h>
13098 +#ifndef COMPAT_USE_MODCOUNT_LOCK
13099 #include <linux/smp_lock.h>
13102 #include "hysdn_defs.h"
13104 @@ -115,8 +117,7 @@ put_log_buffer(hysdn_card * card, char *
13105 strcpy(ib->log_start, cp); /* set output string */
13107 ib->proc_ctrl = pd; /* point to own control structure */
13108 - save_flags(flags);
13110 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13111 ib->usage_cnt = pd->if_used;
13113 pd->log_head = ib; /* new head */
13114 @@ -124,7 +125,7 @@ put_log_buffer(hysdn_card * card, char *
13115 pd->log_tail->next = ib; /* follows existing messages */
13116 pd->log_tail = ib; /* new tail */
13117 i = pd->del_lock++; /* get lock state */
13118 - restore_flags(flags);
13119 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13121 /* delete old entrys */
13123 @@ -210,7 +211,6 @@ hysdn_log_read(struct file *file, char *
13125 struct procdata *pd = NULL;
13127 - loff_t pos = *off;
13129 if (!*((struct log_data **) file->private_data)) {
13130 if (file->f_flags & O_NONBLOCK)
13131 @@ -235,11 +235,11 @@ hysdn_log_read(struct file *file, char *
13134 inf->usage_cnt--; /* new usage count */
13135 - file->private_data = &inf->next; /* next structure */
13136 + (struct log_data **) file->private_data = &inf->next; /* next structure */
13137 if ((len = strlen(inf->log_start)) <= count) {
13138 if (copy_to_user(buf, inf->log_start, len))
13140 - *off = pos + len;
13141 + file->f_pos += len;
13145 @@ -255,7 +255,11 @@ hysdn_log_open(struct inode *ino, struct
13146 struct procdata *pd = NULL;
13149 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13150 + MOD_INC_USE_COUNT;
13156 pd = card->proclog;
13157 @@ -264,7 +268,11 @@ hysdn_log_open(struct inode *ino, struct
13158 card = card->next; /* search next entry */
13161 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13162 + MOD_DEC_USE_COUNT;
13166 return (-ENODEV); /* device is unknown/invalid */
13168 filep->private_data = card; /* remember our own card */
13169 @@ -274,19 +282,24 @@ hysdn_log_open(struct inode *ino, struct
13170 } else if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) {
13172 /* read access -> log/debug read */
13173 - save_flags(flags);
13175 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13178 - filep->private_data = &(pd->log_tail->next);
13179 + (struct log_data **) filep->private_data = &(pd->log_tail->next);
13181 - filep->private_data = &(pd->log_head);
13182 - restore_flags(flags);
13183 + (struct log_data **) filep->private_data = &(pd->log_head);
13184 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13185 } else { /* simultaneous read/write access forbidden ! */
13186 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13187 + MOD_DEC_USE_COUNT;
13191 return (-EPERM); /* no permission this time */
13193 +#ifndef COMPAT_USE_MODCOUNT_LOCK
13197 } /* hysdn_log_open */
13199 @@ -306,7 +319,9 @@ hysdn_log_close(struct inode *ino, struc
13200 int flags, retval = 0;
13203 +#ifndef COMPAT_USE_MODCOUNT_LOCK
13206 if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_WRITE) {
13207 /* write only access -> write debug level written */
13208 retval = 0; /* success */
13209 @@ -314,8 +329,7 @@ hysdn_log_close(struct inode *ino, struc
13210 /* read access -> log/debug read, mark one further file as closed */
13213 - save_flags(flags);
13215 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13216 inf = *((struct log_data **) filep->private_data); /* get first log entry */
13218 pd = (struct procdata *) inf->proc_ctrl; /* still entries there */
13219 @@ -338,7 +352,7 @@ hysdn_log_close(struct inode *ino, struc
13220 inf->usage_cnt--; /* decrement usage count for buffers */
13223 - restore_flags(flags);
13224 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13227 if (pd->if_used <= 0) /* delete buffers if last file closed */
13228 @@ -348,7 +362,11 @@ hysdn_log_close(struct inode *ino, struc
13231 } /* read access */
13232 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13233 + MOD_DEC_USE_COUNT;
13239 } /* hysdn_log_close */
13240 @@ -400,6 +418,9 @@ static struct file_operations log_fops =
13241 release: hysdn_log_close,
13244 +#ifdef COMPAT_NO_SOFTNET
13245 +struct inode_operations log_inode_operations;
13248 /***********************************************************************************/
13249 /* hysdn_proclog_init is called when the module is loaded after creating the cards */
13250 @@ -414,10 +435,20 @@ hysdn_proclog_init(hysdn_card * card)
13252 if ((pd = (struct procdata *) kmalloc(sizeof(struct procdata), GFP_KERNEL)) != NULL) {
13253 memset(pd, 0, sizeof(struct procdata));
13254 +#ifdef COMPAT_NO_SOFTNET
13255 + memset(&log_inode_operations, 0, sizeof(struct inode_operations));
13256 + log_inode_operations.default_file_ops = &log_fops;
13258 sprintf(pd->log_name, "%s%d", PROC_LOG_BASENAME, card->myid);
13259 if ((pd->log = create_proc_entry(pd->log_name, S_IFREG | S_IRUGO | S_IWUSR, hysdn_proc_entry)) != NULL) {
13260 +#ifdef COMPAT_NO_SOFTNET
13261 + pd->log->ops = &log_inode_operations; /* set new operations table */
13263 pd->log->proc_fops = &log_fops;
13264 +#ifdef COMPAT_HAS_FILEOP_OWNER
13265 pd->log->owner = THIS_MODULE;
13270 init_waitqueue_head(&(pd->rd_queue));
13271 --- a/drivers/isdn/hysdn/hysdn_sched.c
13272 +++ b/drivers/isdn/hysdn/hysdn_sched.c
13274 -/* $Id: hysdn_sched.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
13275 +/* $Id: hysdn_sched.c,v 1.9 2001/09/24 13:23:03 kai Exp $
13277 * Linux driver for HYSDN cards
13278 * scheduler routines for handling exchange card <-> pc.
13282 #include <linux/config.h>
13283 -#include <linux/sched.h>
13284 #include <linux/signal.h>
13285 #include <linux/kernel.h>
13286 #include <linux/ioport.h>
13287 -#include <linux/interrupt.h>
13288 #include <asm/io.h>
13290 #include "hysdn_defs.h"
13291 @@ -151,22 +149,19 @@ hysdn_tx_cfgline(hysdn_card * card, ucha
13293 if (card->debug_flags & LOG_SCHED_ASYN)
13294 hysdn_addlog(card, "async tx-cfg chan=%d len=%d", chan, strlen(line) + 1);
13296 - save_flags(flags);
13298 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13299 while (card->async_busy) {
13302 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13303 if (card->debug_flags & LOG_SCHED_ASYN)
13304 hysdn_addlog(card, "async tx-cfg delayed");
13306 set_current_state(TASK_INTERRUPTIBLE);
13307 schedule_timeout((20 * HZ) / 1000); /* Timeout 20ms */
13309 - restore_flags(flags);
13310 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13311 return (-ERR_ASYNC_TIME); /* timed out */
13314 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13315 } /* wait for buffer to become free */
13317 strcpy(card->async_data, line);
13318 @@ -177,31 +172,26 @@ hysdn_tx_cfgline(hysdn_card * card, ucha
13319 /* now queue the task */
13320 queue_task(&card->irq_queue, &tq_immediate);
13321 mark_bh(IMMEDIATE_BH);
13324 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13325 if (card->debug_flags & LOG_SCHED_ASYN)
13326 hysdn_addlog(card, "async tx-cfg data queued");
13328 cnt++; /* short delay */
13331 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13332 while (card->async_busy) {
13335 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13336 if (card->debug_flags & LOG_SCHED_ASYN)
13337 hysdn_addlog(card, "async tx-cfg waiting for tx-ready");
13339 set_current_state(TASK_INTERRUPTIBLE);
13340 schedule_timeout((20 * HZ) / 1000); /* Timeout 20ms */
13342 - restore_flags(flags);
13343 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13344 return (-ERR_ASYNC_TIME); /* timed out */
13347 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13348 } /* wait for buffer to become free again */
13350 - restore_flags(flags);
13352 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13353 if (card->debug_flags & LOG_SCHED_ASYN)
13354 hysdn_addlog(card, "async tx-cfg data send");
13356 --- a/drivers/isdn/icn/icn.c
13357 +++ b/drivers/isdn/icn/icn.c
13359 -/* $Id: icn.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
13362 * ISDN low-level module for the ICN active ISDN-Card.
13364 @@ -41,7 +41,7 @@ MODULE_PARM_DESC(icn_id2, "ID-String of
13368 -*revision = "$Revision: 1.1.4.1 $";
13369 +*revision = "$Revision$";
13371 static int icn_addcard(int, char *, char *);
13373 @@ -1634,6 +1634,7 @@ icn_addcard(int port, char *id1, char *i
13377 +#ifdef COMPAT_HAS_NEW_SETUP
13379 icn_setup(char *line)
13381 @@ -1643,6 +1644,14 @@ icn_setup(char *line)
13382 static char sid2[20];
13384 str = get_options(line, 2, ints);
13387 +icn_setup(char *str, int *ints)
13390 + static char sid[20];
13391 + static char sid2[20];
13394 portbase = ints[1];
13396 @@ -1656,9 +1665,13 @@ icn_setup(char *line)
13400 +#ifdef COMPAT_HAS_NEW_SETUP
13403 __setup("icn=", icn_setup);
13407 #endif /* MODULE */
13409 static int __init icn_init(void)
13410 --- a/drivers/isdn/icn/icn.h
13411 +++ b/drivers/isdn/icn/icn.h
13413 -/* $Id: icn.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
13416 * ISDN lowlevel-module for the ICN active ISDN-Card.
13418 --- a/drivers/isdn/isdn_audio.c
13419 +++ b/drivers/isdn/isdn_audio.c
13421 -/* $Id: isdn_audio.c,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
13422 +/* $Id: isdn_audio.c,v 1.24 2002/08/13 09:57:26 keil Exp $
13424 * Linux ISDN subsystem, audio conversion and compression (linklevel).
13426 * Copyright 1994-1999 by Fritz Elfert (fritz@isdn4linux.de)
13427 - * DTMF code (c) 1996 by Christian Mock (cm@kukuruz.ping.at)
13428 + * DTMF code (c) 1996 by Christian Mock (cm@tahina.priv.at)
13429 * Silence detection (c) 1998 by Armin Schindler (mac@gismo.telekom.de)
13431 * This software may be used and distributed according to the terms
13433 #include "isdn_audio.h"
13434 #include "isdn_common.h"
13436 -char *isdn_audio_revision = "$Revision: 1.1.4.1 $";
13437 +char *isdn_audio_revision = "$Revision: 1.24 $";
13440 * Misc. lookup-tables.
13441 @@ -169,19 +169,39 @@ static char isdn_audio_ulaw_to_alaw[] =
13442 0x8a, 0x8a, 0x6a, 0x6a, 0xea, 0xea, 0x2a, 0x2a
13445 -#define NCOEFF 8 /* number of frequencies to be analyzed */
13446 -#define DTMF_TRESH 4000 /* above this is dtmf */
13447 +#define NCOEFF 16 /* number of frequencies to be analyzed */
13448 +#define DTMF_TRESH 25000 /* above this is dtmf */
13449 #define SILENCE_TRESH 200 /* below this is silence */
13450 +#define H2_TRESH 20000 /* 2nd harmonic */
13451 #define AMP_BITS 9 /* bits per sample, reduced to avoid overflow */
13456 + int grp; /* low/high group */
13458 + int k2; /* k fuer 2. harmonic */
13461 /* For DTMF recognition:
13462 * 2 * cos(2 * PI * k / N) precalculated for all k
13464 static int cos2pik[NCOEFF] =
13466 - 55813, 53604, 51193, 48591, 38114, 33057, 25889, 18332
13467 + 55812, 29528, 53603, 24032, 51193, 14443, 48590, 6517,
13468 + 38113, -21204, 33057, -32186, 25889, -45081, 18332, -55279
13471 +static dtmf_t dtmf_tones[8] =
13473 + {LOGRP, 0, 1}, /* 697 Hz */
13474 + {LOGRP, 2, 3}, /* 770 Hz */
13475 + {LOGRP, 4, 5}, /* 852 Hz */
13476 + {LOGRP, 6, 7}, /* 941 Hz */
13477 + {HIGRP, 8, 9}, /* 1209 Hz */
13478 + {HIGRP, 10, 11}, /* 1336 Hz */
13479 + {HIGRP, 12, 13}, /* 1477 Hz */
13480 + {HIGRP, 14, 15} /* 1633 Hz */
13483 static char dtmf_matrix[4][4] =
13484 @@ -208,7 +228,7 @@ isdn_audio_tlookup(const u_char *table,
13488 - *buff = table[*(unsigned char *)buff], buff++;
13489 + *buff++ = table[*(unsigned char *)buff];
13493 @@ -479,18 +499,6 @@ isdn_audio_goertzel(int *sample, modem_i
13497 - /* Avoid overflows */
13500 - /* compute |X(k)|**2 */
13501 - /* report overflows. This should not happen. */
13502 - /* Comment this out if desired */
13503 - if (sk < -32768 || sk > 32767)
13504 - printk(KERN_DEBUG
13505 - "isdn_audio: dtmf goertzel overflow, sk=%d\n", sk);
13506 - if (sk2 < -32768 || sk2 > 32767)
13507 - printk(KERN_DEBUG
13508 - "isdn_audio: dtmf goertzel overflow, sk2=%d\n", sk2);
13510 ((sk * sk) >> AMP_BITS) -
13511 ((((cos2pik[k] * sk) >> 15) * sk2) >> AMP_BITS) +
13512 @@ -514,58 +522,28 @@ isdn_audio_eval_dtmf(modem_info * info)
13518 while ((skb = skb_dequeue(&info->dtmf_queue))) {
13519 result = (int *) skb->data;
13520 s = info->dtmf_state;
13521 - grp[LOGRP] = grp[HIGRP] = -1;
13522 + grp[LOGRP] = grp[HIGRP] = -2;
13525 - for (i = 0; i < NCOEFF; i++) {
13526 - if (result[i] > DTMF_TRESH) {
13527 - if (result[i] > thresh)
13528 - thresh = result[i];
13530 - else if (result[i] < SILENCE_TRESH)
13531 + for (i = 0; i < 8; i++) {
13532 + if ((result[dtmf_tones[i].k] > DTMF_TRESH) &&
13533 + (result[dtmf_tones[i].k2] < H2_TRESH))
13534 + grp[dtmf_tones[i].grp] = (grp[dtmf_tones[i].grp] == -2) ? i : -1;
13535 + else if ((result[dtmf_tones[i].k] < SILENCE_TRESH) &&
13536 + (result[dtmf_tones[i].k2] < SILENCE_TRESH))
13539 - if (silence == NCOEFF)
13540 + if (silence == 8)
13543 - if (thresh > 0) {
13544 - thresh = thresh >> 4; /* touchtones must match within 12 dB */
13545 - for (i = 0; i < NCOEFF; i++) {
13546 - if (result[i] < thresh)
13547 - continue; /* ignore */
13548 - /* good level found. This is allowed only one time per group */
13549 - if (i < NCOEFF / 2) {
13551 - if (grp[LOGRP] >= 0) {
13552 - // Bad. Another tone found. */
13559 - else { /* higroup */
13560 - if (grp[HIGRP] >= 0) { // Bad. Another tone found. */
13565 - grp[HIGRP] = i - NCOEFF/2;
13568 - if ((grp[LOGRP] >= 0) && (grp[HIGRP] >= 0)) {
13569 - what = dtmf_matrix[grp[LOGRP]][grp[HIGRP]];
13570 - if (s->last != ' ' && s->last != '.')
13571 - s->last = what; /* min. 1 non-DTMF between DTMF */
13576 + if ((grp[LOGRP] >= 0) && (grp[HIGRP] >= 0)) {
13577 + what = dtmf_matrix[grp[LOGRP]][grp[HIGRP] - 4];
13578 + if (s->last != ' ' && s->last != '.')
13579 + s->last = what; /* min. 1 non-DTMF between DTMF */
13583 if ((what != s->last) && (what != ' ') && (what != '.')) {
13584 --- a/drivers/isdn/isdn_audio.h
13585 +++ b/drivers/isdn/isdn_audio.h
13587 -/* $Id: isdn_audio.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
13588 +/* $Id: isdn_audio.h,v 1.10 2001/09/24 13:22:42 kai Exp $
13590 * Linux ISDN subsystem, audio conversion and compression (linklevel).
13592 @@ -20,7 +20,6 @@ typedef struct adpcm_state {
13594 typedef struct dtmf_state {
13598 int buf[DTMF_NPOINTS];
13600 --- a/drivers/isdn/isdn_bsdcomp.c
13601 +++ b/drivers/isdn/isdn_bsdcomp.c
13602 @@ -105,6 +105,14 @@ MODULE_LICENSE("Dual BSD/GPL");
13606 +#ifdef CONFIG_ISDN_WITH_ABC
13607 +#define BSD_C_MALLOC(x) kmalloc((x),GFP_ATOMIC)
13608 +#define BSD_C_FREE(x) kfree(x)
13610 +#define BSD_C_MALLOC(x) vmalloc(x)
13611 +#define BSD_C_FREE(x) vfree(x)
13615 * A dictionary for doing BSD compress.
13617 @@ -285,7 +293,7 @@ static void bsd_free (void *state)
13618 * Release the dictionary
13621 - vfree (db->dict);
13622 + BSD_C_FREE (db->dict);
13626 @@ -293,7 +301,7 @@ static void bsd_free (void *state)
13627 * Release the string buffer
13630 - vfree (db->lens);
13631 + BSD_C_FREE (db->lens);
13635 @@ -350,14 +358,19 @@ static void *bsd_alloc (struct isdn_ppp_
13636 * Allocate space for the dictionary. This may be more than one page in
13639 - db->dict = (struct bsd_dict *) vmalloc (hsize * sizeof (struct bsd_dict));
13640 + db->dict = (struct bsd_dict *) BSD_C_MALLOC (hsize * sizeof (struct bsd_dict));
13642 + MOD_INC_USE_COUNT;
13644 + ** MOD_INC_USE_COUNT must be before bsd_free
13645 + ** bsd_free make MOD_DEC_USE_COUNT if db != NULL
13653 - MOD_INC_USE_COUNT;
13656 * If this is the compression buffer then there is no length data.
13657 * For decompression, the length information is needed as well.
13658 @@ -365,7 +378,7 @@ static void *bsd_alloc (struct isdn_ppp_
13662 - db->lens = (unsigned short *) vmalloc ((maxmaxcode + 1) *
13663 + db->lens = (unsigned short *) BSD_C_MALLOC ((maxmaxcode + 1) *
13664 sizeof (db->lens[0]));
13666 bsd_free (db); /* calls MOD_DEC_USE_COUNT; */
13667 @@ -478,7 +491,11 @@ static int bsd_compress (void *state, st
13668 int hval,disp,ilen,mxcode;
13669 unsigned char *rptr = skb_in->data;
13670 int isize = skb_in->len;
13671 +#ifdef CONFIG_ISDN_WITH_ABC
13675 +#ifndef CONFIG_ISDN_WITH_ABC
13676 #define OUTPUT(ent) \
13679 @@ -490,17 +507,45 @@ static int bsd_compress (void *state, st
13681 } while (bitno <= 24); \
13684 +#define OUTPUT(ent) \
13687 + bitno -= n_bits; \
13688 + accm |= ((ent) << bitno); \
13690 + if(skb_out && skb_tailroom(skb_out) > 0) \
13691 + *(skb_put(skb_out,1)) = (unsigned char) (accm>>24); \
13694 + } while (bitno <= 24 && ++secure < 10000); \
13695 + if(secure >= 10000) { \
13696 + printk(KERN_DEBUG "BSD in OUTPUT secure counter reached\n"); \
13703 * If the protocol is not in the range we're interested in,
13704 * just return without compressing the packet. If it is,
13705 * the protocol becomes the first byte to compress.
13707 +#ifdef CONFIG_ISDN_WITH_ABC
13710 + if (proto < 0x21 || proto > 0xf9 || !(proto & 0x1) ) {
13712 + printk(KERN_DEBUG "bsd_compress called with %x\n",proto);
13716 printk(KERN_DEBUG "bsd_compress called with %x\n",proto);
13719 if (proto < 0x21 || proto > 0xf9 || !(proto & 0x1) )
13723 db = (struct bsd_db *) state;
13724 hshift = db->hshift;
13725 @@ -538,6 +583,9 @@ static int bsd_compress (void *state, st
13727 /* continue probing until a match or invalid entry */
13728 disp = (hval == 0) ? 1 : hval;
13729 +#ifdef CONFIG_ISDN_WITH_ABC
13735 @@ -546,7 +594,15 @@ static int bsd_compress (void *state, st
13736 dictp = dict_ptr (db, hval);
13737 if (dictp->codem1 >= max_ent)
13739 +#ifndef CONFIG_ISDN_WITH_ABC
13740 } while (dictp->fcode != fcode);
13742 + } while (dictp->fcode != fcode && ++secure < 100000);
13743 + if(secure >= 100000) {
13744 + printk(KERN_DEBUG "BSD: compress while dictp->fcode != fcode secure-counter reached\n");
13749 ent = dictp->codem1 + 1; /* finally found (prefix,suffix) */
13751 @@ -669,6 +725,9 @@ static int bsd_decompress (void *state,
13755 +#ifdef CONFIG_ISDN_WITH_ABC
13756 + unsigned long secure = 0;
13759 db = (struct bsd_db *) state;
13760 max_ent = db->max_ent;
13761 @@ -677,7 +736,9 @@ static int bsd_decompress (void *state,
13762 n_bits = db->n_bits;
13763 tgtbitno = 32 - n_bits; /* bitno when we have a code */
13765 +#ifndef CONFIG_ISDN_WITH_ABC
13766 printk(KERN_DEBUG "bsd_decompress called\n");
13769 if(!skb_in || !skb_out) {
13770 printk(KERN_ERR "bsd_decompress called with NULL parameter\n");
13771 @@ -795,7 +856,11 @@ static int bsd_decompress (void *state,
13773 p = skb_put(skb_out,codelen);
13775 +#ifdef CONFIG_ISDN_WITH_ABC
13776 + for(secure = 0; finchar > LAST && secure < 50000;secure++) {
13778 while (finchar > LAST) {
13780 struct bsd_dict *dictp2 = dict_ptr (db, finchar);
13782 dictp = dict_ptr (db, dictp2->cptr);
13783 @@ -822,6 +887,12 @@ static int bsd_decompress (void *state,
13787 +#ifdef CONFIG_ISDN_WITH_ABC
13788 + if(secure >= 50000) {
13789 + printk(KERN_DEBUG "BSD: decompress secure-counter reached\n");
13790 + return DECOMP_FATALERROR;
13795 if (--codelen != 0)
13796 @@ -851,12 +922,23 @@ static int bsd_decompress (void *state,
13797 /* look for a free hash table entry */
13798 if (dictp->codem1 < max_ent) {
13799 disp = (hval == 0) ? 1 : hval;
13800 +#ifdef CONFIG_ISDN_WITH_ABC
13805 if (hval >= db->hsize)
13807 dictp = dict_ptr (db, hval);
13808 +#ifndef CONFIG_ISDN_WITH_ABC
13809 } while (dictp->codem1 < max_ent);
13811 + } while (dictp->codem1 < max_ent && ++secure < 50000);
13812 + if(secure >= 50000) {
13813 + printk(KERN_DEBUG "BSD: decomp while (dictp->codem1 < max_ent) secure-counter reached\n");
13814 + return DECOMP_FATALERROR;
13820 @@ -895,11 +977,21 @@ static int bsd_decompress (void *state,
13821 db->comp_bytes += skb_in->len - BSD_OVHD;
13822 db->uncomp_bytes += skb_out->len;
13824 +#ifdef CONFIG_ISDN_WITH_ABC
13826 + ** bsd_check will call bsd_clear
13827 + ** and so on the internal tables will be cleared.
13829 + ** I think that's not what we will at this point ?????
13830 + ** For me at works without bsd_check.
13833 if (bsd_check(db)) {
13835 printk(KERN_DEBUG "bsd_decomp%d: peer should have cleared dictionary on %d\n",
13836 db->unit, db->seqno - 1);
13839 return skb_out->len;
13842 --- a/drivers/isdn/isdn_common.c
13843 +++ b/drivers/isdn/isdn_common.c
13845 -/* $Id: isdn_common.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
13846 +/* $Id: isdn_common.c,v 1.137 2002/02/09 21:19:11 keil Exp $
13848 * Linux ISDN subsystem, common used functions (linklevel).
13851 #include <linux/vmalloc.h>
13852 #include <linux/isdn.h>
13853 #include <linux/smp_lock.h>
13854 +#include <linux/list.h>
13855 #include "isdn_common.h"
13856 #include "isdn_tty.h"
13857 #include "isdn_net.h"
13859 #include <linux/isdn_divertif.h>
13860 #endif /* CONFIG_ISDN_DIVERSION */
13861 #include "isdn_v110.h"
13862 +#ifdef HAVE_DEVFS_FS
13863 #include <linux/devfs_fs_kernel.h>
13864 +#endif /* HAVE_DEVFS_FS */
13867 #undef ISDN_DEBUG_STATCALLB
13868 @@ -44,7 +47,7 @@ MODULE_LICENSE("GPL");
13872 -static char *isdn_revision = "$Revision: 1.1.4.1 $";
13873 +static char *isdn_revision = "$Revision: 1.137 $";
13875 extern char *isdn_net_revision;
13876 extern char *isdn_tty_revision;
13877 @@ -67,19 +70,19 @@ static isdn_divert_if *divert_if; /* = N
13879 static int isdn_writebuf_stub(int, int, const u_char *, int, int);
13880 static void set_global_features(void);
13881 +#ifdef HAVE_DEVFS_FS
13882 static void isdn_register_devfs(int);
13883 static void isdn_unregister_devfs(int);
13884 +#endif /* HAVE_DEVFS_FS */
13885 static int isdn_wildmat(char *s, char *p);
13888 isdn_lock_drivers(void)
13893 - for (i = 0; i < ISDN_MAX_DRIVERS; i++) {
13894 - if (!dev->drv[i])
13896 + for (i = 0; i < dev->drivers; i++) {
13901 @@ -101,10 +104,7 @@ isdn_unlock_drivers(void)
13905 - for (i = 0; i < ISDN_MAX_DRIVERS; i++) {
13906 - if (!dev->drv[i])
13909 + for (i = 0; i < dev->drivers; i++)
13910 if (dev->drv[i]->locks > 0) {
13913 @@ -114,7 +114,6 @@ isdn_unlock_drivers(void)
13914 isdn_command(&cmd);
13915 dev->drv[i]->locks--;
13921 @@ -473,6 +472,7 @@ isdn_status_callback(isdn_ctrl * c)
13922 dev->drv[di]->flags &= ~DRV_FLAG_RUNNING;
13924 case ISDN_STAT_ICALL:
13925 + case ISDN_STAT_ICALLW:
13928 #ifdef ISDN_DEBUG_STATCALLB
13929 @@ -718,7 +718,9 @@ isdn_status_callback(isdn_ctrl * c)
13930 dev->drvmap[i] = -1;
13931 dev->chanmap[i] = -1;
13932 dev->usage[i] &= ~ISDN_USAGE_DISABLED;
13933 +#ifdef HAVE_DEVFS_FS
13934 isdn_unregister_devfs(i);
13935 +#endif /* HAVE_DEVFS_FS */
13938 dev->channels -= dev->drv[di]->channels;
13939 @@ -755,6 +757,10 @@ isdn_status_callback(isdn_ctrl * c)
13941 return(divert_if->stat_callback(c));
13942 #endif /* CONFIG_ISDN_DIVERSION */
13943 + case ISDN_STAT_ALERT:
13944 + case ISDN_STAT_PROCEED:
13945 + isdn_tty_stat_callback(i, c);
13950 @@ -900,72 +906,239 @@ isdn_minor2chan(int minor)
13951 return (dev->chanmap[minor]);
13955 -isdn_statstr(void)
13956 +// ----------------------------------------------------------------------
13959 +// This device has somewhat insane semantics, but we need to support
13960 +// them for the sake of compatibility.
13962 +// After opening, the first read will succeed and return the current state
13963 +// Then, unless O_NONBLOCK is set, it will block until a state change happens
13964 +// and then return the new state.
13965 +// Also, if the buffer size for the read is too small, we'll just return
13968 +struct isdnstatus_dev {
13969 + struct list_head list;
13973 +static DECLARE_WAIT_QUEUE_HEAD(isdnstatus_waitq);
13974 +static LIST_HEAD(isdnstatus_devs);
13975 +static spinlock_t isdnstatus_devs_lock = SPIN_LOCK_UNLOCKED;
13978 +isdn_info_update(void)
13980 + struct list_head *p;
13981 + struct isdnstatus_dev *idev;
13983 + spin_lock(&isdnstatus_devs_lock);
13984 + list_for_each(p, &isdnstatus_devs) {
13985 + idev = list_entry(p, struct isdnstatus_dev, list);
13986 + idev->update = 1;
13988 + spin_unlock(&isdnstatus_devs_lock);
13989 + wake_up_interruptible(&isdnstatus_waitq);
13993 +isdnstatus_open(struct inode *ino, struct file *filep)
13995 + struct isdnstatus_dev *p;
13997 + p = kmalloc(sizeof(struct isdnstatus_dev), GFP_USER);
14001 + /* At opening time we allow a single update */
14003 + spin_lock(&isdnstatus_devs_lock);
14004 + list_add(&p->list, &isdnstatus_devs);
14005 + spin_unlock(&isdnstatus_devs_lock);
14006 + filep->private_data = p;
14012 +isdnstatus_close(struct inode *ino, struct file *filep)
14014 + struct isdnstatus_dev *p = filep->private_data;
14016 + spin_lock(&isdnstatus_devs_lock);
14017 + list_del(&p->list);
14018 + spin_unlock(&isdnstatus_devs_lock);
14022 +// FIXME we don't lock against the state changing whilst being
14026 +isdn_statstr(char *buf)
14028 - static char istatbuf[2048];
14032 - sprintf(istatbuf, "idmap:\t");
14033 - p = istatbuf + strlen(istatbuf);
14035 + p += sprintf(p, "idmap:\t");
14036 for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
14037 - sprintf(p, "%s ", (dev->drvmap[i] < 0) ? "-" : dev->drvid[dev->drvmap[i]]);
14038 - p = istatbuf + strlen(istatbuf);
14039 + p += sprintf(p, "%s ", (dev->drvmap[i] < 0) ? "-" : dev->drvid[dev->drvmap[i]]);
14041 - sprintf(p, "\nchmap:\t");
14042 - p = istatbuf + strlen(istatbuf);
14043 + p += sprintf(p, "\nchmap:\t");
14044 for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
14045 - sprintf(p, "%d ", dev->chanmap[i]);
14046 - p = istatbuf + strlen(istatbuf);
14047 + p += sprintf(p, "%d ", dev->chanmap[i]);
14049 - sprintf(p, "\ndrmap:\t");
14050 - p = istatbuf + strlen(istatbuf);
14051 + p += sprintf(p, "\ndrmap:\t");
14052 for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
14053 - sprintf(p, "%d ", dev->drvmap[i]);
14054 - p = istatbuf + strlen(istatbuf);
14055 + p += sprintf(p, "%d ", dev->drvmap[i]);
14057 - sprintf(p, "\nusage:\t");
14058 - p = istatbuf + strlen(istatbuf);
14059 + p += sprintf(p, "\nusage:\t");
14060 for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
14061 - sprintf(p, "%d ", dev->usage[i]);
14062 - p = istatbuf + strlen(istatbuf);
14063 + p += sprintf(p, "%d ", dev->usage[i]);
14065 - sprintf(p, "\nflags:\t");
14066 - p = istatbuf + strlen(istatbuf);
14067 + p += sprintf(p, "\nflags:\t");
14068 for (i = 0; i < ISDN_MAX_DRIVERS; i++) {
14070 - sprintf(p, "%ld ", dev->drv[i]->online);
14071 - p = istatbuf + strlen(istatbuf);
14072 + p += sprintf(p, "%ld ", dev->drv[i]->online);
14074 - sprintf(p, "? ");
14075 - p = istatbuf + strlen(istatbuf);
14076 + p += sprintf(p, "? ");
14079 - sprintf(p, "\nphone:\t");
14080 - p = istatbuf + strlen(istatbuf);
14081 + p += sprintf(p, "\nphone:\t");
14082 for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
14083 - sprintf(p, "%s ", dev->num[i]);
14084 - p = istatbuf + strlen(istatbuf);
14085 + p += sprintf(p, "%s ", dev->num[i]);
14087 - sprintf(p, "\n");
14089 + p += sprintf(p, "\n");
14092 -/* Module interface-code */
14094 +isdnstatus_read(struct file *file, char *buf, size_t count, loff_t * off)
14096 + static DECLARE_MUTEX(istatbuf_mutex);
14097 + static char istatbuf[2048];
14100 -isdn_info_update(void)
14101 + DECLARE_WAITQUEUE(wait, current);
14102 + struct isdnstatus_dev *idev;
14104 + unsigned int len;
14106 + idev = file->private_data;
14108 + if (off != &file->f_pos)
14111 + add_wait_queue(&isdnstatus_waitq, &wait);
14113 + set_current_state(TASK_INTERRUPTIBLE);
14115 + if (idev->update)
14118 + retval = -EAGAIN;
14119 + if (file->f_flags & O_NONBLOCK)
14122 + retval = -ERESTARTSYS;
14123 + if (signal_pending(current))
14128 + __set_current_state(TASK_RUNNING);
14129 + remove_wait_queue(&isdnstatus_waitq, &wait);
14131 + if (!idev->update)
14134 + idev->update = 0;
14135 + down(&istatbuf_mutex);
14136 + isdn_statstr(istatbuf);
14137 + len = strlen(istatbuf);
14138 + if (len > count) {
14142 + if (copy_to_user(buf, istatbuf, len)) {
14143 + retval = -EFAULT;
14150 + up(&istatbuf_mutex);
14156 +isdnstatus_write(struct file *file, const char *buf, size_t count, loff_t * off)
14158 - infostruct *p = dev->infochain;
14162 +static unsigned int
14163 +isdnstatus_poll(struct file *file, poll_table * wait)
14165 + struct isdnstatus_dev *idev;
14166 + unsigned int mask = 0;
14168 + idev = file->private_data;
14171 - *(p->private) = 1;
14172 - p = (infostruct *) p->next;
14173 + poll_wait(file, &isdnstatus_waitq, wait);
14174 + if (idev->update) {
14175 + mask |= POLLIN | POLLRDNORM;
14177 - wake_up_interruptible(&(dev->info_waitq));
14182 +isdnstatus_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
14185 + isdn_net_ioctl_phone phone;
14194 + ulong *p = (ulong *) arg;
14196 + if ((retval = verify_area(VERIFY_WRITE, (void *) arg,
14197 + sizeof(ulong) * ISDN_MAX_CHANNELS * 2)))
14199 + for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
14200 + put_user(dev->ibytes[i], p++);
14201 + put_user(dev->obytes[i], p++);
14207 +#ifdef CONFIG_NETDEVICES
14209 + /* Get peer phone number of a connected
14210 + * isdn network interface */
14212 + if (copy_from_user((char *) &phone, (char *) arg, sizeof(phone)))
14214 + return isdn_net_getpeer(&phone, (isdn_net_ioctl_phone *) arg);
14223 +// ----------------------------------------------------------------------
14227 isdn_read(struct file *file, char *buf, size_t count, loff_t * off)
14229 @@ -976,37 +1149,16 @@ isdn_read(struct file *file, char *buf,
14233 - loff_t pos = *off;
14235 if (off != &file->f_pos)
14238 - if (pos != (unsigned) pos)
14241 +#ifndef COMPAT_HAVE_READ_LOCK_KERNEL
14243 - if (minor == ISDN_MINOR_STATUS) {
14244 - if (!file->private_data) {
14245 - if (file->f_flags & O_NONBLOCK) {
14246 - retval = -EAGAIN;
14249 - interruptible_sleep_on(&(dev->info_waitq));
14251 - p = isdn_statstr();
14252 - file->private_data = 0;
14253 - if ((len = strlen(p)) <= count) {
14254 - if (copy_to_user(buf, p, len)) {
14255 - retval = -EFAULT;
14258 - *off = pos + len;
14266 + if (minor == ISDN_MINOR_STATUS)
14267 + return isdnstatus_read(file, buf, count, off);
14269 if (!dev->drivers) {
14272 @@ -1031,7 +1183,7 @@ isdn_read(struct file *file, char *buf,
14274 len = isdn_readbchan(drvidx, chidx, p, 0, count,
14275 &dev->drv[drvidx]->rcv_waitq[chidx]);
14276 - *off = pos + len;
14278 restore_flags(flags);
14279 if (copy_to_user(buf,p,len))
14281 @@ -1052,6 +1204,9 @@ isdn_read(struct file *file, char *buf,
14283 interruptible_sleep_on(&(dev->drv[drvidx]->st_waitq));
14285 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
14286 + if(drvidx || (len = isdn_dw_abc_lcr_readstat(buf,count)) < 1) {
14288 if (dev->drv[drvidx]->interface->readstat) {
14289 if (count > dev->drv[drvidx]->stavail)
14290 count = dev->drv[drvidx]->stavail;
14291 @@ -1065,6 +1220,9 @@ isdn_read(struct file *file, char *buf,
14295 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
14301 @@ -1072,7 +1230,7 @@ isdn_read(struct file *file, char *buf,
14303 dev->drv[drvidx]->stavail = 0;
14304 restore_flags(flags);
14305 - *off = pos + len;
14310 @@ -1084,7 +1242,9 @@ isdn_read(struct file *file, char *buf,
14314 +#ifndef COMPAT_HAVE_READ_LOCK_KERNEL
14320 @@ -1096,15 +1256,18 @@ isdn_write(struct file *file, const char
14324 + if (minor == ISDN_MINOR_STATUS)
14325 + return isdnstatus_write(file, buf, count, off);
14327 if (off != &file->f_pos)
14330 - if (minor == ISDN_MINOR_STATUS)
14335 +#ifndef COMPAT_HAVE_WRITE_LOCK_KERNEL
14338 if (minor <= ISDN_MINOR_BMAX) {
14339 printk(KERN_WARNING "isdn_write minor %d obsolete!\n", minor);
14340 drvidx = isdn_minor2drv(minor);
14341 @@ -1149,7 +1312,9 @@ isdn_write(struct file *file, const char
14345 +#ifndef COMPAT_HAVE_WRITE_LOCK_KERNEL
14351 @@ -1160,15 +1325,12 @@ isdn_poll(struct file *file, poll_table
14352 unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev);
14353 int drvidx = isdn_minor2drv(minor - ISDN_MINOR_CTRL);
14355 +#ifndef COMPAT_HAVE_POLL_LOCK_KERNEL
14357 - if (minor == ISDN_MINOR_STATUS) {
14358 - poll_wait(file, &(dev->info_waitq), wait);
14359 - /* mask = POLLOUT | POLLWRNORM; */
14360 - if (file->private_data) {
14361 - mask |= POLLIN | POLLRDNORM;
14366 + if (minor == ISDN_MINOR_STATUS)
14367 + return isdnstatus_poll(file, wait);
14369 if (minor >= ISDN_MINOR_CTRL && minor <= ISDN_MINOR_CTRLMAX) {
14371 /* driver deregistered while file open */
14372 @@ -1190,7 +1352,9 @@ isdn_poll(struct file *file, poll_table
14376 +#ifndef COMPAT_HAVE_POLL_LOCK_KERNEL
14382 @@ -1220,42 +1384,9 @@ isdn_ioctl(struct inode *inode, struct f
14383 #define phone iocpar.phone
14384 #define cfg iocpar.cfg
14386 - if (minor == ISDN_MINOR_STATUS) {
14394 - ulong *p = (ulong *) arg;
14396 - if ((ret = verify_area(VERIFY_WRITE, (void *) arg,
14397 - sizeof(ulong) * ISDN_MAX_CHANNELS * 2)))
14399 - for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
14400 - put_user(dev->ibytes[i], p++);
14401 - put_user(dev->obytes[i], p++);
14407 -#ifdef CONFIG_NETDEVICES
14409 - /* Get peer phone number of a connected
14410 - * isdn network interface */
14412 - if (copy_from_user((char *) &phone, (char *) arg, sizeof(phone)))
14414 - return isdn_net_getpeer(&phone, (isdn_net_ioctl_phone *) arg);
14422 + if (minor == ISDN_MINOR_STATUS)
14423 + return isdnstatus_ioctl(inode, file, cmd, arg);
14427 if (minor <= ISDN_MINOR_BMAX) {
14428 @@ -1277,11 +1408,34 @@ isdn_ioctl(struct inode *inode, struct f
14431 case IIOCNETDWRSET:
14432 +#ifdef CONFIG_ISDN_WITH_ABC
14435 + if (copy_from_user(name, (char *) arg, sizeof(name))) {
14441 + isdn_net_dev *p = isdn_net_findif(name);
14446 + return(isdn_dw_abc_reset_interface(p->local,1));
14450 printk(KERN_INFO "INFO: ISDN_DW_ABC_EXTENSION not enabled\n");
14454 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
14455 + return(isdn_dw_abc_lcr_ioctl(arg));
14457 printk(KERN_INFO "INFO: ISDN_ABC_LCR_SUPPORT not enabled\n");
14460 #ifdef CONFIG_NETDEVICES
14462 /* Add a network-interface */
14463 @@ -1657,22 +1811,12 @@ isdn_open(struct inode *ino, struct file
14465 int retval = -ENODEV;
14467 +#ifdef COMPAT_USE_MODCOUNT_LOCK
14468 + MOD_INC_USE_COUNT;
14471 if (minor == ISDN_MINOR_STATUS) {
14474 - if ((p = kmalloc(sizeof(infostruct), GFP_KERNEL))) {
14475 - p->next = (char *) dev->infochain;
14476 - p->private = (char *) &(filep->private_data);
14477 - dev->infochain = p;
14478 - /* At opening we allow a single update */
14479 - filep->private_data = (char *) 1;
14483 - retval = -ENOMEM;
14486 + return isdnstatus_open(ino, filep);
14488 if (!dev->channels)
14490 @@ -1695,6 +1839,9 @@ isdn_open(struct inode *ino, struct file
14493 isdn_lock_drivers();
14494 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
14495 + if(!drvidx) isdn_dw_abc_lcr_open();
14500 @@ -1707,6 +1854,10 @@ isdn_open(struct inode *ino, struct file
14504 +#ifdef COMPAT_USE_MODCOUNT_LOCK
14506 + MOD_DEC_USE_COUNT;
14511 @@ -1715,25 +1866,11 @@ isdn_close(struct inode *ino, struct fil
14513 uint minor = MINOR(ino->i_rdev);
14515 +#ifndef COMPAT_USE_MODCOUNT_LOCK
14518 if (minor == ISDN_MINOR_STATUS) {
14519 - infostruct *p = dev->infochain;
14520 - infostruct *q = NULL;
14523 - if (p->private == (char *) &(filep->private_data)) {
14525 - q->next = p->next;
14527 - dev->infochain = (infostruct *) (p->next);
14532 - p = (infostruct *) (p->next);
14534 - printk(KERN_WARNING "isdn: No private data while closing isdnctrl\n");
14536 + isdnstatus_close(ino, filep);
14538 isdn_unlock_drivers();
14539 if (minor <= ISDN_MINOR_BMAX)
14540 @@ -1741,6 +1878,12 @@ isdn_close(struct inode *ino, struct fil
14541 if (minor <= ISDN_MINOR_CTRLMAX) {
14542 if (dev->profd == current)
14544 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
14546 + int drvidx = isdn_minor2drv(minor - ISDN_MINOR_CTRL);
14547 + if(!drvidx) isdn_dw_abc_lcr_close();
14552 #ifdef CONFIG_ISDN_PPP
14553 @@ -1749,13 +1892,19 @@ isdn_close(struct inode *ino, struct fil
14557 +#ifdef COMPAT_USE_MODCOUNT_LOCK
14558 + MOD_DEC_USE_COUNT;
14565 static struct file_operations isdn_fops =
14567 +#ifdef COMPAT_HAS_FILEOP_OWNER
14568 owner: THIS_MODULE,
14573 @@ -1808,6 +1957,15 @@ isdn_get_free_channel(int usage, int l2_
14574 if (USG_NONE(dev->usage[i]) &&
14575 (dev->drvmap[i] != -1)) {
14576 int d = dev->drvmap[i];
14577 +#ifdef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
14578 + if(jiffies < dev->dwabc_chan_external_inuse[i]) {
14580 + if((dev->dwabc_chan_external_inuse[i] - jiffies) > (HZ * 120))
14581 + dev->dwabc_chan_external_inuse[i] = 0;
14586 if ((dev->usage[i] & ISDN_USAGE_EXCLUSIVE) &&
14587 ((pre_dev != d) || (pre_chan != dev->chanmap[i])))
14589 @@ -1826,7 +1984,11 @@ isdn_get_free_channel(int usage, int l2_
14590 restore_flags(flags);
14593 +#ifdef CONFIG_ISDN_WITH_ABC
14594 + if ((pre_dev == d) && ((pre_chan == dev->chanmap[i]) || pre_chan > 1000)) {
14596 if ((pre_dev == d) && (pre_chan == dev->chanmap[i])) {
14598 dev->usage[i] &= ISDN_USAGE_EXCLUSIVE;
14599 dev->usage[i] |= usage;
14600 isdn_info_update();
14601 @@ -2013,7 +2175,7 @@ isdn_add_channels(driver *d, int drvidx,
14603 if ((adding) && (d->rcverr))
14605 - if (!(d->rcverr = kmalloc(sizeof(int) * m, GFP_KERNEL))) {
14606 + if (!(d->rcverr = (int *) kmalloc(sizeof(int) * m, GFP_KERNEL))) {
14607 printk(KERN_WARNING "register_isdn: Could not alloc rcverr\n");
14610 @@ -2021,7 +2183,7 @@ isdn_add_channels(driver *d, int drvidx,
14612 if ((adding) && (d->rcvcount))
14613 kfree(d->rcvcount);
14614 - if (!(d->rcvcount = kmalloc(sizeof(int) * m, GFP_KERNEL))) {
14615 + if (!(d->rcvcount = (int *) kmalloc(sizeof(int) * m, GFP_KERNEL))) {
14616 printk(KERN_WARNING "register_isdn: Could not alloc rcvcount\n");
14617 if (!adding) kfree(d->rcverr);
14619 @@ -2033,7 +2195,8 @@ isdn_add_channels(driver *d, int drvidx,
14620 skb_queue_purge(&d->rpqueue[j]);
14623 - if (!(d->rpqueue = kmalloc(sizeof(struct sk_buff_head) * m, GFP_KERNEL))) {
14624 + if (!(d->rpqueue =
14625 + (struct sk_buff_head *) kmalloc(sizeof(struct sk_buff_head) * m, GFP_KERNEL))) {
14626 printk(KERN_WARNING "register_isdn: Could not alloc rpqueue\n");
14628 kfree(d->rcvcount);
14629 @@ -2047,7 +2210,8 @@ isdn_add_channels(driver *d, int drvidx,
14631 if ((adding) && (d->rcv_waitq))
14632 kfree(d->rcv_waitq);
14633 - d->rcv_waitq = kmalloc(sizeof(wait_queue_head_t) * 2 * m, GFP_KERNEL);
14634 + d->rcv_waitq = (wait_queue_head_t *)
14635 + kmalloc(sizeof(wait_queue_head_t) * 2 * m, GFP_KERNEL);
14636 if (!d->rcv_waitq) {
14637 printk(KERN_WARNING "register_isdn: Could not alloc rcv_waitq\n");
14639 @@ -2071,7 +2235,9 @@ isdn_add_channels(driver *d, int drvidx,
14640 if (dev->chanmap[k] < 0) {
14641 dev->chanmap[k] = j;
14642 dev->drvmap[k] = drvidx;
14643 +#ifdef HAVE_DEVFS_FS
14644 isdn_register_devfs(k);
14645 +#endif /* HAVE_DEVFS_FS */
14648 restore_flags(flags);
14649 @@ -2135,6 +2301,7 @@ int DIVERT_REG_NAME(isdn_divert_if *i_di
14650 i_div->ll_cmd = isdn_command; /* set command function */
14651 i_div->drv_to_name = map_drvname;
14652 i_div->name_to_drv = map_namedrv;
14653 + i_div->dial_net_name = isdn_net_force_dial;
14655 divert_if = i_div; /* remember interface */
14656 return(DIVERT_NO_ERR);
14657 @@ -2172,7 +2339,7 @@ register_isdn(isdn_if * i)
14658 printk(KERN_WARNING "register_isdn: No write routine given.\n");
14661 - if (!(d = kmalloc(sizeof(driver), GFP_KERNEL))) {
14662 + if (!(d = (driver *) kmalloc(sizeof(driver), GFP_KERNEL))) {
14663 printk(KERN_WARNING "register_isdn: Could not alloc driver-struct\n");
14666 @@ -2232,6 +2399,7 @@ isdn_getrev(const char *revision)
14670 +#ifdef HAVE_DEVFS_FS
14671 #ifdef CONFIG_DEVFS_FS
14673 static devfs_handle_t devfs_handle;
14674 @@ -2321,6 +2489,7 @@ static void isdn_cleanup_devfs(void)
14677 #endif /* CONFIG_DEVFS_FS */
14678 +#endif /* HAVE_DEVFS_FS */
14681 * Allocate and initialize all data, register modem-devices
14682 @@ -2338,7 +2507,6 @@ static int __init isdn_init(void)
14683 init_timer(&dev->timer);
14684 dev->timer.function = isdn_timer_funct;
14685 init_MUTEX(&dev->sem);
14686 - init_waitqueue_head(&dev->info_waitq);
14687 for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
14688 dev->drvmap[i] = -1;
14689 dev->chanmap[i] = -1;
14690 @@ -2352,7 +2520,9 @@ static int __init isdn_init(void)
14694 +#ifdef HAVE_DEVFS_FS
14696 +#endif /* HAVE_DEVFS_FS */
14697 if ((i = isdn_tty_modem_init()) < 0) {
14698 printk(KERN_WARNING "isdn: Could not register tty devices\n");
14700 @@ -2360,7 +2530,9 @@ static int __init isdn_init(void)
14702 tty_unregister_driver(&dev->mdm.tty_modem);
14704 +#ifdef HAVE_DEVFS_FS
14705 isdn_cleanup_devfs();
14706 +#endif /* HAVE_DEVFS_FS */
14707 devfs_unregister_chrdev(ISDN_MAJOR, "isdn");
14710 @@ -2371,7 +2543,9 @@ static int __init isdn_init(void)
14711 tty_unregister_driver(&dev->mdm.cua_modem);
14712 for (i = 0; i < ISDN_MAX_CHANNELS; i++)
14713 kfree(dev->mdm.info[i].xmit_buf - 4);
14714 +#ifdef HAVE_DEVFS_FS
14715 isdn_cleanup_devfs();
14716 +#endif /* HAVE_DEVFS_FS */
14717 devfs_unregister_chrdev(ISDN_MAJOR, "isdn");
14720 @@ -2397,6 +2571,9 @@ static int __init isdn_init(void)
14723 isdn_info_update();
14724 +#ifdef CONFIG_ISDN_WITH_ABC
14725 + isdn_dw_abc_init_func();
14730 @@ -2405,7 +2582,7 @@ static int __init isdn_init(void)
14732 static void __exit isdn_exit(void)
14734 - unsigned long flags;
14738 #ifdef CONFIG_ISDN_PPP
14739 @@ -2439,13 +2616,18 @@ static void __exit isdn_exit(void)
14740 printk(KERN_WARNING "isdn: controldevice busy, remove cancelled\n");
14741 restore_flags(flags);
14743 +#ifdef HAVE_DEVFS_FS
14744 isdn_cleanup_devfs();
14745 +#endif /* HAVE_DEVFS_FS */
14746 del_timer(&dev->timer);
14747 restore_flags(flags);
14748 /* call vfree with interrupts enabled, else it will hang */
14750 printk(KERN_NOTICE "ISDN-subsystem unloaded\n");
14752 +#ifdef CONFIG_ISDN_WITH_ABC
14753 + isdn_dw_abc_release_func();
14757 module_init(isdn_init);
14758 --- a/drivers/isdn/isdn_common.h
14759 +++ b/drivers/isdn/isdn_common.h
14761 -/* $Id: isdn_common.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
14762 +/* $Id: isdn_common.h,v 1.22 2001/09/24 13:22:42 kai Exp $
14764 * header for Linux ISDN subsystem
14765 * common used functions and debugging-switches (linklevel).
14767 #undef ISDN_DEBUG_NET_DIAL
14768 #undef ISDN_DEBUG_NET_ICALL
14770 +#ifdef CONFIG_ISDN_WITH_ABC
14771 +int isdn_net_force_dial_lp(isdn_net_local *);
14774 extern void isdn_MOD_INC_USE_COUNT(void);
14775 extern void isdn_MOD_DEC_USE_COUNT(void);
14776 --- a/drivers/isdn/isdn_concap.c
14777 +++ b/drivers/isdn/isdn_concap.c
14779 -/* $Id: isdn_concap.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
14780 +/* $Id: isdn_concap.c,v 1.9 2001/09/24 13:22:42 kai Exp $
14782 * Linux ISDN subsystem, protocol encapsulation
14784 --- a/drivers/isdn/isdn_concap.h
14785 +++ b/drivers/isdn/isdn_concap.h
14787 -/* $Id: isdn_concap.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
14788 +/* $Id: isdn_concap.h,v 1.4 2001/09/24 13:22:42 kai Exp $
14790 * Linux ISDN subsystem, protocol encapsulation
14793 +++ b/drivers/isdn/isdn_dwabc.c
14796 +/* $Id: isdn_dwabc.c,v 1.27 2001/12/01 23:18:21 detabc Exp $
14798 + * Linux ISDN subsystem, abc-extension releated funktions.
14800 + * Copyright by abc GmbH
14801 + * written by Detlef Wengorz <detlefw@isdn4linux.de>
14803 + * This program is free software; you can redistribute it and/or modify
14804 + * it under the terms of the GNU General Public License as published by
14805 + * the Free Software Foundation; either version 2, or (at your option)
14806 + * any later version.
14810 +#include <linux/config.h>
14811 +#define __NO_VERSION__
14813 +#ifdef CONFIG_ISDN_WITH_ABC
14815 +static char *dwabcrevison = "$Revision: 1.27 $";
14817 +#include <asm/semaphore.h>
14818 +#define CONFIG_ISDN_WITH_ABC_NEED_DWSJIFFIES 1
14819 +#include <linux/list.h>
14820 +#include <linux/isdn.h>
14821 +#include "isdn_common.h"
14822 +#include "isdn_net.h"
14824 +#include <linux/skbuff.h>
14826 +#include <net/udp.h>
14827 +#include <net/checksum.h>
14828 +#include <linux/isdn_dwabc.h>
14831 +#if CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS && CONFIG_ISDN_PPP
14832 +#include <linux/isdn_ppp.h>
14833 +extern struct isdn_ppp_compressor *isdn_ippp_comp_head;
14834 +#define ipc_head isdn_ippp_comp_head
14835 +#ifndef CI_BSD_COMPRESS
14836 +#define CI_BSD_COMPRESS 21
14840 +#define NBYTEORDER_30BYTES 0x1e00
14841 +#define DWABC_TMRES (HZ / 10)
14843 +#define VERBLEVEL (dev->net_verbose > 2)
14845 +static struct timer_list dw_abc_timer;
14848 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
14849 +static ISDN_DWSPINLOCK lcr_spin = ISDN_DWSPIN_UNLOCKED;
14850 +#define LCR_LOCK() isdn_dwspin_trylock(&lcr_spin)
14851 +#define LCR_ULOCK() isdn_dwspin_unlock(&lcr_spin)
14853 +typedef struct ISDN_DW_ABC_LCR {
14855 + struct list_head dll;
14856 + char lcr_printbuf[64 + ISDN_MSNLEN + ISDN_MSNLEN];
14860 +} ISDN_DW_ABC_LCR;
14862 +static LIST_HEAD(lcr_dll);
14863 +static atomic_t lcr_open_count = ATOMIC_INIT(0);
14864 +static volatile ulong lcr_call_counter = 0;
14867 +static int myjiftime(char *p,u_long nj)
14869 + sprintf(p,"%02ld:%02ld.%02ld",
14870 + ((nj / 100) / 60) % 100, (nj / 100) % 60,nj % 100);
14876 +static void dw_lcr_clear_all(void)
14878 + struct list_head *lh;
14880 + if(!LCR_LOCK()) {
14882 + while((lh = lcr_dll.next) != &lcr_dll) {
14884 + ISDN_DW_ABC_LCR *p = list_entry(lh,ISDN_DW_ABC_LCR,dll);
14885 + list_del(&p->dll);
14893 +void isdn_dw_abc_lcr_open(void)
14894 +{ atomic_inc(&lcr_open_count); }
14896 +void isdn_dw_abc_lcr_close(void)
14898 + if(atomic_dec_and_test(&lcr_open_count))
14899 + dw_lcr_clear_all();
14902 +int isdn_dw_abc_lcr_lock(void)
14903 +{ return(LCR_LOCK()); }
14905 +void isdn_dw_abc_lcr_ulock(void)
14909 +size_t isdn_dw_abc_lcr_readstat(char *buf,size_t count)
14913 + while(buf != NULL && count > 0) {
14915 + struct list_head *lh = NULL;
14916 + ISDN_DW_ABC_LCR *p = NULL;
14920 + if((n = LCR_LOCK())) {
14929 + while((lh = lcr_dll.next) != &lcr_dll) {
14931 + p = list_entry(lh,ISDN_DW_ABC_LCR,dll);
14933 + if(p->lcr_poin >= p->lcr_epoin) {
14935 + list_del(&p->dll);
14948 + n = p->lcr_epoin - p->lcr_poin;
14953 + dp = p->lcr_poin;
14954 + p->lcr_poin += n;
14957 + copy_to_user(buf,dp,n);
14965 +static void isdn_dw_abc_lcr_clear_helper(isdn_net_local *lp)
14971 + a = lp->dw_abc_lcr_cmd;
14972 + b = lp->dw_abc_lcr_io;
14973 + lp->dw_abc_lcr_io = NULL;
14974 + lp->dw_abc_lcr_cmd = NULL;
14975 + lp->dw_abc_lcr_callid =
14976 + lp->dw_abc_lcr_start_request =
14977 + lp->dw_abc_lcr_end_request = 0;
14984 +void isdn_dw_abc_lcr_clear(isdn_net_local *lp)
14986 + if(!LCR_LOCK()) {
14987 + isdn_dw_abc_lcr_clear_helper(lp);
14993 +u_long isdn_dw_abc_lcr_call_number( isdn_net_local *lp,isdn_ctrl *call_cmd)
15000 + isdn_dw_abc_lcr_clear_helper(lp);
15002 + if( atomic_read(&lcr_open_count) > 0 &&
15004 + call_cmd != NULL) {
15006 + ISDN_DW_ABC_LCR *lc = NULL;
15009 + if((lp->dw_abc_lcr_cmd =
15010 + ( isdn_ctrl *)kmalloc(sizeof(isdn_ctrl),GFP_ATOMIC)) == NULL) {
15013 + isdn_dw_abc_lcr_clear_helper(lp);
15015 + printk(KERN_DEBUG "%s %d : LCR no memory\n",__FILE__,__LINE__);
15019 + memcpy(lp->dw_abc_lcr_cmd,call_cmd,sizeof(*call_cmd));
15020 + while(!(lp->dw_abc_lcr_callid = mid = lcr_call_counter++));
15022 + lp->dw_abc_lcr_end_request = lp->dw_abc_lcr_start_request = jiffies;
15023 + lp->dw_abc_lcr_end_request += HZ * 3;
15025 + if((lc = (ISDN_DW_ABC_LCR *)kmalloc(sizeof(*lc),GFP_KERNEL)) == NULL)
15028 + lc->lcr_poin = lc->lcr_epoin = lc->lcr_printbuf;
15029 + lc->lcr_epoin += myjiftime(lc->lcr_epoin,jiffies);
15031 + sprintf(lc->lcr_epoin," DW_ABC_LCR\t%lu\t%.*s\t%.*s\n",
15033 + (int)ISDN_MSNLEN,
15034 + call_cmd->parm.setup.eazmsn,
15035 + (int)ISDN_MSNLEN,
15036 + call_cmd->parm.setup.phone);
15038 + lc->lcr_epoin += strlen(lc->lcr_epoin);
15039 + ab = lc->lcr_epoin - lc->lcr_poin;
15041 + list_add_tail(&lc->dll,&lcr_dll);
15046 + if(dev->drv[0] != NULL ) {
15048 + dev->drv[0]->stavail += ab;
15049 + wake_up_interruptible(&dev->drv[0]->st_waitq);
15053 + } else LCR_ULOCK();
15059 +int isdn_dw_abc_lcr_ioctl(u_long arg)
15061 + struct ISDN_DWABC_LCR_IOCTL i;
15062 + int need = sizeof(struct ISDN_DWABC_LCR_IOCTL);
15065 + memset(&i,0,sizeof(struct ISDN_DWABC_LCR_IOCTL));
15066 + copy_from_user(&i,(char *)arg,sizeof(int));
15068 + if(i.lcr_ioctl_sizeof < need)
15069 + need = i.lcr_ioctl_sizeof;
15072 + copy_from_user(&i,(char *)arg,need);
15079 + for(;p ; p = p->next) {
15081 + isdn_net_local *lp = p->local;
15083 + if( lp->dw_abc_lcr_callid != i.lcr_ioctl_callid)
15086 + if(lp->dw_abc_lcr_cmd == NULL)
15089 + if(lp->dw_abc_lcr_io == NULL)
15090 + lp->dw_abc_lcr_io = (struct ISDN_DWABC_LCR_IOCTL *)
15091 + kmalloc(sizeof(struct ISDN_DWABC_LCR_IOCTL),GFP_ATOMIC);
15093 + if(lp->dw_abc_lcr_io == NULL) {
15095 + printk(KERN_DEBUG "%s %d : no memory\n",__FILE__,__LINE__);
15099 + memcpy(lp->dw_abc_lcr_io,&i,sizeof(struct ISDN_DWABC_LCR_IOCTL));
15101 + if(i.lcr_ioctl_flags & DWABC_LCR_FLG_NEWNUMBER) {
15103 + char *xx = i.lcr_ioctl_nr;
15104 + char *exx = xx + sizeof(i.lcr_ioctl_nr);
15105 + char *d = lp->dw_abc_lcr_cmd->parm.setup.phone;
15106 + char *ed = d + sizeof(lp->dw_abc_lcr_cmd->parm.setup.phone) - 1;
15108 + while(d < ed && xx < exx && *xx) *(d++) = *(xx++);
15109 + while(d < ed) *(d++) = 0;
15121 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK
15122 +int dw_abc_udp_test(struct sk_buff *skb,struct net_device *ndev)
15124 + if(ndev != NULL && skb != NULL && skb->protocol == htons(ETH_P_IP)) {
15126 + struct iphdr *iph = (struct iphdr *)skb->data;
15127 + isdn_net_local *lp = (isdn_net_local *) ndev->priv;
15128 + int rklen = skb->len;
15130 + if (skb->nh.raw > skb->data && skb->nh.raw < skb->tail) {
15132 + rklen -= (char *)skb->nh.raw - (char *)skb->data;
15133 + iph = (struct iphdr *)skb->nh.raw;
15136 + if(rklen >= 20 && iph->version == 4 &&
15137 + !(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_UDP_CHECK)) {
15139 + if( iph->tot_len == NBYTEORDER_30BYTES &&
15140 + iph->protocol == IPPROTO_UDP) {
15142 + struct udphdr *udp =
15143 + (struct udphdr *)((char *)iph + (iph->ihl << 2));
15145 + ushort usrc = ntohs(udp->source);
15147 + if( udp->dest == htons(25001) &&
15148 + usrc >= 20000 && usrc < 25000) {
15150 + char *p = (char *)(udp + 1);
15152 + if(p[0] == p[1]) {
15161 + if((lp->flags & ISDN_NET_CONNECTED) && (!lp->dialstate))
15169 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL
15170 + if((lp->flags & ISDN_NET_CONNECTED) && (!lp->dialstate)) {
15176 + if(!isdn_net_force_dial_lp(lp)) mc++;
15182 + isdn_dw_abc_reset_interface(lp,1);
15185 + case 0x28: mc = *p + 1; break;
15190 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP
15191 + if(!(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_UDP_HANGUP)) {
15193 + if(lp->isdn_device >= 0) {
15195 + isdn_net_hangup(ndev);
15205 + struct sk_buff *nskb;
15206 + int need = 2+sizeof(struct iphdr)+sizeof(struct udphdr);
15207 + int hneed = need + ndev->hard_header_len;
15209 + if((nskb = (struct sk_buff *)dev_alloc_skb(hneed)) != NULL) {
15211 + ushort n = sizeof(struct udphdr) + 2;
15212 + struct iphdr *niph;
15213 + struct udphdr *nup;
15214 + skb_reserve(nskb,ndev->hard_header_len);
15216 + if((niph = (struct iphdr *)skb_put(nskb,need))==NULL){
15218 + printk(KERN_DEBUG "%s: skb_put failt (%d bytes)\n", lp->name,hneed);
15219 + dev_kfree_skb(nskb);
15223 + nup = (struct udphdr *)(niph + 1);
15224 + ((char *)(nup + 1))[0] = mc;
15225 + ((char *)(nup + 1))[1] = mc;
15226 + nup->source=udp->dest;
15227 + nup->dest=udp->source;
15228 + nup->len=htons(n);
15229 + nup->check=0; /* dont need checksum */
15230 + memset((void *)niph,0,sizeof(*niph));
15233 + niph->tot_len=NBYTEORDER_30BYTES;
15235 + niph->protocol = IPPROTO_UDP;
15236 + niph->saddr=iph->daddr;
15237 + niph->daddr=iph->saddr;
15238 + niph->id=iph->id;
15239 + niph->check=ip_fast_csum((unsigned char *)niph,niph->ihl);
15240 + nskb->dev = ndev;
15241 + nskb->pkt_type = PACKET_HOST;
15242 + nskb->protocol = htons(ETH_P_IP);
15243 + nskb->mac.raw = nskb->data;
15260 +void isdn_dw_clear_if(ulong pm,isdn_net_local *lp)
15263 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
15264 + isdn_dw_abc_lcr_clear(lp);
15271 +static void dw_abc_timer_func(u_long dont_need_yet)
15273 + register u_long t;
15275 + if(!((t = ++isdn_dwabc_jiffies.msec_100) & 1))
15276 + if(isdn_dwabc_jiffies.msec_200++ & 1)
15277 + isdn_dwabc_jiffies.msec_400++;
15280 + if(isdn_dwabc_jiffies.msec_500++ & 1)
15281 + isdn_dwabc_jiffies.msec_1000++;
15283 + dw_abc_timer.expires = jiffies + DWABC_TMRES;
15284 + add_timer(&dw_abc_timer);
15288 +void isdn_dw_abc_init_func(void)
15291 + init_timer(&dw_abc_timer);
15292 + dw_abc_timer.function = dw_abc_timer_func;
15295 + printk( KERN_INFO
15296 + "abc-extension %s Kernel 0x%06X\n"
15297 + "written by\nDetlef Wengorz <detlefw@isdn4linux.de>\n"
15298 + "Installed options:\n"
15299 +#ifdef CONFIG_ISDN_WITH_ABC_CALLB
15300 + "CONFIG_ISDN_WITH_ABC_CALLB\n"
15302 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK
15303 + "CONFIG_ISDN_WITH_ABC_UDP_CHECK\n"
15305 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP
15306 + "CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP\n"
15308 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL
15309 + "CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL\n"
15311 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
15312 + "CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ\n"
15314 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
15315 + "CONFIG_ISDN_WITH_ABC_LCR_SUPPORT\n"
15317 +#ifdef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
15318 + "CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER\n"
15320 +#ifdef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
15321 + "CONFIG_ISDN_WITH_ABC_CH_EXTINUSE\n"
15323 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
15324 + "CONFIG_ISDN_WITH_ABC_CONN_ERROR\n"
15326 +#ifdef CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS
15327 + "CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS\n"
15330 + dwabcrevison,LINUX_VERSION_CODE);
15332 + dw_abc_timer.expires = jiffies + DWABC_TMRES;
15333 + add_timer(&dw_abc_timer);
15336 +void isdn_dw_abc_release_func(void)
15338 + del_timer(&dw_abc_timer);
15339 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
15340 + dw_lcr_clear_all();
15342 + printk( KERN_INFO
15343 + "abc-extension %s Kernel 0x%06X\n"
15345 + "Detlef Wengorz <detlefw@isdn4linux.de>\n"
15347 + dwabcrevison,LINUX_VERSION_CODE);
15351 +void isdn_dwabc_test_phone(isdn_net_local *lp)
15355 + isdn_net_phone *h = lp->phone[0];
15356 + ulong oflags = lp->dw_abc_flags;
15359 + lp->dw_abc_flags = 0;
15360 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
15361 + *lp->dw_out_msn = 0;
15364 + for(;h != NULL && secure < 1000;secure++,h = h->next) {
15366 + char *p = h->num;
15367 + char *ep = p + ISDN_MSNLEN;
15369 + for(;p < ep && *p && (*p <= ' ' || *p == '"' || *p == '\'');p++);
15374 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
15377 + if(++p < ep && *p != '<' && *p != '>') {
15379 + char *d = lp->dw_out_msn;
15381 + for(;*p && (p < ep) && (*p == ' ' || *p == '\t');p++);
15382 + for(ep--;*p && (p < ep);) *(d++) = *(p++);
15391 + /* abc switch's */
15393 + for(p++;p < ep && *p;p++) switch(*p) {
15394 + case 'u': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_NO_UDP_CHECK; break;
15395 + case 'h': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_NO_UDP_HANGUP; break;
15396 + case 'd': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_NO_UDP_DIAL; break;
15397 + case 'c': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_NO_CH_EXTINUSE; break;
15398 + case 'e': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_NO_CONN_ERROR; break;
15399 + case 'l': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_NO_LCR; break;
15402 + case 'X': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_RCV_NO_HUPTIMER; break;
15404 + case 'B': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_BSD_COMPRESS; break;
15405 + case 'L': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_LEASED_LINE; break;
15410 + case '\'': break;
15413 + printk(KERN_DEBUG"isdn_net: %s abc-switch <~%c> unknown\n",lp->name,*p);
15419 + if(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_LEASED_LINE) {
15421 + lp->dw_abc_flags |=
15422 + ISDN_DW_ABC_FLAG_NO_UDP_CHECK |
15423 + ISDN_DW_ABC_FLAG_NO_UDP_HANGUP |
15424 + ISDN_DW_ABC_FLAG_NO_UDP_DIAL |
15425 + ISDN_DW_ABC_FLAG_NO_CH_EXTINUSE |
15426 + ISDN_DW_ABC_FLAG_NO_CONN_ERROR |
15427 + ISDN_DW_ABC_FLAG_NO_LCR;
15430 + if(dev->net_verbose && (lp->dw_abc_flags != oflags || dev->net_verbose > 4))
15431 + printk(KERN_DEBUG "isdn_net %s abc-flags 0x%lx\n",lp->name,lp->dw_abc_flags);
15437 +int isdn_dw_abc_reset_interface(isdn_net_local *lp,int with_message)
15445 + lp->dw_abc_bchan_last_connect = 0;
15446 + lp->dw_abc_dialstart = 0;
15447 + lp->dw_abc_inuse_secure = 0;
15448 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
15449 + lp->dw_abc_bchan_errcnt = 0;
15452 + if(with_message && dev->net_verbose > 0)
15454 + "%s: NOTE: reset (clear) abc-interface-secure-counter\n",
15462 +#if CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS && CONFIG_ISDN_PPP
15464 +#define DWBSD_PKT_FIRST_LEN 16
15465 +#define DWBSD_PKT_SWITCH 165
15466 +#define DWBSD_PKT_BSD 189
15468 +#define DWBSD_VERSION 0x2
15470 +void dwabc_bsd_first_gen(isdn_net_local *lp)
15472 + if(lp != NULL && lp->p_encap == ISDN_NET_ENCAP_RAWIP &&
15473 + (lp->dw_abc_flags & ISDN_DW_ABC_FLAG_BSD_COMPRESS)) {
15475 + struct sk_buff *skb = NULL;
15479 + if((skb =(struct sk_buff *)dev_alloc_skb(128)) == NULL) {
15481 + printk(KERN_INFO "%s: dwabc: alloc-skb failed for 128 bytes\n",lp->name);
15485 + skb_reserve(skb,64);
15486 + p = skb_put(skb,DWBSD_PKT_FIRST_LEN);
15487 + ep = p + DWBSD_PKT_FIRST_LEN;
15489 + *(p++) = DWBSD_PKT_SWITCH;
15490 + *(p++) = DWBSD_VERSION;
15491 + for(;p < ep;p++) *(p++) = 0;
15493 + isdn_net_write_super(lp, skb);
15495 + if(dev->net_verbose > 2)
15496 + printk(KERN_INFO "%s: dwabc: sending comm-header version 0x%x\n",lp->name,DWBSD_VERSION);
15501 +void dwabc_bsd_free(isdn_net_local *lp)
15505 + if(lp->dw_abc_bsd_stat_rx || lp->dw_abc_bsd_stat_tx) {
15507 + struct isdn_ppp_compressor *c = NULL;
15509 + if(!(c = (struct isdn_ppp_compressor *)lp->dw_abc_bsd_compressor)) {
15511 + printk(KERN_WARNING
15512 + "%s: PANIC: freeing bsd compressmemory without compressor\n",
15517 + if(lp->dw_abc_bsd_stat_rx) (*c->free)(lp->dw_abc_bsd_stat_rx);
15518 + if(lp->dw_abc_bsd_stat_tx) (*c->free)(lp->dw_abc_bsd_stat_tx);
15520 + if(dev->net_verbose > 2)
15522 + "%s: free bsd compress-memory\n",
15527 + lp->dw_abc_bsd_compressor = NULL;
15528 + lp->dw_abc_bsd_stat_rx = NULL;
15529 + lp->dw_abc_bsd_stat_tx = NULL;
15530 + lp->dw_abc_if_flags &= ~ISDN_DW_ABC_IFFLAG_BSDAKTIV;
15532 + if(dev->net_verbose > 0) {
15534 + if(lp->dw_abc_bsd_rcv != lp->dw_abc_bsd_bsd_rcv) {
15536 + printk(KERN_INFO "%s: Receive %lu<-%lu kb\n",lp->name,
15537 + lp->dw_abc_bsd_rcv >> 10 , lp->dw_abc_bsd_bsd_rcv >> 10);
15541 + if(lp->dw_abc_bsd_snd != lp->dw_abc_bsd_bsd_snd) {
15543 + printk(KERN_INFO "%s: Send %lu->%lu kb\n",lp->name,
15544 + lp->dw_abc_bsd_snd >> 10 , lp->dw_abc_bsd_bsd_snd >> 10);
15548 + lp->dw_abc_bsd_rcv =
15549 + lp->dw_abc_bsd_bsd_rcv =
15550 + lp->dw_abc_bsd_snd =
15551 + lp->dw_abc_bsd_bsd_snd = 0;
15556 +int dwabc_bsd_init(isdn_net_local *lp)
15562 + dwabc_bsd_free(lp);
15564 + if(lp->p_encap == ISDN_NET_ENCAP_RAWIP) {
15568 + struct isdn_ppp_comp_data *cp = NULL;
15569 + struct isdn_ppp_compressor *c = NULL;
15571 + if(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_BSD_COMPRESS) do {
15573 + for(c = ipc_head ;
15574 + c != NULL && c->num != CI_BSD_COMPRESS; c = c->next);
15579 + "%s: Module isdn_bsdcompress not loaded\n",
15585 + cp = (struct isdn_ppp_comp_data *)
15586 + kmalloc(sizeof(struct isdn_ppp_comp_data),GFP_ATOMIC);
15591 + "%s: allocation of isdn_ppp_comp_data failed\n",
15597 + memset(cp,0,sizeof(*cp));
15598 + cp->num = CI_BSD_COMPRESS;
15602 + ** set BSD_VERSION 1 and 12 bits compressmode
15604 + *cp->options = (1 << 5) | 12;
15606 + if((rx = (*c->alloc)(cp)) == NULL) {
15609 + "%s: allocation of bsd rx-memory failed\n",
15615 + if(!(*c->init)(rx,cp,0,1)) {
15618 + "%s: init of bsd rx-stream failed\n",lp->name);
15623 + cp->flags = IPPP_COMP_FLAG_XMIT;
15625 + if((tx = (*c->alloc)(cp)) == NULL) {
15628 + "%s: allocation of bsd tx-memory failed\n",
15634 + if(!(*c->init)(tx,cp,0,1)) {
15637 + "%s: init of bsd tx-stream failed\n",
15643 + lp->dw_abc_bsd_compressor = (void *)c;
15644 + lp->dw_abc_bsd_stat_rx = rx;
15645 + lp->dw_abc_bsd_stat_tx = tx;
15649 + if(dev->net_verbose > 2)
15651 + "%s: bsd compress-memory and init ok\n",
15661 + if(tx != NULL) (*c->free)(tx);
15662 + if(rx != NULL) (*c->free)(rx);
15665 + } else if(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_BSD_COMPRESS) {
15668 + "%s: bsd-compress only with encapsulation rawip allowed\n",
15676 +struct sk_buff *dwabc_bsd_compress( isdn_net_local *lp,
15677 + struct sk_buff *skb,
15678 + struct net_device *ndev)
15680 + if(lp != NULL && lp->p_encap == ISDN_NET_ENCAP_RAWIP &&
15681 + (lp->dw_abc_flags & ISDN_DW_ABC_FLAG_BSD_COMPRESS) &&
15682 + (lp->dw_abc_if_flags & ISDN_DW_ABC_IFFLAG_BSDAKTIV)) {
15684 + if(lp->dw_abc_bsd_stat_tx != NULL && lp->dw_abc_bsd_compressor) {
15686 + struct isdn_ppp_compressor *cp =
15687 + (struct isdn_ppp_compressor *)lp->dw_abc_bsd_compressor;
15689 + struct sk_buff *nskb = (struct sk_buff *)
15690 + dev_alloc_skb(skb->len * 2 + ndev->hard_header_len);
15694 + if(nskb == NULL) {
15696 + (void)(*cp->reset)(lp->dw_abc_bsd_stat_tx,0,0,NULL,0,NULL);
15697 + printk(KERN_INFO "%s: dwabc-compress no memory\n",lp->name);
15701 + skb_reserve(nskb,ndev->hard_header_len);
15702 + *(unsigned char *)skb_put(nskb,1) = DWBSD_PKT_BSD;
15703 + l = (*cp->compress)(lp->dw_abc_bsd_stat_tx,skb,nskb,0x21);
15705 + if(l < 1 || l > skb->len) {
15707 + (void)(*cp->reset)(lp->dw_abc_bsd_stat_tx,0,0,NULL,0,NULL);
15708 + dev_kfree_skb(nskb);
15714 + dev_kfree_skb(skb);
15716 + sqnr = ((*(u_char *)skb->data) << 8) +
15717 + ((u_char)skb->data[1]);
15720 + (void)(*cp->reset)
15721 + (lp->dw_abc_bsd_stat_tx,0,0,NULL,0,NULL);
15730 +struct sk_buff *dwabc_bsd_rx_pkt( isdn_net_local *lp,
15731 + struct sk_buff *skb,
15732 + struct net_device *ndev)
15734 + struct sk_buff *r = skb;
15736 + if(lp != NULL && lp->p_encap == ISDN_NET_ENCAP_RAWIP &&
15737 + (lp->dw_abc_flags & ISDN_DW_ABC_FLAG_BSD_COMPRESS)) {
15739 + unsigned char *p = (unsigned char *)skb->data;
15740 + struct isdn_ppp_compressor *cp =
15741 + (struct isdn_ppp_compressor *)lp->dw_abc_bsd_compressor;
15743 + if(*p == DWBSD_PKT_SWITCH) {
15745 + if(skb->len == DWBSD_PKT_FIRST_LEN) {
15747 + if((lp->dw_abc_remote_version = p[1]) < 0x2) {
15750 + "%s: I can't really talk with remote version 0x%x\n"
15751 + "Please upgrade remote or disable rawip-compression\n",
15756 + lp->dw_abc_if_flags |= ISDN_DW_ABC_IFFLAG_BSDAKTIV;
15757 + dev_kfree_skb(skb);
15759 + if(cp && lp->dw_abc_bsd_stat_tx)
15760 + (void)(*cp->reset)(lp->dw_abc_bsd_stat_tx,0,0,NULL,0,NULL);
15762 + if(dev->net_verbose > 2)
15764 + "%s: receive comm-header rem-version 0x%02x\n",
15766 + lp->dw_abc_remote_version);
15771 + } else if(*p == DWBSD_PKT_BSD && lp->dw_abc_bsd_stat_rx != NULL && cp) {
15773 + struct sk_buff *nskb = NULL;
15775 + if(test_and_set_bit(ISDN_DW_ABC_BITLOCK_RECEIVE,
15776 + &lp->dw_abc_bitlocks)) {
15778 + printk(KERN_INFO "%s: bsd-decomp called recursivly\n",lp->name);
15779 + dev_kfree_skb(skb);
15780 + dwabc_bsd_first_gen(lp);
15784 + nskb = (struct sk_buff *)
15785 + dev_alloc_skb(2048 + ndev->hard_header_len);
15787 + if(nskb != NULL) {
15792 + skb_reserve(nskb,ndev->hard_header_len);
15793 + skb_pull(skb, 1);
15794 + sqnr = ((*(u_char *)skb->data) << 8) | ((u_char)skb->data[1]);
15796 + if(!sqnr && cp && lp->dw_abc_bsd_stat_rx)
15797 + (void)(*cp->reset)(lp->dw_abc_bsd_stat_rx,0,0,NULL,0,NULL);
15799 + if((l = (*cp->decompress)
15800 + (lp->dw_abc_bsd_stat_rx,skb,nskb,NULL)) < 1 || l>8000) {
15802 + printk(KERN_INFO "%s: abc-decomp failed\n",lp->name);
15803 + dev_kfree_skb(nskb);
15804 + dev_kfree_skb(skb);
15806 + dwabc_bsd_first_gen(lp);
15810 + if (nskb->data[0] & 0x1)
15811 + skb_pull(nskb, 1); /* protocol ID is only 8 bit */
15813 + skb_pull(nskb, 2);
15815 + nskb->dev = skb->dev;
15816 + nskb->pkt_type = skb->pkt_type;
15817 + nskb->mac.raw = nskb->data;
15818 + dev_kfree_skb(skb);
15823 + printk(KERN_INFO "%s: PANIC abc-decomp no memory\n",lp->name);
15824 + dev_kfree_skb(skb);
15825 + dwabc_bsd_first_gen(lp);
15828 + clear_bit(ISDN_DW_ABC_BITLOCK_RECEIVE,&lp->dw_abc_bitlocks);
15837 +int dwabc_bsd_init(isdn_net_local *lp) { return(1); }
15838 +void dwabc_bsd_free(isdn_net_local *lp) { return; }
15839 +void dwabc_bsd_first_gen(isdn_net_local *lp) { return ; }
15841 +struct sk_buff *dwabc_bsd_compress(isdn_net_local *lp,struct sk_buff *skb,struct net_device *ndev)
15844 +struct sk_buff *dwabc_bsd_rx_pkt(isdn_net_local *lp,struct sk_buff *skb,struct net_device *ndev)
15848 --- a/drivers/isdn/isdn_net.c
15849 +++ b/drivers/isdn/isdn_net.c
15851 -/* $Id: isdn_net.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
15852 +/* $Id: isdn_net.c,v 1.153 2002/08/17 18:35:23 detabc Exp $
15854 * Linux ISDN subsystem, network interfaces and related functions (linklevel).
15857 * This software may be used and distributed according to the terms
15858 * of the GNU General Public License, incorporated herein by reference.
15860 - * Data Over Voice (DOV) support added - Guy Ellis 23-Mar-02
15861 - * guy@traverse.com.au
15862 - * Outgoing calls - looks for a 'V' in first char of dialed number
15863 - * Incoming calls - checks first character of eaz as follows:
15864 - * Numeric - accept DATA only - original functionality
15865 - * 'V' - accept VOICE (DOV) only
15866 - * 'B' - accept BOTH DATA and DOV types
15868 * Jan 2001: fix CISCO HDLC Bjoern A. Zeeb <i4l@zabbadoz.net>
15869 * for info on the protocol, see
15870 * http://i4l.zabbadoz.net/i4l/cisco-hdlc.txt
15872 #include "isdn_concap.h"
15875 +#ifdef CONFIG_ISDN_WITH_ABC
15876 +#include <linux/isdn_dwabc.h>
15877 +#define isdn_net_log_skb(skb,lp) isdn_net_log_skb_dwabc(skb,lp,NULL)
15881 * Outline of new tbusy handling:
15882 @@ -79,7 +75,11 @@ static __inline__ int isdn_net_device_st
15886 +#ifdef COMPAT_NO_SOFTNET
15887 + return dev->start;
15889 return netif_running(dev);
15894 @@ -143,6 +143,10 @@ static __inline__ void isdn_net_inc_fram
15895 atomic_inc(&lp->frame_cnt);
15896 if (isdn_net_device_busy(lp))
15897 isdn_net_device_stop_queue(lp);
15899 + printk(KERN_DEBUG "%s: inc_frame_cnt now %d\n", lp->name,
15900 + atomic_read(&lp->frame_cnt));
15904 static __inline__ void isdn_net_dec_frame_cnt(isdn_net_local *lp)
15905 @@ -157,11 +161,19 @@ static __inline__ void isdn_net_dec_fram
15906 isdn_net_device_wake_queue(lp);
15910 + printk(KERN_DEBUG "%s: dec_frame_cnt now %d\n", lp->name,
15911 + atomic_read(&lp->frame_cnt));
15915 static __inline__ void isdn_net_zero_frame_cnt(isdn_net_local *lp)
15917 atomic_set(&lp->frame_cnt, 0);
15919 + printk(KERN_DEBUG "%s: zero_frame_cnt now %d\n", lp->name,
15920 + atomic_read(&lp->frame_cnt));
15924 /* For 2.2.x we leave the transmitter busy timeout at 2 secs, just
15925 @@ -173,23 +185,101 @@ static __inline__ void isdn_net_zero_fra
15926 * which might rely on the tx timeout. If so, we'll find out this way...
15929 +#ifdef COMPAT_NO_SOFTNET
15930 +#define ISDN_NET_TX_TIMEOUT (2*HZ)
15932 #define ISDN_NET_TX_TIMEOUT (20*HZ)
15937 +#ifndef CONFIG_ISDN_WITH_ABC
15938 int isdn_net_force_dial_lp(isdn_net_local *);
15940 static int isdn_net_start_xmit(struct sk_buff *, struct net_device *);
15942 static void isdn_net_ciscohdlck_connected(isdn_net_local *lp);
15943 static void isdn_net_ciscohdlck_disconnected(isdn_net_local *lp);
15945 -char *isdn_net_revision = "$Revision: 1.1.4.1 $";
15946 +char *isdn_net_revision = "$Revision: 1.153 $";
15949 * Code for raw-networking over ISDN
15951 +#ifdef CONFIG_ISDN_WITH_ABC
15952 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
15953 +static int isdn_dwabc_encap_with_conerr(isdn_net_local *lp)
15955 + if(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_CONN_ERROR)
15959 + lp->p_encap == ISDN_NET_ENCAP_SYNCPPP ||
15960 + lp->p_encap == ISDN_NET_ENCAP_RAWIP ||
15961 + lp->p_encap == ISDN_NET_ENCAP_CISCOHDLCK ||
15962 + lp->p_encap == ISDN_NET_ENCAP_UIHDLC );
15965 +static int isdn_dwabc_conerr_ippktok(struct sk_buff *skb)
15967 + struct iphdr *iph = (struct iphdr *)skb->data;
15968 + return(iph->version == 6 || (skb->len >= 20 && iph->version == 4));
15973 +static int isdn_dwabc_is_interface_disabled(isdn_net_local *lp)
15978 + lp->dw_abc_inuse_secure = 0;
15979 + lp->dw_abc_dialstart = 0;
15982 + ** check for jiffies overflow
15984 + if(lp->dw_abc_bchan_last_connect > jiffies) {
15986 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
15987 + lp->dw_abc_bchan_errcnt = 0;
15989 + lp->dw_abc_bchan_last_connect = 0;
15992 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
15993 + if(!(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_CONN_ERROR) && isdn_dwabc_encap_with_conerr(lp)) {
15995 + if(lp->dw_abc_bchan_errcnt > 3 && !(lp->dw_abc_bchan_errcnt & 3)) {
15997 + ulong nj = jiffies;
15998 + ulong delay = lp->dw_abc_bchan_errcnt *
15999 + lp->dw_abc_bchan_errcnt *
16000 + lp->dw_abc_bchan_errcnt;
16002 + if(delay > 86400) delay = 86400;
16003 + delay = (lp->dw_abc_bchan_last_connect + delay * HZ);
16008 + "%s: interface auto-disabled (bchannel connect-error %lu seconds left)\n",
16009 + lp->name,(delay - nj) / HZ);
16020 +#ifdef CONFIG_ISDN_WITH_ABC
16025 isdn_net_unreachable(struct net_device *dev, struct sk_buff *skb, char *reason)
16028 @@ -297,6 +387,12 @@ isdn_net_unbind_channel(isdn_net_local *
16032 +#ifdef CONFIG_ISDN_WITH_ABC
16033 + isdn_dw_clear_if(0l,lp);
16034 + lp->dw_abc_if_flags &= ~ISDN_DW_ABC_IFFLAG_NODCHAN;
16035 + lp->dw_abc_inuse_secure = 0;
16036 + dwabc_bsd_free(lp);
16038 skb_queue_purge(&lp->super_tx_queue);
16040 if (!lp->master) { /* reset only master device */
16041 @@ -351,6 +447,26 @@ isdn_net_autohup()
16042 if ((l->flags & ISDN_NET_CONNECTED) && (!l->dialstate)) {
16045 +#ifdef CONFIG_ISDN_WITH_ABC
16046 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
16047 + if( isdn_dwabc_encap_with_conerr(l) && l->dw_abc_bchan_errcnt > 0) {
16051 + if(l->dw_abc_bchan_errcnt > 3) n = 120;
16052 + if(l->dw_abc_bchan_errcnt > 6) n = 90;
16053 + if(l->dw_abc_bchan_errcnt > 9) n = 60;
16055 + if(l->huptimer > n) {
16057 + printk(KERN_INFO "%s: bchan conf-error auto-secure-hangup\n",l->name);
16058 + isdn_net_hangup(&p->dev);
16059 + p = (isdn_net_dev *) p->next;
16066 * if there is some dialmode where timeout-hangup
16067 * should _not_ be done, check for that here
16068 @@ -465,8 +581,32 @@ isdn_net_stat_callback(int idx, isdn_ctr
16069 printk(KERN_INFO "%s: Chargesum is %d\n", lp->name,
16071 isdn_net_unbind_channel(lp);
16072 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
16073 + if(lp->dw_abc_bchan_errcnt) {
16076 + "%s: Note: bchannel-error-counter is %hd\n",
16078 + lp->dw_abc_bchan_errcnt);
16083 +#ifdef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
16084 + if(!(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_CH_EXTINUSE)) {
16085 + if((lp->dialstate == 4 || lp->dialstate == 12) &&
16086 + lp->dw_abc_dialstart && (idx < ISDN_MAX_CHANNELS)) {
16088 + if((jiffies - lp->dw_abc_dialstart) < (HZ >>2)) {
16090 + lp->dw_abc_if_flags |= ISDN_DW_ABC_IFFLAG_NODCHAN;
16091 + lp->dialstate = 1;
16092 + dev->dwabc_chan_external_inuse[idx] = jiffies + HZ * 30;
16093 + printk(KERN_INFO "%s: Channel %d look like external in use\n",lp->name,idx);
16099 #ifdef CONFIG_ISDN_X25
16100 case ISDN_STAT_BHUP:
16101 @@ -507,6 +647,19 @@ isdn_net_stat_callback(int idx, isdn_ctr
16104 printk(KERN_INFO "isdn_net: %s connected\n", lp->name);
16105 +#ifdef CONFIG_ISDN_WITH_ABC
16106 + if(!dwabc_bsd_init(lp)) dwabc_bsd_first_gen(lp);
16107 + lp->dw_abc_bchan_last_connect = jiffies;
16108 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
16109 + if(!(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_CONN_ERROR)) {
16111 + lp->dw_abc_bchan_errcnt += isdn_dwabc_encap_with_conerr(lp);
16113 + if(lp->dw_abc_bchan_errcnt > 32000)
16114 + lp->dw_abc_bchan_errcnt = 32000;
16118 /* If first Chargeinfo comes before B-Channel connect,
16119 * we correct the timestamp here.
16121 @@ -578,7 +731,6 @@ isdn_net_dial(void)
16123 unsigned long flags;
16125 - u_char *phone_number;
16128 isdn_net_local *lp = p->local;
16129 @@ -597,6 +749,47 @@ isdn_net_dial(void)
16133 +#ifdef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
16134 + if(!(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_CH_EXTINUSE) &&
16135 + (lp->dw_abc_if_flags & ISDN_DW_ABC_IFFLAG_NODCHAN)) {
16138 + short lsecure = 0;
16140 + lsecure = lp->dw_abc_inuse_secure;
16141 + isdn_net_unbind_channel(lp);
16142 + lp->dw_abc_inuse_secure = lsecure + 1;
16144 + /* Grab a free ISDN-Channel */
16145 + if ((lsecure >= ISDN_MAX_CHANNELS ) || (chi =
16146 + isdn_get_free_channel(
16152 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
16153 + (*lp->dw_out_msn) ? lp->dw_out_msn : lp->msn)
16159 + restore_flags(flags);
16160 + isdn_net_unreachable(&p->dev, NULL,
16161 + "DWABC: redial-external-inuse NO FREE CHANNEL\n");
16162 + isdn_net_hangup(&p->dev);
16166 + isdn_net_bind_channel(lp, chi);
16167 + lp->dialstate = 1;
16168 + lp->dialstarted = 0;
16169 + lp->dialwait_timer = 0;
16172 + lp->dw_abc_if_flags &= ~ISDN_DW_ABC_IFFLAG_NODCHAN;
16174 lp->dial = lp->phone[1];
16175 restore_flags(flags);
16177 @@ -621,18 +814,69 @@ isdn_net_dial(void)
16178 cmd.arg = lp->isdn_channel;
16179 cmd.command = ISDN_CMD_CLREAZ;
16180 isdn_command(&cmd);
16181 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
16182 + sprintf(cmd.parm.num, "%s",
16183 + isdn_map_eaz2msn((*lp->dw_out_msn) ? lp->dw_out_msn : lp->msn, cmd.driver));
16185 sprintf(cmd.parm.num, "%s", isdn_map_eaz2msn(lp->msn, cmd.driver));
16187 cmd.command = ISDN_CMD_SETEAZ;
16188 isdn_command(&cmd);
16192 +#ifdef CONFIG_ISDN_WITH_ABC
16193 + lp->onhtime = lp->dw_abc_old_onhtime;
16194 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
16195 + isdn_dw_abc_lcr_clear(lp);
16200 /* Setup interface, dial current phone-number, switch to next number.
16201 * If list of phone-numbers is exhausted, increment
16204 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
16205 + if(!isdn_dw_abc_lcr_lock()) {
16207 + if( lp->dw_abc_lcr_cmd != NULL &&
16208 + lp->dw_abc_lcr_start_request !=
16209 + lp->dw_abc_lcr_end_request) {
16211 + if( lp->dw_abc_lcr_io == NULL &&
16212 + lp->dw_abc_lcr_start_request <= jiffies &&
16213 + lp->dw_abc_lcr_end_request > jiffies) {
16215 + isdn_dw_abc_lcr_ulock();
16220 + if(lp->dw_abc_lcr_io != NULL) {
16222 + if(lp->dw_abc_lcr_io->lcr_ioctl_flags &
16223 + DWABC_LCR_FLG_DISABLE) {
16225 + isdn_dw_abc_lcr_ulock();
16226 + isdn_net_hangup(&p->dev);
16230 + if(lp->dw_abc_lcr_io->lcr_ioctl_flags &
16231 + DWABC_LCR_FLG_NEWHUPTIME) {
16232 + lp->onhtime = lp->dw_abc_lcr_io->lcr_ioctl_onhtime;
16236 + memcpy(&cmd,lp->dw_abc_lcr_cmd,sizeof(cmd));
16237 + isdn_dw_abc_lcr_ulock();
16238 + goto dw_abc_lcr_next_click;
16241 + isdn_dw_abc_lcr_ulock();
16244 if(dev->global_flags & ISDN_GLOBAL_STOPPED || (ISDN_NET_DIALMODE(*lp) == ISDN_NET_DM_OFF)) {
16246 if (dev->global_flags & ISDN_GLOBAL_STOPPED)
16247 @@ -677,20 +921,7 @@ isdn_net_dial(void)
16251 - cmd.driver = lp->isdn_device;
16252 - cmd.command = ISDN_CMD_DIAL;
16253 - cmd.parm.setup.si2 = 0;
16255 - /* check for DOV */
16256 - phone_number = lp->dial->num;
16257 - if ((*phone_number == 'v') ||
16258 - (*phone_number == 'V')) { /* DOV call */
16259 - cmd.parm.setup.si1 = 1;
16260 - } else { /* DATA call */
16261 - cmd.parm.setup.si1 = 7;
16264 - strcpy(cmd.parm.setup.phone, phone_number);
16265 + sprintf(cmd.parm.setup.phone, "%s", lp->dial->num);
16267 * Switch to next number or back to start if at end of list.
16269 @@ -710,17 +941,70 @@ isdn_net_dial(void)
16272 restore_flags(flags);
16273 + cmd.driver = lp->isdn_device;
16274 + cmd.command = ISDN_CMD_DIAL;
16275 + cmd.parm.setup.si1 = 7;
16276 + cmd.parm.setup.si2 = 0;
16277 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
16278 + sprintf(cmd.parm.setup.eazmsn, "%s",
16279 + isdn_map_eaz2msn((*lp->dw_out_msn) ? lp->dw_out_msn : lp->msn, cmd.driver));
16281 sprintf(cmd.parm.setup.eazmsn, "%s",
16282 isdn_map_eaz2msn(lp->msn, cmd.driver));
16284 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
16286 + ** if callback-out we dont need
16287 + ** low-cost-routing LCR
16289 + if(!(lp->flags & ISDN_NET_CBOUT) &&
16290 + !(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_LCR)) {
16292 + isdn_dw_abc_lcr_call_number(lp,&cmd);
16294 + if(lp->dw_abc_lcr_start_request != lp->dw_abc_lcr_end_request) {
16296 + if(dev->net_verbose > 2) {
16299 + "%s: Waiting for LCR-response from isdnlog %s -> %s...\n",
16301 + cmd.parm.setup.eazmsn,
16302 + cmd.parm.setup.phone);
16310 +dw_abc_lcr_next_click:;
16311 + isdn_dw_abc_lcr_clear(lp);
16313 i = isdn_dc2minor(lp->isdn_device, lp->isdn_channel);
16315 strcpy(dev->num[i], cmd.parm.setup.phone);
16316 dev->usage[i] |= ISDN_USAGE_OUTGOING;
16317 isdn_info_update();
16319 - printk(KERN_INFO "%s: dialing %d %s... %s\n", lp->name,
16320 - lp->dialretry, cmd.parm.setup.phone,
16321 - (cmd.parm.setup.si1 == 1) ? "DOV" : "");
16322 +#ifdef CONFIG_ISDN_WITH_ABC
16323 + printk(KERN_INFO "%s: dialing %d %s -> %s...\n", lp->name,
16325 + cmd.parm.setup.eazmsn,
16326 + cmd.parm.setup.phone);
16327 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
16328 + if(lp->dw_abc_bchan_errcnt) {
16331 + "%s: Note: bchannel-error-counter is %hd\n",
16333 + lp->dw_abc_bchan_errcnt);
16337 + printk(KERN_INFO "%s: dialing %d %s...\n", lp->name,
16338 + lp->dialretry, cmd.parm.setup.phone);
16341 #ifdef ISDN_DEBUG_NET_DIAL
16342 printk(KERN_DEBUG "dial: d=%d c=%d\n", lp->isdn_device,
16343 @@ -741,6 +1025,10 @@ isdn_net_dial(void)
16346 (lp->flags & ISDN_NET_CBOUT)) ? 12 : 4;
16347 +#ifdef CONFIG_ISDN_WITH_ABC
16348 + lp->dw_abc_if_flags &= ~ISDN_DW_ABC_IFFLAG_NODCHAN;
16349 + lp->dw_abc_dialstart = jiffies;
16353 /* Wait for D-Channel-connect.
16354 @@ -890,6 +1178,15 @@ isdn_net_hangup(struct net_device *d)
16355 isdn_command(&cmd);
16356 printk(KERN_INFO "%s: Chargesum is %d\n", lp->name, lp->charge);
16357 isdn_all_eaz(lp->isdn_device, lp->isdn_channel);
16358 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
16359 + if(lp->dw_abc_bchan_errcnt) {
16362 + "%s: Note: bchannel-error-counter is %hd\n",
16364 + lp->dw_abc_bchan_errcnt);
16368 isdn_net_unbind_channel(lp);
16370 @@ -899,8 +1196,13 @@ typedef struct {
16371 unsigned short dest;
16374 +#ifdef CONFIG_ISDN_WITH_ABC
16376 +isdn_net_log_skb_dwabc(struct sk_buff * skb, isdn_net_local * lp,char *reason)
16379 isdn_net_log_skb(struct sk_buff * skb, isdn_net_local * lp)
16382 u_char *p = skb->nh.raw; /* hopefully, this was set correctly */
16383 unsigned short proto = ntohs(skb->protocol);
16384 @@ -972,7 +1274,13 @@ isdn_net_log_skb(struct sk_buff * skb, i
16388 +#ifdef CONFIG_ISDN_WITH_ABC
16389 + "%s %s: %d.%d.%d.%d -> %d.%d.%d.%d%s\n",
16390 + (reason == NULL) ? "OPEN" : reason,
16391 + (lp != NULL) ? lp->name : "",
16393 "OPEN: %d.%d.%d.%d -> %d.%d.%d.%d%s\n",
16396 p[12], p[13], p[14], p[15],
16397 p[16], p[17], p[18], p[19],
16398 @@ -980,7 +1288,13 @@ isdn_net_log_skb(struct sk_buff * skb, i
16402 +#ifdef CONFIG_ISDN_WITH_ABC
16403 + "%s %s: ARP %d.%d.%d.%d -> *.*.*.* ?%d.%d.%d.%d\n",
16404 + (reason == NULL) ? "OPEN" : reason,
16405 + (lp != NULL) ? lp->name : "",
16407 "OPEN: ARP %d.%d.%d.%d -> *.*.*.* ?%d.%d.%d.%d\n",
16409 p[14], p[15], p[16], p[17],
16410 p[24], p[25], p[26], p[27]);
16412 @@ -1004,11 +1318,22 @@ void isdn_net_write_super(isdn_net_local
16415 spin_lock_bh(&lp->xmit_lock);
16417 if (!isdn_net_lp_busy(lp)) {
16418 +#ifdef CONFIG_ISDN_WITH_ABC
16419 + if(!skb_queue_empty(&lp->super_tx_queue)) {
16421 + ** don't reverse the frame flow
16422 + ** compression need frames in order and maybe other's too
16424 + skb_queue_tail(&lp->super_tx_queue, skb);
16425 + skb = skb_dequeue(&lp->super_tx_queue);
16428 isdn_net_writebuf_skb(lp, skb);
16430 - skb_queue_tail(&lp->super_tx_queue, skb);
16433 + } else skb_queue_tail(&lp->super_tx_queue, skb);
16435 spin_unlock_bh(&lp->xmit_lock);
16438 @@ -1056,7 +1381,6 @@ void isdn_net_writebuf_skb(isdn_net_loca
16439 printk(KERN_WARNING "%s: HL driver queue full\n", lp->name);
16443 lp->transcount += len;
16444 isdn_net_inc_frame_cnt(lp);
16446 @@ -1064,9 +1388,19 @@ void isdn_net_writebuf_skb(isdn_net_loca
16448 dev_kfree_skb(skb);
16449 lp->stats.tx_errors++;
16454 +int isdn_net_send_skb(struct net_device *ndev, isdn_net_local * lp,struct sk_buff *skb)
16456 + if (isdn_net_lp_busy(lp)) {
16457 + printk(KERN_WARNING "isdn_net_send_skb: HL channel busy\n");
16460 + isdn_net_writebuf_skb(lp, skb);
16466 * Helper function for isdn_net_start_xmit.
16467 @@ -1109,7 +1443,54 @@ isdn_net_xmit(struct net_device *ndev, s
16469 /* Reset hangup-timeout */
16470 lp->huptimer = 0; // FIXME?
16471 +#ifdef CONFIG_ISDN_WITH_ABC
16473 + if(test_and_set_bit(ISDN_DW_ABC_BITLOCK_SEND,&lp->dw_abc_bitlocks)) {
16475 + if(dev->net_verbose > 2)
16476 + printk(KERN_INFO "%s: isdn_net_xmit called recursivly\n",lp->name);
16478 + spin_unlock_bh(&lp->xmit_lock);
16482 + if(skb != NULL) {
16484 + int l = skb->len;
16487 + if( lp->p_encap == ISDN_NET_ENCAP_RAWIP &&
16488 + (lp->dw_abc_if_flags & ISDN_DW_ABC_IFFLAG_BSDAKTIV)) {
16490 + if((skb = dwabc_bsd_compress(lp,skb,ndev)) != NULL) {
16494 + skb_queue_tail(&lp->super_tx_queue,skb);
16496 + if(l != nl && (r = isdn_dc2minor(lp->isdn_device,lp->isdn_channel)) >= 0) {
16498 + dev->obytes[r] += l - nl;
16499 + lp->stats.tx_bytes += l - nl;
16503 + } else skb_queue_tail(&lp->super_tx_queue,skb);
16505 + if(lp->p_encap == ISDN_NET_ENCAP_RAWIP) {
16507 + lp->dw_abc_bsd_snd += l;
16508 + lp->dw_abc_bsd_bsd_snd += nl;
16511 + clear_bit(ISDN_DW_ABC_BITLOCK_SEND,&lp->dw_abc_bitlocks);
16513 + while(!isdn_net_lp_busy(lp) && (skb = skb_dequeue(&lp->super_tx_queue)))
16514 + isdn_net_writebuf_skb(lp, skb);
16517 isdn_net_writebuf_skb(lp, skb);
16519 spin_unlock_bh(&lp->xmit_lock);
16521 /* the following stuff is here for backwards compatibility.
16522 @@ -1143,6 +1524,69 @@ isdn_net_xmit(struct net_device *ndev, s
16527 + if (lp->cps > lp->triggercps) {
16528 + /* Device overloaded */
16531 + * Packet-delivery via round-robin over master
16532 + * and all connected slaves.
16534 + if (lp->master) {
16535 + /* Slaves always deliver themselves */
16536 + spin_lock_bh(&lp->xmit_lock);
16537 + if (!isdn_net_lp_busy(lp)) {
16538 + isdn_net_writebuf_skb(lp, skb);
16541 + isdn_net_device_stop_queue(lp);
16544 + ret = isdn_net_send_skb(ndev, lp, skb);
16545 + spin_unlock_bh(&lp->xmit_lock);
16547 + isdn_net_local *slp = (isdn_net_local *) (lp->srobin->priv);
16548 + /* Master delivers via srobin and maintains srobin */
16549 + if (lp->srobin == ndev) {
16550 + spin_lock_bh(&lp->xmit_lock);
16551 + ret = isdn_net_send_skb(ndev, lp, skb);
16552 + spin_unlock_bh(&lp->xmit_lock);
16554 + ret = isdn_net_start_xmit(skb, lp->srobin);
16556 + lp->srobin = (slp->slave) ? slp->slave : ndev;
16557 + slp = (isdn_net_local *) (lp->srobin->priv);
16558 + if (!((slp->flags & ISDN_NET_CONNECTED) && (slp->dialstate == 0)))
16559 + lp->srobin = ndev;
16561 + /* Slave-startup using delay-variable */
16563 + if (!lp->sqfull) {
16564 + /* First time overload: set timestamp only */
16566 + lp->sqfull_stamp = jiffies;
16568 + /* subsequent overload: if slavedelay exceeded, start dialing */
16569 + if ((jiffies - lp->sqfull_stamp) > lp->slavedelay)
16570 + isdn_net_force_dial_lp((isdn_net_local *) lp->slave->priv);
16574 + /* Not overloaded, deliver locally */
16575 + spin_lock_bh(&lp->xmit_lock);
16576 + if (!isdn_net_lp_busy(lp)) {
16577 + isdn_net_writebuf_skb(lp, skb);
16580 + isdn_net_device_stop_queue(lp);
16583 + spin_unlock_bh(&lp->xmit_lock);
16584 + if (lp->sqfull && ((jiffies - lp->sqfull_stamp) > (lp->slavedelay + (10 * HZ))))
16592 @@ -1161,6 +1605,7 @@ isdn_net_adjust_hdr(struct sk_buff *skb,
16596 +#ifndef COMPAT_NO_SOFTNET
16597 void isdn_net_tx_timeout(struct net_device * ndev)
16599 isdn_net_local *lp = (isdn_net_local *) ndev->priv;
16600 @@ -1188,19 +1633,206 @@ void isdn_net_tx_timeout(struct net_devi
16601 ndev->trans_start = jiffies;
16602 netif_wake_queue(ndev);
16607 * Try sending a packet.
16608 * If this interface isn't connected to a ISDN-Channel, find a free channel,
16609 * and start dialing.
16611 +#ifdef CONFIG_ISDN_WITH_ABC
16612 +static int dwabc_isdn_net_start_xmit(struct sk_buff *,struct net_device *);
16614 +static int isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
16616 + if(skb == NULL || ndev == NULL)
16617 + return(dwabc_isdn_net_start_xmit(skb,ndev));
16618 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK
16619 + if(!(((isdn_net_local *)ndev->priv)->dw_abc_flags &
16620 + ISDN_DW_ABC_FLAG_NO_UDP_CHECK)) {
16622 + if(dw_abc_udp_test(skb,ndev)) {
16623 + dev_kfree_skb(skb);
16628 + return(dwabc_isdn_net_start_xmit(skb,ndev));
16632 +#ifdef CONFIG_ISDN_WITH_ABC
16633 +int isdn_auto_dial_helper( isdn_net_local *lp,
16634 + struct sk_buff *skb,
16635 + int dm_manual_allowed)
16636 +/**********************************************************************
16638 + -1 dial not allowed or impossible
16639 + 0 interface is connected
16640 + 1 dial is started
16641 +***********************************************************************/
16646 + char *errmsg = NULL;
16648 +#ifdef ISDN_DEBUG_NET_DUMP
16650 + char *buf = skb->data;
16651 + isdn_dumppkt("S:", buf, skb->len, 40);
16654 + if (lp->flags & ISDN_NET_CONNECTED)
16657 + save_flags(flags);
16662 + /* Log packet, which triggered dialing */
16663 + if (dev->net_verbose)
16664 + isdn_net_log_skb(skb, lp);
16665 + /* only do autodial if allowed by config */
16666 + if (!(ISDN_NET_DIALMODE(*lp) == ISDN_NET_DM_AUTO)) {
16667 + errmsg = "dial rejected: interface not in dialmode `auto'";
16669 + if(dm_manual_allowed &&
16670 + !(ISDN_NET_DIALMODE(*lp) == ISDN_NET_DM_MANUAL)) {
16673 + "dial rejected: interface not in dialmode `auto or manual'";
16678 + if (!lp->phone[1]) {
16680 + errmsg = "No phone number";
16684 + if(lp->dialwait_timer <= 0) {
16686 + if( lp->dialstarted > 0 &&
16687 + lp->dialtimeout > 0 &&
16688 + jiffies < (lp->dialstarted + lp->dialtimeout + lp->dialwait)) {
16690 + lp->dialwait_timer =
16691 + lp->dialstarted + lp->dialtimeout + lp->dialwait;
16695 + if(lp->dialwait_timer > 0) {
16697 + if(jiffies < lp->dialwait_timer) {
16699 + errmsg = "dial rejected: retry-time not reached";
16702 + } else lp->dialwait_timer = 0;
16704 +#ifdef CONFIG_ISDN_WITH_ABC
16705 + if(isdn_dwabc_is_interface_disabled(lp))
16708 + /* Grab a free ISDN-Channel */
16710 + isdn_get_free_channel(
16716 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
16717 + (*lp->dw_out_msn) ? lp->dw_out_msn :
16722 + isdn_get_free_channel(
16727 + lp->pre_channel^1,
16728 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
16729 + (*lp->dw_out_msn) ? lp->dw_out_msn :
16734 + errmsg = "No channel";
16738 + lp->dialstate = 1;
16739 + /* Connect interface with channel */
16740 + isdn_net_bind_channel(lp, chi);
16741 +#ifdef CONFIG_ISDN_PPP
16742 + if (lp->p_encap == ISDN_NET_ENCAP_SYNCPPP) {
16743 + /* no 'first_skb' handling for syncPPP */
16744 + if (isdn_ppp_bind(lp) < 0) {
16745 + isdn_net_unbind_channel(lp);
16749 + isdn_net_dial(); /* Initiate dialing */
16750 + netif_stop_queue(&lp->netdev->dev);
16753 + /* let upper layer requeue skb packet */
16756 + /* Initiate dialing */
16758 + isdn_net_device_stop_queue(lp);
16763 + if(retw < 0 && errmsg != NULL)
16764 + isdn_net_unreachable(&lp->netdev->dev, skb, errmsg);
16766 + restore_flags(flags);
16774 +dwabc_isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
16777 isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
16780 isdn_net_local *lp = (isdn_net_local *) ndev->priv;
16781 #ifdef CONFIG_ISDN_X25
16782 struct concap_proto * cprot = lp -> netdev -> cprot;
16784 +#ifdef COMPAT_NO_SOFTNET
16785 + /* some comment as with the softnet TX timeout
16786 + when this happens, it's a bug in the HL card driver
16787 + and should be fixed there, so we can supposedly get rid of
16788 + this here at all.
16789 + I added a debugging message to find out if it ever occurs --KG
16792 + if (ndev->tbusy) {
16793 + if (jiffies - ndev->trans_start < ISDN_NET_TX_TIMEOUT)
16795 + if (!lp->dialstate){
16796 + lp->stats.tx_errors++;
16797 + printk(KERN_WARNING "isdn_tx_timeout dev %s dialstate %d\n",
16798 + ndev->name, lp->dialstate);
16800 + ndev->trans_start = jiffies;
16801 + netif_wake_queue(ndev);
16804 #ifdef CONFIG_ISDN_X25
16805 /* At this point hard_start_xmit() passes control to the encapsulation
16806 protocol (if present).
16807 @@ -1220,6 +1852,40 @@ isdn_net_start_xmit(struct sk_buff *skb,
16810 /* auto-dialing xmit function */
16811 +#ifdef CONFIG_ISDN_WITH_ABC
16815 + isdn_net_adjust_hdr(skb, ndev);
16817 + if(!(r = isdn_auto_dial_helper(lp,skb,0))) {
16820 + ** Device is connected to an ISDN channel
16822 + ndev->trans_start = jiffies;
16824 + if (!lp->dialstate) {
16827 + ** ISDN connection is established, try sending
16829 + r = isdn_net_xmit(ndev, skb);
16834 + netif_stop_queue(ndev);
16836 + } else if(r < 0) {
16838 + dev_kfree_skb(skb);
16846 #ifdef ISDN_DEBUG_NET_DUMP
16848 @@ -1256,6 +1922,14 @@ isdn_net_start_xmit(struct sk_buff *skb,
16850 lp->dialwait_timer = 0;
16852 +#ifdef CONFIG_ISDN_WITH_ABC
16853 + if(isdn_dwabc_is_interface_disabled(lp)) {
16855 + dev_kfree_skb(skb);
16856 + restore_flags(flags);
16860 /* Grab a free ISDN-Channel */
16862 isdn_get_free_channel(
16863 @@ -1264,6 +1938,9 @@ isdn_net_start_xmit(struct sk_buff *skb,
16867 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
16868 + (*lp->dw_out_msn) ? lp->dw_out_msn :
16873 @@ -1273,6 +1950,9 @@ isdn_net_start_xmit(struct sk_buff *skb,
16877 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
16878 + (*lp->dw_out_msn) ? lp->dw_out_msn :
16882 restore_flags(flags);
16883 @@ -1296,16 +1976,6 @@ isdn_net_start_xmit(struct sk_buff *skb,
16884 restore_flags(flags);
16885 return 0; /* STN (skb to nirvana) ;) */
16887 -#ifdef CONFIG_IPPP_FILTER
16888 - if (isdn_ppp_autodial_filter(skb, lp)) {
16889 - isdn_ppp_free(lp);
16890 - isdn_net_unbind_channel(lp);
16891 - restore_flags(flags);
16892 - isdn_net_unreachable(ndev, skb, "dial rejected: packet filtered");
16893 - dev_kfree_skb(skb);
16897 restore_flags(flags);
16898 isdn_net_dial(); /* Initiate dialing */
16899 netif_stop_queue(ndev);
16900 @@ -1337,6 +2007,7 @@ isdn_net_start_xmit(struct sk_buff *skb,
16908 @@ -1356,6 +2027,9 @@ isdn_net_close(struct net_device *dev)
16909 if( cprot && cprot -> pops ) cprot -> pops -> close( cprot );
16911 netif_stop_queue(dev);
16912 +#ifdef COMPAT_NO_SOFTNET
16915 if ((p = (((isdn_net_local *) dev->priv)->slave))) {
16916 /* If this interface has slaves, stop them also */
16918 @@ -1776,6 +2450,10 @@ isdn_net_ciscohdlck_receive(isdn_net_loc
16922 + case CISCO_TYPE_INET:
16923 + skb->protocol = htons(ETH_P_IP);
16926 case CISCO_TYPE_SLARP:
16927 isdn_net_ciscohdlck_slarp_in(lp, skb);
16929 @@ -1785,11 +2463,11 @@ isdn_net_ciscohdlck_receive(isdn_net_loc
16930 "\"no cdp enable\" on cisco.\n", lp->name);
16933 - /* no special cisco protocol */
16934 - skb->protocol = htons(type);
16937 + printk(KERN_WARNING "%s: Unknown Cisco type 0x%04x\n",
16945 @@ -1803,9 +2481,19 @@ isdn_net_receive(struct net_device *ndev
16947 isdn_net_local *lp = (isdn_net_local *) ndev->priv;
16948 isdn_net_local *olp = lp; /* original 'lp' */
16949 +#ifdef CONFIG_ISDN_PPP
16950 + int proto = PPP_PROTOCOL(skb->data);
16952 #ifdef CONFIG_ISDN_X25
16953 struct concap_proto *cprot = lp -> netdev -> cprot;
16955 +#ifdef CONFIG_ISDN_WITH_ABC
16956 + struct net_device *ondev = ndev;
16957 +#ifdef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
16958 + ulong lp_huptimer = 0;
16959 + ulong olp_huptimer = 0;
16962 lp->transcount += skb->len;
16964 lp->stats.rx_packets++;
16965 @@ -1819,6 +2507,10 @@ isdn_net_receive(struct net_device *ndev
16966 lp->stats.rx_packets++;
16967 lp->stats.rx_bytes += skb->len;
16969 +#ifdef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
16970 + lp_huptimer = lp->huptimer;
16971 + olp_huptimer = olp->huptimer;
16974 skb->pkt_type = PACKET_HOST;
16975 skb->mac.raw = skb->data;
16976 @@ -1840,9 +2532,40 @@ isdn_net_receive(struct net_device *ndev
16978 case ISDN_NET_ENCAP_RAWIP:
16979 /* RAW-IP without MAC-Header */
16980 +#ifdef CONFIG_ISDN_WITH_ABC
16981 + if(olp->p_encap == ISDN_NET_ENCAP_RAWIP) {
16983 + ushort l = skb->len;
16986 + olp->dw_abc_bsd_bsd_rcv += l;
16988 + if((skb = dwabc_bsd_rx_pkt(olp,skb,ondev)) == NULL) {
16990 + olp->dw_abc_bsd_rcv += l;
16994 + olp->dw_abc_bsd_rcv += skb->len;
16996 + if( l != skb->len &&
16997 + (r=isdn_dc2minor(olp->isdn_device,olp->isdn_channel))>=0) {
16999 + dev->ibytes[r] += skb->len - l;
17000 + olp->stats.rx_bytes += skb->len - l;
17003 + lp->stats.rx_bytes += skb->len - l;
17009 skb->protocol = htons(ETH_P_IP);
17010 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
17011 + if(isdn_dwabc_conerr_ippktok(skb))
17012 + lp->dw_abc_bchan_errcnt = 0;
17015 case ISDN_NET_ENCAP_CISCOHDLCK:
17016 isdn_net_ciscohdlck_receive(lp, skb);
17017 @@ -1862,8 +2585,22 @@ isdn_net_receive(struct net_device *ndev
17019 #ifdef CONFIG_ISDN_PPP
17020 case ISDN_NET_ENCAP_SYNCPPP:
17021 - /* huptimer is done in isdn_ppp_push_higher */
17023 + * If encapsulation is syncppp, don't reset
17024 + * huptimer on LCP packets.
17026 + if (proto != PPP_LCP) {
17027 + olp->huptimer = 0;
17028 + lp->huptimer = 0;
17030 isdn_ppp_receive(lp->netdev, olp, skb);
17031 +#ifdef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
17032 + if(olp->dw_abc_flags & ISDN_DW_ABC_FLAG_RCV_NO_HUPTIMER) {
17034 + lp->huptimer = lp_huptimer + 1;
17035 + olp->huptimer = olp_huptimer+ 1;
17041 @@ -1873,6 +2610,15 @@ isdn_net_receive(struct net_device *ndev
17042 if(cprot) if(cprot -> pops)
17043 if( cprot -> pops -> data_ind){
17044 cprot -> pops -> data_ind(cprot,skb);
17045 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
17046 + lp->dw_abc_bchan_errcnt = 0;
17047 +#ifdef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
17048 + if(olp->dw_abc_flags & ISDN_DW_ABC_FLAG_RCV_NO_HUPTIMER) {
17049 + lp->huptimer = lp_huptimer;
17050 + olp->huptimer = olp_huptimer;
17056 #endif /* CONFIG_ISDN_X25 */
17057 @@ -1882,6 +2628,15 @@ isdn_net_receive(struct net_device *ndev
17061 +#ifdef CONFIG_ISDN_WITH_ABC
17062 +#ifdef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
17063 + if(olp->dw_abc_flags & ISDN_DW_ABC_FLAG_RCV_NO_HUPTIMER) {
17065 + lp->huptimer = lp_huptimer;
17066 + olp->huptimer = olp_huptimer;
17073 @@ -2160,7 +2915,10 @@ isdn_net_find_icall(int di, int ch, int
17076 char nr[ISDN_MSNLEN];
17078 +#ifdef CONFIG_ISDN_WITH_ABC
17079 + if(dev->net_verbose > 2)
17080 + printk(KERN_DEBUG "n_fi: di=%d ch=%d idx=%d usg=0x%04X\n", di, ch, idx,dev->usage[idx]);
17083 /* Search name in netdev-chain */
17085 @@ -2182,17 +2940,15 @@ isdn_net_find_icall(int di, int ch, int
17086 eaz = setup->eazmsn;
17087 if (dev->net_verbose > 1)
17088 printk(KERN_INFO "isdn_net: call from %s,%d,%d -> %s\n", nr, si1, si2, eaz);
17089 - /* Accept DATA and VOICE calls at this stage
17090 - local eaz is checked later for allowed call types */
17091 - if ((si1 != 7) && (si1 != 1)) {
17092 - restore_flags(flags);
17093 - if (dev->net_verbose > 1)
17094 - printk(KERN_INFO "isdn_net: Service-Indicator not 1 or 7, ignored\n");
17098 -n = (isdn_net_phone *) 0;
17100 + /* Accept only calls with Si1 = 7 (Data-Transmission) */
17102 + restore_flags(flags);
17103 + if (dev->net_verbose > 1)
17104 + printk(KERN_INFO "isdn_net: Service-Indicator not 7, ignored\n");
17107 + n = (isdn_net_phone *) 0;
17109 ematch = wret = swapped = 0;
17110 #ifdef ISDN_DEBUG_NET_ICALL
17111 printk(KERN_DEBUG "n_fi: di=%d ch=%d idx=%d usg=%d\n", di, ch, idx,
17112 @@ -2212,25 +2968,8 @@ p = dev->netdev;
17116 - /* check acceptable call types for DOV */
17117 - my_eaz = isdn_map_eaz2msn(lp->msn, di);
17118 - if (si1 == 1) { /* it's a DOV call, check if we allow it */
17119 - if (*my_eaz == 'v' || *my_eaz == 'V' ||
17120 - *my_eaz == 'b' || *my_eaz == 'B')
17121 - my_eaz++; /* skip to allow a match */
17123 - my_eaz = 0; /* force non match */
17124 - } else { /* it's a DATA call, check if we allow it */
17125 - if (*my_eaz == 'b' || *my_eaz == 'B')
17126 - my_eaz++; /* skip to allow a match */
17129 - matchret = isdn_msncmp(eaz, my_eaz);
17135 + if (!(matchret = isdn_msncmp(eaz, isdn_map_eaz2msn(lp->msn, di))))
17137 /* Remember if more numbers eventually can match */
17138 if (matchret > wret)
17140 @@ -2238,17 +2977,122 @@ p = dev->netdev;
17141 printk(KERN_DEBUG "n_fi: if='%s', l.msn=%s, l.flags=%d, l.dstate=%d\n",
17142 lp->name, lp->msn, lp->flags, lp->dialstate);
17144 +#ifdef CONFIG_ISDN_WITH_ABC_CALLB
17145 + if ((!matchret) && /* EAZ is matching */
17146 + (((!(lp->flags & ISDN_NET_CONNECTED)) && /* but not connected */
17147 + (USG_NONE(dev->usage[idx]))) || /* and ch. unused or */
17148 + (lp->dialstate == 4) || (lp->dialstate == 12) || /* if dialing */
17149 + ((lp->flags & ISDN_NET_CBOUT) != 0 && /* init a callback */
17150 + lp->outgoing != 0 )))
17153 + ** we dont stop call's anymore (both sides call's syncron)
17154 + ** it will be problem in any case.
17155 + ** both sides will make the same.
17156 + ** i try later to make a switch (check the phon-numbers)
17157 + ** to detect with side must be stop the call.
17160 if ((!matchret) && /* EAZ is matching */
17161 (((!(lp->flags & ISDN_NET_CONNECTED)) && /* but not connected */
17162 (USG_NONE(dev->usage[idx]))) || /* and ch. unused or */
17163 ((((lp->dialstate == 4) || (lp->dialstate == 12)) && /* if dialing */
17164 (!(lp->flags & ISDN_NET_CALLBACK))) /* but no callback */
17168 #ifdef ISDN_DEBUG_NET_ICALL
17169 printk(KERN_DEBUG "n_fi: match1, pdev=%d pch=%d\n",
17170 lp->pre_device, lp->pre_channel);
17172 +#ifdef CONFIG_ISDN_WITH_ABC
17173 +#ifdef CONFIG_ISDN_WITH_ABC_CALLB
17175 + int use_this_call = 0;
17177 + if(!(lp->flags & ISDN_NET_CBOUT) && ((lp->dialstate == 4) || (lp->dialstate == 12))) {
17180 + ** searching for a diff. in the calling-number and the EAZ
17181 + ** the remote will make the same
17187 + for(;*pnr;pnr++);
17188 + for(;*pea;pea++);
17189 + for(pnr--,pea--;pnr >= nr && pea >= eaz && *pea != *pnr;pnr--,pea--);
17191 + if(pnr < nr || pea < eaz || *pea > *pnr) {
17193 + p = (isdn_net_dev *) p->next;
17197 + use_this_call = 1;
17200 + if( use_this_call ||
17201 + ((lp->flags & ISDN_NET_CBOUT) && (lp->flags & ISDN_NET_CONNECTED))) {
17204 + ** the incoming call was to quick.
17205 + ** the callback-delay-time ist not reached.
17206 + ** in that case we can stop the call
17209 + if(lp->isdn_device > -1 && lp->isdn_channel > -1) {
17211 + int minor = isdn_dc2minor(lp->isdn_device,lp->isdn_channel);
17213 + if(lp->isdn_device != di || lp->isdn_channel != ch) {
17217 + memset((void *)&cmd,0,sizeof(cmd));
17218 + cmd.driver = lp->isdn_device;
17219 + cmd.command = ISDN_CMD_HANGUP;
17220 + cmd.arg = lp->isdn_channel;
17221 + (void) dev->drv[cmd.driver]->interface->command(&cmd);
17222 + isdn_all_eaz(lp->isdn_device, lp->isdn_channel);
17224 + if(dev->net_verbose > 1) {
17227 + "%s: found outgoing call hangup old call on di %d ch %d\n",
17228 + lp->name,lp->isdn_device,lp->isdn_channel);
17231 + } else if (dev->net_verbose > 1) {
17233 + printk(KERN_INFO "%s: found outgoing call on same di %d ch %d\n",
17234 + lp->name,lp->isdn_device,lp->isdn_channel);
17239 + dev->rx_netdev[minor] = NULL;
17240 + dev->st_netdev[minor] = NULL;
17243 + isdn_free_channel(lp->isdn_device,
17244 + lp->isdn_channel, ISDN_USAGE_NET);
17246 + } else if (dev->net_verbose > 1) {
17248 + printk(KERN_INFO "%s: found outgoing call reset callstate \n",lp->name);
17251 + lp->flags &= ~ISDN_NET_CONNECTED;
17252 + lp->isdn_device = -1;
17253 + lp->isdn_channel = -1;
17255 + lp->dialstate = 0;
17260 if (dev->usage[idx] & ISDN_USAGE_EXCLUSIVE) {
17261 if ((lp->pre_channel != ch) ||
17262 (lp->pre_device != di)) {
17263 @@ -2377,6 +3221,12 @@ p = dev->netdev;
17267 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
17268 + if(isdn_dwabc_is_interface_disabled(lp)) {
17269 + restore_flags(flags);
17273 if (lp->flags & ISDN_NET_CALLBACK) {
17276 @@ -2429,6 +3279,47 @@ p = dev->netdev;
17277 restore_flags(flags);
17280 +#ifdef CONFIG_ISDN_WITH_ABC_CALLB
17283 + ** this is a sanity-check.
17284 + ** check for double use (device and channel)
17285 + ** will be very near to a kernel-crash in that case
17287 + isdn_net_dev *sp = dev->netdev;
17289 + isdn_net_local *ml;
17291 + for(s_shl=0; s_shl < 2048 && sp != NULL; sp = (isdn_net_dev *)sp->next, s_shl++) {
17293 + if(sp == p || (ml = sp->local) == NULL)
17296 + if(ml->isdn_device != di || ml->isdn_channel != ch)
17299 + if(ml->dialstate != 4 && ml->dialstate != 12) {
17302 + ** wrong situation
17307 + isdn_net_unbind_channel(ml);
17312 + printk(KERN_DEBUG
17313 +"%s: call from %s -> %s (drv %d chan %d duplicated with %s) \n",
17314 + lp->name, nr, eaz,di,ch,
17315 + sp->local->name );
17317 + restore_flags(flags);
17321 printk(KERN_DEBUG "%s: call from %s -> %s accepted\n", lp->name, nr,
17323 /* if this interface is dialing, it does it probably on a different
17324 @@ -2518,7 +3409,11 @@ isdn_net_force_dial_lp(isdn_net_local *
17328 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
17329 + (*lp->dw_out_msn) ? lp->dw_out_msn : lp->msn)
17334 printk(KERN_WARNING "isdn_net_force_dial: No channel for %s\n", lp->name);
17335 restore_flags(flags);
17336 @@ -2601,7 +3496,11 @@ isdn_net_new(char *name, struct net_devi
17337 strcpy(netdev->local->name, " ");
17339 strcpy(netdev->local->name, name);
17340 +#ifdef COMPAT_NO_SOFTNET
17341 + netdev->dev.name = netdev->local->name;
17343 strcpy(netdev->dev.name, netdev->local->name);
17345 netdev->dev.priv = netdev->local;
17346 netdev->dev.init = isdn_net_init;
17347 netdev->local->p_encap = ISDN_NET_ENCAP_RAWIP;
17348 @@ -2619,11 +3518,13 @@ isdn_net_new(char *name, struct net_devi
17349 ((isdn_net_local *) q->priv)->slave = &(netdev->dev);
17351 /* Device shall be a master */
17352 +#ifndef COMPAT_NO_SOFTNET
17354 * Watchdog timer (currently) for master only.
17356 netdev->dev.tx_timeout = isdn_net_tx_timeout;
17357 netdev->dev.watchdog_timeo = ISDN_NET_TX_TIMEOUT;
17359 if (register_netdev(&netdev->dev) != 0) {
17360 printk(KERN_WARNING "isdn_net: Could not register net-device\n");
17361 kfree(netdev->local);
17362 @@ -2660,6 +3561,9 @@ isdn_net_new(char *name, struct net_devi
17363 netdev->local->hupflags = ISDN_INHUP; /* Do hangup even on incoming calls */
17364 netdev->local->onhtime = 10; /* Default hangup-time for saving costs
17365 of those who forget configuring this */
17366 +#ifdef CONFIG_ISDN_WITH_ABC
17367 + netdev->local->dw_abc_old_onhtime = netdev->local->onhtime;
17369 netdev->local->dialmax = 1;
17370 netdev->local->flags = ISDN_NET_CBHUP | ISDN_NET_DM_MANUAL; /* Hangup before Callback, manual dial */
17371 netdev->local->cbdelay = 25; /* Wait 5 secs before Callback */
17372 @@ -2833,7 +3737,6 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg
17374 /* If binding is exclusive, try to grab the channel */
17377 if ((i = isdn_get_free_channel(ISDN_USAGE_NET,
17378 lp->l2_proto, lp->l3_proto, drvidx,
17379 chidx, lp->msn)) < 0) {
17380 @@ -2862,6 +3765,9 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg
17381 lp->pre_device = drvidx;
17382 lp->pre_channel = chidx;
17383 lp->onhtime = cfg->onhtime;
17384 +#ifdef CONFIG_ISDN_WITH_ABC
17385 + lp->dw_abc_old_onhtime = lp->onhtime;
17387 lp->charge = cfg->charge;
17388 lp->l2_proto = cfg->l2_proto;
17389 lp->l3_proto = cfg->l3_proto;
17390 @@ -2935,6 +3841,9 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg
17393 lp->p_encap = cfg->p_encap;
17394 +#ifdef CONFIG_ISDN_WITH_ABC
17395 + isdn_dw_abc_reset_interface(lp,0);
17400 @@ -3011,6 +3920,9 @@ isdn_net_addphone(isdn_net_ioctl_phone *
17401 n->num[sizeof(n->num) - 1] = 0;
17402 n->next = p->local->phone[phone->outgoing & 1];
17403 p->local->phone[phone->outgoing & 1] = n;
17404 +#ifdef CONFIG_ISDN_WITH_ABC
17405 + isdn_dwabc_test_phone(p->local);
17410 @@ -3104,6 +4016,9 @@ isdn_net_delphone(isdn_net_ioctl_phone *
17412 p->local->phone[inout] = n->next;
17414 +#ifdef CONFIG_ISDN_WITH_ABC
17415 + isdn_dwabc_test_phone(p->local);
17417 restore_flags(flags);
17420 @@ -3139,6 +4054,9 @@ isdn_net_rmallphone(isdn_net_dev * p)
17421 p->local->phone[i] = NULL;
17423 p->local->dial = NULL;
17424 +#ifdef CONFIG_ISDN_WITH_ABC
17425 + isdn_dwabc_test_phone(p->local);
17427 restore_flags(flags);
17430 @@ -3222,6 +4140,10 @@ isdn_net_realrm(isdn_net_dev * p, isdn_n
17431 /* If no more net-devices remain, disable auto-hangup timer */
17432 if (dev->netdev == NULL)
17433 isdn_timer_ctrl(ISDN_TIMER_NETHANGUP, 0);
17434 +#ifdef CONFIG_ISDN_WITH_ABC
17435 + isdn_dw_clear_if(~0l,p->local);
17436 + dwabc_bsd_free(p->local);
17438 restore_flags(flags);
17441 --- a/drivers/isdn/isdn_net.h
17442 +++ b/drivers/isdn/isdn_net.h
17444 -/* $Id: isdn_net.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
17445 +/* $Id: isdn_net.h,v 1.23 2001/11/07 22:35:48 kai Exp $
17447 * header for Linux ISDN subsystem, network related functions (linklevel).
17450 #define CISCO_ADDR_BROADCAST 0x8f
17451 #define CISCO_CTRL 0x00
17452 #define CISCO_TYPE_CDP 0x2000
17453 +#define CISCO_TYPE_INET 0x0800
17454 #define CISCO_TYPE_SLARP 0x8035
17455 #define CISCO_SLARP_REQUEST 0
17456 #define CISCO_SLARP_REPLY 1
17457 @@ -106,8 +107,6 @@ static __inline__ void isdn_net_add_to_b
17458 spin_lock_irqsave(&nd->queue_lock, flags);
17461 -// printk(KERN_DEBUG __FUNCTION__": lp:%s(%p) nlp:%s(%p) last(%p)\n",
17462 -// lp->name, lp, nlp->name, nlp, lp->last);
17463 nlp->last = lp->last;
17464 lp->last->next = nlp;
17466 @@ -127,20 +126,12 @@ static __inline__ void isdn_net_rm_from_
17468 master_lp = (isdn_net_local *) lp->master->priv;
17470 -// printk(KERN_DEBUG __FUNCTION__": lp:%s(%p) mlp:%s(%p) last(%p) next(%p) mndq(%p)\n",
17471 -// lp->name, lp, master_lp->name, master_lp, lp->last, lp->next, master_lp->netdev->queue);
17472 spin_lock_irqsave(&master_lp->netdev->queue_lock, flags);
17473 lp->last->next = lp->next;
17474 lp->next->last = lp->last;
17475 - if (master_lp->netdev->queue == lp) {
17476 + if (master_lp->netdev->queue == lp)
17477 master_lp->netdev->queue = lp->next;
17478 - if (lp->next == lp) { /* last in queue */
17479 - master_lp->netdev->queue = master_lp->netdev->local;
17482 lp->next = lp->last = lp; /* (re)set own pointers */
17483 -// printk(KERN_DEBUG __FUNCTION__": mndq(%p)\n",
17484 -// master_lp->netdev->queue);
17485 spin_unlock_irqrestore(&master_lp->netdev->queue_lock, flags);
17488 --- a/drivers/isdn/isdn_ppp.c
17489 +++ b/drivers/isdn/isdn_ppp.c
17491 -/* $Id: isdn_ppp.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
17492 +/* $Id: isdn_ppp.c,v 1.94 2001/11/07 22:35:48 kai Exp $
17494 * Linux ISDN subsystem, functions for synchronous PPP (linklevel).
17497 #include <linux/isdn.h>
17498 #include <linux/poll.h>
17499 #include <linux/ppp-comp.h>
17500 -#ifdef CONFIG_IPPP_FILTER
17501 -#include <linux/filter.h>
17504 #include "isdn_common.h"
17505 #include "isdn_ppp.h"
17506 @@ -72,11 +69,19 @@ static void isdn_ppp_mp_cleanup( isdn_ne
17507 static int isdn_ppp_bundle(struct ippp_struct *, int unit);
17508 #endif /* CONFIG_ISDN_MPP */
17510 -char *isdn_ppp_revision = "$Revision: 1.1.4.1 $";
17511 +char *isdn_ppp_revision = "$Revision: 1.94 $";
17513 static struct ippp_struct *ippp_table[ISDN_MAX_CHANNELS];
17515 +#ifndef CONFIG_ISDN_WITH_ABC
17516 static struct isdn_ppp_compressor *ipc_head = NULL;
17519 + ** make compressor's common usable
17521 +struct isdn_ppp_compressor *isdn_ippp_comp_head = NULL;
17522 +#define ipc_head isdn_ippp_comp_head
17526 * frame log (debug)
17527 @@ -110,11 +115,8 @@ isdn_ppp_free(isdn_net_local * lp)
17528 unsigned long flags;
17529 struct ippp_struct *is;
17531 - if (lp->ppp_slot < 0 || lp->ppp_slot > ISDN_MAX_CHANNELS) {
17532 - printk(KERN_ERR "%s: ppp_slot(%d) out of range\n",
17533 - __FUNCTION__, lp->ppp_slot);
17534 + if (lp->ppp_slot < 0 || lp->ppp_slot > ISDN_MAX_CHANNELS)
17540 @@ -130,12 +132,7 @@ isdn_ppp_free(isdn_net_local * lp)
17541 lp->netdev->pb->ref_ct--;
17542 spin_unlock(&lp->netdev->pb->lock);
17543 #endif /* CONFIG_ISDN_MPP */
17544 - if (lp->ppp_slot < 0 || lp->ppp_slot > ISDN_MAX_CHANNELS) {
17545 - printk(KERN_ERR "%s: ppp_slot(%d) now invalid\n",
17546 - __FUNCTION__, lp->ppp_slot);
17547 - restore_flags(flags);
17551 is = ippp_table[lp->ppp_slot];
17552 if ((is->state & IPPP_CONNECT))
17553 isdn_ppp_closewait(lp->ppp_slot); /* force wakeup on ippp device */
17554 @@ -231,13 +228,12 @@ isdn_ppp_bind(isdn_net_local * lp)
17556 isdn_ppp_wakeup_daemon(isdn_net_local * lp)
17558 - if (lp->ppp_slot < 0 || lp->ppp_slot >= ISDN_MAX_CHANNELS) {
17559 - printk(KERN_ERR "%s: ppp_slot(%d) out of range\n",
17560 - __FUNCTION__, lp->ppp_slot);
17561 + if (lp->ppp_slot < 0 || lp->ppp_slot >= ISDN_MAX_CHANNELS)
17565 ippp_table[lp->ppp_slot]->state = IPPP_OPEN | IPPP_CONNECT | IPPP_NOBLOCK;
17566 - wake_up_interruptible(&ippp_table[lp->ppp_slot]->wq);
17568 + wake_up_interruptible(&ippp_table[lp->ppp_slot]->wq);
17572 @@ -250,14 +246,13 @@ isdn_ppp_closewait(int slot)
17574 struct ippp_struct *is;
17576 - if (slot < 0 || slot >= ISDN_MAX_CHANNELS) {
17577 - printk(KERN_ERR "%s: slot(%d) out of range\n",
17578 - __FUNCTION__, slot);
17579 + if (slot < 0 || slot >= ISDN_MAX_CHANNELS)
17582 is = ippp_table[slot];
17585 wake_up_interruptible(&is->wq);
17587 is->state = IPPP_CLOSEWAIT;
17590 @@ -295,9 +290,11 @@ isdn_ppp_open(int min, struct file *file
17593 is = file->private_data = ippp_table[slot];
17595 - printk(KERN_DEBUG "ippp, open, slot: %d, minor: %d, state: %04x\n",
17596 - slot, min, is->state);
17599 + if (is->debug & 0x1)
17601 + printk(KERN_DEBUG "ippp, open, slot: %d, minor: %d, state: %04x\n", slot, min, is->state);
17603 /* compression stuff */
17604 is->link_compressor = is->compressor = NULL;
17605 @@ -327,10 +324,7 @@ isdn_ppp_open(int min, struct file *file
17607 is->slcomp = slhc_init(16, 16); /* not necessary for 2. link in bundle */
17609 -#ifdef CONFIG_IPPP_FILTER
17610 - is->pass_filter.filter = NULL;
17611 - is->active_filter.filter = NULL;
17614 is->state = IPPP_OPEN;
17617 @@ -349,20 +343,12 @@ isdn_ppp_release(int min, struct file *f
17619 is = file->private_data;
17622 - printk(KERN_ERR "%s: no file->private_data\n", __FUNCTION__);
17625 if (is->debug & 0x1)
17626 printk(KERN_DEBUG "ippp: release, minor: %d %lx\n", min, (long) is->lp);
17628 if (is->lp) { /* a lp address says: this link is still up */
17629 isdn_net_dev *p = is->lp->netdev;
17632 - printk(KERN_ERR "%s: no lp->netdev\n", __FUNCTION__);
17635 is->state &= ~IPPP_CONNECT; /* -> effect: no call of wakeup */
17637 * isdn_net_hangup() calls isdn_ppp_free()
17638 @@ -385,18 +371,8 @@ isdn_ppp_release(int min, struct file *f
17639 slhc_free(is->slcomp);
17642 -#ifdef CONFIG_IPPP_FILTER
17643 - if (is->pass_filter.filter) {
17644 - kfree(is->pass_filter.filter);
17645 - is->pass_filter.filter = NULL;
17647 - if (is->active_filter.filter) {
17648 - kfree(is->active_filter.filter);
17649 - is->active_filter.filter = NULL;
17653 -/* TODO: if this was the previous master: link the stuff to the new master */
17654 +/* TODO: if this was the previous master: link the the stuff to the new master */
17656 is->compressor->free(is->comp_stat);
17657 if(is->link_comp_stat)
17658 @@ -509,13 +485,15 @@ isdn_ppp_ioctl(int min, struct file *fil
17659 if (val & SC_ENABLE_IP && !(is->pppcfg & SC_ENABLE_IP) && (is->state & IPPP_CONNECT)) {
17661 /* OK .. we are ready to send buffers */
17662 - is->pppcfg = val; /* isdn_ppp_xmit test for SC_ENABLE_IP !!! */
17663 netif_wake_queue(&lp->netdev->dev);
17670 + case PPPIOCGSTAT: /* read PPP statistic information */
17673 case PPPIOCGIDLE: /* get idle time information */
17675 struct ppp_idle pidle;
17676 @@ -604,39 +582,6 @@ isdn_ppp_ioctl(int min, struct file *fil
17678 return set_arg((void *)arg,&pci,sizeof(struct pppcallinfo));
17680 -#ifdef CONFIG_IPPP_FILTER
17681 - case PPPIOCSPASS:
17682 - case PPPIOCSACTIVE:
17684 - struct sock_fprog uprog, *filtp;
17685 - struct sock_filter *code = NULL;
17688 - if (copy_from_user(&uprog, (void *) arg, sizeof(uprog)))
17690 - if (uprog.len > 0 && uprog.len < 65536) {
17691 - len = uprog.len * sizeof(struct sock_filter);
17692 - code = kmalloc(len, GFP_KERNEL);
17693 - if (code == NULL)
17695 - if (copy_from_user(code, uprog.filter, len)) {
17699 - err = sk_chk_filter(code, uprog.len);
17705 - filtp = (cmd == PPPIOCSPASS) ? &is->pass_filter : &is->active_filter;
17706 - if (filtp->filter)
17707 - kfree(filtp->filter);
17708 - filtp->filter = code;
17709 - filtp->len = uprog.len;
17712 -#endif /* CONFIG_IPPP_FILTER */
17716 @@ -699,7 +644,7 @@ isdn_ppp_fill_rq(unsigned char *buf, int
17717 struct ippp_struct *is;
17719 if (slot < 0 || slot >= ISDN_MAX_CHANNELS) {
17720 - printk(KERN_WARNING "ippp: illegal slot(%d).\n", slot);
17721 + printk(KERN_WARNING "ippp: illegal slot.\n");
17724 is = ippp_table[slot];
17725 @@ -976,8 +921,7 @@ void isdn_ppp_receive(isdn_net_dev * net
17727 slot = lp->ppp_slot;
17728 if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
17729 - printk(KERN_ERR "isdn_ppp_receive: lp->ppp_slot(%d)\n",
17731 + printk(KERN_ERR "isdn_ppp_receive: lp->ppp_slot %d\n", lp->ppp_slot);
17735 @@ -1026,23 +970,19 @@ isdn_ppp_push_higher(isdn_net_dev * net_
17737 struct net_device *dev = &net_dev->dev;
17738 struct ippp_struct *is, *mis;
17739 - isdn_net_local *mlp = NULL;
17742 slot = lp->ppp_slot;
17743 if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
17744 - printk(KERN_ERR "isdn_ppp_push_higher: lp->ppp_slot(%d)\n",
17746 + printk(KERN_ERR "isdn_ppp_push_higher: lp->ppp_slot %d\n", lp->ppp_slot);
17749 is = ippp_table[slot];
17751 if (lp->master) { // FIXME?
17752 - mlp = (isdn_net_local *) lp->master->priv;
17753 - slot = mlp->ppp_slot;
17754 + slot = ((isdn_net_local *) (lp->master->priv))->ppp_slot;
17755 if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
17756 - printk(KERN_ERR "isdn_ppp_push_higher: master->ppp_slot(%d)\n",
17758 + printk(KERN_ERR "isdn_ppp_push_higher: master->ppp_slot %d\n", lp->ppp_slot);
17762 @@ -1076,11 +1016,6 @@ isdn_ppp_push_higher(isdn_net_dev * net_
17763 case PPP_VJC_UNCOMP:
17764 if (is->debug & 0x20)
17765 printk(KERN_DEBUG "isdn_ppp: VJC_UNCOMP\n");
17766 - if (net_dev->local->ppp_slot < 0) {
17767 - printk(KERN_ERR "%s: net_dev->local->ppp_slot(%d) out of range\n",
17768 - __FUNCTION__, net_dev->local->ppp_slot);
17769 - goto drop_packet;
17771 if (slhc_remember(ippp_table[net_dev->local->ppp_slot]->slcomp, skb->data, skb->len) <= 0) {
17772 printk(KERN_WARNING "isdn_ppp: received illegal VJC_UNCOMP frame!\n");
17774 @@ -1102,11 +1037,6 @@ isdn_ppp_push_higher(isdn_net_dev * net_
17776 skb_put(skb, skb_old->len + 128);
17777 memcpy(skb->data, skb_old->data, skb_old->len);
17778 - if (net_dev->local->ppp_slot < 0) {
17779 - printk(KERN_ERR "%s: net_dev->local->ppp_slot(%d) out of range\n",
17780 - __FUNCTION__, net_dev->local->ppp_slot);
17781 - goto drop_packet;
17783 pkt_len = slhc_uncompress(ippp_table[net_dev->local->ppp_slot]->slcomp,
17784 skb->data, skb_old->len);
17785 kfree_skb(skb_old);
17786 @@ -1133,36 +1063,12 @@ isdn_ppp_push_higher(isdn_net_dev * net_
17790 -#ifdef CONFIG_IPPP_FILTER
17791 - /* check if the packet passes the pass and active filters
17792 - * the filter instructions are constructed assuming
17793 - * a four-byte PPP header on each packet (which is still present) */
17794 - skb_push(skb, 4);
17795 - skb->data[0] = 0; /* indicate inbound */
17797 - if (is->pass_filter.filter
17798 - && sk_run_filter(skb, is->pass_filter.filter,
17799 - is->pass_filter.len) == 0) {
17800 - if (is->debug & 0x2)
17801 - printk(KERN_DEBUG "IPPP: inbound frame filtered.\n");
17805 - if (!(is->active_filter.filter
17806 - && sk_run_filter(skb, is->active_filter.filter,
17807 - is->active_filter.len) == 0)) {
17808 - if (is->debug & 0x2)
17809 - printk(KERN_DEBUG "IPPP: link-active filter: reseting huptimer.\n");
17810 - lp->huptimer = 0;
17812 - mlp->huptimer = 0;
17814 - skb_pull(skb, 4);
17815 -#else /* CONFIG_IPPP_FILTER */
17816 - lp->huptimer = 0;
17818 - mlp->huptimer = 0;
17819 -#endif /* CONFIG_IPPP_FILTER */
17820 + /* Reset hangup-timer */
17821 + lp->huptimer = 0;
17822 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
17823 + lp->dw_abc_bchan_errcnt = 0;
17827 skb->mac.raw = skb->data;
17829 @@ -1199,6 +1105,7 @@ static unsigned char *isdn_ppp_skb_push(
17830 return skb_push(skb,len);
17835 * send ppp frame .. we expect a PIDCOMPressable proto --
17836 * (here: currently always PPP_IP,PPP_VJC_COMP,PPP_VJC_UNCOMP)
17837 @@ -1214,25 +1121,23 @@ isdn_ppp_xmit(struct sk_buff *skb, struc
17839 unsigned int proto = PPP_IP; /* 0x21 */
17840 struct ippp_struct *ipt,*ipts;
17841 - int slot, retval = 0;
17844 mlp = (isdn_net_local *) (netdev->priv);
17845 nd = mlp->netdev; /* get master lp */
17847 slot = mlp->ppp_slot;
17848 if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
17849 - printk(KERN_ERR "isdn_ppp_xmit: lp->ppp_slot(%d)\n",
17851 + printk(KERN_ERR "isdn_ppp_xmit: lp->ppp_slot %d\n", mlp->ppp_slot);
17856 ipts = ippp_table[slot];
17858 if (!(ipts->pppcfg & SC_ENABLE_IP)) { /* PPP connected ? */
17859 if (ipts->debug & 0x1)
17860 printk(KERN_INFO "%s: IP frame delayed.\n", netdev->name);
17866 switch (ntohs(skb->protocol)) {
17867 @@ -1246,25 +1151,24 @@ isdn_ppp_xmit(struct sk_buff *skb, struc
17868 printk(KERN_ERR "isdn_ppp: skipped unsupported protocol: %#x.\n",
17870 dev_kfree_skb(skb);
17875 lp = isdn_net_get_locked_lp(nd);
17877 printk(KERN_WARNING "%s: all channels busy - requeuing!\n", netdev->name);
17882 /* we have our lp locked from now on */
17884 slot = lp->ppp_slot;
17885 if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
17886 - printk(KERN_ERR "isdn_ppp_xmit: lp->ppp_slot(%d)\n",
17888 + printk(KERN_ERR "isdn_ppp_xmit: lp->ppp_slot %d\n", lp->ppp_slot);
17893 ipt = ippp_table[slot];
17894 + lp->huptimer = 0;
17897 * after this line .. requeueing in the device queue is no longer allowed!!!
17898 @@ -1275,34 +1179,6 @@ isdn_ppp_xmit(struct sk_buff *skb, struc
17900 skb_pull(skb,IPPP_MAX_HEADER);
17902 -#ifdef CONFIG_IPPP_FILTER
17903 - /* check if we should pass this packet
17904 - * the filter instructions are constructed assuming
17905 - * a four-byte PPP header on each packet */
17906 - skb_push(skb, 4);
17907 - skb->data[0] = 1; /* indicate outbound */
17908 - *(u_int16_t *)(skb->data + 2) = htons(proto);
17910 - if (ipt->pass_filter.filter
17911 - && sk_run_filter(skb, ipt->pass_filter.filter,
17912 - ipt->pass_filter.len) == 0) {
17913 - if (ipt->debug & 0x4)
17914 - printk(KERN_DEBUG "IPPP: outbound frame filtered.\n");
17918 - if (!(ipt->active_filter.filter
17919 - && sk_run_filter(skb, ipt->active_filter.filter,
17920 - ipt->active_filter.len) == 0)) {
17921 - if (ipt->debug & 0x4)
17922 - printk(KERN_DEBUG "IPPP: link-active filter: reseting huptimer.\n");
17923 - lp->huptimer = 0;
17925 - skb_pull(skb, 4);
17926 -#else /* CONFIG_IPPP_FILTER */
17927 - lp->huptimer = 0;
17928 -#endif /* CONFIG_IPPP_FILTER */
17930 if (ipt->debug & 0x4)
17931 printk(KERN_DEBUG "xmit skb, len %d\n", (int) skb->len);
17932 if (ipts->debug & 0x40)
17933 @@ -1440,54 +1316,9 @@ isdn_ppp_xmit(struct sk_buff *skb, struc
17936 spin_unlock_bh(&lp->xmit_lock);
17942 -#ifdef CONFIG_IPPP_FILTER
17944 - * check if this packet may trigger auto-dial.
17947 -int isdn_ppp_autodial_filter(struct sk_buff *skb, isdn_net_local *lp)
17949 - struct ippp_struct *is = ippp_table[lp->ppp_slot];
17953 - switch (ntohs(skb->protocol)) {
17961 - printk(KERN_ERR "isdn_ppp_autodial_filter: unsupported protocol 0x%x.\n",
17966 - /* the filter instructions are constructed assuming
17967 - * a four-byte PPP header on each packet. we have to
17968 - * temporarily remove part of the fake header stuck on
17971 - skb_pull(skb, IPPP_MAX_HEADER - 4);
17972 - skb->data[0] = 1; /* indicate outbound */
17973 - *(u_int16_t *)(skb->data + 2) = htons(proto);
17975 - drop |= is->pass_filter.filter
17976 - && sk_run_filter(skb, is->pass_filter.filter,
17977 - is->pass_filter.len) == 0;
17978 - drop |= is->active_filter.filter
17979 - && sk_run_filter(skb, is->active_filter.filter,
17980 - is->active_filter.len) == 0;
17982 - skb_push(skb, IPPP_MAX_HEADER - 4);
17986 #ifdef CONFIG_ISDN_MPP
17988 /* this is _not_ rfc1990 header, but something we convert both short and long
17989 @@ -1537,15 +1368,8 @@ static ippp_bundle * isdn_ppp_mp_bundle_
17991 static int isdn_ppp_mp_init( isdn_net_local * lp, ippp_bundle * add_to )
17993 - struct ippp_struct * is;
17995 - if (lp->ppp_slot < 0) {
17996 - printk(KERN_ERR "%s: lp->ppp_slot(%d) out of range\n",
17997 - __FUNCTION__, lp->ppp_slot);
18001 - is = ippp_table[lp->ppp_slot];
18002 + struct ippp_struct * is = ippp_table[lp->ppp_slot];
18005 if( lp->netdev->pb )
18006 lp->netdev->pb->ref_ct--;
18007 @@ -1591,8 +1415,7 @@ static void isdn_ppp_mp_receive(isdn_net
18008 stats = &mp->stats;
18009 slot = lp->ppp_slot;
18010 if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
18011 - printk(KERN_ERR "%s: lp->ppp_slot(%d)\n",
18012 - __FUNCTION__, lp->ppp_slot);
18013 + printk(KERN_ERR "isdn_ppp_mp_receive: lp->ppp_slot %d\n", lp->ppp_slot);
18014 stats->frame_drops++;
18015 dev_kfree_skb(skb);
18016 spin_unlock_irqrestore(&mp->lock, flags);
18017 @@ -1628,8 +1451,7 @@ static void isdn_ppp_mp_receive(isdn_net
18018 for (lpq = net_dev->queue;;) {
18019 slot = lpq->ppp_slot;
18020 if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
18021 - printk(KERN_ERR "%s: lpq->ppp_slot(%d)\n",
18022 - __FUNCTION__, lpq->ppp_slot);
18023 + printk(KERN_ERR "isdn_ppp_mp_receive: lpq->ppp_slot %d\n", lpq->ppp_slot);
18025 u32 lls = ippp_table[slot]->last_link_seqno;
18026 if (MP_LT(lls, minseq))
18027 @@ -1861,14 +1683,9 @@ void isdn_ppp_mp_reassembly( isdn_net_de
18028 struct sk_buff * skb;
18029 unsigned int tot_len;
18031 - if (lp->ppp_slot < 0 || lp->ppp_slot > ISDN_MAX_CHANNELS) {
18032 - printk(KERN_ERR "%s: lp->ppp_slot(%d) out of range\n",
18033 - __FUNCTION__, lp->ppp_slot);
18036 if( MP_FLAGS(from) == (MP_BEGIN_FRAG | MP_END_FRAG) ) {
18037 if( ippp_table[lp->ppp_slot]->debug & 0x40 )
18038 - printk(KERN_DEBUG "isdn_mppp: reassembly: frame %d, "
18039 + printk(KERN_DEBUG"isdn_mppp: reassembly: frame %d, "
18040 "len %d\n", MP_SEQ(from), from->len );
18042 skb_pull(skb, MP_HEADER_LEN);
18043 @@ -1987,10 +1804,8 @@ isdn_ppp_dev_ioctl_stats(int slot, struc
18044 memset(&t, 0, sizeof(struct ppp_stats));
18045 if (dev->flags & IFF_UP) {
18046 t.p.ppp_ipackets = lp->stats.rx_packets;
18047 - t.p.ppp_ibytes = lp->stats.rx_bytes;
18048 t.p.ppp_ierrors = lp->stats.rx_errors;
18049 t.p.ppp_opackets = lp->stats.tx_packets;
18050 - t.p.ppp_obytes = lp->stats.tx_bytes;
18051 t.p.ppp_oerrors = lp->stats.tx_errors;
18052 #ifdef CONFIG_ISDN_PPP_VJ
18053 if (slot >= 0 && ippp_table[slot]->slcomp) {
18054 @@ -2018,6 +1833,9 @@ isdn_ppp_dev_ioctl(struct net_device *de
18056 isdn_net_local *lp = (isdn_net_local *) dev->priv;
18059 + printk(KERN_DEBUG "ippp, dev_ioctl: cmd %#08x , %d \n", cmd, lp->ppp_slot);
18062 if (lp->p_encap != ISDN_NET_ENCAP_SYNCPPP)
18064 @@ -2432,7 +2250,7 @@ static void isdn_ppp_ccp_reset_trans(str
18067 rs->state = CCPResetSentReq;
18068 - /* We always expect an Ack if the decompressor doesn't
18069 + /* We always expect an Ack if the decompressor doesnt
18073 @@ -2583,7 +2401,13 @@ static struct sk_buff *isdn_ppp_compress
18076 if(type) { /* type=1 => Link compression */
18078 + compressor = is->link_compressor;
18079 + stat = is->link_comp_stat;
18080 + new_proto = PPP_LINK_COMP;
18087 @@ -2631,31 +2455,18 @@ static struct sk_buff *isdn_ppp_compress
18088 static void isdn_ppp_receive_ccp(isdn_net_dev *net_dev, isdn_net_local *lp,
18089 struct sk_buff *skb,int proto)
18091 - struct ippp_struct *is;
18092 + struct ippp_struct *is = ippp_table[lp->ppp_slot];
18093 struct ippp_struct *mis;
18095 struct isdn_ppp_resetparams rsparm;
18096 unsigned char rsdata[IPPP_RESET_MAXDATABYTES];
18098 - printk(KERN_DEBUG "Received CCP frame from peer slot(%d)\n",
18100 - if (lp->ppp_slot < 0 || lp->ppp_slot > ISDN_MAX_CHANNELS) {
18101 - printk(KERN_ERR "%s: lp->ppp_slot(%d) out of range\n",
18102 - __FUNCTION__, lp->ppp_slot);
18105 - is = ippp_table[lp->ppp_slot];
18106 + printk(KERN_DEBUG "Received CCP frame from peer\n");
18107 isdn_ppp_frame_log("ccp-rcv", skb->data, skb->len, 32, is->unit,lp->ppp_slot);
18110 - int slot = ((isdn_net_local *) (lp->master->priv))->ppp_slot;
18111 - if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
18112 - printk(KERN_ERR "%s: slot(%d) out of range\n",
18113 - __FUNCTION__, slot);
18116 - mis = ippp_table[slot];
18119 + mis = ippp_table[((isdn_net_local *) (lp->master->priv))->ppp_slot];
18123 switch(skb->data[0]) {
18124 @@ -2807,18 +2618,13 @@ static void isdn_ppp_receive_ccp(isdn_ne
18126 static void isdn_ppp_send_ccp(isdn_net_dev *net_dev, isdn_net_local *lp, struct sk_buff *skb)
18128 - struct ippp_struct *mis,*is;
18129 - int proto, slot = lp->ppp_slot;
18130 + struct ippp_struct *mis,*is = ippp_table[lp->ppp_slot];
18132 unsigned char *data;
18134 if(!skb || skb->len < 3)
18136 - if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
18137 - printk(KERN_ERR "%s: lp->ppp_slot(%d) out of range\n",
18138 - __FUNCTION__, slot);
18141 - is = ippp_table[slot];
18143 /* Daemon may send with or without address and control field comp */
18145 if(!(is->pppcfg & SC_COMP_AC) && data[0] == 0xff && data[1] == 0x03) {
18146 @@ -2834,17 +2640,12 @@ static void isdn_ppp_send_ccp(isdn_net_d
18147 printk(KERN_DEBUG "Received CCP frame from daemon:\n");
18148 isdn_ppp_frame_log("ccp-xmit", skb->data, skb->len, 32, is->unit,lp->ppp_slot);
18150 - if (lp->master) {
18151 - slot = ((isdn_net_local *) (lp->master->priv))->ppp_slot;
18152 - if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
18153 - printk(KERN_ERR "%s: slot(%d) out of range\n",
18154 - __FUNCTION__, slot);
18157 - mis = ippp_table[slot];
18162 + mis = ippp_table[((isdn_net_local *) (lp->master->priv))->ppp_slot];
18167 printk(KERN_DEBUG "isdn_ppp: Ouch! Master CCP sends on slave slot!\n");
18170 --- a/drivers/isdn/isdn_ppp.h
18171 +++ b/drivers/isdn/isdn_ppp.h
18173 -/* $Id: isdn_ppp.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
18174 +/* $Id: isdn_ppp.h,v 1.18 2001/09/24 13:22:42 kai Exp $
18176 * header for Linux ISDN subsystem, functions for synchronous PPP (linklevel).
18178 @@ -19,7 +19,6 @@ extern int isdn_ppp_init(void);
18179 extern void isdn_ppp_cleanup(void);
18180 extern int isdn_ppp_free(isdn_net_local *);
18181 extern int isdn_ppp_bind(isdn_net_local *);
18182 -extern int isdn_ppp_autodial_filter(struct sk_buff *, isdn_net_local *);
18183 extern int isdn_ppp_xmit(struct sk_buff *, struct net_device *);
18184 extern void isdn_ppp_receive(isdn_net_dev *, isdn_net_local *, struct sk_buff *);
18185 extern int isdn_ppp_dev_ioctl(struct net_device *, struct ifreq *, int);
18186 --- a/drivers/isdn/isdn_tty.c
18187 +++ b/drivers/isdn/isdn_tty.c
18189 -/* $Id: isdn_tty.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
18190 +/* $Id: isdn_tty.c,v 1.104 2002/02/09 21:19:11 keil Exp $
18192 * Linux ISDN subsystem, tty functions and AT-command emulator (linklevel).
18194 @@ -53,7 +53,7 @@ static int bit2si[8] =
18195 static int si2bit[8] =
18196 {4, 1, 4, 4, 4, 4, 4, 4};
18198 -char *isdn_tty_revision = "$Revision: 1.1.4.1 $";
18199 +char *isdn_tty_revision = "$Revision: 1.104 $";
18202 /* isdn_tty_try_read() is called from within isdn_tty_rcv_skb()
18203 @@ -321,7 +321,10 @@ isdn_tty_tint(modem_info * info)
18204 info->send_outstanding++;
18205 info->msr &= ~UART_MSR_CTS;
18206 info->lsr &= ~UART_LSR_TEMT;
18208 + if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
18209 + tty->ldisc.write_wakeup)
18210 + (tty->ldisc.write_wakeup) (tty);
18211 + wake_up_interruptible(&tty->write_wait);
18215 @@ -1211,7 +1214,10 @@ isdn_tty_write(struct tty_struct *tty, i
18216 /* If DLE decoding results in zero-transmit, but
18217 * c originally was non-zero, do a wakeup.
18220 + if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
18221 + tty->ldisc.write_wakeup)
18222 + (tty->ldisc.write_wakeup) (tty);
18223 + wake_up_interruptible(&tty->write_wait);
18224 info->msr |= UART_MSR_CTS;
18225 info->lsr |= UART_LSR_TEMT;
18227 @@ -1232,6 +1238,7 @@ isdn_tty_write(struct tty_struct *tty, i
18231 +#ifdef ISDN_TTY_FCLASS1
18232 if (TTY_IS_FCLASS1(info)) {
18233 int cc = isdn_tty_handleDLEdown(info, m, c);
18235 @@ -1252,6 +1259,7 @@ isdn_tty_write(struct tty_struct *tty, i
18236 info->xmit_count += cc;
18240 info->xmit_count += c;
18242 info->msr |= UART_MSR_CTS;
18243 @@ -1329,7 +1337,10 @@ isdn_tty_flush_buffer(struct tty_struct
18244 isdn_tty_cleanup_xmit(info);
18245 info->xmit_count = 0;
18246 restore_flags(flags);
18248 + wake_up_interruptible(&tty->write_wait);
18249 + if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
18250 + tty->ldisc.write_wakeup)
18251 + (tty->ldisc.write_wakeup) (tty);
18255 @@ -1858,7 +1869,8 @@ isdn_tty_close(struct tty_struct *tty, s
18256 isdn_tty_shutdown(info);
18257 if (tty->driver.flush_buffer)
18258 tty->driver.flush_buffer(tty);
18259 - tty_ldisc_flush(tty);
18260 + if (tty->ldisc.flush_buffer)
18261 + tty->ldisc.flush_buffer(tty);
18263 info->ncarrier = 0;
18265 @@ -2306,6 +2318,22 @@ isdn_tty_stat_callback(int i, isdn_ctrl
18266 isdn_tty_at_cout("\r\n", info);
18269 + case ISDN_STAT_ALERT:
18270 +#ifdef ISDN_TTY_STAT_DEBUG
18271 + printk(KERN_DEBUG "tty_STAT_ALERT ttyI%d\n", info->line);
18273 + /* Signal RINGING to tty-device if requested */
18274 + if (info->emu.mdmreg[REG_ALERT] & BIT_ALERT)
18275 + isdn_tty_modem_result(RESULT_RINGING, info);
18277 + case ISDN_STAT_PROCEED:
18278 +#ifdef ISDN_TTY_STAT_DEBUG
18279 + printk(KERN_DEBUG "tty_STAT_PROCEED ttyI%d\n", info->line);
18281 + /* Signal PROCEEDING to tty-device if requested */
18282 + if (info->emu.mdmreg[REG_PROCEED] & BIT_PROCEED)
18283 + isdn_tty_modem_result(RESULT_PROCEEDING, info);
18285 case ISDN_STAT_DCONN:
18286 #ifdef ISDN_TTY_STAT_DEBUG
18287 printk(KERN_DEBUG "tty_STAT_DCONN ttyI%d\n", info->line);
18288 @@ -2618,7 +2646,7 @@ isdn_tty_modem_result(int code, modem_in
18289 static char *msg[] =
18290 {"OK", "CONNECT", "RING", "NO CARRIER", "ERROR",
18291 "CONNECT 64000", "NO DIALTONE", "BUSY", "NO ANSWER",
18292 - "RINGING", "NO MSN/EAZ", "VCON", "RUNG"};
18293 + "RINGING", "NO MSN/EAZ", "VCON", "RUNG", "PROCEEDING"};
18295 char s[ISDN_MSNLEN+10];
18297 @@ -2781,7 +2809,8 @@ isdn_tty_modem_result(int code, modem_in
18298 restore_flags(flags);
18301 - tty_ldisc_flush(info->tty);
18302 + if (info->tty->ldisc.flush_buffer)
18303 + info->tty->ldisc.flush_buffer(info->tty);
18304 if ((info->flags & ISDN_ASYNC_CHECK_CD) &&
18305 (!((info->flags & ISDN_ASYNC_CALLOUT_ACTIVE) &&
18306 (info->flags & ISDN_ASYNC_CALLOUT_NOHUP)))) {
18307 @@ -3296,9 +3325,11 @@ isdn_tty_cmd_PLUSF(char **p, modem_info
18308 #ifdef CONFIG_ISDN_TTY_FAX
18309 if (TTY_IS_FCLASS2(info))
18310 sprintf(rs, "\r\n2");
18311 +#ifdef ISDN_TTY_FCLASS1
18312 else if (TTY_IS_FCLASS1(info))
18313 sprintf(rs, "\r\n1");
18316 isdn_tty_at_cout(rs, info);
18319 @@ -3313,6 +3344,7 @@ isdn_tty_cmd_PLUSF(char **p, modem_info
18320 m->mdmreg[REG_PSIZE] * 16;
18322 #ifdef CONFIG_ISDN_TTY_FAX
18323 +#ifdef ISDN_TTY_FCLASS1
18326 if (!(dev->global_features &
18327 @@ -3324,6 +3356,7 @@ isdn_tty_cmd_PLUSF(char **p, modem_info
18329 m->mdmreg[REG_PSIZE] * 16;
18334 if (!(dev->global_features &
18335 @@ -3348,9 +3381,11 @@ isdn_tty_cmd_PLUSF(char **p, modem_info
18337 strcpy(rs, "\r\n0,");
18338 #ifdef CONFIG_ISDN_TTY_FAX
18339 +#ifdef ISDN_TTY_FCLASS1
18340 if (dev->global_features &
18341 ISDN_FEATURE_L3_FCLASS1)
18344 if (dev->global_features &
18345 ISDN_FEATURE_L3_FCLASS2)
18347 --- a/drivers/isdn/isdn_tty.h
18348 +++ b/drivers/isdn/isdn_tty.h
18350 -/* $Id: isdn_tty.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
18351 +/* $Id: isdn_tty.h,v 1.25 2002/02/09 21:19:11 keil Exp $
18353 * header for Linux ISDN subsystem, tty related functions (linklevel).
18356 #define BIT_CPNFCON 2
18359 +#define REG_ALERT 23
18360 +#define BIT_ALERT 8
18361 +#define REG_PROCEED 23
18362 +#define BIT_PROCEED 16
18364 /* defines for result codes */
18365 #define RESULT_OK 0
18366 @@ -93,10 +97,13 @@
18367 #define RESULT_NO_MSN_EAZ 10
18368 #define RESULT_VCON 11
18369 #define RESULT_RUNG 12
18370 +#define RESULT_PROCEEDING 13
18372 +#ifdef ISDN_TTY_FCLASS1
18373 #define TTY_IS_FCLASS1(info) \
18374 ((info->emu.mdmreg[REG_L2PROT] == ISDN_PROTO_L2_FAX) && \
18375 (info->emu.mdmreg[REG_L3PROT] == ISDN_PROTO_L3_FCLASS1))
18377 #define TTY_IS_FCLASS2(info) \
18378 ((info->emu.mdmreg[REG_L2PROT] == ISDN_PROTO_L2_FAX) && \
18379 (info->emu.mdmreg[REG_L3PROT] == ISDN_PROTO_L3_FCLASS2))
18380 --- a/drivers/isdn/isdn_ttyfax.c
18381 +++ b/drivers/isdn/isdn_ttyfax.c
18383 -/* $Id: isdn_ttyfax.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
18384 +/* $Id: isdn_ttyfax.c,v 1.9 2001/09/24 13:22:43 kai Exp $
18386 * Linux ISDN subsystem, tty_fax AT-command emulator (linklevel).
18389 #include "isdn_ttyfax.h"
18392 -static char *isdn_tty_fax_revision = "$Revision: 1.1.4.1 $";
18393 +static char *isdn_tty_fax_revision = "$Revision: 1.9 $";
18395 #define PARSE_ERROR1 { isdn_tty_fax_modem_result(1, info); return 1; }
18397 @@ -148,6 +148,7 @@ isdn_tty_fax_modem_result(int code, mode
18401 +#ifdef ISDN_TTY_FCLASS1
18403 isdn_tty_fax_command1(modem_info * info, isdn_ctrl * c)
18405 @@ -186,6 +187,7 @@ isdn_tty_fax_command1(modem_info * info,
18412 isdn_tty_fax_command(modem_info * info, isdn_ctrl * c)
18413 @@ -193,8 +195,10 @@ isdn_tty_fax_command(modem_info * info,
18414 T30_s *f = info->fax;
18417 +#ifdef ISDN_TTY_FCLASS1
18418 if (TTY_IS_FCLASS1(info))
18419 return (isdn_tty_fax_command1(info, c));
18422 #ifdef ISDN_TTY_FAX_CMD_DEBUG
18423 printk(KERN_DEBUG "isdn_tty: Fax cmd %d on ttyI%d\n",
18424 @@ -312,6 +316,7 @@ isdn_tty_fax_bitorder(modem_info * info,
18428 +#ifdef ISDN_TTY_FCLASS1
18430 * Parse AT+F.. FAX class 1 commands
18432 @@ -403,6 +408,7 @@ isdn_tty_cmd_FCLASS1(char **p, modem_inf
18439 * Parse AT+F.. FAX class 2 commands
18440 @@ -970,6 +976,70 @@ isdn_tty_cmd_FCLASS2(char **p, modem_inf
18445 + /* LO=n - Flow control opts */
18446 + if (!strncmp(p[0], "LO", 2)) { /* TODO */
18451 + sprintf(rs, "\r\n%d", f->lo);
18452 + isdn_tty_at_cout(rs, info);
18456 + if (*p[0] == '?') {
18458 + sprintf(rs, "\r\n0,1,2");
18459 + isdn_tty_at_cout(rs, info);
18461 + par = isdn_getnum(p);
18462 + if ((par < 0) || (par > 2))
18465 +#ifdef ISDN_TTY_FAX_STAT_DEBUG
18466 + printk(KERN_DEBUG "isdn_tty: Fax FLO=%d\n", par);
18477 + /* LPL=n - Doc for polling cmd */
18478 + if (!strncmp(p[0], "LPL", 3)) { /* TODO */
18483 + sprintf(rs, "\r\n%d", f->lpl);
18484 + isdn_tty_at_cout(rs, info);
18488 + if (*p[0] == '?') {
18490 + sprintf(rs, "\r\n0,1");
18491 + isdn_tty_at_cout(rs, info);
18493 + par = isdn_getnum(p);
18494 + if ((par < 0) || (par > 1))
18497 +#ifdef ISDN_TTY_FAX_STAT_DEBUG
18498 + printk(KERN_DEBUG "isdn_tty: Fax FLPL=%d\n", par);
18509 /* MDL? - DCE Model */
18510 if (!strncmp(p[0], "MDL?", 4)) {
18511 @@ -1049,6 +1119,38 @@ isdn_tty_cmd_FCLASS2(char **p, modem_inf
18516 + /* PTS=n - Page transfer status */
18517 + if (!strncmp(p[0], "PTS", 3)) { /* TODO */
18522 + sprintf(rs, "\r\n%d", f->pts);
18523 + isdn_tty_at_cout(rs, info);
18527 + if (*p[0] == '?') {
18529 + sprintf(rs, "\r\n0-5");
18530 + isdn_tty_at_cout(rs, info);
18532 + par = isdn_getnum(p);
18533 + if ((par < 0) || (par > 5))
18536 +#ifdef ISDN_TTY_FAX_STAT_DEBUG
18537 + printk(KERN_DEBUG "isdn_tty: Fax FPTS=%d\n", par);
18548 /* REL=n - Phase C received EOL alignment */
18549 if (!strncmp(p[0], "REL", 3)) {
18550 @@ -1091,6 +1193,38 @@ isdn_tty_cmd_FCLASS2(char **p, modem_inf
18551 isdn_tty_at_cout(rs, info);
18555 + /* SPL=n - Enable polling */
18556 + if (!strncmp(p[0], "SPL", 3)) { /* TODO */
18561 + sprintf(rs, "\r\n%d", f->spl);
18562 + isdn_tty_at_cout(rs, info);
18566 + if (*p[0] == '?') {
18568 + sprintf(rs, "\r\n0,1");
18569 + isdn_tty_at_cout(rs, info);
18571 + par = isdn_getnum(p);
18572 + if ((par < 0) || (par > 1))
18575 +#ifdef ISDN_TTY_FAX_STAT_DEBUG
18576 + printk(KERN_DEBUG "isdn_tty: Fax FSPL=%d\n", par);
18587 /* Phase C Transmit Data Block Size */
18588 if (!strncmp(p[0], "TBC=", 4)) { /* dummy, not used */
18589 @@ -1116,7 +1250,9 @@ isdn_tty_cmd_PLUSF_FAX(char **p, modem_i
18591 if (TTY_IS_FCLASS2(info))
18592 return (isdn_tty_cmd_FCLASS2(p, info));
18593 +#ifdef ISDN_TTY_FCLASS1
18594 else if (TTY_IS_FCLASS1(info))
18595 return (isdn_tty_cmd_FCLASS1(p, info));
18599 --- a/drivers/isdn/isdn_ttyfax.h
18600 +++ b/drivers/isdn/isdn_ttyfax.h
18602 -/* $Id: isdn_ttyfax.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
18603 +/* $Id: isdn_ttyfax.h,v 1.3 2001/09/24 13:22:43 kai Exp $
18605 * header for Linux ISDN subsystem, tty_fax related functions (linklevel).
18607 --- a/drivers/isdn/isdn_v110.c
18608 +++ b/drivers/isdn/isdn_v110.c
18610 -/* $Id: isdn_v110.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
18611 +/* $Id: isdn_v110.c,v 1.8 2001/09/24 13:22:43 kai Exp $
18613 * Linux ISDN subsystem, V.110 related functions (linklevel).
18617 #undef ISDN_V110_DEBUG
18619 -char *isdn_v110_revision = "$Revision: 1.1.4.1 $";
18620 +char *isdn_v110_revision = "$Revision: 1.8 $";
18622 #define V110_38400 255
18623 #define V110_19200 15
18624 @@ -138,6 +138,14 @@ isdn_v110_close(isdn_v110_stream * v)
18626 #ifdef ISDN_V110_DEBUG
18627 printk(KERN_DEBUG "v110 close\n");
18629 + printk(KERN_DEBUG "isdn_v110_close: nbytes=%d\n", v->nbytes);
18630 + printk(KERN_DEBUG "isdn_v110_close: nbits=%d\n", v->nbits);
18631 + printk(KERN_DEBUG "isdn_v110_close: key=%d\n", v->key);
18632 + printk(KERN_DEBUG "isdn_v110_close: SyncInit=%d\n", v->SyncInit);
18633 + printk(KERN_DEBUG "isdn_v110:close: decodelen=%d\n", v->decodelen);
18634 + printk(KERN_DEBUG "isdn_v110_close: framelen=%d\n", v->framelen);
18637 kfree(v->encodebuf);
18639 --- a/drivers/isdn/isdn_v110.h
18640 +++ b/drivers/isdn/isdn_v110.h
18642 -/* $Id: isdn_v110.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
18643 +/* $Id: isdn_v110.h,v 1.5 2001/09/24 13:22:43 kai Exp $
18645 * Linux ISDN subsystem, V.110 related functions (linklevel).
18647 --- a/drivers/isdn/isdn_x25iface.c
18648 +++ b/drivers/isdn/isdn_x25iface.c
18650 -/* $Id: isdn_x25iface.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
18651 +/* $Id: isdn_x25iface.c,v 1.10 2001/09/24 13:22:43 kai Exp $
18653 * Linux ISDN subsystem, X.25 related functions
18655 --- a/drivers/isdn/isdn_x25iface.h
18656 +++ b/drivers/isdn/isdn_x25iface.h
18658 -/* $Id: isdn_x25iface.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
18659 +/* $Id: isdn_x25iface.h,v 1.4 2001/09/24 13:22:43 kai Exp $
18661 * header for Linux ISDN subsystem, x.25 related functions
18663 --- a/drivers/isdn/isdnloop/isdnloop.c
18664 +++ b/drivers/isdn/isdnloop/isdnloop.c
18666 -/* $Id: isdnloop.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
18667 +/* $Id: isdnloop.c,v 1.17 2001/08/30 10:45:42 kai Exp $
18669 * ISDN low-level module implementing a dummy loop driver.
18672 #include <linux/init.h>
18673 #include "isdnloop.h"
18675 -static char *revision = "$Revision: 1.1.4.1 $";
18676 +static char *revision = "$Revision$";
18677 static char *isdnloop_id;
18679 MODULE_DESCRIPTION("ISDN4Linux: Pseudo Driver that simulates an ISDN card");
18680 @@ -22,8 +22,8 @@ MODULE_AUTHOR("Fritz Elfert");
18681 MODULE_LICENSE("GPL");
18682 MODULE_PARM(isdnloop_id, "s");
18683 MODULE_PARM_DESC(isdnloop_id, "ID-String of first card");
18685 -static int isdnloop_addcard(char *);
18687 + static int isdnloop_addcard(char *);
18690 * Free queue completely.
18691 @@ -1542,11 +1542,7 @@ isdnloop_init(void)
18693 strcpy(rev, " ??? ");
18694 printk(KERN_NOTICE "isdnloop-ISDN-driver Rev%s\n", rev);
18697 - return (isdnloop_addcard(isdnloop_id));
18700 + return (isdnloop_addcard(isdnloop_id));
18704 --- a/drivers/isdn/isdnloop/isdnloop.h
18705 +++ b/drivers/isdn/isdnloop/isdnloop.h
18707 -/* $Id: isdnloop.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
18710 * Loopback lowlevel module for testing of linklevel.
18712 --- a/drivers/isdn/pcbit/callbacks.c
18713 +++ b/drivers/isdn/pcbit/callbacks.c
18716 * Copyright (C) 1996 Universidade de Lisboa
18718 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
18719 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
18721 * This software may be used and distributed according to the terms of
18722 * the GNU General Public License, incorporated herein by reference.
18723 --- a/drivers/isdn/pcbit/callbacks.h
18724 +++ b/drivers/isdn/pcbit/callbacks.h
18727 * Copyright (C) 1996 Universidade de Lisboa
18729 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
18730 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
18732 * This software may be used and distributed according to the terms of
18733 * the GNU General Public License, incorporated herein by reference.
18734 --- a/drivers/isdn/pcbit/capi.c
18735 +++ b/drivers/isdn/pcbit/capi.c
18738 * Copyright (C) 1996 Universidade de Lisboa
18740 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
18741 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
18743 * This software may be used and distributed according to the terms of
18744 * the GNU General Public License, incorporated herein by reference.
18745 --- a/drivers/isdn/pcbit/capi.h
18746 +++ b/drivers/isdn/pcbit/capi.h
18749 * Copyright (C) 1996 Universidade de Lisboa
18751 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
18752 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
18754 * This software may be used and distributed according to the terms of
18755 * the GNU General Public License, incorporated herein by reference.
18756 @@ -63,7 +63,8 @@ extern int capi_disc_resp(struct pcbit_c
18757 extern int capi_decode_debug_188(u_char *hdr, ushort hdrlen);
18760 -static inline struct pcbit_chan *
18762 +struct pcbit_chan *
18763 capi_channel(struct pcbit_dev *dev, struct sk_buff *skb)
18766 --- a/drivers/isdn/pcbit/drv.c
18767 +++ b/drivers/isdn/pcbit/drv.c
18770 * Copyright (C) 1996 Universidade de Lisboa
18772 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
18773 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
18775 * This software may be used and distributed according to the terms of
18776 * the GNU General Public License, incorporated herein by reference.
18778 #include <linux/isdnif.h>
18779 #include <asm/string.h>
18780 #include <asm/io.h>
18781 +#ifdef COMPAT_HAS_ISA_IOREMAP
18782 #include <linux/ioport.h>
18787 @@ -89,6 +91,7 @@ int pcbit_init_dev(int board, int mem_ba
18789 if (mem_base >= 0xA0000 && mem_base <= 0xFFFFF ) {
18790 dev->ph_mem = mem_base;
18791 +#ifdef COMPAT_HAS_ISA_IOREMAP
18792 if (check_mem_region(dev->ph_mem, 4096)) {
18793 printk(KERN_WARNING
18794 "PCBIT: memory region %lx-%lx already in use\n",
18795 @@ -100,6 +103,9 @@ int pcbit_init_dev(int board, int mem_ba
18796 request_mem_region(dev->ph_mem, 4096, "PCBIT mem");
18798 dev->sh_mem = (unsigned char*)ioremap(dev->ph_mem, 4096);
18800 + dev->sh_mem = (unsigned char*) mem_base;
18805 @@ -112,8 +118,10 @@ int pcbit_init_dev(int board, int mem_ba
18806 dev->b1 = kmalloc(sizeof(struct pcbit_chan), GFP_KERNEL);
18808 printk("pcbit_init: couldn't malloc pcbit_chan struct\n");
18809 +#ifdef COMPAT_HAS_ISA_IOREMAP
18810 iounmap((unsigned char*)dev->sh_mem);
18811 release_mem_region(dev->ph_mem, 4096);
18816 @@ -122,8 +130,10 @@ int pcbit_init_dev(int board, int mem_ba
18818 printk("pcbit_init: couldn't malloc pcbit_chan struct\n");
18820 +#ifdef COMPAT_HAS_ISA_IOREMAP
18821 iounmap((unsigned char*)dev->sh_mem);
18822 release_mem_region(dev->ph_mem, 4096);
18827 @@ -144,8 +154,10 @@ int pcbit_init_dev(int board, int mem_ba
18831 +#ifdef COMPAT_HAS_ISA_IOREMAP
18832 iounmap((unsigned char*)dev->sh_mem);
18833 release_mem_region(dev->ph_mem, 4096);
18836 dev_pcbit[board] = NULL;
18838 @@ -166,8 +178,10 @@ int pcbit_init_dev(int board, int mem_ba
18839 free_irq(irq, dev);
18842 +#ifdef COMPAT_HAS_ISA_IOREMAP
18843 iounmap((unsigned char*)dev->sh_mem);
18844 release_mem_region(dev->ph_mem, 4096);
18847 dev_pcbit[board] = NULL;
18849 @@ -197,8 +211,10 @@ int pcbit_init_dev(int board, int mem_ba
18850 free_irq(irq, dev);
18853 +#ifdef COMPAT_HAS_ISA_IOREMAP
18854 iounmap((unsigned char*)dev->sh_mem);
18855 release_mem_region(dev->ph_mem, 4096);
18858 dev_pcbit[board] = NULL;
18860 @@ -235,8 +251,10 @@ void pcbit_terminate(int board)
18861 del_timer(&dev->b2->fsm_timer);
18864 +#ifdef COMPAT_HAS_ISA_IOREMAP
18865 iounmap((unsigned char*)dev->sh_mem);
18866 release_mem_region(dev->ph_mem, 4096);
18871 @@ -430,7 +448,7 @@ int pcbit_writecmd(const u_char* buf, in
18872 switch(dev->l2_state) {
18874 /* check (size <= rdp_size); write buf into board */
18875 - if (len < 0 || len > BANK4 + 1)
18876 + if (len > BANK4 + 1)
18878 printk("pcbit_writecmd: invalid length %d\n", len);
18880 @@ -609,6 +627,20 @@ void pcbit_l3_receive(struct pcbit_dev *
18882 dev->b2->s_refnum);
18885 + if (dev->b1->s_refnum == refnum)
18889 + if (dev->b2->s_refnum == refnum)
18893 + printk(KERN_WARNING "Connection Confirm - refnum doesn't match chan\n");
18898 /* We just try to find a channel in the right state */
18900 if (dev->b1->fsm_state == ST_CALL_INIT)
18901 @@ -622,6 +654,7 @@ void pcbit_l3_receive(struct pcbit_dev *
18906 if (capi_decode_conn_conf(chan, skb, &complete)) {
18907 printk(KERN_DEBUG "conn_conf indicates error\n");
18908 pcbit_fsm_event(dev, chan, EV_ERROR, NULL);
18909 --- a/drivers/isdn/pcbit/edss1.c
18910 +++ b/drivers/isdn/pcbit/edss1.c
18913 * Copyright (C) 1996 Universidade de Lisboa
18915 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
18916 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
18918 * This software may be used and distributed according to the terms of
18919 * the GNU General Public License, incorporated herein by reference.
18920 --- a/drivers/isdn/pcbit/edss1.h
18921 +++ b/drivers/isdn/pcbit/edss1.h
18924 * Copyright (C) 1996 Universidade de Lisboa
18926 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
18927 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
18929 * This software may be used and distributed according to the terms of
18930 * the GNU General Public License, incorporated herein by reference.
18931 --- a/drivers/isdn/pcbit/layer2.c
18932 +++ b/drivers/isdn/pcbit/layer2.c
18935 * Copyright (C) 1996 Universidade de Lisboa
18937 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
18938 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
18940 * This software may be used and distributed according to the terms of
18941 * the GNU General Public License, incorporated herein by reference.
18942 @@ -369,11 +369,16 @@ pcbit_receive(struct pcbit_dev *dev)
18944 if (dev->read_frame) {
18945 printk(KERN_DEBUG "pcbit_receive: Type 0 frame and read_frame != NULL\n");
18947 + pcbit_l2_error(dev);
18950 /* discard previous queued frame */
18951 if (dev->read_frame->skb)
18952 kfree_skb(dev->read_frame->skb);
18953 kfree(dev->read_frame);
18954 dev->read_frame = NULL;
18957 frame = kmalloc(sizeof(struct frame_buf), GFP_ATOMIC);
18959 @@ -449,10 +454,14 @@ pcbit_receive(struct pcbit_dev *dev)
18961 if (!(frame = dev->read_frame)) {
18962 printk("Type 1 frame and no frame queued\n");
18964 /* usually after an error: toss frame */
18965 dev->readptr += tt;
18966 if (dev->readptr > dev->sh_mem + BANK2 + BANKLEN)
18967 dev->readptr -= BANKLEN;
18969 + pcbit_l2_error(dev);
18974 --- a/drivers/isdn/pcbit/layer2.h
18975 +++ b/drivers/isdn/pcbit/layer2.h
18978 * Copyright (C) 1996 Universidade de Lisboa
18980 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
18981 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
18983 * This software may be used and distributed according to the terms of
18984 * the GNU General Public License, incorporated herein by reference.
18985 --- a/drivers/isdn/pcbit/module.c
18986 +++ b/drivers/isdn/pcbit/module.c
18989 * Copyright (C) 1996 Universidade de Lisboa
18991 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
18992 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
18994 * This software may be used and distributed according to the terms of
18995 * the GNU General Public License, incorporated herein by reference.
18996 @@ -92,6 +92,7 @@ static void __exit pcbit_exit(void)
19000 +#ifdef COMPAT_HAS_NEW_SETUP
19001 #define MAX_PARA (MAX_PCBIT_CARDS * 2)
19002 static int __init pcbit_setup(char *line)
19004 @@ -100,6 +101,11 @@ static int __init pcbit_setup(char *line
19005 int ints[MAX_PARA+1];
19007 str = get_options(line, MAX_PARA, ints);
19009 +void pcbit_setup(char *str, int *ints)
19016 @@ -118,9 +124,13 @@ static int __init pcbit_setup(char *line
19020 +#ifdef COMPAT_HAS_NEW_SETUP
19023 __setup("pcbit=", pcbit_setup);
19029 module_init(pcbit_init);
19030 --- a/drivers/isdn/pcbit/pcbit.h
19031 +++ b/drivers/isdn/pcbit/pcbit.h
19034 * Copyright (C) 1996 Universidade de Lisboa
19036 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19037 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
19039 * This software may be used and distributed according to the terms of
19040 * the GNU General Public License, incorporated herein by reference.
19041 --- a/drivers/isdn/sc/card.h
19042 +++ b/drivers/isdn/sc/card.h
19044 -/* $Id: card.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19047 * Driver parameters for SpellCaster ISA ISDN adapters
19049 --- a/drivers/isdn/sc/command.c
19050 +++ b/drivers/isdn/sc/command.c
19052 -/* $Id: command.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19055 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19057 @@ -95,7 +95,7 @@ int get_card_from_id(int driver)
19058 if(adapter[i]->driverId == driver)
19066 --- a/drivers/isdn/sc/debug.c
19067 +++ b/drivers/isdn/sc/debug.c
19069 -/* $Id: debug.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19072 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19074 --- a/drivers/isdn/sc/debug.h
19075 +++ b/drivers/isdn/sc/debug.h
19077 -/* $Id: debug.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19080 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19082 --- a/drivers/isdn/sc/event.c
19083 +++ b/drivers/isdn/sc/event.c
19085 -/* $Id: event.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19088 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19090 --- a/drivers/isdn/sc/init.c
19091 +++ b/drivers/isdn/sc/init.c
19092 @@ -514,6 +514,15 @@ int identify_board(unsigned long rambase
19093 schedule_timeout(HZ);
19094 sig = readl(rambase + SIG_OFFSET);
19095 pr_debug("Looking for a signature, got 0x%x\n", sig);
19099 + * If it's a timing problem, it should be gone with the above schedule()
19100 + * Another possible reason may be the missing volatile in the original
19101 + * code. readl() does this for us.
19103 + printk(""); /* Hack! Doesn't work without this !!!??? */
19105 if(sig == SIGNATURE)
19108 @@ -525,6 +534,9 @@ int identify_board(unsigned long rambase
19109 schedule_timeout(HZ);
19110 sig = readl(rambase + SIG_OFFSET);
19111 pr_debug("Looking for a signature, got 0x%x\n", sig);
19113 + printk(""); /* Hack! Doesn't work without this !!!??? */
19115 if(sig == SIGNATURE)
19118 --- a/drivers/isdn/sc/interrupt.c
19119 +++ b/drivers/isdn/sc/interrupt.c
19121 -/* $Id: interrupt.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19124 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19126 --- a/drivers/isdn/sc/ioctl.c
19127 +++ b/drivers/isdn/sc/ioctl.c
19128 @@ -23,6 +23,9 @@ extern int send_and_receive(int, unsigne
19130 extern board *adapter[];
19133 +static char *ChannelStates[] = { "Idle", "Ready", "Connecting", "Connected", "Disconnecting" };
19136 int GetStatus(int card, boardInfo *);
19138 --- a/drivers/isdn/sc/message.c
19139 +++ b/drivers/isdn/sc/message.c
19141 -/* $Id: message.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19144 * functions for sending and receiving control messages
19146 --- a/drivers/isdn/sc/message.h
19147 +++ b/drivers/isdn/sc/message.h
19149 -/* $Id: message.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19152 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19154 --- a/drivers/isdn/sc/packet.c
19155 +++ b/drivers/isdn/sc/packet.c
19157 -/* $Id: packet.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19160 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19162 --- a/drivers/isdn/sc/shmem.c
19163 +++ b/drivers/isdn/sc/shmem.c
19165 -/* $Id: shmem.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19168 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19170 --- a/drivers/isdn/sc/timer.c
19171 +++ b/drivers/isdn/sc/timer.c
19173 -/* $Id: timer.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19176 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19178 --- a/drivers/isdn/tpam/tpam.h
19179 +++ b/drivers/isdn/tpam/tpam.h
19181 -/* $Id: tpam.h,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
19182 +/* $Id: tpam.h,v 1.3 2001/09/24 13:23:12 kai Exp $
19184 * Turbo PAM ISDN driver for Linux. (Kernel Driver)
19186 --- a/drivers/isdn/tpam/tpam_commands.c
19187 +++ b/drivers/isdn/tpam/tpam_commands.c
19189 -/* $Id: tpam_commands.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
19190 +/* $Id: tpam_commands.c,v 1.3 2001/09/24 13:23:12 kai Exp $
19192 * Turbo PAM ISDN driver for Linux. (Kernel Driver - ISDN commands)
19194 --- a/drivers/isdn/tpam/tpam_crcpc.c
19195 +++ b/drivers/isdn/tpam/tpam_crcpc.c
19197 -/* $Id: tpam_crcpc.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
19200 * Turbo PAM ISDN driver for Linux. (Kernel Driver - CRC encoding)
19202 --- a/drivers/isdn/tpam/tpam_hdlc.c
19203 +++ b/drivers/isdn/tpam/tpam_hdlc.c
19205 -/* $Id: tpam_hdlc.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
19206 +/* $Id: tpam_hdlc.c,v 1.3 2001/09/24 13:23:12 kai Exp $
19208 * Turbo PAM ISDN driver for Linux. (Kernel Driver - HDLC encoding)
19210 --- a/drivers/isdn/tpam/tpam_main.c
19211 +++ b/drivers/isdn/tpam/tpam_main.c
19213 -/* $Id: tpam_main.c,v 1.1.2.2 2001/12/09 18:45:14 kai Exp $
19216 * Turbo PAM ISDN driver for Linux. (Kernel Driver - main routines)
19218 @@ -254,7 +254,7 @@ static struct pci_driver tpam_driver = {
19220 id_table: tpam_pci_tbl,
19222 - remove: __devexit_p(tpam_remove),
19223 + remove: tpam_remove,
19226 static int __init tpam_init(void) {
19227 --- a/drivers/isdn/tpam/tpam_memory.c
19228 +++ b/drivers/isdn/tpam/tpam_memory.c
19230 -/* $Id: tpam_memory.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
19233 * Turbo PAM ISDN driver for Linux. (Kernel Driver - Board Memory Access)
19235 --- a/drivers/isdn/tpam/tpam_nco.c
19236 +++ b/drivers/isdn/tpam/tpam_nco.c
19238 -/* $Id: tpam_nco.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
19241 * Turbo PAM ISDN driver for Linux.
19242 * (Kernel Driver - Low Level NCO Manipulation)
19243 --- a/drivers/isdn/tpam/tpam_queues.c
19244 +++ b/drivers/isdn/tpam/tpam_queues.c
19246 -/* $Id: tpam_queues.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
19249 * Turbo PAM ISDN driver for Linux. (Kernel Driver)
19251 @@ -146,7 +146,6 @@ void tpam_irq(int irq, void *dev_id, str
19253 hpic = readl(card->bar0 + TPAM_HPIC_REGISTER);
19254 if (waiting_too_long++ > 0xfffffff) {
19256 spin_unlock(&card->lock);
19257 printk(KERN_ERR "TurboPAM(tpam_irq): "
19258 "waiting too long...\n");
19259 --- a/include/linux/b1lli.h
19260 +++ b/include/linux/b1lli.h
19262 -/* $Id: b1lli.h,v 1.8.8.3 2001/09/23 22:25:05 kai Exp $
19265 * ISDN lowlevel-module for AVM B1-card.
19267 --- a/include/linux/b1pcmcia.h
19268 +++ b/include/linux/b1pcmcia.h
19270 -/* $Id: b1pcmcia.h,v 1.1.8.2 2001/09/23 22:25:05 kai Exp $
19273 * Exported functions of module b1pcmcia to be called by
19274 * avm_cs card services module.
19275 --- a/include/linux/capi.h
19276 +++ b/include/linux/capi.h
19278 -/* $Id: capi.h,v 1.1.4.1 2001/11/20 14:19:38 kai Exp $
19281 * CAPI 2.0 Interface for Linux
19283 --- a/include/linux/concap.h
19284 +++ b/include/linux/concap.h
19286 -/* $Id: concap.h,v 1.2.8.1 2001/09/23 22:25:05 kai Exp $
19287 +/* $Id: concap.h,v 1.3 2001/09/24 13:23:13 kai Exp $
19289 * Copyright 1997 by Henner Eisen <eis@baty.hanse.de>
19293 #include <linux/skbuff.h>
19294 #include <linux/netdevice.h>
19295 +#include <linux/isdn_compat.h>
19297 /* Stuff to support encapsulation protocols genericly. The encapsulation
19298 protocol is processed at the uppermost layer of the network interface.
19299 --- a/include/linux/hysdn_if.h
19300 +++ b/include/linux/hysdn_if.h
19302 -/* $Id: hysdn_if.h,v 1.1.8.3 2001/09/23 22:25:05 kai Exp $
19305 * Linux driver for HYSDN cards
19306 * ioctl definitions shared by hynetmgr and driver.
19307 --- a/include/linux/isdn/tpam.h
19308 +++ b/include/linux/isdn/tpam.h
19310 -/* $Id: tpam.h,v 1.1.2.1 2001/11/20 14:19:38 kai Exp $
19313 * Turbo PAM ISDN driver for Linux. (Kernel Driver)
19315 --- a/include/linux/isdn.h
19316 +++ b/include/linux/isdn.h
19318 -/* $Id: isdn.h,v 1.1.4.1 2001/11/20 14:19:38 kai Exp $
19319 +/* $Id: isdn.h,v 1.125 2001/12/01 23:18:21 detabc Exp $
19321 * Main header for the Linux ISDN subsystem (linklevel).
19327 +#include <linux/isdn_compat.h>
19328 #include <linux/ioctl.h>
19330 #ifdef CONFIG_COBALT_MICRO_SERVER
19332 #define ISDN_LMSNLEN 255 /* Length of tty's Listen-MSN string */
19333 #define ISDN_CMSGLEN 50 /* Length of CONNECT-Message to add for Modem */
19335 +#ifdef BIG_PHONE_NUMBERS
19336 #define ISDN_MSNLEN 32
19337 #define NET_DV 0x06 /* Data version for isdn_net_ioctl_cfg */
19338 #define TTY_DV 0x06 /* Data version for iprofd etc. */
19340 +#define ISDN_MSNLEN 20
19341 +#define NET_DV 0x05 /* Data version for isdn_net_ioctl_cfg */
19342 +#define TTY_DV 0x05 /* Data version for iprofd etc. */
19345 #define INF_DV 0x01 /* Data version for /dev/isdninfo */
19347 @@ -187,6 +194,61 @@ typedef struct {
19348 #define ISDN_MINOR_PPPMAX (128 + (ISDN_MAX_CHANNELS-1))
19349 #define ISDN_MINOR_STATUS 255
19351 +#ifndef CONFIG_ISDN_WITH_ABC
19352 +#undef CONFIG_ISDN_WITH_ABC_CALLB
19353 +#undef CONFIG_ISDN_WITH_ABC_UDP_CHECK
19354 +#undef CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP
19355 +#undef CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL
19356 +#undef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
19357 +#undef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
19358 +#undef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
19359 +#undef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
19360 +#undef CONFIG_ISDN_WITH_ABC_CONN_ERROR
19361 +#undef CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS
19362 +#else /* CONFIG_ISDN_WITH_ABC */
19363 +#include <linux/isdn_dwabc.h>
19366 +typedef struct DWABCJIFFIES {
19368 + u_long msec_1000;
19377 +#ifdef CONFIG_ISDN_WITH_ABC_NEED_DWSJIFFIES
19378 +DWABCJIFFIES isdn_dwabc_jiffies;
19380 +extern DWABCJIFFIES isdn_dwabc_jiffies;
19382 +#define dwsjiffies (isdn_dwabc_jiffies.msec_1000)
19384 +#define ISDN_DW_ABC_FLAG_UNUSED00001 0x00000001L
19385 +#define ISDN_DW_ABC_FLAG_NO_UDP_CHECK 0x00000002L
19386 +#define ISDN_DW_ABC_FLAG_NO_UDP_HANGUP 0x00000004L
19387 +#define ISDN_DW_ABC_FLAG_NO_UDP_DIAL 0x00000008L
19388 +#define ISDN_DW_ABC_FLAG_UNUSED00010 0x00000010L
19389 +#define ISDN_DW_ABC_FLAG_RCV_NO_HUPTIMER 0x00000020L
19390 +#define ISDN_DW_ABC_FLAG_NO_CH_EXTINUSE 0x00000040L
19391 +#define ISDN_DW_ABC_FLAG_NO_CONN_ERROR 0x00000080L
19392 +#define ISDN_DW_ABC_FLAG_BSD_COMPRESS 0x00000100L
19393 +#define ISDN_DW_ABC_FLAG_NO_LCR 0x00000200L
19394 +#define ISDN_DW_ABC_FLAG_LEASED_LINE 0x00001000L
19396 +#define ISDN_DW_ABC_IFFLAG_NODCHAN 0x00000001L
19397 +#define ISDN_DW_ABC_IFFLAG_BSDAKTIV 0x00000002L
19399 +#define ISDN_DW_ABC_BITLOCK_SEND 0
19400 +#define ISDN_DW_ABC_BITLOCK_RECEIVE 1
19402 +#endif /* CONFIG_ISDN_WITH_ABC */
19406 #ifdef CONFIG_ISDN_PPP
19408 #ifdef CONFIG_ISDN_PPP_VJ
19409 @@ -204,9 +266,11 @@ typedef struct {
19410 # include <linux/concap.h>
19413 +#ifdef HAVE_DEVFS_FS
19414 #ifdef CONFIG_DEVFS_FS
19415 # include <linux/devfs_fs_kernel.h>
19417 +#endif /* HAVE_DEVFS_FS */
19419 #include <linux/isdnif.h>
19421 @@ -272,6 +336,12 @@ typedef struct {
19422 #define ISDN_NET_CALLBACK 0x04 /* activate callback */
19423 #define ISDN_NET_CBHUP 0x08 /* hangup before callback */
19424 #define ISDN_NET_CBOUT 0x10 /* remote machine does callback */
19427 +#define ISDN_NET_CLONE 0x08 /* clone a tmp interface when called */
19428 +#define ISDN_NET_TMP 0x10 /* tmp interface until getting an IP */
19429 +#define ISDN_NET_DYNAMIC 0x20 /* this link is dynamically allocated */
19432 #define ISDN_NET_MAGIC 0x49344C02 /* for paranoia-checking */
19434 @@ -386,6 +456,38 @@ typedef struct isdn_net_local_s {
19435 char cisco_debserint; /* debugging flag of cisco hdlc with slarp */
19436 struct timer_list cisco_timer;
19437 struct tq_struct tqueue;
19438 +#ifdef CONFIG_ISDN_WITH_ABC
19439 + ulong dw_abc_flags;
19440 + ulong dw_abc_if_flags;
19441 + int dw_abc_inuse_secure;
19442 + ulong dw_abc_dialstart;
19443 + int dw_abc_old_onhtime;
19444 + int dw_abc_remote_version;
19445 + int dw_abc_bitlocks;
19446 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
19447 + char dw_out_msn[ISDN_MSNLEN]; /* eaz for outgoing call if *out_msn != 0 */
19449 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
19450 + ulong dw_abc_lcr_callid;
19451 + ulong dw_abc_lcr_start_request;
19452 + ulong dw_abc_lcr_end_request;
19453 + isdn_ctrl *dw_abc_lcr_cmd;
19454 + struct ISDN_DWABC_LCR_IOCTL *dw_abc_lcr_io;
19456 + ulong dw_abc_bchan_last_connect;
19457 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
19458 + short dw_abc_bchan_errcnt;
19460 +#ifdef CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS
19461 + void *dw_abc_bsd_compressor;
19462 + void *dw_abc_bsd_stat_rx;
19463 + void *dw_abc_bsd_stat_tx;
19465 + ulong dw_abc_bsd_snd;
19466 + ulong dw_abc_bsd_bsd_snd;
19467 + ulong dw_abc_bsd_rcv;
19468 + ulong dw_abc_bsd_bsd_rcv;
19472 /* the interface itself */
19473 @@ -608,12 +710,13 @@ typedef struct isdn_devt {
19474 int tflags; /* Timer-Flags: */
19475 /* see ISDN_TIMER_..defines */
19477 - infostruct *infochain; /* List of open info-devs. */
19478 - wait_queue_head_t info_waitq; /* Wait-Queue for isdninfo */
19479 struct timer_list timer; /* Misc.-function Timer */
19480 int chanmap[ISDN_MAX_CHANNELS];/* Map minor->device-channel */
19481 int drvmap[ISDN_MAX_CHANNELS]; /* Map minor->driver-index */
19482 int usage[ISDN_MAX_CHANNELS]; /* Used by tty/ip/voice */
19483 +#ifdef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
19484 + ulong dwabc_chan_external_inuse[ISDN_MAX_CHANNELS];
19486 char num[ISDN_MAX_CHANNELS][ISDN_MSNLEN];
19487 /* Remote number of active ch.*/
19488 int m_idx[ISDN_MAX_CHANNELS]; /* Index for mdm.... */
19489 @@ -631,6 +734,7 @@ typedef struct isdn_devt {
19490 isdn_v110_stream *v110[ISDN_MAX_CHANNELS]; /* V.110 private data */
19491 struct semaphore sem; /* serialize list access*/
19492 unsigned long global_features;
19493 +#ifdef HAVE_DEVFS_FS
19494 #ifdef CONFIG_DEVFS_FS
19495 devfs_handle_t devfs_handle_isdninfo;
19496 devfs_handle_t devfs_handle_isdnctrl;
19497 @@ -640,10 +744,41 @@ typedef struct isdn_devt {
19498 devfs_handle_t devfs_handle_ipppX[ISDN_MAX_CHANNELS];
19500 #endif /* CONFIG_DEVFS_FS */
19501 +#endif /* HAVE_DEVFS_FS */
19504 extern isdn_dev *dev;
19506 +#ifdef CONFIG_ISDN_WITH_ABC
19507 +extern int isdn_auto_dial_helper(isdn_net_local *,struct sk_buff *,int);
19508 +extern void dwisdn_nfw_send(isdn_net_local *lp,int drop_only);
19509 +extern void isdn_net_unreachable(struct net_device *,struct sk_buff *,char *);
19510 +extern void isdn_net_log_skb_dwabc(struct sk_buff *,isdn_net_local *,char *);
19511 +extern void isdn_net_hangup(struct net_device *d);
19512 +extern void isdn_dw_clear_if(ulong pm,isdn_net_local *);
19513 +extern void isdn_dwabc_test_phone(isdn_net_local *);
19514 +extern void isdn_dw_abc_init_func(void);
19515 +extern void isdn_dw_abc_release_func(void);
19516 +extern int isdn_dw_abc_reset_interface(isdn_net_local *,int);
19517 +extern int dwabc_bsd_init(isdn_net_local *lp);
19518 +extern void dwabc_bsd_free(isdn_net_local *lp);
19519 +extern struct sk_buff *dwabc_bsd_compress(isdn_net_local *,struct sk_buff *,struct net_device *);
19520 +extern void dwabc_bsd_first_gen(isdn_net_local *);
19521 +extern struct sk_buff *dwabc_bsd_rx_pkt(isdn_net_local *,struct sk_buff *,struct net_device *);
19522 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
19523 +extern size_t isdn_dw_abc_lcr_readstat(char *,size_t);
19524 +extern ulong isdn_dw_abc_lcr_call_number(isdn_net_local *,isdn_ctrl *);
19525 +extern void isdn_dw_abc_lcr_open(void);
19526 +extern void isdn_dw_abc_lcr_close(void);
19527 +extern int isdn_dw_abc_lcr_ioctl(ulong);
19528 +extern void isdn_dw_abc_lcr_clear(isdn_net_local *);
19529 +extern int isdn_dw_abc_lcr_lock(void);
19530 +extern void isdn_dw_abc_lcr_ulock(void);
19532 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK
19533 +extern int dw_abc_udp_test(struct sk_buff *skb,struct net_device *ndev);
19537 #endif /* __KERNEL__ */
19540 +++ b/include/linux/isdn_compat.h
19542 +/* $Id: isdn_compat.h,v 1.53 2001/09/24 13:23:13 kai Exp $
19544 + * Linux ISDN subsystem
19545 + * Compatibility for various Linux kernel versions
19547 + * This software may be used and distributed according to the terms
19548 + * of the GNU General Public License, incorporated herein by reference.
19552 +#ifndef _LINUX_ISDN_COMPAT_H
19553 +#define _LINUX_ISDN_COMPAT_H
19557 +#ifndef ISDN_COMPAT_NOT_GENERIC
19558 +/* when using std2kern -u, this part is left out and instead provided
19559 + by the .ctrl files */
19561 +#include <linux/version.h>
19563 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)
19565 +#define set_current_state(sta) (current->state = sta)
19566 +#define module_init(x) int init_module(void) { return x(); }
19567 +#define module_exit(x) void cleanup_module(void) { x(); }
19568 +#define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); *(int *)0 = 0; } while (0)
19569 +#define init_MUTEX(x) *(x)=MUTEX
19570 +#define init_MUTEX_LOCKED(x) *(x)=MUTEX_LOCKED
19572 +#define __devinitdata
19574 +#else /* 2.2.18 and later */
19576 +#define COMPAT_HAS_NEW_SETUP
19577 +#define COMPAT_HAS_NEW_WAITQ
19581 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
19583 +#define dev_kfree_skb_irq(a) dev_kfree_skb(a)
19584 +#define dev_kfree_skb_any(a) dev_kfree_skb(a)
19585 +#define COMPAT_HAS_2_2_PCI
19586 +#define get_pcibase(ps, nr) ps->base_address[nr]
19587 +#define pci_resource_start_io(pdev, nr) ((pdev)->base_address[nr] & PCI_BASE_ADDRESS_IO_MASK)
19588 +#define pci_resource_start_mem(pdev, nr) ((pdev)->base_address[nr] & PCI_BASE_ADDRESS_MEM_MASK)
19589 +#define pci_get_sub_vendor(pdev, id) pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, &id)
19590 +#define pci_get_sub_system(pdev, id) pci_read_config_word(pdev, PCI_SUBSYSTEM_ID, &id)
19594 +#define __devinitdata
19596 +#define net_device device
19597 +#define COMPAT_NO_SOFTNET
19598 +#define netif_running(d) test_bit(LINK_STATE_START, &d->state)
19599 +#define COMPAT_NEED_MPPP_DEFS
19600 +#define spin_lock_bh(lock)
19601 +#define spin_unlock_bh(lock)
19602 +#define COMPAT_NEED_SPIN_LOCK_BH
19603 +#define i_count_read(ic) ic
19604 +#define i_count_inc(ic) ic++
19605 +#define COMPAT_USE_MODCOUNT_LOCK
19606 +#define devfs_register_chrdev(m,n,f) register_chrdev(m,n,f)
19607 +#define devfs_unregister_chrdev(m,n) unregister_chrdev(m,n)
19608 +#define COMPAT_NEED_PCI_IDS
19609 +#define in_irq() (local_irq_count[smp_processor_id()] != 0)
19611 +#else /* 2.4.0 and later */
19613 +#define pci_resource_start_io(pdev, nr) pci_resource_start(pdev, nr)
19614 +#define pci_resource_start_mem(pdev, nr) pci_resource_start(pdev, nr)
19615 +#define get_pcibase(ps, nr) ps->resource[nr].start
19616 +#define pci_get_sub_system(pdev, id) id = pdev->subsystem_device
19617 +#define pci_get_sub_vendor(pdev, id) id = pdev->subsystem_vendor
19619 +#define BIG_PHONE_NUMBERS
19620 +#define COMPAT_HAS_ISA_IOREMAP
19621 +#define i_count_read(ic) atomic_read(&ic)
19622 +#define i_count_inc(ic) atomic_inc(&ic)
19623 +#define COMPAT_HAS_FILEOP_OWNER
19624 +#define COMPAT_HAVE_NEW_FILLDIR
19625 +#define COMPAT_has_fileops_in_inode
19626 +#define COMPAT_HAS_init_special_inode
19627 +#define COMPAT_d_alloc_root_one_parameter
19628 +#define HAVE_DEVFS_FS
19629 +#define COMPAT_HAS_SCHEDULE_TASK
19630 +#define COMPAT_HAS_USB_IDTAB
19634 +#endif /* ISDN_COMPAT_GENERIC */
19636 +#ifdef COMPAT_HAS_2_2_PCI
19637 +#include <linux/pci.h>
19638 +#ifdef __powerpc__
19639 +static inline int pci_enable_device(struct pci_dev *dev)
19642 + pci_read_config_word(dev, PCI_COMMAND, &cmd);
19643 + cmd |= PCI_COMMAND_MEMORY | PCI_COMMAND_IO | PCI_COMMAND_SERR;
19644 + cmd &= ~PCI_COMMAND_FAST_BACK;
19645 + pci_write_config_word(dev, PCI_COMMAND, cmd);
19649 +static inline int pci_enable_device(struct pci_dev *dev)
19653 +#endif /* __powerpc__ */
19655 +#define PCI_ANY_ID (~0)
19657 +/* as this is included multiple times, we make it inline */
19659 +static inline struct pci_dev * pci_find_subsys(unsigned int vendor, unsigned int device,
19660 + unsigned int ss_vendor, unsigned int ss_device,
19661 + struct pci_dev *from)
19663 + unsigned short subsystem_vendor, subsystem_device;
19665 + while ((from = pci_find_device(vendor, device, from))) {
19666 + pci_read_config_word(from, PCI_SUBSYSTEM_VENDOR_ID, &subsystem_vendor);
19667 + pci_read_config_word(from, PCI_SUBSYSTEM_ID, &subsystem_device);
19668 + if ((ss_vendor == PCI_ANY_ID || subsystem_vendor == ss_vendor) &&
19669 + (ss_device == PCI_ANY_ID || subsystem_device == ss_device))
19676 +#ifdef COMPAT_NO_SOFTNET
19677 +#include <linux/netdevice.h>
19680 + * Tell upper layers that the network device is ready to xmit more frames.
19682 +static void __inline__ netif_wake_queue(struct net_device * dev)
19689 + * called during net_device open()
19691 +static void __inline__ netif_start_queue(struct net_device * dev)
19694 + /* actually, we never use the interrupt flag at all */
19695 + dev->interrupt = 0;
19700 + * Ask upper layers to temporarily cease passing us more xmit frames.
19702 +static void __inline__ netif_stop_queue(struct net_device * dev)
19707 +#endif /* COMPAT_NO_SOFTNET */
19709 +#ifndef COMPAT_HAS_NEW_WAITQ
19710 +typedef struct wait_queue wait_queue_t;
19711 +typedef struct wait_queue *wait_queue_head_t;
19713 +#define DECLARE_WAITQUEUE(wait, current) struct wait_queue wait = { current, NULL }
19714 +#define DECLARE_WAIT_QUEUE_HEAD(wait) wait_queue_head_t wait
19715 +#define init_waitqueue_head(x) *(x)=NULL
19716 +#define init_waitqueue_entry(q,p) ((q)->task)=(p)
19717 +#endif /* COMPAT_HAS_NEW_WAITQ */
19719 +#ifdef COMPAT_NEED_PCI_IDS
19721 +#define PCI_ANY_ID (~0)
19723 +#define PCI_VENDOR_ID_DYNALINK 0x0675
19724 +#define PCI_DEVICE_ID_DYNALINK_IS64PH 0x1702
19726 +#define PCI_DEVICE_ID_WINBOND2_6692 0x6692
19728 +#define PCI_DEVICE_ID_PLX_R685 0x1030
19729 +#define PCI_DEVICE_ID_PLX_DJINN_ITOO 0x1151
19730 +#define PCI_DEVICE_ID_PLX_R753 0x1152
19732 +#define PCI_VENDOR_ID_ELSA 0x1048
19733 +#define PCI_DEVICE_ID_ELSA_MICROLINK 0x1000
19734 +#define PCI_DEVICE_ID_ELSA_QS3000 0x3000
19736 +#define PCI_VENDOR_ID_EICON 0x1133
19737 +#define PCI_DEVICE_ID_EICON_DIVA20PRO 0xe001
19738 +#define PCI_DEVICE_ID_EICON_DIVA20 0xe002
19739 +#define PCI_DEVICE_ID_EICON_DIVA20PRO_U 0xe003
19740 +#define PCI_DEVICE_ID_EICON_DIVA20_U 0xe004
19741 +#define PCI_DEVICE_ID_EICON_DIVA201 0xe005
19742 +#define PCI_DEVICE_ID_EICON_MAESTRA 0xe010
19743 +#define PCI_DEVICE_ID_EICON_MAESTRAQ 0xe012
19744 +#define PCI_DEVICE_ID_EICON_MAESTRAQ_U 0xe013
19745 +#define PCI_DEVICE_ID_EICON_MAESTRAP 0xe014
19747 +#define PCI_VENDOR_ID_CCD 0x1397
19748 +#define PCI_DEVICE_ID_CCD_2BD0 0x2BD0
19749 +#define PCI_DEVICE_ID_CCD_B000 0xB000
19750 +#define PCI_DEVICE_ID_CCD_B006 0xB006
19751 +#define PCI_DEVICE_ID_CCD_B007 0xB007
19752 +#define PCI_DEVICE_ID_CCD_B008 0xB008
19753 +#define PCI_DEVICE_ID_CCD_B009 0xB009
19754 +#define PCI_DEVICE_ID_CCD_B00A 0xB00A
19755 +#define PCI_DEVICE_ID_CCD_B00B 0xB00B
19756 +#define PCI_DEVICE_ID_CCD_B00C 0xB00C
19757 +#define PCI_DEVICE_ID_CCD_B100 0xB100
19759 +#define PCI_VENDOR_ID_ASUSTEK 0x1043
19760 +#define PCI_DEVICE_ID_ASUSTEK_0675 0x0675
19762 +#define PCI_VENDOR_ID_BERKOM 0x0871
19763 +#define PCI_DEVICE_ID_BERKOM_A1T 0xFFA1
19764 +#define PCI_DEVICE_ID_BERKOM_T_CONCEPT 0xFFA2
19765 +#define PCI_DEVICE_ID_BERKOM_A4T 0xFFA4
19766 +#define PCI_DEVICE_ID_BERKOM_SCITEL_QUADRO 0xFFA8
19768 +#define PCI_DEVICE_ID_SATSAGEM_NICCY 0x1016
19770 +#define PCI_DEVICE_ID_TIGERJET_100 0x0002
19772 +#define PCI_VENDOR_ID_ANIGMA 0x1051
19773 +#define PCI_DEVICE_ID_ANIGMA_MC145575 0x0100
19775 +#define PCI_VENDOR_ID_ZOLTRIX 0x15b0
19776 +#define PCI_DEVICE_ID_ZOLTRIX_2BD0 0x2BD0
19778 +#define PCI_DEVICE_ID_DIGI_DF_M_IOM2_E 0x0070
19779 +#define PCI_DEVICE_ID_DIGI_DF_M_E 0x0071
19780 +#define PCI_DEVICE_ID_DIGI_DF_M_IOM2_A 0x0072
19781 +#define PCI_DEVICE_ID_DIGI_DF_M_A 0x0073
19783 +#define PCI_DEVICE_ID_AVM_B1 0x0700
19784 +#define PCI_DEVICE_ID_AVM_C4 0x0800
19785 +#define PCI_DEVICE_ID_AVM_C2 0x1100
19786 +#define PCI_DEVICE_ID_AVM_T1 0x1200
19788 +#define PCI_VENDOR_ID_HYPERCOPE 0x1365
19789 +#define PCI_DEVICE_ID_HYPERCOPE_PLX 0x9050
19790 +#define PCI_SUBDEVICE_ID_HYPERCOPE_OLD_ERGO 0x0104
19791 +#define PCI_SUBDEVICE_ID_HYPERCOPE_ERGO 0x0106
19792 +#define PCI_SUBDEVICE_ID_HYPERCOPE_METRO 0x0107
19793 +#define PCI_SUBDEVICE_ID_HYPERCOPE_CHAMP2 0x0108
19794 +#define PCI_SUBDEVICE_ID_HYPERCOPE_PLEXUS 0x0109
19796 +#define PCI_VENDOR_ID_ABOCOM 0x13D1
19797 +#define PCI_DEVICE_ID_ABOCOM_2BD1 0x2BD1
19799 +#endif /* COMPAT_NEED_PCI_IDS */
19801 +#endif /* __KERNEL__ */
19802 +#endif /* _LINUX_ISDN_COMPAT_H */
19803 --- a/include/linux/isdn_divertif.h
19804 +++ b/include/linux/isdn_divertif.h
19806 -/* $Id: isdn_divertif.h,v 1.1.4.1 2001/11/20 14:19:38 kai Exp $
19809 * Header for the diversion supplementary interface for i4l.
19812 /***********************************************************/
19813 /* magic value is also used to control version information */
19814 /***********************************************************/
19815 -#define DIVERT_IF_MAGIC 0x25873401
19816 +#define DIVERT_IF_MAGIC 0x25873402
19817 #define DIVERT_CMD_REG 0x00 /* register command */
19818 #define DIVERT_CMD_REL 0x01 /* release command */
19819 #define DIVERT_NO_ERR 0x00 /* return value no error */
19820 @@ -34,6 +34,7 @@ typedef struct
19821 int (*ll_cmd)(isdn_ctrl *); /* supplied by hl on return */
19822 char * (*drv_to_name)(int); /* map a driver id to name, supplied by hl */
19823 int (*name_to_drv)(char *); /* map a driver id to name, supplied by hl */
19824 + int (*dial_net_name)(char *); /* force dial of a ll net interface */
19827 /*********************/
19829 +++ b/include/linux/isdn_dwabc.h
19831 +/* $Id: isdn_dwabc.h,v 1.9 2001/09/26 20:32:08 detabc Exp $
19833 + * Header for the Linux ISDN abc-extension.
19835 + * Copyright by abc GmbH
19836 + * written by Detlef Wengorz <detlefw@isdn4linux.de>
19838 + * This software may be used and distributed according to the terms
19839 + * of the GNU General Public License, incorporated herein by reference.
19843 +#ifndef ISDN_DWABC_H
19844 +#define ISDN_DWABC_H
19847 +#include <linux/types.h>
19848 +#include <linux/kernel.h>
19849 +#include <linux/sched.h>
19850 +#include <linux/smp.h>
19851 +#include <linux/spinlock.h>
19852 +#include <linux/errno.h>
19855 +typedef struct ISDN_DWSPINLOCK {
19862 +} ISDN_DWSPINLOCK;
19864 +#define ISDN_DWSPIN_UNLOCKED \
19865 + (ISDN_DWSPINLOCK) { \
19866 + spin: SPIN_LOCK_UNLOCKED, \
19872 +#define ISDN_DWSPIN_INIT(x) \
19873 + do { *(x) = ISDN_DWSPIN_UNLOCKED; } while(0);
19875 +static __inline__ int isdn_dwspin_trylock(ISDN_DWSPINLOCK *spin)
19877 + if(!spin_trylock(&spin->spin)) {
19879 + if(spin->owner == smp_processor_id())
19882 + spin_lock(&spin->spin);
19885 + spin->owner = smp_processor_id();
19889 +static __inline__ void isdn_dwspin_unlock(ISDN_DWSPINLOCK *spin)
19891 + spin->owner = -1;
19892 + spin_unlock(&spin->spin);
19897 +#include <sys/types.h>
19900 +#define DWABC_LCR_FLG_NEWNUMBER 0x00000001L
19901 +#define DWABC_LCR_FLG_DISABLE 0x00000002L
19902 +#define DWABC_LCR_FLG_NEWHUPTIME 0x00000004L
19905 +struct ISDN_DWABC_LCR_IOCTL {
19907 + int lcr_ioctl_sizeof; /* mustbe sizeof(ISDN_DWABC_LCR_IOCTL) */
19908 + u_short lcr_ioctl_onhtime; /* new hanguptime */
19909 + u_long lcr_ioctl_callid; /* callid from lcr-subsystem */
19910 + u_long lcr_ioctl_flags; /* see above */
19911 + char lcr_ioctl_nr[32]; /* new destination phonenumber */
19915 --- a/include/linux/isdn_lzscomp.h
19916 +++ b/include/linux/isdn_lzscomp.h
19918 -/* $Id: isdn_lzscomp.h,v 1.1.4.1 2001/11/20 14:19:38 kai Exp $
19921 * Header for isdn_lzscomp.c
19922 * Concentrated here to not mess up half a dozen kernel headers with code
19923 --- a/include/linux/isdn_ppp.h
19924 +++ b/include/linux/isdn_ppp.h
19926 #ifndef _LINUX_ISDN_PPP_H
19927 #define _LINUX_ISDN_PPP_H
19929 +#include <linux/isdn_compat.h>
19931 #define CALLTYPE_INCOMING 0x1
19932 #define CALLTYPE_OUTGOING 0x2
19933 @@ -33,6 +34,11 @@ struct pppcallinfo
19934 #define PPPIOCSCOMPRESSOR _IOW('t',135,int)
19935 #define PPPIOCGIFNAME _IOR('t',136, char [IFNAMSIZ] )
19937 +#ifdef COMPAT_NEED_MPPP_DEFS
19938 +#define PPP_MP 0x003d
19939 +#define PPP_COMPFRAG 0x00fb
19940 +#define PPP_CCPFRAG 0x80fb
19943 #define SC_MP_PROT 0x00000200
19944 #define SC_REJ_MP_PROT 0x00000400
19945 @@ -65,9 +71,6 @@ struct isdn_ppp_comp_data {
19947 #include <linux/config.h>
19949 -#ifdef CONFIG_IPPP_FILTER
19950 -#include <linux/filter.h>
19953 #define DECOMP_ERR_NOMEM (-10)
19955 @@ -226,10 +229,6 @@ struct ippp_struct {
19956 unsigned char *cbuf;
19957 struct slcompress *slcomp;
19959 -#ifdef CONFIG_IPPP_FILTER
19960 - struct sock_fprog pass_filter; /* filter for packets to pass */
19961 - struct sock_fprog active_filter; /* filter for pkts to reset idle */
19963 unsigned long debug;
19964 struct isdn_ppp_compressor *compressor,*decompressor;
19965 struct isdn_ppp_compressor *link_compressor,*link_decompressor;
19966 --- a/include/linux/isdnif.h
19967 +++ b/include/linux/isdnif.h
19969 -/* $Id: isdnif.h,v 1.1.4.1 2001/11/20 14:19:38 kai Exp $
19970 +/* $Id: isdnif.h,v 1.43 2002/02/09 21:19:11 keil Exp $
19972 * Linux ISDN subsystem
19973 * Definition of the interface between the subsystem and its low-level drivers.
19975 #ifndef __ISDNIF_H__
19976 #define __ISDNIF_H__
19978 +#include <linux/isdn_compat.h>
19981 * Values for general protocol-selection
19982 @@ -213,6 +214,8 @@ typedef struct
19983 #define ISDN_STAT_FAXIND 276 /* FAX indications from HL-driver */
19984 #define ISDN_STAT_AUDIO 277 /* DTMF, DSP indications */
19985 #define ISDN_STAT_DISCH 278 /* Disable/Enable channel usage */
19986 +#define ISDN_STAT_ALERT 279 /* Signal alerting */
19987 +#define ISDN_STAT_PROCEED 280 /* Signal proceeding */
19991 --- a/include/linux/kernelcapi.h
19992 +++ b/include/linux/kernelcapi.h
19994 -/* $Id: kernelcapi.h,v 1.1.4.2 2002/01/28 18:25:10 kai Exp $
19996 + * $Id: kernelcapi.h,v 1.9 2000/11/28 09:34:02 kai Exp $
19998 * Kernel CAPI 2.0 Interface for Linux
20000 * (c) Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
20002 - * This software may be used and distributed according to the terms
20003 - * of the GNU General Public License, incorporated herein by reference.
20007 #ifndef __KERNELCAPI_H__