From 3398a13e04e5e0f743c15a60489893f2153b39d1 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 23 Nov 2007 15:19:48 -0500 Subject: [PATCH] Linux 2.2.13pre8 o Fix PCI/PCI_QUIRKS compile error (Alan Cox) o I/O APIC update (Ingo Molnar) o ISDN update (Karsten Keil) o SyncLink update (Paul Fulghum) o PPC Update (Paul Mackerras) o QlogicISP fix (Dave Miller) o Update ctime on rename (Chris Siebenmann) o NFS generation ids (G. Allen Morris III) o Fix /proc kstk values (Solar Designer) o Updated multisound drivers (Andrew Veliath) --- CREDITS | 2 +- Documentation/Configure.help | 36 +- Documentation/isdn/INTERFACE | 134 +++- Documentation/isdn/README | 2 +- Documentation/isdn/README.HiSax | 11 +- Documentation/isdn/README.concap | 14 +- Documentation/isdn/README.hfc-pci | 15 + Documentation/sound/MultiSound | 2 +- MAINTAINERS | 15 +- Makefile | 2 +- arch/i386/kernel/io_apic.c | 6 +- arch/i386/kernel/setup.c | 2 +- arch/ppc/kernel/chrp_pci.c | 3 +- arch/ppc/kernel/ppc_ksyms.c | 2 +- arch/ppc/kernel/setup.c | 4 +- arch/ppc/lib/string.S | 26 +- drivers/char/n_hdlc.c | 104 ++- drivers/char/synclink.c | 480 ++++++++++-- drivers/char/tty_io.c | 38 +- drivers/isdn/Config.in | 4 +- drivers/isdn/act2000/act2000_isa.c | 11 +- drivers/isdn/act2000/capi.c | 4 - drivers/isdn/act2000/capi.h | 14 - drivers/isdn/act2000/module.c | 4 - drivers/isdn/avmb1/avmcard.h | 9 +- drivers/isdn/avmb1/b1.c | 19 +- drivers/isdn/avmb1/b1isa.c | 12 +- drivers/isdn/avmb1/b1pci.c | 3 +- drivers/isdn/avmb1/b1pcmcia.c | 12 +- drivers/isdn/avmb1/capi.c | 25 +- drivers/isdn/avmb1/capidev.h | 4 - drivers/isdn/avmb1/capidrv.c | 7 - drivers/isdn/avmb1/capiutil.c | 8 +- drivers/isdn/avmb1/capiutil.h | 15 +- drivers/isdn/avmb1/kcapi.c | 59 +- drivers/isdn/avmb1/t1isa.c | 18 +- drivers/isdn/divert/divert_init.c | 9 +- drivers/isdn/divert/divert_procfs.c | 16 +- drivers/isdn/divert/isdn_divert.c | 34 +- drivers/isdn/divert/isdn_divert.h | 35 +- drivers/isdn/eicon/eicon.h | 123 +++- drivers/isdn/eicon/eicon_idi.c | 309 ++++++-- drivers/isdn/eicon/eicon_idi.h | 9 +- drivers/isdn/eicon/eicon_io.c | 249 +++++-- drivers/isdn/eicon/eicon_isa.c | 69 +- drivers/isdn/eicon/eicon_isa.h | 13 +- drivers/isdn/eicon/eicon_mod.c | 269 ++++--- drivers/isdn/eicon/eicon_pci.c | 21 +- drivers/isdn/hisax/Makefile | 8 +- drivers/isdn/hisax/arcofi.c | 6 +- drivers/isdn/hisax/asuscom.c | 7 +- drivers/isdn/hisax/avm_a1p.c | 8 +- drivers/isdn/hisax/avm_pci.c | 51 +- drivers/isdn/hisax/bkm_a4t.c | 53 +- drivers/isdn/hisax/bkm_a8.c | 56 +- drivers/isdn/hisax/callc.c | 126 ++-- drivers/isdn/hisax/config.c | 105 ++- drivers/isdn/hisax/diva.c | 89 +-- drivers/isdn/hisax/elsa.c | 99 +-- drivers/isdn/hisax/elsa_ser.c | 77 +- drivers/isdn/hisax/gazel.c | 48 +- drivers/isdn/hisax/hfc_2bds0.c | 71 +- drivers/isdn/hisax/hfc_2bs0.c | 10 +- drivers/isdn/hisax/hfc_pci.c | 341 +++++---- drivers/isdn/hisax/hfc_pci.h | 13 +- drivers/isdn/hisax/hfcscard.c | 7 +- drivers/isdn/hisax/hisax.h | 69 +- drivers/isdn/hisax/hscx.c | 2 +- drivers/isdn/hisax/hscx_irq.c | 6 +- drivers/isdn/hisax/isac.c | 17 +- drivers/isdn/hisax/isar.c | 126 +++- drivers/isdn/hisax/isar.h | 108 +-- drivers/isdn/hisax/isdnl1.c | 24 +- drivers/isdn/hisax/isdnl2.c | 27 +- drivers/isdn/hisax/isdnl3.c | 4 +- drivers/isdn/hisax/isurf.c | 39 +- drivers/isdn/hisax/jade.c | 2 +- drivers/isdn/hisax/jade_irq.c | 6 +- drivers/isdn/hisax/l3_1tr6.c | 44 +- drivers/isdn/hisax/l3dss1.c | 69 +- drivers/isdn/hisax/md5sums.asc | 30 +- drivers/isdn/hisax/netjet.c | 67 +- drivers/isdn/hisax/niccy.c | 61 +- drivers/isdn/hisax/saphir.c | 7 +- drivers/isdn/hisax/sedlbauer.c | 66 +- drivers/isdn/hisax/sportster.c | 7 +- drivers/isdn/hisax/tei.c | 6 +- drivers/isdn/hisax/teleint.c | 18 +- drivers/isdn/hisax/teles3.c | 10 +- drivers/isdn/hisax/telespci.c | 43 +- drivers/isdn/hisax/w6692.c | 1066 +++++++++++++++++++++++++++ drivers/isdn/hisax/w6692.h | 190 +++++ drivers/isdn/icn/icn.c | 34 +- drivers/isdn/icn/icn.h | 7 +- drivers/isdn/isdn_audio.c | 9 +- drivers/isdn/isdn_bsdcomp.c | 1 - drivers/isdn/isdn_common.c | 80 +- drivers/isdn/isdn_common.h | 4 - drivers/isdn/isdn_concap.c | 8 +- drivers/isdn/isdn_net.c | 38 +- drivers/isdn/isdn_net.h | 8 +- drivers/isdn/isdn_ppp.c | 84 +-- drivers/isdn/isdn_ppp.h | 8 +- drivers/isdn/isdn_tty.c | 23 +- drivers/isdn/isdn_tty.h | 9 +- drivers/isdn/isdn_ttyfax.c | 151 +--- drivers/isdn/isdn_v110.c | 8 - drivers/isdn/isdn_x25iface.c | 8 +- drivers/isdn/isdnloop/isdnloop.c | 9 +- drivers/isdn/isdnloop/isdnloop.h | 7 +- drivers/isdn/pcbit/drv.c | 18 - drivers/isdn/pcbit/layer2.c | 9 - drivers/isdn/pcbit/module.c | 1 - drivers/isdn/pcbit/pcbit.h | 4 - drivers/isdn/sc/init.c | 12 - drivers/isdn/sc/ioctl.c | 47 +- drivers/isdn/sc/message.c | 2 +- drivers/isdn/sc/packet.c | 40 +- drivers/macintosh/macserial.c | 16 +- drivers/net/defxx.c | 2 +- drivers/net/pcnet32.c | 1 + drivers/scsi/qlogicisp.c | 5 +- drivers/sound/msnd.c | 41 +- drivers/sound/msnd.h | 10 +- drivers/sound/msnd_classic.h | 6 +- drivers/sound/msnd_pinnacle.c | 56 +- drivers/sound/msnd_pinnacle.h | 22 +- fs/binfmt_elf.c | 4 +- fs/ext2/namei.c | 7 + fs/nfsd/nfsctl.c | 2 +- fs/nfsd/nfsfh.c | 3 + fs/proc/array.c | 14 +- include/asm-ppc/md.h | 13 + include/asm-ppc/spinlock.h | 18 +- include/asm-ppc/uaccess.h | 19 +- include/linux/concap.h | 14 +- include/linux/isdn.h | 74 +- include/linux/isdn_compat.h | 108 --- include/linux/isdn_ppp.h | 6 +- include/linux/isdnif.h | 12 +- include/linux/kernelcapi.h | 28 +- include/linux/nfsd/nfsfh.h | 32 +- include/linux/sem.h | 2 +- include/linux/synclink.h | 16 +- include/linux/tty.h | 1 + 145 files changed, 4300 insertions(+), 2432 deletions(-) create mode 100644 drivers/isdn/hisax/w6692.c create mode 100644 drivers/isdn/hisax/w6692.h create mode 100644 include/asm-ppc/md.h delete mode 100644 include/linux/isdn_compat.h diff --git a/CREDITS b/CREDITS index da3ebb183f6d..00aab7cb70f5 100644 --- a/CREDITS +++ b/CREDITS @@ -1908,7 +1908,7 @@ S: Willowdale, Ontario S: Canada M2N 2Z1 N: Adrian Sun -E: asun@u.washington.edu +E: asun@cobaltnet.com D: hfs support D: alpha rtc port, random appletalk fixes S: Department of Zoology, University of Washington diff --git a/Documentation/Configure.help b/Documentation/Configure.help index d25068833176..b26c2707dc60 100644 --- a/Documentation/Configure.help +++ b/Documentation/Configure.help @@ -10071,6 +10071,10 @@ CONFIG_HISAX_NO_LLC If you have trouble with some ugly exchanges try to select this option. +HiSax Support for german 1TR6 +CONFIG_HISAX_1TR6 + Enable this if you have a old german 1TR6 line. + HiSax Support for Teles 16.0/8.0 CONFIG_HISAX_16_0 This enables HiSax support for the Teles ISDN-cards S0-16.0, S0-8 @@ -10241,6 +10245,19 @@ CONFIG_HISAX_GAZEL See Documentation/isdn/README.HiSax on how to configure it using a different D-channel protocol, or non-standard IRQ/port settings. +HiSax Support for HFC PCI-Bus cards +CONFIG_HISAX_HFC_PCI + This enables HiSax support for the HFC-S PCI 2BDS0 based cards. + + For more informations see under Documentation/isdn/README.hfc-pci. + +HiSax Support for Winbond W6692 based cards (EXPERIMENTAL) +CONFIG_HISAX_W6692 + This enables HiSax support for Winbond W6692 based PCI ISDN cards. + + See Documentation/isdn/README.HiSax on how to configure it using a + different D-channel protocol, or non-standard IRQ/port settings. + HiSax Support for Am7930 (EXPERIMENTAL) CONFIG_HISAX_AMD7930 This enables HiSax support for the AMD7930 chips on some SPARCs. @@ -10297,7 +10314,7 @@ CONFIG_ISDN_TTY_FAX AVM-B1 with CAPI2.0 support CONFIG_ISDN_DRV_AVMB1 - This enables support for the AVM B1 ISDN networking cards. In + This enables support for the AVM B1/T1 ISDN networking cards.In addition, a CAPI (Common ISDN Application Programming Interface, a standard making it easy for programs to access ISDN hardware, see http://www.capi.org/; to browse the WWW, you need to have access to @@ -10312,6 +10329,23 @@ CONFIG_ISDN_DRV_AVMB1 The module will be called avmb1.o. If you want to compile it as a module, say M here and read Documentation/modules.txt. +AVM B1 ISA support +CONFIG_ISDN_DRV_AVMB1_B1ISA + Enable support for the ISA version of the AVM B1 card. + +AVM B1 PCI support +CONFIG_ISDN_DRV_AVMB1_B1PCI + Enable support for the PCI version of the AVM B1 card. + +AVM T1/T1B ISA support +CONFIG_ISDN_DRV_AVMB1_T1ISA + Enable support for the AVM T1 T1B card. + Note: This is a PRI card and handle 30 B-channels. + +AVM B1/M1/M2 PCMCIA support +CONFIG_ISDN_DRV_AVMB1_B1PCMCIA + Enable support for the PCMCIA version of the AVM B1 card. + Verbose reason code reporting (kernel size +=7K) CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON If you say Y here, the AVM B1 driver will give verbose reasons for diff --git a/Documentation/isdn/INTERFACE b/Documentation/isdn/INTERFACE index d8bf08ccc63c..c2a5494b1f88 100644 --- a/Documentation/isdn/INTERFACE +++ b/Documentation/isdn/INTERFACE @@ -1,4 +1,4 @@ -$Id: INTERFACE,v 1.13 1999/08/11 20:30:26 armin Exp $ +$Id: INTERFACE,v 1.15 1999/08/25 20:02:13 werner Exp $ Description of the Interface between Linklevel and Hardwarelevel of isdn4linux: @@ -436,6 +436,57 @@ Description of the Interface between Linklevel and Hardwarelevel arg = unused. parm = unused. + ISDN_CMD_PROCEED: + + With this command, the HL-driver is told to proceed with a incoming call. + + Parameter: + driver = driver-Id. + command = ISDN_CMD_PROCEED + arg = channel-number locally to the driver. (starting with 0) + setup.eazmsn= empty string or string send as uus1 in DSS1 with + PROCEED message + + ISDN_CMD_ALERT: + + With this command, the HL-driver is told to alert a proceeding call. + + Parameter: + driver = driver-Id. + command = ISDN_CMD_ALERT + arg = channel-number locally to the driver. (starting with 0) + setup.eazmsn= empty string or string send as uus1 in DSS1 with + ALERT message + + ISDN_CMD_REDIR: + + With this command, the HL-driver is told to redirect a call in proceeding + or alerting state. + + Parameter: + driver = driver-Id. + command = ISDN_CMD_REDIR + arg = channel-number locally to the driver. (starting with 0) + setup.eazmsn= empty string or string send as uus1 in DSS1 protocol + setup.screen= screening indicator + setup.phone = redirected to party number + + ISDN_CMD_PROT_IO: + + With this call, the LL-driver invokes protocol specific features through + the LL. + The call is not implicitely bound to a connection. + + Parameter: + driver = driver-Id + command = ISDN_CMD_PROT_IO + arg = The lower 8 Bits define the adressed protocol as defined + in ISDN_PTYPE..., the upper bits are used to differenciate + the protocol specific CMD. + + para = protocol and function specific. See isdnif.h for detail. + + ISDN_CMD_FAXCMD: With this command the HL-driver receives a fax sub-command. @@ -471,34 +522,44 @@ Description of the Interface between Linklevel and Hardwarelevel parm = unused. ISDN_STAT_ICALL: + ISDN_STAT_ICALLW: With this call, the HL-driver signals an incoming call to the LL. + If ICALLW is signalled the incoming call is a waiting call without + a available B-chan. Parameter: driver = driver-Id command = ISDN_STAT_ICALL arg = channel-number, locally to the driver. (starting with 0) - parm.setup.phone = Callernumber. - parm.setup.eazmsn = CalledNumber. - parm.setup.si1 = Service Indicator. - parm.setup.si2 = Additional Service Indicator. - parm.setup.plan = octet 3 from Calling party number Information Element. - parm.setup.screen = octet 3a from Calling party number Information Element. + para.setup.phone = Callernumber. + para.setup.eazmsn = CalledNumber. + para.setup.si1 = Service Indicator. + para.setup.si2 = Additional Service Indicator. + para.setup.plan = octet 3 from Calling party number Information Element. + para.setup.screen = octet 3a from Calling party number Information Element. Return: 0 = No device matching this call. 1 = At least one device matching this call (RING on ttyI). HL-driver may send ALERTING on the D-channel in this case. 2 = Call will be rejected. - 3 = Incomplete number. - The CalledNumber would match, if more digits are appended. - This feature is needed for Number-Blocks assigned to - a line. In this case, the LL driver should assemble the - CalledNumber by handling keypad protocol and try again - later with a longer CalledNumber. - HL drivers serving ordinary lines should interpret this - return code like 0 (nothing matches). + 3 = Incoming called party number is currently incomplete. + Additional digits are required. + Used for signalling with PtP connections. + 4 = Call will be held in a proceeding state + (HL driver sends PROCEEDING) + Used when a user space prog needs time to interpret a call + para.setup.eazmsn may be filled with an uus1 message of + 30 octets maximum. Empty string if no uus. + 5 = Call will be actively deflected to another party + Only available in DSS1/EURO protocol + para.setup.phone must be set to destination party number + para.setup.eazmsn may be filled with an uus1 message of + 30 octets maximum. Empty string if no uus. -1 = An error happened. (Invalid parameters for example.) + The keypad support now is included in the dial command. + ISDN_STAT_RUN: @@ -654,19 +715,31 @@ Description of the Interface between Linklevel and Hardwarelevel arg = channel-number, locally to the driver. (starting with 0) parm.num = ASCII string containing CAUSE-message. - ISDN_STAT_L1ERR: + ISDN_STAT_DISPLAY: - ***CHANGEI1.21 new status message. - A signal can be sent to the linklevel if an Layer1-error results in - packet-loss on receive or send. The field errcode of the cmd.parm - union describes the error more precisely. + With this call, the HL-driver delivers DISPLAY-messages to the LL. + Currently the LL does not use this messages. Parameter: driver = driver-Id - command = ISDN_STAT_L1ERR + command = ISDN_STAT_DISPLAY arg = channel-number, locally to the driver. (starting with 0) - parm.errcode= ISDN_STAT_L1ERR_SEND: Packet lost while sending. - ISDN_STAT_L1ERR_RECV: Packet lost while receiving. + para.display= string containing DISPLAY-message. + + ISDN_STAT_PROT: + + With this call, the HL-driver delivers protocol specific infos to the LL. + The call is not implicitely bound to a connection. + + Parameter: + driver = driver-Id + command = ISDN_STAT_PROT + arg = The lower 8 Bits define the adressed protocol as defined + in ISDN_PTYPE..., the upper bits are used to differenciate + the protocol specific STAT. + + para = protocol and function specific. See isdnif.h for detail. + ISDN_STAT_DISCH: With this call, the HL-driver signals the LL to disable or enable the @@ -683,7 +756,20 @@ Description of the Interface between Linklevel and Hardwarelevel command = ISDN_STAT_DISCH arg = channel-number, locally to the driver. (starting with 0) parm.num[0] = 0 if channel shall be disabled, else enabled. - + + ISDN_STAT_L1ERR: + + ***CHANGEI1.21 new status message. + A signal can be sent to the linklevel if an Layer1-error results in + packet-loss on receive or send. The field errcode of the cmd.parm + union describes the error more precisely. + + Parameter: + driver = driver-Id + command = ISDN_STAT_L1ERR + arg = channel-number, locally to the driver. (starting with 0) + parm.errcode= ISDN_STAT_L1ERR_SEND: Packet lost while sending. + ISDN_STAT_L1ERR_RECV: Packet lost while receiving. ISDN_STAT_FAXIND: With this call the HL-driver signals a fax sub-command to the LL. diff --git a/Documentation/isdn/README b/Documentation/isdn/README index dcd14151eb9b..28b177a86fe4 100644 --- a/Documentation/isdn/README +++ b/Documentation/isdn/README @@ -581,7 +581,7 @@ README for the ISDN-subsystem If other drivers will not be affected, I will include the changes in the next release. For developers only, there is a second mailing-list. Write to me - (fritz@wuemaus.franken.de), if you want to join that list. + (fritz@isdn4linux.de), if you want to join that list. Have fun! diff --git a/Documentation/isdn/README.HiSax b/Documentation/isdn/README.HiSax index a9f9851beb08..ee95d85f4147 100644 --- a/Documentation/isdn/README.HiSax +++ b/Documentation/isdn/README.HiSax @@ -55,13 +55,15 @@ USR Sportster internal TA (compatible Stollmann tina-pp V3) ith Kommunikationstechnik GmbH MIC 16 ISA card Traverse Technologie NETjet PCI S0 card Dr. Neuhaus Niccy PnP/PCI -Siemens I-Surf +Siemens I-Surf 1.0 +Siemens I-Surf 2.0 (with IPAC, try type 12 asuscom) ACER P10 HST Saphir Berkom Telekom A4T Scitel Quadro Gazel ISDN cards HFC-PCI based cards +Winbond W6692 based cards Note: PCF, PCF-Pro: up to now, only the ISDN part is supported PCC-8: not tested yet @@ -173,7 +175,7 @@ Card types: 27 AVM PnP (Fritz!PnP) irq, io (from isapnp setup) 27 AVM PCI (Fritz!PCI) no parameter 28 Sedlbauer Speed Fax+ irq, io (from isapnp setup) - 29 Siemens I-Surf irq, io, memory (from isapnp setup) + 29 Siemens I-Surf 1.0 irq, io, memory (from isapnp setup) 30 ACER P10 irq, io (from isapnp setup) 31 HST Saphir irq, io 32 Telekom A4T none @@ -181,6 +183,7 @@ Card types: 34 Gazel ISDN cards (ISA) irq,io 34 Gazel ISDN cards (PCI) none 35 HFC 2BDS0 PCI none + 36 W6692 based PCI cards none At the moment IRQ sharing is only possible with PCI cards. Please make sure @@ -276,7 +279,7 @@ type 27 AVM PnP (Fritz!PnP) ONLY WORKS AS A MODULE ! 27 AVM PCI (Fritz!PCI) no parameter 28 Sedlbauer Speed Fax+ ONLY WORKS AS A MODULE ! - 29 Siemens I-Surf ONLY WORKS AS A MODULE ! + 29 Siemens I-Surf 1.0 ONLY WORKS AS A MODULE ! 30 ACER P10 ONLY WORKS AS A MODULE ! 31 HST Saphir pa=irq, pb=io 32 Telekom A4T no parameter @@ -284,6 +287,7 @@ type 34 Gazel ISDN cards (ISA) pa=irq, pb=io 34 Gazel ISDN cards (PCI) no parameter 35 HFC 2BDS0 PCI no parameter + 36 W6692 based PCI cards none Running the driver ------------------ @@ -424,6 +428,7 @@ Special thanks to: Klaus Lichtenwalder (Klaus.Lichtenwalder@WebForum.DE), for ELSA PCMCIA support Enrik Berkhan (enrik@starfleet.inka.de) for S0BOX specific stuff Ton van Rosmalen for Teles PCI + Petr Novak for Winbond W6692 support and more people who are hunting bugs. (If I forgot somebody, please send me a mail). diff --git a/Documentation/isdn/README.concap b/Documentation/isdn/README.concap index 02a99c7dd5d8..a934fe346e2a 100644 --- a/Documentation/isdn/README.concap +++ b/Documentation/isdn/README.concap @@ -118,7 +118,7 @@ struct concap_proto_ops{ or when the device driver resets the interface. All services of the encapsulation protocol may be used after this*/ int (*restart)(struct concap_proto *cprot, - struct device *ndev, + struct net_device *ndev, struct concap_device_ops *dops); /* deactivate an encapsulation protocol instance. The encapsulation @@ -174,7 +174,7 @@ because the encapsulation protocol directly calls netif_rx(). An encapsulation protocol itself is actually the struct concap_proto{ - struct device *net_dev; /* net device using our service */ + struct net_device *net_dev; /* net device using our service */ struct concap_device_ops *dops; /* callbacks provided by device */ struct concap_proto_ops *pops; /* callbacks provided by us */ int flags; @@ -199,7 +199,7 @@ A possible extended device structure which uses the connection controlling encapsulation services could look like this: struct concap_device{ - struct device net_dev; + struct net_device net_dev; struct my_priv /* device->local stuff */ /* the my_priv struct might contain a struct concap_device_ops *dops; @@ -225,9 +225,9 @@ ATM). If general linux network interfaces explicitly supported concap -protocols (e.g. by a member struct concap_proto* in struct device) +protocols (e.g. by a member struct concap_proto* in struct net_device) then the interface of the service function could be changed -by passing a pointer of type (struct device*) instead of +by passing a pointer of type (struct net_device*) instead of type (struct concap_proto*). Doing so would make many of the service functions compatible to network device support functions. @@ -237,7 +237,7 @@ e.g. instead of the concap protocol's service function we could have - int (*encap_and_xmit)(struct device *ndev, struct sk_buff *skb); + int (*encap_and_xmit)(struct net_device *ndev, struct sk_buff *skb); As this is compatible to the dev->hard_start_xmit() method, the device driver could directly register the concap protocol's encap_and_xmit() @@ -247,7 +247,7 @@ procedure call layer. The device's data request function could also be defined as - int (*data_req)(struct device *ndev, struct sk_buff *skb); + int (*data_req)(struct net_device *ndev, struct sk_buff *skb); This might even allow for some protocol stacking. And the network interface might even register the same data_req() function directly diff --git a/Documentation/isdn/README.hfc-pci b/Documentation/isdn/README.hfc-pci index 94e0d4352543..6cc311e35924 100644 --- a/Documentation/isdn/README.hfc-pci +++ b/Documentation/isdn/README.hfc-pci @@ -20,6 +20,21 @@ This enables the echo mode. If Hex logging is activated the isdnctrlx devices show a output with a line beginning of HEX: for the providers exchange and ECHO: for isdn devices sending to the provider. +If more than one HFC-PCI cards are installed, a specific card may be selected +at the hisax module load command line. Supply the load command with the desired +IO-address of the desired card. +Example: +There tree cards installed in your machine at IO-base addresses 0xd000, 0xd400 +and 0xdc00 +If you want to use the card at 0xd400 standalone you should supply the insmod +or depmod with type=35 io=0xd400. +If you want to use all three cards, but the order needs to be at 0xdc00,0xd400, +0xd000 you may give the parameters type=35,35,35 io=0xdc00,0xd400,0xd00 +Then the desired card will be the initialised in the desired order. +If the io parameter is used the io addresses of all used cards should be +supplied else the parameter is assumed 0 and a auto search for a free card is +invoked which may not give the wanted result. + Comments and reports to werner@isdn4linux.de or werner@titro.de . diff --git a/Documentation/sound/MultiSound b/Documentation/sound/MultiSound index e8ae21aaf724..e4a18bb7f73a 100644 --- a/Documentation/sound/MultiSound +++ b/Documentation/sound/MultiSound @@ -4,7 +4,7 @@ # -- Andrew Veliath # # Last update: September 10, 1998 -# Corresponding msnd driver: 0.8.2 +# Corresponding msnd driver: 0.8.3 # # ** This file is a README (top part) and shell archive (bottom part). # The corresponding archived utility sources can be unpacked by diff --git a/MAINTAINERS b/MAINTAINERS index b1ddf79491c5..58cec2df8007 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -362,7 +362,7 @@ S: Maintained HFS FILESYSTEM P: Adrian Sun -M: asun@u.washington.edu +M: asun@cobaltnet.com L: linux-kernel@vger.rutgers.edu S: Maintained @@ -437,10 +437,17 @@ L: linux-irda@list.uit.no W: http://www.cs.uit.no/linux-irda/ S: Maintained -ISDN SUBSYSTEM +ISDN SUBSYSTEM (general) P: Fritz Elfert -M: fritz@wuemaus.franken.de -L: isdn4linux@hub-wue.franken.de +M: fritz@isdn4linux.de +L: isdn4linux@listserv.isdn4linux.de +W: www.isdn4linux.de +S: Maintained + +ISDN SUBSYSTEM (HiSax) +P: Karsten Keil +M: keil@isdn4linux.de +L: isdn4linux@listserv.isdn4linux.de S: Maintained JOYSTICK DRIVER diff --git a/Makefile b/Makefile index 56eda0ab7bbb..98d612d94951 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 2 SUBLEVEL = 13 -EXTRAVERSION = pre7 +EXTRAVERSION = pre8 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c index 42ebd964376f..b56b379bf514 100644 --- a/arch/i386/kernel/io_apic.c +++ b/arch/i386/kernel/io_apic.c @@ -703,11 +703,11 @@ void __init print_IO_APIC(void) (reg_01.entries != 0x17) && /* typical ISA+PCI boards */ (reg_01.entries != 0x1b) && /* Compaq Proliant boards */ (reg_01.entries != 0x1f) && /* dual Xeon boards */ - (reg_01.entries != 0x3F) /* bigger Xeon boards */ + (reg_01.entries != 0x22) && /* bigger Xeon boards */ + (reg_01.entries != 0x2E) && + (reg_01.entries != 0x3F) ) UNEXPECTED_IO_APIC(); - if (reg_01.entries == 0x0f) - printk("....... [IO-APIC cannot route PCI PIRQ 0-3]\n"); printk("....... : IO APIC version: %04X\n", reg_01.version); if ( (reg_01.version != 0x10) && /* oldest IO-APICs */ diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index 436687c7905b..dc761c098dc3 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c @@ -632,7 +632,7 @@ __initfunc(static void cyrix_model(struct cpuinfo_x86 *c)) c->x86_model = (dir1 & 0x20) ? 1 : 2; c->x86_capability&=~X86_FEATURE_TSC; } -#ifdef CONFIG_PCI +#ifdef CONFIG_PCI_QUIRKS /* It isnt really a PCI quirk directly, but the cure is the same. The MediaGX has deep magic SMM stuff that handles the SB emulation. It thows away the fifo on disable_dma() which diff --git a/arch/ppc/kernel/chrp_pci.c b/arch/ppc/kernel/chrp_pci.c index 976e2d5fad2b..8fc5c6d3dc1c 100644 --- a/arch/ppc/kernel/chrp_pci.c +++ b/arch/ppc/kernel/chrp_pci.c @@ -354,7 +354,8 @@ chrp_setup_pci_ptrs(void) else { if ( !strncmp("IBM,7043-150", get_property(find_path_device("/"), "name", NULL),12) || - !strncmp("IBM,7046-155", get_property(find_path_device("/"), "name", NULL),12) ) + !strncmp("IBM,7046-155", get_property(find_path_device("/"), "name", NULL),12) || + !strncmp("IBM,7046-B50", get_property(find_path_device("/"), "name", NULL),12) ) { pci_dram_offset = 0; isa_mem_base = 0x80000000; diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c index 998b9aa34c0c..c031a69b363a 100644 --- a/arch/ppc/kernel/ppc_ksyms.c +++ b/arch/ppc/kernel/ppc_ksyms.c @@ -121,7 +121,7 @@ EXPORT_SYMBOL(csum_tcpudp_magic); EXPORT_SYMBOL(__copy_tofrom_user); EXPORT_SYMBOL(__clear_user); EXPORT_SYMBOL(__strncpy_from_user); -EXPORT_SYMBOL(strlen_user); +EXPORT_SYMBOL(__strnlen_user); /* EXPORT_SYMBOL(inb); diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c index beacf91c4f36..5990fe036723 100644 --- a/arch/ppc/kernel/setup.c +++ b/arch/ppc/kernel/setup.c @@ -1,5 +1,5 @@ /* - * $Id: setup.c,v 1.132.2.4 1999/09/10 01:08:08 paulus Exp $ + * $Id: setup.c,v 1.132.2.5 1999/09/11 03:32:50 paulus Exp $ * Common prep/pmac/chrp boot and setup code. */ @@ -412,6 +412,8 @@ identify_machine(unsigned long r3, unsigned long r4, unsigned long r5, { #ifdef CONFIG_MACH_SPECIFIC /* prom_init has already been called from __start */ + if (boot_infos) + relocate_nodes(); finish_device_tree(); #endif /* CONFIG_MACH_SPECIFIC */ /* diff --git a/arch/ppc/lib/string.S b/arch/ppc/lib/string.S index be5504940bd2..8d7bf06c4d00 100644 --- a/arch/ppc/lib/string.S +++ b/arch/ppc/lib/string.S @@ -380,16 +380,26 @@ __strncpy_from_user: .long 1b,99b .text - .globl strlen_user -strlen_user: - addi r4,r3,-1 -1: lbzu r0,1(r4) +/* r3 = str, r4 = len (> 0), r5 = top (highest addr + 1) */ + .globl __strnlen_user +__strnlen_user: + subf r6,r3,r5 /* top - str */ + addi r7,r3,-1 + cmplw 0,r4,r6 + bge 0f + mr r6,r4 +0: mtctr r6 /* ctr = min(len, top - str) */ +1: lbzu r0,1(r7) /* get next byte */ cmpwi 0,r0,0 - bne 1b - subf r3,r3,r4 - addi r3,r3,1 + bdnzf 2,1b /* loop if --ctr != 0 && byte != 0 */ + addi r7,r7,1 + subf r3,r3,r7 /* number of bytes we have looked at */ + beqlr /* return if we found a 0 byte */ + cmpw 0,r3,r4 /* did we look at all len bytes? */ + blt 99f /* if not, must have hit top */ + addi r3,r4,1 /* return len + 1 to indicate no null found */ blr -99: li r3,0 +99: li r3,0 /* bad address, return 0 */ blr .section __ex_table,"a" .align 2 diff --git a/drivers/char/n_hdlc.c b/drivers/char/n_hdlc.c index b72e5f89082d..0c5d2bcdc2e8 100644 --- a/drivers/char/n_hdlc.c +++ b/drivers/char/n_hdlc.c @@ -9,7 +9,7 @@ * Al Longyear , Paul Mackerras * * Original release 01/11/99 - * ==FILEDATE 19990524== + * ==FILEDATE 19990901== * * This code is released under the GNU General Public License (GPL) * @@ -21,8 +21,13 @@ * 1. tty write calls represent one complete transmit frame of data * The device driver should accept the complete frame or none of * the frame (busy) in the write method. Each write call should have - * a byte count in the range of 2-4096 bytes (2 is min HDLC frame - * with 1 addr byte and 1 ctrl byte). + * a byte count in the range of 2-65535 bytes (2 is min HDLC frame + * with 1 addr byte and 1 ctrl byte). The max byte count of 65535 + * should include any crc bytes required. For example, when using + * CCITT CRC32, 4 crc bytes are required, so the maximum size frame + * the application may transmit is limited to 65531 bytes. For CCITT + * CRC16, the maximum application frame size would be 65533. + * * * 2. receive callbacks from the device driver represents * one received frame. The device driver should bypass @@ -73,7 +78,7 @@ */ #define HDLC_MAGIC 0x239e -#define HDLC_VERSION "1.2" +#define HDLC_VERSION "1.11" #include #include @@ -114,6 +119,13 @@ #include #endif +#if LINUX_VERSION_CODE < VERSION(2,3,0) +typedef struct wait_queue *wait_queue_head_t; +#define DECLARE_WAITQUEUE(name,task) struct wait_queue (name) = {(task),NULL} +#define init_waitqueue_head(head) *(head) = NULL +#define set_current_state(a) current->state = (a) +#endif + #if LINUX_VERSION_CODE >= VERSION(2,1,4) #include #define GET_USER(error,value,addr) error = get_user(value,addr) @@ -190,18 +202,21 @@ typedef size_t rw_count_t; /* * Buffers for individual HDLC frames */ -#define MAX_HDLC_FRAME_SIZE 4096 +#define MAX_HDLC_FRAME_SIZE 65535 #define DEFAULT_RX_BUF_COUNT 10 -#define MAX_RX_BUF_COUNT 30 +#define MAX_RX_BUF_COUNT 60 #define DEFAULT_TX_BUF_COUNT 1 + typedef struct _n_hdlc_buf { struct _n_hdlc_buf *link; int count; - char buf[MAX_HDLC_FRAME_SIZE]; + char buf[1]; } N_HDLC_BUF; +#define N_HDLC_BUF_SIZE (sizeof(N_HDLC_BUF)+maxframe) + typedef struct _n_hdlc_buf_list { N_HDLC_BUF *head; @@ -222,8 +237,8 @@ struct n_hdlc { struct tty_struct *backup_tty; /* TTY to use if tty gets closed */ /* Queues for select() functionality */ - struct wait_queue *read_wait; - struct wait_queue *write_wait; + wait_queue_head_t read_wait; + wait_queue_head_t write_wait; int tbusy; /* reentrancy flag for tx wakeup code */ int woke_up; @@ -247,12 +262,16 @@ static struct n_hdlc *n_hdlc_alloc (void); #if LINUX_VERSION_CODE >= VERSION(2,1,19) MODULE_PARM(debuglevel, "i"); +MODULE_PARM(maxframe, "i"); #endif /* debug level can be set by insmod for debugging purposes */ #define DEBUG_LEVEL_INFO 1 int debuglevel=0; +/* max frame size for memory allocations */ +ssize_t maxframe=4096; + /* TTY callbacks */ static rw_ret_t n_hdlc_tty_read(struct tty_struct *, @@ -354,6 +373,9 @@ static void n_hdlc_tty_close(struct tty_struct *tty) printk (KERN_WARNING"n_hdlc: trying to close unopened tty!\n"); return; } +#if defined(TTY_NO_WRITE_SPLIT) + clear_bit(TTY_NO_WRITE_SPLIT,&tty->flags); +#endif tty->disc_data = NULL; if (tty == n_hdlc->backup_tty) n_hdlc->backup_tty = 0; @@ -384,7 +406,9 @@ static int n_hdlc_tty_open (struct tty_struct *tty) struct n_hdlc *n_hdlc = tty2n_hdlc (tty); if (debuglevel >= DEBUG_LEVEL_INFO) - printk("%s(%d)n_hdlc_tty_open() called\n",__FILE__,__LINE__); + printk("%s(%d)n_hdlc_tty_open() called (major=%u,minor=%u)\n", + __FILE__,__LINE__, + MAJOR(tty->device), MINOR(tty->device)); /* There should not be an existing table for this slot. */ if (n_hdlc) { @@ -400,9 +424,14 @@ static int n_hdlc_tty_open (struct tty_struct *tty) tty->disc_data = n_hdlc; n_hdlc->tty = tty; - + MOD_INC_USE_COUNT; +#if defined(TTY_NO_WRITE_SPLIT) + /* change tty_io write() to not split large writes into 8K chunks */ + set_bit(TTY_NO_WRITE_SPLIT,&tty->flags); +#endif + /* Flush any pending characters in the driver and discipline. */ if (tty->ldisc.flush_buffer) @@ -598,18 +627,26 @@ static void n_hdlc_tty_receive(struct tty_struct *tty, return; } + if ( count>maxframe ) { + if (debuglevel >= DEBUG_LEVEL_INFO) + printk("%s(%d) rx count>maxframesize, data discarded\n", + __FILE__,__LINE__); + return; + } + /* get a free HDLC buffer */ buf = n_hdlc_buf_get(&n_hdlc->rx_free_buf_list); if (!buf) { /* no buffers in free list, attempt to allocate another rx buffer */ /* unless the maximum count has been reached */ if (n_hdlc->rx_buf_list.count < MAX_RX_BUF_COUNT) - buf = (N_HDLC_BUF*)kmalloc(sizeof(N_HDLC_BUF),GFP_ATOMIC); + buf = (N_HDLC_BUF*)kmalloc(N_HDLC_BUF_SIZE,GFP_ATOMIC); } if (!buf) { - printk("%s(%d) no more rx buffers, data discarded\n", - __FILE__,__LINE__); + if (debuglevel >= DEBUG_LEVEL_INFO) + printk("%s(%d) no more rx buffers, data discarded\n", + __FILE__,__LINE__); return; } @@ -679,12 +716,11 @@ static rw_ret_t n_hdlc_tty_read (struct tty_struct *tty, if (file->f_flags & O_NONBLOCK) return -EAGAIN; - /* TODO: no timeout? current->timeout = 0;*/ interruptible_sleep_on (&n_hdlc->read_wait); if (signal_pending(current)) return -EINTR; } - + if (rbuf->count > nr) { /* frame too large for caller's buffer (discard frame) */ ret = (rw_ret_t)-EOVERFLOW; @@ -725,7 +761,7 @@ static rw_ret_t n_hdlc_tty_write (struct tty_struct *tty, struct file *file, { struct n_hdlc *n_hdlc = tty2n_hdlc (tty); int error = 0; - struct wait_queue wait = {current, NULL}; + DECLARE_WAITQUEUE(wait, current); N_HDLC_BUF *tbuf; if (debuglevel >= DEBUG_LEVEL_INFO) @@ -740,13 +776,13 @@ static rw_ret_t n_hdlc_tty_write (struct tty_struct *tty, struct file *file, return -EIO; /* verify frame size */ - if (count > MAX_HDLC_FRAME_SIZE) { + if (count > maxframe ) { if (debuglevel & DEBUG_LEVEL_INFO) printk (KERN_WARNING "n_hdlc_tty_write: truncating user packet " "from %lu to %d\n", (unsigned long) count, - MAX_HDLC_FRAME_SIZE); - count = MAX_HDLC_FRAME_SIZE; + maxframe ); + count = maxframe; } /* Allocate transmit buffer */ @@ -755,8 +791,7 @@ static rw_ret_t n_hdlc_tty_write (struct tty_struct *tty, struct file *file, /* sleep until transmit buffer available */ add_wait_queue(&n_hdlc->write_wait, &wait); while (!tbuf) { - /* TODO: no timeout? current->timeout = 0;*/ - current->state = TASK_INTERRUPTIBLE; + set_current_state(TASK_INTERRUPTIBLE); schedule(); n_hdlc = tty2n_hdlc (tty); @@ -774,7 +809,7 @@ static rw_ret_t n_hdlc_tty_write (struct tty_struct *tty, struct file *file, tbuf = n_hdlc_buf_get(&n_hdlc->tx_free_buf_list); } - current->state = TASK_RUNNING; + set_current_state(TASK_RUNNING); remove_wait_queue(&n_hdlc->write_wait, &wait); } @@ -1001,24 +1036,28 @@ static struct n_hdlc *n_hdlc_alloc (void) /* allocate free rx buffer list */ for(i=0;irx_free_buf_list,buf); + else if (debuglevel >= DEBUG_LEVEL_INFO) + printk("%s(%d)n_hdlc_alloc(), kalloc() failed for rx buffer %d\n",__FILE__,__LINE__, i); } - /* allocate free rx buffer list */ + /* allocate free tx buffer list */ for(i=0;itx_free_buf_list,buf); + else if (debuglevel >= DEBUG_LEVEL_INFO) + printk("%s(%d)n_hdlc_alloc(), kalloc() failed for tx buffer %d\n",__FILE__,__LINE__, i); } /* Initialize the control block */ n_hdlc->magic = HDLC_MAGIC; n_hdlc->flags = 0; - n_hdlc->read_wait = NULL; - n_hdlc->write_wait = NULL; + init_waitqueue_head(&n_hdlc->read_wait); + init_waitqueue_head(&n_hdlc->write_wait); return n_hdlc; @@ -1109,7 +1148,14 @@ int init_module(void) static struct tty_ldisc n_hdlc_ldisc; int status; - printk("HDLC line discipline: version %s\n", szVersion); + /* range check maxframe arg */ + if ( maxframe<4096) + maxframe=4096; + else if ( maxframe>65535) + maxframe=65535; + + printk("HDLC line discipline: version %s, maxframe=%u\n", + szVersion, maxframe); /* Register the tty discipline */ diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c index fda50c69e8e9..cb3f1e0dea6a 100644 --- a/drivers/char/synclink.c +++ b/drivers/char/synclink.c @@ -1,7 +1,7 @@ /* * linux/drivers/char/synclink.c * - * ==FILEDATE 19990610== + * ==FILEDATE 19990901== * * Device driver for Microgate SyncLink ISA and PCI * high speed multiprotocol serial adapters. @@ -50,6 +50,8 @@ #define BREAKPOINT() asm(" int $3"); #define MAX_ISA_DEVICES 10 +#define MAX_PCI_DEVICES 10 +#define MAX_TOTAL_DEVICES 20 #include #include @@ -91,6 +93,14 @@ #include #include +#if LINUX_VERSION_CODE < VERSION(2,3,0) +typedef struct wait_queue *wait_queue_head_t; +#define DECLARE_WAITQUEUE(name,task) struct wait_queue (name) = {(task),NULL} +#define init_waitqueue_head(head) *(head) = NULL +#define DECLARE_MUTEX(name) struct semaphore (name) = MUTEX +#define set_current_state(a) current->state = (a) +#endif + #if LINUX_VERSION_CODE >= VERSION(2,1,4) #include #define GET_USER(error,value,addr) error = get_user(value,addr) @@ -257,11 +267,11 @@ struct mgsl_struct { int xmit_tail; int xmit_cnt; - struct wait_queue *open_wait; - struct wait_queue *close_wait; + wait_queue_head_t open_wait; + wait_queue_head_t close_wait; - struct wait_queue *status_event_wait_q; - struct wait_queue *event_wait_q; + wait_queue_head_t status_event_wait_q; + wait_queue_head_t event_wait_q; struct timer_list tx_timer; /* HDLC transmit timeout timer */ struct mgsl_struct *next_device; /* device list link */ @@ -297,6 +307,8 @@ struct mgsl_struct { unsigned int tx_buffer_count; /* count of total allocated Tx buffers */ DMABUFFERENTRY *tx_buffer_list; /* list of transmit buffer entries */ + + unsigned char *intermediate_rxbuffer; int rx_enabled; int rx_overflow; @@ -306,6 +318,7 @@ struct mgsl_struct { u32 idle_mode; u16 cmr_value; + u16 tcsr_value; char device_name[25]; /* device instance name */ @@ -345,8 +358,8 @@ struct mgsl_struct { u32 lcr_offset; u32 misc_ctrl_value; - char flag_buf[HDLC_MAX_FRAME_SIZE]; - char char_buf[HDLC_MAX_FRAME_SIZE]; + char flag_buf[MAX_ASYNC_BUFFER_SIZE]; + char char_buf[MAX_ASYNC_BUFFER_SIZE]; BOOLEAN drop_rts_on_tx_done; BOOLEAN loopmode_insert_requested; @@ -573,13 +586,21 @@ struct mgsl_struct { #define IDLEMODE_ALT_MARK_SPACE 0x0500 #define IDLEMODE_SPACE 0x0600 #define IDLEMODE_MARK 0x0700 +#define IDLEMODE_MASK 0x0700 + +/* + * IUSC revision identifiers + */ +#define IUSC_SL1660 0x4d44 +#define IUSC_PRE_SL1660 0x4553 /* * Transmit status Bits in Transmit Command/status Register (TCSR) */ -#define TCSR_PRESERVE 0x0700 +#define TCSR_PRESERVE 0x0F00 +#define TCSR_UNDERWAIT BIT11 #define TXSTATUS_PREAMBLE_SENT BIT7 #define TXSTATUS_IDLE_SENT BIT6 #define TXSTATUS_ABORT_SENT BIT5 @@ -590,7 +611,7 @@ struct mgsl_struct { #define TXSTATUS_UNDERRUN BIT1 #define TXSTATUS_FIFO_EMPTY BIT0 #define TXSTATUS_ALL 0x00fa -#define usc_UnlatchTxstatusBits(a,b) usc_OutReg( (a), TCSR, (u16)((a)->usc_idle_mode + ((b) & 0x00FF)) ) +#define usc_UnlatchTxstatusBits(a,b) usc_OutReg( (a), TCSR, (u16)((a)->tcsr_value + ((b) & 0x00FF)) ) #define MISCSTATUS_RXC_LATCHED BIT15 @@ -710,9 +731,10 @@ void usc_RTCmd( struct mgsl_struct *info, u16 Cmd ); void usc_RCmd( struct mgsl_struct *info, u16 Cmd ); void usc_TCmd( struct mgsl_struct *info, u16 Cmd ); -#define usc_TCmd(a,b) usc_OutReg((a), TCSR, (u16)((a)->usc_idle_mode + (b))) +#define usc_TCmd(a,b) usc_OutReg((a), TCSR, (u16)((a)->tcsr_value + (b))) #define usc_RCmd(a,b) usc_OutReg((a), RCSR, (b)) +void usc_process_rxoverrun_sync( struct mgsl_struct *info ); void usc_start_receiver( struct mgsl_struct *info ); void usc_stop_receiver( struct mgsl_struct *info ); @@ -799,6 +821,8 @@ int mgsl_alloc_frame_memory(struct mgsl_struct *info, DMABUFFERENTRY *BufferLis void mgsl_free_frame_memory(struct mgsl_struct *info, DMABUFFERENTRY *BufferList,int Buffercount); int mgsl_alloc_buffer_list_memory(struct mgsl_struct *info); void mgsl_free_buffer_list_memory(struct mgsl_struct *info); +int mgsl_alloc_intermediate_rxbuffer_memory(struct mgsl_struct *info); +void mgsl_free_intermediate_rxbuffer_memory(struct mgsl_struct *info); /* * Bottom half interrupt handlers @@ -886,6 +910,7 @@ static int io[MAX_ISA_DEVICES] = {0,}; static int irq[MAX_ISA_DEVICES] = {0,}; static int dma[MAX_ISA_DEVICES] = {0,}; static int debug_level = 0; +static int maxframe[MAX_TOTAL_DEVICES] = {0,}; #if LINUX_VERSION_CODE >= VERSION(2,1,0) @@ -896,10 +921,11 @@ MODULE_PARM(io,"1-" __MODULE_STRING(MAX_ISA_DEVICES) "i"); MODULE_PARM(irq,"1-" __MODULE_STRING(MAX_ISA_DEVICES) "i"); MODULE_PARM(dma,"1-" __MODULE_STRING(MAX_ISA_DEVICES) "i"); MODULE_PARM(debug_level,"i"); +MODULE_PARM(maxframe,"1-" __MODULE_STRING(MAX_TOTAL_DEVICES) "i"); #endif static char *driver_name = "SyncLink serial driver"; -static char *driver_version = "1.7"; +static char *driver_version = "1.14"; static struct tty_driver serial_driver, callout_driver; static int serial_refcount; @@ -938,7 +964,7 @@ void* mgsl_get_text_ptr() {return mgsl_get_text_ptr;} * memory if large numbers of serial ports are open. */ static unsigned char *tmp_buf; -static struct semaphore tmp_buf_sem = MUTEX; +static DECLARE_MUTEX(tmp_buf_sem); static inline int mgsl_paranoia_check(struct mgsl_struct *info, kdev_t device, const char *routine) @@ -1349,11 +1375,14 @@ void mgsl_isr_receive_status( struct mgsl_struct *info ) } if (status & RXSTATUS_OVERRUN){ - /* Purge receive FIFO to allow DMA buffer completion - * with overrun status stored in the receive status block. - */ - usc_RCmd( info, RCmd_EnterHuntmode ); - usc_RTCmd( info, RTCmd_PurgeRxFifo ); +// /* Purge receive FIFO to allow DMA buffer completion +// * with overrun status stored in the receive status block. +// */ +// usc_RCmd( info, RCmd_EnterHuntmode ); +// usc_RTCmd( info, RTCmd_PurgeRxFifo ); + + info->icount.rxover++; + usc_process_rxoverrun_sync( info ); } usc_ClearIrqPendingBits( info, RECEIVE_STATUS ); @@ -1381,6 +1410,17 @@ void mgsl_isr_transmit_status( struct mgsl_struct *info ) usc_ClearIrqPendingBits( info, TRANSMIT_STATUS ); usc_UnlatchTxstatusBits( info, status ); + + if ( status & (TXSTATUS_UNDERRUN | TXSTATUS_ABORT_SENT) ) + { + /* finished sending HDLC abort. This may leave */ + /* the TxFifo with data from the aborted frame */ + /* so purge the TxFifo. Also shutdown the DMA */ + /* channel in case there is data remaining in */ + /* the DMA buffer */ + usc_DmaCmd( info, DmaCmd_ResetTxChannel ); + usc_RTCmd( info, RTCmd_PurgeTxFifo ); + } if ( status & TXSTATUS_EOF_SENT ) info->icount.txok++; @@ -3343,7 +3383,7 @@ static void mgsl_close(struct tty_struct *tty, struct file * filp) if (info->blocked_open) { if (info->close_delay) { - current->state = TASK_INTERRUPTIBLE; + set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(info->close_delay); } wake_up_interruptible(&info->open_wait); @@ -3412,8 +3452,7 @@ static void mgsl_wait_until_sent(struct tty_struct *tty, int timeout) if ( info->params.mode == MGSL_MODE_HDLC ) { while (info->tx_active) { - current->state = TASK_INTERRUPTIBLE; - current->counter = 0; /* make us low-priority */ + set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(char_time); if (signal_pending(current)) break; @@ -3423,8 +3462,7 @@ static void mgsl_wait_until_sent(struct tty_struct *tty, int timeout) } else { while (!(usc_InReg(info,TCSR) & TXSTATUS_ALL_SENT) && info->tx_enabled) { - current->state = TASK_INTERRUPTIBLE; - current->counter = 0; /* make us low-priority */ + set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(char_time); if (signal_pending(current)) break; @@ -3433,7 +3471,7 @@ static void mgsl_wait_until_sent(struct tty_struct *tty, int timeout) } } - current->state = TASK_RUNNING; + set_current_state(TASK_RUNNING); exit: if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):mgsl_wait_until_sent(%s) exit\n", @@ -3487,7 +3525,7 @@ static void mgsl_hangup(struct tty_struct *tty) static int block_til_ready(struct tty_struct *tty, struct file * filp, struct mgsl_struct *info) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); int retval; int do_clocal = 0, extra_count = 0; unsigned long flags; @@ -3561,7 +3599,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, spin_unlock_irqrestore(&info->irq_spinlock,flags); } - current->state = TASK_INTERRUPTIBLE; + set_current_state(TASK_INTERRUPTIBLE); if (tty_hung_up_p(filp) || !(info->flags & ASYNC_INITIALIZED)){ retval = (info->flags & ASYNC_HUP_NOTIFY) ? @@ -3591,7 +3629,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, schedule(); } - current->state = TASK_RUNNING; + set_current_state(TASK_RUNNING); remove_wait_queue(&info->open_wait, &wait); if (extra_count) @@ -3801,7 +3839,7 @@ static inline int line_info(char *buf, struct mgsl_struct *info) spin_lock_irqsave(&info->irq_spinlock,flags); { - u16 Tscr = usc_InReg( info, TCSR ); + u16 Tcsr = usc_InReg( info, TCSR ); u16 Tdmr = usc_InDmaReg( info, TDMR ); u16 Ticr = usc_InReg( info, TICR ); u16 Rscr = usc_InReg( info, RCSR ); @@ -3814,7 +3852,7 @@ static inline int line_info(char *buf, struct mgsl_struct *info) u16 Ccar = inw( info->io_base + CCAR ); ret += sprintf(buf+ret, "tcsr=%04X tdmr=%04X ticr=%04X rcsr=%04X rdmr=%04X\n" "ricr=%04X icr =%04X dccr=%04X tmr=%04X tccr=%04X ccar=%04X\n", - Tscr,Tdmr,Ticr,Rscr,Rdmr,Ricr,Icr,Dccr,Tmr,Tccr,Ccar ); + Tcsr,Tdmr,Ticr,Rscr,Rdmr,Ricr,Icr,Dccr,Tmr,Tccr,Ccar ); } spin_unlock_irqrestore(&info->irq_spinlock,flags); @@ -3880,30 +3918,45 @@ int mgsl_allocate_dma_buffers(struct mgsl_struct *info) unsigned short BuffersPerFrame; info->last_mem_alloc = 0; - + + /* Calculate the number of DMA buffers necessary to hold the */ + /* largest allowable frame size. Note: If the max frame size is */ + /* not an even multiple of the DMA buffer size then we need to */ + /* round the buffer count per frame up one. */ + + BuffersPerFrame = (unsigned short)(info->max_frame_size/DMABUFFERSIZE); + if ( info->max_frame_size % DMABUFFERSIZE ) + BuffersPerFrame++; + if ( info->bus_type == MGSL_BUS_TYPE_PCI ) { /* * The PCI adapter has 256KBytes of shared memory to use. - * This is 64 PAGE_SIZE buffers. 1 is used for the buffer - * list. 2 are used for the transmit and one is left as - * a spare. The 4K buffer list can hold 128 DMA_BUFFER - * structures at 32bytes each. + * This is 64 PAGE_SIZE buffers. + * + * The first page is used for padding at this time so the + * buffer list does not begin at offset 0 of the PCI + * adapter's shared memory. + * + * The 2nd page is used for the buffer list. A 4K buffer + * list can hold 128 DMA_BUFFER structures at 32 bytes + * each. + * + * This leaves 62 4K pages. + * + * The next N pages are used for a transmit frame. We + * reserve enough 4K page blocks to hold the configured + * MaxFrameSize + * + * Of the remaining pages (62-N), determine how many can + * be used to receive full MaxFrameSize inbound frames */ - - info->rx_buffer_count = 60; - info->tx_buffer_count = 2; + + info->tx_buffer_count = BuffersPerFrame; + info->rx_buffer_count = 62 - info->tx_buffer_count; } else { /* Calculate the number of PAGE_SIZE buffers needed for */ /* receive and transmit DMA buffers. */ - /* Calculate the number of DMA buffers necessary to hold the */ - /* largest allowable frame size. Note: If the max frame size is */ - /* not an even multiple of the DMA buffer size then we need to */ - /* round the buffer count per frame up one. */ - - BuffersPerFrame = (unsigned short)(info->max_frame_size/DMABUFFERSIZE); - if ( info->max_frame_size % DMABUFFERSIZE ) - BuffersPerFrame++; /* Calculate the number of DMA buffers necessary to */ /* hold 7 max size receive frames and one max size transmit frame. */ @@ -3911,8 +3964,17 @@ int mgsl_allocate_dma_buffers(struct mgsl_struct *info) /* End of List condition if all receive buffers are used when */ /* using linked list DMA buffers. */ - info->rx_buffer_count = (BuffersPerFrame * MAXRXFRAMES) + 6; info->tx_buffer_count = BuffersPerFrame; + info->rx_buffer_count = (BuffersPerFrame * MAXRXFRAMES) + 6; + + /* + * limit total TxBuffers & RxBuffers to 62 4K total + * (ala PCI Allocation) + */ + + if ( (info->tx_buffer_count + info->rx_buffer_count) > 62 ) + info->rx_buffer_count = 62 - info->tx_buffer_count; + } if ( debug_level >= DEBUG_LEVEL_INFO ) @@ -3921,7 +3983,8 @@ int mgsl_allocate_dma_buffers(struct mgsl_struct *info) if ( mgsl_alloc_buffer_list_memory( info ) < 0 || mgsl_alloc_frame_memory(info, info->rx_buffer_list, info->rx_buffer_count) < 0 || - mgsl_alloc_frame_memory(info, info->tx_buffer_list, info->tx_buffer_count) < 0) { + mgsl_alloc_frame_memory(info, info->tx_buffer_list, info->tx_buffer_count) < 0 || + mgsl_alloc_intermediate_rxbuffer_memory(info) < 0 ) { printk("%s(%d):Can't allocate DMA buffer memory\n",__FILE__,__LINE__); return -ENOMEM; } @@ -4148,6 +4211,48 @@ void mgsl_free_dma_buffers( struct mgsl_struct *info ) } /* end of mgsl_free_dma_buffers() */ + +/* + * mgsl_alloc_intermediate_rxbuffer_memory() + * + * Allocate a buffer large enough to hold max_frame_size. This buffer + * is used to pass an assembled frame to the line discipline. + * + * Arguments: + * + * info pointer to device instance data + * + * Return Value: 0 if success, otherwise -ENOMEM + */ +int mgsl_alloc_intermediate_rxbuffer_memory(struct mgsl_struct *info) +{ + info->intermediate_rxbuffer = kmalloc(info->max_frame_size, GFP_KERNEL | GFP_DMA); + if ( info->intermediate_rxbuffer == NULL ) + return -ENOMEM; + + return 0; + +} /* end of mgsl_alloc_intermediate_rxbuffer_memory() */ + +/* + * mgsl_free_intermediate_rxbuffer_memory() + * + * + * Arguments: + * + * info pointer to device instance data + * + * Return Value: None + */ +void mgsl_free_intermediate_rxbuffer_memory(struct mgsl_struct *info) +{ + if ( info->intermediate_rxbuffer ) + kfree_s( info->intermediate_rxbuffer, info->max_frame_size); + + info->intermediate_rxbuffer = NULL; + +} /* end of mgsl_free_intermediate_rxbuffer_memory() */ + /* mgsl_claim_resources() * * Claim all resources used by a device @@ -4256,6 +4361,7 @@ void mgsl_release_resources(struct mgsl_struct *info) info->dma_requested = 0; } mgsl_free_dma_buffers(info); + mgsl_free_intermediate_rxbuffer_memory(info); if ( info->io_addr_requested ) { release_region(info->io_base,info->io_addr_size); @@ -4303,13 +4409,20 @@ void mgsl_add_device( struct mgsl_struct *info ) current_dev->next_device = info; } + if ( info->max_frame_size < 4096 ) + info->max_frame_size = 4096; + else if ( info->max_frame_size > 65535 ) + info->max_frame_size = 65535; + if ( info->bus_type == MGSL_BUS_TYPE_PCI ) { - printk( "SyncLink device %s added:PCI bus IO=%04X IRQ=%d Mem=%08X LCR=%08X\n", + printk( "SyncLink device %s added:PCI bus IO=%04X IRQ=%d Mem=%08X LCR=%08X MaxFrameSize=%u\n", info->device_name, info->io_base, info->irq_level, - info->phys_memory_base, info->phys_lcr_base ); + info->phys_memory_base, info->phys_lcr_base, + info->max_frame_size ); } else { - printk( "SyncLink device %s added:ISA bus IO=%04X IRQ=%d DMA=%d\n", - info->device_name, info->io_base, info->irq_level, info->dma_level ); + printk( "SyncLink device %s added:ISA bus IO=%04X IRQ=%d DMA=%d MaxFrameSize=%u\n", + info->device_name, info->io_base, info->irq_level, info->dma_level, + info->max_frame_size ); } } /* end of mgsl_add_device() */ @@ -4318,7 +4431,7 @@ void mgsl_add_device( struct mgsl_struct *info ) * * Allocate and initialize a device instance structure * - * Arguments: None + * Arguments: none * Return Value: pointer to mgsl_struct if success, otherwise NULL */ struct mgsl_struct* mgsl_allocate_device() @@ -4339,6 +4452,10 @@ struct mgsl_struct* mgsl_allocate_device() info->max_frame_size = 4096; info->close_delay = 5*HZ/10; info->closing_wait = 30*HZ; + init_waitqueue_head(&info->open_wait); + init_waitqueue_head(&info->close_wait); + init_waitqueue_head(&info->status_event_wait_q); + init_waitqueue_head(&info->event_wait_q); memcpy(&info->params,&default_params,sizeof(MGSL_PARAMS)); info->idle_mode = HDLC_TXIDLE_FLAGS; @@ -4360,6 +4477,7 @@ int mgsl_enumerate_devices() { struct mgsl_struct *info; int i; + int num_devices = 0; /* Check for user specified ISA devices */ @@ -4389,9 +4507,16 @@ int mgsl_enumerate_devices() info->bus_type = MGSL_BUS_TYPE_ISA; info->io_addr_size = 16; info->irq_flags = 0; + + /* override default max frame size if arg available */ + if ( num_devices < MAX_TOTAL_DEVICES && + maxframe[num_devices] ) + info->max_frame_size = maxframe[num_devices]; /* add new device to device list */ mgsl_add_device( info ); + + ++num_devices; } @@ -4476,6 +4601,11 @@ int mgsl_enumerate_devices() info->irq_flags = SA_SHIRQ; info->bus = bus; info->function = func; + + /* override default max frame size if arg available */ + if ( num_devices < MAX_TOTAL_DEVICES && + maxframe[num_devices] ) + info->max_frame_size = maxframe[num_devices]; /* Store the PCI9050 misc control register value because a flaw * in the PCI9050 prevents LCR registers from being read if @@ -4858,6 +4988,24 @@ u16 usc_InReg( struct mgsl_struct *info, u16 RegAddr ) void usc_set_sdlc_mode( struct mgsl_struct *info ) { u16 RegValue; + int PreSL1660; + + /* + * determine if the IUSC on the adapter is pre-SL1660. If + * not, take advantage of the UnderWait feature of more + * modern chips. If an underrun occurs and this bit is set, + * the transmitter will idle the programmed idle pattern + * until the driver has time to service the underrun. Otherwise, + * the dma controller may get the cycles previously requested + * and begin transmitting queued tx data. + */ + usc_OutReg(info,TMCR,0x1f); + RegValue=usc_InReg(info,TMDR); + if ( RegValue == IUSC_PRE_SL1660 ) + PreSL1660 = 1; + else + PreSL1660 = 0; + if ( info->params.flags & HDLC_FLAG_HDLC_LOOPMODE ) { @@ -4949,6 +5097,8 @@ void usc_set_sdlc_mode( struct mgsl_struct *info ) if ( info->params.crc_type == HDLC_CRC_16_CCITT ) RegValue |= BIT9; + else if ( info->params.crc_type == HDLC_CRC_32_CCITT ) + RegValue |= ( BIT12 | BIT10 | BIT9 ); usc_OutReg( info, RMR, RegValue ); @@ -5024,6 +5174,8 @@ void usc_set_sdlc_mode( struct mgsl_struct *info ) if ( info->params.crc_type == HDLC_CRC_16_CCITT ) RegValue |= BIT9 + BIT8; + else if ( info->params.crc_type == HDLC_CRC_32_CCITT ) + RegValue |= ( BIT12 | BIT10 | BIT9 | BIT8); usc_OutReg( info, TMR, RegValue ); @@ -5055,6 +5207,30 @@ void usc_set_sdlc_mode( struct mgsl_struct *info ) usc_UnlatchTxstatusBits( info, TXSTATUS_ALL ); usc_ClearIrqPendingBits( info, TRANSMIT_STATUS ); + /* + ** Transmit Command/Status Register (TCSR) + ** + ** <15..12> 0000 TCmd + ** <11> 0/1 UnderWait + ** <10..08> 000 TxIdle + ** <7> x PreSent + ** <6> x IdleSent + ** <5> x AbortSent + ** <4> x EOF/EOM Sent + ** <3> x CRC Sent + ** <2> x All Sent + ** <1> x TxUnder + ** <0> x TxEmpty + ** + ** 0000 0000 0000 0000 = 0x0000 + */ + info->tcsr_value = 0; + + if ( !PreSL1660 ) + info->tcsr_value |= TCSR_UNDERWAIT; + + usc_OutReg( info, TCSR, info->tcsr_value ); + /* Clock mode Control Register (CMCR) * * <15..14> 00 counter 1 Source = Disabled @@ -5470,6 +5646,152 @@ void usc_enable_aux_clock( struct mgsl_struct *info, u32 data_rate ) } /* end of usc_enable_aux_clock() */ +/* + * + * usc_process_rxoverrun_sync() + * + * This function processes a receive overrun by resetting the + * receive DMA buffers and issuing a Purge Rx FIFO command + * to allow the receiver to continue receiving. + * + * Arguments: + * + * info pointer to device extension + * + * Return Value: None + */ +void usc_process_rxoverrun_sync( struct mgsl_struct *info ) +{ + int start_index; + int end_index; + int frame_start_index; + int start_of_frame_found = FALSE; + int end_of_frame_found = FALSE; + int reprogram_dma = FALSE; + + DMABUFFERENTRY *buffer_list = info->rx_buffer_list; + u32 phys_addr; + + usc_DmaCmd( info, DmaCmd_PauseRxChannel ); + usc_RCmd( info, RCmd_EnterHuntmode ); + usc_RTCmd( info, RTCmd_PurgeRxFifo ); + + /* CurrentRxBuffer points to the 1st buffer of the next */ + /* possibly available receive frame. */ + + frame_start_index = start_index = end_index = info->current_rx_buffer; + + /* Search for an unfinished string of buffers. This means */ + /* that a receive frame started (at least one buffer with */ + /* count set to zero) but there is no terminiting buffer */ + /* (status set to non-zero). */ + + while( !buffer_list[end_index].count ) + { + /* Count field has been reset to zero by 16C32. */ + /* This buffer is currently in use. */ + + if ( !start_of_frame_found ) + { + start_of_frame_found = TRUE; + frame_start_index = end_index; + end_of_frame_found = FALSE; + } + + if ( buffer_list[end_index].status ) + { + /* Status field has been set by 16C32. */ + /* This is the last buffer of a received frame. */ + + /* We want to leave the buffers for this frame intact. */ + /* Move on to next possible frame. */ + + start_of_frame_found = FALSE; + end_of_frame_found = TRUE; + } + + /* advance to next buffer entry in linked list */ + end_index++; + if ( end_index == info->rx_buffer_count ) + end_index = 0; + + if ( start_index == end_index ) + { + /* The entire list has been searched with all Counts == 0 and */ + /* all Status == 0. The receive buffers are */ + /* completely screwed, reset all receive buffers! */ + mgsl_reset_rx_dma_buffers( info ); + frame_start_index = 0; + start_of_frame_found = FALSE; + reprogram_dma = TRUE; + break; + } + } + + if ( start_of_frame_found && !end_of_frame_found ) + { + /* There is an unfinished string of receive DMA buffers */ + /* as a result of the receiver overrun. */ + + /* Reset the buffers for the unfinished frame */ + /* and reprogram the receive DMA controller to start */ + /* at the 1st buffer of unfinished frame. */ + + start_index = frame_start_index; + + do + { + *((unsigned long *)&(info->rx_buffer_list[start_index++].count)) = DMABUFFERSIZE; + + /* Adjust index for wrap around. */ + if ( start_index == info->rx_buffer_count ) + start_index = 0; + + } while( start_index != end_index ); + + reprogram_dma = TRUE; + } + + if ( reprogram_dma ) + { + usc_UnlatchRxstatusBits(info,RXSTATUS_ALL); + usc_ClearIrqPendingBits(info, RECEIVE_DATA|RECEIVE_STATUS); + usc_UnlatchRxstatusBits(info, RECEIVE_DATA|RECEIVE_STATUS); + + usc_EnableReceiver(info,DISABLE_UNCONDITIONAL); + + /* This empties the receive FIFO and loads the RCC with RCLR */ + usc_OutReg( info, CCSR, (u16)(usc_InReg(info,CCSR) | BIT13) ); + + /* program 16C32 with physical address of 1st DMA buffer entry */ + phys_addr = info->rx_buffer_list[frame_start_index].phys_entry; + usc_OutDmaReg( info, NRARL, (u16)phys_addr ); + usc_OutDmaReg( info, NRARU, (u16)(phys_addr >> 16) ); + + usc_UnlatchRxstatusBits( info, RXSTATUS_ALL ); + usc_ClearIrqPendingBits( info, RECEIVE_DATA + RECEIVE_STATUS ); + usc_EnableInterrupts( info, RECEIVE_STATUS ); + + /* 1. Arm End of Buffer (EOB) Receive DMA Interrupt (BIT2 of RDIAR) */ + /* 2. Enable Receive DMA Interrupts (BIT1 of DICR) */ + + usc_OutDmaReg( info, RDIAR, BIT3 + BIT2 ); + usc_OutDmaReg( info, DICR, (u16)(usc_InDmaReg(info,DICR) | BIT1) ); + usc_DmaCmd( info, DmaCmd_InitRxChannel ); + if ( info->params.flags & HDLC_FLAG_AUTO_DCD ) + usc_EnableReceiver(info,ENABLE_AUTO_DCD); + else + usc_EnableReceiver(info,ENABLE_UNCONDITIONAL); + } + else + { + /* This empties the receive FIFO and loads the RCC with RCLR */ + usc_OutReg( info, CCSR, (u16)(usc_InReg(info,CCSR) | BIT13) ); + usc_RTCmd( info, RTCmd_PurgeRxFifo ); + } + +} /* end of usc_process_rxoverrun_sync() */ + /* usc_stop_receiver() * * Disable USC receiver @@ -6153,7 +6475,10 @@ void usc_set_txidle( struct mgsl_struct *info ) } info->usc_idle_mode = usc_idle_mode; - usc_OutReg(info, TCSR, usc_idle_mode); + //usc_OutReg(info, TCSR, usc_idle_mode); + info->tcsr_value &= ~IDLEMODE_MASK; /* clear idle mode bits */ + info->tcsr_value += usc_idle_mode; + usc_OutReg(info, TCSR, info->tcsr_value); } /* end of usc_set_txidle() */ @@ -6491,6 +6816,8 @@ int mgsl_get_rx_frame(struct mgsl_struct *info) /* adjust frame size for CRC if any */ if ( info->params.crc_type == HDLC_CRC_16_CCITT ) framesize -= 2; + else if ( info->params.crc_type == HDLC_CRC_32_CCITT ) + framesize -= 4; } if ( debug_level >= DEBUG_LEVEL_BH ) @@ -6499,16 +6826,49 @@ int mgsl_get_rx_frame(struct mgsl_struct *info) if ( debug_level >= DEBUG_LEVEL_DATA ) mgsl_trace_block(info,info->rx_buffer_list[StartIndex].virt_addr, - framesize,0); + MIN(framesize,DMABUFFERSIZE),0); if (framesize) { - if (framesize > HDLC_MAX_FRAME_SIZE) + if (framesize > info->max_frame_size) info->icount.rxlong++; else { +#if 1 + /* + * copy contents of dma frame buffer(s) to intermediate + * rxbuffer for presentation to line discipline + */ + int copy_count = framesize; + int index = StartIndex; + unsigned char *ptmp = info->intermediate_rxbuffer; + + info->icount.rxok++; + + while( copy_count ) + { + int partial_count; + if ( copy_count > DMABUFFERSIZE ) + partial_count = DMABUFFERSIZE; + else + partial_count = copy_count; + + pBufEntry = &(info->rx_buffer_list[index]); + memcpy( ptmp, pBufEntry->virt_addr, partial_count ); + ptmp += partial_count; + copy_count -= partial_count; + + if ( ++index == info->rx_buffer_count ) + index = 0; + + } + + /* Call the line discipline receive callback directly. */ + tty->ldisc.receive_buf(tty, info->intermediate_rxbuffer, info->flag_buf, framesize); +#else info->icount.rxok++; pBufEntry = &(info->rx_buffer_list[StartIndex]); /* Call the line discipline receive callback directly. */ tty->ldisc.receive_buf(tty, pBufEntry->virt_addr, info->flag_buf, framesize); +#endif } } /* Free the buffers used by this frame. */ @@ -6524,8 +6884,8 @@ Cleanup: * receive buffers are now empty, then restart receiver. */ - if ( !info->rx_buffer_list[info->current_rx_buffer].status && - info->rx_buffer_list[info->current_rx_buffer].count ) { + if ( !info->rx_buffer_list[EndIndex].status && + info->rx_buffer_list[EndIndex].count ) { spin_lock_irqsave(&info->irq_spinlock,flags); usc_start_receiver(info); spin_unlock_irqrestore(&info->irq_spinlock,flags); @@ -6556,7 +6916,7 @@ void mgsl_load_tx_dma_buffer(struct mgsl_struct *info, const char *Buffer, DMABUFFERENTRY *pBufEntry; if ( debug_level >= DEBUG_LEVEL_DATA ) - mgsl_trace_block(info,Buffer,BufferSize,1); + mgsl_trace_block(info,Buffer, MIN(BufferSize,DMABUFFERSIZE), 1); if (info->params.flags & HDLC_FLAG_HDLC_LOOPMODE) { /* set CMR:13 to start transmit when @@ -6699,9 +7059,9 @@ BOOLEAN mgsl_irq_test( struct mgsl_struct *info ) EndTime=100; while( EndTime-- && !info->irq_occurred ) { - current->state = TASK_INTERRUPTIBLE; + set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(jiffies_from_ms(10)); - current->state = TASK_RUNNING; + set_current_state(TASK_RUNNING); } spin_lock_irqsave(&info->irq_spinlock,flags); @@ -6881,7 +7241,7 @@ BOOLEAN mgsl_dma_test( struct mgsl_struct *info ) /* unlatch Tx status bits, and start transmit channel. */ - usc_OutReg( info, TCSR, (unsigned short)(( usc_InReg(info, TCSR) & 0x0700) | 0xfa) ); + usc_OutReg( info, TCSR, (unsigned short)(( usc_InReg(info, TCSR) & 0x0f00) | 0xfa) ); usc_DmaCmd( info, DmaCmd_InitTxChannel ); /* wait for DMA controller to fill transmit FIFO */ diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 1bbd618e4de4..97185fc062f4 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -656,23 +656,27 @@ static inline ssize_t do_tty_write( down(&inode->i_sem); return -ERESTARTSYS; } - for (;;) { - unsigned long size = PAGE_SIZE*2; - if (size > count) - size = count; - ret = write(tty, file, buf, size); - if (ret <= 0) - break; - written += ret; - buf += ret; - count -= ret; - if (!count) - break; - ret = -ERESTARTSYS; - if (signal_pending(current)) - break; - if (current->need_resched) - schedule(); + if ( test_bit(TTY_NO_WRITE_SPLIT, &tty->flags) ) + written = write(tty, file, buf, count); + else { + for (;;) { + unsigned long size = PAGE_SIZE*2; + if (size > count) + size = count; + ret = write(tty, file, buf, size); + if (ret <= 0) + break; + written += ret; + buf += ret; + count -= ret; + if (!count) + break; + ret = -ERESTARTSYS; + if (signal_pending(current)) + break; + if (current->need_resched) + schedule(); + } } if (written) { file->f_dentry->d_inode->i_mtime = CURRENT_TIME; diff --git a/drivers/isdn/Config.in b/drivers/isdn/Config.in index 5ad3772819c9..c8d6ab020bdf 100644 --- a/drivers/isdn/Config.in +++ b/drivers/isdn/Config.in @@ -51,8 +51,9 @@ if [ "$CONFIG_ISDN_DRV_HISAX" != "n" ]; then bool 'HiSax Support for Telekom A4T card' CONFIG_HISAX_BKM_A4T bool 'HiSax Support for Scitel Quadro card' CONFIG_HISAX_SCT_QUADRO bool 'HiSax Support for Gazel cards' CONFIG_HISAX_GAZEL + bool 'HiSax Support for HFC PCI-Bus cards' CONFIG_HISAX_HFC_PCI if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then - bool 'HiSax Support for HFC PCI-Bus cards (EXPERIMENTAL)' CONFIG_HISAX_HFC_PCI + bool 'HiSax Support for Winbond W6692 based cards (EXPERIMENTAL)' CONFIG_HISAX_W6692 # bool 'HiSax Support for TESTEMULATOR (EXPERIMENTAL)' CONFIG_HISAX_TESTEMU if [ "$ARCH" = "sparc" -o "$ARCH" = "sparc64" ]; then bool 'HiSax Support for Am7930' CONFIG_HISAX_AMD7930 @@ -75,4 +76,3 @@ if [ "$CONFIG_ISDN_DRV_AVMB1" != "n" ]; then bool 'AVM B1/M1/M2 PCMCIA support' CONFIG_ISDN_DRV_AVMB1_B1PCMCIA bool 'Verbose reason code reporting (kernel size +=7K)' CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON fi - diff --git a/drivers/isdn/act2000/act2000_isa.c b/drivers/isdn/act2000/act2000_isa.c index 80f06b080813..3b256dcee698 100644 --- a/drivers/isdn/act2000/act2000_isa.c +++ b/drivers/isdn/act2000/act2000_isa.c @@ -1,4 +1,4 @@ -/* $Id: act2000_isa.c,v 1.8 1999/01/05 18:29:25 he Exp $ +/* $Id: act2000_isa.c,v 1.9 1999/09/04 06:20:04 keil Exp $ * * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000 (ISA-Version). * @@ -20,6 +20,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: act2000_isa.c,v $ + * Revision 1.9 1999/09/04 06:20:04 keil + * Changes from kernel set_current_state() + * * Revision 1.8 1999/01/05 18:29:25 he * merged remaining schedule_timeout() changes from 2.1.127 * @@ -412,9 +415,6 @@ isa_send(act2000_card * card) while (skb->len) { if (isa_writeb(card, *(skb->data))) { /* Fifo is full, but more data to send */ -#if 0 - printk(KERN_DEBUG "isa_send: %d bytes\n", l); -#endif test_and_clear_bit(ACT2000_LOCK_TX, (void *) &card->ilock); /* Schedule myself */ act2000_schedule_tx(card); @@ -437,9 +437,6 @@ isa_send(act2000_card * card) } else dev_kfree_skb(skb); card->sbuf = NULL; -#if 0 - printk(KERN_DEBUG "isa_send: %d bytes\n", l); -#endif } } diff --git a/drivers/isdn/act2000/capi.c b/drivers/isdn/act2000/capi.c index df2fd68d33a2..9502b314e1c3 100644 --- a/drivers/isdn/act2000/capi.c +++ b/drivers/isdn/act2000/capi.c @@ -113,10 +113,6 @@ static actcapi_msgdsc valid_msg[] = { {{ 0x84, 0x03}, "DISCONNECT_B3_RESP"}, {{ 0x86, 0x03}, "DATA_B3_RESP"}, {{ 0xff, 0x03}, "MANUFACTURER_RESP"}, -#if 0 -/* CAPI 2.0 */ - {{ 0x05, 0x80}, "LISTEN_REQ (CAPI 2.0)"}, -#endif #endif {{ 0x00, 0x00}, NULL}, }; diff --git a/drivers/isdn/act2000/capi.h b/drivers/isdn/act2000/capi.h index 69a1041005ff..0500550db90f 100644 --- a/drivers/isdn/act2000/capi.h +++ b/drivers/isdn/act2000/capi.h @@ -322,19 +322,6 @@ typedef struct actcapi_msg { __u16 plci; __u16 info; } select_b3_protocol_conf; -#if 0 - struct listen_req { - __u32 controller; - __u32 infomask; - __u32 cipmask; - __u32 cipmask2; - __u16 dummy; /* 2 Length-bytes of 2 Structs MUST always be 0!!! */ - } listen_req; - struct listen_conf { - __u32 controller; - __u16 info; - } listen_conf; -#else struct listen_req { __u8 controller; __u32 infomask __attribute__ ((packed)); @@ -345,7 +332,6 @@ typedef struct actcapi_msg { __u8 controller; __u16 info __attribute__ ((packed)); } listen_conf; -#endif struct data_b3_req { __u16 fakencci; __u16 datalen; diff --git a/drivers/isdn/act2000/module.c b/drivers/isdn/act2000/module.c index 2ec5e2fd4132..8304e63cbc38 100644 --- a/drivers/isdn/act2000/module.c +++ b/drivers/isdn/act2000/module.c @@ -701,10 +701,6 @@ act2000_alloccard(int bus, int port, int irq, char *id) card->interface.features = ISDN_FEATURE_L2_X75I | ISDN_FEATURE_L2_HDLC | -#if 0 -/* Not yet! New Firmware is on the way ... */ - ISDN_FEATURE_L2_TRANS | -#endif ISDN_FEATURE_L3_TRANS | ISDN_FEATURE_P_UNKNOWN; card->interface.hl_hdrlen = 20; diff --git a/drivers/isdn/avmb1/avmcard.h b/drivers/isdn/avmb1/avmcard.h index e94c5637cdec..588546a304a5 100644 --- a/drivers/isdn/avmb1/avmcard.h +++ b/drivers/isdn/avmb1/avmcard.h @@ -1,9 +1,14 @@ /* - * $Id: avmcard.h,v 1.4 1999/08/04 10:10:08 calle Exp $ + * $Id: avmcard.h,v 1.5 1999/09/07 09:02:53 calle Exp $ * * Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: avmcard.h,v $ + * Revision 1.5 1999/09/07 09:02:53 calle + * SETDATA removed. Now inside the kernel the datapart of DATA_B3_REQ and + * DATA_B3_IND is always directly after the CAPI message. The "Data" member + * ist never used inside the kernel. + * * Revision 1.4 1999/08/04 10:10:08 calle * Bugfix: corrected /proc functions, added structure for new AVM cards. * @@ -94,7 +99,7 @@ typedef struct avmcard { int interrupt; void *mbase; - __u32 csr; + volatile __u32 csr; avmcard_dmainfo *dma; struct capi_ctr *ctrl; diff --git a/drivers/isdn/avmb1/b1.c b/drivers/isdn/avmb1/b1.c index 620a2aa6e336..fd12bad56099 100644 --- a/drivers/isdn/avmb1/b1.c +++ b/drivers/isdn/avmb1/b1.c @@ -1,11 +1,22 @@ /* - * $Id: b1.c,v 1.7 1999/08/04 10:10:09 calle Exp $ + * $Id: b1.c,v 1.9 1999/09/07 09:02:53 calle Exp $ * * Common module for AVM B1 cards. * * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: b1.c,v $ + * Revision 1.9 1999/09/07 09:02:53 calle + * SETDATA removed. Now inside the kernel the datapart of DATA_B3_REQ and + * DATA_B3_IND is always directly after the CAPI message. The "Data" member + * ist never used inside the kernel. + * + * Revision 1.8 1999/08/22 20:26:22 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * * Revision 1.7 1999/08/04 10:10:09 calle * Bugfix: corrected /proc functions, added structure for new AVM cards. * @@ -47,7 +58,6 @@ * */ -#include #include #include #include @@ -57,13 +67,13 @@ #include #include #include -#include +#include #include "capilli.h" #include "avmcard.h" #include "capicmd.h" #include "capiutil.h" -static char *revision = "$Revision: 1.7 $"; +static char *revision = "$Revision: 1.9 $"; /* ------------------------------------------------------------- */ @@ -482,7 +492,6 @@ void b1_handle_interrupt(avmcard * card) } else { memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen); memcpy(skb_put(skb, DataB3Len), card->databuf, DataB3Len); - CAPIMSG_SETDATA(skb->data, skb->data + MsgLen); ctrl->handle_capimsg(ctrl, ApplId, skb); } break; diff --git a/drivers/isdn/avmb1/b1isa.c b/drivers/isdn/avmb1/b1isa.c index 9b4c47d43671..030dddac44e0 100644 --- a/drivers/isdn/avmb1/b1isa.c +++ b/drivers/isdn/avmb1/b1isa.c @@ -1,11 +1,17 @@ /* - * $Id: b1isa.c,v 1.3 1999/07/09 15:05:40 keil Exp $ + * $Id: b1isa.c,v 1.4 1999/08/22 20:26:24 calle Exp $ * * Module for AVM B1 ISA-card. * * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: b1isa.c,v $ + * Revision 1.4 1999/08/22 20:26:24 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * * Revision 1.3 1999/07/09 15:05:40 keil * compat.h is now isdn_compat.h * @@ -34,7 +40,6 @@ * */ -#include #include #include #include @@ -44,13 +49,12 @@ #include #include #include -#include #include "capicmd.h" #include "capiutil.h" #include "capilli.h" #include "avmcard.h" -static char *revision = "$Revision: 1.3 $"; +static char *revision = "$Revision: 1.4 $"; /* ------------------------------------------------------------- */ diff --git a/drivers/isdn/avmb1/b1pci.c b/drivers/isdn/avmb1/b1pci.c index 8c0006a78bf5..b2d9fc4210d5 100644 --- a/drivers/isdn/avmb1/b1pci.c +++ b/drivers/isdn/avmb1/b1pci.c @@ -51,7 +51,6 @@ #include #include #include -#include #include "capicmd.h" #include "capiutil.h" #include "capilli.h" @@ -252,7 +251,7 @@ int b1pci_init(void) while ((dev = pci_find_device(PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_B1, dev))) { struct capicardparams param; - param.port = get_pcibase(dev, 1) & PCI_BASE_ADDRESS_IO_MASK; + param.port = dev->base_address[ 1] & PCI_BASE_ADDRESS_IO_MASK; param.irq = dev->irq; printk(KERN_INFO "%s: PCI BIOS reports AVM-B1 at i/o %#x, irq %d\n", diff --git a/drivers/isdn/avmb1/b1pcmcia.c b/drivers/isdn/avmb1/b1pcmcia.c index ff7629cb0f71..b7bdb5404498 100644 --- a/drivers/isdn/avmb1/b1pcmcia.c +++ b/drivers/isdn/avmb1/b1pcmcia.c @@ -1,11 +1,17 @@ /* - * $Id: b1pcmcia.c,v 1.3 1999/07/09 15:05:41 keil Exp $ + * $Id: b1pcmcia.c,v 1.4 1999/08/22 20:26:26 calle Exp $ * * Module for AVM B1/M1/M2 PCMCIA-card. * * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: b1pcmcia.c,v $ + * Revision 1.4 1999/08/22 20:26:26 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * * Revision 1.3 1999/07/09 15:05:41 keil * compat.h is now isdn_compat.h * @@ -34,7 +40,6 @@ * */ -#include #include #include #include @@ -45,13 +50,12 @@ #include #include #include -#include #include "capicmd.h" #include "capiutil.h" #include "capilli.h" #include "avmcard.h" -static char *revision = "$Revision: 1.3 $"; +static char *revision = "$Revision: 1.4 $"; /* ------------------------------------------------------------- */ diff --git a/drivers/isdn/avmb1/capi.c b/drivers/isdn/avmb1/capi.c index c8cab69193e0..2fb1b6cbb37c 100644 --- a/drivers/isdn/avmb1/capi.c +++ b/drivers/isdn/avmb1/capi.c @@ -1,11 +1,20 @@ /* - * $Id: capi.c,v 1.19 1999/07/09 15:05:42 keil Exp $ + * $Id: capi.c,v 1.21 1999/09/10 17:24:18 calle Exp $ * * CAPI 2.0 Interface for Linux * * Copyright 1996 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: capi.c,v $ + * Revision 1.21 1999/09/10 17:24:18 calle + * Changes for proposed standard for CAPI2.0: + * - AK148 "Linux Exention" + * + * Revision 1.20 1999/09/07 09:02:53 calle + * SETDATA removed. Now inside the kernel the datapart of DATA_B3_REQ and + * DATA_B3_IND is always directly after the CAPI message. The "Data" member + * ist never used inside the kernel. + * * Revision 1.19 1999/07/09 15:05:42 keil * compat.h is now isdn_compat.h * @@ -117,7 +126,6 @@ #include #include -#include #include "capiutil.h" #include "capicmd.h" #include "capidev.h" @@ -201,9 +209,6 @@ static ssize_t capi_read(struct file *file, char *buf, skb_queue_head(&cdev->recv_queue, skb); return -EMSGSIZE; } - if (CAPIMSG_COMMAND(skb->data) == CAPI_DATA_B3 - && CAPIMSG_SUBCOMMAND(skb->data) == CAPI_IND) - CAPIMSG_SETDATA(skb->data, buf + CAPIMSG_LEN(skb->data)); retval = copy_to_user(buf, skb->data, skb->len); if (retval) { skb_queue_head(&cdev->recv_queue, skb); @@ -429,7 +434,7 @@ static int capi_ioctl(struct inode *inode, struct file *file, return data.errcode; case CAPI_INSTALLED: - if ((*capifuncs->capi_installed) ()) + if ((*capifuncs->capi_isinstalled)() == CAPI_NOERROR) return 0; return -ENXIO; @@ -615,16 +620,8 @@ static struct capi_interface_user cuser = { int capi_init(void) { -#ifdef COMPAT_HAS_NEW_WAITQ - int j; -#endif memset(capidevs, 0, sizeof(capidevs)); -#ifdef COMPAT_HAS_NEW_WAITQ - for ( j = 0; j < CAPI_MAXMINOR+1; j++ ) { - init_waitqueue_head(&capidevs[j].recv_wait); - } -#endif if (register_chrdev(capi_major, "capi20", &capi_fops)) { printk(KERN_ERR "capi20: unable to get major %d\n", capi_major); diff --git a/drivers/isdn/avmb1/capidev.h b/drivers/isdn/avmb1/capidev.h index c66554a2979e..1bc55bdff0a4 100644 --- a/drivers/isdn/avmb1/capidev.h +++ b/drivers/isdn/avmb1/capidev.h @@ -44,11 +44,7 @@ struct capidev { int is_registered; __u16 applid; struct sk_buff_head recv_queue; -#ifdef COMPAT_HAS_NEW_WAITQ - wait_queue_head_t recv_wait; -#else struct wait_queue *recv_wait; -#endif __u16 errcode; /* Statistic */ unsigned long nopen; diff --git a/drivers/isdn/avmb1/capidrv.c b/drivers/isdn/avmb1/capidrv.c index fb83e52a6e06..f53ffeeae1e6 100644 --- a/drivers/isdn/avmb1/capidrv.c +++ b/drivers/isdn/avmb1/capidrv.c @@ -158,7 +158,6 @@ #include #include -#include #include "capiutil.h" #include "capicmd.h" #include "capidrv.h" @@ -2022,10 +2021,8 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb) (void)capidrv_del_ack(nccip, datahandle); return 0; } -#if 1 printk(KERN_DEBUG "capidrv-%d: only %d bytes headroom, need %d\n", card->contrnr, skb_headroom(skb), msglen); -#endif memcpy(skb_push(nskb, msglen), sendcmsg.buf, msglen); errcode = (*capifuncs->capi_put_message) (global.appid, nskb); if (errcode == CAPI_NOERROR) { @@ -2211,10 +2208,6 @@ static int capidrv_addcontr(__u16 contr, struct capi_profile *profp) ISDN_FEATURE_L2_V11096 | ISDN_FEATURE_L2_V11019 | ISDN_FEATURE_L2_V11038 | -#if 0 - ISDN_FEATURE_L2_FAX | - ISDN_FEATURE_L3_FAX | -#endif ISDN_FEATURE_P_UNKNOWN; card->interface.hl_hdrlen = 22; /* len of DATA_B3_REQ */ strncpy(card->interface.id, id, sizeof(card->interface.id) - 1); diff --git a/drivers/isdn/avmb1/capiutil.c b/drivers/isdn/avmb1/capiutil.c index 7f1a9f1adfa5..3482f2a97cbd 100644 --- a/drivers/isdn/avmb1/capiutil.c +++ b/drivers/isdn/avmb1/capiutil.c @@ -1,5 +1,5 @@ /* - * $Id: capiutil.c,v 1.9 1999/07/09 15:05:46 keil Exp $ + * $Id: capiutil.c,v 1.10 1999/08/31 11:19:54 paul Exp $ * * CAPI 2.0 convert capi message to capi message struct * @@ -7,6 +7,9 @@ * Rewritten for Linux 1996 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: capiutil.c,v $ + * Revision 1.10 1999/08/31 11:19:54 paul + * various spelling corrections (new checksums may be needed, Karsten!) + * * Revision 1.9 1999/07/09 15:05:46 keil * compat.h is now isdn_compat.h * @@ -70,7 +73,6 @@ #include #include -#include #include "capiutil.h" /* from CAPI2.0 DDK AVM Berlin GmbH */ @@ -97,7 +99,7 @@ char *capi_info2str(__u16 reason) case 0x1001: return "Too many applications"; case 0x1002: - return "Logical block size to small, must be at least 128 Bytes"; + return "Logical block size too small, must be at least 128 Bytes"; case 0x1003: return "Buffer exceeds 64 kByte"; case 0x1004: diff --git a/drivers/isdn/avmb1/capiutil.h b/drivers/isdn/avmb1/capiutil.h index 38209212dbd9..54ca5f50f17c 100644 --- a/drivers/isdn/avmb1/capiutil.h +++ b/drivers/isdn/avmb1/capiutil.h @@ -1,5 +1,5 @@ /* - * $Id: capiutil.h,v 1.2 1997/05/18 09:24:19 calle Exp $ + * $Id: capiutil.h,v 1.3 1999/09/07 09:02:53 calle Exp $ * * CAPI 2.0 defines & types * @@ -7,6 +7,11 @@ * Rewritten for Linux 1996 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: capiutil.h,v $ + * Revision 1.3 1999/09/07 09:02:53 calle + * SETDATA removed. Now inside the kernel the datapart of DATA_B3_REQ and + * DATA_B3_IND is always directly after the CAPI message. The "Data" member + * ist never used inside the kernel. + * * Revision 1.2 1997/05/18 09:24:19 calle * added verbose disconnect reason reporting to avmb1. * some fixes in capi20 interface. @@ -45,14 +50,6 @@ ((__u8 *)m)[3] = ((__u16)(applid) >> 8) & 0xff; \ } while (0) -#define CAPIMSG_SETDATA(m, data) \ - do { \ - ((__u8 *)m)[12] = (__u32)(data) & 0xff; \ - ((__u8 *)m)[13] = ((__u32)(data) >> 8) & 0xff; \ - ((__u8 *)m)[14] = ((__u32)(data) >> 16) & 0xff; \ - ((__u8 *)m)[15] = ((__u32)(data) >> 24) & 0xff; \ - } while (0) - /*----- basic-type definitions -----*/ typedef __u8 *_cstruct; diff --git a/drivers/isdn/avmb1/kcapi.c b/drivers/isdn/avmb1/kcapi.c index fc58f12415cb..5caa537cd4df 100644 --- a/drivers/isdn/avmb1/kcapi.c +++ b/drivers/isdn/avmb1/kcapi.c @@ -1,11 +1,18 @@ /* - * $Id: kcapi.c,v 1.6 1999/07/20 06:41:49 calle Exp $ + * $Id: kcapi.c,v 1.8 1999/09/10 17:24:18 calle Exp $ * * Kernel CAPI 2.0 Module * * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: kcapi.c,v $ + * Revision 1.8 1999/09/10 17:24:18 calle + * Changes for proposed standard for CAPI2.0: + * - AK148 "Linux Exention" + * + * Revision 1.7 1999/09/04 06:20:05 keil + * Changes from kernel set_current_state() + * * Revision 1.6 1999/07/20 06:41:49 calle * Bugfix: After the redesign of the AVM B1 driver, the driver didn't even * compile, if not selected as modules. @@ -57,7 +64,7 @@ #include #include #include -#include +#include #include "capicmd.h" #include "capiutil.h" #include "capilli.h" @@ -65,7 +72,7 @@ #include #endif -static char *revision = "$Revision: 1.6 $"; +static char *revision = "$Revision: 1.8 $"; /* ------------------------------------------------------------- */ @@ -119,7 +126,7 @@ struct capi_appl { /* ------------------------------------------------------------- */ static struct capi_version driver_version = {2, 0, 1, 1<<4}; -static char driver_serial[CAPI_SERIAL_LEN] = "4711"; +static char driver_serial[CAPI_SERIAL_LEN] = "0004711"; static char capi_manufakturer[64] = "AVM Berlin"; #define APPL(a) (&applications[(a)-1]) @@ -719,7 +726,7 @@ error: /* -------- Notifier ------------------------------------------ */ -static void notify_up(__u16 contr) +static void notify_up(__u32 contr) { struct capi_interface_user *p; @@ -730,7 +737,7 @@ static void notify_up(__u16 contr) } } -static void notify_down(__u16 contr) +static void notify_down(__u32 contr) { struct capi_interface_user *p; printk(KERN_NOTICE "kcapi: notify down contr %d\n", contr); @@ -742,7 +749,7 @@ static void notify_down(__u16 contr) static void notify_handler(void *dummy) { - __u16 contr; + __u32 contr; for (contr=1; VALID_CARD(contr); contr++) if (test_and_clear_bit(contr, ¬ify_up_set)) @@ -984,14 +991,14 @@ void detach_capi_driver(struct capi_driver *driver) /* -------- CAPI2.0 Interface ---------------------------------- */ /* ------------------------------------------------------------- */ -static int capi_installed(void) +static __u16 capi_isinstalled(void) { int i; for (i = 0; i < CAPI_MAXCONTR; i++) { if (cards[i].cardstate == CARD_RUNNING) - return 1; + return CAPI_NOERROR; } - return 0; + return CAPI_REGNOTINSTALLED; } static __u16 capi_register(capi_register_params * rparam, __u16 * applidp) @@ -1053,7 +1060,7 @@ static __u16 capi_release(__u16 applid) static __u16 capi_put_message(__u16 applid, struct sk_buff *skb) { struct capi_ncci *np; - int contr; + __u32 contr; int showctl = 0; __u8 cmd, subcmd; @@ -1131,53 +1138,53 @@ static __u16 capi_set_signal(__u16 applid, return CAPI_NOERROR; } -static __u16 capi_get_manufacturer(__u16 contr, __u8 buf[CAPI_MANUFACTURER_LEN]) +static __u16 capi_get_manufacturer(__u32 contr, __u8 buf[CAPI_MANUFACTURER_LEN]) { if (contr == 0) { strncpy(buf, capi_manufakturer, CAPI_MANUFACTURER_LEN); return CAPI_NOERROR; } if (!VALID_CARD(contr) || CARD(contr)->cardstate != CARD_RUNNING) - return 0x2002; + return CAPI_REGNOTINSTALLED; strncpy(buf, CARD(contr)->manu, CAPI_MANUFACTURER_LEN); return CAPI_NOERROR; } -static __u16 capi_get_version(__u16 contr, struct capi_version *verp) +static __u16 capi_get_version(__u32 contr, struct capi_version *verp) { if (contr == 0) { *verp = driver_version; return CAPI_NOERROR; } if (!VALID_CARD(contr) || CARD(contr)->cardstate != CARD_RUNNING) - return 0x2002; + return CAPI_REGNOTINSTALLED; memcpy((void *) verp, &CARD(contr)->version, sizeof(capi_version)); return CAPI_NOERROR; } -static __u16 capi_get_serial(__u16 contr, __u8 serial[CAPI_SERIAL_LEN]) +static __u16 capi_get_serial(__u32 contr, __u8 serial[CAPI_SERIAL_LEN]) { if (contr == 0) { strncpy(serial, driver_serial, CAPI_SERIAL_LEN); return CAPI_NOERROR; } if (!VALID_CARD(contr) || CARD(contr)->cardstate != CARD_RUNNING) - return 0x2002; + return CAPI_REGNOTINSTALLED; strncpy((void *) serial, CARD(contr)->serial, CAPI_SERIAL_LEN); return CAPI_NOERROR; } -static __u16 capi_get_profile(__u16 contr, struct capi_profile *profp) +static __u16 capi_get_profile(__u32 contr, struct capi_profile *profp) { if (contr == 0) { profp->ncontroller = ncards; return CAPI_NOERROR; } if (!VALID_CARD(contr) || CARD(contr)->cardstate != CARD_RUNNING) - return 0x2002; + return CAPI_REGNOTINSTALLED; memcpy((void *) profp, &CARD(contr)->profile, sizeof(struct capi_profile)); @@ -1404,7 +1411,7 @@ static int capi_manufacturer(unsigned int cmd, void *data) struct capi_interface avmb1_interface = { - capi_installed, + capi_isinstalled, capi_register, capi_release, capi_put_message, @@ -1479,6 +1486,12 @@ extern int t1isa_init(void); #ifdef CONFIG_ISDN_DRV_AVMB1_B1PCMCIA extern int b1pcmcia_init(void); #endif +#ifdef CONFIG_ISDN_DRV_AVMB1_T1PCI +extern int t1pci_init(void); +#endif +#ifdef CONFIG_ISDN_DRV_AVMB1_C4 +extern int c4_init(void); +#endif #endif /* @@ -1528,6 +1541,12 @@ int kcapi_init(void) #ifdef CONFIG_ISDN_DRV_AVMB1_B1PCMCIA (void)b1pcmcia_init(); #endif +#ifdef CONFIG_ISDN_DRV_AVMB1_T1PCI + (void)t1pci_init(); +#endif +#ifdef CONFIG_ISDN_DRV_AVMB1_C4 + (void)c4_init(); +#endif #endif return 0; } diff --git a/drivers/isdn/avmb1/t1isa.c b/drivers/isdn/avmb1/t1isa.c index eb8c5714918e..8458d8e21cf5 100644 --- a/drivers/isdn/avmb1/t1isa.c +++ b/drivers/isdn/avmb1/t1isa.c @@ -1,11 +1,22 @@ /* - * $Id: t1isa.c,v 1.4 1999/07/09 15:05:50 keil Exp $ + * $Id: t1isa.c,v 1.6 1999/09/07 09:02:53 calle Exp $ * * Module for AVM T1 HEMA-card. * * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: t1isa.c,v $ + * Revision 1.6 1999/09/07 09:02:53 calle + * SETDATA removed. Now inside the kernel the datapart of DATA_B3_REQ and + * DATA_B3_IND is always directly after the CAPI message. The "Data" member + * ist never used inside the kernel. + * + * Revision 1.5 1999/08/22 20:26:28 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * * Revision 1.4 1999/07/09 15:05:50 keil * compat.h is now isdn_compat.h * @@ -38,7 +49,6 @@ * */ -#include #include #include #include @@ -48,13 +58,12 @@ #include #include #include -#include #include "capicmd.h" #include "capiutil.h" #include "capilli.h" #include "avmcard.h" -static char *revision = "$Revision: 1.4 $"; +static char *revision = "$Revision: 1.6 $"; /* ------------------------------------------------------------- */ @@ -184,7 +193,6 @@ static void t1_handle_interrupt(avmcard * card) } else { memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen); memcpy(skb_put(skb, DataB3Len), card->databuf, DataB3Len); - CAPIMSG_SETDATA(skb->data, skb->data + MsgLen); ctrl->handle_capimsg(ctrl, ApplId, skb); } break; diff --git a/drivers/isdn/divert/divert_init.c b/drivers/isdn/divert/divert_init.c index 7ee924993b01..ce44cfa19cd3 100644 --- a/drivers/isdn/divert/divert_init.c +++ b/drivers/isdn/divert/divert_init.c @@ -1,5 +1,5 @@ /* - * $Id: divert_init.c,v 1.3 1999/07/05 20:21:39 werner Exp $ + * $Id: divert_init.c,v 1.4 1999/08/22 20:26:32 calle Exp $ * * Module init for DSS1 diversion services for i4l. * @@ -20,6 +20,12 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: divert_init.c,v $ + * Revision 1.4 1999/08/22 20:26:32 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * * Revision 1.3 1999/07/05 20:21:39 werner * changes to use diversion sources for all kernel versions. * removed static device, only proc filesystem used @@ -31,7 +37,6 @@ * */ -#include #include #include #include "isdn_divert.h" diff --git a/drivers/isdn/divert/divert_procfs.c b/drivers/isdn/divert/divert_procfs.c index 035aa363613a..b17da2313fbb 100644 --- a/drivers/isdn/divert/divert_procfs.c +++ b/drivers/isdn/divert/divert_procfs.c @@ -47,7 +47,6 @@ #include #endif #include -#include #include "isdn_divert.h" /*********************************/ @@ -56,11 +55,7 @@ ulong if_used = 0; /* number of interface users */ static struct divert_info *divert_info_head = NULL; /* head of queue */ static struct divert_info *divert_info_tail = NULL; /* pointer to last entry */ -#ifdef COMPAT_HAS_NEW_WAITQ -static wait_queue_head_t rd_queue; -#else static struct wait_queue *rd_queue = 0; /* Queue IO */ -#endif /*********************************/ /* put an info buffer into queue */ @@ -102,7 +97,7 @@ void put_info_buffer(char *cp) /* deflection device read routine */ /**********************************/ #if (LINUX_VERSION_CODE < 0x020117) -static int isdn_divert_read(struct inode *inode, struct file *file, char *buf, RWARG count) +static int isdn_divert_read(struct inode *inode, struct file *file, char *buf, unsigned long count) #else static ssize_t isdn_divert_read(struct file *file, char *buf, size_t count, loff_t *off) #endif @@ -131,7 +126,7 @@ static ssize_t isdn_divert_read(struct file *file, char *buf, size_t count, loff /* deflection device write routine */ /**********************************/ #if (LINUX_VERSION_CODE < 0x020117) -static int isdn_divert_write(struct inode *inode, struct file *file, const char *buf, RWARG count) +static int isdn_divert_write(struct inode *inode, struct file *file, const char *buf, unsigned long count) #else static ssize_t isdn_divert_write(struct file *file, const char *buf, size_t count, loff_t *off) #endif @@ -302,8 +297,8 @@ static int isdn_divert_ioctl(struct inode *inode, struct file *file, #ifdef CONFIG_PROC_FS #if (LINUX_VERSION_CODE < 0x020117) -static LSTYPE -isdn_divert_lseek(struct inode *inode, struct file *file, LSARG offset, int orig) +static long long +isdn_divert_lseek(struct inode *inode, struct file *file, long long offset, int orig) #else static loff_t isdn_divert_lseek(struct file *file, loff_t offset, int orig) @@ -396,9 +391,6 @@ static int (*proc_unreg)(struct proc_dir_entry *, int) = NULL; int divert_dev_init(void) { int i; -#ifdef COMPAT_HAS_NEW_WAITQ - init_waitqueue_head(&rd_queue); -#endif #ifdef CONFIG_PROC_FS #if (LINUX_VERSION_CODE < 0x020117) diff --git a/drivers/isdn/divert/isdn_divert.c b/drivers/isdn/divert/isdn_divert.c index 7454aa0958be..7079232e7dcf 100644 --- a/drivers/isdn/divert/isdn_divert.c +++ b/drivers/isdn/divert/isdn_divert.c @@ -1,5 +1,5 @@ /* - * $Id: isdn_divert.c,v 1.2 1999/07/04 21:37:32 werner Exp $ + * $Id: isdn_divert.c,v 1.5 1999/08/31 11:20:04 paul Exp $ * * DSS1 main diversion supplementary handling for i4l. * @@ -20,6 +20,19 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: isdn_divert.c,v $ + * Revision 1.5 1999/08/31 11:20:04 paul + * various spelling corrections (new checksums may be needed, Karsten!) + * + * Revision 1.4 1999/08/25 20:02:21 werner + * Changed return values for stat_icall(w) from 3->4 and 4->5 because of conflicts + * with existing software definitions. (PtP incomplete called party number) + * + * Revision 1.3 1999/08/22 20:26:35 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * * Revision 1.2 1999/07/04 21:37:32 werner * Ported from kernel version 2.0 * @@ -29,7 +42,6 @@ -#include #define __NO_VERSION__ #include #include @@ -504,19 +516,19 @@ int isdn_divert_icall(isdn_ctrl *ic) if (cs->akt_state == DEFLECT_ALERT) { strcpy(cs->deflect_dest,dv->rule.to_nr); if (!cs->timer.expires) - { strcpy(ic->parm.setup.eazmsn,"Testtext direkt"); + { strcpy(ic->parm.setup.eazmsn,"Testtext direct"); ic->parm.setup.screen = dv->rule.screen; strcpy(ic->parm.setup.phone,dv->rule.to_nr); cs->akt_state = DEFLECT_AUTODEL; /* delete after timeout */ cs->timer.expires = jiffies + (HZ * AUTODEL_TIME); - retval = 4; + retval = 5; } else retval = 1; /* alerting */ } else { cs->deflect_dest[0] = '\0'; - retval = 3; /* only proceed */ + retval = 4; /* only proceed */ } sprintf(cs->info,"%d 0x%lx %s %s %s %s 0x%x 0x%x %d %d %s\n", cs->akt_state, @@ -760,18 +772,6 @@ int prot_stat_callback(isdn_ctrl *ic) } -#if 0 - sprintf(st, "0x%lx 0x%lx",ic->arg, ic->parm.dss1_io.ll_id); - p = st + strlen(st); - p1 = ic->parm.dss1_io.data; - i = ic->parm.dss1_io.datalen; - while ((i > 0) && (p - st < 530)) - { p += sprintf(p," %02x",(*p1++) & 0xFF); - i--; - } - sprintf(p, "\n"); - put_info_buffer(st); -#endif break; default: diff --git a/drivers/isdn/divert/isdn_divert.h b/drivers/isdn/divert/isdn_divert.h index 7a2b5cf08a8a..6ab119ed9527 100644 --- a/drivers/isdn/divert/isdn_divert.h +++ b/drivers/isdn/divert/isdn_divert.h @@ -1,5 +1,5 @@ /* - * $Id: isdn_divert.h,v 1.2 1999/07/04 21:37:33 werner Exp $ + * $Id: isdn_divert.h,v 1.4 1999/09/02 13:24:12 paul Exp $ * * Header for the diversion supplementary ioctl interface. * @@ -20,16 +20,21 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: isdn_divert.h,v $ - * Revision 1.2 1999/07/04 21:37:33 werner - * Ported from kernel version 2.0 + * Revision 1.4 1999/09/02 13:24:12 paul + * cosmetics; text following #endif is not ANSI C * + * Revision 1.3 1999/08/22 20:26:37 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. * + * Revision 1.2 1999/07/04 21:37:33 werner + * Ported from kernel version 2.0 * */ - -#include #include #include @@ -89,12 +94,12 @@ typedef struct typedef union { int drv_version; /* return of driver version */ struct - { int drvid; /* id of driver */ - char drvnam[30]; /* name of driver */ + { int drvid; /* id of driver */ + char drvnam[30]; /* name of driver */ } getid; struct - { int ruleidx; /* index of rule */ - divert_rule rule; /* rule parms */ + { int ruleidx; /* index of rule */ + divert_rule rule; /* rule parms */ } getsetrule; struct { u_char subcmd; /* 0 = hangup/reject, @@ -120,7 +125,7 @@ typedef union #include #include -#define AUTODEL_TIME 30 /* timeout in s to delete internal entrys */ +#define AUTODEL_TIME 30 /* timeout in s to delete internal entries */ /**************************************************/ /* structure keeping ascii info for device output */ @@ -148,12 +153,4 @@ extern void deleteprocs(void); extern int deflect_extern_action(u_char, ulong, char *); extern int cf_command(int, int, u_char, char *, u_char, char *, ulong *); -#endif __KERNEL__ - - - - - - - - +#endif /* __KERNEL__ */ diff --git a/drivers/isdn/eicon/eicon.h b/drivers/isdn/eicon/eicon.h index 88f408cd148f..e898026d4455 100644 --- a/drivers/isdn/eicon/eicon.h +++ b/drivers/isdn/eicon/eicon.h @@ -1,8 +1,8 @@ -/* $Id: eicon.h,v 1.8 1999/07/25 15:12:01 armin Exp $ +/* $Id: eicon.h,v 1.14 1999/09/08 20:17:31 armin Exp $ * * ISDN low-level module for Eicon.Diehl active ISDN-Cards. * - * Copyright 1998 by Fritz Elfert (fritz@wuemaus.franken.de) + * Copyright 1998 by Fritz Elfert (fritz@isdn4linux.de) * Copyright 1998,99 by Armin Schindler (mac@melware.de) * Copyright 1999 Cytronics & Melware (info@melware.de) * @@ -21,6 +21,29 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: eicon.h,v $ + * Revision 1.14 1999/09/08 20:17:31 armin + * Added microchannel patch from Erik Weber. + * + * Revision 1.13 1999/09/06 07:29:35 fritz + * Changed my mail-address. + * + * Revision 1.12 1999/09/04 06:20:05 keil + * Changes from kernel set_current_state() + * + * Revision 1.11 1999/08/29 17:23:44 armin + * New setup compat. + * Bugfix if compile as not module. + * + * Revision 1.10 1999/08/22 20:26:41 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * + * Revision 1.9 1999/08/18 20:16:57 armin + * Added XLOG function for all cards. + * Bugfix of alloc_skb NULL pointer. + * * Revision 1.8 1999/07/25 15:12:01 armin * fix of some debug logs. * enabled ISA-cards option. @@ -73,6 +96,7 @@ #define EICON_IOCTL_LOADPCI 7 #define EICON_IOCTL_LOADISA 8 #define EICON_IOCTL_GETVER 9 +#define EICON_IOCTL_GETXLOG 10 #define EICON_IOCTL_MANIF 90 @@ -102,6 +126,7 @@ #define MAX_HEADER_LEN 10 + /* Struct for adding new cards */ typedef struct eicon_cdef { int membase; @@ -186,6 +211,7 @@ typedef struct { #ifdef __KERNEL__ /* Kernel includes */ +#include #include #include #include @@ -209,6 +235,7 @@ typedef struct { #include + typedef struct { __u16 length __attribute__ ((packed)); /* length of data/parameter field */ __u8 P[1]; /* data/parameter field */ @@ -224,6 +251,92 @@ typedef struct { #endif /* KERNEL */ +#define DIVAS_SHARED_OFFSET (0x1000) + +#define MIPS_BUFFER_SZ 128 +#define MIPS_MAINT_OFFS 0xff00 + +#define XLOG_ERR_CARD_NUM (13) +#define XLOG_ERR_DONE (14) +#define XLOG_ERR_CMD (15) +#define XLOG_ERR_TIMEOUT (16) +#define XLOG_ERR_CARD_STATE (17) +#define XLOG_ERR_UNKNOWN (18) +#define XLOG_OK (0) + +typedef struct { + __u8 Id __attribute__ ((packed)); + __u8 uX __attribute__ ((packed)); + __u8 listen __attribute__ ((packed)); + __u8 active __attribute__ ((packed)); + __u8 sin[3] __attribute__ ((packed)); + __u8 bc[6] __attribute__ ((packed)); + __u8 llc[6] __attribute__ ((packed)); + __u8 hlc[6] __attribute__ ((packed)); + __u8 oad[20] __attribute__ ((packed)); +}DSigStruc; + +typedef struct { + __u32 cx_b1 __attribute__ ((packed)); + __u32 cx_b2 __attribute__ ((packed)); + __u32 cr_b1 __attribute__ ((packed)); + __u32 cr_b2 __attribute__ ((packed)); + __u32 px_b1 __attribute__ ((packed)); + __u32 px_b2 __attribute__ ((packed)); + __u32 pr_b1 __attribute__ ((packed)); + __u32 pr_b2 __attribute__ ((packed)); + __u16 er_b1 __attribute__ ((packed)); + __u16 er_b2 __attribute__ ((packed)); +}BL1Struc; + +typedef struct { + __u32 XTotal __attribute__ ((packed)); + __u32 RTotal __attribute__ ((packed)); + __u16 XError __attribute__ ((packed)); + __u16 RError __attribute__ ((packed)); +}L2Struc; + +typedef struct { + __u16 free_n; +}OSStruc; + +typedef union +{ + DSigStruc DSigStats; + BL1Struc BL1Stats; + L2Struc L2Stats; + OSStruc OSStats; + __u8 b[MIPS_BUFFER_SZ]; + __u16 w[MIPS_BUFFER_SZ>>1]; + __u16 l[MIPS_BUFFER_SZ>>2]; /* word is wrong, do not use! Use 'd' instead. */ + __u32 d[MIPS_BUFFER_SZ>>2]; +} MIPS_BUFFER; + +typedef struct +{ + __u8 req __attribute__ ((packed)); + __u8 rc __attribute__ ((packed)); + __u8 reserved[2] __attribute__ ((packed)); /* R3000 alignment ... */ + __u8 *mem __attribute__ ((packed)); + __u16 length __attribute__ ((packed)); /* used to be short */ + __u16 port __attribute__ ((packed)); + __u8 fill[4] __attribute__ ((packed)); /* data at offset 16 */ + MIPS_BUFFER data __attribute__ ((packed)); +} mi_pc_maint_t; + +typedef struct +{ + __u16 command; + mi_pc_maint_t pcm; +}xlogreq_t; + +typedef struct{ + __u16 code __attribute__ ((packed)); /* used to be short */ + __u16 timeh __attribute__ ((packed)); + __u16 timel __attribute__ ((packed)); + char buffer[MIPS_BUFFER_SZ - 6]; +}xlog_entry_t; + #define DSP_COMBIFILE_FORMAT_IDENTIFICATION_SIZE 48 #define DSP_COMBIFILE_FORMAT_VERSION_BCD 0x0100 @@ -497,8 +610,9 @@ typedef struct eicon_card { isdn_if interface; /* Interface to upper layer */ char regname[35]; /* Name used for request_region */ #ifdef CONFIG_MCA - int mca_slot; /* # of cards MCA slot */ -#endif + int mca_slot; /* # of cards MCA slot */ + int mca_io; /* MCA cards IO port */ +#endif /* CONFIG_MCA */ } eicon_card; /* -----------------------------------------------------------** @@ -555,6 +669,7 @@ extern void eicon_io_transmit(eicon_card *card); extern void eicon_irq(int irq, void *dev_id, struct pt_regs *regs); extern void eicon_io_rcv_dispatch(eicon_card *ccard); extern void eicon_io_ack_dispatch(eicon_card *ccard); +extern int eicon_get_xlog(eicon_card *card, xlogreq_t *xlogreq); #ifdef CONFIG_MCA extern int eicon_mca_find_card(int, int, int, char *); extern int eicon_mca_probe(int, int, int, int, char *); diff --git a/drivers/isdn/eicon/eicon_idi.c b/drivers/isdn/eicon/eicon_idi.c index 412eb46ba9d1..50820afed062 100644 --- a/drivers/isdn/eicon/eicon_idi.c +++ b/drivers/isdn/eicon/eicon_idi.c @@ -1,4 +1,4 @@ -/* $Id: eicon_idi.c,v 1.11 1999/07/25 15:12:03 armin Exp $ +/* $Id: eicon_idi.c,v 1.18 1999/09/07 12:48:05 armin Exp $ * * ISDN lowlevel-module for Eicon.Diehl active cards. * IDI interface @@ -21,6 +21,33 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: eicon_idi.c,v $ + * Revision 1.18 1999/09/07 12:48:05 armin + * Prepared for sub-address usage. + * + * Revision 1.17 1999/09/07 12:35:39 armin + * Better checking and channel Id handling. + * + * Revision 1.16 1999/09/04 13:44:19 armin + * Fix of V.42 analog Modem negotiation handling. + * + * Revision 1.15 1999/08/28 21:32:50 armin + * Prepared for fax related functions. + * Now compilable without errors/warnings. + * + * Revision 1.14 1999/08/28 20:24:40 armin + * Corrected octet 3/3a in CPN/OAD information element. + * Thanks to John Simpson + * + * Revision 1.13 1999/08/22 20:26:44 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * + * Revision 1.12 1999/08/18 20:16:59 armin + * Added XLOG function for all cards. + * Bugfix of alloc_skb NULL pointer. + * * Revision 1.11 1999/07/25 15:12:03 armin * fix of some debug logs. * enabled ISA-cards option. @@ -70,6 +97,7 @@ * */ +#include #define __NO_VERSION__ #include "eicon.h" #include "eicon_idi.h" @@ -77,7 +105,7 @@ #undef EICON_FULL_SERVICE_OKTETT -char *eicon_idi_revision = "$Revision: 1.11 $"; +char *eicon_idi_revision = "$Revision: 1.18 $"; eicon_manifbuf *manbuf; @@ -143,9 +171,14 @@ idi_assign_req(eicon_REQ *reqbuf, int signet, eicon_chan *chan) reqbuf->XBuffer.P[l++] = 5; break; case ISDN_PROTO_L2_TRANS: - case ISDN_PROTO_L2_MODEM: reqbuf->XBuffer.P[l++] = 2; break; + case ISDN_PROTO_L2_MODEM: + if (chan->fsm_state == EICON_STATE_IWAIT) + reqbuf->XBuffer.P[l++] = 9; /* V.42 incoming */ + else + reqbuf->XBuffer.P[l++] = 10; /* V.42 */ + break; case ISDN_PROTO_L2_FAX: if (chan->fsm_state == EICON_STATE_IWAIT) reqbuf->XBuffer.P[l++] = 3; /* autoconnect on incoming */ @@ -264,8 +297,8 @@ idi_call_res_req(eicon_REQ *reqbuf, eicon_chan *chan) int idi_do_req(eicon_card *card, eicon_chan *chan, int cmd, int layer) { - struct sk_buff *skb = 0; - struct sk_buff *skb2 = 0; + struct sk_buff *skb; + struct sk_buff *skb2; eicon_REQ *reqbuf; eicon_chan_ptr *chan2; @@ -415,10 +448,19 @@ idi_hangup(eicon_card *card, eicon_chan *chan) int idi_connect_res(eicon_card *card, eicon_chan *chan) { - chan->fsm_state = EICON_STATE_IWAIT; - idi_do_req(card, chan, CALL_RES, 0); - idi_do_req(card, chan, ASSIGN, 1); - return(0); + chan->fsm_state = EICON_STATE_IWAIT; + idi_do_req(card, chan, CALL_RES, 0); + + /* check if old NetID has been removed */ + if (chan->e.B2Id) { + if (DebugVar & 1) + printk(KERN_WARNING "idi_err: Ch%d: Old NetID %x was not removed.\n", + chan->No, chan->e.B2Id); + idi_do_req(card, chan, REMOVE, 1); + } + + idi_do_req(card, chan, ASSIGN, 1); + return(0); } int @@ -428,6 +470,7 @@ idi_connect_req(eicon_card *card, eicon_chan *chan, char *phone, int l = 0; int i; unsigned char tmp; + unsigned char *sub, *sp; unsigned char bc[5]; unsigned char hlc[5]; struct sk_buff *skb; @@ -456,18 +499,52 @@ idi_connect_req(eicon_card *card, eicon_chan *chan, char *phone, reqbuf->ReqCh = 0; reqbuf->ReqId = 1; + sub = NULL; + sp = phone; + while (*sp) { + if (*sp == '.') { + sub = sp + 1; + *sp = 0; + } else + sp++; + } reqbuf->XBuffer.P[l++] = CPN; reqbuf->XBuffer.P[l++] = strlen(phone) + 1; - reqbuf->XBuffer.P[l++] = 0xc1; + reqbuf->XBuffer.P[l++] = 0x81; for(i=0; iXBuffer.P[l++] = phone[i]; + reqbuf->XBuffer.P[l++] = phone[i] & 0x7f; + if (sub) { + reqbuf->XBuffer.P[l++] = DSA; + reqbuf->XBuffer.P[l++] = strlen(sub) + 2; + reqbuf->XBuffer.P[l++] = 0x80; /* NSAP coded */ + reqbuf->XBuffer.P[l++] = 0x50; /* local IDI format */ + while (*sub) + reqbuf->XBuffer.P[l++] = *sub++ & 0x7f; + } + sub = NULL; + sp = eazmsn; + while (*sp) { + if (*sp == '.') { + sub = sp + 1; + *sp = 0; + } else + sp++; + } reqbuf->XBuffer.P[l++] = OAD; reqbuf->XBuffer.P[l++] = strlen(eazmsn) + 2; reqbuf->XBuffer.P[l++] = 0x01; - reqbuf->XBuffer.P[l++] = 0x81; + reqbuf->XBuffer.P[l++] = 0x80; for(i=0; iXBuffer.P[l++] = eazmsn[i]; + reqbuf->XBuffer.P[l++] = eazmsn[i] & 0x7f; + if (sub) { + reqbuf->XBuffer.P[l++] = OSA; + reqbuf->XBuffer.P[l++] = strlen(sub) + 2; + reqbuf->XBuffer.P[l++] = 0x80; /* NSAP coded */ + reqbuf->XBuffer.P[l++] = 0x50; /* local IDI format */ + while (*sub) + reqbuf->XBuffer.P[l++] = *sub++ & 0x7f; + } if ((tmp = idi_si2bc(si1, si2, bc, hlc)) > 0) { reqbuf->XBuffer.P[l++] = BC; @@ -481,6 +558,7 @@ idi_connect_req(eicon_card *card, eicon_chan *chan, char *phone, reqbuf->XBuffer.P[l++] = hlc[i]; } } + reqbuf->XBuffer.P[l++] = CAI; reqbuf->XBuffer.P[l++] = 6; reqbuf->XBuffer.P[l++] = 0x09; @@ -641,15 +719,15 @@ idi_IndParse(eicon_card *ccard, eicon_chan *chan, idi_ind_message *message, unsi (__u8)message->cpn[0], message->cpn + 1); break; case DSA: - pos++; - for(i=0; i < wlen-1; i++) + pos += 2; + for(i=0; i < wlen-2; i++) message->dsa[i] = buffer[pos++]; if (DebugVar & 2) printk(KERN_DEBUG"idi_inf: Ch%d: DSA=%s\n", chan->No, message->dsa); break; case OSA: - pos++; - for(i=0; i < wlen-1; i++) + pos += 2; + for(i=0; i < wlen-2; i++) message->osa[i] = buffer[pos++]; if (DebugVar & 2) printk(KERN_DEBUG"idi_inf: Ch%d: OSA=%s\n", chan->No, message->osa); @@ -882,6 +960,120 @@ idi_bc2si(unsigned char *bc, unsigned char *hlc, unsigned char *si1, unsigned ch } } +/********************* FAX stuff ***************************/ + +#ifdef CONFIG_ISDN_TTY_FAX + +int +idi_fill_in_T30(eicon_chan *chan, unsigned char *buffer) +{ + + /* TODO , code follows */ + + return(0); +} + +/* send fax struct */ +int +idi_send_edata(eicon_card *card, eicon_chan *chan) +{ + + /* TODO , code follows */ + + return (0); +} + +void +idi_parse_edata(eicon_card *ccard, eicon_chan *chan, unsigned char *buffer, int len) +{ + + /* TODO , code follows */ + +} + +void +idi_fax_send_header(eicon_card *card, eicon_chan *chan, int header) +{ + + /* TODO , code follows */ + +} + +void +idi_fax_cmd(eicon_card *card, eicon_chan *chan) +{ + + /* TODO , code follows */ + +} + +void +idi_edata_rcveop(eicon_card *card, eicon_chan *chan) +{ + + /* TODO , code follows */ + +} + +void +idi_reset_fax_stat(eicon_chan *chan) +{ + + /* TODO , code follows */ + +} + +void +idi_edata_action(eicon_card *ccard, eicon_chan *chan, char *buffer, int len) +{ + + /* TODO , code follows */ + +} + +void +fax_put_rcv(eicon_card *ccard, eicon_chan *chan, u_char *Data, int len) +{ + + /* TODO , code follows */ + +} + +void +idi_faxdata_rcv(eicon_card *ccard, eicon_chan *chan, struct sk_buff *skb) +{ + + /* TODO , code follows */ + +} + +int +idi_fax_send_outbuf(eicon_card *ccard, eicon_chan *chan, eicon_OBJBUFFER *OutBuf) +{ + + /* TODO , code follows */ + + return(0); +} + +int +idi_faxdata_send(eicon_card *ccard, eicon_chan *chan, struct sk_buff *skb) +{ + + /* TODO , code follows */ + + return(0); +} + +void +idi_fax_hangup(eicon_card *ccard, eicon_chan *chan) +{ + + /* TODO , code follows */ + +} + +#endif /******** FAX ********/ int idi_send_udata(eicon_card *card, eicon_chan *chan, int UReq, u_char *buffer, int len) @@ -1064,7 +1256,6 @@ idi_handle_ind(eicon_card *ccard, struct sk_buff *skb) chan->queued = 0; chan->waitq = 0; chan->waitpq = 0; - chan->fsm_state = EICON_STATE_NULL; if (message.e_cau[0] & 0x7f) { cmd.driver = ccard->myid; cmd.arg = chan->No; @@ -1074,14 +1265,23 @@ idi_handle_ind(eicon_card *ccard, struct sk_buff *skb) ccard->interface.statcallb(&cmd); } chan->cause[0] = 0; - cmd.driver = ccard->myid; - cmd.arg = chan->No; - cmd.command = ISDN_STAT_DHUP; - ccard->interface.statcallb(&cmd); - eicon_idi_listen_req(ccard, chan); #ifdef CONFIG_ISDN_TTY_FAX - chan->fax = 0; + if (!chan->e.B2Id) + chan->fax = 0; #endif + if ((chan->fsm_state == EICON_STATE_ACTIVE) || + (chan->fsm_state == EICON_STATE_WMCONN)) { + chan->fsm_state = EICON_STATE_NULL; + } else { + if (chan->e.B2Id) + idi_do_req(ccard, chan, REMOVE, 1); + chan->fsm_state = EICON_STATE_NULL; + cmd.driver = ccard->myid; + cmd.arg = chan->No; + cmd.command = ISDN_STAT_DHUP; + ccard->interface.statcallb(&cmd); + eicon_idi_listen_req(ccard, chan); + } break; case INDICATE_IND: if (DebugVar & 8) @@ -1094,6 +1294,10 @@ idi_handle_ind(eicon_card *ccard, struct sk_buff *skb) strcat(chan->cpn, message.dsa); } strcpy(chan->oad, message.oad); + if (strlen(message.osa)) { + strcat(chan->oad, "."); + strcat(chan->oad, message.osa); + } try_stat_icall_again: cmd.driver = ccard->myid; cmd.command = ISDN_STAT_ICALL; @@ -1155,15 +1359,19 @@ idi_handle_ind(eicon_card *ccard, struct sk_buff *skb) cmd.command = ISDN_STAT_DCONN; cmd.arg = chan->No; ccard->interface.statcallb(&cmd); - if (chan->l2prot != ISDN_PROTO_L2_FAX) { - idi_do_req(ccard, chan, IDI_N_CONNECT, 1); - } + switch(chan->l2prot) { + case ISDN_PROTO_L2_FAX: #ifdef CONFIG_ISDN_TTY_FAX - else { - if (chan->fax) - chan->fax->phase = ISDN_FAX_PHASE_A; - } + if (chan->fax) + chan->fax->phase = ISDN_FAX_PHASE_A; #endif + break; + case ISDN_PROTO_L2_MODEM: + /* do nothing, wait for connect */ + break; + default: + idi_do_req(ccard, chan, IDI_N_CONNECT, 1); + } } else idi_hangup(ccard, chan); break; @@ -1176,6 +1384,15 @@ idi_handle_ind(eicon_card *ccard, struct sk_buff *skb) cmd.command = ISDN_STAT_DCONN; cmd.arg = chan->No; ccard->interface.statcallb(&cmd); + + /* check if old NetID has been removed */ + if (chan->e.B2Id) { + if (DebugVar & 1) + printk(KERN_WARNING "idi_err: Ch%d: Old NetID %x was not removed.\n", + chan->No, chan->e.B2Id); + idi_do_req(ccard, chan, REMOVE, 1); + } + idi_do_req(ccard, chan, ASSIGN, 1); idi_do_req(ccard, chan, IDI_N_CONNECT, 1); #ifdef CONFIG_ISDN_TTY_FAX @@ -1273,12 +1490,17 @@ idi_handle_ind(eicon_card *ccard, struct sk_buff *skb) chan->queued = 0; chan->waitq = 0; chan->waitpq = 0; + idi_do_req(ccard, chan, HANGUP, 0); if (chan->fsm_state == EICON_STATE_ACTIVE) { cmd.driver = ccard->myid; cmd.command = ISDN_STAT_BHUP; cmd.arg = chan->No; ccard->interface.statcallb(&cmd); + chan->fsm_state = EICON_STATE_NULL; } +#ifdef CONFIG_ISDN_TTY_FAX + chan->fax = 0; +#endif break; case IDI_N_DISC_ACK: if (DebugVar & 16) @@ -1327,7 +1549,7 @@ idi_handle_ind(eicon_card *ccard, struct sk_buff *skb) if (free_buff) dev_kfree_skb(skb); } -void +int idi_handle_ack_ok(eicon_card *ccard, eicon_chan *chan, eicon_RC *ack) { isdn_ctrl cmd; @@ -1337,7 +1559,7 @@ idi_handle_ack_ok(eicon_card *ccard, eicon_chan *chan, eicon_RC *ack) if (DebugVar & 16) printk(KERN_DEBUG "idi_ack: Ch%d: RcId %d not equal to last %d\n", chan->No, ack->RcId, (chan->e.ReqCh) ? chan->e.B2Id : chan->e.D3Id); - return; + return 1; } /* Management Interface */ @@ -1350,25 +1572,26 @@ idi_handle_ack_ok(eicon_card *ccard, eicon_chan *chan, eicon_RC *ack) /* Remove an Id */ if (chan->e.Req == REMOVE) { if (ack->Reference != chan->e.ref) { - if (DebugVar & 1) + if (DebugVar & 16) printk(KERN_DEBUG "idi_ack: Ch%d: Rc-Ref %d not equal to stored %d\n", chan->No, ack->Reference, chan->e.ref); + return 0; } ccard->IdTable[ack->RcId] = NULL; if (DebugVar & 16) - printk(KERN_DEBUG "idi_ack: Ch%d: Removed : Id=%d Ch=%d (%s)\n", chan->No, + printk(KERN_DEBUG "idi_ack: Ch%d: Removed : Id=%x Ch=%d (%s)\n", chan->No, ack->RcId, ack->RcCh, (chan->e.ReqCh)? "Net":"Sig"); if (!chan->e.ReqCh) chan->e.D3Id = 0; else chan->e.B2Id = 0; - return; + return 1; } /* Signal layer */ if (!chan->e.ReqCh) { if (DebugVar & 16) - printk(KERN_DEBUG "idi_ack: Ch%d: RC OK Id=%d Ch=%d (ref:%d)\n", chan->No, + printk(KERN_DEBUG "idi_ack: Ch%d: RC OK Id=%x Ch=%d (ref:%d)\n", chan->No, ack->RcId, ack->RcCh, ack->Reference); } else { /* Network layer */ @@ -1409,10 +1632,11 @@ idi_handle_ack_ok(eicon_card *ccard, eicon_chan *chan, eicon_RC *ack) break; default: if (DebugVar & 16) - printk(KERN_DEBUG "idi_ack: Ch%d: RC OK Id=%d Ch=%d (ref:%d)\n", chan->No, + printk(KERN_DEBUG "idi_ack: Ch%d: RC OK Id=%x Ch=%d (ref:%d)\n", chan->No, ack->RcId, ack->RcCh, ack->Reference); } } + return 1; } void @@ -1447,7 +1671,8 @@ idi_handle_ack(eicon_card *ccard, struct sk_buff *skb) printk(KERN_ERR "idi_ack: Ch%d: OK on chan without Id\n", dCh); break; } - idi_handle_ack_ok(ccard, chan, ack); + if (!idi_handle_ack_ok(ccard, chan, ack)) + chan = NULL; break; case ASSIGN_OK: @@ -1486,9 +1711,8 @@ idi_handle_ack(eicon_card *ccard, struct sk_buff *skb) case UNKNOWN_IE: case WRONG_IE: default: - chan->e.busy = 0; - if (DebugVar & 24) - printk(KERN_ERR "eicon_ack: Ch%d: Not OK: Rc=%d Id=%d Ch=%d\n", dCh, + if (DebugVar & 1) + printk(KERN_ERR "eicon_ack: Ch%d: Not OK !!: Rc=%d Id=%x Ch=%d\n", dCh, ack->Rc, ack->RcId, ack->RcCh); if (dCh == ccard->nchannels) { /* Management */ chan->fsm_state = 2; @@ -1585,7 +1809,6 @@ idi_send_data(eicon_card *card, eicon_chan *chan, int ack, struct sk_buff *skb, } - int eicon_idi_manage_assign(eicon_card *card) { diff --git a/drivers/isdn/eicon/eicon_idi.h b/drivers/isdn/eicon/eicon_idi.h index 9a1da1751303..e09c1954d479 100644 --- a/drivers/isdn/eicon/eicon_idi.h +++ b/drivers/isdn/eicon/eicon_idi.h @@ -1,4 +1,4 @@ -/* $Id: eicon_idi.h,v 1.6 1999/07/25 15:12:04 armin Exp $ +/* $Id: eicon_idi.h,v 1.7 1999/08/22 20:26:46 calle Exp $ * * ISDN lowlevel-module for the Eicon.Diehl active cards. * IDI-Interface @@ -21,6 +21,12 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: eicon_idi.h,v $ + * Revision 1.7 1999/08/22 20:26:46 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * * Revision 1.6 1999/07/25 15:12:04 armin * fix of some debug logs. * enabled ISA-cards option. @@ -54,6 +60,7 @@ #ifndef IDI_H #define IDI_H +#include #define ASSIGN 0x01 #define REMOVE 0xff diff --git a/drivers/isdn/eicon/eicon_io.c b/drivers/isdn/eicon/eicon_io.c index 79ce41eed87c..54f8b11a7a32 100644 --- a/drivers/isdn/eicon/eicon_io.c +++ b/drivers/isdn/eicon/eicon_io.c @@ -1,4 +1,4 @@ -/* $Id: eicon_io.c,v 1.2 1999/07/25 15:12:05 armin Exp $ +/* $Id: eicon_io.c,v 1.5 1999/08/31 11:20:11 paul Exp $ * * ISDN low-level module for Eicon.Diehl active ISDN-Cards. * Code for communicating with hardware. @@ -24,6 +24,19 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: eicon_io.c,v $ + * Revision 1.5 1999/08/31 11:20:11 paul + * various spelling corrections (new checksums may be needed, Karsten!) + * + * Revision 1.4 1999/08/22 20:26:47 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * + * Revision 1.3 1999/08/18 20:17:01 armin + * Added XLOG function for all cards. + * Bugfix of alloc_skb NULL pointer. + * * Revision 1.2 1999/07/25 15:12:05 armin * fix of some debug logs. * enabled ISA-cards option. @@ -36,6 +49,7 @@ */ +#include #include "eicon.h" void @@ -60,7 +74,7 @@ eicon_io_rcv_dispatch(eicon_card *ccard) { /* doesn't matter if this happens */ break; default: - printk(KERN_ERR "idi: Indication for unknown channel Ind=%d Id=%d\n", ind->Ind, ind->IndId); + printk(KERN_ERR "idi: Indication for unknown channel Ind=%d Id=%x\n", ind->Ind, ind->IndId); printk(KERN_DEBUG "idi_hdl: Ch??: Ind=%d Id=%x Ch=%d MInd=%d MLen=%d Len=%d\n", ind->Ind,ind->IndId,ind->IndCh,ind->MInd,ind->MLength,ind->RBuffer.length); } @@ -88,12 +102,18 @@ eicon_io_rcv_dispatch(eicon_card *ccard) { if (DebugVar & 1) printk(KERN_ERR "eicon: buffer incomplete, but 0 in queue\n"); dev_kfree_skb(skb); - dev_kfree_skb(skb2); continue; } ind2 = (eicon_IND *)skb2->data; skb_new = alloc_skb(((sizeof(eicon_IND)-1)+ind->RBuffer.length+ind2->RBuffer.length), GFP_ATOMIC); + if (!skb_new) { + if (DebugVar & 1) + printk(KERN_ERR "eicon_io: skb_alloc failed in rcv_dispatch()\n"); + dev_kfree_skb(skb); + dev_kfree_skb(skb2); + continue; + } ind_new = (eicon_IND *)skb_put(skb_new, ((sizeof(eicon_IND)-1)+ind->RBuffer.length+ind2->RBuffer.length)); ind_new->Ind = ind2->Ind; @@ -275,6 +295,92 @@ void ram_copytocard(eicon_card *card, void *adrto, void *adr, int len) { } } +/* + * XLOG + */ +int +eicon_get_xlog(eicon_card *card, xlogreq_t *xlogreq) +{ + int timeout, i; + int divas_shared_offset = 0; + int len = 0; + int stype = 0; + __u32 time = 0; + mi_pc_maint_t *pcm = &xlogreq->pcm; + eicon_pci_card *pci_card = &card->hwif.pci; + eicon_isa_card *isa_card = &card->hwif.isa; + eicon_pr_ram *prram = 0; + char *ram; + + switch(card->type) { + case EICON_CTYPE_MAESTRAP: + ram = (char *)pci_card->PCIram; + prram = (eicon_pr_ram *)ram; + divas_shared_offset = DIVAS_SHARED_OFFSET; + len = sizeof(mi_pc_maint_t); + break; + case EICON_CTYPE_MAESTRA: + prram = 0; + divas_shared_offset = 0; + len = sizeof(mi_pc_maint_t); + break; + case EICON_CTYPE_S: + case EICON_CTYPE_SX: + case EICON_CTYPE_SCOM: + case EICON_CTYPE_QUADRO: + case EICON_CTYPE_S2M: + prram = (eicon_pr_ram *)isa_card->shmem; + divas_shared_offset = 0xfb80; + len = sizeof(mi_pc_maint_t) - 78; + stype = 1; + break; + default: + return -ENODEV; + } + + memset(&(xlogreq->pcm), 0, sizeof(mi_pc_maint_t)); + + xlogreq->pcm.rc = 0; + xlogreq->pcm.req = 1; /* DO_LOG */ + + ram = ((char *)prram) + MIPS_MAINT_OFFS - divas_shared_offset; + + ram_outb(card, ram+1, pcm->rc); + ram_outb(card, ram+0, pcm->req); + + timeout = jiffies + 50; + while (timeout > jiffies) { + pcm->rc = ram_inb(card, ram+1); + pcm->req = ram_inb(card, ram+0); + if (!pcm->req) break; + SLEEP(10); + } + + if (pcm->req) { + return XLOG_ERR_TIMEOUT; + } + + if (pcm->rc != OK) { + return XLOG_ERR_DONE; + } + + ram_copyfromcard(card, pcm, ram, len); + + if (stype) { + for (i=0; i<8; i++) + ((__u8 *)pcm)[11-i] = ((__u8 *)pcm)[9-i]; + time = (__u32)pcm->data.w[2] * 3600 * 1000 + + (__u32)pcm->data.w[1] * 1000 + + (__u32)pcm->data.b[1] * 20 + + (__u32)pcm->data.b[0] ; + pcm->data.w[1] = (__u16) (time >> 16); + pcm->data.w[2] = (__u16) (time & 0x0000ffff); + pcm->data.w[0] = 2; + } + + return XLOG_OK; +} + /* * Transmit-Function */ @@ -372,9 +478,13 @@ eicon_io_transmit(eicon_card *ccard) { chan = chan2->ptr; if (!chan->e.busy) { if((skb = skb_dequeue(&chan->e.X))) { - save_flags(flags); - cli(); - reqbuf = (eicon_REQ *)skb->data; + save_flags(flags); + cli(); + reqbuf = (eicon_REQ *)skb->data; + if ((reqbuf->Reference) && (chan->e.B2Id == 0) && (reqbuf->ReqId & 0x1f)) { + if (DebugVar & 16) + printk(KERN_WARNING "eicon: transmit: error Id=0 on %d (Net)\n", chan->No); + } else { if (scom) { ram_outw(ccard, &com->XBuffer.length, reqbuf->XBuffer.length); ram_copytocard(ccard, &com->XBuffer.P, &reqbuf->XBuffer.P, reqbuf->XBuffer.length); @@ -389,7 +499,7 @@ eicon_io_transmit(eicon_card *ccard) { ram_outb(ccard, &ReqOut->Req, reqbuf->Req); } - if (reqbuf->ReqId &0x1f) { /* if this is no ASSIGN */ + if (reqbuf->ReqId & 0x1f) { /* if this is no ASSIGN */ if (!reqbuf->Reference) { /* Signal Layer */ if (scom) @@ -438,14 +548,15 @@ eicon_io_transmit(eicon_card *ccard) { ram_outw(ccard, &prram->NextReq, ram_inw(ccard, &ReqOut->next)); chan->e.busy = 1; - restore_flags(flags); if (DebugVar & 32) printk(KERN_DEBUG "eicon: Req=%d Id=%x Ch=%d Len=%d Ref=%d\n", reqbuf->Req, ram_inb(ccard, &ReqOut->ReqId), reqbuf->ReqCh, reqbuf->XBuffer.length, chan->e.ref); - dev_kfree_skb(skb); + } + restore_flags(flags); + dev_kfree_skb(skb); } dev_kfree_skb(skb2); } @@ -599,7 +710,7 @@ eicon_irq(int irq, void *dev_id, struct pt_regs *regs) { case EICON_CTYPE_S2M: if (!(readb(isa_card->intack))) { /* card did not interrupt */ if (DebugVar & 1) - printk(KERN_DEBUG "eicon: IRQ: card tells no interrupt!\n"); + printk(KERN_DEBUG "eicon: IRQ: card reports no interrupt!\n"); return; } break; @@ -607,7 +718,7 @@ eicon_irq(int irq, void *dev_id, struct pt_regs *regs) { case EICON_CTYPE_MAESTRAP: if (!(readb(&ram[0x3fe]))) { /* card did not interrupt */ if (DebugVar & 1) - printk(KERN_DEBUG "eicon: IRQ: card tells no interrupt!\n"); + printk(KERN_DEBUG "eicon: IRQ: card reports no interrupt!\n"); return; } break; @@ -615,7 +726,7 @@ eicon_irq(int irq, void *dev_id, struct pt_regs *regs) { outw(0x3fe, pci_card->PCIreg + M_ADDR); if (!(inb(pci_card->PCIreg + M_DATA))) { /* card did not interrupt */ if (DebugVar & 1) - printk(KERN_DEBUG "eicon: IRQ: card tells no interrupt!\n"); + printk(KERN_DEBUG "eicon: IRQ: card reports no interrupt!\n"); return; } break; @@ -635,16 +746,21 @@ eicon_irq(int irq, void *dev_id, struct pt_regs *regs) { } } else { skb = alloc_skb(sizeof(eicon_RC), GFP_ATOMIC); - ack = (eicon_RC *)skb_put(skb, sizeof(eicon_RC)); - ack->Rc = tmp; - ack->RcId = ram_inb(ccard, &com->RcId); - ack->RcCh = ram_inb(ccard, &com->RcCh); - ack->Reference = ccard->ref_in++; - if (DebugVar & 64) - printk(KERN_INFO "eicon: IRQ Rc=%d Id=%x Ch=%d Ref=%d\n", - tmp,ack->RcId,ack->RcCh,ack->Reference); - skb_queue_tail(&ccard->rackq, skb); - eicon_schedule_ack(ccard); + if (!skb) { + if (DebugVar & 1) + printk(KERN_ERR "eicon_io: skb_alloc failed in _irq()\n"); + } else { + ack = (eicon_RC *)skb_put(skb, sizeof(eicon_RC)); + ack->Rc = tmp; + ack->RcId = ram_inb(ccard, &com->RcId); + ack->RcCh = ram_inb(ccard, &com->RcCh); + ack->Reference = ccard->ref_in++; + if (DebugVar & 64) + printk(KERN_INFO "eicon: IRQ Rc=%d Id=%x Ch=%d Ref=%d\n", + tmp,ack->RcId,ack->RcCh,ack->Reference); + skb_queue_tail(&ccard->rackq, skb); + eicon_schedule_ack(ccard); + } ram_outb(ccard, &com->Req, 0); ram_outb(ccard, &com->Rc, 0); } @@ -656,19 +772,24 @@ eicon_irq(int irq, void *dev_id, struct pt_regs *regs) { eicon_IND *ind; int len = ram_inw(ccard, &com->RBuffer.length); skb = alloc_skb((sizeof(eicon_IND) + len - 1), GFP_ATOMIC); - ind = (eicon_IND *)skb_put(skb, (sizeof(eicon_IND) + len - 1)); - ind->Ind = tmp; - ind->IndId = ram_inb(ccard, &com->IndId); - ind->IndCh = ram_inb(ccard, &com->IndCh); - ind->MInd = ram_inb(ccard, &com->MInd); - ind->MLength = ram_inw(ccard, &com->MLength); - ind->RBuffer.length = len; - if (DebugVar & 64) - printk(KERN_INFO "eicon: IRQ Ind=%d Id=%x Ch=%d MInd=%d MLen=%d Len=%d\n", - tmp,ind->IndId,ind->IndCh,ind->MInd,ind->MLength,len); - ram_copyfromcard(ccard, &ind->RBuffer.P, &com->RBuffer.P, len); - skb_queue_tail(&ccard->rcvq, skb); - eicon_schedule_rx(ccard); + if (!skb) { + if (DebugVar & 1) + printk(KERN_ERR "eicon_io: skb_alloc failed in _irq()\n"); + } else { + ind = (eicon_IND *)skb_put(skb, (sizeof(eicon_IND) + len - 1)); + ind->Ind = tmp; + ind->IndId = ram_inb(ccard, &com->IndId); + ind->IndCh = ram_inb(ccard, &com->IndCh); + ind->MInd = ram_inb(ccard, &com->MInd); + ind->MLength = ram_inw(ccard, &com->MLength); + ind->RBuffer.length = len; + if (DebugVar & 64) + printk(KERN_INFO "eicon: IRQ Ind=%d Id=%x Ch=%d MInd=%d MLen=%d Len=%d\n", + tmp,ind->IndId,ind->IndCh,ind->MInd,ind->MLength,len); + ram_copyfromcard(ccard, &ind->RBuffer.P, &com->RBuffer.P, len); + skb_queue_tail(&ccard->rcvq, skb); + eicon_schedule_rx(ccard); + } ram_outb(ccard, &com->Ind, 0); } } @@ -685,17 +806,22 @@ eicon_irq(int irq, void *dev_id, struct pt_regs *regs) { if((Rc=ram_inb(ccard, &RcIn->Rc))) { skb = alloc_skb(sizeof(eicon_RC), GFP_ATOMIC); - ack = (eicon_RC *)skb_put(skb, sizeof(eicon_RC)); - ack->Rc = Rc; - ack->RcId = ram_inb(ccard, &RcIn->RcId); - ack->RcCh = ram_inb(ccard, &RcIn->RcCh); - ack->Reference = ram_inw(ccard, &RcIn->Reference); - if (DebugVar & 64) - printk(KERN_INFO "eicon: IRQ Rc=%d Id=%x Ch=%d Ref=%d\n", - Rc,ack->RcId,ack->RcCh,ack->Reference); - ram_outb(ccard, &RcIn->Rc, 0); - skb_queue_tail(&ccard->rackq, skb); - eicon_schedule_ack(ccard); + if (!skb) { + if (DebugVar & 1) + printk(KERN_ERR "eicon_io: skb_alloc failed in _irq()\n"); + } else { + ack = (eicon_RC *)skb_put(skb, sizeof(eicon_RC)); + ack->Rc = Rc; + ack->RcId = ram_inb(ccard, &RcIn->RcId); + ack->RcCh = ram_inb(ccard, &RcIn->RcCh); + ack->Reference = ram_inw(ccard, &RcIn->Reference); + if (DebugVar & 64) + printk(KERN_INFO "eicon: IRQ Rc=%d Id=%x Ch=%d Ref=%d\n", + Rc,ack->RcId,ack->RcCh,ack->Reference); + skb_queue_tail(&ccard->rackq, skb); + eicon_schedule_ack(ccard); + } + ram_outb(ccard, &RcIn->Rc, 0); } /* get buffer address of next return code */ RcIn = (eicon_RC *)&prram->B[ram_inw(ccard, &RcIn->next)]; @@ -715,19 +841,24 @@ eicon_irq(int irq, void *dev_id, struct pt_regs *regs) { if(Ind) { int len = ram_inw(ccard, &IndIn->RBuffer.length); skb = alloc_skb((sizeof(eicon_IND) + len - 1), GFP_ATOMIC); - ind = (eicon_IND *)skb_put(skb, (sizeof(eicon_IND) + len - 1)); - ind->Ind = Ind; - ind->IndId = ram_inb(ccard, &IndIn->IndId); - ind->IndCh = ram_inb(ccard, &IndIn->IndCh); - ind->MInd = ram_inb(ccard, &IndIn->MInd); - ind->MLength = ram_inw(ccard, &IndIn->MLength); - ind->RBuffer.length = len; - if (DebugVar & 64) - printk(KERN_INFO "eicon: IRQ Ind=%d Id=%x Ch=%d MInd=%d MLen=%d Len=%d\n", - Ind,ind->IndId,ind->IndCh,ind->MInd,ind->MLength,len); - ram_copyfromcard(ccard, &ind->RBuffer.P, &IndIn->RBuffer.P, len); - skb_queue_tail(&ccard->rcvq, skb); - eicon_schedule_rx(ccard); + if (!skb) { + if (DebugVar & 1) + printk(KERN_ERR "eicon_io: skb_alloc failed in _irq()\n"); + } else { + ind = (eicon_IND *)skb_put(skb, (sizeof(eicon_IND) + len - 1)); + ind->Ind = Ind; + ind->IndId = ram_inb(ccard, &IndIn->IndId); + ind->IndCh = ram_inb(ccard, &IndIn->IndCh); + ind->MInd = ram_inb(ccard, &IndIn->MInd); + ind->MLength = ram_inw(ccard, &IndIn->MLength); + ind->RBuffer.length = len; + if (DebugVar & 64) + printk(KERN_INFO "eicon: IRQ Ind=%d Id=%x Ch=%d MInd=%d MLen=%d Len=%d\n", + Ind,ind->IndId,ind->IndCh,ind->MInd,ind->MLength,len); + ram_copyfromcard(ccard, &ind->RBuffer.P, &IndIn->RBuffer.P, len); + skb_queue_tail(&ccard->rcvq, skb); + eicon_schedule_rx(ccard); + } ram_outb(ccard, &IndIn->Ind, 0); } /* get buffer address of next indication */ diff --git a/drivers/isdn/eicon/eicon_isa.c b/drivers/isdn/eicon/eicon_isa.c index 924d5620f686..a89d18b12128 100644 --- a/drivers/isdn/eicon/eicon_isa.c +++ b/drivers/isdn/eicon/eicon_isa.c @@ -1,9 +1,9 @@ -/* $Id: eicon_isa.c,v 1.6 1999/07/25 15:12:06 armin Exp $ +/* $Id: eicon_isa.c,v 1.9 1999/09/08 20:17:31 armin Exp $ * * ISDN low-level module for Eicon.Diehl active ISDN-Cards. * Hardware-specific code for old ISA cards. * - * Copyright 1998 by Fritz Elfert (fritz@wuemaus.franken.de) + * Copyright 1998 by Fritz Elfert (fritz@isdn4linux.de) * Copyright 1998,99 by Armin Schindler (mac@melware.de) * Copyright 1999 Cytronics & Melware (info@melware.de) * @@ -22,6 +22,18 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: eicon_isa.c,v $ + * Revision 1.9 1999/09/08 20:17:31 armin + * Added microchannel patch from Erik Weber. + * + * Revision 1.8 1999/09/06 07:29:35 fritz + * Changed my mail-address. + * + * Revision 1.7 1999/08/22 20:26:48 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * * Revision 1.6 1999/07/25 15:12:06 armin * fix of some debug logs. * enabled ISA-cards option. @@ -50,6 +62,7 @@ * */ +#include #include "eicon.h" #include "eicon_isa.h" @@ -57,7 +70,9 @@ #define release_shmem release_region #define request_shmem request_region -char *eicon_isa_revision = "$Revision: 1.6 $"; +char *eicon_isa_revision = "$Revision: 1.9 $"; + +#undef EICON_MCA_DEBUG #ifdef CONFIG_ISDN_DRV_EICON_ISA @@ -100,7 +115,7 @@ eicon_isa_printpar(eicon_isa_card *card) { case EICON_CTYPE_SCOM: case EICON_CTYPE_QUADRO: case EICON_CTYPE_S2M: - printk(KERN_INFO "Eicon %s at 0x%lx, irq %d\n", + printk(KERN_INFO "Eicon %s at 0x%lx, irq %d.\n", eicon_ctype_name[card->type], (unsigned long)card->shmem, card->irq); @@ -203,12 +218,30 @@ eicon_isa_bootload(eicon_isa_card *card, eicon_isa_codebuf *cb) { return -EBUSY; } request_shmem((unsigned long)card->shmem, card->ramsize, "Eicon ISA ISDN"); +#ifdef EICON_MCA_DEBUG + printk(KERN_INFO "eicon_isa_boot: card->ramsize = %d.\n", card->ramsize); +#endif card->mvalid = 1; /* clear any pending irq's */ readb(card->intack); +#ifdef CONFIG_MCA + if (card->type == EICON_CTYPE_SCOM) { + outb_p(0,card->io+1); + } + else { + printk(KERN_WARNING "eicon_isa_boot: Card type yet not supported.\n"); + return -EINVAL; + }; + +#ifdef EICON_MCA_DEBUG + printk(KERN_INFO "eicon_isa_boot: card->io = %x.\n", card->io); + printk(KERN_INFO "eicon_isa_boot: card->irq = %d.\n", (int)card->irq); +#endif +#else /* set reset-line active */ writeb(0, card->stopcpu); +#endif /* CONFIG_MCA */ /* clear irq-requests */ writeb(0, card->intack); readb(card->intack); @@ -235,7 +268,11 @@ eicon_isa_bootload(eicon_isa_card *card, eicon_isa_codebuf *cb) { /* Start CPU */ writeb(cbuf.boot_opt, &boot->ctrl); +#ifdef CONFIG_MCA + outb_p(0, card->io); +#else writeb(0, card->startcpu); +#endif /* CONFIG_MCA */ /* Delay 0.2 sec. */ SLEEP(20); @@ -247,7 +284,11 @@ eicon_isa_bootload(eicon_isa_card *card, eicon_isa_codebuf *cb) { SLEEP(10); } if (readb(&boot->ctrl) != 0) { - printk(KERN_WARNING "eicon_isa_boot: CPU test failed\n"); + printk(KERN_WARNING "eicon_isa_boot: CPU test failed.\n"); +#ifdef EICON_MCA_DEBUG + printk(KERN_INFO "eicon_isa_boot: &boot->ctrl = %d.\n", + readb(&boot->ctrl)); +#endif eicon_isa_release_shmem(card); return -EIO; } @@ -300,7 +341,7 @@ eicon_isa_load(eicon_isa_card *card, eicon_isa_codebuf *cb) { return -EFAULT; if (!(code = kmalloc(cbuf.firmware_len, GFP_KERNEL))) { - printk(KERN_WARNING "eicon_isa_boot: Couldn't allocate code buffer\n"); + printk(KERN_WARNING "eicon_isa_load: Couldn't allocate code buffer\n"); return -ENOMEM; } @@ -316,7 +357,7 @@ eicon_isa_load(eicon_isa_card *card, eicon_isa_codebuf *cb) { /* Check for valid IRQ */ if ((card->irq < 0) || (card->irq > 15) || (!((1 << card->irq) & eicon_isa_valid_irq[card->type & 0x0f]))) { - printk(KERN_WARNING "eicon_isa_boot: illegal irq: %d\n", card->irq); + printk(KERN_WARNING "eicon_isa_load: illegal irq: %d\n", card->irq); eicon_isa_release_shmem(card); kfree(code); return -EINVAL; @@ -325,7 +366,7 @@ eicon_isa_load(eicon_isa_card *card, eicon_isa_codebuf *cb) { if (!request_irq(card->irq, &eicon_irq, 0, "Eicon ISA ISDN", card)) card->ivalid = 1; else { - printk(KERN_WARNING "eicon_isa_boot: irq %d already in use.\n", + printk(KERN_WARNING "eicon_isa_load: irq %d already in use.\n", card->irq); eicon_isa_release_shmem(card); kfree(code); @@ -336,7 +377,7 @@ eicon_isa_load(eicon_isa_card *card, eicon_isa_codebuf *cb) { tmp = readb(&boot->msize); if (tmp != 8 && tmp != 16 && tmp != 24 && tmp != 32 && tmp != 48 && tmp != 60) { - printk(KERN_WARNING "eicon_isa_boot: invalid memsize\n"); + printk(KERN_WARNING "eicon_isa_load: invalid memsize\n"); eicon_isa_release_shmem(card); return -EIO; } @@ -359,7 +400,7 @@ eicon_isa_load(eicon_isa_card *card, eicon_isa_codebuf *cb) { SLEEP(2); } if (readb(&boot->ctrl)) { - printk(KERN_WARNING "eicon_isa_boot: download timeout at 0x%x\n", p-code); + printk(KERN_WARNING "eicon_isa_load: download timeout at 0x%x\n", p-code); eicon_isa_release(card); kfree(code); return -EIO; @@ -382,7 +423,7 @@ eicon_isa_load(eicon_isa_card *card, eicon_isa_codebuf *cb) { SLEEP(2); } if (readw(&boot->signature) != 0x4447) { - printk(KERN_WARNING "eicon_isa_boot: firmware selftest failed %04x\n", + printk(KERN_WARNING "eicon_isa_load: firmware selftest failed %04x\n", readw(&boot->signature)); eicon_isa_release(card); return -EIO; @@ -407,11 +448,15 @@ eicon_isa_load(eicon_isa_card *card, eicon_isa_codebuf *cb) { SLEEP(2); } if (card->irqprobe == 1) { - printk(KERN_WARNING "eicon_isa_boot: IRQ test failed\n"); + printk(KERN_WARNING "eicon_isa_load: IRQ # %d test failed\n", card->irq); eicon_isa_release(card); return -EIO; } } +#ifdef EICON_MCA_DEBUG + printk(KERN_INFO "eicon_isa_load: IRQ # %d test succeeded.\n", card->irq); +#endif + writeb(card->irq, &card->shmem->com.Int); /* initializing some variables */ diff --git a/drivers/isdn/eicon/eicon_isa.h b/drivers/isdn/eicon/eicon_isa.h index 5b0dc1a6a60f..7f86bd9ff4ef 100644 --- a/drivers/isdn/eicon/eicon_isa.h +++ b/drivers/isdn/eicon/eicon_isa.h @@ -1,8 +1,8 @@ -/* $Id: eicon_isa.h,v 1.3 1999/03/29 11:19:47 armin Exp $ +/* $Id: eicon_isa.h,v 1.5 1999/09/08 20:17:31 armin Exp $ * * ISDN low-level module for Eicon.Diehl active ISDN-Cards. * - * Copyright 1998 by Fritz Elfert (fritz@wuemaus.franken.de) + * Copyright 1998 by Fritz Elfert (fritz@isdn4linux.de) * Copyright 1998,99 by Armin Schindler (mac@melware.de) * Copyright 1999 Cytronics & Melware (info@melware.de) * @@ -21,6 +21,12 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: eicon_isa.h,v $ + * Revision 1.5 1999/09/08 20:17:31 armin + * Added microchannel patch from Erik Weber. + * + * Revision 1.4 1999/09/06 07:29:35 fritz + * Changed my mail-address. + * * Revision 1.3 1999/03/29 11:19:47 armin * I/O stuff now in seperate file (eicon_io.c) * Old ISA type cards (S,SX,SCOM,Quadro,S2M) implemented. @@ -106,6 +112,9 @@ typedef union { typedef struct { int ramsize; int irq; /* IRQ */ +#ifdef CONFIG_MCA + int io; /* IO-port for MCA brand */ +#endif /* CONFIG_MCA */ void* card; eicon_isa_shmem* shmem; /* Shared-memory area */ unsigned char* intack; /* Int-Acknowledge */ diff --git a/drivers/isdn/eicon/eicon_mod.c b/drivers/isdn/eicon/eicon_mod.c index 9efb770ed1f3..fca7b879f6ba 100644 --- a/drivers/isdn/eicon/eicon_mod.c +++ b/drivers/isdn/eicon/eicon_mod.c @@ -1,8 +1,8 @@ -/* $Id: eicon_mod.c,v 1.8 1999/07/25 15:12:08 armin Exp $ +/* $Id: eicon_mod.c,v 1.15 1999/09/08 20:17:31 armin Exp $ * * ISDN lowlevel-module for Eicon.Diehl active cards. * - * Copyright 1997 by Fritz Elfert (fritz@wuemaus.franken.de) + * Copyright 1997 by Fritz Elfert (fritz@isdn4linux.de) * Copyright 1998,99 by Armin Schindler (mac@melware.de) * Copyright 1999 Cytronics & Melware (info@melware.de) * @@ -26,6 +26,31 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: eicon_mod.c,v $ + * Revision 1.15 1999/09/08 20:17:31 armin + * Added microchannel patch from Erik Weber. + * + * Revision 1.14 1999/09/06 07:29:35 fritz + * Changed my mail-address. + * + * Revision 1.13 1999/09/04 17:37:59 armin + * Removed not used define, did not work and caused error + * in 2.3.16 + * + * Revision 1.12 1999/08/31 11:20:14 paul + * various spelling corrections (new checksums may be needed, Karsten!) + * + * Revision 1.11 1999/08/29 17:23:45 armin + * New setup compat. + * Bugfix if compile as not module. + * + * Revision 1.10 1999/08/28 21:32:53 armin + * Prepared for fax related functions. + * Now compilable without errors/warnings. + * + * Revision 1.9 1999/08/18 20:17:02 armin + * Added XLOG function for all cards. + * Bugfix of alloc_skb NULL pointer. + * * Revision 1.8 1999/07/25 15:12:08 armin * fix of some debug logs. * enabled ISA-cards option. @@ -63,12 +88,14 @@ * */ +#define DRIVERPATCH "" + #include #include #include #ifdef CONFIG_MCA #include -#endif +#endif /* CONFIG_MCA */ #include "eicon.h" @@ -77,7 +104,7 @@ static eicon_card *cards = (eicon_card *) NULL; /* glob. var , contains start of card-list */ -static char *eicon_revision = "$Revision: 1.8 $"; +static char *eicon_revision = "$Revision: 1.15 $"; extern char *eicon_pci_revision; extern char *eicon_isa_revision; @@ -87,7 +114,7 @@ extern char *eicon_idi_revision; #define MOD_USE_COUNT (GET_USE_COUNT (&__this_module)) #endif -#define EICON_CTRL_VERSION 1 +#define EICON_CTRL_VERSION 2 ulong DebugVar; @@ -225,87 +252,6 @@ eicon_find_eaz(eicon_card *card, char eaz) return("\0"); } -#if 0 -/* - * Add or delete an MSN to the MSN list - * - * First character of msneaz is EAZ, rest is MSN. - * If length of eazmsn is 1, delete that entry. - */ -static int -eicon_set_msn(eicon_card *card, char *eazmsn) -{ - struct msn_entry *p = card->msn_list; - struct msn_entry *q = NULL; - unsigned long flags; - int i; - - if (!strlen(eazmsn)) - return 0; - if (strlen(eazmsn) > 16) - return -EINVAL; - for (i = 0; i < strlen(eazmsn); i++) - if (!isdigit(eazmsn[i])) - return -EINVAL; - if (strlen(eazmsn) == 1) { - /* Delete a single MSN */ - while (p) { - if (p->eaz == eazmsn[0]) { - save_flags(flags); - cli(); - if (q) - q->next = p->next; - else - card->msn_list = p->next; - restore_flags(flags); - kfree(p); - if (DebugVar & 8) - printk(KERN_DEBUG - "Mapping for EAZ %c deleted\n", - eazmsn[0]); - return 0; - } - q = p; - p = p->next; - } - return 0; - } - /* Add a single MSN */ - while (p) { - /* Found in list, replace MSN */ - if (p->eaz == eazmsn[0]) { - save_flags(flags); - cli(); - strcpy(p->msn, &eazmsn[1]); - restore_flags(flags); - if (DebugVar & 8) - printk(KERN_DEBUG - "Mapping for EAZ %c changed to %s\n", - eazmsn[0], - &eazmsn[1]); - return 0; - } - p = p->next; - } - /* Not found in list, add new entry */ - p = kmalloc(sizeof(msn_entry), GFP_KERNEL); - if (!p) - return -ENOMEM; - p->eaz = eazmsn[0]; - strcpy(p->msn, &eazmsn[1]); - p->next = card->msn_list; - save_flags(flags); - cli(); - card->msn_list = p; - restore_flags(flags); - if (DebugVar & 8) - printk(KERN_DEBUG - "Mapping %c -> %s added\n", - eazmsn[0], - &eazmsn[1]); - return 0; -} -#endif static void eicon_rcv_dispatch(struct eicon_card *card) @@ -355,6 +301,32 @@ eicon_transmit(struct eicon_card *card) } } +static int eicon_xlog(eicon_card *card, xlogreq_t *xlogreq) +{ + xlogreq_t *xlr; + int ret_val; + + if (!(xlr = kmalloc(sizeof(xlogreq_t), GFP_KERNEL))) { + if (DebugVar & 1) + printk(KERN_WARNING "idi_err: alloc_xlogreq_t failed\n"); + return -ENOMEM; + } + if (copy_from_user(xlr, xlogreq, sizeof(xlogreq_t))) { + kfree(xlr); + return -EFAULT; + } + + ret_val = eicon_get_xlog(card, xlr); + + if (copy_to_user(xlogreq, xlr, sizeof(xlogreq_t))) { + kfree(xlr); + return -EFAULT; + } + kfree(xlr); + + return ret_val; +} + static int eicon_command(eicon_card * card, isdn_ctrl * c) { @@ -366,6 +338,10 @@ eicon_command(eicon_card * card, isdn_ctrl * c) int ret = 0; unsigned long flags; + if (DebugVar & 16) + printk(KERN_WARNING "eicon_cmd 0x%x with arg 0x%lx (0x%lx)\n", + c->command, c->arg, (ulong) *c->parm.num); + switch (c->command) { case ISDN_CMD_IOCTL: memcpy(&a, c->parm.num, sizeof(ulong)); @@ -396,13 +372,22 @@ eicon_command(eicon_card * card, isdn_ctrl * c) return -EBUSY; switch (card->bus) { case EICON_BUS_ISA: - case EICON_BUS_MCA: if (eicon_isa_find_card(a, card->hwif.isa.irq, card->regname) < 0) return -EFAULT; card->hwif.isa.shmem = (eicon_isa_shmem *)a; return 0; + case EICON_BUS_MCA: +#if CONFIG_MCA + if (eicon_mca_find_card( + 0, a, + card->hwif.isa.irq, + card->regname) < 0) + return -EFAULT; + card->hwif.isa.shmem = (eicon_isa_shmem *)a; + return 0; +#endif /* CONFIG_MCA */ default: if (DebugVar & 1) printk(KERN_WARNING @@ -507,6 +492,12 @@ eicon_command(eicon_card * card, isdn_ctrl * c) card, (eicon_manifbuf *)a); return ret; + + case EICON_IOCTL_GETXLOG: + if (!card->flags & EICON_FLAGS_RUNNING) + return XLOG_ERR_CARD_STATE; + ret = eicon_xlog(card, (xlogreq_t *)a); + return ret; #if CONFIG_PCI case EICON_IOCTL_LOADPCI: if (card->flags & EICON_FLAGS_RUNNING) @@ -541,18 +532,6 @@ eicon_command(eicon_card * card, isdn_ctrl * c) } return ret; } else return -ENODEV; -#endif -#if 0 - case EICON_IOCTL_SETMSN: - if ((ret = copy_from_user(tmp, (char *)a, sizeof(tmp)))) - return -EFAULT; - if ((ret = eicon_set_msn(card, tmp))) - return ret; -#if 0 - if (card->flags & EICON_FLAGS_RUNNING) - return(eicon_capi_manufacturer_req_msn(card)); -#endif - return 0; #endif case EICON_IOCTL_ADDCARD: if ((ret = copy_from_user(&cdef, (char *)a, sizeof(cdef)))) @@ -674,6 +653,10 @@ eicon_command(eicon_card * card, isdn_ctrl * c) if (!(chan = find_channel(card, c->arg & 0x1f))) break; chan->l3prot = (c->arg >> 8); +#ifdef CONFIG_ISDN_TTY_FAX + if (chan->l3prot == ISDN_PROTO_L3_FAX) + chan->fax = c->parm.fax; +#endif return 0; case ISDN_CMD_GETL3: if (!card->flags & EICON_FLAGS_RUNNING) @@ -705,6 +688,17 @@ eicon_command(eicon_card * card, isdn_ctrl * c) case ISDN_CMD_UNLOCK: MOD_DEC_USE_COUNT; return 0; +#ifdef CONFIG_ISDN_TTY_FAX + case ISDN_CMD_FAXCMD: + if (!card->flags & EICON_FLAGS_RUNNING) + return -ENODEV; + if (!(chan = find_channel(card, c->arg & 0x1f))) + break; + if (!chan->fax) + break; + idi_fax_cmd(card, chan); + return 0; +#endif case ISDN_CMD_AUDIO: if (!card->flags & EICON_FLAGS_RUNNING) return -ENODEV; @@ -752,34 +746,13 @@ if_command(isdn_ctrl * c) static int if_writecmd(const u_char * buf, int len, int user, int id, int channel) { - eicon_card *card = eicon_findcard(id); - - if (card) { - if (!card->flags & EICON_FLAGS_RUNNING) - return -ENODEV; - return (len); - } - printk(KERN_ERR - "eicon: if_writecmd called with invalid driverId!\n"); - return -ENODEV; + return (len); } static int if_readstatus(u_char * buf, int len, int user, int id, int channel) { -#if 0 - /* Not yet used */ - eicon_card *card = eicon_findcard(id); - - if (card) { - if (!card->flags & EICON_FLAGS_RUNNING) - return -ENODEV; - return (eicon_readstatus(buf, len, user, card)); - } - printk(KERN_ERR - "eicon: if_readstatus called with invalid driverId!\n"); -#endif - return -ENODEV; + return 0; } static int @@ -802,6 +775,13 @@ if_sendbuf(int id, int channel, int ack, struct sk_buff *skb) return -ENODEV; } if (chan->fsm_state == EICON_STATE_ACTIVE) { +#ifdef CONFIG_ISDN_TTY_FAX + if (chan->l2prot == ISDN_PROTO_L2_FAX) { + if ((ret = idi_faxdata_send(card, chan, skb)) > 0) + ret = len; + } + else +#endif ret = idi_send_data(card, chan, ack, skb, 1); return (ret); } else { @@ -939,7 +919,7 @@ eicon_alloccard(int Type, int membase, int irq, char *id) ISDN_FEATURE_L2_V11019 | ISDN_FEATURE_L2_V11038 | ISDN_FEATURE_L2_MODEM | - ISDN_FEATURE_L2_FAX | + /* ISDN_FEATURE_L2_FAX | */ ISDN_FEATURE_L3_TRANSDSP | ISDN_FEATURE_L3_FAX; card->hwif.pci.card = (void *)card; @@ -963,7 +943,7 @@ eicon_alloccard(int Type, int membase, int irq, char *id) ISDN_FEATURE_L2_V11019 | ISDN_FEATURE_L2_V11038 | ISDN_FEATURE_L2_MODEM | - ISDN_FEATURE_L2_FAX | + /* ISDN_FEATURE_L2_FAX | */ ISDN_FEATURE_L3_TRANSDSP | ISDN_FEATURE_L3_FAX; card->hwif.pci.card = (void *)card; @@ -1056,7 +1036,7 @@ eicon_registercard(eicon_card * card) case EICON_BUS_MCA: eicon_isa_printpar(&card->hwif.isa); break; -#endif +#endif /* CONFIG_MCA */ #endif case EICON_BUS_PCI: #if CONFIG_PCI @@ -1095,7 +1075,7 @@ unregister_card(eicon_card * card) case EICON_BUS_ISA: #ifdef CONFIG_MCA case EICON_BUS_MCA: -#endif +#endif /* CONFIG_MCA */ eicon_isa_release(&card->hwif.isa); break; #endif @@ -1200,8 +1180,8 @@ eicon_addcard(int Type, int membase, int irq, char *id) #define eicon_init init_module #endif -__initfunc(int -eicon_init(void)) +int +eicon_init(void) { int card_count = 0; int release = 0; @@ -1231,8 +1211,8 @@ eicon_init(void)) printk("%s\n", eicon_getrev(tmprev)); release += getrel(tmprev); sprintf(tmprev,"%d", release); - printk(KERN_INFO "%s Release: %s.%s\n", DRIVERNAME, - DRIVERRELEASE, tmprev); + printk(KERN_INFO "%s Release: %s.%s%s\n", DRIVERNAME, + DRIVERRELEASE, tmprev, DRIVERPATCH); #ifdef CONFIG_ISDN_DRV_EICON_ISA #ifdef CONFIG_MCA @@ -1268,7 +1248,7 @@ eicon_init(void)) #else printk(KERN_INFO "Eicon: No PCI-cards found, driver not loaded !\n"); #endif -#endif +#endif /* MODULE */ return -ENODEV; } else @@ -1286,12 +1266,14 @@ cleanup_module(void) eicon_card *card = cards; eicon_card *last; while (card) { +#ifdef CONFIG_ISDN_DRV_EICON_ISA #ifdef CONFIG_MCA if (MCA_bus) { mca_mark_as_unused (card->mca_slot); mca_set_adapter_procfn(card->mca_slot, NULL, NULL); }; +#endif /* CONFIG_MCA */ #endif unregister_card(card); card = card->next; @@ -1306,13 +1288,15 @@ cleanup_module(void) } #else /* no module */ -__initfunc(void -eicon_setup(char *str, int *ints)) + +void +eicon_setup(char *str, int *ints) { int i, argc; argc = ints[0]; i = 1; +#ifdef CONFIG_ISDN_DRV_EICON_ISA if (argc) { membase = irq = -1; if (argc) { @@ -1330,10 +1314,14 @@ eicon_setup(char *str, int *ints)) } else { strcpy(id, "eicon"); } - /* eicon_addcard(0, membase, irq, id); */ - printk(KERN_INFO "eicon: membase=0x%x irq=%d id=%s\n", membase, irq, id); + printk(KERN_INFO "Eicon ISDN active driver setup (id=%s membase=0x%x irq=%d)\n", + id, membase, irq); } +#else + printk(KERN_INFO "Eicon ISDN active driver setup\n"); +#endif } + #endif /* MODULE */ #ifdef CONFIG_ISDN_DRV_EICON_ISA @@ -1444,7 +1432,7 @@ int eicon_mca_probe(int slot, /* slot-nr where the card was detected */ if (irq == -1) { irq = cards_irq; } else { - if (irq != irq) + if (irq != cards_irq) return ENODEV; }; cards_io= 0xC00 + ((adf_pos0>>4)*0x10); @@ -1477,7 +1465,7 @@ int eicon_mca_probe(int slot, /* slot-nr where the card was detected */ if (irq == -1) { irq = cards_irq; } else { - if (irq != irq) + if (irq != cards_irq) return ENODEV; }; type = 0; @@ -1493,8 +1481,13 @@ int eicon_mca_probe(int slot, /* slot-nr where the card was detected */ mca_mark_as_used(slot); cards->mca_slot = slot; /* card->io noch setzen oder ?? */ + cards->mca_io = cards_io; + cards->hwif.isa.io = cards_io; + /* reset card */ + outb_p(0,cards_io+1); + if (DebugVar & 8) - printk("eicon_addcard: erfolgreich fuer slot: %d.\n", + printk(KERN_INFO "eicon_addcard: successful for slot # %d.\n", cards->mca_slot+1); return 0 ; /* eicon_addcard hat eine Karte zugefuegt */ } else { diff --git a/drivers/isdn/eicon/eicon_pci.c b/drivers/isdn/eicon/eicon_pci.c index a5611394c3aa..954b9dba282a 100644 --- a/drivers/isdn/eicon/eicon_pci.c +++ b/drivers/isdn/eicon/eicon_pci.c @@ -1,4 +1,4 @@ -/* $Id: eicon_pci.c,v 1.9 1999/08/11 21:01:11 keil Exp $ +/* $Id: eicon_pci.c,v 1.10 1999/08/22 20:26:49 calle Exp $ * * ISDN low-level module for Eicon.Diehl active ISDN-Cards. * Hardware-specific code for PCI cards. @@ -26,6 +26,12 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: eicon_pci.c,v $ + * Revision 1.10 1999/08/22 20:26:49 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * * Revision 1.9 1999/08/11 21:01:11 keil * new PCI codefix * @@ -64,13 +70,14 @@ * */ +#include #include #include "eicon.h" #include "eicon_pci.h" -char *eicon_pci_revision = "$Revision: 1.9 $"; +char *eicon_pci_revision = "$Revision: 1.10 $"; #if CONFIG_PCI /* intire stuff is only for PCI */ @@ -145,8 +152,8 @@ int eicon_pci_find_card(char *ID) aparms->type = EICON_CTYPE_MAESTRA; aparms->irq = pdev->irq; - preg = get_pcibase(pdev, 2) & 0xfffffffc; - pcfg = get_pcibase(pdev, 1) & 0xffffff80; + preg = pdev->base_address[ 2] & 0xfffffffc; + pcfg = pdev->base_address[ 1] & 0xffffff80; #ifdef EICON_PCI_DEBUG printk(KERN_DEBUG "eicon_pci: irq=%d\n", aparms->irq); @@ -167,9 +174,9 @@ int eicon_pci_find_card(char *ID) printk(KERN_INFO "Eicon: DIVA Server PRI/PCI detected !\n"); aparms->type = EICON_CTYPE_MAESTRAP; /*includes 9M,30M*/ aparms->irq = pdev->irq; - pram = get_pcibase(pdev, 0) & 0xfffff000; - preg = get_pcibase(pdev, 2) & 0xfffff000; - pcfg = get_pcibase(pdev, 4) & 0xfffff000; + pram = pdev->base_address[ 0] & 0xfffff000; + preg = pdev->base_address[ 2] & 0xfffff000; + pcfg = pdev->base_address[ 4] & 0xfffff000; #ifdef EICON_PCI_DEBUG printk(KERN_DEBUG "eicon_pci: irq=%d\n", aparms->irq); diff --git a/drivers/isdn/hisax/Makefile b/drivers/isdn/hisax/Makefile index 051df6182716..e37d9c404d2d 100644 --- a/drivers/isdn/hisax/Makefile +++ b/drivers/isdn/hisax/Makefile @@ -30,6 +30,8 @@ ISAR_OBJ := HFC_OBJ := HFC_2BDS0 := JADE_OBJ := +W6692_OBJ := + ifeq ($(CONFIG_HISAX_16_0),y) O_OBJS += teles0.o ISAC_OBJ := isac.o @@ -170,6 +172,10 @@ ifeq ($(CONFIG_HISAX_GAZEL),y) HSCX_OBJ := hscx.o endif +ifeq ($(CONFIG_HISAX_W6692),y) + W6692_OBJ := w6692.o +endif + # ifeq ($(CONFIG_HISAX_TESTEMU),y) # O_OBJS += testemu.o # endif @@ -179,7 +185,7 @@ ifeq ($(ISAC_OBJ), isac.o) endif O_OBJS += $(ISAC_OBJ) $(HSCX_OBJ) $(ISAR_OBJ) $(JADE_OBJ) -O_OBJS += $(HFC_OBJ) $(HFC_2BDS0) +O_OBJS += $(HFC_OBJ) $(HFC_2BDS0) $(W6692_OBJ) OX_OBJS += config.o O_TARGET := diff --git a/drivers/isdn/hisax/arcofi.c b/drivers/isdn/hisax/arcofi.c index 641106a19197..1507b4c62f6c 100644 --- a/drivers/isdn/hisax/arcofi.c +++ b/drivers/isdn/hisax/arcofi.c @@ -1,4 +1,4 @@ -/* $Id: arcofi.c,v 1.7 1999/07/01 08:11:17 keil Exp $ +/* $Id: arcofi.c,v 1.8 1999/08/25 16:50:51 keil Exp $ * arcofi.c Ansteuerung ARCOFI 2165 * @@ -7,6 +7,9 @@ * * * $Log: arcofi.c,v $ + * Revision 1.8 1999/08/25 16:50:51 keil + * Fix bugs which cause 2.3.14 hangs (waitqueue init) + * * Revision 1.7 1999/07/01 08:11:17 keil * Common HiSax version for 2.0, 2.1, 2.2 and 2.3 kernel * @@ -151,4 +154,5 @@ init_arcofi(struct IsdnCardState *cs) { cs->dc.isac.arcofitimer.function = (void *) arcofi_timer; cs->dc.isac.arcofitimer.data = (long) cs; init_timer(&cs->dc.isac.arcofitimer); + test_and_set_bit(HW_ARCOFI, &cs->HW_Flags); } diff --git a/drivers/isdn/hisax/asuscom.c b/drivers/isdn/hisax/asuscom.c index 679cf9d1cd3a..762c9bfb8734 100644 --- a/drivers/isdn/hisax/asuscom.c +++ b/drivers/isdn/hisax/asuscom.c @@ -1,4 +1,4 @@ -/* $Id: asuscom.c,v 1.7 1999/07/12 21:04:53 keil Exp $ +/* $Id: asuscom.c,v 1.8 1999/09/04 06:20:05 keil Exp $ * asuscom.c low level stuff for ASUSCOM NETWORK INC. ISDNLink cards * @@ -8,6 +8,9 @@ * * * $Log: asuscom.c,v $ + * Revision 1.8 1999/09/04 06:20:05 keil + * Changes from kernel set_current_state() + * * Revision 1.7 1999/07/12 21:04:53 keil * fix race in IRQ handling * added watchdog for lost IRQs @@ -39,7 +42,7 @@ extern const char *CardType[]; -const char *Asuscom_revision = "$Revision: 1.7 $"; +const char *Asuscom_revision = "$Revision: 1.8 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) diff --git a/drivers/isdn/hisax/avm_a1p.c b/drivers/isdn/hisax/avm_a1p.c index 29b630c9b269..76382c3722b7 100644 --- a/drivers/isdn/hisax/avm_a1p.c +++ b/drivers/isdn/hisax/avm_a1p.c @@ -1,4 +1,4 @@ -/* $Id: avm_a1p.c,v 2.4 1999/07/12 21:04:55 keil Exp $ +/* $Id: avm_a1p.c,v 2.5 1999/09/01 08:26:34 calle Exp $ * * avm_a1p.c low level stuff for the following AVM cards: * A1 PCMCIA @@ -8,6 +8,9 @@ * Author Carsten Paeth (calle@calle.in-berlin.de) * * $Log: avm_a1p.c,v $ + * Revision 2.5 1999/09/01 08:26:34 calle + * Patch from Daniel Beichl to make A1 PCMCIA work again. + * * Revision 2.4 1999/07/12 21:04:55 keil * fix race in IRQ handling * added watchdog for lost IRQs @@ -71,7 +74,7 @@ #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) -static const char *avm_revision = "$Revision: 2.4 $"; +static const char *avm_revision = "$Revision: 2.5 $"; static inline u_char ReadISAC(struct IsdnCardState *cs, u_char offset) @@ -245,6 +248,7 @@ AVM_card_msg(struct IsdnCardState *cs, int mt, void *arg) return 0; case CARD_INIT: + byteout(cs->hw.avm.cfg_reg+ASL0_OFFSET,ASL0_W_TDISABLE|ASL0_W_TRESET|ASL0_W_IRQENABLE); clear_pending_isac_ints(cs); clear_pending_hscx_ints(cs); inithscxisac(cs, 1); diff --git a/drivers/isdn/hisax/avm_pci.c b/drivers/isdn/hisax/avm_pci.c index ef5ddd45fc4b..ac79d345c231 100644 --- a/drivers/isdn/hisax/avm_pci.c +++ b/drivers/isdn/hisax/avm_pci.c @@ -1,4 +1,4 @@ -/* $Id: avm_pci.c,v 1.11 1999/08/11 21:01:18 keil Exp $ +/* $Id: avm_pci.c,v 1.12 1999/09/04 06:20:05 keil Exp $ * avm_pci.c low level stuff for AVM Fritz!PCI and ISA PnP isdn cards * Thanks to AVM, Berlin for informations @@ -7,6 +7,9 @@ * * * $Log: avm_pci.c,v $ + * Revision 1.12 1999/09/04 06:20:05 keil + * Changes from kernel set_current_state() + * * Revision 1.11 1999/08/11 21:01:18 keil * new PCI codefix * @@ -50,13 +53,10 @@ #include "isac.h" #include "isdnl1.h" #include -#ifndef COMPAT_HAS_NEW_PCI -#include -#endif #include extern const char *CardType[]; -static const char *avm_pci_rev = "$Revision: 1.11 $"; +static const char *avm_pci_rev = "$Revision: 1.12 $"; #define AVM_FRITZ_PCI 1 #define AVM_FRITZ_PNP 2 @@ -482,7 +482,7 @@ HDLC_irq(struct BCState *bcs, u_int stat) { if (bcs->st->lli.l1writewakeup && (PACKET_NOACK != bcs->tx_skb->pkt_type)) bcs->st->lli.l1writewakeup(bcs->st, bcs->hw.hdlc.count); - idev_kfree_skb(bcs->tx_skb, FREE_WRITE); + dev_kfree_skb(bcs->tx_skb); bcs->hw.hdlc.count = 0; bcs->tx_skb = NULL; } @@ -609,7 +609,7 @@ close_hdlcstate(struct BCState *bcs) discard_queue(&bcs->rqueue); discard_queue(&bcs->squeue); if (bcs->tx_skb) { - idev_kfree_skb(bcs->tx_skb, FREE_WRITE); + dev_kfree_skb(bcs->tx_skb); bcs->tx_skb = NULL; test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); } @@ -773,11 +773,7 @@ AVM_card_msg(struct IsdnCardState *cs, int mt, void *arg) return(0); } -#ifdef COMPAT_HAS_NEW_PCI static struct pci_dev *dev_avm __initdata = NULL; -#else -static int pci_index __initdata = 0; -#endif __initfunc(int setup_avm_pcipnp(struct IsdnCard *card)) @@ -796,7 +792,6 @@ setup_avm_pcipnp(struct IsdnCard *card)) cs->subtyp = AVM_FRITZ_PNP; } else { #if CONFIG_PCI -#ifdef COMPAT_HAS_NEW_PCI if (!pci_present()) { printk(KERN_ERR "FritzPCI: no PCI bus present\n"); return(0); @@ -808,7 +803,7 @@ setup_avm_pcipnp(struct IsdnCard *card)) printk(KERN_WARNING "FritzPCI: No IRQ for PCI card found\n"); return(0); } - cs->hw.avm.cfg_reg = get_pcibase(dev_avm, 1) & + cs->hw.avm.cfg_reg = dev_avm->base_address[ 1] & PCI_BASE_ADDRESS_IO_MASK; if (!cs->hw.avm.cfg_reg) { printk(KERN_WARNING "FritzPCI: No IO-Adr for PCI card found\n"); @@ -819,36 +814,6 @@ setup_avm_pcipnp(struct IsdnCard *card)) printk(KERN_WARNING "FritzPCI: No PCI card found\n"); return(0); } -#else - for (; pci_index < 255; pci_index++) { - unsigned char pci_bus, pci_device_fn; - unsigned int ioaddr; - unsigned char irq; - - if (pcibios_find_device (PCI_VENDOR_AVM, - PCI_FRITZPCI_ID, pci_index, - &pci_bus, &pci_device_fn) != 0) { - continue; - } - pcibios_read_config_byte(pci_bus, pci_device_fn, - PCI_INTERRUPT_LINE, &irq); - pcibios_read_config_dword(pci_bus, pci_device_fn, - PCI_BASE_ADDRESS_1, &ioaddr); - cs->irq = irq; - cs->hw.avm.cfg_reg = ioaddr & PCI_BASE_ADDRESS_IO_MASK; - if (!cs->hw.avm.cfg_reg) { - printk(KERN_WARNING "FritzPCI: No IO-Adr for PCI card found\n"); - return(0); - } - cs->subtyp = AVM_FRITZ_PCI; - break; - } - if (pci_index == 255) { - printk(KERN_WARNING "FritzPCI: No PCI card found\n"); - return(0); - } - pci_index++; -#endif /* COMPAT_HAS_NEW_PCI */ cs->irq_flags |= SA_SHIRQ; #else printk(KERN_WARNING "FritzPCI: NO_PCI_BIOS\n"); diff --git a/drivers/isdn/hisax/bkm_a4t.c b/drivers/isdn/hisax/bkm_a4t.c index e97c8e9bf01e..3e8cc09b7b7e 100644 --- a/drivers/isdn/hisax/bkm_a4t.c +++ b/drivers/isdn/hisax/bkm_a4t.c @@ -1,4 +1,4 @@ -/* $Id: bkm_a4t.c,v 1.6 1999/08/11 21:01:22 keil Exp $ +/* $Id: bkm_a4t.c,v 1.8 1999/09/04 06:20:05 keil Exp $ * bkm_a4t.c low level stuff for T-Berkom A4T * derived from the original file sedlbauer.c * derived from the original file niccy.c @@ -7,6 +7,15 @@ * Author Roland Klabunde (R.Klabunde@Berkom.de) * * $Log: bkm_a4t.c,v $ + * Revision 1.8 1999/09/04 06:20:05 keil + * Changes from kernel set_current_state() + * + * Revision 1.7 1999/08/22 20:26:55 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * * Revision 1.6 1999/08/11 21:01:22 keil * new PCI codefix * @@ -28,6 +37,7 @@ #define __NO_VERSION__ +#include #include "hisax.h" #include "isac.h" #include "hscx.h" @@ -35,13 +45,10 @@ #include "isdnl1.h" #include "bkm_ax.h" #include -#ifndef COMPAT_HAS_NEW_PCI -#include -#endif extern const char *CardType[]; -const char *bkm_a4t_revision = "$Revision: 1.6 $"; +const char *bkm_a4t_revision = "$Revision: 1.8 $"; static inline u_char @@ -281,11 +288,7 @@ BKM_card_msg(struct IsdnCardState *cs, int mt, void *arg) return (0); } -#ifdef COMPAT_HAS_NEW_PCI static struct pci_dev *dev_a4t __initdata = NULL; -#else -static int pci_index __initdata = 0; -#endif __initfunc(int setup_bkm_a4t(struct IsdnCard *card)) @@ -295,9 +298,6 @@ __initfunc(int u_int pci_memaddr = 0, found = 0; I20_REGISTER_FILE *pI20_Regs; #if CONFIG_PCI -#ifndef COMPAT_HAS_NEW_PCI - u_char pci_bus, pci_device_fn, pci_irq = 0; -#endif #endif strcpy(tmp, bkm_a4t_revision); @@ -308,7 +308,6 @@ __initfunc(int return (0); #if CONFIG_PCI -#ifdef COMPAT_HAS_NEW_PCI if (!pci_present()) { printk(KERN_ERR "bkm_a4t: no PCI bus present\n"); return (0); @@ -320,40 +319,14 @@ __initfunc(int &sub_sys_id); if (sub_sys_id == ((A4T_SUBSYS_ID << 16) | A4T_SUBVEN_ID)) { found = 1; - pci_memaddr = get_pcibase(dev_a4t, 0); + pci_memaddr = dev_a4t->base_address[ 0]; cs->irq = dev_a4t->irq; } } -#else - for (; pci_index < 0xff; pci_index++) { - if (pcibios_find_device(I20_VENDOR_ID, - I20_DEVICE_ID, - pci_index, - &pci_bus, - &pci_device_fn) == PCIBIOS_SUCCESSFUL) { - u_int sub_sys_id = 0; - - pcibios_read_config_dword(pci_bus, pci_device_fn, - PCI_SUBSYSTEM_VENDOR_ID, &sub_sys_id); - if (sub_sys_id == ((A4T_SUBSYS_ID << 16) | A4T_SUBVEN_ID)) { - found = 1; - pcibios_read_config_byte(pci_bus, pci_device_fn, - PCI_INTERRUPT_LINE, &pci_irq); - cs->irq = pci_irq; - pcibios_read_config_dword(pci_bus, pci_device_fn, - PCI_BASE_ADDRESS_0, &pci_memaddr); - break; - } - } - } -#endif /* COMPAT_HAS_NEW_PCI */ if (!found) { printk(KERN_WARNING "HiSax: %s: Card not found\n", CardType[card->typ]); return (0); } -#ifndef COMPAT_HAS_NEW_PCI - pci_index++; -#endif if (!cs->irq) { /* IRQ range check ?? */ printk(KERN_WARNING "HiSax: %s: No IRQ\n", CardType[card->typ]); return (0); diff --git a/drivers/isdn/hisax/bkm_a8.c b/drivers/isdn/hisax/bkm_a8.c index 0e014ebc06e1..ecc854d33eea 100644 --- a/drivers/isdn/hisax/bkm_a8.c +++ b/drivers/isdn/hisax/bkm_a8.c @@ -1,4 +1,4 @@ -/* $Id: bkm_a8.c,v 1.6 1999/08/11 21:01:24 keil Exp $ +/* $Id: bkm_a8.c,v 1.8 1999/09/04 06:20:05 keil Exp $ * bkm_a8.c low level stuff for Scitel Quadro (4*S0, passive) * derived from the original file sedlbauer.c * derived from the original file niccy.c @@ -7,6 +7,15 @@ * Author Roland Klabunde (R.Klabunde@Berkom.de) * * $Log: bkm_a8.c,v $ + * Revision 1.8 1999/09/04 06:20:05 keil + * Changes from kernel set_current_state() + * + * Revision 1.7 1999/08/22 20:26:58 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * * Revision 1.6 1999/08/11 21:01:24 keil * new PCI codefix * @@ -27,6 +36,7 @@ */ #define __NO_VERSION__ +#include #include "hisax.h" #include "isac.h" #include "ipac.h" @@ -34,15 +44,12 @@ #include "isdnl1.h" #include "bkm_ax.h" #include -#ifndef COMPAT_HAS_NEW_PCI -#include -#endif #define ATTEMPT_PCI_REMAPPING /* Required for PLX rev 1 */ extern const char *CardType[]; -const char sct_quadro_revision[] = "$Revision: 1.6 $"; +const char sct_quadro_revision[] = "$Revision: 1.8 $"; /* To survive the startup phase */ typedef struct { @@ -334,11 +341,7 @@ BKM_card_msg(struct IsdnCardState *cs, int mt, void *arg) return (0); } -#ifdef COMPAT_HAS_NEW_PCI static struct pci_dev *dev_a8 __initdata = NULL; -#else -static int pci_index __initdata = 0; -#endif __initfunc(int setup_sct_quadro(struct IsdnCard *card)) @@ -365,7 +368,6 @@ __initfunc(int printk(KERN_WARNING "HiSax: %s: Invalid subcontroller in configuration, default to 1\n", CardType[card->typ]); #if CONFIG_PCI -#ifdef COMPAT_HAS_NEW_PCI if (!pci_present()) { printk(KERN_ERR "bkm_a4t: no PCI bus present\n"); return (0); @@ -377,46 +379,18 @@ __initfunc(int &sub_sys_id); if (sub_sys_id == ((SCT_SUBSYS_ID << 16) | SCT_SUBVEN_ID)) { found = 1; - pci_ioaddr1 = get_pcibase(dev_a8, 1); + pci_ioaddr1 = dev_a8->base_address[ 1]; pci_irq = dev_a8->irq; pci_bus = dev_a8->bus->number; pci_device_fn = dev_a8->devfn; } } -#else - for (; pci_index < 0xff; pci_index++) { - if (pcibios_find_device( - PLX_VENDOR_ID, - PLX_DEVICE_ID, - pci_index, - &pci_bus, - &pci_device_fn) == PCIBIOS_SUCCESSFUL) { - - u_int sub_sys_id = 0; - - pcibios_read_config_dword(pci_bus, pci_device_fn, - PCI_SUBSYSTEM_VENDOR_ID, &sub_sys_id); - if (sub_sys_id == ((SCT_SUBSYS_ID << 16) | SCT_SUBVEN_ID)) { - found = 1; - pcibios_read_config_byte(pci_bus, pci_device_fn, - PCI_INTERRUPT_LINE, &pci_irq); - pcibios_read_config_dword(pci_bus, pci_device_fn, - PCI_BASE_ADDRESS_1, &pci_ioaddr1); - cs->irq = pci_irq; - break; - } - } - } -#endif /* COMPAT_HAS_NEW_PCI */ if (!found) { printk(KERN_WARNING "HiSax: %s (%s): Card not found\n", CardType[card->typ], sct_quadro_subtypes[cs->subtyp]); return (0); } -#ifndef COMPAT_HAS_NEW_PCI - pci_index++; /* need for more as one card */ -#endif if (!pci_irq) { /* IRQ range check ?? */ printk(KERN_WARNING "HiSax: %s (%s): No IRQ\n", CardType[card->typ], @@ -438,9 +412,7 @@ __initfunc(int pci_ioaddr1 &= PCI_BASE_ADDRESS_IO_MASK; pcibios_write_config_dword(pci_bus, pci_device_fn, PCI_BASE_ADDRESS_1, pci_ioaddr1); -#ifdef COMPAT_HAS_NEW_PCI - get_pcibase(dev_a8, 1) = pci_ioaddr1; -#endif /* COMPAT_HAS_NEW_PCI */ + dev_a8->base_address[ 1] = pci_ioaddr1; } /* End HACK */ #endif diff --git a/drivers/isdn/hisax/callc.c b/drivers/isdn/hisax/callc.c index 6284a4cf38ca..c18c6a5db667 100644 --- a/drivers/isdn/hisax/callc.c +++ b/drivers/isdn/hisax/callc.c @@ -1,4 +1,4 @@ -/* $Id: callc.c,v 2.31 1999/08/05 20:43:10 keil Exp $ +/* $Id: callc.c,v 2.35 1999/09/04 06:20:05 keil Exp $ * Author Karsten Keil (keil@isdn4linux.de) * based on the teles driver from Jan den Ouden @@ -11,6 +11,23 @@ * Fritz Elfert * * $Log: callc.c,v $ + * Revision 2.35 1999/09/04 06:20:05 keil + * Changes from kernel set_current_state() + * + * Revision 2.34 1999/08/25 20:02:34 werner + * Changed return values for stat_icall(w) from 3->4 and 4->5 because of conflicts + * with existing software definitions. (PtP incomplete called party number) + * + * Revision 2.33 1999/08/25 17:00:09 keil + * Make ISAR V32bis modem running + * Make LL->HL interface open for additional commands + * + * Revision 2.32 1999/08/22 20:27:01 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * * Revision 2.31 1999/08/05 20:43:10 keil * ISAR analog modem support * @@ -131,15 +148,10 @@ #include "../avmb1/capicmd.h" /* this should be moved in a common place */ #ifdef MODULE -#ifdef COMPAT_HAS_NEW_SYMTAB #define MOD_USE_COUNT ( GET_USE_COUNT (&__this_module)) -#else -extern long mod_use_count_; -#define MOD_USE_COUNT mod_use_count_ -#endif /* COMPAT_HAS_NEW_SYMTAB */ #endif /* MODULE */ -const char *lli_revision = "$Revision: 2.31 $"; +const char *lli_revision = "$Revision: 2.35 $"; extern struct IsdnCard cards[]; extern int nrcards; @@ -195,7 +207,7 @@ discard_queue(struct sk_buff_head *q) int ret=0; while ((skb = skb_dequeue(q))) { - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); ret++; } return(ret); @@ -497,12 +509,12 @@ lli_deliver_call(struct FsmInst *fi, int event, void *arg) FsmChangeState(fi, ST_IN_ALERT_SENT); chanp->d_st->lli.l4l3(chanp->d_st, CC_ALERTING | REQUEST, chanp->proc); break; - case 4: /* direct redirect */ - case 3: /* Proceeding desired */ + case 5: /* direct redirect */ + case 4: /* Proceeding desired */ FsmDelTimer(&chanp->drel_timer, 61); FsmChangeState(fi, ST_IN_PROCEED_SEND); chanp->d_st->lli.l4l3(chanp->d_st, CC_PROCEED_SEND | REQUEST, chanp->proc); - if (ret == 4) + if (ret == 5) { chanp->setup = ic.parm.setup; chanp->d_st->lli.l4l3(chanp->d_st, CC_REDIR | REQUEST, chanp->proc); } @@ -970,6 +982,7 @@ release_b_st(struct Channel *chanp) case (ISDN_PROTO_L2_HDLC): case (ISDN_PROTO_L2_TRANS): case (ISDN_PROTO_L2_MODEM): + case (ISDN_PROTO_L2_FAX): releasestack_transl2(st); break; } @@ -1274,7 +1287,7 @@ lldata_handler(struct PStack *st, int pr, void *arg) if (chanp->data_open) chanp->cs->iif.rcvcallb_skb(chanp->cs->myid, chanp->chan, skb); else { - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); } break; case (DL_ESTABLISH | INDICATION): @@ -1304,7 +1317,7 @@ lltrans_handler(struct PStack *st, int pr, void *arg) chanp->cs->iif.rcvcallb_skb(chanp->cs->myid, chanp->chan, skb); else { link_debug(chanp, 0, "channel not open"); - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); } break; case (PH_ACTIVATE | INDICATION): @@ -1358,6 +1371,9 @@ init_b_st(struct Channel *chanp, int incoming) case (ISDN_PROTO_L2_MODEM): st->l1.mode = L1_MODE_V32; break; + case (ISDN_PROTO_L2_FAX): + st->l1.mode = L1_MODE_FAX; + break; } chanp->bcs->conmsg = NULL; if (chanp->bcs->BC_SetStack(st, chanp->bcs)) @@ -1387,6 +1403,7 @@ init_b_st(struct Channel *chanp, int incoming) case (ISDN_PROTO_L2_HDLC): case (ISDN_PROTO_L2_TRANS): case (ISDN_PROTO_L2_MODEM): + case (ISDN_PROTO_L2_FAX): st->l1.l1l2 = lltrans_handler; st->lli.userdata = chanp; st->lli.l1writewakeup = ll_writewakeup; @@ -1394,8 +1411,7 @@ init_b_st(struct Channel *chanp, int incoming) setstack_l3bc(st, chanp); break; } - test_and_set_bit(FLG_START_B, &chanp->Flags); - + test_and_set_bit(FLG_START_B, &chanp->Flags); return (0); } @@ -1408,7 +1424,7 @@ leased_l4l3(struct PStack *st, int pr, void *arg) switch (pr) { case (DL_DATA | REQUEST): link_debug(chanp, 0, "leased line d-channel DATA"); - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); break; case (DL_ESTABLISH | REQUEST): st->l2.l2l1(st, PH_ACTIVATE | REQUEST, NULL); @@ -1432,7 +1448,7 @@ leased_l1l2(struct PStack *st, int pr, void *arg) switch (pr) { case (PH_DATA | INDICATION): link_debug(chanp, 0, "leased line d-channel DATA"); - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); break; case (PH_ACTIVATE | INDICATION): case (PH_ACTIVATE | CONFIRM): @@ -1546,29 +1562,29 @@ lli_got_manufacturer(struct Channel *chanp, struct IsdnCardState *cs, capi_msg * /***************************************************************/ static int set_channel_limit(struct IsdnCardState *cs, int chanmax) -{ isdn_ctrl ic; - int i, ii; - - if ((chanmax < 0) || (chanmax > 2)) - return(-EINVAL); - cs->chanlimit = 0; - for (ii = 0; ii < 2; ii++) { - ic.driver = cs->myid; - ic.command = ISDN_STAT_DISCH; - ic.arg = ii; - if (ii >= chanmax) - ic.parm.num[0] = 0; /* disabled */ - else - ic.parm.num[0] = 1; /* enabled */ - i = cs->iif.statcallb(&ic); - if (i) return(-EINVAL); - if (ii < chanmax) - cs->chanlimit++; - } - return(0); +{ + isdn_ctrl ic; + int i, ii; + + if ((chanmax < 0) || (chanmax > 2)) + return(-EINVAL); + cs->chanlimit = 0; + for (ii = 0; ii < 2; ii++) { + ic.driver = cs->myid; + ic.command = ISDN_STAT_DISCH; + ic.arg = ii; + if (ii >= chanmax) + ic.parm.num[0] = 0; /* disabled */ + else + ic.parm.num[0] = 1; /* enabled */ + i = cs->iif.statcallb(&ic); + if (i) return(-EINVAL); + if (ii < chanmax) + cs->chanlimit++; + } + return(0); } /* set_channel_limit */ - int HiSax_command(isdn_ctrl * ic) { @@ -1577,7 +1593,6 @@ HiSax_command(isdn_ctrl * ic) struct Channel *chanp; int i; u_int num; - u_long adr; if (!csta) { printk(KERN_ERR @@ -1585,12 +1600,10 @@ HiSax_command(isdn_ctrl * ic) ic->command, ic->driver); return -ENODEV; } - switch (ic->command) { case (ISDN_CMD_SETEAZ): chanp = csta->channel + ic->arg; break; - case (ISDN_CMD_SETL2): chanp = csta->channel + (ic->arg & 0xff); if (chanp->debug & 1) @@ -1766,11 +1779,6 @@ HiSax_command(isdn_ctrl * ic) chanp->d_st->lli.l4l3(chanp->d_st, DL_ESTABLISH | REQUEST, NULL); break; - case (9): /* load firmware */ - memcpy(&adr, ic->parm.num, sizeof(ulong)); - csta->cardmsg(csta, CARD_LOAD_FIRM, - (void *) adr); - break; #ifdef MODULE case (55): MOD_USE_COUNT = 0; @@ -1796,23 +1804,12 @@ HiSax_command(isdn_ctrl * ic) printk(KERN_DEBUG "HiSax: l3 debugging flags card %d set to %x\n", csta->cardnr + 1, *(unsigned int *) ic->parm.num); break; - case (10): - i = *(unsigned int *) ic->parm.num; - if ((i < 0) || (i > 2)) - return(-EINVAL); /* invalid number */ + case (10): + i = *(unsigned int *) ic->parm.num; return(set_channel_limit(csta, i)); - break; - case (12): - i = *(unsigned int *) ic->parm.num; -#ifdef CONFIG_HISAX_HFC_PCI - if (csta->typ != ISDN_CTYPE_HFC_PCI) - return(-EINVAL); - return(hfcpci_set_echo(csta,i)); -#else - return(-EINVAL); -#endif - break; default: + if (csta->auxcmd) + return(csta->auxcmd(csta, ic)); printk(KERN_DEBUG "HiSax: invalid ioclt %d\n", (int) ic->arg); return (-EINVAL); @@ -1849,9 +1846,10 @@ HiSax_command(isdn_ctrl * ic) return(-EINVAL); break; default: - break; + if (csta->auxcmd) + return(csta->auxcmd(csta, ic)); + return(-EINVAL); } - return (0); } @@ -1904,7 +1902,7 @@ HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb) chanp->bcs->tx_cnt += len; st->l2.l2l1(st, PH_DATA | REQUEST, nskb); } - idev_kfree_skb(skb, FREE_WRITE); + dev_kfree_skb(skb); } else len = 0; restore_flags(flags); diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c index 6e54fd1dcfeb..6b7d42b523d2 100644 --- a/drivers/isdn/hisax/config.c +++ b/drivers/isdn/hisax/config.c @@ -1,10 +1,29 @@ -/* $Id: config.c,v 2.30 1999/08/05 20:43:14 keil Exp $ +/* $Id: config.c,v 2.36 1999/09/07 05:43:58 werner Exp $ * Author Karsten Keil (keil@isdn4linux.de) * based on the teles driver from Jan den Ouden * * * $Log: config.c,v $ + * Revision 2.36 1999/09/07 05:43:58 werner + * + * Added io as parameter 0 for HFC-PCI cards, if manual selection needed. + * + * Revision 2.35 1999/09/04 06:35:09 keil + * Winbond W6692 support + * + * Revision 2.34 1999/09/04 06:20:06 keil + * Changes from kernel set_current_state() + * + * Revision 2.33 1999/08/30 11:57:52 keil + * Fix broken avm pcmcia + * + * Revision 2.32 1999/08/28 22:11:10 keil + * __setup function should be static + * + * Revision 2.31 1999/08/25 16:47:43 keil + * Support new __setup; allow to add FEATURES after register_isdn + * * Revision 2.30 1999/08/05 20:43:14 keil * ISAR analog modem support * @@ -169,6 +188,8 @@ * 33 Scitel Quadro p0=subcontroller (4*S0, subctrl 1...4) * 34 Gazel ISDN cards * 35 HFC 2BDS0 PCI none + * 36 Winbond 6692 PCI none + * * protocol can be either ISDN_PTYPE_EURO or ISDN_PTYPE_1TR6 or ISDN_PTYPE_NI1 * * @@ -182,7 +203,7 @@ const char *CardType[] = "Compaq ISA", "NETjet", "Teles PCI", "Sedlbauer Speed Star (PCMCIA)", "AMD 7930", "NICCY", "S0Box", "AVM A1 (PCMCIA)", "AVM Fritz PnP/PCI", "Sedlbauer Speed Fax +", "Siemens I-Surf", "Acer P10", "HST Saphir", - "Telekom A4T", "Scitel Quadro", "Gazel", "HFC 2BDS0 PCI", + "Telekom A4T", "Scitel Quadro", "Gazel", "HFC 2BDS0 PCI", "Winbond 6692", }; void HiSax_closecard(int cardnr); @@ -191,15 +212,7 @@ void HiSax_closecard(int cardnr); #define DEFAULT_CARD ISDN_CTYPE_ELSA #define DEFAULT_CFG {0,0,0,0} int elsa_init_pcmcia(void*, int, int*, int); -#ifdef COMPAT_HAS_NEW_SYMTAB EXPORT_SYMBOL(elsa_init_pcmcia); -#else -static struct symbol_table hisax_syms_elsa = { -#include - X(elsa_init_pcmcia), -#include -}; -#endif /* COMPAT_HAS_NEW_SYMTAB */ #endif /* CONFIG_HISAX_ELSA */ #ifdef CONFIG_HISAX_AVM_A1 @@ -215,16 +228,8 @@ static struct symbol_table hisax_syms_elsa = { #define DEFAULT_CARD ISDN_CTYPE_A1_PCMCIA #define DEFAULT_CFG {11,0x170,0,0} int avm_a1_init_pcmcia(void*, int, int*, int); -#ifdef COMPAT_HAS_NEW_SYMTAB EXPORT_SYMBOL(avm_a1_init_pcmcia); -#else -static struct symbol_table hisax_syms_avm_a1= { -#include - X(avm_a1_init_pcmcia), - X(HiSax_closecard), -#include -}; -#endif /* COMPAT_HAS_NEW_SYMTAB */ +EXPORT_SYMBOL(HiSax_closecard); #endif /* CONFIG_HISAX_AVM_A1_PCMCIA */ #ifdef CONFIG_HISAX_FRITZPCI @@ -296,15 +301,7 @@ static struct symbol_table hisax_syms_avm_a1= { #define DEFAULT_CARD ISDN_CTYPE_SEDLBAUER #define DEFAULT_CFG {11,0x270,0,0} int sedl_init_pcmcia(void*, int, int*, int); -#ifdef COMPAT_HAS_NEW_SYMTAB EXPORT_SYMBOL(sedl_init_pcmcia); -#else -static struct symbol_table hisax_syms_sedl= { -#include - X(sedl_init_pcmcia), -#include -}; -#endif /* COMPAT_HAS_NEW_SYMTAB */ #endif /* CONFIG_HISAX_SEDLBAUER */ #ifdef CONFIG_HISAX_SPORTSTER @@ -392,6 +389,13 @@ static struct symbol_table hisax_syms_sedl= { #define DEFAULT_CFG {15,0x180,0,0} #endif +#ifdef CONFIG_HISAX_W6692 +#undef DEFAULT_CARD +#undef DEFAULT_CFG +#define DEFAULT_CARD ISDN_CTYPE_W6692 +#define DEFAULT_CFG {0,0,0,0} +#endif + #ifdef CONFIG_HISAX_1TR6 #define DEFAULT_PROTO ISDN_PTYPE_1TR6 #define DEFAULT_PROTO_NAME "1TR6" @@ -469,7 +473,6 @@ static int mem[] HISAX_INITDATA = {0, 0, 0, 0, 0, 0, 0, 0}; static char *id HISAX_INITDATA = HiSaxID; -#ifdef COMPAT_HAS_NEW_SYMTAB MODULE_AUTHOR("Karsten Keil"); MODULE_PARM(type, "1-8i"); MODULE_PARM(protocol, "1-8i"); @@ -481,7 +484,6 @@ MODULE_PARM(id, "s"); MODULE_PARM(io0, "1-8i"); MODULE_PARM(io1, "1-8i"); #endif /* CONFIG_HISAX_16_3 */ -#endif /* COMPAT_HAS_NEW_SYMTAB */ #endif /* MODULE */ int nrcards; @@ -514,9 +516,9 @@ HiSaxVersion(void)) printk(KERN_INFO "HiSax: Linux Driver for passive ISDN cards\n"); #ifdef MODULE - printk(KERN_INFO "HiSax: Version 3.3 (module)\n"); + printk(KERN_INFO "HiSax: Version 3.3a (module)\n"); #else - printk(KERN_INFO "HiSax: Version 3.3 (kernel)\n"); + printk(KERN_INFO "HiSax: Version 3.3a (kernel)\n"); #endif strcpy(tmp, l1_revision); printk(KERN_INFO "HiSax: Layer1 Revision %s\n", HiSax_getrev(tmp)); @@ -550,8 +552,8 @@ __initfunc(void HiSax_setup(char *str, int *ints)) { int i, j, argc; - argc = ints[0]; + printk(KERN_DEBUG"HiSax_setup: argc(%d) str(%s)\n", argc, str); i = 0; j = 1; while (argc && (i < HISAX_MAX_CARDS)) { @@ -590,7 +592,7 @@ HiSax_setup(char *str, int *ints)) HiSax_id = HiSaxID; } } -#endif +#endif /* MODULES */ #if CARD_TELES0 extern int setup_teles0(struct IsdnCard *card); @@ -684,11 +686,11 @@ extern int setup_saphir(struct IsdnCard *card); extern int setup_testemu(struct IsdnCard *card); #endif -#if CARD_BKM_A4T +#if CARD_BKM_A4T extern int setup_bkm_a4t(struct IsdnCard *card); #endif -#if CARD_SCT_QUADRO +#if CARD_SCT_QUADRO extern int setup_sct_quadro(struct IsdnCard *card); #endif @@ -696,6 +698,10 @@ extern int setup_sct_quadro(struct IsdnCard *card); extern int setup_gazel(struct IsdnCard *card); #endif +#if CARD_W6692 +extern int setup_w6692(struct IsdnCard *card); +#endif + /* * Find card with given driverId */ @@ -875,7 +881,7 @@ HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...) } int -ll_run(struct IsdnCardState *cs) +ll_run(struct IsdnCardState *cs, int addfeatures) { long flags; isdn_ctrl ic; @@ -884,6 +890,7 @@ ll_run(struct IsdnCardState *cs) cli(); ic.driver = cs->myid; ic.command = ISDN_STAT_RUN; + cs->iif.features |= addfeatures; cs->iif.statcallb(&ic); restore_flags(flags); return 0; @@ -933,7 +940,7 @@ closecard(int cardnr) csta->rcvbuf = NULL; } if (csta->tx_skb) { - idev_kfree_skb(csta->tx_skb, FREE_WRITE); + dev_kfree_skb(csta->tx_skb); csta->tx_skb = NULL; } if (csta->DC_Close != NULL) { @@ -1053,7 +1060,6 @@ checkcard(int cardnr, char *id, int *busy_flag)) cs->iif.features = ISDN_FEATURE_L2_X75I | ISDN_FEATURE_L2_HDLC | - ISDN_FEATURE_L2_MODEM | ISDN_FEATURE_L2_TRANS | ISDN_FEATURE_L3_TRANS | #ifdef CONFIG_HISAX_1TR6 @@ -1220,6 +1226,11 @@ checkcard(int cardnr, char *id, int *busy_flag)) case ISDN_CTYPE_GAZEL: ret = setup_gazel(card); break; +#endif +#if CARD_W6692 + case ISDN_CTYPE_W6692: + ret = setup_w6692(card); + break; #endif default: printk(KERN_WARNING @@ -1269,7 +1280,7 @@ checkcard(int cardnr, char *id, int *busy_flag)) CallcNewChan(cs); /* ISAR needs firmware download first */ if (!test_bit(HW_ISAR, &cs->HW_Flags)) - ll_run(cs); + ll_run(cs, 0); restore_flags(flags); return (1); } @@ -1419,27 +1430,18 @@ HiSax_init(void)) #ifdef CONFIG_HISAX_ELSA if (type[0] == ISDN_CTYPE_ELSA_PCMCIA) { /* we have exported and return in this case */ -#ifndef COMPAT_HAS_NEW_SYMTAB - register_symtab(&hisax_syms_elsa); -#endif return 0; } #endif #ifdef CONFIG_HISAX_SEDLBAUER if (type[0] == ISDN_CTYPE_SEDLBAUER_PCMCIA) { /* we have to export and return in this case */ -#ifndef COMPAT_HAS_NEW_SYMTAB - register_symtab(&hisax_syms_sedl); -#endif return 0; } #endif #ifdef CONFIG_HISAX_AVM_A1_PCMCIA if (type[0] == ISDN_CTYPE_A1_PCMCIA) { /* we have to export and return in this case */ -#ifndef COMPAT_HAS_NEW_SYMTAB - register_symtab(&hisax_syms_avm_a1); -#endif return 0; } #endif @@ -1482,6 +1484,7 @@ HiSax_init(void)) break; #endif case ISDN_CTYPE_ELSA: + case ISDN_CTYPE_HFC_PCI: cards[i].para[0] = io[i]; break; case ISDN_CTYPE_16_3: @@ -1517,6 +1520,7 @@ HiSax_init(void)) case ISDN_CTYPE_NETJET: case ISDN_CTYPE_AMD7930: case ISDN_CTYPE_TELESPCI: + case ISDN_CTYPE_W6692: break; case ISDN_CTYPE_BKM_A4T: break; @@ -1549,11 +1553,6 @@ HiSax_init(void)) if (HiSax_inithardware(NULL)) { /* Install only, if at least one card found */ #ifdef MODULE -#ifndef COMPAT_HAS_NEW_SYMTAB - /* No symbols to export, hide all symbols */ - register_symtab(NULL); - printk(KERN_INFO "HiSax: module installed\n"); -#endif /* COMPAT_HAS_NEW_SYMTAB */ #endif /* MODULE */ return (0); } else { diff --git a/drivers/isdn/hisax/diva.c b/drivers/isdn/hisax/diva.c index 482a90695f87..37f0382b786b 100644 --- a/drivers/isdn/hisax/diva.c +++ b/drivers/isdn/hisax/diva.c @@ -1,4 +1,4 @@ -/* $Id: diva.c,v 1.16 1999/08/11 21:01:25 keil Exp $ +/* $Id: diva.c,v 1.17 1999/09/04 06:20:06 keil Exp $ * diva.c low level stuff for Eicon.Diehl Diva Family ISDN cards * @@ -12,6 +12,9 @@ * * * $Log: diva.c,v $ + * Revision 1.17 1999/09/04 06:20:06 keil + * Changes from kernel set_current_state() + * * Revision 1.16 1999/08/11 21:01:25 keil * new PCI codefix * @@ -74,13 +77,10 @@ #include "ipac.h" #include "isdnl1.h" #include -#ifndef COMPAT_HAS_NEW_PCI -#include -#endif extern const char *CardType[]; -const char *Diva_revision = "$Revision: 1.16 $"; +const char *Diva_revision = "$Revision: 1.17 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) @@ -550,7 +550,7 @@ Memhscx_interrupt(struct IsdnCardState *cs, u_char val, u_char hscx) if (!(skb = dev_alloc_skb(count))) printk(KERN_WARNING "HSCX: receive out of memory\n"); else { - SET_SKB_FREE(skb); + ; memcpy(skb_put(skb, count), bcs->hw.hscx.rcvbuf, count); skb_queue_tail(&bcs->rqueue, skb); } @@ -566,7 +566,7 @@ Memhscx_interrupt(struct IsdnCardState *cs, u_char val, u_char hscx) if (!(skb = dev_alloc_skb(fifo_size))) printk(KERN_WARNING "HiSax: receive out of memory\n"); else { - SET_SKB_FREE(skb); + ; memcpy(skb_put(skb, fifo_size), bcs->hw.hscx.rcvbuf, fifo_size); skb_queue_tail(&bcs->rqueue, skb); } @@ -583,7 +583,7 @@ Memhscx_interrupt(struct IsdnCardState *cs, u_char val, u_char hscx) if (bcs->st->lli.l1writewakeup && (PACKET_NOACK != bcs->tx_skb->pkt_type)) bcs->st->lli.l1writewakeup(bcs->st, bcs->hw.hscx.count); - idev_kfree_skb(bcs->tx_skb, FREE_WRITE); + dev_kfree_skb(bcs->tx_skb); bcs->hw.hscx.count = 0; bcs->tx_skb = NULL; } @@ -880,13 +880,9 @@ Diva_card_msg(struct IsdnCardState *cs, int mt, void *arg) return(0); } -#ifdef COMPAT_HAS_NEW_PCI static struct pci_dev *dev_diva __initdata = NULL; static struct pci_dev *dev_diva_u __initdata = NULL; static struct pci_dev *dev_diva201 __initdata = NULL; -#else -static int pci_index __initdata = 0; -#endif __initfunc(int setup_diva(struct IsdnCard *card)) @@ -927,7 +923,6 @@ setup_diva(struct IsdnCard *card)) bytecnt = 8; } else { #if CONFIG_PCI -#ifdef COMPAT_HAS_NEW_PCI if (!pci_present()) { printk(KERN_ERR "Diva: no PCI bus present\n"); return(0); @@ -938,23 +933,23 @@ setup_diva(struct IsdnCard *card)) PCI_DIVA20_ID, dev_diva))) { cs->subtyp = DIVA_PCI; cs->irq = dev_diva->irq; - cs->hw.diva.cfg_reg = get_pcibase(dev_diva, 2) + cs->hw.diva.cfg_reg = dev_diva->base_address[ 2] & PCI_BASE_ADDRESS_IO_MASK; } else if ((dev_diva_u = pci_find_device(PCI_VENDOR_EICON_DIEHL, PCI_DIVA20_U_ID, dev_diva_u))) { cs->subtyp = DIVA_PCI; cs->irq = dev_diva_u->irq; - cs->hw.diva.cfg_reg = get_pcibase(dev_diva_u, 2) + cs->hw.diva.cfg_reg = dev_diva_u->base_address[ 2] & PCI_BASE_ADDRESS_IO_MASK; } else if ((dev_diva201 = pci_find_device(PCI_VENDOR_EICON_DIEHL, PCI_DIVA_201, dev_diva201))) { cs->subtyp = DIVA_IPAC_PCI; cs->irq = dev_diva201->irq; cs->hw.diva.pci_cfg = - (ulong) ioremap((get_pcibase(dev_diva201, 0) + (ulong) ioremap((dev_diva201->base_address[ 0] & PCI_BASE_ADDRESS_IO_MASK), 4096); cs->hw.diva.cfg_reg = - (ulong) ioremap((get_pcibase(dev_diva201, 1) + (ulong) ioremap((dev_diva201->base_address[ 1] & PCI_BASE_ADDRESS_IO_MASK), 4096); } else { printk(KERN_WARNING "Diva: No PCI card found\n"); @@ -970,66 +965,6 @@ setup_diva(struct IsdnCard *card)) printk(KERN_WARNING "Diva: No IO-Adr for PCI card found\n"); return(0); } -#else - u_char pci_bus, pci_device_fn, pci_irq; - u_int pci_ioaddr; - - cs->subtyp = 0; - for (; pci_index < 0xff; pci_index++) { - if (pcibios_find_device(PCI_VENDOR_EICON_DIEHL, - PCI_DIVA20_ID, pci_index, &pci_bus, &pci_device_fn) - == PCIBIOS_SUCCESSFUL) - cs->subtyp = DIVA_PCI; - else if (pcibios_find_device(PCI_VENDOR_EICON_DIEHL, - PCI_DIVA20_U_ID, pci_index, &pci_bus, &pci_device_fn) - == PCIBIOS_SUCCESSFUL) - cs->subtyp = DIVA_PCI; - else if (pcibios_find_device(PCI_VENDOR_EICON_DIEHL, - PCI_DIVA_201, pci_index, &pci_bus, &pci_device_fn) - == PCIBIOS_SUCCESSFUL) - cs->subtyp = DIVA_IPAC_PCI; - else - break; - /* get IRQ */ - pcibios_read_config_byte(pci_bus, pci_device_fn, - PCI_INTERRUPT_LINE, &pci_irq); - - /* get IO address */ - if (cs->subtyp == DIVA_IPAC_PCI) { - pcibios_read_config_dword(pci_bus, pci_device_fn, - PCI_BASE_ADDRESS_0, &pci_ioaddr); - cs->hw.diva.pci_cfg = (ulong) ioremap(pci_ioaddr, - 4096); - pcibios_read_config_dword(pci_bus, pci_device_fn, - PCI_BASE_ADDRESS_1, &pci_ioaddr); - cs->hw.diva.cfg_reg = (ulong) ioremap(pci_ioaddr, - 4096); - } else { - pcibios_read_config_dword(pci_bus, pci_device_fn, - PCI_BASE_ADDRESS_1, &pci_ioaddr); - cs->hw.diva.pci_cfg = pci_ioaddr & ~3; - pcibios_read_config_dword(pci_bus, pci_device_fn, - PCI_BASE_ADDRESS_2, &pci_ioaddr); - cs->hw.diva.cfg_reg = pci_ioaddr & ~3; - } - if (cs->subtyp) - break; - } - if (!cs->subtyp) { - printk(KERN_WARNING "Diva: No PCI card found\n"); - return(0); - } - pci_index++; - if (!pci_irq) { - printk(KERN_WARNING "Diva: No IRQ for PCI card found\n"); - return(0); - } - if (!pci_ioaddr) { - printk(KERN_WARNING "Diva: No IO-Adr for PCI card found\n"); - return(0); - } - cs->irq = pci_irq; -#endif /* COMPAT_HAS_NEW_PCI */ cs->irq_flags |= SA_SHIRQ; #else printk(KERN_WARNING "Diva: cfgreg 0 and NO_PCI_BIOS\n"); diff --git a/drivers/isdn/hisax/elsa.c b/drivers/isdn/hisax/elsa.c index 8f47869ba8f7..99ecade9817f 100644 --- a/drivers/isdn/hisax/elsa.c +++ b/drivers/isdn/hisax/elsa.c @@ -1,4 +1,4 @@ -/* $Id: elsa.c,v 2.17 1999/08/11 20:57:40 keil Exp $ +/* $Id: elsa.c,v 2.19 1999/09/04 06:20:06 keil Exp $ * elsa.c low level stuff for Elsa isdn cards * @@ -14,6 +14,12 @@ * for ELSA PCMCIA support * * $Log: elsa.c,v $ + * Revision 2.19 1999/09/04 06:20:06 keil + * Changes from kernel set_current_state() + * + * Revision 2.18 1999/08/25 16:50:54 keil + * Fix bugs which cause 2.3.14 hangs (waitqueue init) + * * Revision 2.17 1999/08/11 20:57:40 keil * bugfix IPAC version 1.1 * new PCI codefix @@ -88,15 +94,12 @@ #include "hscx.h" #include "isdnl1.h" #include -#ifndef COMPAT_HAS_NEW_PCI -#include -#endif #include #include extern const char *CardType[]; -const char *Elsa_revision = "$Revision: 2.17 $"; +const char *Elsa_revision = "$Revision: 2.19 $"; const char *Elsa_Types[] = {"None", "PC", "PCC-8", "PCC-16", "PCF", "PCF-Pro", "PCMCIA", "QS 1000", "QS 3000", "QS 1000 PCI", "QS 3000 PCI", @@ -180,6 +183,7 @@ const char *ITACVer[] = #define ELSA_IPAC_LINE_LED 0x40 /* Bit 6 Gelbe LED */ #define ELSA_IPAC_STAT_LED 0x80 /* Bit 7 Gruene LED */ +#if ARCOFI_USE static struct arcofi_msg ARCOFI_XOP_F = {NULL,0,2,{0xa1,0x3f,0,0,0,0,0,0,0,0}}; /* Normal OP */ static struct arcofi_msg ARCOFI_XOP_1 = @@ -203,9 +207,8 @@ static struct arcofi_msg ARCOFI_XOP_0 = static void set_arcofi(struct IsdnCardState *cs, int bc); -#if ARCOFI_USE #include "elsa_ser.c" -#endif +#endif /* ARCOFI_USE */ static inline u_char readreg(unsigned int ale, unsigned int adr, u_char off) @@ -432,6 +435,7 @@ elsa_interrupt(int intno, void *dev_id, struct pt_regs *regs) cs->hw.elsa.counter++; } } +#if ARCOFI_USE if (cs->hw.elsa.MFlag) { val = serial_inp(cs, UART_MCR); val ^= 0x8; @@ -440,6 +444,7 @@ elsa_interrupt(int intno, void *dev_id, struct pt_regs *regs) val ^= 0x8; serial_outp(cs, UART_MCR, val); } +#endif if (cs->hw.elsa.trig) byteout(cs->hw.elsa.trig, 0x00); writereg(cs->hw.elsa.ale, cs->hw.elsa.hscx, HSCX_MASK, 0x0); @@ -514,7 +519,9 @@ release_io_elsa(struct IsdnCardState *cs) int bytecnt = 8; del_timer(&cs->hw.elsa.tl); +#if ARCOFI_USE clear_arcofi(cs); +#endif if (cs->hw.elsa.ctrl) byteout(cs->hw.elsa.ctrl, 0); /* LEDs Out */ if (cs->subtyp == ELSA_QS1000PCI) { @@ -536,7 +543,9 @@ release_io_elsa(struct IsdnCardState *cs) (cs->subtyp == ELSA_PCF) || (cs->subtyp == ELSA_QS3000PCI)) { bytecnt = 16; +#if ARCOFI_USE release_modem(cs); +#endif } if (cs->hw.elsa.base) release_region(cs->hw.elsa.base, bytecnt); @@ -592,6 +601,8 @@ reset_elsa(struct IsdnCardState *cs) } } +#if ARCOFI_USE + static void set_arcofi(struct IsdnCardState *cs, int bc) { cs->dc.isac.arcofi_bc = bc; @@ -602,7 +613,6 @@ set_arcofi(struct IsdnCardState *cs, int bc) { static int check_arcofi(struct IsdnCardState *cs) { -#if ARCOFI_USE int arcofi_present = 0; char tmp[40]; char *t; @@ -690,9 +700,9 @@ check_arcofi(struct IsdnCardState *cs) interruptible_sleep_on(&cs->dc.isac.arcofi_wait); return(1); } -#endif return(0); } +#endif /* ARCOFI_USE */ static void elsa_led_handler(struct IsdnCardState *cs) @@ -738,8 +748,7 @@ elsa_led_handler(struct IsdnCardState *cs) static int Elsa_card_msg(struct IsdnCardState *cs, int mt, void *arg) { - int len, ret = 0; - u_char *msg; + int ret = 0; long flags; switch (mt) { @@ -828,8 +837,12 @@ Elsa_card_msg(struct IsdnCardState *cs, int mt, void *arg) cs->hw.elsa.status &= ~0x0100; } break; +#if ARCOFI_USE case CARD_AUX_IND: if (cs->hw.elsa.MFlag) { + int len; + u_char *msg; + if (!arg) return(0); msg = arg; @@ -838,6 +851,7 @@ Elsa_card_msg(struct IsdnCardState *cs, int mt, void *arg) modem_write_cmd(cs, msg, len); } break; +#endif } if (cs->typ == ISDN_CTYPE_ELSA) { int pwr = bytein(cs->hw.elsa.ale); @@ -914,12 +928,8 @@ probe_elsa(struct IsdnCardState *cs) return (CARD_portlist[i]); } -#ifdef COMPAT_HAS_NEW_PCI static struct pci_dev *dev_qs1000 __initdata = NULL; static struct pci_dev *dev_qs3000 __initdata = NULL; -#else -static int pci_index __initdata = 0; -#endif int setup_elsa(struct IsdnCard *card) @@ -1037,7 +1047,6 @@ setup_elsa(struct IsdnCard *card) cs->irq); } else if (cs->typ == ISDN_CTYPE_ELSA_PCI) { #if CONFIG_PCI -#ifdef COMPAT_HAS_NEW_PCI if (!pci_present()) { printk(KERN_ERR "Elsa: no PCI bus present\n"); return(0); @@ -1047,17 +1056,17 @@ setup_elsa(struct IsdnCard *card) dev_qs1000))) { cs->subtyp = ELSA_QS1000PCI; cs->irq = dev_qs1000->irq; - cs->hw.elsa.cfg = get_pcibase(dev_qs1000, 1) & + cs->hw.elsa.cfg = dev_qs1000->base_address[ 1] & PCI_BASE_ADDRESS_IO_MASK; - cs->hw.elsa.base = get_pcibase(dev_qs1000, 3) & + cs->hw.elsa.base = dev_qs1000->base_address[ 3] & PCI_BASE_ADDRESS_IO_MASK; } else if ((dev_qs3000 = pci_find_device(PCI_VENDOR_ELSA, PCI_QS3000_ID, dev_qs3000))) { cs->subtyp = ELSA_QS3000PCI; cs->irq = dev_qs3000->irq; - cs->hw.elsa.cfg = get_pcibase(dev_qs3000, 1) & + cs->hw.elsa.cfg = dev_qs3000->base_address[ 1] & PCI_BASE_ADDRESS_IO_MASK; - cs->hw.elsa.base = get_pcibase(dev_qs3000, 3) & + cs->hw.elsa.base = dev_qs3000->base_address[ 3] & PCI_BASE_ADDRESS_IO_MASK; } else { printk(KERN_WARNING "Elsa: No PCI card found\n"); @@ -1082,54 +1091,6 @@ setup_elsa(struct IsdnCard *card) HZDELAY(500); /* wait 500*10 ms */ restore_flags(flags); } -#else - u_char pci_bus, pci_device_fn, pci_irq; - u_int pci_ioaddr; - - cs->subtyp = 0; - for (; pci_index < 0xff; pci_index++) { - if (pcibios_find_device(PCI_VENDOR_ELSA, - PCI_QS1000_ID, pci_index, &pci_bus, &pci_device_fn) - == PCIBIOS_SUCCESSFUL) - cs->subtyp = ELSA_QS1000PCI; - else if (pcibios_find_device(PCI_VENDOR_ELSA, - PCI_QS3000_ID, pci_index, &pci_bus, &pci_device_fn) - == PCIBIOS_SUCCESSFUL) - cs->subtyp = ELSA_QS3000PCI; - else - break; - /* get IRQ */ - pcibios_read_config_byte(pci_bus, pci_device_fn, - PCI_INTERRUPT_LINE, &pci_irq); - - /* get IO address */ - pcibios_read_config_dword(pci_bus, pci_device_fn, - PCI_BASE_ADDRESS_1, &pci_ioaddr); - pci_ioaddr &= ~3; /* remove io/mem flag */ - cs->hw.elsa.cfg = pci_ioaddr; - pcibios_read_config_dword(pci_bus, pci_device_fn, - PCI_BASE_ADDRESS_3, &pci_ioaddr); - if (cs->subtyp) - break; - } - if (!cs->subtyp) { - printk(KERN_WARNING "Elsa: No PCI card found\n"); - return(0); - } - pci_index++; - if (!pci_irq) { - printk(KERN_WARNING "Elsa: No IRQ for PCI card found\n"); - return(0); - } - - if (!pci_ioaddr) { - printk(KERN_WARNING "Elsa: No IO-Adr for PCI card found\n"); - return(0); - } - pci_ioaddr &= ~3; /* remove io/mem flag */ - cs->hw.elsa.base = pci_ioaddr; - cs->irq = pci_irq; -#endif /* COMPAT_HAS_NEW_PCI */ cs->hw.elsa.ale = cs->hw.elsa.base; cs->hw.elsa.isac = cs->hw.elsa.base +1; cs->hw.elsa.hscx = cs->hw.elsa.base +1; @@ -1199,7 +1160,9 @@ setup_elsa(struct IsdnCard *card) request_region(cs->hw.elsa.cfg, 0x80, "elsa isdn pci"); } } +#if ARCOFI_USE init_arcofi(cs); +#endif cs->hw.elsa.tl.function = (void *) elsa_led_handler; cs->hw.elsa.tl.data = (long) cs; init_timer(&cs->hw.elsa.tl); diff --git a/drivers/isdn/hisax/elsa_ser.c b/drivers/isdn/hisax/elsa_ser.c index a1016fd4b40f..529a74815169 100644 --- a/drivers/isdn/hisax/elsa_ser.c +++ b/drivers/isdn/hisax/elsa_ser.c @@ -1,3 +1,4 @@ +#include #include #include @@ -297,7 +298,7 @@ modem_fill(struct BCState *bcs) { (PACKET_NOACK != bcs->tx_skb->pkt_type)) bcs->st->lli.l1writewakeup(bcs->st, bcs->hw.hscx.count); - idev_kfree_skb(bcs->tx_skb, FREE_WRITE); + dev_kfree_skb(bcs->tx_skb); bcs->tx_skb = NULL; } } @@ -388,74 +389,6 @@ static inline void transmit_chars(struct IsdnCardState *cs, int *intr_done) } } -#if 0 -static inline void check_modem_status(struct IsdnCardState *cs) -{ - int status; - struct async_struct *info = cs->hw.elsa.info; - struct async_icount *icount; - - status = serial_inp(info, UART_MSR); - - if (status & UART_MSR_ANY_DELTA) { - icount = &info->state->icount; - /* update input line counters */ - if (status & UART_MSR_TERI) - icount->rng++; - if (status & UART_MSR_DDSR) - icount->dsr++; - if (status & UART_MSR_DDCD) { - icount->dcd++; - } - if (status & UART_MSR_DCTS) - icount->cts++; -// wake_up_interruptible(&info->delta_msr_wait); - } - - if ((info->flags & ASYNC_CHECK_CD) && (status & UART_MSR_DDCD)) { -#if (defined(SERIAL_DEBUG_OPEN) || defined(SERIAL_DEBUG_INTR)) - printk("ttys%d CD now %s...", info->line, - (status & UART_MSR_DCD) ? "on" : "off"); -#endif - if (status & UART_MSR_DCD) -// wake_up_interruptible(&info->open_wait); -; - else if (!((info->flags & ASYNC_CALLOUT_ACTIVE) && - (info->flags & ASYNC_CALLOUT_NOHUP))) { -#ifdef SERIAL_DEBUG_OPEN - printk("doing serial hangup..."); -#endif - if (info->tty) - tty_hangup(info->tty); - } - } -#if 0 - if (info->flags & ASYNC_CTS_FLOW) { - if (info->tty->hw_stopped) { - if (status & UART_MSR_CTS) { -#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW)) - printk("CTS tx start..."); -#endif - info->tty->hw_stopped = 0; - info->IER |= UART_IER_THRI; - serial_outp(info, UART_IER, info->IER); -// rs_sched_event(info, RS_EVENT_WRITE_WAKEUP); - return; - } - } else { - if (!(status & UART_MSR_CTS)) { -#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW)) - printk("CTS tx stop..."); -#endif - info->tty->hw_stopped = 1; - info->IER &= ~UART_IER_THRI; - serial_outp(info, UART_IER, info->IER); - } - } - } -#endif 0 -} -#endif static void rs_interrupt_elsa(int irq, struct IsdnCardState *cs) { @@ -509,13 +442,13 @@ close_elsastate(struct BCState *bcs) bcs->hw.hscx.rcvbuf = NULL; } while ((skb = skb_dequeue(&bcs->rqueue))) { - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); } while ((skb = skb_dequeue(&bcs->squeue))) { - idev_kfree_skb(skb, FREE_WRITE); + dev_kfree_skb(skb); } if (bcs->tx_skb) { - idev_kfree_skb(bcs->tx_skb, FREE_WRITE); + dev_kfree_skb(bcs->tx_skb); bcs->tx_skb = NULL; test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); } diff --git a/drivers/isdn/hisax/gazel.c b/drivers/isdn/hisax/gazel.c index ea27f28b230f..56b05b5206a8 100644 --- a/drivers/isdn/hisax/gazel.c +++ b/drivers/isdn/hisax/gazel.c @@ -1,4 +1,4 @@ -/* $Id: gazel.c,v 2.5 1999/08/11 21:01:26 keil Exp $ +/* $Id: gazel.c,v 2.6 1999/08/22 20:27:03 calle Exp $ * gazel.c low level stuff for Gazel isdn cards * @@ -6,6 +6,12 @@ * based on source code from Karsten Keil * * $Log: gazel.c,v $ + * Revision 2.6 1999/08/22 20:27:03 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * * Revision 2.5 1999/08/11 21:01:26 keil * new PCI codefix * @@ -23,6 +29,7 @@ * Initial revision * */ +#include #define __NO_VERSION__ #include "hisax.h" #include "isac.h" @@ -30,12 +37,9 @@ #include "isdnl1.h" #include "ipac.h" #include -#ifndef COMPAT_HAS_NEW_PCI -#include -#endif extern const char *CardType[]; -const char *gazel_revision = "$Revision: 2.5 $"; +const char *gazel_revision = "$Revision: 2.6 $"; #define R647 1 #define R685 2 @@ -566,11 +570,7 @@ setup_gazelisa(struct IsdnCard *card, struct IsdnCardState *cs) return (0); } -#ifdef COMPAT_HAS_NEW_PCI static struct pci_dev *dev_tel __initdata = NULL; -#else -static int pci_index __initdata = 0; -#endif static int setup_gazelpci(struct IsdnCardState *cs) @@ -582,42 +582,19 @@ setup_gazelpci(struct IsdnCardState *cs) printk(KERN_WARNING "Gazel: PCI card automatic recognition\n"); found = 0; -#ifdef COMPAT_HAS_NEW_PCI if (!pci_present()) { printk(KERN_WARNING "Gazel: No PCI bus present\n"); return 1; } -#endif seekcard = GAZEL_R685; for (nbseek = 0; nbseek < 3; nbseek++) { -#ifdef COMPAT_HAS_NEW_PCI if ((dev_tel = pci_find_device(GAZEL_MANUFACTURER, seekcard, dev_tel))) { pci_irq = dev_tel->irq; - pci_ioaddr0 = get_pcibase(dev_tel, 1); - pci_ioaddr1 = get_pcibase(dev_tel, 2); - found = 1; - } -#else - for (; pci_index < 0xff; pci_index++) { - u_char pci_bus, pci_device_fn; - - if (pcibios_find_device(GAZEL_MANUFACTURER, seekcard, - pci_index, &pci_bus, &pci_device_fn) - != PCIBIOS_SUCCESSFUL) - break; - /* get IRQ */ - pcibios_read_config_byte(pci_bus, pci_device_fn, - PCI_INTERRUPT_LINE, &pci_irq); - /* get IO address */ - pcibios_read_config_dword(pci_bus, pci_device_fn, - PCI_BASE_ADDRESS_1, &pci_ioaddr0); - pcibios_read_config_dword(pci_bus, pci_device_fn, - PCI_BASE_ADDRESS_2, &pci_ioaddr1); + pci_ioaddr0 = dev_tel->base_address[ 1]; + pci_ioaddr1 = dev_tel->base_address[ 2]; found = 1; - break; } -#endif /* COMPAT_HAS_NEW_PCI */ if (found) break; else { @@ -629,9 +606,6 @@ setup_gazelpci(struct IsdnCardState *cs) seekcard = GAZEL_DJINN_ITOO; break; } -#ifndef COMPAT_HAS_NEW_PCI - pci_index = 0; -#endif } } if (!found) { diff --git a/drivers/isdn/hisax/hfc_2bds0.c b/drivers/isdn/hisax/hfc_2bds0.c index cbb64fbab98f..da6d93397e42 100644 --- a/drivers/isdn/hisax/hfc_2bds0.c +++ b/drivers/isdn/hisax/hfc_2bds0.c @@ -267,7 +267,7 @@ static struct sk_buff } else if (!(skb = dev_alloc_skb(count - 3))) printk(KERN_WARNING "HFC: receive out of memory\n"); else { - SET_SKB_FREE(skb); + ; ptr = skb_put(skb, count - 3); idx = 0; cip = HFCB_FIFO | HFCB_FIFO_OUT | HFCB_REC | HFCB_CHANNEL(bcs->channel); @@ -285,7 +285,7 @@ static struct sk_buff sti(); debugl1(cs, "RFIFO BUSY error"); printk(KERN_WARNING "HFC FIFO channel %d BUSY Error\n", bcs->channel); - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); skb = NULL; } else { cli(); @@ -301,7 +301,7 @@ static struct sk_buff bcs->channel, chksum, stat); if (stat) { debugl1(cs, "FIFO CRC error"); - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); skb = NULL; } } @@ -390,7 +390,7 @@ hfc_fill_fifo(struct BCState *bcs) if (bcs->st->lli.l1writewakeup && (PACKET_NOACK != bcs->tx_skb->pkt_type)) bcs->st->lli.l1writewakeup(bcs->st, bcs->tx_skb->len); - idev_kfree_skb(bcs->tx_skb, FREE_WRITE); + dev_kfree_skb(bcs->tx_skb); bcs->tx_skb = NULL; } WaitForBusy(cs); @@ -592,7 +592,7 @@ close_2bs0(struct BCState *bcs) discard_queue(&bcs->rqueue); discard_queue(&bcs->squeue); if (bcs->tx_skb) { - idev_kfree_skb(bcs->tx_skb, FREE_WRITE); + dev_kfree_skb(bcs->tx_skb); bcs->tx_skb = NULL; test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); } @@ -634,17 +634,6 @@ hfcd_bh(struct IsdnCardState *cs) */ if (!cs) return; -#if 0 - if (test_and_clear_bit(D_CLEARBUSY, &cs->event)) { - if (cs->debug) - debugl1(cs, "D-Channel Busy cleared"); - stptr = cs->stlist; - while (stptr != NULL) { - stptr->l1.l1l2(stptr, PH_PAUSE | CONFIRM, NULL); - stptr = stptr->next; - } - } -#endif if (test_and_clear_bit(D_L1STATECHANGE, &cs->event)) { switch (cs->dc.hfcd.ph_state) { case (0): @@ -737,7 +726,7 @@ int receive_dmsg(struct IsdnCardState *cs) while ((idx++ < rcnt) && WaitNoBusy(cs)) ReadReg(cs, HFCD_DATA_NODEB, cip); } else if ((skb = dev_alloc_skb(rcnt - 3))) { - SET_SKB_FREE(skb); + ; ptr = skb_put(skb, rcnt - 3); while (idx < (rcnt - 3)) { cli(); @@ -752,7 +741,7 @@ int receive_dmsg(struct IsdnCardState *cs) sti(); debugl1(cs, "RFIFO D BUSY error"); printk(KERN_WARNING "HFC DFIFO channel BUSY Error\n"); - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); skb = NULL; } else { cli(); @@ -768,7 +757,7 @@ int receive_dmsg(struct IsdnCardState *cs) chksum, stat); if (stat) { debugl1(cs, "FIFO CRC error"); - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); skb = NULL; } else { skb_queue_tail(&cs->rq, skb); @@ -865,7 +854,7 @@ hfc_fill_dfifo(struct IsdnCardState *cs) cli(); WaitNoBusy(cs); ReadReg(cs, HFCD_DATA, HFCD_FIFO | HFCD_F1_INC | HFCD_SEND); - idev_kfree_skb(cs->tx_skb, FREE_WRITE); + dev_kfree_skb(cs->tx_skb); cs->tx_skb = NULL; sti(); WaitForBusy(cs); @@ -999,7 +988,7 @@ hfc2bds0_interrupt(struct IsdnCardState *cs, u_char val) } goto afterXPR; } else { - idev_kfree_skb(cs->tx_skb, FREE_WRITE); + dev_kfree_skb(cs->tx_skb); cs->tx_cnt = 0; cs->tx_skb = NULL; } @@ -1114,32 +1103,6 @@ HFCD_l1hw(struct PStack *st, int pr, void *arg) cs->hw.hfcD.mst_m |= HFCD_MASTER; cs->writeisac(cs, HFCD_MST_MODE, cs->hw.hfcD.mst_m); break; -#if 0 - case (HW_TESTLOOP | REQUEST): - u_char val = 0; - if (1 & (int) arg) - val |= 0x0c; - if (2 & (int) arg) - val |= 0x3; - if (test_bit(HW_IOM1, &cs->HW_Flags)) { - /* IOM 1 Mode */ - if (!val) { - cs->writeisac(cs, ISAC_SPCR, 0xa); - cs->writeisac(cs, ISAC_ADF1, 0x2); - } else { - cs->writeisac(cs, ISAC_SPCR, val); - cs->writeisac(cs, ISAC_ADF1, 0xa); - } - } else { - /* IOM 2 Mode */ - cs->writeisac(cs, ISAC_SPCR, val); - if (val) - cs->writeisac(cs, ISAC_ADF1, 0x8); - else - cs->writeisac(cs, ISAC_ADF1, 0x0); - } - break; -#endif default: if (cs->debug & L1_DEB_WARN) debugl1(cs, "hfcd_l1hw unknown pr %4x", pr); @@ -1156,20 +1119,6 @@ setstack_hfcd(struct PStack *st, struct IsdnCardState *cs) static void hfc_dbusy_timer(struct IsdnCardState *cs) { -#if 0 - struct PStack *stptr; - if (test_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) { - if (cs->debug) - debugl1(cs, "D-Channel Busy"); - test_and_set_bit(FLG_L1_DBUSY, &cs->HW_Flags); - stptr = cs->stlist; - - while (stptr != NULL) { - stptr->l1.l1l2(stptr, PH_PAUSE | INDICATION, NULL); - stptr = stptr->next; - } - } -#endif } __initfunc(unsigned int diff --git a/drivers/isdn/hisax/hfc_2bs0.c b/drivers/isdn/hisax/hfc_2bs0.c index 86515e17d273..d9c1a99b63c5 100644 --- a/drivers/isdn/hisax/hfc_2bs0.c +++ b/drivers/isdn/hisax/hfc_2bs0.c @@ -222,7 +222,7 @@ hfc_empty_fifo(struct BCState *bcs, int count) if (!(skb = dev_alloc_skb(count - 3))) printk(KERN_WARNING "HFC: receive out of memory\n"); else { - SET_SKB_FREE(skb); + ; ptr = skb_put(skb, count - 3); idx = 0; cip = HFC_CIP | HFC_FIFO_OUT | HFC_REC | HFC_CHANNEL(bcs->channel); @@ -233,7 +233,7 @@ hfc_empty_fifo(struct BCState *bcs, int count) if (idx != count - 3) { debugl1(cs, "RFIFO BUSY error"); printk(KERN_WARNING "HFC FIFO channel %d BUSY Error\n", bcs->channel); - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); WaitNoBusy(cs); stat = cs->BC_Read_Reg(cs, HFC_DATA, HFC_CIP | HFC_F2_INC | HFC_REC | HFC_CHANNEL(bcs->channel)); @@ -251,7 +251,7 @@ hfc_empty_fifo(struct BCState *bcs, int count) bcs->channel, chksum, stat); if (stat) { debugl1(cs, "FIFO CRC error"); - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); skb = NULL; } WaitNoBusy(cs); @@ -325,7 +325,7 @@ hfc_fill_fifo(struct BCState *bcs) bcs->tx_cnt -= count; if (PACKET_NOACK == bcs->tx_skb->pkt_type) count = -1; - idev_kfree_skb(bcs->tx_skb, FREE_WRITE); + dev_kfree_skb(bcs->tx_skb); bcs->tx_skb = NULL; WaitForBusy(cs); WaitNoBusy(cs); @@ -523,7 +523,7 @@ close_hfcstate(struct BCState *bcs) discard_queue(&bcs->rqueue); discard_queue(&bcs->squeue); if (bcs->tx_skb) { - idev_kfree_skb(bcs->tx_skb, FREE_WRITE); + dev_kfree_skb(bcs->tx_skb); bcs->tx_skb = NULL; test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); } diff --git a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c index 2d972f3fe625..d61016b0e5da 100644 --- a/drivers/isdn/hisax/hfc_pci.c +++ b/drivers/isdn/hisax/hfc_pci.c @@ -1,4 +1,4 @@ -/* $Id: hfc_pci.c,v 1.13 1999/08/11 21:01:28 keil Exp $ +/* $Id: hfc_pci.c,v 1.20 1999/09/07 06:18:55 werner Exp $ * hfc_pci.c low level driver for CCD´s hfc-pci based cards * @@ -23,6 +23,32 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: hfc_pci.c,v $ + * Revision 1.20 1999/09/07 06:18:55 werner + * + * Added io parameter for HFC-PCI based cards. Needed only with multiple cards + * when initialisation/selection order needs to be set. + * + * Revision 1.19 1999/09/04 06:20:06 keil + * Changes from kernel set_current_state() + * + * Revision 1.18 1999/08/29 17:05:44 werner + * corrected tx_lo line setup. Datasheet is not correct. + * + * Revision 1.17 1999/08/28 21:04:27 werner + * Implemented full audio support (transparent mode) + * + * Revision 1.16 1999/08/25 17:01:27 keil + * Use new LL->HL auxcmd call + * + * Revision 1.15 1999/08/22 20:27:05 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * + * Revision 1.14 1999/08/12 18:59:45 werner + * Added further manufacturer and device ids to PCI list + * * Revision 1.13 1999/08/11 21:01:28 keil * new PCI codefix * @@ -67,32 +93,43 @@ * */ +#include #define __NO_VERSION__ #include "hisax.h" #include "hfc_pci.h" #include "isdnl1.h" #include -#ifndef COMPAT_HAS_NEW_PCI -#include -#endif #include extern const char *CardType[]; -static const char *hfcpci_revision = "$Revision: 1.13 $"; - -static const int CCD_VENDOR_IDS[] = { - 0x1043, /* Asuscom */ - 0x1051, /* Motorola MC145575 */ - 0x1397, /* CCD and Billion */ - 0, -}; - -static const int CCD_DEVICE_IDS[] = { - 0x675, /* Asuscom */ - 0x100, /* Motorola MC145575 */ - 0x2BD0, /* CCD and Billion */ - 0, +static const char *hfcpci_revision = "$Revision: 1.20 $"; + +/* table entry in the PCI devices list */ +typedef struct { + int vendor_id; + int device_id; + char *vendor_name; + char *card_name; + } PCI_ENTRY; + +static const PCI_ENTRY id_list[] = { + {0x1397,0x2BD0,"CCD/Billion/Asuscom","2BD0"}, + {0x1397,0xB000,"Billion","B000"}, + {0x1397,0xB006,"Billion","B006"}, + {0x1397,0xB007,"Billion","B007"}, + {0x1397,0xB008,"Billion","B008"}, + {0x1397,0xB009,"Billion","B009"}, + {0x1397,0xB00A,"Billion","B00A"}, + {0x1397,0xB00B,"Billion","B00B"}, + {0x1397,0xB00C,"Billion","B00C"}, + {0x1043,0x0675,"Asuscom/Askey","675"}, + {0x0871,0xFFA2,"German telekom","T-Concept"}, + {0x0871,0xFFA1,"German telekom","A1T"}, + {0x1051,0x0100,"Motorola MC145575","MC145575"}, + {0x1397,0xB100,"Seyeon","B100"}, + {0x15B0,0x2BD0,"Zoltrix","2BD0"}, + {0,0,NULL,NULL}, }; @@ -155,7 +192,7 @@ reset_hfcpci(struct IsdnCardState *cs) cs->hw.hfcpci.fifo_en = 0x30; /* only D fifos enabled */ Write_hfc(cs, HFCPCI_FIFO_EN, cs->hw.hfcpci.fifo_en); - cs->hw.hfcpci.trm = 0; /* no echo connect */ + cs->hw.hfcpci.trm = 0 + HFCPCI_BTRANS_THRESMASK; /* no echo connect , threshold */ Write_hfc(cs, HFCPCI_TRM, cs->hw.hfcpci.trm); Write_hfc(cs, HFCPCI_CLKDEL, 0x0e); /* ST-Bit delay for TE-Mode */ @@ -181,7 +218,7 @@ reset_hfcpci(struct IsdnCardState *cs) cs->hw.hfcpci.mst_m = HFCPCI_MASTER; /* HFC Master Mode */ Write_hfc(cs, HFCPCI_MST_MODE, cs->hw.hfcpci.mst_m); - cs->hw.hfcpci.sctrl = 0; + cs->hw.hfcpci.sctrl = 0x40; /* set tx_lo mode, error in datasheet ! */ Write_hfc(cs, HFCPCI_SCTRL, cs->hw.hfcpci.sctrl); cs->hw.hfcpci.sctrl_r = 0; Write_hfc(cs, HFCPCI_SCTRL_R, cs->hw.hfcpci.sctrl_r); @@ -285,7 +322,7 @@ hfcpci_empty_fifo(struct BCState *bcs, bzfifo_type * bz, u_char * bdata, int cou } else if (!(skb = dev_alloc_skb(count - 3))) printk(KERN_WARNING "HFCPCI: receive out of memory\n"); else { - SET_SKB_FREE(skb); + ; total = count; count -= 3; ptr = skb_put(skb, count); @@ -349,7 +386,7 @@ receive_dmsg(struct IsdnCardState *cs) df->f2 = ((df->f2 + 1) & MAX_D_FRAMES) | (MAX_D_FRAMES + 1); /* next buffer */ df->za[df->f2 & D_FREG_MASK].z2 = (zp->z2 + rcnt) & (D_FIFO_SIZE - 1); } else if ((skb = dev_alloc_skb(rcnt - 3))) { - SET_SKB_FREE(skb); + ; total = rcnt; rcnt -= 3; ptr = skb_put(skb, rcnt); @@ -380,6 +417,59 @@ receive_dmsg(struct IsdnCardState *cs) return (1); } +/*******************************************************************************/ +/* check for transparent receive data and read max one threshold size if avail */ +/*******************************************************************************/ +int hfcpci_empty_fifo_trans(struct BCState *bcs, bzfifo_type *bz, u_char *bdata) +{ unsigned short *z1r, *z2r; + int new_z2, fcnt, maxlen; + struct sk_buff *skb; + u_char *ptr, *ptr1; + + z1r = &bz->za[MAX_B_FRAMES].z1; /* pointer to z reg */ + z2r = z1r + 1; + + if (!(fcnt = *z1r - *z2r)) + return(0); /* no data avail */ + + if (fcnt <= 0) + fcnt += B_FIFO_SIZE; /* bytes actually buffered */ + if (fcnt > HFCPCI_BTRANS_THRESHOLD) + fcnt = HFCPCI_BTRANS_THRESHOLD; /* limit size */ + + new_z2 = *z2r + fcnt; /* new position in fifo */ + if (new_z2 >= (B_FIFO_SIZE + B_SUB_VAL)) + new_z2 -= B_FIFO_SIZE; /* buffer wrap */ + + if (!(skb = dev_alloc_skb(fcnt))) + printk(KERN_WARNING "HFCPCI: receive out of memory\n"); + else { + ; + ptr = skb_put(skb, fcnt); + if (*z2r + fcnt <= B_FIFO_SIZE + B_SUB_VAL) + maxlen = fcnt; /* complete transfer */ + else + maxlen = B_FIFO_SIZE + B_SUB_VAL - *z2r; /* maximum */ + + ptr1 = bdata + (*z2r - B_SUB_VAL); /* start of data */ + memcpy(ptr, ptr1, maxlen); /* copy data */ + fcnt -= maxlen; + + if (fcnt) { /* rest remaining */ + ptr += maxlen; + ptr1 = bdata; /* start of buffer */ + memcpy(ptr, ptr1, fcnt); /* rest */ + } + cli(); + skb_queue_tail(&bcs->rqueue, skb); + sti(); + hfcpci_sched_event(bcs, B_RCVBUFREADY); + } + + *z2r = new_z2; /* new position */ + return(1); +} /* hfcpci_empty_fifo_trans */ + /**********************************/ /* B-channel main receive routine */ /**********************************/ @@ -439,8 +529,11 @@ main_rec_hfcpci(struct BCState *bcs) receive = 1; else receive = 0; - } else - receive = 0; + } else + if (bcs->mode == L1_MODE_TRANS) + receive = hfcpci_empty_fifo_trans(bcs, bz, bdata); + else + receive = 0; test_and_clear_bit(FLG_LOCK_ATOMIC, &cs->HW_Flags); if (count && receive) goto Begin; @@ -515,7 +608,7 @@ hfcpci_fill_dfifo(struct IsdnCardState *cs) df->f1 = new_f1; /* next frame */ restore_flags(flags); - idev_kfree_skb(cs->tx_skb, FREE_WRITE); + dev_kfree_skb(cs->tx_skb); cs->tx_skb = NULL; return; } @@ -532,6 +625,7 @@ hfcpci_fill_fifo(struct BCState *bcs) bzfifo_type *bz; u_char *bdata; u_char new_f1, *src, *dst; + unsigned short *z1t, *z2t; if (!bcs->tx_skb) return; @@ -549,8 +643,60 @@ hfcpci_fill_fifo(struct BCState *bcs) bdata = ((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.txdat_b1; } + if (bcs->mode == L1_MODE_TRANS) { + z1t = &bz->za[MAX_B_FRAMES].z1; + z2t = z1t + 1; + if (cs->debug & L1_DEB_HSCX) + debugl1(cs, "hfcpci_fill_fifo_trans %d z1(%x) z2(%x)", + bcs->channel, *z1t, *z2t); + fcnt = *z2t - *z1t; + if (fcnt <= 0) + fcnt += B_FIFO_SIZE; /* fcnt contains available bytes in fifo */ + fcnt = B_FIFO_SIZE - fcnt; /* remaining bytes to send */ + + while ((fcnt < 2 * HFCPCI_BTRANS_THRESHOLD) && (bcs->tx_skb)) { + if (bcs->tx_skb->len < B_FIFO_SIZE - fcnt) { + /* data is suitable for fifo */ + count = bcs->tx_skb->len; + + new_z1 = *z1t + count; /* new buffer Position */ + if (new_z1 >= (B_FIFO_SIZE + B_SUB_VAL)) + new_z1 -= B_FIFO_SIZE; /* buffer wrap */ + src = bcs->tx_skb->data; /* source pointer */ + dst = bdata + (*z1t - B_SUB_VAL); + maxlen = (B_FIFO_SIZE + B_SUB_VAL) - *z1t; /* end of fifo */ + if (maxlen > count) + maxlen = count; /* limit size */ + memcpy(dst, src, maxlen); /* first copy */ + + count -= maxlen; /* remaining bytes */ + if (count) { + dst = bdata; /* start of buffer */ + src += maxlen; /* new position */ + memcpy(dst, src, count); + } + bcs->tx_cnt -= bcs->tx_skb->len; + fcnt += bcs->tx_skb->len; + *z1t = new_z1; /* now send data */ + } + else + if (cs->debug & L1_DEB_HSCX) + debugl1(cs, "hfcpci_fill_fifo_trans %d frame length %d discarded", + bcs->channel, bcs->tx_skb->len); + + dev_kfree_skb(bcs->tx_skb); + cli(); + bcs->tx_skb = skb_dequeue(&bcs->squeue); /* fetch next data */ + sti(); + } + test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); + restore_flags(flags); + return; + } + + if (cs->debug & L1_DEB_HSCX) - debugl1(cs, "hfcpci_fill_fifo %d f1(%d) f2(%d) z1(f1)(%x)", + debugl1(cs, "hfcpci_fill_fifo_hdlc %d f1(%d) f2(%d) z1(f1)(%x)", bcs->channel, bz->f1, bz->f2, bz->za[bz->f1].z1); @@ -608,7 +754,7 @@ hfcpci_fill_fifo(struct BCState *bcs) bz->f1 = new_f1; /* next frame */ restore_flags(flags); - idev_kfree_skb(bcs->tx_skb, FREE_WRITE); + dev_kfree_skb(bcs->tx_skb); bcs->tx_skb = NULL; test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); return; @@ -617,9 +763,12 @@ hfcpci_fill_fifo(struct BCState *bcs) /***********************/ /* set/reset echo mode */ /***********************/ -int hfcpci_set_echo(struct IsdnCardState *cs, int i) -{ int flags; - +static int +hfcpci_auxcmd(struct IsdnCardState *cs, isdn_ctrl *ic) +{ + int flags; + int i = *(unsigned int *) ic->parm.num; + if (cs->chanlimit > 1) return(-EINVAL); @@ -650,7 +799,7 @@ int hfcpci_set_echo(struct IsdnCardState *cs, int i) Write_hfc(cs, HFCPCI_INT_M1, cs->hw.hfcpci.int_m1); restore_flags(flags); return(0); -} /* hfcpci_set_echo */ +} /* hfcpci_auxcmd */ /*****************************/ /* E-channel receive routine */ @@ -892,7 +1041,7 @@ hfcpci_interrupt(int intno, void *dev_id, struct pt_regs *regs) } goto afterXPR; } else { - idev_kfree_skb(cs->tx_skb, FREE_WRITE); + dev_kfree_skb(cs->tx_skb); cs->tx_cnt = 0; cs->tx_skb = NULL; } @@ -926,20 +1075,6 @@ hfcpci_interrupt(int intno, void *dev_id, struct pt_regs *regs) static void hfcpci_dbusy_timer(struct IsdnCardState *cs) { -#if 0 - struct PStack *stptr; - if (test_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) { - if (cs->debug) - debugl1(cs, "D-Channel Busy"); - test_and_set_bit(FLG_L1_DBUSY, &cs->HW_Flags); - stptr = cs->stlist; - - while (stptr != NULL) { - stptr->l1.l1l2(stptr, PH_PAUSE | INDICATION, NULL); - stptr = stptr->next; - } - } -#endif } /*************************************/ @@ -1032,32 +1167,6 @@ HFCPCI_l1hw(struct PStack *st, int pr, void *arg) cs->hw.hfcpci.mst_m |= HFCPCI_MASTER; Write_hfc(cs, HFCPCI_MST_MODE, cs->hw.hfcpci.mst_m); break; -#if 0 - case (HW_TESTLOOP | REQUEST): - u_char val = 0; - if (1 & (int) arg) - val |= 0x0c; - if (2 & (int) arg) - val |= 0x3; - if (test_bit(HW_IOM1, &cs->HW_Flags)) { - /* IOM 1 Mode */ - if (!val) { - cs->writeisac(cs, ISAC_SPCR, 0xa); - cs->writeisac(cs, ISAC_ADF1, 0x2); - } else { - cs->writeisac(cs, ISAC_SPCR, val); - cs->writeisac(cs, ISAC_ADF1, 0xa); - } - } else { - /* IOM 2 Mode */ - cs->writeisac(cs, ISAC_SPCR, val); - if (val) - cs->writeisac(cs, ISAC_ADF1, 0x8); - else - cs->writeisac(cs, ISAC_ADF1, 0x0); - } - break; -#endif default: if (cs->debug & L1_DEB_WARN) debugl1(cs, "hfcpci_l1hw unknown pr %4x", pr); @@ -1096,6 +1205,7 @@ void mode_hfcpci(struct BCState *bcs, int mode, int bc) { struct IsdnCardState *cs = bcs->cs; + bzfifo_type *bzr, *bzt; int flags; if (cs->debug & L1_DEB_HSCX) @@ -1142,6 +1252,8 @@ mode_hfcpci(struct BCState *bcs, int mode, int bc) cs->hw.hfcpci.sctrl_r |= SCTRL_B2_ENA; cs->hw.hfcpci.fifo_en |= HFCPCI_FIFOEN_B2; cs->hw.hfcpci.int_m1 |= (HFCPCI_INTS_B2TRANS+HFCPCI_INTS_B2REC); + bzr = &((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.rxbz_b2; + bzt = &((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.txbz_b2; } else { cs->hw.hfcpci.ctmt |= 1; cs->hw.hfcpci.conn &= ~0x03; @@ -1149,7 +1261,17 @@ mode_hfcpci(struct BCState *bcs, int mode, int bc) cs->hw.hfcpci.sctrl_r |= SCTRL_B1_ENA; cs->hw.hfcpci.fifo_en |= HFCPCI_FIFOEN_B1; cs->hw.hfcpci.int_m1 |= (HFCPCI_INTS_B1TRANS+HFCPCI_INTS_B1REC); + bzr = &((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.rxbz_b1; + bzt = &((fifo_area *) (cs->hw.hfcpci.fifos))->b_chans.txbz_b1; } + bzr->za[MAX_B_FRAMES].z1 = B_FIFO_SIZE + B_SUB_VAL - 1; + bzr->za[MAX_B_FRAMES].z2 = bzr->za[MAX_B_FRAMES].z1; + bzr->f1 = MAX_B_FRAMES; + bzr->f2 = bzr->f1; /* init F pointers to remain constant */ + bzt->za[MAX_B_FRAMES].z1 = B_FIFO_SIZE + B_SUB_VAL - 1; + bzt->za[MAX_B_FRAMES].z2 = bzt->za[MAX_B_FRAMES].z1; + bzt->f1 = MAX_B_FRAMES; + bzt->f2 = bzt->f1; /* init F pointers to remain constant */ break; case (L1_MODE_HDLC): if (bc) { @@ -1263,7 +1385,7 @@ close_hfcpci(struct BCState *bcs) discard_queue(&bcs->rqueue); discard_queue(&bcs->squeue); if (bcs->tx_skb) { - idev_kfree_skb(bcs->tx_skb, FREE_WRITE); + dev_kfree_skb(bcs->tx_skb); bcs->tx_skb = NULL; test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); } @@ -1314,17 +1436,6 @@ hfcpci_bh(struct IsdnCardState *cs) */ if (!cs) return; -#if 0 - if (test_and_clear_bit(D_CLEARBUSY, &cs->event)) { - if (cs->debug) - debugl1(cs, "D-Channel Busy cleared"); - stptr = cs->stlist; - while (stptr != NULL) { - stptr->l1.l1l2(stptr, PH_PAUSE | CONFIRM, NULL); - stptr = stptr->next; - } - } -#endif if (test_and_clear_bit(D_L1STATECHANGE, &cs->event)) { switch (cs->dc.hfcpci.ph_state) { case (0): @@ -1382,10 +1493,6 @@ __initfunc(void cs->dbusytimer.data = (long) cs; init_timer(&cs->dbusytimer); cs->tqueue.routine = (void *) (void *) hfcpci_bh; -#if 0 - if (!cs->hw.hfcpci.send) - cs->hw.hfcpci.send = init_send_hfcpci(16); -#endif if (!cs->bcs[0].hw.hfc.send) cs->bcs[0].hw.hfc.send = init_send_hfcpci(32); if (!cs->bcs[1].hw.hfc.send) @@ -1439,11 +1546,7 @@ hfcpci_card_msg(struct IsdnCardState *cs, int mt, void *arg) /* this variable is used as card index when more than one cards are present */ -#ifdef COMPAT_HAS_NEW_PCI static struct pci_dev *dev_hfcpci __initdata = NULL; -#else -static int pci_index __initdata = 0; -#endif #endif /* CONFIG_PCI */ @@ -1453,37 +1556,37 @@ __initfunc(int struct IsdnCardState *cs = card->cs; char tmp[64]; int i; -#ifdef COMPAT_HAS_NEW_PCI struct pci_dev *tmp_hfcpci = NULL; -#endif strcpy(tmp, hfcpci_revision); printk(KERN_INFO "HiSax: HFC-PCI driver Rev. %s\n", HiSax_getrev(tmp)); #if CONFIG_PCI cs->hw.hfcpci.int_s1 = 0; -#if 0 - cs->hw.hfcpci.send = NULL; -#endif cs->bcs[0].hw.hfc.send = NULL; cs->bcs[1].hw.hfc.send = NULL; cs->dc.hfcpci.ph_state = 0; cs->hw.hfcpci.fifo = 255; if (cs->typ == ISDN_CTYPE_HFC_PCI) { -#ifdef COMPAT_HAS_NEW_PCI if (!pci_present()) { printk(KERN_ERR "HFC-PCI: no PCI bus present\n"); return (0); } i = 0; - while (CCD_VENDOR_IDS[i]) { - tmp_hfcpci = pci_find_device(CCD_VENDOR_IDS[i], - CCD_DEVICE_IDS[i], + while (id_list[i].vendor_id) { + tmp_hfcpci = pci_find_device(id_list[i].vendor_id, + id_list[i].device_id, dev_hfcpci); - if (tmp_hfcpci) break; i++; + if (tmp_hfcpci) { + if ((card->para[0]) && (card->para[0] != (tmp_hfcpci->base_address[0] & PCI_BASE_ADDRESS_IO_MASK))) + continue; + else + break; + } } if (tmp_hfcpci) { + i--; dev_hfcpci = tmp_hfcpci; /* old device */ cs->hw.hfcpci.pci_bus = dev_hfcpci->bus->number; cs->hw.hfcpci.pci_device_fn = dev_hfcpci->devfn; @@ -1492,41 +1595,12 @@ __initfunc(int printk(KERN_WARNING "HFC-PCI: No IRQ for PCI card found\n"); return (0); } - cs->hw.hfcpci.pci_io = (char *) get_pcibase(dev_hfcpci, 1); + cs->hw.hfcpci.pci_io = (char *) dev_hfcpci->base_address[ 1]; + printk(KERN_INFO "HiSax: HFC-PCI card manufacturer: %s card name: %s\n",id_list[i].vendor_name,id_list[i].card_name); } else { printk(KERN_WARNING "HFC-PCI: No PCI card found\n"); return (0); } -#else - for (; pci_index < 255; pci_index++) { - unsigned char irq; - - i = 0; - while (CCD_VENDOR_IDS[i]) { - if (pcibios_find_device(CCD_VENDOR_IDS[i], - CCD_DEVICE_IDS[i], pci_index, - &cs->hw.hfcpci.pci_bus, &cs->hw.hfcpci.pci_device_fn) == 0) - break; - i++; - } - if (!CCD_VENDOR_IDS[i]) - continue; - - pcibios_read_config_byte(cs->hw.hfcpci.pci_bus, cs->hw.hfcpci.pci_device_fn, - PCI_INTERRUPT_LINE, &irq); - cs->irq = irq; - - pcibios_read_config_dword(cs->hw.hfcpci.pci_bus, - cs->hw.hfcpci.pci_device_fn, PCI_BASE_ADDRESS_1, - (void *) &cs->hw.hfcpci.pci_io); - break; - } - if (pci_index == 255) { - printk(KERN_WARNING "HFC-PCI: No card found\n"); - return (0); - } - pci_index++; -#endif /* COMPAT_HAS_NEW_PCI */ if (!cs->hw.hfcpci.pci_io) { printk(KERN_WARNING "HFC-PCI: No IO-Mem for PCI card found\n"); return (0); @@ -1576,6 +1650,7 @@ __initfunc(int reset_hfcpci(cs); cs->cardmsg = &hfcpci_card_msg; + cs->auxcmd = &hfcpci_auxcmd; return (1); #else printk(KERN_WARNING "HFC-PCI: NO_PCI_BIOS\n"); diff --git a/drivers/isdn/hisax/hfc_pci.h b/drivers/isdn/hisax/hfc_pci.h index 9f5124523234..ae04d3d16af9 100644 --- a/drivers/isdn/hisax/hfc_pci.h +++ b/drivers/isdn/hisax/hfc_pci.h @@ -1,4 +1,4 @@ -/* $Id: hfc_pci.h,v 1.5 1999/08/09 19:13:34 werner Exp $ +/* $Id: hfc_pci.h,v 1.6 1999/08/28 21:04:29 werner Exp $ * specific defines for CCD's HFC 2BDS0 PCI chips * @@ -21,6 +21,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: hfc_pci.h,v $ + * Revision 1.6 1999/08/28 21:04:29 werner + * Implemented full audio support (transparent mode) + * * Revision 1.5 1999/08/09 19:13:34 werner * moved constant pci ids to pci id table * @@ -37,6 +40,14 @@ * */ +/*********************************************/ +/* thresholds for transparent B-channel mode */ +/* change mask and threshold simultaneously */ +/*********************************************/ +#define HFCPCI_BTRANS_THRESHOLD 128 +#define HFCPCI_BTRANS_THRESMASK 0x00 + + /* defines for PCI config */ diff --git a/drivers/isdn/hisax/hfcscard.c b/drivers/isdn/hisax/hfcscard.c index edd3836431cb..74498ef9efcf 100644 --- a/drivers/isdn/hisax/hfcscard.c +++ b/drivers/isdn/hisax/hfcscard.c @@ -1,4 +1,4 @@ -/* $Id: hfcscard.c,v 1.4 1999/08/09 18:59:59 keil Exp $ +/* $Id: hfcscard.c,v 1.5 1999/09/04 06:20:06 keil Exp $ * hfcscard.c low level stuff for hfcs based cards (Teles3c, ACER P10) * @@ -6,6 +6,9 @@ * * * $Log: hfcscard.c,v $ + * Revision 1.5 1999/09/04 06:20:06 keil + * Changes from kernel set_current_state() + * * Revision 1.4 1999/08/09 18:59:59 keil * Fix S0 init - Thanks to Stefan Gybas * @@ -27,7 +30,7 @@ extern const char *CardType[]; -static const char *hfcs_revision = "$Revision: 1.4 $"; +static const char *hfcs_revision = "$Revision: 1.5 $"; static void hfcs_interrupt(int intno, void *dev_id, struct pt_regs *regs) diff --git a/drivers/isdn/hisax/hisax.h b/drivers/isdn/hisax/hisax.h index 14c201386a02..43c5e4405399 100644 --- a/drivers/isdn/hisax/hisax.h +++ b/drivers/isdn/hisax/hisax.h @@ -1,8 +1,15 @@ -/* $Id: hisax.h,v 2.33 1999/08/05 20:43:16 keil Exp $ +/* $Id: hisax.h,v 2.35 1999/09/04 06:35:09 keil Exp $ * Basic declarations, defines and prototypes * * $Log: hisax.h,v $ + * Revision 2.35 1999/09/04 06:35:09 keil + * Winbond W6692 support + * + * Revision 2.34 1999/08/25 17:00:04 keil + * Make ISAR V32bis modem running + * Make LL->HL interface open for additional commands + * * Revision 2.33 1999/08/05 20:43:16 keil * ISAR analog modem support * @@ -154,7 +161,6 @@ #define CARD_RELEASE 0x00F3 #define CARD_TEST 0x00F4 #define CARD_AUX_IND 0x00F5 -#define CARD_LOAD_FIRM 0x00F6 #define PH_ACTIVATE 0x0100 #define PH_DEACTIVATE 0x0110 @@ -444,6 +450,13 @@ struct hscx_hw { u_char tsaxr1; }; +struct w6692B_hw { + int bchan; + int rcvidx; + int count; /* Current skb sent count */ + u_char *rcvbuf; /* B-Channel receive Buffer */ +}; + struct isar_reg { unsigned int Flags; volatile u_char bstat; @@ -458,6 +471,12 @@ struct isar_hw { int rcvidx; int txcnt; int mml; + u_char state; + u_char cmd; + u_char mod; + u_char newcmd; + u_char newmod; + struct timer_list ftimer; u_char *rcvbuf; /* B-Channel receive Buffer */ u_char conmsg[16]; struct isar_reg *reg; @@ -528,6 +547,14 @@ struct amd7930_hw { #define BC_FLG_HALF 5 #define BC_FLG_EMPTY 6 #define BC_FLG_ORIG 7 +#define BC_FLG_DLEETX 8 +#define BC_FLG_LASTDLE 9 +#define BC_FLG_FIRST 10 +#define BC_FLG_LASTDATA 11 +#define BC_FLG_NMD_DATA 12 +#define BC_FLG_FTI_RUN 13 +#define BC_FLG_LL_OK 14 +#define BC_FLG_LL_CONN 15 #define L1_MODE_NULL 0 #define L1_MODE_TRANS 1 @@ -561,6 +588,7 @@ struct BCState { struct hfcB_hw hfc; struct tiger_hw tiger; struct amd7930_hw amd7930; + struct w6692B_hw w6692; } hw; }; @@ -796,6 +824,11 @@ struct gazel_hw { unsigned char iom2; }; +struct w6692_hw { + unsigned int iobase; + struct timer_list timer; +}; + #ifdef CONFIG_HISAX_TESTEMU struct te_hw { unsigned char *sfifo; @@ -804,13 +837,8 @@ struct te_hw { unsigned char *sfifo_e; int sfifo_cnt; unsigned int stat; -#ifdef COMPAT_HAS_NEW_WAITQ - wait_queue_head_t rwaitq; - wait_queue_head_t swaitq; -#else struct wait_queue *rwaitq; struct wait_queue *swaitq; -#endif }; #endif @@ -830,11 +858,7 @@ struct isac_chip { int mon_rxp; struct arcofi_msg *arcofi_list; struct timer_list arcofitimer; -#ifdef COMPAT_HAS_NEW_WAITQ - wait_queue_head_t arcofi_wait; -#else struct wait_queue *arcofi_wait; -#endif u_char arcofi_bc; u_char arcofi_state; u_char mocr; @@ -849,9 +873,14 @@ struct hfcpci_chip { int ph_state; }; +struct w6692_chip { + int ph_state; +}; + #define HW_IOM1 0 #define HW_IPAC 1 #define HW_ISAR 2 +#define HW_ARCOFI 3 #define FLG_TWO_DCHAN 4 #define FLG_L1_DBUSY 5 #define FLG_DBUSY_TIMER 6 @@ -892,6 +921,7 @@ struct IsdnCardState { #endif struct bkm_hw ax; struct gazel_hw gazel; + struct w6692_hw w6692; } hw; int myid; isdn_if iif; @@ -910,6 +940,7 @@ struct IsdnCardState { void (*setstack_d) (struct PStack *, struct IsdnCardState *); void (*DC_Close) (struct IsdnCardState *); void (*irq_func) (int, void *, struct pt_regs *); + int (*auxcmd) (struct IsdnCardState *, isdn_ctrl *); struct Channel channel[2+MAX_WAITING_CALLS]; struct BCState bcs[2+MAX_WAITING_CALLS]; struct PStack *stlist; @@ -921,6 +952,7 @@ struct IsdnCardState { struct isac_chip isac; struct hfcd_chip hfcd; struct hfcpci_chip hfcpci; + struct w6692_chip w6692; } dc; u_char *rcvbuf; int rcvidx; @@ -973,7 +1005,8 @@ struct IsdnCardState { #define ISDN_CTYPE_SCT_QUADRO 33 #define ISDN_CTYPE_GAZEL 34 #define ISDN_CTYPE_HFC_PCI 35 -#define ISDN_CTYPE_COUNT 35 +#define ISDN_CTYPE_W6692 36 +#define ISDN_CTYPE_COUNT 36 #ifdef ISDN_CHIP_ISAC @@ -1138,7 +1171,6 @@ struct IsdnCardState { #ifdef CONFIG_HISAX_HFC_PCI #define CARD_HFC_PCI 1 -extern int hfcpci_set_echo(struct IsdnCardState *, int); #else #define CARD_HFC_PCI 0 #endif @@ -1221,6 +1253,15 @@ extern int hfcpci_set_echo(struct IsdnCardState *, int); #define CARD_GAZEL 0 #endif +#ifdef CONFIG_HISAX_W6692 +#define CARD_W6692 1 +#ifndef ISDN_CHIP_W6692 +#define ISDN_CHIP_W6692 1 +#endif +#else +#define CARD_W6692 0 +#endif + #define TEI_PER_CARD 0 #ifdef CONFIG_HISAX_1TR6 @@ -1327,7 +1368,7 @@ void setstack_isac(struct PStack *st, struct IsdnCardState *cs); #define HZDELAY(jiffs) {int tout = jiffs; while (tout--) udelay(1000000/HZ);} -int ll_run(struct IsdnCardState *cs); +int ll_run(struct IsdnCardState *cs, int addfeatures); void ll_stop(struct IsdnCardState *cs); void CallcNew(void); void CallcFree(void); diff --git a/drivers/isdn/hisax/hscx.c b/drivers/isdn/hisax/hscx.c index 290c89f5059b..1c57cd3f1c43 100644 --- a/drivers/isdn/hisax/hscx.c +++ b/drivers/isdn/hisax/hscx.c @@ -219,7 +219,7 @@ close_hscxstate(struct BCState *bcs) discard_queue(&bcs->rqueue); discard_queue(&bcs->squeue); if (bcs->tx_skb) { - idev_kfree_skb(bcs->tx_skb, FREE_WRITE); + dev_kfree_skb(bcs->tx_skb); bcs->tx_skb = NULL; test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); } diff --git a/drivers/isdn/hisax/hscx_irq.c b/drivers/isdn/hisax/hscx_irq.c index ecc1e825e52a..0147209f71a7 100644 --- a/drivers/isdn/hisax/hscx_irq.c +++ b/drivers/isdn/hisax/hscx_irq.c @@ -204,7 +204,7 @@ hscx_interrupt(struct IsdnCardState *cs, u_char val, u_char hscx) if (!(skb = dev_alloc_skb(count))) printk(KERN_WARNING "HSCX: receive out of memory\n"); else { - SET_SKB_FREE(skb); + ; memcpy(skb_put(skb, count), bcs->hw.hscx.rcvbuf, count); skb_queue_tail(&bcs->rqueue, skb); } @@ -220,7 +220,7 @@ hscx_interrupt(struct IsdnCardState *cs, u_char val, u_char hscx) if (!(skb = dev_alloc_skb(fifo_size))) printk(KERN_WARNING "HiSax: receive out of memory\n"); else { - SET_SKB_FREE(skb); + ; memcpy(skb_put(skb, fifo_size), bcs->hw.hscx.rcvbuf, fifo_size); skb_queue_tail(&bcs->rqueue, skb); } @@ -237,7 +237,7 @@ hscx_interrupt(struct IsdnCardState *cs, u_char val, u_char hscx) if (bcs->st->lli.l1writewakeup && (PACKET_NOACK != bcs->tx_skb->pkt_type)) bcs->st->lli.l1writewakeup(bcs->st, bcs->hw.hscx.count); - idev_kfree_skb(bcs->tx_skb, FREE_WRITE); + dev_kfree_skb(bcs->tx_skb); bcs->hw.hscx.count = 0; bcs->tx_skb = NULL; } diff --git a/drivers/isdn/hisax/isac.c b/drivers/isdn/hisax/isac.c index 6a130ed01001..5e37f852f3de 100644 --- a/drivers/isdn/hisax/isac.c +++ b/drivers/isdn/hisax/isac.c @@ -1,4 +1,4 @@ -/* $Id: isac.c,v 1.22 1999/08/09 19:04:40 keil Exp $ +/* $Id: isac.c,v 1.23 1999/08/25 16:50:52 keil Exp $ * isac.c ISAC specific routines * @@ -9,6 +9,9 @@ * ../../../Documentation/isdn/HiSax.cert * * $Log: isac.c,v $ + * Revision 1.23 1999/08/25 16:50:52 keil + * Fix bugs which cause 2.3.14 hangs (waitqueue init) + * * Revision 1.22 1999/08/09 19:04:40 keil * Fix race condition - Thanks to Christer Weinigel * @@ -168,10 +171,14 @@ isac_bh(struct IsdnCardState *cs) DChannel_proc_rcv(cs); if (test_and_clear_bit(D_XMTBUFREADY, &cs->event)) DChannel_proc_xmt(cs); +#if ARCOFI_USE + if (!test_bit(HW_ARCOFI, &cs->HW_Flags)) + return; if (test_and_clear_bit(D_RX_MON1, &cs->event)) arcofi_fsm(cs, ARCOFI_RX_END, NULL); if (test_and_clear_bit(D_TX_MON1, &cs->event)) arcofi_fsm(cs, ARCOFI_TX_END, NULL); +#endif } void @@ -293,7 +300,7 @@ isac_interrupt(struct IsdnCardState *cs, u_char val) if (!(skb = alloc_skb(count, GFP_ATOMIC))) printk(KERN_WARNING "HiSax: D receive out of memory\n"); else { - SET_SKB_FREE(skb); + ; memcpy(skb_put(skb, count), cs->rcvbuf, count); skb_queue_tail(&cs->rq, skb); } @@ -321,7 +328,7 @@ isac_interrupt(struct IsdnCardState *cs, u_char val) isac_fill_fifo(cs); goto afterXPR; } else { - idev_kfree_skb(cs->tx_skb, FREE_WRITE); + dev_kfree_skb(cs->tx_skb); cs->tx_cnt = 0; cs->tx_skb = NULL; } @@ -607,7 +614,7 @@ ISAC_l1hw(struct PStack *st, int pr, void *arg) discard_queue(&cs->rq); discard_queue(&cs->sq); if (cs->tx_skb) { - idev_kfree_skb(cs->tx_skb, FREE_WRITE); + dev_kfree_skb(cs->tx_skb); cs->tx_skb = NULL; } if (test_and_clear_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) @@ -663,7 +670,7 @@ dbusy_timer_handler(struct IsdnCardState *cs) /* discard frame; reset transceiver */ test_and_clear_bit(FLG_DBUSY_TIMER, &cs->HW_Flags); if (cs->tx_skb) { - idev_kfree_skb(cs->tx_skb, FREE_WRITE); + dev_kfree_skb(cs->tx_skb); cs->tx_cnt = 0; cs->tx_skb = NULL; } else { diff --git a/drivers/isdn/hisax/isar.c b/drivers/isdn/hisax/isar.c index 05fb7fe9cb95..1e61a348ef88 100644 --- a/drivers/isdn/hisax/isar.c +++ b/drivers/isdn/hisax/isar.c @@ -1,4 +1,4 @@ -/* $Id: isar.c,v 1.4 1999/08/05 20:43:18 keil Exp $ +/* $Id: isar.c,v 1.6 1999/08/31 11:20:20 paul Exp $ * isar.c ISAR (Siemens PSB 7110) specific routines * @@ -6,6 +6,13 @@ * * * $Log: isar.c,v $ + * Revision 1.6 1999/08/31 11:20:20 paul + * various spelling corrections (new checksums may be needed, Karsten!) + * + * Revision 1.5 1999/08/25 16:59:55 keil + * Make ISAR V32bis modem running + * Make LL->HL interface open for additional commands + * * Revision 1.4 1999/08/05 20:43:18 keil * ISAR analog modem support * @@ -309,6 +316,10 @@ isar_load_firmware(struct IsdnCardState *cs, u_char *buf) printk(KERN_DEBUG"isar firmware block %5d words loaded\n", blk_head.len); } + /* 10ms delay */ + cnt = 10; + while (cnt--) + udelay(1000); msg[0] = 0xff; msg[1] = 0xfe; ireg->bstat = 0; @@ -343,20 +354,26 @@ isar_load_firmware(struct IsdnCardState *cs, u_char *buf) printk(KERN_DEBUG"isar general status event %x\n", ireg->bstat); } + /* 10ms delay */ + cnt = 10; + while (cnt--) + udelay(1000); ireg->iis = 0; if (!sendmsg(cs, ISAR_HIS_DIAG, ISAR_CTRL_STST, 0, NULL)) { printk(KERN_ERR"isar sendmsg self tst failed\n"); ret = 1;goto reterrflg; } - cnt = 1000; /* max 10 ms */ + cnt = 10000; /* max 100 ms */ while ((ireg->iis != ISAR_IIS_DIAG) && cnt) { udelay(10); cnt--; } + udelay(1000); if (!cnt) { printk(KERN_ERR"isar no self tst response\n"); ret = 1;goto reterrflg; - } else if ((ireg->cmsb == ISAR_CTRL_STST) && (ireg->clsb == 1) + } + if ((ireg->cmsb == ISAR_CTRL_STST) && (ireg->clsb == 1) && (ireg->par[0] == 0)) { printk(KERN_DEBUG"isar selftest OK\n"); } else { @@ -369,11 +386,12 @@ isar_load_firmware(struct IsdnCardState *cs, u_char *buf) printk(KERN_ERR"isar RQST SVN failed\n"); ret = 1;goto reterror; } - cnt = 10000; /* max 100 ms */ + cnt = 30000; /* max 300 ms */ while ((ireg->iis != ISAR_IIS_DIAG) && cnt) { udelay(10); cnt--; } + udelay(1000); if (!cnt) { printk(KERN_ERR"isar no SVN response\n"); ret = 1;goto reterrflg; @@ -402,7 +420,18 @@ reterror: return(ret); } -void +extern void BChannel_bh(struct BCState *); +#define B_LL_NOCARRIER 8 +#define B_LL_CONNECT 9 +#define B_LL_OK 10 + +static void +isar_bh(struct BCState *bcs) +{ + BChannel_bh(bcs); +} + +static void isar_sched_event(struct BCState *bcs, int event) { bcs->event |= 1 << event; @@ -433,7 +462,7 @@ isar_rcv_frame(struct IsdnCardState *cs, struct BCState *bcs) case L1_MODE_TRANS: case L1_MODE_V32: if ((skb = dev_alloc_skb(ireg->clsb))) { - SET_SKB_FREE(skb); + ; rcv_mbox(cs, ireg, (u_char *)skb_put(skb, ireg->clsb)); skb_queue_tail(&bcs->rqueue, skb); isar_sched_event(bcs, B_RCVBUFREADY); @@ -464,10 +493,10 @@ isar_rcv_frame(struct IsdnCardState *cs, struct BCState *bcs) if (bcs->hw.isar.rcvidx < 3) { /* last 2 bytes are the FCS */ printk(KERN_WARNING "ISAR: HDLC frame too short(%d)\n", bcs->hw.isar.rcvidx); - } else if (!(skb = dev_alloc_skb(bcs->hw.isar.rcvidx-2))) + } else if (!(skb = dev_alloc_skb(bcs->hw.isar.rcvidx-2))) { printk(KERN_WARNING "ISAR: receive out of memory\n"); - else { - SET_SKB_FREE(skb); + } else { + ; memcpy(skb_put(skb, bcs->hw.isar.rcvidx-2), bcs->hw.isar.rcvbuf, bcs->hw.isar.rcvidx-2); skb_queue_tail(&bcs->rqueue, skb); @@ -567,7 +596,7 @@ send_frames(struct BCState *bcs) if (bcs->st->lli.l1writewakeup && (PACKET_NOACK != bcs->tx_skb->pkt_type)) bcs->st->lli.l1writewakeup(bcs->st, bcs->hw.isar.txcnt); - idev_kfree_skb(bcs->tx_skb, FREE_WRITE); + dev_kfree_skb(bcs->tx_skb); bcs->hw.isar.txcnt = 0; bcs->tx_skb = NULL; } @@ -709,7 +738,6 @@ isar_pump_status_ev(struct BCState *bcs, u_char devt) { case PSEV_DSR_ON: if (cs->debug & L1_DEB_HSCX) debugl1(cs, "pump stev DSR ON"); -// sendmsg(cs, dps | ISAR_HIS_PUMPCTRL, 0xCF, 0, NULL); break; case PSEV_DSR_OFF: if (cs->debug & L1_DEB_HSCX) @@ -734,7 +762,7 @@ isar_pump_status_ev(struct BCState *bcs, u_char devt) { } } -static char debbuf[64]; +static char debbuf[128]; void isar_int_main(struct IsdnCardState *cs) @@ -806,6 +834,12 @@ isar_int_main(struct IsdnCardState *cs) debugl1(cs, debbuf); } break; + case ISAR_IIS_INVMSG: + rcv_mbox(cs, ireg, debbuf); + if (cs->debug & L1_DEB_WARN) + debugl1(cs, "invalid msg his:%x", + ireg->cmsb); + break; default: rcv_mbox(cs, ireg, debbuf); if (cs->debug & L1_DEB_WARN) @@ -816,7 +850,7 @@ isar_int_main(struct IsdnCardState *cs) restore_flags(flags); } -void +static void setup_pump(struct BCState *bcs) { struct IsdnCardState *cs = bcs->cs; u_char dps = SET_DPS(bcs->hw.isar.dpath); @@ -840,15 +874,12 @@ setup_pump(struct BCState *bcs) { } else { param[5] = PV32P6_ATN; } - param[0] = 11; /* 11 db */ -// param[1] = PV32P2_V22A | PV32P2_V22B | PV32P2_V21; - param[1] = PV32P2_V22A; -// param[2] = PV32P3_AMOD | PV32P3_V32B; - param[2] = PV32P3_AMOD; - param[3] = PV32P4_48; - param[4] = PV32P5_48; -// param[3] = PV32P4_UT144; -// param[4] = PV32P5_UT144; + param[0] = 6; /* 6 db */ + param[1] = PV32P2_V23R | PV32P2_V22A | PV32P2_V22B | + PV32P2_V22C | PV32P2_V21 | PV32P2_BEL; + param[2] = PV32P3_AMOD | PV32P3_V32B | PV32P3_V23B; + param[3] = PV32P4_UT144; + param[4] = PV32P5_UT144; if (!sendmsg(cs, dps | ISAR_HIS_PUMPCFG, ctrl, 6, param)) { if (cs->debug) debugl1(cs, "isar pump datamodem cfg dp%d failed", @@ -863,7 +894,7 @@ setup_pump(struct BCState *bcs) { } else { param[1] = PFAXP2_ATN; } - param[0] = 8; /* 8 db */ + param[0] = 6; /* 6 db */ if (!sendmsg(cs, dps | ISAR_HIS_PUMPCFG, ctrl, 2, param)) { if (cs->debug) debugl1(cs, "isar pump faxmodem cfg dp%d failed", @@ -878,7 +909,7 @@ setup_pump(struct BCState *bcs) { } } -void +static void setup_sart(struct BCState *bcs) { struct IsdnCardState *cs = bcs->cs; u_char dps = SET_DPS(bcs->hw.isar.dpath); @@ -900,7 +931,9 @@ setup_sart(struct BCState *bcs) { } break; case L1_MODE_HDLC: - if (!sendmsg(cs, dps | ISAR_HIS_SARTCFG, SMODE_HDLC, 1, "\0")) { + case L1_MODE_FAX: + param[0] = 0; + if (!sendmsg(cs, dps | ISAR_HIS_SARTCFG, SMODE_HDLC, 1, param)) { if (cs->debug) debugl1(cs, "isar sart hdlc dp%d failed", bcs->hw.isar.dpath); @@ -924,7 +957,7 @@ setup_sart(struct BCState *bcs) { } } -void +static void setup_iom2(struct BCState *bcs) { struct IsdnCardState *cs = bcs->cs; u_char dps = SET_DPS(bcs->hw.isar.dpath); @@ -967,6 +1000,9 @@ modeisar(struct BCState *bcs, int mode, int bc) bcs->channel = bc; switch (mode) { case L1_MODE_NULL: /* init */ + if (!bcs->hw.isar.dpath) + /* no init for dpath 0 */ + return(0); break; case L1_MODE_TRANS: case L1_MODE_HDLC: @@ -983,13 +1019,14 @@ modeisar(struct BCState *bcs, int mode, int bc) } break; case L1_MODE_V32: + case L1_MODE_FAX: /* only datapath 1 */ if (!test_and_set_bit(ISAR_DP1_USE, &bcs->hw.isar.reg->Flags)) bcs->hw.isar.dpath = 1; else { - printk(KERN_WARNING"isar modeisar analog funktions only with DP1\n"); - debugl1(cs, "isar modeisar analog funktions only with DP1"); + printk(KERN_WARNING"isar modeisar analog works only with DP1\n"); + debugl1(cs, "isar modeisar analog works only with DP1"); return(1); } break; @@ -1032,6 +1069,7 @@ isar_setup(struct IsdnCardState *cs) cs->bcs[i].mode = 0; cs->bcs[i].hw.isar.dpath = i + 1; modeisar(&cs->bcs[i], 0, 0); + cs->bcs[i].tqueue.routine = (void *) (void *) isar_bh; } } @@ -1124,7 +1162,7 @@ close_isarstate(struct BCState *bcs) discard_queue(&bcs->rqueue); discard_queue(&bcs->squeue); if (bcs->tx_skb) { - idev_kfree_skb(bcs->tx_skb, FREE_WRITE); + dev_kfree_skb(bcs->tx_skb); bcs->tx_skb = NULL; test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); if (bcs->cs->debug & L1_DEB_HSCX) @@ -1169,6 +1207,36 @@ setstack_isar(struct PStack *st, struct BCState *bcs) return (0); } +int +isar_auxcmd(struct IsdnCardState *cs, isdn_ctrl *ic) { + u_long adr; + int features; + + if (cs->debug & L1_DEB_HSCX) + debugl1(cs, "isar_auxcmd cmd/ch %x/%d", ic->command, ic->arg); + switch (ic->command) { + case (ISDN_CMD_IOCTL): + switch (ic->arg) { + case (9): /* load firmware */ + features = ISDN_FEATURE_L2_MODEM; + memcpy(&adr, ic->parm.num, sizeof(ulong)); + if (isar_load_firmware(cs, (u_char *)adr)) + return(1); + else + ll_run(cs, features); + break; + default: + printk(KERN_DEBUG "HiSax: invalid ioctl %d\n", + (int) ic->arg); + return(-EINVAL); + } + break; + default: + return(-EINVAL); + } + return(0); +} + HISAX_INITFUNC(void initisar(struct IsdnCardState *cs)) { diff --git a/drivers/isdn/hisax/isar.h b/drivers/isdn/hisax/isar.h index c17875263901..c6ac6532b231 100644 --- a/drivers/isdn/hisax/isar.h +++ b/drivers/isdn/hisax/isar.h @@ -1,10 +1,14 @@ -/* $Id: isar.h,v 1.4 1999/08/05 20:43:20 keil Exp $ +/* $Id: isar.h,v 1.5 1999/08/25 16:59:59 keil Exp $ * isar.h ISAR (Siemens PSB 7110) specific defines * * Author Karsten Keil (keil@isdn4linux.de) * * * $Log: isar.h,v $ + * Revision 1.5 1999/08/25 16:59:59 keil + * Make ISAR V32bis modem running + * Make LL->HL interface open for additional commands + * * Revision 1.4 1999/08/05 20:43:20 keil * ISAR analog modem support * @@ -33,40 +37,41 @@ #define ISAR_WADR 0x4a #define ISAR_RADR 0x48 -#define ISAR_HIS_VNR 0x14 -#define ISAR_HIS_DKEY 0x02 -#define ISAR_HIS_FIRM 0x1e -#define ISAR_HIS_STDSP 0x08 -#define ISAR_HIS_DIAG 0x05 -#define ISAR_HIS_P0CFG 0x3c -#define ISAR_HIS_P12CFG 0x24 +#define ISAR_HIS_VNR 0x14 +#define ISAR_HIS_DKEY 0x02 +#define ISAR_HIS_FIRM 0x1e +#define ISAR_HIS_STDSP 0x08 +#define ISAR_HIS_DIAG 0x05 +#define ISAR_HIS_P0CFG 0x3c +#define ISAR_HIS_P12CFG 0x24 #define ISAR_HIS_SARTCFG 0x25 #define ISAR_HIS_PUMPCFG 0x26 #define ISAR_HIS_PUMPCTRL 0x2a #define ISAR_HIS_IOM2CFG 0x27 #define ISAR_HIS_IOM2REQ 0x07 #define ISAR_HIS_IOM2CTRL 0x2b -#define ISAR_HIS_BSTREQ 0x0c -#define ISAR_HIS_PSTREQ 0x0e -#define ISAR_HIS_SDATA 0x20 -#define ISAR_HIS_DPS1 0x40 -#define ISAR_HIS_DPS2 0x80 -#define SET_DPS(x) ((x<<6) & 0xc0) - -#define ISAR_IIS_MSCMSD 0x3f -#define ISAR_IIS_VNR 0x15 -#define ISAR_IIS_DKEY 0x03 -#define ISAR_IIS_FIRM 0x1f -#define ISAR_IIS_STDSP 0x09 -#define ISAR_IIS_DIAG 0x25 -#define ISAR_IIS_GSTEV 0x0 -#define ISAR_IIS_BSTEV 0x28 -#define ISAR_IIS_BSTRSP 0x2c -#define ISAR_IIS_PSTRSP 0x2e -#define ISAR_IIS_PSTEV 0x2a +#define ISAR_HIS_BSTREQ 0x0c +#define ISAR_HIS_PSTREQ 0x0e +#define ISAR_HIS_SDATA 0x20 +#define ISAR_HIS_DPS1 0x40 +#define ISAR_HIS_DPS2 0x80 +#define SET_DPS(x) ((x<<6) & 0xc0) + +#define ISAR_IIS_MSCMSD 0x3f +#define ISAR_IIS_VNR 0x15 +#define ISAR_IIS_DKEY 0x03 +#define ISAR_IIS_FIRM 0x1f +#define ISAR_IIS_STDSP 0x09 +#define ISAR_IIS_DIAG 0x25 +#define ISAR_IIS_GSTEV 0x00 +#define ISAR_IIS_BSTEV 0x28 +#define ISAR_IIS_BSTRSP 0x2c +#define ISAR_IIS_PSTRSP 0x2e +#define ISAR_IIS_PSTEV 0x2a #define ISAR_IIS_IOM2RSP 0x27 +#define ISAR_IIS_RDATA 0x20 +#define ISAR_IIS_INVMSG 0x3f -#define ISAR_IIS_RDATA 0x20 #define ISAR_CTRL_SWVER 0x10 #define ISAR_CTRL_STST 0x40 @@ -93,30 +98,33 @@ #define PV32P2_V21 0x02 #define PV32P2_BEL 0x01 +// LSB MSB in ISAR doc wrong !!! Arghhh #define PV32P3_AMOD 0x80 #define PV32P3_V32B 0x02 -#define PV32P4_48 0x05 -#define PV32P5_48 0x11 -#define PV32P4_UT48 0x0d -#define PV32P5_UT48 0x11 -#define PV32P4_96 0x03 -#define PV32P5_96 0x11 -#define PV32P4_UT96 0x0f -#define PV32P5_UT96 0x11 -#define PV32P4_B96 0x0b -#define PV32P5_B96 0x91 -#define PV32P4_UTB96 0x0f -#define PV32P5_UTB96 0xd1 -#define PV32P4_120 0x09 -#define PV32P5_120 0xb1 -#define PV32P4_UT120 0x0f -#define PV32P5_UT120 0xf1 -#define PV32P4_144 0x09 -#define PV32P5_144 0x99 -#define PV32P4_UT144 0x0f -#define PV32P5_UT144 0xf9 +#define PV32P3_V23B 0x01 +#define PV32P4_48 0x11 +#define PV32P5_48 0x05 +#define PV32P4_UT48 0x11 +#define PV32P5_UT48 0x0d +#define PV32P4_96 0x11 +#define PV32P5_96 0x03 +#define PV32P4_UT96 0x11 +#define PV32P5_UT96 0x0f +#define PV32P4_B96 0x91 +#define PV32P5_B96 0x0b +#define PV32P4_UTB96 0xd1 +#define PV32P5_UTB96 0x0f +#define PV32P4_120 0xb1 +#define PV32P5_120 0x09 +#define PV32P4_UT120 0xf1 +#define PV32P5_UT120 0x0f +#define PV32P4_144 0x99 +#define PV32P5_144 0x09 +#define PV32P4_UT144 0xf9 +#define PV32P5_UT144 0x0f #define PV32P6_CTN 0x01 #define PV32P6_ATN 0x02 + #define PFAXP2_CTN 0x01 #define PFAXP2_ATN 0x04 @@ -156,7 +164,7 @@ #define S_P1_CHS_6 0x01 #define S_P1_CHS_5 0x00 -#define S_P2_BFT_DEF 30 +#define S_P2_BFT_DEF 0x10 #define IOM_CTRL_ENA 0x80 #define IOM_CTRL_NOPCM 0x00 @@ -170,15 +178,15 @@ #define HDLC_FSD 0x20 #define HDLC_FST 0x20 #define HDLC_ERROR 0x1c +#define SART_NMD 0x01 #define BSTAT_RDM0 0x1 #define BSTAT_RDM1 0x2 #define BSTAT_RDM2 0x4 #define BSTAT_RDM3 0x8 - extern int ISARVersion(struct IsdnCardState *cs, char *s); -extern int isar_load_firmware(struct IsdnCardState *cs, u_char *buf); extern void isar_int_main(struct IsdnCardState *cs); extern void initisar(struct IsdnCardState *cs); extern void isar_fill_fifo(struct BCState *bcs); +extern int isar_auxcmd(struct IsdnCardState *cs, isdn_ctrl *ic); diff --git a/drivers/isdn/hisax/isdnl1.c b/drivers/isdn/hisax/isdnl1.c index 68813448084a..7682170253e7 100644 --- a/drivers/isdn/hisax/isdnl1.c +++ b/drivers/isdn/hisax/isdnl1.c @@ -1,4 +1,4 @@ -/* $Id: isdnl1.c,v 2.34 1999/07/09 13:50:15 keil Exp $ +/* $Id: isdnl1.c,v 2.36 1999/08/25 16:50:57 keil Exp $ * isdnl1.c common low level stuff for Siemens Chipsetbased isdn cards * based on the teles driver from Jan den Ouden @@ -15,6 +15,15 @@ * * * $Log: isdnl1.c,v $ + * Revision 2.36 1999/08/25 16:50:57 keil + * Fix bugs which cause 2.3.14 hangs (waitqueue init) + * + * Revision 2.35 1999/08/22 20:27:07 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * * Revision 2.34 1999/07/09 13:50:15 keil * remove unused variable * @@ -129,10 +138,9 @@ * */ -const char *l1_revision = "$Revision: 2.34 $"; +const char *l1_revision = "$Revision: 2.36 $"; #define __NO_VERSION__ -#include #include "hisax.h" #include "isdnl1.h" @@ -310,12 +318,12 @@ DChannel_proc_rcv(struct IsdnCardState *cs) stptr = cs->stlist; if (skb->len<3) { debugl1(cs, "D-channel frame too short(%d)",skb->len); - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); return; } if ((skb->data[0] & 1) || !(skb->data[1] &1)) { debugl1(cs, "D-channel frame wrong EA0/EA1"); - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); return; } sapi = skb->data[0] >> 2; @@ -342,7 +350,7 @@ DChannel_proc_rcv(struct IsdnCardState *cs) stptr = stptr->next; } } - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); } else if (sapi == CTRL_SAPI) { /* sapi 0 */ found = 0; while (stptr != NULL) @@ -353,7 +361,7 @@ DChannel_proc_rcv(struct IsdnCardState *cs) } else stptr = stptr->next; if (!found) - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); } } } @@ -391,7 +399,7 @@ BChannel_proc_rcv(struct BCState *bcs) } } -static void +void BChannel_bh(struct BCState *bcs) { if (!bcs) diff --git a/drivers/isdn/hisax/isdnl2.c b/drivers/isdn/hisax/isdnl2.c index 24d468da2528..6dfd28e7eaed 100644 --- a/drivers/isdn/hisax/isdnl2.c +++ b/drivers/isdn/hisax/isdnl2.c @@ -1,4 +1,4 @@ -/* $Id: isdnl2.c,v 2.19 1999/08/05 20:40:26 keil Exp $ +/* $Id: isdnl2.c,v 2.20 1999/08/25 16:52:04 keil Exp $ * Author Karsten Keil (keil@isdn4linux.de) * based on the teles driver from Jan den Ouden @@ -11,6 +11,9 @@ * Fritz Elfert * * $Log: isdnl2.c,v $ + * Revision 2.20 1999/08/25 16:52:04 keil + * Make gcc on AXP happy + * * Revision 2.19 1999/08/05 20:40:26 keil * Fix interlayer communication * @@ -80,7 +83,7 @@ #include "hisax.h" #include "isdnl2.h" -const char *l2_revision = "$Revision: 2.19 $"; +const char *l2_revision = "$Revision: 2.20 $"; static void l2m_debug(struct FsmInst *fi, char *fmt, ...); @@ -198,7 +201,7 @@ freewin1(struct Layer2 *l2) for (i = 0; i < MAX_WINDOW; i++) { if (l2->windowar[i]) { cnt++; - idev_kfree_skb(l2->windowar[i], FREE_WRITE); + dev_kfree_skb(l2->windowar[i]); l2->windowar[i] = NULL; } } @@ -477,7 +480,7 @@ setva(struct PStack *st, unsigned int nr) len = l2->windowar[l2->sow]->len; if (PACKET_NOACK == l2->windowar[l2->sow]->pkt_type) len = -1; - idev_kfree_skb(l2->windowar[l2->sow], FREE_WRITE); + dev_kfree_skb(l2->windowar[l2->sow]); l2->windowar[l2->sow] = NULL; l2->sow = (l2->sow + 1) % l2->window; if (st->lli.l2writewakeup && (len >=0)) @@ -498,7 +501,7 @@ send_uframe(struct PStack *st, u_char cmd, u_char cr) printk(KERN_WARNING "isdl2 can't alloc sbbuff for send_uframe\n"); return; } - SET_SKB_FREE(skb); + ; memcpy(skb_put(skb, i), tmp, i); enqueue_super(st, skb); } @@ -512,7 +515,7 @@ get_PollFlag(struct PStack * st, struct sk_buff * skb) inline void FreeSkb(struct sk_buff *skb) { - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); } @@ -967,7 +970,7 @@ enquiry_cr(struct PStack *st, u_char typ, u_char cr, u_char pf) printk(KERN_WARNING "isdl2 can't alloc sbbuff for enquiry_cr\n"); return; } - SET_SKB_FREE(skb); + ; memcpy(skb_put(skb, i), tmp, i); enqueue_super(st, skb); } @@ -1340,7 +1343,7 @@ l2_pull_iqueue(struct FsmInst *fi, int event, void *arg) if (l2->windowar[p1]) { printk(KERN_WARNING "isdnl2 try overwrite ack queue entry %d\n", p1); - idev_kfree_skb(l2->windowar[p1], FREE_WRITE); + dev_kfree_skb(l2->windowar[p1]); } l2->windowar[p1] = skb_clone(skb, GFP_ATOMIC); @@ -1364,7 +1367,7 @@ l2_pull_iqueue(struct FsmInst *fi, int event, void *arg) "isdl2 pull_iqueue skb header(%d/%d) too short\n", i, p1); oskb = skb; skb = alloc_skb(oskb->len + i, GFP_ATOMIC); - SET_SKB_FREE(skb); + ; memcpy(skb_put(skb, i), header, i); memcpy(skb_put(skb, oskb->len), oskb->data, oskb->len); FreeSkb(oskb); @@ -1747,7 +1750,7 @@ isdnl2_l1l2(struct PStack *st, int pr, void *arg) } if(c) { FreeSkb(skb); - FsmEvent(&st->l2.l2m, EV_L2_FRAME_ERROR, (void *) c); + FsmEvent(&st->l2.l2m, EV_L2_FRAME_ERROR, (void *)(long)c); ret = 0; } if (ret) @@ -1785,12 +1788,12 @@ isdnl2_l3l2(struct PStack *st, int pr, void *arg) switch (pr) { case (DL_DATA | REQUEST): if (FsmEvent(&st->l2.l2m, EV_L2_DL_DATA, arg)) { - idev_kfree_skb((struct sk_buff *) arg, FREE_READ); + dev_kfree_skb((struct sk_buff *) arg); } break; case (DL_UNIT_DATA | REQUEST): if (FsmEvent(&st->l2.l2m, EV_L2_DL_UNIT_DATA, arg)) { - idev_kfree_skb((struct sk_buff *) arg, FREE_READ); + dev_kfree_skb((struct sk_buff *) arg); } break; case (DL_ESTABLISH | REQUEST): diff --git a/drivers/isdn/hisax/isdnl3.c b/drivers/isdn/hisax/isdnl3.c index 458afe920984..8fdfb43d4b8d 100644 --- a/drivers/isdn/hisax/isdnl3.c +++ b/drivers/isdn/hisax/isdnl3.c @@ -260,7 +260,7 @@ l3_alloc_skb(int len) printk(KERN_WARNING "HiSax: No skb for D-channel\n"); return (NULL); } - SET_SKB_FREE(skb); + ; skb_reserve(skb, MAX_HEADER_LEN); return (skb); } @@ -272,7 +272,7 @@ no_l3_proto(struct PStack *st, int pr, void *arg) HiSax_putstatus(st->l1.hardware, "L3", "no D protocol"); if (skb) { - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); } } diff --git a/drivers/isdn/hisax/isurf.c b/drivers/isdn/hisax/isurf.c index a5d251b71382..a4061939e2d6 100644 --- a/drivers/isdn/hisax/isurf.c +++ b/drivers/isdn/hisax/isurf.c @@ -1,10 +1,23 @@ -/* $Id: isurf.c,v 1.3 1999/07/12 21:05:18 keil Exp $ +/* $Id: isurf.c,v 1.6 1999/09/04 06:20:06 keil Exp $ * isurf.c low level stuff for Siemens I-Surf/I-Talk cards * * Author Karsten Keil (keil@isdn4linux.de) * * $Log: isurf.c,v $ + * Revision 1.6 1999/09/04 06:20:06 keil + * Changes from kernel set_current_state() + * + * Revision 1.5 1999/08/25 17:00:02 keil + * Make ISAR V32bis modem running + * Make LL->HL interface open for additional commands + * + * Revision 1.4 1999/08/22 20:27:09 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * * Revision 1.3 1999/07/12 21:05:18 keil * fix race in IRQ handling * added watchdog for lost IRQs @@ -17,7 +30,6 @@ */ #define __NO_VERSION__ -#include #include "hisax.h" #include "isac.h" #include "isar.h" @@ -25,7 +37,7 @@ extern const char *CardType[]; -static const char *ISurf_revision = "$Revision: 1.3 $"; +static const char *ISurf_revision = "$Revision: 1.6 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) @@ -175,18 +187,26 @@ ISurf_card_msg(struct IsdnCardState *cs, int mt, void *arg) return(0); case CARD_TEST: return(0); - case CARD_LOAD_FIRM: - if (isar_load_firmware(cs, arg)) - return(1); - ll_run(cs); + } + return(0); +} + +static int +isurf_auxcmd(struct IsdnCardState *cs, isdn_ctrl *ic) { + int ret; + + if ((ic->command == ISDN_CMD_IOCTL) && (ic->arg == 9)) { + ret = isar_auxcmd(cs, ic); + if (!ret) { reset_isurf(cs, ISURF_ISAR_EA | ISURF_ISAC_RESET | ISURF_ARCOFI_RESET); initisac(cs); cs->writeisac(cs, ISAC_MASK, 0); cs->writeisac(cs, ISAC_CMDR, 0x41); - return(0); + } + return(ret); } - return(0); + return(isar_auxcmd(cs, ic)); } __initfunc(int @@ -229,6 +249,7 @@ setup_isurf(struct IsdnCard *card)) cs->cardmsg = &ISurf_card_msg; cs->irq_func = &isurf_interrupt; + cs->auxcmd = &isurf_auxcmd; cs->readisac = &ReadISAC; cs->writeisac = &WriteISAC; cs->readisacfifo = &ReadISACfifo; diff --git a/drivers/isdn/hisax/jade.c b/drivers/isdn/hisax/jade.c index 5699f28a76dd..4f07eed875a9 100644 --- a/drivers/isdn/hisax/jade.c +++ b/drivers/isdn/hisax/jade.c @@ -214,7 +214,7 @@ close_jadestate(struct BCState *bcs) discard_queue(&bcs->rqueue); discard_queue(&bcs->squeue); if (bcs->tx_skb) { - idev_kfree_skb(bcs->tx_skb, FREE_WRITE); + dev_kfree_skb(bcs->tx_skb); bcs->tx_skb = NULL; test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); } diff --git a/drivers/isdn/hisax/jade_irq.c b/drivers/isdn/hisax/jade_irq.c index 9cfcc7d6db91..c2f56a85eb0b 100644 --- a/drivers/isdn/hisax/jade_irq.c +++ b/drivers/isdn/hisax/jade_irq.c @@ -161,7 +161,7 @@ jade_interrupt(struct IsdnCardState *cs, u_char val, u_char jade) if (!(skb = dev_alloc_skb(count))) printk(KERN_WARNING "JADE %s receive out of memory\n", (jade ? "B":"A")); else { - SET_SKB_FREE(skb); + ; memcpy(skb_put(skb, count), bcs->hw.hscx.rcvbuf, count); skb_queue_tail(&bcs->rqueue, skb); } @@ -177,7 +177,7 @@ jade_interrupt(struct IsdnCardState *cs, u_char val, u_char jade) if (!(skb = dev_alloc_skb(fifo_size))) printk(KERN_WARNING "HiSax: receive out of memory\n"); else { - SET_SKB_FREE(skb); + ; memcpy(skb_put(skb, fifo_size), bcs->hw.hscx.rcvbuf, fifo_size); skb_queue_tail(&bcs->rqueue, skb); } @@ -194,7 +194,7 @@ jade_interrupt(struct IsdnCardState *cs, u_char val, u_char jade) if (bcs->st->lli.l1writewakeup && (PACKET_NOACK != bcs->tx_skb->pkt_type)) bcs->st->lli.l1writewakeup(bcs->st, bcs->hw.hscx.count); - idev_kfree_skb(bcs->tx_skb, FREE_WRITE); + dev_kfree_skb(bcs->tx_skb); bcs->hw.hscx.count = 0; bcs->tx_skb = NULL; } diff --git a/drivers/isdn/hisax/l3_1tr6.c b/drivers/isdn/hisax/l3_1tr6.c index ba8d95dbdb77..31b25acdfc28 100644 --- a/drivers/isdn/hisax/l3_1tr6.c +++ b/drivers/isdn/hisax/l3_1tr6.c @@ -94,14 +94,14 @@ l3_1tr6_invalid(struct l3_process *pc, u_char pr, void *arg) { struct sk_buff *skb = arg; - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); l3_1tr6_release_req(pc, 0, NULL); } static void l3_1tr6_error(struct l3_process *pc, u_char *msg, struct sk_buff *skb) { - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); if (pc->st->l3.debug & L3_DEB_WARN) l3_debug(pc->st, msg); l3_1tr6_release_req(pc, 0, NULL); @@ -251,7 +251,7 @@ l3_1tr6_setup(struct l3_process *pc, u_char pr, void *arg) if ((FAC_SPV == p[3]) || (FAC_Activate == p[3])) pc->para.spv = 1; } - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); /* Signal all services, linklevel takes care of Service-Indicator */ if (bcfound) { @@ -290,7 +290,7 @@ l3_1tr6_setup_ack(struct l3_process *pc, u_char pr, void *arg) l3_1tr6_error(pc, "missing setup_ack WE0_chanID", skb); return; } - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); L3AddTimer(&pc->timer, T304, CC_T304); pc->st->l3.l3l4(pc->st, CC_MORE_INFO | INDICATION, pc); } @@ -321,7 +321,7 @@ l3_1tr6_call_sent(struct l3_process *pc, u_char pr, void *arg) l3_1tr6_error(pc, "missing call sent WE0_chanID", skb); return; } - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); L3AddTimer(&pc->timer, T310, CC_T310); newl3state(pc, 3); pc->st->l3.l3l4(pc->st, CC_PROCEEDING | INDICATION, pc); @@ -332,7 +332,7 @@ l3_1tr6_alert(struct l3_process *pc, u_char pr, void *arg) { struct sk_buff *skb = arg; - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); L3DelTimer(&pc->timer); /* T304 */ newl3state(pc, 4); pc->st->l3.l3l4(pc->st, CC_ALERTING | INDICATION, pc); @@ -363,7 +363,7 @@ l3_1tr6_info(struct l3_process *pc, u_char pr, void *arg) } } else if (pc->st->l3.debug & L3_DEB_CHARGE) l3_debug(pc->st, "charging info not found"); - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); } @@ -372,7 +372,7 @@ l3_1tr6_info_s2(struct l3_process *pc, u_char pr, void *arg) { struct sk_buff *skb = arg; - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); } static void @@ -386,7 +386,7 @@ l3_1tr6_connect(struct l3_process *pc, u_char pr, void *arg) return; } newl3state(pc, 10); - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); pc->para.chargeinfo = 0; pc->st->l3.l3l4(pc->st, CC_SETUP | CONFIRM, pc); } @@ -414,7 +414,7 @@ l3_1tr6_rel(struct l3_process *pc, u_char pr, void *arg) l3_1tr6_error(pc, "missing REL cause", skb); return; } - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); StopAllL3Timer(pc); newl3state(pc, 0); l3_1TR6_message(pc, MT_N1_REL_ACK, PROTO_DIS_N1); @@ -427,7 +427,7 @@ l3_1tr6_rel_ack(struct l3_process *pc, u_char pr, void *arg) { struct sk_buff *skb = arg; - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); StopAllL3Timer(pc); newl3state(pc, 0); pc->para.cause = NO_CAUSE; @@ -484,7 +484,7 @@ l3_1tr6_disc(struct l3_process *pc, u_char pr, void *arg) l3_1tr6_error(pc, "missing connack date", skb); return; } - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); newl3state(pc, 12); pc->st->l3.l3l4(pc->st, CC_DISCONNECT | INDICATION, pc); } @@ -499,7 +499,7 @@ l3_1tr6_connect_ack(struct l3_process *pc, u_char pr, void *arg) l3_1tr6_error(pc, "missing connack date", skb); return; } - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); newl3state(pc, 10); pc->para.chargeinfo = 0; L3DelTimer(&pc->timer); @@ -814,7 +814,7 @@ up1tr6(struct PStack *st, int pr, void *arg) sprintf(tmp, "up1tr6 len only %d", skb->len); l3_debug(st, tmp); } - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); return; } if ((skb->data[0] & 0xfe) != PROTO_DIS_N0) { @@ -824,7 +824,7 @@ up1tr6(struct PStack *st, int pr, void *arg) skb->data[0], skb->len); l3_debug(st, tmp); } - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); return; } if (skb->data[1] != 1) { @@ -832,13 +832,13 @@ up1tr6(struct PStack *st, int pr, void *arg) sprintf(tmp, "up1tr6 CR len not 1"); l3_debug(st, tmp); } - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); return; } cr = skb->data[2]; mt = skb->data[3]; if (skb->data[0] == PROTO_DIS_N0) { - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); if (st->l3.debug & L3_DEB_STATE) { sprintf(tmp, "up1tr6%s N0 mt %x unhandled", (pr == (DL_DATA | INDICATION)) ? " " : "(broadcast) ", mt); @@ -853,11 +853,11 @@ up1tr6(struct PStack *st, int pr, void *arg) sprintf(tmp, "up1tr6 no roc mem"); l3_debug(st, tmp); } - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); return; } } else { - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); return; } } else if ((mt == MT_N1_REL) || (mt == MT_N1_REL_ACK) || @@ -865,7 +865,7 @@ up1tr6(struct PStack *st, int pr, void *arg) (mt == MT_N1_REG_ACK) || (mt == MT_N1_REG_REJ) || (mt == MT_N1_SUSP_ACK) || (mt == MT_N1_RES_REJ) || (mt == MT_N1_INFO)) { - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); return; } else { if (!(proc = new_l3_process(st, cr))) { @@ -873,7 +873,7 @@ up1tr6(struct PStack *st, int pr, void *arg) sprintf(tmp, "up1tr6 no roc mem"); l3_debug(st, tmp); } - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); return; } mt = MT_N1_INVALID; @@ -884,7 +884,7 @@ up1tr6(struct PStack *st, int pr, void *arg) ((1 << proc->state) & datastln1[i].state)) break; if (i == DATASTLN1_LEN) { - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); if (st->l3.debug & L3_DEB_STATE) { sprintf(tmp, "up1tr6%sstate %d mt %x unhandled", (pr == (DL_DATA | INDICATION)) ? " " : "(broadcast) ", diff --git a/drivers/isdn/hisax/l3dss1.c b/drivers/isdn/hisax/l3dss1.c index 1c541033f0fd..6429057c974d 100644 --- a/drivers/isdn/hisax/l3dss1.c +++ b/drivers/isdn/hisax/l3dss1.c @@ -1,4 +1,4 @@ -/* $Id: l3dss1.c,v 2.18 1999/08/11 20:54:39 keil Exp $ +/* $Id: l3dss1.c,v 2.19 1999/08/25 16:55:23 keil Exp $ * EURO/DSS1 D-channel protocol * @@ -13,6 +13,9 @@ * Fritz Elfert * * $Log: l3dss1.c,v $ + * Revision 2.19 1999/08/25 16:55:23 keil + * Fix for test case TC10011 + * * Revision 2.18 1999/08/11 20:54:39 keil * High layer compatibility is valid in SETUP * @@ -87,7 +90,7 @@ #include extern char *HiSax_getrev(const char *revision); -const char *dss1_revision = "$Revision: 2.18 $"; +const char *dss1_revision = "$Revision: 2.19 $"; #define EXT_BEARER_CAPS 1 @@ -764,11 +767,6 @@ ie_in_set(struct l3_process *pc, u_char ie, int *checklist) { int ret = 1; while (*checklist != -1) { -#if 0 - if (pc->debug & L3_DEB_CHECK) - l3_debug(pc->st, "ie_in_set ie(%x) cl(%x)", - ie, *checklist); -#endif if ((*checklist & 0xff) == ie) { if (ie & 0x80) return(-ret); @@ -1737,15 +1735,12 @@ l3dss1_setup(struct l3_process *pc, u_char pr, void *arg) return; } /* Now we are on none mandatory IEs */ -#if 1 -/* !!!!!! this check seems to be a problem ? info bugfix to Karsten */ err = check_infoelements(pc, skb, ie_SETUP); if (ERR_IE_COMPREHENSION == err) { pc->para.cause = 96; l3dss1_msg_without_setup(pc, pr, NULL); return; } -#endif p = skb->data; if ((p = findie(p, skb->len, 0x70, 0))) iecpy(pc->para.setup.eazmsn, p, 1); @@ -1787,29 +1782,10 @@ l3dss1_setup(struct l3_process *pc, u_char pr, void *arg) } else if (pc->debug & L3_DEB_WARN) l3_debug(pc->st, "wrong calling subaddress"); } - -#if 0 - if (bcfound) { - if ((pc->para.setup.si1 != 7) && (pc->debug & L3_DEB_WARN)) { - l3_debug(pc->st, "non-digital call: %s -> %s", - pc->para.setup.phone, pc->para.setup.eazmsn); - } - if ((pc->para.setup.si1 != 7) && - test_bit(FLG_PTP, &pc->st->l2.flag)) { - pc->para.cause = 88; /* incompatible destination */ - l3dss1_msg_without_setup(pc, pr, NULL); - return; - } - newl3state(pc, 6); - pc->st->l3.l3l4(pc->st, CC_SETUP | INDICATION, pc); - } else - dss1_release_l3_process(pc); -#else newl3state(pc, 6); if (err) /* STATUS for none mandatory IE errors after actions are taken */ l3dss1_std_ie_err(pc, err); pc->st->l3.l3l4(pc->st, CC_SETUP | INDICATION, pc); -#endif } static void @@ -2106,8 +2082,6 @@ l3dss1_status_enq(struct l3_process *pc, u_char pr, void *arg) ret = check_infoelements(pc, skb, ie_STATUS_ENQUIRY); l3dss1_std_ie_err(pc, ret); -// KKe 19.7.99 test eicon -// idev_kfree_skb(skb, FREE_READ); pc->para.cause = 30; /* response to STATUS_ENQUIRY */ l3dss1_status_send(pc, pr, NULL); } @@ -2862,7 +2836,8 @@ static struct stateentry datastatelist[] = MT_STATUS, l3dss1_status}, {SBIT(0), MT_SETUP, l3dss1_setup}, - {SBIT(6) | SBIT(7), + {SBIT(6) | SBIT(7) | SBIT(8) | SBIT(9) | SBIT(10) | SBIT(11) | SBIT(12) | + SBIT(15) | SBIT(17) | SBIT(19) | SBIT(25), MT_SETUP, l3dss1_dummy}, {SBIT(1) | SBIT(2), MT_CALL_PROCEEDING, l3dss1_call_proc}, @@ -2885,8 +2860,6 @@ static struct stateentry datastatelist[] = {SBIT(19), MT_RELEASE, l3dss1_release_ind}, {SBIT(1) | SBIT(2) | SBIT(3) | SBIT(4) | SBIT(7) | SBIT(8) | SBIT(9) | SBIT(10) | SBIT(11) | SBIT(15) | SBIT(17) | SBIT(25), MT_DISCONNECT, l3dss1_disconnect}, -// {SBIT(11), -// MT_DISCONNECT, l3dss1_release_req}, {SBIT(19), MT_DISCONNECT, l3dss1_dummy}, {SBIT(1) | SBIT(2) | SBIT(3) | SBIT(4), @@ -3003,7 +2976,7 @@ dss1up(struct PStack *st, int pr, void *arg) } if (skb->len < 3) { l3_debug(st, "dss1up frame too short(%d)", skb->len); - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); return; } @@ -3013,13 +2986,13 @@ dss1up(struct PStack *st, int pr, void *arg) (pr == (DL_DATA | INDICATION)) ? " " : "(broadcast) ", skb->data[0], skb->len); } - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); return; } cr = getcallref(skb->data); if (skb->len < ((skb->data[1] & 0x0f) + 3)) { l3_debug(st, "dss1up frame too short(%d)", skb->len); - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); return; } mt = skb->data[skb->data[1] + 2]; @@ -3028,26 +3001,26 @@ dss1up(struct PStack *st, int pr, void *arg) if (cr == -2) { /* wrong Callref */ if (st->l3.debug & L3_DEB_WARN) l3_debug(st, "dss1up wrong Callref"); - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); return; } else if (cr == -1) { /* Dummy Callref */ if (mt == MT_FACILITY) if ((p = findie(skb->data, skb->len, IE_FACILITY, 0))) { l3dss1_parse_facility(st, NULL, (pr == (DL_DATA | INDICATION)) ? -1 : -2, p); - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); return; } if (st->l3.debug & L3_DEB_WARN) l3_debug(st, "dss1up dummy Callref (no facility msg or ie)"); - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); return; } else if ((((skb->data[1] & 0x0f) == 1) && (0==(cr & 0x7f))) || (((skb->data[1] & 0x0f) == 2) && (0==(cr & 0x7fff)))) { /* Global CallRef */ if (st->l3.debug & L3_DEB_STATE) l3_debug(st, "dss1up Global CallRef"); global_handler(st, mt, skb); - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); return; } else if (!(proc = getl3proc(st, cr))) { /* No transaction process exist, that means no call with @@ -3059,7 +3032,7 @@ dss1up(struct PStack *st, int pr, void *arg) /* Setup with wrong CREF flag */ if (st->l3.debug & L3_DEB_STATE) l3_debug(st, "dss1up wrong CRef flag"); - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); return; } if (!(proc = dss1_new_l3_process(st, cr))) { @@ -3067,7 +3040,7 @@ dss1up(struct PStack *st, int pr, void *arg) * CAUSE 0x2f "Resource unavailable", but this * need a new_l3_process too ... arghh */ - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); return; } } else if (mt == MT_STATUS) { @@ -3101,17 +3074,17 @@ dss1up(struct PStack *st, int pr, void *arg) l3dss1_msg_without_setup(proc, 0, NULL); } } - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); return; } else if (mt == MT_RELEASE_COMPLETE) { - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); return; } else { /* ETS 300-104 part 2 * if setup has not been made and a message type * (except MT_SETUP and RELEASE_COMPLETE) is received, * we must send MT_RELEASE_COMPLETE cause 81 */ - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); if ((proc = dss1_new_l3_process(st, cr))) { proc->para.cause = 81; l3dss1_msg_without_setup(proc, 0, NULL); @@ -3120,7 +3093,7 @@ dss1up(struct PStack *st, int pr, void *arg) } } if (l3dss1_check_messagetype_validity(proc, mt, skb)) { - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); return; } if ((p = findie(skb->data, skb->len, IE_DISPLAY, 0)) != NULL) @@ -3147,7 +3120,7 @@ dss1up(struct PStack *st, int pr, void *arg) } datastatelist[i].rout(proc, pr, skb); } - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); return; } diff --git a/drivers/isdn/hisax/md5sums.asc b/drivers/isdn/hisax/md5sums.asc index 7fe2bbbae56e..f0939f7714a8 100644 --- a/drivers/isdn/hisax/md5sums.asc +++ b/drivers/isdn/hisax/md5sums.asc @@ -6,26 +6,26 @@ # Eicon Technology Diva 2.01 PCI cards in the moment. # Read ../../../Documentation/isdn/HiSax.cert for more informations. # -d93f31e02c1b153ec04d16f69e5688b3 isac.c -e2a78c07f32c8ca7c88fc9f92a87dfab isdnl1.c -54490c4f46a998ff4ef34287bc262185 isdnl2.c -f4184a50e35e5b568608e6cb7a693319 isdnl3.c -ef70f4269fdc2ca15100f9b776afaa0d tei.c -cf3923304983e9d64cf35bc5a3533f6c callc.c +e99c0a0111a10aa88daa3f3f453f1e73 isac.c +a9a15d069dbacb383cc24c238cb5ebbe isdnl1.c +7ce53a4b9f78722fe5498a20067bcb3a isdnl2.c +978120723f9beb6c97c288584e2896c9 isdnl3.c +ff2691458dd2b8b3b6504d25a60381fa tei.c +b002c28266bb3b111995140b86b61023 callc.c bf9605b36429898f7be6630034e83230 cert.c -309261e4c36d950db6978440e8bc8342 l3dss1.c -b674eee9314a7cc413971c84003cf1d2 l3_1tr6.c -8f86d92f43ecc42f6457773168cfc114 elsa.c -24cda374da44b57f6a1bb215424267b5 diva.c +3fe91ac7175e1c15ad5f15b6d71b2756 l3dss1.c +2d748ced0eea375b21fe7ea91ca7917c l3_1tr6.c +72ee065c70473949a676f06f8ce83ebf elsa.c +21515518209e7048dd887d8a60102598 diva.c # end of md5sums -----BEGIN PGP SIGNATURE----- Version: 2.6.3i Charset: noconv -iQCVAwUBN7HnvDpxHvX/mS9tAQFANgP+LGuG98lvCv97vN2dc6T/6hZTxFW+WirJ -XMhU5NHoZ+8MISMOVKB7ugsGO9cJI0lUA0sOe8jtPCo5070nF1ZkNsxV/x7WK2dS -RwXfHy6+TAH7qIiBnkP9odB2lib+VFl/nnkkTwsXfVwRCD8bLaagMPv+nAveDoNE -uff0xxXEnJw= -=Wu2M +iQCVAwUBN955dTpxHvX/mS9tAQHS5wP8Cqlr9EKFJD8nmgSNsGJxxweY4OSM0xNH +3CEhDd5sm/7bAk4id+UH/KQjtRpNoV9CJCLPyW9ADc1m/Y0oFZdhdNSfYjcdfXXo +1eR3NK1TAO3WKabhIw7Shyh5aryrriTRBN19uFhsxsyPsxkVsk0A8JGZqwWiAxW2 +9ZoGxGJsGp8= +=IjAL -----END PGP SIGNATURE----- diff --git a/drivers/isdn/hisax/netjet.c b/drivers/isdn/hisax/netjet.c index 7043959e9db6..e25cdc1902b7 100644 --- a/drivers/isdn/hisax/netjet.c +++ b/drivers/isdn/hisax/netjet.c @@ -1,4 +1,4 @@ -/* $Id: netjet.c,v 1.13 1999/08/11 21:01:31 keil Exp $ +/* $Id: netjet.c,v 1.15 1999/09/04 06:20:06 keil Exp $ * netjet.c low level stuff for Traverse Technologie NETJet ISDN cards * @@ -7,6 +7,12 @@ * Thanks to Traverse Technologie Australia for documents and informations * * $Log: netjet.c,v $ + * Revision 1.15 1999/09/04 06:20:06 keil + * Changes from kernel set_current_state() + * + * Revision 1.14 1999/08/31 11:20:25 paul + * various spelling corrections (new checksums may be needed, Karsten!) + * * Revision 1.13 1999/08/11 21:01:31 keil * new PCI codefix * @@ -59,9 +65,6 @@ #include "hscx.h" #include "isdnl1.h" #include -#ifndef COMPAT_HAS_NEW_PCI -#include -#endif #include #include @@ -75,7 +78,7 @@ extern const char *CardType[]; -const char *NETjet_revision = "$Revision: 1.13 $"; +const char *NETjet_revision = "$Revision: 1.15 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) @@ -406,7 +409,7 @@ static void got_frame(struct BCState *bcs, int count) { if (!(skb = dev_alloc_skb(count))) printk(KERN_WARNING "TIGER: receive out of memory\n"); else { - SET_SKB_FREE(skb); + ; memcpy(skb_put(skb, count), bcs->hw.tiger.rcvbuf, count); skb_queue_tail(&bcs->rqueue, skb); } @@ -556,7 +559,7 @@ static void read_raw(struct BCState *bcs, u_int *buf, int cnt){ if ((state == HDLC_FRAME_FOUND) && !(bitcnt & 7)) { if ((bitcnt>>3)>=HSCX_BUFMAX) { - debugl1(bcs->cs, "tiger: frame to big"); + debugl1(bcs->cs, "tiger: frame too big"); r_val=0; state=HDLC_FLAG_SEARCH; bcs->hw.tiger.r_err++; @@ -705,7 +708,7 @@ static void write_raw(struct BCState *bcs, u_int *buf, int cnt) { if (bcs->st->lli.l1writewakeup && (PACKET_NOACK != bcs->tx_skb->pkt_type)) bcs->st->lli.l1writewakeup(bcs->st, bcs->tx_skb->len); - idev_kfree_skb(bcs->tx_skb, FREE_WRITE); + dev_kfree_skb(bcs->tx_skb); bcs->tx_skb = NULL; } test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); @@ -842,7 +845,7 @@ close_tigerstate(struct BCState *bcs) discard_queue(&bcs->rqueue); discard_queue(&bcs->squeue); if (bcs->tx_skb) { - idev_kfree_skb(bcs->tx_skb, FREE_WRITE); + dev_kfree_skb(bcs->tx_skb); bcs->tx_skb = NULL; test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); } @@ -1074,11 +1077,7 @@ NETjet_card_msg(struct IsdnCardState *cs, int mt, void *arg) return(0); } -#ifdef COMPAT_HAS_NEW_PCI static struct pci_dev *dev_netjet __initdata = NULL; -#else -static int pci_index __initdata = 0; -#endif __initfunc(int setup_netjet(struct IsdnCard *card)) @@ -1087,10 +1086,6 @@ setup_netjet(struct IsdnCard *card)) struct IsdnCardState *cs = card->cs; char tmp[64]; #if CONFIG_PCI -#ifndef COMPAT_HAS_NEW_PCI - u_char pci_bus, pci_device_fn, pci_irq; - u_int pci_ioaddr, found; -#endif #endif strcpy(tmp, NETjet_revision); printk(KERN_INFO "HiSax: Traverse Tech. NETjet driver Rev. %s\n", HiSax_getrev(tmp)); @@ -1098,7 +1093,6 @@ setup_netjet(struct IsdnCard *card)) return(0); test_and_clear_bit(FLG_LOCK_ATOMIC, &cs->HW_Flags); #if CONFIG_PCI -#ifdef COMPAT_HAS_NEW_PCI if (!pci_present()) { printk(KERN_ERR "Netjet: no PCI bus present\n"); return(0); @@ -1110,7 +1104,7 @@ setup_netjet(struct IsdnCard *card)) printk(KERN_WARNING "NETjet: No IRQ for PCI card found\n"); return(0); } - cs->hw.njet.base = get_pcibase(dev_netjet, 0) + cs->hw.njet.base = dev_netjet->base_address[ 0] & PCI_BASE_ADDRESS_IO_MASK; if (!cs->hw.njet.base) { printk(KERN_WARNING "NETjet: No IO-Adr for PCI card found\n"); @@ -1120,41 +1114,6 @@ setup_netjet(struct IsdnCard *card)) printk(KERN_WARNING "NETjet: No PCI card found\n"); return(0); } -#else - found = 0; - for (; pci_index < 0xff; pci_index++) { - if (pcibios_find_device(PCI_VENDOR_TRAVERSE_TECH, - PCI_NETJET_ID, pci_index, &pci_bus, &pci_device_fn) - == PCIBIOS_SUCCESSFUL) - found = 1; - else - continue; - /* get IRQ */ - pcibios_read_config_byte(pci_bus, pci_device_fn, - PCI_INTERRUPT_LINE, &pci_irq); - - /* get IO address */ - pcibios_read_config_dword(pci_bus, pci_device_fn, - PCI_BASE_ADDRESS_0, &pci_ioaddr); - if (found) - break; - } - if (!found) { - printk(KERN_WARNING "NETjet: No PCI card found\n"); - return(0); - } - pci_index++; - if (!pci_irq) { - printk(KERN_WARNING "NETjet: No IRQ for PCI card found\n"); - return(0); - } - if (!pci_ioaddr) { - printk(KERN_WARNING "NETjet: No IO-Adr for PCI card found\n"); - return(0); - } - cs->hw.njet.base = pci_ioaddr & PCI_BASE_ADDRESS_IO_MASK; - cs->irq = pci_irq; -#endif /* COMPAT_HAS_NEW_PCI */ cs->hw.njet.auxa = cs->hw.njet.base + NETJET_AUXDATA; cs->hw.njet.isac = cs->hw.njet.base | NETJET_ISAC_OFF; bytecnt = 256; diff --git a/drivers/isdn/hisax/niccy.c b/drivers/isdn/hisax/niccy.c index d83287d23287..aec259e86795 100644 --- a/drivers/isdn/hisax/niccy.c +++ b/drivers/isdn/hisax/niccy.c @@ -40,9 +40,6 @@ #include "hscx.h" #include "isdnl1.h" #include -#ifndef COMPAT_HAS_NEW_PCI -#include -#endif extern const char *CardType[]; const char *niccy_revision = "$Revision: 1.8 $"; @@ -259,11 +256,7 @@ niccy_card_msg(struct IsdnCardState *cs, int mt, void *arg) return(0); } -#ifdef COMPAT_HAS_NEW_PCI static struct pci_dev *niccy_dev __initdata = NULL; -#else -static int pci_index __initdata = 0; -#endif __initfunc(int setup_niccy(struct IsdnCard *card)) @@ -306,7 +299,6 @@ setup_niccy(struct IsdnCard *card)) } else { #if CONFIG_PCI u_int pci_ioaddr; -#ifdef COMPAT_HAS_NEW_PCI if (!pci_present()) { printk(KERN_ERR "Niccy: no PCI bus present\n"); return(0); @@ -320,66 +312,21 @@ setup_niccy(struct IsdnCard *card)) return(0); } cs->irq = niccy_dev->irq; - if (!get_pcibase(niccy_dev, 0)) { + if (!niccy_dev->base_address[ 0]) { printk(KERN_WARNING "Niccy: No IO-Adr for PCI cfg found\n"); return(0); } - cs->hw.niccy.cfg_reg = get_pcibase(niccy_dev, 0) & PCI_BASE_ADDRESS_IO_MASK; - if (!get_pcibase(niccy_dev, 1)) { + cs->hw.niccy.cfg_reg = niccy_dev->base_address[ 0] & PCI_BASE_ADDRESS_IO_MASK; + if (!niccy_dev->base_address[ 1]) { printk(KERN_WARNING "Niccy: No IO-Adr for PCI card found\n"); return(0); } - pci_ioaddr = get_pcibase(niccy_dev, 1) & PCI_BASE_ADDRESS_IO_MASK; + pci_ioaddr = niccy_dev->base_address[ 1] & PCI_BASE_ADDRESS_IO_MASK; cs->subtyp = NICCY_PCI; } else { printk(KERN_WARNING "Niccy: No PCI card found\n"); return(0); } -#else - u_char pci_bus, pci_device_fn, pci_irq; - - cs->subtyp = 0; - for (; pci_index < 0xff; pci_index++) { - if (pcibios_find_device(PCI_VENDOR_DR_NEUHAUS, - PCI_NICCY_ID, pci_index, &pci_bus, &pci_device_fn) - == PCIBIOS_SUCCESSFUL) - cs->subtyp = NICCY_PCI; - else - continue; - /* get IRQ */ - pcibios_read_config_byte(pci_bus, pci_device_fn, - PCI_INTERRUPT_LINE, &pci_irq); - - /* get IO pci AMCC address */ - pcibios_read_config_dword(pci_bus, pci_device_fn, - PCI_BASE_ADDRESS_0, &pci_ioaddr); - if (!pci_ioaddr) { - printk(KERN_WARNING "Niccy: No IO-Adr for PCI cfg found\n"); - return(0); - } - cs->hw.niccy.cfg_reg = pci_ioaddr & ~3 ; - /* get IO address */ - pcibios_read_config_dword(pci_bus, pci_device_fn, - PCI_BASE_ADDRESS_1, &pci_ioaddr); - if (cs->subtyp) - break; - } - if (!cs->subtyp) { - printk(KERN_WARNING "Niccy: No PCI card found\n"); - return(0); - } - pci_index++; - if (!pci_irq) { - printk(KERN_WARNING "Niccy: No IRQ for PCI card found\n"); - return(0); - } - if (!pci_ioaddr) { - printk(KERN_WARNING "Niccy: No IO-Adr for PCI card found\n"); - return(0); - } - pci_ioaddr &= ~3; /* remove io/mem flag */ - cs->irq = pci_irq; -#endif /* COMPAT_HAS_NEW_PCI */ cs->irq_flags |= SA_SHIRQ; cs->hw.niccy.isac = pci_ioaddr + ISAC_PCI_DATA; cs->hw.niccy.isac_ale = pci_ioaddr + ISAC_PCI_ADDR; diff --git a/drivers/isdn/hisax/saphir.c b/drivers/isdn/hisax/saphir.c index b132afc2c51e..9568f88a548d 100644 --- a/drivers/isdn/hisax/saphir.c +++ b/drivers/isdn/hisax/saphir.c @@ -1,4 +1,4 @@ -/* $Id: saphir.c,v 1.3 1999/07/12 21:05:26 keil Exp $ +/* $Id: saphir.c,v 1.4 1999/09/04 06:20:06 keil Exp $ * saphir.c low level stuff for HST Saphir 1 * @@ -8,6 +8,9 @@ * * * $Log: saphir.c,v $ + * Revision 1.4 1999/09/04 06:20:06 keil + * Changes from kernel set_current_state() + * * Revision 1.3 1999/07/12 21:05:26 keil * fix race in IRQ handling * added watchdog for lost IRQs @@ -26,7 +29,7 @@ #include "isdnl1.h" extern const char *CardType[]; -static char *saphir_rev = "$Revision: 1.3 $"; +static char *saphir_rev = "$Revision: 1.4 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) diff --git a/drivers/isdn/hisax/sedlbauer.c b/drivers/isdn/hisax/sedlbauer.c index 25303b6e942b..777c0cae9e1a 100644 --- a/drivers/isdn/hisax/sedlbauer.c +++ b/drivers/isdn/hisax/sedlbauer.c @@ -1,4 +1,4 @@ -/* $Id: sedlbauer.c,v 1.14 1999/08/11 20:59:22 keil Exp $ +/* $Id: sedlbauer.c,v 1.17 1999/09/04 06:20:06 keil Exp $ * sedlbauer.c low level stuff for Sedlbauer cards * includes support for the Sedlbauer speed star (speed star II), @@ -17,6 +17,16 @@ * Edgar Toernig * * $Log: sedlbauer.c,v $ + * Revision 1.17 1999/09/04 06:20:06 keil + * Changes from kernel set_current_state() + * + * Revision 1.16 1999/08/29 18:23:01 niemann + * Fixed typo in errormsg + * + * Revision 1.15 1999/08/25 17:00:00 keil + * Make ISAR V32bis modem running + * Make LL->HL interface open for additional commands + * * Revision 1.14 1999/08/11 20:59:22 keil * new PCI codefix * fix IRQ problem while unload @@ -93,13 +103,10 @@ #include "isar.h" #include "isdnl1.h" #include -#ifndef COMPAT_HAS_NEW_PCI -#include -#endif extern const char *CardType[]; -const char *Sedlbauer_revision = "$Revision: 1.14 $"; +const char *Sedlbauer_revision = "$Revision: 1.17 $"; const char *Sedlbauer_Types[] = {"None", "speed card/win", "speed star", "speed fax+", @@ -530,25 +537,12 @@ Sedl_card_msg(struct IsdnCardState *cs, int mt, void *arg) return(0); case CARD_TEST: return(0); - case CARD_LOAD_FIRM: - if (cs->hw.sedl.chip == SEDL_CHIP_ISAC_ISAR) { - if (isar_load_firmware(cs, arg)) - return(1); - else - ll_run(cs); - } - return(0); } return(0); } - #ifdef SEDLBAUER_PCI -#ifdef COMPAT_HAS_NEW_PCI static struct pci_dev *dev_sedl __initdata = NULL; -#else -static int pci_index __initdata = 0; -#endif #endif __initfunc(int @@ -587,9 +581,8 @@ setup_sedlbauer(struct IsdnCard *card)) /* Probe for Sedlbauer speed pci */ #if SEDLBAUER_PCI #if CONFIG_PCI -#ifdef COMPAT_HAS_NEW_PCI if (!pci_present()) { - printk(KERN_ERR "FritzPCI: no PCI bus present\n"); + printk(KERN_ERR "Sedlbauer: no PCI bus present\n"); return(0); } if ((dev_sedl = pci_find_device(PCI_VENDOR_SEDLBAUER, @@ -599,41 +592,12 @@ setup_sedlbauer(struct IsdnCard *card)) printk(KERN_WARNING "Sedlbauer: No IRQ for PCI card found\n"); return(0); } - cs->hw.sedl.cfg_reg = get_pcibase(dev_sedl, 0) & + cs->hw.sedl.cfg_reg = dev_sedl->base_address[ 0] & PCI_BASE_ADDRESS_IO_MASK; } else { printk(KERN_WARNING "Sedlbauer: No PCI card found\n"); return(0); } -#else - for (; pci_index < 255; pci_index++) { - unsigned char pci_bus, pci_device_fn; - unsigned int ioaddr; - unsigned char irq; - - if (pcibios_find_device (PCI_VENDOR_SEDLBAUER, - PCI_SPEEDPCI_ID, pci_index, - &pci_bus, &pci_device_fn) != 0) { - continue; - } - pcibios_read_config_byte(pci_bus, pci_device_fn, - PCI_INTERRUPT_LINE, &irq); - pcibios_read_config_dword(pci_bus, pci_device_fn, - PCI_BASE_ADDRESS_0, &ioaddr); - cs->irq = irq; - cs->hw.sedl.cfg_reg = ioaddr & PCI_BASE_ADDRESS_IO_MASK; - if (!cs->hw.sedl.cfg_reg) { - printk(KERN_WARNING "Sedlbauer: No IO-Adr for PCI card found\n"); - return(0); - } - break; - } - if (pci_index == 255) { - printk(KERN_WARNING "Sedlbauer: No PCI card found\n"); - return(0); - } - pci_index++; -#endif /* COMPAT_HAS_NEW_PCI */ cs->irq_flags |= SA_SHIRQ; cs->hw.sedl.bus = SEDL_BUS_PCI; cs->hw.sedl.chip = SEDL_CHIP_IPAC; @@ -743,7 +707,7 @@ setup_sedlbauer(struct IsdnCard *card)) cs->bcs[1].hw.isar.reg = &cs->hw.sedl.isar; test_and_set_bit(HW_ISAR, &cs->HW_Flags); cs->irq_func = &sedlbauer_interrupt_isar; - + cs->auxcmd = &isar_auxcmd; ISACVersion(cs, "Sedlbauer:"); cs->BC_Read_Reg = &ReadISAR; diff --git a/drivers/isdn/hisax/sportster.c b/drivers/isdn/hisax/sportster.c index 0d062dadaf36..d4407fb7466f 100644 --- a/drivers/isdn/hisax/sportster.c +++ b/drivers/isdn/hisax/sportster.c @@ -1,4 +1,4 @@ -/* $Id: sportster.c,v 1.9 1999/07/12 21:05:29 keil Exp $ +/* $Id: sportster.c,v 1.10 1999/09/04 06:20:06 keil Exp $ * sportster.c low level stuff for USR Sportster internal TA * @@ -7,6 +7,9 @@ * Thanks to Christian "naddy" Weisgerber (3Com, US Robotics) for documentation * * $Log: sportster.c,v $ + * Revision 1.10 1999/09/04 06:20:06 keil + * Changes from kernel set_current_state() + * * Revision 1.9 1999/07/12 21:05:29 keil * fix race in IRQ handling * added watchdog for lost IRQs @@ -43,7 +46,7 @@ #include "isdnl1.h" extern const char *CardType[]; -const char *sportster_revision = "$Revision: 1.9 $"; +const char *sportster_revision = "$Revision: 1.10 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) diff --git a/drivers/isdn/hisax/tei.c b/drivers/isdn/hisax/tei.c index f21284bece2c..e7b7c0de8d22 100644 --- a/drivers/isdn/hisax/tei.c +++ b/drivers/isdn/hisax/tei.c @@ -169,7 +169,7 @@ put_tei_msg(struct PStack *st, u_char m_id, unsigned int ri, u_char tei) printk(KERN_WARNING "HiSax: No skb for TEI manager\n"); return; } - SET_SKB_FREE(skb); + ; bp = skb_put(skb, 3); bp[0] = (TEI_SAPI << 2); bp[1] = (GROUP_TEI << 1) | 0x1; @@ -371,7 +371,7 @@ tei_l1l2(struct PStack *st, int pr, void *arg) int mt; if (test_bit(FLG_FIXED_TEI, &st->l2.flag)) { - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); return; } @@ -417,7 +417,7 @@ tei_l1l2(struct PStack *st, int pr, void *arg) st->ma.tei_m.printdebug(&st->ma.tei_m, "tei handler wrong pr %x\n", pr); } - idev_kfree_skb(skb, FREE_READ); + dev_kfree_skb(skb); } static void diff --git a/drivers/isdn/hisax/teleint.c b/drivers/isdn/hisax/teleint.c index 05a74bdf7f97..413b71379ae4 100644 --- a/drivers/isdn/hisax/teleint.c +++ b/drivers/isdn/hisax/teleint.c @@ -1,4 +1,4 @@ -/* $Id: teleint.c,v 1.9 1999/07/12 21:05:30 keil Exp $ +/* $Id: teleint.c,v 1.11 1999/09/04 06:20:06 keil Exp $ * teleint.c low level stuff for TeleInt isdn cards * @@ -6,6 +6,12 @@ * * * $Log: teleint.c,v $ + * Revision 1.11 1999/09/04 06:20:06 keil + * Changes from kernel set_current_state() + * + * Revision 1.10 1999/08/31 11:20:27 paul + * various spelling corrections (new checksums may be needed, Karsten!) + * * Revision 1.9 1999/07/12 21:05:30 keil * fix race in IRQ handling * added watchdog for lost IRQs @@ -45,7 +51,7 @@ extern const char *CardType[]; -const char *TeleInt_revision = "$Revision: 1.9 $"; +const char *TeleInt_revision = "$Revision: 1.11 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) @@ -64,7 +70,7 @@ readreg(unsigned int ale, unsigned int adr, u_char off) while (ret && --max_delay) ret = HFC_BUSY & bytein(ale); if (!max_delay) { - printk(KERN_WARNING "TeleInt Busy not inaktive\n"); + printk(KERN_WARNING "TeleInt Busy not inactive\n"); restore_flags(flags); return (0); } @@ -86,7 +92,7 @@ readfifo(unsigned int ale, unsigned int adr, u_char off, u_char * data, int size while (ret && --max_delay) ret = HFC_BUSY & bytein(ale); if (!max_delay) { - printk(KERN_WARNING "TeleInt Busy not inaktive\n"); + printk(KERN_WARNING "TeleInt Busy not inactive\n"); return; } data[i] = bytein(adr); @@ -108,7 +114,7 @@ writereg(unsigned int ale, unsigned int adr, u_char off, u_char data) while (ret && --max_delay) ret = HFC_BUSY & bytein(ale); if (!max_delay) { - printk(KERN_WARNING "TeleInt Busy not inaktive\n"); + printk(KERN_WARNING "TeleInt Busy not inactive\n"); restore_flags(flags); return; } @@ -130,7 +136,7 @@ writefifo(unsigned int ale, unsigned int adr, u_char off, u_char * data, int siz while (ret && --max_delay) ret = HFC_BUSY & bytein(ale); if (!max_delay) { - printk(KERN_WARNING "TeleInt Busy not inaktive\n"); + printk(KERN_WARNING "TeleInt Busy not inactive\n"); return; } byteout(adr, data[i]); diff --git a/drivers/isdn/hisax/teles3.c b/drivers/isdn/hisax/teles3.c index e54745458845..0db245abcfc8 100644 --- a/drivers/isdn/hisax/teles3.c +++ b/drivers/isdn/hisax/teles3.c @@ -1,4 +1,4 @@ -/* $Id: teles3.c,v 2.12 1999/07/12 21:05:32 keil Exp $ +/* $Id: teles3.c,v 2.13 1999/08/30 12:01:28 keil Exp $ * teles3.c low level stuff for Teles 16.3 & PNP isdn cards * @@ -11,6 +11,9 @@ * Beat Doebeli * * $Log: teles3.c,v $ + * Revision 2.13 1999/08/30 12:01:28 keil + * HW version v1.3 support + * * Revision 2.12 1999/07/12 21:05:32 keil * fix race in IRQ handling * added watchdog for lost IRQs @@ -85,7 +88,7 @@ #include "isdnl1.h" extern const char *CardType[]; -const char *teles3_revision = "$Revision: 2.12 $"; +const char *teles3_revision = "$Revision: 2.13 $"; #define byteout(addr,val) outb(val,addr) #define bytein(addr) inb(addr) @@ -464,9 +467,10 @@ setup_teles3(struct IsdnCard *card)) * 0x1f=with AB * 0x1c 16.3 ??? * 0x39 16.3 1.1 + * 0x38 16.3 1.3 * 0x46 16.3 with AB + Video (Teles-Vision) */ - if (val != 0x46 && val != 0x39 && val != 0x1c && val != 0x1e && val != 0x1f) { + if (val != 0x46 && val != 0x39 && val != 0x38 && val != 0x1c && val != 0x1e && val != 0x1f) { printk(KERN_WARNING "Teles: 16.3 Byte at %x is %x\n", cs->hw.teles3.cfg_reg + 2, val); release_io_teles3(cs); diff --git a/drivers/isdn/hisax/telespci.c b/drivers/isdn/hisax/telespci.c index dd9e5fb4a2fe..e98e4d742b56 100644 --- a/drivers/isdn/hisax/telespci.c +++ b/drivers/isdn/hisax/telespci.c @@ -42,9 +42,6 @@ #include "hscx.h" #include "isdnl1.h" #include -#ifndef COMPAT_HAS_NEW_PCI -#include -#endif extern const char *CardType[]; const char *telespci_revision = "$Revision: 2.9 $"; @@ -304,29 +301,19 @@ TelesPCI_card_msg(struct IsdnCardState *cs, int mt, void *arg) return(0); } -#ifdef COMPAT_HAS_NEW_PCI static struct pci_dev *dev_tel __initdata = NULL; -#else -static int pci_index __initdata = 0; -#endif __initfunc(int setup_telespci(struct IsdnCard *card)) { struct IsdnCardState *cs = card->cs; char tmp[64]; -#ifndef COMPAT_HAS_NEW_PCI - u_char pci_bus, pci_device_fn, pci_irq; - u_int pci_memaddr; - u_char found = 0; -#endif strcpy(tmp, telespci_revision); printk(KERN_INFO "HiSax: Teles/PCI driver Rev. %s\n", HiSax_getrev(tmp)); if (cs->typ != ISDN_CTYPE_TELESPCI) return (0); #if CONFIG_PCI -#ifdef COMPAT_HAS_NEW_PCI if (!pci_present()) { printk(KERN_ERR "TelesPCI: no PCI bus present\n"); return(0); @@ -337,40 +324,14 @@ setup_telespci(struct IsdnCard *card)) printk(KERN_WARNING "Teles: No IRQ for PCI card found\n"); return(0); } - cs->hw.teles0.membase = (u_int) ioremap(get_pcibase(dev_tel, 0), + cs->hw.teles0.membase = (u_int) ioremap(dev_tel->base_address[ 0], PAGE_SIZE); printk(KERN_INFO "Found: Zoran, base-address: 0x%lx, irq: 0x%x\n", - get_pcibase(dev_tel, 0), dev_tel->irq); + dev_tel->base_address[ 0], dev_tel->irq); } else { printk(KERN_WARNING "TelesPCI: No PCI card found\n"); return(0); } -#else - for (; pci_index < 0xff; pci_index++) { - if (pcibios_find_device (0x11DE, 0x6120, - pci_index, &pci_bus, &pci_device_fn) - == PCIBIOS_SUCCESSFUL) { - found = 1; - } else { - break; - } - pcibios_read_config_dword(pci_bus, pci_device_fn, - PCI_BASE_ADDRESS_0, &pci_memaddr); - pcibios_read_config_byte(pci_bus, pci_device_fn, - PCI_INTERRUPT_LINE, &pci_irq); - - printk(KERN_INFO "Found: Zoran, base-address: 0x%x," - " irq: 0x%x\n", pci_memaddr, pci_irq); - break; - } - if (!found) { - printk(KERN_WARNING "TelesPCI: No PCI card found\n"); - return(0); - } - pci_index++; - cs->irq = pci_irq; - cs->hw.teles0.membase = (u_int) vremap(pci_memaddr, PAGE_SIZE); -#endif /* COMPAT_HAS_NEW_PCI */ #else printk(KERN_WARNING "HiSax: Teles/PCI and NO_PCI_BIOS\n"); printk(KERN_WARNING "HiSax: Teles/PCI unable to config\n"); diff --git a/drivers/isdn/hisax/w6692.c b/drivers/isdn/hisax/w6692.c new file mode 100644 index 000000000000..ed7e40eda1e9 --- /dev/null +++ b/drivers/isdn/hisax/w6692.c @@ -0,0 +1,1066 @@ +/* $Id: w6692.c,v 1.1 1999/09/04 06:28:58 keil Exp $ + + * w6692.c Winbond W6692 specific routines + * + * Author Petr Novak + * (based on HiSax driver by Karsten Keil) + * + * This file is (c) under GNU PUBLIC LICENSE + * + * $Log: w6692.c,v $ + * Revision 1.1 1999/09/04 06:28:58 keil + * first revision + * + * + * + */ + +#include +#define __NO_VERSION__ +#include "hisax.h" +#include "w6692.h" +#include "isdnl1.h" +#include +#include + +#define PCI_VEND_ASUSCOM 0x675 +#define PCI_DEV_ASUSCOMPCI1 0x1702 +#ifndef PCI_VENDOR_ID_WINBOND2 +#define PCI_VENDOR_ID_WINBOND2 0x1050 +#endif +#define PCI_DEVICE_W6692 0x6692 + +/* table entry in the PCI devices list */ +typedef struct { + int vendor_id; + int device_id; + char *vendor_name; + char *card_name; +} PCI_ENTRY; + +static const PCI_ENTRY id_list[] = +{ + {PCI_VEND_ASUSCOM, PCI_DEV_ASUSCOMPCI1, "AsusCom", "TA XXX"}, + {PCI_VENDOR_ID_WINBOND2, PCI_DEVICE_W6692, "Winbond", "W6692"}, + {0, 0, NULL, NULL} +}; + +extern const char *CardType[]; + +const char *w6692_revision = "$Revision: 1.1 $"; + +#define DBUSY_TIMER_VALUE 80 + +static char *W6692Ver[] HISAX_INITDATA = +{"W6692 V00", "W6692 V01", "W6692 V10", + "W6692 V11"}; + +static void +W6692Version(struct IsdnCardState *cs, char *s) +{ + int val; + + val = cs->readW6692(cs, W_D_RBCH); + printk(KERN_INFO "%s Winbond W6692 version (%x): %s\n", s, val, W6692Ver[(val >> 6) & 3]); +} + +static void +ph_command(struct IsdnCardState *cs, unsigned int command) +{ + if (cs->debug & L1_DEB_ISAC) + debugl1(cs, "ph_command %x", command); + cs->writeisac(cs, W_CIX, command); +} + + +static void +W6692_new_ph(struct IsdnCardState *cs) +{ + switch (cs->dc.w6692.ph_state) { + case (W_L1CMD_RST): + ph_command(cs, W_L1CMD_DRC); + l1_msg(cs, HW_RESET | INDICATION, NULL); + /* fallthru */ + case (W_L1IND_CD): + l1_msg(cs, HW_DEACTIVATE | CONFIRM, NULL); + break; + case (W_L1IND_DRD): + l1_msg(cs, HW_DEACTIVATE | INDICATION, NULL); + break; + case (W_L1IND_CE): + l1_msg(cs, HW_POWERUP | CONFIRM, NULL); + break; + case (W_L1IND_LD): + l1_msg(cs, HW_RSYNC | INDICATION, NULL); + break; + case (W_L1IND_ARD): + l1_msg(cs, HW_INFO2 | INDICATION, NULL); + break; + case (W_L1IND_AI8): + l1_msg(cs, HW_INFO4_P8 | INDICATION, NULL); + break; + case (W_L1IND_AI10): + l1_msg(cs, HW_INFO4_P10 | INDICATION, NULL); + break; + default: + break; + } +} + +static void +W6692_bh(struct IsdnCardState *cs) +{ + struct PStack *stptr; + + if (!cs) + return; + if (test_and_clear_bit(D_CLEARBUSY, &cs->event)) { + if (cs->debug) + debugl1(cs, "D-Channel Busy cleared"); + stptr = cs->stlist; + while (stptr != NULL) { + stptr->l1.l1l2(stptr, PH_PAUSE | CONFIRM, NULL); + stptr = stptr->next; + } + } + if (test_and_clear_bit(D_L1STATECHANGE, &cs->event)) + W6692_new_ph(cs); + if (test_and_clear_bit(D_RCVBUFREADY, &cs->event)) + DChannel_proc_rcv(cs); + if (test_and_clear_bit(D_XMTBUFREADY, &cs->event)) + DChannel_proc_xmt(cs); +/* + if (test_and_clear_bit(D_RX_MON1, &cs->event)) + arcofi_fsm(cs, ARCOFI_RX_END, NULL); + if (test_and_clear_bit(D_TX_MON1, &cs->event)) + arcofi_fsm(cs, ARCOFI_TX_END, NULL); + */ +} + +void +W6692_sched_event(struct IsdnCardState *cs, int event) +{ + test_and_set_bit(event, &cs->event); + queue_task(&cs->tqueue, &tq_immediate); + mark_bh(IMMEDIATE_BH); +} + +static void +W6692B_sched_event(struct BCState *bcs, int event) +{ + bcs->event |= 1 << event; + queue_task(&bcs->tqueue, &tq_immediate); + mark_bh(IMMEDIATE_BH); +} + +static void +W6692_empty_fifo(struct IsdnCardState *cs, int count) +{ + u_char *ptr; + long flags; + + if ((cs->debug & L1_DEB_ISAC) && !(cs->debug & L1_DEB_ISAC_FIFO)) + debugl1(cs, "W6692_empty_fifo"); + + if ((cs->rcvidx + count) >= MAX_DFRAME_LEN_L1) { + if (cs->debug & L1_DEB_WARN) + debugl1(cs, "W6692_empty_fifo overrun %d", + cs->rcvidx + count); + cs->writeW6692(cs, W_D_CMDR, W_D_CMDR_RACK); + cs->rcvidx = 0; + return; + } + ptr = cs->rcvbuf + cs->rcvidx; + cs->rcvidx += count; + save_flags(flags); + cli(); + cs->readW6692fifo(cs, ptr, count); + cs->writeW6692(cs, W_D_CMDR, W_D_CMDR_RACK); + restore_flags(flags); + if (cs->debug & L1_DEB_ISAC_FIFO) { + char *t = cs->dlog; + + t += sprintf(t, "W6692_empty_fifo cnt %d", count); + QuickHex(t, ptr, count); + debugl1(cs, cs->dlog); + } +} + +static void +W6692_fill_fifo(struct IsdnCardState *cs) +{ + int count, more; + u_char *ptr; + long flags; + + if ((cs->debug & L1_DEB_ISAC) && !(cs->debug & L1_DEB_ISAC_FIFO)) + debugl1(cs, "W6692_fill_fifo"); + + if (!cs->tx_skb) + return; + + count = cs->tx_skb->len; + if (count <= 0) + return; + + more = 0; + if (count > W_D_FIFO_THRESH) { + more = !0; + count = W_D_FIFO_THRESH; + } + save_flags(flags); + cli(); + ptr = cs->tx_skb->data; + skb_pull(cs->tx_skb, count); + cs->tx_cnt += count; + cs->writeW6692fifo(cs, ptr, count); + cs->writeW6692(cs, W_D_CMDR, more ? W_D_CMDR_XMS : (W_D_CMDR_XMS | W_D_CMDR_XME)); + restore_flags(flags); + if (test_and_set_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) { + debugl1(cs, "W6692_fill_fifo dbusytimer running"); + del_timer(&cs->dbusytimer); + } + init_timer(&cs->dbusytimer); + cs->dbusytimer.expires = jiffies + ((DBUSY_TIMER_VALUE * HZ) / 1000); + add_timer(&cs->dbusytimer); + if (cs->debug & L1_DEB_ISAC_FIFO) { + char *t = cs->dlog; + + t += sprintf(t, "W6692_fill_fifo cnt %d", count); + QuickHex(t, ptr, count); + debugl1(cs, cs->dlog); + } +} + +static void +W6692B_empty_fifo(struct BCState *bcs, int count) +{ + u_char *ptr; + struct IsdnCardState *cs = bcs->cs; + long flags; + + if ((cs->debug & L1_DEB_HSCX) && !(cs->debug & L1_DEB_HSCX_FIFO)) + debugl1(cs, "W6692B_empty_fifo"); + + if (bcs->hw.w6692.rcvidx + count > HSCX_BUFMAX) { + if (cs->debug & L1_DEB_WARN) + debugl1(cs, "W6692B_empty_fifo: incoming packet too large"); + cs->BC_Write_Reg(cs, bcs->hw.w6692.bchan, W_B_CMDR, W_B_CMDR_RACK | W_B_CMDR_RACT); + bcs->hw.w6692.rcvidx = 0; + return; + } + ptr = bcs->hw.w6692.rcvbuf + bcs->hw.w6692.rcvidx; + bcs->hw.w6692.rcvidx += count; + save_flags(flags); + cli(); + READW6692BFIFO(cs, bcs->hw.w6692.bchan, ptr, count); + cs->BC_Write_Reg(cs, bcs->hw.w6692.bchan, W_B_CMDR, W_B_CMDR_RACK | W_B_CMDR_RACT); + restore_flags(flags); + if (cs->debug & L1_DEB_HSCX_FIFO) { + char *t = bcs->blog; + + t += sprintf(t, "W6692B_empty_fifo %c cnt %d", + bcs->hw.w6692.bchan ? 'B' : 'A', count); + QuickHex(t, ptr, count); + debugl1(cs, bcs->blog); + } +} + +static void +W6692B_fill_fifo(struct BCState *bcs) +{ + struct IsdnCardState *cs = bcs->cs; + int more, count; + u_char *ptr; + long flags; + + + if ((cs->debug & L1_DEB_HSCX) && !(cs->debug & L1_DEB_HSCX_FIFO)) + debugl1(cs, "W6692B_fill_fifo"); + + if (!bcs->tx_skb) + return; + if (bcs->tx_skb->len <= 0) + return; + + more = (bcs->mode == L1_MODE_TRANS) ? 1 : 0; + if (bcs->tx_skb->len > W_B_FIFO_THRESH) { + more = !0; + count = W_B_FIFO_THRESH; + } else + count = bcs->tx_skb->len; + + save_flags(flags); + cli(); + ptr = bcs->tx_skb->data; + skb_pull(bcs->tx_skb, count); + bcs->tx_cnt -= count; + bcs->hw.w6692.count += count; + WRITEW6692BFIFO(cs, bcs->hw.w6692.bchan, ptr, count); + cs->BC_Write_Reg(cs, bcs->hw.w6692.bchan, W_B_CMDR, W_B_CMDR_RACT | W_B_CMDR_XMS | (more ? 0 : W_B_CMDR_XME)); + restore_flags(flags); + if (cs->debug & L1_DEB_HSCX_FIFO) { + char *t = bcs->blog; + + t += sprintf(t, "W6692B_fill_fifo %c cnt %d", + bcs->hw.w6692.bchan ? 'B' : 'A', count); + QuickHex(t, ptr, count); + debugl1(cs, bcs->blog); + } +} + +static void +W6692B_interrupt(struct IsdnCardState *cs, u_char bchan) +{ + u_char val; + u_char r; + struct BCState *bcs = cs->bcs + bchan; + struct sk_buff *skb; + int count; + + val = cs->BC_Read_Reg(cs, bchan, W_B_EXIR); + debugl1(cs, "W6692B chan %d B_EXIR 0x%02X", bchan, val); + + if (!test_bit(BC_FLG_INIT, &bcs->Flag)) { + debugl1(cs, "W6692B not INIT yet"); + return; + } + if (val & W_B_EXI_RME) { /* RME */ + r = cs->BC_Read_Reg(cs, bchan, W_B_STAR); + if (r & (W_B_STAR_RDOV | W_B_STAR_CRCE | W_B_STAR_RMB | W_B_STAR_XDOW)) { + if ((r & W_B_STAR_RDOV) && bcs->mode) + if (cs->debug & L1_DEB_WARN) + debugl1(cs, "W6692 B RDOV mode=%d", + bcs->mode); + if (r & W_B_STAR_CRCE) + if (cs->debug & L1_DEB_WARN) + debugl1(cs, "W6692 B CRC error"); + cs->BC_Write_Reg(cs, bchan, W_B_CMDR, W_B_CMDR_RACK | W_B_CMDR_RRST | W_B_CMDR_RACT); + } else { + count = cs->BC_Read_Reg(cs, bchan, W_B_RBCL) & (W_B_FIFO_THRESH - 1); + if (count == 0) + count = W_B_FIFO_THRESH; + W6692B_empty_fifo(bcs, count); + if ((count = bcs->hw.w6692.rcvidx) > 0) { + if (cs->debug & L1_DEB_HSCX_FIFO) + debugl1(cs, "W6692 Bchan Frame %d", count); + if (!(skb = dev_alloc_skb(count))) + printk(KERN_WARNING "W6692: Bchan receive out of memory\n"); + else { + ; + memcpy(skb_put(skb, count), bcs->hw.w6692.rcvbuf, count); + skb_queue_tail(&bcs->rqueue, skb); + } + } + } + bcs->hw.w6692.rcvidx = 0; + W6692B_sched_event(bcs, B_RCVBUFREADY); + } + if (val & W_B_EXI_RMR) { /* RMR */ + W6692B_empty_fifo(bcs, W_B_FIFO_THRESH); + if (bcs->mode == L1_MODE_TRANS) { + /* receive audio data */ + if (!(skb = dev_alloc_skb(W_B_FIFO_THRESH))) + printk(KERN_WARNING "HiSax: receive out of memory\n"); + else { + ; + memcpy(skb_put(skb, W_B_FIFO_THRESH), bcs->hw.w6692.rcvbuf, W_B_FIFO_THRESH); + skb_queue_tail(&bcs->rqueue, skb); + } + bcs->hw.w6692.rcvidx = 0; + W6692B_sched_event(bcs, B_RCVBUFREADY); + } + } + if (val & W_B_EXI_XFR) { /* XFR */ + if (bcs->tx_skb) { + if (bcs->tx_skb->len) { + W6692B_fill_fifo(bcs); + return; + } else { + if (bcs->st->lli.l1writewakeup && + (PACKET_NOACK != bcs->tx_skb->pkt_type)) + bcs->st->lli.l1writewakeup(bcs->st, bcs->hw.w6692.count); + dev_kfree_skb(bcs->tx_skb); + bcs->hw.w6692.count = 0; + bcs->tx_skb = NULL; + } + } + if ((bcs->tx_skb = skb_dequeue(&bcs->squeue))) { + bcs->hw.w6692.count = 0; + test_and_set_bit(BC_FLG_BUSY, &bcs->Flag); + W6692B_fill_fifo(bcs); + } else { + test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); + W6692B_sched_event(bcs, B_XMTBUFREADY); + } + } + if (val & W_B_EXI_XDUN) { /* XDUN */ + if (bcs->mode == 1) + W6692B_fill_fifo(bcs); + else { + /* Here we lost an TX interrupt, so + * restart transmitting the whole frame. + */ + if (bcs->tx_skb) { + skb_push(bcs->tx_skb, bcs->hw.w6692.count); + bcs->tx_cnt += bcs->hw.w6692.count; + bcs->hw.w6692.count = 0; + } + cs->BC_Write_Reg(cs, bcs->hw.w6692.bchan, W_B_CMDR, W_B_CMDR_XRST | W_B_CMDR_RACT); + if (cs->debug & L1_DEB_WARN) + debugl1(cs, "W6692 B EXIR %x Lost TX", val); + } + } +} + +static void +W6692_interrupt(int intno, void *dev_id, struct pt_regs *regs) +{ + struct IsdnCardState *cs = dev_id; + u_char val, exval, v1; + struct sk_buff *skb; + unsigned int count; + long flags; + int icnt = 5; + + if (!cs) { + printk(KERN_WARNING "W6692: Spurious interrupt!\n"); + return; + } + val = cs->readW6692(cs, W_ISTA); + + StartW6692: + if (cs->debug & L1_DEB_ISAC) + debugl1(cs, "W6692 ISTA %x", val); + + if (val & W_INT_D_RME) { /* RME */ + exval = cs->readW6692(cs, W_D_RSTA); + if (exval & (W_D_RSTA_RDOV | W_D_RSTA_CRCE | W_D_RSTA_RMB)) { + if (exval & W_D_RSTA_RDOV) + if (cs->debug & L1_DEB_WARN) + debugl1(cs, "W6692 RDOV"); + if (exval & W_D_RSTA_CRCE) + if (cs->debug & L1_DEB_WARN) + debugl1(cs, "W6692 D-channel CRC error"); + if (exval & W_D_RSTA_RMB) + if (cs->debug & L1_DEB_WARN) + debugl1(cs, "W6692 D-channel ABORT"); + cs->writeW6692(cs, W_D_CMDR, W_D_CMDR_RACK | W_D_CMDR_RRST); + } else { + count = cs->readW6692(cs, W_D_RBCL) & (W_D_FIFO_THRESH - 1); + if (count == 0) + count = W_D_FIFO_THRESH; + W6692_empty_fifo(cs, count); + save_flags(flags); + cli(); + if ((count = cs->rcvidx) > 0) { + cs->rcvidx = 0; + if (!(skb = alloc_skb(count, GFP_ATOMIC))) + printk(KERN_WARNING "HiSax: D receive out of memory\n"); + else { + ; + memcpy(skb_put(skb, count), cs->rcvbuf, count); + skb_queue_tail(&cs->rq, skb); + } + } + restore_flags(flags); + } + cs->rcvidx = 0; + W6692_sched_event(cs, D_RCVBUFREADY); + } + if (val & W_INT_D_RMR) { /* RMR */ + W6692_empty_fifo(cs, W_D_FIFO_THRESH); + } + if (val & W_INT_D_XFR) { /* XFR */ + if (test_and_clear_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) + del_timer(&cs->dbusytimer); + if (test_and_clear_bit(FLG_L1_DBUSY, &cs->HW_Flags)) + W6692_sched_event(cs, D_CLEARBUSY); + if (cs->tx_skb) { + if (cs->tx_skb->len) { + W6692_fill_fifo(cs); + goto afterXFR; + } else { + dev_kfree_skb(cs->tx_skb); + cs->tx_cnt = 0; + cs->tx_skb = NULL; + } + } + if ((cs->tx_skb = skb_dequeue(&cs->sq))) { + cs->tx_cnt = 0; + W6692_fill_fifo(cs); + } else + W6692_sched_event(cs, D_XMTBUFREADY); + } + afterXFR: + if (val & (W_INT_XINT0 | W_INT_XINT1)) { /* XINT0/1 - never */ + if (cs->debug & L1_DEB_ISAC) + debugl1(cs, "W6692 spurious XINT!"); + } + if (val & W_INT_D_EXI) { /* EXI */ + exval = cs->readW6692(cs, W_D_EXIR); + if (cs->debug & L1_DEB_WARN) + debugl1(cs, "W6692 D_EXIR %02x", exval); + if (exval & (W_D_EXI_XDUN | W_D_EXI_XCOL)) { /* Transmit underrun/collision */ + debugl1(cs, "W6692 D-chan underrun/collision"); + printk(KERN_WARNING "HiSax: W6692 XDUN/XCOL\n"); + if (test_and_clear_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) + del_timer(&cs->dbusytimer); + if (test_and_clear_bit(FLG_L1_DBUSY, &cs->HW_Flags)) + W6692_sched_event(cs, D_CLEARBUSY); + if (cs->tx_skb) { /* Restart frame */ + skb_push(cs->tx_skb, cs->tx_cnt); + cs->tx_cnt = 0; + W6692_fill_fifo(cs); + } else { + printk(KERN_WARNING "HiSax: W6692 XDUN/XCOL no skb\n"); + debugl1(cs, "W6692 XDUN/XCOL no skb"); + cs->writeW6692(cs, W_D_CMDR, W_D_CMDR_XRST); + } + } + if (exval & W_D_EXI_RDOV) { /* RDOV */ + debugl1(cs, "W6692 D-channel RDOV"); + printk(KERN_WARNING "HiSax: W6692 D-RDOV\n"); + cs->writeW6692(cs, W_D_CMDR, W_D_CMDR_RRST); + } + if (exval & W_D_EXI_TIN2) { /* TIN2 - never */ + debugl1(cs, "W6692 spurious TIN2 interrupt"); + } + if (exval & W_D_EXI_MOC) { /* MOC - not supported */ + debugl1(cs, "W6692 spurious MOC interrupt"); + v1 = cs->readW6692(cs, W_MOSR); + debugl1(cs, "W6692 MOSR %02x", v1); + } + if (exval & W_D_EXI_ISC) { /* ISC - Level1 change */ + v1 = cs->readW6692(cs, W_CIR); + if (cs->debug & L1_DEB_ISAC) + debugl1(cs, "W6692 ISC CIR=0x%02X", v1); + if (v1 & W_CIR_ICC) { + cs->dc.w6692.ph_state = v1 & W_CIR_COD_MASK; + if (cs->debug & L1_DEB_ISAC) + debugl1(cs, "ph_state_change %x", cs->dc.w6692.ph_state); + W6692_sched_event(cs, D_L1STATECHANGE); + } + if (v1 & W_CIR_SCC) { + v1 = cs->readW6692(cs, W_SQR); + debugl1(cs, "W6692 SCC SQR=0x%02X", v1); + } + } + if (exval & W_D_EXI_WEXP) { + debugl1(cs, "W6692 spurious WEXP interrupt!"); + } + if (exval & W_D_EXI_TEXP) { + debugl1(cs, "W6692 spurious TEXP interrupt!"); + } + } + if (val & W_INT_B1_EXI) { + debugl1(cs, "W6692 B channel 1 interrupt"); + W6692B_interrupt(cs, 0); + } + if (val & W_INT_B2_EXI) { + debugl1(cs, "W6692 B channel 2 interrupt"); + W6692B_interrupt(cs, 1); + } + val = cs->readW6692(cs, W_ISTA); + if (val && icnt) { + icnt--; + goto StartW6692; + } + if (!icnt) { + printk(KERN_WARNING "W6692 IRQ LOOP\n"); + cs->writeW6692(cs, W_IMASK, 0xff); + } +} + +static void +W6692_l1hw(struct PStack *st, int pr, void *arg) +{ + struct IsdnCardState *cs = (struct IsdnCardState *) st->l1.hardware; + struct sk_buff *skb = arg; + int val; + + switch (pr) { + case (PH_DATA | REQUEST): + if (cs->debug & DEB_DLOG_HEX) + LogFrame(cs, skb->data, skb->len); + if (cs->debug & DEB_DLOG_VERBOSE) + dlogframe(cs, skb, 0); + if (cs->tx_skb) { + skb_queue_tail(&cs->sq, skb); +#ifdef L2FRAME_DEBUG /* psa */ + if (cs->debug & L1_DEB_LAPD) + Logl2Frame(cs, skb, "PH_DATA Queued", 0); +#endif + } else { + cs->tx_skb = skb; + cs->tx_cnt = 0; +#ifdef L2FRAME_DEBUG /* psa */ + if (cs->debug & L1_DEB_LAPD) + Logl2Frame(cs, skb, "PH_DATA", 0); +#endif + W6692_fill_fifo(cs); + } + break; + case (PH_PULL | INDICATION): + if (cs->tx_skb) { + if (cs->debug & L1_DEB_WARN) + debugl1(cs, " l2l1 tx_skb exist this shouldn't happen"); + skb_queue_tail(&cs->sq, skb); + break; + } + if (cs->debug & DEB_DLOG_HEX) + LogFrame(cs, skb->data, skb->len); + if (cs->debug & DEB_DLOG_VERBOSE) + dlogframe(cs, skb, 0); + cs->tx_skb = skb; + cs->tx_cnt = 0; +#ifdef L2FRAME_DEBUG /* psa */ + if (cs->debug & L1_DEB_LAPD) + Logl2Frame(cs, skb, "PH_DATA_PULLED", 0); +#endif + W6692_fill_fifo(cs); + break; + case (PH_PULL | REQUEST): +#ifdef L2FRAME_DEBUG /* psa */ + if (cs->debug & L1_DEB_LAPD) + debugl1(cs, "-> PH_REQUEST_PULL"); +#endif + if (!cs->tx_skb) { + test_and_clear_bit(FLG_L1_PULL_REQ, &st->l1.Flags); + st->l1.l1l2(st, PH_PULL | CONFIRM, NULL); + } else + test_and_set_bit(FLG_L1_PULL_REQ, &st->l1.Flags); + break; + case (HW_RESET | REQUEST): + if ((cs->dc.w6692.ph_state == W_L1IND_DRD)) + ph_command(cs, W_L1CMD_ECK); + else { + ph_command(cs, W_L1CMD_RST); + cs->dc.w6692.ph_state = W_L1CMD_RST; + W6692_new_ph(cs); + } + break; + case (HW_ENABLE | REQUEST): + ph_command(cs, W_L1CMD_ECK); + break; + case (HW_INFO3 | REQUEST): + ph_command(cs, W_L1CMD_AR8); + break; + case (HW_TESTLOOP | REQUEST): + val = 0; + if (1 & (long) arg) + val |= 0x0c; + if (2 & (long) arg) + val |= 0x3; + /* !!! not implemented yet */ + break; + case (HW_DEACTIVATE | RESPONSE): + discard_queue(&cs->rq); + discard_queue(&cs->sq); + if (cs->tx_skb) { + dev_kfree_skb(cs->tx_skb); + cs->tx_skb = NULL; + } + if (test_and_clear_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) + del_timer(&cs->dbusytimer); + if (test_and_clear_bit(FLG_L1_DBUSY, &cs->HW_Flags)) + W6692_sched_event(cs, D_CLEARBUSY); + break; + default: + if (cs->debug & L1_DEB_WARN) + debugl1(cs, "W6692_l1hw unknown %04x", pr); + break; + } +} + +static void +setstack_W6692(struct PStack *st, struct IsdnCardState *cs) +{ + st->l1.l1hw = W6692_l1hw; +} + +static void +DC_Close_W6692(struct IsdnCardState *cs) +{ +} + +static void +dbusy_timer_handler(struct IsdnCardState *cs) +{ + struct PStack *stptr; + int rbch, star; + + if (test_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) { + rbch = cs->readW6692(cs, W_D_RBCH); + star = cs->readW6692(cs, W_D_STAR); + if (cs->debug) + debugl1(cs, "D-Channel Busy D_RBCH %02x D_STAR %02x", + rbch, star); + if (star & W_D_STAR_XBZ) { /* D-Channel Busy */ + test_and_set_bit(FLG_L1_DBUSY, &cs->HW_Flags); + stptr = cs->stlist; + while (stptr != NULL) { + stptr->l1.l1l2(stptr, PH_PAUSE | INDICATION, NULL); + stptr = stptr->next; + } + } else { + /* discard frame; reset transceiver */ + test_and_clear_bit(FLG_DBUSY_TIMER, &cs->HW_Flags); + if (cs->tx_skb) { + dev_kfree_skb(cs->tx_skb); + cs->tx_cnt = 0; + cs->tx_skb = NULL; + } else { + printk(KERN_WARNING "HiSax: W6692 D-Channel Busy no skb\n"); + debugl1(cs, "D-Channel Busy no skb"); + } + cs->writeW6692(cs, W_D_CMDR, W_D_CMDR_XRST); /* Transmitter reset */ + cs->irq_func(cs->irq, cs, NULL); + } + } +} + +static void +W6692Bmode(struct BCState *bcs, int mode, int bc) +{ + struct IsdnCardState *cs = bcs->cs; + int bchan = bcs->hw.w6692.bchan; + + if (cs->debug & L1_DEB_HSCX) + debugl1(cs, "w6692 %c mode %d ichan %d", + '1' + bchan, mode, bc); + bcs->mode = mode; + bcs->channel = bc; + + switch (mode) { + case (L1_MODE_NULL): + cs->BC_Write_Reg(cs, bchan, W_B_MODE, 0); + break; + case (L1_MODE_TRANS): + cs->BC_Write_Reg(cs, bchan, W_B_MODE, W_B_MODE_MMS); + break; + case (L1_MODE_HDLC): + cs->BC_Write_Reg(cs, bchan, W_B_MODE, W_B_MODE_ITF); + cs->BC_Write_Reg(cs, bchan, W_B_ADM1, 0xff); + cs->BC_Write_Reg(cs, bchan, W_B_ADM2, 0xff); + break; + } + if (mode) + cs->BC_Write_Reg(cs, bchan, W_B_CMDR, W_B_CMDR_RRST | + W_B_CMDR_RACT | W_B_CMDR_XRST); + cs->BC_Write_Reg(cs, bchan, W_B_EXIM, 0x00); +} + +static void +W6692_l2l1(struct PStack *st, int pr, void *arg) +{ + struct sk_buff *skb = arg; + long flags; + + switch (pr) { + case (PH_DATA | REQUEST): + save_flags(flags); + cli(); + if (st->l1.bcs->tx_skb) { + skb_queue_tail(&st->l1.bcs->squeue, skb); + restore_flags(flags); + } else { + st->l1.bcs->tx_skb = skb; + test_and_set_bit(BC_FLG_BUSY, &st->l1.bcs->Flag); + st->l1.bcs->hw.w6692.count = 0; + restore_flags(flags); + st->l1.bcs->cs->BC_Send_Data(st->l1.bcs); + } + break; + case (PH_PULL | INDICATION): + if (st->l1.bcs->tx_skb) { + printk(KERN_WARNING "W6692_l2l1: this shouldn't happen\n"); + break; + } + test_and_set_bit(BC_FLG_BUSY, &st->l1.bcs->Flag); + st->l1.bcs->tx_skb = skb; + st->l1.bcs->hw.w6692.count = 0; + st->l1.bcs->cs->BC_Send_Data(st->l1.bcs); + break; + case (PH_PULL | REQUEST): + if (!st->l1.bcs->tx_skb) { + test_and_clear_bit(FLG_L1_PULL_REQ, &st->l1.Flags); + st->l1.l1l2(st, PH_PULL | CONFIRM, NULL); + } else + test_and_set_bit(FLG_L1_PULL_REQ, &st->l1.Flags); + break; + case (PH_ACTIVATE | REQUEST): + test_and_set_bit(BC_FLG_ACTIV, &st->l1.bcs->Flag); + W6692Bmode(st->l1.bcs, st->l1.mode, st->l1.bc); + l1_msg_b(st, pr, arg); + break; + case (PH_DEACTIVATE | REQUEST): + l1_msg_b(st, pr, arg); + break; + case (PH_DEACTIVATE | CONFIRM): + test_and_clear_bit(BC_FLG_ACTIV, &st->l1.bcs->Flag); + test_and_clear_bit(BC_FLG_BUSY, &st->l1.bcs->Flag); + W6692Bmode(st->l1.bcs, 0, st->l1.bc); + st->l1.l1l2(st, PH_DEACTIVATE | CONFIRM, NULL); + break; + } +} + +static void +close_w6692state(struct BCState *bcs) +{ + W6692Bmode(bcs, 0, bcs->channel); + if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) { + if (bcs->hw.w6692.rcvbuf) { + kfree(bcs->hw.w6692.rcvbuf); + bcs->hw.w6692.rcvbuf = NULL; + } + if (bcs->blog) { + kfree(bcs->blog); + bcs->blog = NULL; + } + discard_queue(&bcs->rqueue); + discard_queue(&bcs->squeue); + if (bcs->tx_skb) { + dev_kfree_skb(bcs->tx_skb); + bcs->tx_skb = NULL; + test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); + } + } +} + +static int +open_w6692state(struct IsdnCardState *cs, struct BCState *bcs) +{ + if (!test_and_set_bit(BC_FLG_INIT, &bcs->Flag)) { + if (!(bcs->hw.w6692.rcvbuf = kmalloc(HSCX_BUFMAX, GFP_ATOMIC))) { + printk(KERN_WARNING + "HiSax: No memory for w6692.rcvbuf\n"); + test_and_clear_bit(BC_FLG_INIT, &bcs->Flag); + return (1); + } + if (!(bcs->blog = kmalloc(MAX_BLOG_SPACE, GFP_ATOMIC))) { + printk(KERN_WARNING + "HiSax: No memory for bcs->blog\n"); + test_and_clear_bit(BC_FLG_INIT, &bcs->Flag); + kfree(bcs->hw.w6692.rcvbuf); + bcs->hw.w6692.rcvbuf = NULL; + return (2); + } + skb_queue_head_init(&bcs->rqueue); + skb_queue_head_init(&bcs->squeue); + } + bcs->tx_skb = NULL; + test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); + bcs->event = 0; + bcs->hw.w6692.rcvidx = 0; + bcs->tx_cnt = 0; + return (0); +} + +static int +setstack_w6692(struct PStack *st, struct BCState *bcs) +{ + bcs->channel = st->l1.bc; + if (open_w6692state(st->l1.hardware, bcs)) + return (-1); + st->l1.bcs = bcs; + st->l2.l2l1 = W6692_l2l1; + setstack_manager(st); + bcs->st = st; + setstack_l1_B(st); + return (0); +} + +HISAX_INITFUNC(void initW6692(struct IsdnCardState *cs, int part)) +{ + if (part & 1) { + cs->tqueue.routine = (void *) (void *) W6692_bh; + cs->setstack_d = setstack_W6692; + cs->DC_Close = DC_Close_W6692; + cs->dbusytimer.function = (void *) dbusy_timer_handler; + cs->dbusytimer.data = (long) cs; + init_timer(&cs->dbusytimer); + + cs->writeW6692(cs, W_D_CTL, W_D_CTL_SRST); + cs->writeW6692(cs, W_D_CTL, 0x00); + cs->writeW6692(cs, W_IMASK, 0xff); + cs->writeW6692(cs, W_D_SAM, 0xff); + cs->writeW6692(cs, W_D_TAM, 0xff); + cs->writeW6692(cs, W_D_EXIM, 0x00); + cs->writeW6692(cs, W_D_MODE, W_D_MODE_RACT); + cs->writeW6692(cs, W_IMASK, 0x18); + ph_command(cs, W_L1CMD_RST); + cs->dc.w6692.ph_state = W_L1CMD_RST; + W6692_new_ph(cs); + ph_command(cs, W_L1CMD_ECK); + + cs->bcs[0].BC_SetStack = setstack_w6692; + cs->bcs[1].BC_SetStack = setstack_w6692; + cs->bcs[0].BC_Close = close_w6692state; + cs->bcs[1].BC_Close = close_w6692state; + cs->bcs[0].hw.w6692.bchan = 0; + cs->bcs[1].hw.w6692.bchan = 1; + W6692Bmode(cs->bcs, 0, 0); + W6692Bmode(cs->bcs + 1, 0, 0); + } + if (part & 2) { + /* Reenable all IRQ */ + cs->writeW6692(cs, W_IMASK, 0x18); + cs->writeW6692(cs, W_D_EXIM, 0x00); + cs->BC_Write_Reg(cs, 0, W_B_EXIM, 0x00); + cs->BC_Write_Reg(cs, 1, W_B_EXIM, 0x00); + /* Reset D-chan receiver and transmitter */ + cs->writeW6692(cs, W_D_CMDR, W_D_CMDR_RRST | W_D_CMDR_XRST); + } +} + +/* Interface functions */ + +static u_char +ReadW6692(struct IsdnCardState *cs, u_char offset) +{ + return (inb(cs->hw.w6692.iobase + offset)); +} + +static void +WriteW6692(struct IsdnCardState *cs, u_char offset, u_char value) +{ + outb(value, cs->hw.w6692.iobase + offset); +} + +static void +ReadISACfifo(struct IsdnCardState *cs, u_char * data, int size) +{ + insb(cs->hw.w6692.iobase + W_D_RFIFO, data, size); +} + +static void +WriteISACfifo(struct IsdnCardState *cs, u_char * data, int size) +{ + outsb(cs->hw.w6692.iobase + W_D_XFIFO, data, size); +} + +static u_char +ReadW6692B(struct IsdnCardState *cs, int bchan, u_char offset) +{ + return (inb(cs->hw.w6692.iobase + (bchan ? 0x40 : 0) + offset)); +} + +static void +WriteW6692B(struct IsdnCardState *cs, int bchan, u_char offset, u_char value) +{ + outb(value, cs->hw.w6692.iobase + (bchan ? 0x40 : 0) + offset); +} + +static int +w6692_card_msg(struct IsdnCardState *cs, int mt, void *arg) +{ + switch (mt) { + case CARD_RESET: + return (0); + case CARD_RELEASE: + release_region(cs->hw.w6692.iobase, 256); + return (0); + case CARD_INIT: + initW6692(cs, 3); + return (0); + case CARD_TEST: + return (0); + } + return (0); +} + +static int id_idx = 0; + +static struct pci_dev *dev_w6692 __initdata = NULL; + +__initfunc(int setup_w6692(struct IsdnCard *card)) +{ + struct IsdnCardState *cs = card->cs; + char tmp[64]; + u_char found = 0; + u_char pci_irq = 0; + u_int pci_ioaddr = 0; + + strcpy(tmp, w6692_revision); + printk(KERN_INFO "HiSax: W6692 driver Rev. %s\n", HiSax_getrev(tmp)); + if (cs->typ != ISDN_CTYPE_W6692) + return (0); +#if CONFIG_PCI + if (!pci_present()) { + printk(KERN_ERR "W6692: no PCI bus present\n"); + return (0); + } + while (id_list[id_idx].vendor_id) { + dev_w6692 = pci_find_device(id_list[id_idx].vendor_id, + id_list[id_idx].device_id, + dev_w6692); + if (dev_w6692) + break; + id_idx++; + } + if (dev_w6692) { + found = 1; + pci_irq = dev_w6692->irq; + /* I think address 0 is allways the configuration area */ + /* and address 1 is the real IO space KKe 03.09.99 */ + pci_ioaddr = dev_w6692->base_address[ 1]; + } + if (!found) { + printk(KERN_WARNING "W6692: No PCI card found\n"); + return (0); + } + cs->irq = pci_irq; + if (!cs->irq) { + printk(KERN_WARNING "W6692: No IRQ for PCI card found\n"); + return (0); + } + pci_ioaddr &= PCI_BASE_ADDRESS_IO_MASK; + if (!pci_ioaddr) { + printk(KERN_WARNING "W6692: NO I/O Base Address found\n"); + return (0); + } + cs->hw.w6692.iobase = pci_ioaddr; + printk(KERN_INFO "Found: %s %s, I/O base: 0x%x, irq: %d\n", + id_list[id_idx].vendor_name, id_list[id_idx].card_name, + pci_ioaddr, dev_w6692->irq); + if (check_region((cs->hw.w6692.iobase), 256)) { + printk(KERN_WARNING + "HiSax: %s I/O ports %x-%x already in use\n", + id_list[id_idx].card_name, + cs->hw.w6692.iobase, + cs->hw.w6692.iobase + 255); + return (0); + } else { + request_region(cs->hw.w6692.iobase, 256, + id_list[id_idx].card_name); + } +#else + printk(KERN_WARNING "HiSax: W6692 and NO_PCI_BIOS\n"); + printk(KERN_WARNING "HiSax: W6692 unable to config\n"); + return (0); +#endif /* CONFIG_PCI */ + + printk(KERN_INFO + "HiSax: %s config irq:%d I/O:%x\n", + id_list[id_idx].card_name, cs->irq, + cs->hw.w6692.iobase); + + cs->readW6692 = &ReadW6692; + cs->writeW6692 = &WriteW6692; + cs->readisacfifo = &ReadISACfifo; + cs->writeisacfifo = &WriteISACfifo; + cs->BC_Read_Reg = &ReadW6692B; + cs->BC_Write_Reg = &WriteW6692B; + cs->BC_Send_Data = &W6692B_fill_fifo; + cs->cardmsg = &w6692_card_msg; + cs->irq_func = &W6692_interrupt; + W6692Version(cs, "W6692:"); + printk(KERN_INFO "W6692 ISTA=0x%X\n", ReadW6692(cs, W_ISTA)); + printk(KERN_INFO "W6692 IMASK=0x%X\n", ReadW6692(cs, W_IMASK)); + printk(KERN_INFO "W6692 D_EXIR=0x%X\n", ReadW6692(cs, W_D_EXIR)); + printk(KERN_INFO "W6692 D_EXIM=0x%X\n", ReadW6692(cs, W_D_EXIM)); + printk(KERN_INFO "W6692 D_RSTA=0x%X\n", ReadW6692(cs, W_D_RSTA)); + return (1); +} diff --git a/drivers/isdn/hisax/w6692.h b/drivers/isdn/hisax/w6692.h new file mode 100644 index 000000000000..4990b008263a --- /dev/null +++ b/drivers/isdn/hisax/w6692.h @@ -0,0 +1,190 @@ +/* $Id: w6692.h,v 1.1 1999/09/04 06:28:58 keil Exp $ + + * w6692.h Winbond W6692 specific defines + * + * Author Petr Novak + * + * + * $Log: w6692.h,v $ + * Revision 1.1 1999/09/04 06:28:58 keil + * first revision + * + * + * Revision 1.0 1999/08/28 21:58:00 pnovak + * first version + * + * + */ + +/* map W6692 functions to ISAC functions */ +#define readW6692 readisac +#define writeW6692 writeisac +#define readW6692fifo readisacfifo +#define writeW6692fifo writeisacfifo + +/* B-channel FIFO read/write routines */ + +#define READW6692BFIFO(cs,bchan,ptr,count) \ + insb(cs->hw.w6692.iobase+W_B_RFIFO+(bchan?0x40:0),ptr,count) + +#define WRITEW6692BFIFO(cs,bchan,ptr,count) \ + outsb(cs->hw.w6692.iobase+W_B_XFIFO+(bchan?0x40:0),ptr,count) + +/* Specifications of W6692 registers */ + +#define W_D_RFIFO 0x00 /* R */ +#define W_D_XFIFO 0x04 /* W */ +#define W_D_CMDR 0x08 /* W */ +#define W_D_MODE 0x0c /* R/W */ +#define W_D_TIMR 0x10 /* R/W */ +#define W_ISTA 0x14 /* R_clr */ +#define W_IMASK 0x18 /* R/W */ +#define W_D_EXIR 0x1c /* R_clr */ +#define W_D_EXIM 0x20 /* R/W */ +#define W_D_STAR 0x24 /* R */ +#define W_D_RSTA 0x28 /* R */ +#define W_D_SAM 0x2c /* R/W */ +#define W_D_SAP1 0x30 /* R/W */ +#define W_D_SAP2 0x34 /* R/W */ +#define W_D_TAM 0x38 /* R/W */ +#define W_D_TEI1 0x3c /* R/W */ +#define W_D_TEI2 0x40 /* R/W */ +#define W_D_RBCH 0x44 /* R */ +#define W_D_RBCL 0x48 /* R */ +#define W_TIMR2 0x4c /* W */ +#define W_L1_RC 0x50 /* R/W */ +#define W_D_CTL 0x54 /* R/W */ +#define W_CIR 0x58 /* R */ +#define W_CIX 0x5c /* W */ +#define W_SQR 0x60 /* R */ +#define W_SQX 0x64 /* W */ +#define W_PCTL 0x68 /* R/W */ +#define W_MOR 0x6c /* R */ +#define W_MOX 0x70 /* R/W */ +#define W_MOSR 0x74 /* R_clr */ +#define W_MOCR 0x78 /* R/W */ +#define W_GCR 0x7c /* R/W */ + +#define W_B_RFIFO 0x80 /* R */ +#define W_B_XFIFO 0x84 /* W */ +#define W_B_CMDR 0x88 /* W */ +#define W_B_MODE 0x8c /* R/W */ +#define W_B_EXIR 0x90 /* R_clr */ +#define W_B_EXIM 0x94 /* R/W */ +#define W_B_STAR 0x98 /* R */ +#define W_B_ADM1 0x9c /* R/W */ +#define W_B_ADM2 0xa0 /* R/W */ +#define W_B_ADR1 0xa4 /* R/W */ +#define W_B_ADR2 0xa8 /* R/W */ +#define W_B_RBCL 0xac /* R */ +#define W_B_RBCH 0xb0 /* R */ + +#define W_XADDR 0xf4 /* R/W */ +#define W_XDATA 0xf8 /* R/W */ +#define W_EPCTL 0xfc /* W */ + +/* W6692 register bits */ + +#define W_D_CMDR_XRST 0x01 +#define W_D_CMDR_XME 0x02 +#define W_D_CMDR_XMS 0x08 +#define W_D_CMDR_STT 0x10 +#define W_D_CMDR_RRST 0x40 +#define W_D_CMDR_RACK 0x80 + +#define W_D_MODE_RLP 0x01 +#define W_D_MODE_DLP 0x02 +#define W_D_MODE_MFD 0x04 +#define W_D_MODE_TEE 0x08 +#define W_D_MODE_TMS 0x10 +#define W_D_MODE_RACT 0x40 +#define W_D_MODE_MMS 0x80 + +#define W_INT_B2_EXI 0x01 +#define W_INT_B1_EXI 0x02 +#define W_INT_D_EXI 0x04 +#define W_INT_XINT0 0x08 +#define W_INT_XINT1 0x10 +#define W_INT_D_XFR 0x20 +#define W_INT_D_RME 0x40 +#define W_INT_D_RMR 0x80 + +#define W_D_EXI_WEXP 0x01 +#define W_D_EXI_TEXP 0x02 +#define W_D_EXI_ISC 0x04 +#define W_D_EXI_MOC 0x08 +#define W_D_EXI_TIN2 0x10 +#define W_D_EXI_XCOL 0x20 +#define W_D_EXI_XDUN 0x40 +#define W_D_EXI_RDOV 0x80 + +#define W_D_STAR_DRDY 0x10 +#define W_D_STAR_XBZ 0x20 +#define W_D_STAR_XDOW 0x80 + +#define W_D_RSTA_RMB 0x10 +#define W_D_RSTA_CRCE 0x20 +#define W_D_RSTA_RDOV 0x40 + +#define W_D_CTL_SRST 0x20 + +#define W_CIR_SCC 0x80 +#define W_CIR_ICC 0x40 +#define W_CIR_COD_MASK 0x0f + +#define W_B_CMDR_XRST 0x01 +#define W_B_CMDR_XME 0x02 +#define W_B_CMDR_XMS 0x04 +#define W_B_CMDR_RACT 0x20 +#define W_B_CMDR_RRST 0x40 +#define W_B_CMDR_RACK 0x80 + +#define W_B_MODE_FTS0 0x01 +#define W_B_MODE_FTS1 0x02 +#define W_B_MODE_SW56 0x04 +#define W_B_MODE_BSW0 0x08 +#define W_B_MODE_BSW1 0x10 +#define W_B_MODE_EPCM 0x20 +#define W_B_MODE_ITF 0x40 +#define W_B_MODE_MMS 0x80 + +#define W_B_EXI_XDUN 0x01 +#define W_B_EXI_XFR 0x02 +#define W_B_EXI_RDOV 0x10 +#define W_B_EXI_RME 0x20 +#define W_B_EXI_RMR 0x40 + +#define W_B_STAR_XBZ 0x01 +#define W_B_STAR_XDOW 0x04 +#define W_B_STAR_RMB 0x10 +#define W_B_STAR_CRCE 0x20 +#define W_B_STAR_RDOV 0x40 + +#define W_B_RBCH_LOV 0x20 + +/* W6692 Layer1 commands */ + +#define W_L1CMD_ECK 0x00 +#define W_L1CMD_RST 0x01 +#define W_L1CMD_SCP 0x04 +#define W_L1CMD_SSP 0x02 +#define W_L1CMD_AR8 0x08 +#define W_L1CMD_AR10 0x09 +#define W_L1CMD_EAL 0x0a +#define W_L1CMD_DRC 0x0f + +/* W6692 Layer1 indications */ + +#define W_L1IND_CE 0x07 +#define W_L1IND_DRD 0x00 +#define W_L1IND_LD 0x04 +#define W_L1IND_ARD 0x08 +#define W_L1IND_TI 0x0a +#define W_L1IND_ATI 0x0b +#define W_L1IND_AI8 0x0c +#define W_L1IND_AI10 0x0d +#define W_L1IND_CD 0x0f + +/* FIFO thresholds */ +#define W_D_FIFO_THRESH 64 +#define W_B_FIFO_THRESH 64 diff --git a/drivers/isdn/icn/icn.c b/drivers/isdn/icn/icn.c index 0768ec0fce56..819797b2d585 100644 --- a/drivers/isdn/icn/icn.c +++ b/drivers/isdn/icn/icn.c @@ -1,8 +1,8 @@ -/* $Id: icn.c,v 1.57 1999/07/06 16:15:30 detabc Exp $ +/* $Id: icn.c,v 1.62 1999/09/06 07:29:35 fritz Exp $ * ISDN low-level module for the ICN active ISDN-Card. * - * Copyright 1994,95,96 by Fritz Elfert (fritz@wuemaus.franken.de) + * Copyright 1994,95,96 by Fritz Elfert (fritz@isdn4linux.de) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,6 +19,21 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: icn.c,v $ + * Revision 1.62 1999/09/06 07:29:35 fritz + * Changed my mail-address. + * + * Revision 1.61 1999/09/03 14:06:58 fritz + * Fixed a memory leak. + * + * Revision 1.60 1999/08/31 11:20:32 paul + * various spelling corrections (new checksums may be needed, Karsten!) + * + * Revision 1.59 1999/08/28 22:10:55 keil + * __setup function should be static + * + * Revision 1.58 1999/08/25 16:44:17 keil + * Support for new __setup function + * * Revision 1.57 1999/07/06 16:15:30 detabc * remove unused messages * @@ -232,7 +247,7 @@ #undef MAP_DEBUG static char -*revision = "$Revision: 1.57 $"; +*revision = "$Revision: 1.62 $"; static int icn_addcard(int, char *, char *); @@ -461,7 +476,7 @@ icn_pollbchan_receive(int channel, icn_card * card) if (!eflag) { if ((cnt = card->rcvidx[channel])) { if (!(skb = dev_alloc_skb(cnt))) { - printk(KERN_WARNING "ïcn: receive out of memory\n"); + printk(KERN_WARNING "icn: receive out of memory\n"); break; } memcpy(skb_put(skb, cnt), card->rcvbuf[channel], cnt); @@ -539,12 +554,10 @@ icn_pollbchan_send(int channel, icn_card * card) if (!skb->len) { save_flags(flags); cli(); - if (card->xskb[channel]) { + if (card->xskb[channel]) card->xskb[channel] = NULL; - restore_flags(flags); - dev_kfree_skb(skb); - } else - restore_flags(flags); + restore_flags(flags); + dev_kfree_skb(skb); if (card->xlen[channel]) { cmd.command = ISDN_STAT_BSENT; cmd.driver = card->myid; @@ -1852,7 +1865,6 @@ icn_setup(char *str, int *ints) char *p; static char sid[20]; static char sid2[20]; - if (ints[0]) portbase = ints[1]; if (ints[0] > 1) @@ -1867,7 +1879,7 @@ icn_setup(char *str, int *ints) } } } -#endif +#endif /* MODULES */ int icn_init(void) diff --git a/drivers/isdn/icn/icn.h b/drivers/isdn/icn/icn.h index 3bd2819cedb8..6d40a695c434 100644 --- a/drivers/isdn/icn/icn.h +++ b/drivers/isdn/icn/icn.h @@ -1,8 +1,8 @@ -/* $Id: icn.h,v 1.28 1997/10/10 15:56:18 fritz Exp $ +/* $Id: icn.h,v 1.29 1999/09/06 07:29:35 fritz Exp $ * ISDN lowlevel-module for the ICN active ISDN-Card. * - * Copyright 1994 by Fritz Elfert (fritz@wuemaus.franken.de) + * Copyright 1994 by Fritz Elfert (fritz@isdn4linux.de) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,6 +19,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: icn.h,v $ + * Revision 1.29 1999/09/06 07:29:35 fritz + * Changed my mail-address. + * * Revision 1.28 1997/10/10 15:56:18 fritz * New HL<->LL interface: * New BSENT callback with nr. of bytes included. diff --git a/drivers/isdn/isdn_audio.c b/drivers/isdn/isdn_audio.c index a6f13ef76432..3599d2ada109 100644 --- a/drivers/isdn/isdn_audio.c +++ b/drivers/isdn/isdn_audio.c @@ -1,4 +1,4 @@ -/* $Id: isdn_audio.c,v 1.16 1999/08/06 12:47:35 calle Exp $ +/* $Id: isdn_audio.c,v 1.17 1999/08/17 11:10:52 paul Exp $ * Linux ISDN subsystem, audio conversion and compression (linklevel). * @@ -21,6 +21,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: isdn_audio.c,v $ + * Revision 1.17 1999/08/17 11:10:52 paul + * don't try to use x86 assembler on non-x86! + * * Revision 1.16 1999/08/06 12:47:35 calle * Using __GNUC__ == 2 && __GNUC_MINOR__ < 95 how to define * ISDN_AUDIO_OPTIMIZE_ON_X386_WITH_ASM_IF_GCC_ALLOW_IT @@ -92,7 +95,7 @@ #include "isdn_audio.h" #include "isdn_common.h" -char *isdn_audio_revision = "$Revision: 1.16 $"; +char *isdn_audio_revision = "$Revision: 1.17 $"; /* * Misc. lookup-tables. @@ -294,7 +297,7 @@ static char dtmf_matrix[4][4] = * egcs 2.95 complain about invalid asm statement: * "fixed or forbidden register 2 (cx) was spilled for class CREG." */ -#if ((CPU == 386) || (CPU == 486) || (CPU == 586)) || defined(__GNUC__) +#if ((CPU == 386) || (CPU == 486) || (CPU == 586)) && defined(__GNUC__) #if __GNUC__ == 2 && __GNUC_MINOR__ < 95 #define ISDN_AUDIO_OPTIMIZE_ON_X386_WITH_ASM_IF_GCC_ALLOW_IT #endif diff --git a/drivers/isdn/isdn_bsdcomp.c b/drivers/isdn/isdn_bsdcomp.c index 92012c8e5c7b..e5cc0ea30be5 100644 --- a/drivers/isdn/isdn_bsdcomp.c +++ b/drivers/isdn/isdn_bsdcomp.c @@ -64,7 +64,6 @@ #include #include #include -#include /* to get the struct task_struct */ #include /* used in new tty drivers */ #include /* used in new tty drivers */ diff --git a/drivers/isdn/isdn_common.c b/drivers/isdn/isdn_common.c index cac4be6dcda5..f72de9a3085a 100644 --- a/drivers/isdn/isdn_common.c +++ b/drivers/isdn/isdn_common.c @@ -1,4 +1,4 @@ -/* $Id: isdn_common.c,v 1.86 1999/07/31 12:59:42 armin Exp $ +/* $Id: isdn_common.c,v 1.87 1999/09/12 16:19:39 detabc Exp $ * Linux ISDN subsystem, common used functions (linklevel). * @@ -21,6 +21,15 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: isdn_common.c,v $ + * Revision 1.87 1999/09/12 16:19:39 detabc + * added abc features + * low cost routing for net-interfaces (only the HL side). + * need more implementation in the isdnlog-utility + * udp info support (first part). + * different EAZ on outgoing call's. + * more checks on D-Channel callbacks (double use of channels). + * tested and running with kernel 2.3.17 + * * Revision 1.86 1999/07/31 12:59:42 armin * Added tty fax capabilities. * @@ -381,7 +390,7 @@ isdn_dev *dev = (isdn_dev *) 0; -static char *isdn_revision = "$Revision: 1.86 $"; +static char *isdn_revision = "$Revision: 1.87 $"; extern char *isdn_net_revision; extern char *isdn_tty_revision; @@ -1039,9 +1048,7 @@ isdn_status_callback(isdn_ctrl * c) isdn_free_queue(&dev->drv[di]->rpqueue[i]); kfree(dev->drv[di]->rpqueue); kfree(dev->drv[di]->rcv_waitq); -#ifndef COMPAT_HAS_NEW_WAITQ kfree(dev->drv[di]->snd_waitq); -#endif kfree(dev->drv[di]); dev->drv[di] = NULL; dev->drvid[di][0] = '\0'; @@ -1103,11 +1110,7 @@ isdn_getnum(char **p) * of the mapping (di,ch)<->minor, happen during the sleep? --he */ int -#ifdef COMPAT_HAS_NEW_WAITQ -isdn_readbchan(int di, int channel, u_char * buf, u_char * fp, int len, wait_queue_head_t *sleep) -#else isdn_readbchan(int di, int channel, u_char * buf, u_char * fp, int len, struct wait_queue **sleep) -#endif { int left; int count; @@ -1535,6 +1538,9 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg) * are serialized by means of a semaphore. */ switch (cmd) { + case IIOCNETLCR: + printk(KERN_INFO "INFO: ISDN_ABC_LCR_SUPPORT not enabled\n"); + return -ENODEV; #ifdef CONFIG_NETDEVICES case IIOCNETAIF: /* Add a network-interface */ @@ -2202,43 +2208,11 @@ isdn_writebuf_skb_stub(int drvidx, int chan, int ack, struct sk_buff *skb) int register_isdn_module(isdn_module *m) { -#if 0 - isdn_module_list **pp = &dev->modules; - isdn_module *new = kmalloc(sizeof(isdn_module_list), GFP_KERNEL); - - if (!new) { - printk(KERN_WARNING "isdn: Out of memory in register_isdn_module\n"); - return -1; - } - while (*pp && (*pp)->orig != m) - pp = &(*pp)->next; - if (*pp != NULL) { - printk(KERN_WARNING "isdn: Module %s already registered\n", m->name); - return -1; - } - while (*pp && ((*pp)->module.priority < m->priority)) - pp = &(*pp)->next; - new->next = *pp; - new->orig = m; - new->module = *m; - - *pp = new; -#endif return 0; } int unregister_isdn_module(isdn_module *m) { -#if 0 - isdn_module_list **pp = &dev->modules; - - while (*pp && *pp != m) - pp = &(*pp)->next; - if (*pp == NULL) { - printk(KERN_WARNING "isdn: Module %s not found\n", m->name); - return -1; - } -#endif return 0; } @@ -2248,9 +2222,6 @@ isdn_add_channels(driver *d, int drvidx, int n, int adding) int j, k, m; ulong flags; -#ifdef COMPAT_HAS_NEW_WAITQ - init_waitqueue_head(&d->st_waitq); -#endif if (d->flags & DRV_FLAG_RUNNING) return -1; if (n < 1) return 0; @@ -2300,14 +2271,8 @@ isdn_add_channels(driver *d, int drvidx, int n, int adding) if ((adding) && (d->rcv_waitq)) kfree(d->rcv_waitq); -#ifdef COMPAT_HAS_NEW_WAITQ - d->rcv_waitq = (wait_queue_head_t *) - kmalloc(sizeof(wait_queue_head_t) * 2 * m, GFP_KERNEL); - if (!d->rcv_waitq) { -#else if (!(d->rcv_waitq = (struct wait_queue **) kmalloc(sizeof(struct wait_queue *) * m, GFP_KERNEL))) { -#endif printk(KERN_WARNING "register_isdn: Could not alloc rcv_waitq\n"); if (!adding) { kfree(d->rpqueue); @@ -2316,13 +2281,6 @@ isdn_add_channels(driver *d, int drvidx, int n, int adding) } return -1; } -#ifdef COMPAT_HAS_NEW_WAITQ - d->snd_waitq = d->rcv_waitq + m; - for (j = 0; j < m; j++) { - init_waitqueue_head(&d->rcv_waitq[m]); - init_waitqueue_head(&d->snd_waitq[m]); - } -#else memset((char *) d->rcv_waitq, 0, sizeof(struct wait_queue *) * m); if ((adding) && (d->snd_waitq)) @@ -2339,7 +2297,6 @@ isdn_add_channels(driver *d, int drvidx, int n, int adding) return -1; } memset((char *) d->snd_waitq, 0, sizeof(struct wait_queue *) * m); -#endif dev->channels += n; save_flags(flags); @@ -2521,21 +2478,12 @@ isdn_init(void) memset((char *) dev, 0, sizeof(isdn_dev)); init_timer(&dev->timer); dev->timer.function = isdn_timer_funct; -#ifdef COMPAT_HAS_NEW_WAITQ - init_MUTEX(&dev->sem); - init_waitqueue_head(&dev->info_waitq); -#else dev->sem = MUTEX; -#endif for (i = 0; i < ISDN_MAX_CHANNELS; i++) { dev->drvmap[i] = -1; dev->chanmap[i] = -1; dev->m_idx[i] = -1; strcpy(dev->num[i], "???"); -#ifdef COMPAT_HAS_NEW_WAITQ - init_waitqueue_head(&dev->mdm.info[i].open_wait); - init_waitqueue_head(&dev->mdm.info[i].close_wait); -#endif } if (register_chrdev(ISDN_MAJOR, "isdn", &isdn_fops)) { printk(KERN_WARNING "isdn: Could not register control devices\n"); diff --git a/drivers/isdn/isdn_common.h b/drivers/isdn/isdn_common.h index e6fb122f6669..23c6fe94af21 100644 --- a/drivers/isdn/isdn_common.h +++ b/drivers/isdn/isdn_common.h @@ -118,11 +118,7 @@ extern char *isdn_map_eaz2msn(char *msn, int di); extern void isdn_timer_ctrl(int tf, int onoff); extern void isdn_unexclusive_channel(int di, int ch); extern int isdn_getnum(char **); -#ifdef COMPAT_HAS_NEW_WAITQ -extern int isdn_readbchan(int, int, u_char *, u_char *, int, wait_queue_head_t *); -#else extern int isdn_readbchan(int, int, u_char *, u_char *, int, struct wait_queue**); -#endif extern int isdn_get_free_channel(int, int, int, int, int); extern int isdn_writebuf_skb_stub(int, int, int, struct sk_buff *); extern int register_isdn(isdn_if * i); diff --git a/drivers/isdn/isdn_concap.c b/drivers/isdn/isdn_concap.c index 1ca6c34e383b..d331cbe1acae 100644 --- a/drivers/isdn/isdn_concap.c +++ b/drivers/isdn/isdn_concap.c @@ -1,10 +1,16 @@ -/* $Id: isdn_concap.c,v 1.5 1998/10/30 18:44:48 he Exp $ +/* $Id: isdn_concap.c,v 1.6 1999/08/22 20:26:01 calle Exp $ * Stuff to support the concap_proto by isdn4linux. isdn4linux - specific * stuff goes here. Stuff that depends only on the concap protocol goes to * another -- protocol specific -- source file. * * $Log: isdn_concap.c,v $ + * Revision 1.6 1999/08/22 20:26:01 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * * Revision 1.5 1998/10/30 18:44:48 he * pass return value from isdn_net_dial_req for dialmode change * diff --git a/drivers/isdn/isdn_net.c b/drivers/isdn/isdn_net.c index b3e15ff1833e..ada4a4902d37 100644 --- a/drivers/isdn/isdn_net.c +++ b/drivers/isdn/isdn_net.c @@ -1,4 +1,4 @@ -/* $Id: isdn_net.c,v 1.88 1999/07/07 10:13:31 detabc Exp $ +/* $Id: isdn_net.c,v 1.92 1999/09/13 23:25:17 he Exp $ * Linux ISDN subsystem, network interfaces and related functions (linklevel). * @@ -21,6 +21,26 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: isdn_net.c,v $ + * Revision 1.92 1999/09/13 23:25:17 he + * serialized xmitting frames from isdn_ppp and BSENT statcallb + * + * Revision 1.91 1999/09/12 16:19:39 detabc + * added abc features + * low cost routing for net-interfaces (only the HL side). + * need more implementation in the isdnlog-utility + * udp info support (first part). + * different EAZ on outgoing call's. + * more checks on D-Channel callbacks (double use of channels). + * tested and running with kernel 2.3.17 + * + * Revision 1.90 1999/09/04 22:21:39 detabc + * + * Revision 1.89 1999/08/22 20:26:03 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * * Revision 1.88 1999/07/07 10:13:31 detabc * remove unused messages * @@ -354,13 +374,15 @@ #include "isdn_concap.h" #endif + + /* Prototypes */ int isdn_net_force_dial_lp(isdn_net_local *); static int isdn_net_start_xmit(struct sk_buff *, struct device *); static int isdn_net_xmit(struct device *, isdn_net_local *, struct sk_buff *); -char *isdn_net_revision = "$Revision: 1.88 $"; +char *isdn_net_revision = "$Revision: 1.92 $"; /* * Code for raw-networking over ISDN @@ -601,6 +623,13 @@ isdn_net_stat_callback(int idx, isdn_ctrl *c) (!lp->dialstate)) { lp->stats.tx_packets++; lp->stats.tx_bytes += c->parm.length; + /* some HL drivers deliver + ISDN_STAT_BSENT from hw interrupt. + Output routines in isdn_ppp are now + called with irq disabled such that + dequeueing the sav_skb while another + frame is sent will not occur. + */ if (lp->p_encap == ISDN_NET_ENCAP_SYNCPPP && lp->sav_skb) { struct device *mdev; if (lp->master) @@ -1292,7 +1321,6 @@ isdn_net_start_xmit(struct sk_buff *skb, struct device *ndev) #ifdef CONFIG_ISDN_X25 struct concap_proto * cprot = lp -> netdev -> cprot; #endif - if (ndev->tbusy) { if (jiffies - ndev->trans_start < (2 * HZ)) return 1; @@ -1909,7 +1937,7 @@ isdn_net_rebuild_header(struct sk_buff *skb) } /* - * Interface-setup. (called just after registering a new interface) + * Interface-setup. (just after registering a new interface) */ static int isdn_net_init(struct device *ndev) @@ -3070,7 +3098,6 @@ isdn_net_realrm(isdn_net_dev * p, isdn_net_dev * q) if (dev->netdev == NULL) isdn_timer_ctrl(ISDN_TIMER_NETHANGUP, 0); restore_flags(flags); - kfree(p->local); kfree(p); @@ -3126,3 +3153,4 @@ isdn_net_rmall(void) restore_flags(flags); return 0; } + diff --git a/drivers/isdn/isdn_net.h b/drivers/isdn/isdn_net.h index 79d4ff6154d7..fd0ad3ea4aff 100644 --- a/drivers/isdn/isdn_net.h +++ b/drivers/isdn/isdn_net.h @@ -1,4 +1,4 @@ -/* $Id: isdn_net.h,v 1.9 1999/04/12 12:33:27 fritz Exp $ +/* $Id: isdn_net.h,v 1.10 1999/08/22 20:26:06 calle Exp $ * header for Linux ISDN subsystem, network related functions (linklevel). * @@ -21,6 +21,12 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: isdn_net.h,v $ + * Revision 1.10 1999/08/22 20:26:06 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * * Revision 1.9 1999/04/12 12:33:27 fritz * Changes from 2.0 tree. * diff --git a/drivers/isdn/isdn_ppp.c b/drivers/isdn/isdn_ppp.c index 69e84990512f..118905e5fbab 100644 --- a/drivers/isdn/isdn_ppp.c +++ b/drivers/isdn/isdn_ppp.c @@ -1,4 +1,4 @@ -/* $Id: isdn_ppp.c,v 1.49 1999/07/06 07:47:11 calle Exp $ +/* $Id: isdn_ppp.c,v 1.54 1999/09/13 23:25:17 he Exp $ * * Linux ISDN subsystem, functions for synchronous PPP (linklevel). * @@ -19,6 +19,24 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: isdn_ppp.c,v $ + * Revision 1.54 1999/09/13 23:25:17 he + * serialized xmitting frames from isdn_ppp and BSENT statcallb + * + * Revision 1.53 1999/08/31 11:18:14 paul + * various spelling corrections (new checksums may be needed, Karsten!) + * + * Revision 1.52 1999/08/22 20:26:07 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * + * Revision 1.51 1999/08/18 16:19:17 hipp + * applied MPPP-resize-headroom patch + * + * Revision 1.50 1999/08/16 07:11:41 hipp + * Additional VJ decomp-buffer-size increased from 40 to 128 + * * Revision 1.49 1999/07/06 07:47:11 calle * bugfix: dev_alloc_skb only reserve 16 bytes. We need to look at the * hdrlen the driver want. So I changed dev_alloc_skb calls @@ -269,7 +287,7 @@ static int isdn_ppp_fill_mpqueue(isdn_net_dev *, struct sk_buff **skb, static void isdn_ppp_free_mpqueue(isdn_net_dev *); #endif -char *isdn_ppp_revision = "$Revision: 1.49 $"; +char *isdn_ppp_revision = "$Revision: 1.54 $"; static struct ippp_struct *ippp_table[ISDN_MAX_CHANNELS]; static struct isdn_ppp_compressor *ipc_head = NULL; @@ -438,9 +456,7 @@ isdn_ppp_wakeup_daemon(isdn_net_local * lp) ippp_table[lp->ppp_slot]->state = IPPP_OPEN | IPPP_CONNECT | IPPP_NOBLOCK; -#ifndef COMPAT_HAS_NEW_WAITQ if (ippp_table[lp->ppp_slot]->wq) -#endif wake_up_interruptible(&ippp_table[lp->ppp_slot]->wq); } @@ -458,11 +474,7 @@ isdn_ppp_closewait(int slot) return 0; is = ippp_table[slot]; -#ifdef COMPAT_HAS_NEW_WAITQ - if (is->state) -#else if (is->state && is->wq) -#endif wake_up_interruptible(&is->wq); is->state = IPPP_CLOSEWAIT; @@ -503,9 +515,6 @@ isdn_ppp_open(int min, struct file *file) } is = file->private_data = ippp_table[slot]; -#if 0 - if (is->debug & 0x1) -#endif printk(KERN_DEBUG "ippp, open, slot: %d, minor: %d, state: %04x\n", slot, min, is->state); /* compression stuff */ @@ -527,11 +536,7 @@ isdn_ppp_open(int min, struct file *file) is->mru = 1524; /* MRU, default 1524 */ is->maxcid = 16; /* VJ: maxcid */ is->tk = current; -#ifdef COMPAT_HAS_NEW_WAITQ - init_waitqueue_head(&is->wq); -#else is->wq = NULL; /* read() wait queue */ -#endif is->first = is->rq + NUM_RCV_BUFFS - 1; /* receive queue */ is->last = is->rq; is->minor = min; @@ -707,10 +712,6 @@ isdn_ppp_ioctl(int min, struct file *file, unsigned int cmd, unsigned long arg) } is->pppcfg = val; break; -#if 0 - case PPPIOCGSTAT: /* read PPP statistic information */ - break; -#endif case PPPIOCGIDLE: /* get idle time information */ if (lp) { struct ppp_idle pidle; @@ -899,9 +900,7 @@ isdn_ppp_fill_rq(unsigned char *buf, int len, int proto, int slot) is->last = bl->next; restore_flags(flags); -#ifndef COMPAT_HAS_NEW_WAITQ if (is->wq) -#endif wake_up_interruptible(&is->wq); return len; @@ -992,6 +991,7 @@ isdn_ppp_write(int min, struct file *file, const char *buf, int count) lp->dialstate == 0 && (lp->flags & ISDN_NET_CONNECTED)) { unsigned short hl; + unsigned long flags; int cnt; struct sk_buff *skb; /* @@ -1015,6 +1015,8 @@ isdn_ppp_write(int min, struct file *file, const char *buf, int count) isdn_ppp_send_ccp(lp->netdev,lp,skb); /* keeps CCP/compression states in sync */ + save_flags(flags); + cli(); if ((cnt = isdn_writebuf_skb_stub(lp->isdn_device, lp->isdn_channel, 1, skb)) != count) { if (lp->sav_skb) { dev_kfree_skb(lp->sav_skb); @@ -1023,6 +1025,7 @@ isdn_ppp_write(int min, struct file *file, const char *buf, int count) printk(KERN_INFO "isdn_ppp_write: Can't write PPP frame to LL (%d,%d)!\n", cnt, count); lp->sav_skb = skb; } + restore_flags(flags); } } return count; @@ -1103,7 +1106,7 @@ void isdn_ppp_receive(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buf isdn_ppp_frame_log("receive", skb->data, skb->len, 32,is->unit,lp->ppp_slot); } if (net_dev->local->master) { - printk(KERN_WARNING "isdn_ppp_receice: net_dev != master\n"); + printk(KERN_WARNING "isdn_ppp_receive: net_dev != master\n"); net_dev = ((isdn_net_local *) net_dev->local->master->priv)->netdev; } if (skb->data[0] == 0xff && skb->data[1] == 0x03) @@ -1413,22 +1416,24 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff static unsigned char *isdn_ppp_skb_push(struct sk_buff **skb_p,int len) { struct sk_buff *skb = *skb_p; - + if(skb_headroom(skb) < len) { struct sk_buff *nskb = skb_realloc_headroom(skb, len); - + if (!nskb) { - printk(KERN_INFO "isdn_ppp_skb_push: can't realloc headroom!\n"); + printk(KERN_ERR "isdn_ppp_skb_push: can't realloc headroom!\n"); dev_kfree_skb(skb); return NULL; } + printk(KERN_DEBUG "isdn_ppp_skb_push:under %d %d\n",skb_headroom(skb),len); dev_kfree_skb(skb); *skb_p = nskb; return skb_push(nskb, len); } return skb_push(skb,len); } - + + /* * send ppp frame .. we expect a PIDCOMPressable proto -- * (here: currently always PPP_IP,PPP_VJC_COMP,PPP_VJC_UNCOMP) @@ -1445,6 +1450,7 @@ isdn_ppp_xmit(struct sk_buff *skb, struct device *netdev) isdn_net_dev *nd; unsigned int proto = PPP_IP; /* 0x21 */ struct ippp_struct *ipt,*ipts; + unsigned long flags; if (mdev) mlp = (isdn_net_local *) (mdev->priv); @@ -1640,13 +1646,16 @@ isdn_ppp_xmit(struct sk_buff *skb, struct device *netdev) printk(KERN_DEBUG "skb xmit: len: %d\n", (int) skb->len); isdn_ppp_frame_log("xmit", skb->data, skb->len, 32,ipt->unit,lp->ppp_slot); } + save_flags(flags); + cli(); if (isdn_net_send_skb(netdev, lp, skb)) { - if (lp->sav_skb) { /* whole sav_skb processing with disabled IRQs ?? */ + if (lp->sav_skb) { /* should never happen as sav_skb are sent with disabled IRQs) */ printk(KERN_ERR "%s: whoops .. there is another stored skb!\n", netdev->name); dev_kfree_skb(skb); } else lp->sav_skb = skb; } + restore_flags(flags); return 0; } @@ -1730,12 +1739,6 @@ isdn_ppp_bundle(struct ippp_struct *is, int unit) ippp_table[nlp->ppp_slot]->mpppcfg |= ippp_table[lp->ppp_slot]->mpppcfg & (SC_MP_PROT | SC_REJ_MP_PROT | SC_OUT_SHORT_SEQ | SC_IN_SHORT_SEQ); -#if 0 - if (ippp_table[nlp->ppp_slot]->mpppcfg != ippp_table[lp->ppp_slot]->mpppcfg) { - printk(KERN_WARNING "isdn_ppp_bundle: different MP options %04x and %04x\n", - ippp_table[nlp->ppp_slot]->mpppcfg, ippp_table[lp->ppp_slot]->mpppcfg); - } -#endif restore_flags(flags); return 0; @@ -2061,9 +2064,6 @@ isdn_ppp_dev_ioctl(struct device *dev, struct ifreq *ifr, int cmd) int len; isdn_net_local *lp = (isdn_net_local *) dev->priv; -#if 0 - printk(KERN_DEBUG "ippp, dev_ioctl: cmd %#08x , %d \n", cmd, lp->ppp_slot); -#endif if (lp->p_encap != ISDN_NET_ENCAP_SYNCPPP) return -EINVAL; @@ -2228,6 +2228,7 @@ static void isdn_ppp_ccp_xmit_reset(struct ippp_struct *is, int proto, struct sk_buff *skb; unsigned char *p; int count; + unsigned long flags; int cnt = 0; isdn_net_local *lp = is->lp; @@ -2270,6 +2271,8 @@ static void isdn_ppp_ccp_xmit_reset(struct ippp_struct *is, int proto, especially dunno what the sav_skb stuff is good for. */ count = skb->len; + save_flags(flags); + cli(); if ((cnt = isdn_writebuf_skb_stub(lp->isdn_device, lp->isdn_channel, 1, skb)) != count) { if (lp->sav_skb) { @@ -2283,6 +2286,7 @@ static void isdn_ppp_ccp_xmit_reset(struct ippp_struct *is, int proto, cnt, count); lp->sav_skb = skb; } + restore_flags(flags); } /* Allocate the reset state vector */ @@ -2639,13 +2643,7 @@ static struct sk_buff *isdn_ppp_compress(struct sk_buff *skb_in,int *proto, } if(type) { /* type=1 => Link compression */ -#if 0 - compressor = is->link_compressor; - stat = is->link_comp_stat; - new_proto = PPP_LINK_COMP; -#else return skb_in; -#endif } else { if(!master) { @@ -2986,5 +2984,3 @@ static int isdn_ppp_set_compressor(struct ippp_struct *is, struct isdn_ppp_comp_ } return -EINVAL; } - - diff --git a/drivers/isdn/isdn_ppp.h b/drivers/isdn/isdn_ppp.h index 2c60240a59ff..760774a03e93 100644 --- a/drivers/isdn/isdn_ppp.h +++ b/drivers/isdn/isdn_ppp.h @@ -1,4 +1,4 @@ -/* $Id: isdn_ppp.h,v 1.13 1998/03/22 18:50:50 hipp Exp $ +/* $Id: isdn_ppp.h,v 1.14 1999/08/22 20:26:10 calle Exp $ * header for Linux ISDN subsystem, functions for synchronous PPP (linklevel). * @@ -19,6 +19,12 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: isdn_ppp.h,v $ + * Revision 1.14 1999/08/22 20:26:10 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * * Revision 1.13 1998/03/22 18:50:50 hipp * Added BSD Compression for syncPPP .. UNTESTED at the moment * diff --git a/drivers/isdn/isdn_tty.c b/drivers/isdn/isdn_tty.c index d3a36c0e51b7..77a7f5dc1e38 100644 --- a/drivers/isdn/isdn_tty.c +++ b/drivers/isdn/isdn_tty.c @@ -1,4 +1,4 @@ -/* $Id: isdn_tty.c,v 1.72 1999/07/31 12:59:45 armin Exp $ +/* $Id: isdn_tty.c,v 1.74 1999/09/04 06:20:04 keil Exp $ * Linux ISDN subsystem, tty functions and AT-command emulator (linklevel). * @@ -20,6 +20,12 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: isdn_tty.c,v $ + * Revision 1.74 1999/09/04 06:20:04 keil + * Changes from kernel set_current_state() + * + * Revision 1.73 1999/08/28 21:56:27 keil + * misplaced #endif caused ttyI crash in 2.3.X + * * Revision 1.72 1999/07/31 12:59:45 armin * Added tty fax capabilities. * @@ -345,7 +351,7 @@ static int bit2si[8] = static int si2bit[8] = {4, 1, 4, 4, 4, 4, 4, 4}; -char *isdn_tty_revision = "$Revision: 1.72 $"; +char *isdn_tty_revision = "$Revision: 1.74 $"; /* isdn_tty_try_read() is called from within isdn_tty_rcv_skb() @@ -1898,12 +1904,8 @@ isdn_tty_set_termios(struct tty_struct *tty, struct termios *old_termios) static int isdn_tty_block_til_ready(struct tty_struct *tty, struct file *filp, modem_info * info) { -#ifdef COMPAT_HAS_NEW_WAITQ - DECLARE_WAITQUEUE(wait, NULL); -#else struct wait_queue wait = {current, NULL}; -#endif int do_clocal = 0; unsigned long flags; int retval; @@ -2372,11 +2374,7 @@ isdn_tty_modem_init(void) return -3; } #endif -#ifdef COMPAT_HAS_NEW_WAITQ - init_MUTEX(&info->write_sem); -#else info->write_sem = MUTEX; -#endif sprintf(info->last_cause, "0000"); sprintf(info->last_num, "none"); info->last_dir = 0; @@ -2393,14 +2391,9 @@ isdn_tty_modem_init(void) info->blocked_open = 0; info->callout_termios = m->cua_modem.init_termios; info->normal_termios = m->tty_modem.init_termios; -#ifdef COMPAT_HAS_NEW_WAITQ - init_waitqueue_head(&info->open_wait); - init_waitqueue_head(&info->close_wait); -#else info->open_wait = 0; info->close_wait = 0; info->isdn_driver = -1; -#endif info->isdn_channel = -1; info->drv_index = -1; info->xmit_size = ISDN_SERIAL_XMIT_SIZE; diff --git a/drivers/isdn/isdn_tty.h b/drivers/isdn/isdn_tty.h index 4fe9568ca9e2..87acd7be2fd3 100644 --- a/drivers/isdn/isdn_tty.h +++ b/drivers/isdn/isdn_tty.h @@ -1,4 +1,4 @@ -/* $Id: isdn_tty.h,v 1.15 1999/07/31 12:59:48 armin Exp $ +/* $Id: isdn_tty.h,v 1.16 1999/08/22 20:26:10 calle Exp $ * header for Linux ISDN subsystem, tty related functions (linklevel). * @@ -20,6 +20,12 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: isdn_tty.h,v $ + * Revision 1.16 1999/08/22 20:26:10 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * * Revision 1.15 1999/07/31 12:59:48 armin * Added tty fax capabilities. * @@ -86,6 +92,7 @@ * */ +#include #define DLE 0x10 #define ETX 0x03 diff --git a/drivers/isdn/isdn_ttyfax.c b/drivers/isdn/isdn_ttyfax.c index fc17b5b830ac..b08014d95c82 100644 --- a/drivers/isdn/isdn_ttyfax.c +++ b/drivers/isdn/isdn_ttyfax.c @@ -1,4 +1,4 @@ -/* $Id: isdn_ttyfax.c,v 1.2 1999/08/05 10:36:10 armin Exp $ +/* $Id: isdn_ttyfax.c,v 1.3 1999/08/22 20:26:12 calle Exp $ * Linux ISDN subsystem, tty_fax AT-command emulator (linklevel). * * Copyright 1999 by Armin Schindler (mac@melware.de) @@ -20,6 +20,12 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: isdn_ttyfax.c,v $ + * Revision 1.3 1999/08/22 20:26:12 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * * Revision 1.2 1999/08/05 10:36:10 armin * Bugfix: kernel oops on getting revision. * @@ -33,7 +39,6 @@ #undef ISDN_TTY_FAX_CMD_DEBUG #define __NO_VERSION__ -#include #include #include #include "isdn_common.h" @@ -41,7 +46,7 @@ #include "isdn_ttyfax.h" -static char *isdn_tty_fax_revision = "$Revision: 1.2 $"; +static char *isdn_tty_fax_revision = "$Revision: 1.3 $"; #define PARSE_ERROR1 { isdn_tty_fax_modem_result(1, info); return 1; } @@ -902,76 +907,6 @@ int isdn_tty_cmd_PLUSF_FAX(char **p, modem_info * info) return 0; } -#if 0 - /* LO=n - Flow control opts */ - if (!strncmp(p[0], "LO", 2)) { /* TODO */ - p[0] += 2; - switch (*p[0]) { - case '?': - p[0]++; - sprintf(rs, "\r\n%d",f->lo); - isdn_tty_at_cout(rs, info); - break; - case '=': - p[0]++; - if (*p[0] == '?') - { - p[0]++; - sprintf(rs, "\r\n0,1,2"); - isdn_tty_at_cout(rs, info); - } - else - { - par = isdn_getnum(p); - if ((par < 0) || (par > 2)) - PARSE_ERROR1; - f->lo = par; -#ifdef ISDN_TTY_FAX_STAT_DEBUG - printk(KERN_DEBUG "isdn_tty: Fax FLO=%d\n", par); -#endif - } - break; - default: - PARSE_ERROR1; - } - return 0; - } -#endif -#if 0 - /* LPL=n - Doc for polling cmd */ - if (!strncmp(p[0], "LPL", 3)) { /* TODO */ - p[0] += 3; - switch (*p[0]) { - case '?': - p[0]++; - sprintf(rs, "\r\n%d",f->lpl); - isdn_tty_at_cout(rs, info); - break; - case '=': - p[0]++; - if (*p[0] == '?') - { - p[0]++; - sprintf(rs, "\r\n0,1"); - isdn_tty_at_cout(rs, info); - } - else - { - par = isdn_getnum(p); - if ((par < 0) || (par > 1)) - PARSE_ERROR1; - f->lpl = par; -#ifdef ISDN_TTY_FAX_STAT_DEBUG - printk(KERN_DEBUG "isdn_tty: Fax FLPL=%d\n", par); -#endif - } - break; - default: - PARSE_ERROR1; - } - return 0; - } -#endif /* MDL? - DCE Model */ if (!strncmp(p[0], "MDL?", 4)) { @@ -1061,41 +996,6 @@ int isdn_tty_cmd_PLUSF_FAX(char **p, modem_info * info) return 0; } -#if 0 - /* PTS=n - Page transfer status */ - if (!strncmp(p[0], "PTS", 3)) { /* TODO */ - p[0] += 3; - switch (*p[0]) { - case '?': - p[0]++; - sprintf(rs, "\r\n%d",f->pts); - isdn_tty_at_cout(rs, info); - break; - case '=': - p[0]++; - if (*p[0] == '?') - { - p[0]++; - sprintf(rs, "\r\n0-5"); - isdn_tty_at_cout(rs, info); - } - else - { - par = isdn_getnum(p); - if ((par < 0) || (par > 5)) - PARSE_ERROR1; - f->pts = par; -#ifdef ISDN_TTY_FAX_STAT_DEBUG - printk(KERN_DEBUG "isdn_tty: Fax FPTS=%d\n", par); -#endif - } - break; - default: - PARSE_ERROR1; - } - return 0; - } -#endif /* REL=n - Phase C received EOL alignment */ if (!strncmp(p[0], "REL", 3)) { @@ -1143,41 +1043,6 @@ int isdn_tty_cmd_PLUSF_FAX(char **p, modem_info * info) return 0; } -#if 0 - /* SPL=n - Enable polling */ - if (!strncmp(p[0], "SPL", 3)) { /* TODO */ - p[0] += 3; - switch (*p[0]) { - case '?': - p[0]++; - sprintf(rs, "\r\n%d", f->spl); - isdn_tty_at_cout(rs, info); - break; - case '=': - p[0]++; - if (*p[0] == '?') - { - p[0]++; - sprintf(rs, "\r\n0,1"); - isdn_tty_at_cout(rs, info); - } - else - { - par = isdn_getnum(p); - if ((par < 0) || (par > 1)) - PARSE_ERROR1; - f->spl = par; -#ifdef ISDN_TTY_FAX_STAT_DEBUG - printk(KERN_DEBUG "isdn_tty: Fax FSPL=%d\n", par); -#endif - } - break; - default: - PARSE_ERROR1; - } - return 0; - } -#endif /* Phase C Transmit Data Block Size */ if (!strncmp(p[0], "TBC=", 4)) { /* dummy, not used */ diff --git a/drivers/isdn/isdn_v110.c b/drivers/isdn/isdn_v110.c index ae62378b8757..bf09073efe6f 100644 --- a/drivers/isdn/isdn_v110.c +++ b/drivers/isdn/isdn_v110.c @@ -155,14 +155,6 @@ isdn_v110_close(isdn_v110_stream * v) return; #ifdef ISDN_V110_DEBUG printk(KERN_DEBUG "v110 close\n"); -#if 0 - printk(KERN_DEBUG "isdn_v110_close: nbytes=%d\n", v->nbytes); - printk(KERN_DEBUG "isdn_v110_close: nbits=%d\n", v->nbits); - printk(KERN_DEBUG "isdn_v110_close: key=%d\n", v->key); - printk(KERN_DEBUG "isdn_v110_close: SyncInit=%d\n", v->SyncInit); - printk(KERN_DEBUG "isdn_v110:close: decodelen=%d\n", v->decodelen); - printk(KERN_DEBUG "isdn_v110_close: framelen=%d\n", v->framelen); -#endif #endif kfree(v->encodebuf); kfree(v); diff --git a/drivers/isdn/isdn_x25iface.c b/drivers/isdn/isdn_x25iface.c index d0594fe34520..d264311ae3de 100644 --- a/drivers/isdn/isdn_x25iface.c +++ b/drivers/isdn/isdn_x25iface.c @@ -1,4 +1,4 @@ -/* $Id: isdn_x25iface.c,v 1.6 1999/01/27 22:53:19 he Exp $ +/* $Id: isdn_x25iface.c,v 1.7 1999/08/22 20:26:13 calle Exp $ * stuff needed to support the Linux X.25 PLP code on top of devices that * can provide a lab_b service using the concap_proto mechanism. * This module supports a network interface wich provides lapb_sematics @@ -10,6 +10,12 @@ * goes to another -- device related -- concap_proto support source file. * * $Log: isdn_x25iface.c,v $ + * Revision 1.7 1999/08/22 20:26:13 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * * Revision 1.6 1999/01/27 22:53:19 he * minor updates (spellings, jiffies wrap around in isdn_tty) * diff --git a/drivers/isdn/isdnloop/isdnloop.c b/drivers/isdn/isdnloop/isdnloop.c index 2e580e1c7a61..9168aca8cbba 100644 --- a/drivers/isdn/isdnloop/isdnloop.c +++ b/drivers/isdn/isdnloop/isdnloop.c @@ -1,8 +1,8 @@ -/* $Id: isdnloop.c,v 1.8 1998/11/18 18:59:43 armin Exp $ +/* $Id: isdnloop.c,v 1.9 1999/09/06 07:29:36 fritz Exp $ * ISDN low-level module implementing a dummy loop driver. * - * Copyright 1997 by Fritz Elfert (fritz@wuemaus.franken.de) + * Copyright 1997 by Fritz Elfert (fritz@isdn4linux.de) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,6 +19,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: isdnloop.c,v $ + * Revision 1.9 1999/09/06 07:29:36 fritz + * Changed my mail-address. + * * Revision 1.8 1998/11/18 18:59:43 armin * changes for 2.1.127 * @@ -56,7 +59,7 @@ #include "isdnloop.h" static char -*revision = "$Revision: 1.8 $"; +*revision = "$Revision: 1.9 $"; static int isdnloop_addcard(char *); diff --git a/drivers/isdn/isdnloop/isdnloop.h b/drivers/isdn/isdnloop/isdnloop.h index 42906c143ee3..82266edbe393 100644 --- a/drivers/isdn/isdnloop/isdnloop.h +++ b/drivers/isdn/isdnloop/isdnloop.h @@ -1,8 +1,8 @@ -/* $Id: isdnloop.h,v 1.3 1998/04/14 20:59:35 he Exp $ +/* $Id: isdnloop.h,v 1.4 1999/09/06 07:29:36 fritz Exp $ * Loopback lowlevel module for testing of linklevel. * - * Copyright 1997 by Fritz Elfert (fritz@wuemaus.franken.de) + * Copyright 1997 by Fritz Elfert (fritz@isdn4linux.de) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,6 +19,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: isdnloop.h,v $ + * Revision 1.4 1999/09/06 07:29:36 fritz + * Changed my mail-address. + * * Revision 1.3 1998/04/14 20:59:35 he * merged 2.1.94 changes * diff --git a/drivers/isdn/pcbit/drv.c b/drivers/isdn/pcbit/drv.c index 77f0ed45f7d9..2af614b2ee71 100644 --- a/drivers/isdn/pcbit/drv.c +++ b/drivers/isdn/pcbit/drv.c @@ -86,9 +86,6 @@ int pcbit_init_dev(int board, int mem_base, int irq) dev_pcbit[board] = dev; memset(dev, 0, sizeof(struct pcbit_dev)); -#ifdef COMPAT_HAS_NEW_WAITQ - init_waitqueue_head(&dev->set_running_wq); -#endif if (mem_base >= 0xA0000 && mem_base <= 0xFFFFF ) dev->sh_mem = (unsigned char*) mem_base; @@ -593,20 +590,6 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg, dev->b1->s_refnum, dev->b2->s_refnum); #endif -#if 0 - if (dev->b1->s_refnum == refnum) - chan = dev->b1; - else { - - if (dev->b2->s_refnum == refnum) - chan = dev->b2; - else { - chan = NULL; - printk(KERN_WARNING "Connection Confirm - refnum doesn't match chan\n"); - break; - } - } -#else /* We just try to find a channel in the right state */ if (dev->b1->fsm_state == ST_CALL_INIT) @@ -620,7 +603,6 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg, break; } } -#endif if (capi_decode_conn_conf(chan, skb, &complete)) { printk(KERN_DEBUG "conn_conf indicates error\n"); pcbit_fsm_event(dev, chan, EV_ERROR, NULL); diff --git a/drivers/isdn/pcbit/layer2.c b/drivers/isdn/pcbit/layer2.c index bc1b079a2d12..36bd6f8aad9e 100644 --- a/drivers/isdn/pcbit/layer2.c +++ b/drivers/isdn/pcbit/layer2.c @@ -375,16 +375,11 @@ pcbit_receive(struct pcbit_dev *dev) if (dev->read_frame) { printk(KERN_DEBUG "pcbit_receive: Type 0 frame and read_frame != NULL\n"); -#if 0 - pcbit_l2_error(dev); - return; -#else /* discard previous queued frame */ if (dev->read_frame->skb) kfree_skb(dev->read_frame->skb); kfree(dev->read_frame); dev->read_frame = NULL; -#endif } frame = kmalloc(sizeof(struct frame_buf), GFP_ATOMIC); @@ -460,14 +455,10 @@ pcbit_receive(struct pcbit_dev *dev) if (!(frame = dev->read_frame)) { printk("Type 1 frame and no frame queued\n"); -#if 1 /* usually after an error: toss frame */ dev->readptr += tt; if (dev->readptr > dev->sh_mem + BANK2 + BANKLEN) dev->readptr -= BANKLEN; -#else - pcbit_l2_error(dev); -#endif return; } diff --git a/drivers/isdn/pcbit/module.c b/drivers/isdn/pcbit/module.c index 33aee3360eb3..55dad0fce1cb 100644 --- a/drivers/isdn/pcbit/module.c +++ b/drivers/isdn/pcbit/module.c @@ -105,7 +105,6 @@ void cleanup_module(void) void pcbit_setup(char *str, int *ints) { int i, j, argc; - argc = ints[0]; i = 0; j = 1; diff --git a/drivers/isdn/pcbit/pcbit.h b/drivers/isdn/pcbit/pcbit.h index 45c68871dd5b..20051bf3ec13 100644 --- a/drivers/isdn/pcbit/pcbit.h +++ b/drivers/isdn/pcbit/pcbit.h @@ -68,11 +68,7 @@ struct pcbit_dev { struct frame_buf *write_queue; /* Protocol start */ -#ifdef COMPAT_HAS_NEW_WAITQ - wait_queue_head_t set_running_wq; -#else struct wait_queue *set_running_wq; -#endif struct timer_list set_running_timer; struct timer_list error_recover_timer; diff --git a/drivers/isdn/sc/init.c b/drivers/isdn/sc/init.c index 788950eebf5a..d4a64e43df07 100644 --- a/drivers/isdn/sc/init.c +++ b/drivers/isdn/sc/init.c @@ -516,15 +516,6 @@ int identify_board(unsigned long rambase, unsigned int iobase) schedule_timeout(HZ); sig = readl(rambase + SIG_OFFSET); pr_debug("Looking for a signature, got 0x%x\n", sig); -#if 0 -/* - * For Gary: - * If it's a timing problem, it should be gone with the above schedule() - * Another possible reason may be the missing volatile in the original - * code. readl() does this for us. - */ - printk(""); /* Hack! Doesn't work without this !!!??? */ -#endif if(sig == SIGNATURE) return PRI_BOARD; @@ -536,9 +527,6 @@ int identify_board(unsigned long rambase, unsigned int iobase) schedule_timeout(HZ); sig = readl(rambase + SIG_OFFSET); pr_debug("Looking for a signature, got 0x%x\n", sig); -#if 0 - printk(""); /* Hack! Doesn't work without this !!!??? */ -#endif if(sig == SIGNATURE) return BRI_BOARD; diff --git a/drivers/isdn/sc/ioctl.c b/drivers/isdn/sc/ioctl.c index 9915cb0d8cac..141d5254dbea 100644 --- a/drivers/isdn/sc/ioctl.c +++ b/drivers/isdn/sc/ioctl.c @@ -15,9 +15,6 @@ extern int send_and_receive(int, unsigned int, unsigned char,unsigned char, extern board *adapter[]; -#if 0 -static char *ChannelStates[] = { "Idle", "Ready", "Connecting", "Connected", "Disconnecting" }; -#endif int GetStatus(int card, boardInfo *); @@ -42,7 +39,7 @@ int sc_ioctl(int card, scs_ioctl *data) pr_debug("%s: SCIOLOAD: ioctl received\n", adapter[card]->devicename); if(adapter[card]->EngineUp) { - pr_debug("%s: SCIOCLOAD: Command Failed, LoadProc while engine running.\n", + pr_debug("%s: SCIOCLOAD: command failed, LoadProc while engine running.\n", adapter[card]->devicename); return -1; } @@ -56,12 +53,12 @@ int sc_ioctl(int card, scs_ioctl *data) status = send_and_receive(card, CMPID, cmReqType2, cmReqClass0, cmReqLoadProc, 0, sizeof(srec), srec, &rcvmsg, SAR_TIMEOUT); if(status) { - pr_debug("%s: SCIOCLOAD: Command Failed, status = %d\n", + pr_debug("%s: SCIOCLOAD: command failed, status = %d\n", adapter[card]->devicename, status); return -1; } else { - pr_debug("%s: SCIOCLOAD: Command Sucessful\n", adapter[card]->devicename); + pr_debug("%s: SCIOCLOAD: command successful\n", adapter[card]->devicename); return 0; } } @@ -70,7 +67,7 @@ int sc_ioctl(int card, scs_ioctl *data) { pr_debug("%s: SCIOSTART: ioctl received\n", adapter[card]->devicename); if(adapter[card]->EngineUp) { - pr_debug("%s: SCIOCSTART: Command Failed, Engine already running.\n", + pr_debug("%s: SCIOCSTART: command failed, engine already running.\n", adapter[card]->devicename); return -1; } @@ -94,16 +91,16 @@ int sc_ioctl(int card, scs_ioctl *data) if ((err = copy_from_user(&switchtype, (char *) data->dataptr, sizeof(char)))) return err; - pr_debug("%s: SCIOCSETSWITCH: Setting switch type to %d\n", adapter[card]->devicename, + pr_debug("%s: SCIOCSETSWITCH: setting switch type to %d\n", adapter[card]->devicename, switchtype); status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, ceReqCallSetSwitchType, 0, sizeof(char),&switchtype,&rcvmsg, SAR_TIMEOUT); if(!status && !rcvmsg.rsp_status) { - pr_debug("%s: SCIOCSETSWITCH: Command Successful\n", adapter[card]->devicename); + pr_debug("%s: SCIOCSETSWITCH: command successful\n", adapter[card]->devicename); return 0; } else { - pr_debug("%s: SCIOCSETSWITCH: Command Failed (status = %d)\n", + pr_debug("%s: SCIOCSETSWITCH: command failed (status = %d)\n", adapter[card]->devicename, status); return status; } @@ -123,10 +120,10 @@ int sc_ioctl(int card, scs_ioctl *data) status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, ceReqCallGetSwitchType, 0, 0, 0, &rcvmsg, SAR_TIMEOUT); if (!status && !rcvmsg.rsp_status) { - pr_debug("%s: SCIOCGETSWITCH: Command Sucessful\n", adapter[card]->devicename); + pr_debug("%s: SCIOCGETSWITCH: command successful\n", adapter[card]->devicename); } else { - pr_debug("%s: SCIOCGETSWITCH: Command Failed (status = %d)\n", + pr_debug("%s: SCIOCGETSWITCH: command failed (status = %d)\n", adapter[card]->devicename, status); return status; } @@ -156,10 +153,10 @@ int sc_ioctl(int card, scs_ioctl *data) status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, ceReqCallGetSPID, data->channel, 0, 0, &rcvmsg, SAR_TIMEOUT); if (!status) { - pr_debug("%s: SCIOCGETSPID: Command Sucessful\n", adapter[card]->devicename); + pr_debug("%s: SCIOCGETSPID: command successful\n", adapter[card]->devicename); } else { - pr_debug("%s: SCIOCGETSPID: Command Failed (status = %d)\n", + pr_debug("%s: SCIOCGETSPID: command failed (status = %d)\n", adapter[card]->devicename, status); return status; } @@ -188,18 +185,18 @@ int sc_ioctl(int card, scs_ioctl *data) if ((err = copy_from_user(spid, (char *) data->dataptr, sizeof(spid)))) return err; - pr_debug("%s: SCIOCSETSPID: Setting channel %d spid to %s\n", + pr_debug("%s: SCIOCSETSPID: setting channel %d spid to %s\n", adapter[card]->devicename, data->channel, spid); status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, ceReqCallSetSPID, data->channel, strlen(spid), spid, &rcvmsg, SAR_TIMEOUT); if(!status && !rcvmsg.rsp_status) { - pr_debug("%s: SCIOCSETSPID: Command Successful\n", + pr_debug("%s: SCIOCSETSPID: command successful\n", adapter[card]->devicename); return 0; } else { - pr_debug("%s: SCIOCSETSPID: Command Failed (status = %d)\n", + pr_debug("%s: SCIOCSETSPID: command failed (status = %d)\n", adapter[card]->devicename, status); return status; } @@ -219,10 +216,10 @@ int sc_ioctl(int card, scs_ioctl *data) status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, ceReqCallGetMyNumber, data->channel, 0, 0, &rcvmsg, SAR_TIMEOUT); if (!status) { - pr_debug("%s: SCIOCGETDN: Command Sucessful\n", adapter[card]->devicename); + pr_debug("%s: SCIOCGETDN: command successful\n", adapter[card]->devicename); } else { - pr_debug("%s: SCIOCGETDN: Command Failed (status = %d)\n", + pr_debug("%s: SCIOCGETDN: command failed (status = %d)\n", adapter[card]->devicename, status); return status; } @@ -252,18 +249,18 @@ int sc_ioctl(int card, scs_ioctl *data) if ((err = copy_from_user(dn, (char *) data->dataptr, sizeof(dn)))) return err; - pr_debug("%s: SCIOCSETDN: Setting channel %d dn to %s\n", + pr_debug("%s: SCIOCSETDN: setting channel %d dn to %s\n", adapter[card]->devicename, data->channel, dn); status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, ceReqCallSetMyNumber, data->channel, strlen(dn),dn,&rcvmsg, SAR_TIMEOUT); if(!status && !rcvmsg.rsp_status) { - pr_debug("%s: SCIOCSETDN: Command Successful\n", + pr_debug("%s: SCIOCSETDN: command successful\n", adapter[card]->devicename); return 0; } else { - pr_debug("%s: SCIOCSETDN: Command Failed (status = %d)\n", + pr_debug("%s: SCIOCSETDN: command failed (status = %d)\n", adapter[card]->devicename, status); return status; } @@ -273,7 +270,7 @@ int sc_ioctl(int card, scs_ioctl *data) pr_debug("%s: SCIOTRACE: ioctl received\n", adapter[card]->devicename); /* adapter[card]->trace = !adapter[card]->trace; - pr_debug("%s: SCIOCTRACE: Tracing turned %s\n", adapter[card]->devicename, + pr_debug("%s: SCIOCTRACE: tracing turned %s\n", adapter[card]->devicename, adapter[card]->trace ? "ON" : "OFF"); */ break; @@ -305,11 +302,11 @@ int sc_ioctl(int card, scs_ioctl *data) status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, ceReqCallGetCallType, data->channel, 0, 0, &rcvmsg, SAR_TIMEOUT); if (!status && !rcvmsg.rsp_status) { - pr_debug("%s: SCIOCGETSPEED: Command Sucessful\n", + pr_debug("%s: SCIOCGETSPEED: command successful\n", adapter[card]->devicename); } else { - pr_debug("%s: SCIOCGETSPEED: Command Failed (status = %d)\n", + pr_debug("%s: SCIOCGETSPEED: command failed (status = %d)\n", adapter[card]->devicename, status); return status; } diff --git a/drivers/isdn/sc/message.c b/drivers/isdn/sc/message.c index 4d4765f79247..a00b892692de 100644 --- a/drivers/isdn/sc/message.c +++ b/drivers/isdn/sc/message.c @@ -1,5 +1,5 @@ /* - * $Id: message.c,v 1.4 1999/01/05 18:29:47 he Exp $ + * $Id: message.c,v 1.5 1999/09/04 06:20:07 keil Exp $ * Copyright (C) 1996 SpellCaster Telecommunications Inc. * * message.c - functions for sending and receiving control messages diff --git a/drivers/isdn/sc/packet.c b/drivers/isdn/sc/packet.c index d75cb04d7f7b..31e562c57b04 100644 --- a/drivers/isdn/sc/packet.c +++ b/drivers/isdn/sc/packet.c @@ -1,5 +1,5 @@ /* - * $Id: packet.c,v 1.4 1998/02/12 23:08:50 keil Exp $ + * $Id: packet.c,v 1.5 1999/08/31 11:20:41 paul Exp $ * Copyright (C) 1996 SpellCaster Telecommunications Inc. * * This program is free software; you can redistribute it and/or modify @@ -52,11 +52,11 @@ int sndpkt(int devId, int channel, struct sk_buff *data) card = get_card_from_id(devId); if(!IS_VALID_CARD(card)) { - pr_debug("Invalid param: %d is not a valid card id\n", card); + pr_debug("invalid param: %d is not a valid card id\n", card); return -ENODEV; } - pr_debug("%s: Send Packet: frst = 0x%x nxt = %d f = %d n = %d\n", + pr_debug("%s: sndpkt: frst = 0x%x nxt = %d f = %d n = %d\n", adapter[card]->devicename, adapter[card]->channel[channel].first_sendbuf, adapter[card]->channel[channel].next_sendbuf, @@ -64,26 +64,26 @@ int sndpkt(int devId, int channel, struct sk_buff *data) adapter[card]->channel[channel].num_sendbufs); if(!adapter[card]->channel[channel].free_sendbufs) { - pr_debug("%s: Out out TX buffers\n", adapter[card]->devicename); + pr_debug("%s: out of TX buffers\n", adapter[card]->devicename); return -EINVAL; } if(data->len > BUFFER_SIZE) { - pr_debug("%s: Data overflows buffer size (data > buffer)\n", adapter[card]->devicename); + pr_debug("%s: data overflows buffer size (data > buffer)\n", adapter[card]->devicename); return -EINVAL; } ReqLnkWrite.buff_offset = adapter[card]->channel[channel].next_sendbuf * BUFFER_SIZE + adapter[card]->channel[channel].first_sendbuf; ReqLnkWrite.msg_len = data->len; /* sk_buff size */ - pr_debug("%s: Writing %d bytes to buffer offset 0x%x\n", adapter[card]->devicename, + pr_debug("%s: writing %d bytes to buffer offset 0x%x\n", adapter[card]->devicename, ReqLnkWrite.msg_len, ReqLnkWrite.buff_offset); memcpy_toshmem(card, (char *)ReqLnkWrite.buff_offset, data->data, ReqLnkWrite.msg_len); /* * sendmessage */ - pr_debug("%s: Send Packet size=%d, buf_offset=0x%x buf_indx=%d\n", + pr_debug("%s: sndpkt size=%d, buf_offset=0x%x buf_indx=%d\n", adapter[card]->devicename, ReqLnkWrite.msg_len, ReqLnkWrite.buff_offset, adapter[card]->channel[channel].next_sendbuf); @@ -92,7 +92,7 @@ int sndpkt(int devId, int channel, struct sk_buff *data) channel+1, sizeof(LLData), (unsigned int*)&ReqLnkWrite); len = data->len; if(status) { - pr_debug("%s: Failed to send packet, status = %d\n", adapter[card]->devicename, status); + pr_debug("%s: failed to send packet, status = %d\n", adapter[card]->devicename, status); return -1; } else { @@ -101,7 +101,7 @@ int sndpkt(int devId, int channel, struct sk_buff *data) ++adapter[card]->channel[channel].next_sendbuf == adapter[card]->channel[channel].num_sendbufs ? 0 : adapter[card]->channel[channel].next_sendbuf; - pr_debug("%s: Packet sent successfully\n", adapter[card]->devicename); + pr_debug("%s: packet sent successfully\n", adapter[card]->devicename); dev_kfree_skb(data); indicate_status(card,ISDN_STAT_BSENT,channel, (char *)&len); } @@ -114,7 +114,7 @@ void rcvpkt(int card, RspMessage *rcvmsg) struct sk_buff *skb; if(!IS_VALID_CARD(card)) { - pr_debug("Invalid param: %d is not a valid card id\n", card); + pr_debug("invalid param: %d is not a valid card id\n", card); return; } @@ -122,7 +122,7 @@ void rcvpkt(int card, RspMessage *rcvmsg) case 0x01: case 0x02: case 0x70: - pr_debug("%s: Error status code: 0x%x\n", adapter[card]->devicename, rcvmsg->rsp_status); + pr_debug("%s: error status code: 0x%x\n", adapter[card]->devicename, rcvmsg->rsp_status); return; case 0x00: if (!(skb = dev_alloc_skb(rcvmsg->msg_data.response.msg_len))) { @@ -144,7 +144,7 @@ void rcvpkt(int card, RspMessage *rcvmsg) /* * Recycle the buffer */ - pr_debug("%s: Buffer size : %d\n", adapter[card]->devicename, BUFFER_SIZE); + pr_debug("%s: buffer size : %d\n", adapter[card]->devicename, BUFFER_SIZE); /* memset_shmem(card, rcvmsg->msg_data.response.buff_offset, 0, BUFFER_SIZE); */ newll.buff_offset = rcvmsg->msg_data.response.buff_offset; newll.msg_len = BUFFER_SIZE; @@ -163,30 +163,30 @@ int setup_buffers(int card, int c) LLData RcvBuffOffset; if(!IS_VALID_CARD(card)) { - pr_debug("Invalid param: %d is not a valid card id\n", card); + pr_debug("invalid param: %d is not a valid card id\n", card); return -ENODEV; } /* * Calculate the buffer offsets (send/recv/send/recv) */ - pr_debug("%s: Seting up channel buffer space in shared RAM\n", adapter[card]->devicename); + pr_debug("%s: setting up channel buffer space in shared RAM\n", adapter[card]->devicename); buffer_size = BUFFER_SIZE; nBuffers = ((adapter[card]->ramsize - BUFFER_BASE) / buffer_size) / 2; nBuffers = nBuffers > BUFFERS_MAX ? BUFFERS_MAX : nBuffers; - pr_debug("%s: Calculating buffer space: %d buffers, %d big\n", adapter[card]->devicename, + pr_debug("%s: calculating buffer space: %d buffers, %d big\n", adapter[card]->devicename, nBuffers, buffer_size); if(nBuffers < 2) { - pr_debug("%s: Not enough buffer space\n", adapter[card]->devicename); + pr_debug("%s: not enough buffer space\n", adapter[card]->devicename); return -1; } cBase = (nBuffers * buffer_size) * (c - 1); - pr_debug("%s: Channel buffer offset from Shared RAM: 0x%x\n", adapter[card]->devicename, cBase); + pr_debug("%s: channel buffer offset from shared RAM: 0x%x\n", adapter[card]->devicename, cBase); adapter[card]->channel[c-1].first_sendbuf = BUFFER_BASE + cBase; adapter[card]->channel[c-1].num_sendbufs = nBuffers / 2; adapter[card]->channel[c-1].free_sendbufs = nBuffers / 2; adapter[card]->channel[c-1].next_sendbuf = 0; - pr_debug("%s: Send buffer setup complete: first=0x%x n=%d f=%d, nxt=%d\n", + pr_debug("%s: send buffer setup complete: first=0x%x n=%d f=%d, nxt=%d\n", adapter[card]->devicename, adapter[card]->channel[c-1].first_sendbuf, adapter[card]->channel[c-1].num_sendbufs, @@ -196,13 +196,13 @@ int setup_buffers(int card, int c) /* * Prep the receive buffers */ - pr_debug("%s: Adding %d RecvBuffers:\n", adapter[card]->devicename, nBuffers /2); + pr_debug("%s: adding %d RecvBuffers:\n", adapter[card]->devicename, nBuffers /2); for (i = 0 ; i < nBuffers / 2; i++) { RcvBuffOffset.buff_offset = ((adapter[card]->channel[c-1].first_sendbuf + (nBuffers / 2) * buffer_size) + (buffer_size * i)); RcvBuffOffset.msg_len = buffer_size; - pr_debug("%s: Adding RcvBuffer #%d offset=0x%x sz=%d buffsz:%d\n", + pr_debug("%s: adding RcvBuffer #%d offset=0x%x sz=%d bufsz:%d\n", adapter[card]->devicename, i + 1, RcvBuffOffset.buff_offset, RcvBuffOffset.msg_len,buffer_size); diff --git a/drivers/macintosh/macserial.c b/drivers/macintosh/macserial.c index ec62bd78e36e..576b9e2003c7 100644 --- a/drivers/macintosh/macserial.c +++ b/drivers/macintosh/macserial.c @@ -5,6 +5,8 @@ * * Copyright (C) 1996 Paul Mackerras (Paul.Mackerras@cs.anu.edu.au) * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) + * + * $Id: macserial.c,v 1.24.2.3 1999/09/10 02:05:58 paulus Exp $ */ #include @@ -2084,6 +2086,7 @@ int macserial_init(void) /* By default, disable the port */ set_scc_power(info, 0); } + tmp_buf = 0; return 0; } @@ -2109,6 +2112,16 @@ void cleanup_module(void) restore_flags(flags); tty_unregister_driver(&callout_driver); tty_unregister_driver(&serial_driver); + + if (tmp_buf) { + free_page((unsigned long) tmp_buf); + tmp_buf = 0; + } + +#ifdef CONFIG_PMAC_PBOOK + if (zs_channels_found) + pmu_unregister_sleep_notifier(&serial_sleep_notifier); +#endif /* CONFIG_PMAC_PBOOK */ } #endif /* MODULE */ @@ -2520,6 +2533,3 @@ serial_notify_sleep(struct pmu_sleep_notifier *self, int when) return PBOOK_SLEEP_OK; } #endif /* CONFIG_PMAC_PBOOK */ - - - diff --git a/drivers/net/defxx.c b/drivers/net/defxx.c index 3a3dd6af8e9d..4a5fbb8fcb00 100644 --- a/drivers/net/defxx.c +++ b/drivers/net/defxx.c @@ -3310,7 +3310,7 @@ int dfx_xmt_queue_pkt( * wide. */ - p_xmt_descr->long_0 = (u32) (PI_XMT_DESCR_M_SOP | PI_XMT_DESCR_M_EOP | ((skb->len + 3) << PI_XMT_DESCR_V_SEG_LEN)); + p_xmt_descr->long_0 = (u32) (PI_XMT_DESCR_M_SOP | PI_XMT_DESCR_M_EOP | ((skb->len) << PI_XMT_DESCR_V_SEG_LEN)); p_xmt_descr->long_1 = (u32) virt_to_bus(skb->data); /* diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c index 62be203af456..68e87ebd408b 100644 --- a/drivers/net/pcnet32.c +++ b/drivers/net/pcnet32.c @@ -587,6 +587,7 @@ pcnet32_probe1(struct device *dev, unsigned long ioaddr, unsigned char irq_line, case 0x2627: chipname = "PCnet/FAST III 79C975"; fdx = 1; mii = 1; + break; default: printk("pcnet32: PCnet version %#x, no PCnet32 chip.\n",chip_version); return ENODEV; diff --git a/drivers/scsi/qlogicisp.c b/drivers/scsi/qlogicisp.c index 6376734431fb..8744bb8ab1c6 100644 --- a/drivers/scsi/qlogicisp.c +++ b/drivers/scsi/qlogicisp.c @@ -636,7 +636,8 @@ int isp1020_detect(Scsi_Host_Template *tmpt) continue; } - if (check_region(host->io_port, 0xff)) { + if (host->io_port != 0UL && + check_region(host->io_port, 0xff)) { printk("qlogicisp : i/o region 0x%lx-0x%lx already " "in use\n", host->io_port, host->io_port + 0xff); @@ -1269,7 +1270,7 @@ static int isp1020_init(struct Scsi_Host *sh) hostdata->memaddr = mem_base; io_base = 0; } else { - if (command & PCI_COMMAND_IO && (io_base & 3) == 1) + if ((command & PCI_COMMAND_IO) && (io_base & 3) == 1) io_base &= PCI_BASE_ADDRESS_IO_MASK; else { printk("qlogicisp : i/o mapping is disabled\n"); diff --git a/drivers/sound/msnd.c b/drivers/sound/msnd.c index a3f73ededff3..05d4fbde08f7 100644 --- a/drivers/sound/msnd.c +++ b/drivers/sound/msnd.c @@ -20,7 +20,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: msnd.c,v 1.16 1998/09/08 04:05:56 andrewtv Exp $ + * $Id: msnd.c,v 1.17 1999/03/21 16:50:09 andrewtv Exp $ * ********************************************************************/ @@ -66,7 +66,7 @@ int msnd_register(multisound_dev_t *dev) if (i == MSND_MAX_DEVS) return -ENOMEM; - + devs[i] = dev; ++num_devs; @@ -106,13 +106,21 @@ multisound_dev_t *msnd_get_dev(int j) for (i = 0; i < MSND_MAX_DEVS && j; ++i) if (devs[i] != NULL) --j; - + if (i == MSND_MAX_DEVS || j != 0) return NULL; return devs[i]; } +void msnd_init_queue(volatile BYTE *base, int start, int size) +{ + writew(PCTODSP_BASED(start), base + JQS_wStart); + writew(PCTODSP_OFFSET(size) - 1, base + JQS_wSize); + writew(0, base + JQS_wHead); + writew(0, base + JQS_wTail); +} + void msnd_fifo_init(msnd_fifo *f) { f->data = NULL; @@ -152,11 +160,11 @@ int msnd_fifo_write(msnd_fifo *f, const char *buf, size_t len, int user) if (f->len == f->n) return 0; - + while ((count < len) && (f->len != f->n)) { - + int nwritten; - + if (f->head <= f->tail) { nwritten = len - count; if (nwritten > f->n - f->tail) @@ -180,7 +188,7 @@ int msnd_fifo_write(msnd_fifo *f, const char *buf, size_t len, int user) f->tail += nwritten; f->tail %= f->n; } - + return count; } @@ -190,11 +198,11 @@ int msnd_fifo_read(msnd_fifo *f, char *buf, size_t len, int user) if (f->len == 0) return f->len; - + while ((count < len) && (f->len > 0)) { - + int nread; - + if (f->tail <= f->head) { nread = len - count; if (nread > f->n - f->head) @@ -205,20 +213,20 @@ int msnd_fifo_read(msnd_fifo *f, char *buf, size_t len, int user) if (nread > len - count) nread = len - count; } - + if (user) { if (copy_to_user(buf, f->data + f->head, nread)) return -EFAULT; } else memcpy(buf, f->data + f->head, nread); - + count += nread; buf += nread; f->len -= nread; f->head += nread; f->head %= f->n; } - + return count; } @@ -259,7 +267,7 @@ int msnd_send_dsp_cmd(multisound_dev_t *dev, BYTE cmd) spin_unlock_irqrestore(&dev->lock, flags); printk(KERN_DEBUG LOGNAME ": Send DSP command timeout\n"); - + return -EIO; } @@ -307,7 +315,7 @@ int msnd_enable_irq(multisound_dev_t *dev) return 0; printk(KERN_DEBUG LOGNAME ": Enabling IRQ\n"); - + spin_lock_irqsave(&dev->lock, flags); if (msnd_wait_TXDE(dev) == 0) { outb(inb(dev->io + HP_ICR) | HPICR_TREQ, dev->io + HP_ICR); @@ -316,6 +324,7 @@ int msnd_enable_irq(multisound_dev_t *dev) outb(inb(dev->io + HP_ICR) & ~HPICR_TREQ, dev->io + HP_ICR); outb(inb(dev->io + HP_ICR) | HPICR_RREQ, dev->io + HP_ICR); enable_irq(dev->irq); + msnd_init_queue(dev->DSPQ, dev->dspq_data_buff, dev->dspq_buff_size); spin_unlock_irqrestore(&dev->lock, flags); return 0; } @@ -360,6 +369,8 @@ EXPORT_SYMBOL(msnd_unregister); EXPORT_SYMBOL(msnd_get_num_devs); EXPORT_SYMBOL(msnd_get_dev); +EXPORT_SYMBOL(msnd_init_queue); + EXPORT_SYMBOL(msnd_fifo_init); EXPORT_SYMBOL(msnd_fifo_free); EXPORT_SYMBOL(msnd_fifo_alloc); diff --git a/drivers/sound/msnd.h b/drivers/sound/msnd.h index ae7a952add15..57ae3b139b82 100644 --- a/drivers/sound/msnd.h +++ b/drivers/sound/msnd.h @@ -24,13 +24,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: msnd.h,v 1.33 1998/11/05 20:26:18 andrewtv Exp $ + * $Id: msnd.h,v 1.36 1999/03/21 17:05:42 andrewtv Exp $ * ********************************************************************/ #ifndef __MSND_H #define __MSND_H -#define VERSION "0.8.2.2" +#define VERSION "0.8.3.1" #define DEFSAMPLERATE DSP_DEFAULT_SPEED #define DEFSAMPLESIZE AFMT_U8 @@ -202,6 +202,7 @@ typedef struct multisound_dev { /* Linux device info */ char *name; int dsp_minor, mixer_minor; + int ext_midi_dev, hdr_midi_dev; /* Hardware resources */ int io, numio; @@ -214,6 +215,7 @@ typedef struct multisound_dev { volatile BYTE *SMA; volatile BYTE *DAPQ, *DARQ, *MODQ, *MIDQ, *DSPQ; volatile WORD *pwDSPQData, *pwMIDQData, *pwMODQData; + int dspq_data_buff, dspq_buff_size; /* State variables */ enum { msndClassic, msndPinnacle } type; @@ -229,7 +231,7 @@ typedef struct multisound_dev { #define F_READING 7 #define F_READBLOCK 8 #define F_EXT_MIDI_INUSE 9 -#define F_INT_MIDI_INUSE 10 +#define F_HDR_MIDI_INUSE 10 #define F_DISABLE_WRITE_NDELAY 11 struct wait_queue *writeblock, *readblock; struct wait_queue *writeflush; @@ -268,6 +270,8 @@ void msnd_unregister(multisound_dev_t *dev); int msnd_get_num_devs(void); multisound_dev_t * msnd_get_dev(int i); +void msnd_init_queue(volatile BYTE *base, int start, int size); + void msnd_fifo_init(msnd_fifo *f); void msnd_fifo_free(msnd_fifo *f); int msnd_fifo_alloc(msnd_fifo *f, size_t n); diff --git a/drivers/sound/msnd_classic.h b/drivers/sound/msnd_classic.h index 25898f8e0744..83c3c46ffffe 100644 --- a/drivers/sound/msnd_classic.h +++ b/drivers/sound/msnd_classic.h @@ -24,7 +24,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: msnd_classic.h,v 1.9 1998/09/10 04:11:18 andrewtv Exp $ + * $Id: msnd_classic.h,v 1.10 1999/03/21 17:36:09 andrewtv Exp $ * ********************************************************************/ #ifndef __MSND_CLASSIC_H @@ -108,13 +108,13 @@ #define MIDQ_OFFSET (SRAM_CNTL_START + 0x18) #define DSPQ_OFFSET (SRAM_CNTL_START + 0x20) -#define MOP_PROTEUS 0x10 +#define MOP_SYNTH 0x10 #define MOP_EXTOUT 0x32 #define MOP_EXTTHRU 0x02 #define MOP_OUTMASK 0x01 #define MIP_EXTIN 0x01 -#define MIP_PROTEUS 0x00 +#define MIP_SYNTH 0x00 #define MIP_INMASK 0x32 /* Classic SMA Common Data */ diff --git a/drivers/sound/msnd_pinnacle.c b/drivers/sound/msnd_pinnacle.c index 7bf7364ab9e7..c70d8d94d0ac 100644 --- a/drivers/sound/msnd_pinnacle.c +++ b/drivers/sound/msnd_pinnacle.c @@ -29,7 +29,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: msnd_pinnacle.c,v 1.73 1998/12/04 14:41:02 andrewtv Exp $ + * $Id: msnd_pinnacle.c,v 1.75 1999/03/21 16:50:09 andrewtv Exp $ * ********************************************************************/ @@ -254,7 +254,7 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) case SNDCTL_DSP_SYNC: dsp_write_flush(); return 0; - + case SNDCTL_DSP_GETBLKSIZE: tmp = dsp_get_frag_size(); if (put_user(tmp, (int *)arg)) @@ -352,7 +352,7 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) break; } } - + for (i = 0; i < 3; ++i, lpDAQ += DAQDS__size, lpDARQ += DAQDS__size) { if (file->f_mode & FMODE_WRITE) writew(data, lpDAQ + DAQDS_wChannels); @@ -570,7 +570,7 @@ static int mixer_ioctl(unsigned int cmd, unsigned long arg) return 0; } else if (((cmd >> 8) & 0xff) == 'M') { int val = 0; - + if (_SIOC_DIR(cmd) & _SIOC_WRITE) { switch (cmd & 0xff) { case SOUND_MIXER_RECSRC: @@ -578,7 +578,7 @@ static int mixer_ioctl(unsigned int cmd, unsigned long arg) return -EFAULT; val = set_recsrc(val); break; - + default: if (get_user(val, (int *)arg)) return -EFAULT; @@ -592,7 +592,7 @@ static int mixer_ioctl(unsigned int cmd, unsigned long arg) case SOUND_MIXER_RECSRC: val = dev.recsrc; break; - + case SOUND_MIXER_DEVMASK: case SOUND_MIXER_STEREODEVS: val = SOUND_MASK_PCM | @@ -620,7 +620,7 @@ static int mixer_ioctl(unsigned int cmd, unsigned long arg) case SOUND_MIXER_CAPS: val = SOUND_CAP_EXCL_INPUT; break; - + default: if ((val = mixer_get(cmd & 0xff)) < 0) return -EINVAL; @@ -787,7 +787,7 @@ static int dev_open(struct inode *inode, struct file *file) /* nothing */ } else err = -EINVAL; - + if (err >= 0) mod_inc_ref(); @@ -873,7 +873,7 @@ static __inline__ int pack_DAPF_to_DAPQ(register int start) register int bank_num = DAPQ_tail / PCTODSP_OFFSET(DAQDS__size); register int n; unsigned long flags; - + /* Write the data to the new tail */ if (protect) { /* Critical section: protect fifo in non-interrupt */ @@ -910,11 +910,11 @@ static __inline__ int pack_DAPF_to_DAPQ(register int start) /* Then advance the tail */ DAPQ_tail = (++bank_num % 3) * PCTODSP_OFFSET(DAQDS__size); writew(DAPQ_tail, dev.DAPQ + JQS_wTail); - + /* Tell the DSP to play the bank */ msnd_send_dsp_cmd(&dev, HDEX_PLAY_START); } - + return nbanks; } @@ -999,7 +999,7 @@ static int dsp_write(const char *buf, size_t len) return -EINTR; } } - + return len - count; } @@ -1147,7 +1147,7 @@ static struct file_operations dev_fileops = { static int reset_dsp(void) { int timeout = 100; - + outb(HPDSPRESET_ON, dev.io + HP_DSPR); mdelay(1); #ifndef MSND_CLASSIC @@ -1195,7 +1195,7 @@ __initfunc(static int probe_multisound(void)) case 0x3: xv = "1.4"; break; default: xv = "unknown"; break; } - + switch (dev.info & 0x7) { case 0x0: rev = "I"; dev.name = pin; break; case 0x1: rev = "F"; dev.name = pin; break; @@ -1221,16 +1221,8 @@ __initfunc(static int probe_multisound(void)) dev.base, dev.base + 0x7fff); release_region(dev.io, dev.numio); - - return 0; -} -static void msnd_init_queue(volatile BYTE *base, int start, int size) -{ - writew(PCTODSP_BASED(start), base + JQS_wStart); - writew(PCTODSP_OFFSET(size) - 1, base + JQS_wSize); - writew(0, base + JQS_wHead); - writew(0, base + JQS_wTail); + return 0; } static int init_sma(void) @@ -1388,7 +1380,7 @@ static int initialize(void) if ((err = reset_dsp()) < 0) return err; - + if ((err = upload_dsp_code()) < 0) { printk(KERN_WARNING LOGNAME ": Cannot upload DSP code\n"); return err; @@ -1467,12 +1459,14 @@ __initfunc(static int attach_multisound(void)) return dev.mixer_minor; } + dev.ext_midi_dev = dev.hdr_midi_dev = -1; + disable_irq(dev.irq); calibrate_adc(dev.play_sample_rate); #ifndef MSND_CLASSIC force_recsrc(SOUND_MASK_IMIX); #endif - + return 0; } @@ -1598,7 +1592,7 @@ __initfunc(static int msnd_pinnacle_cfg_devices(int cfg, int reset, msnd_pinnacl /* Configure specified devices */ for (i = 0; i < 4; ++i) { - + switch (i) { case 0: /* DSP */ if (!(device[i].io0 && device[i].irq && device[i].mem)) @@ -1781,7 +1775,7 @@ __initfunc(int msnd_pinnacle_init(void)) printk(KERN_INFO LOGNAME ": Turtle Beach " LONGNAME " Linux Driver Version " VERSION ", Copyright (C) 1998 Andrew Veliath\n"); - + if (io == -1 || irq == -1 || mem == -1) printk(KERN_WARNING LOGNAME ": io, irq and mem must be set\n"); @@ -1797,7 +1791,7 @@ __initfunc(int msnd_pinnacle_init(void)) printk(KERN_ERR LOGNAME ": \"io\" - DSP I/O base must be set to 0x210, 0x220, 0x230, 0x240, 0x250, 0x260, 0x290, or 0x3E0\n"); return -EINVAL; } - + if (irq == -1 || !(irq == 5 || irq == 7 || @@ -1854,7 +1848,7 @@ __initfunc(int msnd_pinnacle_init(void)) pinnacle_devs[0].mem = mem; /* The following are Pinnacle specific */ - + /* MPU */ pinnacle_devs[1].io0 = mpu_io; pinnacle_devs[1].irq = mpu_irq; @@ -1901,6 +1895,8 @@ __initfunc(int msnd_pinnacle_init(void)) dev.fifosize = fifosize * 1024; dev.calibrate_signal = calibrate_signal ? 1 : 0; dev.recsrc = 0; + dev.dspq_data_buff = DSPQ_DATA_BUFF; + dev.dspq_buff_size = DSPQ_BUFF_SIZE; dev.inc_ref = mod_inc_ref; dev.dec_ref = mod_dec_ref; if (write_ndelay == -1) @@ -1939,7 +1935,7 @@ __initfunc(int msnd_pinnacle_init(void)) msnd_fifo_free(&dev.DARF); return err; } - + if ((err = attach_multisound()) < 0) { printk(KERN_ERR LOGNAME ": Attach failed\n"); msnd_fifo_free(&dev.DAPF); diff --git a/drivers/sound/msnd_pinnacle.h b/drivers/sound/msnd_pinnacle.h index 2f572af2c723..e85aef4a55e0 100644 --- a/drivers/sound/msnd_pinnacle.h +++ b/drivers/sound/msnd_pinnacle.h @@ -24,7 +24,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: msnd_pinnacle.h,v 1.10 1998/09/10 04:11:18 andrewtv Exp $ + * $Id: msnd_pinnacle.h,v 1.11 1999/03/21 17:36:09 andrewtv Exp $ * ********************************************************************/ #ifndef __MSND_PINNACLE_H @@ -141,18 +141,16 @@ #define MIDQ_OFFSET (SRAM_CNTL_START + 0x18) #define DSPQ_OFFSET (SRAM_CNTL_START + 0x20) -#define WAVEHDR_MOP 0 -#define EXTOUT_MOP 1 -#define HWINIT_MOP 0xFE -#define NO_MOP 0xFF +#define MOP_WAVEHDR 0 +#define MOP_EXTOUT 1 +#define MOP_HWINIT 0xfe +#define MOP_NONE 0xff +#define MOP_MAX 1 -#define MAX_MOP 1 - -#define EXTIN_MIP 0 -#define WAVEHDR_MIP 1 -#define HWINIT_MIP 0xFE - -#define MAX_MIP 1 +#define MIP_EXTIN 0 +#define MIP_WAVEHDR 1 +#define MIP_HWINIT 0xfe +#define MIP_MAX 1 /* Pinnacle/Fiji SMA Common Data */ #define SMA_wCurrPlayBytes 0x0000 diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index dcff980ffc8f..3211c4e8f77a 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -191,13 +191,13 @@ create_elf_tables(char *p, int argc, int envc, current->mm->arg_start = (unsigned long) p; while (argc-->0) { __put_user((elf_caddr_t)(unsigned long)p,argv++); - p += strnlen_user(p, 65536); + p += strlen_user(p); } __put_user(NULL, argv); current->mm->arg_end = current->mm->env_start = (unsigned long) p; while (envc-->0) { __put_user((elf_caddr_t)(unsigned long)p,envp++); - p += strnlen_user(p, 65536); + p += strlen_user(p); } __put_user(NULL, envp); current->mm->env_end = (unsigned long) p; diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c index 6a7fb92f7329..ecef4a91b9db 100644 --- a/fs/ext2/namei.c +++ b/fs/ext2/namei.c @@ -882,6 +882,13 @@ int ext2_rename (struct inode * old_dir, struct dentry *old_dentry, } new_dir->i_version = ++event; + /* + * Like most other Unix systems, set the ctime for inodes on a + * rename. + */ + old_inode->i_ctime = CURRENT_TIME; + mark_inode_dirty(old_inode); + /* * ok, that's it */ diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index fd7a5b227a63..aca7e982c3dd 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c @@ -284,7 +284,7 @@ void nfsd_modcount(struct inode *inode, int fill) int init_module(void) { - printk("Installing knfsd (copyright (C) 1996 okir@monad.swb.de).\n"); + printk(KERN_INFO "Installing knfsd (copyright (C) 1996 okir@monad.swb.de).\n"); do_nfsservctl = handle_sys_nfsservctl; return 0; } diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index 6f6b4a733023..97d61a4a6d75 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c @@ -4,6 +4,7 @@ * NFS server file handle treatment. * * Copyright (C) 1995, 1996 Olaf Kirch + * Portions Copyright (C) 1999 G. Allen Morris III */ #include @@ -1192,6 +1193,7 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry) fhp->fh_handle.fh_dcookie = dentry; if (inode) { fhp->fh_handle.fh_ino = ino_t_to_u32(inode->i_ino); + fhp->fh_handle.fh_generation = inode->i_generation; } fhp->fh_handle.fh_dirino = ino_t_to_u32(parent->d_inode->i_ino); fhp->fh_handle.fh_dev = kdev_t_to_u32(parent->d_inode->i_dev); @@ -1223,6 +1225,7 @@ fh_update(struct svc_fh *fhp) if (!inode) goto out_negative; fhp->fh_handle.fh_ino = ino_t_to_u32(inode->i_ino); + fhp->fh_handle.fh_generation = inode->i_generation; out: return; diff --git a/fs/proc/array.c b/fs/proc/array.c index d02cea19e59c..d28ee317e521 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -899,9 +899,10 @@ static int get_stat(int pid, char * buffer) read_lock(&tasklist_lock); tsk = find_task_by_pid(pid); - read_unlock(&tasklist_lock); /* FIXME!! This should be done after the last use */ - if (!tsk) + if (!tsk) { + read_unlock(&tasklist_lock); return 0; + } state = *get_task_state(tsk); vsize = eip = esp = 0; if (tsk->mm && tsk->mm != &init_mm) { @@ -910,9 +911,14 @@ static int get_stat(int pid, char * buffer) vsize += vma->vm_end - vma->vm_start; vma = vma->vm_next; } - eip = KSTK_EIP(tsk); - esp = KSTK_ESP(tsk); + if ((current->fsuid == tsk->euid && tsk->dumpable && + cap_issubset(tsk->cap_permitted, current->cap_permitted)) || + capable(CAP_DAC_OVERRIDE)) { + eip = KSTK_EIP(tsk); + esp = KSTK_ESP(tsk); + } } + read_unlock(&tasklist_lock); /* FIXME!! This should be done after the last use */ wchan = get_wchan(tsk); diff --git a/include/asm-ppc/md.h b/include/asm-ppc/md.h new file mode 100644 index 000000000000..318dfa6198ba --- /dev/null +++ b/include/asm-ppc/md.h @@ -0,0 +1,13 @@ +/* $Id: md.h,v 1.1.4.1 1999/08/13 18:30:41 davem dead $ + * md.h: High speed xor_block operation for RAID4/5 + * + */ + +#ifndef __ASM_MD_H +#define __ASM_MD_H + +/* #define HAVE_ARCH_XORBLOCK */ + +#define MD_XORBLOCK_ALIGNMENT sizeof(long) + +#endif /* __ASM_MD_H */ diff --git a/include/asm-ppc/spinlock.h b/include/asm-ppc/spinlock.h index 1b4fdb3640d6..6e190f35e8b6 100644 --- a/include/asm-ppc/spinlock.h +++ b/include/asm-ppc/spinlock.h @@ -17,15 +17,15 @@ #endif #define spin_lock_init(lock) do { } while(0) -#define spin_lock(lock) do { } while(0) +#define spin_lock(lock) (void)(lock) /* avoid unused vble warning */ #define spin_trylock(lock) (1) #define spin_unlock_wait(lock) do { } while(0) #define spin_unlock(lock) do { } while(0) -#define spin_lock_irq(lock) cli() +#define spin_lock_irq(lock) do { cli(); (void)(lock); } while (0) #define spin_unlock_irq(lock) sti() #define spin_lock_irqsave(lock, flags) \ - do { save_flags(flags); cli(); } while (0) + do { save_flags(flags); cli(); (void)(lock); } while (0) #define spin_unlock_irqrestore(lock, flags) \ restore_flags(flags) @@ -49,21 +49,21 @@ #define RW_LOCK_UNLOCKED (rwlock_t) { 0 } #endif -#define read_lock(lock) do { } while(0) +#define read_lock(lock) (void)(lock) #define read_unlock(lock) do { } while(0) -#define write_lock(lock) do { } while(0) +#define write_lock(lock) (void)(lock) #define write_unlock(lock) do { } while(0) -#define read_lock_irq(lock) cli() +#define read_lock_irq(lock) do { cli(); (void)(lock); } while (0) #define read_unlock_irq(lock) sti() -#define write_lock_irq(lock) cli() +#define write_lock_irq(lock) do { cli(); (void)(lock); } while (0) #define write_unlock_irq(lock) sti() #define read_lock_irqsave(lock, flags) \ - do { save_flags(flags); cli(); } while (0) + do { save_flags(flags); cli(); (void)(lock); } while (0) #define read_unlock_irqrestore(lock, flags) \ restore_flags(flags) #define write_lock_irqsave(lock, flags) \ - do { save_flags(flags); cli(); } while (0) + do { save_flags(flags); cli(); (void)(lock); } while (0) #define write_unlock_irqrestore(lock, flags) \ restore_flags(flags) diff --git a/include/asm-ppc/uaccess.h b/include/asm-ppc/uaccess.h index 59956966a526..fd77878bf8a7 100644 --- a/include/asm-ppc/uaccess.h +++ b/include/asm-ppc/uaccess.h @@ -259,7 +259,24 @@ strncpy_from_user(char *dst, const char *src, long count) * Return 0 for error */ -extern long strlen_user(const char *); +extern int __strnlen_user(const char *str, long len, unsigned long top); + +/* + * Returns the length of the string at str (including the null byte), + * or 0 if we hit a page we can't access, + * or something > len if we didn't find a null byte. + * + * The `top' parameter to __strnlen_user is to make sure that + * we can never overflow from the user area into kernel space. + * It is 1 + the highest address the task can access. + */ +extern __inline__ int strnlen_user(const char *str, long len) +{ + unsigned long top = __kernel_ok? 0: TASK_SIZE; + return __strnlen_user(str, len, top); +} + +#define strlen_user(str) strnlen_user((str), 0x7ffffffe) #endif /* __ASSEMBLY__ */ diff --git a/include/linux/concap.h b/include/linux/concap.h index 05f74d820c89..b8e72dc62315 100644 --- a/include/linux/concap.h +++ b/include/linux/concap.h @@ -1,4 +1,4 @@ -/* $Id: concap.h,v 1.1 1998/02/01 00:15:11 keil Exp $ +/* $Id: concap.h,v 1.2 1999/08/23 15:54:21 keil Exp $ */ #ifndef _LINUX_CONCAP_H #define _LINUX_CONCAP_H @@ -25,11 +25,11 @@ struct concap_device_ops; /* this manages all data needed by the encapsulation protocol */ struct concap_proto{ - struct device *net_dev; /* net device using our service */ - struct concap_device_ops *dops; /* callbacks provided by device */ - struct concap_proto_ops *pops; /* callbacks provided by us */ + struct device *net_dev; /* net device using our service */ + struct concap_device_ops *dops; /* callbacks provided by device */ + struct concap_proto_ops *pops; /* callbacks provided by us */ int flags; - void *proto_data; /* protocol specific private data, to + void *proto_data; /* protocol specific private data, to be accessed via *pops methods only*/ /* : @@ -107,7 +107,3 @@ extern int concap_nop(struct concap_proto *cprot); extern int concap_drop_skb(struct concap_proto *cprot, struct sk_buff *skb); #endif #endif - - - - diff --git a/include/linux/isdn.h b/include/linux/isdn.h index 853f236f6fef..acb653d6cc13 100644 --- a/include/linux/isdn.h +++ b/include/linux/isdn.h @@ -1,8 +1,8 @@ -/* $Id: isdn.h,v 1.70 1999/07/31 12:59:58 armin Exp $ +/* $Id: isdn.h,v 1.76 1999/09/14 10:16:21 keil Exp $ * * Main header for the Linux ISDN subsystem (linklevel). * - * Copyright 1994,95,96 by Fritz Elfert (fritz@wuemaus.franken.de) + * Copyright 1994,95,96 by Fritz Elfert (fritz@isdn4linux.de) * Copyright 1995,96 by Thinking Objects Software GmbH Wuerzburg * Copyright 1995,96 by Michael Hipp (Michael.Hipp@student.uni-tuebingen.de) * @@ -21,6 +21,29 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: isdn.h,v $ + * Revision 1.76 1999/09/14 10:16:21 keil + * change ABC include + * + * Revision 1.75 1999/09/13 23:25:17 he + * serialized xmitting frames from isdn_ppp and BSENT statcallb + * + * Revision 1.74 1999/09/12 16:19:39 detabc + * added abc features + * low cost routing for net-interfaces (only the HL side). + * need more implementation in the isdnlog-utility + * udp info support (first part). + * different EAZ on outgoing call's. + * more checks on D-Channel callbacks (double use of channels). + * tested and running with kernel 2.3.17 + * + * Revision 1.73 1999/09/06 07:29:36 fritz + * Changed my mail-address. + * + * Revision 1.72 1999/09/04 22:20:19 detabc + * + * Revision 1.71 1999/08/23 15:54:22 keil + * more backported changes from kernel 2.3.14 + * * Revision 1.70 1999/07/31 12:59:58 armin * Added tty fax capabilities. * @@ -247,7 +270,6 @@ #ifndef isdn_h #define isdn_h -#include #include #include @@ -276,6 +298,14 @@ #define ISDN_MINOR_PPPMAX (128 + (ISDN_MAX_CHANNELS-1)) #define ISDN_MINOR_STATUS 255 +#undef CONFIG_ISDN_WITH_ABC_CALLB +#undef CONFIG_ISDN_WITH_ABC_UDP_CHECK +#undef CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP +#undef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ +#undef CONFIG_ISDN_WITH_ABC_CALL_CHECK_SYNCRO +#undef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT + + /* New ioctl-codes */ #define IIOCNETAIF _IO('I',1) #define IIOCNETDIF _IO('I',2) @@ -299,6 +329,7 @@ #define IIOCNETDIL _IO('I',20) #define IIOCGETCPS _IO('I',21) #define IIOCGETDVR _IO('I',22) +#define IIOCNETLCR _IO('I',23) /* dwabc ioctl for LCR from isdnlog */ #define IIOCNETALN _IO('I',32) #define IIOCNETDLN _IO('I',33) @@ -393,9 +424,6 @@ typedef struct { #ifdef __KERNEL__ -#ifndef STANDALONE -#include -#endif #include #include #include @@ -438,7 +466,6 @@ typedef struct { #include - #define ISDN_DRVIOCTL_MASK 0x7f /* Mask for Device-ioctl */ /* Until now unused */ @@ -504,12 +531,6 @@ typedef struct { #define ISDN_NET_CALLBACK 0x04 /* activate callback */ #define ISDN_NET_CBHUP 0x08 /* hangup before callback */ #define ISDN_NET_CBOUT 0x10 /* remote machine does callback */ -#if 0 -/* Unused??? */ -#define ISDN_NET_CLONE 0x08 /* clone a tmp interface when called */ -#define ISDN_NET_TMP 0x10 /* tmp interface until getting an IP */ -#define ISDN_NET_DYNAMIC 0x20 /* this link is dynamically allocated */ -#endif #define ISDN_NET_MAGIC 0x49344C02 /* for paranoia-checking */ @@ -580,18 +601,18 @@ typedef struct isdn_net_local_s { ulong sqfull_stamp; /* Start-Time of overload */ ulong slavedelay; /* Dynamic bundling delaytime */ int triggercps; /* BogoCPS needed for trigger slave */ - struct device *srobin; /* Ptr to Master device for slaves */ + struct device *srobin; /* Ptr to Master device for slaves */ isdn_net_phone *phone[2]; /* List of remote-phonenumbers */ /* phone[0] = Incoming Numbers */ /* phone[1] = Outgoing Numbers */ isdn_net_phone *dial; /* Pointer to dialed number */ - struct device *master; /* Ptr to Master device for slaves */ - struct device *slave; /* Ptr to Slave device for masters */ + struct device *master; /* Ptr to Master device for slaves */ + struct device *slave; /* Ptr to Slave device for masters */ struct isdn_net_local_s *next; /* Ptr to next link in bundle */ struct isdn_net_local_s *last; /* Ptr to last link in bundle */ struct isdn_net_dev_s *netdev; /* Ptr to netdev */ struct sk_buff *first_skb; /* Ptr to skb that triggers dialing */ - struct sk_buff *sav_skb; /* Ptr to skb, rejected by LL-driver*/ + struct sk_buff *volatile sav_skb; /* Ptr to skb, rejected by LL-driver*/ /* Ptr to orig. hard_header_cache */ int (*org_hhc)( struct neighbour *neigh, @@ -619,7 +640,7 @@ typedef struct isdn_net_dev_s { isdn_net_local *local; isdn_net_local *queue; void *next; /* Pointer to next isdn-interface */ - struct device dev; /* interface to upper levels */ + struct device dev; /* interface to upper levels */ #ifdef CONFIG_ISDN_PPP struct mpqueue *mp_last; struct ippp_bundle ib; @@ -743,12 +764,8 @@ typedef struct modem_info { atemu emu; /* AT-emulator data */ struct termios normal_termios; /* For saving termios structs */ struct termios callout_termios; -#ifdef COMPAT_HAS_NEW_WAITQ - wait_queue_head_t open_wait, close_wait; -#else struct wait_queue *open_wait; struct wait_queue *close_wait; -#endif struct semaphore write_sem; } modem_info; @@ -826,11 +843,7 @@ typedef struct { ulong flags; /* Misc driver Flags */ int locks; /* Number of locks for this driver */ int channels; /* Number of channels */ -#ifdef COMPAT_HAS_NEW_WAITQ - wait_queue_head_t st_waitq; /* Wait-Queue for status-read's */ -#else struct wait_queue *st_waitq; /* Wait-Queue for status-read's */ -#endif int maxbufsize; /* Maximum Buffersize supported */ unsigned long pktcount; /* Until now: unused */ int stavail; /* Chars avail on Status-device */ @@ -841,13 +854,8 @@ typedef struct { unsigned long DLEflag; /* Flags: Insert DLE at next read */ #endif struct sk_buff_head *rpqueue; /* Pointers to start of Rcv-Queue */ -#ifdef COMPAT_HAS_NEW_WAITQ - wait_queue_head_t *rcv_waitq; /* Wait-Queues for B-Channel-Reads */ - wait_queue_head_t *snd_waitq; /* Wait-Queue for B-Channel-Send's */ -#else struct wait_queue **rcv_waitq; /* Wait-Queues for B-Channel-Reads */ struct wait_queue **snd_waitq; /* Wait-Queue for B-Channel-Send's */ -#endif char msn2eaz[10][ISDN_MSNLEN]; /* Mapping-Table MSN->EAZ */ } driver; @@ -863,11 +871,7 @@ typedef struct isdn_devt { /* see ISDN_TIMER_..defines */ int global_flags; infostruct *infochain; /* List of open info-devs. */ -#ifdef COMPAT_HAS_NEW_WAITQ - wait_queue_head_t info_waitq; /* Wait-Queue for isdninfo */ -#else struct wait_queue *info_waitq; /* Wait-Queue for isdninfo */ -#endif struct timer_list timer; /* Misc.-function Timer */ int chanmap[ISDN_MAX_CHANNELS];/* Map minor->device-channel */ int drvmap[ISDN_MAX_CHANNELS]; /* Map minor->driver-index */ diff --git a/include/linux/isdn_compat.h b/include/linux/isdn_compat.h deleted file mode 100644 index db002c415319..000000000000 --- a/include/linux/isdn_compat.h +++ /dev/null @@ -1,108 +0,0 @@ -#ifdef __KERNEL__ -/* Compatibility for various Linux kernel versions */ - -#ifndef _LINUX_ISDN_COMPAT_H -#define _LINUX_ISDN_COMPAT_H - -#ifndef LINUX_VERSION_CODE -#include -#endif - -#ifndef KERNEL_VERSION -#define KERNEL_VERSION(x,y,z) (((x)<<16)+((y)<<8)+(z)) -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0) -#include - -#define ioremap vremap -#define ioremap_nocache vremap -#define iounmap vfree - -static inline unsigned long copy_from_user(void *to, const void *from, unsigned long n) -{ - int i; - if ((i = verify_area(VERIFY_READ, from, n)) != 0) - return i; - memcpy_fromfs(to, from, n); - return 0; -} - -static inline unsigned long copy_to_user(void *to, const void *from, unsigned long n) -{ - int i; - if ((i = verify_area(VERIFY_WRITE, to, n)) != 0) - return i; - memcpy_tofs(to, from, n); - return 0; -} - -#define GET_USER(x, addr) ( x = get_user(addr) ) -#ifdef __alpha__ /* needed for 2.0.x with alpha-patches */ -#define RWTYPE long -#define LSTYPE long -#define RWARG unsigned long -#else -#define RWTYPE int -#define LSTYPE int -#define RWARG int -#endif -#define LSARG off_t -#else -#include -#define GET_USER get_user -#define PUT_USER put_user -#define RWTYPE long -#define LSTYPE long long -#define RWARG unsigned long -#define LSARG long long -#endif /* LINUX_VERSION_CODE */ - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,15) -#define SET_SKB_FREE(x) ( x->free = 1 ) -#define idev_kfree_skb(a,b) dev_kfree_skb(a,b) -#else -#define SET_SKB_FREE(x) -#define idev_kfree_skb(a,b) dev_kfree_skb(a) -#endif - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,18) -#define COMPAT_HAS_NEW_SYMTAB -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,31) -#define CLOSETYPE void -#define CLOSEVAL -#else -#define CLOSETYPE int -#define CLOSEVAL (0) -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,37) -#define test_and_clear_bit clear_bit -#define test_and_set_bit set_bit -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,81) -#define kstat_irqs( PAR ) kstat.interrupts[PAR] -#endif - -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,91) -#define COMPAT_HAS_NEW_PCI -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,13) -#define get_pcibase(ps, nr) ps->base_address[nr] -#else -#define get_pcibase(ps, nr) ps->resource[nr].start -#endif -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,127) -#define schedule_timeout(a) current->timeout = jiffies + (a); schedule (); -#endif - -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,0) -#define COMPAT_HAS_NEW_WAITQ -#endif - -#endif /* __KERNEL__ */ -#endif /* _LINUX_ISDN_COMPAT_H */ diff --git a/include/linux/isdn_ppp.h b/include/linux/isdn_ppp.h index a62101d0f778..06d71797c538 100644 --- a/include/linux/isdn_ppp.h +++ b/include/linux/isdn_ppp.h @@ -3,7 +3,7 @@ #ifndef _LINUX_ISDN_PPP_H #define _LINUX_ISDN_PPP_H -#include +#include #define CALLTYPE_INCOMING 0x1 #define CALLTYPE_OUTGOING 0x2 @@ -206,11 +206,7 @@ struct ippp_struct { struct ippp_buf_queue rq[NUM_RCV_BUFFS]; /* packet queue for isdn_ppp_read() */ struct ippp_buf_queue *first; /* pointer to (current) first packet */ struct ippp_buf_queue *last; /* pointer to (current) last used packet in queue */ -#ifdef COMPAT_HAS_NEW_WAITQ - wait_queue_head_t wq; -#else struct wait_queue *wq; -#endif struct task_struct *tk; unsigned int mpppcfg; unsigned int pppcfg; diff --git a/include/linux/isdnif.h b/include/linux/isdnif.h index aeb177ab3956..6d63986033ca 100644 --- a/include/linux/isdnif.h +++ b/include/linux/isdnif.h @@ -1,10 +1,10 @@ -/* $Id: isdnif.h,v 1.29 1999/07/31 13:00:02 armin Exp $ +/* $Id: isdnif.h,v 1.31 1999/09/06 07:29:36 fritz Exp $ * * Linux ISDN subsystem * * Definition of the interface between the subsystem and its low-level drivers. * - * Copyright 1994,95,96 by Fritz Elfert (fritz@wuemaus.franken.de) + * Copyright 1994,95,96 by Fritz Elfert (fritz@isdn4linux.de) * Copyright 1995,96 Thinking Objects Software GmbH Wuerzburg * * This program is free software; you can redistribute it and/or modify @@ -22,6 +22,12 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: isdnif.h,v $ + * Revision 1.31 1999/09/06 07:29:36 fritz + * Changed my mail-address. + * + * Revision 1.30 1999/08/23 15:54:29 keil + * more backported changes from kernel 2.3.14 + * * Revision 1.29 1999/07/31 13:00:02 armin * Added tty fax capabilities. * @@ -134,7 +140,7 @@ #ifndef isdnif_h #define isdnif_h -#include +#include /* * Values for general protocol-selection diff --git a/include/linux/kernelcapi.h b/include/linux/kernelcapi.h index 7b212be05955..5778d2ebb97f 100644 --- a/include/linux/kernelcapi.h +++ b/include/linux/kernelcapi.h @@ -1,11 +1,15 @@ /* - * $Id: kernelcapi.h,v 1.3 1999/07/01 15:26:56 calle Exp $ + * $Id: kernelcapi.h,v 1.4 1999/09/10 17:24:19 calle Exp $ * * Kernel CAPI 2.0 Interface for Linux * * (c) Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: kernelcapi.h,v $ + * Revision 1.4 1999/09/10 17:24:19 calle + * Changes for proposed standard for CAPI2.0: + * - AK148 "Linux Exention" + * * Revision 1.3 1999/07/01 15:26:56 calle * complete new version (I love it): * + new hardware independed "capi_driver" interface that will make it easy to: @@ -70,19 +74,19 @@ typedef struct kcapi_flagdef { #ifdef __KERNEL__ struct capi_interface { - int (*capi_installed) (void); + __u16 (*capi_isinstalled) (void); - __u16(*capi_register) (capi_register_params * rparam, __u16 * applidp); - __u16(*capi_release) (__u16 applid); - __u16(*capi_put_message) (__u16 applid, struct sk_buff * msg); - __u16(*capi_get_message) (__u16 applid, struct sk_buff ** msgp); - __u16(*capi_set_signal) (__u16 applid, + __u16 (*capi_register) (capi_register_params * rparam, __u16 * applidp); + __u16 (*capi_release) (__u16 applid); + __u16 (*capi_put_message) (__u16 applid, struct sk_buff * msg); + __u16 (*capi_get_message) (__u16 applid, struct sk_buff ** msgp); + __u16 (*capi_set_signal) (__u16 applid, void (*signal) (__u16 applid, __u32 param), __u32 param); - __u16(*capi_get_manufacturer) (__u16 contr, __u8 buf[CAPI_MANUFACTURER_LEN]); - __u16(*capi_get_version) (__u16 contr, struct capi_version * verp); - __u16(*capi_get_serial) (__u16 contr, __u8 serial[CAPI_SERIAL_LEN]); - __u16(*capi_get_profile) (__u16 contr, struct capi_profile * profp); + __u16 (*capi_get_manufacturer) (__u32 contr, __u8 buf[CAPI_MANUFACTURER_LEN]); + __u16 (*capi_get_version) (__u32 contr, struct capi_version * verp); + __u16(*capi_get_serial) (__u32 contr, __u8 serial[CAPI_SERIAL_LEN]); + __u16(*capi_get_profile) (__u32 contr, struct capi_profile * profp); /* * to init controllers, data is always in user memory @@ -96,7 +100,7 @@ struct capi_interface { struct capi_interface_user { char name[20]; - void (*callback) (unsigned int cmd, __u16 contr, void *data); + void (*callback) (unsigned int cmd, __u32 contr, void *data); /* internal */ struct capi_interface_user *next; }; diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h index dc16282e1724..a0ba9587f4c2 100644 --- a/include/linux/nfsd/nfsfh.h +++ b/include/linux/nfsd/nfsfh.h @@ -8,7 +8,7 @@ * or SHA. I've removed this code, because it doesn't give you more * security than blocking external access to port 2049 on your firewall. * - * Copyright (C) 1995, 1996, 1997 Olaf Kirch + * Copyright (C) 1995-1999 Olaf Kirch */ #ifndef NFSD_FH_H @@ -33,6 +33,7 @@ struct nfs_fhbase { __u32 fb_dev; /* our device */ __u32 fb_xdev; __u32 fb_xino; + __u32 fb_generation; }; #define NFS_FH_PADDING (NFS_FHSIZE - sizeof(struct nfs_fhbase)) @@ -47,6 +48,7 @@ struct knfs_fh { #define fh_dev fh_base.fb_dev #define fh_xdev fh_base.fb_xdev #define fh_xino fh_base.fb_xino +#define fh_generation fh_base.fb_generation #ifdef __KERNEL__ @@ -180,34 +182,6 @@ fh_unlock(struct svc_fh *fhp) } } -/* - * Release an inode - */ -#if 0 -#define fh_put(fhp) __fh_put(fhp, __FILE__, __LINE__) - -static inline void -__fh_put(struct svc_fh *fhp, char *file, int line) -{ - struct dentry *dentry; - - if (!fhp->fh_dverified) - return; - - dentry = fhp->fh_dentry; - if (!dentry->d_count) { - printk("nfsd: trying to free free dentry in %s:%d\n" - " file %s/%s\n", - file, line, - dentry->d_parent->d_name.name, dentry->d_name.name); - } else { - fh_unlock(fhp); - fhp->fh_dverified = 0; - dput(dentry); - } -} -#endif - #endif /* __KERNEL__ */ #endif /* NFSD_FH_H */ diff --git a/include/linux/sem.h b/include/linux/sem.h index 3fb2a48f6822..13c9a8acc6f4 100644 --- a/include/linux/sem.h +++ b/include/linux/sem.h @@ -61,7 +61,7 @@ struct seminfo { }; #define SEMMNI 128 /* ? max # of semaphore identifiers */ -#define SEMMSL 32 /* <= 512 max num of semaphores per id */ +#define SEMMSL 250 /* <= 512 max num of semaphores per id */ #define SEMMNS (SEMMNI*SEMMSL) /* ? max # of semaphores in system */ #define SEMOPM 32 /* ~ 100 max num of ops per semop call */ #define SEMVMX 32767 /* semaphore maximum value */ diff --git a/include/linux/synclink.h b/include/linux/synclink.h index 70ce90e103a9..450341b74628 100644 --- a/include/linux/synclink.h +++ b/include/linux/synclink.h @@ -1,7 +1,7 @@ /* * SyncLink Multiprotocol Serial Adapter Driver * - * ==FILEDATE 19990523== + * ==FILEDATE 19990810== * * Copyright (C) 1998 by Microgate Corporation * @@ -50,8 +50,9 @@ #define BIT31 0x80000000 -#define HDLC_MAX_FRAME_SIZE 4096 +#define HDLC_MAX_FRAME_SIZE 65535 #define MAX_ASYNC_TRANSMIT 4096 +#define MAX_ASYNC_BUFFER_SIZE 4096 #define ASYNC_PARITY_NONE 0 #define ASYNC_PARITY_EVEN 1 @@ -68,12 +69,12 @@ #define HDLC_FLAG_AUTO_RTS 0x0080 #define HDLC_FLAG_RXC_DPLL 0x0100 #define HDLC_FLAG_RXC_BRG 0x0200 -#define HDLC_FLAG_RXC_TXCPIN 0x8000 -#define HDLC_FLAG_RXC_RXCPIN 0x0000 +#define HDLC_FLAG_RXC_TXCPIN 0x8000 +#define HDLC_FLAG_RXC_RXCPIN 0x0000 #define HDLC_FLAG_TXC_DPLL 0x0400 #define HDLC_FLAG_TXC_BRG 0x0800 -#define HDLC_FLAG_TXC_TXCPIN 0x0000 -#define HDLC_FLAG_TXC_RXCPIN 0x0008 +#define HDLC_FLAG_TXC_TXCPIN 0x0000 +#define HDLC_FLAG_TXC_RXCPIN 0x0008 #define HDLC_FLAG_DPLL_DIV8 0x1000 #define HDLC_FLAG_DPLL_DIV16 0x2000 #define HDLC_FLAG_DPLL_DIV32 0x0000 @@ -81,6 +82,7 @@ #define HDLC_CRC_NONE 0 #define HDLC_CRC_16_CCITT 1 +#define HDLC_CRC_32_CCITT 2 #define HDLC_TXIDLE_FLAGS 0 #define HDLC_TXIDLE_ALT_ZEROS_ONES 1 @@ -132,7 +134,7 @@ typedef struct _MGSL_PARAMS unsigned char encoding; /* NRZ, NRZI, etc. */ unsigned long clock_speed; /* external clock speed in bits per second */ unsigned char addr_filter; /* receive HDLC address filter, 0xFF = disable */ - unsigned short crc_type; /* None, CRC16 or CRC16-CCITT */ + unsigned short crc_type; /* None, CRC16-CCITT, or CRC32-CCITT */ unsigned char preamble_length; unsigned char preamble; diff --git a/include/linux/tty.h b/include/linux/tty.h index 55aabe43dfea..ddeb2d9bb7f8 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -328,6 +328,7 @@ struct tty_struct { #define TTY_HW_COOK_OUT 14 #define TTY_HW_COOK_IN 15 #define TTY_PTY_LOCK 16 +#define TTY_NO_WRITE_SPLIT 17 #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) -- 2.39.5