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");