1 diff -rNu linux-2.4.29.old/Documentation/isdn/CREDITS linux-2.4.29/Documentation/isdn/CREDITS
2 --- linux-2.4.29.old/Documentation/isdn/CREDITS 2005-03-22 14:48:26.000000000 +0100
3 +++ linux-2.4.29/Documentation/isdn/CREDITS 2005-03-22 15:06:50.246454160 +0100
5 Andreas Kool (akool@Kool.f.EUnet.de)
6 For contribution of the isdnlog/isdnrep-tool
8 -Pedro Roque Marques (pedro_m@yahoo.com)
9 +Pedro Roque Marques (roque@di.fc.ul.pt)
10 For lot of new ideas and the pcbit driver.
12 Eberhard Moenkeberg (emoenke@gwdg.de)
13 diff -rNu linux-2.4.29.old/Documentation/isdn/HiSax.cert linux-2.4.29/Documentation/isdn/HiSax.cert
14 --- linux-2.4.29.old/Documentation/isdn/HiSax.cert 2005-03-22 14:48:26.000000000 +0100
15 +++ linux-2.4.29/Documentation/isdn/HiSax.cert 2005-03-22 15:06:50.264451424 +0100
17 drivers/isdn/hisax/elsa.c
18 drivers/isdn/hisax/diva.c
19 drivers/isdn/hisax/hfc_pci.c
20 +drivers/isdn/hisax/hfc_usbr.c
21 +drivers/isdn/hisax/hfc_usb.c
23 Please send any changes, bugfixes and patches to me rather than implementing
24 them directly into the HiSax sources.
25 diff -rNu linux-2.4.29.old/Documentation/isdn/INTERFACE linux-2.4.29/Documentation/isdn/INTERFACE
26 --- linux-2.4.29.old/Documentation/isdn/INTERFACE 2005-03-22 14:48:26.000000000 +0100
27 +++ linux-2.4.29/Documentation/isdn/INTERFACE 2005-03-22 15:06:50.288447776 +0100
29 -$Id: INTERFACE,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
30 +$Id: INTERFACE,v 1.17 2002/01/31 13:26:35 keil Exp $
32 Description of the Interface between Linklevel and Hardwarelevel
35 protocol-Id is one of the constants ISDN_PROTO_L3...
36 parm.fax = Pointer to T30_s fax struct. (fax usage only)
38 - ISDN_CMD_GETL2: (currently unused)
39 + ISDN_CMD_GETL3: (currently unused)
41 With this command, the HL-driver is told to return the current
42 setting of the Layer-3-protocol.
44 arg = channel-number, locally to the driver. (starting with 0)
49 + With this call, the HL-driver signals the receive of an ALERTING message to the LL.
53 + command = ISDN_STAT_ALERT
54 + arg = channel-number, locally to the driver. (starting with 0)
58 + With this call, the HL-driver signals the receive of an CALL PROCEEDING message
63 + command = ISDN_STAT_PROCEED
64 + arg = channel-number, locally to the driver. (starting with 0)
66 diff -rNu linux-2.4.29.old/Documentation/isdn/INTERFACE.fax linux-2.4.29/Documentation/isdn/INTERFACE.fax
67 --- linux-2.4.29.old/Documentation/isdn/INTERFACE.fax 2005-03-22 14:48:26.000000000 +0100
68 +++ linux-2.4.29/Documentation/isdn/INTERFACE.fax 2005-03-22 15:06:50.312444128 +0100
70 -$Id: INTERFACE.fax,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
71 +$Id: INTERFACE.fax,v 1.2 2000/08/06 09:22:50 armin Exp $
74 Description of the fax-subinterface between linklevel and hardwarelevel of
75 diff -rNu linux-2.4.29.old/Documentation/isdn/README linux-2.4.29/Documentation/isdn/README
76 --- linux-2.4.29.old/Documentation/isdn/README 2005-03-22 14:48:26.000000000 +0100
77 +++ linux-2.4.29/Documentation/isdn/README 2005-03-22 15:06:50.340439872 +0100
79 1 = Add CPN to FCON message on
80 Bit 2: 0 = Add CDN to RING/FCON message off
81 1 = Add CDN to RING/FCON message on
82 + Bit 3: 0 = Do not signal RINGING
83 + 1 = Signal RINGING if ALERT was received
84 + Bit 4: 0 = Do not signal PROCEEDING
85 + 1 = Signal PROCEEDING if CALL PROCEEDING
89 Last but not least a (at the moment fairly primitive) device to request
90 the line-status (/dev/isdninfo) is made available.
91 diff -rNu linux-2.4.29.old/Documentation/isdn/README.HiSax linux-2.4.29/Documentation/isdn/README.HiSax
92 --- linux-2.4.29.old/Documentation/isdn/README.HiSax 2005-03-22 14:48:26.000000000 +0100
93 +++ linux-2.4.29/Documentation/isdn/README.HiSax 2005-03-22 15:06:50.372435008 +0100
95 ELSA Quickstep 3000PCI
98 -Eicon Diva 2.0 ISA and PCI (S0 and U interface, no PRO version)
99 -Eicon Diva 2.01 ISA and PCI
102 +Eicon.Diehl Diva 2.0 ISA and PCI (S0 and U interface, no PRO version)
103 +Eicon.Diehl Diva 2.01 ISA and PCI
104 +Eicon.Diehl Diva Piccola
105 ASUSCOM NETWORK INC. ISDNLink 128K PC adapter (order code I-IN100-ST-D)
106 Dynalink IS64PH (OEM version of ASUSCOM NETWORK INC. ISDNLink 128K adapter)
107 PCBIT-DP (OEM version of ASUSCOM NETWORK INC. ISDNLink)
109 Sedlbauer Speed Star/Speed Star2 (PCMCIA)
110 Sedlbauer ISDN-Controller PC/104
111 USR Sportster internal TA (compatible Stollmann tina-pp V3)
113 ith Kommunikationstechnik GmbH MIC 16 ISA card
114 Traverse Technologie NETjet PCI S0 card and NETspider U card
115 Ovislink ISDN sc100-p card (NETjet driver)
118 Winbond W6692 based cards
119 HFC-S+, HFC-SP/PCMCIA cards
124 Note: PCF, PCF-Pro: up to now, only the ISDN part is supported
125 PCC-8: not tested yet
126 Eicon.Diehl Diva U interface not tested
128 If you know other passive cards with the Siemens chipset, please let me know.
129 +To use the PNP cards you need the isapnptools.
130 You can combine any card, if there is no conflict between the resources
134 modules. It is included in the normal "make [menu]config" target at the
135 kernel. Don't forget it, especially to select the right D-channel protocol.
137 -Please note: In older versions of the HiSax driver, all PnP cards
138 -needed to be configured with isapnp and worked only with the HiSax
139 -driver used as a module.
141 -In the current version, HiSax will automatically use the in-kernel
142 -ISAPnP support, provided you selected it during kernel configuration
143 -(CONFIG_ISAPNP), if you don't give the io=, irq= command line parameters.
145 -The affected card types are: 4,7,12,14,19,27-30
146 +Please note: All PnP cards need to be configured with isapnp and will work
147 +only with the HiSax driver used as a module.
149 a) when built as a module
150 -------------------------
152 37 HFC 2BDS0 S+, SP irq,io
153 38 NETspider U PCI card none
154 39 HFC 2BDS0 SP/PCMCIA irq,io (set with cardmgr)
155 - 40 hotplug interface
156 - 41 Formula-n enter:now PCI none
158 At the moment IRQ sharing is only possible with PCI cards. Please make sure
159 that your IRQ is free and enabled for ISA use.
162 modprobe hisax type=4 protocol=2 irq=10 io0=0x580 io1=0x180
164 - In the current version of HiSax, you can instead simply use
166 - modprobe hisax type=4 protocol=2
168 - if you configured your kernel for ISAPnP. Don't run isapnp in
171 6. Teles 16.3, Euro ISDN, I/O base 280 hex, IRQ 12 and
172 Teles 16.0, 1TR6, IRQ 5, Memory d0000 hex
173 modprobe hisax type=3,1 protocol=2,1 io=0x280 mem=0,0xd0000
175 36 W6692 based PCI cards none
176 37 HFC 2BDS0 S+,SP/PCMCIA ONLY WORKS AS A MODULE !
177 38 NETspider U PCI card none
178 - 39 HFC 2BDS0 SP/PCMCIA ONLY WORKS AS A MODULE !
179 - 40 hotplug interface ONLY WORKS AS A MODULE !
180 - 41 Formula-n enter:now PCI none
185 diff -rNu linux-2.4.29.old/Documentation/isdn/README.act2000 linux-2.4.29/Documentation/isdn/README.act2000
186 --- linux-2.4.29.old/Documentation/isdn/README.act2000 2005-03-22 14:48:26.000000000 +0100
187 +++ linux-2.4.29/Documentation/isdn/README.act2000 2005-03-22 15:06:50.388432576 +0100
189 -$Id: README.act2000,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
190 +$Id: README.act2000,v 1.3 2000/08/06 09:22:51 armin Exp $
192 This document describes the ACT2000 driver for the
193 IBM Active 2000 ISDN card.
194 diff -rNu linux-2.4.29.old/Documentation/isdn/README.audio linux-2.4.29/Documentation/isdn/README.audio
195 --- linux-2.4.29.old/Documentation/isdn/README.audio 2005-03-22 14:48:26.000000000 +0100
196 +++ linux-2.4.29/Documentation/isdn/README.audio 2005-03-22 15:06:50.404430144 +0100
198 -$Id: README.audio,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
199 +$Id: README.audio,v 1.8 1999/07/11 17:17:29 armin Exp $
201 ISDN subsystem for Linux.
202 Description of audio mode.
203 diff -rNu linux-2.4.29.old/Documentation/isdn/README.eicon linux-2.4.29/Documentation/isdn/README.eicon
204 --- linux-2.4.29.old/Documentation/isdn/README.eicon 2005-03-22 14:48:26.000000000 +0100
205 +++ linux-2.4.29/Documentation/isdn/README.eicon 2005-03-22 15:06:50.479418744 +0100
207 -$Id: README.eicon,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
208 +$Id: README.eicon,v 1.10 2000/08/13 12:19:15 armin Exp $
210 (c) 1999,2000 Armin Schindler (mac@melware.de)
211 (c) 1999,2000 Cytronics & Melware (info@melware.de)
212 diff -rNu linux-2.4.29.old/Documentation/isdn/README.hysdn linux-2.4.29/Documentation/isdn/README.hysdn
213 --- linux-2.4.29.old/Documentation/isdn/README.hysdn 2005-03-22 14:48:26.000000000 +0100
214 +++ linux-2.4.29/Documentation/isdn/README.hysdn 2005-03-22 15:06:50.522412208 +0100
216 -$Id: README.hysdn,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
217 +$Id: README.hysdn,v 1.3.6.1 2001/02/10 14:41:19 kai Exp $
218 The hysdn driver has been written by
219 by Werner Cornelius (werner@isdn4linux.de or werner@titro.de)
220 for Hypercope GmbH Aachen Germany. Hypercope agreed to publish this driver
221 diff -rNu linux-2.4.29.old/Documentation/isdn/README.icn linux-2.4.29/Documentation/isdn/README.icn
222 --- linux-2.4.29.old/Documentation/isdn/README.icn 2005-03-22 14:48:26.000000000 +0100
223 +++ linux-2.4.29/Documentation/isdn/README.icn 2005-03-22 15:06:50.550407952 +0100
225 -$Id: README.icn,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
226 +$Id: README.icn,v 1.7 2000/08/06 09:22:51 armin Exp $
228 You can get the ICN-ISDN-card from:
230 diff -rNu linux-2.4.29.old/Documentation/isdn/README.pcbit linux-2.4.29/Documentation/isdn/README.pcbit
231 --- linux-2.4.29.old/Documentation/isdn/README.pcbit 2005-03-22 14:48:26.000000000 +0100
232 +++ linux-2.4.29/Documentation/isdn/README.pcbit 2005-03-22 15:06:50.567405368 +0100
239 diff -rNu linux-2.4.29.old/Documentation/isdn/abcext_kernel.help linux-2.4.29/Documentation/isdn/abcext_kernel.help
240 --- linux-2.4.29.old/Documentation/isdn/abcext_kernel.help 1970-01-01 01:00:00.000000000 +0100
241 +++ linux-2.4.29/Documentation/isdn/abcext_kernel.help 2005-03-22 15:06:50.600400352 +0100
244 +ISDN-ABC-DW Extension
245 +CONFIG_ISDN_WITH_ABC
246 + These are many brand new Options and Features for the
247 + ISDN SUBSYSTEM. Including Logical Device bindings,
248 + Compression and other good stuff for Optimizing your
251 + To Use this Extensions you MUST HAVE THE NEWEST
252 + ISDN4K-UTILS. You must have Version 3.1-Beta6 or
253 + higher. Elsewhere you can not configure this Extensions.
255 + WARNING ! THIS STUF IS NOT PRODUCTION RELEASE THE
256 + FUNCTION ARE UNDER DEVELOPMENT. This ist BETA-CODE.
257 + You can use it at you Own Risk.
259 + For more Information on these Extensions take a look at
260 + "linux/Documentation/isdn/dw-abc-extension-howto.txt or
261 + Online at the Web "http://www.mediatronix.de/i4l/index.html"
263 + Please Report Bugs to "mario@mediatronix.de" or
264 + "delefw@isdn4linux.de"
266 +D-Channel-Callback with Channel in use check
267 +CONFIG_ISDN_WITH_ABC_CALLB
268 + When a Interface is declared as an Callback Interface,
269 + the Interface is checking that the other Side is not
270 + Calling on the same time before the Interface is Dialing.
272 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
273 + for more Information
275 + In most case answer with "Yes" when you have Callback devices,
276 + otherwise leave it "No"
278 +Outgoing-EAZ-Support
279 +CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
280 + Enables the Feature to Define an other EAZ or MSN for
281 + Outgoing calls on an Interface.
283 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
284 + for more Information
286 +Least Cost Router Support
287 +CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
288 + This is the final Kernel Code for configuring an Least
289 + Cost Router Softwarebased. The other Job is to do the
290 + action in ISDNLOG. You need the ISDNLOG to use this
291 + function. Currently the ISDNLOG have not the Support for
293 + So in most situations let the Option off.
295 +TCP keepalive detect and response
296 +CONFIG_ISDN_WITH_ABC_IPV4_TCP_KEEPALIVE
297 + This Option works only with the TCP/IP V4. It enables
298 + the Function that ISDN Devices are Answering TCP_KEEPALIVE Pakets
299 + localy. So that TCP KEEPALIVE Pakets not longer takes the Line
302 +Drop frames Sourceadresse is not Interfaceadress
303 +CONFIG_ISDN_WITH_ABC_IPV4_DYNADDR
304 + This Option works only with the TCP/IP V4. It will allow only
305 + the Transmitt of Pakets where the Sourceadresse is the Interface
306 + adress. It is usefull when you have Lines with Dynamic IP.
308 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
309 + for more Information
311 +Receive do not reset the Hanguptimer
312 +CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
313 + When you activate this option than the reiceive of pakets do
314 + not reset the Hanguptimer. It is very usefull because if the
315 + Paket vor your Network your Network generate an Response and
316 + the Transmit is reseting the HUPTIMER. But when the Paket is
317 + Rejected at your firewall your network generate no Response
318 + and no Sendtraffic is generated. So in this case there is no
319 + need to Reset the Huptimer because you have only received Data.
320 + With that option only Transmitted Data/Pakets will reset the
323 +Support of (device-channel) and Binding Groups
324 +CONFIG_ISDN_WITH_ABC_ICALL_BIND
325 + This Option enables the Feature to Bind logical ISDN Interfaces
326 + to an prefered ISDN Card or ISDN Card plus Channel. So you have
327 + the Chance to keep Channels exclusively for one (or more)
328 + Connection. Very usefull when you have more channels and Use
329 + Calling Line Identification, because you can organize that your
330 + call is going out over the Line with the right EAZ for the CLI.
332 +Skip channel if used external (Dial Only)
333 +CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
334 + When you have more than One ISDN Card in your System and you
335 + will Dialout with an Interface you can become the Situation
336 + that an External Device such a Telephone or Fax is Using the
337 + B-Channels. Normaly ISDN4Linux does not detect this Situation
338 + and dial everytime of the "External Busy" line out. With this
339 + Option Enabled the I4L will detect that he can not dialout on
340 + This Card and dial over the next Card out.
342 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
343 + for more Information
345 +Interface autodisable if Config error
346 +CONFIG_ISDN_WITH_ABC_CONN_ERROR
347 + This Option will detect an Device which generate Telephone
348 + Cost but does not Function correctly because there are
349 + Configerrors on one of the Site. In this Situation the
350 + Interface will be marked as Unsuably for some time to do
351 + not call every time this Site.
353 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
354 + for more Information
357 +CONFIG_ISDN_WITH_ABC_UDP_CHECK
358 + This is the Mainoption to Enable or Disable the UDP
359 + Info Support. An Option to Controll ISDN-Interfaces
360 + Remotely. For this very Complex thing take a look at
362 + "linux/Documentation/isdn/dw-abc-extension-howto.txt"
363 + for more Information.
366 +CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP
368 + Sorry no more Information!
370 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
371 + for more Information
374 +CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL
376 + Sorry no more Information!
378 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
379 + for more Information
381 +Limit on the line frames to two
382 +CONFIG_ISDN_WITH_ABC_FRAME_LIMIT
384 + This Option enables support for sending only 2 Pakets on
385 + the Fly to the ISDN Driver. It is very usefull when you
386 + will use the new RAW-IP Compression. Because of sending
387 + Only 2 Pakets on the Fly makes the risk of overflowing
388 + the ISDN Driver very smaller.
390 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
391 + for more Information
393 +Compression with RAWIP and X75I
394 +CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS
396 + With this Option you have the ability to make Datacompression
397 + on RAW-IP Lines. It is function on HDLC and X75I Connection,
398 + but the Prefered L2-Protocol for Compression is X75I because
399 + the HDLC Protocol have no Errorcorrection.
401 + To Use this Option YOU MUST HAVE ENABLED THE OPTION:
402 + Support synchronous PPP
403 + and must load after loading the main isdndrivers the
404 + Modul "isdn_bsdcomp".
406 + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
407 + for more Information
409 diff -rNu linux-2.4.29.old/drivers/isdn/Config.in linux-2.4.29/drivers/isdn/Config.in
410 --- linux-2.4.29.old/drivers/isdn/Config.in 2005-03-22 14:47:56.000000000 +0100
411 +++ linux-2.4.29/drivers/isdn/Config.in 2005-03-22 15:06:44.259364336 +0100
414 # only included if CONFIG_ISDN != n
416 -define_bool CONFIG_ISDN_BOOL y
417 if [ "$CONFIG_INET" != "n" ]; then
418 bool ' Support synchronous PPP' CONFIG_ISDN_PPP
419 if [ "$CONFIG_ISDN_PPP" != "n" ]; then
420 - dep_bool ' PPP filtering for ISDN' CONFIG_IPPP_FILTER $CONFIG_FILTER
421 bool ' Use VJ-compression with synchronous PPP' CONFIG_ISDN_PPP_VJ
422 bool ' Support generic MP (RFC 1717)' CONFIG_ISDN_MPP
423 dep_tristate ' Support BSD compression' CONFIG_ISDN_PPP_BSDCOMP $CONFIG_ISDN
427 mainmenu_option next_comment
428 +comment 'ISDN abc-dw-extension'
429 +bool 'Enable isdn-abc-dw-extension' CONFIG_ISDN_WITH_ABC
430 +if [ "$CONFIG_ISDN_WITH_ABC" != "n" ]; then
431 + bool ' Use D-Channel-Callback with Channel in use check' CONFIG_ISDN_WITH_ABC_CALLB
432 + bool ' Enable Outgoing-EAZ-Support' CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
433 + bool ' Enable LCR-Support (need isdnlog)' CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
434 + bool ' RX dont reset hanguptimeout' CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
435 + if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then
436 + bool ' Enable UDP-Info-Support' CONFIG_ISDN_WITH_ABC_UDP_CHECK
437 + if [ "$CONFIG_ISDN_WITH_ABC_UDP_CHECK" != "n" ]; then
438 + bool ' Enable Hangup-Support with UDP-INFO' CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP
439 + bool ' Enable Dial-Support with UDP-INFO' CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL
443 + bool ' Skip channel if used external (dial only)' CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
444 + bool ' Support interface-auto-disable if config-error' CONFIG_ISDN_WITH_ABC_CONN_ERROR
445 + if [ "$CONFIG_ISDN_PPP" != "n" ]; then
446 + bool ' Enable Compression with rawip and x75i' CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS
451 +mainmenu_option next_comment
452 comment 'ISDN feature submodules'
453 dep_tristate 'isdnloop support' CONFIG_ISDN_DRV_LOOP $CONFIG_ISDN
454 dep_tristate 'Support isdn diversion services' CONFIG_ISDN_DIVERSION $CONFIG_ISDN
456 comment 'Passive ISDN cards'
457 dep_tristate 'HiSax SiemensChipSet driver support' CONFIG_ISDN_DRV_HISAX $CONFIG_ISDN
458 if [ "$CONFIG_ISDN_DRV_HISAX" != "n" ]; then
459 - define_bool CONFIG_ISDN_HISAX y
460 comment ' D-channel protocol features'
461 bool ' HiSax Support for EURO/DSS1' CONFIG_HISAX_EURO
462 if [ "$CONFIG_HISAX_EURO" != "n" ]; then
465 bool ' HiSax Support for german 1TR6' CONFIG_HISAX_1TR6
466 bool ' HiSax Support for US NI1' CONFIG_HISAX_NI1
467 - int ' Maximum number of cards supported by HiSax' CONFIG_HISAX_MAX_CARDS 8
468 comment ' HiSax supported cards'
469 - if [ "$CONFIG_ISA" != "n" ]; then
470 - bool ' Teles 16.0/8.0' CONFIG_HISAX_16_0
471 - bool ' Teles 16.3 or PNP or PCMCIA' CONFIG_HISAX_16_3
472 - bool ' AVM A1 (Fritz)' CONFIG_HISAX_AVM_A1
473 - bool ' ITK ix1-micro Revision 2' CONFIG_HISAX_IX1MICROR2
474 - bool ' ASUSCOM ISA cards' CONFIG_HISAX_ASUSCOM
475 - bool ' TELEINT cards' CONFIG_HISAX_TELEINT
476 - bool ' HFC-S based cards' CONFIG_HISAX_HFCS
477 - bool ' USR Sportster internal TA' CONFIG_HISAX_SPORTSTER
478 - bool ' MIC card' CONFIG_HISAX_MIC
479 - bool ' Siemens I-Surf card' CONFIG_HISAX_ISURF
480 - bool ' HST Saphir card' CONFIG_HISAX_HSTSAPHIR
482 + bool ' Teles 16.0/8.0' CONFIG_HISAX_16_0
483 + bool ' Teles 16.3 or PNP or PCMCIA' CONFIG_HISAX_16_3
484 bool ' Teles PCI' CONFIG_HISAX_TELESPCI
485 bool ' Teles S0Box' CONFIG_HISAX_S0BOX
486 + bool ' AVM A1 (Fritz)' CONFIG_HISAX_AVM_A1
487 bool ' AVM PnP/PCI (Fritz!PnP/PCI)' CONFIG_HISAX_FRITZPCI
488 bool ' AVM A1 PCMCIA (Fritz)' CONFIG_HISAX_AVM_A1_PCMCIA
489 bool ' Elsa cards' CONFIG_HISAX_ELSA
490 + bool ' ITK ix1-micro Revision 2' CONFIG_HISAX_IX1MICROR2
491 bool ' Eicon.Diehl Diva cards' CONFIG_HISAX_DIEHLDIVA
492 + bool ' ASUSCOM ISA cards' CONFIG_HISAX_ASUSCOM
493 + bool ' TELEINT cards' CONFIG_HISAX_TELEINT
494 + bool ' HFC-S based cards' CONFIG_HISAX_HFCS
495 bool ' Sedlbauer cards' CONFIG_HISAX_SEDLBAUER
496 + bool ' USR Sportster internal TA' CONFIG_HISAX_SPORTSTER
497 + bool ' MIC card' CONFIG_HISAX_MIC
498 bool ' NETjet card' CONFIG_HISAX_NETJET
499 bool ' NETspider U card' CONFIG_HISAX_NETJET_U
500 bool ' Niccy PnP/PCI card' CONFIG_HISAX_NICCY
501 + bool ' Siemens I-Surf card' CONFIG_HISAX_ISURF
502 + bool ' HST Saphir card' CONFIG_HISAX_HSTSAPHIR
503 bool ' Telekom A4T card' CONFIG_HISAX_BKM_A4T
504 bool ' Scitel Quadro card' CONFIG_HISAX_SCT_QUADRO
505 bool ' Gazel cards' CONFIG_HISAX_GAZEL
507 bool ' HFC-S+, HFC-SP, HFC-PCMCIA cards' CONFIG_HISAX_HFC_SX
508 if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then
509 # bool ' TESTEMULATOR (EXPERIMENTAL)' CONFIG_HISAX_TESTEMU
510 - bool ' Formula-n enter:now PCI card' CONFIG_HISAX_ENTERNOW_PCI
511 if [ "$ARCH" = "sparc" -o "$ARCH" = "sparc64" ]; then
512 bool ' Am7930' CONFIG_HISAX_AMD7930
515 bool ' HiSax debugging' CONFIG_HISAX_DEBUG
517 - dep_tristate 'Sedlbauer PCMCIA cards' CONFIG_HISAX_SEDLBAUER_CS $CONFIG_ISDN_DRV_HISAX $CONFIG_PCMCIA
518 - dep_tristate 'ELSA PCMCIA MicroLink cards' CONFIG_HISAX_ELSA_CS $CONFIG_ISDN_DRV_HISAX $CONFIG_PCMCIA
519 - dep_tristate 'AVM A1 PCMCIA cards' CONFIG_HISAX_AVM_A1_CS $CONFIG_ISDN_DRV_HISAX $CONFIG_PCMCIA $CONFIG_HISAX_AVM_A1_PCMCIA
520 - dep_tristate 'ST5481 USB ISDN modem (EXPERIMENTAL)' CONFIG_HISAX_ST5481 $CONFIG_ISDN_DRV_HISAX $CONFIG_EXPERIMENTAL
521 - dep_tristate 'AVM Fritz!Card PCI/PCIv2/PnP support (EXPERIMENTAL)' CONFIG_HISAX_FRITZ_PCIPNP $CONFIG_ISDN_DRV_HISAX $CONFIG_EXPERIMENTAL
522 - dep_tristate 'Auerswald devices ISDN support' CONFIG_USB_AUERISDN $CONFIG_ISDN_DRV_HISAX
523 + dep_tristate 'Sedlbauer PCMCIA cards' CONFIG_HISAX_SEDLBAUER_CS $CONFIG_PCMCIA
524 + dep_tristate 'ELSA PCMCIA MicroLink cards' CONFIG_HISAX_ELSA_CS $CONFIG_PCMCIA
525 + dep_tristate 'Colognechip HFC-USB support' CONFIG_HISAX_HFC_USB_CS $CONFIG_HISAX $CONFIG_USB
526 + dep_tristate 'ST5481 USB ISDN modem (EXPERIMENTAL)' CONFIG_HISAX_ST5481 $CONFIG_HISAX $CONFIG_USB $CONFIG_EXPERIMENTAL
527 + dep_tristate 'Fritz!PCIv2 support (EXPERIMENTAL)' CONFIG_HISAX_FRITZ_PCIPNP $CONFIG_HISAX $CONFIG_EXPERIMENTAL
529 + if [ "$CONFIG_HISAX_SEDLBAUER_CS" != "n" ]; then
530 + define_bool CONFIG_HISAX_SEDLBAUER y
532 + if [ "$CONFIG_HISAX_ELSA_CS" != "n" ]; then
533 + define_bool CONFIG_HISAX_ELSA y
535 + if [ "$CONFIG_HISAX_HFC_USB_CS" != "n" ]; then
536 + define_bool CONFIG_HISAX_HFC_USB y
541 diff -rNu linux-2.4.29.old/drivers/isdn/Makefile linux-2.4.29/drivers/isdn/Makefile
542 --- linux-2.4.29.old/drivers/isdn/Makefile 2005-03-22 14:47:56.000000000 +0100
543 +++ linux-2.4.29/drivers/isdn/Makefile 2005-03-22 15:06:44.277361600 +0100
546 # The target object and module list name.
548 -O_TARGET := vmlinux-obj.o
551 # Objects that export symbols.
555 # Object files in subdirectories
557 -mod-subdirs := avmb1 eicon hisax
558 +mod-subdirs := avmb1 eicon
559 subdir-$(CONFIG_ISDN_DIVERSION) += divert
560 -subdir-$(CONFIG_ISDN_HISAX) += hisax
561 +subdir-$(CONFIG_ISDN_DRV_HISAX) += hisax
562 subdir-$(CONFIG_ISDN_DRV_ICN) += icn
563 subdir-$(CONFIG_ISDN_DRV_PCBIT) += pcbit
564 subdir-$(CONFIG_ISDN_DRV_SC) += sc
565 diff -rNu linux-2.4.29.old/drivers/isdn/act2000/act2000.h linux-2.4.29/drivers/isdn/act2000/act2000.h
566 --- linux-2.4.29.old/drivers/isdn/act2000/act2000.h 2005-03-22 14:47:56.000000000 +0100
567 +++ linux-2.4.29/drivers/isdn/act2000/act2000.h 2005-03-22 15:06:44.103388048 +0100
569 -/* $Id: act2000.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
572 * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
574 @@ -178,19 +178,19 @@
575 char regname[35]; /* Name used for request_region */
578 -static inline void act2000_schedule_tx(act2000_card *card)
579 +extern __inline__ void act2000_schedule_tx(act2000_card *card)
581 queue_task(&card->snd_tq, &tq_immediate);
582 mark_bh(IMMEDIATE_BH);
585 -static inline void act2000_schedule_rx(act2000_card *card)
586 +extern __inline__ void act2000_schedule_rx(act2000_card *card)
588 queue_task(&card->rcv_tq, &tq_immediate);
589 mark_bh(IMMEDIATE_BH);
592 -static inline void act2000_schedule_poll(act2000_card *card)
593 +extern __inline__ void act2000_schedule_poll(act2000_card *card)
595 queue_task(&card->poll_tq, &tq_immediate);
596 mark_bh(IMMEDIATE_BH);
597 diff -rNu linux-2.4.29.old/drivers/isdn/act2000/act2000_isa.c linux-2.4.29/drivers/isdn/act2000/act2000_isa.c
598 --- linux-2.4.29.old/drivers/isdn/act2000/act2000_isa.c 2005-03-22 14:47:56.000000000 +0100
599 +++ linux-2.4.29/drivers/isdn/act2000/act2000_isa.c 2005-03-22 15:06:44.135383184 +0100
601 -/* $Id: act2000_isa.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
604 * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000 (ISA-Version).
607 card->flags &= ~ACT2000_FLAGS_PVALID;
609 if (!check_region(portbase, ISA_REGION)) {
610 - if (request_region(portbase, ACT2000_PORTLEN, card->regname) == NULL)
612 + request_region(portbase, ACT2000_PORTLEN, card->regname);
613 card->port = portbase;
614 card->flags |= ACT2000_FLAGS_PVALID;
618 if (act2000_isa_writeb(card, *(skb->data))) {
619 /* Fifo is full, but more data to send */
621 + printk(KERN_DEBUG "act2000_isa_send: %d bytes\n", l);
623 test_and_clear_bit(ACT2000_LOCK_TX, (void *) &card->ilock);
624 /* Schedule myself */
625 act2000_schedule_tx(card);
631 + printk(KERN_DEBUG "act2000_isa_send: %d bytes\n", l);
636 diff -rNu linux-2.4.29.old/drivers/isdn/act2000/act2000_isa.h linux-2.4.29/drivers/isdn/act2000/act2000_isa.h
637 --- linux-2.4.29.old/drivers/isdn/act2000/act2000_isa.h 2005-03-22 14:47:56.000000000 +0100
638 +++ linux-2.4.29/drivers/isdn/act2000/act2000_isa.h 2005-03-22 15:06:44.152380600 +0100
640 -/* $Id: act2000_isa.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
643 * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000 (ISA-Version).
645 diff -rNu linux-2.4.29.old/drivers/isdn/act2000/capi.c linux-2.4.29/drivers/isdn/act2000/capi.c
646 --- linux-2.4.29.old/drivers/isdn/act2000/capi.c 2005-03-22 14:47:56.000000000 +0100
647 +++ linux-2.4.29/drivers/isdn/act2000/capi.c 2005-03-22 15:06:44.172377560 +0100
649 -/* $Id: capi.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
652 * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
653 * CAPI encoder/decoder
655 {{ 0x84, 0x03}, "DISCONNECT_B3_RESP"},
656 {{ 0x86, 0x03}, "DATA_B3_RESP"},
657 {{ 0xff, 0x03}, "MANUFACTURER_RESP"},
660 + {{ 0x05, 0x80}, "LISTEN_REQ (CAPI 2.0)"},
663 {{ 0x00, 0x00}, NULL},
665 diff -rNu linux-2.4.29.old/drivers/isdn/act2000/capi.h linux-2.4.29/drivers/isdn/act2000/capi.h
666 --- linux-2.4.29.old/drivers/isdn/act2000/capi.h 2005-03-22 14:47:56.000000000 +0100
667 +++ linux-2.4.29/drivers/isdn/act2000/capi.h 2005-03-22 15:06:44.187375280 +0100
669 -/* $Id: capi.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
672 * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
677 } select_b3_protocol_conf;
679 + struct listen_req {
684 + __u16 dummy; /* 2 Length-bytes of 2 Structs MUST always be 0!!! */
686 + struct listen_conf {
693 __u32 infomask __attribute__ ((packed));
696 __u16 info __attribute__ ((packed));
706 -static inline unsigned short
707 +extern __inline__ unsigned short
708 actcapi_nextsmsg(act2000_card *card)
711 diff -rNu linux-2.4.29.old/drivers/isdn/act2000/module.c linux-2.4.29/drivers/isdn/act2000/module.c
712 --- linux-2.4.29.old/drivers/isdn/act2000/module.c 2005-03-22 14:47:56.000000000 +0100
713 +++ linux-2.4.29/drivers/isdn/act2000/module.c 2005-03-22 15:06:44.202373000 +0100
715 -/* $Id: module.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
718 * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
721 card->interface.features =
722 ISDN_FEATURE_L2_X75I |
723 ISDN_FEATURE_L2_HDLC |
725 +/* Not yet! New Firmware is on the way ... */
726 + ISDN_FEATURE_L2_TRANS |
728 ISDN_FEATURE_L3_TRANS |
729 ISDN_FEATURE_P_UNKNOWN;
730 card->interface.hl_hdrlen = 20;
733 printk(KERN_INFO "%s unloaded\n", DRIVERNAME);
738 +act2000_setup(char *str, int *ints)
740 + int i, j, argc, port, irq, bus;
763 + act2000_addcard(bus, port, irq, act_id);
769 module_init(act2000_init);
770 module_exit(act2000_exit);
771 diff -rNu linux-2.4.29.old/drivers/isdn/avmb1/avm_cs.c linux-2.4.29/drivers/isdn/avmb1/avm_cs.c
772 --- linux-2.4.29.old/drivers/isdn/avmb1/avm_cs.c 2005-03-22 14:47:56.000000000 +0100
773 +++ linux-2.4.29/drivers/isdn/avmb1/avm_cs.c 2005-03-22 15:06:44.696297912 +0100
775 -/* $Id: avm_cs.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
776 +/* $Id: avm_cs.c,v 1.6 2001/09/24 13:22:44 kai Exp $
778 * A PCMCIA client driver for AVM B1/M1/M2
780 diff -rNu linux-2.4.29.old/drivers/isdn/avmb1/avmcard.h linux-2.4.29/drivers/isdn/avmb1/avmcard.h
781 --- linux-2.4.29.old/drivers/isdn/avmb1/avmcard.h 2005-03-22 14:47:56.000000000 +0100
782 +++ linux-2.4.29/drivers/isdn/avmb1/avmcard.h 2005-03-22 15:06:44.711295632 +0100
784 -/* $Id: avmcard.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
785 +/* $Id: avmcard.h,v 1.12 2001/09/24 13:22:44 kai Exp $
787 * Copyright 1999 by Carsten Paeth <calle@calle.de>
789 diff -rNu linux-2.4.29.old/drivers/isdn/avmb1/b1.c linux-2.4.29/drivers/isdn/avmb1/b1.c
790 --- linux-2.4.29.old/drivers/isdn/avmb1/b1.c 2005-03-22 14:47:56.000000000 +0100
791 +++ linux-2.4.29/drivers/isdn/avmb1/b1.c 2005-03-22 15:06:44.733292288 +0100
793 -/* $Id: b1.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
794 +/* $Id: b1.c,v 1.26 2001/09/24 13:22:44 kai Exp $
796 * Common module for AVM B1 cards.
799 #include <linux/kernelcapi.h>
801 #include <linux/init.h>
802 +#include <linux/isdn_compat.h>
803 #include <asm/uaccess.h>
804 #include <linux/netdevice.h>
808 #include "capiutil.h"
810 -static char *revision = "$Revision: 1.1.4.1 $";
811 +static char *revision = "$Revision: 1.26 $";
813 /* ------------------------------------------------------------- */
815 diff -rNu linux-2.4.29.old/drivers/isdn/avmb1/b1dma.c linux-2.4.29/drivers/isdn/avmb1/b1dma.c
816 --- linux-2.4.29.old/drivers/isdn/avmb1/b1dma.c 2005-03-22 14:47:56.000000000 +0100
817 +++ linux-2.4.29/drivers/isdn/avmb1/b1dma.c 2005-03-22 15:06:44.750289704 +0100
819 -/* $Id: b1dma.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
820 +/* $Id: b1dma.c,v 1.18 2001/09/24 13:22:44 kai Exp $
822 * Common module for AVM B1 cards that support dma with AMCC
825 #include <linux/kernelcapi.h>
827 #include <linux/init.h>
828 +#include <linux/isdn_compat.h>
829 #include <asm/uaccess.h>
830 #include <linux/netdevice.h>
834 #include "capiutil.h"
836 -static char *revision = "$Revision: 1.1.4.1 $";
837 +#if BITS_PER_LONG != 32
838 +#error FIXME: driver requires 32-bit platform
841 +static char *revision = "$Revision: 1.18 $";
843 /* ------------------------------------------------------------- */
849 - u_long txaddr, txlen, rxaddr, rxlen, csr;
850 + __u32 txaddr, txlen, rxaddr, rxlen, csr;
852 len += sprintf(page+len, "%-16s %s\n", "name", card->name);
853 len += sprintf(page+len, "%-16s 0x%x\n", "io", card->port);
854 @@ -907,12 +912,12 @@
858 - txaddr = (u_long)phys_to_virt(b1dmainmeml(card->mbase+0x2c));
859 - txaddr -= (u_long)card->dma->sendbuf;
860 + txaddr = (__u32)phys_to_virt(b1dmainmeml(card->mbase+0x2c));
861 + txaddr -= (__u32)card->dma->sendbuf;
862 txlen = b1dmainmeml(card->mbase+0x30);
864 - rxaddr = (u_long)phys_to_virt(b1dmainmeml(card->mbase+0x24));
865 - rxaddr -= (u_long)card->dma->recvbuf;
866 + rxaddr = (__u32)phys_to_virt(b1dmainmeml(card->mbase+0x24));
867 + rxaddr -= (__u32)card->dma->recvbuf;
868 rxlen = b1dmainmeml(card->mbase+0x28);
870 csr = b1dmainmeml(card->mbase+AMCC_INTCSR);
871 diff -rNu linux-2.4.29.old/drivers/isdn/avmb1/b1isa.c linux-2.4.29/drivers/isdn/avmb1/b1isa.c
872 --- linux-2.4.29.old/drivers/isdn/avmb1/b1isa.c 2005-03-22 14:47:56.000000000 +0100
873 +++ linux-2.4.29/drivers/isdn/avmb1/b1isa.c 2005-03-22 15:06:44.766287272 +0100
875 -/* $Id: b1isa.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
876 +/* $Id: b1isa.c,v 1.14 2001/09/24 13:22:44 kai Exp $
878 * Module for AVM B1 ISA-card.
881 #include <linux/capi.h>
882 #include <linux/init.h>
884 +#include <linux/isdn_compat.h>
886 #include "capiutil.h"
890 -static char *revision = "$Revision: 1.1.4.1 $";
891 +static char *revision = "$Revision: 1.14 $";
893 /* ------------------------------------------------------------- */
895 diff -rNu linux-2.4.29.old/drivers/isdn/avmb1/b1pci.c linux-2.4.29/drivers/isdn/avmb1/b1pci.c
896 --- linux-2.4.29.old/drivers/isdn/avmb1/b1pci.c 2005-03-22 14:47:56.000000000 +0100
897 +++ linux-2.4.29/drivers/isdn/avmb1/b1pci.c 2005-03-22 15:06:44.781284992 +0100
899 -/* $Id: b1pci.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
900 +/* $Id: b1pci.c,v 1.40 2001/09/24 13:22:44 kai Exp $
902 * Module for AVM B1 PCI-card.
905 #include <linux/capi.h>
907 #include <linux/init.h>
908 +#include <linux/isdn_compat.h>
910 #include "capiutil.h"
914 -static char *revision = "$Revision: 1.1.4.1 $";
915 +static char *revision = "$Revision: 1.40 $";
917 /* ------------------------------------------------------------- */
919 +#ifndef COMPAT_HAS_2_2_PCI
920 static struct pci_device_id b1pci_pci_tbl[] __initdata = {
921 { PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_B1, PCI_ANY_ID, PCI_ANY_ID },
922 { } /* Terminating entry */
925 MODULE_DEVICE_TABLE(pci, b1pci_pci_tbl);
927 MODULE_DESCRIPTION("CAPI4Linux: Driver for AVM B1 PCI card");
928 MODULE_AUTHOR("Carsten Paeth");
929 MODULE_LICENSE("GPL");
930 @@ -416,14 +419,14 @@
932 param.irq = dev->irq;
934 - if (pci_resource_start(dev, 2)) { /* B1 PCI V4 */
935 + if (pci_resource_start_io(dev, 2)) { /* B1 PCI V4 */
936 #ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4
937 driver = &b1pciv4_driver;
941 - param.membase = pci_resource_start(dev, 0);
942 - param.port = pci_resource_start(dev, 2);
943 + param.membase = pci_resource_start_mem(dev, 0);
944 + param.port = pci_resource_start_io(dev, 2);
947 "%s: PCI BIOS reports AVM-B1 V4 at i/o %#x, irq %d, mem %#x\n",
952 - param.port = pci_resource_start(dev, 1);
953 + param.port = pci_resource_start_io(dev, 1);
956 "%s: PCI BIOS reports AVM-B1 at i/o %#x, irq %d\n",
957 diff -rNu linux-2.4.29.old/drivers/isdn/avmb1/b1pcmcia.c linux-2.4.29/drivers/isdn/avmb1/b1pcmcia.c
958 --- linux-2.4.29.old/drivers/isdn/avmb1/b1pcmcia.c 2005-03-22 14:47:56.000000000 +0100
959 +++ linux-2.4.29/drivers/isdn/avmb1/b1pcmcia.c 2005-03-22 15:06:44.796282712 +0100
961 -/* $Id: b1pcmcia.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
962 +/* $Id: b1pcmcia.c,v 1.17 2001/09/24 13:22:44 kai Exp $
964 * Module for AVM B1/M1/M2 PCMCIA-card.
970 -static char *revision = "$Revision: 1.1.4.1 $";
971 +static char *revision = "$Revision: 1.17 $";
973 /* ------------------------------------------------------------- */
975 diff -rNu linux-2.4.29.old/drivers/isdn/avmb1/c4.c linux-2.4.29/drivers/isdn/avmb1/c4.c
976 --- linux-2.4.29.old/drivers/isdn/avmb1/c4.c 2005-03-22 14:47:56.000000000 +0100
977 +++ linux-2.4.29/drivers/isdn/avmb1/c4.c 2005-03-22 15:06:44.812280280 +0100
979 -/* $Id: c4.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
980 +/* $Id: c4.c,v 1.38 2001/09/24 13:22:44 kai Exp $
982 * Module for AVM C4 & C2 card.
985 #include <linux/interrupt.h>
986 #include <linux/ioport.h>
987 #include <linux/pci.h>
988 +#include <linux/isdn_compat.h>
989 #include <linux/capi.h>
990 #include <linux/kernelcapi.h>
991 #include <linux/init.h>
996 -static char *revision = "$Revision: 1.1.4.1 $";
997 +static char *revision = "$Revision: 1.38 $";
999 #undef CONFIG_C4_DEBUG
1000 #undef CONFIG_C4_POLLDEBUG
1003 static int suppress_pollack;
1005 +#ifndef COMPAT_HAS_2_2_PCI
1006 static struct pci_device_id c4_pci_tbl[] __initdata = {
1007 { PCI_VENDOR_ID_DEC,PCI_DEVICE_ID_DEC_21285, PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_C4 },
1008 { PCI_VENDOR_ID_DEC,PCI_DEVICE_ID_DEC_21285, PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_C2 },
1012 MODULE_DEVICE_TABLE(pci, c4_pci_tbl);
1014 MODULE_DESCRIPTION("CAPI4Linux: Driver for AVM C2/C4 cards");
1015 MODULE_AUTHOR("Carsten Paeth");
1016 MODULE_LICENSE("GPL");
1017 @@ -1328,9 +1331,9 @@
1019 pci_set_master(dev);
1021 - param.port = pci_resource_start(dev, 1);
1022 + param.port = pci_resource_start_io(dev, 1);
1023 param.irq = dev->irq;
1024 - param.membase = pci_resource_start(dev, 0);
1025 + param.membase = pci_resource_start_mem(dev, 0);
1028 "%s: PCI BIOS reports AVM-C%d at i/o %#x, irq %d, mem %#x\n",
1029 diff -rNu linux-2.4.29.old/drivers/isdn/avmb1/capi.c linux-2.4.29/drivers/isdn/avmb1/capi.c
1030 --- linux-2.4.29.old/drivers/isdn/avmb1/capi.c 2005-03-22 14:47:56.000000000 +0100
1031 +++ linux-2.4.29/drivers/isdn/avmb1/capi.c 2005-03-22 15:06:44.849274656 +0100
1033 -/* $Id: capi.c,v 1.1.4.2 2001/12/09 18:45:13 kai Exp $
1034 +/* $Id: capi.c,v 1.59 2001/11/07 22:35:48 kai Exp $
1036 * CAPI 2.0 Interface for Linux
1039 #include <linux/smp_lock.h>
1040 #include <linux/timer.h>
1041 #include <linux/wait.h>
1042 +#include <linux/isdn_compat.h>
1043 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1044 #include <linux/tty.h>
1047 #include <linux/ppp_defs.h>
1048 #include <linux/if_ppp.h>
1049 #undef CAPI_PPP_ON_RAW_DEVICE
1050 +#ifdef CAPI_PPP_ON_RAW_DEVICE
1051 +#include <linux/ppp_channel.h>
1052 +#endif /* CAPI_PPP_ON_RAW_DEVICE */
1053 #endif /* CONFIG_PPP */
1054 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1055 #include <linux/skbuff.h>
1057 #include <linux/capi.h>
1058 #include <linux/kernelcapi.h>
1059 #include <linux/init.h>
1060 +#ifdef HAVE_DEVFS_FS
1061 #include <linux/devfs_fs_kernel.h>
1062 +#endif /* HAVE_DEVFS_FS */
1063 #include "capiutil.h"
1064 #include "capicmd.h"
1065 #if defined(CONFIG_ISDN_CAPI_CAPIFS) || defined(CONFIG_ISDN_CAPI_CAPIFS_MODULE)
1069 -static char *revision = "$Revision: 1.1.4.2 $";
1070 +static char *revision = "$Revision: 1.59 $";
1072 MODULE_DESCRIPTION("CAPI4Linux: Userspace /dev/capi20 interface");
1073 MODULE_AUTHOR("Carsten Paeth");
1075 struct capincci *nccip;
1088 struct tty_struct *tty;
1089 @@ -112,16 +118,22 @@
1091 struct datahandle_queue {
1092 struct datahandle_queue *next;
1098 +#ifdef CAPI_PPP_ON_RAW_DEVICE
1099 + /* interface to generic ppp layer */
1100 + struct ppp_channel chan;
1101 + int chan_connected;
1105 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1108 struct capincci *next;
1111 struct capidev *cdev;
1112 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1113 struct capiminor *minorp;
1116 struct capidev *next;
1125 @@ -156,22 +168,28 @@
1126 static struct capiminor *minors = 0;
1127 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1129 +#ifdef COMPAT_HAS_kmem_cache
1130 static kmem_cache_t *capidev_cachep = 0;
1131 static kmem_cache_t *capincci_cachep = 0;
1132 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1133 static kmem_cache_t *capiminor_cachep = 0;
1134 static kmem_cache_t *capidh_cachep = 0;
1135 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1138 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1139 /* -------- datahandles --------------------------------------------- */
1141 -static int capincci_add_ack(struct capiminor *mp, u16 datahandle)
1142 +int capincci_add_ack(struct capiminor *mp, __u16 datahandle)
1144 struct datahandle_queue *n, **pp;
1146 n = (struct datahandle_queue *)
1147 +#ifdef COMPAT_HAS_kmem_cache
1148 kmem_cache_alloc(capidh_cachep, GFP_ATOMIC);
1150 + kmalloc(sizeof(struct datahandle_queue), GFP_ATOMIC);
1153 printk(KERN_ERR "capi: alloc datahandle failed\n");
1159 -static int capiminor_del_ack(struct capiminor *mp, u16 datahandle)
1160 +int capiminor_del_ack(struct capiminor *mp, __u16 datahandle)
1162 struct datahandle_queue **pp, *p;
1164 @@ -192,7 +210,11 @@
1165 if ((*pp)->datahandle == datahandle) {
1168 +#ifdef COMPAT_HAS_kmem_cache
1169 kmem_cache_free(capidh_cachep, p);
1180 -static void capiminor_del_all_ack(struct capiminor *mp)
1181 +void capiminor_del_all_ack(struct capiminor *mp)
1183 struct datahandle_queue **pp, *p;
1185 @@ -208,7 +230,11 @@
1189 +#ifdef COMPAT_HAS_kmem_cache
1190 kmem_cache_free(capidh_cachep, p);
1197 @@ -216,13 +242,17 @@
1199 /* -------- struct capiminor ---------------------------------------- */
1201 -static struct capiminor *capiminor_alloc(u16 applid, u32 ncci)
1202 +struct capiminor *capiminor_alloc(__u16 applid, __u32 ncci)
1204 struct capiminor *mp, **pp;
1205 unsigned int minor = 0;
1208 +#ifdef COMPAT_HAS_kmem_cache
1209 mp = (struct capiminor *)kmem_cache_alloc(capiminor_cachep, GFP_ATOMIC);
1211 + mp = (struct capiminor *)kmalloc(sizeof(struct capiminor), GFP_ATOMIC);
1215 printk(KERN_ERR "capi: can't alloc capiminor\n");
1220 -static void capiminor_free(struct capiminor *mp)
1221 +void capiminor_free(struct capiminor *mp)
1223 struct capiminor **pp;
1225 @@ -271,7 +301,11 @@
1226 skb_queue_purge(&mp->inqueue);
1227 skb_queue_purge(&mp->outqueue);
1228 capiminor_del_all_ack(mp);
1229 +#ifdef COMPAT_HAS_kmem_cache
1230 kmem_cache_free(capiminor_cachep, mp);
1235 #ifdef _DEBUG_REFCOUNT
1236 printk(KERN_DEBUG "capiminor_free %d\n", GET_USE_COUNT(THIS_MODULE));
1241 -static struct capiminor *capiminor_find(unsigned int minor)
1242 +struct capiminor *capiminor_find(unsigned int minor)
1244 struct capiminor *p;
1245 for (p = minors; p && p->minor != minor; p = p->next)
1248 /* -------- struct capincci ----------------------------------------- */
1250 -static struct capincci *capincci_alloc(struct capidev *cdev, u32 ncci)
1251 +static struct capincci *capincci_alloc(struct capidev *cdev, __u32 ncci)
1253 struct capincci *np, **pp;
1254 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1255 @@ -302,7 +336,11 @@
1257 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1259 +#ifdef COMPAT_HAS_kmem_cache
1260 np = (struct capincci *)kmem_cache_alloc(capincci_cachep, GFP_ATOMIC);
1262 + np = (struct capincci *)kmalloc(sizeof(struct capincci), GFP_ATOMIC);
1266 memset(np, 0, sizeof(struct capincci));
1271 -static void capincci_free(struct capidev *cdev, u32 ncci)
1272 +static void capincci_free(struct capidev *cdev, __u32 ncci)
1274 struct capincci *np, **pp;
1275 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1276 @@ -367,7 +405,11 @@
1279 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1280 +#ifdef COMPAT_HAS_kmem_cache
1281 kmem_cache_free(capincci_cachep, np);
1285 if (*pp == 0) return;
1292 -static struct capincci *capincci_find(struct capidev *cdev, u32 ncci)
1293 +struct capincci *capincci_find(struct capidev *cdev, __u32 ncci)
1297 @@ -393,7 +435,11 @@
1298 struct capidev *cdev;
1299 struct capidev **pp;
1301 +#ifdef COMPAT_HAS_kmem_cache
1302 cdev = (struct capidev *)kmem_cache_alloc(capidev_cachep, GFP_KERNEL);
1304 + cdev = (struct capidev *)kmalloc(sizeof(struct capidev), GFP_KERNEL);
1308 memset(cdev, 0, sizeof(struct capidev));
1309 @@ -423,10 +469,14 @@
1313 +#ifdef COMPAT_HAS_kmem_cache
1314 kmem_cache_free(capidev_cachep, cdev);
1320 -static struct capidev *capidev_find(u16 applid)
1321 +static struct capidev *capidev_find(__u16 applid)
1324 for (p=capidev_openlist; p; p = p->next) {
1325 @@ -439,13 +489,13 @@
1326 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1327 /* -------- handle data queue --------------------------------------- */
1329 -static struct sk_buff *
1331 gen_data_b3_resp_for(struct capiminor *mp, struct sk_buff *skb)
1333 struct sk_buff *nskb;
1334 nskb = alloc_skb(CAPI_DATA_B3_RESP_LEN, GFP_ATOMIC);
1336 - u16 datahandle = CAPIMSG_U16(skb->data,CAPIMSG_BASELEN+4+4+2);
1337 + __u16 datahandle = CAPIMSG_U16(skb->data,CAPIMSG_BASELEN+4+4+2);
1338 unsigned char *s = skb_put(nskb, CAPI_DATA_B3_RESP_LEN);
1339 capimsg_setu16(s, 0, CAPI_DATA_B3_RESP_LEN);
1340 capimsg_setu16(s, 2, mp->applid);
1341 @@ -458,11 +508,11 @@
1345 -static int handle_recv_skb(struct capiminor *mp, struct sk_buff *skb)
1346 +int handle_recv_skb(struct capiminor *mp, struct sk_buff *skb)
1348 struct sk_buff *nskb;
1349 unsigned int datalen;
1350 - u16 errcode, datahandle;
1351 + __u16 errcode, datahandle;
1353 datalen = skb->len - CAPIMSG_LEN(skb->data);
1355 @@ -504,6 +554,28 @@
1359 +#ifdef CAPI_PPP_ON_RAW_DEVICE
1360 + } else if (mp->chan_connected) {
1361 + if ((nskb = gen_data_b3_resp_for(mp, skb)) == 0) {
1362 + printk(KERN_ERR "capi: gen_data_b3_resp failed\n");
1365 + datahandle = CAPIMSG_U16(skb->data,CAPIMSG_BASELEN+4);
1366 + errcode = (*capifuncs->capi_put_message)(mp->applid, nskb);
1367 + if (errcode != CAPI_NOERROR) {
1368 + printk(KERN_ERR "capi: send DATA_B3_RESP failed=%x\n",
1373 + (void)skb_pull(skb, CAPIMSG_LEN(skb->data));
1374 +#ifdef _DEBUG_DATAFLOW
1375 + printk(KERN_DEBUG "capi: DATA_B3_RESP %u len=%d => ppp\n",
1376 + datahandle, skb->len);
1378 + ppp_input(&mp->chan, skb);
1381 } else if (mp->file) {
1382 if (skb_queue_len(&mp->recvqueue) > CAPINC_MAX_RECVQUEUE) {
1383 #if defined(_DEBUG_DATAFLOW) || defined(_DEBUG_TTYFUNCS)
1388 -static void handle_minor_recv(struct capiminor *mp)
1389 +void handle_minor_recv(struct capiminor *mp)
1391 struct sk_buff *skb;
1392 while ((skb = skb_dequeue(&mp->inqueue)) != 0) {
1393 @@ -552,13 +624,13 @@
1397 -static int handle_minor_send(struct capiminor *mp)
1398 +int handle_minor_send(struct capiminor *mp)
1400 struct sk_buff *skb;
1409 if (mp->tty && mp->ttyoutstop) {
1410 #if defined(_DEBUG_DATAFLOW) || defined(_DEBUG_TTYFUNCS)
1413 while ((skb = skb_dequeue(&mp->outqueue)) != 0) {
1414 datahandle = mp->datahandle;
1415 - len = (u16)skb->len;
1416 + len = (__u16)skb->len;
1417 skb_push(skb, CAPI_DATA_B3_REQ_LEN);
1418 memset(skb->data, 0, CAPI_DATA_B3_REQ_LEN);
1419 capimsg_setu16(skb->data, 0, CAPI_DATA_B3_REQ_LEN);
1421 capimsg_setu8 (skb->data, 5, CAPI_REQ);
1422 capimsg_setu16(skb->data, 6, mp->msgid++);
1423 capimsg_setu32(skb->data, 8, mp->ncci); /* NCCI */
1424 - capimsg_setu32(skb->data, 12, (u32) skb->data); /* Data32 */
1425 + capimsg_setu32(skb->data, 12, (__u32) skb->data); /* Data32 */
1426 capimsg_setu16(skb->data, 16, len); /* Data length */
1427 capimsg_setu16(skb->data, 18, datahandle);
1428 capimsg_setu16(skb->data, 20, 0); /* Flags */
1429 @@ -620,16 +692,16 @@
1430 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1431 /* -------- function called by lower level -------------------------- */
1433 -static void capi_signal(u16 applid, void *param)
1434 +static void capi_signal(__u16 applid, void *param)
1436 struct capidev *cdev = (struct capidev *)param;
1437 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1438 struct capiminor *mp;
1441 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1442 struct capincci *np;
1443 struct sk_buff *skb = 0;
1447 (void) (*capifuncs->capi_get_message) (applid, &skb);
1449 @@ -683,6 +755,12 @@
1452 (void)capiminor_del_ack(mp, datahandle);
1453 +#ifdef CAPI_PPP_ON_RAW_DEVICE
1454 + if (mp->chan_connected) {
1455 + ppp_output_wakeup(&mp->chan);
1460 if (mp->tty->ldisc.write_wakeup)
1461 mp->tty->ldisc.write_wakeup(mp->tty);
1463 struct capidev *cdev = (struct capidev *)file->private_data;
1464 struct sk_buff *skb;
1469 if (ppos != &file->f_pos)
1471 @@ -998,7 +1076,7 @@
1475 - nccip = capincci_find(cdev, (u32) ncci);
1476 + nccip = capincci_find(cdev, (__u32) ncci);
1479 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1480 @@ -1023,7 +1101,7 @@
1484 - nccip = capincci_find(cdev, (u32) ncci);
1485 + nccip = capincci_find(cdev, (__u32) ncci);
1486 if (!nccip || (mp = nccip->minorp) == 0)
1489 @@ -1070,7 +1148,9 @@
1491 static struct file_operations capi_fops =
1493 +#ifdef COMPAT_HAS_FILEOP_OWNER
1499 @@ -1233,6 +1313,45 @@
1503 +#ifdef CAPI_PPP_ON_RAW_DEVICE
1504 + case PPPIOCATTACH:
1507 + if (get_user(val, (int *) arg))
1509 + if (mp->chan_connected)
1511 + mp->chan.private = mp;
1515 + mp->chan.ops = &ppp_ops;
1518 + retval = ppp_register_channel(&mp->chan, val);
1521 + mp->chan_connected = 1;
1522 + mp->chan_index = val;
1525 + case PPPIOCDETACH:
1527 + if (!mp->chan_connected)
1529 + ppp_unregister_channel(&mp->chan);
1530 + mp->chan_connected = 0;
1535 + if (!mp->chan_connected)
1537 + if (put_user(mp->chan_index, (int *) arg))
1545 @@ -1260,7 +1379,9 @@
1547 static struct file_operations capinc_raw_fops =
1549 +#ifdef COMPAT_HAS_FILEOP_OWNER
1553 read: capinc_raw_read,
1554 write: capinc_raw_write,
1555 @@ -1272,7 +1393,7 @@
1557 /* -------- tty_operations for capincci ----------------------------- */
1559 -static int capinc_tty_open(struct tty_struct * tty, struct file * file)
1560 +int capinc_tty_open(struct tty_struct * tty, struct file * file)
1562 struct capiminor *mp;
1564 @@ -1300,7 +1421,7 @@
1568 -static void capinc_tty_close(struct tty_struct * tty, struct file * file)
1569 +void capinc_tty_close(struct tty_struct * tty, struct file * file)
1571 struct capiminor *mp;
1573 @@ -1325,8 +1446,8 @@
1577 -static int capinc_tty_write(struct tty_struct * tty, int from_user,
1578 - const unsigned char *buf, int count)
1579 +int capinc_tty_write(struct tty_struct * tty, int from_user,
1580 + const unsigned char *buf, int count)
1582 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1583 struct sk_buff *skb;
1584 @@ -1377,7 +1498,7 @@
1588 -static void capinc_tty_put_char(struct tty_struct *tty, unsigned char ch)
1589 +void capinc_tty_put_char(struct tty_struct *tty, unsigned char ch)
1591 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1592 struct sk_buff *skb;
1593 @@ -1414,7 +1535,7 @@
1597 -static void capinc_tty_flush_chars(struct tty_struct *tty)
1598 +void capinc_tty_flush_chars(struct tty_struct *tty)
1600 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1601 struct sk_buff *skb;
1602 @@ -1440,7 +1561,7 @@
1603 (void)handle_minor_recv(mp);
1606 -static int capinc_tty_write_room(struct tty_struct *tty)
1607 +int capinc_tty_write_room(struct tty_struct *tty)
1609 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1611 @@ -1458,7 +1579,7 @@
1615 -static int capinc_tty_chars_in_buffer(struct tty_struct *tty)
1616 +int capinc_tty_chars_in_buffer(struct tty_struct *tty)
1618 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1619 if (!mp || !mp->nccip) {
1620 @@ -1476,7 +1597,7 @@
1621 return mp->outbytes;
1624 -static int capinc_tty_ioctl(struct tty_struct *tty, struct file * file,
1625 +int capinc_tty_ioctl(struct tty_struct *tty, struct file * file,
1626 unsigned int cmd, unsigned long arg)
1629 @@ -1488,14 +1609,14 @@
1633 -static void capinc_tty_set_termios(struct tty_struct *tty, struct termios * old)
1634 +void capinc_tty_set_termios(struct tty_struct *tty, struct termios * old)
1636 #ifdef _DEBUG_TTYFUNCS
1637 printk(KERN_DEBUG "capinc_tty_set_termios\n");
1641 -static void capinc_tty_throttle(struct tty_struct * tty)
1642 +void capinc_tty_throttle(struct tty_struct * tty)
1644 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1645 #ifdef _DEBUG_TTYFUNCS
1646 @@ -1505,7 +1626,7 @@
1650 -static void capinc_tty_unthrottle(struct tty_struct * tty)
1651 +void capinc_tty_unthrottle(struct tty_struct * tty)
1653 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1654 #ifdef _DEBUG_TTYFUNCS
1655 @@ -1517,7 +1638,7 @@
1659 -static void capinc_tty_stop(struct tty_struct *tty)
1660 +void capinc_tty_stop(struct tty_struct *tty)
1662 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1663 #ifdef _DEBUG_TTYFUNCS
1664 @@ -1528,7 +1649,7 @@
1668 -static void capinc_tty_start(struct tty_struct *tty)
1669 +void capinc_tty_start(struct tty_struct *tty)
1671 struct capiminor *mp = (struct capiminor *)tty->driver_data;
1672 #ifdef _DEBUG_TTYFUNCS
1673 @@ -1540,43 +1661,49 @@
1677 -static void capinc_tty_hangup(struct tty_struct *tty)
1678 +void capinc_tty_hangup(struct tty_struct *tty)
1680 #ifdef _DEBUG_TTYFUNCS
1681 printk(KERN_DEBUG "capinc_tty_hangup\n");
1685 -static void capinc_tty_break_ctl(struct tty_struct *tty, int state)
1686 +void capinc_tty_break_ctl(struct tty_struct *tty, int state)
1688 #ifdef _DEBUG_TTYFUNCS
1689 printk(KERN_DEBUG "capinc_tty_break_ctl(%d)\n", state);
1693 -static void capinc_tty_flush_buffer(struct tty_struct *tty)
1694 +void capinc_tty_flush_buffer(struct tty_struct *tty)
1696 #ifdef _DEBUG_TTYFUNCS
1697 printk(KERN_DEBUG "capinc_tty_flush_buffer\n");
1701 -static void capinc_tty_set_ldisc(struct tty_struct *tty)
1702 +void capinc_tty_set_ldisc(struct tty_struct *tty)
1704 #ifdef _DEBUG_TTYFUNCS
1705 printk(KERN_DEBUG "capinc_tty_set_ldisc\n");
1709 -static void capinc_tty_send_xchar(struct tty_struct *tty, char ch)
1710 +void capinc_tty_send_xchar(struct tty_struct *tty, char ch)
1712 #ifdef _DEBUG_TTYFUNCS
1713 printk(KERN_DEBUG "capinc_tty_send_xchar(%d)\n", ch);
1717 -static int capinc_tty_read_proc(char *page, char **start, off_t off,
1718 - int count, int *eof, void *data)
1719 +int capinc_tty_read_proc(char *page, char **start, off_t off,
1720 + int count, int *eof, void *data)
1725 +int capinc_write_proc(struct file *file, const char *buffer,
1726 + unsigned long count, void *data)
1730 @@ -1588,7 +1715,7 @@
1731 static struct termios *capinc_tty_termios[CAPINC_NR_PORTS];
1732 static struct termios *capinc_tty_termios_locked[CAPINC_NR_PORTS];
1734 -static int capinc_tty_init(void)
1735 +int capinc_tty_init(void)
1737 struct tty_driver *drv = &capinc_tty_driver;
1739 @@ -1646,7 +1773,7 @@
1743 -static void capinc_tty_exit(void)
1744 +void capinc_tty_exit(void)
1746 struct tty_driver *drv = &capinc_tty_driver;
1748 @@ -1771,8 +1898,9 @@
1750 /* -------- init function and module interface ---------------------- */
1752 +#ifdef COMPAT_HAS_kmem_cache
1754 -static void alloc_exit(void)
1755 +static void __exit alloc_exit(void)
1757 if (capidev_cachep) {
1758 (void)kmem_cache_destroy(capidev_cachep);
1759 @@ -1837,8 +1965,9 @@
1760 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1765 -static void lower_callback(unsigned int cmd, u32 contr, void *data)
1766 +static void lower_callback(unsigned int cmd, __u32 contr, void *data)
1768 struct capi_ncciinfo *np;
1769 struct capidev *cdev;
1770 @@ -1900,15 +2029,19 @@
1774 +#ifdef HAVE_DEVFS_FS
1775 devfs_register_series (NULL, "capi/r%u", CAPINC_NR_PORTS,
1778 S_IFCHR | S_IRUSR | S_IWUSR,
1779 &capinc_raw_fops, NULL);
1781 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1782 +#ifdef HAVE_DEVFS_FS
1783 devfs_register (NULL, "isdn/capi20", DEVFS_FL_DEFAULT,
1784 capi_major, 0, S_IFCHR | S_IRUSR | S_IWUSR,
1787 printk(KERN_NOTICE "capi20: started up with major %d\n", capi_major);
1789 if ((capifuncs = attach_capi_interface(&cuser)) == 0) {
1790 @@ -1918,9 +2051,11 @@
1791 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1792 devfs_unregister_chrdev(capi_rawmajor, "capi/r%d");
1793 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1794 +#ifdef HAVE_DEVFS_FS
1795 devfs_unregister(devfs_find_handle(NULL, "capi20",
1797 DEVFS_SPECIAL_CHR, 0));
1802 @@ -1934,8 +2069,10 @@
1804 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1806 +#ifdef COMPAT_HAS_kmem_cache
1807 if (alloc_init() < 0) {
1808 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1809 +#ifdef HAVE_DEVFS_FS
1811 devfs_unregister_chrdev(capi_rawmajor, "capi/r%d");
1812 for (j = 0; j < CAPINC_NR_PORTS; j++) {
1813 @@ -1943,16 +2080,20 @@
1814 sprintf(devname, "capi/r%u", j);
1815 devfs_unregister(devfs_find_handle(NULL, devname, capi_rawmajor, j, DEVFS_SPECIAL_CHR, 0));
1819 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
1820 (void) detach_capi_interface(&cuser);
1821 devfs_unregister_chrdev(capi_major, "capi20");
1822 +#ifdef HAVE_DEVFS_FS
1823 devfs_unregister(devfs_find_handle(NULL, "capi20",
1825 DEVFS_SPECIAL_CHR, 0));
1830 +#endif /* COMPAT_HAS_kmem_cache */
1834 @@ -1975,23 +2116,31 @@
1835 static void __exit capi_exit(void)
1837 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1838 +#ifdef HAVE_DEVFS_FS
1842 +#ifdef COMPAT_HAS_kmem_cache
1847 devfs_unregister_chrdev(capi_major, "capi20");
1848 +#ifdef HAVE_DEVFS_FS
1849 devfs_unregister(devfs_find_handle(NULL, "isdn/capi20", capi_major, 0, DEVFS_SPECIAL_CHR, 0));
1852 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1854 devfs_unregister_chrdev(capi_rawmajor, "capi/r%d");
1855 +#ifdef HAVE_DEVFS_FS
1856 for (j = 0; j < CAPINC_NR_PORTS; j++) {
1858 sprintf(devname, "capi/r%u", j);
1859 devfs_unregister(devfs_find_handle(NULL, devname, capi_rawmajor, j, DEVFS_SPECIAL_CHR, 0));
1863 (void) detach_capi_interface(&cuser);
1864 printk(KERN_NOTICE "capi: Rev %s: unloaded\n", rev);
1866 diff -rNu linux-2.4.29.old/drivers/isdn/avmb1/capicmd.h linux-2.4.29/drivers/isdn/avmb1/capicmd.h
1867 --- linux-2.4.29.old/drivers/isdn/avmb1/capicmd.h 2005-03-22 14:47:56.000000000 +0100
1868 +++ linux-2.4.29/drivers/isdn/avmb1/capicmd.h 2005-03-22 15:06:44.865272224 +0100
1870 -/* $Id: capicmd.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
1871 +/* $Id: capicmd.h,v 1.4 2001/09/24 13:22:44 kai Exp $
1873 * CAPI 2.0 Interface for Linux
1875 diff -rNu linux-2.4.29.old/drivers/isdn/avmb1/capidev.h linux-2.4.29/drivers/isdn/avmb1/capidev.h
1876 --- linux-2.4.29.old/drivers/isdn/avmb1/capidev.h 2005-03-22 14:47:56.000000000 +0100
1877 +++ linux-2.4.29/drivers/isdn/avmb1/capidev.h 2005-03-22 15:06:44.880269944 +0100
1879 -/* $Id: capidev.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
1880 +/* $Id: capidev.h,v 1.8 2001/09/24 13:22:44 kai Exp $
1882 * CAPI 2.0 Interface for Linux
1884 diff -rNu linux-2.4.29.old/drivers/isdn/avmb1/capidrv.c linux-2.4.29/drivers/isdn/avmb1/capidrv.c
1885 --- linux-2.4.29.old/drivers/isdn/avmb1/capidrv.c 2005-03-22 14:47:56.000000000 +0100
1886 +++ linux-2.4.29/drivers/isdn/avmb1/capidrv.c 2005-03-22 15:06:44.918264168 +0100
1888 -/* $Id: capidrv.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
1889 +/* $Id: capidrv.c,v 1.45 2001/09/24 13:22:44 kai Exp $
1891 * ISDN4Linux Driver, using capi20 interface (kernelcapi)
1894 #include "capicmd.h"
1895 #include "capidrv.h"
1897 -static char *revision = "$Revision: 1.1.4.1 $";
1898 +static char *revision = "$Revision: 1.45 $";
1899 static int debugmode = 0;
1901 MODULE_DESCRIPTION("CAPI4Linux: Interface to ISDN4Linux");
1907 struct ncci_datahandle_queue {
1908 struct ncci_datahandle_queue *next;
1911 nccip->plcip = plcip;
1912 nccip->chan = plcip->chan;
1913 nccip->datahandle = 0;
1914 - nccip->lock = SPIN_LOCK_UNLOCKED;
1916 nccip->next = plcip->ncci_list;
1917 plcip->ncci_list = nccip;
1919 __u16 datahandle, int len)
1921 struct ncci_datahandle_queue *n, **pp;
1922 - unsigned long flags;
1924 n = (struct ncci_datahandle_queue *)
1925 kmalloc(sizeof(struct ncci_datahandle_queue), GFP_ATOMIC);
1926 @@ -491,31 +488,25 @@
1928 n->datahandle = datahandle;
1930 - spin_lock_irqsave(&nccip->lock, flags);
1931 for (pp = &nccip->ackqueue; *pp; pp = &(*pp)->next) ;
1933 - spin_unlock_irqrestore(&nccip->lock, flags);
1937 static int capidrv_del_ack(struct capidrv_ncci *nccip, __u16 datahandle)
1939 struct ncci_datahandle_queue **pp, *p;
1940 - unsigned long flags;
1943 - spin_lock_irqsave(&nccip->lock, flags);
1944 for (pp = &nccip->ackqueue; *pp; pp = &(*pp)->next) {
1945 if ((*pp)->datahandle == datahandle) {
1949 - spin_unlock_irqrestore(&nccip->lock, flags);
1954 - spin_unlock_irqrestore(&nccip->lock, flags);
1958 @@ -523,25 +514,13 @@
1960 static void send_message(capidrv_contr * card, _cmsg * cmsg)
1962 - struct sk_buff *skb;
1966 + struct sk_buff *skb;
1968 capi_cmsg2message(cmsg, cmsg->buf);
1969 len = CAPIMSG_LEN(cmsg->buf);
1970 skb = alloc_skb(len, GFP_ATOMIC);
1972 - printk(KERN_ERR "no skb len(%d) memory\n", len);
1975 memcpy(skb_put(skb, len), cmsg->buf, len);
1976 - err = (*capifuncs->capi_put_message) (global.appid, skb);
1978 - printk(KERN_WARNING "%s: capi_put_message error: %04x\n",
1979 - __FUNCTION__, err);
1983 + (*capifuncs->capi_put_message) (global.appid, skb);
1984 global.nsentctlpkt++;
1987 @@ -1932,8 +1911,10 @@
1988 (void)capidrv_del_ack(nccip, datahandle);
1992 printk(KERN_DEBUG "capidrv-%d: only %d bytes headroom, need %d\n",
1993 card->contrnr, skb_headroom(skb), msglen);
1995 memcpy(skb_push(nskb, msglen), sendcmsg.buf, msglen);
1996 errcode = (*capifuncs->capi_put_message) (global.appid, nskb);
1997 if (errcode == CAPI_NOERROR) {
1998 @@ -2035,6 +2016,52 @@
1999 send_message(card, &cmdcmsg);
2003 +static void disable_dchannel_trace(capidrv_contr *card)
2005 + __u8 manufacturer[CAPI_MANUFACTURER_LEN];
2006 + capi_version version;
2007 + __u16 contr = card->contrnr;
2009 + __u16 avmversion[3];
2011 + errcode = (*capifuncs->capi_get_manufacturer)(contr, manufacturer);
2012 + if (errcode != CAPI_NOERROR) {
2013 + printk(KERN_ERR "%s: can't get manufacturer (0x%x)\n",
2014 + card->name, errcode);
2017 + if (strstr(manufacturer, "AVM") == 0) {
2018 + printk(KERN_ERR "%s: not from AVM, no d-channel trace possible (%s)\n",
2019 + card->name, manufacturer);
2022 + errcode = (*capifuncs->capi_get_version)(contr, &version);
2023 + if (errcode != CAPI_NOERROR) {
2024 + printk(KERN_ERR "%s: can't get version (0x%x)\n",
2025 + card->name, errcode);
2028 + avmversion[0] = (version.majormanuversion >> 4) & 0x0f;
2029 + avmversion[1] = (version.majormanuversion << 4) & 0xf0;
2030 + avmversion[1] |= (version.minormanuversion >> 4) & 0x0f;
2031 + avmversion[2] |= version.minormanuversion & 0x0f;
2033 + if (avmversion[0] > 3 || (avmversion[0] == 3 && avmversion[1] > 5)) {
2034 + printk(KERN_INFO "%s: D2 trace disabled\n", card->name);
2036 + printk(KERN_INFO "%s: D3 trace disabled\n", card->name);
2038 + capi_fill_MANUFACTURER_REQ(&cmdcmsg, global.appid,
2041 + 0x214D5641, /* ManuID */
2044 + (_cstruct)"\004\000\000\000\000");
2045 + send_message(card, &cmdcmsg);
2049 static void send_listen(capidrv_contr *card)
2051 @@ -2200,10 +2227,10 @@
2052 free_ncci(card, card->bchans[card->nbchan-1].nccip);
2053 if (card->bchans[card->nbchan-1].plcip)
2054 free_plci(card, card->bchans[card->nbchan-1].plcip);
2055 + if (card->plci_list)
2056 + printk(KERN_ERR "capidrv: bug in free_plci()\n");
2059 - if (card->plci_list)
2060 - printk(KERN_ERR "capidrv: bug in free_plci()\n");
2061 kfree(card->bchans);
2064 diff -rNu linux-2.4.29.old/drivers/isdn/avmb1/capidrv.h linux-2.4.29/drivers/isdn/avmb1/capidrv.h
2065 --- linux-2.4.29.old/drivers/isdn/avmb1/capidrv.h 2005-03-22 14:47:56.000000000 +0100
2066 +++ linux-2.4.29/drivers/isdn/avmb1/capidrv.h 2005-03-22 15:06:44.935261584 +0100
2068 -/* $Id: capidrv.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
2069 +/* $Id: capidrv.h,v 1.4 2001/09/24 13:22:44 kai Exp $
2071 * ISDN4Linux Driver, using capi20 interface (kernelcapi)
2073 diff -rNu linux-2.4.29.old/drivers/isdn/avmb1/capifs.c linux-2.4.29/drivers/isdn/avmb1/capifs.c
2074 --- linux-2.4.29.old/drivers/isdn/avmb1/capifs.c 2005-03-22 14:47:56.000000000 +0100
2075 +++ linux-2.4.29/drivers/isdn/avmb1/capifs.c 2005-03-22 15:06:44.950259304 +0100
2077 -/* $Id: capifs.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
2078 +/* $Id: capifs.c,v 1.22 2001/09/24 13:22:44 kai Exp $
2080 * Copyright 2000 by Carsten Paeth <calle@calle.de>
2083 #include <linux/major.h>
2084 #include <linux/slab.h>
2085 #include <linux/ctype.h>
2086 +#include <linux/isdn_compat.h>
2087 #include <asm/bitops.h>
2088 #include <asm/uaccess.h>
2091 MODULE_AUTHOR("Carsten Paeth");
2092 MODULE_LICENSE("GPL");
2094 -static char *revision = "$Revision: 1.1.4.1 $";
2095 +static char *revision = "$Revision: 1.22 $";
2097 struct capifs_ncci {
2098 struct inode *inode;
2100 static int capifs_root_readdir(struct file *,void *,filldir_t);
2101 static struct dentry *capifs_root_lookup(struct inode *,struct dentry *);
2102 static int capifs_revalidate(struct dentry *, int);
2103 +#ifdef COMPAT_VFS_2_4
2104 static struct inode *capifs_new_inode(struct super_block *sb);
2107 static struct file_operations capifs_root_operations = {
2108 +#ifdef COMPAT_VFS_2_4
2109 read: generic_read_dir,
2111 readdir: capifs_root_readdir,
2114 struct inode_operations capifs_root_inode_operations = {
2115 +#ifndef COMPAT_VFS_2_4
2116 + default_file_ops: &capifs_root_operations, /* file operations */
2118 lookup: capifs_root_lookup,
2121 @@ -101,12 +109,20 @@
2125 +#ifdef COMPAT_VFS_2_4
2126 if (filldir(dirent, ".", 1, nr, inode->i_ino, DT_DIR) < 0)
2128 + if (filldir(dirent, ".", 1, nr, inode->i_ino) < 0)
2134 +#ifdef COMPAT_VFS_2_4
2135 if (filldir(dirent, "..", 2, nr, inode->i_ino, DT_DIR) < 0)
2137 + if (filldir(dirent, "..", 2, nr, inode->i_ino) < 0)
2142 @@ -118,7 +134,11 @@
2144 if (np->type) *p++ = np->type;
2145 sprintf(p, "%u", np->num);
2146 +#ifdef COMPAT_VFS_2_4
2147 if ( filldir(dirent, numbuf, strlen(numbuf), nr, nr, DT_UNKNOWN) < 0 )
2149 + if ( filldir(dirent, numbuf, strlen(numbuf), nr, nr) < 0 )
2156 dentry->d_inode = np->inode;
2157 if ( dentry->d_inode )
2158 - atomic_inc(&dentry->d_inode->i_count);
2159 + i_count_inc(dentry->d_inode->i_count);
2161 d_add(dentry, dentry->d_inode);
2165 for ( i = 0 ; i < sbi->max_ncci ; i++ ) {
2166 if ( (inode = sbi->nccis[i].inode) ) {
2167 - if (atomic_read(&inode->i_count) != 1 )
2168 + if (i_count_read(inode->i_count) != 1 )
2169 printk("capifs_put_super: badness: entry %d count %d\n",
2170 - i, (unsigned)atomic_read(&inode->i_count));
2171 + i, (unsigned)i_count_read(inode->i_count));
2175 @@ -213,11 +233,24 @@
2179 +#ifndef COMPAT_VFS_2_4
2180 + MOD_DEC_USE_COUNT;
2184 +#ifdef COMPAT_VFS_2_4
2185 static int capifs_statfs(struct super_block *sb, struct statfs *buf);
2187 +static int capifs_statfs(struct super_block *sb, struct statfs *buf, int bufsiz);
2188 +static void capifs_write_inode(struct inode *inode) { };
2189 +static void capifs_read_inode(struct inode *inode);
2192 static struct super_operations capifs_sops = {
2193 +#ifndef COMPAT_VFS_2_4
2194 + read_inode: capifs_read_inode,
2195 + write_inode: capifs_write_inode,
2197 put_super: capifs_put_super,
2198 statfs: capifs_statfs,
2200 @@ -288,6 +321,10 @@
2201 struct dentry * root;
2202 struct capifs_sb_info *sbi;
2204 +#ifndef COMPAT_VFS_2_4
2205 + MOD_INC_USE_COUNT;
2208 /* Super block already completed? */
2213 * Get the root inode and dentry, but defer checking for errors.
2215 +#ifdef COMPAT_VFS_2_4
2216 root_inode = capifs_new_inode(s);
2218 root_inode->i_ino = 1;
2219 @@ -331,6 +369,10 @@
2220 root_inode->i_nlink = 2;
2222 root = d_alloc_root(root_inode);
2224 + root_inode = iget(s, 1); /* inode 1 == root directory */
2225 + root = d_alloc_root(root_inode, NULL);
2229 * Check whether somebody else completed the super block.
2230 @@ -370,11 +412,34 @@
2233 out: /* Success ... somebody else completed the super block for us. */
2234 +#ifndef COMPAT_VFS_2_4
2239 +#ifndef COMPAT_VFS_2_4
2241 + MOD_DEC_USE_COUNT;
2246 +#ifndef COMPAT_VFS_2_4
2247 +static int capifs_statfs(struct super_block *sb, struct statfs *buf, int bufsiz)
2249 + struct statfs tmp;
2251 + tmp.f_type = CAPIFS_SUPER_MAGIC;
2252 + tmp.f_bsize = 1024;
2258 + tmp.f_namelen = NAME_MAX;
2259 + return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0;
2262 static int capifs_statfs(struct super_block *sb, struct statfs *buf)
2264 buf->f_type = CAPIFS_SUPER_MAGIC;
2266 buf->f_namelen = NAME_MAX;
2271 +#ifdef COMPAT_VFS_2_4
2272 static struct inode *capifs_new_inode(struct super_block *sb)
2274 struct inode *inode = new_inode(sb);
2275 @@ -399,8 +466,51 @@
2280 +static void capifs_read_inode(struct inode *inode)
2282 + ino_t ino = inode->i_ino;
2283 + struct capifs_sb_info *sbi = SBI(inode->i_sb);
2285 + inode->i_mode = 0;
2286 + inode->i_nlink = 0;
2287 + inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
2288 + inode->i_blocks = 0;
2289 + inode->i_blksize = 1024;
2290 + inode->i_uid = inode->i_gid = 0;
2293 + inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR;
2294 + inode->i_op = &capifs_root_inode_operations;
2295 + inode->i_nlink = 2;
2300 + if ( ino >= sbi->max_ncci )
2301 + return; /* Bogus */
2303 +#ifdef COMPAT_VFS_2_4
2304 + init_special_inode(inode, S_IFCHR, 0);
2306 + inode->i_mode = S_IFCHR;
2307 + inode->i_op = &chrdev_inode_operations;
2314 +#ifndef COMPAT_VFS_2_4
2315 +static struct file_system_type capifs_fs_type = {
2318 + capifs_read_super,
2322 static DECLARE_FSTYPE(capifs_fs_type, "capifs", capifs_read_super, 0);
2325 void capifs_new_ncci(char type, unsigned int num, kdev_t device)
2327 @@ -421,16 +531,26 @@
2331 +#ifdef COMPAT_VFS_2_4
2332 if ( ino >= sbi->max_ncci )
2335 if ((np->inode = capifs_new_inode(sb)) != NULL) {
2337 + if ((np->inode = iget(sb, ino+2)) != NULL) {
2339 struct inode *inode = np->inode;
2340 inode->i_uid = sbi->setuid ? sbi->uid : current->fsuid;
2341 inode->i_gid = sbi->setgid ? sbi->gid : current->fsgid;
2342 +#ifdef COMPAT_VFS_2_4
2344 inode->i_ino = ino + 2;
2345 init_special_inode(inode, sbi->mode|S_IFCHR, np->kdev);
2347 + inode->i_mode = sbi->mode | S_IFCHR;
2348 + inode->i_rdev = np->kdev;
2354 diff -rNu linux-2.4.29.old/drivers/isdn/avmb1/capifs.h linux-2.4.29/drivers/isdn/avmb1/capifs.h
2355 --- linux-2.4.29.old/drivers/isdn/avmb1/capifs.h 2005-03-22 14:47:56.000000000 +0100
2356 +++ linux-2.4.29/drivers/isdn/avmb1/capifs.h 2005-03-22 15:06:44.965257024 +0100
2358 -/* $Id: capifs.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
2359 +/* $Id: capifs.h,v 1.4 2001/09/24 13:22:44 kai Exp $
2361 * Copyright 2000 by Carsten Paeth <calle@calle.de>
2363 diff -rNu linux-2.4.29.old/drivers/isdn/avmb1/capilli.h linux-2.4.29/drivers/isdn/avmb1/capilli.h
2364 --- linux-2.4.29.old/drivers/isdn/avmb1/capilli.h 2005-03-22 14:47:56.000000000 +0100
2365 +++ linux-2.4.29/drivers/isdn/avmb1/capilli.h 2005-03-22 15:06:44.980254744 +0100
2367 -/* $Id: capilli.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
2368 +/* $Id: capilli.h,v 1.5 2001/09/24 13:22:44 kai Exp $
2370 * Kernel CAPI 2.0 Driver Interface for Linux
2372 diff -rNu linux-2.4.29.old/drivers/isdn/avmb1/capiutil.c linux-2.4.29/drivers/isdn/avmb1/capiutil.c
2373 --- linux-2.4.29.old/drivers/isdn/avmb1/capiutil.c 2005-03-22 14:47:56.000000000 +0100
2374 +++ linux-2.4.29/drivers/isdn/avmb1/capiutil.c 2005-03-22 15:06:44.997252160 +0100
2376 -/* $Id: capiutil.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
2377 +/* $Id: capiutil.c,v 1.16 2001/09/24 13:22:44 kai Exp $
2379 * CAPI 2.0 convert capi message to capi message struct
2382 #include <linux/init.h>
2383 #include <asm/segment.h>
2384 #include <linux/config.h>
2385 +#include <linux/isdn_compat.h>
2386 #include "capiutil.h"
2388 MODULE_DESCRIPTION("CAPI4Linux: CAPI message conversion support");
2389 diff -rNu linux-2.4.29.old/drivers/isdn/avmb1/capiutil.h linux-2.4.29/drivers/isdn/avmb1/capiutil.h
2390 --- linux-2.4.29.old/drivers/isdn/avmb1/capiutil.h 2005-03-22 14:47:56.000000000 +0100
2391 +++ linux-2.4.29/drivers/isdn/avmb1/capiutil.h 2005-03-22 15:06:45.040245624 +0100
2393 -/* $Id: capiutil.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
2394 +/* $Id: capiutil.h,v 1.7 2001/09/24 13:22:44 kai Exp $
2396 * CAPI 2.0 defines & types
2398 diff -rNu linux-2.4.29.old/drivers/isdn/avmb1/kcapi.c linux-2.4.29/drivers/isdn/avmb1/kcapi.c
2399 --- linux-2.4.29.old/drivers/isdn/avmb1/kcapi.c 2005-03-22 14:47:56.000000000 +0100
2400 +++ linux-2.4.29/drivers/isdn/avmb1/kcapi.c 2005-03-22 15:06:45.062242280 +0100
2402 -/* $Id: kcapi.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
2403 +/* $Id: kcapi.c,v 1.28 2001/09/24 13:22:44 kai Exp $
2405 * Kernel CAPI 2.0 Module
2408 #include <linux/proc_fs.h>
2409 #include <linux/skbuff.h>
2410 #include <linux/tqueue.h>
2411 +#include <linux/isdn_compat.h>
2412 #include <linux/capi.h>
2413 #include <linux/kernelcapi.h>
2414 #include <linux/locks.h>
2416 #include <linux/b1lli.h>
2419 -static char *revision = "$Revision: 1.1.4.1 $";
2420 +static char *revision = "$Revision: 1.28 $";
2422 /* ------------------------------------------------------------- */
2429 struct msgidqueue *msgidqueue;
2430 struct msgidqueue *msgidlast;
2431 struct msgidqueue *msgidfree;
2432 @@ -104,14 +104,14 @@
2433 #define APPL(a) (&applications[(a)-1])
2434 #define VALID_APPLID(a) ((a) && (a) <= CAPI_MAXAPPL && APPL(a)->applid == a)
2435 #define APPL_IS_FREE(a) (APPL(a)->applid == 0)
2436 -#define APPL_MARK_FREE(a) do{ APPL(a)->applid=0; MOD_DEC_USE_COUNT; }while(0)
2437 -#define APPL_MARK_USED(a) do{ APPL(a)->applid=(a); MOD_INC_USE_COUNT; }while(0)
2438 +#define APPL_MARK_FREE(a) do{ APPL(a)->applid=0; MOD_DEC_USE_COUNT; }while(0);
2439 +#define APPL_MARK_USED(a) do{ APPL(a)->applid=(a); MOD_INC_USE_COUNT; }while(0);
2441 #define NCCI2CTRL(ncci) (((ncci) >> 24) & 0x7f)
2443 #define VALID_CARD(c) ((c) > 0 && (c) <= CAPI_MAXCONTR)
2444 #define CARD(c) (&cards[(c)-1])
2445 -#define CARDNR(cp) ((((cp)-cards)+1) & 0xff)
2446 +#define CARDNR(cp) (((cp)-cards)+1)
2448 static struct capi_appl applications[CAPI_MAXAPPL];
2449 static struct capi_ctr cards[CAPI_MAXCONTR];
2450 @@ -535,9 +535,13 @@
2451 * of devices. Devices can only removed in
2452 * user process, not in bh.
2454 +#ifdef COMPAT_HAS_SCHEDULE_TASK
2456 if (schedule_task(&tq_state_notify) == 0)
2459 + queue_task(&tq_state_notify, &tq_scheduler);
2464 @@ -546,13 +550,7 @@
2465 static void notify_up(__u32 contr)
2467 struct capi_interface_user *p;
2470 - for (appl = 1; appl <= CAPI_MAXAPPL; appl++) {
2471 - if (!VALID_APPLID(appl)) continue;
2472 - if (APPL(appl)->releasing) continue;
2473 - CARD(contr)->driver->register_appl(CARD(contr), appl, &APPL(appl)->rparam);
2475 printk(KERN_NOTICE "kcapi: notify up contr %d\n", contr);
2476 spin_lock(&capi_users_lock);
2477 for (p = capi_users; p; p = p->next) {
2482 +#ifdef COMPAT_HAS_SCHEDULE_TASK
2487 /* -------- NCCI Handling ------------------------------------- */
2489 static inline void mq_init(struct capi_ncci * np)
2492 - np->lock = SPIN_LOCK_UNLOCKED;
2496 @@ -662,11 +661,8 @@
2497 static inline int mq_enqueue(struct capi_ncci * np, __u16 msgid)
2499 struct msgidqueue *mq;
2500 - spin_lock_bh(&np->lock);
2501 - if ((mq = np->msgidfree) == 0) {
2502 - spin_unlock_bh(&np->lock);
2503 + if ((mq = np->msgidfree) == 0)
2506 np->msgidfree = mq->next;
2509 @@ -676,14 +672,12 @@
2510 if (!np->msgidqueue)
2511 np->msgidqueue = mq;
2513 - spin_unlock_bh(&np->lock);
2517 static inline int mq_dequeue(struct capi_ncci * np, __u16 msgid)
2519 struct msgidqueue **pp;
2520 - spin_lock_bh(&np->lock);
2521 for (pp = &np->msgidqueue; *pp; pp = &(*pp)->next) {
2522 if ((*pp)->msgid == msgid) {
2523 struct msgidqueue *mq = *pp;
2524 @@ -693,11 +687,9 @@
2525 mq->next = np->msgidfree;
2528 - spin_unlock_bh(&np->lock);
2532 - spin_unlock_bh(&np->lock);
2536 @@ -720,16 +712,12 @@
2537 nextpp = &(*pp)->next;
2540 - if (APPL(appl)->releasing) { /* only release if the application was marked for release */
2541 - printk(KERN_DEBUG "kcapi: appl %d releasing(%d)\n", appl, APPL(appl)->releasing);
2542 - APPL(appl)->releasing--;
2543 - if (APPL(appl)->releasing <= 0) {
2544 - APPL(appl)->signal = 0;
2545 - APPL_MARK_FREE(appl);
2546 - printk(KERN_INFO "kcapi: appl %d down\n", appl);
2549 - printk(KERN_WARNING "kcapi: appl %d card%d released without request\n", appl, card->cnr);
2550 + APPL(appl)->releasing--;
2551 + if (APPL(appl)->releasing <= 0) {
2552 + APPL(appl)->signal = 0;
2553 + APPL_MARK_FREE(appl);
2554 + printk(KERN_INFO "kcapi: appl %d down\n", appl);
2559 @@ -882,7 +870,16 @@
2561 static void controllercb_ready(struct capi_ctr * card)
2565 card->cardstate = CARD_RUNNING;
2567 + for (appl = 1; appl <= CAPI_MAXAPPL; appl++) {
2568 + if (!VALID_APPLID(appl)) continue;
2569 + if (APPL(appl)->releasing) continue;
2570 + card->driver->register_appl(card, appl, &APPL(appl)->rparam);
2573 printk(KERN_NOTICE "kcapi: card %d \"%s\" ready.\n",
2574 CARDNR(card), card->name);
2576 diff -rNu linux-2.4.29.old/drivers/isdn/avmb1/t1isa.c linux-2.4.29/drivers/isdn/avmb1/t1isa.c
2577 --- linux-2.4.29.old/drivers/isdn/avmb1/t1isa.c 2005-03-22 14:47:56.000000000 +0100
2578 +++ linux-2.4.29/drivers/isdn/avmb1/t1isa.c 2005-03-22 15:06:45.078239848 +0100
2580 -/* $Id: t1isa.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
2581 +/* $Id: t1isa.c,v 1.22 2001/09/24 13:22:44 kai Exp $
2583 * Module for AVM T1 HEMA-card.
2586 #include <linux/capi.h>
2587 #include <linux/kernelcapi.h>
2588 #include <linux/init.h>
2589 +#include <linux/isdn_compat.h>
2591 #include "capicmd.h"
2592 #include "capiutil.h"
2593 #include "capilli.h"
2594 #include "avmcard.h"
2596 -static char *revision = "$Revision: 1.1.4.1 $";
2597 +static char *revision = "$Revision: 1.22 $";
2599 /* ------------------------------------------------------------- */
2601 diff -rNu linux-2.4.29.old/drivers/isdn/avmb1/t1pci.c linux-2.4.29/drivers/isdn/avmb1/t1pci.c
2602 --- linux-2.4.29.old/drivers/isdn/avmb1/t1pci.c 2005-03-22 14:47:56.000000000 +0100
2603 +++ linux-2.4.29/drivers/isdn/avmb1/t1pci.c 2005-03-22 15:06:45.094237416 +0100
2605 -/* $Id: t1pci.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
2606 +/* $Id: t1pci.c,v 1.25 2001/09/24 13:22:44 kai Exp $
2608 * Module for AVM T1 PCI-card.
2611 #include <linux/interrupt.h>
2612 #include <linux/ioport.h>
2613 #include <linux/pci.h>
2614 +#include <linux/isdn_compat.h>
2615 #include <linux/capi.h>
2616 #include <linux/init.h>
2619 #include "capilli.h"
2620 #include "avmcard.h"
2622 -static char *revision = "$Revision: 1.1.4.1 $";
2623 +static char *revision = "$Revision: 1.25 $";
2625 #undef CONFIG_T1PCI_DEBUG
2626 #undef CONFIG_T1PCI_POLLDEBUG
2628 /* ------------------------------------------------------------- */
2630 +#ifndef COMPAT_HAS_2_2_PCI
2631 static struct pci_device_id t1pci_pci_tbl[] __initdata = {
2632 { PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_T1, PCI_ANY_ID, PCI_ANY_ID },
2633 { } /* Terminating entry */
2636 MODULE_DEVICE_TABLE(pci, t1pci_pci_tbl);
2638 MODULE_DESCRIPTION("CAPI4Linux: Driver for AVM T1 PCI card");
2639 MODULE_AUTHOR("Carsten Paeth");
2640 MODULE_LICENSE("GPL");
2643 pci_set_master(dev);
2645 - param.port = pci_resource_start(dev, 1);
2646 + param.port = pci_resource_start_io(dev, 1);
2647 param.irq = dev->irq;
2648 - param.membase = pci_resource_start(dev, 0);
2649 + param.membase = pci_resource_start_mem(dev, 0);
2652 "%s: PCI BIOS reports AVM-T1-PCI at i/o %#x, irq %d, mem %#x\n",
2653 diff -rNu linux-2.4.29.old/drivers/isdn/divert/divert_procfs.c linux-2.4.29/drivers/isdn/divert/divert_procfs.c
2654 --- linux-2.4.29.old/drivers/isdn/divert/divert_procfs.c 2005-03-22 14:47:56.000000000 +0100
2655 +++ linux-2.4.29/drivers/isdn/divert/divert_procfs.c 2005-03-22 15:06:45.158227688 +0100
2657 -/* $Id: divert_procfs.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
2660 * Filesystem handling for the diversion supplementary services.
2663 #include <linux/module.h>
2664 #include <linux/version.h>
2665 #include <linux/poll.h>
2666 +#ifndef COMPAT_USE_MODCOUNT_LOCK
2667 #include <linux/smp_lock.h>
2669 #ifdef CONFIG_PROC_FS
2670 #include <linux/proc_fs.h>
2672 #include <linux/fs.h>
2674 #include <linux/isdnif.h>
2675 +#include <linux/isdn_compat.h>
2676 #include "isdn_divert.h"
2678 /*********************************/
2680 isdn_divert_read(struct file *file, char *buf, size_t count, loff_t * off)
2682 struct divert_info *inf;
2683 - loff_t pos = *off;
2686 if (!*((struct divert_info **) file->private_data)) {
2690 inf->usage_cnt--; /* new usage count */
2691 - file->private_data = &inf->next; /* next structure */
2692 + (struct divert_info **) file->private_data = &inf->next; /* next structure */
2693 if ((len = strlen(inf->info_start)) <= count) {
2694 if (copy_to_user(buf, inf->info_start, len))
2697 + file->f_pos += len;
2701 @@ -136,17 +138,23 @@
2703 unsigned long flags;
2705 +#ifdef COMPAT_USE_MODCOUNT_LOCK
2706 + MOD_INC_USE_COUNT;
2713 if (divert_info_head)
2714 - filep->private_data = &(divert_info_tail->next);
2715 + (struct divert_info **) filep->private_data = &(divert_info_tail->next);
2717 - filep->private_data = &divert_info_head;
2718 + (struct divert_info **) filep->private_data = &divert_info_head;
2719 restore_flags(flags);
2720 /* start_divert(); */
2721 +#ifndef COMPAT_USE_MODCOUNT_LOCK
2725 } /* isdn_divert_open */
2728 struct divert_info *inf;
2729 unsigned long flags;
2731 +#ifndef COMPAT_USE_MODCOUNT_LOCK
2737 @@ -175,7 +185,11 @@
2738 divert_info_head = divert_info_head->next;
2741 +#ifdef COMPAT_USE_MODCOUNT_LOCK
2742 + MOD_DEC_USE_COUNT;
2747 } /* isdn_divert_close */
2750 open: isdn_divert_open,
2751 release: isdn_divert_close,
2753 +#ifdef COMPAT_NO_SOFTNET
2754 +struct inode_operations divert_file_inode_operations;
2757 /****************************/
2758 /* isdn subdir in /proc/net */
2759 @@ -302,8 +319,16 @@
2760 remove_proc_entry("isdn", proc_net);
2763 +#ifdef COMPAT_NO_SOFTNET
2764 + memset(&divert_file_inode_operations, 0, sizeof(struct inode_operations));
2765 + divert_file_inode_operations.default_file_ops = &isdn_fops;
2766 + isdn_divert_entry->ops = &divert_file_inode_operations;
2768 isdn_divert_entry->proc_fops = &isdn_fops;
2769 +#ifdef COMPAT_HAS_FILEOP_OWNER
2770 isdn_divert_entry->owner = THIS_MODULE;
2772 +#endif /* COMPAT_NO_SOFTNET */
2773 #endif /* CONFIG_PROC_FS */
2776 diff -rNu linux-2.4.29.old/drivers/isdn/divert/isdn_divert.c linux-2.4.29/drivers/isdn/divert/isdn_divert.c
2777 --- linux-2.4.29.old/drivers/isdn/divert/isdn_divert.c 2005-03-22 14:47:56.000000000 +0100
2778 +++ linux-2.4.29/drivers/isdn/divert/isdn_divert.c 2005-03-22 15:06:45.173225408 +0100
2780 -/* $Id: isdn_divert.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
2783 * DSS1 main diversion supplementary handling for i4l.
2786 restore_flags(flags);
2789 + case NETWORK_DIAL:
2790 + divert_if.dial_net_name(cs->deflect_dest);
2792 case DEFLECT_AUTODEL:
2796 case DEFLECT_PROCEED:
2797 case DEFLECT_REPORT:
2798 case DEFLECT_REJECT:
2799 + case NETWORK_DIAL:
2800 if (dv->rule.action == DEFLECT_PROCEED)
2801 if ((!if_used) || ((!extern_wait_max) && (!dv->rule.waittime)))
2802 return(0); /* no external deflection needed */
2803 @@ -495,6 +499,11 @@
2805 { cs->deflect_dest[0] = '\0';
2806 retval = 4; /* only proceed */
2807 + if (cs->akt_state == NETWORK_DIAL) {
2808 + strcpy(cs->deflect_dest,dv->rule.to_nr);
2809 + cs->timer.expires = jiffies + 10;
2813 sprintf(cs->info,"%d 0x%lx %s %s %s %s 0x%x 0x%x %d %d %s\n",
2815 @@ -739,6 +748,18 @@
2820 + sprintf(st, "0x%lx 0x%lx",ic->arg, ic->parm.dss1_io.ll_id);
2821 + p = st + strlen(st);
2822 + p1 = ic->parm.dss1_io.data;
2823 + i = ic->parm.dss1_io.datalen;
2824 + while ((i > 0) && (p - st < 530))
2825 + { p += sprintf(p," %02x",(*p1++) & 0xFF);
2829 + put_info_buffer(st);
2834 diff -rNu linux-2.4.29.old/drivers/isdn/divert/isdn_divert.h linux-2.4.29/drivers/isdn/divert/isdn_divert.h
2835 --- linux-2.4.29.old/drivers/isdn/divert/isdn_divert.h 2005-03-22 14:47:56.000000000 +0100
2836 +++ linux-2.4.29/drivers/isdn/divert/isdn_divert.h 2005-03-22 15:06:45.189222976 +0100
2838 -/* $Id: isdn_divert.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
2841 * Header for the diversion supplementary ioctl interface.
2844 #define DEFLECT_PROCEED 2 /* deflect when externally triggered */
2845 #define DEFLECT_ALERT 3 /* alert and deflect after delay */
2846 #define DEFLECT_REJECT 4 /* reject immediately */
2847 -#define DIVERT_ACTIVATE 5 /* diversion activate */
2848 -#define DIVERT_DEACTIVATE 6 /* diversion deactivate */
2849 -#define DIVERT_REPORT 7 /* interrogation result */
2850 +#define NETWORK_DIAL 5 /* dial a network interface */
2851 +#define DIVERT_ACTIVATE 16 /* diversion activate */
2852 +#define DIVERT_DEACTIVATE 17 /* diversion deactivate */
2853 +#define DIVERT_REPORT 18 /* interrogation result */
2854 #define DEFLECT_AUTODEL 255 /* only for internal use */
2856 #define DEFLECT_ALL_IDS 0xFFFFFFFF /* all drivers selected */
2858 2 = report call, send proceed, wait max waittime secs
2859 3 = report call, alert and deflect after waittime
2860 4 = report call, reject immediately
2861 + 5 = dial net interface specified in to_nr
2862 actions 1-2 only take place if interface is opened
2864 u_char waittime; /* maximum wait time for proceeding */
2865 diff -rNu linux-2.4.29.old/drivers/isdn/eicon/Divas_mod.c linux-2.4.29/drivers/isdn/eicon/Divas_mod.c
2866 --- linux-2.4.29.old/drivers/isdn/eicon/Divas_mod.c 2005-03-22 14:47:56.000000000 +0100
2867 +++ linux-2.4.29/drivers/isdn/eicon/Divas_mod.c 2005-03-22 15:06:45.229216896 +0100
2869 #include "adapter.h"
2872 +#include <linux/isdn_compat.h>
2874 MODULE_DESCRIPTION("ISDN4Linux: Driver for Eicon Diva Server cards");
2875 MODULE_AUTHOR("Armin Schindler");
2876 diff -rNu linux-2.4.29.old/drivers/isdn/eicon/common.c linux-2.4.29/drivers/isdn/eicon/common.c
2877 --- linux-2.4.29.old/drivers/isdn/eicon/common.c 2005-03-22 14:47:56.000000000 +0100
2878 +++ linux-2.4.29/drivers/isdn/eicon/common.c 2005-03-22 15:06:45.301205952 +0100
2883 - if (card->state == DIA_RUNNING)
2884 - DivaDoCardDpc(card);
2886 + DivaDoCardDpc(card++);
2890 diff -rNu linux-2.4.29.old/drivers/isdn/eicon/eicon.h linux-2.4.29/drivers/isdn/eicon/eicon.h
2891 --- linux-2.4.29.old/drivers/isdn/eicon/eicon.h 2005-03-22 14:47:56.000000000 +0100
2892 +++ linux-2.4.29/drivers/isdn/eicon/eicon.h 2005-03-22 15:06:45.371195312 +0100
2894 -/* $Id: eicon.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
2895 +/* $Id: eicon.h,v 1.26 2001/09/24 13:22:47 kai Exp $
2897 * ISDN low-level module for Eicon active ISDN-Cards.
2899 @@ -348,19 +348,19 @@
2900 extern char *eicon_ctype_name[];
2903 -static inline void eicon_schedule_tx(eicon_card *card)
2904 +extern __inline__ void eicon_schedule_tx(eicon_card *card)
2906 queue_task(&card->snd_tq, &tq_immediate);
2907 mark_bh(IMMEDIATE_BH);
2910 -static inline void eicon_schedule_rx(eicon_card *card)
2911 +extern __inline__ void eicon_schedule_rx(eicon_card *card)
2913 queue_task(&card->rcv_tq, &tq_immediate);
2914 mark_bh(IMMEDIATE_BH);
2917 -static inline void eicon_schedule_ack(eicon_card *card)
2918 +extern __inline__ void eicon_schedule_ack(eicon_card *card)
2920 queue_task(&card->ack_tq, &tq_immediate);
2921 mark_bh(IMMEDIATE_BH);
2922 diff -rNu linux-2.4.29.old/drivers/isdn/eicon/eicon_dsp.h linux-2.4.29/drivers/isdn/eicon/eicon_dsp.h
2923 --- linux-2.4.29.old/drivers/isdn/eicon/eicon_dsp.h 2005-03-22 14:47:56.000000000 +0100
2924 +++ linux-2.4.29/drivers/isdn/eicon/eicon_dsp.h 2005-03-22 15:06:45.386193032 +0100
2926 -/* $Id: eicon_dsp.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
2927 +/* $Id: eicon_dsp.h,v 1.8 2001/09/24 13:22:47 kai Exp $
2929 * ISDN lowlevel-module for Eicon active cards.
2931 diff -rNu linux-2.4.29.old/drivers/isdn/eicon/eicon_idi.c linux-2.4.29/drivers/isdn/eicon/eicon_idi.c
2932 --- linux-2.4.29.old/drivers/isdn/eicon/eicon_idi.c 2005-03-22 14:47:56.000000000 +0100
2933 +++ linux-2.4.29/drivers/isdn/eicon/eicon_idi.c 2005-03-22 15:06:45.421187712 +0100
2935 -/* $Id: eicon_idi.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
2936 +/* $Id: eicon_idi.c,v 1.45 2001/11/07 22:35:48 kai Exp $
2938 * ISDN lowlevel-module for Eicon active cards.
2942 #undef EICON_FULL_SERVICE_OKTETT
2944 -char *eicon_idi_revision = "$Revision: 1.1.4.1 $";
2945 +char *eicon_idi_revision = "$Revision: 1.45 $";
2947 eicon_manifbuf *manbuf;
2949 @@ -1583,6 +1583,37 @@
2954 + eicon_sff_dochead *doc = (eicon_sff_dochead *)skb->data;
2955 + eicon_sff_pagehead *page = (eicon_sff_pagehead *)skb->data + sizeof(eicon_sff_dochead);
2957 + printk(KERN_DEBUG"SFF: doc %d / page %d (skb : %d)\n",
2958 + sizeof(eicon_sff_dochead),
2959 + sizeof(eicon_sff_pagehead), skb->len);
2961 + if (skb->len >= sizeof(eicon_sff_dochead)) {
2962 + printk(KERN_DEBUG"SFF: id = 0x%x\n", doc->id);
2963 + printk(KERN_DEBUG"SFF: version = 0x%x\n", doc->version);
2964 + printk(KERN_DEBUG"SFF: reserved1 = 0x%x\n", doc->reserved1);
2965 + printk(KERN_DEBUG"SFF: userinfo = 0x%x\n", doc->userinfo);
2966 + printk(KERN_DEBUG"SFF: pagecount = 0x%x\n", doc->pagecount);
2967 + printk(KERN_DEBUG"SFF: off1pagehead = 0x%x\n", doc->off1pagehead);
2968 + printk(KERN_DEBUG"SFF: offnpagehead = 0x%x\n", doc->offnpagehead);
2969 + printk(KERN_DEBUG"SFF: offdocend = 0x%x\n", doc->offdocend);
2971 + if (skb->len >= (sizeof(eicon_sff_dochead) + sizeof(eicon_sff_pagehead))) {
2972 + printk(KERN_DEBUG"SFFp: id = 0x%x\n", page->pageheadid);
2973 + printk(KERN_DEBUG"SFFp: len = 0x%x\n", page->pageheadlen);
2974 + printk(KERN_DEBUG"SFFp: resvert = 0x%x\n", page->resvert);
2975 + printk(KERN_DEBUG"SFFp: reshoriz = 0x%x\n", page->reshoriz);
2976 + printk(KERN_DEBUG"SFFp: coding = 0x%x\n", page->coding);
2977 + printk(KERN_DEBUG"SFFp: reserved2 = 0x%x\n", page->reserved2);
2978 + printk(KERN_DEBUG"SFFp: linelength = 0x%x\n", page->linelength);
2979 + printk(KERN_DEBUG"SFFp: pagelength = 0x%x\n", page->pagelength);
2980 + printk(KERN_DEBUG"SFFp: offprevpage = 0x%x\n", page->offprevpage);
2981 + printk(KERN_DEBUG"SFFp: offnextpage = 0x%x\n", page->offnextpage);
2986 if (chan->fax->direction == ISDN_TTY_FAX_CONN_IN) {
2987 @@ -2054,8 +2085,7 @@
2991 - *(__u16 *) OutBuf.Next = (__u16) LineBuf.Len;
2992 - OutBuf.Next += sizeof(__u16);
2993 + *((__u16 *) OutBuf.Next)++ = (__u16) LineBuf.Len;
2996 memcpy(OutBuf.Next, LineBuf.Data, LineBuf.Len);
2997 @@ -2385,6 +2415,12 @@
3000 idi_do_req(ccard, chan, REMOVE, 1);
3002 + if (chan->e.D3Id) {
3003 + idi_do_req(ccard, chan, REMOVE, 0);
3004 + idi_do_req(ccard, chan, ASSIGN, 0);
3007 chan->statectrl &= ~WAITING_FOR_HANGUP;
3008 chan->statectrl &= ~IN_HOLD;
3009 if (chan->statectrl & HAVE_CONN_REQ) {
3010 diff -rNu linux-2.4.29.old/drivers/isdn/eicon/eicon_idi.h linux-2.4.29/drivers/isdn/eicon/eicon_idi.h
3011 --- linux-2.4.29.old/drivers/isdn/eicon/eicon_idi.h 2005-03-22 14:47:56.000000000 +0100
3012 +++ linux-2.4.29/drivers/isdn/eicon/eicon_idi.h 2005-03-22 15:06:45.437185280 +0100
3014 -/* $Id: eicon_idi.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
3015 +/* $Id: eicon_idi.h,v 1.12 2001/09/24 13:22:47 kai Exp $
3017 * ISDN lowlevel-module for the Eicon active cards.
3019 diff -rNu linux-2.4.29.old/drivers/isdn/eicon/eicon_io.c linux-2.4.29/drivers/isdn/eicon/eicon_io.c
3020 --- linux-2.4.29.old/drivers/isdn/eicon/eicon_io.c 2005-03-22 14:47:56.000000000 +0100
3021 +++ linux-2.4.29/drivers/isdn/eicon/eicon_io.c 2005-03-22 15:06:45.453182848 +0100
3023 -/* $Id: eicon_io.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
3024 +/* $Id: eicon_io.c,v 1.15 2001/09/24 13:22:47 kai Exp $
3026 * ISDN low-level module for Eicon active ISDN-Cards.
3027 * Code for communicating with hardware.
3028 diff -rNu linux-2.4.29.old/drivers/isdn/eicon/eicon_isa.c linux-2.4.29/drivers/isdn/eicon/eicon_isa.c
3029 --- linux-2.4.29.old/drivers/isdn/eicon/eicon_isa.c 2005-03-22 14:47:56.000000000 +0100
3030 +++ linux-2.4.29/drivers/isdn/eicon/eicon_isa.c 2005-03-22 15:06:45.469180416 +0100
3032 -/* $Id: eicon_isa.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
3033 +/* $Id: eicon_isa.c,v 1.18 2001/11/07 22:35:48 kai Exp $
3035 * ISDN low-level module for Eicon active ISDN-Cards.
3036 * Hardware-specific code for old ISA cards.
3038 #define release_shmem release_region
3039 #define request_shmem request_region
3041 -char *eicon_isa_revision = "$Revision: 1.1.4.1 $";
3042 +char *eicon_isa_revision = "$Revision: 1.18 $";
3044 #undef EICON_MCA_DEBUG
3048 eicon_isa_release_shmem(eicon_isa_card *card) {
3050 +#ifdef COMPAT_HAS_ISA_IOREMAP
3051 iounmap(card->shmem);
3052 release_mem_region(card->physmem, card->ramsize);
3054 + release_shmem((unsigned long)card->shmem, card->ramsize);
3063 +#ifdef COMPAT_HAS_ISA_IOREMAP
3064 if (check_mem_region(Mem, RAMSIZE)) {
3066 + if (check_shmem(Mem, RAMSIZE)) {
3068 printk(KERN_WARNING "eicon_isa_boot: memory at 0x%x already in use.\n", Mem);
3072 +#ifdef COMPAT_HAS_ISA_IOREMAP
3073 amem = (unsigned long) ioremap(Mem, RAMSIZE);
3075 + amem = (unsigned long) Mem;
3077 writew(0x55aa, amem + 0x402);
3078 if (readw(amem + 0x402) != 0x55aa) primary = 0;
3079 writew(0, amem + 0x402);
3080 @@ -109,12 +121,16 @@
3082 printk(KERN_INFO "Eicon: assuming pri card at 0x%x\n", Mem);
3083 writeb(0, amem + 0x3ffe);
3084 +#ifdef COMPAT_HAS_ISA_IOREMAP
3085 iounmap((unsigned char *)amem);
3087 return EICON_CTYPE_ISAPRI;
3089 printk(KERN_INFO "Eicon: assuming bri card at 0x%x\n", Mem);
3090 writeb(0, amem + 0x400);
3091 +#ifdef COMPAT_HAS_ISA_IOREMAP
3092 iounmap((unsigned char *)amem);
3094 return EICON_CTYPE_ISABRI;
3099 card->ramsize = RAMSIZE;
3101 +#ifdef COMPAT_HAS_ISA_IOREMAP
3102 if (check_mem_region(card->physmem, card->ramsize)) {
3103 printk(KERN_WARNING "eicon_isa_boot: memory at 0x%lx already in use.\n",
3105 @@ -159,6 +176,16 @@
3107 request_mem_region(card->physmem, card->ramsize, "Eicon ISA ISDN");
3108 card->shmem = (eicon_isa_shmem *) ioremap(card->physmem, card->ramsize);
3110 + /* Register shmem */
3111 + if (check_shmem((unsigned long)card->shmem, card->ramsize)) {
3112 + printk(KERN_WARNING "eicon_isa_boot: memory at 0x%lx already in use.\n",
3113 + (unsigned long)card->shmem);
3117 + request_shmem((unsigned long)card->shmem, card->ramsize, "Eicon ISA ISDN");
3119 #ifdef EICON_MCA_DEBUG
3120 printk(KERN_INFO "eicon_isa_boot: card->ramsize = %d.\n", card->ramsize);
3122 diff -rNu linux-2.4.29.old/drivers/isdn/eicon/eicon_isa.h linux-2.4.29/drivers/isdn/eicon/eicon_isa.h
3123 --- linux-2.4.29.old/drivers/isdn/eicon/eicon_isa.h 2005-03-22 14:47:56.000000000 +0100
3124 +++ linux-2.4.29/drivers/isdn/eicon/eicon_isa.h 2005-03-22 15:06:45.485177984 +0100
3126 -/* $Id: eicon_isa.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
3127 +/* $Id: eicon_isa.h,v 1.11 2001/09/24 13:22:47 kai Exp $
3129 * ISDN low-level module for Eicon active ISDN-Cards.
3131 diff -rNu linux-2.4.29.old/drivers/isdn/eicon/eicon_mod.c linux-2.4.29/drivers/isdn/eicon/eicon_mod.c
3132 --- linux-2.4.29.old/drivers/isdn/eicon/eicon_mod.c 2005-03-22 14:47:56.000000000 +0100
3133 +++ linux-2.4.29/drivers/isdn/eicon/eicon_mod.c 2005-03-22 15:06:45.505174944 +0100
3135 -/* $Id: eicon_mod.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
3136 +/* $Id: eicon_mod.c,v 1.44 2001/11/20 09:48:25 armin Exp $
3138 * ISDN lowlevel-module for Eicon active cards.
3141 static eicon_card *cards = (eicon_card *) NULL; /* glob. var , contains
3142 start of card-list */
3144 -static char *eicon_revision = "$Revision: 1.1.4.1 $";
3145 +static char *eicon_revision = "$Revision: 1.44 $";
3147 extern char *eicon_pci_revision;
3148 extern char *eicon_isa_revision;
3149 @@ -639,6 +639,18 @@
3151 if_writecmd(const u_char * buf, int len, int user, int id, int channel)
3154 + /* Not yet used */
3155 + eicon_card *card = eicon_findcard(id);
3158 + if (!card->flags & EICON_FLAGS_RUNNING)
3163 + "eicon: if_writecmd called with invalid driverId!\n");
3168 @@ -665,11 +677,8 @@
3173 - spin_unlock_irqrestore(&eicon_lock, flags);
3175 copy_to_user(p, skb->data, cnt);
3176 - spin_lock_irqsave(&eicon_lock, flags);
3179 memcpy(p, skb->data, cnt);
3181 @@ -1459,6 +1468,7 @@
3185 +#ifdef COMPAT_HAS_NEW_SETUP
3187 eicon_setup(char *line)
3189 @@ -1467,6 +1477,12 @@
3192 str = get_options(line, 4, ints);
3195 +eicon_setup(char *str, int *ints)
3202 @@ -1494,9 +1510,13 @@
3204 printk(KERN_INFO "Eicon ISDN active driver setup\n");
3206 +#ifdef COMPAT_HAS_NEW_SETUP
3209 __setup("eicon=", eicon_setup);
3216 diff -rNu linux-2.4.29.old/drivers/isdn/eicon/eicon_pci.c linux-2.4.29/drivers/isdn/eicon/eicon_pci.c
3217 --- linux-2.4.29.old/drivers/isdn/eicon/eicon_pci.c 2005-03-22 14:47:56.000000000 +0100
3218 +++ linux-2.4.29/drivers/isdn/eicon/eicon_pci.c 2005-03-22 15:06:45.522172360 +0100
3220 -/* $Id: eicon_pci.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
3221 +/* $Id: eicon_pci.c,v 1.18 2001/09/24 13:22:47 kai Exp $
3223 * ISDN low-level module for Eicon active ISDN-Cards.
3224 * Hardware-specific code for PCI cards.
3226 #include "adapter.h"
3229 -char *eicon_pci_revision = "$Revision: 1.1.4.1 $";
3230 +char *eicon_pci_revision = "$Revision: 1.18 $";
3232 #if CONFIG_PCI /* intire stuff is only for PCI */
3233 #ifdef CONFIG_ISDN_DRV_EICON_PCI
3234 diff -rNu linux-2.4.29.old/drivers/isdn/eicon/eicon_pci.h linux-2.4.29/drivers/isdn/eicon/eicon_pci.h
3235 --- linux-2.4.29.old/drivers/isdn/eicon/eicon_pci.h 2005-03-22 14:47:56.000000000 +0100
3236 +++ linux-2.4.29/drivers/isdn/eicon/eicon_pci.h 2005-03-22 15:06:45.538169928 +0100
3238 -/* $Id: eicon_pci.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
3239 +/* $Id: eicon_pci.h,v 1.7 2001/09/24 13:22:47 kai Exp $
3241 * ISDN low-level module for Eicon active ISDN-Cards (PCI part).
3243 diff -rNu linux-2.4.29.old/drivers/isdn/eicon/fourbri.c linux-2.4.29/drivers/isdn/eicon/fourbri.c
3244 --- linux-2.4.29.old/drivers/isdn/eicon/fourbri.c 2005-03-22 14:47:56.000000000 +0100
3245 +++ linux-2.4.29/drivers/isdn/eicon/fourbri.c 2005-03-22 15:06:45.553167648 +0100
3247 static int diva_server_4bri_start(card_t *card, byte *channels)
3255 DPRINTF(("divas: start Diva Server 4BRI"));
3256 diff -rNu linux-2.4.29.old/drivers/isdn/eicon/kprintf.c linux-2.4.29/drivers/isdn/eicon/kprintf.c
3257 --- linux-2.4.29.old/drivers/isdn/eicon/kprintf.c 2005-03-22 14:47:56.000000000 +0100
3258 +++ linux-2.4.29/drivers/isdn/eicon/kprintf.c 2005-03-22 15:06:45.601160352 +0100
3260 #include "divalog.h"
3264 + * Implementation of printf and sprintf for kernel
3267 +#define MAX_BUFF (80) /* limit size of temporary buffers */
3269 +#define WRITE_CHAR(BUFFER, SIZE, C) \
3270 + if (--(SIZE) < 0) { (BUFFER)--; *(BUFFER) = '\0'; return; } *(BUFFER)++ = (C)
3274 + * convert a number to decimal ASCII
3278 +void do_decimal( char *temp,
3280 + unsigned int value,
3288 + for (i = 1; i < temp_len; i++)
3290 + temp[i] = (char) ((value % 10) + (int) '0');
3294 + for (i = (temp_len - 1); temp[i] == '0'; i--)
3313 + * convert a number to octal ASCII
3317 +void do_octal( char *temp,
3318 + unsigned int value,
3326 + for (i = 1; i <= 11; i++)
3328 + temp[i] = (char) ((value & 07) + (int) '0');
3333 + for (i = 11; temp[i] == '0'; i--)
3352 + * convert a number to hex ASCII
3356 +void do_hex( char *temp,
3357 + unsigned int value,
3363 + char *dec_to_hex = "0123456789abcdef";
3367 + for (i = 1; i <= 8; i++)
3369 + temp[i] = dec_to_hex[value & 0x0f];
3373 + for (i = 8; temp[i] == '0'; i--)
3392 + * convert a buffer to ASCII HEX
3396 +void do_buffer( char *buffer,
3402 + char hex_char [] = "0123456789abcdef";
3407 + length = (length >= ((MAX_BUFF / 3) + 1)) ? (MAX_BUFF / 3) : length;
3411 + hex_byte = (int) *b++;
3412 + nybble = (hex_byte >> 4) & 0xf;
3413 + *s++ = hex_char[nybble];
3414 + nybble = hex_byte & 0xf;
3415 + *s++ = hex_char[nybble];
3425 + * Body of sprintf function: behaves just like standard sprintf, except we
3426 + * have an extra argument (buffer size) which we use to ensure we don't
3430 +void Divas_vsprintf( char *buffer,
3436 + char c; /* single character buffer */
3437 + int i; /* handy scratch counter */
3438 + int f; /* format character (after %) */
3439 + char *str; /* pointer into string */
3440 + char temp[20]; /* temp buffer used in printing numbers */
3441 + char string[MAX_BUFF]; /* output from number conversion */
3442 + int length; /* length of string "str" */
3443 + char fill; /* fill character ' ' or '0' */
3444 + boolean_t leftjust; /* TRUE if left justified, else right justified */
3445 + int fmax, fmin; /* field specifiers % MIN . MAX s */
3446 + int leading; /* number of leading/trailing fill characters */
3447 + char sign; /* set to '-' for negative decimals */
3448 + int number; /* numeric argument */
3450 + char *buff_ptr; /* pointer to user's buffer of hex data */
3451 + int buff_len; /* length of hex data */
3453 + /* make sure we have somthing to write into */
3455 + if ((!buffer) || (size <= 0))
3462 + /* echo characters until end or '%' encountered */
3464 + while ((c = *fmt++) != '%')
3471 + WRITE_CHAR(buffer, size, c);
3474 + /* echo %% as % */
3478 + WRITE_CHAR(buffer, size, *fmt);
3482 + /* %- turns on left-justify */
3484 + if ((leftjust = (boolean_t) ((*fmt == '-') ? TRUE : FALSE)))
3489 + /* %0 turns on zero filling */
3500 + /* minium field width specifier for %d, u, x, c, s */
3506 + fmin = va_arg(argptr, int);
3511 + while ('0' <= *fmt && *fmt <= '9')
3513 + fmin = (fmin * 10) + (*fmt++ - '0');
3517 + /* maximum string width specifier for %s */
3523 + if (*(++fmt) == '*')
3525 + fmax = va_arg(argptr, int);
3530 + while ('0' <= *fmt && *fmt <= '9')
3532 + fmax = (fmax * 10) + (*fmt++ - '0');
3537 + /* skip over 'l' option (ints are assumed same size as longs) */
3544 + /* get the format chacater */
3546 + if (!(f = *fmt++))
3548 + WRITE_CHAR(buffer, size, '%');
3553 + sign = '\0'; /* sign == '-' for negative decimal */
3560 + string[0] = (char) va_arg(argptr, int);
3567 + str = va_arg(argptr, char *);
3573 + number = va_arg(argptr, int);
3579 + do_decimal(temp, DIM(temp), (unsigned int) number, str);
3585 + number = va_arg(argptr, int);
3586 + do_decimal(temp, DIM(temp), (unsigned int) number, str);
3592 + number = va_arg(argptr, int);
3593 + do_octal(temp, (unsigned int) number, str);
3599 + number = va_arg(argptr, int);
3600 + do_hex(temp, (unsigned int) number, str);
3606 + buff_ptr = va_arg(argptr, char *);
3607 + buff_len = va_arg(argptr, int);
3608 + do_buffer(buff_ptr, buff_len, str);
3613 + WRITE_CHAR(buffer, size, ((char) f));
3617 + /* get the length of the string */
3620 + while (str[length])
3625 + /* make sure we have fmax and fmin values that are O.K. */
3627 + if (fmin > DIM(string) || fmin < 0)
3632 + if (fmax > DIM(string) || fmax < 0)
3637 + /* figure out how many leading characters thare are */
3645 + if (length > fmax)
3653 + leading = fmin - length;
3662 + /* output sign now, if fill is numeric */
3664 + if (sign == '-' && fill == '0')
3666 + WRITE_CHAR(buffer, size, '-');
3669 + /* if right justified, output fill characters */
3673 + for (i = 0; i < leading; i++)
3675 + WRITE_CHAR(buffer, size, fill);
3679 + /* output sign now, if fill is spaces */
3681 + if (sign == '-' && fill == ' ')
3683 + WRITE_CHAR(buffer, size, '-');
3686 + /* now the actual value */
3688 + for (i = 0; i < length; i++)
3690 + WRITE_CHAR(buffer, size, str[i]);
3693 + /* if left justified, fill out with the fill character */
3697 + for (i = 0; i < leading; i++)
3699 + WRITE_CHAR(buffer, size, fill);
3706 + * sprintf for kernel
3708 + * call our vsprintf assuming user has a big buffer....
3711 +void DivasSprintf(char *buffer, char *fmt, ...)
3714 + va_list argptr; /* pointer to additional args */
3716 + va_start(argptr, fmt);
3718 + Divas_vsprintf(buffer, 1024, fmt, argptr);
3725 void DivasPrintf(char *fmt, ...)
3730 /* call vsprintf to format the user's information */
3732 - vsnprintf(log.buffer, DIM(log.buffer), fmt, argptr);
3733 + Divas_vsprintf(log.buffer, DIM(log.buffer), fmt, argptr);
3737 diff -rNu linux-2.4.29.old/drivers/isdn/eicon/lincfg.c linux-2.4.29/drivers/isdn/eicon/lincfg.c
3738 --- linux-2.4.29.old/drivers/isdn/eicon/lincfg.c 2005-03-22 14:47:56.000000000 +0100
3739 +++ linux-2.4.29/drivers/isdn/eicon/lincfg.c 2005-03-22 15:06:45.620157464 +0100
3743 #include <linux/pci.h>
3744 +#ifndef COMPAT_HAS_2_2_PCI
3745 +#include <linux/pci_ids.h>
3747 #include <linux/kernel.h>
3748 #include <linux/ioport.h>
3750 diff -rNu linux-2.4.29.old/drivers/isdn/eicon/linchr.c linux-2.4.29/drivers/isdn/eicon/linchr.c
3751 --- linux-2.4.29.old/drivers/isdn/eicon/linchr.c 2005-03-22 14:47:56.000000000 +0100
3752 +++ linux-2.4.29/drivers/isdn/eicon/linchr.c 2005-03-22 15:06:45.635155184 +0100
3753 @@ -154,17 +154,17 @@
3756 if (BufferSize < sizeof(klog_t))
3758 + printk(KERN_WARNING "Divas: Divalog buffer specifed a size that is too small (%d - %d required)\n",
3759 + BufferSize, sizeof(klog_t));
3763 pHeadItem = (klog_t *) DivasLogFifoRead();
3767 - if(copy_to_user(pClientLogBuffer, pHeadItem, sizeof(klog_t)))
3772 + memcpy(pClientLogBuffer, pHeadItem, sizeof(klog_t));
3774 return sizeof(klog_t);
3776 diff -rNu linux-2.4.29.old/drivers/isdn/eicon/linio.c linux-2.4.29/drivers/isdn/eicon/linio.c
3777 --- linux-2.4.29.old/drivers/isdn/eicon/linio.c 2005-03-22 14:47:56.000000000 +0100
3778 +++ linux-2.4.29/drivers/isdn/eicon/linio.c 2005-03-22 15:06:45.651152752 +0100
3780 #include <linux/slab.h>
3781 #include <linux/pci.h>
3782 #include <linux/delay.h>
3783 +#include <linux/isdn_compat.h>
3787 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/Makefile linux-2.4.29/drivers/isdn/hisax/Makefile
3788 --- linux-2.4.29.old/drivers/isdn/hisax/Makefile 2005-03-22 14:47:56.000000000 +0100
3789 +++ linux-2.4.29/drivers/isdn/hisax/Makefile 2005-03-22 15:06:45.819127216 +0100
3792 O_TARGET := vmlinux-obj.o
3794 -# Define maximum number of cards
3796 -EXTRA_CFLAGS += -DHISAX_MAX_CARDS=$(CONFIG_HISAX_MAX_CARDS)
3798 # Objects that export symbols.
3800 -export-objs := config.o hisax_isac.o isdnhdlc.o
3801 +export-objs := config.o fsm.o hisax_isac.o
3803 # Multipart objects.
3805 list-multi := hisax.o hisax_st5481.o
3806 hisax-objs := config.o isdnl1.o tei.o isdnl2.o isdnl3.o \
3807 lmgr.o q931.o callc.o fsm.o cert.o
3808 -hisax_st5481-objs := st5481_init.o st5481_usb.o st5481_d.o st5481_b.o
3809 +hisax_st5481-objs := st5481_init.o st5481_usb.o st5481_d.o st5481_b.o \
3812 # Optional parts of multipart objects.
3813 hisax-objs-$(CONFIG_HISAX_EURO) += l3dss1.o
3815 hisax-objs-$(CONFIG_HISAX_FRITZPCI) += avm_pci.o isac.o arcofi.o
3816 hisax-objs-$(CONFIG_HISAX_ELSA) += elsa.o isac.o arcofi.o hscx.o
3817 hisax-objs-$(CONFIG_HISAX_IX1MICROR2) += ix1_micro.o isac.o arcofi.o hscx.o
3818 -hisax-objs-$(CONFIG_HISAX_DIEHLDIVA) += diva.o isac.o arcofi.o hscx.o ipacx.o
3819 +hisax-objs-$(CONFIG_HISAX_DIEHLDIVA) += diva.o isac.o arcofi.o hscx.o
3820 hisax-objs-$(CONFIG_HISAX_ASUSCOM) += asuscom.o isac.o arcofi.o hscx.o
3821 hisax-objs-$(CONFIG_HISAX_TELEINT) += teleint.o isac.o arcofi.o hfc_2bs0.o
3822 hisax-objs-$(CONFIG_HISAX_SEDLBAUER) += sedlbauer.o isac.o arcofi.o hscx.o isar.o
3824 hisax-objs-$(CONFIG_HISAX_HFCS) += hfcscard.o hfc_2bds0.o
3825 hisax-objs-$(CONFIG_HISAX_HFC_PCI) += hfc_pci.o
3826 hisax-objs-$(CONFIG_HISAX_HFC_SX) += hfc_sx.o
3827 +hisax-objs-$(CONFIG_HISAX_HFC_USB) += hfc_usbr.o
3828 hisax-objs-$(CONFIG_HISAX_NICCY) += niccy.o isac.o arcofi.o hscx.o
3829 hisax-objs-$(CONFIG_HISAX_ISURF) += isurf.o isac.o arcofi.o isar.o
3830 hisax-objs-$(CONFIG_HISAX_HSTSAPHIR) += saphir.o isac.o arcofi.o hscx.o
3832 hisax-objs-$(CONFIG_HISAX_SCT_QUADRO) += bkm_a8.o isac.o arcofi.o hscx.o
3833 hisax-objs-$(CONFIG_HISAX_GAZEL) += gazel.o isac.o arcofi.o hscx.o
3834 hisax-objs-$(CONFIG_HISAX_W6692) += w6692.o
3835 -hisax-objs-$(CONFIG_HISAX_ENTERNOW_PCI) += enternow_pci.o amd7930_fn.o
3836 #hisax-objs-$(CONFIG_HISAX_TESTEMU) += testemu.o
3838 hisax-objs += $(sort $(hisax-objs-y))
3840 obj-$(CONFIG_ISDN_DRV_HISAX) += hisax.o
3841 obj-$(CONFIG_HISAX_SEDLBAUER_CS) += sedlbauer_cs.o
3842 obj-$(CONFIG_HISAX_ELSA_CS) += elsa_cs.o
3843 -obj-$(CONFIG_HISAX_AVM_A1_CS) += avma1_cs.o
3844 -obj-$(CONFIG_HISAX_ST5481) += hisax_st5481.o isdnhdlc.o
3845 -obj-$(CONFIG_HISAX_FRITZ_PCIPNP) += hisax_isac.o hisax_fcpcipnp.o
3846 -obj-$(CONFIG_USB_AUERISDN) += isdnhdlc.o
3847 +obj-$(CONFIG_HISAX_HFC_USB_CS) += hfc_usb.o
3848 +obj-$(CONFIG_HISAX_ST5481) += hisax_st5481.o
3849 +obj-$(CONFIG_HISAX_FRITZ_PCIPNP) += hisax_fcpcipnp.o hisax_isac.o
3851 CERT := $(shell md5sum -c md5sums.asc >> /dev/null;echo $$?)
3852 CFLAGS_cert.o := -DCERTIFICATION=$(CERT)
3853 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/amd7930.c linux-2.4.29/drivers/isdn/hisax/amd7930.c
3854 --- linux-2.4.29.old/drivers/isdn/hisax/amd7930.c 1970-01-01 01:00:00.000000000 +0100
3855 +++ linux-2.4.29/drivers/isdn/hisax/amd7930.c 2005-03-22 15:06:45.837124480 +0100
3857 +/* $Id: amd7930.c,v 1.8 2001/09/24 13:22:55 kai Exp $
3859 + * HiSax ISDN driver - chip specific routines for AMD 7930
3861 + * Author Brent Baccala
3862 + * Copyright by Brent Baccala <baccala@FreeSoft.org>
3864 + * This software may be used and distributed according to the terms
3865 + * of the GNU General Public License, incorporated herein by reference.
3867 + * - Existing ISDN HiSax driver provides all the smarts
3868 + * - it compiles, runs, talks to an isolated phone switch, connects
3869 + * to a Cisco, pings go through
3870 + * - AMD 7930 support only (no DBRI yet)
3871 + * - no US NI-1 support (may not work on US phone system - untested)
3872 + * - periodic packet loss, apparently due to lost interrupts
3873 + * - ISDN sometimes freezes, requiring reboot before it will work again
3875 + * The code is unreliable enough to be consider alpha
3877 + * This file is (c) under GNU General Public License
3879 + * Advanced Micro Devices' Am79C30A is an ISDN/audio chip used in the
3880 + * SparcStation 1+. The chip provides microphone and speaker interfaces
3881 + * which provide mono-channel audio at 8K samples per second via either
3882 + * 8-bit A-law or 8-bit mu-law encoding. Also, the chip features an
3883 + * ISDN BRI Line Interface Unit (LIU), I.430 S/T physical interface,
3884 + * which performs basic D channel LAPD processing and provides raw
3885 + * B channel data. The digital audio channel, the two ISDN B channels,
3886 + * and two 64 Kbps channels to the microprocessor are all interconnected
3887 + * via a multiplexer.
3889 + * This driver interfaces to the Linux HiSax ISDN driver, which performs
3890 + * all high-level Q.921 and Q.931 ISDN functions. The file is not
3891 + * itself a hardware driver; rather it uses functions exported by
3892 + * the AMD7930 driver in the sparcaudio subsystem (drivers/sbus/audio),
3893 + * allowing the chip to be simultaneously used for both audio and ISDN data.
3894 + * The hardware driver does _no_ buffering, but provides several callbacks
3895 + * which are called during interrupt service and should therefore run quickly.
3897 + * D channel transmission is performed by passing the hardware driver the
3898 + * address and size of an skb's data area, then waiting for a callback
3899 + * to signal successful transmission of the packet. A task is then
3900 + * queued to notify the HiSax driver that another packet may be transmitted.
3902 + * D channel reception is quite simple, mainly because of:
3903 + * 1) the slow speed of the D channel - 16 kbps, and
3904 + * 2) the presence of an 8- or 32-byte (depending on chip version) FIFO
3905 + * to buffer the D channel data on the chip
3906 + * Worst case scenario of back-to-back packets with the 8 byte buffer
3907 + * at 16 kbps yields an service time of 4 ms - long enough to preclude
3908 + * the need for fancy buffering. We queue a background task that copies
3909 + * data out of the receive buffer into an skb, and the hardware driver
3910 + * simply does nothing until we're done with the receive buffer and
3911 + * reset it for a new packet.
3913 + * B channel processing is more complex, because of:
3914 + * 1) the faster speed - 64 kbps,
3915 + * 2) the lack of any on-chip buffering (it interrupts for every byte), and
3916 + * 3) the lack of any chip support for HDLC encapsulation
3918 + * The HiSax driver can put each B channel into one of three modes -
3919 + * L1_MODE_NULL (channel disabled), L1_MODE_TRANS (transparent data relay),
3920 + * and L1_MODE_HDLC (HDLC encapsulation by low-level driver).
3921 + * L1_MODE_HDLC is the most common, used for almost all "pure" digital
3922 + * data sessions. L1_MODE_TRANS is used for ISDN audio.
3924 + * HDLC B channel transmission is performed via a large buffer into
3925 + * which the skb is copied while performing HDLC bit-stuffing. A CRC
3926 + * is computed and attached to the end of the buffer, which is then
3927 + * passed to the low-level routines for raw transmission. Once
3928 + * transmission is complete, the hardware driver is set to enter HDLC
3929 + * idle by successive transmission of mark (all 1) bytes, waiting for
3930 + * the ISDN driver to prepare another packet for transmission and
3933 + * HDLC B channel reception is performed via an X-byte ring buffer
3934 + * divided into N sections of X/N bytes each. Defaults: X=256 bytes, N=4.
3935 + * As the hardware driver notifies us that each section is full, we
3936 + * hand it the next section and schedule a background task to peruse
3937 + * the received section, bit-by-bit, with an HDLC decoder. As
3938 + * packets are detected, they are copied into a large buffer while
3939 + * decoding HDLC bit-stuffing. The ending CRC is verified, and if
3940 + * it is correct, we alloc a new skb of the correct length (which we
3941 + * now know), copy the packet into it, and hand it to the upper layers.
3942 + * Optimization: for large packets, we hand the buffer (which also
3943 + * happens to be an skb) directly to the upper layer after an skb_trim,
3944 + * and alloc a new large buffer for future packets, thus avoiding a copy.
3945 + * Then we return to HDLC processing; state is saved between calls.
3949 +#define __NO_VERSION__
3951 +#include "../../sbus/audio/amd7930.h"
3953 +#include "isdnl1.h"
3954 +#include "rawhdlc.h"
3955 +#include <linux/interrupt.h>
3957 +static const char *amd7930_revision = "$Revision: 1.8 $";
3959 +#define RCV_BUFSIZE 1024 /* Size of raw receive buffer in bytes */
3960 +#define RCV_BUFBLKS 4 /* Number of blocks to divide buffer into
3961 + * (must divide RCV_BUFSIZE) */
3963 +static void Bchan_fill_fifo(struct BCState *, struct sk_buff *);
3966 +Bchan_xmt_bh(struct BCState *bcs)
3968 + struct sk_buff *skb;
3970 + if (bcs->hw.amd7930.tx_skb != NULL) {
3971 + dev_kfree_skb(bcs->hw.amd7930.tx_skb);
3972 + bcs->hw.amd7930.tx_skb = NULL;
3975 + if ((skb = skb_dequeue(&bcs->squeue))) {
3976 + Bchan_fill_fifo(bcs, skb);
3978 + clear_bit(BC_FLG_BUSY, &bcs->Flag);
3979 + bcs->event |= 1 << B_XMTBUFREADY;
3980 + queue_task(&bcs->tqueue, &tq_immediate);
3981 + mark_bh(IMMEDIATE_BH);
3986 +Bchan_xmit_callback(struct BCState *bcs)
3988 + queue_task(&bcs->hw.amd7930.tq_xmt, &tq_immediate);
3989 + mark_bh(IMMEDIATE_BH);
3992 +/* B channel transmission: two modes (three, if you count L1_MODE_NULL)
3994 + * L1_MODE_HDLC - We need to do HDLC encapsulation before transmiting
3995 + * the packet (i.e. make_raw_hdlc_data). Since this can be a
3996 + * time-consuming operation, our completion callback just schedules
3997 + * a bottom half to do encapsulation for the next packet. In between,
3998 + * the link will just idle
4000 + * L1_MODE_TRANS - Data goes through, well, transparent. No HDLC encap,
4001 + * and we can't just let the link idle, so the "bottom half" actually
4002 + * gets called during the top half (it's our callback routine in this case),
4003 + * but it's a lot faster now since we don't call make_raw_hdlc_data
4007 +Bchan_fill_fifo(struct BCState *bcs, struct sk_buff *skb)
4009 + struct IsdnCardState *cs = bcs->cs;
4012 + if ((cs->debug & L1_DEB_HSCX) || (cs->debug & L1_DEB_HSCX_FIFO)) {
4016 + t += sprintf(t, "amd7930_fill_fifo %c cnt %d",
4017 + bcs->channel ? 'B' : 'A', skb->len);
4018 + if (cs->debug & L1_DEB_HSCX_FIFO)
4019 + QuickHex(t, skb->data, skb->len);
4023 + if (bcs->mode == L1_MODE_HDLC) {
4024 + len = make_raw_hdlc_data(skb->data, skb->len,
4025 + bcs->hw.amd7930.tx_buff, RAW_BUFMAX);
4027 + amd7930_bxmit(0, bcs->channel,
4028 + bcs->hw.amd7930.tx_buff, len,
4029 + (void *) &Bchan_xmit_callback,
4031 + dev_kfree_skb(skb);
4032 + } else if (bcs->mode == L1_MODE_TRANS) {
4033 + amd7930_bxmit(0, bcs->channel,
4034 + bcs->hw.amd7930.tx_buff, skb->len,
4035 + (void *) &Bchan_xmt_bh,
4037 + bcs->hw.amd7930.tx_skb = skb;
4039 + dev_kfree_skb(skb);
4044 +Bchan_mode(struct BCState *bcs, int mode, int bc)
4046 + struct IsdnCardState *cs = bcs->cs;
4048 + if (cs->debug & L1_DEB_HSCX) {
4050 + sprintf(tmp, "AMD 7930 mode %d bchan %d/%d",
4051 + mode, bc, bcs->channel);
4057 +/* Bchan_l2l1 is the entry point for upper layer routines that want to
4058 + * transmit on the B channel. PH_DATA_REQ is a normal packet that
4059 + * we either start transmitting (if idle) or queue (if busy).
4060 + * PH_PULL_REQ can be called to request a callback message (PH_PULL_CNF)
4061 + * once the link is idle. After a "pull" callback, the upper layer
4062 + * routines can use PH_PULL_IND to send data.
4066 +Bchan_l2l1(struct PStack *st, int pr, void *arg)
4068 + struct sk_buff *skb = arg;
4071 + case (PH_DATA_REQ):
4072 + if (test_bit(BC_FLG_BUSY, &st->l1.bcs->Flag)) {
4073 + skb_queue_tail(&st->l1.bcs->squeue, skb);
4075 + test_and_set_bit(BC_FLG_BUSY, &st->l1.bcs->Flag);
4076 + Bchan_fill_fifo(st->l1.bcs, skb);
4079 + case (PH_PULL_IND):
4080 + if (test_bit(BC_FLG_BUSY, &st->l1.bcs->Flag)) {
4081 + printk(KERN_WARNING "amd7930: this shouldn't happen\n");
4084 + test_and_set_bit(BC_FLG_BUSY, &st->l1.bcs->Flag);
4085 + Bchan_fill_fifo(st->l1.bcs, skb);
4087 + case (PH_PULL_REQ):
4088 + if (!test_bit(BC_FLG_BUSY, &st->l1.bcs->Flag)) {
4089 + clear_bit(FLG_L1_PULL_REQ, &st->l1.Flags);
4090 + st->l1.l1l2(st, PH_PULL_CNF, NULL);
4092 + set_bit(FLG_L1_PULL_REQ, &st->l1.Flags);
4097 +/* Receiver callback and bottom half - decodes HDLC at leisure (if
4098 + * L1_MODE_HDLC) and passes newly received skb on via bcs->rqueue. If
4099 + * a large packet is received, stick rv_skb (the buffer that the
4100 + * packet has been decoded into) on the receive queue and alloc a new
4101 + * (large) skb to act as buffer for future receives. If a small
4102 + * packet is received, leave rv_skb alone, alloc a new skb of the
4103 + * correct size, and copy the packet into it
4107 +Bchan_recv_callback(struct BCState *bcs)
4109 + struct amd7930_hw *hw = &bcs->hw.amd7930;
4111 + hw->rv_buff_in += RCV_BUFSIZE/RCV_BUFBLKS;
4112 + hw->rv_buff_in %= RCV_BUFSIZE;
4114 + if (hw->rv_buff_in != hw->rv_buff_out) {
4115 + amd7930_brecv(0, bcs->channel,
4116 + hw->rv_buff + hw->rv_buff_in,
4117 + RCV_BUFSIZE/RCV_BUFBLKS,
4118 + (void *) &Bchan_recv_callback, (void *) bcs);
4121 + queue_task(&hw->tq_rcv, &tq_immediate);
4122 + mark_bh(IMMEDIATE_BH);
4126 +Bchan_rcv_bh(struct BCState *bcs)
4128 + struct IsdnCardState *cs = bcs->cs;
4129 + struct amd7930_hw *hw = &bcs->hw.amd7930;
4130 + struct sk_buff *skb;
4133 + if (cs->debug & L1_DEB_HSCX) {
4136 + sprintf(tmp, "amd7930_Bchan_rcv (%d/%d)",
4137 + hw->rv_buff_in, hw->rv_buff_out);
4139 + QuickHex(tmp, hw->rv_buff + hw->rv_buff_out,
4140 + RCV_BUFSIZE/RCV_BUFBLKS);
4145 + if (bcs->mode == L1_MODE_HDLC) {
4146 + while ((len = read_raw_hdlc_data(hw->hdlc_state,
4147 + hw->rv_buff + hw->rv_buff_out, RCV_BUFSIZE/RCV_BUFBLKS,
4148 + hw->rv_skb->tail, HSCX_BUFMAX))) {
4149 + if (len > 0 && (cs->debug & L1_DEB_HSCX_FIFO)) {
4153 + t += sprintf(t, "amd7930_Bchan_rcv %c cnt %d", bcs->channel ? 'B' : 'A', len);
4154 + QuickHex(t, hw->rv_skb->tail, len);
4158 + if (len > HSCX_BUFMAX/2) {
4159 + /* Large packet received */
4161 + if (!(skb = dev_alloc_skb(HSCX_BUFMAX))) {
4162 + printk(KERN_WARNING "amd7930: receive out of memory");
4164 + skb_put(hw->rv_skb, len);
4165 + skb_queue_tail(&bcs->rqueue, hw->rv_skb);
4167 + bcs->event |= 1 << B_RCVBUFREADY;
4168 + queue_task(&bcs->tqueue, &tq_immediate);
4170 + } else if (len > 0) {
4171 + /* Small packet received */
4173 + if (!(skb = dev_alloc_skb(len))) {
4174 + printk(KERN_WARNING "amd7930: receive out of memory\n");
4176 + memcpy(skb_put(skb, len), hw->rv_skb->tail, len);
4177 + skb_queue_tail(&bcs->rqueue, skb);
4178 + bcs->event |= 1 << B_RCVBUFREADY;
4179 + queue_task(&bcs->tqueue, &tq_immediate);
4180 + mark_bh(IMMEDIATE_BH);
4183 + /* Reception Error */
4184 + /* printk("amd7930: B channel receive error\n"); */
4187 + } else if (bcs->mode == L1_MODE_TRANS) {
4188 + if (!(skb = dev_alloc_skb(RCV_BUFSIZE/RCV_BUFBLKS))) {
4189 + printk(KERN_WARNING "amd7930: receive out of memory\n");
4191 + memcpy(skb_put(skb, RCV_BUFSIZE/RCV_BUFBLKS),
4192 + hw->rv_buff + hw->rv_buff_out,
4193 + RCV_BUFSIZE/RCV_BUFBLKS);
4194 + skb_queue_tail(&bcs->rqueue, skb);
4195 + bcs->event |= 1 << B_RCVBUFREADY;
4196 + queue_task(&bcs->tqueue, &tq_immediate);
4197 + mark_bh(IMMEDIATE_BH);
4201 + if (hw->rv_buff_in == hw->rv_buff_out) {
4202 + /* Buffer was filled up - need to restart receiver */
4203 + amd7930_brecv(0, bcs->channel,
4204 + hw->rv_buff + hw->rv_buff_in,
4205 + RCV_BUFSIZE/RCV_BUFBLKS,
4206 + (void *) &Bchan_recv_callback,
4210 + hw->rv_buff_out += RCV_BUFSIZE/RCV_BUFBLKS;
4211 + hw->rv_buff_out %= RCV_BUFSIZE;
4213 + } while (hw->rv_buff_in != hw->rv_buff_out);
4217 +Bchan_close(struct BCState *bcs)
4219 + struct sk_buff *skb;
4221 + Bchan_mode(bcs, 0, 0);
4222 + amd7930_bclose(0, bcs->channel);
4224 + if (test_bit(BC_FLG_INIT, &bcs->Flag)) {
4225 + skb_queue_purge(&bcs->rqueue);
4226 + skb_queue_purge(&bcs->squeue);
4228 + test_and_clear_bit(BC_FLG_INIT, &bcs->Flag);
4232 +Bchan_open(struct BCState *bcs)
4234 + struct amd7930_hw *hw = &bcs->hw.amd7930;
4236 + if (!test_and_set_bit(BC_FLG_INIT, &bcs->Flag)) {
4237 + skb_queue_head_init(&bcs->rqueue);
4238 + skb_queue_head_init(&bcs->squeue);
4240 + test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag);
4242 + amd7930_bopen(0, bcs->channel, 0xff);
4243 + hw->rv_buff_in = 0;
4244 + hw->rv_buff_out = 0;
4245 + hw->tx_skb = NULL;
4246 + init_hdlc_state(hw->hdlc_state, 0);
4247 + amd7930_brecv(0, bcs->channel,
4248 + hw->rv_buff + hw->rv_buff_in, RCV_BUFSIZE/RCV_BUFBLKS,
4249 + (void *) &Bchan_recv_callback, (void *) bcs);
4257 +Bchan_init(struct BCState *bcs)
4259 + if (!(bcs->hw.amd7930.tx_buff = kmalloc(RAW_BUFMAX, GFP_ATOMIC))) {
4260 + printk(KERN_WARNING
4261 + "HiSax: No memory for amd7930.tx_buff\n");
4264 + if (!(bcs->hw.amd7930.rv_buff = kmalloc(RCV_BUFSIZE, GFP_ATOMIC))) {
4265 + printk(KERN_WARNING
4266 + "HiSax: No memory for amd7930.rv_buff\n");
4269 + if (!(bcs->hw.amd7930.rv_skb = dev_alloc_skb(HSCX_BUFMAX))) {
4270 + printk(KERN_WARNING
4271 + "HiSax: No memory for amd7930.rv_skb\n");
4274 + if (!(bcs->hw.amd7930.hdlc_state = kmalloc(sizeof(struct hdlc_state),
4276 + printk(KERN_WARNING
4277 + "HiSax: No memory for amd7930.hdlc_state\n");
4281 + bcs->hw.amd7930.tq_rcv.sync = 0;
4282 + bcs->hw.amd7930.tq_rcv.routine = (void (*)(void *)) &Bchan_rcv_bh;
4283 + bcs->hw.amd7930.tq_rcv.data = (void *) bcs;
4285 + bcs->hw.amd7930.tq_xmt.sync = 0;
4286 + bcs->hw.amd7930.tq_xmt.routine = (void (*)(void *)) &Bchan_xmt_bh;
4287 + bcs->hw.amd7930.tq_xmt.data = (void *) bcs;
4291 +Bchan_manl1(struct PStack *st, int pr,
4295 + case (PH_ACTIVATE_REQ):
4296 + test_and_set_bit(BC_FLG_ACTIV, &st->l1.bcs->Flag);
4297 + Bchan_mode(st->l1.bcs, st->l1.mode, st->l1.bc);
4298 + st->l1.l1man(st, PH_ACTIVATE_CNF, NULL);
4300 + case (PH_DEACTIVATE_REQ):
4301 + if (!test_bit(BC_FLG_BUSY, &st->l1.bcs->Flag))
4302 + Bchan_mode(st->l1.bcs, 0, 0);
4303 + test_and_clear_bit(BC_FLG_ACTIV, &st->l1.bcs->Flag);
4309 +setstack_amd7930(struct PStack *st, struct BCState *bcs)
4311 + if (Bchan_open(bcs))
4314 + st->l2.l2l1 = Bchan_l2l1;
4315 + st->ma.manl1 = Bchan_manl1;
4316 + setstack_manager(st);
4323 +amd7930_drecv_callback(void *arg, int error, unsigned int count)
4325 + struct IsdnCardState *cs = (struct IsdnCardState *) arg;
4326 + static struct tq_struct task;
4327 + struct sk_buff *skb;
4329 + /* NOTE: This function is called directly from an interrupt handler */
4332 + if (!(skb = alloc_skb(count, GFP_ATOMIC)))
4333 + printk(KERN_WARNING "HiSax: D receive out of memory\n");
4335 + memcpy(skb_put(skb, count), cs->rcvbuf, count);
4336 + skb_queue_tail(&cs->rq, skb);
4339 + task.routine = (void *) DChannel_proc_rcv;
4340 + task.data = (void *) cs;
4341 + queue_task(&task, &tq_immediate);
4342 + mark_bh(IMMEDIATE_BH);
4345 + if (cs->debug & L1_DEB_ISAC_FIFO) {
4349 + t += sprintf(t, "amd7930 Drecv cnt %d", count);
4350 + if (error) t += sprintf(t, " ERR %x", error);
4351 + QuickHex(t, cs->rcvbuf, count);
4355 + amd7930_drecv(0, cs->rcvbuf, MAX_DFRAME_LEN,
4356 + &amd7930_drecv_callback, cs);
4360 +amd7930_dxmit_callback(void *arg, int error)
4362 + struct IsdnCardState *cs = (struct IsdnCardState *) arg;
4363 + static struct tq_struct task;
4365 + /* NOTE: This function is called directly from an interrupt handler */
4367 + /* may wish to do retransmission here, if error indicates collision */
4369 + if (cs->debug & L1_DEB_ISAC_FIFO) {
4373 + t += sprintf(t, "amd7930 Dxmit cnt %d", cs->tx_skb->len);
4374 + if (error) t += sprintf(t, " ERR %x", error);
4375 + QuickHex(t, cs->tx_skb->data, cs->tx_skb->len);
4379 + cs->tx_skb = NULL;
4381 + task.routine = (void *) DChannel_proc_xmt;
4382 + task.data = (void *) cs;
4383 + queue_task(&task, &tq_immediate);
4384 + mark_bh(IMMEDIATE_BH);
4388 +amd7930_Dchan_l2l1(struct PStack *st, int pr, void *arg)
4390 + struct IsdnCardState *cs = (struct IsdnCardState *) st->l1.hardware;
4391 + struct sk_buff *skb = arg;
4395 + case (PH_DATA_REQ):
4397 + skb_queue_tail(&cs->sq, skb);
4398 +#ifdef L2FRAME_DEBUG /* psa */
4399 + if (cs->debug & L1_DEB_LAPD)
4400 + Logl2Frame(cs, skb, "PH_DATA Queued", 0);
4403 + if ((cs->dlogflag) && (!(skb->data[2] & 1))) {
4405 + LogFrame(cs, skb->data, skb->len);
4406 + sprintf(str, "Q.931 frame user->network tei %d", st->l2.tei);
4407 + dlogframe(cs, skb->data+4, skb->len-4,
4412 +#ifdef L2FRAME_DEBUG /* psa */
4413 + if (cs->debug & L1_DEB_LAPD)
4414 + Logl2Frame(cs, skb, "PH_DATA", 0);
4416 + amd7930_dxmit(0, skb->data, skb->len,
4417 + &amd7930_dxmit_callback, cs);
4420 + case (PH_PULL_IND):
4422 + if (cs->debug & L1_DEB_WARN)
4423 + debugl1(cs, " l2l1 tx_skb exist this shouldn't happen");
4424 + skb_queue_tail(&cs->sq, skb);
4427 + if ((cs->dlogflag) && (!(skb->data[2] & 1))) { /* I-FRAME */
4428 + LogFrame(cs, skb->data, skb->len);
4429 + sprintf(str, "Q.931 frame user->network tei %d", st->l2.tei);
4430 + dlogframe(cs, skb->data + 4, skb->len - 4,
4435 +#ifdef L2FRAME_DEBUG /* psa */
4436 + if (cs->debug & L1_DEB_LAPD)
4437 + Logl2Frame(cs, skb, "PH_DATA_PULLED", 0);
4439 + amd7930_dxmit(0, cs->tx_skb->data, cs->tx_skb->len,
4440 + &amd7930_dxmit_callback, cs);
4442 + case (PH_PULL_REQ):
4443 +#ifdef L2FRAME_DEBUG /* psa */
4444 + if (cs->debug & L1_DEB_LAPD)
4445 + debugl1(cs, "-> PH_REQUEST_PULL");
4447 + if (!cs->tx_skb) {
4448 + test_and_clear_bit(FLG_L1_PULL_REQ, &st->l1.Flags);
4449 + st->l1.l1l2(st, PH_PULL_CNF, NULL);
4451 + test_and_set_bit(FLG_L1_PULL_REQ, &st->l1.Flags);
4457 +setDstack_amd7930(struct PStack *st, struct IsdnCardState *cs)
4459 + st->l2.l2l1 = amd7930_Dchan_l2l1;
4460 + if (! cs->rcvbuf) {
4461 + printk("setDstack_amd7930: No cs->rcvbuf!\n");
4463 + amd7930_drecv(0, cs->rcvbuf, MAX_DFRAME_LEN,
4464 + &amd7930_drecv_callback, cs);
4470 +manl1_msg(struct IsdnCardState *cs, int msg, void *arg) {
4471 + struct PStack *st;
4475 + st->ma.manl1(st, msg, arg);
4481 +amd7930_new_ph(struct IsdnCardState *cs)
4483 + switch (amd7930_get_liu_state(0)) {
4485 + manl1_msg(cs, PH_POWERUP_CNF, NULL);
4489 + manl1_msg(cs, PH_I4_P8_IND, NULL);
4493 + manl1_msg(cs, PH_RSYNC_IND, NULL);
4498 +/* amd7930 LIU state change callback */
4501 +amd7930_liu_callback(struct IsdnCardState *cs)
4503 + static struct tq_struct task;
4508 + if (cs->debug & L1_DEB_ISAC) {
4510 + sprintf(tmp, "amd7930_liu state %d", amd7930_get_liu_state(0));
4515 + task.routine = (void *) &amd7930_new_ph;
4516 + task.data = (void *) cs;
4517 + queue_task(&task, &tq_immediate);
4518 + mark_bh(IMMEDIATE_BH);
4522 +amd7930_l1cmd(struct IsdnCardState *cs, int msg, void *arg)
4527 + if (cs->debug & L1_DEB_ISAC) {
4529 + sprintf(tmp, "amd7930_l1cmd msg %x", msg);
4534 + case PH_RESET_REQ:
4535 + if (amd7930_get_liu_state(0) <= 3)
4536 + amd7930_liu_activate(0,0);
4538 + amd7930_liu_deactivate(0);
4540 + case PH_ENABLE_REQ:
4542 + case PH_INFO3_REQ:
4543 + amd7930_liu_activate(0,0);
4545 + case PH_TESTLOOP_REQ:
4548 + if (cs->debug & L1_DEB_WARN) {
4549 + sprintf(tmp, "amd7930_l1cmd unknown %4x", msg);
4556 +static void init_amd7930(struct IsdnCardState *cs)
4558 + Bchan_init(&cs->bcs[0]);
4559 + Bchan_init(&cs->bcs[1]);
4560 + cs->bcs[0].BC_SetStack = setstack_amd7930;
4561 + cs->bcs[1].BC_SetStack = setstack_amd7930;
4562 + cs->bcs[0].BC_Close = Bchan_close;
4563 + cs->bcs[1].BC_Close = Bchan_close;
4564 + Bchan_mode(cs->bcs, 0, 0);
4565 + Bchan_mode(cs->bcs + 1, 0, 0);
4569 +release_amd7930(struct IsdnCardState *cs)
4574 +amd7930_card_msg(struct IsdnCardState *cs, int mt, void *arg)
4579 + case CARD_RELEASE:
4580 + release_amd7930(cs);
4583 + cs->l1cmd = amd7930_l1cmd;
4584 + amd7930_liu_init(0, &amd7930_liu_callback, (void *)cs);
4594 +setup_amd7930(struct IsdnCard *card)
4596 + struct IsdnCardState *cs = card->cs;
4599 + strcpy(tmp, amd7930_revision);
4600 + printk(KERN_INFO "HiSax: AMD7930 driver Rev. %s\n", HiSax_getrev(tmp));
4601 + if (cs->typ != ISDN_CTYPE_AMD7930)
4604 + cs->irq = amd7930_get_irqnum(0);
4608 + cs->cardmsg = &amd7930_card_msg;
4612 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/arcofi.c linux-2.4.29/drivers/isdn/hisax/arcofi.c
4613 --- linux-2.4.29.old/drivers/isdn/hisax/arcofi.c 2005-03-22 14:47:56.000000000 +0100
4614 +++ linux-2.4.29/drivers/isdn/hisax/arcofi.c 2005-03-22 15:06:45.852122200 +0100
4616 -/* $Id: arcofi.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4617 +/* $Id: arcofi.c,v 1.14 2001/09/24 13:22:55 kai Exp $
4619 * Ansteuerung ARCOFI 2165
4621 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/arcofi.h linux-2.4.29/drivers/isdn/hisax/arcofi.h
4622 --- linux-2.4.29.old/drivers/isdn/hisax/arcofi.h 2005-03-22 14:47:56.000000000 +0100
4623 +++ linux-2.4.29/drivers/isdn/hisax/arcofi.h 2005-03-22 15:06:45.872119160 +0100
4625 -/* $Id: arcofi.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4628 * Ansteuerung ARCOFI 2165
4630 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/asuscom.c linux-2.4.29/drivers/isdn/hisax/asuscom.c
4631 --- linux-2.4.29.old/drivers/isdn/hisax/asuscom.c 2005-03-22 14:47:56.000000000 +0100
4632 +++ linux-2.4.29/drivers/isdn/hisax/asuscom.c 2005-03-22 15:06:45.889116576 +0100
4634 -/* $Id: asuscom.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4635 +/* $Id: asuscom.c,v 1.14 2001/09/24 13:22:55 kai Exp $
4637 * low level stuff for ASUSCOM NETWORK INC. ISDNLink cards
4641 #define __NO_VERSION__
4642 #include <linux/init.h>
4643 -#include <linux/isapnp.h>
4649 extern const char *CardType[];
4651 -const char *Asuscom_revision = "$Revision: 1.1.4.1 $";
4652 +const char *Asuscom_revision = "$Revision: 1.14 $";
4654 #define byteout(addr,val) outb(val,addr)
4655 #define bytein(addr) inb(addr)
4656 @@ -310,27 +309,6 @@
4661 -static struct isapnp_device_id asus_ids[] __initdata = {
4662 - { ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1688),
4663 - ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1688),
4664 - (unsigned long) "Asus1688 PnP" },
4665 - { ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1690),
4666 - ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1690),
4667 - (unsigned long) "Asus1690 PnP" },
4668 - { ISAPNP_VENDOR('S', 'I', 'E'), ISAPNP_FUNCTION(0x0020),
4669 - ISAPNP_VENDOR('S', 'I', 'E'), ISAPNP_FUNCTION(0x0020),
4670 - (unsigned long) "Isurf2 PnP" },
4671 - { ISAPNP_VENDOR('E', 'L', 'F'), ISAPNP_FUNCTION(0x0000),
4672 - ISAPNP_VENDOR('E', 'L', 'F'), ISAPNP_FUNCTION(0x0000),
4673 - (unsigned long) "Iscas TE320" },
4677 -static struct isapnp_device_id *adev = &asus_ids[0];
4678 -static struct pci_bus *pnp_c __devinitdata = NULL;
4682 setup_asuscom(struct IsdnCard *card)
4684 @@ -343,45 +321,7 @@
4685 printk(KERN_INFO "HiSax: Asuscom ISDNLink driver Rev. %s\n", HiSax_getrev(tmp));
4686 if (cs->typ != ISDN_CTYPE_ASUSCOM)
4689 - if (!card->para[1] && isapnp_present()) {
4690 - struct pci_bus *pb;
4691 - struct pci_dev *pd;
4693 - while(adev->card_vendor) {
4694 - if ((pb = isapnp_find_card(adev->card_vendor,
4695 - adev->card_device, pnp_c))) {
4698 - if ((pd = isapnp_find_dev(pnp_c,
4699 - adev->vendor, adev->function, pd))) {
4700 - printk(KERN_INFO "HiSax: %s detected\n",
4701 - (char *)adev->driver_data);
4703 - pd->deactivate(pd);
4705 - card->para[1] = pd->resource[0].start;
4706 - card->para[0] = pd->irq_resource[0].start;
4707 - if (!card->para[0] || !card->para[1]) {
4708 - printk(KERN_ERR "AsusPnP:some resources are missing %ld/%lx\n",
4709 - card->para[0], card->para[1]);
4710 - pd->deactivate(pd);
4715 - printk(KERN_ERR "AsusPnP: PnP error card found, no device\n");
4721 - if (!adev->card_vendor) {
4722 - printk(KERN_INFO "AsusPnP: no ISAPnP card found\n");
4729 cs->hw.asus.cfg_reg = card->para[1];
4730 cs->irq = card->para[0];
4731 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/avm_a1.c linux-2.4.29/drivers/isdn/hisax/avm_a1.c
4732 --- linux-2.4.29.old/drivers/isdn/hisax/avm_a1.c 2005-03-22 14:47:56.000000000 +0100
4733 +++ linux-2.4.29/drivers/isdn/hisax/avm_a1.c 2005-03-22 15:06:45.904114296 +0100
4735 -/* $Id: avm_a1.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4736 +/* $Id: avm_a1.c,v 2.15 2001/09/24 13:22:55 kai Exp $
4738 * low level stuff for AVM A1 (Fritz) isdn cards
4743 extern const char *CardType[];
4744 -static const char *avm_revision = "$Revision: 1.1.4.1 $";
4745 +static const char *avm_revision = "$Revision: 2.15 $";
4747 #define AVM_A1_STAT_ISAC 0x01
4748 #define AVM_A1_STAT_HSCX 0x02
4749 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/avm_a1p.c linux-2.4.29/drivers/isdn/hisax/avm_a1p.c
4750 --- linux-2.4.29.old/drivers/isdn/hisax/avm_a1p.c 2005-03-22 14:47:56.000000000 +0100
4751 +++ linux-2.4.29/drivers/isdn/hisax/avm_a1p.c 2005-03-22 15:06:45.919112016 +0100
4753 -/* $Id: avm_a1p.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4754 +/* $Id: avm_a1p.c,v 2.9 2001/09/24 13:22:55 kai Exp $
4756 * low level stuff for the following AVM cards:
4759 #define byteout(addr,val) outb(val,addr)
4760 #define bytein(addr) inb(addr)
4762 -static const char *avm_revision = "$Revision: 1.1.4.1 $";
4763 +static const char *avm_revision = "$Revision: 2.9 $";
4765 static inline u_char
4766 ReadISAC(struct IsdnCardState *cs, u_char offset)
4767 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/avm_pci.c linux-2.4.29/drivers/isdn/hisax/avm_pci.c
4768 --- linux-2.4.29.old/drivers/isdn/hisax/avm_pci.c 2005-03-22 14:47:56.000000000 +0100
4769 +++ linux-2.4.29/drivers/isdn/hisax/avm_pci.c 2005-03-22 15:06:45.945108064 +0100
4771 -/* $Id: avm_pci.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4772 +/* $Id: avm_pci.c,v 1.29 2001/09/24 13:22:55 kai Exp $
4774 * low level stuff for AVM Fritz!PCI and ISA PnP isdn cards
4779 #include <linux/pci.h>
4780 -#include <linux/isapnp.h>
4781 +#include <linux/isdn_compat.h>
4782 #include <linux/interrupt.h>
4784 extern const char *CardType[];
4785 -static const char *avm_pci_rev = "$Revision: 1.1.4.1 $";
4786 +static const char *avm_pci_rev = "$Revision: 1.29 $";
4788 #define AVM_FRITZ_PCI 1
4789 #define AVM_FRITZ_PNP 2
4791 debugl1(cs, "hdlc_empty_fifo: incoming packet too large");
4794 - p = bcs->hw.hdlc.rcvbuf + bcs->hw.hdlc.rcvidx;
4796 + ptr = (u_int *) p = bcs->hw.hdlc.rcvbuf + bcs->hw.hdlc.rcvidx;
4797 bcs->hw.hdlc.rcvidx += count;
4798 if (cs->subtyp == AVM_FRITZ_PCI) {
4799 outl(idx, cs->hw.avm.cfg_reg + 4);
4802 if ((cs->debug & L1_DEB_HSCX) && !(cs->debug & L1_DEB_HSCX_FIFO))
4803 debugl1(cs, "hdlc_fill_fifo %d/%ld", count, bcs->tx_skb->len);
4804 - p = bcs->tx_skb->data;
4806 + ptr = (u_int *) p = bcs->tx_skb->data;
4807 skb_pull(bcs->tx_skb, count);
4808 bcs->tx_cnt -= count;
4809 bcs->hw.hdlc.count += count;
4810 @@ -766,10 +764,6 @@
4813 static struct pci_dev *dev_avm __initdata = NULL;
4815 -static struct pci_bus *bus_avm __initdata = NULL;
4816 -static struct pci_dev *pnp_avm __initdata = NULL;
4820 setup_avm_pcipnp(struct IsdnCard *card)
4821 @@ -783,47 +777,10 @@
4822 if (cs->typ != ISDN_CTYPE_FRITZPCI)
4824 if (card->para[1]) {
4825 - /* old manual method */
4826 cs->hw.avm.cfg_reg = card->para[1];
4827 cs->irq = card->para[0];
4828 cs->subtyp = AVM_FRITZ_PNP;
4831 - if (isapnp_present()) {
4832 - struct pci_bus *ba;
4833 - if ((ba = isapnp_find_card(
4834 - ISAPNP_VENDOR('A', 'V', 'M'),
4835 - ISAPNP_FUNCTION(0x0900), bus_avm))) {
4838 - if ((pnp_avm = isapnp_find_dev(bus_avm,
4839 - ISAPNP_VENDOR('A', 'V', 'M'),
4840 - ISAPNP_FUNCTION(0x0900), pnp_avm))) {
4841 - pnp_avm->prepare(pnp_avm);
4842 - pnp_avm->deactivate(pnp_avm);
4843 - pnp_avm->activate(pnp_avm);
4844 - cs->hw.avm.cfg_reg =
4845 - pnp_avm->resource[0].start;
4847 - pnp_avm->irq_resource[0].start;
4849 - printk(KERN_ERR "FritzPnP:No IRQ\n");
4850 - pnp_avm->deactivate(pnp_avm);
4853 - if (!cs->hw.avm.cfg_reg) {
4854 - printk(KERN_ERR "FritzPnP:No IO address\n");
4855 - pnp_avm->deactivate(pnp_avm);
4858 - cs->subtyp = AVM_FRITZ_PNP;
4863 - printk(KERN_INFO "FritzPnP: no ISA PnP present\n");
4867 if (!pci_present()) {
4868 printk(KERN_ERR "FritzPCI: no PCI bus present\n");
4871 if (pci_enable_device(dev_avm))
4873 - cs->hw.avm.cfg_reg = pci_resource_start(dev_avm, 1);
4874 + cs->hw.avm.cfg_reg = pci_resource_start_io(dev_avm, 1);
4875 if (!cs->hw.avm.cfg_reg) {
4876 printk(KERN_ERR "FritzPCI: No IO-Adr for PCI card found\n");
4880 #endif /* CONFIG_PCI */
4883 cs->hw.avm.isac = cs->hw.avm.cfg_reg + 0x10;
4884 if (check_region((cs->hw.avm.cfg_reg), 32)) {
4886 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/bkm_a4t.c linux-2.4.29/drivers/isdn/hisax/bkm_a4t.c
4887 --- linux-2.4.29.old/drivers/isdn/hisax/bkm_a4t.c 2005-03-22 14:47:56.000000000 +0100
4888 +++ linux-2.4.29/drivers/isdn/hisax/bkm_a4t.c 2005-03-22 15:06:45.962105480 +0100
4890 -/* $Id: bkm_a4t.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4891 +/* $Id: bkm_a4t.c,v 1.22 2001/09/24 13:22:55 kai Exp $
4893 * low level stuff for T-Berkom A4T
4898 #include <linux/pci.h>
4899 +#include <linux/isdn_compat.h>
4902 extern const char *CardType[];
4904 -const char *bkm_a4t_revision = "$Revision: 1.1.4.1 $";
4905 +const char *bkm_a4t_revision = "$Revision: 1.22 $";
4908 static inline u_char
4909 @@ -293,13 +294,13 @@
4913 - sub_vendor = dev_a4t->subsystem_vendor;
4914 - sub_sys = dev_a4t->subsystem_device;
4915 + pci_get_sub_vendor(dev_a4t,sub_vendor);
4916 + pci_get_sub_system(dev_a4t,sub_sys);
4917 if ((sub_sys == PCI_DEVICE_ID_BERKOM_A4T) && (sub_vendor == PCI_VENDOR_ID_BERKOM)) {
4918 if (pci_enable_device(dev_a4t))
4921 - pci_memaddr = pci_resource_start(dev_a4t, 0);
4922 + pci_memaddr = pci_resource_start_mem(dev_a4t, 0);
4923 cs->irq = dev_a4t->irq;
4926 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/bkm_a8.c linux-2.4.29/drivers/isdn/hisax/bkm_a8.c
4927 --- linux-2.4.29.old/drivers/isdn/hisax/bkm_a8.c 2005-03-22 14:47:56.000000000 +0100
4928 +++ linux-2.4.29/drivers/isdn/hisax/bkm_a8.c 2005-03-22 15:06:45.982102440 +0100
4930 -/* $Id: bkm_a8.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4931 +/* $Id: bkm_a8.c,v 1.22 2001/09/24 13:22:55 kai Exp $
4933 * low level stuff for Scitel Quadro (4*S0, passive)
4938 #include <linux/pci.h>
4939 +#include <linux/isdn_compat.h>
4945 extern const char *CardType[];
4947 -const char sct_quadro_revision[] = "$Revision: 1.1.4.1 $";
4948 +const char sct_quadro_revision[] = "$Revision: 1.22 $";
4950 static const char *sct_quadro_subtypes[] =
4952 @@ -329,13 +330,13 @@
4953 while ((dev_a8 = pci_find_device(PCI_VENDOR_ID_PLX,
4954 PCI_DEVICE_ID_PLX_9050, dev_a8))) {
4956 - sub_vendor_id = dev_a8->subsystem_vendor;
4957 - sub_sys_id = dev_a8->subsystem_device;
4958 + pci_get_sub_vendor(dev_a8,sub_vendor_id);
4959 + pci_get_sub_system(dev_a8,sub_sys_id);
4960 if ((sub_sys_id == PCI_DEVICE_ID_BERKOM_SCITEL_QUADRO) &&
4961 (sub_vendor_id == PCI_VENDOR_ID_BERKOM)) {
4962 if (pci_enable_device(dev_a8))
4964 - pci_ioaddr1 = pci_resource_start(dev_a8, 1);
4965 + pci_ioaddr1 = pci_resource_start_io(dev_a8, 1);
4966 pci_irq = dev_a8->irq;
4967 pci_bus = dev_a8->bus->number;
4968 pci_device_fn = dev_a8->devfn;
4970 pci_ioaddr1 &= PCI_BASE_ADDRESS_IO_MASK;
4971 pcibios_write_config_dword(pci_bus, pci_device_fn,
4972 PCI_BASE_ADDRESS_1, pci_ioaddr1);
4973 - dev_a8->resource[ 1].start = pci_ioaddr1;
4974 + get_pcibase(dev_a8, 1) = pci_ioaddr1;
4976 #endif /* End HACK */
4978 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/bkm_ax.h linux-2.4.29/drivers/isdn/hisax/bkm_ax.h
4979 --- linux-2.4.29.old/drivers/isdn/hisax/bkm_ax.h 2005-03-22 14:47:56.000000000 +0100
4980 +++ linux-2.4.29/drivers/isdn/hisax/bkm_ax.h 2005-03-22 15:06:46.010098184 +0100
4982 -/* $Id: bkm_ax.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4985 * low level decls for T-Berkom cards A4T and Scitel Quadro (4*S0, passive)
4987 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/callc.c linux-2.4.29/drivers/isdn/hisax/callc.c
4988 --- linux-2.4.29.old/drivers/isdn/hisax/callc.c 2005-03-22 14:47:56.000000000 +0100
4989 +++ linux-2.4.29/drivers/isdn/hisax/callc.c 2005-03-22 15:06:46.027095600 +0100
4991 -/* $Id: callc.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
4992 +/* $Id: callc.c,v 2.59 2002/02/09 21:19:11 keil Exp $
4994 * Author Karsten Keil
4995 * Copyright by Karsten Keil <keil@isdn4linux.de>
4997 #define MOD_USE_COUNT ( GET_USE_COUNT (&__this_module))
5000 -const char *lli_revision = "$Revision: 1.1.4.1 $";
5001 +const char *lli_revision = "$Revision: 2.59 $";
5003 extern struct IsdnCard cards[];
5005 @@ -145,9 +145,11 @@
5006 EV_PROCEED, /* 20 */
5009 + EV_ALERTING, /* 23 */
5010 + EV_PROCEEDING, /* 24 */
5013 -#define EVENT_COUNT (EV_REDIR + 1)
5014 +#define EVENT_COUNT (EV_PROCEEDING + 1)
5016 static char *strEvent[] =
5027 @@ -286,6 +290,22 @@
5031 +lli_alerting(struct FsmInst *fi, int event, void *arg)
5033 + struct Channel *chanp = fi->userdata;
5035 + HL_LL(chanp, ISDN_STAT_ALERT);
5039 +lli_proceeding(struct FsmInst *fi, int event, void *arg)
5041 + struct Channel *chanp = fi->userdata;
5043 + HL_LL(chanp, ISDN_STAT_PROCEED);
5047 lli_resume(struct FsmInst *fi, int event, void *arg)
5049 struct Channel *chanp = fi->userdata;
5051 {ST_OUT_DIAL, EV_DISCONNECT_IND, lli_release_req},
5052 {ST_OUT_DIAL, EV_RELEASE, lli_dhup_close},
5053 {ST_OUT_DIAL, EV_NOSETUP_RSP, lli_no_setup_rsp},
5054 + {ST_OUT_DIAL, EV_PROCEEDING, lli_proceeding},
5055 + {ST_OUT_DIAL, EV_ALERTING, lli_alerting},
5056 {ST_OUT_DIAL, EV_SETUP_ERR, lli_error},
5057 {ST_IN_WAIT_LL, EV_LEASED_REL, lli_failure_l},
5058 {ST_IN_WAIT_LL, EV_ACCEPTD, lli_setup_rsp},
5060 ic.driver = cs->myid;
5061 ic.command = ISDN_STAT_REDIR;
5063 - ic.parm.num[0] = result;
5064 + (ulong)(ic.parm.num[0]) = result;
5065 cs->iif.statcallb(&ic);
5066 } /* stat_redir_result */
5068 @@ -997,8 +1019,13 @@
5069 FsmEvent(&chanp->fi, EV_RELEASE, NULL);
5071 case (CC_PROCEED_SEND | INDICATION):
5073 case (CC_PROCEEDING | INDICATION):
5074 + FsmEvent(&chanp->fi, EV_PROCEEDING, NULL);
5076 case (CC_ALERTING | INDICATION):
5077 + FsmEvent(&chanp->fi, EV_ALERTING, NULL);
5079 case (CC_PROGRESS | INDICATION):
5080 case (CC_NOTIFY | INDICATION):
5082 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/cert.c linux-2.4.29/drivers/isdn/hisax/cert.c
5083 --- linux-2.4.29.old/drivers/isdn/hisax/cert.c 2005-03-22 14:47:56.000000000 +0100
5084 +++ linux-2.4.29/drivers/isdn/hisax/cert.c 2005-03-22 15:06:46.042093320 +0100
5086 -/* $Id: cert.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
5087 +/* $Id: cert.c,v 2.6 2001/09/24 13:22:56 kai Exp $
5089 * Author Karsten Keil
5090 * Copyright by Karsten Keil <keil@isdn4linux.de>
5091 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/config.c linux-2.4.29/drivers/isdn/hisax/config.c
5092 --- linux-2.4.29.old/drivers/isdn/hisax/config.c 2005-03-22 14:47:56.000000000 +0100
5093 +++ linux-2.4.29/drivers/isdn/hisax/config.c 2005-03-22 15:06:46.077088000 +0100
5095 -/* $Id: config.c,v 1.1.4.5 2001/12/09 19:19:26 kai Exp $
5096 +/* $Id: config.c,v 2.84 2002/08/13 09:55:29 keil Exp $
5098 * Author Karsten Keil
5099 * Copyright by Karsten Keil <keil@isdn4linux.de>
5101 #include <linux/kernel_stat.h>
5102 #include <linux/tqueue.h>
5103 #include <linux/interrupt.h>
5105 +#ifdef CONFIG_HISAX_HFC_USB
5106 +#include "hisax_loadable.h"
5109 #define HISAX_STATUS_BUFSIZE 4096
5110 #define INCLUDE_INLINE_FUNCS
5113 * 37 HFC 2BDS0 S+/SP p0=irq p1=iobase
5114 * 38 Travers Technologies NETspider-U PCI card
5115 * 39 HFC 2BDS0-SP PCMCIA p0=irq p1=iobase
5116 - * 40 hotplug interface
5117 - * 41 Formula-n enter:now ISDN PCI a/b none
5118 + * 40 HFC-S USB none
5120 * protocol can be either ISDN_PTYPE_EURO or ISDN_PTYPE_1TR6 or ISDN_PTYPE_NI1
5123 "Siemens I-Surf", "Acer P10", "HST Saphir", "Telekom A4T",
5124 "Scitel Quadro", "Gazel", "HFC 2BDS0 PCI", "Winbond 6692",
5125 "HFC 2BDS0 SX", "NETspider-U", "HFC-2BDS0-SP PCMCIA",
5126 - "Hotplug", "Formula-n enter:now PCI a/b",
5130 void HiSax_closecard(int cardnr);
5132 +#ifdef CONFIG_HISAX_HFC_USB
5133 +#define DEFAULT_CARD ISDN_CTYPE_HFC_USB
5134 +#define DEFAULT_CFG {0,0,0,0}
5135 +EXPORT_SYMBOL(hisax_register_hfcusb);
5138 #ifdef CONFIG_HISAX_ELSA
5139 #define DEFAULT_CARD ISDN_CTYPE_ELSA
5140 #define DEFAULT_CFG {0,0,0,0}
5141 @@ -339,19 +349,27 @@
5145 -struct IsdnCard cards[HISAX_MAX_CARDS] = {
5146 +#define EMPTY_CARD {0, DEFAULT_PROTO, {0, 0, 0, 0}, NULL}
5148 +struct IsdnCard cards[] = {
5159 -#define HISAX_IDSIZE (HISAX_MAX_CARDS*8)
5160 -static char HiSaxID[HISAX_IDSIZE] __devinitdata = { 0, };
5161 +static char HiSaxID[64] __devinitdata = { 0, };
5163 char *HiSax_id __devinitdata = HiSaxID;
5165 /* Variables for insmod */
5166 -static int type[HISAX_MAX_CARDS] __devinitdata = { 0, };
5167 -static int protocol[HISAX_MAX_CARDS] __devinitdata = { 0, };
5168 -static int io[HISAX_MAX_CARDS] __devinitdata = { 0, };
5169 +static int type[8] __devinitdata = { 0, };
5170 +static int protocol[8] __devinitdata = { 0, };
5171 +static int io[8] __devinitdata = { 0, };
5173 #ifdef CONFIG_HISAX_16_3
5175 @@ -361,27 +379,23 @@
5179 -static int io0[HISAX_MAX_CARDS] __devinitdata = { 0, };
5180 -static int io1[HISAX_MAX_CARDS] __devinitdata = { 0, };
5181 +static int io0[8] __devinitdata = { 0, };
5182 +static int io1[8] __devinitdata = { 0, };
5184 -static int irq[HISAX_MAX_CARDS] __devinitdata = { 0, };
5185 -static int mem[HISAX_MAX_CARDS] __devinitdata = { 0, };
5186 +static int irq[8] __devinitdata = { 0, };
5187 +static int mem[8] __devinitdata = { 0, };
5188 static char *id __devinitdata = HiSaxID;
5190 -#define PARM_PARA "1-" __MODULE_STRING(HISAX_MAX_CARDS) "i"
5192 -MODULE_DESCRIPTION("ISDN4Linux: Driver for passive ISDN cards");
5193 MODULE_AUTHOR("Karsten Keil");
5194 -MODULE_LICENSE("GPL");
5195 -MODULE_PARM(type, PARM_PARA);
5196 -MODULE_PARM(protocol, PARM_PARA);
5197 -MODULE_PARM(io, PARM_PARA);
5198 -MODULE_PARM(irq, PARM_PARA);
5199 -MODULE_PARM(mem, PARM_PARA);
5200 +MODULE_PARM(type, "1-8i");
5201 +MODULE_PARM(protocol, "1-8i");
5202 +MODULE_PARM(io, "1-8i");
5203 +MODULE_PARM(irq, "1-8i");
5204 +MODULE_PARM(mem, "1-8i");
5205 MODULE_PARM(id, "s");
5207 -MODULE_PARM(io0, PARM_PARA);
5208 -MODULE_PARM(io1, PARM_PARA);
5209 +MODULE_PARM(io0, "1-8i");
5210 +MODULE_PARM(io1, "1-8i");
5218 +#ifdef COMPAT_HAS_NEW_SETUP
5219 #define MAX_ARG (HISAX_MAX_CARDS*5)
5220 static int __init HiSax_setup(char *line)
5222 @@ -440,12 +455,16 @@
5225 str = get_options(line, MAX_ARG, ints);
5227 +void __init HiSax_setup(char *str, int *ints)
5232 printk(KERN_DEBUG "HiSax_setup: argc(%d) str(%s)\n", argc, str);
5235 while (argc && (i < HISAX_MAX_CARDS)) {
5236 - cards[i].protocol = DEFAULT_PROTO;
5238 cards[i].typ = ints[j];
5240 @@ -473,19 +492,21 @@
5244 - if (str && *str) {
5245 - if (strlen(str) < HISAX_IDSIZE)
5246 - strcpy(HiSaxID, str);
5248 - printk(KERN_WARNING "HiSax: ID too long!");
5250 + if (str && *str) {
5251 + strcpy(HiSaxID, str);
5252 + HiSax_id = HiSaxID;
5254 strcpy(HiSaxID, "HiSax");
5256 - HiSax_id = HiSaxID;
5257 + HiSax_id = HiSaxID;
5259 +#ifdef COMPAT_HAS_NEW_SETUP
5263 __setup("hisax=", HiSax_setup);
5266 +#endif /* COMPAT_HAS_NEW_SETUP */
5267 #endif /* MODULES */
5270 @@ -560,6 +581,10 @@
5271 extern int setup_hfcpci(struct IsdnCard *card);
5274 +#if CONFIG_HISAX_HFC_USB
5275 +extern int setup_hfc_usb(struct IsdnCard *card);
5279 extern int setup_hfcsx(struct IsdnCard *card);
5281 @@ -604,10 +629,6 @@
5282 extern int setup_netjet_u(struct IsdnCard *card);
5285 -#if CARD_FN_ENTERNOW_PCI
5286 -extern int setup_enternow_pci(struct IsdnCard *card);
5290 * Find card with given driverId
5296 -static int __devinit checkcard(int cardnr, char *id, int *busy_flag)
5297 +static int __devinit checkcard(int cardnr, char *id, int *busy_flag,
5302 @@ -1093,6 +1115,12 @@
5303 ret = setup_hfcsx(card);
5306 +#if CONFIG_HISAX_HFC_USB
5307 + case ISDN_CTYPE_HFC_USB:
5308 + cs->hw.hfcusb.drv = load_drv;
5309 + ret = setup_hfc_usb(card);
5313 case ISDN_CTYPE_NICCY:
5314 ret = setup_niccy(card);
5315 @@ -1143,11 +1171,6 @@
5316 ret = setup_netjet_u(card);
5319 -#if CARD_FN_ENTERNOW_PCI
5320 - case ISDN_CTYPE_ENTERNOW:
5321 - ret = setup_enternow_pci(card);
5324 case ISDN_CTYPE_DYNAMIC:
5327 @@ -1186,6 +1209,9 @@
5328 case ISDN_CTYPE_DYNAMIC:
5331 + case ISDN_CTYPE_HFC_USB:
5332 + ret = cs->cardmsg(cs, CARD_INIT, NULL);
5335 ret = init_card(cs);
5337 @@ -1257,16 +1283,13 @@
5339 sprintf(ids, "%s%d", id, i);
5341 - if (checkcard(i, ids, busy_flag)) {
5342 + if (checkcard(i, ids, busy_flag, NULL)) {
5346 - /* make sure we don't oops the module */
5347 - if (cards[i].typ > 0 && cards[i].typ <= ISDN_CTYPE_COUNT) {
5348 - printk(KERN_WARNING
5349 - "HiSax: Card %s not installed !\n",
5350 - CardType[cards[i].typ]);
5352 + printk(KERN_WARNING
5353 + "HiSax: Card %s not installed !\n",
5354 + CardType[cards[i].typ]);
5355 HiSax_shiftcards(i);
5358 @@ -1342,6 +1365,49 @@
5362 +#ifdef CONFIG_HISAX_HFC_USB
5364 +hisax_register_hfcusb(struct hisax_drvreg *l1drv)
5369 + if (l1drv->version != HISAX_LOAD_VERSION)
5372 + switch (l1drv->cmd) {
5373 + case HISAX_LOAD_CHKVER:
5374 + break; /* success */
5376 + case HISAX_LOAD_REGISTER:
5377 + for (i = 0; i < HISAX_MAX_CARDS; i++) {
5378 + if (!cards[i].typ)
5381 + if (i >= HISAX_MAX_CARDS)
5382 + return 1; /* no space */
5383 + cards[i].typ = ISDN_CTYPE_HFC_USB; /* setup type */
5384 + cards[i].protocol = DEFAULT_PROTO;
5385 + sprintf(ids, "%s%d", l1drv->drvname, i);
5386 + if (checkcard(i, ids, NULL, (void *) l1drv)) {
5391 + kfree((void *) cards[i].cs);
5392 + cards[i].cs = NULL;
5393 + cards[i].typ = 0; /* no card present */
5398 + return 1; /* unknown command */
5402 +} /* hisax_register_hfcusb */
5405 static int __init HiSax_init(void)
5408 @@ -1408,8 +1474,6 @@
5410 cards[j].protocol = protocol[i];
5413 - cards[j].protocol = DEFAULT_PROTO;
5416 case ISDN_CTYPE_16_0:
5417 @@ -1487,22 +1551,15 @@
5419 /* QUADRO is a 4 BRI card */
5420 cards[j++].para[0] = 1;
5421 - /* we need to check if further cards can be added */
5422 - if (j < HISAX_MAX_CARDS) {
5423 - cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
5424 - cards[j].protocol = protocol[i];
5425 - cards[j++].para[0] = 2;
5427 - if (j < HISAX_MAX_CARDS) {
5428 - cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
5429 - cards[j].protocol = protocol[i];
5430 - cards[j++].para[0] = 3;
5432 - if (j < HISAX_MAX_CARDS) {
5433 - cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
5434 - cards[j].protocol = protocol[i];
5435 - cards[j].para[0] = 4;
5437 + cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
5438 + cards[j].protocol = protocol[i];
5439 + cards[j++].para[0] = 2;
5440 + cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
5441 + cards[j].protocol = protocol[i];
5442 + cards[j++].para[0] = 3;
5443 + cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
5444 + cards[j].protocol = protocol[i];
5445 + cards[j].para[0] = 4;
5449 @@ -1526,10 +1583,15 @@
5450 nrcards, (nrcards > 1) ? "s" : "");
5452 /* Install only, if at least one card found */
5453 - if (!HiSax_inithardware(NULL))
5455 + if (!HiSax_inithardware(NULL)) {
5467 @@ -1576,8 +1638,6 @@
5468 cards[i].typ = type[i];
5470 cards[i].protocol = protocol[i];
5472 - cards[i].protocol = DEFAULT_PROTO;
5475 cards[0].para[0] = pcm_irq;
5476 @@ -1595,8 +1655,7 @@
5477 printk(KERN_DEBUG "HiSax: Total %d card%s defined\n",
5478 nrcards, (nrcards > 1) ? "s" : "");
5480 - if (!HiSax_inithardware(busy_flag))
5482 + HiSax_inithardware(busy_flag);
5483 printk(KERN_NOTICE "HiSax: module installed\n");
5486 @@ -1619,8 +1678,6 @@
5487 cards[i].typ = type[i];
5489 cards[i].protocol = protocol[i];
5491 - cards[i].protocol = DEFAULT_PROTO;
5494 cards[0].para[0] = pcm_irq;
5495 @@ -1638,8 +1695,7 @@
5496 printk(KERN_DEBUG "HiSax: Total %d card%s defined\n",
5497 nrcards, (nrcards > 1) ? "s" : "");
5499 - if (!HiSax_inithardware(busy_flag))
5501 + HiSax_inithardware(busy_flag);
5502 printk(KERN_NOTICE "HiSax: module installed\n");
5505 @@ -1662,8 +1718,6 @@
5506 cards[i].typ = type[i];
5508 cards[i].protocol = protocol[i];
5510 - cards[i].protocol = DEFAULT_PROTO;
5513 cards[0].para[0] = pcm_irq;
5514 @@ -1681,8 +1735,7 @@
5515 printk(KERN_DEBUG "HiSax: Total %d card%s defined\n",
5516 nrcards, (nrcards > 1) ? "s" : "");
5518 - if (!HiSax_inithardware(busy_flag))
5520 + HiSax_inithardware(busy_flag);
5521 printk(KERN_NOTICE "HiSax: module installed\n");
5524 @@ -1705,8 +1758,6 @@
5525 cards[i].typ = type[i];
5527 cards[i].protocol = protocol[i];
5529 - cards[i].protocol = DEFAULT_PROTO;
5532 cards[0].para[0] = pcm_irq;
5533 @@ -1724,8 +1775,7 @@
5534 printk(KERN_DEBUG "HiSax: Total %d card%s defined\n",
5535 nrcards, (nrcards > 1) ? "s" : "");
5537 - if (!HiSax_inithardware(busy_flag))
5539 + HiSax_inithardware(busy_flag);
5540 printk(KERN_NOTICE "HiSax: module installed\n");
5543 @@ -1743,7 +1793,7 @@
5544 sprintf(ids, "HiSax%d", nrcards);
5546 sprintf(ids, "HiSax");
5547 - if (!checkcard(nrcards, ids, busy_flag)) {
5548 + if (!checkcard(nrcards, ids, busy_flag, NULL)) {
5552 @@ -1785,7 +1835,7 @@
5553 cards[i].protocol = protocol;
5554 sprintf(id, "%s%d", name, i);
5556 - retval = checkcard(i, id, 0);
5557 + retval = checkcard(i, id, 0, NULL);
5558 if (retval == 0) { // yuck
5561 @@ -2117,9 +2167,6 @@
5562 {PCI_VENDOR_ID_EICON, PCI_DEVICE_ID_EICON_DIVA20, PCI_ANY_ID, PCI_ANY_ID},
5563 {PCI_VENDOR_ID_EICON, PCI_DEVICE_ID_EICON_DIVA20_U, PCI_ANY_ID, PCI_ANY_ID},
5564 {PCI_VENDOR_ID_EICON, PCI_DEVICE_ID_EICON_DIVA201, PCI_ANY_ID, PCI_ANY_ID},
5565 -//#########################################################################################
5566 - {PCI_VENDOR_ID_EICON, PCI_DEVICE_ID_EICON_DIVA202, PCI_ANY_ID, PCI_ANY_ID},
5567 -//#########################################################################################
5569 #ifdef CONFIG_HISAX_ELSA
5570 {PCI_VENDOR_ID_ELSA, PCI_DEVICE_ID_ELSA_MICROLINK, PCI_ANY_ID, PCI_ANY_ID},
5571 @@ -2178,11 +2225,3 @@
5573 module_init(HiSax_init);
5574 module_exit(HiSax_exit);
5576 -EXPORT_SYMBOL(FsmNew);
5577 -EXPORT_SYMBOL(FsmFree);
5578 -EXPORT_SYMBOL(FsmEvent);
5579 -EXPORT_SYMBOL(FsmChangeState);
5580 -EXPORT_SYMBOL(FsmInitTimer);
5581 -EXPORT_SYMBOL(FsmDelTimer);
5582 -EXPORT_SYMBOL(FsmRestartTimer);
5583 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/diva.c linux-2.4.29/drivers/isdn/hisax/diva.c
5584 --- linux-2.4.29.old/drivers/isdn/hisax/diva.c 2005-03-22 14:47:56.000000000 +0100
5585 +++ linux-2.4.29/drivers/isdn/hisax/diva.c 2005-03-22 15:06:46.106083592 +0100
5587 -/* $Id: diva.c,v 1.1.4.2 2002/08/30 11:21:00 keil Exp $
5588 +/* $Id: diva.c,v 1.33 2001/09/24 13:22:56 kai Exp $
5590 * low level stuff for Eicon.Diehl Diva Family ISDN cards
5598 #include <linux/pci.h>
5599 -#include <linux/isapnp.h>
5600 +#include <linux/isdn_compat.h>
5602 extern const char *CardType[];
5604 -const char *Diva_revision = "$Revision: 1.1.4.2 $";
5605 +const char *Diva_revision = "$Revision: 1.33 $";
5607 #define byteout(addr,val) outb(val,addr)
5608 #define bytein(addr) inb(addr)
5611 #define DIVA_IPAC_ISA 3
5612 #define DIVA_IPAC_PCI 4
5613 -#define DIVA_IPACX_PCI 5
5616 #define DIVA_IRQ_STAT 0x01
5618 #define PITA_MISC_REG 0x1c
5620 #define PITA_PARA_SOFTRESET 0x00000001
5621 -#define PITA_SER_SOFTRESET 0x00000002
5622 #define PITA_PARA_MPX_MODE 0x00000004
5623 #define PITA_INT0_ENABLE 0x00000200
5625 #define PITA_PARA_SOFTRESET 0x01000000
5626 -#define PITA_SER_SOFTRESET 0x02000000
5627 #define PITA_PARA_MPX_MODE 0x04000000
5628 #define PITA_INT0_ENABLE 0x00020000
5630 @@ -244,47 +240,6 @@
5631 memwritereg(cs->hw.diva.cfg_reg, offset + (hscx ? 0x40 : 0), value);
5634 -/* IO-Functions for IPACX type cards */
5636 -MemReadISAC_IPACX(struct IsdnCardState *cs, u_char offset)
5638 - return (memreadreg(cs->hw.diva.cfg_reg, offset));
5642 -MemWriteISAC_IPACX(struct IsdnCardState *cs, u_char offset, u_char value)
5644 - memwritereg(cs->hw.diva.cfg_reg, offset, value);
5648 -MemReadISACfifo_IPACX(struct IsdnCardState *cs, u_char * data, int size)
5651 - *data++ = memreadreg(cs->hw.diva.cfg_reg, 0);
5655 -MemWriteISACfifo_IPACX(struct IsdnCardState *cs, u_char * data, int size)
5658 - memwritereg(cs->hw.diva.cfg_reg, 0, *data++);
5662 -MemReadHSCX_IPACX(struct IsdnCardState *cs, int hscx, u_char offset)
5664 - return(memreadreg(cs->hw.diva.cfg_reg, offset +
5665 - (hscx ? IPACX_OFF_B2 : IPACX_OFF_B1)));
5669 -MemWriteHSCX_IPACX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value)
5671 - memwritereg(cs->hw.diva.cfg_reg, offset +
5672 - (hscx ? IPACX_OFF_B2 : IPACX_OFF_B1), value);
5676 * fast interrupt HSCX stuff goes here
5680 struct BCState *bcs;
5682 - if (val & 0x01) { // EXB
5685 exval = MemReadHSCX(cs, 1, HSCX_EXIR);
5688 debugl1(cs, "HSCX B interrupt %x", val);
5689 Memhscx_interrupt(cs, val, 1);
5691 - if (val & 0x02) { // EXA
5694 exval = MemReadHSCX(cs, 0, HSCX_EXIR);
5697 } else if (cs->debug & L1_DEB_HSCX)
5698 debugl1(cs, "HSCX A EXIR %x", exval);
5700 - if (val & 0x04) { // ICA
5702 exval = MemReadHSCX(cs, 0, HSCX_ISTA);
5703 if (cs->debug & L1_DEB_HSCX)
5704 debugl1(cs, "HSCX A interrupt %x", exval);
5705 @@ -705,31 +660,12 @@
5706 memwritereg(cs->hw.diva.cfg_reg, IPAC_MASK, 0xC0);
5710 -diva_irq_ipacx_pci(int intno, void *dev_id, struct pt_regs *regs)
5712 - struct IsdnCardState *cs = dev_id;
5717 - printk(KERN_WARNING "Diva: Spurious interrupt!\n");
5720 - cfg = (u_char *) cs->hw.diva.pci_cfg;
5722 - if (!(val &PITA_INT0_STATUS)) return; // other shared IRQ
5723 - interrupt_ipacx(cs); // handler for chip
5724 - *cfg = PITA_INT0_STATUS; // Reset PLX interrupt
5728 release_io_diva(struct IsdnCardState *cs)
5732 - if ((cs->subtyp == DIVA_IPAC_PCI) ||
5733 - (cs->subtyp == DIVA_IPACX_PCI) ) {
5734 + if (cs->subtyp == DIVA_IPAC_PCI) {
5735 u_int *cfg = (unsigned int *)cs->hw.diva.pci_cfg;
5737 *cfg = 0; /* disable INT0/1 */
5738 @@ -776,16 +712,6 @@
5739 set_current_state(TASK_UNINTERRUPTIBLE);
5740 schedule_timeout((10*HZ)/1000);
5741 memwritereg(cs->hw.diva.cfg_reg, IPAC_MASK, 0xc0);
5742 - } else if (cs->subtyp == DIVA_IPACX_PCI) {
5743 - unsigned int *ireg = (unsigned int *)(cs->hw.diva.pci_cfg +
5745 - *ireg = PITA_PARA_SOFTRESET | PITA_PARA_MPX_MODE;
5746 - set_current_state(TASK_UNINTERRUPTIBLE);
5747 - schedule_timeout((10*HZ)/1000);
5748 - *ireg = PITA_PARA_MPX_MODE | PITA_SER_SOFTRESET;
5749 - set_current_state(TASK_UNINTERRUPTIBLE);
5750 - schedule_timeout((10*HZ)/1000);
5751 - MemWriteISAC_IPACX(cs, IPACX_MASK, 0xff); // Interrupts off
5752 } else { /* DIVA 2.0 */
5753 cs->hw.diva.ctrl_reg = 0; /* Reset On */
5754 byteout(cs->hw.diva.ctrl, cs->hw.diva.ctrl_reg);
5759 - if ((cs->subtyp == DIVA_IPAC_ISA) ||
5760 - (cs->subtyp == DIVA_IPAC_PCI) ||
5761 - (cs->subtyp == DIVA_IPACX_PCI) )
5762 + if ((cs->subtyp == DIVA_IPAC_ISA) || (cs->subtyp == DIVA_IPAC_PCI))
5764 del_timer(&cs->hw.diva.tl);
5765 if (cs->hw.diva.status & DIVA_ASSIGN)
5766 @@ -859,12 +783,6 @@
5767 release_io_diva(cs);
5770 - if (cs->subtyp == DIVA_IPACX_PCI) {
5771 - ireg = (unsigned int *)cs->hw.diva.pci_cfg;
5772 - *ireg = PITA_INT0_ENABLE;
5773 - init_ipacx(cs, 3); // init chip and enable interrupts
5776 if (cs->subtyp == DIVA_IPAC_PCI) {
5777 ireg = (unsigned int *)cs->hw.diva.pci_cfg;
5778 *ireg = PITA_INT0_ENABLE;
5783 - if ((cs->subtyp != DIVA_IPAC_ISA) &&
5784 - (cs->subtyp != DIVA_IPAC_PCI) &&
5785 - (cs->subtyp != DIVA_IPACX_PCI) )
5786 + if ((cs->subtyp != DIVA_IPAC_ISA) && (cs->subtyp != DIVA_IPAC_PCI))
5787 diva_led_handler(cs);
5790 @@ -911,40 +827,11 @@
5791 static struct pci_dev *dev_diva __initdata = NULL;
5792 static struct pci_dev *dev_diva_u __initdata = NULL;
5793 static struct pci_dev *dev_diva201 __initdata = NULL;
5794 -static struct pci_dev *dev_diva202 __initdata = NULL;
5797 -static struct isapnp_device_id diva_ids[] __initdata = {
5798 - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51),
5799 - ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51),
5800 - (unsigned long) "Diva picola" },
5801 - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51),
5802 - ISAPNP_VENDOR('E', 'I', 'C'), ISAPNP_FUNCTION(0x51),
5803 - (unsigned long) "Diva picola" },
5804 - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x71),
5805 - ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x71),
5806 - (unsigned long) "Diva 2.0" },
5807 - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x71),
5808 - ISAPNP_VENDOR('E', 'I', 'C'), ISAPNP_FUNCTION(0x71),
5809 - (unsigned long) "Diva 2.0" },
5810 - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0xA1),
5811 - ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0xA1),
5812 - (unsigned long) "Diva 2.01" },
5813 - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0xA1),
5814 - ISAPNP_VENDOR('E', 'I', 'C'), ISAPNP_FUNCTION(0xA1),
5815 - (unsigned long) "Diva 2.01" },
5819 -static struct isapnp_device_id *pdev = &diva_ids[0];
5820 -static struct pci_bus *pnp_c __devinitdata = NULL;
5825 setup_diva(struct IsdnCard *card)
5830 struct IsdnCardState *cs = card->cs;
5832 @@ -977,75 +864,8 @@
5833 cs->hw.diva.hscx_adr = card->para[1] + DIVA_HSCX_ADR;
5835 cs->irq = card->para[0];
5839 - if (isapnp_present()) {
5840 - struct pci_bus *pb;
5841 - struct pci_dev *pd;
5843 - while(pdev->card_vendor) {
5844 - if ((pb = isapnp_find_card(pdev->card_vendor,
5845 - pdev->card_device, pnp_c))) {
5848 - if ((pd = isapnp_find_dev(pnp_c,
5849 - pdev->vendor, pdev->function, pd))) {
5850 - printk(KERN_INFO "HiSax: %s detected\n",
5851 - (char *)pdev->driver_data);
5853 - pd->deactivate(pd);
5856 - pd->resource[0].start;
5858 - pd->irq_resource[0].start;
5859 - if (!card->para[0] || !card->para[1]) {
5860 - printk(KERN_ERR "Diva PnP:some resources are missing %ld/%lx\n",
5861 - card->para[0], card->para[1]);
5862 - pd->deactivate(pd);
5865 - cs->hw.diva.cfg_reg = card->para[1];
5866 - cs->irq = card->para[0];
5867 - if (pdev->function == ISAPNP_FUNCTION(0xA1)) {
5868 - cs->subtyp = DIVA_IPAC_ISA;
5869 - cs->hw.diva.ctrl = 0;
5870 - cs->hw.diva.isac =
5871 - card->para[1] + DIVA_IPAC_DATA;
5872 - cs->hw.diva.hscx =
5873 - card->para[1] + DIVA_IPAC_DATA;
5874 - cs->hw.diva.isac_adr =
5875 - card->para[1] + DIVA_IPAC_ADR;
5876 - cs->hw.diva.hscx_adr =
5877 - card->para[1] + DIVA_IPAC_ADR;
5878 - test_and_set_bit(HW_IPAC, &cs->HW_Flags);
5880 - cs->subtyp = DIVA_ISA;
5881 - cs->hw.diva.ctrl =
5882 - card->para[1] + DIVA_ISA_CTRL;
5883 - cs->hw.diva.isac =
5884 - card->para[1] + DIVA_ISA_ISAC_DATA;
5885 - cs->hw.diva.hscx =
5886 - card->para[1] + DIVA_HSCX_DATA;
5887 - cs->hw.diva.isac_adr =
5888 - card->para[1] + DIVA_ISA_ISAC_ADR;
5889 - cs->hw.diva.hscx_adr =
5890 - card->para[1] + DIVA_HSCX_ADR;
5894 - printk(KERN_ERR "Diva PnP: PnP error card found, no device\n");
5901 - if (!pdev->card_vendor) {
5902 - printk(KERN_INFO "Diva PnP: no ISAPnP card found\n");
5907 if (!pci_present()) {
5908 printk(KERN_ERR "Diva: no PCI bus present\n");
5909 @@ -1059,14 +879,14 @@
5911 cs->subtyp = DIVA_PCI;
5912 cs->irq = dev_diva->irq;
5913 - cs->hw.diva.cfg_reg = pci_resource_start(dev_diva, 2);
5914 + cs->hw.diva.cfg_reg = pci_resource_start_io(dev_diva, 2);
5915 } else if ((dev_diva_u = pci_find_device(PCI_VENDOR_ID_EICON,
5916 PCI_DEVICE_ID_EICON_DIVA20_U, dev_diva_u))) {
5917 if (pci_enable_device(dev_diva_u))
5919 cs->subtyp = DIVA_PCI;
5920 cs->irq = dev_diva_u->irq;
5921 - cs->hw.diva.cfg_reg = pci_resource_start(dev_diva_u, 2);
5922 + cs->hw.diva.cfg_reg = pci_resource_start_io(dev_diva_u, 2);
5923 } else if ((dev_diva201 = pci_find_device(PCI_VENDOR_ID_EICON,
5924 PCI_DEVICE_ID_EICON_DIVA201, dev_diva201))) {
5925 if (pci_enable_device(dev_diva201))
5926 @@ -1074,19 +894,9 @@
5927 cs->subtyp = DIVA_IPAC_PCI;
5928 cs->irq = dev_diva201->irq;
5929 cs->hw.diva.pci_cfg =
5930 - (ulong) ioremap(pci_resource_start(dev_diva201, 0), 4096);
5931 + (ulong) ioremap(pci_resource_start_mem(dev_diva201, 0), 4096);
5932 cs->hw.diva.cfg_reg =
5933 - (ulong) ioremap(pci_resource_start(dev_diva201, 1), 4096);
5934 - } else if ((dev_diva202 = pci_find_device(PCI_VENDOR_ID_EICON,
5935 - PCI_DEVICE_ID_EICON_DIVA202, dev_diva202))) {
5936 - if (pci_enable_device(dev_diva202))
5938 - cs->subtyp = DIVA_IPACX_PCI;
5939 - cs->irq = dev_diva202->irq;
5940 - cs->hw.diva.pci_cfg =
5941 - (ulong) ioremap(pci_resource_start(dev_diva202, 0), 4096);
5942 - cs->hw.diva.cfg_reg =
5943 - (ulong) ioremap(pci_resource_start(dev_diva202, 1), 4096);
5944 + (ulong) ioremap(pci_resource_start_mem(dev_diva201, 1), 4096);
5946 printk(KERN_WARNING "Diva: No PCI card found\n");
5948 @@ -1107,8 +917,7 @@
5949 printk(KERN_WARNING "Diva: unable to config DIVA PCI\n");
5951 #endif /* CONFIG_PCI */
5952 - if ((cs->subtyp == DIVA_IPAC_PCI) ||
5953 - (cs->subtyp == DIVA_IPACX_PCI) ) {
5954 + if (cs->subtyp == DIVA_IPAC_PCI) {
5955 cs->hw.diva.ctrl = 0;
5956 cs->hw.diva.isac = 0;
5957 cs->hw.diva.hscx = 0;
5958 @@ -1125,23 +934,18 @@
5965 "Diva: %s card configured at %#lx IRQ %d\n",
5966 (cs->subtyp == DIVA_PCI) ? "PCI" :
5967 (cs->subtyp == DIVA_ISA) ? "ISA" :
5968 - (cs->subtyp == DIVA_IPAC_ISA) ? "IPAC ISA" :
5969 - (cs->subtyp == DIVA_IPAC_PCI) ? "IPAC PCI" : "IPACX PCI",
5970 + (cs->subtyp == DIVA_IPAC_ISA) ? "IPAC ISA" : "IPAC PCI",
5971 cs->hw.diva.cfg_reg, cs->irq);
5972 - if ((cs->subtyp == DIVA_IPAC_PCI) ||
5973 - (cs->subtyp == DIVA_IPACX_PCI) ||
5974 - (cs->subtyp == DIVA_PCI) )
5975 - printk(KERN_INFO "Diva: %s space at %#lx\n",
5976 - (cs->subtyp == DIVA_PCI) ? "PCI" :
5977 - (cs->subtyp == DIVA_IPAC_PCI) ? "IPAC PCI" : "IPACX PCI",
5978 + if ((cs->subtyp == DIVA_IPAC_PCI) || (cs->subtyp == DIVA_PCI))
5979 + printk(KERN_INFO "Diva: %s PCI space at %#lx\n",
5980 + (cs->subtyp == DIVA_PCI) ? "PCI" : "IPAC PCI",
5981 cs->hw.diva.pci_cfg);
5982 - if ((cs->subtyp != DIVA_IPAC_PCI) &&
5983 - (cs->subtyp != DIVA_IPACX_PCI) ) {
5984 + if (cs->subtyp != DIVA_IPAC_PCI) {
5985 if (check_region(cs->hw.diva.cfg_reg, bytecnt)) {
5987 "HiSax: %s config port %lx-%lx already in use\n",
5988 @@ -1177,17 +981,6 @@
5989 cs->irq_func = &diva_irq_ipac_pci;
5990 val = memreadreg(cs->hw.diva.cfg_reg, IPAC_ID);
5991 printk(KERN_INFO "Diva: IPAC version %x\n", val);
5992 - } else if (cs->subtyp == DIVA_IPACX_PCI) {
5993 - cs->readisac = &MemReadISAC_IPACX;
5994 - cs->writeisac = &MemWriteISAC_IPACX;
5995 - cs->readisacfifo = &MemReadISACfifo_IPACX;
5996 - cs->writeisacfifo = &MemWriteISACfifo_IPACX;
5997 - cs->BC_Read_Reg = &MemReadHSCX_IPACX;
5998 - cs->BC_Write_Reg = &MemWriteHSCX_IPACX;
5999 - cs->BC_Send_Data = 0; // function located in ipacx module
6000 - cs->irq_func = &diva_irq_ipacx_pci;
6001 - printk(KERN_INFO "Diva: IPACX Design Id: %x\n",
6002 - MemReadISAC_IPACX(cs, IPACX_ID) &0x3F);
6003 } else { /* DIVA 2.0 */
6004 cs->hw.diva.tl.function = (void *) diva_led_handler;
6005 cs->hw.diva.tl.data = (long) cs;
6006 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/elsa.c linux-2.4.29/drivers/isdn/hisax/elsa.c
6007 --- linux-2.4.29.old/drivers/isdn/hisax/elsa.c 2005-03-22 14:47:56.000000000 +0100
6008 +++ linux-2.4.29/drivers/isdn/hisax/elsa.c 2005-03-22 15:06:46.123081008 +0100
6010 -/* $Id: elsa.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6011 +/* $Id: elsa.c,v 2.32 2001/09/24 13:22:56 kai Exp $
6013 * low level stuff for Elsa isdn cards
6018 #include <linux/pci.h>
6019 -#include <linux/isapnp.h>
6020 +#include <linux/isdn_compat.h>
6021 #include <linux/serial.h>
6022 #include <linux/serial_reg.h>
6024 extern const char *CardType[];
6026 -const char *Elsa_revision = "$Revision: 1.1.4.1 $";
6027 +const char *Elsa_revision = "$Revision: 2.32 $";
6028 const char *Elsa_Types[] =
6029 {"None", "PC", "PCC-8", "PCC-16", "PCF", "PCF-Pro",
6030 "PCMCIA", "QS 1000", "QS 3000", "Microlink PCI", "QS 3000 PCI",
6031 @@ -864,21 +864,6 @@
6032 static struct pci_dev *dev_qs1000 __devinitdata = NULL;
6033 static struct pci_dev *dev_qs3000 __devinitdata = NULL;
6036 -static struct isapnp_device_id elsa_ids[] __initdata = {
6037 - { ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0133),
6038 - ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0133),
6039 - (unsigned long) "Elsa QS1000" },
6040 - { ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0134),
6041 - ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0134),
6042 - (unsigned long) "Elsa QS3000" },
6046 -static struct isapnp_device_id *pdev = &elsa_ids[0];
6047 -static struct pci_bus *pnp_c __devinitdata = NULL;
6051 setup_elsa(struct IsdnCard *card)
6054 cs->hw.elsa.ctrl_reg = 0;
6055 cs->hw.elsa.status = 0;
6056 cs->hw.elsa.MFlag = 0;
6058 if (cs->typ == ISDN_CTYPE_ELSA) {
6059 cs->hw.elsa.base = card->para[0];
6060 printk(KERN_INFO "Elsa: Microlink IO probing\n");
6061 @@ -955,60 +939,9 @@
6064 } else if (cs->typ == ISDN_CTYPE_ELSA_PNP) {
6066 - if (!card->para[1] && isapnp_present()) {
6067 - struct pci_bus *pb;
6068 - struct pci_dev *pd;
6070 - while(pdev->card_vendor) {
6071 - if ((pb = isapnp_find_card(pdev->card_vendor,
6072 - pdev->card_device, pnp_c))) {
6075 - if ((pd = isapnp_find_dev(pnp_c,
6076 - pdev->vendor, pdev->function, pd))) {
6077 - printk(KERN_INFO "HiSax: %s detected\n",
6078 - (char *)pdev->driver_data);
6080 - pd->deactivate(pd);
6083 - pd->resource[0].start;
6085 - pd->irq_resource[0].start;
6086 - if (!card->para[0] || !card->para[1]) {
6087 - printk(KERN_ERR "Elsa PnP:some resources are missing %ld/%lx\n",
6088 - card->para[0], card->para[1]);
6089 - pd->deactivate(pd);
6092 - if (pdev->function == ISAPNP_FUNCTION(0x133))
6093 - cs->subtyp = ELSA_QS1000;
6095 - cs->subtyp = ELSA_QS3000;
6098 - printk(KERN_ERR "Elsa PnP: PnP error card found, no device\n");
6105 - if (!pdev->card_vendor) {
6106 - printk(KERN_INFO "Elsa PnP: no ISAPnP card found\n");
6111 - if (card->para[1] && card->para[0]) {
6112 - cs->hw.elsa.base = card->para[1];
6113 - cs->irq = card->para[0];
6115 - cs->subtyp = ELSA_QS1000;
6117 - printk(KERN_ERR "Elsa PnP: no parameter\n");
6119 + cs->hw.elsa.base = card->para[1];
6120 + cs->irq = card->para[0];
6121 + cs->subtyp = ELSA_QS1000;
6122 cs->hw.elsa.cfg = cs->hw.elsa.base + ELSA_CONFIG;
6123 cs->hw.elsa.ale = cs->hw.elsa.base + ELSA_ALE;
6124 cs->hw.elsa.isac = cs->hw.elsa.base + ELSA_ISAC;
6125 @@ -1058,16 +991,16 @@
6127 cs->subtyp = ELSA_QS1000PCI;
6128 cs->irq = dev_qs1000->irq;
6129 - cs->hw.elsa.cfg = pci_resource_start(dev_qs1000, 1);
6130 - cs->hw.elsa.base = pci_resource_start(dev_qs1000, 3);
6131 + cs->hw.elsa.cfg = pci_resource_start_io(dev_qs1000, 1);
6132 + cs->hw.elsa.base = pci_resource_start_io(dev_qs1000, 3);
6133 } else if ((dev_qs3000 = pci_find_device(PCI_VENDOR_ID_ELSA,
6134 PCI_DEVICE_ID_ELSA_QS3000, dev_qs3000))) {
6135 if (pci_enable_device(dev_qs3000))
6137 cs->subtyp = ELSA_QS3000PCI;
6138 cs->irq = dev_qs3000->irq;
6139 - cs->hw.elsa.cfg = pci_resource_start(dev_qs3000, 1);
6140 - cs->hw.elsa.base = pci_resource_start(dev_qs3000, 3);
6141 + cs->hw.elsa.cfg = pci_resource_start_io(dev_qs3000, 1);
6142 + cs->hw.elsa.base = pci_resource_start_io(dev_qs3000, 3);
6144 printk(KERN_WARNING "Elsa: No PCI card found\n");
6146 @@ -1123,7 +1056,6 @@
6151 case ELSA_QS3000PCI:
6154 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/elsa_cs.c linux-2.4.29/drivers/isdn/hisax/elsa_cs.c
6155 --- linux-2.4.29.old/drivers/isdn/hisax/elsa_cs.c 2005-03-22 14:47:56.000000000 +0100
6156 +++ linux-2.4.29/drivers/isdn/hisax/elsa_cs.c 2005-03-22 15:06:46.138078728 +0100
6158 MODULE_PARM(pc_debug, "i");
6159 #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args);
6160 static char *version =
6161 -"elsa_cs.c $Revision: 1.1.4.1 $ $Date: 2001/11/20 14:19:35 $ (K.Lichtenwalder)";
6162 +"elsa_cs.c $Revision: 1.2 $ $Date: 2001/09/24 13:22:56 $ (K.Lichtenwalder)";
6164 #define DEBUG(n, args...)
6166 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/elsa_ser.c linux-2.4.29/drivers/isdn/hisax/elsa_ser.c
6167 --- linux-2.4.29.old/drivers/isdn/hisax/elsa_ser.c 2005-03-22 14:47:56.000000000 +0100
6168 +++ linux-2.4.29/drivers/isdn/hisax/elsa_ser.c 2005-03-22 15:06:46.158075688 +0100
6170 -/* $Id: elsa_ser.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6171 +/* $Id: elsa_ser.c,v 2.14 2001/09/24 13:22:56 kai Exp $
6173 * stuff for the serial modem on ELSA cards
6175 @@ -396,6 +396,74 @@
6180 +static inline void check_modem_status(struct IsdnCardState *cs)
6183 + struct async_struct *info = cs->hw.elsa.info;
6184 + struct async_icount *icount;
6186 + status = serial_inp(info, UART_MSR);
6188 + if (status & UART_MSR_ANY_DELTA) {
6189 + icount = &info->state->icount;
6190 + /* update input line counters */
6191 + if (status & UART_MSR_TERI)
6193 + if (status & UART_MSR_DDSR)
6195 + if (status & UART_MSR_DDCD) {
6198 + if (status & UART_MSR_DCTS)
6200 +// wake_up(&info->delta_msr_wait);
6203 + if ((info->flags & ASYNC_CHECK_CD) && (status & UART_MSR_DDCD)) {
6204 +#if (defined(SERIAL_DEBUG_OPEN) || defined(SERIAL_DEBUG_INTR))
6205 + printk("ttys%d CD now %s...", info->line,
6206 + (status & UART_MSR_DCD) ? "on" : "off");
6208 + if (status & UART_MSR_DCD)
6209 +// wake_up(&info->open_wait);
6211 + else if (!((info->flags & ASYNC_CALLOUT_ACTIVE) &&
6212 + (info->flags & ASYNC_CALLOUT_NOHUP))) {
6213 +#ifdef SERIAL_DEBUG_OPEN
6214 + printk("doing serial hangup...");
6217 + tty_hangup(info->tty);
6221 + if (info->flags & ASYNC_CTS_FLOW) {
6222 + if (info->tty->hw_stopped) {
6223 + if (status & UART_MSR_CTS) {
6224 +#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW))
6225 + printk("CTS tx start...");
6227 + info->tty->hw_stopped = 0;
6228 + info->IER |= UART_IER_THRI;
6229 + serial_outp(info, UART_IER, info->IER);
6230 +// rs_sched_event(info, RS_EVENT_WRITE_WAKEUP);
6234 + if (!(status & UART_MSR_CTS)) {
6235 +#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW))
6236 + printk("CTS tx stop...");
6238 + info->tty->hw_stopped = 1;
6239 + info->IER &= ~UART_IER_THRI;
6240 + serial_outp(info, UART_IER, info->IER);
6248 static void rs_interrupt_elsa(int irq, struct IsdnCardState *cs)
6250 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/fsm.c linux-2.4.29/drivers/isdn/hisax/fsm.c
6251 --- linux-2.4.29.old/drivers/isdn/hisax/fsm.c 2005-03-22 14:47:56.000000000 +0100
6252 +++ linux-2.4.29/drivers/isdn/hisax/fsm.c 2005-03-22 15:06:46.174073256 +0100
6254 -/* $Id: fsm.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6257 * Finite state machine
6261 #define FSM_TIMER_DEBUG 0
6263 +EXPORT_SYMBOL(FsmNew);
6264 +EXPORT_SYMBOL(FsmFree);
6265 +EXPORT_SYMBOL(FsmEvent);
6266 +EXPORT_SYMBOL(FsmChangeState);
6267 +EXPORT_SYMBOL(FsmInitTimer);
6268 +EXPORT_SYMBOL(FsmDelTimer);
6269 +EXPORT_SYMBOL(FsmRestartTimer);
6272 FsmNew(struct Fsm *fsm, struct FsmNode *fnlist, int fncount)
6274 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/fsm.h linux-2.4.29/drivers/isdn/hisax/fsm.h
6275 --- linux-2.4.29.old/drivers/isdn/hisax/fsm.h 2005-03-22 14:47:56.000000000 +0100
6276 +++ linux-2.4.29/drivers/isdn/hisax/fsm.h 2005-03-22 15:06:46.189070976 +0100
6278 -/* $Id: fsm.h,v 1.1.2.1 2001/11/20 14:19:35 kai Exp $
6281 * Finite state machine
6283 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/gazel.c linux-2.4.29/drivers/isdn/hisax/gazel.c
6284 --- linux-2.4.29.old/drivers/isdn/hisax/gazel.c 2005-03-22 14:47:56.000000000 +0100
6285 +++ linux-2.4.29/drivers/isdn/hisax/gazel.c 2005-03-22 15:06:46.205068544 +0100
6287 -/* $Id: gazel.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6288 +/* $Id: gazel.c,v 2.19 2001/09/24 13:22:56 kai Exp $
6290 * low level stuff for Gazel isdn cards
6295 #include <linux/pci.h>
6296 +#include <linux/isdn_compat.h>
6298 extern const char *CardType[];
6299 -const char *gazel_revision = "$Revision: 1.1.4.1 $";
6300 +const char *gazel_revision = "$Revision: 2.19 $";
6305 if (pci_enable_device(dev_tel))
6307 pci_irq = dev_tel->irq;
6308 - pci_ioaddr0 = pci_resource_start(dev_tel, 1);
6309 - pci_ioaddr1 = pci_resource_start(dev_tel, 2);
6310 + pci_ioaddr0 = pci_resource_start_io(dev_tel, 1);
6311 + pci_ioaddr1 = pci_resource_start_io(dev_tel, 2);
6315 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/hfc_2bds0.c linux-2.4.29/drivers/isdn/hisax/hfc_2bds0.c
6316 --- linux-2.4.29.old/drivers/isdn/hisax/hfc_2bds0.c 2005-03-22 14:47:56.000000000 +0100
6317 +++ linux-2.4.29/drivers/isdn/hisax/hfc_2bds0.c 2005-03-22 15:06:46.221066112 +0100
6319 -/* $Id: hfc_2bds0.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6320 +/* $Id: hfc_2bds0.c,v 1.18 2001/09/24 13:22:56 kai Exp $
6322 * specific routines for CCD's HFC 2BDS0
6324 @@ -616,6 +616,17 @@
6329 + if (test_and_clear_bit(D_CLEARBUSY, &cs->event)) {
6331 + debugl1(cs, "D-Channel Busy cleared");
6332 + stptr = cs->stlist;
6333 + while (stptr != NULL) {
6334 + stptr->l1.l1l2(stptr, PH_PAUSE | CONFIRM, NULL);
6335 + stptr = stptr->next;
6339 if (test_and_clear_bit(D_L1STATECHANGE, &cs->event)) {
6340 switch (cs->dc.hfcd.ph_state) {
6342 @@ -1090,6 +1101,32 @@
6343 cs->hw.hfcD.mst_m |= HFCD_MASTER;
6344 cs->writeisac(cs, HFCD_MST_MODE, cs->hw.hfcD.mst_m);
6347 + case (HW_TESTLOOP | REQUEST):
6349 + if (1 & (int) arg)
6351 + if (2 & (int) arg)
6353 + if (test_bit(HW_IOM1, &cs->HW_Flags)) {
6356 + cs->writeisac(cs, ISAC_SPCR, 0xa);
6357 + cs->writeisac(cs, ISAC_ADF1, 0x2);
6359 + cs->writeisac(cs, ISAC_SPCR, val);
6360 + cs->writeisac(cs, ISAC_ADF1, 0xa);
6364 + cs->writeisac(cs, ISAC_SPCR, val);
6366 + cs->writeisac(cs, ISAC_ADF1, 0x8);
6368 + cs->writeisac(cs, ISAC_ADF1, 0x0);
6373 if (cs->debug & L1_DEB_WARN)
6374 debugl1(cs, "hfcd_l1hw unknown pr %4x", pr);
6375 @@ -1106,6 +1143,20 @@
6377 hfc_dbusy_timer(struct IsdnCardState *cs)
6380 + struct PStack *stptr;
6381 + if (test_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) {
6383 + debugl1(cs, "D-Channel Busy");
6384 + test_and_set_bit(FLG_L1_DBUSY, &cs->HW_Flags);
6385 + stptr = cs->stlist;
6387 + while (stptr != NULL) {
6388 + stptr->l1.l1l2(stptr, PH_PAUSE | INDICATION, NULL);
6389 + stptr = stptr->next;
6396 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/hfc_2bds0.h linux-2.4.29/drivers/isdn/hisax/hfc_2bds0.h
6397 --- linux-2.4.29.old/drivers/isdn/hisax/hfc_2bds0.h 2005-03-22 14:47:56.000000000 +0100
6398 +++ linux-2.4.29/drivers/isdn/hisax/hfc_2bds0.h 2005-03-22 15:06:46.236063832 +0100
6400 -/* $Id: hfc_2bds0.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6401 +/* $Id: hfc_2bds0.h,v 1.6 2001/09/24 13:22:56 kai Exp $
6403 * specific defines for CCD's HFC 2BDS0
6405 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/hfc_2bs0.c linux-2.4.29/drivers/isdn/hisax/hfc_2bs0.c
6406 --- linux-2.4.29.old/drivers/isdn/hisax/hfc_2bs0.c 2005-03-22 14:47:56.000000000 +0100
6407 +++ linux-2.4.29/drivers/isdn/hisax/hfc_2bs0.c 2005-03-22 15:06:46.272058360 +0100
6409 -/* $Id: hfc_2bs0.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6410 +/* $Id: hfc_2bs0.c,v 1.20 2001/09/24 13:22:56 kai Exp $
6412 * specific routines for CCD's HFC 2BS0
6414 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/hfc_2bs0.h linux-2.4.29/drivers/isdn/hisax/hfc_2bs0.h
6415 --- linux-2.4.29.old/drivers/isdn/hisax/hfc_2bs0.h 2005-03-22 14:47:56.000000000 +0100
6416 +++ linux-2.4.29/drivers/isdn/hisax/hfc_2bs0.h 2005-03-22 15:06:46.288055928 +0100
6418 -/* $Id: hfc_2bs0.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6419 +/* $Id: hfc_2bs0.h,v 1.5 2001/09/24 13:22:56 kai Exp $
6421 * specific defines for CCD's HFC 2BS0
6423 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/hfc_pci.c linux-2.4.29/drivers/isdn/hisax/hfc_pci.c
6424 --- linux-2.4.29.old/drivers/isdn/hisax/hfc_pci.c 2005-03-22 14:47:56.000000000 +0100
6425 +++ linux-2.4.29/drivers/isdn/hisax/hfc_pci.c 2005-03-22 15:06:46.305053344 +0100
6427 -/* $Id: hfc_pci.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6428 +/* $Id: hfc_pci.c,v 1.48 2001/09/24 13:22:56 kai Exp $
6430 * low level driver for CCD´s hfc-pci based cards
6433 #include "hfc_pci.h"
6435 #include <linux/pci.h>
6436 +#include <linux/isdn_compat.h>
6437 #include <linux/interrupt.h>
6439 extern const char *CardType[];
6441 -static const char *hfcpci_revision = "$Revision: 1.1.4.1 $";
6442 +static const char *hfcpci_revision = "$Revision: 1.48 $";
6444 /* table entry in the PCI devices list */
6448 unsigned long flags;
6450 - printk(KERN_INFO "HiSax: release hfcpci at %p\n",
6451 - cs->hw.hfcpci.pci_io);
6454 cs->hw.hfcpci.int_m2 = 0; /* interrupt output off ! */
6456 set_current_state(TASK_UNINTERRUPTIBLE);
6457 schedule_timeout((30 * HZ) / 1000); /* Timeout 30ms */
6458 Write_hfc(cs, HFCPCI_CIRM, 0); /* Reset Off */
6460 pcibios_write_config_word(cs->hw.hfcpci.pci_bus, cs->hw.hfcpci.pci_device_fn, PCI_COMMAND, 0); /* disable memory mapped ports + busmaster */
6461 +#endif /* CONFIG_PCI */
6462 del_timer(&cs->hw.hfcpci.timer);
6463 kfree(cs->hw.hfcpci.share_start);
6464 cs->hw.hfcpci.share_start = NULL;
6465 - iounmap((void *)cs->hw.hfcpci.pci_io);
6466 + vfree(cs->hw.hfcpci.pci_io);
6469 /********************************************************************************/
6470 @@ -687,10 +688,6 @@
6471 debugl1(cs, "hfcpci_fill_fifo_trans %d frame length %d discarded",
6472 bcs->channel, bcs->tx_skb->len);
6474 - if (bcs->st->lli.l1writewakeup &&
6475 - (PACKET_NOACK != bcs->tx_skb->pkt_type))
6476 - bcs->st->lli.l1writewakeup(bcs->st, bcs->tx_skb->len);
6478 dev_kfree_skb_any(bcs->tx_skb);
6480 bcs->tx_skb = skb_dequeue(&bcs->squeue); /* fetch next data */
6481 @@ -1146,6 +1143,20 @@
6483 hfcpci_dbusy_timer(struct IsdnCardState *cs)
6486 + struct PStack *stptr;
6487 + if (test_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) {
6489 + debugl1(cs, "D-Channel Busy");
6490 + test_and_set_bit(FLG_L1_DBUSY, &cs->HW_Flags);
6491 + stptr = cs->stlist;
6493 + while (stptr != NULL) {
6494 + stptr->l1.l1l2(stptr, PH_PAUSE | INDICATION, NULL);
6495 + stptr = stptr->next;
6501 /*************************************/
6502 @@ -1550,6 +1561,17 @@
6507 + if (test_and_clear_bit(D_CLEARBUSY, &cs->event)) {
6509 + debugl1(cs, "D-Channel Busy cleared");
6510 + stptr = cs->stlist;
6511 + while (stptr != NULL) {
6512 + stptr->l1.l1l2(stptr, PH_PAUSE | CONFIRM, NULL);
6513 + stptr = stptr->next;
6517 if (test_and_clear_bit(D_L1STATECHANGE, &cs->event)) {
6518 if (!cs->hw.hfcpci.nt_mode)
6519 switch (cs->dc.hfcpci.ph_state) {
6520 @@ -1712,7 +1734,7 @@
6521 if (pci_enable_device(tmp_hfcpci))
6523 pci_set_master(tmp_hfcpci);
6524 - if ((card->para[0]) && (card->para[0] != (tmp_hfcpci->resource[ 0].start & PCI_BASE_ADDRESS_IO_MASK)))
6525 + if ((card->para[0]) && (card->para[0] != (get_pcibase(tmp_hfcpci, 0) & PCI_BASE_ADDRESS_IO_MASK)))
6529 @@ -1729,7 +1751,7 @@
6530 printk(KERN_WARNING "HFC-PCI: No IRQ for PCI card found\n");
6533 - cs->hw.hfcpci.pci_io = (char *) dev_hfcpci->resource[ 1].start;
6534 + cs->hw.hfcpci.pci_io = (char *) get_pcibase(dev_hfcpci, 1);
6535 printk(KERN_INFO "HiSax: HFC-PCI card manufacturer: %s card name: %s\n", id_list[i].vendor_name, id_list[i].card_name);
6537 printk(KERN_WARNING "HFC-PCI: No PCI card found\n");
6538 @@ -1746,7 +1768,7 @@
6539 printk(KERN_WARNING "HFC-PCI: Error allocating memory for FIFO!\n");
6542 - cs->hw.hfcpci.fifos = (void *)
6543 + (ulong) cs->hw.hfcpci.fifos =
6544 (((ulong) cs->hw.hfcpci.share_start) & ~0x7FFF) + 0x8000;
6545 pcibios_write_config_dword(cs->hw.hfcpci.pci_bus,
6546 cs->hw.hfcpci.pci_device_fn, 0x80,
6547 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/hfc_pci.h linux-2.4.29/drivers/isdn/hisax/hfc_pci.h
6548 --- linux-2.4.29.old/drivers/isdn/hisax/hfc_pci.h 2005-03-22 14:47:56.000000000 +0100
6549 +++ linux-2.4.29/drivers/isdn/hisax/hfc_pci.h 2005-03-22 15:06:46.320051064 +0100
6551 -/* $Id: hfc_pci.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6552 +/* $Id: hfc_pci.h,v 1.10 2001/09/24 13:22:56 kai Exp $
6554 * specific defines for CCD's HFC 2BDS0 PCI chips
6556 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/hfc_sx.c linux-2.4.29/drivers/isdn/hisax/hfc_sx.c
6557 --- linux-2.4.29.old/drivers/isdn/hisax/hfc_sx.c 2005-03-22 14:47:56.000000000 +0100
6558 +++ linux-2.4.29/drivers/isdn/hisax/hfc_sx.c 2005-03-22 15:06:46.350046504 +0100
6560 -/* $Id: hfc_sx.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6561 +/* $Id: hfc_sx.c,v 1.12 2001/09/24 13:22:56 kai Exp $
6563 * level driver for CCD´s hfc-s+/sp based cards
6568 #include <linux/interrupt.h>
6569 -#include <linux/isapnp.h>
6571 extern const char *CardType[];
6573 -static const char *hfcsx_revision = "$Revision: 1.1.4.1 $";
6574 +static const char *hfcsx_revision = "$Revision: 1.12 $";
6576 /***************************************/
6577 /* IRQ-table for CCDs demo board */
6578 @@ -940,6 +939,20 @@
6580 hfcsx_dbusy_timer(struct IsdnCardState *cs)
6583 + struct PStack *stptr;
6584 + if (test_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) {
6586 + debugl1(cs, "D-Channel Busy");
6587 + test_and_set_bit(FLG_L1_DBUSY, &cs->HW_Flags);
6588 + stptr = cs->stlist;
6590 + while (stptr != NULL) {
6591 + stptr->l1.l1l2(stptr, PH_PAUSE | INDICATION, NULL);
6592 + stptr = stptr->next;
6598 /*************************************/
6599 @@ -1333,6 +1346,17 @@
6604 + if (test_and_clear_bit(D_CLEARBUSY, &cs->event)) {
6606 + debugl1(cs, "D-Channel Busy cleared");
6607 + stptr = cs->stlist;
6608 + while (stptr != NULL) {
6609 + stptr->l1.l1l2(stptr, PH_PAUSE | CONFIRM, NULL);
6610 + stptr = stptr->next;
6614 if (test_and_clear_bit(D_L1STATECHANGE, &cs->event)) {
6615 if (!cs->hw.hfcsx.nt_mode)
6616 switch (cs->dc.hfcsx.ph_state) {
6617 @@ -1461,17 +1485,7 @@
6622 -static struct isapnp_device_id hfc_ids[] __initdata = {
6623 - { ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2620),
6624 - ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2620),
6625 - (unsigned long) "Teles 16.3c2" },
6629 -static struct isapnp_device_id *hdev = &hfc_ids[0];
6630 -static struct pci_bus *pnp_c __devinitdata = NULL;
6634 setup_hfcsx(struct IsdnCard *card)
6635 @@ -1482,45 +1496,6 @@
6637 strcpy(tmp, hfcsx_revision);
6638 printk(KERN_INFO "HiSax: HFC-SX driver Rev. %s\n", HiSax_getrev(tmp));
6640 - if (!card->para[1] && isapnp_present()) {
6641 - struct pci_bus *pb;
6642 - struct pci_dev *pd;
6644 - while(hdev->card_vendor) {
6645 - if ((pb = isapnp_find_card(hdev->card_vendor,
6646 - hdev->card_device, pnp_c))) {
6649 - if ((pd = isapnp_find_dev(pnp_c,
6650 - hdev->vendor, hdev->function, pd))) {
6651 - printk(KERN_INFO "HiSax: %s detected\n",
6652 - (char *)hdev->driver_data);
6654 - pd->deactivate(pd);
6656 - card->para[1] = pd->resource[0].start;
6657 - card->para[0] = pd->irq_resource[0].start;
6658 - if (!card->para[0] || !card->para[1]) {
6659 - printk(KERN_ERR "HFC PnP:some resources are missing %ld/%lx\n",
6660 - card->para[0], card->para[1]);
6661 - pd->deactivate(pd);
6666 - printk(KERN_ERR "HFC PnP: PnP error card found, no device\n");
6672 - if (!hdev->card_vendor) {
6673 - printk(KERN_INFO "HFC PnP: no ISAPnP card found\n");
6678 cs->hw.hfcsx.base = card->para[1] & 0xfffe;
6679 cs->irq = card->para[0];
6680 cs->hw.hfcsx.int_s1 = 0;
6681 @@ -1603,3 +1578,7 @@
6682 cs->auxcmd = &hfcsx_auxcmd;
6689 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/hfc_sx.h linux-2.4.29/drivers/isdn/hisax/hfc_sx.h
6690 --- linux-2.4.29.old/drivers/isdn/hisax/hfc_sx.h 2005-03-22 14:47:56.000000000 +0100
6691 +++ linux-2.4.29/drivers/isdn/hisax/hfc_sx.h 2005-03-22 15:06:46.365044224 +0100
6693 -/* $Id: hfc_sx.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
6696 * specific defines for CCD's HFC 2BDS0 S+,SP chips
6698 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/hfc_usb.c linux-2.4.29/drivers/isdn/hisax/hfc_usb.c
6699 --- linux-2.4.29.old/drivers/isdn/hisax/hfc_usb.c 1970-01-01 01:00:00.000000000 +0100
6700 +++ linux-2.4.29/drivers/isdn/hisax/hfc_usb.c 2005-03-22 15:06:46.381041792 +0100
6702 +/* $Id: hfc_usb.c,v 2.3 2001/07/06 21:30:11 werner Exp $
6706 + * Author (C) 2001 Werner Cornelius (werner@isdn-development.de)
6707 + * modular driver for Colognechip HFC-USB chip
6708 + * as plugin for HiSax isdn driver
6709 + * type approval valid for HFC-S USB based TAs
6711 + * Copyright 2001 by Werner Cornelius (werner@isdn-development.de)
6713 + * This program is free software; you can redistribute it and/or modify
6714 + * it under the terms of the GNU General Public License as published by
6715 + * the Free Software Foundation; either version 2, or (at your option)
6716 + * any later version.
6718 + * This program is distributed in the hope that it will be useful,
6719 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
6720 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6721 + * GNU General Public License for more details.
6723 + * You should have received a copy of the GNU General Public License
6724 + * along with this program; if not, write to the Free Software
6725 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
6729 +#include <linux/types.h>
6730 +#include <linux/stddef.h>
6731 +#include <linux/timer.h>
6732 +#include <linux/config.h>
6733 +#include <linux/isdn_compat.h>
6734 +#include <linux/init.h>
6736 +#include <linux/module.h>
6737 +#include <linux/kernel_stat.h>
6738 +#include <linux/tqueue.h>
6739 +#include <linux/usb.h>
6740 +#include <linux/kernel.h>
6741 +#include <linux/smp_lock.h>
6742 +#include <linux/sched.h>
6743 +#include "hisax_loadable.h"
6745 +#define INCLUDE_INLINE_FUNCS
6750 +#define HFC_CTRL_TIMEOUT 5 /* 5ms timeout writing/reading regs */
6751 +#define HFC_TIMER_T3 7000 /* timeout for l1 activation timer */
6753 +#define HFCUSB_L1_STATECHANGE 0 /* L1 state changed */
6754 +#define HFCUSB_L1_DRX 1 /* D-frame received */
6755 +#define HFCUSB_L1_ERX 2 /* E-frame received */
6756 +#define HFCUSB_L1_DTX 4 /* D-frames completed */
6758 +#define MAX_BCH_SIZE 2048 /* allowed B-channel packet size */
6760 +#define HFCUSB_RX_THRESHOLD 64 /* threshold for fifo report bit rx */
6761 +#define HFCUSB_TX_THRESHOLD 64 /* threshold for fifo report bit tx */
6763 +#define HFCUSB_CHIP_ID 0x16 /* Chip ID register index */
6764 +#define HFCUSB_CIRM 0x00 /* cirm register index */
6765 +#define HFCUSB_USB_SIZE 0x07 /* int length register */
6766 +#define HFCUSB_USB_SIZE_I 0x06 /* iso length register */
6767 +#define HFCUSB_F_CROSS 0x0b /* bit order register */
6768 +#define HFCUSB_CLKDEL 0x37 /* bit delay register */
6769 +#define HFCUSB_CON_HDLC 0xfa /* channel connect register */
6770 +#define HFCUSB_HDLC_PAR 0xfb
6771 +#define HFCUSB_SCTRL 0x31 /* S-bus control register (tx) */
6772 +#define HFCUSB_SCTRL_E 0x32 /* same for E and special funcs */
6773 +#define HFCUSB_SCTRL_R 0x33 /* S-bus control register (rx) */
6774 +#define HFCUSB_F_THRES 0x0c /* threshold register */
6775 +#define HFCUSB_FIFO 0x0f /* fifo select register */
6776 +#define HFCUSB_F_USAGE 0x1a /* fifo usage register */
6777 +#define HFCUSB_MST_MODE0 0x14
6778 +#define HFCUSB_MST_MODE1 0x15
6779 +#define HFCUSB_P_DATA 0x1f
6780 +#define HFCUSB_INC_RES_F 0x0e
6781 +#define HFCUSB_STATES 0x30
6783 +#define HFCUSB_CHIPID 0x40 /* ID value of HFC-USB */
6785 +/******************/
6786 +/* fifo registers */
6787 +/******************/
6788 +#define HFCUSB_NUM_FIFOS 8 /* maximum number of fifos */
6789 +#define HFCUSB_B1_TX 0 /* index for B1 transmit bulk/int */
6790 +#define HFCUSB_B1_RX 1 /* index for B1 receive bulk/int */
6791 +#define HFCUSB_B2_TX 2
6792 +#define HFCUSB_B2_RX 3
6793 +#define HFCUSB_D_TX 4
6794 +#define HFCUSB_D_RX 5
6795 +#define HFCUSB_PCM_TX 6
6796 +#define HFCUSB_PCM_RX 7
6801 +#define LED_DRIVER 0x1
6803 +#define LED_BCH 0x4
6808 +#define Write_hfc(a,b,c) usb_control_msg((a)->dev,(a)->ctrl_out_pipe,0,0x40,(c),(b),0,0,HFC_CTRL_TIMEOUT)
6809 +#define Read_hfc(a,b,c) usb_control_msg((a)->dev,(a)->ctrl_in_pipe,1,0xC0,0,(b),(c),1,HFC_CTRL_TIMEOUT)
6811 +#ifdef COMPAT_HAS_USB_IDTAB
6812 +/****************************************/
6813 +/* data defining the devices to be used */
6814 +/****************************************/
6815 +static __devinitdata const struct usb_device_id hfc_usb_idtab[3] = {
6816 + {USB_DEVICE(0x959, 0x2bd0)}, /* Colognechip ROM */
6817 + {USB_DEVICE(0x7b0, 0x0006)}, /* USB TA 128 */
6818 + {} /* end with an all-zeroes entry */
6822 +/*************************************************/
6823 +/* entry and size of output/input control buffer */
6824 +/*************************************************/
6825 +#define HFC_CTRL_BUFSIZE 32
6827 + __u8 hfc_reg; /* register number */
6828 + __u8 reg_val; /* value to be written (or read) */
6831 +/***************************************************************/
6832 +/* structure defining input+output fifos (interrupt/bulk mode) */
6833 +/***************************************************************/
6834 +struct hfcusb_data; /* forward definition */
6836 + int fifonum; /* fifo index attached to this structure */
6837 + __u8 fifo_mask; /* mask for this fifo */
6838 + int active; /* fifo is currently active */
6839 + struct hfcusb_data *hfc; /* pointer to main structure */
6840 + int pipe; /* address of endpoint */
6841 + __u8 usb_maxlen; /* maximum length for usb transfer */
6842 + int max_size; /* maximum size of receive/send packet */
6843 + int transmode; /* transparent mode selected */
6844 + int framenum; /* number of frame when last tx completed */
6845 + int rx_offset; /* offset inside rx buffer */
6846 + int next_complete; /* complete marker */
6847 + __u8 *act_ptr; /* pointer to next data */
6848 + __u8 intervall; /* interrupt interval */
6849 + struct sk_buff *buff; /* actual used buffer */
6850 + urb_t urb; /* transfer structure for usb routines */
6851 + __u8 buffer[128]; /* buffer incoming/outgoing data */
6854 +/*********************************************/
6855 +/* structure holding all data for one device */
6856 +/*********************************************/
6857 +typedef struct hfcusb_data {
6858 + struct hisax_drvreg regd; /* register data and callbacks */
6859 + struct usb_device *dev; /* our device */
6860 + int if_used; /* used interface number */
6861 + int alt_used; /* used alternate config */
6862 + int ctrl_paksize; /* control pipe packet size */
6863 + int ctrl_in_pipe, ctrl_out_pipe; /* handles for control pipe */
6865 + /* control pipe background handling */
6866 + ctrl_buft ctrl_buff[HFC_CTRL_BUFSIZE]; /* buffer holding queued data */
6867 + volatile int ctrl_in_idx, ctrl_out_idx, ctrl_cnt; /* input/output pointer + count */
6868 + urb_t ctrl_urb; /* transfer structure for control channel */
6869 + devrequest ctrl_write; /* buffer for control write request */
6870 + devrequest ctrl_read; /* same for read request */
6872 + volatile __u8 dfifo_fill; /* value read from tx d-fifo */
6873 + volatile __u8 active_fifos; /* fifos currently active as bit mask */
6874 + volatile __u8 threshold_mask; /* threshold actually reported */
6875 + volatile __u8 service_request; /* fifo needs service from task */
6876 + volatile __u8 ctrl_fifo; /* last selected fifo */
6877 + volatile __u8 bch_enables; /* or mask for sctrl_r and sctrl register values */
6878 + volatile __u8 led_req; /* request status of adapters leds */
6879 + volatile __u8 led_act; /* active status of adapters leds */
6880 + usb_fifo fifos[HFCUSB_NUM_FIFOS]; /* structure holding all fifo data */
6882 + /* layer 1 activation/deactivation handling */
6883 + volatile __u8 l1_state; /* actual l1 state */
6884 + volatile ulong l1_event; /* event mask */
6885 + struct tq_struct l1_tq; /* l1 bh structure */
6886 + struct timer_list t3_timer; /* timer for activation/deactivation */
6887 + struct timer_list t4_timer; /* timer for activation/deactivation */
6892 +usb_dump_urb(purb_t purb)
6894 + printk("urb :%p\n", purb);
6895 + printk("next :%p\n", purb->next);
6896 + printk("dev :%p\n", purb->dev);
6897 + printk("pipe :%08X\n", purb->pipe);
6898 + printk("status :%d\n", purb->status);
6899 + printk("transfer_flags :%08X\n", purb->transfer_flags);
6900 + printk("transfer_buffer :%p\n", purb->transfer_buffer);
6901 + printk("transfer_buffer_length:%d\n",
6902 + purb->transfer_buffer_length);
6903 + printk("actual_length :%d\n", purb->actual_length);
6904 + printk("setup_packet :%p\n", purb->setup_packet);
6905 + printk("start_frame :%d\n", purb->start_frame);
6906 + printk("number_of_packets :%d\n", purb->number_of_packets);
6907 + printk("interval :%d\n", purb->interval);
6908 + printk("error_count :%d\n", purb->error_count);
6909 + printk("context :%p\n", purb->context);
6910 + printk("complete :%p\n", purb->complete);
6914 +/*************************************************************************/
6915 +/* bottom half handler for L1 activation/deactiavtaion + D-chan + E-chan */
6916 +/*************************************************************************/
6918 +usb_l1d_bh(hfcusb_data * hfc)
6921 + while (hfc->l1_event) {
6922 + if (test_and_clear_bit
6923 + (HFCUSB_L1_STATECHANGE, &hfc->l1_event)) {
6924 + if (hfc->l1_state == 7)
6925 + hfc->led_req |= LED_L1;
6927 + hfc->led_req &= ~LED_L1;
6928 + if ((hfc->l1_state == 7) ||
6929 + (hfc->l1_state == 3))
6930 + hfc->regd.dch_l1l2(hfc->regd.arg_hisax,
6932 + 7) ? (PH_ACTIVATE |
6934 + : (PH_DEACTIVATE | INDICATION),
6937 + if (test_and_clear_bit(HFCUSB_L1_DRX, &hfc->l1_event)) {
6938 + hfc->regd.dch_l1l2(hfc->regd.arg_hisax,
6939 + PH_DATA | INDICATION,
6942 + if (test_and_clear_bit(HFCUSB_L1_ERX, &hfc->l1_event)) {
6943 + hfc->regd.dch_l1l2(hfc->regd.arg_hisax,
6944 + PH_DATA | INDICATION,
6947 + if (test_and_clear_bit(HFCUSB_L1_DTX, &hfc->l1_event)) {
6948 + hfc->regd.dch_l1l2(hfc->regd.arg_hisax,
6949 + PH_DATA | CONFIRM, NULL);
6954 +/******************************************************/
6955 +/* start next background transfer for control channel */
6956 +/******************************************************/
6958 +ctrl_start_transfer(hfcusb_data * hfc)
6961 + if (hfc->ctrl_cnt) {
6962 + switch (hfc->ctrl_buff[hfc->ctrl_out_idx].hfc_reg) {
6963 + case HFCUSB_F_USAGE:
6964 + hfc->ctrl_urb.pipe = hfc->ctrl_in_pipe;
6965 + hfc->ctrl_urb.setup_packet =
6966 + (u_char *) & hfc->ctrl_read;
6967 + hfc->ctrl_urb.transfer_buffer_length = 1;
6968 + hfc->ctrl_read.index =
6969 + hfc->ctrl_buff[hfc->ctrl_out_idx].
6971 + hfc->ctrl_urb.transfer_buffer =
6972 + (char *) &hfc->dfifo_fill;
6975 + default: /* write register */
6976 + hfc->ctrl_urb.pipe = hfc->ctrl_out_pipe;
6977 + hfc->ctrl_urb.setup_packet =
6978 + (u_char *) & hfc->ctrl_write;
6979 + hfc->ctrl_urb.transfer_buffer = NULL;
6980 + hfc->ctrl_urb.transfer_buffer_length = 0;
6981 + hfc->ctrl_write.index =
6982 + hfc->ctrl_buff[hfc->ctrl_out_idx].
6984 + hfc->ctrl_write.value =
6985 + hfc->ctrl_buff[hfc->ctrl_out_idx].
6989 + usb_submit_urb(&hfc->ctrl_urb); /* start transfer */
6991 +} /* ctrl_start_transfer */
6993 +/************************************/
6994 +/* queue a control transfer request */
6995 +/* return 0 on success. */
6996 +/************************************/
6998 +queue_control_request(hfcusb_data * hfc, __u8 reg, __u8 val)
7002 + if (hfc->ctrl_cnt >= HFC_CTRL_BUFSIZE)
7003 + return (1); /* no space left */
7004 + buf = hfc->ctrl_buff + hfc->ctrl_in_idx; /* pointer to new index */
7005 + buf->hfc_reg = reg;
7006 + buf->reg_val = val;
7007 + if (++hfc->ctrl_in_idx >= HFC_CTRL_BUFSIZE)
7008 + hfc->ctrl_in_idx = 0; /* pointer wrap */
7009 + if (++hfc->ctrl_cnt == 1)
7010 + ctrl_start_transfer(hfc);
7012 +} /* queue_control_request */
7014 +/**************************************/
7015 +/* called when timer t3 or t4 expires */
7016 +/**************************************/
7018 +l1_timer_expire(hfcusb_data * hfc)
7020 + if (timer_pending(&hfc->t4_timer))
7021 + del_timer(&hfc->t4_timer);
7022 + queue_control_request(hfc, HFCUSB_STATES, 0x40);
7023 + test_and_set_bit(HFCUSB_L1_STATECHANGE,
7025 + queue_task(&hfc->l1_tq, &tq_immediate);
7026 + mark_bh(IMMEDIATE_BH);
7027 +} /* l1_timer_expire */
7029 +/**************************************************/
7030 +/* (re)fills a tx-fifo urb. Queuing is done later */
7031 +/**************************************************/
7033 +fill_tx_urb(usb_fifo * fifo)
7035 + struct sk_buff *skb;
7039 + fifo->urb.dev = fifo->hfc->dev;
7041 + && (fifo->urb.transfer_buffer_length < fifo->usb_maxlen)) {
7042 + switch (fifo->fifonum) {
7043 + case HFCUSB_B1_TX:
7044 + case HFCUSB_B2_TX:
7046 + fifo->buff = NULL;
7047 + fifo->hfc->regd.bch_l1l2(fifo->hfc->regd.
7055 + fifo->hfc->service_request |=
7059 + dev_kfree_skb_any(fifo->buff);
7060 + fifo->buff = NULL;
7061 + save_flags(flags);
7063 + fifo->hfc->dfifo_fill = 0xff; /* currently invalid data */
7064 + queue_control_request(fifo->hfc,
7067 + queue_control_request(fifo->hfc,
7068 + HFCUSB_F_USAGE, 0);
7069 + restore_flags(flags);
7072 + return; /* error, invalid fifo */
7076 + /* check if new buffer needed */
7077 + if (!fifo->buff) {
7078 + switch (fifo->fifonum) {
7079 + case HFCUSB_B1_TX:
7080 + if (fifo->hfc->regd.bsk[0])
7081 + fifo->buff = *fifo->hfc->regd.bsk[0]; /* B1-channel tx buffer */
7083 + case HFCUSB_B2_TX:
7084 + if (fifo->hfc->regd.bsk[1])
7085 + fifo->buff = *fifo->hfc->regd.bsk[1]; /* B2-channel tx buffer */
7088 + if (fifo->hfc->regd.dsq)
7089 + fifo->buff = skb_dequeue(fifo->hfc->regd.dsq); /* D-channel tx queue */
7092 + return; /* error, invalid fifo */
7094 + if (!fifo->buff) {
7095 + fifo->active = 0; /* we are inactive now */
7096 + fifo->hfc->active_fifos &= ~fifo->fifo_mask;
7097 + if (fifo->fifonum == HFCUSB_D_TX) {
7098 + test_and_set_bit(HFCUSB_L1_DTX,
7099 + &fifo->hfc->l1_event);
7100 + queue_task(&fifo->hfc->l1_tq,
7102 + mark_bh(IMMEDIATE_BH);
7106 + fifo->act_ptr = fifo->buff->data; /* start of data */
7109 + fifo->hfc->active_fifos |= fifo->fifo_mask;
7110 + fifo->hfc->service_request &= ~fifo->fifo_mask;
7112 + /* fillup the send buffer */
7113 + i = fifo->buff->len - (fifo->act_ptr - fifo->buff->data); /* remaining length */
7114 + fifo->buffer[0] = !fifo->transmode; /* not eof */
7115 + if (i > (fifo->usb_maxlen - ii)) {
7116 + i = fifo->usb_maxlen - ii;
7119 + memcpy(fifo->buffer + ii, fifo->act_ptr, i);
7120 + fifo->urb.transfer_buffer_length = i + ii;
7121 + fifo->rx_offset = ii;
7122 +} /* fill_tx_urb */
7124 +/************************************************/
7125 +/* transmit completion routine for all tx fifos */
7126 +/************************************************/
7128 +tx_complete(purb_t urb)
7130 + usb_fifo *fifo = (usb_fifo *) urb->context; /* pointer to our fifo */
7132 + fifo->hfc->service_request &= ~fifo->fifo_mask; /* no further handling */
7133 + fifo->framenum = usb_get_current_frame_number(fifo->hfc->dev);
7135 + /* check for deactivation or error */
7136 + if ((!fifo->active) || (urb->status)) {
7137 + fifo->hfc->active_fifos &= ~fifo->fifo_mask; /* we are inactive */
7139 + if ((fifo->buff) && (fifo->fifonum == HFCUSB_D_TX)) {
7140 + dev_kfree_skb_any(fifo->buff);
7142 + fifo->buff = NULL;
7145 + fifo->act_ptr += (urb->transfer_buffer_length - fifo->rx_offset); /* adjust pointer */
7146 + fill_tx_urb(fifo); /* refill the urb */
7147 + fifo->hfc->threshold_mask |= fifo->fifo_mask; /* assume threshold reached */
7149 + fifo->hfc->service_request |= fifo->fifo_mask; /* need to restart */
7150 +} /* tx_complete */
7152 +/***********************************************/
7153 +/* receive completion routine for all rx fifos */
7154 +/***********************************************/
7156 +rx_complete(purb_t urb)
7158 + usb_fifo *fifo = (usb_fifo *) urb->context; /* pointer to our fifo */
7159 + hfcusb_data *hfc = fifo->hfc;
7162 + int i, ii, currcnt, hdlci;
7163 + struct sk_buff *skb;
7165 + urb->dev = hfc->dev; /* security init */
7166 + if ((!fifo->active) || (urb->status)) {
7167 + hfc->service_request &= ~fifo->fifo_mask; /* no further handling */
7168 + hfc->active_fifos &= ~fifo->fifo_mask; /* we are inactive */
7169 + fifo->urb.interval = 0; /* cancel automatic rescheduling */
7171 + dev_kfree_skb_any(fifo->buff);
7172 + fifo->buff = NULL;
7177 + /* first check for any status changes */
7178 + if ((urb->actual_length < fifo->rx_offset)
7179 + || (urb->actual_length > fifo->usb_maxlen))
7180 + return; /* error condition */
7182 + if (fifo->rx_offset) {
7183 + hfc->threshold_mask = fifo->buffer[1]; /* update threshold status */
7184 + fifo->next_complete = fifo->buffer[0] & 1;
7185 + if ((fifo->fifonum == HFCUSB_D_RX) &&
7186 + (hfc->led_req != hfc->led_act))
7187 + queue_control_request(hfc, HFCUSB_P_DATA, hfc->led_req);
7189 + /* check if rescheduling needed */
7191 + hfc->service_request & hfc->active_fifos & ~hfc->
7192 + threshold_mask)) {
7194 + usb_get_current_frame_number(hfc->dev);
7195 + txfifo = hfc->fifos + HFCUSB_B1_TX;
7198 + if ((i & txfifo->fifo_mask)
7199 + && (currcnt != txfifo->framenum)) {
7200 + hfc->service_request &=
7201 + ~txfifo->fifo_mask;
7202 + if (!txfifo->buff)
7203 + fill_tx_urb(txfifo);
7205 + usb_submit_urb(&txfifo->
7212 + /* handle l1 events */
7213 + if ((fifo->buffer[0] >> 4) != hfc->l1_state) {
7214 + last_state = hfc->l1_state;
7215 + hfc->l1_state = fifo->buffer[0] >> 4; /* update status */
7216 + if (timer_pending(&hfc->t4_timer))
7217 + del_timer(&hfc->t4_timer);
7218 + if (((hfc->l1_state == 3) &&
7219 + ((last_state == 7) ||
7220 + (last_state == 8))) ||
7221 + ((timer_pending(&hfc->t3_timer) &&
7222 + (hfc->l1_state == 8)))) {
7223 + hfc->t4_timer.expires = jiffies + 2;
7224 + add_timer(&hfc->t4_timer);
7226 + if (timer_pending(&hfc->t3_timer)
7227 + && (hfc->l1_state == 7))
7228 + del_timer(&hfc->t3_timer); /* no longer needed */
7229 + test_and_set_bit(HFCUSB_L1_STATECHANGE,
7231 + queue_task(&hfc->l1_tq, &tq_immediate);
7232 + mark_bh(IMMEDIATE_BH);
7237 + /* check the length for data and move if present */
7238 + if (fifo->next_complete || (urb->actual_length > fifo->rx_offset)) {
7239 + i = fifo->buff->len + urb->actual_length - fifo->rx_offset; /* new total length */
7240 + hdlci = (fifo->transmode) ? 0 : 3;
7241 + if (i <= (fifo->max_size + hdlci)) {
7242 + memcpy(fifo->act_ptr,
7243 + fifo->buffer + fifo->rx_offset,
7244 + urb->actual_length - fifo->rx_offset);
7246 + (urb->actual_length - fifo->rx_offset);
7247 + fifo->buff->len +=
7248 + (urb->actual_length - fifo->rx_offset);
7250 + fifo->buff->len = fifo->max_size + 4; /* mark frame as to long */
7251 + if (fifo->next_complete && (urb->actual_length < fifo->usb_maxlen)) {
7252 + /* the frame is complete */
7253 + fifo->next_complete = 0;
7254 + if (((!*(fifo->act_ptr - 1)) || fifo->transmode) &&
7255 + (fifo->buff->len >= (hdlci + 1))
7256 + && (fifo->buff->len <=
7257 + (fifo->max_size + hdlci)) &&
7258 + ((skb = dev_alloc_skb(fifo->max_size + hdlci)) != NULL)) {
7259 + fifo->buff->len -= hdlci; /* adjust size */
7260 + switch (fifo->fifonum) {
7262 + skb_queue_tail(hfc->regd.
7268 + queue_task(&hfc->l1_tq,
7270 + mark_bh(IMMEDIATE_BH);
7273 + case HFCUSB_B1_RX:
7274 + if (hfc->regd.brq[0]) {
7295 + case HFCUSB_B2_RX:
7296 + if (hfc->regd.brq[1]) {
7318 + case HFCUSB_PCM_RX:
7319 + skb_queue_tail(&hfc->regd.
7325 + queue_task(&hfc->l1_tq,
7327 + mark_bh(IMMEDIATE_BH);
7331 + dev_kfree_skb_any(fifo->
7337 + fifo->buff->len = 0; /* reset counter */
7338 + fifo->act_ptr = fifo->buff->data; /* and pointer */
7341 + fifo->rx_offset = (urb->actual_length < fifo->usb_maxlen) ? 2 : 0;
7342 +} /* rx_complete */
7344 +/***************************************************/
7345 +/* start the interrupt transfer for the given fifo */
7346 +/***************************************************/
7348 +start_rx_fifo(usb_fifo * fifo)
7351 + return; /* still active */
7354 + dev_alloc_skb(fifo->max_size + (fifo->transmode ? 0 : 3))))
7356 + fifo->act_ptr = fifo->buff->data;
7357 + FILL_INT_URB(&fifo->urb, fifo->hfc->dev, fifo->pipe, fifo->buffer,
7358 + fifo->usb_maxlen, rx_complete, fifo, fifo->intervall);
7359 + fifo->next_complete = 0;
7360 + fifo->rx_offset = 2;
7361 + fifo->active = 1; /* must be marked active */
7362 + fifo->hfc->active_fifos |= fifo->fifo_mask;
7363 + if (usb_submit_urb(&fifo->urb)) {
7365 + fifo->hfc->active_fifos &= ~fifo->fifo_mask;
7366 + dev_kfree_skb_any(fifo->buff);
7367 + fifo->buff = NULL;
7369 +} /* start_rx_fifo */
7371 +/***************************************************************/
7372 +/* control completion routine handling background control cmds */
7373 +/***************************************************************/
7375 +ctrl_complete(purb_t urb)
7377 + hfcusb_data *hfc = (hfcusb_data *) urb->context;
7379 + urb->dev = hfc->dev;
7380 + if (hfc->ctrl_cnt) {
7381 + switch (hfc->ctrl_buff[hfc->ctrl_out_idx].hfc_reg) {
7384 + hfc->ctrl_buff[hfc->ctrl_out_idx].
7387 + case HFCUSB_F_USAGE:
7388 + if (!hfc->dfifo_fill) {
7389 + fill_tx_urb(hfc->fifos +
7391 + if (hfc->fifos[HFCUSB_D_TX].buff)
7392 + usb_submit_urb(&hfc->
7397 + queue_control_request(hfc,
7400 + queue_control_request(hfc,
7405 + case HFCUSB_SCTRL_R:
7406 + switch (hfc->ctrl_fifo) {
7407 + case HFCUSB_B1_RX:
7408 + if (hfc->bch_enables & 1)
7409 + start_rx_fifo(hfc->
7414 + case HFCUSB_B2_RX:
7415 + if (hfc->bch_enables & 2)
7416 + start_rx_fifo(hfc->
7422 + if (hfc->bch_enables & 3)
7423 + hfc->led_req |= LED_BCH;
7425 + hfc->led_req &= ~LED_BCH;
7427 + case HFCUSB_P_DATA:
7429 + hfc->ctrl_buff[hfc->ctrl_out_idx].
7433 + hfc->ctrl_cnt--; /* decrement actual count */
7434 + if (++hfc->ctrl_out_idx >= HFC_CTRL_BUFSIZE)
7435 + hfc->ctrl_out_idx = 0; /* pointer wrap */
7436 + ctrl_start_transfer(hfc); /* start next transfer */
7438 +} /* ctrl_complete */
7440 +/*****************************************/
7441 +/* Layer 1 + D channel access from HiSax */
7442 +/*****************************************/
7444 +hfcusb_l1_access(void *drvarg, int pr, void *arg)
7446 + hfcusb_data *hfc = (hfcusb_data *) drvarg;
7449 + case (PH_DATA | REQUEST):
7450 + case (PH_PULL | INDICATION):
7451 + skb_queue_tail(hfc->regd.dsq,
7452 + (struct sk_buff *) arg);
7453 + if (!hfc->fifos[HFCUSB_D_TX].active
7454 + && !hfc->dfifo_fill) {
7455 + fill_tx_urb(hfc->fifos + HFCUSB_D_TX);
7456 + hfc->active_fifos |=
7457 + hfc->fifos[HFCUSB_D_TX].fifo_mask;
7458 + usb_submit_urb(&hfc->fifos[HFCUSB_D_TX].
7462 + case (PH_ACTIVATE | REQUEST):
7463 + switch (hfc->l1_state) {
7466 + hfc->regd.dch_l1l2(hfc->regd.arg_hisax,
7468 + INDICATION), NULL);
7472 + hfc->regd.dch_l1l2(hfc->regd.arg_hisax,
7474 + INDICATION), NULL);
7478 + queue_control_request(hfc, HFCUSB_STATES, 0x60); /* start activation */
7479 + hfc->t3_timer.expires =
7480 + jiffies + (HFC_TIMER_T3 * HZ) / 1000;
7481 + if (!timer_pending(&hfc->t3_timer))
7482 + add_timer(&hfc->t3_timer);
7487 + case (PH_DEACTIVATE | REQUEST):
7488 + queue_control_request(hfc, HFCUSB_STATES, 0x40); /* start deactivation */
7491 + printk(KERN_INFO "unknown hfcusb l1_access 0x%x\n",
7495 +} /* hfcusb_l1_access */
7497 +/*******************************/
7498 +/* B channel access from HiSax */
7499 +/*******************************/
7501 +hfcusb_bch_access(void *drvarg, int chan, int pr, void *arg)
7503 + hfcusb_data *hfc = (hfcusb_data *) drvarg;
7504 + usb_fifo *fifo = hfc->fifos + (chan ? HFCUSB_B2_TX : HFCUSB_B1_TX);
7508 + case (PH_DATA | REQUEST):
7509 + case (PH_PULL | INDICATION):
7510 + save_flags(flags);
7512 + if (!fifo->active) {
7513 + fill_tx_urb(fifo);
7514 + hfc->active_fifos |= fifo->fifo_mask;
7515 + usb_submit_urb(&fifo->urb);
7517 + restore_flags(flags);
7519 + case (PH_ACTIVATE | REQUEST):
7520 + if (!((int) arg)) {
7521 + hfc->bch_enables &= ~(1 << chan);
7522 + if (fifo->active) {
7524 + usb_unlink_urb(&fifo->urb);
7526 + save_flags(flags);
7528 + queue_control_request(hfc, HFCUSB_FIFO,
7530 + queue_control_request(hfc,
7531 + HFCUSB_INC_RES_F, 2);
7532 + queue_control_request(hfc, HFCUSB_CON_HDLC,
7534 + queue_control_request(hfc, HFCUSB_SCTRL,
7536 + hfc->bch_enables);
7537 + queue_control_request(hfc, HFCUSB_SCTRL_R,
7538 + hfc->bch_enables);
7539 + restore_flags(flags);
7541 + if (fifo->active) {
7543 + usb_unlink_urb(&fifo->urb);
7545 + return; /* fifo deactivated */
7547 + fifo->transmode = ((int) arg == L1_MODE_TRANS);
7549 + ((fifo->transmode) ? fifo->
7550 + usb_maxlen : MAX_BCH_SIZE);
7551 + (fifo + 1)->transmode = fifo->transmode;
7552 + (fifo + 1)->max_size = fifo->max_size;
7553 + hfc->bch_enables |= (1 << chan);
7554 + save_flags(flags);
7556 + queue_control_request(hfc, HFCUSB_FIFO,
7558 + queue_control_request(hfc, HFCUSB_CON_HDLC,
7560 + transmode) ? 9 : 11));
7561 + queue_control_request(hfc, HFCUSB_INC_RES_F, 2);
7562 + queue_control_request(hfc, HFCUSB_SCTRL,
7563 + 0x40 + hfc->bch_enables);
7564 + if ((int) arg == L1_MODE_HDLC)
7565 + queue_control_request(hfc, HFCUSB_CON_HDLC,
7567 + queue_control_request(hfc, HFCUSB_FIFO,
7568 + fifo->fifonum + 1);
7569 + queue_control_request(hfc, HFCUSB_CON_HDLC,
7571 + transmode) ? 8 : 10));
7572 + queue_control_request(hfc, HFCUSB_INC_RES_F, 2);
7573 + queue_control_request(hfc, HFCUSB_SCTRL_R,
7574 + hfc->bch_enables);
7575 + restore_flags(flags);
7581 + "unknown hfcusb bch_access chan %d 0x%x\n",
7585 +} /* hfcusb_bch_access */
7587 +/***************************************************************************/
7588 +/* usb_init is called once when a new matching device is detected to setup */
7589 +/* main parmeters. It registers the driver at the main hisax module. */
7590 +/* on success 0 is returned. */
7591 +/***************************************************************************/
7593 +usb_init(hfcusb_data * hfc)
7599 + /* check the chip id */
7600 + if ((Read_hfc(hfc, HFCUSB_CHIP_ID, &b) != 1) ||
7601 + (b != HFCUSB_CHIPID)) {
7602 + printk(KERN_INFO "HFC-USB: Invalid chip id 0x%02x\n", b);
7606 + /* first set the needed config, interface and alternate */
7607 + usb_set_configuration(hfc->dev, 1);
7608 + usb_set_interface(hfc->dev, hfc->if_used, hfc->alt_used);
7610 + /* init the led state request */
7611 + hfc->led_req = LED_DRIVER;
7613 + /* now we initialise the chip */
7614 + Write_hfc(hfc, HFCUSB_CIRM, 0x10); /* aux = output, reset off */
7615 + Write_hfc(hfc, HFCUSB_P_DATA, 0); /* leds = off */
7616 + Write_hfc(hfc, HFCUSB_USB_SIZE,
7617 + (hfc->fifos[HFCUSB_B1_TX].usb_maxlen >> 3) |
7618 + ((hfc->fifos[HFCUSB_B1_RX].usb_maxlen >> 3) << 4));
7620 + /* enable PCM/GCI master mode */
7621 + Write_hfc(hfc, HFCUSB_MST_MODE1, 0); /* set default values */
7622 + Write_hfc(hfc, HFCUSB_MST_MODE0, 1); /* enable master mode */
7624 + /* init the fifos */
7625 + Write_hfc(hfc, HFCUSB_F_THRES, (HFCUSB_TX_THRESHOLD >> 3) |
7626 + ((HFCUSB_RX_THRESHOLD >> 3) << 4));
7628 + for (i = 0, fifo = hfc->fifos + i; i < HFCUSB_NUM_FIFOS;
7630 + Write_hfc(hfc, HFCUSB_FIFO, i); /* select the desired fifo */
7632 + fifo->transmode = 0; /* hdlc mode selected */
7633 + fifo->buff = NULL; /* init buffer pointer */
7635 + (i <= HFCUSB_B2_RX) ? MAX_BCH_SIZE : MAX_DFRAME_LEN;
7636 + Write_hfc(hfc, HFCUSB_HDLC_PAR, ((i <= HFCUSB_B2_RX) ? 0 : 2)); /* data length */
7637 + Write_hfc(hfc, HFCUSB_CON_HDLC, ((i & 1) ? 0x08 : 0x09)); /* rx hdlc, tx fill 1 */
7638 + Write_hfc(hfc, HFCUSB_INC_RES_F, 2); /* reset the fifo */
7641 + Write_hfc(hfc, HFCUSB_CLKDEL, 0x0f); /* clock delay value */
7642 + Write_hfc(hfc, HFCUSB_STATES, 3 | 0x10); /* set deactivated mode */
7643 + Write_hfc(hfc, HFCUSB_STATES, 3); /* enable state machine */
7645 + Write_hfc(hfc, HFCUSB_SCTRL_R, 0); /* disable both B receivers */
7646 + Write_hfc(hfc, HFCUSB_SCTRL, 0x40); /* disable B transmitters + cap mode */
7648 + /* init the l1 timer */
7649 + init_timer(&hfc->t3_timer);
7650 + hfc->t3_timer.data = (long) hfc;
7651 + hfc->t3_timer.function = (void *) l1_timer_expire;
7652 + hfc->t4_timer.data = (long) hfc;
7653 + hfc->t4_timer.function = (void *) l1_timer_expire;
7654 + hfc->l1_tq.routine = (void *) (void *) usb_l1d_bh;
7655 + hfc->l1_tq.sync = 0;
7656 + hfc->l1_tq.data = hfc;
7658 + /* init the background control machinery */
7659 + hfc->ctrl_read.requesttype = 0xc0;
7660 + hfc->ctrl_read.request = 1;
7661 + hfc->ctrl_read.length = 1;
7662 + hfc->ctrl_write.requesttype = 0x40;
7663 + hfc->ctrl_write.request = 0;
7664 + hfc->ctrl_write.length = 0;
7665 + FILL_CONTROL_URB(&hfc->ctrl_urb, hfc->dev, hfc->ctrl_out_pipe,
7666 + (u_char *) & hfc->ctrl_write, NULL, 0,
7667 + ctrl_complete, hfc);
7669 + /* init the TX-urbs */
7670 + fifo = hfc->fifos + HFCUSB_D_TX;
7671 + FILL_BULK_URB(&fifo->urb, hfc->dev, fifo->pipe,
7672 + (u_char *) fifo->buffer, 0, tx_complete, fifo);
7673 + fifo = hfc->fifos + HFCUSB_B1_TX;
7674 + FILL_BULK_URB(&fifo->urb, hfc->dev, fifo->pipe,
7675 + (u_char *) fifo->buffer, 0, tx_complete, fifo);
7676 + fifo = hfc->fifos + HFCUSB_B2_TX;
7677 + FILL_BULK_URB(&fifo->urb, hfc->dev, fifo->pipe,
7678 + (u_char *) fifo->buffer, 0, tx_complete, fifo);
7680 + /* init the E-buffer */
7681 + skb_queue_head_init(&hfc->regd.erq);
7683 + /* now register ourself at hisax */
7684 + hfc->regd.version = HISAX_LOAD_VERSION; /* set our version */
7685 + hfc->regd.cmd = HISAX_LOAD_REGISTER; /* register command */
7686 + hfc->regd.argl1 = (void *) hfc; /* argument for our local routine */
7687 + hfc->regd.dch_l2l1 = hfcusb_l1_access;
7688 + hfc->regd.bch_l2l1 = hfcusb_bch_access;
7689 + hfc->regd.drvname = "hfc_usb";
7690 + if (hisax_register_hfcusb(&hfc->regd)) {
7691 + printk(KERN_INFO "HFC-USB failed to register at hisax\n");
7692 + Write_hfc(hfc, HFCUSB_CIRM, 0x08); /* aux = input, reset on */
7696 + /* startup the D- and E-channel fifos */
7697 + start_rx_fifo(hfc->fifos + HFCUSB_D_RX); /* D-fifo */
7698 + if (hfc->fifos[HFCUSB_PCM_RX].pipe)
7699 + start_rx_fifo(hfc->fifos + HFCUSB_PCM_RX); /* E-fifo */
7704 +/*************************************************/
7705 +/* function called to probe a new plugged device */
7706 +/*************************************************/
7708 +hfc_usb_probe(struct usb_device *dev, unsigned int interface
7709 +#ifdef COMPAT_HAS_USB_IDTAB
7710 + , const struct usb_device_id *id_table)
7715 + hfcusb_data *context;
7716 + struct usb_interface *ifp = dev->actconfig->interface + interface;
7717 + struct usb_interface_descriptor *ifdp =
7718 + ifp->altsetting + ifp->act_altsetting;
7719 + struct usb_endpoint_descriptor *epd;
7720 + int i, idx, ep_msk;
7722 +#ifdef COMPAT_HAS_USB_IDTAB
7723 + if (id_table && (dev->descriptor.idVendor == id_table->idVendor) &&
7724 + (dev->descriptor.idProduct == id_table->idProduct) &&
7726 + if ((((dev->descriptor.idVendor == 0x959) &&
7727 + (dev->descriptor.idProduct == 0x2bd0)) ||
7728 + ((dev->descriptor.idVendor == 0x7b0) &&
7729 + (dev->descriptor.idProduct == 0x0006))) &&
7731 + (ifdp->bNumEndpoints >= 6) && (ifdp->bNumEndpoints <= 16)) {
7732 + if (!(context = kmalloc(sizeof(hfcusb_data), GFP_KERNEL))) {
7733 + return (NULL); /* got no mem */
7735 + memset(context, 0, sizeof(hfcusb_data)); /* clear the structure */
7736 + i = ifdp->bNumEndpoints; /* get number of endpoints */
7737 + ep_msk = 0; /* none found */
7738 + epd = ifdp->endpoint; /* first endpoint descriptor */
7739 + while (i-- && ((ep_msk & 0xcf) != 0xcf)) {
7741 + idx = (((epd->bEndpointAddress & 0x7f) - 1) << 1); /* get endpoint base */
7743 + switch (epd->bmAttributes) {
7744 + case USB_ENDPOINT_XFER_INT:
7747 + bEndpointAddress &
7749 + break; /* only interrupt in allowed */
7750 + idx++; /* input index is odd */
7751 + context->fifos[idx].pipe =
7752 + usb_rcvintpipe(dev,
7754 + bEndpointAddress);
7757 + case USB_ENDPOINT_XFER_BULK:
7759 + bEndpointAddress &
7761 + break; /* only bulk out allowed */
7762 + context->fifos[idx].pipe =
7763 + usb_sndbulkpipe(dev,
7765 + bEndpointAddress);
7768 + context->fifos[idx].pipe = 0; /* reset data */
7769 + } /* switch attribute */
7771 + if (context->fifos[idx].pipe) {
7772 + context->fifos[idx].fifonum = idx;
7773 + context->fifos[idx].fifo_mask =
7775 + context->fifos[idx].hfc = context;
7776 + context->fifos[idx].usb_maxlen =
7777 + epd->wMaxPacketSize;
7778 + context->fifos[idx].intervall =
7780 + ep_msk |= (1 << idx);
7782 + ep_msk &= ~(1 << idx);
7787 + if ((ep_msk & 0x3f) != 0x3f) {
7791 + MOD_INC_USE_COUNT; /* lock our module */
7792 + context->dev = dev; /* save device */
7793 + context->if_used = interface; /* save used interface */
7794 + context->alt_used = ifp->act_altsetting; /* and alternate config */
7795 + context->ctrl_paksize = dev->descriptor.bMaxPacketSize0; /* control size */
7797 + /* create the control pipes needed for register access */
7798 + context->ctrl_in_pipe = usb_rcvctrlpipe(context->dev, 0);
7799 + context->ctrl_out_pipe = usb_sndctrlpipe(context->dev, 0);
7801 + /* init the chip and register the driver */
7802 + if (usb_init(context)) {
7804 + MOD_DEC_USE_COUNT;
7809 + "HFC-USB: New device if=%d alt=%d registered\n",
7810 + context->if_used, context->alt_used);
7814 + return (NULL); /* no matching entry */
7815 +} /* hfc_usb_probe */
7817 +/****************************************************/
7818 +/* function called when an active device is removed */
7819 +/****************************************************/
7821 +hfc_usb_disconnect(struct usb_device *usbdev, void *drv_context)
7823 + hfcusb_data *context = drv_context;
7825 + struct sk_buff *skb;
7827 + /* tell all fifos to terminate */
7828 + for (i = 0; i < HFCUSB_NUM_FIFOS; i++)
7829 + if (context->fifos[i].active) {
7830 + context->fifos[i].active = 0;
7831 + usb_unlink_urb(&context->fifos[i].urb);
7833 + while (context->active_fifos) {
7834 + set_current_state(TASK_INTERRUPTIBLE);
7835 + /* Timeout 10ms */
7836 + schedule_timeout((10 * HZ) / 1000);
7838 + if (timer_pending(&context->t3_timer))
7839 + del_timer(&context->t3_timer);
7840 + context->regd.release_driver(context->regd.arg_hisax);
7841 + while ((skb = skb_dequeue(&context->regd.erq)) != NULL)
7842 + dev_kfree_skb_any(skb);
7844 + kfree(context); /* free our structure again */
7845 + MOD_DEC_USE_COUNT; /* and decrement the usage counter */
7846 +} /* hfc_usb_disconnect */
7848 +/************************************/
7849 +/* our driver information structure */
7850 +/************************************/
7851 +static struct usb_driver hfc_drv = {
7853 +#ifdef COMPAT_HAS_USB_IDTAB
7854 + id_table:hfc_usb_idtab,
7856 + probe:hfc_usb_probe,
7857 + disconnect:hfc_usb_disconnect,
7864 + usb_deregister(&hfc_drv); /* release our driver */
7865 + printk(KERN_INFO "HFC-USB module removed\n");
7871 + struct hisax_drvreg drv;
7873 + drv.version = HISAX_LOAD_VERSION; /* set our version */
7874 + drv.cmd = HISAX_LOAD_CHKVER; /* check command only */
7875 + if (hisax_register_hfcusb(&drv)) {
7876 + printk(KERN_INFO "HFC-USB <-> hisax version conflict\n");
7877 + return (-1); /* unable to register */
7879 + if (usb_register(&hfc_drv)) {
7881 + "Unable to register HFC-USB module at usb stack\n");
7882 + return (-1); /* unable to register */
7885 + printk(KERN_INFO "HFC-USB module loaded\n");
7889 +module_init(hfc_usb_init);
7890 +module_exit(hfc_usb_exit);
7891 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/hfc_usbr.c linux-2.4.29/drivers/isdn/hisax/hfc_usbr.c
7892 --- linux-2.4.29.old/drivers/isdn/hisax/hfc_usbr.c 1970-01-01 01:00:00.000000000 +0100
7893 +++ linux-2.4.29/drivers/isdn/hisax/hfc_usbr.c 2005-03-22 15:06:46.397039360 +0100
7895 +/* $Id: hfc_usbr.c,v 2.5 2001/07/06 21:30:11 werner Exp $
7897 + * hfc_usb.c low level driver for CCD´s hfc-usb single chip controllers
7898 + * type approval valid for HFC-S USB based TAs
7900 + * Author Werner Cornelius (werner@isdn-development.de)
7902 + * Copyright 2001 by Werner Cornelius (werner@isdn4linux.de)
7904 + * This program is free software; you can redistribute it and/or modify
7905 + * it under the terms of the GNU General Public License as published by
7906 + * the Free Software Foundation; either version 2, or (at your option)
7907 + * any later version.
7909 + * This program is distributed in the hope that it will be useful,
7910 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
7911 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7912 + * GNU General Public License for more details.
7914 + * You should have received a copy of the GNU General Public License
7915 + * along with this program; if not, write to the Free Software
7916 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
7920 +#define __NO_VERSION__
7921 +#include <linux/init.h>
7923 +#include "isdnl1.h"
7924 +#include "hisax_loadable.h"
7926 +extern const char *CardType[];
7928 +static const char *hfcusb_revision = "$Revision: 2.5 $";
7930 +/*********************************/
7931 +/* schedule a new b_channel task */
7932 +/*********************************/
7934 +hfcusb_sched_event(struct BCState *bcs, int event)
7936 + bcs->event |= 1 << event;
7937 + queue_task(&bcs->tqueue, &tq_immediate);
7938 + mark_bh(IMMEDIATE_BH);
7941 +/************************************************/
7942 +/* select a b-channel entry matching and active */
7943 +/************************************************/
7946 +Sel_BCS(struct IsdnCardState *cs, int channel)
7948 + if (cs->bcs[0].mode && (cs->bcs[0].channel == channel))
7949 + return (&cs->bcs[0]);
7950 + else if (cs->bcs[1].mode && (cs->bcs[1].channel == channel))
7951 + return (&cs->bcs[1]);
7956 +/**********************************************/
7957 +/* transfer function (D-channel from l2 to l1 */
7958 +/**********************************************/
7960 +hfcusb_d_l2l1(struct PStack *st, int pr, void *arg)
7962 + struct IsdnCardState *cs = st->l1.hardware;
7963 + struct hisax_drvreg *drv = cs->hw.hfcusb.drv;
7967 + case (PH_DATA | REQUEST):
7968 + case (PH_PULL | INDICATION):
7969 + cs->hw.hfcusb.dch_tx_busy = 1;
7971 + case (PH_PULL | REQUEST):
7972 + if (!cs->hw.hfcusb.dch_tx_busy) {
7973 + test_and_clear_bit(FLG_L1_PULL_REQ,
7975 + st->l1.l1l2(st, PH_PULL | CONFIRM,
7978 + test_and_set_bit(FLG_L1_PULL_REQ,
7982 + drv->dch_l2l1(drv, pr, arg);
7984 + debugl1(cs, "hfcusb l2l1 called without existing driver");
7985 +} /* hfcusb_d_l2l1 */
7987 +/*****************************/
7988 +/* E-channel receive routine */
7989 +/*****************************/
7991 +EChannel_proc_rcv(struct IsdnCardState *cs)
7994 + struct sk_buff *skb;
7995 + struct hisax_drvreg *usbdrv =
7996 + (struct hisax_drvreg *) cs->hw.hfcusb.drv;
7999 + while ((skb = skb_dequeue(&usbdrv->erq)) != NULL) {
8000 + if (cs->debug & DEB_DLOG_HEX) {
8002 + if ((skb->len) < MAX_DLOG_SPACE / 3 - 10) {
8008 + ptr += QuickHex(ptr, skb->data, skb->len);
8012 + HiSax_putstatus(cs, NULL, cs->dlog);
8014 + HiSax_putstatus(cs, "LogEcho: ",
8015 + "warning Frame too big (%d)",
8018 + dev_kfree_skb_any(skb);
8022 +/******************************************/
8023 +/* transfer function called from L1 to L2 */
8024 +/******************************************/
8026 +hfcusb_d_l1l2(void *cs1, int pr, void *arg)
8028 + struct IsdnCardState *cs = (struct IsdnCardState *) cs1;
8031 + case (PH_DATA | INDICATION):
8033 + DChannel_proc_rcv(cs);
8035 + EChannel_proc_rcv(cs);
8038 + case (PH_DATA | CONFIRM):
8039 + cs->hw.hfcusb.dch_tx_busy = 0;
8040 + DChannel_proc_xmt(cs);
8043 + case (PH_ACTIVATE | INDICATION):
8044 + case (PH_ACTIVATE | CONFIRM):
8045 + cs->stlist->l1.l1l2(cs->stlist, pr, arg);
8046 + if (cs->debug & L1_DEB_ISAC)
8047 + debugl1(cs, "layer 1 activated");
8050 + case (PH_DEACTIVATE | INDICATION):
8051 + case (PH_DEACTIVATE | CONFIRM):
8052 + cs->stlist->l1.l1l2(cs->stlist, pr, arg);
8053 + if (cs->debug & L1_DEB_ISAC)
8054 + debugl1(cs, "layer 1 deactivated");
8058 + debugl1(cs, "unknown l1 msg 0x%x ", pr);
8060 +} /* hfcusb_d_l1l2 */
8063 +/******************************************/
8064 +/* transfer function called from L1 to L2 */
8065 +/******************************************/
8067 +hfcusb_b_l1l2(void *cs1, int chan, int pr, void *arg)
8069 + struct IsdnCardState *cs = (struct IsdnCardState *) cs1;
8070 + struct BCState *bcs = Sel_BCS(cs, chan);
8073 + case (PH_DATA | INDICATION):
8076 + hfcusb_sched_event(bcs, B_RCVBUFREADY);
8079 + case (PH_DATA | CONFIRM):
8082 + bcs->tx_cnt -= bcs->tx_skb->len;
8083 + if (bcs->st->lli.l1writewakeup &&
8084 + (PACKET_NOACK != bcs->tx_skb->pkt_type))
8085 + bcs->st->lli.l1writewakeup(bcs->st,
8088 + dev_kfree_skb_any(bcs->tx_skb);
8089 + bcs->tx_skb = skb_dequeue(&bcs->squeue);
8092 + case (PH_ACTIVATE | INDICATION):
8093 + case (PH_ACTIVATE | CONFIRM):
8094 + cs->stlist->l1.l1l2(cs->stlist, pr, arg);
8095 + if (cs->debug & L1_DEB_ISAC)
8096 + debugl1(cs, "layer 1 activated");
8099 + case (PH_DEACTIVATE | INDICATION):
8100 + case (PH_DEACTIVATE | CONFIRM):
8101 + cs->stlist->l1.l1l2(cs->stlist, pr, arg);
8102 + if (cs->debug & L1_DEB_ISAC)
8103 + debugl1(cs, "layer 1 deactivated");
8107 + debugl1(cs, "unknown l1 b msg 0x%x ", pr);
8109 +} /* hfcusb_b_l1l2 */
8112 +/***********************************************/
8113 +/* called during init setting l1 stack pointer */
8114 +/***********************************************/
8116 +setstack_hfcusb(struct PStack *st, struct IsdnCardState *cs)
8118 + st->l2.l2l1 = hfcusb_d_l2l1;
8121 +/**************************************/
8122 +/* send B-channel data if not blocked */
8123 +/**************************************/
8125 +hfcusb_send_data(struct BCState *bcs)
8127 + struct IsdnCardState *cs = bcs->cs;
8128 + struct hisax_drvreg *drv =
8129 + (struct hisax_drvreg *) cs->hw.hfcusb.drv;
8133 + drv->bch_l2l1(drv->argl1, bcs->channel, PH_DATA | REQUEST,
8137 +/***************************************************************/
8138 +/* activate/deactivate hardware for selected channels and mode */
8139 +/***************************************************************/
8141 +mode_hfcusb(struct BCState *bcs, int mode, int bc)
8143 + struct IsdnCardState *cs = bcs->cs;
8144 + struct hisax_drvreg *drv = cs->hw.hfcusb.drv;
8148 + if (cs->debug & L1_DEB_HSCX)
8149 + debugl1(cs, "HFCUSB bchannel mode %d bchan %d/%d",
8150 + mode, bc, bcs->channel);
8152 + bcs->channel = bc;
8154 + drv->bsk[bc] = &bcs->tx_skb;
8155 + drv->brq[bc] = &bcs->rqueue;
8157 + drv->bch_l2l1(drv->argl1, bc, PH_ACTIVATE | REQUEST,
8160 + drv->bsk[bc] = NULL;
8161 + drv->brq[bc] = NULL;
8165 +/******************************/
8166 +/* Layer2 -> Layer 1 Transfer */
8167 +/******************************/
8169 +hfcusb_b_l2l1(struct PStack *st, int pr, void *arg)
8171 + struct sk_buff *skb = arg;
8172 + struct hisax_drvreg *drv = st->l1.bcs->cs->hw.hfcusb.drv;
8176 + case (PH_DATA | REQUEST):
8177 + save_flags(flags);
8179 + if (st->l1.bcs->tx_skb) {
8180 + skb_queue_tail(&st->l1.bcs->squeue, skb);
8181 + restore_flags(flags);
8183 + st->l1.bcs->tx_skb = skb;
8184 + st->l1.bcs->cs->BC_Send_Data(st->l1.bcs);
8185 + restore_flags(flags);
8188 + case (PH_PULL | INDICATION):
8189 + if (st->l1.bcs->tx_skb) {
8190 + printk(KERN_WARNING
8191 + "hfc_l2l1: this shouldn't happen\n");
8194 + save_flags(flags);
8196 + st->l1.bcs->tx_skb = skb;
8197 + st->l1.bcs->cs->BC_Send_Data(st->l1.bcs);
8198 + restore_flags(flags);
8200 + case (PH_PULL | REQUEST):
8201 + if (!st->l1.bcs->tx_skb) {
8202 + test_and_clear_bit(FLG_L1_PULL_REQ,
8204 + st->l1.l1l2(st, PH_PULL | CONFIRM, NULL);
8206 + test_and_set_bit(FLG_L1_PULL_REQ,
8209 + case (PH_ACTIVATE | REQUEST):
8211 + test_and_set_bit(BC_FLG_ACTIV,
8212 + &st->l1.bcs->Flag);
8213 + mode_hfcusb(st->l1.bcs, st->l1.mode,
8215 + l1_msg_b(st, pr, arg);
8218 + case (PH_DEACTIVATE | REQUEST):
8219 + l1_msg_b(st, pr, arg);
8221 + case (PH_DEACTIVATE | CONFIRM):
8222 + test_and_clear_bit(BC_FLG_ACTIV,
8223 + &st->l1.bcs->Flag);
8224 + test_and_clear_bit(BC_FLG_BUSY, &st->l1.bcs->Flag);
8225 + mode_hfcusb(st->l1.bcs, 0, st->l1.bc);
8226 + st->l1.l1l2(st, PH_DEACTIVATE | CONFIRM, NULL);
8231 +/******************************************/
8232 +/* deactivate B-channel access and queues */
8233 +/******************************************/
8235 +close_hfcusb(struct BCState *bcs)
8237 + mode_hfcusb(bcs, 0, bcs->channel);
8238 + if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) {
8239 + skb_queue_purge(&bcs->rqueue);
8240 + skb_queue_purge(&bcs->squeue);
8241 + if (bcs->tx_skb) {
8242 + dev_kfree_skb_any(bcs->tx_skb);
8243 + bcs->tx_skb = NULL;
8244 + test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag);
8249 +/*************************************/
8250 +/* init B-channel queues and control */
8251 +/*************************************/
8253 +open_hfcusbstate(struct IsdnCardState *cs, struct BCState *bcs)
8255 + if (!test_and_set_bit(BC_FLG_INIT, &bcs->Flag)) {
8256 + skb_queue_head_init(&bcs->rqueue);
8257 + skb_queue_head_init(&bcs->squeue);
8259 + bcs->tx_skb = NULL;
8260 + test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag);
8266 +/*********************************/
8267 +/* inits the stack for B-channel */
8268 +/*********************************/
8270 +setstack_2b(struct PStack *st, struct BCState *bcs)
8272 + bcs->channel = st->l1.bc;
8273 + if (open_hfcusbstate(st->l1.hardware, bcs))
8276 + st->l2.l2l1 = hfcusb_b_l2l1;
8277 + setstack_manager(st);
8279 + setstack_l1_B(st);
8283 +/********************************/
8284 +/* called for card init message */
8285 +/********************************/
8287 +inithfcusb(struct IsdnCardState *cs)
8289 + cs->setstack_d = setstack_hfcusb;
8290 + cs->BC_Send_Data = &hfcusb_send_data;
8291 + cs->bcs[0].BC_SetStack = setstack_2b;
8292 + cs->bcs[1].BC_SetStack = setstack_2b;
8293 + cs->bcs[0].BC_Close = close_hfcusb;
8294 + cs->bcs[1].BC_Close = close_hfcusb;
8295 + mode_hfcusb(cs->bcs, 0, 0);
8296 + mode_hfcusb(cs->bcs + 1, 0, 1);
8301 +/*******************************************/
8302 +/* handle card messages from control layer */
8303 +/*******************************************/
8305 +hfcusb_card_msg(struct IsdnCardState *cs, int mt, void *arg)
8307 + if (cs->debug & L1_DEB_ISAC)
8308 + debugl1(cs, "HFCUSB: card_msg %x", mt);
8313 + case CARD_RELEASE:
8323 + HiSax_closecard(int cardnr);
8324 +/*****************************/
8325 +/* release a driver instance */
8326 +/* called when hardware is */
8327 +/* no longer present. */
8328 +/*****************************/
8330 +release_hfcdrv(void *arg)
8332 + struct IsdnCardState *cs = (struct IsdnCardState *) arg;
8334 + cs->hw.hfcusb.drv = NULL; /* disable any further use of driver */
8335 + HiSax_closecard(cs->cardnr);
8336 +} /* release_hfcdrv */
8338 +/*********************************************/
8339 +/* called once when a new device is detected */
8340 +/* initialises local data */
8341 +/*********************************************/
8343 +setup_hfc_usb(struct IsdnCard *card)
8345 + struct IsdnCardState *cs = card->cs;
8347 + struct hisax_drvreg *usbdrv =
8348 + (struct hisax_drvreg *) cs->hw.hfcusb.drv;
8351 + return (0); /* no driver data present */
8353 + strcpy(tmp, hfcusb_revision);
8354 + printk(KERN_INFO "HiSax: HFC-USB driver Rev. %s\n",
8355 + HiSax_getrev(tmp));
8357 + usbdrv->release_driver = &release_hfcdrv; /* release routine */
8358 + usbdrv->arg_hisax = (void *) cs; /* parameter for calling */
8359 + usbdrv->dch_l1l2 = &hfcusb_d_l1l2; /* access from L1 to HiSax */
8360 + usbdrv->bch_l1l2 = &hfcusb_b_l1l2;
8361 + usbdrv->drq = &cs->rq;
8362 + usbdrv->dsq = &cs->sq;
8363 + cs->cardmsg = &hfcusb_card_msg;
8364 + return (1); /* success */
8366 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/hfcscard.c linux-2.4.29/drivers/isdn/hisax/hfcscard.c
8367 --- linux-2.4.29.old/drivers/isdn/hisax/hfcscard.c 2005-03-22 14:47:56.000000000 +0100
8368 +++ linux-2.4.29/drivers/isdn/hisax/hfcscard.c 2005-03-22 15:06:46.412037080 +0100
8370 -/* $Id: hfcscard.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
8371 +/* $Id: hfcscard.c,v 1.10 2001/09/24 13:22:56 kai Exp $
8373 * low level stuff for hfcs based cards (Teles3c, ACER P10)
8377 #define __NO_VERSION__
8378 #include <linux/init.h>
8379 -#include <linux/isapnp.h>
8381 #include "hfc_2bds0.h"
8384 extern const char *CardType[];
8386 -static const char *hfcs_revision = "$Revision: 1.1.4.1 $";
8387 +static const char *hfcs_revision = "$Revision: 1.10 $";
8390 hfcs_interrupt(int intno, void *dev_id, struct pt_regs *regs)
8391 @@ -140,36 +139,6 @@
8396 -static struct isapnp_device_id hfc_ids[] __initdata = {
8397 - { ISAPNP_VENDOR('A', 'N', 'X'), ISAPNP_FUNCTION(0x1114),
8398 - ISAPNP_VENDOR('A', 'N', 'X'), ISAPNP_FUNCTION(0x1114),
8399 - (unsigned long) "Acer P10" },
8400 - { ISAPNP_VENDOR('B', 'I', 'L'), ISAPNP_FUNCTION(0x0002),
8401 - ISAPNP_VENDOR('B', 'I', 'L'), ISAPNP_FUNCTION(0x0002),
8402 - (unsigned long) "Billion 2" },
8403 - { ISAPNP_VENDOR('B', 'I', 'L'), ISAPNP_FUNCTION(0x0001),
8404 - ISAPNP_VENDOR('B', 'I', 'L'), ISAPNP_FUNCTION(0x0001),
8405 - (unsigned long) "Billion 1" },
8406 - { ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x7410),
8407 - ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x7410),
8408 - (unsigned long) "IStar PnP" },
8409 - { ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2610),
8410 - ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2610),
8411 - (unsigned long) "Teles 16.3c" },
8412 - { ISAPNP_VENDOR('S', 'F', 'M'), ISAPNP_FUNCTION(0x0001),
8413 - ISAPNP_VENDOR('S', 'F', 'M'), ISAPNP_FUNCTION(0x0001),
8414 - (unsigned long) "Tornado Tipa C" },
8415 - { ISAPNP_VENDOR('K', 'Y', 'E'), ISAPNP_FUNCTION(0x0001),
8416 - ISAPNP_VENDOR('K', 'Y', 'E'), ISAPNP_FUNCTION(0x0001),
8417 - (unsigned long) "Genius Speed Surfer" },
8421 -static struct isapnp_device_id *hdev = &hfc_ids[0];
8422 -static struct pci_bus *pnp_c __devinitdata = NULL;
8426 setup_hfcs(struct IsdnCard *card)
8428 @@ -178,46 +147,6 @@
8430 strcpy(tmp, hfcs_revision);
8431 printk(KERN_INFO "HiSax: HFC-S driver Rev. %s\n", HiSax_getrev(tmp));
8434 - if (!card->para[1] && isapnp_present()) {
8435 - struct pci_bus *pb;
8436 - struct pci_dev *pd;
8438 - while(hdev->card_vendor) {
8439 - if ((pb = isapnp_find_card(hdev->card_vendor,
8440 - hdev->card_device, pnp_c))) {
8443 - if ((pd = isapnp_find_dev(pnp_c,
8444 - hdev->vendor, hdev->function, pd))) {
8445 - printk(KERN_INFO "HiSax: %s detected\n",
8446 - (char *)hdev->driver_data);
8448 - pd->deactivate(pd);
8450 - card->para[1] = pd->resource[0].start;
8451 - card->para[0] = pd->irq_resource[0].start;
8452 - if (!card->para[0] || !card->para[1]) {
8453 - printk(KERN_ERR "HFC PnP:some resources are missing %ld/%lx\n",
8454 - card->para[0], card->para[1]);
8455 - pd->deactivate(pd);
8460 - printk(KERN_ERR "HFC PnP: PnP error card found, no device\n");
8466 - if (!hdev->card_vendor) {
8467 - printk(KERN_INFO "HFC PnP: no ISAPnP card found\n");
8472 cs->hw.hfcD.addr = card->para[1] & 0xfffe;
8473 cs->irq = card->para[0];
8474 cs->hw.hfcD.cip = 0;
8475 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/hisax.h linux-2.4.29/drivers/isdn/hisax/hisax.h
8476 --- linux-2.4.29.old/drivers/isdn/hisax/hisax.h 2005-03-22 14:47:56.000000000 +0100
8477 +++ linux-2.4.29/drivers/isdn/hisax/hisax.h 2005-03-22 15:06:46.431034192 +0100
8479 -/* $Id: hisax.h,v 1.1.4.2 2001/12/09 19:15:28 kai Exp $
8480 +/* $Id: hisax.h,v 2.64 2001/09/24 13:22:56 kai Exp $
8482 * Basic declarations, defines and prototypes
8485 #include <linux/isdnif.h>
8486 #include <linux/tty.h>
8487 #include <linux/serial_reg.h>
8488 +#ifndef COMPAT_NO_SOFTNET
8489 #include <linux/netdevice.h>
8492 #define ERROR_STATISTIC
8495 #define DL_DATA 0x0220
8496 #define DL_FLUSH 0x0224
8497 #define DL_UNIT_DATA 0x0230
8499 -#define MDL_BC_RELEASE 0x0278 // Formula-n enter:now
8500 -#define MDL_BC_ASSIGN 0x027C // Formula-n enter:now
8501 #define MDL_ASSIGN 0x0280
8502 #define MDL_REMOVE 0x0284
8503 #define MDL_ERROR 0x0288
8505 #define BC_FLG_FTI_RUN 13
8506 #define BC_FLG_LL_OK 14
8507 #define BC_FLG_LL_CONN 15
8508 -#define BC_FLG_FTI_FTS 16
8509 -#define BC_FLG_FRH_WAIT 17
8511 #define L1_MODE_NULL 0
8512 #define L1_MODE_TRANS 1
8513 @@ -695,6 +692,13 @@
8514 struct timer_list timer;
8517 +#ifdef CONFIG_HISAX_HFC_USB
8519 + void *drv; /* pointer to driver structure */
8527 @@ -838,17 +842,6 @@
8531 -struct amd7930_chip {
8536 - unsigned int tx_xmtlen;
8537 - struct timer_list timer3;
8538 - void (*ph_command) (struct IsdnCardState *, u_char, char *);
8539 - void (*setIrqMask) (struct IsdnCardState *, u_char);
8546 struct njet_hw njet;
8547 struct hfcD_hw hfcD;
8548 struct hfcPCI_hw hfcpci;
8549 +#ifdef CONFIG_HISAX_HFC_USB
8550 + struct hfcUSB_hw hfcusb;
8552 struct hfcSX_hw hfcsx;
8553 struct ix1_hw niccy;
8554 struct isurf_hw isurf;
8556 struct hfcpci_chip hfcpci;
8557 struct hfcsx_chip hfcsx;
8558 struct w6692_chip w6692;
8559 - struct amd7930_chip amd7930;
8560 struct icc_chip icc;
8567 +#define HISAX_MAX_CARDS 8
8569 #define ISDN_CTYPE_16_0 1
8570 #define ISDN_CTYPE_8_0 2
8571 #define ISDN_CTYPE_16_3 3
8572 @@ -1006,8 +1003,8 @@
8573 #define ISDN_CTYPE_HFC_SX 37
8574 #define ISDN_CTYPE_NETJET_U 38
8575 #define ISDN_CTYPE_HFC_SP_PCMCIA 39
8576 -#define ISDN_CTYPE_DYNAMIC 40
8577 -#define ISDN_CTYPE_ENTERNOW 41
8578 +#define ISDN_CTYPE_HFC_USB 40
8579 +#define ISDN_CTYPE_DYNAMIC 41
8580 #define ISDN_CTYPE_COUNT 41
8583 @@ -1267,10 +1264,6 @@
8584 #define CARD_NETJET_U 0
8587 -#ifdef CONFIG_HISAX_ENTERNOW_PCI
8588 -#define CARD_FN_ENTERNOW_PCI 1
8591 #define TEI_PER_CARD 1
8594 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/hisax_debug.h linux-2.4.29/drivers/isdn/hisax/hisax_debug.h
8595 --- linux-2.4.29.old/drivers/isdn/hisax/hisax_debug.h 2005-03-22 14:47:56.000000000 +0100
8596 +++ linux-2.4.29/drivers/isdn/hisax/hisax_debug.h 2005-03-22 15:06:46.452031000 +0100
8599 #define DBG(level, format, arg...) do { \
8600 if (level & __debug_variable) \
8601 -printk(KERN_DEBUG "%s: " format "\n" , __FUNCTION__ , ## arg); \
8602 +printk(KERN_DEBUG __FUNCTION__ ": " format "\n" , ## arg); \
8605 #define DBG_PACKET(level,data,count) \
8606 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/hisax_fcpcipnp.c linux-2.4.29/drivers/isdn/hisax/hisax_fcpcipnp.c
8607 --- linux-2.4.29.old/drivers/isdn/hisax/hisax_fcpcipnp.c 2005-03-22 14:47:56.000000000 +0100
8608 +++ linux-2.4.29/drivers/isdn/hisax/hisax_fcpcipnp.c 2005-03-22 15:06:46.468028568 +0100
8612 * o clean up debugging
8613 - * o tx_skb at PH_DEACTIVATE time
8616 #include <linux/version.h>
8617 #include <linux/module.h>
8618 #include <linux/init.h>
8619 #include <linux/pci.h>
8620 -#include <linux/isapnp.h>
8621 +#include "hisax_isapnp.h"
8622 #include <linux/kmod.h>
8623 #include <linux/slab.h>
8624 #include <linux/skbuff.h>
8625 #include <linux/netdevice.h>
8627 -#include <asm/io.h>
8629 #include "hisax_fcpcipnp.h"
8630 +#include "hisax_isac.h"
8633 #define __debug_variable debug
8635 MODULE_PARM(debug, "i");
8638 -MODULE_AUTHOR("Kai Germaschewski <kai.germaschewski@gmx.de>/Karsten Keil <kkeil@suse.de>");
8639 +MODULE_AUTHOR("Kai Germaschewski <kai.germaschewski@gmx.de>");
8640 MODULE_DESCRIPTION("AVM Fritz!PCI/PnP ISDN driver");
8642 -static struct pci_device_id fcpci_ids[] __devinitdata = {
8643 +#ifndef PCI_DEVICE_ID_AVM_A1_V2
8644 +#define PCI_DEVICE_ID_AVM_A1_V2 0x0e00
8647 +static struct pci_device_id fcpci_ids[] __initdata = {
8648 { PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_A1 , PCI_ANY_ID, PCI_ANY_ID,
8649 0, 0, (unsigned long) "Fritz!Card PCI" },
8650 { PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_A1_V2, PCI_ANY_ID, PCI_ANY_ID,
8653 MODULE_DEVICE_TABLE(pci, fcpci_ids);
8655 -static struct isapnp_device_id fcpnp_ids[] __devinitdata = {
8656 +static struct isapnp_device_id fcpnp_ids[] __initdata = {
8657 { ISAPNP_VENDOR('A', 'V', 'M'), ISAPNP_FUNCTION(0x0900),
8658 ISAPNP_VENDOR('A', 'V', 'M'), ISAPNP_FUNCTION(0x0900),
8659 (unsigned long) "Fritz!Card PnP" },
8662 static int protocol = 2; /* EURO-ISDN Default */
8663 MODULE_PARM(protocol, "i");
8664 -MODULE_LICENSE("GPL");
8666 +static LIST_HEAD(adapter_list);
8668 // ----------------------------------------------------------------------
8671 outb(idx, adapter->io + AVM_INDEX);
8672 val = inb(adapter->io + AVM_DATA + (offset & 0xf));
8673 spin_unlock_irqrestore(&adapter->hw_lock, flags);
8674 - DBG(0x1000, " port %#x, value %#x",
8675 + DBG(0x1000, __FUNCTION__ " port %#x, value %#x",
8680 AVM_IDX_ISAC_REG_HIGH : AVM_IDX_ISAC_REG_LOW;
8681 unsigned long flags;
8683 - DBG(0x1000, " port %#x, value %#x",
8684 + DBG(0x1000, __FUNCTION__ " port %#x, value %#x",
8686 spin_lock_irqsave(&adapter->hw_lock, flags);
8687 outb(idx, adapter->io + AVM_INDEX);
8689 outl(offset, adapter->io + AVM_ISACSX_INDEX);
8690 val = inl(adapter->io + AVM_ISACSX_DATA);
8691 spin_unlock_irqrestore(&adapter->hw_lock, flags);
8692 - DBG(0x1000, " port %#x, value %#x",
8693 + DBG(0x1000, __FUNCTION__ " port %#x, value %#x",
8698 struct fritz_adapter *adapter = isac->priv;
8699 unsigned long flags;
8701 - DBG(0x1000, " port %#x, value %#x",
8702 + DBG(0x1000, __FUNCTION__ " port %#x, value %#x",
8704 spin_lock_irqsave(&adapter->hw_lock, flags);
8705 outl(offset, adapter->io + AVM_ISACSX_INDEX);
8708 DBG(0x40, "hdlc_fill_fifo");
8718 skb_push(bcs->tx_skb, bcs->tx_cnt);
8720 - hdlc_fill_fifo(bcs);
8723 static inline void hdlc_xpr_irq(struct fritz_bcs *bcs)
8725 dev_kfree_skb_irq(skb);
8728 -static void hdlc_irq_one(struct fritz_bcs *bcs, u32 stat)
8729 +static void hdlc_irq(struct fritz_bcs *bcs, u32 stat)
8731 DBG(0x10, "ch%d stat %#x", bcs->channel, stat);
8732 if (stat & HDLC_INT_RPR) {
8737 -static inline void hdlc_irq(struct fritz_adapter *adapter)
8738 +static inline void hdlc_interrupt(struct fritz_adapter *adapter)
8743 stat = adapter->read_hdlc_status(adapter, nr);
8744 DBG(0x10, "HDLC %c stat %#x", 'A' + nr, stat);
8745 if (stat & HDLC_INT_MASK)
8746 - hdlc_irq_one(&adapter->bcs[nr], stat);
8747 + hdlc_irq(&adapter->bcs[nr], stat);
8751 @@ -584,14 +588,14 @@
8752 adapter->write_ctrl(bcs, 5);
8755 + bcs->ctrl.sr.mode = HDLC_MODE_TRANS;
8756 + adapter->write_ctrl(bcs, 5);
8757 + bcs->ctrl.sr.cmd = HDLC_CMD_XRS;
8758 + adapter->write_ctrl(bcs, 1);
8759 + bcs->ctrl.sr.cmd = 0;
8764 - bcs->tx_skb = NULL;
8765 - if (mode == L1_MODE_TRANS)
8766 - bcs->ctrl.sr.mode = HDLC_MODE_TRANS;
8768 - bcs->ctrl.sr.mode = HDLC_MODE_ITF_FLG;
8769 + bcs->ctrl.sr.mode = HDLC_MODE_ITF_FLG;
8770 adapter->write_ctrl(bcs, 5);
8771 bcs->ctrl.sr.cmd = HDLC_CMD_XRS;
8772 adapter->write_ctrl(bcs, 1);
8773 @@ -645,10 +649,10 @@
8775 DBG(2, "STATUS0 %#x", val);
8776 if (val & AVM_STATUS0_IRQ_ISAC)
8777 - isacsx_irq(&adapter->isac);
8778 + isacsx_interrupt(&adapter->isac);
8780 if (val & AVM_STATUS0_IRQ_HDLC)
8781 - hdlc_irq(adapter);
8782 + hdlc_interrupt(adapter);
8785 static void fcpci_irq(int intno, void *dev, struct pt_regs *regs)
8786 @@ -662,10 +666,10 @@
8788 DBG(2, "sval %#x", sval);
8789 if (!(sval & AVM_STATUS0_IRQ_ISAC))
8790 - isac_irq(&adapter->isac);
8791 + isac_interrupt(&adapter->isac);
8793 if (!(sval & AVM_STATUS0_IRQ_HDLC))
8794 - hdlc_irq(adapter);
8795 + hdlc_interrupt(adapter);
8798 // ----------------------------------------------------------------------
8799 @@ -681,11 +685,6 @@
8801 outb(AVM_STATUS0_DIS_TIMER | AVM_STATUS0_RES_TIMER |
8802 AVM_STATUS0_ENA_IRQ, adapter->io + AVM_STATUS0);
8804 - outb(AVM_STATUS1_ENA_IOM | adapter->irq,
8805 - adapter->io + AVM_STATUS1);
8806 - set_current_state(TASK_UNINTERRUPTIBLE);
8807 - schedule_timeout(50*HZ / 1000); /* Timeout 50ms */
8810 // ----------------------------------------------------------------------
8812 static int __devinit fcpcipnp_setup(struct fritz_adapter *adapter)
8815 + struct pci_dev *pdev = adapter->pci_dev;
8819 @@ -700,21 +700,21 @@
8820 isac_init(&adapter->isac); // FIXME is this okay now
8823 - if (!request_region(adapter->io, 32, "fcpcipnp"))
8824 + if (!request_region(adapter->io, 32, "hisax_fcpcipnp"))
8827 switch (adapter->type) {
8828 case AVM_FRITZ_PCIV2:
8829 - retval = request_irq(adapter->irq, fcpci2_irq, SA_SHIRQ,
8830 - "fcpcipnp", adapter);
8831 + retval = request_irq(pdev->irq, fcpci2_irq, SA_SHIRQ,
8832 + "hisax_fcpcipnp", adapter);
8835 - retval = request_irq(adapter->irq, fcpci_irq, SA_SHIRQ,
8836 - "fcpcipnp", adapter);
8837 + retval = request_irq(pdev->irq, fcpci_irq, SA_SHIRQ,
8838 + "hisax_fcpcipnp", adapter);
8841 - retval = request_irq(adapter->irq, fcpci_irq, 0,
8842 - "fcpcipnp", adapter);
8843 + retval = request_irq(pdev->irq, fcpci_irq, 0,
8844 + "hisax_fcpcipnp", adapter);
8848 @@ -808,11 +808,23 @@
8850 static void __devexit fcpcipnp_release(struct fritz_adapter *adapter)
8852 + struct pci_dev *pdev = adapter->pci_dev;
8856 outb(0, adapter->io + AVM_STATUS0);
8857 - free_irq(adapter->irq, adapter);
8858 + free_irq(pdev->irq, adapter);
8859 release_region(adapter->io, 32);
8861 + switch (adapter->type) {
8862 + case AVM_FRITZ_PCI:
8863 + case AVM_FRITZ_PCIV2:
8864 + pci_disable_device(pdev);
8866 + case AVM_FRITZ_PNP:
8867 + pdev->deactivate(pdev);
8872 // ----------------------------------------------------------------------
8875 memset(adapter, 0, sizeof(struct fritz_adapter));
8877 + adapter->pci_dev = pdev;
8879 SET_MODULE_OWNER(&adapter->isac.hisax_d_if);
8880 adapter->isac.hisax_d_if.ifc.priv = &adapter->isac;
8881 adapter->isac.hisax_d_if.ifc.l2l1 = isac_d_l2l1;
8883 adapter->bcs[i].b_if.ifc.priv = &adapter->bcs[i];
8884 adapter->bcs[i].b_if.ifc.l2l1 = fritz_b_l2l1;
8886 + list_add(&adapter->list, &adapter_list);
8888 pci_set_drvdata(pdev, adapter);
8891 static void delete_adapter(struct fritz_adapter *adapter)
8893 hisax_unregister(&adapter->isac.hisax_d_if);
8894 + list_del(&adapter->list);
8898 @@ -863,12 +879,15 @@
8899 struct fritz_adapter *adapter;
8902 + printk(KERN_INFO "hisax_fcpcipnp: found adapter %s at %s\n",
8903 + (char *) ent->driver_data, pdev->slot_name);
8906 adapter = new_adapter(pdev);
8910 - if (pdev->device == PCI_DEVICE_ID_AVM_A1_V2)
8911 + if (pdev->device == 0x0e00)
8912 adapter->type = AVM_FRITZ_PCIV2;
8914 adapter->type = AVM_FRITZ_PCI;
8915 @@ -876,12 +895,7 @@
8916 retval = pci_enable_device(pdev);
8920 adapter->io = pci_resource_start(pdev, 1);
8921 - adapter->irq = pdev->irq;
8923 - printk(KERN_INFO "hisax_fcpcipnp: found adapter %s at %s\n",
8924 - (char *) ent->driver_data, pdev->slot_name);
8926 retval = fcpcipnp_setup(adapter);
8929 struct fritz_adapter *adapter;
8932 + printk(KERN_INFO "hisax_fcpcipnp: found adapter %s\n",
8933 + (char *) ent->driver_data);
8936 adapter = new_adapter(pdev);
8938 @@ -912,11 +929,8 @@
8939 pdev->deactivate(pdev); // why?
8940 pdev->activate(pdev);
8941 adapter->io = pdev->resource[0].start;
8942 - adapter->irq = pdev->irq_resource[0].start;
8944 - printk(KERN_INFO "hisax_fcpcipnp: found adapter %s at IO %#x irq %d\n",
8945 - (char *) ent->driver_data, adapter->io, adapter->irq);
8947 + pdev->irq = pdev->irq_resource[0].start;
8949 retval = fcpcipnp_setup(adapter);
8952 @@ -929,43 +943,35 @@
8956 -static void __devexit fcpci_remove(struct pci_dev *pdev)
8958 - struct fritz_adapter *adapter = pci_get_drvdata(pdev);
8960 - fcpcipnp_release(adapter);
8961 - pci_disable_device(pdev);
8962 - delete_adapter(adapter);
8965 -static void __devexit fcpnp_remove(struct pci_dev *pdev)
8966 +static void __devexit fcpcipnp_remove(struct pci_dev *pdev)
8968 struct fritz_adapter *adapter = pci_get_drvdata(pdev);
8970 fcpcipnp_release(adapter);
8971 - pdev->deactivate(pdev);
8972 delete_adapter(adapter);
8975 static struct pci_driver fcpci_driver = {
8977 - probe: fcpci_probe,
8978 - remove: __devexit_p(fcpci_remove),
8980 + probe: fcpci_probe,
8981 + remove: fcpcipnp_remove,
8982 id_table: fcpci_ids,
8985 static struct isapnp_driver fcpnp_driver = {
8987 - probe: fcpnp_probe,
8988 - remove: __devexit_p(fcpnp_remove),
8990 + probe: fcpnp_probe,
8991 + remove: fcpcipnp_remove,
8992 id_table: fcpnp_ids,
8995 -static int __init hisax_fcpcipnp_init(void)
8996 +static LIST_HEAD(isapnp_drivers);
8998 +static int __init hisax_fcpci_init(void)
9000 int retval, pci_nr_found;
9002 - printk(KERN_INFO "hisax_fcpcipnp: Fritz!Card PCI/PCIv2/PnP ISDN driver v0.0.1\n");
9003 + printk(KERN_INFO "hisax_fcpcipnp: Fritz!PCI/PnP ISDN driver v0.0.1\n");
9005 retval = pci_register_driver(&fcpci_driver);
9007 @@ -976,15 +982,14 @@
9009 goto out_unregister_pci;
9011 -#if !defined(CONFIG_HOTPLUG) || defined(MODULE)
9012 +#if !defined(CONFIG_HOTPLUG) && defined(MODULE)
9013 if (pci_nr_found + retval == 0) {
9015 goto out_unregister_isapnp;
9020 -#if !defined(CONFIG_HOTPLUG) || defined(MODULE)
9021 +#if !defined(CONFIG_HOTPLUG) && defined(MODULE)
9022 out_unregister_isapnp:
9023 isapnp_unregister_driver(&fcpnp_driver);
9025 @@ -994,11 +999,15 @@
9029 -static void __exit hisax_fcpcipnp_exit(void)
9030 +static void __exit hisax_fcpci_exit(void)
9032 isapnp_unregister_driver(&fcpnp_driver);
9033 pci_unregister_driver(&fcpci_driver);
9036 -module_init(hisax_fcpcipnp_init);
9037 -module_exit(hisax_fcpcipnp_exit);
9038 +module_init(hisax_fcpci_init);
9039 +module_exit(hisax_fcpci_exit);
9042 +#include "hisax_isapnp.c"
9044 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/hisax_fcpcipnp.h linux-2.4.29/drivers/isdn/hisax/hisax_fcpcipnp.h
9045 --- linux-2.4.29.old/drivers/isdn/hisax/hisax_fcpcipnp.h 2005-03-22 14:47:56.000000000 +0100
9046 +++ linux-2.4.29/drivers/isdn/hisax/hisax_fcpcipnp.h 2005-03-22 15:06:46.484026136 +0100
9050 struct fritz_adapter {
9051 + struct list_head list;
9052 + struct pci_dev *pci_dev;
9060 struct fritz_bcs bcs[2];
9061 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/hisax_isac.c linux-2.4.29/drivers/isdn/hisax/hisax_isac.c
9062 --- linux-2.4.29.old/drivers/isdn/hisax/hisax_isac.c 2005-03-22 14:47:56.000000000 +0100
9063 +++ linux-2.4.29/drivers/isdn/hisax/hisax_isac.c 2005-03-22 15:06:46.543017168 +0100
9065 static int debug = 1;
9066 MODULE_PARM(debug, "i");
9068 -static char *ISACVer[] = {
9069 +static char *ISACVer[] __devinitdata = {
9077 -MODULE_AUTHOR("Kai Germaschewski <kai.germaschewski@gmx.de>/Karsten Keil <kkeil@suse.de>");
9078 -MODULE_DESCRIPTION("ISAC/ISAC-SX driver");
9079 -MODULE_LICENSE("GPL");
9081 #define DBG_WARN 0x0001
9082 #define DBG_IRQ 0x0002
9083 #define DBG_L1M 0x0004
9088 -static void isac_version(struct isac *cs)
9089 +static void __devinit isac_version(struct isac *cs)
9097 -void isac_irq(struct isac *isac)
9098 +void isac_interrupt(struct isac *isac)
9103 if (val & ISAC_ISTA_SIN) {
9104 DBG(DBG_WARN, "SIN");
9106 - isac->write_isac(isac, ISAC_MASK, 0xff);
9107 - isac->write_isac(isac, ISAC_MASK, 0x00);
9110 // ======================================================================
9115 -void isacsx_irq(struct isac *isac)
9116 +void isacsx_interrupt(struct isac *isac)
9121 isacsx_cic_interrupt(isac);
9124 -void isac_init(struct isac *isac)
9125 +void __devinit isac_init(struct isac *isac)
9127 isac->tx_skb = NULL;
9128 isac->l1m.fsm = &l1fsm;
9130 FsmInitTimer(&isac->l1m, &isac->timer);
9133 -void isac_setup(struct isac *isac)
9134 +void __devinit isac_setup(struct isac *isac)
9140 isac->write_isac(isac, ISAC_MASK, 0xff);
9142 - if (test_bit(ISAC_IOM1, &isac->flags)) {
9143 + if (test_bit(HW_IOM1, &isac->flags)) {
9145 isac->write_isac(isac, ISAC_ADF2, 0x0);
9146 isac->write_isac(isac, ISAC_SPCR, 0xa);
9148 FsmEvent(&isac->l1m, (val >> 2) & 0xf, NULL);
9150 isac->write_isac(isac, ISAC_MASK, 0x0);
9151 - // RESET Receiver and Transmitter
9152 + /* RESET Receiver and Transmitter */
9153 isac->write_isac(isac, ISAC_CMDR, ISAC_CMDR_XRES | ISAC_CMDR_RRES);
9156 @@ -888,10 +882,10 @@
9157 EXPORT_SYMBOL(isac_d_l2l1);
9159 EXPORT_SYMBOL(isacsx_setup);
9160 -EXPORT_SYMBOL(isacsx_irq);
9161 +EXPORT_SYMBOL(isacsx_interrupt);
9163 EXPORT_SYMBOL(isac_setup);
9164 -EXPORT_SYMBOL(isac_irq);
9165 +EXPORT_SYMBOL(isac_interrupt);
9167 module_init(hisax_isac_init);
9168 module_exit(hisax_isac_exit);
9169 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/hisax_isac.h linux-2.4.29/drivers/isdn/hisax/hisax_isac.h
9170 --- linux-2.4.29.old/drivers/isdn/hisax/hisax_isac.h 2005-03-22 14:47:56.000000000 +0100
9171 +++ linux-2.4.29/drivers/isdn/hisax/hisax_isac.h 2005-03-22 15:06:46.559014736 +0100
9173 #define TIMER3_VALUE 7000
9174 #define MAX_DFRAME_LEN_L1 300
9176 -#define ISAC_IOM1 0
9182 void isac_d_l2l1(struct hisax_if *hisax_d_if, int pr, void *arg);
9184 void isac_setup(struct isac *isac);
9185 -void isac_irq(struct isac *isac);
9186 +void isac_interrupt(struct isac *isac);
9188 void isacsx_setup(struct isac *isac);
9189 -void isacsx_irq(struct isac *isac);
9190 +void isacsx_interrupt(struct isac *isac);
9193 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/hisax_isapnp.c linux-2.4.29/drivers/isdn/hisax/hisax_isapnp.c
9194 --- linux-2.4.29.old/drivers/isdn/hisax/hisax_isapnp.c 1970-01-01 01:00:00.000000000 +0100
9195 +++ linux-2.4.29/drivers/isdn/hisax/hisax_isapnp.c 2005-03-22 15:06:46.576012152 +0100
9198 +static const struct isapnp_device_id *
9199 +isapnp_match_device(const struct isapnp_device_id *ids, struct pci_dev *dev)
9203 + while (ids->card_vendor || ids->card_device) {
9204 + if ((ids->card_vendor == ISAPNP_ANY_ID || ids->card_vendor == dev->bus->vendor) &&
9205 + (ids->card_device == ISAPNP_ANY_ID || ids->card_device == dev->bus->device) &&
9206 + (ids->vendor == ISAPNP_ANY_ID || ids->vendor == dev->vendor) &&
9207 + (ids->function == ISAPNP_ANY_ID || ids->function == dev->device))
9215 + * pci_dev_driver - get the pci_driver of a device
9216 + * @dev: the device to query
9218 + * Returns the appropriate pci_driver structure or %NULL if there is no
9219 + * registered driver for the device.
9221 +struct pci_driver *isapnp_dev_driver(const struct pci_dev *dev)
9223 + return dev->driver;
9226 +static int isapnp_announce_device(struct isapnp_driver *drv, struct pci_dev *dev)
9228 + const struct isapnp_device_id *id;
9233 + if (drv->id_table) {
9234 + id = isapnp_match_device(drv->id_table, dev);
9242 +// dev_probe_lock();
9243 + if (drv->probe(dev, id) >= 0) {
9244 + dev->driver = (struct pci_driver *) drv;
9247 +// dev_probe_unlock();
9253 + * FIXME pci_register_driver - register a new pci driver
9254 + * @drv: the driver structure to register
9256 + * Adds the driver structure to the list of registered drivers
9257 + * Returns the number of pci devices which were claimed by the driver
9258 + * during registration. The driver remains registered even if the
9259 + * return value is zero.
9261 +int isapnp_register_driver(struct isapnp_driver *drv)
9263 + struct pci_dev *dev;
9268 + list_add_tail(&drv->node, &isapnp_drivers);
9269 + isapnp_for_each_dev(dev) {
9270 + if (!isapnp_dev_driver(dev))
9271 + count += isapnp_announce_device(drv, dev);
9277 + * pci_unregister_driver - unregister a pci driver
9278 + * @drv: the driver structure to unregister
9280 + * Deletes the driver structure from the list of registered PCI drivers,
9281 + * gives it a chance to clean up by calling its remove() function for
9282 + * each device it was responsible for, and marks those devices as
9286 +void isapnp_unregister_driver(struct isapnp_driver *drv)
9288 + struct pci_dev *dev;
9292 + list_del(&drv->node);
9293 + isapnp_for_each_dev(dev) {
9294 + if (dev->driver == (struct pci_driver *) drv) {
9297 + dev->driver = NULL;
9302 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/hisax_isapnp.h linux-2.4.29/drivers/isdn/hisax/hisax_isapnp.h
9303 --- linux-2.4.29.old/drivers/isdn/hisax/hisax_isapnp.h 1970-01-01 01:00:00.000000000 +0100
9304 +++ linux-2.4.29/drivers/isdn/hisax/hisax_isapnp.h 2005-03-22 15:06:46.590010024 +0100
9306 +#ifndef __HISAX_ISAPNP_H__
9307 +#define __HISAX_ISAPNP_H__
9309 +#include <linux/isapnp.h>
9311 +#ifdef COMPAT_NEED_ISAPNP_DRIVER
9312 +struct isapnp_driver {
9313 + struct list_head node;
9315 + const struct isapnp_device_id *id_table; /* NULL if wants all devices */
9316 + int (*probe) (struct pci_dev *dev, const struct isapnp_device_id *id); /* New device inserted */
9317 + void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */
9322 +int isapnp_register_driver(struct isapnp_driver *drv);
9323 +void isapnp_unregister_driver(struct isapnp_driver *drv);
9327 +static inline int isapnp_register_driver(struct isapnp_driver *drv)
9332 +static inline void isapnp_unregister_driver(struct isapnp_driver *drv)
9339 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/hisax_loadable.h linux-2.4.29/drivers/isdn/hisax/hisax_loadable.h
9340 --- linux-2.4.29.old/drivers/isdn/hisax/hisax_loadable.h 1970-01-01 01:00:00.000000000 +0100
9341 +++ linux-2.4.29/drivers/isdn/hisax/hisax_loadable.h 2005-03-22 15:06:46.606007592 +0100
9343 +/* $Id: hisax_loadable.h,v 2.1 2001/06/08 22:19:16 werner Exp $
9346 + * Author (C) 2001 Werner Cornelius (werner@isdn-development.de)
9347 + * modular driver for Colognechip HFC-USB chip
9348 + * as plugin for HiSax isdn driver
9350 + * Copyright 2001 by Werner Cornelius (werner@isdn4linux.de)
9352 + * This program is free software; you can redistribute it and/or modify
9353 + * it under the terms of the GNU General Public License as published by
9354 + * the Free Software Foundation; either version 2, or (at your option)
9355 + * any later version.
9357 + * This program is distributed in the hope that it will be useful,
9358 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
9359 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9360 + * GNU General Public License for more details.
9362 + * You should have received a copy of the GNU General Public License
9363 + * along with this program; if not, write to the Free Software
9364 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
9368 +#include <linux/types.h>
9369 +#include <linux/skbuff.h>
9371 +/***************************************/
9372 +/* additional defines for l1 constants */
9373 +/***************************************/
9374 +#define B1_DATA 0x1f0
9375 +#define B1_SETMODE 0x1f4
9376 +#define B2_DATA 0x1f8
9377 +#define B2_SETMODE 0x1fc
9380 +/********************************************************/
9381 +/* structure used for register and release of L1 driver */
9382 +/********************************************************/
9383 +struct hisax_drvreg {
9384 + int version; /* actual version for check */
9385 + int cmd; /* command code */
9387 + /* function pointers set by hisax during register call */
9388 + void (*release_driver) (void *arg_hisax); /* set by hisax, release function for driver */
9389 + void (*dch_l1l2) (void *arg_hisax, int pr, void *arg); /* set by hisax, notify dch+l1 events */
9390 + void (*bch_l1l2) (void *arg_hisax, int chan, int pr, void *arg); /* set by hisax, notify bch events */
9391 + void *arg_hisax; /* argument when calling hisax main */
9392 + struct sk_buff_head *drq; /* pointer to D-receive queue */
9393 + struct sk_buff_head *dsq; /* pointer to D-send queue */
9394 + struct sk_buff_head erq; /* E-receive queue */
9395 + struct sk_buff_head *brq[2]; /* pointer to B-receive queues */
9396 + struct sk_buff **bsk[2]; /* pointer to B-transmit buffer */
9398 + /* function pointers set by l1 driver before calling the register function */
9399 + void (*dch_l2l1) (void *argl1, int pr, void *arg); /* function dch+l1 from hisax -> l1 */
9400 + void (*bch_l2l1) (void *argl1, int chan, int pr, void *arg); /* function bch from hisax -> l1 */
9401 + void *argl1; /* pointer to l1 data structure when calling l1 */
9403 + char *drvname; /* driver name for hisax usage */
9406 +/**************************/
9407 +/* constants and commands */
9408 +/**************************/
9409 +#define HISAX_LOAD_VERSION 4 /* change when interface changes */
9410 +#define HISAX_LOAD_CHKVER 0 /* check version command (returns 0 on success) */
9411 +#define HISAX_LOAD_REGISTER 1 /* register the L1 driver and return 0 on success */
9413 +/***************************************/
9414 +/* definition of the register function */
9415 +/***************************************/
9416 +extern int hisax_register_hfcusb(struct hisax_drvreg *l1drv);
9417 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/hscx.c linux-2.4.29/drivers/isdn/hisax/hscx.c
9418 --- linux-2.4.29.old/drivers/isdn/hisax/hscx.c 2005-03-22 14:47:56.000000000 +0100
9419 +++ linux-2.4.29/drivers/isdn/hisax/hscx.c 2005-03-22 15:06:46.621005312 +0100
9421 -/* $Id: hscx.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9422 +/* $Id: hscx.c,v 1.24 2001/09/24 13:22:56 kai Exp $
9424 * HSCX specific routines
9426 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/hscx.h linux-2.4.29/drivers/isdn/hisax/hscx.h
9427 --- linux-2.4.29.old/drivers/isdn/hisax/hscx.h 2005-03-22 14:47:56.000000000 +0100
9428 +++ linux-2.4.29/drivers/isdn/hisax/hscx.h 2005-03-22 15:06:46.640002424 +0100
9430 -/* $Id: hscx.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9431 +/* $Id: hscx.h,v 1.8 2001/09/24 13:22:56 kai Exp $
9433 * HSCX specific defines
9435 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/hscx_irq.c linux-2.4.29/drivers/isdn/hisax/hscx_irq.c
9436 --- linux-2.4.29.old/drivers/isdn/hisax/hscx_irq.c 2005-03-22 14:47:56.000000000 +0100
9437 +++ linux-2.4.29/drivers/isdn/hisax/hscx_irq.c 2005-03-22 15:06:46.655999992 +0100
9439 -/* $Id: hscx_irq.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9440 +/* $Id: hscx_irq.c,v 1.18 2001/09/24 13:22:56 kai Exp $
9442 * low level b-channel stuff for Siemens HSCX
9444 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/icc.c linux-2.4.29/drivers/isdn/hisax/icc.c
9445 --- linux-2.4.29.old/drivers/isdn/hisax/icc.c 2005-03-22 14:47:56.000000000 +0100
9446 +++ linux-2.4.29/drivers/isdn/hisax/icc.c 2005-03-22 15:06:46.672997408 +0100
9448 -/* $Id: icc.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9449 +/* $Id: icc.c,v 1.8 2001/09/24 13:22:56 kai Exp $
9451 * ICC specific routines
9453 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/icc.h linux-2.4.29/drivers/isdn/hisax/icc.h
9454 --- linux-2.4.29.old/drivers/isdn/hisax/icc.h 2005-03-22 14:47:56.000000000 +0100
9455 +++ linux-2.4.29/drivers/isdn/hisax/icc.h 2005-03-22 15:06:46.687995128 +0100
9457 -/* $Id: icc.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9458 +/* $Id: icc.h,v 1.4 2001/09/24 13:22:56 kai Exp $
9460 * ICC specific routines
9462 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/ipac.h linux-2.4.29/drivers/isdn/hisax/ipac.h
9463 --- linux-2.4.29.old/drivers/isdn/hisax/ipac.h 2005-03-22 14:47:56.000000000 +0100
9464 +++ linux-2.4.29/drivers/isdn/hisax/ipac.h 2005-03-22 15:06:46.702992848 +0100
9466 -/* $Id: ipac.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9467 +/* $Id: ipac.h,v 1.7 2001/09/24 13:22:56 kai Exp $
9469 * IPAC specific defines
9471 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/isac.c linux-2.4.29/drivers/isdn/hisax/isac.c
9472 --- linux-2.4.29.old/drivers/isdn/hisax/isac.c 2005-03-22 14:47:56.000000000 +0100
9473 +++ linux-2.4.29/drivers/isdn/hisax/isac.c 2005-03-22 15:06:46.844971264 +0100
9475 -/* $Id: isac.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9476 +/* $Id: isac.c,v 1.31 2001/09/24 13:22:56 kai Exp $
9478 * ISAC specific routines
9480 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/isac.h linux-2.4.29/drivers/isdn/hisax/isac.h
9481 --- linux-2.4.29.old/drivers/isdn/hisax/isac.h 2005-03-22 14:47:56.000000000 +0100
9482 +++ linux-2.4.29/drivers/isdn/hisax/isac.h 2005-03-22 15:06:47.111930680 +0100
9484 -/* $Id: isac.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9485 +/* $Id: isac.h,v 1.9 2001/09/24 13:22:56 kai Exp $
9487 * ISAC specific defines
9489 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/isar.c linux-2.4.29/drivers/isdn/hisax/isar.c
9490 --- linux-2.4.29.old/drivers/isdn/hisax/isar.c 2005-03-22 14:47:56.000000000 +0100
9491 +++ linux-2.4.29/drivers/isdn/hisax/isar.c 2005-03-22 15:06:47.302901648 +0100
9493 -/* $Id: isar.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9494 +/* $Id: isar.c,v 1.22 2001/09/23 12:00:05 keil Exp $
9496 * isar.c ISAR (Siemens PSB 7110) specific routines
9502 -#define FAXMODCNT 13
9503 -const u_char faxmodulation[] = {3,24,48,72,73,74,96,97,98,121,122,145,146};
9504 -static u_int modmask = 0x1fff;
9505 -static int frm_extra_delay = 2;
9506 -static int para_TOA = 6;
9507 -const u_char *FC1_CMD[] = {"FAE", "FTS", "FRS", "FTM", "FRM", "FTH", "FRH", "CTRL" };
9509 +const u_char faxmodulation_s[] = "3,24,48,72,73,74,96,97,98,121,122,145,146";
9510 +const u_char faxmodulation[] = {3,24,48,72,73,74,96,97,98,121,122,145,146};
9511 +#define FAXMODCNT 13
9513 void isar_setup(struct IsdnCardState *cs);
9514 static void isar_pump_cmd(struct BCState *bcs, u_char cmd, u_char para);
9516 ireg->clsb = cs->BC_Read_Reg(cs, 1, ISAR_CTRL_L);
9518 if (cs->debug & L1_DEB_HSCX)
9519 - debugl1(cs, "irq_stat(%02x,%02x,%d)", ireg->iis, ireg->cmsb,
9520 + debugl1(cs, "rcv_mbox(%02x,%02x,%d)", ireg->iis, ireg->cmsb,
9531 restore_flags(flags);
9532 @@ -428,21 +425,6 @@
9537 -ll_deliver_faxstat(struct BCState *bcs, u_char status)
9540 - struct Channel *chanp = (struct Channel *) bcs->st->lli.userdata;
9542 - if (bcs->cs->debug & L1_DEB_HSCX)
9543 - debugl1(bcs->cs, "HL->LL FAXIND %x", status);
9544 - ic.driver = bcs->cs->myid;
9545 - ic.command = ISDN_STAT_FAXIND;
9546 - ic.arg = chanp->chan;
9547 - ic.parm.aux.cmd = status;
9548 - bcs->cs->iif.statcallb(&ic);
9551 extern void BChannel_bh(struct BCState *);
9552 #define B_LL_NOCARRIER 8
9553 #define B_LL_CONNECT 9
9555 if (ireg->cmsb & SART_NMD) { /* ABORT */
9556 if (cs->debug & L1_DEB_WARN)
9557 debugl1(cs, "isar_rcv_frame: no more data");
9558 + cs->BC_Write_Reg(cs, 1, ISAR_IIA, 0);
9559 bcs->hw.isar.rcvidx = 0;
9561 sendmsg(cs, SET_DPS(bcs->hw.isar.dpath) |
9565 printk(KERN_WARNING "HiSax: skb out of memory\n");
9566 + cs->BC_Write_Reg(cs, 1, ISAR_IIA, 0);
9571 bcs->hw.isar.rcvidx = 0;
9572 cs->BC_Write_Reg(cs, 1, ISAR_IIA, 0);
9574 - if (ireg->cmsb & HDLC_FSD) {
9575 + if (ireg->cmsb & HDLC_FSD)
9576 bcs->hw.isar.rcvidx = 0;
9578 ptr = bcs->hw.isar.rcvbuf + bcs->hw.isar.rcvidx;
9579 bcs->hw.isar.rcvidx += ireg->clsb;
9580 rcv_mbox(cs, ireg, ptr);
9582 if (cs->debug & L1_DEB_WARN)
9583 debugl1(cs, "isar frame to short %d",
9584 bcs->hw.isar.rcvidx);
9585 - printk(KERN_WARNING "ISAR: frame to short %d\n",
9586 - bcs->hw.isar.rcvidx);
9587 } else if (!(skb = dev_alloc_skb(bcs->hw.isar.rcvidx))) {
9588 printk(KERN_WARNING "ISAR: receive out of memory\n");
9591 isar_sched_event(bcs, B_RCVBUFREADY);
9593 isar_sched_event(bcs, B_LL_OK);
9594 - test_and_clear_bit(BC_FLG_FRH_WAIT, &bcs->Flag);
9596 bcs->hw.isar.rcvidx = 0;
9598 @@ -666,14 +646,13 @@
9599 if (ireg->cmsb & SART_NMD) { /* ABORT */
9600 if (cs->debug & L1_DEB_WARN)
9601 debugl1(cs, "isar_rcv_frame: no more data");
9602 + cs->BC_Write_Reg(cs, 1, ISAR_IIA, 0);
9603 bcs->hw.isar.rcvidx = 0;
9604 + send_DLE_ETX(bcs);
9605 sendmsg(cs, SET_DPS(bcs->hw.isar.dpath) |
9606 ISAR_HIS_PUMPCTRL, PCTRL_CMD_ESC, 0, NULL);
9607 bcs->hw.isar.state = STFAX_ESCAPE;
9608 - if (test_and_clear_bit(BC_FLG_FRH_WAIT, &bcs->Flag)) {
9609 - send_DLE_ETX(bcs);
9610 - isar_sched_event(bcs, B_LL_NOCARRIER);
9612 + isar_sched_event(bcs, B_LL_NOCARRIER);
9616 @@ -977,6 +956,21 @@
9621 +ll_deliver_faxstat(struct BCState *bcs, u_char status)
9624 + struct Channel *chanp = (struct Channel *) bcs->st->lli.userdata;
9626 + if (bcs->cs->debug & L1_DEB_HSCX)
9627 + debugl1(bcs->cs, "HL->LL FAXIND %x", status);
9628 + ic.driver = bcs->cs->myid;
9629 + ic.command = ISDN_STAT_FAXIND;
9630 + ic.arg = chanp->chan;
9631 + ic.parm.aux.cmd = status;
9632 + bcs->cs->iif.statcallb(&ic);
9636 isar_pump_statev_fax(struct BCState *bcs, u_char devt) {
9637 struct IsdnCardState *cs = bcs->cs;
9638 @@ -1081,22 +1075,19 @@
9639 if (cs->debug & L1_DEB_HSCX)
9640 debugl1(cs, "pump stev RSP_DISC");
9641 if (bcs->hw.isar.state == STFAX_ESCAPE) {
9643 switch(bcs->hw.isar.newcmd) {
9645 bcs->hw.isar.state = STFAX_READY;
9647 - case PCTRL_CMD_FTM:
9650 + case PCTRL_CMD_FTM:
9652 sendmsg(cs, dps | ISAR_HIS_PUMPCTRL,
9653 PCTRL_CMD_SILON, 1, &p1);
9654 bcs->hw.isar.state = STFAX_SILDET;
9656 - case PCTRL_CMD_FRM:
9657 - if (frm_extra_delay)
9658 - mdelay(frm_extra_delay);
9660 + case PCTRL_CMD_FRM:
9661 p1 = bcs->hw.isar.mod = bcs->hw.isar.newmod;
9662 bcs->hw.isar.newmod = 0;
9663 bcs->hw.isar.cmd = bcs->hw.isar.newcmd;
9664 @@ -1215,9 +1206,6 @@
9665 isar_pump_statev_modem(bcs, ireg->cmsb);
9666 } else if (bcs->mode == L1_MODE_FAX) {
9667 isar_pump_statev_fax(bcs, ireg->cmsb);
9668 - } else if (ireg->cmsb == PSEV_10MS_TIMER) {
9669 - if (cs->debug & L1_DEB_HSCX)
9670 - debugl1(cs, "pump stev TIMER");
9672 if (cs->debug & L1_DEB_WARN)
9673 debugl1(cs, "isar IIS_PSTEV pmode %d stat %x",
9674 @@ -1278,9 +1266,6 @@
9675 if (test_and_clear_bit(BC_FLG_LL_CONN, &bcs->Flag)) {
9676 isar_sched_event(bcs, B_LL_CONNECT);
9678 - if (test_and_clear_bit(BC_FLG_FTI_FTS, &bcs->Flag)) {
9679 - isar_sched_event(bcs, B_LL_OK);
9684 @@ -1303,7 +1288,7 @@
9686 param[5] = PV32P6_ATN;
9688 - param[0] = para_TOA; /* 6 db */
9689 + param[0] = 6; /* 6 db */
9690 param[1] = PV32P2_V23R | PV32P2_V22A | PV32P2_V22B |
9691 PV32P2_V22C | PV32P2_V21 | PV32P2_BEL;
9692 param[2] = PV32P3_AMOD | PV32P3_V32B | PV32P3_V23B;
9693 @@ -1319,7 +1304,7 @@
9695 param[1] = PFAXP2_ATN;
9697 - param[0] = para_TOA; /* 6 db */
9698 + param[0] = 6; /* 6 db */
9699 sendmsg(cs, dps | ISAR_HIS_PUMPCFG, ctrl, 2, param);
9700 bcs->hw.isar.state = STFAX_NULL;
9701 bcs->hw.isar.newcmd = 0;
9702 @@ -1348,6 +1333,7 @@
9708 sendmsg(cs, dps | ISAR_HIS_SARTCFG, SMODE_HDLC, 1,
9710 @@ -1359,9 +1345,6 @@
9711 sendmsg(cs, dps | ISAR_HIS_SARTCFG, ctrl, 2,
9715 - /* SART must not configured with FAX */
9719 sendmsg(cs, dps | ISAR_HIS_BSTREQ, 0, 0, NULL);
9720 @@ -1465,7 +1448,6 @@
9723 case ISDN_FAX_CLASS1_FTM:
9724 - test_and_clear_bit(BC_FLG_FRH_WAIT, &bcs->Flag);
9725 if (bcs->hw.isar.state == STFAX_READY) {
9727 ctrl = PCTRL_CMD_FTM;
9728 @@ -1489,7 +1471,6 @@
9731 case ISDN_FAX_CLASS1_FTH:
9732 - test_and_clear_bit(BC_FLG_FRH_WAIT, &bcs->Flag);
9733 if (bcs->hw.isar.state == STFAX_READY) {
9735 ctrl = PCTRL_CMD_FTH;
9736 @@ -1513,7 +1494,6 @@
9739 case ISDN_FAX_CLASS1_FRM:
9740 - test_and_clear_bit(BC_FLG_FRH_WAIT, &bcs->Flag);
9741 if (bcs->hw.isar.state == STFAX_READY) {
9743 ctrl = PCTRL_CMD_FRM;
9744 @@ -1537,7 +1517,6 @@
9747 case ISDN_FAX_CLASS1_FRH:
9748 - test_and_set_bit(BC_FLG_FRH_WAIT, &bcs->Flag);
9749 if (bcs->hw.isar.state == STFAX_READY) {
9751 ctrl = PCTRL_CMD_FRH;
9752 @@ -1560,11 +1539,6 @@
9753 bcs->hw.isar.state = STFAX_ESCAPE;
9756 - case ISDN_FAXPUMP_HALT:
9757 - bcs->hw.isar.state = STFAX_NULL;
9759 - ctrl = PCTRL_CMD_HALT;
9763 sendmsg(cs, dps | ISAR_HIS_PUMPCTRL, ctrl, nom, &p1);
9764 @@ -1658,15 +1632,6 @@
9765 l1_msg_b(st, pr, arg);
9767 case (PH_DEACTIVATE | CONFIRM):
9768 - switch(st->l1.mode) {
9769 - case L1_MODE_TRANS:
9770 - case L1_MODE_HDLC:
9774 - isar_pump_cmd(st->l1.bcs, ISDN_FAXPUMP_HALT, 0);
9777 test_and_clear_bit(BC_FLG_ACTIV, &st->l1.bcs->Flag);
9778 test_and_clear_bit(BC_FLG_BUSY, &st->l1.bcs->Flag);
9779 if (st->l1.bcs->cs->debug & L1_DEB_HSCX)
9780 @@ -1758,51 +1723,6 @@
9781 test_and_set_bit(BC_FLG_DLEETX,
9784 - case ISDN_FAX_CLASS1_FTS:
9785 - if (ic->parm.aux.subcmd == AT_QUERY) {
9786 - ic->command = ISDN_STAT_FAXIND;
9787 - ic->parm.aux.cmd = ISDN_FAX_CLASS1_OK;
9788 - cs->iif.statcallb(ic);
9790 - } else if (ic->parm.aux.subcmd == AT_EQ_QUERY) {
9791 - strcpy(ic->parm.aux.para, "0-255");
9792 - ic->command = ISDN_STAT_FAXIND;
9793 - ic->parm.aux.cmd = ISDN_FAX_CLASS1_QUERY;
9794 - cs->iif.statcallb(ic);
9796 - } else if (ic->parm.aux.subcmd == AT_EQ_VALUE) {
9797 - if (cs->debug & L1_DEB_HSCX)
9798 - debugl1(cs, "isar_auxcmd %s=%d",
9799 - FC1_CMD[ic->parm.aux.cmd], ic->parm.aux.para[0]);
9800 - if (bcs->hw.isar.state == STFAX_READY) {
9801 - if (! ic->parm.aux.para[0]) {
9802 - ic->command = ISDN_STAT_FAXIND;
9803 - ic->parm.aux.cmd = ISDN_FAX_CLASS1_OK;
9804 - cs->iif.statcallb(ic);
9807 - if (! test_and_set_bit(BC_FLG_FTI_RUN, &bcs->Flag)) {
9809 - bcs->hw.isar.ftimer.expires =
9810 - jiffies + ((ic->parm.aux.para[0] * 10 * HZ)/1000);
9811 - test_and_set_bit(BC_FLG_FTI_FTS, &bcs->Flag);
9812 - add_timer(&bcs->hw.isar.ftimer);
9816 - debugl1(cs, "isar FTS=%d and FTI busy",
9817 - ic->parm.aux.para[0]);
9821 - debugl1(cs, "isar FTS=%d and isar.state not ready(%x)",
9822 - ic->parm.aux.para[0],bcs->hw.isar.state);
9824 - ic->command = ISDN_STAT_FAXIND;
9825 - ic->parm.aux.cmd = ISDN_FAX_CLASS1_ERROR;
9826 - cs->iif.statcallb(ic);
9829 case ISDN_FAX_CLASS1_FRM:
9830 case ISDN_FAX_CLASS1_FRH:
9831 case ISDN_FAX_CLASS1_FTM:
9832 @@ -1815,24 +1735,16 @@
9833 cs->iif.statcallb(ic);
9835 } else if (ic->parm.aux.subcmd == AT_EQ_QUERY) {
9836 - char *p = ic->parm.aux.para;
9837 - for(i=0;i<FAXMODCNT;i++)
9838 - if ((1<<i) & modmask)
9839 - p += sprintf(p, "%d,", faxmodulation[i]);
9842 + strcpy(ic->parm.aux.para, faxmodulation_s);
9843 ic->command = ISDN_STAT_FAXIND;
9844 ic->parm.aux.cmd = ISDN_FAX_CLASS1_QUERY;
9845 cs->iif.statcallb(ic);
9847 } else if (ic->parm.aux.subcmd == AT_EQ_VALUE) {
9848 - if (cs->debug & L1_DEB_HSCX)
9849 - debugl1(cs, "isar_auxcmd %s=%d",
9850 - FC1_CMD[ic->parm.aux.cmd], ic->parm.aux.para[0]);
9851 for(i=0;i<FAXMODCNT;i++)
9852 if (faxmodulation[i]==ic->parm.aux.para[0])
9854 - if ((i < FAXMODCNT) && ((1<<i) & modmask) &&
9855 + if ((FAXMODCNT > i) &&
9856 test_bit(BC_FLG_INIT, &bcs->Flag)) {
9859 @@ -1850,7 +1762,7 @@
9861 case (ISDN_CMD_IOCTL):
9863 - case 9: /* load firmware */
9864 + case (9): /* load firmware */
9865 features = ISDN_FEATURE_L2_MODEM |
9866 ISDN_FEATURE_L2_FAX |
9867 ISDN_FEATURE_L3_FCLASS1;
9868 @@ -1860,26 +1772,6 @@
9870 ll_run(cs, features);
9873 - features = *(unsigned int *) ic->parm.num;
9874 - printk(KERN_DEBUG "HiSax: max modulation old(%04x) new(%04x)\n",
9875 - modmask, features);
9876 - modmask = features;
9879 - features = *(unsigned int *) ic->parm.num;
9880 - printk(KERN_DEBUG "HiSax: FRM extra delay old(%d) new(%d) ms\n",
9881 - frm_extra_delay, features);
9882 - if (features >= 0)
9883 - frm_extra_delay = features;
9886 - features = *(unsigned int *) ic->parm.num;
9887 - printk(KERN_DEBUG "HiSax: TOA old(%d) new(%d) db\n",
9888 - para_TOA, features);
9889 - if (features >= 0 && features < 32)
9890 - para_TOA = features;
9893 printk(KERN_DEBUG "HiSax: invalid ioctl %d\n",
9895 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/isar.h linux-2.4.29/drivers/isdn/hisax/isar.h
9896 --- linux-2.4.29.old/drivers/isdn/hisax/isar.h 2005-03-22 14:47:56.000000000 +0100
9897 +++ linux-2.4.29/drivers/isdn/hisax/isar.h 2005-03-22 15:06:47.457878088 +0100
9899 -/* $Id: isar.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9900 +/* $Id: isar.h,v 1.11 2001/09/24 13:22:56 kai Exp $
9902 * ISAR (Siemens PSB 7110) specific defines
9905 #define ISAR_HIS_FIRM 0x1e
9906 #define ISAR_HIS_STDSP 0x08
9907 #define ISAR_HIS_DIAG 0x05
9908 -#define ISAR_HIS_WAITSTATE 0x27
9909 -#define ISAR_HIS_TIMERIRQ 0x25
9910 #define ISAR_HIS_P0CFG 0x3c
9911 #define ISAR_HIS_P12CFG 0x24
9912 #define ISAR_HIS_SARTCFG 0x25
9914 #define ISAR_HIS_DPS2 0x80
9915 #define SET_DPS(x) ((x<<6) & 0xc0)
9917 -#define ISAR_CMD_TIMERIRQ_OFF 0x20
9918 -#define ISAR_CMD_TIMERIRQ_ON 0x21
9921 #define ISAR_IIS_MSCMSD 0x3f
9922 #define ISAR_IIS_VNR 0x15
9923 #define ISAR_IIS_DKEY 0x03
9925 #define STFAX_ESCAPE 5
9926 #define STFAX_SILDET 6
9928 -#define ISDN_FAXPUMP_HALT 100
9930 extern int ISARVersion(struct IsdnCardState *cs, char *s);
9931 extern void isar_int_main(struct IsdnCardState *cs);
9932 extern void initisar(struct IsdnCardState *cs);
9933 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/isdnl1.c linux-2.4.29/drivers/isdn/hisax/isdnl1.c
9934 --- linux-2.4.29.old/drivers/isdn/hisax/isdnl1.c 2005-03-22 14:47:56.000000000 +0100
9935 +++ linux-2.4.29/drivers/isdn/hisax/isdnl1.c 2005-03-22 15:06:47.582859088 +0100
9937 -/* $Id: isdnl1.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9938 +/* $Id: isdnl1.c,v 2.46 2001/09/24 13:22:56 kai Exp $
9940 * common low level stuff for Siemens Chipsetbased isdn cards
9946 -const char *l1_revision = "$Revision: 1.1.4.1 $";
9947 +const char *l1_revision = "$Revision: 2.46 $";
9949 #define __NO_VERSION__
9950 #include <linux/init.h>
9951 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/isdnl1.h linux-2.4.29/drivers/isdn/hisax/isdnl1.h
9952 --- linux-2.4.29.old/drivers/isdn/hisax/isdnl1.h 2005-03-22 14:47:56.000000000 +0100
9953 +++ linux-2.4.29/drivers/isdn/hisax/isdnl1.h 2005-03-22 15:06:47.615854072 +0100
9955 -/* $Id: isdnl1.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9956 +/* $Id: isdnl1.h,v 2.12 2001/09/24 13:22:56 kai Exp $
9960 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/isdnl2.c linux-2.4.29/drivers/isdn/hisax/isdnl2.c
9961 --- linux-2.4.29.old/drivers/isdn/hisax/isdnl2.c 2005-03-22 14:47:56.000000000 +0100
9962 +++ linux-2.4.29/drivers/isdn/hisax/isdnl2.c 2005-03-22 15:06:47.631851640 +0100
9964 -/* $Id: isdnl2.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9965 +/* $Id: isdnl2.c,v 2.30 2001/09/24 13:22:56 kai Exp $
9967 * Author Karsten Keil
9968 * based on the teles driver from Jan den Ouden
9973 -const char *l2_revision = "$Revision: 1.1.4.1 $";
9974 +const char *l2_revision = "$Revision: 2.30 $";
9976 static void l2m_debug(struct FsmInst *fi, char *fmt, ...);
9978 @@ -1418,8 +1418,8 @@
9982 - st5_dl_release_l2l3(st);
9983 FsmChangeState(fi, ST_L2_1);
9984 + st5_dl_release_l2l3(st);
9988 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/isdnl2.h linux-2.4.29/drivers/isdn/hisax/isdnl2.h
9989 --- linux-2.4.29.old/drivers/isdn/hisax/isdnl2.h 2005-03-22 14:47:56.000000000 +0100
9990 +++ linux-2.4.29/drivers/isdn/hisax/isdnl2.h 2005-03-22 15:06:47.647849208 +0100
9992 -/* $Id: isdnl2.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
9997 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/isdnl3.c linux-2.4.29/drivers/isdn/hisax/isdnl3.c
9998 --- linux-2.4.29.old/drivers/isdn/hisax/isdnl3.c 2005-03-22 14:47:56.000000000 +0100
9999 +++ linux-2.4.29/drivers/isdn/hisax/isdnl3.c 2005-03-22 15:06:47.663846776 +0100
10001 -/* $Id: isdnl3.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10002 +/* $Id: isdnl3.c,v 2.22 2001/09/24 13:22:56 kai Exp $
10004 * Author Karsten Keil
10005 * based on the teles driver from Jan den Ouden
10007 #include "isdnl3.h"
10008 #include <linux/config.h>
10010 -const char *l3_revision = "$Revision: 1.1.4.1 $";
10011 +const char *l3_revision = "$Revision: 2.22 $";
10013 static struct Fsm l3fsm;
10015 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/isdnl3.h linux-2.4.29/drivers/isdn/hisax/isdnl3.h
10016 --- linux-2.4.29.old/drivers/isdn/hisax/isdnl3.h 2005-03-22 14:47:56.000000000 +0100
10017 +++ linux-2.4.29/drivers/isdn/hisax/isdnl3.h 2005-03-22 15:06:47.679844344 +0100
10019 -/* $Id: isdnl3.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10022 * This software may be used and distributed according to the terms
10023 * of the GNU General Public License, incorporated herein by reference.
10024 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/isurf.c linux-2.4.29/drivers/isdn/hisax/isurf.c
10025 --- linux-2.4.29.old/drivers/isdn/hisax/isurf.c 2005-03-22 14:47:56.000000000 +0100
10026 +++ linux-2.4.29/drivers/isdn/hisax/isurf.c 2005-03-22 15:06:47.699841304 +0100
10028 -/* $Id: isurf.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10029 +/* $Id: isurf.c,v 1.12 2001/09/24 13:22:56 kai Exp $
10031 * low level stuff for Siemens I-Surf/I-Talk cards
10033 @@ -16,11 +16,10 @@
10036 #include "isdnl1.h"
10037 -#include <linux/isapnp.h>
10039 extern const char *CardType[];
10041 -static const char *ISurf_revision = "$Revision: 1.1.4.1 $";
10042 +static const char *ISurf_revision = "$Revision: 1.12 $";
10044 #define byteout(addr,val) outb(val,addr)
10045 #define bytein(addr) inb(addr)
10046 @@ -128,8 +127,10 @@
10047 release_io_isurf(struct IsdnCardState *cs)
10049 release_region(cs->hw.isurf.reset, 1);
10050 +#ifdef COMPAT_HAS_ISA_IOREMAP
10051 iounmap((unsigned char *)cs->hw.isurf.isar);
10052 release_mem_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE);
10057 @@ -194,10 +195,6 @@
10058 return(isar_auxcmd(cs, ic));
10062 -static struct pci_bus *pnp_surf __devinitdata = NULL;
10066 setup_isurf(struct IsdnCard *card)
10068 @@ -215,58 +212,9 @@
10069 cs->hw.isurf.phymem = card->para[2];
10070 cs->irq = card->para[0];
10073 - struct pci_bus *pb;
10074 - struct pci_dev *pd;
10076 - if (isapnp_present()) {
10078 - if ((pb = isapnp_find_card(
10079 - ISAPNP_VENDOR('S', 'I', 'E'),
10080 - ISAPNP_FUNCTION(0x0010), pnp_surf))) {
10083 - if (!(pd = isapnp_find_dev(pnp_surf,
10084 - ISAPNP_VENDOR('S', 'I', 'E'),
10085 - ISAPNP_FUNCTION(0x0010), pd))) {
10086 - printk(KERN_ERR "ISurfPnP: PnP error card found, no device\n");
10090 - pd->deactivate(pd);
10091 - pd->activate(pd);
10092 - /* The ISA-PnP logic apparently
10093 - * expects upper limit address to be
10094 - * set. Since the isa-pnp module
10095 - * doesn't do this, so we have to make
10098 - isapnp_cfg_begin(pd->bus->number, pd->devfn);
10099 - isapnp_write_word(ISAPNP_CFG_MEM+3,
10100 - pd->resource[8].end >> 8);
10101 - isapnp_cfg_end();
10102 - cs->hw.isurf.reset = pd->resource[0].start;
10103 - cs->hw.isurf.phymem = pd->resource[8].start;
10104 - cs->irq = pd->irq_resource[0].start;
10105 - if (!cs->irq || !cs->hw.isurf.reset || !cs->hw.isurf.phymem) {
10106 - printk(KERN_ERR "ISurfPnP:some resources are missing %d/%x/%lx\n",
10107 - cs->irq, cs->hw.isurf.reset, cs->hw.isurf.phymem);
10108 - pd->deactivate(pd);
10112 - printk(KERN_INFO "ISurfPnP: no ISAPnP card found\n");
10116 - printk(KERN_INFO "ISurfPnP: no ISAPnP bus found\n");
10120 printk(KERN_WARNING "HiSax: %s port/mem not set\n",
10121 CardType[card->typ]);
10125 if (check_region(cs->hw.isurf.reset, 1)) {
10126 printk(KERN_WARNING
10127 @@ -277,6 +225,7 @@
10129 request_region(cs->hw.isurf.reset, 1, "isurf isdn");
10131 +#ifdef COMPAT_HAS_ISA_IOREMAP
10132 if (check_mem_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE)) {
10133 printk(KERN_WARNING
10134 "HiSax: %s memory region %lx-%lx already in use\n",
10135 @@ -292,6 +241,10 @@
10136 cs->hw.isurf.isar =
10137 (unsigned long) ioremap(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE);
10138 cs->hw.isurf.isac = cs->hw.isurf.isar + ISURF_ISAC_OFFSET;
10140 + cs->hw.isurf.isar = cs->hw.isurf.phymem + ISURF_ISAR_OFFSET;
10141 + cs->hw.isurf.isac = cs->hw.isurf.phymem + ISURF_ISAC_OFFSET;
10144 "ISurf: defined at 0x%x 0x%lx IRQ %d\n",
10145 cs->hw.isurf.reset,
10146 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/ix1_micro.c linux-2.4.29/drivers/isdn/hisax/ix1_micro.c
10147 --- linux-2.4.29.old/drivers/isdn/hisax/ix1_micro.c 2005-03-22 14:47:56.000000000 +0100
10148 +++ linux-2.4.29/drivers/isdn/hisax/ix1_micro.c 2005-03-22 15:06:47.714839024 +0100
10150 -/* $Id: ix1_micro.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10151 +/* $Id: ix1_micro.c,v 2.12 2001/09/24 13:22:56 kai Exp $
10153 * low level stuff for ITK ix1-micro Rev.2 isdn cards
10154 * derived from the original file teles3.c from Karsten Keil
10155 @@ -19,14 +19,13 @@
10157 #define __NO_VERSION__
10158 #include <linux/init.h>
10159 -#include <linux/isapnp.h>
10163 #include "isdnl1.h"
10165 extern const char *CardType[];
10166 -const char *ix1_revision = "$Revision: 1.1.4.1 $";
10167 +const char *ix1_revision = "$Revision: 2.12 $";
10169 #define byteout(addr,val) outb(val,addr)
10170 #define bytein(addr) inb(addr)
10171 @@ -219,21 +218,6 @@
10176 -static struct isapnp_device_id itk_ids[] __initdata = {
10177 - { ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x25),
10178 - ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x25),
10179 - (unsigned long) "ITK micro 2" },
10180 - { ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x29),
10181 - ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x29),
10182 - (unsigned long) "ITK micro 2." },
10186 -static struct isapnp_device_id *idev = &itk_ids[0];
10187 -static struct pci_bus *pnp_c __devinitdata = NULL;
10192 setup_ix1micro(struct IsdnCard *card)
10193 @@ -246,45 +230,6 @@
10194 if (cs->typ != ISDN_CTYPE_IX1MICROR2)
10198 - if (!card->para[1] && isapnp_present()) {
10199 - struct pci_bus *pb;
10200 - struct pci_dev *pd;
10202 - while(idev->card_vendor) {
10203 - if ((pb = isapnp_find_card(idev->card_vendor,
10204 - idev->card_device, pnp_c))) {
10207 - if ((pd = isapnp_find_dev(pnp_c,
10208 - idev->vendor, idev->function, pd))) {
10209 - printk(KERN_INFO "HiSax: %s detected\n",
10210 - (char *)idev->driver_data);
10212 - pd->deactivate(pd);
10213 - pd->activate(pd);
10214 - card->para[1] = pd->resource[0].start;
10215 - card->para[0] = pd->irq_resource[0].start;
10216 - if (!card->para[0] || !card->para[1]) {
10217 - printk(KERN_ERR "ITK PnP:some resources are missing %ld/%lx\n",
10218 - card->para[0], card->para[1]);
10219 - pd->deactivate(pd);
10224 - printk(KERN_ERR "ITK PnP: PnP error card found, no device\n");
10230 - if (!idev->card_vendor) {
10231 - printk(KERN_INFO "ITK PnP: no ISAPnP card found\n");
10237 cs->hw.ix1.isac_ale = card->para[1] + ISAC_COMMAND_OFFSET;
10238 cs->hw.ix1.hscx_ale = card->para[1] + HSCX_COMMAND_OFFSET;
10239 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/jade.c linux-2.4.29/drivers/isdn/hisax/jade.c
10240 --- linux-2.4.29.old/drivers/isdn/hisax/jade.c 2005-03-22 14:47:56.000000000 +0100
10241 +++ linux-2.4.29/drivers/isdn/hisax/jade.c 2005-03-22 15:06:47.729836744 +0100
10243 -/* $Id: jade.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10244 +/* $Id: jade.c,v 1.9 2001/09/24 13:22:56 kai Exp $
10246 * JADE stuff (derived from original hscx.c)
10248 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/jade.h linux-2.4.29/drivers/isdn/hisax/jade.h
10249 --- linux-2.4.29.old/drivers/isdn/hisax/jade.h 2005-03-22 14:47:56.000000000 +0100
10250 +++ linux-2.4.29/drivers/isdn/hisax/jade.h 2005-03-22 15:06:47.745834312 +0100
10252 -/* $Id: jade.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10253 +/* $Id: jade.h,v 1.5 2001/09/24 13:22:56 kai Exp $
10255 * JADE specific defines
10257 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/jade_irq.c linux-2.4.29/drivers/isdn/hisax/jade_irq.c
10258 --- linux-2.4.29.old/drivers/isdn/hisax/jade_irq.c 2005-03-22 14:47:56.000000000 +0100
10259 +++ linux-2.4.29/drivers/isdn/hisax/jade_irq.c 2005-03-22 15:06:47.760832032 +0100
10261 -/* $Id: jade_irq.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10262 +/* $Id: jade_irq.c,v 1.7 2001/09/24 13:22:56 kai Exp $
10264 * Low level JADE IRQ stuff (derived from original hscx_irq.c)
10266 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/l3_1tr6.c linux-2.4.29/drivers/isdn/hisax/l3_1tr6.c
10267 --- linux-2.4.29.old/drivers/isdn/hisax/l3_1tr6.c 2005-03-22 14:47:56.000000000 +0100
10268 +++ linux-2.4.29/drivers/isdn/hisax/l3_1tr6.c 2005-03-22 15:06:47.777829448 +0100
10270 -/* $Id: l3_1tr6.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10271 +/* $Id: l3_1tr6.c,v 2.15 2001/09/24 13:22:56 kai Exp $
10273 * German 1TR6 D-channel protocol
10276 #include <linux/ctype.h>
10278 extern char *HiSax_getrev(const char *revision);
10279 -const char *l3_1tr6_revision = "$Revision: 1.1.4.1 $";
10280 +const char *l3_1tr6_revision = "$Revision: 2.15 $";
10282 #define MsgHead(ptr, cref, mty, dis) \
10284 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/l3_1tr6.h linux-2.4.29/drivers/isdn/hisax/l3_1tr6.h
10285 --- linux-2.4.29.old/drivers/isdn/hisax/l3_1tr6.h 2005-03-22 14:47:56.000000000 +0100
10286 +++ linux-2.4.29/drivers/isdn/hisax/l3_1tr6.h 2005-03-22 15:06:47.796826560 +0100
10288 -/* $Id: l3_1tr6.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10291 * German 1TR6 D-channel protocol defines
10293 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/l3dss1.c linux-2.4.29/drivers/isdn/hisax/l3dss1.c
10294 --- linux-2.4.29.old/drivers/isdn/hisax/l3dss1.c 2005-03-22 14:47:56.000000000 +0100
10295 +++ linux-2.4.29/drivers/isdn/hisax/l3dss1.c 2005-03-22 15:06:47.822822608 +0100
10297 -/* $Id: l3dss1.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10298 +/* $Id: l3dss1.c,v 2.32 2001/09/24 13:22:56 kai Exp $
10300 * EURO/DSS1 D-channel protocol
10303 #include <linux/config.h>
10305 extern char *HiSax_getrev(const char *revision);
10306 -const char *dss1_revision = "$Revision: 1.1.4.1 $";
10307 +const char *dss1_revision = "$Revision: 2.32 $";
10309 #define EXT_BEARER_CAPS 1
10311 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/l3dss1.h linux-2.4.29/drivers/isdn/hisax/l3dss1.h
10312 --- linux-2.4.29.old/drivers/isdn/hisax/l3dss1.h 2005-03-22 14:47:56.000000000 +0100
10313 +++ linux-2.4.29/drivers/isdn/hisax/l3dss1.h 2005-03-22 15:06:47.842819568 +0100
10315 -/* $Id: l3dss1.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10318 * DSS1 (Euro) D-channel protocol defines
10320 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/l3ni1.c linux-2.4.29/drivers/isdn/hisax/l3ni1.c
10321 --- linux-2.4.29.old/drivers/isdn/hisax/l3ni1.c 2005-03-22 14:47:56.000000000 +0100
10322 +++ linux-2.4.29/drivers/isdn/hisax/l3ni1.c 2005-03-22 15:06:47.859816984 +0100
10324 -/* $Id: l3ni1.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10325 +/* $Id: l3ni1.c,v 2.8 2001/09/24 13:22:56 kai Exp $
10327 * NI1 D-channel protocol
10330 #include <linux/ctype.h>
10332 extern char *HiSax_getrev(const char *revision);
10333 -const char *ni1_revision = "$Revision: 1.1.4.1 $";
10334 +const char *ni1_revision = "$Revision: 2.8 $";
10336 #define EXT_BEARER_CAPS 1
10338 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/l3ni1.h linux-2.4.29/drivers/isdn/hisax/l3ni1.h
10339 --- linux-2.4.29.old/drivers/isdn/hisax/l3ni1.h 2005-03-22 14:47:56.000000000 +0100
10340 +++ linux-2.4.29/drivers/isdn/hisax/l3ni1.h 2005-03-22 15:06:47.877814248 +0100
10342 -/* $Id: l3ni1.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10345 * NI1 D-channel protocol
10347 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/lmgr.c linux-2.4.29/drivers/isdn/hisax/lmgr.c
10348 --- linux-2.4.29.old/drivers/isdn/hisax/lmgr.c 2005-03-22 14:47:56.000000000 +0100
10349 +++ linux-2.4.29/drivers/isdn/hisax/lmgr.c 2005-03-22 15:06:47.895811512 +0100
10351 -/* $Id: lmgr.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10354 * Layermanagement module
10356 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/md5sums.asc linux-2.4.29/drivers/isdn/hisax/md5sums.asc
10357 --- linux-2.4.29.old/drivers/isdn/hisax/md5sums.asc 2005-03-22 14:47:56.000000000 +0100
10358 +++ linux-2.4.29/drivers/isdn/hisax/md5sums.asc 2005-03-22 15:06:47.910809232 +0100
10360 ------BEGIN PGP SIGNED MESSAGE-----
10363 # This are valid md5sums for certificated HiSax driver.
10364 # The certification is valid only if the md5sums of all files match.
10365 # The certification is valid only for ELSA Microlink PCI,
10366 -# Eicon Technology Diva 2.01 PCI, Sedlbauer SpeedFax+,
10367 -# HFC-S PCI A based cards and HFC-S USB based ISDN
10368 -# terminal adapters in the moment.
10369 +# Eicon Technology Diva 2.01 PCI, Sedlbauer SpeedFax+,
10370 +# HFC-S PCI A based cards and HFC-S USB based isdn tas
10372 # Read ../../../Documentation/isdn/HiSax.cert for more informations.
10374 -cd4a9917e1147039d5dfc66440d42054 isac.c
10375 -211840e78b56c9d4753be9c85da21a50 isdnl1.c
10376 -5ce9b1fff42a02f9c2eb4fb81c701b1f isdnl2.c
10377 -6948de0c43513dd23c6706feb5fc2209 isdnl3.c
10378 -3730780b69368218d756024165efea79 tei.c
10379 -16e72710eb58da01415b877490f5d2ac callc.c
10380 -6abc55c77e0f3149ae9334f3257a1a1a cert.c
10381 -27bdb2800d4590e00da20eff241edc47 l3dss1.c
10382 -df8bb877b854c4302d396b554e4e84ef l3_1tr6.c
10383 -9d8b4bed15370063d1b16e47080f50e1 elsa.c
10384 -210f4a3f1eebca70229d786b15cf3e90 diva.c
10385 -4ddf21079dd77e892380f789bae250a7 sedlbauer.c
10386 -8200d818771e3cbdef2a3c3e818d25ac hfc_pci.c
10387 +6f9433a8b696076562562d090e3c420f isac.c
10388 +13c3eed869f5139f44c563e3a8fea1f5 isdnl1.c
10389 +addcff863b0ff1e366c0f2ae9fa6e81e isdnl2.c
10390 +7076deb94a363945c21ea27aca4a720a isdnl3.c
10391 +51c603829b6cc4f8421f744ad657ceff tei.c
10392 +669050ab5079f02887ed0239d86e5474 callc.c
10393 +ecacd146b8f8881ef9349935dab3df4a cert.c
10394 +fadeb3b85bb23bc1ac48470c0848d6fa l3dss1.c
10395 +cf7dec9fac6283716904d26b99188476 l3_1tr6.c
10396 +2f75c8765e1be13d114d5f4433cf364b elsa.c
10397 +b4cf8a4dceed9ea6dcba65a85b4eecc7 diva.c
10398 +dee3f8f40c6fe78a4b57729804b7e6cd sedlbauer.c
10399 +0d79fe6dfc5bfaa4826970c41a6d273d hfc_pci.c
10401 ------BEGIN PGP SIGNATURE-----
10402 -Version: GnuPG v1.0.6 (GNU/Linux)
10403 -Comment: For info see http://www.gnupg.org
10405 -iD8DBQE9rE91DiY0VZsg4ukRAkKfAJ4xWUfqjc0hW+V+JPue5yr7mrt+RwCdGdSf
10406 -GIKgAEdRLzERmpt/bCCwAbY=
10408 ------END PGP SIGNATURE-----
10409 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/mic.c linux-2.4.29/drivers/isdn/hisax/mic.c
10410 --- linux-2.4.29.old/drivers/isdn/hisax/mic.c 2005-03-22 14:47:56.000000000 +0100
10411 +++ linux-2.4.29/drivers/isdn/hisax/mic.c 2005-03-22 15:06:47.926806800 +0100
10413 -/* $Id: mic.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10414 +/* $Id: mic.c,v 1.12 2001/09/24 13:22:56 kai Exp $
10416 * low level stuff for mic cards
10420 extern const char *CardType[];
10422 -const char *mic_revision = "$Revision: 1.1.4.1 $";
10423 +const char *mic_revision = "$Revision: 1.12 $";
10425 #define byteout(addr,val) outb(val,addr)
10426 #define bytein(addr) inb(addr)
10427 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/netjet.c linux-2.4.29/drivers/isdn/hisax/netjet.c
10428 --- linux-2.4.29.old/drivers/isdn/hisax/netjet.c 2005-03-22 14:47:56.000000000 +0100
10429 +++ linux-2.4.29/drivers/isdn/hisax/netjet.c 2005-03-22 15:06:47.941804520 +0100
10431 -/* $Id: netjet.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10432 +/* $Id: netjet.c,v 1.29 2001/09/24 13:22:56 kai Exp $
10434 * low level stuff for Traverse Technologie NETJet ISDN cards
10437 * This software may be used and distributed according to the terms
10438 * of the GNU General Public License, incorporated herein by reference.
10440 - * Thanks to Traverse Technologies Australia for documents and information
10442 - * 16-Apr-2002 - led code added - Guy Ellis (guy@traverse.com.au)
10443 + * Thanks to Traverse Technologie Australia for documents and information
10448 #include <asm/io.h>
10449 #include "netjet.h"
10451 -const char *NETjet_revision = "$Revision: 1.1.4.1 $";
10452 +const char *NETjet_revision = "$Revision: 1.29 $";
10454 /* Interface functions */
10456 @@ -135,7 +133,6 @@
10457 mode_tiger(struct BCState *bcs, int mode, int bc)
10459 struct IsdnCardState *cs = bcs->cs;
10462 if (cs->debug & L1_DEB_HSCX)
10463 debugl1(cs, "Tiger mode %d bchan %d/%d",
10464 @@ -157,15 +154,6 @@
10465 cs->hw.njet.dmactrl);
10466 byteout(cs->hw.njet.base + NETJET_IRQMASK0, 0);
10468 - if (cs->typ == ISDN_CTYPE_NETJET_S)
10472 - led = 0x01 << (6 + led); // convert to mask
10474 - cs->hw.njet.auxd &= led;
10475 - byteout(cs->hw.njet.auxa, cs->hw.njet.auxd);
10478 case (L1_MODE_TRANS):
10480 @@ -191,14 +179,6 @@
10481 bcs->hw.tiger.sendp = bcs->hw.tiger.send;
10482 bcs->hw.tiger.free = NETJET_DMA_TXSIZE;
10483 test_and_set_bit(BC_FLG_EMPTY, &bcs->Flag);
10484 - if (cs->typ == ISDN_CTYPE_NETJET_S)
10488 - led = 0x01 << (6 + led); // convert to mask
10489 - cs->hw.njet.auxd |= led;
10490 - byteout(cs->hw.njet.auxa, cs->hw.njet.auxd);
10494 if (cs->debug & L1_DEB_HSCX)
10495 @@ -874,13 +854,9 @@
10496 case (PH_ACTIVATE | REQUEST):
10497 test_and_set_bit(BC_FLG_ACTIV, &st->l1.bcs->Flag);
10498 mode_tiger(st->l1.bcs, st->l1.mode, st->l1.bc);
10499 - /* 2001/10/04 Christoph Ersfeld, Formula-n Europe AG */
10500 - st->l1.bcs->cs->cardmsg(st->l1.bcs->cs, MDL_BC_ASSIGN, (void *)(&st->l1.bc));
10501 l1_msg_b(st, pr, arg);
10503 case (PH_DEACTIVATE | REQUEST):
10504 - /* 2001/10/04 Christoph Ersfeld, Formula-n Europe AG */
10505 - st->l1.bcs->cs->cardmsg(st->l1.bcs->cs, MDL_BC_RELEASE, (void *)(&st->l1.bc));
10506 l1_msg_b(st, pr, arg);
10508 case (PH_DEACTIVATE | CONFIRM):
10509 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/netjet.h linux-2.4.29/drivers/isdn/hisax/netjet.h
10510 --- linux-2.4.29.old/drivers/isdn/hisax/netjet.h 2005-03-22 14:47:56.000000000 +0100
10511 +++ linux-2.4.29/drivers/isdn/hisax/netjet.h 2005-03-22 15:06:47.956802240 +0100
10513 -/* $Id: netjet.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10514 +/* $Id: netjet.h,v 2.8 2001/09/24 13:22:56 kai Exp $
10516 * NETjet common header file
10518 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/niccy.c linux-2.4.29/drivers/isdn/hisax/niccy.c
10519 --- linux-2.4.29.old/drivers/isdn/hisax/niccy.c 2005-03-22 14:47:56.000000000 +0100
10520 +++ linux-2.4.29/drivers/isdn/hisax/niccy.c 2005-03-22 15:06:47.977799048 +0100
10522 -/* $Id: niccy.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10523 +/* $Id: niccy.c,v 1.21 2001/10/20 22:05:00 kai Exp $
10525 * low level stuff for Dr. Neuhaus NICCY PnP and NICCY PCI and
10526 * compatible (SAGEM cybermodem)
10527 @@ -22,10 +22,10 @@
10529 #include "isdnl1.h"
10530 #include <linux/pci.h>
10531 -#include <linux/isapnp.h>
10532 +#include <linux/isdn_compat.h>
10534 extern const char *CardType[];
10535 -const char *niccy_revision = "$Revision: 1.1.4.1 $";
10536 +const char *niccy_revision = "$Revision: 1.21 $";
10538 #define byteout(addr,val) outb(val,addr)
10539 #define bytein(addr) inb(addr)
10540 @@ -239,9 +239,6 @@
10543 static struct pci_dev *niccy_dev __initdata = NULL;
10545 -static struct pci_bus *pnp_c __devinitdata = NULL;
10549 setup_niccy(struct IsdnCard *card)
10550 @@ -253,39 +250,7 @@
10551 printk(KERN_INFO "HiSax: Niccy driver Rev. %s\n", HiSax_getrev(tmp));
10552 if (cs->typ != ISDN_CTYPE_NICCY)
10555 - if (!card->para[1] && isapnp_present()) {
10556 - struct pci_bus *pb;
10557 - struct pci_dev *pd;
10559 - if ((pb = isapnp_find_card(
10560 - ISAPNP_VENDOR('S', 'D', 'A'),
10561 - ISAPNP_FUNCTION(0x0150), pnp_c))) {
10564 - if (!(pd = isapnp_find_dev(pnp_c,
10565 - ISAPNP_VENDOR('S', 'D', 'A'),
10566 - ISAPNP_FUNCTION(0x0150), pd))) {
10567 - printk(KERN_ERR "NiccyPnP: PnP error card found, no device\n");
10571 - pd->deactivate(pd);
10572 - pd->activate(pd);
10573 - card->para[1] = pd->resource[0].start;
10574 - card->para[2] = pd->resource[1].start;
10575 - card->para[0] = pd->irq_resource[0].start;
10576 - if (!card->para[0] || !card->para[1] || !card->para[2]) {
10577 - printk(KERN_ERR "NiccyPnP:some resources are missing %ld/%lx/%lx\n",
10578 - card->para[0], card->para[1], card->para[2]);
10579 - pd->deactivate(pd);
10583 - printk(KERN_INFO "NiccyPnP: no ISAPnP card found\n");
10588 if (card->para[1]) {
10589 cs->hw.niccy.isac = card->para[1] + ISAC_PNP;
10590 cs->hw.niccy.hscx = card->para[1] + HSCX_PNP;
10591 @@ -331,12 +296,12 @@
10594 cs->irq = niccy_dev->irq;
10595 - cs->hw.niccy.cfg_reg = pci_resource_start(niccy_dev, 0);
10596 + cs->hw.niccy.cfg_reg = pci_resource_start_io(niccy_dev, 0);
10597 if (!cs->hw.niccy.cfg_reg) {
10598 printk(KERN_WARNING "Niccy: No IO-Adr for PCI cfg found\n");
10601 - pci_ioaddr = pci_resource_start(niccy_dev, 1);
10602 + pci_ioaddr = pci_resource_start_io(niccy_dev, 1);
10604 printk(KERN_WARNING "Niccy: No IO-Adr for PCI card found\n");
10606 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/nj_s.c linux-2.4.29/drivers/isdn/hisax/nj_s.c
10607 --- linux-2.4.29.old/drivers/isdn/hisax/nj_s.c 2005-03-22 14:47:56.000000000 +0100
10608 +++ linux-2.4.29/drivers/isdn/hisax/nj_s.c 2005-03-22 15:06:47.993796616 +0100
10610 -/* $Id: nj_s.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10611 +/* $Id: nj_s.c,v 2.13 2001/09/24 13:22:56 kai Exp $
10613 * This software may be used and distributed according to the terms
10614 * of the GNU General Public License, incorporated herein by reference.
10615 @@ -12,11 +12,12 @@
10617 #include "isdnl1.h"
10618 #include <linux/pci.h>
10619 +#include <linux/isdn_compat.h>
10620 #include <linux/interrupt.h>
10621 #include <linux/ppp_defs.h>
10622 #include "netjet.h"
10624 -const char *NETjet_S_revision = "$Revision: 1.1.4.1 $";
10625 +const char *NETjet_S_revision = "$Revision: 2.13 $";
10627 static u_char dummyrr(struct IsdnCardState *cs, int chan, u_char off)
10629 @@ -130,7 +131,6 @@
10630 release_io_netjet(cs);
10633 - reset_netjet_s(cs);
10635 clear_pending_isac_ints(cs);
10637 @@ -180,19 +180,11 @@
10638 printk(KERN_WARNING "NETjet-S: No IRQ for PCI card found\n");
10641 - cs->hw.njet.base = pci_resource_start(dev_netjet, 0);
10642 + cs->hw.njet.base = pci_resource_start_io(dev_netjet, 0);
10643 if (!cs->hw.njet.base) {
10644 printk(KERN_WARNING "NETjet-S: No IO-Adr for PCI card found\n");
10647 - /* 2001/10/04 Christoph Ersfeld, Formula-n Europe AG www.formula-n.com */
10648 - if ((dev_netjet->subsystem_vendor == 0x55) &&
10649 - (dev_netjet->subsystem_device == 0x02)) {
10650 - printk(KERN_WARNING "Netjet: You tried to load this driver with an incompatible TigerJet-card\n");
10651 - printk(KERN_WARNING "Use type=41 for Formula-n enter:now ISDN PCI and compatible\n");
10654 - /* end new code */
10656 printk(KERN_WARNING "NETjet-S: No PCI card found\n");
10658 @@ -263,6 +255,7 @@
10660 request_region(cs->hw.njet.base, bytecnt, "netjet-s isdn");
10662 + reset_netjet_s(cs);
10663 cs->readisac = &NETjet_ReadIC;
10664 cs->writeisac = &NETjet_WriteIC;
10665 cs->readisacfifo = &NETjet_ReadICfifo;
10666 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/nj_u.c linux-2.4.29/drivers/isdn/hisax/nj_u.c
10667 --- linux-2.4.29.old/drivers/isdn/hisax/nj_u.c 2005-03-22 14:47:56.000000000 +0100
10668 +++ linux-2.4.29/drivers/isdn/hisax/nj_u.c 2005-03-22 15:06:48.008794336 +0100
10670 -/* $Id: nj_u.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10671 +/* $Id: nj_u.c,v 2.14 2001/09/24 13:22:56 kai Exp $
10673 * This software may be used and distributed according to the terms
10674 * of the GNU General Public License, incorporated herein by reference.
10675 @@ -12,11 +12,12 @@
10677 #include "isdnl1.h"
10678 #include <linux/pci.h>
10679 +#include <linux/isdn_compat.h>
10680 #include <linux/interrupt.h>
10681 #include <linux/ppp_defs.h>
10682 #include "netjet.h"
10684 -const char *NETjet_U_revision = "$Revision: 1.1.4.1 $";
10685 +const char *NETjet_U_revision = "$Revision: 2.14 $";
10687 static u_char dummyrr(struct IsdnCardState *cs, int chan, u_char off)
10689 @@ -181,7 +182,7 @@
10690 printk(KERN_WARNING "NETspider-U: No IRQ for PCI card found\n");
10693 - cs->hw.njet.base = pci_resource_start(dev_netjet, 0);
10694 + cs->hw.njet.base = pci_resource_start_io(dev_netjet, 0);
10695 if (!cs->hw.njet.base) {
10696 printk(KERN_WARNING "NETspider-U: No IO-Adr for PCI card found\n");
10698 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/q931.c linux-2.4.29/drivers/isdn/hisax/q931.c
10699 --- linux-2.4.29.old/drivers/isdn/hisax/q931.c 2005-03-22 14:47:56.000000000 +0100
10700 +++ linux-2.4.29/drivers/isdn/hisax/q931.c 2005-03-22 15:06:48.032790688 +0100
10702 -/* $Id: q931.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
10703 +/* $Id: q931.c,v 1.12 2001/09/24 13:22:56 kai Exp $
10705 * code to decode ITU Q.931 call control messages
10707 @@ -197,6 +197,31 @@
10709 #define MT_N1_LEN (sizeof(mt_n1) / sizeof(struct MessageType))
10712 +static struct MessageType fac_1tr6[] =
10714 + {FAC_Sperre, "Sperre"},
10715 + {FAC_Forward1, "Forward 1"},
10716 + {FAC_Forward2, "Forward 2"},
10717 + {FAC_Konferenz, "Konferenz"},
10718 + {FAC_GrabBchan, "Grab Bchannel"},
10719 + {FAC_Reactivate, "Reactivate"},
10720 + {FAC_Konferenz3, "Dreier Konferenz"},
10721 + {FAC_Dienstwechsel1, "Einseitiger Dienstwechsel"},
10722 + {FAC_Dienstwechsel2, "Zweiseitiger Dienstwechsel"},
10723 + {FAC_NummernIdent, "Rufnummer-Identifizierung"},
10724 + {FAC_GBG, "GBG"},
10725 + {FAC_DisplayUebergeben, "Display Uebergeben"},
10726 + {FAC_DisplayUmgeleitet, "Display Umgeleitet"},
10727 + {FAC_Unterdruecke, "Unterdruecke Rufnummer"},
10728 + {FAC_Deactivate, "Deactivate"},
10729 + {FAC_Activate, "Activate"},
10730 + {FAC_SPV, "SPV"},
10731 + {FAC_Rueckwechsel, "Rueckwechsel"},
10732 + {FAC_Umleitung, "Umleitung"}
10734 +#define FAC_1TR6_LEN (sizeof(fac_1tr6) / sizeof(struct MessageType))
10738 prbits(char *dest, u_char b, int start, int len)
10739 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/rawhdlc.c linux-2.4.29/drivers/isdn/hisax/rawhdlc.c
10740 --- linux-2.4.29.old/drivers/isdn/hisax/rawhdlc.c 1970-01-01 01:00:00.000000000 +0100
10741 +++ linux-2.4.29/drivers/isdn/hisax/rawhdlc.c 2005-03-22 15:06:48.047788408 +0100
10743 +/* $Id: rawhdlc.c,v 1.7 2001/09/24 13:22:57 kai Exp $
10745 + * support routines for cards that don't support HDLC
10747 + * Author Brent Baccala
10748 + * Copyright by Karsten Keil <keil@isdn4linux.de>
10749 + * by Brent Baccala <baccala@FreeSoft.org>
10751 + * This software may be used and distributed according to the terms
10752 + * of the GNU General Public License, incorporated herein by reference.
10755 + * Some passive ISDN cards, such as the Traverse NETJet and the AMD 7930,
10756 + * don't perform HDLC encapsulation over the B channel. Drivers for
10757 + * such cards use support routines in this file to perform B channel HDLC.
10759 + * Bit-synchronous HDLC encapsulation is a means of encapsulating packets
10760 + * over a continuously transmitting serial communications link.
10761 + * It looks like this:
10763 + * 11111111101111110...........0111111011111111111
10764 + * iiiiiiiiiffffffffdddddddddddffffffffiiiiiiiiiii
10766 + * i = idle f = flag d = data
10768 + * When idle, the channel sends a continuous string of ones (mark
10769 + * idle; illustrated), or a continuous string of flag characters (flag
10770 + * idle). The beginning of a data frame is marked by a flag character
10771 + * (01111110), then comes the actual data, followed by another flag
10772 + * character, after which another frame may be sent immediately (a
10773 + * single flag may serve as both the end of one frame and the start of
10774 + * the next), or the link may return to idle. Obviously, the flag
10775 + * character can not appear anywhere in the data (or a false
10776 + * end-of-frame would occur), so the transmitter performs
10777 + * "bit-stuffing" - inserting a zero bit after every five one bits,
10778 + * irregardless of the original bit after the five ones. Byte
10779 + * ordering is irrelevent at this point - the data is treated as a
10780 + * string of bits, not bytes. Since no more than 5 ones may now occur
10781 + * in a row, the flag sequence, with its 6 ones, is unique.
10783 + * Upon reception, a zero bit that occur after 5 one bits is simply
10784 + * discarded. A series of 6 one bits is end-of-frame, and a series of
10785 + * 7 one bits is an abort. Once bit-stuffing has been corrected for,
10786 + * an integer number of bytes should now be present. The last two
10787 + * of these bytes form the Frame Check Sequence, a CRC that is verified
10788 + * and then discarded. Note that bit-stuffing is performed on the FCS
10789 + * just as if it were regular data.
10793 + * int make_raw_hdlc_data(u_char *src, u_int slen,
10794 + * u_char *dst, u_int dsize)
10796 + * Used for transmission. Copies slen bytes from src to dst, performing
10797 + * HDLC encapsulation (flag bytes, bit-stuffing, CRC) in the process.
10798 + * dsize is size of destination buffer, and should be at least
10799 + * ((6*slen)/5)+5 bytes to ensure adequate space will be available.
10800 + * Function returns length (in bytes) of valid destination buffer, or
10801 + * 0 upon destination overflow.
10803 + * void init_hdlc_state(struct hdlc_state *stateptr, int mode)
10805 + * Initializes hdlc_state structure before first call to read_raw_hdlc_data
10807 + * mode = 0: Sane mode
10809 + * Insane mode; NETJet use a shared unsigned int memory block (
10810 + * with busmaster DMA), the bit pattern of every word is
10811 + * <8 B1> <8 B2> <8 Mon> <2 D> <4 C/I> <MX> <MR>
10812 + * according to Siemens IOM-2 interface, so we have to handle
10813 + * the src buffer as unsigned int and have to shift/mask the
10814 + * B-channel bytes.
10815 + * mode 1 -> B1 mode 2 -> B2 data is used
10817 + * int read_raw_hdlc_data(struct hdlc_state *saved_state,
10818 + * u_char *src, u_int slen,
10819 + * u_char *dst, u_int dsize)
10821 + * Used for reception. Scans source buffer bit-by-bit looking for
10822 + * valid HDLC frames, which are copied to destination buffer. HDLC
10823 + * state information is stored in a structure, which allows this
10824 + * function to process frames spread across several blocks of raw
10825 + * HDLC data. Part of the state information is bit offsets into
10826 + * the source and destination buffers.
10828 + * A return value >0 indicates the length of a valid frame, now
10829 + * stored in the destination buffer. In this case, the source
10830 + * buffer might not be completely processed, so this function should
10831 + * be called again with the same source buffer, possibly with a
10832 + * different destination buffer.
10834 + * A return value of zero indicates that the source buffer was
10835 + * completely processed without finding a valid end-of-packet;
10836 + * however, we might be in the middle of packet reception, so
10837 + * the function should be called again with the next block of
10838 + * raw HDLC data and the same destination buffer. It is NOT
10839 + * permitted to change the destination buffer in this case,
10840 + * since data may already have begun to be stored there.
10842 + * A return value of -1 indicates some kind of error - destination
10843 + * buffer overflow, CRC check failed, frame not a multiple of 8
10844 + * bits. Destination buffer probably contains invalid data, which
10845 + * should be discarded. Call function again with same source buffer
10846 + * and a new (or same) destination buffer.
10848 + * Suggested calling sequence:
10850 + * init_hdlc_state(...);
10851 + * for (EACH_RAW_DATA_BLOCK) {
10852 + * while (len = read_raw_hdlc_data(...)) {
10853 + * if (len == -1) DISCARD_FRAME;
10854 + * else PROCESS_FRAME;
10859 + * Test the code in this file as follows:
10860 + * gcc -DDEBUGME -o rawhdlctest rawhdlc.c
10861 + * ./rawhdlctest < rawdata
10863 + * The file "rawdata" can be easily generated from a HISAX B-channel
10864 + * hex dump (CF CF CF 02 ...) using the following perl script:
10867 + * @hexlist = split ' ';
10868 + * while ($hexstr = shift(@hexlist)) {
10869 + * printf "%c", hex($hexstr);
10876 +#include <stdio.h>
10879 +#include <linux/types.h>
10880 +#include <linux/ppp_defs.h>
10881 +#include "rawhdlc.h"
10883 +/* There's actually an identical copy of this table in the PPP code
10884 + * (ppp_crc16_table), but I don't want this code dependent on PPP
10888 +__u16 fcstab[256] =
10890 + 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
10891 + 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7,
10892 + 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e,
10893 + 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876,
10894 + 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd,
10895 + 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5,
10896 + 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c,
10897 + 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974,
10898 + 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb,
10899 + 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3,
10900 + 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a,
10901 + 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72,
10902 + 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9,
10903 + 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1,
10904 + 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738,
10905 + 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70,
10906 + 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7,
10907 + 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff,
10908 + 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036,
10909 + 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e,
10910 + 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5,
10911 + 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd,
10912 + 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134,
10913 + 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c,
10914 + 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3,
10915 + 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb,
10916 + 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232,
10917 + 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a,
10918 + 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1,
10919 + 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9,
10920 + 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330,
10921 + 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78
10924 +#define HDLC_ZERO_SEARCH 0
10925 +#define HDLC_FLAG_SEARCH 1
10926 +#define HDLC_FLAG_FOUND 2
10927 +#define HDLC_FRAME_FOUND 3
10928 +#define HDLC_NULL 4
10929 +#define HDLC_PART 5
10930 +#define HDLC_FULL 6
10932 +#define HDLC_FLAG_VALUE 0x7e
10935 +#define MAKE_RAW_BYTE for (j=0; j<8; j++) { \
10940 + out_val |= 0x80;\
10943 + out_val &= 0x7f;\
10945 + if (bitcnt==8) {\
10946 + if (d_cnt == dsize) return 0;\
10947 + dst[d_cnt++] = out_val;\
10950 + if (s_one == 5) {\
10952 + out_val &= 0x7f;\
10956 + if (bitcnt==8) {\
10957 + if (d_cnt == dsize) return 0;\
10958 + dst[d_cnt++] = out_val;\
10964 +/* Optimization suggestion: If needed, this function could be
10965 + * dramatically sped up using a state machine. Each state would
10966 + * correspond to having seen N one bits, and being offset M bits into
10967 + * the current output byte. N ranges from 0 to 4, M from 0 to 7, so
10968 + * we need 5*8 = 35 states. Each state would have a table with 256
10969 + * entries, one for each input character. Each entry would contain
10970 + * three output characters, an output state, an a byte increment
10971 + * that's either 1 or 2. All this could fit in four bytes; so we need
10972 + * 4 bytes * 256 characters = 1 KB for each state (35 KB total). Zero
10973 + * the output buffer before you start. For each character in your
10974 + * input, you look it up in the current state's table and get three
10975 + * bytes to be or'ed into the output at the current byte offset, and
10976 + * an byte increment to move your pointer forward. A simple Perl
10977 + * script could generate the tables. Given HDLC semantics, probably
10978 + * would be better to set output to all 1s, then use ands instead of ors.
10979 + * A smaller state machine could operate on nibbles instead of bytes.
10980 + * A state machine for 32-bit architectures could use word offsets
10981 + * instead of byte offsets, requiring 5*32 = 160 states; probably
10982 + * best to work on nibbles in such a case.
10986 +int make_raw_hdlc_data(u_char *src, u_int slen, u_char *dst, u_int dsize)
10988 + register u_int i,d_cnt=0;
10989 + register u_char j;
10990 + register u_char val;
10991 + register u_char s_one = 0;
10992 + register u_char out_val = 0;
10993 + register u_char bitcnt = 0;
10997 + dst[d_cnt++] = HDLC_FLAG_VALUE;
10998 + fcs = PPP_INITFCS;
10999 + for (i=0; i<slen; i++) {
11001 + fcs = PPP_FCS (fcs, val);
11005 + val = fcs & 0xff;
11007 + val = (fcs>>8) & 0xff;
11009 + val = HDLC_FLAG_VALUE;
11010 + for (j=0; j<8; j++) {
11018 + if (d_cnt == dsize) return 0;
11019 + dst[d_cnt++] = out_val;
11025 + while (8>bitcnt++) {
11029 + if (d_cnt == dsize) return 0;
11030 + dst[d_cnt++] = out_val;
11036 +void init_hdlc_state(struct hdlc_state *stateptr, int mode)
11038 + stateptr->state = HDLC_ZERO_SEARCH;
11039 + stateptr->r_one = 0;
11040 + stateptr->r_val = 0;
11041 + stateptr->o_bitcnt = 0;
11042 + stateptr->i_bitcnt = 0;
11043 + stateptr->insane_mode = mode;
11046 +/* Optimization suggestion: A similar state machine could surely
11047 + * be developed for this function as well.
11050 +int read_raw_hdlc_data(struct hdlc_state *saved_state,
11051 + u_char *src, u_int slen, u_char *dst, u_int dsize)
11054 + register u_char val;
11055 + register u_char state = saved_state->state;
11056 + register u_char r_one = saved_state->r_one;
11057 + register u_char r_val = saved_state->r_val;
11058 + register u_int o_bitcnt = saved_state->o_bitcnt;
11059 + register u_int i_bitcnt = saved_state->i_bitcnt;
11060 + register u_int fcs = saved_state->fcs;
11061 + register u_int *isrc = (u_int *) src;
11063 + /* Use i_bitcnt (bit offset into source buffer) to reload "val"
11064 + * in case we're starting up again partway through a source buffer
11067 + if ((i_bitcnt >> 3) < slen) {
11068 + if (saved_state->insane_mode==1) {
11069 + val = isrc[(i_bitcnt >> 3)] & 0xff;
11070 + } else if (saved_state->insane_mode==2) {
11071 + val = (isrc[i_bitcnt >> 3] >>8) & 0xff;
11073 + val = src[i_bitcnt >> 3];
11075 + val >>= i_bitcnt & 7;
11078 + /* One bit per loop. Keep going until we've got something to
11079 + * report (retval != 0), or we exhaust the source buffer
11082 + while ((retval == 0) && ((i_bitcnt >> 3) < slen)) {
11083 + if ((i_bitcnt & 7) == 0) {
11084 + if (saved_state->insane_mode==1) {
11085 + val = isrc[(i_bitcnt >> 3)] & 0xff;
11086 + } else if (saved_state->insane_mode==2) {
11087 + val = (isrc[i_bitcnt >> 3] >>8) & 0xff;
11089 + val = src[i_bitcnt >> 3];
11092 + printf("Input byte %d: 0x%2x\n", i_bitcnt>>3, val);
11094 + if (val == 0xff) {
11095 + state = HDLC_ZERO_SEARCH;
11104 + /* printf("Data bit=%d (%d/%d)\n", val&1, i_bitcnt>>3, i_bitcnt&7);*/
11107 + if (state == HDLC_ZERO_SEARCH) {
11112 + state= HDLC_FLAG_SEARCH;
11114 + } else if (state == HDLC_FLAG_SEARCH) {
11118 + state=HDLC_ZERO_SEARCH;
11124 + state=HDLC_FLAG_FOUND;
11128 + } else if (state == HDLC_FLAG_FOUND) {
11132 + state=HDLC_ZERO_SEARCH;
11146 + } else if (r_one!=5) {
11153 + if ((state != HDLC_ZERO_SEARCH) &&
11154 + !(o_bitcnt & 7)) {
11156 + printf("HDLC_FRAME_FOUND at i_bitcnt:%d\n",i_bitcnt);
11158 + state=HDLC_FRAME_FOUND;
11159 + fcs = PPP_INITFCS;
11161 + fcs = PPP_FCS (fcs, r_val);
11163 + } else if (state == HDLC_FRAME_FOUND) {
11167 + state=HDLC_ZERO_SEARCH;
11179 + if (o_bitcnt & 7) {
11180 + /* Alignment error */
11182 + printf("Alignment error\n");
11184 + state=HDLC_FLAG_SEARCH;
11186 + } else if (fcs==PPP_GOODFCS) {
11187 + /* Valid frame */
11188 + state=HDLC_FLAG_FOUND;
11189 + retval = (o_bitcnt>>3)-3;
11193 + printf("CRC error; fcs was 0x%x, should have been 0x%x\n", fcs, PPP_GOODFCS);
11195 + state=HDLC_FLAG_FOUND;
11198 + } else if (r_one==5) {
11210 + if ((state == HDLC_FRAME_FOUND) &&
11211 + !(o_bitcnt & 7)) {
11212 + if ((o_bitcnt>>3)>=dsize) {
11213 + /* Buffer overflow error */
11215 + printf("Buffer overflow error\n");
11218 + state=HDLC_FLAG_SEARCH;
11221 + dst[(o_bitcnt>>3)-1] = r_val;
11222 + fcs = PPP_FCS (fcs, r_val);
11224 + printf("Output byte %d: 0x%02x; FCS 0x%04x\n", (o_bitcnt>>3)-1, r_val, fcs);
11233 + /* We exhausted the source buffer before anything else happened
11234 + * (retval==0). Reset i_bitcnt in expectation of a new source
11235 + * buffer. Other, we either had an error or a valid frame, so
11236 + * reset o_bitcnt in expectation of a new destination buffer.
11239 + if (retval == 0) {
11245 + saved_state->state = state;
11246 + saved_state->r_one = r_one;
11247 + saved_state->r_val = r_val;
11248 + saved_state->fcs = fcs;
11249 + saved_state->o_bitcnt = o_bitcnt;
11250 + saved_state->i_bitcnt = i_bitcnt;
11259 +char buffer[1024];
11260 +char obuffer[1024];
11266 + struct hdlc_state hdlc_state;
11268 + while((buffer[buflen] = getc(stdin)) != EOF && buflen<1024) buflen++;
11270 + printf("buflen = %d\n", buflen);
11272 + init_hdlc_state(&hdlc_state, 0);
11274 + while (len = read_raw_hdlc_data(&hdlc_state,buffer,buflen,obuffer,1024)) {
11275 + if (len == -1) printf("Error @ byte %d/bit %d\n",
11276 + hdlc_state.i_bitcnt>>3, hdlc_state.i_bitcnt & 7);
11278 + printf("Frame received: len %d\n", len);
11282 + printf("Done\n");
11286 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/rawhdlc.h linux-2.4.29/drivers/isdn/hisax/rawhdlc.h
11287 --- linux-2.4.29.old/drivers/isdn/hisax/rawhdlc.h 1970-01-01 01:00:00.000000000 +0100
11288 +++ linux-2.4.29/drivers/isdn/hisax/rawhdlc.h 2005-03-22 15:06:48.076784000 +0100
11290 +/* $Id: rawhdlc.h,v 1.5 2001/09/24 13:22:57 kai Exp $
11292 + * Author Brent Baccala
11293 + * Copyright by Brent Baccala <baccala@FreeSoft.org>
11295 + * This software may be used and distributed according to the terms
11296 + * of the GNU General Public License, incorporated herein by reference.
11301 +struct hdlc_state {
11302 + char insane_mode;
11312 +int make_raw_hdlc_data(u_char *src, u_int slen, u_char *dst, u_int dsize);
11313 +void init_hdlc_state(struct hdlc_state *stateptr, int mode);
11314 +int read_raw_hdlc_data(struct hdlc_state *saved_state,
11315 + u_char *src, u_int slen, u_char *dst, u_int dsize);
11318 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/s0box.c linux-2.4.29/drivers/isdn/hisax/s0box.c
11319 --- linux-2.4.29.old/drivers/isdn/hisax/s0box.c 2005-03-22 14:47:56.000000000 +0100
11320 +++ linux-2.4.29/drivers/isdn/hisax/s0box.c 2005-03-22 15:06:48.092781568 +0100
11322 -/* $Id: s0box.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
11323 +/* $Id: s0box.c,v 2.6 2001/09/24 13:22:57 kai Exp $
11325 * low level stuff for Creatix S0BOX
11328 #include "isdnl1.h"
11330 extern const char *CardType[];
11331 -const char *s0box_revision = "$Revision: 1.1.4.1 $";
11332 +const char *s0box_revision = "$Revision: 2.6 $";
11335 writereg(unsigned int padr, signed int addr, u_char off, u_char val) {
11336 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/saphir.c linux-2.4.29/drivers/isdn/hisax/saphir.c
11337 --- linux-2.4.29.old/drivers/isdn/hisax/saphir.c 2005-03-22 14:47:56.000000000 +0100
11338 +++ linux-2.4.29/drivers/isdn/hisax/saphir.c 2005-03-22 15:06:48.107779288 +0100
11340 -/* $Id: saphir.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
11341 +/* $Id: saphir.c,v 1.10 2001/09/24 13:22:57 kai Exp $
11343 * low level stuff for HST Saphir 1
11346 #include "isdnl1.h"
11348 extern const char *CardType[];
11349 -static char *saphir_rev = "$Revision: 1.1.4.1 $";
11350 +static char *saphir_rev = "$Revision: 1.10 $";
11352 #define byteout(addr,val) outb(val,addr)
11353 #define bytein(addr) inb(addr)
11354 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/sedlbauer.c linux-2.4.29/drivers/isdn/hisax/sedlbauer.c
11355 --- linux-2.4.29.old/drivers/isdn/hisax/sedlbauer.c 2005-03-22 14:47:56.000000000 +0100
11356 +++ linux-2.4.29/drivers/isdn/hisax/sedlbauer.c 2005-03-22 15:06:48.123776856 +0100
11358 -/* $Id: sedlbauer.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
11359 +/* $Id: sedlbauer.c,v 1.34 2002/02/09 21:00:57 keil Exp $
11361 * low level stuff for Sedlbauer cards
11362 * includes support for the Sedlbauer speed star (speed star II),
11363 @@ -48,18 +48,19 @@
11365 #include "isdnl1.h"
11366 #include <linux/pci.h>
11367 -#include <linux/isapnp.h>
11368 +#include <linux/isdn_compat.h>
11370 extern const char *CardType[];
11372 -const char *Sedlbauer_revision = "$Revision: 1.1.4.1 $";
11373 +const char *Sedlbauer_revision = "$Revision: 1.34 $";
11375 const char *Sedlbauer_Types[] =
11376 {"None", "speed card/win", "speed star", "speed fax+",
11377 "speed win II / ISDN PC/104", "speed star II", "speed pci",
11378 - "speed fax+ pyramid", "speed fax+ pci"};
11379 + "speed fax+ pyramid", "speed fax+ pci", "HST Saphir III"};
11381 #define PCI_SUBVENDOR_SPEEDFAX_PYRAMID 0x51
11382 +#define PCI_SUBVENDOR_HST_SAPHIR3 0x52
11383 #define PCI_SUBVENDOR_SEDLBAUER_PCI 0x53
11384 #define PCI_SUBVENDOR_SPEEDFAX_PCI 0x54
11385 #define PCI_SUB_ID_SEDLBAUER 0x01
11387 #define SEDL_SPEED_PCI 6
11388 #define SEDL_SPEEDFAX_PYRAMID 7
11389 #define SEDL_SPEEDFAX_PCI 8
11390 +#define HST_SAPHIR3 9
11392 #define SEDL_CHIP_TEST 0
11393 #define SEDL_CHIP_ISAC_HSCX 1
11394 @@ -531,21 +533,6 @@
11396 static struct pci_dev *dev_sedl __devinitdata = NULL;
11399 -static struct isapnp_device_id sedl_ids[] __initdata = {
11400 - { ISAPNP_VENDOR('S', 'A', 'G'), ISAPNP_FUNCTION(0x01),
11401 - ISAPNP_VENDOR('S', 'A', 'G'), ISAPNP_FUNCTION(0x01),
11402 - (unsigned long) "Speed win" },
11403 - { ISAPNP_VENDOR('S', 'A', 'G'), ISAPNP_FUNCTION(0x02),
11404 - ISAPNP_VENDOR('S', 'A', 'G'), ISAPNP_FUNCTION(0x02),
11405 - (unsigned long) "Speed Fax+" },
11409 -static struct isapnp_device_id *pdev = &sedl_ids[0];
11410 -static struct pci_bus *pnp_c __devinitdata = NULL;
11414 setup_sedlbauer(struct IsdnCard *card)
11416 @@ -581,57 +568,6 @@
11421 - if (isapnp_present()) {
11422 - struct pci_bus *pb;
11423 - struct pci_dev *pd;
11425 - while(pdev->card_vendor) {
11426 - if ((pb = isapnp_find_card(pdev->card_vendor,
11427 - pdev->card_device, pnp_c))) {
11430 - if ((pd = isapnp_find_dev(pnp_c,
11431 - pdev->vendor, pdev->function, pd))) {
11432 - printk(KERN_INFO "HiSax: %s detected\n",
11433 - (char *)pdev->driver_data);
11435 - pd->deactivate(pd);
11436 - pd->activate(pd);
11438 - pd->resource[0].start;
11440 - pd->irq_resource[0].start;
11441 - if (!card->para[0] || !card->para[1]) {
11442 - printk(KERN_ERR "Sedlbauer PnP:some resources are missing %ld/%lx\n",
11443 - card->para[0], card->para[1]);
11444 - pd->deactivate(pd);
11447 - cs->hw.sedl.cfg_reg = card->para[1];
11448 - cs->irq = card->para[0];
11449 - if (pdev->function == ISAPNP_FUNCTION(0x2)) {
11450 - cs->subtyp = SEDL_SPEED_FAX;
11451 - cs->hw.sedl.chip = SEDL_CHIP_ISAC_ISAR;
11454 - cs->subtyp = SEDL_SPEED_CARD_WIN;
11455 - cs->hw.sedl.chip = SEDL_CHIP_TEST;
11459 - printk(KERN_ERR "Sedlbauer PnP: PnP error card found, no device\n");
11466 - if (!pdev->card_vendor) {
11467 - printk(KERN_INFO "Sedlbauer PnP: no ISAPnP card found\n");
11471 /* Probe for Sedlbauer speed pci */
11473 if (!pci_present()) {
11474 @@ -647,15 +583,15 @@
11475 printk(KERN_WARNING "Sedlbauer: No IRQ for PCI card found\n");
11478 - cs->hw.sedl.cfg_reg = pci_resource_start(dev_sedl, 0);
11479 + cs->hw.sedl.cfg_reg = pci_resource_start_io(dev_sedl, 0);
11481 printk(KERN_WARNING "Sedlbauer: No PCI card found\n");
11484 cs->irq_flags |= SA_SHIRQ;
11485 cs->hw.sedl.bus = SEDL_BUS_PCI;
11486 - sub_vendor_id = dev_sedl->subsystem_vendor;
11487 - sub_id = dev_sedl->subsystem_device;
11488 + pci_get_sub_vendor(dev_sedl,sub_vendor_id);
11489 + pci_get_sub_system(dev_sedl,sub_id);
11490 printk(KERN_INFO "Sedlbauer: PCI subvendor:%x subid %x\n",
11491 sub_vendor_id, sub_id);
11492 printk(KERN_INFO "Sedlbauer: PCI base adr %#x\n",
11493 @@ -670,6 +606,9 @@
11494 } else if (sub_vendor_id == PCI_SUBVENDOR_SPEEDFAX_PCI) {
11495 cs->hw.sedl.chip = SEDL_CHIP_ISAC_ISAR;
11496 cs->subtyp = SEDL_SPEEDFAX_PCI;
11497 + } else if (sub_vendor_id == PCI_SUBVENDOR_HST_SAPHIR3) {
11498 + cs->hw.sedl.chip = SEDL_CHIP_IPAC;
11499 + cs->subtyp = HST_SAPHIR3;
11500 } else if (sub_vendor_id == PCI_SUBVENDOR_SEDLBAUER_PCI) {
11501 cs->hw.sedl.chip = SEDL_CHIP_IPAC;
11502 cs->subtyp = SEDL_SPEED_PCI;
11503 @@ -683,8 +622,8 @@
11504 cs->hw.sedl.reset_off = SEDL_ISAR_PCI_ISAR_RESET_OFF;
11505 byteout(cs->hw.sedl.cfg_reg, 0xff);
11506 byteout(cs->hw.sedl.cfg_reg, 0x00);
11507 - byteout(cs->hw.sedl.cfg_reg+ 2, 0xdd);
11508 - byteout(cs->hw.sedl.cfg_reg+ 5, 0x02);
11509 + byteout(cs->hw.sedl.cfg_reg +2, 0xdd);
11510 + byteout(cs->hw.sedl.cfg_reg +5, 0x02);
11511 byteout(cs->hw.sedl.cfg_reg +3, cs->hw.sedl.reset_on);
11514 @@ -697,7 +636,7 @@
11516 #endif /* CONFIG_PCI */
11520 /* In case of the sedlbauer pcmcia card, this region is in use,
11521 * reserved for us by the card manager. So we do not check it
11522 * here, it would fail.
11523 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/sportster.c linux-2.4.29/drivers/isdn/hisax/sportster.c
11524 --- linux-2.4.29.old/drivers/isdn/hisax/sportster.c 2005-03-22 14:47:56.000000000 +0100
11525 +++ linux-2.4.29/drivers/isdn/hisax/sportster.c 2005-03-22 15:06:48.169769864 +0100
11527 -/* $Id: sportster.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
11528 +/* $Id: sportster.c,v 1.16 2001/09/24 13:22:57 kai Exp $
11530 * low level stuff for USR Sportster internal TA
11533 #include "isdnl1.h"
11535 extern const char *CardType[];
11536 -const char *sportster_revision = "$Revision: 1.1.4.1 $";
11537 +const char *sportster_revision = "$Revision: 1.16 $";
11539 #define byteout(addr,val) outb(val,addr)
11540 #define bytein(addr) inb(addr)
11541 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/st5481-debug.h linux-2.4.29/drivers/isdn/hisax/st5481-debug.h
11542 --- linux-2.4.29.old/drivers/isdn/hisax/st5481-debug.h 1970-01-01 01:00:00.000000000 +0100
11543 +++ linux-2.4.29/drivers/isdn/hisax/st5481-debug.h 2005-03-22 15:06:48.184767584 +0100
11545 +#define ST5481_DEBUG 0x0
11551 + DEBUG flags. Set compile option ST5481_DEBUG with the following bits set to trace
11552 + the given subsections:
11558 + 0x10: PACKET_DUMP D out
11559 + 0x20: ISO_DUMP D out
11560 + 0x40: PACKET_DUMP D in
11561 + 0x80: ISO_DUMP in
11562 + 0x100: PACKET_DUMP B out
11563 + 0x200: ISO_DUMP B out
11564 + 0x400: PACKET_DUMP B in
11567 +#define DBG(level, format, arg...) \
11568 +if (level & ST5481_DEBUG) \
11569 +printk(KERN_DEBUG __FUNCTION__ ": " format "\n" , ## arg) \
11571 +static inline void
11572 +dump_packet(const char *name,const u_char *data,int pkt_len)
11574 +#define DUMP_HDR_SIZE 200
11575 +#define DUMP_TLR_SIZE 8
11579 + printk(KERN_DEBUG "%s: length=%d,data=",name,pkt_len);
11581 + if (pkt_len > DUMP_HDR_SIZE+ DUMP_TLR_SIZE) {
11582 + len1 = DUMP_HDR_SIZE;
11583 + len2 = DUMP_TLR_SIZE;
11585 + len1 = pkt_len > DUMP_HDR_SIZE ? DUMP_HDR_SIZE : pkt_len;
11588 + for (i = 0; i < len1; ++i) {
11589 + printk ("%.2x", data[i]);
11593 + for (i = pkt_len-DUMP_TLR_SIZE; i < pkt_len; ++i) {
11594 + printk ("%.2x", data[i]);
11599 +#undef DUMP_HDR_SIZE
11600 +#undef DUMP_TLR_SIZE
11603 +static inline void
11604 +dump_iso_packet(const char *name,urb_t *urb)
11610 + printk(KERN_DEBUG "%s: packets=%d,errors=%d\n",
11611 + name,urb->number_of_packets,urb->error_count);
11612 + for (i = 0; i < urb->number_of_packets; ++i) {
11613 + if (urb->pipe & USB_DIR_IN) {
11614 + len = urb->iso_frame_desc[i].actual_length;
11616 + len = urb->iso_frame_desc[i].length;
11618 + ofs = urb->iso_frame_desc[i].offset;
11619 + printk(KERN_DEBUG "len=%.2d,ofs=%.3d ",len,ofs);
11621 + data = urb->transfer_buffer+ofs;
11622 + for (j=0; j < len; j++) {
11623 + printk ("%.2x", data[j]);
11630 +#define DUMP_PACKET(level,data,count) \
11631 + if (level & ST5481_DEBUG) dump_packet(__FUNCTION__,data,count)
11632 +#define DUMP_SKB(level,skb) \
11633 + if ((level & ST5481_DEBUG) && skb) dump_packet(__FUNCTION__,skb->data,skb->len)
11634 +#define DUMP_ISO_PACKET(level,urb) \
11635 + if (level & ST5481_DEBUG) dump_iso_packet(__FUNCTION__,urb)
11639 +#define DBG(level,format, arg...) do {} while (0)
11640 +#define DUMP_PACKET(level,data,count) do {} while (0)
11641 +#define DUMP_SKB(level,skb) do {} while (0)
11642 +#define DUMP_ISO_PACKET(level,urb) do {} while (0)
11648 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/st5481.h linux-2.4.29/drivers/isdn/hisax/st5481.h
11649 --- linux-2.4.29.old/drivers/isdn/hisax/st5481.h 2005-03-22 14:47:56.000000000 +0100
11650 +++ linux-2.4.29/drivers/isdn/hisax/st5481.h 2005-03-22 15:06:48.201765000 +0100
11651 @@ -219,15 +219,15 @@
11652 #define L1_EVENT_COUNT (EV_TIMER3 + 1)
11654 #define ERR(format, arg...) \
11655 -printk(KERN_ERR "%s:%s: " format "\n" , __FILE__, __FUNCTION__ , ## arg)
11656 +printk(KERN_ERR __FILE__ ": " __FUNCTION__ ": " format "\n" , ## arg)
11658 #define WARN(format, arg...) \
11659 -printk(KERN_WARNING "%s:%s: " format "\n" , __FILE__, __FUNCTION__ , ## arg)
11660 +printk(KERN_WARNING __FILE__ ": " __FUNCTION__ ": " format "\n" , ## arg)
11662 #define INFO(format, arg...) \
11663 -printk(KERN_INFO "%s:%s: " format "\n" , __FILE__, __FUNCTION__ , ## arg)
11664 +printk(KERN_INFO __FILE__ ": " __FUNCTION__ ": " format "\n" , ## arg)
11666 -#include "isdnhdlc.h"
11667 +#include "st5481_hdlc.h"
11669 #include "hisax_if.h"
11670 #include <linux/skbuff.h>
11671 @@ -236,7 +236,7 @@
11675 -/* Generic FIFO structure */
11676 +/* Generic FIFO structure */
11678 u_char r,w,count,size;
11680 @@ -270,7 +270,7 @@
11683 // Return index where to get the next data to add to the FIFO
11684 - index = fifo->w++ & (fifo->size-1);
11685 + index = fifo->w++ & (fifo->size-1);
11688 spin_unlock_irqrestore(&fifo->lock, flags);
11689 @@ -289,13 +289,13 @@
11693 - spin_lock_irqsave(&fifo->lock, flags);
11694 + spin_lock_irqsave(&fifo->lock, flags);
11695 if (!fifo->count) {
11699 // Return index where to get the next data from the FIFO
11700 - index = fifo->r++ & (fifo->size-1);
11701 + index = fifo->r++ & (fifo->size-1);
11704 spin_unlock_irqrestore(&fifo->lock, flags);
11705 @@ -309,7 +309,7 @@
11706 typedef void (*ctrl_complete_t)(void *);
11708 typedef struct ctrl_msg {
11709 - struct usb_ctrlrequest dr;
11711 ctrl_complete_t complete;
11714 @@ -336,7 +336,7 @@
11717 struct st5481_d_out {
11718 - struct isdnhdlc_vars hdlc_state;
11719 + struct hdlc_vars hdlc_state;
11720 struct urb *urb[2]; /* double buffering */
11721 unsigned long busy;
11722 struct sk_buff *tx_skb;
11723 @@ -344,7 +344,7 @@
11726 struct st5481_b_out {
11727 - struct isdnhdlc_vars hdlc_state;
11728 + struct hdlc_vars hdlc_state;
11729 struct urb *urb[2]; /* double buffering */
11732 @@ -352,7 +352,7 @@
11736 - struct isdnhdlc_vars hdlc_state;
11737 + struct hdlc_vars hdlc_state;
11738 struct urb *urb[2]; /* double buffering */
11741 @@ -478,7 +478,7 @@
11742 if (level & __debug_variable) dump_iso_packet(__FUNCTION__,urb)
11744 static void __attribute__((unused))
11745 -dump_iso_packet(const char *name,struct urb *urb)
11746 +dump_iso_packet(const char *name,urb_t *urb)
11750 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/st5481_b.c linux-2.4.29/drivers/isdn/hisax/st5481_b.c
11751 --- linux-2.4.29.old/drivers/isdn/hisax/st5481_b.c 2005-03-22 14:47:56.000000000 +0100
11752 +++ linux-2.4.29/drivers/isdn/hisax/st5481_b.c 2005-03-22 15:06:48.216762720 +0100
11753 @@ -67,28 +67,24 @@
11754 bytes_sent = buf_size - len;
11755 if (skb->len < bytes_sent)
11756 bytes_sent = skb->len;
11757 - { /* swap tx bytes to get hearable audio data */
11758 - register unsigned char *src = skb->data;
11759 - register unsigned char *dest = urb->transfer_buffer+len;
11760 - register unsigned int count;
11761 - for (count = 0; count < bytes_sent; count++)
11762 - *dest++ = isdnhdlc_bit_rev_tab[*src++];
11765 + memcpy(urb->transfer_buffer+len, skb->data, bytes_sent);
11769 - len += isdnhdlc_encode(&b_out->hdlc_state,
11770 - skb->data, skb->len, &bytes_sent,
11771 - urb->transfer_buffer+len, buf_size-len);
11772 + len += hdlc_encode(&b_out->hdlc_state,
11773 + skb->data, skb->len, &bytes_sent,
11774 + urb->transfer_buffer+len, buf_size-len);
11777 skb_pull(skb, bytes_sent);
11782 b_out->tx_skb = NULL;
11783 B_L1L2(bcs, PH_DATA | CONFIRM, (void *) skb->truesize);
11784 dev_kfree_skb_any(skb);
11787 /* if (!(bcs->tx_skb = skb_dequeue(&bcs->sq))) { */
11788 /* st5481B_sched_event(bcs, B_XMTBUFREADY); */
11794 - len += isdnhdlc_encode(&b_out->hdlc_state,
11795 - NULL, 0, &bytes_sent,
11796 - urb->transfer_buffer+len, buf_size-len);
11797 + len += hdlc_encode(&b_out->hdlc_state,
11798 + NULL, 0, &bytes_sent,
11799 + urb->transfer_buffer+len, buf_size-len);
11803 @@ -213,7 +209,7 @@
11804 if (bcs->mode != L1_MODE_NULL) {
11805 // Open the B channel
11806 if (bcs->mode != L1_MODE_TRANS) {
11807 - isdnhdlc_out_init(&b_out->hdlc_state, 0, bcs->mode == L1_MODE_HDLC_56K);
11808 + hdlc_out_init(&b_out->hdlc_state, 0, bcs->mode == L1_MODE_HDLC_56K);
11810 st5481_usb_pipe_reset(adapter, (bcs->channel+1)*2, NULL, NULL);
11812 @@ -279,7 +275,7 @@
11813 usb_b_out_complete, bcs);
11816 -static void st5481_release_b_out(struct st5481_bcs *bcs)
11817 +static void __devexit st5481_release_b_out(struct st5481_bcs *bcs)
11819 struct st5481_b_out *b_out = &bcs->b_out;
11821 @@ -320,7 +316,7 @@
11823 * Release buffers and URBs for the B channels
11825 -void st5481_release_b(struct st5481_bcs *bcs)
11826 +void __devexit st5481_release_b(struct st5481_bcs *bcs)
11830 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/st5481_d.c linux-2.4.29/drivers/isdn/hisax/st5481_d.c
11831 --- linux-2.4.29.old/drivers/isdn/hisax/st5481_d.c 2005-03-22 14:47:56.000000000 +0100
11832 +++ linux-2.4.29/drivers/isdn/hisax/st5481_d.c 2005-03-22 15:06:48.231760440 +0100
11833 @@ -162,8 +162,8 @@
11834 {ST_L1_F8, EV_TIMER3, l1_timer3},
11835 {ST_L1_F8, EV_IND_DP, l1_go_f3},
11836 {ST_L1_F8, EV_IND_AP, l1_go_f6},
11837 - {ST_L1_F8, EV_IND_AI8, l1_go_f7},
11838 - {ST_L1_F8, EV_IND_AI10, l1_go_f7},
11839 + {ST_L1_F8, EV_IND_AI8, l1_go_f8},
11840 + {ST_L1_F8, EV_IND_AI10, l1_go_f8},
11841 {ST_L1_F8, EV_IND_RSY, l1_ignore},
11844 @@ -297,7 +297,7 @@
11845 unsigned int num_packets, packet_offset;
11846 int len, buf_size, bytes_sent;
11847 struct sk_buff *skb;
11848 - struct iso_packet_descriptor *desc;
11849 + iso_packet_descriptor_t *desc;
11851 if (d_out->fsm.state != ST_DOUT_NORMAL)
11853 @@ -313,15 +313,15 @@
11854 buf_size = NUM_ISO_PACKETS_D * SIZE_ISO_PACKETS_D_OUT;
11857 - len = isdnhdlc_encode(&d_out->hdlc_state,
11858 - skb->data, skb->len, &bytes_sent,
11859 - urb->transfer_buffer, buf_size);
11860 + len = hdlc_encode(&d_out->hdlc_state,
11861 + skb->data, skb->len, &bytes_sent,
11862 + urb->transfer_buffer, buf_size);
11863 skb_pull(skb,bytes_sent);
11865 // Send flags or idle
11866 - len = isdnhdlc_encode(&d_out->hdlc_state,
11867 - NULL, 0, &bytes_sent,
11868 - urb->transfer_buffer, buf_size);
11869 + len = hdlc_encode(&d_out->hdlc_state,
11870 + NULL, 0, &bytes_sent,
11871 + urb->transfer_buffer, buf_size);
11874 if (len < buf_size) {
11875 @@ -413,7 +413,7 @@
11877 DBG(2,"len=%d",skb->len);
11879 - isdnhdlc_out_init(&d_out->hdlc_state, 1, 0);
11880 + hdlc_out_init(&d_out->hdlc_state, 1, 0);
11882 if (test_and_set_bit(buf_nr, &d_out->busy)) {
11883 WARN("ep %d urb %d busy %#lx", EP_D_OUT, buf_nr, d_out->busy);
11884 @@ -422,9 +422,9 @@
11885 urb = d_out->urb[buf_nr];
11887 DBG_SKB(0x10, skb);
11888 - len = isdnhdlc_encode(&d_out->hdlc_state,
11889 - skb->data, skb->len, &bytes_sent,
11890 - urb->transfer_buffer, 16);
11891 + len = hdlc_encode(&d_out->hdlc_state,
11892 + skb->data, skb->len, &bytes_sent,
11893 + urb->transfer_buffer, 16);
11894 skb_pull(skb, bytes_sent);
11897 @@ -673,7 +673,7 @@
11898 usb_d_out_complete, adapter);
11901 -static void st5481_release_d_out(struct st5481_adapter *adapter)
11902 +static void __devexit st5481_release_d_out(struct st5481_adapter *adapter)
11904 struct st5481_d_out *d_out = &adapter->d_out;
11906 @@ -723,7 +723,7 @@
11910 -void st5481_release_d(struct st5481_adapter *adapter)
11911 +void __devexit st5481_release_d(struct st5481_adapter *adapter)
11915 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/st5481_init.c linux-2.4.29/drivers/isdn/hisax/st5481_init.c
11916 --- linux-2.4.29.old/drivers/isdn/hisax/st5481_init.c 2005-03-22 14:47:56.000000000 +0100
11917 +++ linux-2.4.29/drivers/isdn/hisax/st5481_init.c 2005-03-22 15:06:48.268754816 +0100
11923 * hotplug / unregister issues
11924 * mod_inc/dec_use_count
11925 * unify parts of d/b channel usb handling
11926 @@ -177,7 +178,7 @@
11927 static struct usb_driver st5481_usb_driver = {
11928 name: "st5481_usb",
11929 probe: probe_st5481,
11930 - disconnect: __devexit_p(disconnect_st5481),
11931 + disconnect: disconnect_st5481,
11932 id_table: st5481_ids,
11935 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/st5481_usb.c linux-2.4.29/drivers/isdn/hisax/st5481_usb.c
11936 --- linux-2.4.29.old/drivers/isdn/hisax/st5481_usb.c 2005-03-22 14:47:56.000000000 +0100
11937 +++ linux-2.4.29/drivers/isdn/hisax/st5481_usb.c 2005-03-22 15:06:48.284752384 +0100
11939 (unsigned char *)&ctrl->msg_fifo.data[r_index];
11941 DBG(1,"request=0x%02x,value=0x%04x,index=%x",
11942 - ((struct ctrl_msg *)urb->setup_packet)->dr.bRequest,
11943 - ((struct ctrl_msg *)urb->setup_packet)->dr.wValue,
11944 - ((struct ctrl_msg *)urb->setup_packet)->dr.wIndex);
11945 + ((struct ctrl_msg *)urb->setup_packet)->dr.request,
11946 + ((struct ctrl_msg *)urb->setup_packet)->dr.value,
11947 + ((struct ctrl_msg *)urb->setup_packet)->dr.index);
11950 urb->dev = adapter->usb_dev;
11951 @@ -69,11 +69,11 @@
11953 ctrl_msg = &ctrl->msg_fifo.data[w_index];
11955 - ctrl_msg->dr.bRequestType = requesttype;
11956 - ctrl_msg->dr.bRequest = request;
11957 - ctrl_msg->dr.wValue = cpu_to_le16p(&value);
11958 - ctrl_msg->dr.wIndex = cpu_to_le16p(&index);
11959 - ctrl_msg->dr.wLength = 0;
11960 + ctrl_msg->dr.requesttype = requesttype;
11961 + ctrl_msg->dr.request = request;
11962 + ctrl_msg->dr.value = cpu_to_le16p(&value);
11963 + ctrl_msg->dr.index = cpu_to_le16p(&index);
11964 + ctrl_msg->dr.length = 0;
11965 ctrl_msg->complete = complete;
11966 ctrl_msg->context = context;
11968 @@ -140,17 +140,17 @@
11970 ctrl_msg = (struct ctrl_msg *)urb->setup_packet;
11972 - if (ctrl_msg->dr.bRequest == USB_REQ_CLEAR_FEATURE) {
11973 + if (ctrl_msg->dr.request == USB_REQ_CLEAR_FEATURE) {
11974 /* Special case handling for pipe reset */
11975 - le16_to_cpus(&ctrl_msg->dr.wIndex);
11976 + le16_to_cpus(&ctrl_msg->dr.index);
11977 usb_endpoint_running(adapter->usb_dev,
11978 - ctrl_msg->dr.wIndex & ~USB_DIR_IN,
11979 - (ctrl_msg->dr.wIndex & USB_DIR_IN) == 0);
11980 + ctrl_msg->dr.index & ~USB_DIR_IN,
11981 + (ctrl_msg->dr.index & USB_DIR_IN) == 0);
11983 /* toggle is reset on clear */
11984 usb_settoggle(adapter->usb_dev,
11985 - ctrl_msg->dr.wIndex & ~USB_DIR_IN,
11986 - (ctrl_msg->dr.wIndex & USB_DIR_IN) == 0,
11987 + ctrl_msg->dr.index & ~USB_DIR_IN,
11988 + (ctrl_msg->dr.index & USB_DIR_IN) == 0,
11992 @@ -235,7 +235,7 @@
11993 struct usb_interface_descriptor *altsetting;
11994 struct usb_endpoint_descriptor *endpoint;
12001 @@ -307,7 +307,7 @@
12002 * Release buffers and URBs for the interrupt and control
12005 -void st5481_release_usb(struct st5481_adapter *adapter)
12006 +void __devexit st5481_release_usb(struct st5481_adapter *adapter)
12008 struct st5481_intr *intr = &adapter->intr;
12009 struct st5481_ctrl *ctrl = &adapter->ctrl;
12010 @@ -443,7 +443,7 @@
12014 -void st5481_release_isocpipes(struct urb* urb[2])
12015 +void __devexit st5481_release_isocpipes(struct urb* urb[2])
12019 @@ -484,18 +484,16 @@
12020 ptr = urb->transfer_buffer;
12022 if (in->mode == L1_MODE_TRANS) {
12023 - /* swap rx bytes to get hearable audio */
12024 - register unsigned char *dest = in->rcvbuf;
12025 + memcpy(in->rcvbuf, ptr, len);
12027 - for (; len; len--)
12028 - *dest++ = isdnhdlc_bit_rev_tab[*ptr++];
12031 - status = isdnhdlc_decode(&in->hdlc_state, ptr, len, &count,
12032 - in->rcvbuf, in->bufsize);
12033 + status = hdlc_decode(&in->hdlc_state, ptr, len, &count,
12034 + in->rcvbuf, in->bufsize);
12041 // Good frame received
12042 DBG(4,"count=%d",status);
12043 @@ -549,7 +547,7 @@
12047 -void st5481_release_in(struct st5481_in *in)
12048 +void __devexit st5481_release_in(struct st5481_in *in)
12052 @@ -562,8 +560,7 @@
12054 int st5481_isoc_flatten(struct urb *urb)
12056 - struct iso_packet_descriptor *pipd;
12057 - struct iso_packet_descriptor *pend;
12058 + piso_packet_descriptor_t pipd,pend;
12059 unsigned char *src,*dst;
12062 @@ -624,10 +621,15 @@
12064 if (in->mode != L1_MODE_NULL) {
12065 if (in->mode != L1_MODE_TRANS)
12066 - isdnhdlc_rcv_init(&in->hdlc_state,
12067 - in->mode == L1_MODE_HDLC_56K);
12068 + hdlc_rcv_init(&in->hdlc_state,
12069 + in->mode == L1_MODE_HDLC_56K);
12071 st5481_usb_pipe_reset(in->adapter, in->ep, NULL, NULL);
12073 + st5481_usb_device_ctrl_msg(in->adapter, in->counter,
12075 + st5481_start_rcv, in);
12077 st5481_usb_device_ctrl_msg(in->adapter, in->counter,
12080 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/tei.c linux-2.4.29/drivers/isdn/hisax/tei.c
12081 --- linux-2.4.29.old/drivers/isdn/hisax/tei.c 2005-03-22 14:47:56.000000000 +0100
12082 +++ linux-2.4.29/drivers/isdn/hisax/tei.c 2005-03-22 15:06:48.316747520 +0100
12084 -/* $Id: tei.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
12085 +/* $Id: tei.c,v 2.20 2001/09/24 13:22:57 kai Exp $
12087 * Author Karsten Keil
12088 * based on the teles driver from Jan den Ouden
12090 #include <linux/init.h>
12091 #include <linux/random.h>
12093 -const char *tei_revision = "$Revision: 1.1.4.1 $";
12094 +const char *tei_revision = "$Revision: 2.20 $";
12096 #define ID_REQUEST 1
12097 #define ID_ASSIGNED 2
12098 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/teleint.c linux-2.4.29/drivers/isdn/hisax/teleint.c
12099 --- linux-2.4.29.old/drivers/isdn/hisax/teleint.c 2005-03-22 14:47:56.000000000 +0100
12100 +++ linux-2.4.29/drivers/isdn/hisax/teleint.c 2005-03-22 15:06:48.330745392 +0100
12102 -/* $Id: teleint.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
12103 +/* $Id: teleint.c,v 1.16 2001/09/24 13:22:57 kai Exp $
12105 * low level stuff for TeleInt isdn cards
12109 extern const char *CardType[];
12111 -const char *TeleInt_revision = "$Revision: 1.1.4.1 $";
12112 +const char *TeleInt_revision = "$Revision: 1.16 $";
12114 #define byteout(addr,val) outb(val,addr)
12115 #define bytein(addr) inb(addr)
12116 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/teles0.c linux-2.4.29/drivers/isdn/hisax/teles0.c
12117 --- linux-2.4.29.old/drivers/isdn/hisax/teles0.c 2005-03-22 14:47:56.000000000 +0100
12118 +++ linux-2.4.29/drivers/isdn/hisax/teles0.c 2005-03-22 15:06:48.348742656 +0100
12120 -/* $Id: teles0.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
12121 +/* $Id: teles0.c,v 2.15 2001/09/24 13:22:57 kai Exp $
12123 * low level stuff for Teles Memory IO isdn cards
12127 extern const char *CardType[];
12129 -const char *teles0_revision = "$Revision: 1.1.4.1 $";
12130 +const char *teles0_revision = "$Revision: 2.15 $";
12132 #define TELES_IOMEM_SIZE 0x400
12133 #define byteout(addr,val) outb(val,addr)
12134 @@ -189,8 +189,10 @@
12136 if (cs->hw.teles0.cfg_reg)
12137 release_region(cs->hw.teles0.cfg_reg, 8);
12138 +#ifdef COMPAT_HAS_ISA_IOREMAP
12139 iounmap((unsigned char *)cs->hw.teles0.membase);
12140 release_mem_region(cs->hw.teles0.phymem, TELES_IOMEM_SIZE);
12145 @@ -327,6 +329,7 @@
12146 /* 16.0 and 8.0 designed for IOM1 */
12147 test_and_set_bit(HW_IOM1, &cs->HW_Flags);
12148 cs->hw.teles0.phymem = card->para[1];
12149 +#ifdef COMPAT_HAS_ISA_IOREMAP
12150 if (check_mem_region(cs->hw.teles0.phymem, TELES_IOMEM_SIZE)) {
12151 printk(KERN_WARNING
12152 "HiSax: %s memory region %lx-%lx already in use\n",
12153 @@ -342,6 +345,9 @@
12155 cs->hw.teles0.membase =
12156 (unsigned long) ioremap(cs->hw.teles0.phymem, TELES_IOMEM_SIZE);
12158 + cs->hw.teles0.membase = cs->hw.teles0.phymem;
12161 "HiSax: %s config irq:%d mem:0x%lX cfg:0x%X\n",
12162 CardType[cs->typ], cs->irq,
12163 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/teles3.c linux-2.4.29/drivers/isdn/hisax/teles3.c
12164 --- linux-2.4.29.old/drivers/isdn/hisax/teles3.c 2005-03-22 14:47:56.000000000 +0100
12165 +++ linux-2.4.29/drivers/isdn/hisax/teles3.c 2005-03-22 15:06:48.367739768 +0100
12167 -/* $Id: teles3.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
12168 +/* $Id: teles3.c,v 2.19 2001/09/24 13:22:57 kai Exp $
12170 * low level stuff for Teles 16.3 & PNP isdn cards
12172 @@ -15,14 +15,13 @@
12174 #define __NO_VERSION__
12175 #include <linux/init.h>
12176 -#include <linux/isapnp.h>
12180 #include "isdnl1.h"
12182 extern const char *CardType[];
12183 -const char *teles3_revision = "$Revision: 1.1.4.1 $";
12184 +const char *teles3_revision = "$Revision: 2.19 $";
12186 #define byteout(addr,val) outb(val,addr)
12187 #define bytein(addr) inb(addr)
12188 @@ -255,24 +254,6 @@
12193 -static struct isapnp_device_id teles_ids[] __initdata = {
12194 - { ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2110),
12195 - ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2110),
12196 - (unsigned long) "Teles 16.3 PnP" },
12197 - { ISAPNP_VENDOR('C', 'T', 'X'), ISAPNP_FUNCTION(0x0),
12198 - ISAPNP_VENDOR('C', 'T', 'X'), ISAPNP_FUNCTION(0x0),
12199 - (unsigned long) "Creatix 16.3 PnP" },
12200 - { ISAPNP_VENDOR('C', 'P', 'Q'), ISAPNP_FUNCTION(0x1002),
12201 - ISAPNP_VENDOR('C', 'P', 'Q'), ISAPNP_FUNCTION(0x1002),
12202 - (unsigned long) "Compaq ISDN S0" },
12206 -static struct isapnp_device_id *tdev = &teles_ids[0];
12207 -static struct pci_bus *pnp_c __devinitdata = NULL;
12211 setup_teles3(struct IsdnCard *card)
12213 @@ -286,47 +267,6 @@
12214 && (cs->typ != ISDN_CTYPE_TELESPCMCIA) && (cs->typ != ISDN_CTYPE_COMPAQ_ISA))
12218 - if (!card->para[1] && isapnp_present()) {
12219 - struct pci_bus *pb;
12220 - struct pci_dev *pd;
12222 - while(tdev->card_vendor) {
12223 - if ((pb = isapnp_find_card(tdev->card_vendor,
12224 - tdev->card_device, pnp_c))) {
12227 - if ((pd = isapnp_find_dev(pnp_c,
12228 - tdev->vendor, tdev->function, pd))) {
12229 - printk(KERN_INFO "HiSax: %s detected\n",
12230 - (char *)tdev->driver_data);
12232 - pd->deactivate(pd);
12233 - pd->activate(pd);
12234 - card->para[3] = pd->resource[2].start;
12235 - card->para[2] = pd->resource[1].start;
12236 - card->para[1] = pd->resource[0].start;
12237 - card->para[0] = pd->irq_resource[0].start;
12238 - if (!card->para[0] || !card->para[1] || !card->para[2]) {
12239 - printk(KERN_ERR "Teles PnP:some resources are missing %ld/%lx/%lx\n",
12240 - card->para[0], card->para[1], card->para[2]);
12241 - pd->deactivate(pd);
12246 - printk(KERN_ERR "Teles PnP: PnP error card found, no device\n");
12252 - if (!tdev->card_vendor) {
12253 - printk(KERN_INFO "Teles PnP: no ISAPnP card found\n");
12258 if (cs->typ == ISDN_CTYPE_16_3) {
12259 cs->hw.teles3.cfg_reg = card->para[1];
12260 switch (cs->hw.teles3.cfg_reg) {
12261 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/telespci.c linux-2.4.29/drivers/isdn/hisax/telespci.c
12262 --- linux-2.4.29.old/drivers/isdn/hisax/telespci.c 2005-03-22 14:47:56.000000000 +0100
12263 +++ linux-2.4.29/drivers/isdn/hisax/telespci.c 2005-03-22 15:06:48.382737488 +0100
12265 -/* $Id: telespci.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
12266 +/* $Id: telespci.c,v 2.23 2001/09/24 13:22:57 kai Exp $
12268 * low level stuff for Teles PCI isdn cards
12272 #include "isdnl1.h"
12273 #include <linux/pci.h>
12274 +#include <linux/isdn_compat.h>
12276 extern const char *CardType[];
12277 -const char *telespci_revision = "$Revision: 1.1.4.1 $";
12278 +const char *telespci_revision = "$Revision: 2.23 $";
12280 #define ZORAN_PO_RQ_PEN 0x02000000
12281 #define ZORAN_PO_WR 0x00800000
12282 @@ -307,10 +308,10 @@
12283 printk(KERN_WARNING "Teles: No IRQ for PCI card found\n");
12286 - cs->hw.teles0.membase = (u_long) ioremap(pci_resource_start(dev_tel, 0),
12287 + cs->hw.teles0.membase = (u_long) ioremap(pci_resource_start_mem(dev_tel, 0),
12289 printk(KERN_INFO "Found: Zoran, base-address: 0x%lx, irq: 0x%x\n",
12290 - pci_resource_start(dev_tel, 0), dev_tel->irq);
12291 + pci_resource_start_mem(dev_tel, 0), dev_tel->irq);
12293 printk(KERN_WARNING "TelesPCI: No PCI card found\n");
12295 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/w6692.c linux-2.4.29/drivers/isdn/hisax/w6692.c
12296 --- linux-2.4.29.old/drivers/isdn/hisax/w6692.c 2005-03-22 14:47:56.000000000 +0100
12297 +++ linux-2.4.29/drivers/isdn/hisax/w6692.c 2005-03-22 15:06:48.398735056 +0100
12299 -/* $Id: w6692.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
12300 +/* $Id: w6692.c,v 1.18 2001/09/24 13:22:57 kai Exp $
12302 * Winbond W6692 specific routines
12305 #include "isdnl1.h"
12306 #include <linux/interrupt.h>
12307 #include <linux/pci.h>
12308 +#include <linux/isdn_compat.h>
12310 /* table entry in the PCI devices list */
12312 @@ -29,20 +30,14 @@
12314 static const PCI_ENTRY id_list[] =
12316 - {PCI_VENDOR_ID_WINBOND2, PCI_DEVICE_ID_WINBOND2_6692, "Winbond", "W6692"},
12317 {PCI_VENDOR_ID_DYNALINK, PCI_DEVICE_ID_DYNALINK_IS64PH, "Dynalink/AsusCom", "IS64PH"},
12318 - {0, 0, "U.S.Robotics", "ISDN PCI Card TA"}
12319 + {PCI_VENDOR_ID_WINBOND2, PCI_DEVICE_ID_WINBOND2_6692, "Winbond", "W6692"},
12320 + {0, 0, NULL, NULL}
12323 -#define W6692_SV_USR 0x16ec
12324 -#define W6692_SD_USR 0x3409
12325 -#define W6692_WINBOND 0
12326 -#define W6692_DYNALINK 1
12327 -#define W6692_USR 2
12329 extern const char *CardType[];
12331 -const char *w6692_revision = "$Revision: 1.1.4.1 $";
12332 +const char *w6692_revision = "$Revision: 1.18 $";
12334 #define DBUSY_TIMER_VALUE 80
12336 @@ -675,6 +670,16 @@
12338 DC_Close_W6692(struct IsdnCardState *cs)
12341 + if (cs->dc.w6692.mon_rx) {
12342 + kfree(cs->dc.w6692.mon_rx);
12343 + cs->dc.w6692.mon_rx = NULL;
12345 + if (cs->dc.w6692.mon_tx) {
12346 + kfree(cs->dc.w6692.mon_tx);
12347 + cs->dc.w6692.mon_tx = NULL;
12353 @@ -865,38 +870,31 @@
12357 -void resetW6692(struct IsdnCardState *cs)
12359 - cs->writeW6692(cs, W_D_CTL, W_D_CTL_SRST);
12360 - schedule_timeout((10*HZ)/1000);
12361 - cs->writeW6692(cs, W_D_CTL, 0x00);
12362 - schedule_timeout((10*HZ)/1000);
12363 - cs->writeW6692(cs, W_IMASK, 0xff);
12364 - cs->writeW6692(cs, W_D_SAM, 0xff);
12365 - cs->writeW6692(cs, W_D_TAM, 0xff);
12366 - cs->writeW6692(cs, W_D_EXIM, 0x00);
12367 - cs->writeW6692(cs, W_D_MODE, W_D_MODE_RACT);
12368 - cs->writeW6692(cs, W_IMASK, 0x18);
12369 - if (cs->subtyp == W6692_USR) {
12370 - /* seems that USR implemented some power control features
12371 - * Pin 79 is connected to the oscilator circuit so we
12372 - * have to handle it here
12374 - cs->writeW6692(cs, W_PCTL, 0x80);
12375 - cs->writeW6692(cs, W_XDATA, 0x00);
12379 void __init initW6692(struct IsdnCardState *cs, int part)
12382 cs->tqueue.routine = (void *) (void *) W6692_bh;
12383 cs->setstack_d = setstack_W6692;
12384 cs->DC_Close = DC_Close_W6692;
12386 + cs->dc.w6692.mon_tx = NULL;
12387 + cs->dc.w6692.mon_rx = NULL;
12389 cs->dbusytimer.function = (void *) dbusy_timer_handler;
12390 cs->dbusytimer.data = (long) cs;
12391 init_timer(&cs->dbusytimer);
12394 + cs->writeW6692(cs, W_D_CTL, W_D_CTL_SRST);
12395 + cs->writeW6692(cs, W_D_CTL, 0x00);
12396 + cs->writeW6692(cs, W_IMASK, 0xff);
12398 + cs->dc.w6692.mocr = 0xaa;
12400 + cs->writeW6692(cs, W_D_SAM, 0xff);
12401 + cs->writeW6692(cs, W_D_TAM, 0xff);
12402 + cs->writeW6692(cs, W_D_EXIM, 0x00);
12403 + cs->writeW6692(cs, W_D_MODE, W_D_MODE_RACT);
12404 + cs->writeW6692(cs, W_IMASK, 0x18);
12405 ph_command(cs, W_L1CMD_RST);
12406 cs->dc.w6692.ph_state = W_L1CMD_RST;
12408 @@ -963,14 +961,9 @@
12415 - cs->writeW6692(cs, W_IMASK, 0xff);
12416 release_region(cs->hw.w6692.iobase, 256);
12417 - if (cs->subtyp == W6692_USR) {
12418 - cs->writeW6692(cs, W_XDATA, 0x04);
12423 @@ -1013,7 +1006,6 @@
12425 if (pci_enable_device(dev_w6692))
12427 - cs->subtyp = id_idx;
12431 @@ -1023,14 +1015,7 @@
12432 pci_irq = dev_w6692->irq;
12433 /* I think address 0 is allways the configuration area */
12434 /* and address 1 is the real IO space KKe 03.09.99 */
12435 - pci_ioaddr = pci_resource_start(dev_w6692, 1);
12436 - /* USR ISDN PCI card TA need some special handling */
12437 - if (cs->subtyp == W6692_WINBOND) {
12438 - if ((W6692_SV_USR == dev_w6692->subsystem_vendor) &&
12439 - (W6692_SD_USR == dev_w6692->subsystem_device)) {
12440 - cs->subtyp = W6692_USR;
12443 + pci_ioaddr = pci_resource_start_io(dev_w6692, 1);
12446 printk(KERN_WARNING "W6692: No PCI card found\n");
12447 @@ -1047,18 +1032,18 @@
12449 cs->hw.w6692.iobase = pci_ioaddr;
12450 printk(KERN_INFO "Found: %s %s, I/O base: 0x%x, irq: %d\n",
12451 - id_list[cs->subtyp].vendor_name, id_list[cs->subtyp].card_name,
12452 - pci_ioaddr, pci_irq);
12453 + id_list[id_idx].vendor_name, id_list[id_idx].card_name,
12454 + pci_ioaddr, dev_w6692->irq);
12455 if (check_region((cs->hw.w6692.iobase), 256)) {
12456 printk(KERN_WARNING
12457 "HiSax: %s I/O ports %x-%x already in use\n",
12458 - id_list[cs->subtyp].card_name,
12459 + id_list[id_idx].card_name,
12460 cs->hw.w6692.iobase,
12461 cs->hw.w6692.iobase + 255);
12464 request_region(cs->hw.w6692.iobase, 256,
12465 - id_list[cs->subtyp].card_name);
12466 + id_list[id_idx].card_name);
12469 printk(KERN_WARNING "HiSax: W6692 and NO_PCI_BIOS\n");
12470 @@ -1068,7 +1053,7 @@
12473 "HiSax: %s config irq:%d I/O:%x\n",
12474 - id_list[cs->subtyp].card_name, cs->irq,
12475 + id_list[id_idx].card_name, cs->irq,
12476 cs->hw.w6692.iobase);
12478 cs->readW6692 = &ReadW6692;
12479 diff -rNu linux-2.4.29.old/drivers/isdn/hisax/w6692.h linux-2.4.29/drivers/isdn/hisax/w6692.h
12480 --- linux-2.4.29.old/drivers/isdn/hisax/w6692.h 2005-03-22 14:47:56.000000000 +0100
12481 +++ linux-2.4.29/drivers/isdn/hisax/w6692.h 2005-03-22 15:06:48.414732624 +0100
12483 -/* $Id: w6692.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
12484 +/* $Id: w6692.h,v 1.4 2001/09/24 13:22:57 kai Exp $
12486 * Winbond W6692 specific defines
12488 diff -rNu linux-2.4.29.old/drivers/isdn/hysdn/boardergo.c linux-2.4.29/drivers/isdn/hysdn/boardergo.c
12489 --- linux-2.4.29.old/drivers/isdn/hysdn/boardergo.c 2005-03-22 14:47:56.000000000 +0100
12490 +++ linux-2.4.29/drivers/isdn/hysdn/boardergo.c 2005-03-22 15:06:48.468724416 +0100
12492 -/* $Id: boardergo.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12494 +/* $Id: boardergo.c,v 1.9 2001/07/19 20:39:51 kai Exp $
12496 * Linux driver for HYSDN cards, specific routines for ergo type boards.
12498 - * Author Werner Cornelius (werner@titro.de) for Hypercope GmbH
12499 - * Copyright 1999 by Werner Cornelius (werner@titro.de)
12501 - * This software may be used and distributed according to the terms
12502 - * of the GNU General Public License, incorporated herein by reference.
12504 * As all Linux supported cards Champ2, Ergo and Metro2/4 use the same
12505 * DPRAM interface and layout with only minor differences all related
12506 * stuff is done here, not in separate modules.
12508 + * written by Werner Cornelius (werner@titro.de) for Hypercope GmbH
12510 + * Copyright 1999 by Werner Cornelius (werner@titro.de)
12512 + * This program is free software; you can redistribute it and/or modify
12513 + * it under the terms of the GNU General Public License as published by
12514 + * the Free Software Foundation; either version 2, or (at your option)
12515 + * any later version.
12517 + * This program is distributed in the hope that it will be useful,
12518 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
12519 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12520 + * GNU General Public License for more details.
12522 + * You should have received a copy of the GNU General Public License
12523 + * along with this program; if not, write to the Free Software
12524 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
12528 +#define __NO_VERSION__
12529 #include <linux/config.h>
12530 -#include <linux/sched.h>
12531 +#include <linux/module.h>
12532 +#include <linux/version.h>
12533 +#include <asm/io.h>
12534 #include <linux/signal.h>
12535 #include <linux/kernel.h>
12536 #include <linux/ioport.h>
12537 #include <linux/interrupt.h>
12538 #include <linux/vmalloc.h>
12539 -#include <asm/io.h>
12541 #include "hysdn_defs.h"
12542 #include "boardergo.h"
12543 @@ -45,11 +59,10 @@
12544 if (!card->irq_enabled)
12545 return; /* other device interrupting or irq switched off */
12547 - save_flags(flags);
12548 - cli(); /* no further irqs allowed */
12549 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
12551 if (!(bytein(card->iobase + PCI9050_INTR_REG) & PCI9050_INTR_REG_STAT1)) {
12552 - restore_flags(flags); /* restore old state */
12553 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12554 return; /* no interrupt requested by E1 */
12556 /* clear any pending ints on the board */
12558 queue_task(&card->irq_queue, &tq_immediate);
12559 mark_bh(IMMEDIATE_BH);
12561 - restore_flags(flags);
12562 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12563 } /* ergo_interrupt */
12565 /******************************************************************************/
12566 @@ -83,17 +96,15 @@
12567 return; /* invalid call */
12569 dpr = card->dpram; /* point to DPRAM */
12570 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
12572 - save_flags(flags);
12574 if (card->hw_lock) {
12575 - restore_flags(flags); /* hardware currently unavailable */
12576 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12579 card->hw_lock = 1; /* we now lock the hardware */
12582 - sti(); /* reenable other ints */
12583 again = 0; /* assume loop not to be repeated */
12585 if (!dpr->ToHyFlag) {
12586 @@ -113,15 +124,13 @@
12587 again = 1; /* restart loop */
12589 } /* a message has arrived for us */
12590 - cli(); /* no further ints */
12593 dpr->ToPcInt = 1; /* interrupt to E1 for all cards */
12595 card->hw_lock = 0; /* free hardware again */
12596 } while (again); /* until nothing more to do */
12598 - restore_flags(flags);
12599 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12600 } /* ergo_irq_bh */
12603 @@ -138,8 +147,7 @@
12604 #ifdef CONFIG_HYSDN_CAPI
12605 hycapi_capi_stop(card);
12606 #endif /* CONFIG_HYSDN_CAPI */
12607 - save_flags(flags);
12609 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
12610 val = bytein(card->iobase + PCI9050_INTR_REG); /* get actual value */
12611 val &= ~(PCI9050_INTR_REG_ENPCI | PCI9050_INTR_REG_EN1); /* mask irq */
12612 byteout(card->iobase + PCI9050_INTR_REG, val);
12613 @@ -147,8 +155,7 @@
12614 byteout(card->iobase + PCI9050_USER_IO, PCI9050_E1_RESET); /* reset E1 processor */
12615 card->state = CARD_STATE_UNUSED;
12616 card->err_log_state = ERRLOG_STATE_OFF; /* currently no log active */
12618 - restore_flags(flags);
12619 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12620 } /* ergo_stopcard */
12622 /**************************************************************************/
12623 @@ -163,20 +170,17 @@
12624 card->err_log_state = ERRLOG_STATE_OFF; /* must be off */
12627 - save_flags(flags);
12630 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
12631 if (((card->err_log_state == ERRLOG_STATE_OFF) && !on) ||
12632 ((card->err_log_state == ERRLOG_STATE_ON) && on)) {
12633 - restore_flags(flags);
12634 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12635 return; /* nothing to do */
12638 card->err_log_state = ERRLOG_STATE_START; /* request start */
12640 card->err_log_state = ERRLOG_STATE_STOP; /* request stop */
12642 - restore_flags(flags);
12643 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12644 queue_task(&card->irq_queue, &tq_immediate);
12645 mark_bh(IMMEDIATE_BH);
12646 } /* ergo_set_errlog_state */
12647 @@ -245,9 +249,6 @@
12648 while (!dpram->ToHyNoDpramErrLog); /* reread volatile register to flush PCI */
12650 byteout(card->iobase + PCI9050_USER_IO, PCI9050_E1_RUN); /* start E1 processor */
12651 - /* the interrupts are still masked */
12654 set_current_state(TASK_INTERRUPTIBLE);
12655 schedule_timeout((20 * HZ) / 1000); /* Timeout 20ms */
12657 @@ -282,7 +283,6 @@
12658 dst = sp->Data; /* point to data in spool structure */
12659 buflen = sp->Len; /* maximum len of spooled data */
12660 wr_mirror = sp->WrPtr; /* only once read */
12663 /* try until all bytes written or error */
12664 i = 0x1000; /* timeout value */
12665 @@ -358,9 +358,7 @@
12667 if (card->debug_flags & LOG_POF_RECORD)
12668 hysdn_addlog(card, "ERGO: pof boot success");
12669 - save_flags(flags);
12672 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
12673 card->state = CARD_STATE_RUN; /* now card is running */
12674 /* enable the cards interrupt */
12675 byteout(card->iobase + PCI9050_INTR_REG,
12676 @@ -371,8 +369,7 @@
12677 dpr->ToPcFlag = 0; /* reset data indicator */
12679 dpr->ToPcInt = 1; /* interrupt to E1 for all cards */
12681 - restore_flags(flags);
12682 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
12683 if ((hynet_enable & (1 << card->myid))
12684 && (i = hysdn_net_create(card)))
12686 @@ -387,7 +384,6 @@
12687 #endif /* CONFIG_HYSDN_CAPI */
12688 return (0); /* success */
12689 } /* data has arrived */
12691 set_current_state(TASK_INTERRUPTIBLE);
12692 schedule_timeout((50 * HZ) / 1000); /* Timeout 50ms */
12693 } /* wait until timeout */
12694 diff -rNu linux-2.4.29.old/drivers/isdn/hysdn/boardergo.h linux-2.4.29/drivers/isdn/hysdn/boardergo.h
12695 --- linux-2.4.29.old/drivers/isdn/hysdn/boardergo.h 2005-03-22 14:47:56.000000000 +0100
12696 +++ linux-2.4.29/drivers/isdn/hysdn/boardergo.h 2005-03-22 15:06:48.485721832 +0100
12698 -/* $Id: boardergo.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12701 * Linux driver for HYSDN cards, definitions for ergo type boards (buffers..).
12707 +#include <linux/isdn_compat.h>
12709 /************************************************/
12710 /* defines for the dual port memory of the card */
12711 diff -rNu linux-2.4.29.old/drivers/isdn/hysdn/hycapi.c linux-2.4.29/drivers/isdn/hysdn/hycapi.c
12712 --- linux-2.4.29.old/drivers/isdn/hysdn/hycapi.c 2005-03-22 14:47:57.000000000 +0100
12713 +++ linux-2.4.29/drivers/isdn/hysdn/hycapi.c 2005-03-22 15:06:48.500719552 +0100
12715 -/* $Id: hycapi.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12718 * Linux driver for HYSDN cards, CAPI2.0-Interface.
12721 #include "hysdn_defs.h"
12722 #include <linux/kernelcapi.h>
12724 -static char hycapi_revision[]="$Revision: 1.1.4.1 $";
12725 +static char hycapi_revision[]="$Revision$";
12727 unsigned int hycapi_enable = 0xffffffff;
12728 MODULE_PARM(hycapi_enable, "i");
12729 diff -rNu linux-2.4.29.old/drivers/isdn/hysdn/hysdn_boot.c linux-2.4.29/drivers/isdn/hysdn/hysdn_boot.c
12730 --- linux-2.4.29.old/drivers/isdn/hysdn/hysdn_boot.c 2005-03-22 14:47:56.000000000 +0100
12731 +++ linux-2.4.29/drivers/isdn/hysdn/hysdn_boot.c 2005-03-22 15:06:48.516717120 +0100
12733 -/* $Id: hysdn_boot.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12736 * Linux driver for HYSDN cards
12737 * specific routines for booting and pof handling
12738 @@ -143,7 +143,7 @@
12739 (boot->pof_recid == TAG_CABSDATA) ? "CABSDATA" : "ABSDATA",
12740 datlen, boot->pof_recoffset);
12742 - if ((boot->last_error = card->writebootseq(card, boot->buf.BootBuf, datlen)) < 0)
12743 + if ((boot->last_error = card->writebootseq(card, boot->buf.BootBuf, datlen) < 0))
12744 return (boot->last_error); /* error writing data */
12746 if (boot->pof_recoffset + datlen >= boot->pof_reclen)
12747 diff -rNu linux-2.4.29.old/drivers/isdn/hysdn/hysdn_defs.h linux-2.4.29/drivers/isdn/hysdn/hysdn_defs.h
12748 --- linux-2.4.29.old/drivers/isdn/hysdn/hysdn_defs.h 2005-03-22 14:47:56.000000000 +0100
12749 +++ linux-2.4.29/drivers/isdn/hysdn/hysdn_defs.h 2005-03-22 15:06:48.533714536 +0100
12751 -/* $Id: hysdn_defs.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12752 +/* $Id: hysdn_defs.h,v 1.10 2001/09/24 13:23:03 kai Exp $
12754 * Linux driver for HYSDN cards
12755 * global definitions and exported vars and functions.
12757 #include <linux/interrupt.h>
12758 #include <linux/tqueue.h>
12759 #include <linux/skbuff.h>
12760 +#include <linux/isdn_compat.h>
12761 +#include <linux/spinlock.h>
12763 +#define HYSDN_SPIN_LOCK(a,b) spin_lock(a)
12764 +#define HYSDN_SPIN_UNLOCK(a,b) spin_unlock(a)
12766 /****************************/
12767 /* storage type definitions */
12768 @@ -176,6 +181,7 @@
12769 struct tq_struct irq_queue; /* interrupt task queue */
12770 uchar volatile irq_enabled; /* interrupt enabled if != 0 */
12771 uchar volatile hw_lock; /* hardware is currently locked -> no access */
12772 + spinlock_t irq_lock;
12775 void *boot; /* pointer to boot private data */
12776 diff -rNu linux-2.4.29.old/drivers/isdn/hysdn/hysdn_init.c linux-2.4.29/drivers/isdn/hysdn/hysdn_init.c
12777 --- linux-2.4.29.old/drivers/isdn/hysdn/hysdn_init.c 2005-03-22 14:47:57.000000000 +0100
12778 +++ linux-2.4.29/drivers/isdn/hysdn/hysdn_init.c 2005-03-22 15:06:48.551711800 +0100
12780 -/* $Id: hysdn_init.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12783 * Linux driver for HYSDN cards, init functions.
12787 #include "hysdn_defs.h"
12789 +#ifndef COMPAT_HAS_2_2_PCI
12790 static struct pci_device_id hysdn_pci_tbl[] __initdata = {
12791 {PCI_VENDOR_ID_HYPERCOPE, PCI_DEVICE_ID_HYPERCOPE_PLX, PCI_ANY_ID, PCI_SUBDEVICE_ID_HYPERCOPE_METRO},
12792 {PCI_VENDOR_ID_HYPERCOPE, PCI_DEVICE_ID_HYPERCOPE_PLX, PCI_ANY_ID, PCI_SUBDEVICE_ID_HYPERCOPE_CHAMP2},
12793 @@ -29,11 +30,12 @@
12794 { } /* Terminating entry */
12796 MODULE_DEVICE_TABLE(pci, hysdn_pci_tbl);
12798 MODULE_DESCRIPTION("ISDN4Linux: Driver for HYSDN cards");
12799 MODULE_AUTHOR("Werner Cornelius");
12800 MODULE_LICENSE("GPL");
12802 -static char *hysdn_init_revision = "$Revision: 1.1.4.1 $";
12803 +static char *hysdn_init_revision = "$Revision$";
12804 int cardmax; /* number of found cards */
12805 hysdn_card *card_root = NULL; /* pointer to first card */
12807 @@ -91,11 +93,11 @@
12808 card->myid = cardmax; /* set own id */
12809 card->bus = akt_pcidev->bus->number;
12810 card->devfn = akt_pcidev->devfn; /* slot + function */
12811 - card->subsysid = akt_pcidev->subsystem_device;
12812 + pci_get_sub_system(akt_pcidev,card->subsysid);
12813 card->irq = akt_pcidev->irq;
12814 - card->iobase = pci_resource_start(akt_pcidev, PCI_REG_PLX_IO_BASE);
12815 - card->plxbase = pci_resource_start(akt_pcidev, PCI_REG_PLX_MEM_BASE);
12816 - card->membase = pci_resource_start(akt_pcidev, PCI_REG_MEMORY_BASE);
12817 + card->iobase = pci_resource_start_io(akt_pcidev, PCI_REG_PLX_IO_BASE);
12818 + card->plxbase = pci_resource_start_mem(akt_pcidev, PCI_REG_PLX_MEM_BASE);
12819 + card->membase = pci_resource_start_mem(akt_pcidev, PCI_REG_MEMORY_BASE);
12820 card->brdtype = BD_NONE; /* unknown */
12821 card->debug_flags = DEF_DEB_FLAGS; /* set default debug */
12822 card->faxchans = 0; /* default no fax channels */
12823 diff -rNu linux-2.4.29.old/drivers/isdn/hysdn/hysdn_net.c linux-2.4.29/drivers/isdn/hysdn/hysdn_net.c
12824 --- linux-2.4.29.old/drivers/isdn/hysdn/hysdn_net.c 2005-03-22 14:47:57.000000000 +0100
12825 +++ linux-2.4.29/drivers/isdn/hysdn/hysdn_net.c 2005-03-22 15:06:48.567709368 +0100
12827 -/* $Id: hysdn_net.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
12830 * Linux driver for HYSDN cards, net (ethernet type) handling routines.
12833 MODULE_PARM(hynet_enable, "i");
12835 /* store the actual version for log reporting */
12836 -char *hysdn_net_revision = "$Revision: 1.1.4.1 $";
12837 +char *hysdn_net_revision = "$Revision$";
12839 #define MAX_SKB_BUFFERS 20 /* number of buffers for keeping TX-data */
12842 /* additional vars may be added here */
12843 char dev_name[9]; /* our own device name */
12845 +#ifdef COMPAT_NO_SOFTNET
12846 + struct sk_buff *tx_skb; /* buffer for tx operation */
12849 /* Tx control lock. This protects the transmit buffer ring
12850 * state along with the "tx full" state of the driver. This
12851 * means all netif_queue flow control actions are protected
12853 int sk_count; /* number of buffers currently in ring */
12855 int is_open; /* flag controlling module locking */
12860 @@ -83,11 +88,19 @@
12861 hysdn_card *card = dev->priv;
12864 +#ifdef COMPAT_NO_SOFTNET
12865 + dev->tbusy = 0; /* non busy state */
12866 + dev->interrupt = 0;
12868 + MOD_INC_USE_COUNT; /* increment only if device is down */
12869 + dev->start = 1; /* and started */
12871 if (!((struct net_local *) dev)->is_open)
12872 MOD_INC_USE_COUNT; /* increment only if interface is actually down */
12873 ((struct net_local *) dev)->is_open = 1; /* device actually open */
12875 netif_start_queue(dev); /* start tx-queueing */
12878 /* Fill in the MAC-level header (if not already set) */
12879 if (!card->mac_addr[0]) {
12880 @@ -104,6 +117,7 @@
12884 +#ifndef COMPAT_NO_SOFTNET
12885 /*******************************************/
12886 /* flush the currently occupied tx-buffers */
12887 /* must only be called when device closed */
12888 @@ -119,6 +133,7 @@
12891 } /* flush_tx_buffers */
12895 /*********************************************************************/
12896 @@ -129,6 +144,15 @@
12897 net_close(struct net_device *dev)
12900 +#ifdef COMPAT_NO_SOFTNET
12901 + dev->tbusy = 1; /* we are busy */
12904 + MOD_DEC_USE_COUNT; /* dec only if device has been active */
12906 + dev->start = 0; /* and not started */
12909 netif_stop_queue(dev); /* disable queueing */
12911 if (((struct net_local *) dev)->is_open)
12912 @@ -136,9 +160,52 @@
12913 ((struct net_local *) dev)->is_open = 0;
12914 flush_tx_buffers((struct net_local *) dev);
12917 return (0); /* success */
12920 +#ifdef COMPAT_NO_SOFTNET
12921 +/************************************/
12922 +/* send a packet on this interface. */
12923 +/* only for kernel versions < 2.3.33 */
12924 +/************************************/
12926 +net_send_packet(struct sk_buff *skb, struct net_device *dev)
12928 + struct net_local *lp = (struct net_local *) dev;
12930 + if (dev->tbusy) {
12932 + * If we get here, some higher level has decided we are broken.
12933 + * There should really be a "kick me" function call instead.
12934 + * As ISDN may have higher timeouts than real ethernet 10s timeout
12936 + int tickssofar = jiffies - dev->trans_start;
12937 + if (tickssofar < (10000 * HZ) / 1000)
12939 + printk(KERN_WARNING "%s: transmit timed out. \n", dev->name);
12941 + dev->trans_start = jiffies;
12944 + * Block a timer-based transmit from overlapping. This could better be
12945 + * done with atomic_swap(1, dev->tbusy), but set_bit() works as well.
12947 + if (test_and_set_bit(0, (void *) &dev->tbusy) != 0)
12948 + printk(KERN_WARNING "%s: Transmitter access conflict.\n", dev->name);
12951 + lp->stats.tx_bytes += skb->len;
12952 + dev->trans_start = jiffies;
12953 + lp->tx_skb = skb; /* remember skb pointer */
12954 + queue_task(&((hysdn_card *) dev->priv)->irq_queue, &tq_immediate);
12955 + mark_bh(IMMEDIATE_BH);
12958 + return (0); /* success */
12959 +} /* net_send_packet */
12962 /************************************/
12963 /* send a packet on this interface. */
12964 /* new style for kernel >= 2.3.33 */
12965 @@ -176,6 +243,7 @@
12966 return (0); /* success */
12967 } /* net_send_packet */
12972 /***********************************************************************/
12973 @@ -190,6 +258,15 @@
12975 return; /* non existing device */
12977 +#ifdef COMPAT_NO_SOFTNET
12979 + dev_kfree_skb(lp->tx_skb); /* free tx pointer */
12980 + lp->tx_skb = NULL; /* reset pointer */
12982 + lp->stats.tx_packets++;
12983 + lp->netdev.tbusy = 0;
12984 + mark_bh(NET_BH); /* Inform upper layers. */
12988 return; /* error condition */
12989 @@ -203,6 +280,7 @@
12991 if (lp->sk_count-- == MAX_SKB_BUFFERS) /* dec usage count */
12992 netif_start_queue((struct net_device *) lp);
12994 } /* hysdn_tx_netack */
12996 /*****************************************************/
12997 @@ -250,10 +328,15 @@
12999 return (NULL); /* non existing device */
13001 +#ifdef COMPAT_NO_SOFTNET
13002 + return (lp->tx_skb); /* return packet pointer */
13006 return (NULL); /* nothing available */
13008 return (lp->skbs[lp->out_idx]); /* next packet to send */
13010 } /* hysdn_tx_netget */
13013 @@ -296,15 +379,21 @@
13015 memset(dev, 0, sizeof(struct net_local)); /* clean the structure */
13017 +#ifndef COMPAT_NO_SOFTNET
13018 spin_lock_init(&((struct net_local *) dev)->lock);
13021 /* initialise necessary or informing fields */
13022 dev->base_addr = card->iobase; /* IO address */
13023 dev->irq = card->irq; /* irq */
13024 dev->init = net_init; /* the init function of the device */
13025 +#ifdef COMPAT_NO_SOFTNET
13026 + dev->name = ((struct net_local *) dev)->dev_name; /* device name */
13029 strcpy(dev->name, ((struct net_local *) dev)->dev_name);
13032 if ((i = register_netdev(dev))) {
13033 printk(KERN_WARNING "HYSDN: unable to create network device\n");
13035 @@ -333,7 +422,9 @@
13036 card->netif = NULL; /* clear out pointer */
13037 dev->stop(dev); /* close the device */
13039 +#ifndef COMPAT_NO_SOFTNET
13040 flush_tx_buffers((struct net_local *) dev); /* empty buffers */
13043 unregister_netdev(dev); /* release the device */
13044 kfree(dev); /* release the memory allocated */
13045 diff -rNu linux-2.4.29.old/drivers/isdn/hysdn/hysdn_pof.h linux-2.4.29/drivers/isdn/hysdn/hysdn_pof.h
13046 --- linux-2.4.29.old/drivers/isdn/hysdn/hysdn_pof.h 2005-03-22 14:47:57.000000000 +0100
13047 +++ linux-2.4.29/drivers/isdn/hysdn/hysdn_pof.h 2005-03-22 15:06:48.583706936 +0100
13049 -/* $Id: hysdn_pof.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
13052 * Linux driver for HYSDN cards, definitions used for handling pof-files.
13054 diff -rNu linux-2.4.29.old/drivers/isdn/hysdn/hysdn_procconf.c linux-2.4.29/drivers/isdn/hysdn/hysdn_procconf.c
13055 --- linux-2.4.29.old/drivers/isdn/hysdn/hysdn_procconf.c 2005-03-22 14:47:56.000000000 +0100
13056 +++ linux-2.4.29/drivers/isdn/hysdn/hysdn_procconf.c 2005-03-22 15:06:48.598704656 +0100
13058 -/* $Id: hysdn_procconf.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
13061 * Linux driver for HYSDN cards, /proc/net filesystem dir and conf functions.
13063 @@ -17,11 +17,13 @@
13064 #include <linux/poll.h>
13065 #include <linux/proc_fs.h>
13066 #include <linux/pci.h>
13067 +#ifndef COMPAT_USE_MODCOUNT_LOCK
13068 #include <linux/smp_lock.h>
13071 #include "hysdn_defs.h"
13073 -static char *hysdn_procconf_revision = "$Revision: 1.1.4.1 $";
13074 +static char *hysdn_procconf_revision = "$Revision$";
13076 #define INFO_OUT_LEN 80 /* length of info line including lf */
13078 @@ -212,32 +214,29 @@
13080 hysdn_conf_read(struct file *file, char *buf, size_t count, loff_t * off)
13082 - loff_t pos = *off;
13086 if (off != &file->f_pos) /* fs error check */
13089 - if (!(file->f_mode & FMODE_READ))
13092 - if (!(cp = file->private_data))
13093 - return (-EFAULT); /* should never happen */
13095 - i = strlen(cp); /* get total string length */
13097 - if (pos != (unsigned)pos || pos >= i)
13100 - /* still bytes to transfer */
13101 - cp += pos; /* point to desired data offset */
13102 - i -= pos; /* remaining length */
13104 - i = count; /* limit length to transfer */
13105 - if (copy_to_user(buf, cp, i))
13106 - return (-EFAULT); /* copy error */
13107 - *off = pos + i; /* adjust offset */
13108 + if (file->f_mode & FMODE_READ) {
13109 + if (!(cp = file->private_data))
13110 + return (-EFAULT); /* should never happen */
13111 + i = strlen(cp); /* get total string length */
13113 + /* still bytes to transfer */
13114 + cp += *off; /* point to desired data offset */
13115 + i -= *off; /* remaining length */
13117 + i = count; /* limit length to transfer */
13118 + if (copy_to_user(buf, cp, i))
13119 + return (-EFAULT); /* copy error */
13120 + *off += i; /* adjust offset */
13124 + return (-EPERM); /* no permission to read */
13127 } /* hysdn_conf_read */
13128 @@ -254,7 +253,11 @@
13131 /* now search the addressed card */
13132 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13133 + MOD_INC_USE_COUNT;
13139 pd = card->procconf;
13140 @@ -263,7 +266,11 @@
13141 card = card->next; /* search next entry */
13144 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13145 + MOD_DEC_USE_COUNT;
13149 return (-ENODEV); /* device is unknown/invalid */
13151 if (card->debug_flags & (LOG_PROC_OPEN | LOG_PROC_ALL))
13152 @@ -274,7 +281,11 @@
13153 /* write only access -> write boot file or conf line */
13155 if (!(cnf = kmalloc(sizeof(struct conf_writedata), GFP_KERNEL))) {
13156 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13157 + MOD_DEC_USE_COUNT;
13164 @@ -286,7 +297,11 @@
13165 /* read access -> output card info data */
13167 if (!(tmp = (char *) kmalloc(INFO_OUT_LEN * 2 + 2, GFP_KERNEL))) {
13168 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13169 + MOD_DEC_USE_COUNT;
13173 return (-EFAULT); /* out of memory */
13175 filep->private_data = tmp; /* start of string */
13176 @@ -320,10 +335,16 @@
13178 *cp = 0; /* end of string */
13179 } else { /* simultaneous read/write access forbidden ! */
13180 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13181 + MOD_DEC_USE_COUNT;
13185 return (-EPERM); /* no permission this time */
13187 +#ifndef COMPAT_USE_MODCOUNT_LOCK
13191 } /* hysdn_conf_open */
13193 @@ -338,7 +359,9 @@
13195 struct proc_dir_entry *pd;
13197 +#ifndef COMPAT_USE_MODCOUNT_LOCK
13200 /* search the addressed card */
13203 @@ -348,7 +371,9 @@
13204 card = card->next; /* search next entry */
13207 +#ifndef COMPAT_USE_MODCOUNT_LOCK
13210 return (-ENODEV); /* device is unknown/invalid */
13212 if (card->debug_flags & (LOG_PROC_OPEN | LOG_PROC_ALL))
13213 @@ -371,7 +396,11 @@
13214 if (filep->private_data)
13215 kfree(filep->private_data); /* release memory */
13217 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13218 + MOD_DEC_USE_COUNT;
13223 } /* hysdn_conf_close */
13225 @@ -387,6 +416,9 @@
13226 release: hysdn_conf_close,
13229 +#ifdef COMPAT_NO_SOFTNET
13230 +static struct inode_operations conf_inode_operations;
13232 /*****************************/
13233 /* hysdn subdir in /proc/net */
13234 /*****************************/
13235 @@ -415,8 +447,17 @@
13236 if ((card->procconf = (void *) create_proc_entry(conf_name,
13237 S_IFREG | S_IRUGO | S_IWUSR,
13238 hysdn_proc_entry)) != NULL) {
13239 +#ifdef COMPAT_NO_SOFTNET
13240 + memset(&conf_inode_operations, 0, sizeof(struct inode_operations));
13241 + conf_inode_operations.default_file_ops = &conf_fops;
13243 + ((struct proc_dir_entry *) card->procconf)->ops = &conf_inode_operations;
13245 ((struct proc_dir_entry *) card->procconf)->proc_fops = &conf_fops;
13246 +#ifdef COMPAT_HAS_FILEOP_OWNER
13247 ((struct proc_dir_entry *) card->procconf)->owner = THIS_MODULE;
13250 hysdn_proclog_init(card); /* init the log file entry */
13252 card = card->next; /* next entry */
13253 diff -rNu linux-2.4.29.old/drivers/isdn/hysdn/hysdn_proclog.c linux-2.4.29/drivers/isdn/hysdn/hysdn_proclog.c
13254 --- linux-2.4.29.old/drivers/isdn/hysdn/hysdn_proclog.c 2005-03-22 14:47:56.000000000 +0100
13255 +++ linux-2.4.29/drivers/isdn/hysdn/hysdn_proclog.c 2005-03-22 15:06:48.613702376 +0100
13257 -/* $Id: hysdn_proclog.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
13260 * Linux driver for HYSDN cards, /proc/net filesystem log functions.
13263 #include <linux/poll.h>
13264 #include <linux/proc_fs.h>
13265 #include <linux/pci.h>
13266 +#ifndef COMPAT_USE_MODCOUNT_LOCK
13267 #include <linux/smp_lock.h>
13270 #include "hysdn_defs.h"
13272 @@ -115,8 +117,7 @@
13273 strcpy(ib->log_start, cp); /* set output string */
13275 ib->proc_ctrl = pd; /* point to own control structure */
13276 - save_flags(flags);
13278 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13279 ib->usage_cnt = pd->if_used;
13281 pd->log_head = ib; /* new head */
13282 @@ -124,7 +125,7 @@
13283 pd->log_tail->next = ib; /* follows existing messages */
13284 pd->log_tail = ib; /* new tail */
13285 i = pd->del_lock++; /* get lock state */
13286 - restore_flags(flags);
13287 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13289 /* delete old entrys */
13291 @@ -210,7 +211,6 @@
13293 struct procdata *pd = NULL;
13295 - loff_t pos = *off;
13297 if (!*((struct log_data **) file->private_data)) {
13298 if (file->f_flags & O_NONBLOCK)
13299 @@ -235,11 +235,11 @@
13302 inf->usage_cnt--; /* new usage count */
13303 - file->private_data = &inf->next; /* next structure */
13304 + (struct log_data **) file->private_data = &inf->next; /* next structure */
13305 if ((len = strlen(inf->log_start)) <= count) {
13306 if (copy_to_user(buf, inf->log_start, len))
13308 - *off = pos + len;
13309 + file->f_pos += len;
13313 @@ -255,7 +255,11 @@
13314 struct procdata *pd = NULL;
13317 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13318 + MOD_INC_USE_COUNT;
13324 pd = card->proclog;
13325 @@ -264,7 +268,11 @@
13326 card = card->next; /* search next entry */
13329 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13330 + MOD_DEC_USE_COUNT;
13334 return (-ENODEV); /* device is unknown/invalid */
13336 filep->private_data = card; /* remember our own card */
13337 @@ -274,19 +282,24 @@
13338 } else if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) {
13340 /* read access -> log/debug read */
13341 - save_flags(flags);
13343 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13346 - filep->private_data = &(pd->log_tail->next);
13347 + (struct log_data **) filep->private_data = &(pd->log_tail->next);
13349 - filep->private_data = &(pd->log_head);
13350 - restore_flags(flags);
13351 + (struct log_data **) filep->private_data = &(pd->log_head);
13352 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13353 } else { /* simultaneous read/write access forbidden ! */
13354 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13355 + MOD_DEC_USE_COUNT;
13359 return (-EPERM); /* no permission this time */
13361 +#ifndef COMPAT_USE_MODCOUNT_LOCK
13365 } /* hysdn_log_open */
13367 @@ -306,7 +319,9 @@
13368 int flags, retval = 0;
13371 +#ifndef COMPAT_USE_MODCOUNT_LOCK
13374 if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_WRITE) {
13375 /* write only access -> write debug level written */
13376 retval = 0; /* success */
13377 @@ -314,8 +329,7 @@
13378 /* read access -> log/debug read, mark one further file as closed */
13381 - save_flags(flags);
13383 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13384 inf = *((struct log_data **) filep->private_data); /* get first log entry */
13386 pd = (struct procdata *) inf->proc_ctrl; /* still entries there */
13387 @@ -338,7 +352,7 @@
13388 inf->usage_cnt--; /* decrement usage count for buffers */
13391 - restore_flags(flags);
13392 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13395 if (pd->if_used <= 0) /* delete buffers if last file closed */
13396 @@ -348,7 +362,11 @@
13399 } /* read access */
13400 +#ifdef COMPAT_USE_MODCOUNT_LOCK
13401 + MOD_DEC_USE_COUNT;
13407 } /* hysdn_log_close */
13408 @@ -400,6 +418,9 @@
13409 release: hysdn_log_close,
13412 +#ifdef COMPAT_NO_SOFTNET
13413 +struct inode_operations log_inode_operations;
13416 /***********************************************************************************/
13417 /* hysdn_proclog_init is called when the module is loaded after creating the cards */
13418 @@ -414,10 +435,20 @@
13420 if ((pd = (struct procdata *) kmalloc(sizeof(struct procdata), GFP_KERNEL)) != NULL) {
13421 memset(pd, 0, sizeof(struct procdata));
13422 +#ifdef COMPAT_NO_SOFTNET
13423 + memset(&log_inode_operations, 0, sizeof(struct inode_operations));
13424 + log_inode_operations.default_file_ops = &log_fops;
13426 sprintf(pd->log_name, "%s%d", PROC_LOG_BASENAME, card->myid);
13427 if ((pd->log = create_proc_entry(pd->log_name, S_IFREG | S_IRUGO | S_IWUSR, hysdn_proc_entry)) != NULL) {
13428 +#ifdef COMPAT_NO_SOFTNET
13429 + pd->log->ops = &log_inode_operations; /* set new operations table */
13431 pd->log->proc_fops = &log_fops;
13432 +#ifdef COMPAT_HAS_FILEOP_OWNER
13433 pd->log->owner = THIS_MODULE;
13438 init_waitqueue_head(&(pd->rd_queue));
13439 diff -rNu linux-2.4.29.old/drivers/isdn/hysdn/hysdn_sched.c linux-2.4.29/drivers/isdn/hysdn/hysdn_sched.c
13440 --- linux-2.4.29.old/drivers/isdn/hysdn/hysdn_sched.c 2005-03-22 14:47:57.000000000 +0100
13441 +++ linux-2.4.29/drivers/isdn/hysdn/hysdn_sched.c 2005-03-22 15:06:48.630699792 +0100
13443 -/* $Id: hysdn_sched.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
13444 +/* $Id: hysdn_sched.c,v 1.9 2001/09/24 13:23:03 kai Exp $
13446 * Linux driver for HYSDN cards
13447 * scheduler routines for handling exchange card <-> pc.
13451 #include <linux/config.h>
13452 -#include <linux/sched.h>
13453 #include <linux/signal.h>
13454 #include <linux/kernel.h>
13455 #include <linux/ioport.h>
13456 -#include <linux/interrupt.h>
13457 #include <asm/io.h>
13459 #include "hysdn_defs.h"
13460 @@ -151,22 +149,19 @@
13462 if (card->debug_flags & LOG_SCHED_ASYN)
13463 hysdn_addlog(card, "async tx-cfg chan=%d len=%d", chan, strlen(line) + 1);
13465 - save_flags(flags);
13467 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13468 while (card->async_busy) {
13471 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13472 if (card->debug_flags & LOG_SCHED_ASYN)
13473 hysdn_addlog(card, "async tx-cfg delayed");
13475 set_current_state(TASK_INTERRUPTIBLE);
13476 schedule_timeout((20 * HZ) / 1000); /* Timeout 20ms */
13478 - restore_flags(flags);
13479 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13480 return (-ERR_ASYNC_TIME); /* timed out */
13483 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13484 } /* wait for buffer to become free */
13486 strcpy(card->async_data, line);
13487 @@ -177,31 +172,26 @@
13488 /* now queue the task */
13489 queue_task(&card->irq_queue, &tq_immediate);
13490 mark_bh(IMMEDIATE_BH);
13493 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13494 if (card->debug_flags & LOG_SCHED_ASYN)
13495 hysdn_addlog(card, "async tx-cfg data queued");
13497 cnt++; /* short delay */
13500 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13501 while (card->async_busy) {
13504 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13505 if (card->debug_flags & LOG_SCHED_ASYN)
13506 hysdn_addlog(card, "async tx-cfg waiting for tx-ready");
13508 set_current_state(TASK_INTERRUPTIBLE);
13509 schedule_timeout((20 * HZ) / 1000); /* Timeout 20ms */
13511 - restore_flags(flags);
13512 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13513 return (-ERR_ASYNC_TIME); /* timed out */
13516 + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
13517 } /* wait for buffer to become free again */
13519 - restore_flags(flags);
13521 + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
13522 if (card->debug_flags & LOG_SCHED_ASYN)
13523 hysdn_addlog(card, "async tx-cfg data send");
13525 diff -rNu linux-2.4.29.old/drivers/isdn/icn/icn.c linux-2.4.29/drivers/isdn/icn/icn.c
13526 --- linux-2.4.29.old/drivers/isdn/icn/icn.c 2005-03-22 14:47:56.000000000 +0100
13527 +++ linux-2.4.29/drivers/isdn/icn/icn.c 2005-03-22 15:06:48.722685808 +0100
13529 -/* $Id: icn.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
13532 * ISDN low-level module for the ICN active ISDN-Card.
13538 -*revision = "$Revision: 1.1.4.1 $";
13539 +*revision = "$Revision$";
13541 static int icn_addcard(int, char *, char *);
13543 @@ -1634,6 +1634,7 @@
13547 +#ifdef COMPAT_HAS_NEW_SETUP
13549 icn_setup(char *line)
13551 @@ -1643,6 +1644,14 @@
13552 static char sid2[20];
13554 str = get_options(line, 2, ints);
13557 +icn_setup(char *str, int *ints)
13560 + static char sid[20];
13561 + static char sid2[20];
13564 portbase = ints[1];
13566 @@ -1656,9 +1665,13 @@
13570 +#ifdef COMPAT_HAS_NEW_SETUP
13573 __setup("icn=", icn_setup);
13577 #endif /* MODULE */
13579 static int __init icn_init(void)
13580 diff -rNu linux-2.4.29.old/drivers/isdn/icn/icn.h linux-2.4.29/drivers/isdn/icn/icn.h
13581 --- linux-2.4.29.old/drivers/isdn/icn/icn.h 2005-03-22 14:47:56.000000000 +0100
13582 +++ linux-2.4.29/drivers/isdn/icn/icn.h 2005-03-22 15:06:48.752681248 +0100
13584 -/* $Id: icn.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
13587 * ISDN lowlevel-module for the ICN active ISDN-Card.
13589 diff -rNu linux-2.4.29.old/drivers/isdn/isdn_audio.c linux-2.4.29/drivers/isdn/isdn_audio.c
13590 --- linux-2.4.29.old/drivers/isdn/isdn_audio.c 2005-03-22 14:47:56.000000000 +0100
13591 +++ linux-2.4.29/drivers/isdn/isdn_audio.c 2005-03-22 15:06:44.306357192 +0100
13593 -/* $Id: isdn_audio.c,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
13594 +/* $Id: isdn_audio.c,v 1.24 2002/08/13 09:57:26 keil Exp $
13596 * Linux ISDN subsystem, audio conversion and compression (linklevel).
13598 * Copyright 1994-1999 by Fritz Elfert (fritz@isdn4linux.de)
13599 - * DTMF code (c) 1996 by Christian Mock (cm@kukuruz.ping.at)
13600 + * DTMF code (c) 1996 by Christian Mock (cm@tahina.priv.at)
13601 * Silence detection (c) 1998 by Armin Schindler (mac@gismo.telekom.de)
13603 * This software may be used and distributed according to the terms
13605 #include "isdn_audio.h"
13606 #include "isdn_common.h"
13608 -char *isdn_audio_revision = "$Revision: 1.1.4.1 $";
13609 +char *isdn_audio_revision = "$Revision: 1.24 $";
13612 * Misc. lookup-tables.
13613 @@ -169,19 +169,39 @@
13614 0x8a, 0x8a, 0x6a, 0x6a, 0xea, 0xea, 0x2a, 0x2a
13617 -#define NCOEFF 8 /* number of frequencies to be analyzed */
13618 -#define DTMF_TRESH 4000 /* above this is dtmf */
13619 +#define NCOEFF 16 /* number of frequencies to be analyzed */
13620 +#define DTMF_TRESH 25000 /* above this is dtmf */
13621 #define SILENCE_TRESH 200 /* below this is silence */
13622 +#define H2_TRESH 20000 /* 2nd harmonic */
13623 #define AMP_BITS 9 /* bits per sample, reduced to avoid overflow */
13628 + int grp; /* low/high group */
13630 + int k2; /* k fuer 2. harmonic */
13633 /* For DTMF recognition:
13634 * 2 * cos(2 * PI * k / N) precalculated for all k
13636 static int cos2pik[NCOEFF] =
13638 - 55813, 53604, 51193, 48591, 38114, 33057, 25889, 18332
13639 + 55812, 29528, 53603, 24032, 51193, 14443, 48590, 6517,
13640 + 38113, -21204, 33057, -32186, 25889, -45081, 18332, -55279
13643 +static dtmf_t dtmf_tones[8] =
13645 + {LOGRP, 0, 1}, /* 697 Hz */
13646 + {LOGRP, 2, 3}, /* 770 Hz */
13647 + {LOGRP, 4, 5}, /* 852 Hz */
13648 + {LOGRP, 6, 7}, /* 941 Hz */
13649 + {HIGRP, 8, 9}, /* 1209 Hz */
13650 + {HIGRP, 10, 11}, /* 1336 Hz */
13651 + {HIGRP, 12, 13}, /* 1477 Hz */
13652 + {HIGRP, 14, 15} /* 1633 Hz */
13655 static char dtmf_matrix[4][4] =
13656 @@ -208,7 +228,7 @@
13660 - *buff = table[*(unsigned char *)buff], buff++;
13661 + *buff++ = table[*(unsigned char *)buff];
13665 @@ -479,18 +499,6 @@
13669 - /* Avoid overflows */
13672 - /* compute |X(k)|**2 */
13673 - /* report overflows. This should not happen. */
13674 - /* Comment this out if desired */
13675 - if (sk < -32768 || sk > 32767)
13676 - printk(KERN_DEBUG
13677 - "isdn_audio: dtmf goertzel overflow, sk=%d\n", sk);
13678 - if (sk2 < -32768 || sk2 > 32767)
13679 - printk(KERN_DEBUG
13680 - "isdn_audio: dtmf goertzel overflow, sk2=%d\n", sk2);
13682 ((sk * sk) >> AMP_BITS) -
13683 ((((cos2pik[k] * sk) >> 15) * sk2) >> AMP_BITS) +
13684 @@ -514,58 +522,28 @@
13690 while ((skb = skb_dequeue(&info->dtmf_queue))) {
13691 result = (int *) skb->data;
13692 s = info->dtmf_state;
13693 - grp[LOGRP] = grp[HIGRP] = -1;
13694 + grp[LOGRP] = grp[HIGRP] = -2;
13697 - for (i = 0; i < NCOEFF; i++) {
13698 - if (result[i] > DTMF_TRESH) {
13699 - if (result[i] > thresh)
13700 - thresh = result[i];
13702 - else if (result[i] < SILENCE_TRESH)
13703 + for (i = 0; i < 8; i++) {
13704 + if ((result[dtmf_tones[i].k] > DTMF_TRESH) &&
13705 + (result[dtmf_tones[i].k2] < H2_TRESH))
13706 + grp[dtmf_tones[i].grp] = (grp[dtmf_tones[i].grp] == -2) ? i : -1;
13707 + else if ((result[dtmf_tones[i].k] < SILENCE_TRESH) &&
13708 + (result[dtmf_tones[i].k2] < SILENCE_TRESH))
13711 - if (silence == NCOEFF)
13712 + if (silence == 8)
13715 - if (thresh > 0) {
13716 - thresh = thresh >> 4; /* touchtones must match within 12 dB */
13717 - for (i = 0; i < NCOEFF; i++) {
13718 - if (result[i] < thresh)
13719 - continue; /* ignore */
13720 - /* good level found. This is allowed only one time per group */
13721 - if (i < NCOEFF / 2) {
13723 - if (grp[LOGRP] >= 0) {
13724 - // Bad. Another tone found. */
13731 - else { /* higroup */
13732 - if (grp[HIGRP] >= 0) { // Bad. Another tone found. */
13737 - grp[HIGRP] = i - NCOEFF/2;
13740 - if ((grp[LOGRP] >= 0) && (grp[HIGRP] >= 0)) {
13741 - what = dtmf_matrix[grp[LOGRP]][grp[HIGRP]];
13742 - if (s->last != ' ' && s->last != '.')
13743 - s->last = what; /* min. 1 non-DTMF between DTMF */
13748 + if ((grp[LOGRP] >= 0) && (grp[HIGRP] >= 0)) {
13749 + what = dtmf_matrix[grp[LOGRP]][grp[HIGRP] - 4];
13750 + if (s->last != ' ' && s->last != '.')
13751 + s->last = what; /* min. 1 non-DTMF between DTMF */
13755 if ((what != s->last) && (what != ' ') && (what != '.')) {
13756 diff -rNu linux-2.4.29.old/drivers/isdn/isdn_audio.h linux-2.4.29/drivers/isdn/isdn_audio.h
13757 --- linux-2.4.29.old/drivers/isdn/isdn_audio.h 2005-03-22 14:47:56.000000000 +0100
13758 +++ linux-2.4.29/drivers/isdn/isdn_audio.h 2005-03-22 15:06:44.321354912 +0100
13760 -/* $Id: isdn_audio.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
13761 +/* $Id: isdn_audio.h,v 1.10 2001/09/24 13:22:42 kai Exp $
13763 * Linux ISDN subsystem, audio conversion and compression (linklevel).
13767 typedef struct dtmf_state {
13771 int buf[DTMF_NPOINTS];
13773 diff -rNu linux-2.4.29.old/drivers/isdn/isdn_bsdcomp.c linux-2.4.29/drivers/isdn/isdn_bsdcomp.c
13774 --- linux-2.4.29.old/drivers/isdn/isdn_bsdcomp.c 2005-03-22 14:47:56.000000000 +0100
13775 +++ linux-2.4.29/drivers/isdn/isdn_bsdcomp.c 2005-03-22 15:06:44.339352176 +0100
13776 @@ -105,6 +105,14 @@
13780 +#ifdef CONFIG_ISDN_WITH_ABC
13781 +#define BSD_C_MALLOC(x) kmalloc((x),GFP_ATOMIC)
13782 +#define BSD_C_FREE(x) kfree(x)
13784 +#define BSD_C_MALLOC(x) vmalloc(x)
13785 +#define BSD_C_FREE(x) vfree(x)
13789 * A dictionary for doing BSD compress.
13791 @@ -285,7 +293,7 @@
13792 * Release the dictionary
13795 - vfree (db->dict);
13796 + BSD_C_FREE (db->dict);
13800 @@ -293,7 +301,7 @@
13801 * Release the string buffer
13804 - vfree (db->lens);
13805 + BSD_C_FREE (db->lens);
13809 @@ -350,14 +358,19 @@
13810 * Allocate space for the dictionary. This may be more than one page in
13813 - db->dict = (struct bsd_dict *) vmalloc (hsize * sizeof (struct bsd_dict));
13814 + db->dict = (struct bsd_dict *) BSD_C_MALLOC (hsize * sizeof (struct bsd_dict));
13816 + MOD_INC_USE_COUNT;
13818 + ** MOD_INC_USE_COUNT must be before bsd_free
13819 + ** bsd_free make MOD_DEC_USE_COUNT if db != NULL
13827 - MOD_INC_USE_COUNT;
13830 * If this is the compression buffer then there is no length data.
13831 * For decompression, the length information is needed as well.
13832 @@ -365,7 +378,7 @@
13836 - db->lens = (unsigned short *) vmalloc ((maxmaxcode + 1) *
13837 + db->lens = (unsigned short *) BSD_C_MALLOC ((maxmaxcode + 1) *
13838 sizeof (db->lens[0]));
13840 bsd_free (db); /* calls MOD_DEC_USE_COUNT; */
13841 @@ -478,7 +491,11 @@
13842 int hval,disp,ilen,mxcode;
13843 unsigned char *rptr = skb_in->data;
13844 int isize = skb_in->len;
13845 +#ifdef CONFIG_ISDN_WITH_ABC
13849 +#ifndef CONFIG_ISDN_WITH_ABC
13850 #define OUTPUT(ent) \
13853 @@ -490,17 +507,45 @@
13855 } while (bitno <= 24); \
13858 +#define OUTPUT(ent) \
13861 + bitno -= n_bits; \
13862 + accm |= ((ent) << bitno); \
13864 + if(skb_out && skb_tailroom(skb_out) > 0) \
13865 + *(skb_put(skb_out,1)) = (unsigned char) (accm>>24); \
13868 + } while (bitno <= 24 && ++secure < 10000); \
13869 + if(secure >= 10000) { \
13870 + printk(KERN_DEBUG "BSD in OUTPUT secure counter reached\n"); \
13877 * If the protocol is not in the range we're interested in,
13878 * just return without compressing the packet. If it is,
13879 * the protocol becomes the first byte to compress.
13881 +#ifdef CONFIG_ISDN_WITH_ABC
13884 + if (proto < 0x21 || proto > 0xf9 || !(proto & 0x1) ) {
13886 + printk(KERN_DEBUG "bsd_compress called with %x\n",proto);
13890 printk(KERN_DEBUG "bsd_compress called with %x\n",proto);
13893 if (proto < 0x21 || proto > 0xf9 || !(proto & 0x1) )
13897 db = (struct bsd_db *) state;
13898 hshift = db->hshift;
13899 @@ -538,6 +583,9 @@
13901 /* continue probing until a match or invalid entry */
13902 disp = (hval == 0) ? 1 : hval;
13903 +#ifdef CONFIG_ISDN_WITH_ABC
13909 @@ -546,7 +594,15 @@
13910 dictp = dict_ptr (db, hval);
13911 if (dictp->codem1 >= max_ent)
13913 +#ifndef CONFIG_ISDN_WITH_ABC
13914 } while (dictp->fcode != fcode);
13916 + } while (dictp->fcode != fcode && ++secure < 100000);
13917 + if(secure >= 100000) {
13918 + printk(KERN_DEBUG "BSD: compress while dictp->fcode != fcode secure-counter reached\n");
13923 ent = dictp->codem1 + 1; /* finally found (prefix,suffix) */
13925 @@ -669,6 +725,9 @@
13929 +#ifdef CONFIG_ISDN_WITH_ABC
13930 + unsigned long secure = 0;
13933 db = (struct bsd_db *) state;
13934 max_ent = db->max_ent;
13935 @@ -677,7 +736,9 @@
13936 n_bits = db->n_bits;
13937 tgtbitno = 32 - n_bits; /* bitno when we have a code */
13939 +#ifndef CONFIG_ISDN_WITH_ABC
13940 printk(KERN_DEBUG "bsd_decompress called\n");
13943 if(!skb_in || !skb_out) {
13944 printk(KERN_ERR "bsd_decompress called with NULL parameter\n");
13945 @@ -795,7 +856,11 @@
13947 p = skb_put(skb_out,codelen);
13949 +#ifdef CONFIG_ISDN_WITH_ABC
13950 + for(secure = 0; finchar > LAST && secure < 50000;secure++) {
13952 while (finchar > LAST) {
13954 struct bsd_dict *dictp2 = dict_ptr (db, finchar);
13956 dictp = dict_ptr (db, dictp2->cptr);
13957 @@ -822,6 +887,12 @@
13961 +#ifdef CONFIG_ISDN_WITH_ABC
13962 + if(secure >= 50000) {
13963 + printk(KERN_DEBUG "BSD: decompress secure-counter reached\n");
13964 + return DECOMP_FATALERROR;
13969 if (--codelen != 0)
13970 @@ -851,12 +922,23 @@
13971 /* look for a free hash table entry */
13972 if (dictp->codem1 < max_ent) {
13973 disp = (hval == 0) ? 1 : hval;
13974 +#ifdef CONFIG_ISDN_WITH_ABC
13979 if (hval >= db->hsize)
13981 dictp = dict_ptr (db, hval);
13982 +#ifndef CONFIG_ISDN_WITH_ABC
13983 } while (dictp->codem1 < max_ent);
13985 + } while (dictp->codem1 < max_ent && ++secure < 50000);
13986 + if(secure >= 50000) {
13987 + printk(KERN_DEBUG "BSD: decomp while (dictp->codem1 < max_ent) secure-counter reached\n");
13988 + return DECOMP_FATALERROR;
13994 @@ -895,11 +977,21 @@
13995 db->comp_bytes += skb_in->len - BSD_OVHD;
13996 db->uncomp_bytes += skb_out->len;
13998 +#ifdef CONFIG_ISDN_WITH_ABC
14000 + ** bsd_check will call bsd_clear
14001 + ** and so on the internal tables will be cleared.
14003 + ** I think that's not what we will at this point ?????
14004 + ** For me at works without bsd_check.
14007 if (bsd_check(db)) {
14009 printk(KERN_DEBUG "bsd_decomp%d: peer should have cleared dictionary on %d\n",
14010 db->unit, db->seqno - 1);
14013 return skb_out->len;
14016 diff -rNu linux-2.4.29.old/drivers/isdn/isdn_common.c linux-2.4.29/drivers/isdn/isdn_common.c
14017 --- linux-2.4.29.old/drivers/isdn/isdn_common.c 2005-03-22 14:47:56.000000000 +0100
14018 +++ linux-2.4.29/drivers/isdn/isdn_common.c 2005-03-22 15:06:44.359349136 +0100
14020 -/* $Id: isdn_common.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
14021 +/* $Id: isdn_common.c,v 1.137 2002/02/09 21:19:11 keil Exp $
14023 * Linux ISDN subsystem, common used functions (linklevel).
14026 #include <linux/vmalloc.h>
14027 #include <linux/isdn.h>
14028 #include <linux/smp_lock.h>
14029 +#include <linux/list.h>
14030 #include "isdn_common.h"
14031 #include "isdn_tty.h"
14032 #include "isdn_net.h"
14034 #include <linux/isdn_divertif.h>
14035 #endif /* CONFIG_ISDN_DIVERSION */
14036 #include "isdn_v110.h"
14037 +#ifdef HAVE_DEVFS_FS
14038 #include <linux/devfs_fs_kernel.h>
14039 +#endif /* HAVE_DEVFS_FS */
14042 #undef ISDN_DEBUG_STATCALLB
14047 -static char *isdn_revision = "$Revision: 1.1.4.1 $";
14048 +static char *isdn_revision = "$Revision: 1.137 $";
14050 extern char *isdn_net_revision;
14051 extern char *isdn_tty_revision;
14052 @@ -67,19 +70,19 @@
14054 static int isdn_writebuf_stub(int, int, const u_char *, int, int);
14055 static void set_global_features(void);
14056 +#ifdef HAVE_DEVFS_FS
14057 static void isdn_register_devfs(int);
14058 static void isdn_unregister_devfs(int);
14059 +#endif /* HAVE_DEVFS_FS */
14060 static int isdn_wildmat(char *s, char *p);
14063 isdn_lock_drivers(void)
14068 - for (i = 0; i < ISDN_MAX_DRIVERS; i++) {
14069 - if (!dev->drv[i])
14071 + for (i = 0; i < dev->drivers; i++) {
14076 @@ -101,10 +104,7 @@
14080 - for (i = 0; i < ISDN_MAX_DRIVERS; i++) {
14081 - if (!dev->drv[i])
14084 + for (i = 0; i < dev->drivers; i++)
14085 if (dev->drv[i]->locks > 0) {
14088 @@ -114,7 +114,6 @@
14089 isdn_command(&cmd);
14090 dev->drv[i]->locks--;
14096 @@ -473,6 +472,7 @@
14097 dev->drv[di]->flags &= ~DRV_FLAG_RUNNING;
14099 case ISDN_STAT_ICALL:
14100 + case ISDN_STAT_ICALLW:
14103 #ifdef ISDN_DEBUG_STATCALLB
14104 @@ -718,7 +718,9 @@
14105 dev->drvmap[i] = -1;
14106 dev->chanmap[i] = -1;
14107 dev->usage[i] &= ~ISDN_USAGE_DISABLED;
14108 +#ifdef HAVE_DEVFS_FS
14109 isdn_unregister_devfs(i);
14110 +#endif /* HAVE_DEVFS_FS */
14113 dev->channels -= dev->drv[di]->channels;
14114 @@ -755,6 +757,10 @@
14116 return(divert_if->stat_callback(c));
14117 #endif /* CONFIG_ISDN_DIVERSION */
14118 + case ISDN_STAT_ALERT:
14119 + case ISDN_STAT_PROCEED:
14120 + isdn_tty_stat_callback(i, c);
14125 @@ -900,72 +906,239 @@
14126 return (dev->chanmap[minor]);
14130 -isdn_statstr(void)
14131 +// ----------------------------------------------------------------------
14134 +// This device has somewhat insane semantics, but we need to support
14135 +// them for the sake of compatibility.
14137 +// After opening, the first read will succeed and return the current state
14138 +// Then, unless O_NONBLOCK is set, it will block until a state change happens
14139 +// and then return the new state.
14140 +// Also, if the buffer size for the read is too small, we'll just return
14143 +struct isdnstatus_dev {
14144 + struct list_head list;
14148 +static DECLARE_WAIT_QUEUE_HEAD(isdnstatus_waitq);
14149 +static LIST_HEAD(isdnstatus_devs);
14150 +static spinlock_t isdnstatus_devs_lock = SPIN_LOCK_UNLOCKED;
14153 +isdn_info_update(void)
14155 + struct list_head *p;
14156 + struct isdnstatus_dev *idev;
14158 + spin_lock(&isdnstatus_devs_lock);
14159 + list_for_each(p, &isdnstatus_devs) {
14160 + idev = list_entry(p, struct isdnstatus_dev, list);
14161 + idev->update = 1;
14163 + spin_unlock(&isdnstatus_devs_lock);
14164 + wake_up_interruptible(&isdnstatus_waitq);
14168 +isdnstatus_open(struct inode *ino, struct file *filep)
14170 + struct isdnstatus_dev *p;
14172 + p = kmalloc(sizeof(struct isdnstatus_dev), GFP_USER);
14176 + /* At opening time we allow a single update */
14178 + spin_lock(&isdnstatus_devs_lock);
14179 + list_add(&p->list, &isdnstatus_devs);
14180 + spin_unlock(&isdnstatus_devs_lock);
14181 + filep->private_data = p;
14187 +isdnstatus_close(struct inode *ino, struct file *filep)
14189 + struct isdnstatus_dev *p = filep->private_data;
14191 + spin_lock(&isdnstatus_devs_lock);
14192 + list_del(&p->list);
14193 + spin_unlock(&isdnstatus_devs_lock);
14197 +// FIXME we don't lock against the state changing whilst being
14201 +isdn_statstr(char *buf)
14203 - static char istatbuf[2048];
14207 - sprintf(istatbuf, "idmap:\t");
14208 - p = istatbuf + strlen(istatbuf);
14210 + p += sprintf(p, "idmap:\t");
14211 for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
14212 - sprintf(p, "%s ", (dev->drvmap[i] < 0) ? "-" : dev->drvid[dev->drvmap[i]]);
14213 - p = istatbuf + strlen(istatbuf);
14214 + p += sprintf(p, "%s ", (dev->drvmap[i] < 0) ? "-" : dev->drvid[dev->drvmap[i]]);
14216 - sprintf(p, "\nchmap:\t");
14217 - p = istatbuf + strlen(istatbuf);
14218 + p += sprintf(p, "\nchmap:\t");
14219 for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
14220 - sprintf(p, "%d ", dev->chanmap[i]);
14221 - p = istatbuf + strlen(istatbuf);
14222 + p += sprintf(p, "%d ", dev->chanmap[i]);
14224 - sprintf(p, "\ndrmap:\t");
14225 - p = istatbuf + strlen(istatbuf);
14226 + p += sprintf(p, "\ndrmap:\t");
14227 for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
14228 - sprintf(p, "%d ", dev->drvmap[i]);
14229 - p = istatbuf + strlen(istatbuf);
14230 + p += sprintf(p, "%d ", dev->drvmap[i]);
14232 - sprintf(p, "\nusage:\t");
14233 - p = istatbuf + strlen(istatbuf);
14234 + p += sprintf(p, "\nusage:\t");
14235 for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
14236 - sprintf(p, "%d ", dev->usage[i]);
14237 - p = istatbuf + strlen(istatbuf);
14238 + p += sprintf(p, "%d ", dev->usage[i]);
14240 - sprintf(p, "\nflags:\t");
14241 - p = istatbuf + strlen(istatbuf);
14242 + p += sprintf(p, "\nflags:\t");
14243 for (i = 0; i < ISDN_MAX_DRIVERS; i++) {
14245 - sprintf(p, "%ld ", dev->drv[i]->online);
14246 - p = istatbuf + strlen(istatbuf);
14247 + p += sprintf(p, "%ld ", dev->drv[i]->online);
14249 - sprintf(p, "? ");
14250 - p = istatbuf + strlen(istatbuf);
14251 + p += sprintf(p, "? ");
14254 - sprintf(p, "\nphone:\t");
14255 - p = istatbuf + strlen(istatbuf);
14256 + p += sprintf(p, "\nphone:\t");
14257 for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
14258 - sprintf(p, "%s ", dev->num[i]);
14259 - p = istatbuf + strlen(istatbuf);
14260 + p += sprintf(p, "%s ", dev->num[i]);
14262 - sprintf(p, "\n");
14264 + p += sprintf(p, "\n");
14267 -/* Module interface-code */
14269 +isdnstatus_read(struct file *file, char *buf, size_t count, loff_t * off)
14271 + static DECLARE_MUTEX(istatbuf_mutex);
14272 + static char istatbuf[2048];
14275 -isdn_info_update(void)
14276 + DECLARE_WAITQUEUE(wait, current);
14277 + struct isdnstatus_dev *idev;
14279 + unsigned int len;
14281 + idev = file->private_data;
14283 + if (off != &file->f_pos)
14286 + add_wait_queue(&isdnstatus_waitq, &wait);
14288 + set_current_state(TASK_INTERRUPTIBLE);
14290 + if (idev->update)
14293 + retval = -EAGAIN;
14294 + if (file->f_flags & O_NONBLOCK)
14297 + retval = -ERESTARTSYS;
14298 + if (signal_pending(current))
14303 + __set_current_state(TASK_RUNNING);
14304 + remove_wait_queue(&isdnstatus_waitq, &wait);
14306 + if (!idev->update)
14309 + idev->update = 0;
14310 + down(&istatbuf_mutex);
14311 + isdn_statstr(istatbuf);
14312 + len = strlen(istatbuf);
14313 + if (len > count) {
14317 + if (copy_to_user(buf, istatbuf, len)) {
14318 + retval = -EFAULT;
14325 + up(&istatbuf_mutex);
14331 +isdnstatus_write(struct file *file, const char *buf, size_t count, loff_t * off)
14333 - infostruct *p = dev->infochain;
14337 +static unsigned int
14338 +isdnstatus_poll(struct file *file, poll_table * wait)
14340 + struct isdnstatus_dev *idev;
14341 + unsigned int mask = 0;
14343 + idev = file->private_data;
14346 - *(p->private) = 1;
14347 - p = (infostruct *) p->next;
14348 + poll_wait(file, &isdnstatus_waitq, wait);
14349 + if (idev->update) {
14350 + mask |= POLLIN | POLLRDNORM;
14352 - wake_up_interruptible(&(dev->info_waitq));
14357 +isdnstatus_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
14360 + isdn_net_ioctl_phone phone;
14369 + ulong *p = (ulong *) arg;
14371 + if ((retval = verify_area(VERIFY_WRITE, (void *) arg,
14372 + sizeof(ulong) * ISDN_MAX_CHANNELS * 2)))
14374 + for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
14375 + put_user(dev->ibytes[i], p++);
14376 + put_user(dev->obytes[i], p++);
14382 +#ifdef CONFIG_NETDEVICES
14384 + /* Get peer phone number of a connected
14385 + * isdn network interface */
14387 + if (copy_from_user((char *) &phone, (char *) arg, sizeof(phone)))
14389 + return isdn_net_getpeer(&phone, (isdn_net_ioctl_phone *) arg);
14398 +// ----------------------------------------------------------------------
14402 isdn_read(struct file *file, char *buf, size_t count, loff_t * off)
14404 @@ -976,37 +1149,16 @@
14408 - loff_t pos = *off;
14410 if (off != &file->f_pos)
14413 - if (pos != (unsigned) pos)
14416 +#ifndef COMPAT_HAVE_READ_LOCK_KERNEL
14418 - if (minor == ISDN_MINOR_STATUS) {
14419 - if (!file->private_data) {
14420 - if (file->f_flags & O_NONBLOCK) {
14421 - retval = -EAGAIN;
14424 - interruptible_sleep_on(&(dev->info_waitq));
14426 - p = isdn_statstr();
14427 - file->private_data = 0;
14428 - if ((len = strlen(p)) <= count) {
14429 - if (copy_to_user(buf, p, len)) {
14430 - retval = -EFAULT;
14433 - *off = pos + len;
14441 + if (minor == ISDN_MINOR_STATUS)
14442 + return isdnstatus_read(file, buf, count, off);
14444 if (!dev->drivers) {
14447 @@ -1031,7 +1183,7 @@
14449 len = isdn_readbchan(drvidx, chidx, p, 0, count,
14450 &dev->drv[drvidx]->rcv_waitq[chidx]);
14451 - *off = pos + len;
14453 restore_flags(flags);
14454 if (copy_to_user(buf,p,len))
14456 @@ -1052,6 +1204,9 @@
14458 interruptible_sleep_on(&(dev->drv[drvidx]->st_waitq));
14460 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
14461 + if(drvidx || (len = isdn_dw_abc_lcr_readstat(buf,count)) < 1) {
14463 if (dev->drv[drvidx]->interface->readstat) {
14464 if (count > dev->drv[drvidx]->stavail)
14465 count = dev->drv[drvidx]->stavail;
14466 @@ -1061,6 +1216,9 @@
14470 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
14476 @@ -1068,7 +1226,7 @@
14478 dev->drv[drvidx]->stavail = 0;
14479 restore_flags(flags);
14480 - *off = pos + len;
14485 @@ -1080,7 +1238,9 @@
14489 +#ifndef COMPAT_HAVE_READ_LOCK_KERNEL
14495 @@ -1092,15 +1252,18 @@
14499 + if (minor == ISDN_MINOR_STATUS)
14500 + return isdnstatus_write(file, buf, count, off);
14502 if (off != &file->f_pos)
14505 - if (minor == ISDN_MINOR_STATUS)
14510 +#ifndef COMPAT_HAVE_WRITE_LOCK_KERNEL
14513 if (minor <= ISDN_MINOR_BMAX) {
14514 printk(KERN_WARNING "isdn_write minor %d obsolete!\n", minor);
14515 drvidx = isdn_minor2drv(minor);
14516 @@ -1145,7 +1308,9 @@
14520 +#ifndef COMPAT_HAVE_WRITE_LOCK_KERNEL
14526 @@ -1156,15 +1321,12 @@
14527 unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev);
14528 int drvidx = isdn_minor2drv(minor - ISDN_MINOR_CTRL);
14530 +#ifndef COMPAT_HAVE_POLL_LOCK_KERNEL
14532 - if (minor == ISDN_MINOR_STATUS) {
14533 - poll_wait(file, &(dev->info_waitq), wait);
14534 - /* mask = POLLOUT | POLLWRNORM; */
14535 - if (file->private_data) {
14536 - mask |= POLLIN | POLLRDNORM;
14541 + if (minor == ISDN_MINOR_STATUS)
14542 + return isdnstatus_poll(file, wait);
14544 if (minor >= ISDN_MINOR_CTRL && minor <= ISDN_MINOR_CTRLMAX) {
14546 /* driver deregistered while file open */
14547 @@ -1186,7 +1348,9 @@
14551 +#ifndef COMPAT_HAVE_POLL_LOCK_KERNEL
14557 @@ -1216,42 +1380,9 @@
14558 #define phone iocpar.phone
14559 #define cfg iocpar.cfg
14561 - if (minor == ISDN_MINOR_STATUS) {
14569 - ulong *p = (ulong *) arg;
14571 - if ((ret = verify_area(VERIFY_WRITE, (void *) arg,
14572 - sizeof(ulong) * ISDN_MAX_CHANNELS * 2)))
14574 - for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
14575 - put_user(dev->ibytes[i], p++);
14576 - put_user(dev->obytes[i], p++);
14582 -#ifdef CONFIG_NETDEVICES
14584 - /* Get peer phone number of a connected
14585 - * isdn network interface */
14587 - if (copy_from_user((char *) &phone, (char *) arg, sizeof(phone)))
14589 - return isdn_net_getpeer(&phone, (isdn_net_ioctl_phone *) arg);
14597 + if (minor == ISDN_MINOR_STATUS)
14598 + return isdnstatus_ioctl(inode, file, cmd, arg);
14602 if (minor <= ISDN_MINOR_BMAX) {
14603 @@ -1273,11 +1404,34 @@
14606 case IIOCNETDWRSET:
14607 +#ifdef CONFIG_ISDN_WITH_ABC
14610 + if (copy_from_user(name, (char *) arg, sizeof(name))) {
14616 + isdn_net_dev *p = isdn_net_findif(name);
14621 + return(isdn_dw_abc_reset_interface(p->local,1));
14625 printk(KERN_INFO "INFO: ISDN_DW_ABC_EXTENSION not enabled\n");
14629 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
14630 + return(isdn_dw_abc_lcr_ioctl(arg));
14632 printk(KERN_INFO "INFO: ISDN_ABC_LCR_SUPPORT not enabled\n");
14635 #ifdef CONFIG_NETDEVICES
14637 /* Add a network-interface */
14638 @@ -1650,22 +1804,12 @@
14640 int retval = -ENODEV;
14642 +#ifdef COMPAT_USE_MODCOUNT_LOCK
14643 + MOD_INC_USE_COUNT;
14646 if (minor == ISDN_MINOR_STATUS) {
14649 - if ((p = kmalloc(sizeof(infostruct), GFP_KERNEL))) {
14650 - p->next = (char *) dev->infochain;
14651 - p->private = (char *) &(filep->private_data);
14652 - dev->infochain = p;
14653 - /* At opening we allow a single update */
14654 - filep->private_data = (char *) 1;
14658 - retval = -ENOMEM;
14661 + return isdnstatus_open(ino, filep);
14663 if (!dev->channels)
14665 @@ -1688,6 +1832,9 @@
14668 isdn_lock_drivers();
14669 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
14670 + if(!drvidx) isdn_dw_abc_lcr_open();
14675 @@ -1700,6 +1847,10 @@
14679 +#ifdef COMPAT_USE_MODCOUNT_LOCK
14681 + MOD_DEC_USE_COUNT;
14686 @@ -1708,25 +1859,11 @@
14688 uint minor = MINOR(ino->i_rdev);
14690 +#ifndef COMPAT_USE_MODCOUNT_LOCK
14693 if (minor == ISDN_MINOR_STATUS) {
14694 - infostruct *p = dev->infochain;
14695 - infostruct *q = NULL;
14698 - if (p->private == (char *) &(filep->private_data)) {
14700 - q->next = p->next;
14702 - dev->infochain = (infostruct *) (p->next);
14707 - p = (infostruct *) (p->next);
14709 - printk(KERN_WARNING "isdn: No private data while closing isdnctrl\n");
14711 + isdnstatus_close(ino, filep);
14713 isdn_unlock_drivers();
14714 if (minor <= ISDN_MINOR_BMAX)
14715 @@ -1734,6 +1871,12 @@
14716 if (minor <= ISDN_MINOR_CTRLMAX) {
14717 if (dev->profd == current)
14719 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
14721 + int drvidx = isdn_minor2drv(minor - ISDN_MINOR_CTRL);
14722 + if(!drvidx) isdn_dw_abc_lcr_close();
14727 #ifdef CONFIG_ISDN_PPP
14728 @@ -1742,13 +1885,19 @@
14732 +#ifdef COMPAT_USE_MODCOUNT_LOCK
14733 + MOD_DEC_USE_COUNT;
14740 static struct file_operations isdn_fops =
14742 +#ifdef COMPAT_HAS_FILEOP_OWNER
14743 owner: THIS_MODULE,
14748 @@ -1801,6 +1950,15 @@
14749 if (USG_NONE(dev->usage[i]) &&
14750 (dev->drvmap[i] != -1)) {
14751 int d = dev->drvmap[i];
14752 +#ifdef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
14753 + if(jiffies < dev->dwabc_chan_external_inuse[i]) {
14755 + if((dev->dwabc_chan_external_inuse[i] - jiffies) > (HZ * 120))
14756 + dev->dwabc_chan_external_inuse[i] = 0;
14761 if ((dev->usage[i] & ISDN_USAGE_EXCLUSIVE) &&
14762 ((pre_dev != d) || (pre_chan != dev->chanmap[i])))
14764 @@ -1819,7 +1977,11 @@
14765 restore_flags(flags);
14768 +#ifdef CONFIG_ISDN_WITH_ABC
14769 + if ((pre_dev == d) && ((pre_chan == dev->chanmap[i]) || pre_chan > 1000)) {
14771 if ((pre_dev == d) && (pre_chan == dev->chanmap[i])) {
14773 dev->usage[i] &= ISDN_USAGE_EXCLUSIVE;
14774 dev->usage[i] |= usage;
14775 isdn_info_update();
14776 @@ -2006,7 +2168,7 @@
14778 if ((adding) && (d->rcverr))
14780 - if (!(d->rcverr = kmalloc(sizeof(int) * m, GFP_KERNEL))) {
14781 + if (!(d->rcverr = (int *) kmalloc(sizeof(int) * m, GFP_KERNEL))) {
14782 printk(KERN_WARNING "register_isdn: Could not alloc rcverr\n");
14785 @@ -2014,7 +2176,7 @@
14787 if ((adding) && (d->rcvcount))
14788 kfree(d->rcvcount);
14789 - if (!(d->rcvcount = kmalloc(sizeof(int) * m, GFP_KERNEL))) {
14790 + if (!(d->rcvcount = (int *) kmalloc(sizeof(int) * m, GFP_KERNEL))) {
14791 printk(KERN_WARNING "register_isdn: Could not alloc rcvcount\n");
14792 if (!adding) kfree(d->rcverr);
14794 @@ -2026,7 +2188,8 @@
14795 skb_queue_purge(&d->rpqueue[j]);
14798 - if (!(d->rpqueue = kmalloc(sizeof(struct sk_buff_head) * m, GFP_KERNEL))) {
14799 + if (!(d->rpqueue =
14800 + (struct sk_buff_head *) kmalloc(sizeof(struct sk_buff_head) * m, GFP_KERNEL))) {
14801 printk(KERN_WARNING "register_isdn: Could not alloc rpqueue\n");
14803 kfree(d->rcvcount);
14804 @@ -2040,7 +2203,8 @@
14806 if ((adding) && (d->rcv_waitq))
14807 kfree(d->rcv_waitq);
14808 - d->rcv_waitq = kmalloc(sizeof(wait_queue_head_t) * 2 * m, GFP_KERNEL);
14809 + d->rcv_waitq = (wait_queue_head_t *)
14810 + kmalloc(sizeof(wait_queue_head_t) * 2 * m, GFP_KERNEL);
14811 if (!d->rcv_waitq) {
14812 printk(KERN_WARNING "register_isdn: Could not alloc rcv_waitq\n");
14814 @@ -2064,7 +2228,9 @@
14815 if (dev->chanmap[k] < 0) {
14816 dev->chanmap[k] = j;
14817 dev->drvmap[k] = drvidx;
14818 +#ifdef HAVE_DEVFS_FS
14819 isdn_register_devfs(k);
14820 +#endif /* HAVE_DEVFS_FS */
14823 restore_flags(flags);
14824 @@ -2128,6 +2294,7 @@
14825 i_div->ll_cmd = isdn_command; /* set command function */
14826 i_div->drv_to_name = map_drvname;
14827 i_div->name_to_drv = map_namedrv;
14828 + i_div->dial_net_name = isdn_net_force_dial;
14830 divert_if = i_div; /* remember interface */
14831 return(DIVERT_NO_ERR);
14832 @@ -2165,7 +2332,7 @@
14833 printk(KERN_WARNING "register_isdn: No write routine given.\n");
14836 - if (!(d = kmalloc(sizeof(driver), GFP_KERNEL))) {
14837 + if (!(d = (driver *) kmalloc(sizeof(driver), GFP_KERNEL))) {
14838 printk(KERN_WARNING "register_isdn: Could not alloc driver-struct\n");
14841 @@ -2225,6 +2392,7 @@
14845 +#ifdef HAVE_DEVFS_FS
14846 #ifdef CONFIG_DEVFS_FS
14848 static devfs_handle_t devfs_handle;
14849 @@ -2314,6 +2482,7 @@
14852 #endif /* CONFIG_DEVFS_FS */
14853 +#endif /* HAVE_DEVFS_FS */
14856 * Allocate and initialize all data, register modem-devices
14857 @@ -2331,7 +2500,6 @@
14858 init_timer(&dev->timer);
14859 dev->timer.function = isdn_timer_funct;
14860 init_MUTEX(&dev->sem);
14861 - init_waitqueue_head(&dev->info_waitq);
14862 for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
14863 dev->drvmap[i] = -1;
14864 dev->chanmap[i] = -1;
14865 @@ -2345,7 +2513,9 @@
14869 +#ifdef HAVE_DEVFS_FS
14871 +#endif /* HAVE_DEVFS_FS */
14872 if ((i = isdn_tty_modem_init()) < 0) {
14873 printk(KERN_WARNING "isdn: Could not register tty devices\n");
14875 @@ -2353,7 +2523,9 @@
14877 tty_unregister_driver(&dev->mdm.tty_modem);
14879 +#ifdef HAVE_DEVFS_FS
14880 isdn_cleanup_devfs();
14881 +#endif /* HAVE_DEVFS_FS */
14882 devfs_unregister_chrdev(ISDN_MAJOR, "isdn");
14885 @@ -2364,7 +2536,9 @@
14886 tty_unregister_driver(&dev->mdm.cua_modem);
14887 for (i = 0; i < ISDN_MAX_CHANNELS; i++)
14888 kfree(dev->mdm.info[i].xmit_buf - 4);
14889 +#ifdef HAVE_DEVFS_FS
14890 isdn_cleanup_devfs();
14891 +#endif /* HAVE_DEVFS_FS */
14892 devfs_unregister_chrdev(ISDN_MAJOR, "isdn");
14895 @@ -2390,6 +2564,9 @@
14898 isdn_info_update();
14899 +#ifdef CONFIG_ISDN_WITH_ABC
14900 + isdn_dw_abc_init_func();
14905 @@ -2398,7 +2575,7 @@
14907 static void __exit isdn_exit(void)
14909 - unsigned long flags;
14913 #ifdef CONFIG_ISDN_PPP
14914 @@ -2432,13 +2609,18 @@
14915 printk(KERN_WARNING "isdn: controldevice busy, remove cancelled\n");
14916 restore_flags(flags);
14918 +#ifdef HAVE_DEVFS_FS
14919 isdn_cleanup_devfs();
14920 +#endif /* HAVE_DEVFS_FS */
14921 del_timer(&dev->timer);
14922 restore_flags(flags);
14923 /* call vfree with interrupts enabled, else it will hang */
14925 printk(KERN_NOTICE "ISDN-subsystem unloaded\n");
14927 +#ifdef CONFIG_ISDN_WITH_ABC
14928 + isdn_dw_abc_release_func();
14932 module_init(isdn_init);
14933 diff -rNu linux-2.4.29.old/drivers/isdn/isdn_common.h linux-2.4.29/drivers/isdn/isdn_common.h
14934 --- linux-2.4.29.old/drivers/isdn/isdn_common.h 2005-03-22 14:47:56.000000000 +0100
14935 +++ linux-2.4.29/drivers/isdn/isdn_common.h 2005-03-22 15:06:44.374346856 +0100
14937 -/* $Id: isdn_common.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
14938 +/* $Id: isdn_common.h,v 1.22 2001/09/24 13:22:42 kai Exp $
14940 * header for Linux ISDN subsystem
14941 * common used functions and debugging-switches (linklevel).
14943 #undef ISDN_DEBUG_NET_DIAL
14944 #undef ISDN_DEBUG_NET_ICALL
14946 +#ifdef CONFIG_ISDN_WITH_ABC
14947 +int isdn_net_force_dial_lp(isdn_net_local *);
14950 extern void isdn_MOD_INC_USE_COUNT(void);
14951 extern void isdn_MOD_DEC_USE_COUNT(void);
14952 diff -rNu linux-2.4.29.old/drivers/isdn/isdn_concap.c linux-2.4.29/drivers/isdn/isdn_concap.c
14953 --- linux-2.4.29.old/drivers/isdn/isdn_concap.c 2005-03-22 14:47:56.000000000 +0100
14954 +++ linux-2.4.29/drivers/isdn/isdn_concap.c 2005-03-22 15:06:44.389344576 +0100
14956 -/* $Id: isdn_concap.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
14957 +/* $Id: isdn_concap.c,v 1.9 2001/09/24 13:22:42 kai Exp $
14959 * Linux ISDN subsystem, protocol encapsulation
14961 diff -rNu linux-2.4.29.old/drivers/isdn/isdn_concap.h linux-2.4.29/drivers/isdn/isdn_concap.h
14962 --- linux-2.4.29.old/drivers/isdn/isdn_concap.h 2005-03-22 14:47:56.000000000 +0100
14963 +++ linux-2.4.29/drivers/isdn/isdn_concap.h 2005-03-22 15:06:44.405342144 +0100
14965 -/* $Id: isdn_concap.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
14966 +/* $Id: isdn_concap.h,v 1.4 2001/09/24 13:22:42 kai Exp $
14968 * Linux ISDN subsystem, protocol encapsulation
14970 diff -rNu linux-2.4.29.old/drivers/isdn/isdn_dwabc.c linux-2.4.29/drivers/isdn/isdn_dwabc.c
14971 --- linux-2.4.29.old/drivers/isdn/isdn_dwabc.c 1970-01-01 01:00:00.000000000 +0100
14972 +++ linux-2.4.29/drivers/isdn/isdn_dwabc.c 2005-03-22 15:06:44.421339712 +0100
14975 +/* $Id: isdn_dwabc.c,v 1.27 2001/12/01 23:18:21 detabc Exp $
14977 + * Linux ISDN subsystem, abc-extension releated funktions.
14979 + * Copyright by abc GmbH
14980 + * written by Detlef Wengorz <detlefw@isdn4linux.de>
14982 + * This program is free software; you can redistribute it and/or modify
14983 + * it under the terms of the GNU General Public License as published by
14984 + * the Free Software Foundation; either version 2, or (at your option)
14985 + * any later version.
14989 +#include <linux/config.h>
14990 +#define __NO_VERSION__
14992 +#ifdef CONFIG_ISDN_WITH_ABC
14994 +static char *dwabcrevison = "$Revision: 1.27 $";
14996 +#include <asm/semaphore.h>
14997 +#define CONFIG_ISDN_WITH_ABC_NEED_DWSJIFFIES 1
14998 +#include <linux/list.h>
14999 +#include <linux/isdn.h>
15000 +#include "isdn_common.h"
15001 +#include "isdn_net.h"
15003 +#include <linux/skbuff.h>
15005 +#include <net/udp.h>
15006 +#include <net/checksum.h>
15007 +#include <linux/isdn_dwabc.h>
15010 +#if CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS && CONFIG_ISDN_PPP
15011 +#include <linux/isdn_ppp.h>
15012 +extern struct isdn_ppp_compressor *isdn_ippp_comp_head;
15013 +#define ipc_head isdn_ippp_comp_head
15014 +#ifndef CI_BSD_COMPRESS
15015 +#define CI_BSD_COMPRESS 21
15019 +#define NBYTEORDER_30BYTES 0x1e00
15020 +#define DWABC_TMRES (HZ / 10)
15022 +#define VERBLEVEL (dev->net_verbose > 2)
15024 +static struct timer_list dw_abc_timer;
15027 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
15028 +static ISDN_DWSPINLOCK lcr_spin = ISDN_DWSPIN_UNLOCKED;
15029 +#define LCR_LOCK() isdn_dwspin_trylock(&lcr_spin)
15030 +#define LCR_ULOCK() isdn_dwspin_unlock(&lcr_spin)
15032 +typedef struct ISDN_DW_ABC_LCR {
15034 + struct list_head dll;
15035 + char lcr_printbuf[64 + ISDN_MSNLEN + ISDN_MSNLEN];
15039 +} ISDN_DW_ABC_LCR;
15041 +static LIST_HEAD(lcr_dll);
15042 +static atomic_t lcr_open_count = ATOMIC_INIT(0);
15043 +static volatile ulong lcr_call_counter = 0;
15046 +static int myjiftime(char *p,u_long nj)
15048 + sprintf(p,"%02ld:%02ld.%02ld",
15049 + ((nj / 100) / 60) % 100, (nj / 100) % 60,nj % 100);
15055 +static void dw_lcr_clear_all(void)
15057 + struct list_head *lh;
15059 + if(!LCR_LOCK()) {
15061 + while((lh = lcr_dll.next) != &lcr_dll) {
15063 + ISDN_DW_ABC_LCR *p = list_entry(lh,ISDN_DW_ABC_LCR,dll);
15064 + list_del(&p->dll);
15072 +void isdn_dw_abc_lcr_open(void)
15073 +{ atomic_inc(&lcr_open_count); }
15075 +void isdn_dw_abc_lcr_close(void)
15077 + if(atomic_dec_and_test(&lcr_open_count))
15078 + dw_lcr_clear_all();
15081 +int isdn_dw_abc_lcr_lock(void)
15082 +{ return(LCR_LOCK()); }
15084 +void isdn_dw_abc_lcr_ulock(void)
15088 +size_t isdn_dw_abc_lcr_readstat(char *buf,size_t count)
15092 + while(buf != NULL && count > 0) {
15094 + struct list_head *lh = NULL;
15095 + ISDN_DW_ABC_LCR *p = NULL;
15099 + if((n = LCR_LOCK())) {
15108 + while((lh = lcr_dll.next) != &lcr_dll) {
15110 + p = list_entry(lh,ISDN_DW_ABC_LCR,dll);
15112 + if(p->lcr_poin >= p->lcr_epoin) {
15114 + list_del(&p->dll);
15127 + n = p->lcr_epoin - p->lcr_poin;
15132 + dp = p->lcr_poin;
15133 + p->lcr_poin += n;
15136 + copy_to_user(buf,dp,n);
15144 +static void isdn_dw_abc_lcr_clear_helper(isdn_net_local *lp)
15150 + a = lp->dw_abc_lcr_cmd;
15151 + b = lp->dw_abc_lcr_io;
15152 + lp->dw_abc_lcr_io = NULL;
15153 + lp->dw_abc_lcr_cmd = NULL;
15154 + lp->dw_abc_lcr_callid =
15155 + lp->dw_abc_lcr_start_request =
15156 + lp->dw_abc_lcr_end_request = 0;
15163 +void isdn_dw_abc_lcr_clear(isdn_net_local *lp)
15165 + if(!LCR_LOCK()) {
15166 + isdn_dw_abc_lcr_clear_helper(lp);
15172 +u_long isdn_dw_abc_lcr_call_number( isdn_net_local *lp,isdn_ctrl *call_cmd)
15179 + isdn_dw_abc_lcr_clear_helper(lp);
15181 + if( atomic_read(&lcr_open_count) > 0 &&
15183 + call_cmd != NULL) {
15185 + ISDN_DW_ABC_LCR *lc = NULL;
15188 + if((lp->dw_abc_lcr_cmd =
15189 + ( isdn_ctrl *)kmalloc(sizeof(isdn_ctrl),GFP_ATOMIC)) == NULL) {
15192 + isdn_dw_abc_lcr_clear_helper(lp);
15194 + printk(KERN_DEBUG "%s %d : LCR no memory\n",__FILE__,__LINE__);
15198 + memcpy(lp->dw_abc_lcr_cmd,call_cmd,sizeof(*call_cmd));
15199 + while(!(lp->dw_abc_lcr_callid = mid = lcr_call_counter++));
15201 + lp->dw_abc_lcr_end_request = lp->dw_abc_lcr_start_request = jiffies;
15202 + lp->dw_abc_lcr_end_request += HZ * 3;
15204 + if((lc = (ISDN_DW_ABC_LCR *)kmalloc(sizeof(*lc),GFP_KERNEL)) == NULL)
15207 + lc->lcr_poin = lc->lcr_epoin = lc->lcr_printbuf;
15208 + lc->lcr_epoin += myjiftime(lc->lcr_epoin,jiffies);
15210 + sprintf(lc->lcr_epoin," DW_ABC_LCR\t%lu\t%.*s\t%.*s\n",
15212 + (int)ISDN_MSNLEN,
15213 + call_cmd->parm.setup.eazmsn,
15214 + (int)ISDN_MSNLEN,
15215 + call_cmd->parm.setup.phone);
15217 + lc->lcr_epoin += strlen(lc->lcr_epoin);
15218 + ab = lc->lcr_epoin - lc->lcr_poin;
15220 + list_add_tail(&lc->dll,&lcr_dll);
15225 + if(dev->drv[0] != NULL ) {
15227 + dev->drv[0]->stavail += ab;
15228 + wake_up_interruptible(&dev->drv[0]->st_waitq);
15232 + } else LCR_ULOCK();
15238 +int isdn_dw_abc_lcr_ioctl(u_long arg)
15240 + struct ISDN_DWABC_LCR_IOCTL i;
15241 + int need = sizeof(struct ISDN_DWABC_LCR_IOCTL);
15244 + memset(&i,0,sizeof(struct ISDN_DWABC_LCR_IOCTL));
15245 + copy_from_user(&i,(char *)arg,sizeof(int));
15247 + if(i.lcr_ioctl_sizeof < need)
15248 + need = i.lcr_ioctl_sizeof;
15251 + copy_from_user(&i,(char *)arg,need);
15258 + for(;p ; p = p->next) {
15260 + isdn_net_local *lp = p->local;
15262 + if( lp->dw_abc_lcr_callid != i.lcr_ioctl_callid)
15265 + if(lp->dw_abc_lcr_cmd == NULL)
15268 + if(lp->dw_abc_lcr_io == NULL)
15269 + lp->dw_abc_lcr_io = (struct ISDN_DWABC_LCR_IOCTL *)
15270 + kmalloc(sizeof(struct ISDN_DWABC_LCR_IOCTL),GFP_ATOMIC);
15272 + if(lp->dw_abc_lcr_io == NULL) {
15274 + printk(KERN_DEBUG "%s %d : no memory\n",__FILE__,__LINE__);
15278 + memcpy(lp->dw_abc_lcr_io,&i,sizeof(struct ISDN_DWABC_LCR_IOCTL));
15280 + if(i.lcr_ioctl_flags & DWABC_LCR_FLG_NEWNUMBER) {
15282 + char *xx = i.lcr_ioctl_nr;
15283 + char *exx = xx + sizeof(i.lcr_ioctl_nr);
15284 + char *d = lp->dw_abc_lcr_cmd->parm.setup.phone;
15285 + char *ed = d + sizeof(lp->dw_abc_lcr_cmd->parm.setup.phone) - 1;
15287 + while(d < ed && xx < exx && *xx) *(d++) = *(xx++);
15288 + while(d < ed) *(d++) = 0;
15300 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK
15301 +int dw_abc_udp_test(struct sk_buff *skb,struct net_device *ndev)
15303 + if(ndev != NULL && skb != NULL && skb->protocol == htons(ETH_P_IP)) {
15305 + struct iphdr *iph = (struct iphdr *)skb->data;
15306 + isdn_net_local *lp = (isdn_net_local *) ndev->priv;
15307 + int rklen = skb->len;
15309 + if (skb->nh.raw > skb->data && skb->nh.raw < skb->tail) {
15311 + rklen -= (char *)skb->nh.raw - (char *)skb->data;
15312 + iph = (struct iphdr *)skb->nh.raw;
15315 + if(rklen >= 20 && iph->version == 4 &&
15316 + !(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_UDP_CHECK)) {
15318 + if( iph->tot_len == NBYTEORDER_30BYTES &&
15319 + iph->protocol == IPPROTO_UDP) {
15321 + struct udphdr *udp =
15322 + (struct udphdr *)((char *)iph + (iph->ihl << 2));
15324 + ushort usrc = ntohs(udp->source);
15326 + if( udp->dest == htons(25001) &&
15327 + usrc >= 20000 && usrc < 25000) {
15329 + char *p = (char *)(udp + 1);
15331 + if(p[0] == p[1]) {
15340 + if((lp->flags & ISDN_NET_CONNECTED) && (!lp->dialstate))
15348 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL
15349 + if((lp->flags & ISDN_NET_CONNECTED) && (!lp->dialstate)) {
15355 + if(!isdn_net_force_dial_lp(lp)) mc++;
15361 + isdn_dw_abc_reset_interface(lp,1);
15364 + case 0x28: mc = *p + 1; break;
15369 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP
15370 + if(!(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_UDP_HANGUP)) {
15372 + if(lp->isdn_device >= 0) {
15374 + isdn_net_hangup(ndev);
15384 + struct sk_buff *nskb;
15385 + int need = 2+sizeof(struct iphdr)+sizeof(struct udphdr);
15386 + int hneed = need + ndev->hard_header_len;
15388 + if((nskb = (struct sk_buff *)dev_alloc_skb(hneed)) != NULL) {
15390 + ushort n = sizeof(struct udphdr) + 2;
15391 + struct iphdr *niph;
15392 + struct udphdr *nup;
15393 + skb_reserve(nskb,ndev->hard_header_len);
15395 + if((niph = (struct iphdr *)skb_put(nskb,need))==NULL){
15397 + printk(KERN_DEBUG "%s: skb_put failt (%d bytes)\n", lp->name,hneed);
15398 + dev_kfree_skb(nskb);
15402 + nup = (struct udphdr *)(niph + 1);
15403 + ((char *)(nup + 1))[0] = mc;
15404 + ((char *)(nup + 1))[1] = mc;
15405 + nup->source=udp->dest;
15406 + nup->dest=udp->source;
15407 + nup->len=htons(n);
15408 + nup->check=0; /* dont need checksum */
15409 + memset((void *)niph,0,sizeof(*niph));
15412 + niph->tot_len=NBYTEORDER_30BYTES;
15414 + niph->protocol = IPPROTO_UDP;
15415 + niph->saddr=iph->daddr;
15416 + niph->daddr=iph->saddr;
15417 + niph->id=iph->id;
15418 + niph->check=ip_fast_csum((unsigned char *)niph,niph->ihl);
15419 + nskb->dev = ndev;
15420 + nskb->pkt_type = PACKET_HOST;
15421 + nskb->protocol = htons(ETH_P_IP);
15422 + nskb->mac.raw = nskb->data;
15439 +void isdn_dw_clear_if(ulong pm,isdn_net_local *lp)
15442 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
15443 + isdn_dw_abc_lcr_clear(lp);
15450 +static void dw_abc_timer_func(u_long dont_need_yet)
15452 + register u_long t;
15454 + if(!((t = ++isdn_dwabc_jiffies.msec_100) & 1))
15455 + if(isdn_dwabc_jiffies.msec_200++ & 1)
15456 + isdn_dwabc_jiffies.msec_400++;
15459 + if(isdn_dwabc_jiffies.msec_500++ & 1)
15460 + isdn_dwabc_jiffies.msec_1000++;
15462 + dw_abc_timer.expires = jiffies + DWABC_TMRES;
15463 + add_timer(&dw_abc_timer);
15467 +void isdn_dw_abc_init_func(void)
15470 + init_timer(&dw_abc_timer);
15471 + dw_abc_timer.function = dw_abc_timer_func;
15474 + printk( KERN_INFO
15475 + "abc-extension %s Kernel 0x%06X\n"
15476 + "written by\nDetlef Wengorz <detlefw@isdn4linux.de>\n"
15477 + "Installed options:\n"
15478 +#ifdef CONFIG_ISDN_WITH_ABC_CALLB
15479 + "CONFIG_ISDN_WITH_ABC_CALLB\n"
15481 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK
15482 + "CONFIG_ISDN_WITH_ABC_UDP_CHECK\n"
15484 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP
15485 + "CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP\n"
15487 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL
15488 + "CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL\n"
15490 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
15491 + "CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ\n"
15493 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
15494 + "CONFIG_ISDN_WITH_ABC_LCR_SUPPORT\n"
15496 +#ifdef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
15497 + "CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER\n"
15499 +#ifdef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
15500 + "CONFIG_ISDN_WITH_ABC_CH_EXTINUSE\n"
15502 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
15503 + "CONFIG_ISDN_WITH_ABC_CONN_ERROR\n"
15505 +#ifdef CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS
15506 + "CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS\n"
15509 + dwabcrevison,LINUX_VERSION_CODE);
15511 + dw_abc_timer.expires = jiffies + DWABC_TMRES;
15512 + add_timer(&dw_abc_timer);
15515 +void isdn_dw_abc_release_func(void)
15517 + del_timer(&dw_abc_timer);
15518 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
15519 + dw_lcr_clear_all();
15521 + printk( KERN_INFO
15522 + "abc-extension %s Kernel 0x%06X\n"
15524 + "Detlef Wengorz <detlefw@isdn4linux.de>\n"
15526 + dwabcrevison,LINUX_VERSION_CODE);
15530 +void isdn_dwabc_test_phone(isdn_net_local *lp)
15534 + isdn_net_phone *h = lp->phone[0];
15535 + ulong oflags = lp->dw_abc_flags;
15538 + lp->dw_abc_flags = 0;
15539 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
15540 + *lp->dw_out_msn = 0;
15543 + for(;h != NULL && secure < 1000;secure++,h = h->next) {
15545 + char *p = h->num;
15546 + char *ep = p + ISDN_MSNLEN;
15548 + for(;p < ep && *p && (*p <= ' ' || *p == '"' || *p == '\'');p++);
15553 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
15556 + if(++p < ep && *p != '<' && *p != '>') {
15558 + char *d = lp->dw_out_msn;
15560 + for(;*p && (p < ep) && (*p == ' ' || *p == '\t');p++);
15561 + for(ep--;*p && (p < ep);) *(d++) = *(p++);
15570 + /* abc switch's */
15572 + for(p++;p < ep && *p;p++) switch(*p) {
15573 + case 'u': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_NO_UDP_CHECK; break;
15574 + case 'h': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_NO_UDP_HANGUP; break;
15575 + case 'd': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_NO_UDP_DIAL; break;
15576 + case 'c': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_NO_CH_EXTINUSE; break;
15577 + case 'e': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_NO_CONN_ERROR; break;
15578 + case 'l': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_NO_LCR; break;
15581 + case 'X': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_RCV_NO_HUPTIMER; break;
15583 + case 'B': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_BSD_COMPRESS; break;
15584 + case 'L': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_LEASED_LINE; break;
15589 + case '\'': break;
15592 + printk(KERN_DEBUG"isdn_net: %s abc-switch <~%c> unknown\n",lp->name,*p);
15598 + if(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_LEASED_LINE) {
15600 + lp->dw_abc_flags |=
15601 + ISDN_DW_ABC_FLAG_NO_UDP_CHECK |
15602 + ISDN_DW_ABC_FLAG_NO_UDP_HANGUP |
15603 + ISDN_DW_ABC_FLAG_NO_UDP_DIAL |
15604 + ISDN_DW_ABC_FLAG_NO_CH_EXTINUSE |
15605 + ISDN_DW_ABC_FLAG_NO_CONN_ERROR |
15606 + ISDN_DW_ABC_FLAG_NO_LCR;
15609 + if(dev->net_verbose && (lp->dw_abc_flags != oflags || dev->net_verbose > 4))
15610 + printk(KERN_DEBUG "isdn_net %s abc-flags 0x%lx\n",lp->name,lp->dw_abc_flags);
15616 +int isdn_dw_abc_reset_interface(isdn_net_local *lp,int with_message)
15624 + lp->dw_abc_bchan_last_connect = 0;
15625 + lp->dw_abc_dialstart = 0;
15626 + lp->dw_abc_inuse_secure = 0;
15627 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
15628 + lp->dw_abc_bchan_errcnt = 0;
15631 + if(with_message && dev->net_verbose > 0)
15633 + "%s: NOTE: reset (clear) abc-interface-secure-counter\n",
15641 +#if CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS && CONFIG_ISDN_PPP
15643 +#define DWBSD_PKT_FIRST_LEN 16
15644 +#define DWBSD_PKT_SWITCH 165
15645 +#define DWBSD_PKT_BSD 189
15647 +#define DWBSD_VERSION 0x2
15649 +void dwabc_bsd_first_gen(isdn_net_local *lp)
15651 + if(lp != NULL && lp->p_encap == ISDN_NET_ENCAP_RAWIP &&
15652 + (lp->dw_abc_flags & ISDN_DW_ABC_FLAG_BSD_COMPRESS)) {
15654 + struct sk_buff *skb = NULL;
15658 + if((skb =(struct sk_buff *)dev_alloc_skb(128)) == NULL) {
15660 + printk(KERN_INFO "%s: dwabc: alloc-skb failed for 128 bytes\n",lp->name);
15664 + skb_reserve(skb,64);
15665 + p = skb_put(skb,DWBSD_PKT_FIRST_LEN);
15666 + ep = p + DWBSD_PKT_FIRST_LEN;
15668 + *(p++) = DWBSD_PKT_SWITCH;
15669 + *(p++) = DWBSD_VERSION;
15670 + for(;p < ep;p++) *(p++) = 0;
15672 + isdn_net_write_super(lp, skb);
15674 + if(dev->net_verbose > 2)
15675 + printk(KERN_INFO "%s: dwabc: sending comm-header version 0x%x\n",lp->name,DWBSD_VERSION);
15680 +void dwabc_bsd_free(isdn_net_local *lp)
15684 + if(lp->dw_abc_bsd_stat_rx || lp->dw_abc_bsd_stat_tx) {
15686 + struct isdn_ppp_compressor *c = NULL;
15688 + if(!(c = (struct isdn_ppp_compressor *)lp->dw_abc_bsd_compressor)) {
15690 + printk(KERN_WARNING
15691 + "%s: PANIC: freeing bsd compressmemory without compressor\n",
15696 + if(lp->dw_abc_bsd_stat_rx) (*c->free)(lp->dw_abc_bsd_stat_rx);
15697 + if(lp->dw_abc_bsd_stat_tx) (*c->free)(lp->dw_abc_bsd_stat_tx);
15699 + if(dev->net_verbose > 2)
15701 + "%s: free bsd compress-memory\n",
15706 + lp->dw_abc_bsd_compressor = NULL;
15707 + lp->dw_abc_bsd_stat_rx = NULL;
15708 + lp->dw_abc_bsd_stat_tx = NULL;
15709 + lp->dw_abc_if_flags &= ~ISDN_DW_ABC_IFFLAG_BSDAKTIV;
15711 + if(dev->net_verbose > 0) {
15713 + if(lp->dw_abc_bsd_rcv != lp->dw_abc_bsd_bsd_rcv) {
15715 + printk(KERN_INFO "%s: Receive %lu<-%lu kb\n",lp->name,
15716 + lp->dw_abc_bsd_rcv >> 10 , lp->dw_abc_bsd_bsd_rcv >> 10);
15720 + if(lp->dw_abc_bsd_snd != lp->dw_abc_bsd_bsd_snd) {
15722 + printk(KERN_INFO "%s: Send %lu->%lu kb\n",lp->name,
15723 + lp->dw_abc_bsd_snd >> 10 , lp->dw_abc_bsd_bsd_snd >> 10);
15727 + lp->dw_abc_bsd_rcv =
15728 + lp->dw_abc_bsd_bsd_rcv =
15729 + lp->dw_abc_bsd_snd =
15730 + lp->dw_abc_bsd_bsd_snd = 0;
15735 +int dwabc_bsd_init(isdn_net_local *lp)
15741 + dwabc_bsd_free(lp);
15743 + if(lp->p_encap == ISDN_NET_ENCAP_RAWIP) {
15747 + struct isdn_ppp_comp_data *cp = NULL;
15748 + struct isdn_ppp_compressor *c = NULL;
15750 + if(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_BSD_COMPRESS) do {
15752 + for(c = ipc_head ;
15753 + c != NULL && c->num != CI_BSD_COMPRESS; c = c->next);
15758 + "%s: Module isdn_bsdcompress not loaded\n",
15764 + cp = (struct isdn_ppp_comp_data *)
15765 + kmalloc(sizeof(struct isdn_ppp_comp_data),GFP_ATOMIC);
15770 + "%s: allocation of isdn_ppp_comp_data failed\n",
15776 + memset(cp,0,sizeof(*cp));
15777 + cp->num = CI_BSD_COMPRESS;
15781 + ** set BSD_VERSION 1 and 12 bits compressmode
15783 + *cp->options = (1 << 5) | 12;
15785 + if((rx = (*c->alloc)(cp)) == NULL) {
15788 + "%s: allocation of bsd rx-memory failed\n",
15794 + if(!(*c->init)(rx,cp,0,1)) {
15797 + "%s: init of bsd rx-stream failed\n",lp->name);
15802 + cp->flags = IPPP_COMP_FLAG_XMIT;
15804 + if((tx = (*c->alloc)(cp)) == NULL) {
15807 + "%s: allocation of bsd tx-memory failed\n",
15813 + if(!(*c->init)(tx,cp,0,1)) {
15816 + "%s: init of bsd tx-stream failed\n",
15822 + lp->dw_abc_bsd_compressor = (void *)c;
15823 + lp->dw_abc_bsd_stat_rx = rx;
15824 + lp->dw_abc_bsd_stat_tx = tx;
15828 + if(dev->net_verbose > 2)
15830 + "%s: bsd compress-memory and init ok\n",
15840 + if(tx != NULL) (*c->free)(tx);
15841 + if(rx != NULL) (*c->free)(rx);
15844 + } else if(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_BSD_COMPRESS) {
15847 + "%s: bsd-compress only with encapsulation rawip allowed\n",
15855 +struct sk_buff *dwabc_bsd_compress( isdn_net_local *lp,
15856 + struct sk_buff *skb,
15857 + struct net_device *ndev)
15859 + if(lp != NULL && lp->p_encap == ISDN_NET_ENCAP_RAWIP &&
15860 + (lp->dw_abc_flags & ISDN_DW_ABC_FLAG_BSD_COMPRESS) &&
15861 + (lp->dw_abc_if_flags & ISDN_DW_ABC_IFFLAG_BSDAKTIV)) {
15863 + if(lp->dw_abc_bsd_stat_tx != NULL && lp->dw_abc_bsd_compressor) {
15865 + struct isdn_ppp_compressor *cp =
15866 + (struct isdn_ppp_compressor *)lp->dw_abc_bsd_compressor;
15868 + struct sk_buff *nskb = (struct sk_buff *)
15869 + dev_alloc_skb(skb->len * 2 + ndev->hard_header_len);
15873 + if(nskb == NULL) {
15875 + (void)(*cp->reset)(lp->dw_abc_bsd_stat_tx,0,0,NULL,0,NULL);
15876 + printk(KERN_INFO "%s: dwabc-compress no memory\n",lp->name);
15880 + skb_reserve(nskb,ndev->hard_header_len);
15881 + *(unsigned char *)skb_put(nskb,1) = DWBSD_PKT_BSD;
15882 + l = (*cp->compress)(lp->dw_abc_bsd_stat_tx,skb,nskb,0x21);
15884 + if(l < 1 || l > skb->len) {
15886 + (void)(*cp->reset)(lp->dw_abc_bsd_stat_tx,0,0,NULL,0,NULL);
15887 + dev_kfree_skb(nskb);
15893 + dev_kfree_skb(skb);
15895 + sqnr = ((*(u_char *)skb->data) << 8) +
15896 + ((u_char)skb->data[1]);
15899 + (void)(*cp->reset)
15900 + (lp->dw_abc_bsd_stat_tx,0,0,NULL,0,NULL);
15909 +struct sk_buff *dwabc_bsd_rx_pkt( isdn_net_local *lp,
15910 + struct sk_buff *skb,
15911 + struct net_device *ndev)
15913 + struct sk_buff *r = skb;
15915 + if(lp != NULL && lp->p_encap == ISDN_NET_ENCAP_RAWIP &&
15916 + (lp->dw_abc_flags & ISDN_DW_ABC_FLAG_BSD_COMPRESS)) {
15918 + unsigned char *p = (unsigned char *)skb->data;
15919 + struct isdn_ppp_compressor *cp =
15920 + (struct isdn_ppp_compressor *)lp->dw_abc_bsd_compressor;
15922 + if(*p == DWBSD_PKT_SWITCH) {
15924 + if(skb->len == DWBSD_PKT_FIRST_LEN) {
15926 + if((lp->dw_abc_remote_version = p[1]) < 0x2) {
15929 + "%s: I can't really talk with remote version 0x%x\n"
15930 + "Please upgrade remote or disable rawip-compression\n",
15935 + lp->dw_abc_if_flags |= ISDN_DW_ABC_IFFLAG_BSDAKTIV;
15936 + dev_kfree_skb(skb);
15938 + if(cp && lp->dw_abc_bsd_stat_tx)
15939 + (void)(*cp->reset)(lp->dw_abc_bsd_stat_tx,0,0,NULL,0,NULL);
15941 + if(dev->net_verbose > 2)
15943 + "%s: receive comm-header rem-version 0x%02x\n",
15945 + lp->dw_abc_remote_version);
15950 + } else if(*p == DWBSD_PKT_BSD && lp->dw_abc_bsd_stat_rx != NULL && cp) {
15952 + struct sk_buff *nskb = NULL;
15954 + if(test_and_set_bit(ISDN_DW_ABC_BITLOCK_RECEIVE,
15955 + &lp->dw_abc_bitlocks)) {
15957 + printk(KERN_INFO "%s: bsd-decomp called recursivly\n",lp->name);
15958 + dev_kfree_skb(skb);
15959 + dwabc_bsd_first_gen(lp);
15963 + nskb = (struct sk_buff *)
15964 + dev_alloc_skb(2048 + ndev->hard_header_len);
15966 + if(nskb != NULL) {
15971 + skb_reserve(nskb,ndev->hard_header_len);
15972 + skb_pull(skb, 1);
15973 + sqnr = ((*(u_char *)skb->data) << 8) | ((u_char)skb->data[1]);
15975 + if(!sqnr && cp && lp->dw_abc_bsd_stat_rx)
15976 + (void)(*cp->reset)(lp->dw_abc_bsd_stat_rx,0,0,NULL,0,NULL);
15978 + if((l = (*cp->decompress)
15979 + (lp->dw_abc_bsd_stat_rx,skb,nskb,NULL)) < 1 || l>8000) {
15981 + printk(KERN_INFO "%s: abc-decomp failed\n",lp->name);
15982 + dev_kfree_skb(nskb);
15983 + dev_kfree_skb(skb);
15985 + dwabc_bsd_first_gen(lp);
15989 + if (nskb->data[0] & 0x1)
15990 + skb_pull(nskb, 1); /* protocol ID is only 8 bit */
15992 + skb_pull(nskb, 2);
15994 + nskb->dev = skb->dev;
15995 + nskb->pkt_type = skb->pkt_type;
15996 + nskb->mac.raw = nskb->data;
15997 + dev_kfree_skb(skb);
16002 + printk(KERN_INFO "%s: PANIC abc-decomp no memory\n",lp->name);
16003 + dev_kfree_skb(skb);
16004 + dwabc_bsd_first_gen(lp);
16007 + clear_bit(ISDN_DW_ABC_BITLOCK_RECEIVE,&lp->dw_abc_bitlocks);
16016 +int dwabc_bsd_init(isdn_net_local *lp) { return(1); }
16017 +void dwabc_bsd_free(isdn_net_local *lp) { return; }
16018 +void dwabc_bsd_first_gen(isdn_net_local *lp) { return ; }
16020 +struct sk_buff *dwabc_bsd_compress(isdn_net_local *lp,struct sk_buff *skb,struct net_device *ndev)
16023 +struct sk_buff *dwabc_bsd_rx_pkt(isdn_net_local *lp,struct sk_buff *skb,struct net_device *ndev)
16027 diff -rNu linux-2.4.29.old/drivers/isdn/isdn_net.c linux-2.4.29/drivers/isdn/isdn_net.c
16028 --- linux-2.4.29.old/drivers/isdn/isdn_net.c 2005-03-22 14:47:56.000000000 +0100
16029 +++ linux-2.4.29/drivers/isdn/isdn_net.c 2005-03-22 15:06:44.447335760 +0100
16031 -/* $Id: isdn_net.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
16032 +/* $Id: isdn_net.c,v 1.153 2002/08/17 18:35:23 detabc Exp $
16034 * Linux ISDN subsystem, network interfaces and related functions (linklevel).
16037 * This software may be used and distributed according to the terms
16038 * of the GNU General Public License, incorporated herein by reference.
16040 - * Data Over Voice (DOV) support added - Guy Ellis 23-Mar-02
16041 - * guy@traverse.com.au
16042 - * Outgoing calls - looks for a 'V' in first char of dialed number
16043 - * Incoming calls - checks first character of eaz as follows:
16044 - * Numeric - accept DATA only - original functionality
16045 - * 'V' - accept VOICE (DOV) only
16046 - * 'B' - accept BOTH DATA and DOV types
16048 * Jan 2001: fix CISCO HDLC Bjoern A. Zeeb <i4l@zabbadoz.net>
16049 * for info on the protocol, see
16050 * http://i4l.zabbadoz.net/i4l/cisco-hdlc.txt
16052 #include "isdn_concap.h"
16055 +#ifdef CONFIG_ISDN_WITH_ABC
16056 +#include <linux/isdn_dwabc.h>
16057 +#define isdn_net_log_skb(skb,lp) isdn_net_log_skb_dwabc(skb,lp,NULL)
16061 * Outline of new tbusy handling:
16066 +#ifdef COMPAT_NO_SOFTNET
16067 + return dev->start;
16069 return netif_running(dev);
16074 @@ -143,6 +143,10 @@
16075 atomic_inc(&lp->frame_cnt);
16076 if (isdn_net_device_busy(lp))
16077 isdn_net_device_stop_queue(lp);
16079 + printk(KERN_DEBUG "%s: inc_frame_cnt now %d\n", lp->name,
16080 + atomic_read(&lp->frame_cnt));
16084 static __inline__ void isdn_net_dec_frame_cnt(isdn_net_local *lp)
16085 @@ -157,11 +161,19 @@
16086 isdn_net_device_wake_queue(lp);
16090 + printk(KERN_DEBUG "%s: dec_frame_cnt now %d\n", lp->name,
16091 + atomic_read(&lp->frame_cnt));
16095 static __inline__ void isdn_net_zero_frame_cnt(isdn_net_local *lp)
16097 atomic_set(&lp->frame_cnt, 0);
16099 + printk(KERN_DEBUG "%s: zero_frame_cnt now %d\n", lp->name,
16100 + atomic_read(&lp->frame_cnt));
16104 /* For 2.2.x we leave the transmitter busy timeout at 2 secs, just
16105 @@ -173,23 +185,101 @@
16106 * which might rely on the tx timeout. If so, we'll find out this way...
16109 +#ifdef COMPAT_NO_SOFTNET
16110 +#define ISDN_NET_TX_TIMEOUT (2*HZ)
16112 #define ISDN_NET_TX_TIMEOUT (20*HZ)
16117 +#ifndef CONFIG_ISDN_WITH_ABC
16118 int isdn_net_force_dial_lp(isdn_net_local *);
16120 static int isdn_net_start_xmit(struct sk_buff *, struct net_device *);
16122 static void isdn_net_ciscohdlck_connected(isdn_net_local *lp);
16123 static void isdn_net_ciscohdlck_disconnected(isdn_net_local *lp);
16125 -char *isdn_net_revision = "$Revision: 1.1.4.1 $";
16126 +char *isdn_net_revision = "$Revision: 1.153 $";
16129 * Code for raw-networking over ISDN
16131 +#ifdef CONFIG_ISDN_WITH_ABC
16132 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
16133 +static int isdn_dwabc_encap_with_conerr(isdn_net_local *lp)
16135 + if(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_CONN_ERROR)
16139 + lp->p_encap == ISDN_NET_ENCAP_SYNCPPP ||
16140 + lp->p_encap == ISDN_NET_ENCAP_RAWIP ||
16141 + lp->p_encap == ISDN_NET_ENCAP_CISCOHDLCK ||
16142 + lp->p_encap == ISDN_NET_ENCAP_UIHDLC );
16145 +static int isdn_dwabc_conerr_ippktok(struct sk_buff *skb)
16147 + struct iphdr *iph = (struct iphdr *)skb->data;
16148 + return(iph->version == 6 || (skb->len >= 20 && iph->version == 4));
16153 +static int isdn_dwabc_is_interface_disabled(isdn_net_local *lp)
16158 + lp->dw_abc_inuse_secure = 0;
16159 + lp->dw_abc_dialstart = 0;
16162 + ** check for jiffies overflow
16164 + if(lp->dw_abc_bchan_last_connect > jiffies) {
16166 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
16167 + lp->dw_abc_bchan_errcnt = 0;
16169 + lp->dw_abc_bchan_last_connect = 0;
16172 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
16173 + if(!(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_CONN_ERROR) && isdn_dwabc_encap_with_conerr(lp)) {
16175 + if(lp->dw_abc_bchan_errcnt > 3 && !(lp->dw_abc_bchan_errcnt & 3)) {
16177 + ulong nj = jiffies;
16178 + ulong delay = lp->dw_abc_bchan_errcnt *
16179 + lp->dw_abc_bchan_errcnt *
16180 + lp->dw_abc_bchan_errcnt;
16182 + if(delay > 86400) delay = 86400;
16183 + delay = (lp->dw_abc_bchan_last_connect + delay * HZ);
16188 + "%s: interface auto-disabled (bchannel connect-error %lu seconds left)\n",
16189 + lp->name,(delay - nj) / HZ);
16200 +#ifdef CONFIG_ISDN_WITH_ABC
16205 isdn_net_unreachable(struct net_device *dev, struct sk_buff *skb, char *reason)
16208 @@ -297,6 +387,12 @@
16212 +#ifdef CONFIG_ISDN_WITH_ABC
16213 + isdn_dw_clear_if(0l,lp);
16214 + lp->dw_abc_if_flags &= ~ISDN_DW_ABC_IFFLAG_NODCHAN;
16215 + lp->dw_abc_inuse_secure = 0;
16216 + dwabc_bsd_free(lp);
16218 skb_queue_purge(&lp->super_tx_queue);
16220 if (!lp->master) { /* reset only master device */
16221 @@ -351,6 +447,26 @@
16222 if ((l->flags & ISDN_NET_CONNECTED) && (!l->dialstate)) {
16225 +#ifdef CONFIG_ISDN_WITH_ABC
16226 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
16227 + if( isdn_dwabc_encap_with_conerr(l) && l->dw_abc_bchan_errcnt > 0) {
16231 + if(l->dw_abc_bchan_errcnt > 3) n = 120;
16232 + if(l->dw_abc_bchan_errcnt > 6) n = 90;
16233 + if(l->dw_abc_bchan_errcnt > 9) n = 60;
16235 + if(l->huptimer > n) {
16237 + printk(KERN_INFO "%s: bchan conf-error auto-secure-hangup\n",l->name);
16238 + isdn_net_hangup(&p->dev);
16239 + p = (isdn_net_dev *) p->next;
16246 * if there is some dialmode where timeout-hangup
16247 * should _not_ be done, check for that here
16248 @@ -465,8 +581,32 @@
16249 printk(KERN_INFO "%s: Chargesum is %d\n", lp->name,
16251 isdn_net_unbind_channel(lp);
16252 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
16253 + if(lp->dw_abc_bchan_errcnt) {
16256 + "%s: Note: bchannel-error-counter is %hd\n",
16258 + lp->dw_abc_bchan_errcnt);
16263 +#ifdef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
16264 + if(!(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_CH_EXTINUSE)) {
16265 + if((lp->dialstate == 4 || lp->dialstate == 12) &&
16266 + lp->dw_abc_dialstart && (idx < ISDN_MAX_CHANNELS)) {
16268 + if((jiffies - lp->dw_abc_dialstart) < (HZ >>2)) {
16270 + lp->dw_abc_if_flags |= ISDN_DW_ABC_IFFLAG_NODCHAN;
16271 + lp->dialstate = 1;
16272 + dev->dwabc_chan_external_inuse[idx] = jiffies + HZ * 30;
16273 + printk(KERN_INFO "%s: Channel %d look like external in use\n",lp->name,idx);
16279 #ifdef CONFIG_ISDN_X25
16280 case ISDN_STAT_BHUP:
16281 @@ -507,6 +647,19 @@
16284 printk(KERN_INFO "isdn_net: %s connected\n", lp->name);
16285 +#ifdef CONFIG_ISDN_WITH_ABC
16286 + if(!dwabc_bsd_init(lp)) dwabc_bsd_first_gen(lp);
16287 + lp->dw_abc_bchan_last_connect = jiffies;
16288 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
16289 + if(!(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_CONN_ERROR)) {
16291 + lp->dw_abc_bchan_errcnt += isdn_dwabc_encap_with_conerr(lp);
16293 + if(lp->dw_abc_bchan_errcnt > 32000)
16294 + lp->dw_abc_bchan_errcnt = 32000;
16298 /* If first Chargeinfo comes before B-Channel connect,
16299 * we correct the timestamp here.
16301 @@ -578,7 +731,6 @@
16303 unsigned long flags;
16305 - u_char *phone_number;
16308 isdn_net_local *lp = p->local;
16309 @@ -597,6 +749,47 @@
16313 +#ifdef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
16314 + if(!(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_CH_EXTINUSE) &&
16315 + (lp->dw_abc_if_flags & ISDN_DW_ABC_IFFLAG_NODCHAN)) {
16318 + short lsecure = 0;
16320 + lsecure = lp->dw_abc_inuse_secure;
16321 + isdn_net_unbind_channel(lp);
16322 + lp->dw_abc_inuse_secure = lsecure + 1;
16324 + /* Grab a free ISDN-Channel */
16325 + if ((lsecure >= ISDN_MAX_CHANNELS ) || (chi =
16326 + isdn_get_free_channel(
16332 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
16333 + (*lp->dw_out_msn) ? lp->dw_out_msn : lp->msn)
16339 + restore_flags(flags);
16340 + isdn_net_unreachable(&p->dev, NULL,
16341 + "DWABC: redial-external-inuse NO FREE CHANNEL\n");
16342 + isdn_net_hangup(&p->dev);
16346 + isdn_net_bind_channel(lp, chi);
16347 + lp->dialstate = 1;
16348 + lp->dialstarted = 0;
16349 + lp->dialwait_timer = 0;
16352 + lp->dw_abc_if_flags &= ~ISDN_DW_ABC_IFFLAG_NODCHAN;
16354 lp->dial = lp->phone[1];
16355 restore_flags(flags);
16357 @@ -621,18 +814,69 @@
16358 cmd.arg = lp->isdn_channel;
16359 cmd.command = ISDN_CMD_CLREAZ;
16360 isdn_command(&cmd);
16361 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
16362 + sprintf(cmd.parm.num, "%s",
16363 + isdn_map_eaz2msn((*lp->dw_out_msn) ? lp->dw_out_msn : lp->msn, cmd.driver));
16365 sprintf(cmd.parm.num, "%s", isdn_map_eaz2msn(lp->msn, cmd.driver));
16367 cmd.command = ISDN_CMD_SETEAZ;
16368 isdn_command(&cmd);
16372 +#ifdef CONFIG_ISDN_WITH_ABC
16373 + lp->onhtime = lp->dw_abc_old_onhtime;
16374 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
16375 + isdn_dw_abc_lcr_clear(lp);
16380 /* Setup interface, dial current phone-number, switch to next number.
16381 * If list of phone-numbers is exhausted, increment
16384 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
16385 + if(!isdn_dw_abc_lcr_lock()) {
16387 + if( lp->dw_abc_lcr_cmd != NULL &&
16388 + lp->dw_abc_lcr_start_request !=
16389 + lp->dw_abc_lcr_end_request) {
16391 + if( lp->dw_abc_lcr_io == NULL &&
16392 + lp->dw_abc_lcr_start_request <= jiffies &&
16393 + lp->dw_abc_lcr_end_request > jiffies) {
16395 + isdn_dw_abc_lcr_ulock();
16400 + if(lp->dw_abc_lcr_io != NULL) {
16402 + if(lp->dw_abc_lcr_io->lcr_ioctl_flags &
16403 + DWABC_LCR_FLG_DISABLE) {
16405 + isdn_dw_abc_lcr_ulock();
16406 + isdn_net_hangup(&p->dev);
16410 + if(lp->dw_abc_lcr_io->lcr_ioctl_flags &
16411 + DWABC_LCR_FLG_NEWHUPTIME) {
16412 + lp->onhtime = lp->dw_abc_lcr_io->lcr_ioctl_onhtime;
16416 + memcpy(&cmd,lp->dw_abc_lcr_cmd,sizeof(cmd));
16417 + isdn_dw_abc_lcr_ulock();
16418 + goto dw_abc_lcr_next_click;
16421 + isdn_dw_abc_lcr_ulock();
16424 if(dev->global_flags & ISDN_GLOBAL_STOPPED || (ISDN_NET_DIALMODE(*lp) == ISDN_NET_DM_OFF)) {
16426 if (dev->global_flags & ISDN_GLOBAL_STOPPED)
16427 @@ -677,20 +921,7 @@
16431 - cmd.driver = lp->isdn_device;
16432 - cmd.command = ISDN_CMD_DIAL;
16433 - cmd.parm.setup.si2 = 0;
16435 - /* check for DOV */
16436 - phone_number = lp->dial->num;
16437 - if ((*phone_number == 'v') ||
16438 - (*phone_number == 'V')) { /* DOV call */
16439 - cmd.parm.setup.si1 = 1;
16440 - } else { /* DATA call */
16441 - cmd.parm.setup.si1 = 7;
16444 - strcpy(cmd.parm.setup.phone, phone_number);
16445 + sprintf(cmd.parm.setup.phone, "%s", lp->dial->num);
16447 * Switch to next number or back to start if at end of list.
16449 @@ -710,17 +941,70 @@
16452 restore_flags(flags);
16453 + cmd.driver = lp->isdn_device;
16454 + cmd.command = ISDN_CMD_DIAL;
16455 + cmd.parm.setup.si1 = 7;
16456 + cmd.parm.setup.si2 = 0;
16457 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
16458 + sprintf(cmd.parm.setup.eazmsn, "%s",
16459 + isdn_map_eaz2msn((*lp->dw_out_msn) ? lp->dw_out_msn : lp->msn, cmd.driver));
16461 sprintf(cmd.parm.setup.eazmsn, "%s",
16462 isdn_map_eaz2msn(lp->msn, cmd.driver));
16464 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
16466 + ** if callback-out we dont need
16467 + ** low-cost-routing LCR
16469 + if(!(lp->flags & ISDN_NET_CBOUT) &&
16470 + !(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_LCR)) {
16472 + isdn_dw_abc_lcr_call_number(lp,&cmd);
16474 + if(lp->dw_abc_lcr_start_request != lp->dw_abc_lcr_end_request) {
16476 + if(dev->net_verbose > 2) {
16479 + "%s: Waiting for LCR-response from isdnlog %s -> %s...\n",
16481 + cmd.parm.setup.eazmsn,
16482 + cmd.parm.setup.phone);
16490 +dw_abc_lcr_next_click:;
16491 + isdn_dw_abc_lcr_clear(lp);
16493 i = isdn_dc2minor(lp->isdn_device, lp->isdn_channel);
16495 strcpy(dev->num[i], cmd.parm.setup.phone);
16496 dev->usage[i] |= ISDN_USAGE_OUTGOING;
16497 isdn_info_update();
16499 - printk(KERN_INFO "%s: dialing %d %s... %s\n", lp->name,
16500 - lp->dialretry, cmd.parm.setup.phone,
16501 - (cmd.parm.setup.si1 == 1) ? "DOV" : "");
16502 +#ifdef CONFIG_ISDN_WITH_ABC
16503 + printk(KERN_INFO "%s: dialing %d %s -> %s...\n", lp->name,
16505 + cmd.parm.setup.eazmsn,
16506 + cmd.parm.setup.phone);
16507 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
16508 + if(lp->dw_abc_bchan_errcnt) {
16511 + "%s: Note: bchannel-error-counter is %hd\n",
16513 + lp->dw_abc_bchan_errcnt);
16517 + printk(KERN_INFO "%s: dialing %d %s...\n", lp->name,
16518 + lp->dialretry, cmd.parm.setup.phone);
16521 #ifdef ISDN_DEBUG_NET_DIAL
16522 printk(KERN_DEBUG "dial: d=%d c=%d\n", lp->isdn_device,
16523 @@ -741,6 +1025,10 @@
16526 (lp->flags & ISDN_NET_CBOUT)) ? 12 : 4;
16527 +#ifdef CONFIG_ISDN_WITH_ABC
16528 + lp->dw_abc_if_flags &= ~ISDN_DW_ABC_IFFLAG_NODCHAN;
16529 + lp->dw_abc_dialstart = jiffies;
16533 /* Wait for D-Channel-connect.
16534 @@ -890,6 +1178,15 @@
16535 isdn_command(&cmd);
16536 printk(KERN_INFO "%s: Chargesum is %d\n", lp->name, lp->charge);
16537 isdn_all_eaz(lp->isdn_device, lp->isdn_channel);
16538 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
16539 + if(lp->dw_abc_bchan_errcnt) {
16542 + "%s: Note: bchannel-error-counter is %hd\n",
16544 + lp->dw_abc_bchan_errcnt);
16548 isdn_net_unbind_channel(lp);
16550 @@ -899,8 +1196,13 @@
16551 unsigned short dest;
16554 +#ifdef CONFIG_ISDN_WITH_ABC
16556 +isdn_net_log_skb_dwabc(struct sk_buff * skb, isdn_net_local * lp,char *reason)
16559 isdn_net_log_skb(struct sk_buff * skb, isdn_net_local * lp)
16562 u_char *p = skb->nh.raw; /* hopefully, this was set correctly */
16563 unsigned short proto = ntohs(skb->protocol);
16564 @@ -972,7 +1274,13 @@
16568 +#ifdef CONFIG_ISDN_WITH_ABC
16569 + "%s %s: %d.%d.%d.%d -> %d.%d.%d.%d%s\n",
16570 + (reason == NULL) ? "OPEN" : reason,
16571 + (lp != NULL) ? lp->name : "",
16573 "OPEN: %d.%d.%d.%d -> %d.%d.%d.%d%s\n",
16576 p[12], p[13], p[14], p[15],
16577 p[16], p[17], p[18], p[19],
16578 @@ -980,7 +1288,13 @@
16582 +#ifdef CONFIG_ISDN_WITH_ABC
16583 + "%s %s: ARP %d.%d.%d.%d -> *.*.*.* ?%d.%d.%d.%d\n",
16584 + (reason == NULL) ? "OPEN" : reason,
16585 + (lp != NULL) ? lp->name : "",
16587 "OPEN: ARP %d.%d.%d.%d -> *.*.*.* ?%d.%d.%d.%d\n",
16589 p[14], p[15], p[16], p[17],
16590 p[24], p[25], p[26], p[27]);
16592 @@ -1004,11 +1318,22 @@
16595 spin_lock_bh(&lp->xmit_lock);
16597 if (!isdn_net_lp_busy(lp)) {
16598 +#ifdef CONFIG_ISDN_WITH_ABC
16599 + if(!skb_queue_empty(&lp->super_tx_queue)) {
16601 + ** don't reverse the frame flow
16602 + ** compression need frames in order and maybe other's too
16604 + skb_queue_tail(&lp->super_tx_queue, skb);
16605 + skb = skb_dequeue(&lp->super_tx_queue);
16608 isdn_net_writebuf_skb(lp, skb);
16610 - skb_queue_tail(&lp->super_tx_queue, skb);
16613 + } else skb_queue_tail(&lp->super_tx_queue, skb);
16615 spin_unlock_bh(&lp->xmit_lock);
16618 @@ -1056,7 +1381,6 @@
16619 printk(KERN_WARNING "%s: HL driver queue full\n", lp->name);
16623 lp->transcount += len;
16624 isdn_net_inc_frame_cnt(lp);
16626 @@ -1064,9 +1388,19 @@
16628 dev_kfree_skb(skb);
16629 lp->stats.tx_errors++;
16634 +int isdn_net_send_skb(struct net_device *ndev, isdn_net_local * lp,struct sk_buff *skb)
16636 + if (isdn_net_lp_busy(lp)) {
16637 + printk(KERN_WARNING "isdn_net_send_skb: HL channel busy\n");
16640 + isdn_net_writebuf_skb(lp, skb);
16646 * Helper function for isdn_net_start_xmit.
16647 @@ -1109,7 +1443,54 @@
16649 /* Reset hangup-timeout */
16650 lp->huptimer = 0; // FIXME?
16651 +#ifdef CONFIG_ISDN_WITH_ABC
16653 + if(test_and_set_bit(ISDN_DW_ABC_BITLOCK_SEND,&lp->dw_abc_bitlocks)) {
16655 + if(dev->net_verbose > 2)
16656 + printk(KERN_INFO "%s: isdn_net_xmit called recursivly\n",lp->name);
16658 + spin_unlock_bh(&lp->xmit_lock);
16662 + if(skb != NULL) {
16664 + int l = skb->len;
16667 + if( lp->p_encap == ISDN_NET_ENCAP_RAWIP &&
16668 + (lp->dw_abc_if_flags & ISDN_DW_ABC_IFFLAG_BSDAKTIV)) {
16670 + if((skb = dwabc_bsd_compress(lp,skb,ndev)) != NULL) {
16674 + skb_queue_tail(&lp->super_tx_queue,skb);
16676 + if(l != nl && (r = isdn_dc2minor(lp->isdn_device,lp->isdn_channel)) >= 0) {
16678 + dev->obytes[r] += l - nl;
16679 + lp->stats.tx_bytes += l - nl;
16683 + } else skb_queue_tail(&lp->super_tx_queue,skb);
16685 + if(lp->p_encap == ISDN_NET_ENCAP_RAWIP) {
16687 + lp->dw_abc_bsd_snd += l;
16688 + lp->dw_abc_bsd_bsd_snd += nl;
16691 + clear_bit(ISDN_DW_ABC_BITLOCK_SEND,&lp->dw_abc_bitlocks);
16693 + while(!isdn_net_lp_busy(lp) && (skb = skb_dequeue(&lp->super_tx_queue)))
16694 + isdn_net_writebuf_skb(lp, skb);
16697 isdn_net_writebuf_skb(lp, skb);
16699 spin_unlock_bh(&lp->xmit_lock);
16701 /* the following stuff is here for backwards compatibility.
16702 @@ -1143,6 +1524,69 @@
16707 + if (lp->cps > lp->triggercps) {
16708 + /* Device overloaded */
16711 + * Packet-delivery via round-robin over master
16712 + * and all connected slaves.
16714 + if (lp->master) {
16715 + /* Slaves always deliver themselves */
16716 + spin_lock_bh(&lp->xmit_lock);
16717 + if (!isdn_net_lp_busy(lp)) {
16718 + isdn_net_writebuf_skb(lp, skb);
16721 + isdn_net_device_stop_queue(lp);
16724 + ret = isdn_net_send_skb(ndev, lp, skb);
16725 + spin_unlock_bh(&lp->xmit_lock);
16727 + isdn_net_local *slp = (isdn_net_local *) (lp->srobin->priv);
16728 + /* Master delivers via srobin and maintains srobin */
16729 + if (lp->srobin == ndev) {
16730 + spin_lock_bh(&lp->xmit_lock);
16731 + ret = isdn_net_send_skb(ndev, lp, skb);
16732 + spin_unlock_bh(&lp->xmit_lock);
16734 + ret = isdn_net_start_xmit(skb, lp->srobin);
16736 + lp->srobin = (slp->slave) ? slp->slave : ndev;
16737 + slp = (isdn_net_local *) (lp->srobin->priv);
16738 + if (!((slp->flags & ISDN_NET_CONNECTED) && (slp->dialstate == 0)))
16739 + lp->srobin = ndev;
16741 + /* Slave-startup using delay-variable */
16743 + if (!lp->sqfull) {
16744 + /* First time overload: set timestamp only */
16746 + lp->sqfull_stamp = jiffies;
16748 + /* subsequent overload: if slavedelay exceeded, start dialing */
16749 + if ((jiffies - lp->sqfull_stamp) > lp->slavedelay)
16750 + isdn_net_force_dial_lp((isdn_net_local *) lp->slave->priv);
16754 + /* Not overloaded, deliver locally */
16755 + spin_lock_bh(&lp->xmit_lock);
16756 + if (!isdn_net_lp_busy(lp)) {
16757 + isdn_net_writebuf_skb(lp, skb);
16760 + isdn_net_device_stop_queue(lp);
16763 + spin_unlock_bh(&lp->xmit_lock);
16764 + if (lp->sqfull && ((jiffies - lp->sqfull_stamp) > (lp->slavedelay + (10 * HZ))))
16772 @@ -1161,6 +1605,7 @@
16776 +#ifndef COMPAT_NO_SOFTNET
16777 void isdn_net_tx_timeout(struct net_device * ndev)
16779 isdn_net_local *lp = (isdn_net_local *) ndev->priv;
16780 @@ -1188,19 +1633,206 @@
16781 ndev->trans_start = jiffies;
16782 netif_wake_queue(ndev);
16787 * Try sending a packet.
16788 * If this interface isn't connected to a ISDN-Channel, find a free channel,
16789 * and start dialing.
16791 +#ifdef CONFIG_ISDN_WITH_ABC
16792 +static int dwabc_isdn_net_start_xmit(struct sk_buff *,struct net_device *);
16794 +static int isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
16796 + if(skb == NULL || ndev == NULL)
16797 + return(dwabc_isdn_net_start_xmit(skb,ndev));
16798 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK
16799 + if(!(((isdn_net_local *)ndev->priv)->dw_abc_flags &
16800 + ISDN_DW_ABC_FLAG_NO_UDP_CHECK)) {
16802 + if(dw_abc_udp_test(skb,ndev)) {
16803 + dev_kfree_skb(skb);
16808 + return(dwabc_isdn_net_start_xmit(skb,ndev));
16812 +#ifdef CONFIG_ISDN_WITH_ABC
16813 +int isdn_auto_dial_helper( isdn_net_local *lp,
16814 + struct sk_buff *skb,
16815 + int dm_manual_allowed)
16816 +/**********************************************************************
16818 + -1 dial not allowed or impossible
16819 + 0 interface is connected
16820 + 1 dial is started
16821 +***********************************************************************/
16826 + char *errmsg = NULL;
16828 +#ifdef ISDN_DEBUG_NET_DUMP
16830 + char *buf = skb->data;
16831 + isdn_dumppkt("S:", buf, skb->len, 40);
16834 + if (lp->flags & ISDN_NET_CONNECTED)
16837 + save_flags(flags);
16842 + /* Log packet, which triggered dialing */
16843 + if (dev->net_verbose)
16844 + isdn_net_log_skb(skb, lp);
16845 + /* only do autodial if allowed by config */
16846 + if (!(ISDN_NET_DIALMODE(*lp) == ISDN_NET_DM_AUTO)) {
16847 + errmsg = "dial rejected: interface not in dialmode `auto'";
16849 + if(dm_manual_allowed &&
16850 + !(ISDN_NET_DIALMODE(*lp) == ISDN_NET_DM_MANUAL)) {
16853 + "dial rejected: interface not in dialmode `auto or manual'";
16858 + if (!lp->phone[1]) {
16860 + errmsg = "No phone number";
16864 + if(lp->dialwait_timer <= 0) {
16866 + if( lp->dialstarted > 0 &&
16867 + lp->dialtimeout > 0 &&
16868 + jiffies < (lp->dialstarted + lp->dialtimeout + lp->dialwait)) {
16870 + lp->dialwait_timer =
16871 + lp->dialstarted + lp->dialtimeout + lp->dialwait;
16875 + if(lp->dialwait_timer > 0) {
16877 + if(jiffies < lp->dialwait_timer) {
16879 + errmsg = "dial rejected: retry-time not reached";
16882 + } else lp->dialwait_timer = 0;
16884 +#ifdef CONFIG_ISDN_WITH_ABC
16885 + if(isdn_dwabc_is_interface_disabled(lp))
16888 + /* Grab a free ISDN-Channel */
16890 + isdn_get_free_channel(
16896 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
16897 + (*lp->dw_out_msn) ? lp->dw_out_msn :
16902 + isdn_get_free_channel(
16907 + lp->pre_channel^1,
16908 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
16909 + (*lp->dw_out_msn) ? lp->dw_out_msn :
16914 + errmsg = "No channel";
16918 + lp->dialstate = 1;
16919 + /* Connect interface with channel */
16920 + isdn_net_bind_channel(lp, chi);
16921 +#ifdef CONFIG_ISDN_PPP
16922 + if (lp->p_encap == ISDN_NET_ENCAP_SYNCPPP) {
16923 + /* no 'first_skb' handling for syncPPP */
16924 + if (isdn_ppp_bind(lp) < 0) {
16925 + isdn_net_unbind_channel(lp);
16929 + isdn_net_dial(); /* Initiate dialing */
16930 + netif_stop_queue(&lp->netdev->dev);
16933 + /* let upper layer requeue skb packet */
16936 + /* Initiate dialing */
16938 + isdn_net_device_stop_queue(lp);
16943 + if(retw < 0 && errmsg != NULL)
16944 + isdn_net_unreachable(&lp->netdev->dev, skb, errmsg);
16946 + restore_flags(flags);
16954 +dwabc_isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
16957 isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
16960 isdn_net_local *lp = (isdn_net_local *) ndev->priv;
16961 #ifdef CONFIG_ISDN_X25
16962 struct concap_proto * cprot = lp -> netdev -> cprot;
16964 +#ifdef COMPAT_NO_SOFTNET
16965 + /* some comment as with the softnet TX timeout
16966 + when this happens, it's a bug in the HL card driver
16967 + and should be fixed there, so we can supposedly get rid of
16968 + this here at all.
16969 + I added a debugging message to find out if it ever occurs --KG
16972 + if (ndev->tbusy) {
16973 + if (jiffies - ndev->trans_start < ISDN_NET_TX_TIMEOUT)
16975 + if (!lp->dialstate){
16976 + lp->stats.tx_errors++;
16977 + printk(KERN_WARNING "isdn_tx_timeout dev %s dialstate %d\n",
16978 + ndev->name, lp->dialstate);
16980 + ndev->trans_start = jiffies;
16981 + netif_wake_queue(ndev);
16984 #ifdef CONFIG_ISDN_X25
16985 /* At this point hard_start_xmit() passes control to the encapsulation
16986 protocol (if present).
16987 @@ -1220,6 +1852,40 @@
16990 /* auto-dialing xmit function */
16991 +#ifdef CONFIG_ISDN_WITH_ABC
16995 + isdn_net_adjust_hdr(skb, ndev);
16997 + if(!(r = isdn_auto_dial_helper(lp,skb,0))) {
17000 + ** Device is connected to an ISDN channel
17002 + ndev->trans_start = jiffies;
17004 + if (!lp->dialstate) {
17007 + ** ISDN connection is established, try sending
17009 + r = isdn_net_xmit(ndev, skb);
17014 + netif_stop_queue(ndev);
17016 + } else if(r < 0) {
17018 + dev_kfree_skb(skb);
17026 #ifdef ISDN_DEBUG_NET_DUMP
17028 @@ -1256,6 +1922,14 @@
17030 lp->dialwait_timer = 0;
17032 +#ifdef CONFIG_ISDN_WITH_ABC
17033 + if(isdn_dwabc_is_interface_disabled(lp)) {
17035 + dev_kfree_skb(skb);
17036 + restore_flags(flags);
17040 /* Grab a free ISDN-Channel */
17042 isdn_get_free_channel(
17043 @@ -1264,6 +1938,9 @@
17047 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
17048 + (*lp->dw_out_msn) ? lp->dw_out_msn :
17053 @@ -1273,6 +1950,9 @@
17057 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
17058 + (*lp->dw_out_msn) ? lp->dw_out_msn :
17062 restore_flags(flags);
17063 @@ -1296,16 +1976,6 @@
17064 restore_flags(flags);
17065 return 0; /* STN (skb to nirvana) ;) */
17067 -#ifdef CONFIG_IPPP_FILTER
17068 - if (isdn_ppp_autodial_filter(skb, lp)) {
17069 - isdn_ppp_free(lp);
17070 - isdn_net_unbind_channel(lp);
17071 - restore_flags(flags);
17072 - isdn_net_unreachable(ndev, skb, "dial rejected: packet filtered");
17073 - dev_kfree_skb(skb);
17077 restore_flags(flags);
17078 isdn_net_dial(); /* Initiate dialing */
17079 netif_stop_queue(ndev);
17080 @@ -1337,6 +2007,7 @@
17088 @@ -1356,6 +2027,9 @@
17089 if( cprot && cprot -> pops ) cprot -> pops -> close( cprot );
17091 netif_stop_queue(dev);
17092 +#ifdef COMPAT_NO_SOFTNET
17095 if ((p = (((isdn_net_local *) dev->priv)->slave))) {
17096 /* If this interface has slaves, stop them also */
17098 @@ -1776,6 +2450,10 @@
17102 + case CISCO_TYPE_INET:
17103 + skb->protocol = htons(ETH_P_IP);
17106 case CISCO_TYPE_SLARP:
17107 isdn_net_ciscohdlck_slarp_in(lp, skb);
17109 @@ -1785,11 +2463,11 @@
17110 "\"no cdp enable\" on cisco.\n", lp->name);
17113 - /* no special cisco protocol */
17114 - skb->protocol = htons(type);
17117 + printk(KERN_WARNING "%s: Unknown Cisco type 0x%04x\n",
17125 @@ -1803,9 +2481,19 @@
17127 isdn_net_local *lp = (isdn_net_local *) ndev->priv;
17128 isdn_net_local *olp = lp; /* original 'lp' */
17129 +#ifdef CONFIG_ISDN_PPP
17130 + int proto = PPP_PROTOCOL(skb->data);
17132 #ifdef CONFIG_ISDN_X25
17133 struct concap_proto *cprot = lp -> netdev -> cprot;
17135 +#ifdef CONFIG_ISDN_WITH_ABC
17136 + struct net_device *ondev = ndev;
17137 +#ifdef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
17138 + ulong lp_huptimer = 0;
17139 + ulong olp_huptimer = 0;
17142 lp->transcount += skb->len;
17144 lp->stats.rx_packets++;
17145 @@ -1819,6 +2507,10 @@
17146 lp->stats.rx_packets++;
17147 lp->stats.rx_bytes += skb->len;
17149 +#ifdef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
17150 + lp_huptimer = lp->huptimer;
17151 + olp_huptimer = olp->huptimer;
17154 skb->pkt_type = PACKET_HOST;
17155 skb->mac.raw = skb->data;
17156 @@ -1840,9 +2532,40 @@
17158 case ISDN_NET_ENCAP_RAWIP:
17159 /* RAW-IP without MAC-Header */
17160 +#ifdef CONFIG_ISDN_WITH_ABC
17161 + if(olp->p_encap == ISDN_NET_ENCAP_RAWIP) {
17163 + ushort l = skb->len;
17166 + olp->dw_abc_bsd_bsd_rcv += l;
17168 + if((skb = dwabc_bsd_rx_pkt(olp,skb,ondev)) == NULL) {
17170 + olp->dw_abc_bsd_rcv += l;
17174 + olp->dw_abc_bsd_rcv += skb->len;
17176 + if( l != skb->len &&
17177 + (r=isdn_dc2minor(olp->isdn_device,olp->isdn_channel))>=0) {
17179 + dev->ibytes[r] += skb->len - l;
17180 + olp->stats.rx_bytes += skb->len - l;
17183 + lp->stats.rx_bytes += skb->len - l;
17189 skb->protocol = htons(ETH_P_IP);
17190 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
17191 + if(isdn_dwabc_conerr_ippktok(skb))
17192 + lp->dw_abc_bchan_errcnt = 0;
17195 case ISDN_NET_ENCAP_CISCOHDLCK:
17196 isdn_net_ciscohdlck_receive(lp, skb);
17197 @@ -1862,8 +2585,22 @@
17199 #ifdef CONFIG_ISDN_PPP
17200 case ISDN_NET_ENCAP_SYNCPPP:
17201 - /* huptimer is done in isdn_ppp_push_higher */
17203 + * If encapsulation is syncppp, don't reset
17204 + * huptimer on LCP packets.
17206 + if (proto != PPP_LCP) {
17207 + olp->huptimer = 0;
17208 + lp->huptimer = 0;
17210 isdn_ppp_receive(lp->netdev, olp, skb);
17211 +#ifdef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
17212 + if(olp->dw_abc_flags & ISDN_DW_ABC_FLAG_RCV_NO_HUPTIMER) {
17214 + lp->huptimer = lp_huptimer + 1;
17215 + olp->huptimer = olp_huptimer+ 1;
17221 @@ -1873,6 +2610,15 @@
17222 if(cprot) if(cprot -> pops)
17223 if( cprot -> pops -> data_ind){
17224 cprot -> pops -> data_ind(cprot,skb);
17225 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
17226 + lp->dw_abc_bchan_errcnt = 0;
17227 +#ifdef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
17228 + if(olp->dw_abc_flags & ISDN_DW_ABC_FLAG_RCV_NO_HUPTIMER) {
17229 + lp->huptimer = lp_huptimer;
17230 + olp->huptimer = olp_huptimer;
17236 #endif /* CONFIG_ISDN_X25 */
17237 @@ -1882,6 +2628,15 @@
17241 +#ifdef CONFIG_ISDN_WITH_ABC
17242 +#ifdef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
17243 + if(olp->dw_abc_flags & ISDN_DW_ABC_FLAG_RCV_NO_HUPTIMER) {
17245 + lp->huptimer = lp_huptimer;
17246 + olp->huptimer = olp_huptimer;
17253 @@ -2160,8 +2915,10 @@
17259 +#ifdef CONFIG_ISDN_WITH_ABC
17260 + if(dev->net_verbose > 2)
17261 + printk(KERN_DEBUG "n_fi: di=%d ch=%d idx=%d usg=0x%04X\n", di, ch, idx,dev->usage[idx]);
17263 /* Search name in netdev-chain */
17266 @@ -2180,17 +2937,15 @@
17267 eaz = setup->eazmsn;
17268 if (dev->net_verbose > 1)
17269 printk(KERN_INFO "isdn_net: call from %s,%d,%d -> %s\n", nr, si1, si2, eaz);
17270 - /* Accept DATA and VOICE calls at this stage
17271 - local eaz is checked later for allowed call types */
17272 - if ((si1 != 7) && (si1 != 1)) {
17273 - restore_flags(flags);
17274 - if (dev->net_verbose > 1)
17275 - printk(KERN_INFO "isdn_net: Service-Indicator not 1 or 7, ignored\n");
17279 -n = (isdn_net_phone *) 0;
17281 + /* Accept only calls with Si1 = 7 (Data-Transmission) */
17283 + restore_flags(flags);
17284 + if (dev->net_verbose > 1)
17285 + printk(KERN_INFO "isdn_net: Service-Indicator not 7, ignored\n");
17288 + n = (isdn_net_phone *) 0;
17290 ematch = wret = swapped = 0;
17291 #ifdef ISDN_DEBUG_NET_ICALL
17292 printk(KERN_DEBUG "n_fi: di=%d ch=%d idx=%d usg=%d\n", di, ch, idx,
17293 @@ -2210,25 +2965,8 @@
17297 - /* check acceptable call types for DOV */
17298 - my_eaz = isdn_map_eaz2msn(lp->msn, di);
17299 - if (si1 == 1) { /* it's a DOV call, check if we allow it */
17300 - if (*my_eaz == 'v' || *my_eaz == 'V' ||
17301 - *my_eaz == 'b' || *my_eaz == 'B')
17302 - my_eaz++; /* skip to allow a match */
17304 - my_eaz = 0; /* force non match */
17305 - } else { /* it's a DATA call, check if we allow it */
17306 - if (*my_eaz == 'b' || *my_eaz == 'B')
17307 - my_eaz++; /* skip to allow a match */
17310 - matchret = isdn_msncmp(eaz, my_eaz);
17316 + if (!(matchret = isdn_msncmp(eaz, isdn_map_eaz2msn(lp->msn, di))))
17318 /* Remember if more numbers eventually can match */
17319 if (matchret > wret)
17321 @@ -2236,17 +2974,122 @@
17322 printk(KERN_DEBUG "n_fi: if='%s', l.msn=%s, l.flags=%d, l.dstate=%d\n",
17323 lp->name, lp->msn, lp->flags, lp->dialstate);
17325 +#ifdef CONFIG_ISDN_WITH_ABC_CALLB
17326 + if ((!matchret) && /* EAZ is matching */
17327 + (((!(lp->flags & ISDN_NET_CONNECTED)) && /* but not connected */
17328 + (USG_NONE(dev->usage[idx]))) || /* and ch. unused or */
17329 + (lp->dialstate == 4) || (lp->dialstate == 12) || /* if dialing */
17330 + ((lp->flags & ISDN_NET_CBOUT) != 0 && /* init a callback */
17331 + lp->outgoing != 0 )))
17334 + ** we dont stop call's anymore (both sides call's syncron)
17335 + ** it will be problem in any case.
17336 + ** both sides will make the same.
17337 + ** i try later to make a switch (check the phon-numbers)
17338 + ** to detect with side must be stop the call.
17341 if ((!matchret) && /* EAZ is matching */
17342 (((!(lp->flags & ISDN_NET_CONNECTED)) && /* but not connected */
17343 (USG_NONE(dev->usage[idx]))) || /* and ch. unused or */
17344 ((((lp->dialstate == 4) || (lp->dialstate == 12)) && /* if dialing */
17345 (!(lp->flags & ISDN_NET_CALLBACK))) /* but no callback */
17349 #ifdef ISDN_DEBUG_NET_ICALL
17350 printk(KERN_DEBUG "n_fi: match1, pdev=%d pch=%d\n",
17351 lp->pre_device, lp->pre_channel);
17353 +#ifdef CONFIG_ISDN_WITH_ABC
17354 +#ifdef CONFIG_ISDN_WITH_ABC_CALLB
17356 + int use_this_call = 0;
17358 + if(!(lp->flags & ISDN_NET_CBOUT) && ((lp->dialstate == 4) || (lp->dialstate == 12))) {
17361 + ** searching for a diff. in the calling-number and the EAZ
17362 + ** the remote will make the same
17368 + for(;*pnr;pnr++);
17369 + for(;*pea;pea++);
17370 + for(pnr--,pea--;pnr >= nr && pea >= eaz && *pea != *pnr;pnr--,pea--);
17372 + if(pnr < nr || pea < eaz || *pea > *pnr) {
17374 + p = (isdn_net_dev *) p->next;
17378 + use_this_call = 1;
17381 + if( use_this_call ||
17382 + ((lp->flags & ISDN_NET_CBOUT) && (lp->flags & ISDN_NET_CONNECTED))) {
17385 + ** the incoming call was to quick.
17386 + ** the callback-delay-time ist not reached.
17387 + ** in that case we can stop the call
17390 + if(lp->isdn_device > -1 && lp->isdn_channel > -1) {
17392 + int minor = isdn_dc2minor(lp->isdn_device,lp->isdn_channel);
17394 + if(lp->isdn_device != di || lp->isdn_channel != ch) {
17398 + memset((void *)&cmd,0,sizeof(cmd));
17399 + cmd.driver = lp->isdn_device;
17400 + cmd.command = ISDN_CMD_HANGUP;
17401 + cmd.arg = lp->isdn_channel;
17402 + (void) dev->drv[cmd.driver]->interface->command(&cmd);
17403 + isdn_all_eaz(lp->isdn_device, lp->isdn_channel);
17405 + if(dev->net_verbose > 1) {
17408 + "%s: found outgoing call hangup old call on di %d ch %d\n",
17409 + lp->name,lp->isdn_device,lp->isdn_channel);
17412 + } else if (dev->net_verbose > 1) {
17414 + printk(KERN_INFO "%s: found outgoing call on same di %d ch %d\n",
17415 + lp->name,lp->isdn_device,lp->isdn_channel);
17420 + dev->rx_netdev[minor] = NULL;
17421 + dev->st_netdev[minor] = NULL;
17424 + isdn_free_channel(lp->isdn_device,
17425 + lp->isdn_channel, ISDN_USAGE_NET);
17427 + } else if (dev->net_verbose > 1) {
17429 + printk(KERN_INFO "%s: found outgoing call reset callstate \n",lp->name);
17432 + lp->flags &= ~ISDN_NET_CONNECTED;
17433 + lp->isdn_device = -1;
17434 + lp->isdn_channel = -1;
17436 + lp->dialstate = 0;
17441 if (dev->usage[idx] & ISDN_USAGE_EXCLUSIVE) {
17442 if ((lp->pre_channel != ch) ||
17443 (lp->pre_device != di)) {
17444 @@ -2375,6 +3218,12 @@
17448 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
17449 + if(isdn_dwabc_is_interface_disabled(lp)) {
17450 + restore_flags(flags);
17454 if (lp->flags & ISDN_NET_CALLBACK) {
17457 @@ -2427,6 +3276,47 @@
17458 restore_flags(flags);
17461 +#ifdef CONFIG_ISDN_WITH_ABC_CALLB
17464 + ** this is a sanity-check.
17465 + ** check for double use (device and channel)
17466 + ** will be very near to a kernel-crash in that case
17468 + isdn_net_dev *sp = dev->netdev;
17470 + isdn_net_local *ml;
17472 + for(s_shl=0; s_shl < 2048 && sp != NULL; sp = (isdn_net_dev *)sp->next, s_shl++) {
17474 + if(sp == p || (ml = sp->local) == NULL)
17477 + if(ml->isdn_device != di || ml->isdn_channel != ch)
17480 + if(ml->dialstate != 4 && ml->dialstate != 12) {
17483 + ** wrong situation
17488 + isdn_net_unbind_channel(ml);
17493 + printk(KERN_DEBUG
17494 +"%s: call from %s -> %s (drv %d chan %d duplicated with %s) \n",
17495 + lp->name, nr, eaz,di,ch,
17496 + sp->local->name );
17498 + restore_flags(flags);
17502 printk(KERN_DEBUG "%s: call from %s -> %s accepted\n", lp->name, nr,
17504 /* if this interface is dialing, it does it probably on a different
17505 @@ -2516,7 +3406,11 @@
17509 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
17510 + (*lp->dw_out_msn) ? lp->dw_out_msn : lp->msn)
17515 printk(KERN_WARNING "isdn_net_force_dial: No channel for %s\n", lp->name);
17516 restore_flags(flags);
17517 @@ -2599,7 +3493,11 @@
17518 strcpy(netdev->local->name, " ");
17520 strcpy(netdev->local->name, name);
17521 +#ifdef COMPAT_NO_SOFTNET
17522 + netdev->dev.name = netdev->local->name;
17524 strcpy(netdev->dev.name, netdev->local->name);
17526 netdev->dev.priv = netdev->local;
17527 netdev->dev.init = isdn_net_init;
17528 netdev->local->p_encap = ISDN_NET_ENCAP_RAWIP;
17529 @@ -2617,11 +3515,13 @@
17530 ((isdn_net_local *) q->priv)->slave = &(netdev->dev);
17532 /* Device shall be a master */
17533 +#ifndef COMPAT_NO_SOFTNET
17535 * Watchdog timer (currently) for master only.
17537 netdev->dev.tx_timeout = isdn_net_tx_timeout;
17538 netdev->dev.watchdog_timeo = ISDN_NET_TX_TIMEOUT;
17540 if (register_netdev(&netdev->dev) != 0) {
17541 printk(KERN_WARNING "isdn_net: Could not register net-device\n");
17542 kfree(netdev->local);
17543 @@ -2658,6 +3558,9 @@
17544 netdev->local->hupflags = ISDN_INHUP; /* Do hangup even on incoming calls */
17545 netdev->local->onhtime = 10; /* Default hangup-time for saving costs
17546 of those who forget configuring this */
17547 +#ifdef CONFIG_ISDN_WITH_ABC
17548 + netdev->local->dw_abc_old_onhtime = netdev->local->onhtime;
17550 netdev->local->dialmax = 1;
17551 netdev->local->flags = ISDN_NET_CBHUP | ISDN_NET_DM_MANUAL; /* Hangup before Callback, manual dial */
17552 netdev->local->cbdelay = 25; /* Wait 5 secs before Callback */
17553 @@ -2831,7 +3734,6 @@
17555 /* If binding is exclusive, try to grab the channel */
17558 if ((i = isdn_get_free_channel(ISDN_USAGE_NET,
17559 lp->l2_proto, lp->l3_proto, drvidx,
17560 chidx, lp->msn)) < 0) {
17561 @@ -2859,6 +3761,9 @@
17562 lp->pre_device = drvidx;
17563 lp->pre_channel = chidx;
17564 lp->onhtime = cfg->onhtime;
17565 +#ifdef CONFIG_ISDN_WITH_ABC
17566 + lp->dw_abc_old_onhtime = lp->onhtime;
17568 lp->charge = cfg->charge;
17569 lp->l2_proto = cfg->l2_proto;
17570 lp->l3_proto = cfg->l3_proto;
17571 @@ -2932,6 +3837,9 @@
17574 lp->p_encap = cfg->p_encap;
17575 +#ifdef CONFIG_ISDN_WITH_ABC
17576 + isdn_dw_abc_reset_interface(lp,0);
17581 @@ -3007,6 +3915,9 @@
17582 strcpy(n->num, phone->phone);
17583 n->next = p->local->phone[phone->outgoing & 1];
17584 p->local->phone[phone->outgoing & 1] = n;
17585 +#ifdef CONFIG_ISDN_WITH_ABC
17586 + isdn_dwabc_test_phone(p->local);
17591 @@ -3100,6 +4011,9 @@
17593 p->local->phone[inout] = n->next;
17595 +#ifdef CONFIG_ISDN_WITH_ABC
17596 + isdn_dwabc_test_phone(p->local);
17598 restore_flags(flags);
17601 @@ -3135,6 +4049,9 @@
17602 p->local->phone[i] = NULL;
17604 p->local->dial = NULL;
17605 +#ifdef CONFIG_ISDN_WITH_ABC
17606 + isdn_dwabc_test_phone(p->local);
17608 restore_flags(flags);
17611 @@ -3218,6 +4135,10 @@
17612 /* If no more net-devices remain, disable auto-hangup timer */
17613 if (dev->netdev == NULL)
17614 isdn_timer_ctrl(ISDN_TIMER_NETHANGUP, 0);
17615 +#ifdef CONFIG_ISDN_WITH_ABC
17616 + isdn_dw_clear_if(~0l,p->local);
17617 + dwabc_bsd_free(p->local);
17619 restore_flags(flags);
17622 diff -rNu linux-2.4.29.old/drivers/isdn/isdn_net.h linux-2.4.29/drivers/isdn/isdn_net.h
17623 --- linux-2.4.29.old/drivers/isdn/isdn_net.h 2005-03-22 14:47:56.000000000 +0100
17624 +++ linux-2.4.29/drivers/isdn/isdn_net.h 2005-03-22 15:06:44.463333328 +0100
17626 -/* $Id: isdn_net.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
17627 +/* $Id: isdn_net.h,v 1.23 2001/11/07 22:35:48 kai Exp $
17629 * header for Linux ISDN subsystem, network related functions (linklevel).
17632 #define CISCO_ADDR_BROADCAST 0x8f
17633 #define CISCO_CTRL 0x00
17634 #define CISCO_TYPE_CDP 0x2000
17635 +#define CISCO_TYPE_INET 0x0800
17636 #define CISCO_TYPE_SLARP 0x8035
17637 #define CISCO_SLARP_REQUEST 0
17638 #define CISCO_SLARP_REPLY 1
17639 @@ -106,8 +107,6 @@
17640 spin_lock_irqsave(&nd->queue_lock, flags);
17643 -// printk(KERN_DEBUG __FUNCTION__": lp:%s(%p) nlp:%s(%p) last(%p)\n",
17644 -// lp->name, lp, nlp->name, nlp, lp->last);
17645 nlp->last = lp->last;
17646 lp->last->next = nlp;
17648 @@ -127,20 +126,12 @@
17650 master_lp = (isdn_net_local *) lp->master->priv;
17652 -// printk(KERN_DEBUG __FUNCTION__": lp:%s(%p) mlp:%s(%p) last(%p) next(%p) mndq(%p)\n",
17653 -// lp->name, lp, master_lp->name, master_lp, lp->last, lp->next, master_lp->netdev->queue);
17654 spin_lock_irqsave(&master_lp->netdev->queue_lock, flags);
17655 lp->last->next = lp->next;
17656 lp->next->last = lp->last;
17657 - if (master_lp->netdev->queue == lp) {
17658 + if (master_lp->netdev->queue == lp)
17659 master_lp->netdev->queue = lp->next;
17660 - if (lp->next == lp) { /* last in queue */
17661 - master_lp->netdev->queue = master_lp->netdev->local;
17664 lp->next = lp->last = lp; /* (re)set own pointers */
17665 -// printk(KERN_DEBUG __FUNCTION__": mndq(%p)\n",
17666 -// master_lp->netdev->queue);
17667 spin_unlock_irqrestore(&master_lp->netdev->queue_lock, flags);
17670 diff -rNu linux-2.4.29.old/drivers/isdn/isdn_ppp.c linux-2.4.29/drivers/isdn/isdn_ppp.c
17671 --- linux-2.4.29.old/drivers/isdn/isdn_ppp.c 2005-03-22 14:47:56.000000000 +0100
17672 +++ linux-2.4.29/drivers/isdn/isdn_ppp.c 2005-03-22 15:06:44.481330592 +0100
17674 -/* $Id: isdn_ppp.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
17675 +/* $Id: isdn_ppp.c,v 1.94 2001/11/07 22:35:48 kai Exp $
17677 * Linux ISDN subsystem, functions for synchronous PPP (linklevel).
17680 #include <linux/isdn.h>
17681 #include <linux/poll.h>
17682 #include <linux/ppp-comp.h>
17683 -#ifdef CONFIG_IPPP_FILTER
17684 -#include <linux/filter.h>
17687 #include "isdn_common.h"
17688 #include "isdn_ppp.h"
17689 @@ -72,11 +69,19 @@
17690 static int isdn_ppp_bundle(struct ippp_struct *, int unit);
17691 #endif /* CONFIG_ISDN_MPP */
17693 -char *isdn_ppp_revision = "$Revision: 1.1.4.1 $";
17694 +char *isdn_ppp_revision = "$Revision: 1.94 $";
17696 static struct ippp_struct *ippp_table[ISDN_MAX_CHANNELS];
17698 +#ifndef CONFIG_ISDN_WITH_ABC
17699 static struct isdn_ppp_compressor *ipc_head = NULL;
17702 + ** make compressor's common usable
17704 +struct isdn_ppp_compressor *isdn_ippp_comp_head = NULL;
17705 +#define ipc_head isdn_ippp_comp_head
17709 * frame log (debug)
17710 @@ -110,11 +115,8 @@
17711 unsigned long flags;
17712 struct ippp_struct *is;
17714 - if (lp->ppp_slot < 0 || lp->ppp_slot > ISDN_MAX_CHANNELS) {
17715 - printk(KERN_ERR "%s: ppp_slot(%d) out of range\n",
17716 - __FUNCTION__, lp->ppp_slot);
17717 + if (lp->ppp_slot < 0 || lp->ppp_slot > ISDN_MAX_CHANNELS)
17723 @@ -130,12 +132,7 @@
17724 lp->netdev->pb->ref_ct--;
17725 spin_unlock(&lp->netdev->pb->lock);
17726 #endif /* CONFIG_ISDN_MPP */
17727 - if (lp->ppp_slot < 0 || lp->ppp_slot > ISDN_MAX_CHANNELS) {
17728 - printk(KERN_ERR "%s: ppp_slot(%d) now invalid\n",
17729 - __FUNCTION__, lp->ppp_slot);
17730 - restore_flags(flags);
17734 is = ippp_table[lp->ppp_slot];
17735 if ((is->state & IPPP_CONNECT))
17736 isdn_ppp_closewait(lp->ppp_slot); /* force wakeup on ippp device */
17737 @@ -231,13 +228,12 @@
17739 isdn_ppp_wakeup_daemon(isdn_net_local * lp)
17741 - if (lp->ppp_slot < 0 || lp->ppp_slot >= ISDN_MAX_CHANNELS) {
17742 - printk(KERN_ERR "%s: ppp_slot(%d) out of range\n",
17743 - __FUNCTION__, lp->ppp_slot);
17744 + if (lp->ppp_slot < 0 || lp->ppp_slot >= ISDN_MAX_CHANNELS)
17748 ippp_table[lp->ppp_slot]->state = IPPP_OPEN | IPPP_CONNECT | IPPP_NOBLOCK;
17749 - wake_up_interruptible(&ippp_table[lp->ppp_slot]->wq);
17751 + wake_up_interruptible(&ippp_table[lp->ppp_slot]->wq);
17755 @@ -250,14 +246,13 @@
17757 struct ippp_struct *is;
17759 - if (slot < 0 || slot >= ISDN_MAX_CHANNELS) {
17760 - printk(KERN_ERR "%s: slot(%d) out of range\n",
17761 - __FUNCTION__, slot);
17762 + if (slot < 0 || slot >= ISDN_MAX_CHANNELS)
17765 is = ippp_table[slot];
17768 wake_up_interruptible(&is->wq);
17770 is->state = IPPP_CLOSEWAIT;
17773 @@ -295,9 +290,11 @@
17776 is = file->private_data = ippp_table[slot];
17778 - printk(KERN_DEBUG "ippp, open, slot: %d, minor: %d, state: %04x\n",
17779 - slot, min, is->state);
17782 + if (is->debug & 0x1)
17784 + printk(KERN_DEBUG "ippp, open, slot: %d, minor: %d, state: %04x\n", slot, min, is->state);
17786 /* compression stuff */
17787 is->link_compressor = is->compressor = NULL;
17788 @@ -327,10 +324,7 @@
17790 is->slcomp = slhc_init(16, 16); /* not necessary for 2. link in bundle */
17792 -#ifdef CONFIG_IPPP_FILTER
17793 - is->pass_filter.filter = NULL;
17794 - is->active_filter.filter = NULL;
17797 is->state = IPPP_OPEN;
17800 @@ -349,20 +343,12 @@
17802 is = file->private_data;
17805 - printk(KERN_ERR "%s: no file->private_data\n", __FUNCTION__);
17808 if (is->debug & 0x1)
17809 printk(KERN_DEBUG "ippp: release, minor: %d %lx\n", min, (long) is->lp);
17811 if (is->lp) { /* a lp address says: this link is still up */
17812 isdn_net_dev *p = is->lp->netdev;
17815 - printk(KERN_ERR "%s: no lp->netdev\n", __FUNCTION__);
17818 is->state &= ~IPPP_CONNECT; /* -> effect: no call of wakeup */
17820 * isdn_net_hangup() calls isdn_ppp_free()
17821 @@ -385,18 +371,8 @@
17822 slhc_free(is->slcomp);
17825 -#ifdef CONFIG_IPPP_FILTER
17826 - if (is->pass_filter.filter) {
17827 - kfree(is->pass_filter.filter);
17828 - is->pass_filter.filter = NULL;
17830 - if (is->active_filter.filter) {
17831 - kfree(is->active_filter.filter);
17832 - is->active_filter.filter = NULL;
17836 -/* TODO: if this was the previous master: link the stuff to the new master */
17837 +/* TODO: if this was the previous master: link the the stuff to the new master */
17839 is->compressor->free(is->comp_stat);
17840 if(is->link_comp_stat)
17841 @@ -509,13 +485,15 @@
17842 if (val & SC_ENABLE_IP && !(is->pppcfg & SC_ENABLE_IP) && (is->state & IPPP_CONNECT)) {
17844 /* OK .. we are ready to send buffers */
17845 - is->pppcfg = val; /* isdn_ppp_xmit test for SC_ENABLE_IP !!! */
17846 netif_wake_queue(&lp->netdev->dev);
17853 + case PPPIOCGSTAT: /* read PPP statistic information */
17856 case PPPIOCGIDLE: /* get idle time information */
17858 struct ppp_idle pidle;
17859 @@ -604,39 +582,6 @@
17861 return set_arg((void *)arg,&pci,sizeof(struct pppcallinfo));
17863 -#ifdef CONFIG_IPPP_FILTER
17864 - case PPPIOCSPASS:
17865 - case PPPIOCSACTIVE:
17867 - struct sock_fprog uprog, *filtp;
17868 - struct sock_filter *code = NULL;
17871 - if (copy_from_user(&uprog, (void *) arg, sizeof(uprog)))
17873 - if (uprog.len > 0 && uprog.len < 65536) {
17874 - len = uprog.len * sizeof(struct sock_filter);
17875 - code = kmalloc(len, GFP_KERNEL);
17876 - if (code == NULL)
17878 - if (copy_from_user(code, uprog.filter, len)) {
17882 - err = sk_chk_filter(code, uprog.len);
17888 - filtp = (cmd == PPPIOCSPASS) ? &is->pass_filter : &is->active_filter;
17889 - if (filtp->filter)
17890 - kfree(filtp->filter);
17891 - filtp->filter = code;
17892 - filtp->len = uprog.len;
17895 -#endif /* CONFIG_IPPP_FILTER */
17899 @@ -699,7 +644,7 @@
17900 struct ippp_struct *is;
17902 if (slot < 0 || slot >= ISDN_MAX_CHANNELS) {
17903 - printk(KERN_WARNING "ippp: illegal slot(%d).\n", slot);
17904 + printk(KERN_WARNING "ippp: illegal slot.\n");
17907 is = ippp_table[slot];
17908 @@ -976,8 +921,7 @@
17910 slot = lp->ppp_slot;
17911 if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
17912 - printk(KERN_ERR "isdn_ppp_receive: lp->ppp_slot(%d)\n",
17914 + printk(KERN_ERR "isdn_ppp_receive: lp->ppp_slot %d\n", lp->ppp_slot);
17918 @@ -1026,23 +970,19 @@
17920 struct net_device *dev = &net_dev->dev;
17921 struct ippp_struct *is, *mis;
17922 - isdn_net_local *mlp = NULL;
17925 slot = lp->ppp_slot;
17926 if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
17927 - printk(KERN_ERR "isdn_ppp_push_higher: lp->ppp_slot(%d)\n",
17929 + printk(KERN_ERR "isdn_ppp_push_higher: lp->ppp_slot %d\n", lp->ppp_slot);
17932 is = ippp_table[slot];
17934 if (lp->master) { // FIXME?
17935 - mlp = (isdn_net_local *) lp->master->priv;
17936 - slot = mlp->ppp_slot;
17937 + slot = ((isdn_net_local *) (lp->master->priv))->ppp_slot;
17938 if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
17939 - printk(KERN_ERR "isdn_ppp_push_higher: master->ppp_slot(%d)\n",
17941 + printk(KERN_ERR "isdn_ppp_push_higher: master->ppp_slot %d\n", lp->ppp_slot);
17945 @@ -1076,11 +1016,6 @@
17946 case PPP_VJC_UNCOMP:
17947 if (is->debug & 0x20)
17948 printk(KERN_DEBUG "isdn_ppp: VJC_UNCOMP\n");
17949 - if (net_dev->local->ppp_slot < 0) {
17950 - printk(KERN_ERR "%s: net_dev->local->ppp_slot(%d) out of range\n",
17951 - __FUNCTION__, net_dev->local->ppp_slot);
17952 - goto drop_packet;
17954 if (slhc_remember(ippp_table[net_dev->local->ppp_slot]->slcomp, skb->data, skb->len) <= 0) {
17955 printk(KERN_WARNING "isdn_ppp: received illegal VJC_UNCOMP frame!\n");
17957 @@ -1102,11 +1037,6 @@
17959 skb_put(skb, skb_old->len + 128);
17960 memcpy(skb->data, skb_old->data, skb_old->len);
17961 - if (net_dev->local->ppp_slot < 0) {
17962 - printk(KERN_ERR "%s: net_dev->local->ppp_slot(%d) out of range\n",
17963 - __FUNCTION__, net_dev->local->ppp_slot);
17964 - goto drop_packet;
17966 pkt_len = slhc_uncompress(ippp_table[net_dev->local->ppp_slot]->slcomp,
17967 skb->data, skb_old->len);
17968 kfree_skb(skb_old);
17969 @@ -1133,36 +1063,12 @@
17973 -#ifdef CONFIG_IPPP_FILTER
17974 - /* check if the packet passes the pass and active filters
17975 - * the filter instructions are constructed assuming
17976 - * a four-byte PPP header on each packet (which is still present) */
17977 - skb_push(skb, 4);
17978 - skb->data[0] = 0; /* indicate inbound */
17980 - if (is->pass_filter.filter
17981 - && sk_run_filter(skb, is->pass_filter.filter,
17982 - is->pass_filter.len) == 0) {
17983 - if (is->debug & 0x2)
17984 - printk(KERN_DEBUG "IPPP: inbound frame filtered.\n");
17988 - if (!(is->active_filter.filter
17989 - && sk_run_filter(skb, is->active_filter.filter,
17990 - is->active_filter.len) == 0)) {
17991 - if (is->debug & 0x2)
17992 - printk(KERN_DEBUG "IPPP: link-active filter: reseting huptimer.\n");
17993 - lp->huptimer = 0;
17995 - mlp->huptimer = 0;
17997 - skb_pull(skb, 4);
17998 -#else /* CONFIG_IPPP_FILTER */
17999 - lp->huptimer = 0;
18001 - mlp->huptimer = 0;
18002 -#endif /* CONFIG_IPPP_FILTER */
18003 + /* Reset hangup-timer */
18004 + lp->huptimer = 0;
18005 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
18006 + lp->dw_abc_bchan_errcnt = 0;
18010 skb->mac.raw = skb->data;
18012 @@ -1199,6 +1105,7 @@
18013 return skb_push(skb,len);
18018 * send ppp frame .. we expect a PIDCOMPressable proto --
18019 * (here: currently always PPP_IP,PPP_VJC_COMP,PPP_VJC_UNCOMP)
18020 @@ -1214,25 +1121,23 @@
18022 unsigned int proto = PPP_IP; /* 0x21 */
18023 struct ippp_struct *ipt,*ipts;
18024 - int slot, retval = 0;
18027 mlp = (isdn_net_local *) (netdev->priv);
18028 nd = mlp->netdev; /* get master lp */
18030 slot = mlp->ppp_slot;
18031 if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
18032 - printk(KERN_ERR "isdn_ppp_xmit: lp->ppp_slot(%d)\n",
18034 + printk(KERN_ERR "isdn_ppp_xmit: lp->ppp_slot %d\n", mlp->ppp_slot);
18039 ipts = ippp_table[slot];
18041 if (!(ipts->pppcfg & SC_ENABLE_IP)) { /* PPP connected ? */
18042 if (ipts->debug & 0x1)
18043 printk(KERN_INFO "%s: IP frame delayed.\n", netdev->name);
18049 switch (ntohs(skb->protocol)) {
18050 @@ -1246,25 +1151,24 @@
18051 printk(KERN_ERR "isdn_ppp: skipped unsupported protocol: %#x.\n",
18053 dev_kfree_skb(skb);
18058 lp = isdn_net_get_locked_lp(nd);
18060 printk(KERN_WARNING "%s: all channels busy - requeuing!\n", netdev->name);
18065 /* we have our lp locked from now on */
18067 slot = lp->ppp_slot;
18068 if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
18069 - printk(KERN_ERR "isdn_ppp_xmit: lp->ppp_slot(%d)\n",
18071 + printk(KERN_ERR "isdn_ppp_xmit: lp->ppp_slot %d\n", lp->ppp_slot);
18076 ipt = ippp_table[slot];
18077 + lp->huptimer = 0;
18080 * after this line .. requeueing in the device queue is no longer allowed!!!
18081 @@ -1275,34 +1179,6 @@
18083 skb_pull(skb,IPPP_MAX_HEADER);
18085 -#ifdef CONFIG_IPPP_FILTER
18086 - /* check if we should pass this packet
18087 - * the filter instructions are constructed assuming
18088 - * a four-byte PPP header on each packet */
18089 - skb_push(skb, 4);
18090 - skb->data[0] = 1; /* indicate outbound */
18091 - *(u_int16_t *)(skb->data + 2) = htons(proto);
18093 - if (ipt->pass_filter.filter
18094 - && sk_run_filter(skb, ipt->pass_filter.filter,
18095 - ipt->pass_filter.len) == 0) {
18096 - if (ipt->debug & 0x4)
18097 - printk(KERN_DEBUG "IPPP: outbound frame filtered.\n");
18101 - if (!(ipt->active_filter.filter
18102 - && sk_run_filter(skb, ipt->active_filter.filter,
18103 - ipt->active_filter.len) == 0)) {
18104 - if (ipt->debug & 0x4)
18105 - printk(KERN_DEBUG "IPPP: link-active filter: reseting huptimer.\n");
18106 - lp->huptimer = 0;
18108 - skb_pull(skb, 4);
18109 -#else /* CONFIG_IPPP_FILTER */
18110 - lp->huptimer = 0;
18111 -#endif /* CONFIG_IPPP_FILTER */
18113 if (ipt->debug & 0x4)
18114 printk(KERN_DEBUG "xmit skb, len %d\n", (int) skb->len);
18115 if (ipts->debug & 0x40)
18116 @@ -1440,54 +1316,9 @@
18119 spin_unlock_bh(&lp->xmit_lock);
18125 -#ifdef CONFIG_IPPP_FILTER
18127 - * check if this packet may trigger auto-dial.
18130 -int isdn_ppp_autodial_filter(struct sk_buff *skb, isdn_net_local *lp)
18132 - struct ippp_struct *is = ippp_table[lp->ppp_slot];
18136 - switch (ntohs(skb->protocol)) {
18144 - printk(KERN_ERR "isdn_ppp_autodial_filter: unsupported protocol 0x%x.\n",
18149 - /* the filter instructions are constructed assuming
18150 - * a four-byte PPP header on each packet. we have to
18151 - * temporarily remove part of the fake header stuck on
18154 - skb_pull(skb, IPPP_MAX_HEADER - 4);
18155 - skb->data[0] = 1; /* indicate outbound */
18156 - *(u_int16_t *)(skb->data + 2) = htons(proto);
18158 - drop |= is->pass_filter.filter
18159 - && sk_run_filter(skb, is->pass_filter.filter,
18160 - is->pass_filter.len) == 0;
18161 - drop |= is->active_filter.filter
18162 - && sk_run_filter(skb, is->active_filter.filter,
18163 - is->active_filter.len) == 0;
18165 - skb_push(skb, IPPP_MAX_HEADER - 4);
18169 #ifdef CONFIG_ISDN_MPP
18171 /* this is _not_ rfc1990 header, but something we convert both short and long
18172 @@ -1537,15 +1368,8 @@
18174 static int isdn_ppp_mp_init( isdn_net_local * lp, ippp_bundle * add_to )
18176 - struct ippp_struct * is;
18178 - if (lp->ppp_slot < 0) {
18179 - printk(KERN_ERR "%s: lp->ppp_slot(%d) out of range\n",
18180 - __FUNCTION__, lp->ppp_slot);
18184 - is = ippp_table[lp->ppp_slot];
18185 + struct ippp_struct * is = ippp_table[lp->ppp_slot];
18188 if( lp->netdev->pb )
18189 lp->netdev->pb->ref_ct--;
18190 @@ -1591,8 +1415,7 @@
18191 stats = &mp->stats;
18192 slot = lp->ppp_slot;
18193 if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
18194 - printk(KERN_ERR "%s: lp->ppp_slot(%d)\n",
18195 - __FUNCTION__, lp->ppp_slot);
18196 + printk(KERN_ERR "isdn_ppp_mp_receive: lp->ppp_slot %d\n", lp->ppp_slot);
18197 stats->frame_drops++;
18198 dev_kfree_skb(skb);
18199 spin_unlock_irqrestore(&mp->lock, flags);
18200 @@ -1628,8 +1451,7 @@
18201 for (lpq = net_dev->queue;;) {
18202 slot = lpq->ppp_slot;
18203 if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
18204 - printk(KERN_ERR "%s: lpq->ppp_slot(%d)\n",
18205 - __FUNCTION__, lpq->ppp_slot);
18206 + printk(KERN_ERR "isdn_ppp_mp_receive: lpq->ppp_slot %d\n", lpq->ppp_slot);
18208 u32 lls = ippp_table[slot]->last_link_seqno;
18209 if (MP_LT(lls, minseq))
18210 @@ -1861,14 +1683,9 @@
18211 struct sk_buff * skb;
18212 unsigned int tot_len;
18214 - if (lp->ppp_slot < 0 || lp->ppp_slot > ISDN_MAX_CHANNELS) {
18215 - printk(KERN_ERR "%s: lp->ppp_slot(%d) out of range\n",
18216 - __FUNCTION__, lp->ppp_slot);
18219 if( MP_FLAGS(from) == (MP_BEGIN_FRAG | MP_END_FRAG) ) {
18220 if( ippp_table[lp->ppp_slot]->debug & 0x40 )
18221 - printk(KERN_DEBUG "isdn_mppp: reassembly: frame %d, "
18222 + printk(KERN_DEBUG"isdn_mppp: reassembly: frame %d, "
18223 "len %d\n", MP_SEQ(from), from->len );
18225 skb_pull(skb, MP_HEADER_LEN);
18226 @@ -1987,10 +1804,8 @@
18227 memset(&t, 0, sizeof(struct ppp_stats));
18228 if (dev->flags & IFF_UP) {
18229 t.p.ppp_ipackets = lp->stats.rx_packets;
18230 - t.p.ppp_ibytes = lp->stats.rx_bytes;
18231 t.p.ppp_ierrors = lp->stats.rx_errors;
18232 t.p.ppp_opackets = lp->stats.tx_packets;
18233 - t.p.ppp_obytes = lp->stats.tx_bytes;
18234 t.p.ppp_oerrors = lp->stats.tx_errors;
18235 #ifdef CONFIG_ISDN_PPP_VJ
18236 if (slot >= 0 && ippp_table[slot]->slcomp) {
18237 @@ -2018,6 +1833,9 @@
18239 isdn_net_local *lp = (isdn_net_local *) dev->priv;
18242 + printk(KERN_DEBUG "ippp, dev_ioctl: cmd %#08x , %d \n", cmd, lp->ppp_slot);
18245 if (lp->p_encap != ISDN_NET_ENCAP_SYNCPPP)
18247 @@ -2431,7 +2249,7 @@
18250 rs->state = CCPResetSentReq;
18251 - /* We always expect an Ack if the decompressor doesn't
18252 + /* We always expect an Ack if the decompressor doesnt
18256 @@ -2582,7 +2400,13 @@
18259 if(type) { /* type=1 => Link compression */
18261 + compressor = is->link_compressor;
18262 + stat = is->link_comp_stat;
18263 + new_proto = PPP_LINK_COMP;
18270 @@ -2630,31 +2454,18 @@
18271 static void isdn_ppp_receive_ccp(isdn_net_dev *net_dev, isdn_net_local *lp,
18272 struct sk_buff *skb,int proto)
18274 - struct ippp_struct *is;
18275 + struct ippp_struct *is = ippp_table[lp->ppp_slot];
18276 struct ippp_struct *mis;
18278 struct isdn_ppp_resetparams rsparm;
18279 unsigned char rsdata[IPPP_RESET_MAXDATABYTES];
18281 - printk(KERN_DEBUG "Received CCP frame from peer slot(%d)\n",
18283 - if (lp->ppp_slot < 0 || lp->ppp_slot > ISDN_MAX_CHANNELS) {
18284 - printk(KERN_ERR "%s: lp->ppp_slot(%d) out of range\n",
18285 - __FUNCTION__, lp->ppp_slot);
18288 - is = ippp_table[lp->ppp_slot];
18289 + printk(KERN_DEBUG "Received CCP frame from peer\n");
18290 isdn_ppp_frame_log("ccp-rcv", skb->data, skb->len, 32, is->unit,lp->ppp_slot);
18293 - int slot = ((isdn_net_local *) (lp->master->priv))->ppp_slot;
18294 - if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
18295 - printk(KERN_ERR "%s: slot(%d) out of range\n",
18296 - __FUNCTION__, slot);
18299 - mis = ippp_table[slot];
18302 + mis = ippp_table[((isdn_net_local *) (lp->master->priv))->ppp_slot];
18306 switch(skb->data[0]) {
18307 @@ -2806,18 +2617,13 @@
18309 static void isdn_ppp_send_ccp(isdn_net_dev *net_dev, isdn_net_local *lp, struct sk_buff *skb)
18311 - struct ippp_struct *mis,*is;
18312 - int proto, slot = lp->ppp_slot;
18313 + struct ippp_struct *mis,*is = ippp_table[lp->ppp_slot];
18315 unsigned char *data;
18317 if(!skb || skb->len < 3)
18319 - if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
18320 - printk(KERN_ERR "%s: lp->ppp_slot(%d) out of range\n",
18321 - __FUNCTION__, slot);
18324 - is = ippp_table[slot];
18326 /* Daemon may send with or without address and control field comp */
18328 if(!(is->pppcfg & SC_COMP_AC) && data[0] == 0xff && data[1] == 0x03) {
18329 @@ -2833,17 +2639,12 @@
18330 printk(KERN_DEBUG "Received CCP frame from daemon:\n");
18331 isdn_ppp_frame_log("ccp-xmit", skb->data, skb->len, 32, is->unit,lp->ppp_slot);
18333 - if (lp->master) {
18334 - slot = ((isdn_net_local *) (lp->master->priv))->ppp_slot;
18335 - if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
18336 - printk(KERN_ERR "%s: slot(%d) out of range\n",
18337 - __FUNCTION__, slot);
18340 - mis = ippp_table[slot];
18345 + mis = ippp_table[((isdn_net_local *) (lp->master->priv))->ppp_slot];
18350 printk(KERN_DEBUG "isdn_ppp: Ouch! Master CCP sends on slave slot!\n");
18353 diff -rNu linux-2.4.29.old/drivers/isdn/isdn_ppp.h linux-2.4.29/drivers/isdn/isdn_ppp.h
18354 --- linux-2.4.29.old/drivers/isdn/isdn_ppp.h 2005-03-22 14:47:56.000000000 +0100
18355 +++ linux-2.4.29/drivers/isdn/isdn_ppp.h 2005-03-22 15:06:44.497328160 +0100
18357 -/* $Id: isdn_ppp.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
18358 +/* $Id: isdn_ppp.h,v 1.18 2001/09/24 13:22:42 kai Exp $
18360 * header for Linux ISDN subsystem, functions for synchronous PPP (linklevel).
18363 extern void isdn_ppp_cleanup(void);
18364 extern int isdn_ppp_free(isdn_net_local *);
18365 extern int isdn_ppp_bind(isdn_net_local *);
18366 -extern int isdn_ppp_autodial_filter(struct sk_buff *, isdn_net_local *);
18367 extern int isdn_ppp_xmit(struct sk_buff *, struct net_device *);
18368 extern void isdn_ppp_receive(isdn_net_dev *, isdn_net_local *, struct sk_buff *);
18369 extern int isdn_ppp_dev_ioctl(struct net_device *, struct ifreq *, int);
18370 diff -rNu linux-2.4.29.old/drivers/isdn/isdn_tty.c linux-2.4.29/drivers/isdn/isdn_tty.c
18371 --- linux-2.4.29.old/drivers/isdn/isdn_tty.c 2005-03-22 14:47:56.000000000 +0100
18372 +++ linux-2.4.29/drivers/isdn/isdn_tty.c 2005-03-22 15:06:44.524324056 +0100
18374 -/* $Id: isdn_tty.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
18375 +/* $Id: isdn_tty.c,v 1.104 2002/02/09 21:19:11 keil Exp $
18377 * Linux ISDN subsystem, tty functions and AT-command emulator (linklevel).
18380 static int si2bit[8] =
18381 {4, 1, 4, 4, 4, 4, 4, 4};
18383 -char *isdn_tty_revision = "$Revision: 1.1.4.1 $";
18384 +char *isdn_tty_revision = "$Revision: 1.104 $";
18387 /* isdn_tty_try_read() is called from within isdn_tty_rcv_skb()
18388 @@ -321,7 +321,10 @@
18389 info->send_outstanding++;
18390 info->msr &= ~UART_MSR_CTS;
18391 info->lsr &= ~UART_LSR_TEMT;
18393 + if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
18394 + tty->ldisc.write_wakeup)
18395 + (tty->ldisc.write_wakeup) (tty);
18396 + wake_up_interruptible(&tty->write_wait);
18400 @@ -1211,7 +1214,10 @@
18401 /* If DLE decoding results in zero-transmit, but
18402 * c originally was non-zero, do a wakeup.
18405 + if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
18406 + tty->ldisc.write_wakeup)
18407 + (tty->ldisc.write_wakeup) (tty);
18408 + wake_up_interruptible(&tty->write_wait);
18409 info->msr |= UART_MSR_CTS;
18410 info->lsr |= UART_LSR_TEMT;
18412 @@ -1232,6 +1238,7 @@
18416 +#ifdef ISDN_TTY_FCLASS1
18417 if (TTY_IS_FCLASS1(info)) {
18418 int cc = isdn_tty_handleDLEdown(info, m, c);
18420 @@ -1252,6 +1259,7 @@
18421 info->xmit_count += cc;
18425 info->xmit_count += c;
18427 info->msr |= UART_MSR_CTS;
18428 @@ -1329,7 +1337,10 @@
18429 isdn_tty_cleanup_xmit(info);
18430 info->xmit_count = 0;
18431 restore_flags(flags);
18433 + wake_up_interruptible(&tty->write_wait);
18434 + if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
18435 + tty->ldisc.write_wakeup)
18436 + (tty->ldisc.write_wakeup) (tty);
18440 @@ -1858,7 +1869,8 @@
18441 isdn_tty_shutdown(info);
18442 if (tty->driver.flush_buffer)
18443 tty->driver.flush_buffer(tty);
18444 - tty_ldisc_flush(tty);
18445 + if (tty->ldisc.flush_buffer)
18446 + tty->ldisc.flush_buffer(tty);
18448 info->ncarrier = 0;
18450 @@ -2306,6 +2318,22 @@
18451 isdn_tty_at_cout("\r\n", info);
18454 + case ISDN_STAT_ALERT:
18455 +#ifdef ISDN_TTY_STAT_DEBUG
18456 + printk(KERN_DEBUG "tty_STAT_ALERT ttyI%d\n", info->line);
18458 + /* Signal RINGING to tty-device if requested */
18459 + if (info->emu.mdmreg[REG_ALERT] & BIT_ALERT)
18460 + isdn_tty_modem_result(RESULT_RINGING, info);
18462 + case ISDN_STAT_PROCEED:
18463 +#ifdef ISDN_TTY_STAT_DEBUG
18464 + printk(KERN_DEBUG "tty_STAT_PROCEED ttyI%d\n", info->line);
18466 + /* Signal PROCEEDING to tty-device if requested */
18467 + if (info->emu.mdmreg[REG_PROCEED] & BIT_PROCEED)
18468 + isdn_tty_modem_result(RESULT_PROCEEDING, info);
18470 case ISDN_STAT_DCONN:
18471 #ifdef ISDN_TTY_STAT_DEBUG
18472 printk(KERN_DEBUG "tty_STAT_DCONN ttyI%d\n", info->line);
18473 @@ -2618,7 +2646,7 @@
18474 static char *msg[] =
18475 {"OK", "CONNECT", "RING", "NO CARRIER", "ERROR",
18476 "CONNECT 64000", "NO DIALTONE", "BUSY", "NO ANSWER",
18477 - "RINGING", "NO MSN/EAZ", "VCON", "RUNG"};
18478 + "RINGING", "NO MSN/EAZ", "VCON", "RUNG", "PROCEEDING"};
18480 char s[ISDN_MSNLEN+10];
18482 @@ -2781,7 +2809,8 @@
18483 restore_flags(flags);
18486 - tty_ldisc_flush(info->tty);
18487 + if (info->tty->ldisc.flush_buffer)
18488 + info->tty->ldisc.flush_buffer(info->tty);
18489 if ((info->flags & ISDN_ASYNC_CHECK_CD) &&
18490 (!((info->flags & ISDN_ASYNC_CALLOUT_ACTIVE) &&
18491 (info->flags & ISDN_ASYNC_CALLOUT_NOHUP)))) {
18492 @@ -3296,9 +3325,11 @@
18493 #ifdef CONFIG_ISDN_TTY_FAX
18494 if (TTY_IS_FCLASS2(info))
18495 sprintf(rs, "\r\n2");
18496 +#ifdef ISDN_TTY_FCLASS1
18497 else if (TTY_IS_FCLASS1(info))
18498 sprintf(rs, "\r\n1");
18501 isdn_tty_at_cout(rs, info);
18504 @@ -3313,6 +3344,7 @@
18505 m->mdmreg[REG_PSIZE] * 16;
18507 #ifdef CONFIG_ISDN_TTY_FAX
18508 +#ifdef ISDN_TTY_FCLASS1
18511 if (!(dev->global_features &
18512 @@ -3324,6 +3356,7 @@
18514 m->mdmreg[REG_PSIZE] * 16;
18519 if (!(dev->global_features &
18520 @@ -3348,9 +3381,11 @@
18522 strcpy(rs, "\r\n0,");
18523 #ifdef CONFIG_ISDN_TTY_FAX
18524 +#ifdef ISDN_TTY_FCLASS1
18525 if (dev->global_features &
18526 ISDN_FEATURE_L3_FCLASS1)
18529 if (dev->global_features &
18530 ISDN_FEATURE_L3_FCLASS2)
18532 diff -rNu linux-2.4.29.old/drivers/isdn/isdn_tty.h linux-2.4.29/drivers/isdn/isdn_tty.h
18533 --- linux-2.4.29.old/drivers/isdn/isdn_tty.h 2005-03-22 14:47:56.000000000 +0100
18534 +++ linux-2.4.29/drivers/isdn/isdn_tty.h 2005-03-22 15:06:44.545320864 +0100
18536 -/* $Id: isdn_tty.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
18537 +/* $Id: isdn_tty.h,v 1.25 2002/02/09 21:19:11 keil Exp $
18539 * header for Linux ISDN subsystem, tty related functions (linklevel).
18542 #define BIT_CPNFCON 2
18545 +#define REG_ALERT 23
18546 +#define BIT_ALERT 8
18547 +#define REG_PROCEED 23
18548 +#define BIT_PROCEED 16
18550 /* defines for result codes */
18551 #define RESULT_OK 0
18552 @@ -93,10 +97,13 @@
18553 #define RESULT_NO_MSN_EAZ 10
18554 #define RESULT_VCON 11
18555 #define RESULT_RUNG 12
18556 +#define RESULT_PROCEEDING 13
18558 +#ifdef ISDN_TTY_FCLASS1
18559 #define TTY_IS_FCLASS1(info) \
18560 ((info->emu.mdmreg[REG_L2PROT] == ISDN_PROTO_L2_FAX) && \
18561 (info->emu.mdmreg[REG_L3PROT] == ISDN_PROTO_L3_FCLASS1))
18563 #define TTY_IS_FCLASS2(info) \
18564 ((info->emu.mdmreg[REG_L2PROT] == ISDN_PROTO_L2_FAX) && \
18565 (info->emu.mdmreg[REG_L3PROT] == ISDN_PROTO_L3_FCLASS2))
18566 diff -rNu linux-2.4.29.old/drivers/isdn/isdn_ttyfax.c linux-2.4.29/drivers/isdn/isdn_ttyfax.c
18567 --- linux-2.4.29.old/drivers/isdn/isdn_ttyfax.c 2005-03-22 14:47:56.000000000 +0100
18568 +++ linux-2.4.29/drivers/isdn/isdn_ttyfax.c 2005-03-22 15:06:44.561318432 +0100
18570 -/* $Id: isdn_ttyfax.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
18571 +/* $Id: isdn_ttyfax.c,v 1.9 2001/09/24 13:22:43 kai Exp $
18573 * Linux ISDN subsystem, tty_fax AT-command emulator (linklevel).
18576 #include "isdn_ttyfax.h"
18579 -static char *isdn_tty_fax_revision = "$Revision: 1.1.4.1 $";
18580 +static char *isdn_tty_fax_revision = "$Revision: 1.9 $";
18582 #define PARSE_ERROR1 { isdn_tty_fax_modem_result(1, info); return 1; }
18584 @@ -148,6 +148,7 @@
18588 +#ifdef ISDN_TTY_FCLASS1
18590 isdn_tty_fax_command1(modem_info * info, isdn_ctrl * c)
18592 @@ -186,6 +187,7 @@
18599 isdn_tty_fax_command(modem_info * info, isdn_ctrl * c)
18600 @@ -193,8 +195,10 @@
18601 T30_s *f = info->fax;
18604 +#ifdef ISDN_TTY_FCLASS1
18605 if (TTY_IS_FCLASS1(info))
18606 return (isdn_tty_fax_command1(info, c));
18609 #ifdef ISDN_TTY_FAX_CMD_DEBUG
18610 printk(KERN_DEBUG "isdn_tty: Fax cmd %d on ttyI%d\n",
18611 @@ -312,6 +316,7 @@
18615 +#ifdef ISDN_TTY_FCLASS1
18617 * Parse AT+F.. FAX class 1 commands
18619 @@ -403,6 +408,7 @@
18626 * Parse AT+F.. FAX class 2 commands
18627 @@ -970,6 +976,70 @@
18632 + /* LO=n - Flow control opts */
18633 + if (!strncmp(p[0], "LO", 2)) { /* TODO */
18638 + sprintf(rs, "\r\n%d", f->lo);
18639 + isdn_tty_at_cout(rs, info);
18643 + if (*p[0] == '?') {
18645 + sprintf(rs, "\r\n0,1,2");
18646 + isdn_tty_at_cout(rs, info);
18648 + par = isdn_getnum(p);
18649 + if ((par < 0) || (par > 2))
18652 +#ifdef ISDN_TTY_FAX_STAT_DEBUG
18653 + printk(KERN_DEBUG "isdn_tty: Fax FLO=%d\n", par);
18664 + /* LPL=n - Doc for polling cmd */
18665 + if (!strncmp(p[0], "LPL", 3)) { /* TODO */
18670 + sprintf(rs, "\r\n%d", f->lpl);
18671 + isdn_tty_at_cout(rs, info);
18675 + if (*p[0] == '?') {
18677 + sprintf(rs, "\r\n0,1");
18678 + isdn_tty_at_cout(rs, info);
18680 + par = isdn_getnum(p);
18681 + if ((par < 0) || (par > 1))
18684 +#ifdef ISDN_TTY_FAX_STAT_DEBUG
18685 + printk(KERN_DEBUG "isdn_tty: Fax FLPL=%d\n", par);
18696 /* MDL? - DCE Model */
18697 if (!strncmp(p[0], "MDL?", 4)) {
18698 @@ -1049,6 +1119,38 @@
18703 + /* PTS=n - Page transfer status */
18704 + if (!strncmp(p[0], "PTS", 3)) { /* TODO */
18709 + sprintf(rs, "\r\n%d", f->pts);
18710 + isdn_tty_at_cout(rs, info);
18714 + if (*p[0] == '?') {
18716 + sprintf(rs, "\r\n0-5");
18717 + isdn_tty_at_cout(rs, info);
18719 + par = isdn_getnum(p);
18720 + if ((par < 0) || (par > 5))
18723 +#ifdef ISDN_TTY_FAX_STAT_DEBUG
18724 + printk(KERN_DEBUG "isdn_tty: Fax FPTS=%d\n", par);
18735 /* REL=n - Phase C received EOL alignment */
18736 if (!strncmp(p[0], "REL", 3)) {
18737 @@ -1091,6 +1193,38 @@
18738 isdn_tty_at_cout(rs, info);
18742 + /* SPL=n - Enable polling */
18743 + if (!strncmp(p[0], "SPL", 3)) { /* TODO */
18748 + sprintf(rs, "\r\n%d", f->spl);
18749 + isdn_tty_at_cout(rs, info);
18753 + if (*p[0] == '?') {
18755 + sprintf(rs, "\r\n0,1");
18756 + isdn_tty_at_cout(rs, info);
18758 + par = isdn_getnum(p);
18759 + if ((par < 0) || (par > 1))
18762 +#ifdef ISDN_TTY_FAX_STAT_DEBUG
18763 + printk(KERN_DEBUG "isdn_tty: Fax FSPL=%d\n", par);
18774 /* Phase C Transmit Data Block Size */
18775 if (!strncmp(p[0], "TBC=", 4)) { /* dummy, not used */
18776 @@ -1116,7 +1250,9 @@
18778 if (TTY_IS_FCLASS2(info))
18779 return (isdn_tty_cmd_FCLASS2(p, info));
18780 +#ifdef ISDN_TTY_FCLASS1
18781 else if (TTY_IS_FCLASS1(info))
18782 return (isdn_tty_cmd_FCLASS1(p, info));
18786 diff -rNu linux-2.4.29.old/drivers/isdn/isdn_ttyfax.h linux-2.4.29/drivers/isdn/isdn_ttyfax.h
18787 --- linux-2.4.29.old/drivers/isdn/isdn_ttyfax.h 2005-03-22 14:47:56.000000000 +0100
18788 +++ linux-2.4.29/drivers/isdn/isdn_ttyfax.h 2005-03-22 15:06:44.576316152 +0100
18790 -/* $Id: isdn_ttyfax.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
18791 +/* $Id: isdn_ttyfax.h,v 1.3 2001/09/24 13:22:43 kai Exp $
18793 * header for Linux ISDN subsystem, tty_fax related functions (linklevel).
18795 diff -rNu linux-2.4.29.old/drivers/isdn/isdn_v110.c linux-2.4.29/drivers/isdn/isdn_v110.c
18796 --- linux-2.4.29.old/drivers/isdn/isdn_v110.c 2005-03-22 14:47:56.000000000 +0100
18797 +++ linux-2.4.29/drivers/isdn/isdn_v110.c 2005-03-22 15:06:44.593313568 +0100
18799 -/* $Id: isdn_v110.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
18800 +/* $Id: isdn_v110.c,v 1.8 2001/09/24 13:22:43 kai Exp $
18802 * Linux ISDN subsystem, V.110 related functions (linklevel).
18806 #undef ISDN_V110_DEBUG
18808 -char *isdn_v110_revision = "$Revision: 1.1.4.1 $";
18809 +char *isdn_v110_revision = "$Revision: 1.8 $";
18811 #define V110_38400 255
18812 #define V110_19200 15
18813 @@ -138,6 +138,14 @@
18815 #ifdef ISDN_V110_DEBUG
18816 printk(KERN_DEBUG "v110 close\n");
18818 + printk(KERN_DEBUG "isdn_v110_close: nbytes=%d\n", v->nbytes);
18819 + printk(KERN_DEBUG "isdn_v110_close: nbits=%d\n", v->nbits);
18820 + printk(KERN_DEBUG "isdn_v110_close: key=%d\n", v->key);
18821 + printk(KERN_DEBUG "isdn_v110_close: SyncInit=%d\n", v->SyncInit);
18822 + printk(KERN_DEBUG "isdn_v110:close: decodelen=%d\n", v->decodelen);
18823 + printk(KERN_DEBUG "isdn_v110_close: framelen=%d\n", v->framelen);
18826 kfree(v->encodebuf);
18828 diff -rNu linux-2.4.29.old/drivers/isdn/isdn_v110.h linux-2.4.29/drivers/isdn/isdn_v110.h
18829 --- linux-2.4.29.old/drivers/isdn/isdn_v110.h 2005-03-22 14:47:56.000000000 +0100
18830 +++ linux-2.4.29/drivers/isdn/isdn_v110.h 2005-03-22 15:06:44.608311288 +0100
18832 -/* $Id: isdn_v110.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
18833 +/* $Id: isdn_v110.h,v 1.5 2001/09/24 13:22:43 kai Exp $
18835 * Linux ISDN subsystem, V.110 related functions (linklevel).
18837 diff -rNu linux-2.4.29.old/drivers/isdn/isdn_x25iface.c linux-2.4.29/drivers/isdn/isdn_x25iface.c
18838 --- linux-2.4.29.old/drivers/isdn/isdn_x25iface.c 2005-03-22 14:47:56.000000000 +0100
18839 +++ linux-2.4.29/drivers/isdn/isdn_x25iface.c 2005-03-22 15:06:44.626308552 +0100
18841 -/* $Id: isdn_x25iface.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
18842 +/* $Id: isdn_x25iface.c,v 1.10 2001/09/24 13:22:43 kai Exp $
18844 * Linux ISDN subsystem, X.25 related functions
18846 diff -rNu linux-2.4.29.old/drivers/isdn/isdn_x25iface.h linux-2.4.29/drivers/isdn/isdn_x25iface.h
18847 --- linux-2.4.29.old/drivers/isdn/isdn_x25iface.h 2005-03-22 14:47:56.000000000 +0100
18848 +++ linux-2.4.29/drivers/isdn/isdn_x25iface.h 2005-03-22 15:06:44.645305664 +0100
18850 -/* $Id: isdn_x25iface.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
18851 +/* $Id: isdn_x25iface.h,v 1.4 2001/09/24 13:22:43 kai Exp $
18853 * header for Linux ISDN subsystem, x.25 related functions
18855 diff -rNu linux-2.4.29.old/drivers/isdn/isdnloop/isdnloop.c linux-2.4.29/drivers/isdn/isdnloop/isdnloop.c
18856 --- linux-2.4.29.old/drivers/isdn/isdnloop/isdnloop.c 2005-03-22 14:47:56.000000000 +0100
18857 +++ linux-2.4.29/drivers/isdn/isdnloop/isdnloop.c 2005-03-22 15:06:48.813671976 +0100
18859 -/* $Id: isdnloop.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
18860 +/* $Id: isdnloop.c,v 1.17 2001/08/30 10:45:42 kai Exp $
18862 * ISDN low-level module implementing a dummy loop driver.
18865 #include <linux/init.h>
18866 #include "isdnloop.h"
18868 -static char *revision = "$Revision: 1.1.4.1 $";
18869 +static char *revision = "$Revision$";
18870 static char *isdnloop_id;
18872 MODULE_DESCRIPTION("ISDN4Linux: Pseudo Driver that simulates an ISDN card");
18874 MODULE_LICENSE("GPL");
18875 MODULE_PARM(isdnloop_id, "s");
18876 MODULE_PARM_DESC(isdnloop_id, "ID-String of first card");
18878 -static int isdnloop_addcard(char *);
18880 + static int isdnloop_addcard(char *);
18883 * Free queue completely.
18884 @@ -1542,11 +1542,7 @@
18886 strcpy(rev, " ??? ");
18887 printk(KERN_NOTICE "isdnloop-ISDN-driver Rev%s\n", rev);
18890 - return (isdnloop_addcard(isdnloop_id));
18893 + return (isdnloop_addcard(isdnloop_id));
18897 diff -rNu linux-2.4.29.old/drivers/isdn/isdnloop/isdnloop.h linux-2.4.29/drivers/isdn/isdnloop/isdnloop.h
18898 --- linux-2.4.29.old/drivers/isdn/isdnloop/isdnloop.h 2005-03-22 14:47:56.000000000 +0100
18899 +++ linux-2.4.29/drivers/isdn/isdnloop/isdnloop.h 2005-03-22 15:06:48.834668784 +0100
18901 -/* $Id: isdnloop.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
18904 * Loopback lowlevel module for testing of linklevel.
18906 diff -rNu linux-2.4.29.old/drivers/isdn/pcbit/callbacks.c linux-2.4.29/drivers/isdn/pcbit/callbacks.c
18907 --- linux-2.4.29.old/drivers/isdn/pcbit/callbacks.c 2005-03-22 14:47:56.000000000 +0100
18908 +++ linux-2.4.29/drivers/isdn/pcbit/callbacks.c 2005-03-22 15:06:48.909657384 +0100
18911 * Copyright (C) 1996 Universidade de Lisboa
18913 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
18914 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
18916 * This software may be used and distributed according to the terms of
18917 * the GNU General Public License, incorporated herein by reference.
18918 diff -rNu linux-2.4.29.old/drivers/isdn/pcbit/callbacks.h linux-2.4.29/drivers/isdn/pcbit/callbacks.h
18919 --- linux-2.4.29.old/drivers/isdn/pcbit/callbacks.h 2005-03-22 14:47:56.000000000 +0100
18920 +++ linux-2.4.29/drivers/isdn/pcbit/callbacks.h 2005-03-22 15:06:48.953650696 +0100
18923 * Copyright (C) 1996 Universidade de Lisboa
18925 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
18926 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
18928 * This software may be used and distributed according to the terms of
18929 * the GNU General Public License, incorporated herein by reference.
18930 diff -rNu linux-2.4.29.old/drivers/isdn/pcbit/capi.c linux-2.4.29/drivers/isdn/pcbit/capi.c
18931 --- linux-2.4.29.old/drivers/isdn/pcbit/capi.c 2005-03-22 14:47:56.000000000 +0100
18932 +++ linux-2.4.29/drivers/isdn/pcbit/capi.c 2005-03-22 15:06:49.042637168 +0100
18935 * Copyright (C) 1996 Universidade de Lisboa
18937 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
18938 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
18940 * This software may be used and distributed according to the terms of
18941 * the GNU General Public License, incorporated herein by reference.
18942 diff -rNu linux-2.4.29.old/drivers/isdn/pcbit/capi.h linux-2.4.29/drivers/isdn/pcbit/capi.h
18943 --- linux-2.4.29.old/drivers/isdn/pcbit/capi.h 2005-03-22 14:47:56.000000000 +0100
18944 +++ linux-2.4.29/drivers/isdn/pcbit/capi.h 2005-03-22 15:06:49.071632760 +0100
18947 * Copyright (C) 1996 Universidade de Lisboa
18949 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
18950 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
18952 * This software may be used and distributed according to the terms of
18953 * the GNU General Public License, incorporated herein by reference.
18955 extern int capi_decode_debug_188(u_char *hdr, ushort hdrlen);
18958 -static inline struct pcbit_chan *
18960 +struct pcbit_chan *
18961 capi_channel(struct pcbit_dev *dev, struct sk_buff *skb)
18964 diff -rNu linux-2.4.29.old/drivers/isdn/pcbit/drv.c linux-2.4.29/drivers/isdn/pcbit/drv.c
18965 --- linux-2.4.29.old/drivers/isdn/pcbit/drv.c 2005-03-22 14:47:56.000000000 +0100
18966 +++ linux-2.4.29/drivers/isdn/pcbit/drv.c 2005-03-22 15:06:49.091629720 +0100
18969 * Copyright (C) 1996 Universidade de Lisboa
18971 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
18972 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
18974 * This software may be used and distributed according to the terms of
18975 * the GNU General Public License, incorporated herein by reference.
18977 #include <linux/isdnif.h>
18978 #include <asm/string.h>
18979 #include <asm/io.h>
18980 +#ifdef COMPAT_HAS_ISA_IOREMAP
18981 #include <linux/ioport.h>
18988 if (mem_base >= 0xA0000 && mem_base <= 0xFFFFF ) {
18989 dev->ph_mem = mem_base;
18990 +#ifdef COMPAT_HAS_ISA_IOREMAP
18991 if (check_mem_region(dev->ph_mem, 4096)) {
18992 printk(KERN_WARNING
18993 "PCBIT: memory region %lx-%lx already in use\n",
18994 @@ -100,6 +103,9 @@
18995 request_mem_region(dev->ph_mem, 4096, "PCBIT mem");
18997 dev->sh_mem = (unsigned char*)ioremap(dev->ph_mem, 4096);
18999 + dev->sh_mem = (unsigned char*) mem_base;
19004 @@ -112,8 +118,10 @@
19005 dev->b1 = kmalloc(sizeof(struct pcbit_chan), GFP_KERNEL);
19007 printk("pcbit_init: couldn't malloc pcbit_chan struct\n");
19008 +#ifdef COMPAT_HAS_ISA_IOREMAP
19009 iounmap((unsigned char*)dev->sh_mem);
19010 release_mem_region(dev->ph_mem, 4096);
19015 @@ -122,8 +130,10 @@
19017 printk("pcbit_init: couldn't malloc pcbit_chan struct\n");
19019 +#ifdef COMPAT_HAS_ISA_IOREMAP
19020 iounmap((unsigned char*)dev->sh_mem);
19021 release_mem_region(dev->ph_mem, 4096);
19026 @@ -144,8 +154,10 @@
19030 +#ifdef COMPAT_HAS_ISA_IOREMAP
19031 iounmap((unsigned char*)dev->sh_mem);
19032 release_mem_region(dev->ph_mem, 4096);
19035 dev_pcbit[board] = NULL;
19037 @@ -166,8 +178,10 @@
19038 free_irq(irq, dev);
19041 +#ifdef COMPAT_HAS_ISA_IOREMAP
19042 iounmap((unsigned char*)dev->sh_mem);
19043 release_mem_region(dev->ph_mem, 4096);
19046 dev_pcbit[board] = NULL;
19048 @@ -197,8 +211,10 @@
19049 free_irq(irq, dev);
19052 +#ifdef COMPAT_HAS_ISA_IOREMAP
19053 iounmap((unsigned char*)dev->sh_mem);
19054 release_mem_region(dev->ph_mem, 4096);
19057 dev_pcbit[board] = NULL;
19059 @@ -235,8 +251,10 @@
19060 del_timer(&dev->b2->fsm_timer);
19063 +#ifdef COMPAT_HAS_ISA_IOREMAP
19064 iounmap((unsigned char*)dev->sh_mem);
19065 release_mem_region(dev->ph_mem, 4096);
19070 @@ -430,7 +448,7 @@
19071 switch(dev->l2_state) {
19073 /* check (size <= rdp_size); write buf into board */
19074 - if (len < 0 || len > BANK4 + 1)
19075 + if (len > BANK4 + 1)
19077 printk("pcbit_writecmd: invalid length %d\n", len);
19079 @@ -609,6 +627,20 @@
19081 dev->b2->s_refnum);
19084 + if (dev->b1->s_refnum == refnum)
19088 + if (dev->b2->s_refnum == refnum)
19092 + printk(KERN_WARNING "Connection Confirm - refnum doesn't match chan\n");
19097 /* We just try to find a channel in the right state */
19099 if (dev->b1->fsm_state == ST_CALL_INIT)
19100 @@ -622,6 +654,7 @@
19105 if (capi_decode_conn_conf(chan, skb, &complete)) {
19106 printk(KERN_DEBUG "conn_conf indicates error\n");
19107 pcbit_fsm_event(dev, chan, EV_ERROR, NULL);
19108 diff -rNu linux-2.4.29.old/drivers/isdn/pcbit/edss1.c linux-2.4.29/drivers/isdn/pcbit/edss1.c
19109 --- linux-2.4.29.old/drivers/isdn/pcbit/edss1.c 2005-03-22 14:47:56.000000000 +0100
19110 +++ linux-2.4.29/drivers/isdn/pcbit/edss1.c 2005-03-22 15:06:49.119625464 +0100
19113 * Copyright (C) 1996 Universidade de Lisboa
19115 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19116 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
19118 * This software may be used and distributed according to the terms of
19119 * the GNU General Public License, incorporated herein by reference.
19120 diff -rNu linux-2.4.29.old/drivers/isdn/pcbit/edss1.h linux-2.4.29/drivers/isdn/pcbit/edss1.h
19121 --- linux-2.4.29.old/drivers/isdn/pcbit/edss1.h 2005-03-22 14:47:56.000000000 +0100
19122 +++ linux-2.4.29/drivers/isdn/pcbit/edss1.h 2005-03-22 15:06:49.161619080 +0100
19125 * Copyright (C) 1996 Universidade de Lisboa
19127 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19128 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
19130 * This software may be used and distributed according to the terms of
19131 * the GNU General Public License, incorporated herein by reference.
19132 diff -rNu linux-2.4.29.old/drivers/isdn/pcbit/layer2.c linux-2.4.29/drivers/isdn/pcbit/layer2.c
19133 --- linux-2.4.29.old/drivers/isdn/pcbit/layer2.c 2005-03-22 14:47:56.000000000 +0100
19134 +++ linux-2.4.29/drivers/isdn/pcbit/layer2.c 2005-03-22 15:06:49.195613912 +0100
19137 * Copyright (C) 1996 Universidade de Lisboa
19139 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19140 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
19142 * This software may be used and distributed according to the terms of
19143 * the GNU General Public License, incorporated herein by reference.
19144 @@ -369,11 +369,16 @@
19146 if (dev->read_frame) {
19147 printk(KERN_DEBUG "pcbit_receive: Type 0 frame and read_frame != NULL\n");
19149 + pcbit_l2_error(dev);
19152 /* discard previous queued frame */
19153 if (dev->read_frame->skb)
19154 kfree_skb(dev->read_frame->skb);
19155 kfree(dev->read_frame);
19156 dev->read_frame = NULL;
19159 frame = kmalloc(sizeof(struct frame_buf), GFP_ATOMIC);
19161 @@ -449,10 +454,14 @@
19163 if (!(frame = dev->read_frame)) {
19164 printk("Type 1 frame and no frame queued\n");
19166 /* usually after an error: toss frame */
19167 dev->readptr += tt;
19168 if (dev->readptr > dev->sh_mem + BANK2 + BANKLEN)
19169 dev->readptr -= BANKLEN;
19171 + pcbit_l2_error(dev);
19176 diff -rNu linux-2.4.29.old/drivers/isdn/pcbit/layer2.h linux-2.4.29/drivers/isdn/pcbit/layer2.h
19177 --- linux-2.4.29.old/drivers/isdn/pcbit/layer2.h 2005-03-22 14:47:56.000000000 +0100
19178 +++ linux-2.4.29/drivers/isdn/pcbit/layer2.h 2005-03-22 15:06:49.228608896 +0100
19181 * Copyright (C) 1996 Universidade de Lisboa
19183 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19184 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
19186 * This software may be used and distributed according to the terms of
19187 * the GNU General Public License, incorporated herein by reference.
19188 diff -rNu linux-2.4.29.old/drivers/isdn/pcbit/module.c linux-2.4.29/drivers/isdn/pcbit/module.c
19189 --- linux-2.4.29.old/drivers/isdn/pcbit/module.c 2005-03-22 14:47:56.000000000 +0100
19190 +++ linux-2.4.29/drivers/isdn/pcbit/module.c 2005-03-22 15:06:49.251605400 +0100
19193 * Copyright (C) 1996 Universidade de Lisboa
19195 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19196 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
19198 * This software may be used and distributed according to the terms of
19199 * the GNU General Public License, incorporated herein by reference.
19204 +#ifdef COMPAT_HAS_NEW_SETUP
19205 #define MAX_PARA (MAX_PCBIT_CARDS * 2)
19206 static int __init pcbit_setup(char *line)
19208 @@ -100,6 +101,11 @@
19209 int ints[MAX_PARA+1];
19211 str = get_options(line, MAX_PARA, ints);
19213 +void pcbit_setup(char *str, int *ints)
19220 @@ -118,9 +124,13 @@
19224 +#ifdef COMPAT_HAS_NEW_SETUP
19227 __setup("pcbit=", pcbit_setup);
19233 module_init(pcbit_init);
19234 diff -rNu linux-2.4.29.old/drivers/isdn/pcbit/pcbit.h linux-2.4.29/drivers/isdn/pcbit/pcbit.h
19235 --- linux-2.4.29.old/drivers/isdn/pcbit/pcbit.h 2005-03-22 14:47:56.000000000 +0100
19236 +++ linux-2.4.29/drivers/isdn/pcbit/pcbit.h 2005-03-22 15:06:49.284600384 +0100
19239 * Copyright (C) 1996 Universidade de Lisboa
19241 - * Written by Pedro Roque Marques (pedro_m@yahoo.com)
19242 + * Written by Pedro Roque Marques (roque@di.fc.ul.pt)
19244 * This software may be used and distributed according to the terms of
19245 * the GNU General Public License, incorporated herein by reference.
19246 diff -rNu linux-2.4.29.old/drivers/isdn/sc/card.h linux-2.4.29/drivers/isdn/sc/card.h
19247 --- linux-2.4.29.old/drivers/isdn/sc/card.h 2005-03-22 14:47:56.000000000 +0100
19248 +++ linux-2.4.29/drivers/isdn/sc/card.h 2005-03-22 15:06:49.333592936 +0100
19250 -/* $Id: card.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19253 * Driver parameters for SpellCaster ISA ISDN adapters
19255 diff -rNu linux-2.4.29.old/drivers/isdn/sc/command.c linux-2.4.29/drivers/isdn/sc/command.c
19256 --- linux-2.4.29.old/drivers/isdn/sc/command.c 2005-03-22 14:47:56.000000000 +0100
19257 +++ linux-2.4.29/drivers/isdn/sc/command.c 2005-03-22 15:06:49.348590656 +0100
19259 -/* $Id: command.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19262 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19265 if(adapter[i]->driverId == driver)
19273 diff -rNu linux-2.4.29.old/drivers/isdn/sc/debug.c linux-2.4.29/drivers/isdn/sc/debug.c
19274 --- linux-2.4.29.old/drivers/isdn/sc/debug.c 2005-03-22 14:47:56.000000000 +0100
19275 +++ linux-2.4.29/drivers/isdn/sc/debug.c 2005-03-22 15:06:49.363588376 +0100
19277 -/* $Id: debug.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19280 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19282 diff -rNu linux-2.4.29.old/drivers/isdn/sc/debug.h linux-2.4.29/drivers/isdn/sc/debug.h
19283 --- linux-2.4.29.old/drivers/isdn/sc/debug.h 2005-03-22 14:47:56.000000000 +0100
19284 +++ linux-2.4.29/drivers/isdn/sc/debug.h 2005-03-22 15:06:49.378586096 +0100
19286 -/* $Id: debug.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19289 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19291 diff -rNu linux-2.4.29.old/drivers/isdn/sc/event.c linux-2.4.29/drivers/isdn/sc/event.c
19292 --- linux-2.4.29.old/drivers/isdn/sc/event.c 2005-03-22 14:47:56.000000000 +0100
19293 +++ linux-2.4.29/drivers/isdn/sc/event.c 2005-03-22 15:06:49.394583664 +0100
19295 -/* $Id: event.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19298 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19300 diff -rNu linux-2.4.29.old/drivers/isdn/sc/init.c linux-2.4.29/drivers/isdn/sc/init.c
19301 --- linux-2.4.29.old/drivers/isdn/sc/init.c 2005-03-22 14:47:56.000000000 +0100
19302 +++ linux-2.4.29/drivers/isdn/sc/init.c 2005-03-22 15:06:49.432577888 +0100
19303 @@ -514,6 +514,15 @@
19304 schedule_timeout(HZ);
19305 sig = readl(rambase + SIG_OFFSET);
19306 pr_debug("Looking for a signature, got 0x%x\n", sig);
19310 + * If it's a timing problem, it should be gone with the above schedule()
19311 + * Another possible reason may be the missing volatile in the original
19312 + * code. readl() does this for us.
19314 + printk(""); /* Hack! Doesn't work without this !!!??? */
19316 if(sig == SIGNATURE)
19319 @@ -525,6 +534,9 @@
19320 schedule_timeout(HZ);
19321 sig = readl(rambase + SIG_OFFSET);
19322 pr_debug("Looking for a signature, got 0x%x\n", sig);
19324 + printk(""); /* Hack! Doesn't work without this !!!??? */
19326 if(sig == SIGNATURE)
19329 diff -rNu linux-2.4.29.old/drivers/isdn/sc/interrupt.c linux-2.4.29/drivers/isdn/sc/interrupt.c
19330 --- linux-2.4.29.old/drivers/isdn/sc/interrupt.c 2005-03-22 14:47:56.000000000 +0100
19331 +++ linux-2.4.29/drivers/isdn/sc/interrupt.c 2005-03-22 15:06:49.447575608 +0100
19333 -/* $Id: interrupt.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19336 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19338 diff -rNu linux-2.4.29.old/drivers/isdn/sc/ioctl.c linux-2.4.29/drivers/isdn/sc/ioctl.c
19339 --- linux-2.4.29.old/drivers/isdn/sc/ioctl.c 2005-03-22 14:47:56.000000000 +0100
19340 +++ linux-2.4.29/drivers/isdn/sc/ioctl.c 2005-03-22 15:06:49.463573176 +0100
19343 extern board *adapter[];
19346 +static char *ChannelStates[] = { "Idle", "Ready", "Connecting", "Connected", "Disconnecting" };
19349 int GetStatus(int card, boardInfo *);
19351 diff -rNu linux-2.4.29.old/drivers/isdn/sc/message.c linux-2.4.29/drivers/isdn/sc/message.c
19352 --- linux-2.4.29.old/drivers/isdn/sc/message.c 2005-03-22 14:47:56.000000000 +0100
19353 +++ linux-2.4.29/drivers/isdn/sc/message.c 2005-03-22 15:06:49.478570896 +0100
19355 -/* $Id: message.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19358 * functions for sending and receiving control messages
19360 diff -rNu linux-2.4.29.old/drivers/isdn/sc/message.h linux-2.4.29/drivers/isdn/sc/message.h
19361 --- linux-2.4.29.old/drivers/isdn/sc/message.h 2005-03-22 14:47:56.000000000 +0100
19362 +++ linux-2.4.29/drivers/isdn/sc/message.h 2005-03-22 15:06:49.495568312 +0100
19364 -/* $Id: message.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19367 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19369 diff -rNu linux-2.4.29.old/drivers/isdn/sc/packet.c linux-2.4.29/drivers/isdn/sc/packet.c
19370 --- linux-2.4.29.old/drivers/isdn/sc/packet.c 2005-03-22 14:47:56.000000000 +0100
19371 +++ linux-2.4.29/drivers/isdn/sc/packet.c 2005-03-22 15:06:49.514565424 +0100
19373 -/* $Id: packet.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19376 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19378 diff -rNu linux-2.4.29.old/drivers/isdn/sc/shmem.c linux-2.4.29/drivers/isdn/sc/shmem.c
19379 --- linux-2.4.29.old/drivers/isdn/sc/shmem.c 2005-03-22 14:47:56.000000000 +0100
19380 +++ linux-2.4.29/drivers/isdn/sc/shmem.c 2005-03-22 15:06:49.560558432 +0100
19382 -/* $Id: shmem.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19385 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19387 diff -rNu linux-2.4.29.old/drivers/isdn/sc/timer.c linux-2.4.29/drivers/isdn/sc/timer.c
19388 --- linux-2.4.29.old/drivers/isdn/sc/timer.c 2005-03-22 14:47:56.000000000 +0100
19389 +++ linux-2.4.29/drivers/isdn/sc/timer.c 2005-03-22 15:06:49.575556152 +0100
19391 -/* $Id: timer.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
19394 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
19396 diff -rNu linux-2.4.29.old/drivers/isdn/tpam/tpam.h linux-2.4.29/drivers/isdn/tpam/tpam.h
19397 --- linux-2.4.29.old/drivers/isdn/tpam/tpam.h 2005-03-22 14:47:57.000000000 +0100
19398 +++ linux-2.4.29/drivers/isdn/tpam/tpam.h 2005-03-22 15:06:49.648545056 +0100
19400 -/* $Id: tpam.h,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
19401 +/* $Id: tpam.h,v 1.3 2001/09/24 13:23:12 kai Exp $
19403 * Turbo PAM ISDN driver for Linux. (Kernel Driver)
19405 diff -rNu linux-2.4.29.old/drivers/isdn/tpam/tpam_commands.c linux-2.4.29/drivers/isdn/tpam/tpam_commands.c
19406 --- linux-2.4.29.old/drivers/isdn/tpam/tpam_commands.c 2005-03-22 14:47:57.000000000 +0100
19407 +++ linux-2.4.29/drivers/isdn/tpam/tpam_commands.c 2005-03-22 15:06:49.664542624 +0100
19409 -/* $Id: tpam_commands.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
19410 +/* $Id: tpam_commands.c,v 1.3 2001/09/24 13:23:12 kai Exp $
19412 * Turbo PAM ISDN driver for Linux. (Kernel Driver - ISDN commands)
19414 diff -rNu linux-2.4.29.old/drivers/isdn/tpam/tpam_crcpc.c linux-2.4.29/drivers/isdn/tpam/tpam_crcpc.c
19415 --- linux-2.4.29.old/drivers/isdn/tpam/tpam_crcpc.c 2005-03-22 14:47:57.000000000 +0100
19416 +++ linux-2.4.29/drivers/isdn/tpam/tpam_crcpc.c 2005-03-22 15:06:49.681540040 +0100
19418 -/* $Id: tpam_crcpc.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
19421 * Turbo PAM ISDN driver for Linux. (Kernel Driver - CRC encoding)
19423 diff -rNu linux-2.4.29.old/drivers/isdn/tpam/tpam_hdlc.c linux-2.4.29/drivers/isdn/tpam/tpam_hdlc.c
19424 --- linux-2.4.29.old/drivers/isdn/tpam/tpam_hdlc.c 2005-03-22 14:47:57.000000000 +0100
19425 +++ linux-2.4.29/drivers/isdn/tpam/tpam_hdlc.c 2005-03-22 15:06:49.702536848 +0100
19427 -/* $Id: tpam_hdlc.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
19428 +/* $Id: tpam_hdlc.c,v 1.3 2001/09/24 13:23:12 kai Exp $
19430 * Turbo PAM ISDN driver for Linux. (Kernel Driver - HDLC encoding)
19432 diff -rNu linux-2.4.29.old/drivers/isdn/tpam/tpam_main.c linux-2.4.29/drivers/isdn/tpam/tpam_main.c
19433 --- linux-2.4.29.old/drivers/isdn/tpam/tpam_main.c 2005-03-22 14:47:57.000000000 +0100
19434 +++ linux-2.4.29/drivers/isdn/tpam/tpam_main.c 2005-03-22 15:06:49.717534568 +0100
19436 -/* $Id: tpam_main.c,v 1.1.2.2 2001/12/09 18:45:14 kai Exp $
19439 * Turbo PAM ISDN driver for Linux. (Kernel Driver - main routines)
19441 @@ -254,7 +254,7 @@
19443 id_table: tpam_pci_tbl,
19445 - remove: __devexit_p(tpam_remove),
19446 + remove: tpam_remove,
19449 static int __init tpam_init(void) {
19450 diff -rNu linux-2.4.29.old/drivers/isdn/tpam/tpam_memory.c linux-2.4.29/drivers/isdn/tpam/tpam_memory.c
19451 --- linux-2.4.29.old/drivers/isdn/tpam/tpam_memory.c 2005-03-22 14:47:57.000000000 +0100
19452 +++ linux-2.4.29/drivers/isdn/tpam/tpam_memory.c 2005-03-22 15:06:49.734531984 +0100
19454 -/* $Id: tpam_memory.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
19457 * Turbo PAM ISDN driver for Linux. (Kernel Driver - Board Memory Access)
19459 diff -rNu linux-2.4.29.old/drivers/isdn/tpam/tpam_nco.c linux-2.4.29/drivers/isdn/tpam/tpam_nco.c
19460 --- linux-2.4.29.old/drivers/isdn/tpam/tpam_nco.c 2005-03-22 14:47:57.000000000 +0100
19461 +++ linux-2.4.29/drivers/isdn/tpam/tpam_nco.c 2005-03-22 15:06:49.749529704 +0100
19463 -/* $Id: tpam_nco.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
19466 * Turbo PAM ISDN driver for Linux.
19467 * (Kernel Driver - Low Level NCO Manipulation)
19468 diff -rNu linux-2.4.29.old/drivers/isdn/tpam/tpam_queues.c linux-2.4.29/drivers/isdn/tpam/tpam_queues.c
19469 --- linux-2.4.29.old/drivers/isdn/tpam/tpam_queues.c 2005-03-22 14:47:57.000000000 +0100
19470 +++ linux-2.4.29/drivers/isdn/tpam/tpam_queues.c 2005-03-22 15:06:49.764527424 +0100
19472 -/* $Id: tpam_queues.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
19475 * Turbo PAM ISDN driver for Linux. (Kernel Driver)
19477 @@ -146,7 +146,6 @@
19479 hpic = readl(card->bar0 + TPAM_HPIC_REGISTER);
19480 if (waiting_too_long++ > 0xfffffff) {
19482 spin_unlock(&card->lock);
19483 printk(KERN_ERR "TurboPAM(tpam_irq): "
19484 "waiting too long...\n");
19485 diff -rNu linux-2.4.29.old/include/linux/b1lli.h linux-2.4.29/include/linux/b1lli.h
19486 --- linux-2.4.29.old/include/linux/b1lli.h 2005-03-22 14:47:32.000000000 +0100
19487 +++ linux-2.4.29/include/linux/b1lli.h 2005-03-22 15:06:49.881509640 +0100
19489 -/* $Id: b1lli.h,v 1.8.8.3 2001/09/23 22:25:05 kai Exp $
19492 * ISDN lowlevel-module for AVM B1-card.
19494 diff -rNu linux-2.4.29.old/include/linux/b1pcmcia.h linux-2.4.29/include/linux/b1pcmcia.h
19495 --- linux-2.4.29.old/include/linux/b1pcmcia.h 2005-03-22 14:47:32.000000000 +0100
19496 +++ linux-2.4.29/include/linux/b1pcmcia.h 2005-03-22 15:06:49.862512528 +0100
19498 -/* $Id: b1pcmcia.h,v 1.1.8.2 2001/09/23 22:25:05 kai Exp $
19501 * Exported functions of module b1pcmcia to be called by
19502 * avm_cs card services module.
19503 diff -rNu linux-2.4.29.old/include/linux/capi.h linux-2.4.29/include/linux/capi.h
19504 --- linux-2.4.29.old/include/linux/capi.h 2005-03-22 14:47:32.000000000 +0100
19505 +++ linux-2.4.29/include/linux/capi.h 2005-03-22 15:06:49.922503408 +0100
19507 -/* $Id: capi.h,v 1.1.4.1 2001/11/20 14:19:38 kai Exp $
19510 * CAPI 2.0 Interface for Linux
19512 diff -rNu linux-2.4.29.old/include/linux/concap.h linux-2.4.29/include/linux/concap.h
19513 --- linux-2.4.29.old/include/linux/concap.h 2005-03-22 14:47:32.000000000 +0100
19514 +++ linux-2.4.29/include/linux/concap.h 2005-03-22 15:06:49.906505840 +0100
19516 -/* $Id: concap.h,v 1.2.8.1 2001/09/23 22:25:05 kai Exp $
19517 +/* $Id: concap.h,v 1.3 2001/09/24 13:23:13 kai Exp $
19519 * Copyright 1997 by Henner Eisen <eis@baty.hanse.de>
19523 #include <linux/skbuff.h>
19524 #include <linux/netdevice.h>
19525 +#include <linux/isdn_compat.h>
19527 /* Stuff to support encapsulation protocols genericly. The encapsulation
19528 protocol is processed at the uppermost layer of the network interface.
19529 diff -rNu linux-2.4.29.old/include/linux/hysdn_if.h linux-2.4.29/include/linux/hysdn_if.h
19530 --- linux-2.4.29.old/include/linux/hysdn_if.h 2005-03-22 14:47:32.000000000 +0100
19531 +++ linux-2.4.29/include/linux/hysdn_if.h 2005-03-22 15:06:49.974495504 +0100
19533 -/* $Id: hysdn_if.h,v 1.1.8.3 2001/09/23 22:25:05 kai Exp $
19536 * Linux driver for HYSDN cards
19537 * ioctl definitions shared by hynetmgr and driver.
19538 diff -rNu linux-2.4.29.old/include/linux/isdn/tpam.h linux-2.4.29/include/linux/isdn/tpam.h
19539 --- linux-2.4.29.old/include/linux/isdn/tpam.h 2005-03-22 14:47:32.000000000 +0100
19540 +++ linux-2.4.29/include/linux/isdn/tpam.h 2005-03-22 15:06:49.947499608 +0100
19542 -/* $Id: tpam.h,v 1.1.2.1 2001/11/20 14:19:38 kai Exp $
19545 * Turbo PAM ISDN driver for Linux. (Kernel Driver)
19547 diff -rNu linux-2.4.29.old/include/linux/isdn.h linux-2.4.29/include/linux/isdn.h
19548 --- linux-2.4.29.old/include/linux/isdn.h 2005-03-22 14:47:31.000000000 +0100
19549 +++ linux-2.4.29/include/linux/isdn.h 2005-03-22 15:06:50.001491400 +0100
19551 -/* $Id: isdn.h,v 1.1.4.1 2001/11/20 14:19:38 kai Exp $
19552 +/* $Id: isdn.h,v 1.125 2001/12/01 23:18:21 detabc Exp $
19554 * Main header for the Linux ISDN subsystem (linklevel).
19560 +#include <linux/isdn_compat.h>
19561 #include <linux/ioctl.h>
19563 #ifdef CONFIG_COBALT_MICRO_SERVER
19565 #define ISDN_LMSNLEN 255 /* Length of tty's Listen-MSN string */
19566 #define ISDN_CMSGLEN 50 /* Length of CONNECT-Message to add for Modem */
19568 +#ifdef BIG_PHONE_NUMBERS
19569 #define ISDN_MSNLEN 32
19570 #define NET_DV 0x06 /* Data version for isdn_net_ioctl_cfg */
19571 #define TTY_DV 0x06 /* Data version for iprofd etc. */
19573 +#define ISDN_MSNLEN 20
19574 +#define NET_DV 0x05 /* Data version for isdn_net_ioctl_cfg */
19575 +#define TTY_DV 0x05 /* Data version for iprofd etc. */
19578 #define INF_DV 0x01 /* Data version for /dev/isdninfo */
19580 @@ -187,6 +194,61 @@
19581 #define ISDN_MINOR_PPPMAX (128 + (ISDN_MAX_CHANNELS-1))
19582 #define ISDN_MINOR_STATUS 255
19584 +#ifndef CONFIG_ISDN_WITH_ABC
19585 +#undef CONFIG_ISDN_WITH_ABC_CALLB
19586 +#undef CONFIG_ISDN_WITH_ABC_UDP_CHECK
19587 +#undef CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP
19588 +#undef CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL
19589 +#undef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
19590 +#undef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
19591 +#undef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
19592 +#undef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
19593 +#undef CONFIG_ISDN_WITH_ABC_CONN_ERROR
19594 +#undef CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS
19595 +#else /* CONFIG_ISDN_WITH_ABC */
19596 +#include <linux/isdn_dwabc.h>
19599 +typedef struct DWABCJIFFIES {
19601 + u_long msec_1000;
19610 +#ifdef CONFIG_ISDN_WITH_ABC_NEED_DWSJIFFIES
19611 +DWABCJIFFIES isdn_dwabc_jiffies;
19613 +extern DWABCJIFFIES isdn_dwabc_jiffies;
19615 +#define dwsjiffies (isdn_dwabc_jiffies.msec_1000)
19617 +#define ISDN_DW_ABC_FLAG_UNUSED00001 0x00000001L
19618 +#define ISDN_DW_ABC_FLAG_NO_UDP_CHECK 0x00000002L
19619 +#define ISDN_DW_ABC_FLAG_NO_UDP_HANGUP 0x00000004L
19620 +#define ISDN_DW_ABC_FLAG_NO_UDP_DIAL 0x00000008L
19621 +#define ISDN_DW_ABC_FLAG_UNUSED00010 0x00000010L
19622 +#define ISDN_DW_ABC_FLAG_RCV_NO_HUPTIMER 0x00000020L
19623 +#define ISDN_DW_ABC_FLAG_NO_CH_EXTINUSE 0x00000040L
19624 +#define ISDN_DW_ABC_FLAG_NO_CONN_ERROR 0x00000080L
19625 +#define ISDN_DW_ABC_FLAG_BSD_COMPRESS 0x00000100L
19626 +#define ISDN_DW_ABC_FLAG_NO_LCR 0x00000200L
19627 +#define ISDN_DW_ABC_FLAG_LEASED_LINE 0x00001000L
19629 +#define ISDN_DW_ABC_IFFLAG_NODCHAN 0x00000001L
19630 +#define ISDN_DW_ABC_IFFLAG_BSDAKTIV 0x00000002L
19632 +#define ISDN_DW_ABC_BITLOCK_SEND 0
19633 +#define ISDN_DW_ABC_BITLOCK_RECEIVE 1
19635 +#endif /* CONFIG_ISDN_WITH_ABC */
19639 #ifdef CONFIG_ISDN_PPP
19641 #ifdef CONFIG_ISDN_PPP_VJ
19642 @@ -204,9 +266,11 @@
19643 # include <linux/concap.h>
19646 +#ifdef HAVE_DEVFS_FS
19647 #ifdef CONFIG_DEVFS_FS
19648 # include <linux/devfs_fs_kernel.h>
19650 +#endif /* HAVE_DEVFS_FS */
19652 #include <linux/isdnif.h>
19654 @@ -272,6 +336,12 @@
19655 #define ISDN_NET_CALLBACK 0x04 /* activate callback */
19656 #define ISDN_NET_CBHUP 0x08 /* hangup before callback */
19657 #define ISDN_NET_CBOUT 0x10 /* remote machine does callback */
19660 +#define ISDN_NET_CLONE 0x08 /* clone a tmp interface when called */
19661 +#define ISDN_NET_TMP 0x10 /* tmp interface until getting an IP */
19662 +#define ISDN_NET_DYNAMIC 0x20 /* this link is dynamically allocated */
19665 #define ISDN_NET_MAGIC 0x49344C02 /* for paranoia-checking */
19667 @@ -386,6 +456,38 @@
19668 char cisco_debserint; /* debugging flag of cisco hdlc with slarp */
19669 struct timer_list cisco_timer;
19670 struct tq_struct tqueue;
19671 +#ifdef CONFIG_ISDN_WITH_ABC
19672 + ulong dw_abc_flags;
19673 + ulong dw_abc_if_flags;
19674 + int dw_abc_inuse_secure;
19675 + ulong dw_abc_dialstart;
19676 + int dw_abc_old_onhtime;
19677 + int dw_abc_remote_version;
19678 + int dw_abc_bitlocks;
19679 +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
19680 + char dw_out_msn[ISDN_MSNLEN]; /* eaz for outgoing call if *out_msn != 0 */
19682 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
19683 + ulong dw_abc_lcr_callid;
19684 + ulong dw_abc_lcr_start_request;
19685 + ulong dw_abc_lcr_end_request;
19686 + isdn_ctrl *dw_abc_lcr_cmd;
19687 + struct ISDN_DWABC_LCR_IOCTL *dw_abc_lcr_io;
19689 + ulong dw_abc_bchan_last_connect;
19690 +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
19691 + short dw_abc_bchan_errcnt;
19693 +#ifdef CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS
19694 + void *dw_abc_bsd_compressor;
19695 + void *dw_abc_bsd_stat_rx;
19696 + void *dw_abc_bsd_stat_tx;
19698 + ulong dw_abc_bsd_snd;
19699 + ulong dw_abc_bsd_bsd_snd;
19700 + ulong dw_abc_bsd_rcv;
19701 + ulong dw_abc_bsd_bsd_rcv;
19705 /* the interface itself */
19706 @@ -608,12 +710,13 @@
19707 int tflags; /* Timer-Flags: */
19708 /* see ISDN_TIMER_..defines */
19710 - infostruct *infochain; /* List of open info-devs. */
19711 - wait_queue_head_t info_waitq; /* Wait-Queue for isdninfo */
19712 struct timer_list timer; /* Misc.-function Timer */
19713 int chanmap[ISDN_MAX_CHANNELS];/* Map minor->device-channel */
19714 int drvmap[ISDN_MAX_CHANNELS]; /* Map minor->driver-index */
19715 int usage[ISDN_MAX_CHANNELS]; /* Used by tty/ip/voice */
19716 +#ifdef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
19717 + ulong dwabc_chan_external_inuse[ISDN_MAX_CHANNELS];
19719 char num[ISDN_MAX_CHANNELS][ISDN_MSNLEN];
19720 /* Remote number of active ch.*/
19721 int m_idx[ISDN_MAX_CHANNELS]; /* Index for mdm.... */
19722 @@ -631,6 +734,7 @@
19723 isdn_v110_stream *v110[ISDN_MAX_CHANNELS]; /* V.110 private data */
19724 struct semaphore sem; /* serialize list access*/
19725 unsigned long global_features;
19726 +#ifdef HAVE_DEVFS_FS
19727 #ifdef CONFIG_DEVFS_FS
19728 devfs_handle_t devfs_handle_isdninfo;
19729 devfs_handle_t devfs_handle_isdnctrl;
19730 @@ -640,10 +744,41 @@
19731 devfs_handle_t devfs_handle_ipppX[ISDN_MAX_CHANNELS];
19733 #endif /* CONFIG_DEVFS_FS */
19734 +#endif /* HAVE_DEVFS_FS */
19737 extern isdn_dev *dev;
19739 +#ifdef CONFIG_ISDN_WITH_ABC
19740 +extern int isdn_auto_dial_helper(isdn_net_local *,struct sk_buff *,int);
19741 +extern void dwisdn_nfw_send(isdn_net_local *lp,int drop_only);
19742 +extern void isdn_net_unreachable(struct net_device *,struct sk_buff *,char *);
19743 +extern void isdn_net_log_skb_dwabc(struct sk_buff *,isdn_net_local *,char *);
19744 +extern void isdn_net_hangup(struct net_device *d);
19745 +extern void isdn_dw_clear_if(ulong pm,isdn_net_local *);
19746 +extern void isdn_dwabc_test_phone(isdn_net_local *);
19747 +extern void isdn_dw_abc_init_func(void);
19748 +extern void isdn_dw_abc_release_func(void);
19749 +extern int isdn_dw_abc_reset_interface(isdn_net_local *,int);
19750 +extern int dwabc_bsd_init(isdn_net_local *lp);
19751 +extern void dwabc_bsd_free(isdn_net_local *lp);
19752 +extern struct sk_buff *dwabc_bsd_compress(isdn_net_local *,struct sk_buff *,struct net_device *);
19753 +extern void dwabc_bsd_first_gen(isdn_net_local *);
19754 +extern struct sk_buff *dwabc_bsd_rx_pkt(isdn_net_local *,struct sk_buff *,struct net_device *);
19755 +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
19756 +extern size_t isdn_dw_abc_lcr_readstat(char *,size_t);
19757 +extern ulong isdn_dw_abc_lcr_call_number(isdn_net_local *,isdn_ctrl *);
19758 +extern void isdn_dw_abc_lcr_open(void);
19759 +extern void isdn_dw_abc_lcr_close(void);
19760 +extern int isdn_dw_abc_lcr_ioctl(ulong);
19761 +extern void isdn_dw_abc_lcr_clear(isdn_net_local *);
19762 +extern int isdn_dw_abc_lcr_lock(void);
19763 +extern void isdn_dw_abc_lcr_ulock(void);
19765 +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK
19766 +extern int dw_abc_udp_test(struct sk_buff *skb,struct net_device *ndev);
19770 #endif /* __KERNEL__ */
19772 diff -rNu linux-2.4.29.old/include/linux/isdn_compat.h linux-2.4.29/include/linux/isdn_compat.h
19773 --- linux-2.4.29.old/include/linux/isdn_compat.h 1970-01-01 01:00:00.000000000 +0100
19774 +++ linux-2.4.29/include/linux/isdn_compat.h 2005-03-22 15:06:50.017488968 +0100
19776 +/* $Id: isdn_compat.h,v 1.53 2001/09/24 13:23:13 kai Exp $
19778 + * Linux ISDN subsystem
19779 + * Compatibility for various Linux kernel versions
19781 + * This software may be used and distributed according to the terms
19782 + * of the GNU General Public License, incorporated herein by reference.
19786 +#ifndef _LINUX_ISDN_COMPAT_H
19787 +#define _LINUX_ISDN_COMPAT_H
19791 +#ifndef ISDN_COMPAT_NOT_GENERIC
19792 +/* when using std2kern -u, this part is left out and instead provided
19793 + by the .ctrl files */
19795 +#include <linux/version.h>
19797 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)
19799 +#define set_current_state(sta) (current->state = sta)
19800 +#define module_init(x) int init_module(void) { return x(); }
19801 +#define module_exit(x) void cleanup_module(void) { x(); }
19802 +#define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); *(int *)0 = 0; } while (0)
19803 +#define init_MUTEX(x) *(x)=MUTEX
19804 +#define init_MUTEX_LOCKED(x) *(x)=MUTEX_LOCKED
19806 +#define __devinitdata
19808 +#else /* 2.2.18 and later */
19810 +#define COMPAT_HAS_NEW_SETUP
19811 +#define COMPAT_HAS_NEW_WAITQ
19815 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
19817 +#define dev_kfree_skb_irq(a) dev_kfree_skb(a)
19818 +#define dev_kfree_skb_any(a) dev_kfree_skb(a)
19819 +#define COMPAT_HAS_2_2_PCI
19820 +#define get_pcibase(ps, nr) ps->base_address[nr]
19821 +#define pci_resource_start_io(pdev, nr) ((pdev)->base_address[nr] & PCI_BASE_ADDRESS_IO_MASK)
19822 +#define pci_resource_start_mem(pdev, nr) ((pdev)->base_address[nr] & PCI_BASE_ADDRESS_MEM_MASK)
19823 +#define pci_get_sub_vendor(pdev, id) pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, &id)
19824 +#define pci_get_sub_system(pdev, id) pci_read_config_word(pdev, PCI_SUBSYSTEM_ID, &id)
19828 +#define __devinitdata
19830 +#define net_device device
19831 +#define COMPAT_NO_SOFTNET
19832 +#define netif_running(d) test_bit(LINK_STATE_START, &d->state)
19833 +#define COMPAT_NEED_MPPP_DEFS
19834 +#define spin_lock_bh(lock)
19835 +#define spin_unlock_bh(lock)
19836 +#define COMPAT_NEED_SPIN_LOCK_BH
19837 +#define i_count_read(ic) ic
19838 +#define i_count_inc(ic) ic++
19839 +#define COMPAT_USE_MODCOUNT_LOCK
19840 +#define devfs_register_chrdev(m,n,f) register_chrdev(m,n,f)
19841 +#define devfs_unregister_chrdev(m,n) unregister_chrdev(m,n)
19842 +#define COMPAT_NEED_PCI_IDS
19843 +#define in_irq() (local_irq_count[smp_processor_id()] != 0)
19845 +#else /* 2.4.0 and later */
19847 +#define pci_resource_start_io(pdev, nr) pci_resource_start(pdev, nr)
19848 +#define pci_resource_start_mem(pdev, nr) pci_resource_start(pdev, nr)
19849 +#define get_pcibase(ps, nr) ps->resource[nr].start
19850 +#define pci_get_sub_system(pdev, id) id = pdev->subsystem_device
19851 +#define pci_get_sub_vendor(pdev, id) id = pdev->subsystem_vendor
19853 +#define BIG_PHONE_NUMBERS
19854 +#define COMPAT_HAS_ISA_IOREMAP
19855 +#define i_count_read(ic) atomic_read(&ic)
19856 +#define i_count_inc(ic) atomic_inc(&ic)
19857 +#define COMPAT_HAS_FILEOP_OWNER
19858 +#define COMPAT_HAVE_NEW_FILLDIR
19859 +#define COMPAT_has_fileops_in_inode
19860 +#define COMPAT_HAS_init_special_inode
19861 +#define COMPAT_d_alloc_root_one_parameter
19862 +#define HAVE_DEVFS_FS
19863 +#define COMPAT_HAS_SCHEDULE_TASK
19864 +#define COMPAT_HAS_USB_IDTAB
19868 +#endif /* ISDN_COMPAT_GENERIC */
19870 +#ifdef COMPAT_HAS_2_2_PCI
19871 +#include <linux/pci.h>
19872 +#ifdef __powerpc__
19873 +static inline int pci_enable_device(struct pci_dev *dev)
19876 + pci_read_config_word(dev, PCI_COMMAND, &cmd);
19877 + cmd |= PCI_COMMAND_MEMORY | PCI_COMMAND_IO | PCI_COMMAND_SERR;
19878 + cmd &= ~PCI_COMMAND_FAST_BACK;
19879 + pci_write_config_word(dev, PCI_COMMAND, cmd);
19883 +static inline int pci_enable_device(struct pci_dev *dev)
19887 +#endif /* __powerpc__ */
19889 +#define PCI_ANY_ID (~0)
19891 +/* as this is included multiple times, we make it inline */
19893 +static inline struct pci_dev * pci_find_subsys(unsigned int vendor, unsigned int device,
19894 + unsigned int ss_vendor, unsigned int ss_device,
19895 + struct pci_dev *from)
19897 + unsigned short subsystem_vendor, subsystem_device;
19899 + while ((from = pci_find_device(vendor, device, from))) {
19900 + pci_read_config_word(from, PCI_SUBSYSTEM_VENDOR_ID, &subsystem_vendor);
19901 + pci_read_config_word(from, PCI_SUBSYSTEM_ID, &subsystem_device);
19902 + if ((ss_vendor == PCI_ANY_ID || subsystem_vendor == ss_vendor) &&
19903 + (ss_device == PCI_ANY_ID || subsystem_device == ss_device))
19910 +#ifdef COMPAT_NO_SOFTNET
19911 +#include <linux/netdevice.h>
19914 + * Tell upper layers that the network device is ready to xmit more frames.
19916 +static void __inline__ netif_wake_queue(struct net_device * dev)
19923 + * called during net_device open()
19925 +static void __inline__ netif_start_queue(struct net_device * dev)
19928 + /* actually, we never use the interrupt flag at all */
19929 + dev->interrupt = 0;
19934 + * Ask upper layers to temporarily cease passing us more xmit frames.
19936 +static void __inline__ netif_stop_queue(struct net_device * dev)
19941 +#endif /* COMPAT_NO_SOFTNET */
19943 +#ifndef COMPAT_HAS_NEW_WAITQ
19944 +typedef struct wait_queue wait_queue_t;
19945 +typedef struct wait_queue *wait_queue_head_t;
19947 +#define DECLARE_WAITQUEUE(wait, current) struct wait_queue wait = { current, NULL }
19948 +#define DECLARE_WAIT_QUEUE_HEAD(wait) wait_queue_head_t wait
19949 +#define init_waitqueue_head(x) *(x)=NULL
19950 +#define init_waitqueue_entry(q,p) ((q)->task)=(p)
19951 +#endif /* COMPAT_HAS_NEW_WAITQ */
19953 +#ifdef COMPAT_NEED_PCI_IDS
19955 +#define PCI_ANY_ID (~0)
19957 +#define PCI_VENDOR_ID_DYNALINK 0x0675
19958 +#define PCI_DEVICE_ID_DYNALINK_IS64PH 0x1702
19960 +#define PCI_DEVICE_ID_WINBOND2_6692 0x6692
19962 +#define PCI_DEVICE_ID_PLX_R685 0x1030
19963 +#define PCI_DEVICE_ID_PLX_DJINN_ITOO 0x1151
19964 +#define PCI_DEVICE_ID_PLX_R753 0x1152
19966 +#define PCI_VENDOR_ID_ELSA 0x1048
19967 +#define PCI_DEVICE_ID_ELSA_MICROLINK 0x1000
19968 +#define PCI_DEVICE_ID_ELSA_QS3000 0x3000
19970 +#define PCI_VENDOR_ID_EICON 0x1133
19971 +#define PCI_DEVICE_ID_EICON_DIVA20PRO 0xe001
19972 +#define PCI_DEVICE_ID_EICON_DIVA20 0xe002
19973 +#define PCI_DEVICE_ID_EICON_DIVA20PRO_U 0xe003
19974 +#define PCI_DEVICE_ID_EICON_DIVA20_U 0xe004
19975 +#define PCI_DEVICE_ID_EICON_DIVA201 0xe005
19976 +#define PCI_DEVICE_ID_EICON_MAESTRA 0xe010
19977 +#define PCI_DEVICE_ID_EICON_MAESTRAQ 0xe012
19978 +#define PCI_DEVICE_ID_EICON_MAESTRAQ_U 0xe013
19979 +#define PCI_DEVICE_ID_EICON_MAESTRAP 0xe014
19981 +#define PCI_VENDOR_ID_CCD 0x1397
19982 +#define PCI_DEVICE_ID_CCD_2BD0 0x2BD0
19983 +#define PCI_DEVICE_ID_CCD_B000 0xB000
19984 +#define PCI_DEVICE_ID_CCD_B006 0xB006
19985 +#define PCI_DEVICE_ID_CCD_B007 0xB007
19986 +#define PCI_DEVICE_ID_CCD_B008 0xB008
19987 +#define PCI_DEVICE_ID_CCD_B009 0xB009
19988 +#define PCI_DEVICE_ID_CCD_B00A 0xB00A
19989 +#define PCI_DEVICE_ID_CCD_B00B 0xB00B
19990 +#define PCI_DEVICE_ID_CCD_B00C 0xB00C
19991 +#define PCI_DEVICE_ID_CCD_B100 0xB100
19993 +#define PCI_VENDOR_ID_ASUSTEK 0x1043
19994 +#define PCI_DEVICE_ID_ASUSTEK_0675 0x0675
19996 +#define PCI_VENDOR_ID_BERKOM 0x0871
19997 +#define PCI_DEVICE_ID_BERKOM_A1T 0xFFA1
19998 +#define PCI_DEVICE_ID_BERKOM_T_CONCEPT 0xFFA2
19999 +#define PCI_DEVICE_ID_BERKOM_A4T 0xFFA4
20000 +#define PCI_DEVICE_ID_BERKOM_SCITEL_QUADRO 0xFFA8
20002 +#define PCI_DEVICE_ID_SATSAGEM_NICCY 0x1016
20004 +#define PCI_DEVICE_ID_TIGERJET_100 0x0002
20006 +#define PCI_VENDOR_ID_ANIGMA 0x1051
20007 +#define PCI_DEVICE_ID_ANIGMA_MC145575 0x0100
20009 +#define PCI_VENDOR_ID_ZOLTRIX 0x15b0
20010 +#define PCI_DEVICE_ID_ZOLTRIX_2BD0 0x2BD0
20012 +#define PCI_DEVICE_ID_DIGI_DF_M_IOM2_E 0x0070
20013 +#define PCI_DEVICE_ID_DIGI_DF_M_E 0x0071
20014 +#define PCI_DEVICE_ID_DIGI_DF_M_IOM2_A 0x0072
20015 +#define PCI_DEVICE_ID_DIGI_DF_M_A 0x0073
20017 +#define PCI_DEVICE_ID_AVM_B1 0x0700
20018 +#define PCI_DEVICE_ID_AVM_C4 0x0800
20019 +#define PCI_DEVICE_ID_AVM_C2 0x1100
20020 +#define PCI_DEVICE_ID_AVM_T1 0x1200
20022 +#define PCI_VENDOR_ID_HYPERCOPE 0x1365
20023 +#define PCI_DEVICE_ID_HYPERCOPE_PLX 0x9050
20024 +#define PCI_SUBDEVICE_ID_HYPERCOPE_OLD_ERGO 0x0104
20025 +#define PCI_SUBDEVICE_ID_HYPERCOPE_ERGO 0x0106
20026 +#define PCI_SUBDEVICE_ID_HYPERCOPE_METRO 0x0107
20027 +#define PCI_SUBDEVICE_ID_HYPERCOPE_CHAMP2 0x0108
20028 +#define PCI_SUBDEVICE_ID_HYPERCOPE_PLEXUS 0x0109
20030 +#define PCI_VENDOR_ID_ABOCOM 0x13D1
20031 +#define PCI_DEVICE_ID_ABOCOM_2BD1 0x2BD1
20033 +#endif /* COMPAT_NEED_PCI_IDS */
20035 +#endif /* __KERNEL__ */
20036 +#endif /* _LINUX_ISDN_COMPAT_H */
20037 diff -rNu linux-2.4.29.old/include/linux/isdn_divertif.h linux-2.4.29/include/linux/isdn_divertif.h
20038 --- linux-2.4.29.old/include/linux/isdn_divertif.h 2005-03-22 14:47:32.000000000 +0100
20039 +++ linux-2.4.29/include/linux/isdn_divertif.h 2005-03-22 15:06:50.032486688 +0100
20041 -/* $Id: isdn_divertif.h,v 1.1.4.1 2001/11/20 14:19:38 kai Exp $
20044 * Header for the diversion supplementary interface for i4l.
20047 /***********************************************************/
20048 /* magic value is also used to control version information */
20049 /***********************************************************/
20050 -#define DIVERT_IF_MAGIC 0x25873401
20051 +#define DIVERT_IF_MAGIC 0x25873402
20052 #define DIVERT_CMD_REG 0x00 /* register command */
20053 #define DIVERT_CMD_REL 0x01 /* release command */
20054 #define DIVERT_NO_ERR 0x00 /* return value no error */
20056 int (*ll_cmd)(isdn_ctrl *); /* supplied by hl on return */
20057 char * (*drv_to_name)(int); /* map a driver id to name, supplied by hl */
20058 int (*name_to_drv)(char *); /* map a driver id to name, supplied by hl */
20059 + int (*dial_net_name)(char *); /* force dial of a ll net interface */
20062 /*********************/
20063 diff -rNu linux-2.4.29.old/include/linux/isdn_dwabc.h linux-2.4.29/include/linux/isdn_dwabc.h
20064 --- linux-2.4.29.old/include/linux/isdn_dwabc.h 1970-01-01 01:00:00.000000000 +0100
20065 +++ linux-2.4.29/include/linux/isdn_dwabc.h 2005-03-22 15:06:50.048484256 +0100
20067 +/* $Id: isdn_dwabc.h,v 1.9 2001/09/26 20:32:08 detabc Exp $
20069 + * Header for the Linux ISDN abc-extension.
20071 + * Copyright by abc GmbH
20072 + * written by Detlef Wengorz <detlefw@isdn4linux.de>
20074 + * This software may be used and distributed according to the terms
20075 + * of the GNU General Public License, incorporated herein by reference.
20079 +#ifndef ISDN_DWABC_H
20080 +#define ISDN_DWABC_H
20083 +#include <linux/types.h>
20084 +#include <linux/kernel.h>
20085 +#include <linux/sched.h>
20086 +#include <linux/smp.h>
20087 +#include <linux/spinlock.h>
20088 +#include <linux/errno.h>
20091 +typedef struct ISDN_DWSPINLOCK {
20098 +} ISDN_DWSPINLOCK;
20100 +#define ISDN_DWSPIN_UNLOCKED \
20101 + (ISDN_DWSPINLOCK) { \
20102 + spin: SPIN_LOCK_UNLOCKED, \
20108 +#define ISDN_DWSPIN_INIT(x) \
20109 + do { *(x) = ISDN_DWSPIN_UNLOCKED; } while(0);
20111 +static __inline__ int isdn_dwspin_trylock(ISDN_DWSPINLOCK *spin)
20113 + if(!spin_trylock(&spin->spin)) {
20115 + if(spin->owner == smp_processor_id())
20118 + spin_lock(&spin->spin);
20121 + spin->owner = smp_processor_id();
20125 +static __inline__ void isdn_dwspin_unlock(ISDN_DWSPINLOCK *spin)
20127 + spin->owner = -1;
20128 + spin_unlock(&spin->spin);
20133 +#include <sys/types.h>
20136 +#define DWABC_LCR_FLG_NEWNUMBER 0x00000001L
20137 +#define DWABC_LCR_FLG_DISABLE 0x00000002L
20138 +#define DWABC_LCR_FLG_NEWHUPTIME 0x00000004L
20141 +struct ISDN_DWABC_LCR_IOCTL {
20143 + int lcr_ioctl_sizeof; /* mustbe sizeof(ISDN_DWABC_LCR_IOCTL) */
20144 + u_short lcr_ioctl_onhtime; /* new hanguptime */
20145 + u_long lcr_ioctl_callid; /* callid from lcr-subsystem */
20146 + u_long lcr_ioctl_flags; /* see above */
20147 + char lcr_ioctl_nr[32]; /* new destination phonenumber */
20151 diff -rNu linux-2.4.29.old/include/linux/isdn_lzscomp.h linux-2.4.29/include/linux/isdn_lzscomp.h
20152 --- linux-2.4.29.old/include/linux/isdn_lzscomp.h 2005-03-22 14:47:32.000000000 +0100
20153 +++ linux-2.4.29/include/linux/isdn_lzscomp.h 2005-03-22 15:06:50.089478024 +0100
20155 -/* $Id: isdn_lzscomp.h,v 1.1.4.1 2001/11/20 14:19:38 kai Exp $
20158 * Header for isdn_lzscomp.c
20159 * Concentrated here to not mess up half a dozen kernel headers with code
20160 diff -rNu linux-2.4.29.old/include/linux/isdn_ppp.h linux-2.4.29/include/linux/isdn_ppp.h
20161 --- linux-2.4.29.old/include/linux/isdn_ppp.h 2005-03-22 14:47:31.000000000 +0100
20162 +++ linux-2.4.29/include/linux/isdn_ppp.h 2005-03-22 15:06:50.116473920 +0100
20164 #ifndef _LINUX_ISDN_PPP_H
20165 #define _LINUX_ISDN_PPP_H
20167 +#include <linux/isdn_compat.h>
20169 #define CALLTYPE_INCOMING 0x1
20170 #define CALLTYPE_OUTGOING 0x2
20172 #define PPPIOCSCOMPRESSOR _IOW('t',135,int)
20173 #define PPPIOCGIFNAME _IOR('t',136, char [IFNAMSIZ] )
20175 +#ifdef COMPAT_NEED_MPPP_DEFS
20176 +#define PPP_MP 0x003d
20177 +#define PPP_COMPFRAG 0x00fb
20178 +#define PPP_CCPFRAG 0x80fb
20181 #define SC_MP_PROT 0x00000200
20182 #define SC_REJ_MP_PROT 0x00000400
20185 #include <linux/config.h>
20187 -#ifdef CONFIG_IPPP_FILTER
20188 -#include <linux/filter.h>
20191 #define DECOMP_ERR_NOMEM (-10)
20193 @@ -226,10 +229,6 @@
20194 unsigned char *cbuf;
20195 struct slcompress *slcomp;
20197 -#ifdef CONFIG_IPPP_FILTER
20198 - struct sock_fprog pass_filter; /* filter for packets to pass */
20199 - struct sock_fprog active_filter; /* filter for pkts to reset idle */
20201 unsigned long debug;
20202 struct isdn_ppp_compressor *compressor,*decompressor;
20203 struct isdn_ppp_compressor *link_compressor,*link_decompressor;
20204 diff -rNu linux-2.4.29.old/include/linux/isdnif.h linux-2.4.29/include/linux/isdnif.h
20205 --- linux-2.4.29.old/include/linux/isdnif.h 2005-03-22 14:47:31.000000000 +0100
20206 +++ linux-2.4.29/include/linux/isdnif.h 2005-03-22 15:06:50.132471488 +0100
20208 -/* $Id: isdnif.h,v 1.1.4.1 2001/11/20 14:19:38 kai Exp $
20209 +/* $Id: isdnif.h,v 1.43 2002/02/09 21:19:11 keil Exp $
20211 * Linux ISDN subsystem
20212 * Definition of the interface between the subsystem and its low-level drivers.
20214 #ifndef __ISDNIF_H__
20215 #define __ISDNIF_H__
20217 +#include <linux/isdn_compat.h>
20220 * Values for general protocol-selection
20221 @@ -213,6 +214,8 @@
20222 #define ISDN_STAT_FAXIND 276 /* FAX indications from HL-driver */
20223 #define ISDN_STAT_AUDIO 277 /* DTMF, DSP indications */
20224 #define ISDN_STAT_DISCH 278 /* Disable/Enable channel usage */
20225 +#define ISDN_STAT_ALERT 279 /* Signal alerting */
20226 +#define ISDN_STAT_PROCEED 280 /* Signal proceeding */
20230 diff -rNu linux-2.4.29.old/include/linux/kernelcapi.h linux-2.4.29/include/linux/kernelcapi.h
20231 --- linux-2.4.29.old/include/linux/kernelcapi.h 2005-03-22 14:47:32.000000000 +0100
20232 +++ linux-2.4.29/include/linux/kernelcapi.h 2005-03-22 15:06:50.147469208 +0100
20234 -/* $Id: kernelcapi.h,v 1.1.4.2 2002/01/28 18:25:10 kai Exp $
20236 + * $Id: kernelcapi.h,v 1.9 2000/11/28 09:34:02 kai Exp $
20238 * Kernel CAPI 2.0 Interface for Linux
20240 * (c) Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
20242 - * This software may be used and distributed according to the terms
20243 - * of the GNU General Public License, incorporated herein by reference.
20247 #ifndef __KERNELCAPI_H__