diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2001-01-10 17:17:53 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2001-01-10 17:17:53 +0000 |
commit | b2ad5f821b1381492d792ca10b1eb7a107b48f14 (patch) | |
tree | 954a648692e7da983db1d2470953705f6a729264 /drivers/isdn | |
parent | c9c06167e7933d93a6e396174c68abf242294abb (diff) |
Merge with Linux 2.4.0-prerelease. Big Makefile rewrite, test your
Makefiles.
Diffstat (limited to 'drivers/isdn')
29 files changed, 413 insertions, 4135 deletions
diff --git a/drivers/isdn/Config.in b/drivers/isdn/Config.in index f42516b12..d63dd5981 100644 --- a/drivers/isdn/Config.in +++ b/drivers/isdn/Config.in @@ -1,11 +1,15 @@ # # ISDN device configuration # + +# only included if CONFIG_ISDN != n + if [ "$CONFIG_INET" != "n" ]; then bool ' Support synchronous PPP' CONFIG_ISDN_PPP if [ "$CONFIG_ISDN_PPP" != "n" ]; then - bool ' Use VJ-compression with synchronous PPP' CONFIG_ISDN_PPP_VJ - bool ' Support generic MP (RFC 1717)' CONFIG_ISDN_MPP + bool ' Use VJ-compression with synchronous PPP' CONFIG_ISDN_PPP_VJ + bool ' Support generic MP (RFC 1717)' CONFIG_ISDN_MPP + dep_tristate ' Support BSD compression (module only)' CONFIG_ISDN_PPP_BSDCOMP m fi fi bool ' Support audio via ISDN' CONFIG_ISDN_AUDIO @@ -19,7 +23,7 @@ fi mainmenu_option next_comment comment 'ISDN feature submodules' dep_tristate 'isdnloop support' CONFIG_ISDN_DRV_LOOP $CONFIG_ISDN - bool 'Support isdn diversion services' CONFIG_ISDN_DIVERSION + dep_tristate 'Support isdn diversion services' CONFIG_ISDN_DIVERSION $CONFIG_ISDN endmenu comment 'low-level hardware drivers' @@ -75,57 +79,63 @@ if [ "$CONFIG_ISDN_DRV_HISAX" != "n" ]; then fi endmenu +### Active ISDN cards + mainmenu_option next_comment comment 'Active ISDN cards' -dep_tristate 'ICN 2B and 4B support' CONFIG_ISDN_DRV_ICN $CONFIG_ISDN -dep_tristate 'PCBIT-D support' CONFIG_ISDN_DRV_PCBIT $CONFIG_ISDN -if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then - dep_tristate 'Spellcaster support (EXPERIMENTAL)' CONFIG_ISDN_DRV_SC $CONFIG_ISDN - dep_tristate 'IBM Active 2000 support (EXPERIMENTAL)' CONFIG_ISDN_DRV_ACT2000 $CONFIG_ISDN -fi -dep_tristate 'Eicon active card support' CONFIG_ISDN_DRV_EICON $CONFIG_ISDN + +dep_tristate 'ICN 2B and 4B support' CONFIG_ISDN_DRV_ICN $CONFIG_ISDN +dep_tristate 'PCBIT-D support' CONFIG_ISDN_DRV_PCBIT $CONFIG_ISDN +dep_tristate 'Spellcaster support' CONFIG_ISDN_DRV_SC $CONFIG_ISDN +dep_tristate 'IBM Active 2000 support' CONFIG_ISDN_DRV_ACT2000 $CONFIG_ISDN + +bool 'Eicon active card support' CONFIG_ISDN_DRV_EICON if [ "$CONFIG_ISDN_DRV_EICON" != "n" ]; then - if [ "$CONFIG_ISDN_DRV_EICON_STANDALONE" != "y" ]; then - if [ "$CONFIG_PCI" = "y" ]; then - bool ' Eicon PCI DIVA Server BRI/PRI/4BRI support' CONFIG_ISDN_DRV_EICON_PCI - fi - bool ' Eicon S,SX,SCOM,Quadro,S2M support' CONFIG_ISDN_DRV_EICON_ISA - fi - if [ "$CONFIG_PCI" = "y" ]; then - bool ' build eicon driver type standalone' CONFIG_ISDN_DRV_EICON_STANDALONE + if [ "$CONFIG_ISDN_DRV_EICON_OLD" != "y" ]; then + dep_tristate ' Build Eicon driver type standalone' CONFIG_ISDN_DRV_EICON_DIVAS $CONFIG_ISDN fi -fi -dep_tristate 'CAPI2.0 support' CONFIG_ISDN_CAPI $CONFIG_ISDN -if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then - bool 'CAPI2.0 Middleware support' CONFIG_ISDN_CAPI_MIDDLEWARE - if [ "$CONFIG_ISDN_CAPI_MIDDLEWARE" != "n" ]; then - bool 'CAPI2.0 filesystem support' CONFIG_ISDN_CAPIFS + if [ "$CONFIG_ISDN_DRV_EICON_DIVAS" != "y" ]; then + dep_tristate ' Legacy Eicon driver' CONFIG_ISDN_DRV_EICON_OLD $CONFIG_ISDN + if [ "$CONFIG_ISDN_DRV_EICON_OLD" != "n" ]; then + dep_bool ' Eicon PCI DIVA Server BRI/PRI/4BRI support' CONFIG_ISDN_DRV_EICON_PCI $CONFIG_PCI + bool ' Eicon S,SX,SCOM,Quadro,S2M support' CONFIG_ISDN_DRV_EICON_ISA + fi fi fi + +# CAPI subsystem + +tristate 'CAPI2.0 support' CONFIG_ISDN_CAPI if [ "$CONFIG_ISDN_CAPI" != "n" ]; then - bool ' AVM B1 ISA support' CONFIG_ISDN_DRV_AVMB1_B1ISA - bool ' AVM B1 PCI support' CONFIG_ISDN_DRV_AVMB1_B1PCI - if [ "$CONFIG_ISDN_DRV_AVMB1_B1PCI" != "n" ]; then - if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then - bool ' AVM B1 PCI V4 support' CONFIG_ISDN_DRV_AVMB1_B1PCIV4 + bool ' Verbose reason code reporting (kernel size +=7K)' CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON + dep_bool ' CAPI2.0 Middleware support (EXPERIMENTAL)' CONFIG_ISDN_CAPI_MIDDLEWARE $CONFIG_EXPERIMENTAL + dep_tristate ' CAPI2.0 /dev/capi support' CONFIG_ISDN_CAPI_CAPI20 $CONFIG_ISDN_CAPI + if [ "$CONFIG_ISDN_CAPI_MIDDLEWARE" = "y" ]; then + dep_mbool ' CAPI2.0 filesystem support' CONFIG_ISDN_CAPI_CAPIFS_BOOL $CONFIG_ISDN_CAPI_CAPI20 + if [ "$CONFIG_ISDN_CAPI_CAPIFS_BOOL" = "y" ]; then + define_tristate CONFIG_ISDN_CAPI_CAPIFS $CONFIG_ISDN_CAPI_CAPI20 + else + define_tristate CONFIG_ISDN_CAPI_CAPIFS n fi fi - bool ' AVM T1/T1-B ISA support' CONFIG_ISDN_DRV_AVMB1_T1ISA - bool ' AVM B1/M1/M2 PCMCIA support' CONFIG_ISDN_DRV_AVMB1_B1PCMCIA - bool ' AVM T1/T1-B PCI support' CONFIG_ISDN_DRV_AVMB1_T1PCI - if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then - bool ' AVM C4 support' CONFIG_ISDN_DRV_AVMB1_C4 - fi - bool ' Verbose reason code reporting (kernel size +=7K)' CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON -fi -if [ "$CONFIG_PROC_FS" != "n" ]; then - if [ "$CONFIG_MODULES" != "n" ]; then - bool 'Hypercope HYSDN cards (Champ, Ergo, Metro) support (module)' CONFIG_HYSDN - fi + dep_tristate ' CAPI2.0 capidrv interface support' CONFIG_ISDN_CAPI_CAPIDRV $CONFIG_ISDN_CAPI $CONFIG_ISDN fi -if [ "$CONFIG_HYSDN" != "n" ]; then - if [ "$CONFIG_ISDN_CAPI" != "n" ]; then - bool ' HYSDN CAPI 2.0 support' CONFIG_HYSDN_CAPI - fi + +# CAPI drivers + +if [ "$CONFIG_ISDN_CAPI" != "n" ]; then + dep_tristate ' AVM B1 ISA support' CONFIG_ISDN_DRV_AVMB1_B1ISA $CONFIG_ISDN_CAPI + dep_tristate ' AVM B1 PCI support' CONFIG_ISDN_DRV_AVMB1_B1PCI $CONFIG_ISDN_CAPI $CONFIG_PCI + dep_mbool ' AVM B1 PCI V4 support' CONFIG_ISDN_DRV_AVMB1_B1PCIV4 $CONFIG_ISDN_DRV_AVMB1_B1PCI + dep_tristate ' AVM T1/T1-B ISA support' CONFIG_ISDN_DRV_AVMB1_T1ISA $CONFIG_ISDN_CAPI + dep_tristate ' AVM B1/M1/M2 PCMCIA support' CONFIG_ISDN_DRV_AVMB1_B1PCMCIA $CONFIG_ISDN_CAPI $CONFIG_PCMCIA + dep_tristate ' AVM B1/M1/M2 PCMCIA cs module' CONFIG_ISDN_DRV_AVMB1_AVM_CS $CONFIG_ISDN_DRV_AVMB1_B1PCMCIA + dep_tristate ' AVM T1/T1-B PCI support' CONFIG_ISDN_DRV_AVMB1_T1PCI $CONFIG_ISDN_CAPI $CONFIG_PCI + dep_tristate ' AVM C4 support' CONFIG_ISDN_DRV_AVMB1_C4 $CONFIG_ISDN_CAPI $CONFIG_PCI fi + +# HYSDN + +dep_tristate ' Hypercope HYSDN cards (Champ, Ergo, Metro) support (module only)' CONFIG_HYSDN m $CONFIG_PROC_FS +dep_mbool ' HYSDN CAPI 2.0 support' CONFIG_HYSDN_CAPI $CONFIG_HYSDN $CONFIG_ISDN_CAPI endmenu diff --git a/drivers/isdn/Makefile b/drivers/isdn/Makefile index b1e43f487..d1ab6cd7b 100644 --- a/drivers/isdn/Makefile +++ b/drivers/isdn/Makefile @@ -1,145 +1,57 @@ -SUB_DIRS := -MOD_SUB_DIRS := -ALL_SUB_DIRS := icn pcbit hisax avmb1 act2000 eicon divert hysdn - -L_OBJS := -LX_OBJS := -M_OBJS := -MX_OBJS := -O_OBJS := -OX_OBJS := -L_TARGET := -O_TARGET := - -ifeq ($(CONFIG_ISDN),y) - L_TARGET := isdn.a - L_OBJS += isdn_net.o isdn_tty.o isdn_cards.o isdn_v110.o - LX_OBJS += isdn_common.o - ifdef CONFIG_ISDN_PPP - L_OBJS += isdn_ppp.o - endif - ifdef CONFIG_ISDN_X25 - L_OBJS += isdn_x25iface.o - L_OBJS += isdn_concap.o - endif - ifdef CONFIG_ISDN_AUDIO - L_OBJS += isdn_audio.o - ifdef CONFIG_ISDN_TTY_FAX - L_OBJS += isdn_ttyfax.o - endif - endif -else - ifeq ($(CONFIG_ISDN),m) - M_OBJS += isdn.o - O_TARGET += isdn.o - O_OBJS += isdn_net.o isdn_tty.o isdn_v110.o - OX_OBJS += isdn_common.o - ifdef CONFIG_ISDN_PPP - O_OBJS += isdn_ppp.o - M_OBJS += isdn_bsdcomp.o - endif - ifdef CONFIG_ISDN_X25 - O_OBJS += isdn_x25iface.o - O_OBJS += isdn_concap.o - endif - ifdef CONFIG_ISDN_AUDIO - O_OBJS += isdn_audio.o - ifdef CONFIG_ISDN_TTY_FAX - O_OBJS += isdn_ttyfax.o - endif - endif - endif -endif - -ifeq ($(CONFIG_ISDN_DIVERSION),y) - ifeq ($(CONFIG_MODULES),y) - MOD_SUB_DIRS += divert - endif -endif - -ifeq ($(CONFIG_ISDN_DRV_HISAX),y) - L_OBJS += hisax/hisax.o - SUB_DIRS += hisax - MOD_SUB_DIRS += hisax -else - ifeq ($(CONFIG_ISDN_DRV_HISAX),m) - MOD_SUB_DIRS += hisax - endif -endif - -ifeq ($(CONFIG_ISDN_DRV_ICN),y) - L_OBJS += icn/icn_obj.o - SUB_DIRS += icn - MOD_SUB_DIRS += icn -else - ifeq ($(CONFIG_ISDN_DRV_ICN),m) - MOD_SUB_DIRS += icn - endif -endif - -ifeq ($(CONFIG_ISDN_DRV_PCBIT),y) - L_OBJS += pcbit/pcbit.o - SUB_DIRS += pcbit - MOD_SUB_DIRS += pcbit -else - ifeq ($(CONFIG_ISDN_DRV_PCBIT),m) - MOD_SUB_DIRS += pcbit - endif -endif - -ifeq ($(CONFIG_ISDN_DRV_SC),y) - L_OBJS += sc/sc.o - SUB_DIRS += sc - MOD_SUB_DIRS += sc -else - ifeq ($(CONFIG_ISDN_DRV_SC),m) - MOD_SUB_DIRS += sc - endif -endif - -ifeq ($(CONFIG_ISDN_CAPI),y) - L_OBJS += avmb1/avmb1.o - SUB_DIRS += avmb1 - MOD_SUB_DIRS += avmb1 -else - ifeq ($(CONFIG_ISDN_CAPI),m) - MOD_SUB_DIRS += avmb1 - endif -endif - -ifeq ($(CONFIG_ISDN_DRV_LOOP),y) - L_OBJS += isdnloop/isdnloop.o - SUB_DIRS += isdnloop - MOD_SUB_DIRS += isdnloop -else - ifeq ($(CONFIG_ISDN_DRV_LOOP),m) - MOD_SUB_DIRS += isdnloop - endif -endif - -ifeq ($(CONFIG_ISDN_DRV_ACT2000),y) - L_OBJS += act2000/act2000.o - SUB_DIRS += act2000 - MOD_SUB_DIRS += act2000 -else - ifeq ($(CONFIG_ISDN_DRV_ACT2000),m) - MOD_SUB_DIRS += act2000 - endif -endif - -ifeq ($(CONFIG_ISDN_DRV_EICON),y) - L_OBJS += eicon/eicon.o - SUB_DIRS += eicon - MOD_SUB_DIRS += eicon -else - ifeq ($(CONFIG_ISDN_DRV_EICON),m) - MOD_SUB_DIRS += eicon - endif -endif - -ifeq ($(CONFIG_HYSDN),y) - MOD_SUB_DIRS += hysdn -endif +# Makefile for the kernel ISDN subsystem and device drivers. + +# The target object and module list name. + +O_TARGET := isdn.a + +# Objects that export symbols. + +export-objs := isdn_common.o + +# Multipart objects. + +list-multi := isdn.o +isdn-objs := isdn_net.o isdn_tty.o isdn_cards.o isdn_v110.o \ + isdn_common.o + +# Optional parts of multipart objects. + +isdn-objs-$(CONFIG_ISDN_PPP) += isdn_ppp.o +isdn-objs-$(CONFIG_ISDN_X25) += isdn_concap.o isdn_x25iface.o +isdn-objs-$(CONFIG_ISDN_AUDIO) += isdn_audio.o +isdn-objs-$(CONFIG_ISDN_TTY_FAX) += isdn_ttyfax.o +isdn-objs-$(CONFIG_ISDN_WITH_ABC) += isdn_dwabc.o + +isdn-objs += $(isdn-objs-y) + +# Ordering constraints: isdn.o first, rest doesn't matter + +# Each configuration option enables a list of files. + +obj-$(CONFIG_ISDN) += isdn.o +obj-$(CONFIG_ISDN_PPP_BSDCOMP) += isdn_bsdcomp.o + +# Object files in subdirectories + +mod-subdirs := avmb1 eicon +subdir-$(CONFIG_ISDN_DIVERSION) += divert +subdir-$(CONFIG_ISDN_DRV_HISAX) += hisax +subdir-$(CONFIG_ISDN_DRV_ICN) += icn +subdir-$(CONFIG_ISDN_DRV_PCBIT) += pcbit +subdir-$(CONFIG_ISDN_DRV_SC) += sc +subdir-$(CONFIG_ISDN_CAPI) += avmb1 +subdir-$(CONFIG_ISDN_DRV_LOOP) += isdnloop +subdir-$(CONFIG_ISDN_DRV_ACT2000) += act2000 +subdir-$(CONFIG_ISDN_DRV_EICON) += eicon +subdir-$(CONFIG_HYSDN) += hysdn + +obj-y += $(addsuffix /vmlinux-obj.o, $(subdir-y)) + +# The global Rules.make. include $(TOPDIR)/Rules.make +# Link rules for multi-part drivers. + +isdn.o: $(isdn-objs) + $(LD) -r -o $@ $(isdn-objs) diff --git a/drivers/isdn/act2000/Makefile b/drivers/isdn/act2000/Makefile index 31312e8f6..556c402b1 100644 --- a/drivers/isdn/act2000/Makefile +++ b/drivers/isdn/act2000/Makefile @@ -1,15 +1,21 @@ -L_OBJS := -M_OBJS := -O_OBJS := module.o capi.o act2000_isa.o - -O_TARGET := -ifeq ($(CONFIG_ISDN_DRV_ACT2000),y) - O_TARGET += act2000.o -else - ifeq ($(CONFIG_ISDN_DRV_ACT2000),m) - O_TARGET += act2000.o - M_OBJS = act2000.o - endif -endif +# Makefile for the act2000 ISDN device driver + +# The target object and module list name. + +O_TARGET := vmlinux-obj.o + +# Multipart objects. + +list-multi := act2000.o +act2000-objs := module.o capi.o act2000_isa.o + +# Each configuration option enables a list of files. + +obj-$(CONFIG_ISDN_DRV_ACT2000) += act2000.o include $(TOPDIR)/Rules.make + +# Link rules for multi-part drivers. + +act2000.o: $(act2000-objs) + $(LD) -r -o $@ $(act2000-objs) diff --git a/drivers/isdn/avmb1/Makefile b/drivers/isdn/avmb1/Makefile index a076ef7c3..366909287 100644 --- a/drivers/isdn/avmb1/Makefile +++ b/drivers/isdn/avmb1/Makefile @@ -1,218 +1,40 @@ -# -# $Id: Makefile,v 1.22 2000/11/23 20:45:14 kai Exp $ -# -# Makefile for the CAPI and AVM-B1 device drivers. -# -# Note! Dependencies are done automagically by 'make dep', which also -# removes any old dependencies. DON'T put your own dependencies here -# unless it's something special (ie not a .c file). -# -# Note 2! The CFLAGS definitions are now inherited from the -# parent makes.. -# -# $Log: Makefile,v $ -# Revision 1.22 2000/11/23 20:45:14 kai -# fixed module_init/exit stuff -# Note: compiled-in kernel doesn't work pre 2.2.18 anymore. -# -# Revision 1.21 2000/11/01 14:05:02 calle -# - use module_init/module_exit from linux/init.h. -# - all static struct variables are initialized with "membername:" now. -# - avm_cs.c, let it work with newer pcmcia-cs. -# -# Revision 1.20 2000/10/18 06:13:34 ostoyke -# Removing CAPI4Linux from I4L CVS. -# -# Revision 1.19 2000/08/10 14:46:25 ostoyke -# CAPI4Linux. -# -# Revision 1.18 2000/04/03 16:39:25 calle -# Makefile checked in with future things :-( -# -# Revision 1.17 2000/04/03 16:38:05 calle -# made suppress_pollack static. -# -# Revision 1.16 2000/03/17 12:15:44 calle -# ALL_SUB_DIRS were wrong. -# -# Revision 1.15 2000/03/16 15:21:03 calle -# Bugfix in c4_remove: loop 5 times instead of 4 :-( -# -# Revision 1.14 2000/03/13 17:50:55 calle -# Added avm_cs.c for 2.3.x PCMCIA support. -# -# Revision 1.13 2000/03/08 17:06:33 calle -# - changes for devfs and 2.3.49 -# - capifs now configurable (no need with devfs) -# - New Middleware ioctl CAPI_NCCI_GETUNIT -# - Middleware again tested with 2.2.14 and 2.3.49 (with and without devfs) -# -# Revision 1.12 2000/03/06 18:00:23 calle -# - Middleware extention now working with 2.3.49 (capifs). -# - Fixed typos in debug section of capi.c -# - Bugfix: Makefile corrected for b1pcmcia.c -# -# Revision 1.11 2000/03/06 09:17:07 calle -# - capifs: fileoperations now in inode (change for 2.3.49) -# - Config.in: Middleware extention not a tristate, uups. -# -# Revision 1.10 2000/03/03 16:48:38 calle -# - Added CAPI2.0 Middleware support (CONFIG_ISDN_CAPI) -# It is now possible to create a connection with a CAPI2.0 applikation -# and than to handle the data connection from /dev/capi/ (capifs) and also -# using async or sync PPP on this connection. -# The two major device number 190 and 191 are not confirmed yet, -# but I want to save the code in cvs, before I go on. -# -# Revision 1.9 2000/03/03 15:50:42 calle -# - kernel CAPI: -# - Changed parameter "param" in capi_signal from __u32 to void *. -# - rewrote notifier handling in kcapi.c -# - new notifier NCCI_UP and NCCI_DOWN -# - User CAPI: -# - /dev/capi20 is now a cloning device. -# - middleware extentions prepared. -# - capidrv.c -# - locking of list operations and module count updates. -# -# Revision 1.8 2000/01/25 14:33:38 calle -# - Added Support AVM B1 PCI V4.0 (tested with prototype) -# - splitted up t1pci.c into b1dma.c for common function with b1pciv4 -# - support for revision register -# -# Revision 1.7 1999/09/15 08:16:03 calle -# Implementation of 64Bit extention complete. -# -# Revision 1.6 1999/07/20 06:41:44 calle -# Bugfix: After the redesign of the AVM B1 driver, the driver didn't even -# compile, if not selected as modules. -# -# Revision 1.5 1999/07/01 15:26:20 calle -# complete new version (I love it): -# + new hardware independed "capi_driver" interface that will make it easy to: -# - support other controllers with CAPI-2.0 (i.e. USB Controller) -# - write a CAPI-2.0 for the passive cards -# - support serial link CAPI-2.0 boxes. -# + wrote "capi_driver" for all supported cards. -# + "capi_driver" (supported cards) now have to be configured with -# make menuconfig, in the past all supported cards where included -# at once. -# + new and better informations in /proc/capi/ -# + new ioctl to switch trace of capi messages per controller -# using "avmcapictrl trace [contr] on|off|...." -# + complete testcircle with all supported cards and also the -# PCMCIA cards (now patch for pcmcia-cs-3.0.13 needed) done. -# -# Revision 1.4 1997/03/30 17:10:40 calle -# added support for AVM-B1-PCI card. -# -# Revision 1.3 1997/03/22 02:00:57 fritz -# -Reworked toplevel Makefile. From now on, no different Makefiles -# for standalone- and in-kernel-compilation are needed any more. -# -Added local Rules.make for above reason. -# -Experimental changes in teles3.c for enhanced IRQ-checking with -# 2.1.X and SMP kernels. -# -Removed diffstd-script, same functionality is in stddiff -r. -# -Enhanced scripts std2kern and stddiff. -# -# Revision 1.1 1997/03/05 21:26:14 fritz -# Renamed, according naming conventions in CVS tree. -# -# Revision 1.1 1997/03/04 21:50:26 calle -# Frirst version in isdn4linux -# -# Revision 2.2 1997/02/12 09:31:39 calle -# -# Revision 1.1 1997/01/31 10:32:20 calle -# Initial revision -# -# +# Makefile for the AVM ISDN device drivers and CAPI subsystem. -SUB_DIRS := -MOD_SUB_DIRS := -ALL_SUB_DIRS := -# -# Objects that don't export a symtab -# -L_OBJS := # used as component of an L_TARGET -O_OBJS := # used as component of an O_TARGET -M_OBJS := # used as module -# -# Objects that do export a symtab -# -LX_OBJS := # used as component of an L_TARGET -OX_OBJS := # used as component of an O_TARGET -MX_OBJS := # used as module -# -# Targets, created by linking others -# -O_TARGET := # used for .o targets (from O and OX objects) -L_TARGET := # used for .a targets (from L and LX objects) +# The target object and module list name. -ifeq ($(CONFIG_ISDN_CAPI),y) - O_TARGET += avmb1.o - OX_OBJS += kcapi.o - O_OBJS += capi.o - ifdef CONFIG_ISDN_CAPIFS - OX_OBJS += capifs.o - endif - ifdef CONFIG_ISDN_DRV_AVMB1_B1ISA - O_OBJS += b1isa.o - endif - ifdef CONFIG_ISDN_DRV_AVMB1_B1PCI - O_OBJS += b1pci.o - endif - ifdef CONFIG_ISDN_DRV_AVMB1_T1ISA - O_OBJS += t1isa.o - endif - ifdef CONFIG_ISDN_DRV_AVMB1_B1PCMCIA - OX_OBJS += b1pcmcia.o - ifeq ($(CONFIG_HOTPLUG),y) - ifneq ($(CONFIG_PCMCIA),n) - M_OBJS += avm_cs.o - endif - endif - endif - ifdef CONFIG_ISDN_DRV_AVMB1_T1PCI - O_OBJS += t1pci.o - endif - ifdef CONFIG_ISDN_DRV_AVMB1_C4 - O_OBJS += c4.o - endif - OX_OBJS += capiutil.o capidrv.o b1.o b1dma.o -else - ifeq ($(CONFIG_ISDN_CAPI),m) - O_TARGET += kernelcapi.o - OX_OBJS += kcapi.o - M_OBJS += capi.o kernelcapi.o - ifdef CONFIG_ISDN_CAPIFS - MX_OBJS += capifs.o - endif - ifdef CONFIG_ISDN_DRV_AVMB1_B1ISA - M_OBJS += b1isa.o - endif - ifdef CONFIG_ISDN_DRV_AVMB1_B1PCI - M_OBJS += b1pci.o - endif - ifdef CONFIG_ISDN_DRV_AVMB1_T1ISA - M_OBJS += t1isa.o - endif - ifdef CONFIG_ISDN_DRV_AVMB1_B1PCMCIA - MX_OBJS += b1pcmcia.o - ifeq ($(CONFIG_HOTPLUG),y) - ifneq ($(CONFIG_PCMCIA),n) - M_OBJS += avm_cs.o - endif - endif - endif - ifdef CONFIG_ISDN_DRV_AVMB1_T1PCI - M_OBJS += t1pci.o - endif - ifdef CONFIG_ISDN_DRV_AVMB1_C4 - M_OBJS += c4.o - endif - MX_OBJS += capiutil.o capidrv.o b1.o b1dma.o - endif -endif +O_TARGET := vmlinux-obj.o + +# Objects that export symbols. + +export-objs := kcapi.o capiutil.o b1dma.o b1pcmcia.o b1.o capifs.o + +# Multipart objects. + +list-multi := kernelcapi.o +kernelcapi-objs := kcapi.o + +# Ordering constraints: kernelcapi.o first + +# Each configuration option enables a list of files. + +obj-$(CONFIG_ISDN_CAPI) += kernelcapi.o capiutil.o +obj-$(CONFIG_ISDN_CAPI_CAPI20) += capi.o +obj-$(CONFIG_ISDN_CAPI_CAPIDRV) += capidrv.o +obj-$(CONFIG_ISDN_CAPI_CAPIFS) += capifs.o +obj-$(CONFIG_ISDN_DRV_AVMB1_B1ISA) += b1isa.o b1.o +obj-$(CONFIG_ISDN_DRV_AVMB1_B1PCI) += b1pci.o b1.o b1dma.o +obj-$(CONFIG_ISDN_DRV_AVMB1_B1PCMCIA) += b1pcmcia.o b1.o +obj-$(CONFIG_ISDN_DRV_AVMB1_AVM_CS) += avm_cs.o +obj-$(CONFIG_ISDN_DRV_AVMB1_T1ISA) += t1isa.o b1.o +obj-$(CONFIG_ISDN_DRV_AVMB1_T1PCI) += t1pci.o b1.o b1dma.o +obj-$(CONFIG_ISDN_DRV_AVMB1_C4) += c4.o b1.o + +# The global Rules.make. include $(TOPDIR)/Rules.make + +# Link rules for multi-part drivers. + +kernelcapi.o: $(kernelcapi-objs) + $(LD) -r -o $@ $(kernelcapi-objs) + diff --git a/drivers/isdn/avmb1/b1capi.c b/drivers/isdn/avmb1/b1capi.c deleted file mode 100644 index 117701a90..000000000 --- a/drivers/isdn/avmb1/b1capi.c +++ /dev/null @@ -1,1272 +0,0 @@ -/* - * $Id: b1capi.c,v 1.14 1999/04/15 19:49:29 calle Exp $ - * - * CAPI 2.0 Module for AVM B1-card. - * - * (c) Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de) - * - * $Log: b1capi.c,v $ - * Revision 1.14 1999/04/15 19:49:29 calle - * fix fuer die B1-PCI. Jetzt geht z.B. auch IRQ 17 ... - * - * Revision 1.13 1999/01/05 18:29:31 he - * merged remaining schedule_timeout() changes from 2.1.127 - * - * Revision 1.12 1998/10/25 14:38:58 fritz - * Backported from MIPS (Cobalt). - * - * Revision 1.11 1998/03/29 16:05:58 calle - * changes from 2.0 tree merged. - * - * Revision 1.4.2.18 1998/03/20 20:34:37 calle - * port valid check now only for T1, because of the PCI and PCMCIA cards. - * - * Revision 1.4.2.17 1998/03/20 14:38:17 calle - * capidrv: prepared state machines for suspend/resume/hold - * capidrv: fix bug in state machine if B1/T1 is out of nccis - * b1capi: changed some errno returns. - * b1capi: detect if you try to add same T1 to different io address. - * b1capi: change number of nccis depending on number of channels. - * b1lli: cosmetics - * - * Revision 1.4.2.16 1998/03/20 09:01:08 calle - * Changes capi_register handling to get full support for 30 bchannels. - * - * Revision 1.4.2.15 1998/03/18 17:43:26 calle - * T1 with fastlink, bugfix for multicontroller support in capidrv.c - * - * Revision 1.4.2.14 1998/03/04 17:33:47 calle - * Changes for T1. - * - * Revision 1.4.2.13 1998/02/27 15:40:41 calle - * T1 running with slow link. bugfix in capi_release. - * - * Revision 1.4.2.12 1998/02/24 17:58:25 calle - * changes for T1. - * - * Revision 1.10 1998/02/13 07:09:10 calle - * change for 2.1.86 (removing FREE_READ/FREE_WRITE from [dev]_kfree_skb() - * - * Revision 1.9 1998/01/31 11:14:39 calle - * merged changes to 2.0 tree, prepare 2.1.82 to work. - * - * Revision 1.8 1997/12/10 20:00:46 calle - * get changes from 2.0 version - * - * Revision 1.4.2.5 1997/12/07 19:59:54 calle - * more changes for M1/T1/B1 + config - * - * Revision 1.4.2.4 1997/11/26 16:57:20 calle - * more changes for B1/M1/T1. - * - * Revision 1.7 1997/10/19 14:45:40 calle - * fixed capi_get_version. - * - * Revision 1.6 1997/10/01 09:21:09 fritz - * Removed old compatibility stuff for 2.0.X kernels. - * From now on, this code is for 2.1.X ONLY! - * Old stuff is still in the separate branch. - * - * Revision 1.5 1997/07/12 08:22:26 calle - * Correct bug in CARD_NR macro, so now more than one card will work. - * Allow card reset, even if card is in running state. - * - * - * Revision 1.4 1997/05/27 15:17:45 fritz - * Added changes for recent 2.1.x kernels: - * changed return type of isdn_close - * queue_task_* -> queue_task - * clear/set_bit -> test_and_... where apropriate. - * changed type of hard_header_cache parameter. - * - * Revision 1.3 1997/05/18 09:24:09 calle - * added verbose disconnect reason reporting to avmb1. - * some fixes in capi20 interface. - * changed info messages for B1-PCI - * - * Revision 1.2 1997/03/05 21:20:41 fritz - * Removed include of config.h (mkdep stated this is unneded). - * - * Revision 1.1 1997/03/04 21:50:27 calle - * Frirst version in isdn4linux - * - * Revision 2.2 1997/02/12 09:31:39 calle - * new version - * - * Revision 1.1 1997/01/31 10:32:20 calle - * Initial revision - * - * - */ - -#include <linux/module.h> -#include <linux/kernel.h> -#include <linux/mm.h> -#include <linux/interrupt.h> -#include <linux/ioport.h> -#include <asm/segment.h> -#include <linux/skbuff.h> -#include <linux/tqueue.h> -#include <linux/capi.h> -#include <linux/b1lli.h> -#include <linux/kernelcapi.h> -#include "compat.h" -#include "capicmd.h" -#include "capiutil.h" - -static char *revision = "$Revision: 1.14 $"; - -/* ------------------------------------------------------------- */ - -int showcapimsgs = 0; /* used in lli.c */ -int loaddebug = 0; - -MODULE_AUTHOR("Carsten Paeth <calle@calle.in-berlin.de>"); -MODULE_PARM(showcapimsgs, "0-5i"); -MODULE_PARM(loaddebug, "0-1i"); - -/* ------------------------------------------------------------- */ - -struct msgidqueue { - struct msgidqueue *next; - __u16 msgid; -}; - -typedef struct avmb1_ncci { - struct avmb1_ncci *next; - __u16 applid; - __u32 ncci; - __u32 winsize; - struct msgidqueue *msgidqueue; - struct msgidqueue *msgidlast; - struct msgidqueue *msgidfree; - struct msgidqueue msgidpool[CAPI_MAXDATAWINDOW]; -} avmb1_ncci; - -typedef struct avmb1_appl { - __u16 applid; - capi_register_params rparam; - int releasing; - __u32 param; - void (*signal) (__u16 applid, __u32 param); - struct sk_buff_head recv_queue; - struct avmb1_ncci *nccilist; -} avmb1_appl; - -/* ------------------------------------------------------------- */ - -static struct capi_version driver_version = {2, 0, 1, 1<<4}; -static char driver_serial[CAPI_SERIAL_LEN] = "4711"; -static char capi_manufakturer[64] = "AVM Berlin"; - -#define APPL(a) (&applications[(a)-1]) -#define VALID_APPLID(a) ((a) && (a) <= CAPI_MAXAPPL && APPL(a)->applid == a) -#define APPL_IS_FREE(a) (APPL(a)->applid == 0) -#define APPL_MARK_FREE(a) do{ APPL(a)->applid=0; MOD_DEC_USE_COUNT; }while(0); -#define APPL_MARK_USED(a) do{ APPL(a)->applid=(a); MOD_INC_USE_COUNT; }while(0); - -#define NCCI2CTRL(ncci) (((ncci) >> 24) & 0x7f) - -#define VALID_CARD(c) ((c) > 0 && (c) <= CAPI_MAXCONTR) -#define CARD(c) (&cards[(c)-1]) -#define CARDNR(cp) (((cp)-cards)+1) - -static avmb1_appl applications[CAPI_MAXAPPL]; -static avmb1_card cards[CAPI_MAXCONTR]; -static int ncards = 0; -static struct sk_buff_head recv_queue; -static struct capi_interface_user *capi_users = 0; -static long notify_up_set = 0; -static long notify_down_set = 0; - -static struct tq_struct tq_state_notify; -static struct tq_struct tq_recv_notify; - -/* -------- util functions ------------------------------------ */ - -static char *cardtype2str(int cardtype) -{ - switch (cardtype) { - default: - case AVM_CARDTYPE_B1: return "B1-ISA"; - case AVM_CARDTYPE_B1PCI: return "B1-PCI"; - case AVM_CARDTYPE_M1: return "M1"; - case AVM_CARDTYPE_M2: return "M2"; - case AVM_CARDTYPE_T1: return "T1"; - } -} - -static inline int capi_cmd_valid(__u8 cmd) -{ - switch (cmd) { - case CAPI_ALERT: - case CAPI_CONNECT: - case CAPI_CONNECT_ACTIVE: - case CAPI_CONNECT_B3_ACTIVE: - case CAPI_CONNECT_B3: - case CAPI_CONNECT_B3_T90_ACTIVE: - case CAPI_DATA_B3: - case CAPI_DISCONNECT_B3: - case CAPI_DISCONNECT: - case CAPI_FACILITY: - case CAPI_INFO: - case CAPI_LISTEN: - case CAPI_MANUFACTURER: - case CAPI_RESET_B3: - case CAPI_SELECT_B_PROTOCOL: - return 1; - } - return 0; -} - -static inline int capi_subcmd_valid(__u8 subcmd) -{ - switch (subcmd) { - case CAPI_REQ: - case CAPI_CONF: - case CAPI_IND: - case CAPI_RESP: - return 1; - } - return 0; -} - -/* -------- NCCI Handling ------------------------------------- */ - -static inline void mq_init(avmb1_ncci * np) -{ - int i; - np->msgidqueue = 0; - np->msgidlast = 0; - memset(np->msgidpool, 0, sizeof(np->msgidpool)); - np->msgidfree = &np->msgidpool[0]; - for (i = 1; i < np->winsize; i++) { - np->msgidpool[i].next = np->msgidfree; - np->msgidfree = &np->msgidpool[i]; - } -} - -static inline int mq_enqueue(avmb1_ncci * np, __u16 msgid) -{ - struct msgidqueue *mq; - if ((mq = np->msgidfree) == 0) - return 0; - np->msgidfree = mq->next; - mq->msgid = msgid; - mq->next = 0; - if (np->msgidlast) - np->msgidlast->next = mq; - np->msgidlast = mq; - if (!np->msgidqueue) - np->msgidqueue = mq; - return 1; -} - -static inline int mq_dequeue(avmb1_ncci * np, __u16 msgid) -{ - struct msgidqueue **pp; - for (pp = &np->msgidqueue; *pp; pp = &(*pp)->next) { - if ((*pp)->msgid == msgid) { - struct msgidqueue *mq = *pp; - *pp = mq->next; - if (mq == np->msgidlast) - np->msgidlast = 0; - mq->next = np->msgidfree; - np->msgidfree = mq; - return 1; - } - } - return 0; -} - -void avmb1_handle_new_ncci(avmb1_card * card, - __u16 appl, __u32 ncci, __u32 winsize) -{ - avmb1_ncci *np; - if (!VALID_APPLID(appl)) { - printk(KERN_ERR "avmb1_handle_new_ncci: illegal appl %d\n", appl); - return; - } - if ((np = (avmb1_ncci *) kmalloc(sizeof(avmb1_ncci), GFP_ATOMIC)) == 0) { - printk(KERN_ERR "avmb1_handle_new_ncci: alloc failed ncci 0x%x\n", ncci); - return; - } - if (winsize > CAPI_MAXDATAWINDOW) { - printk(KERN_ERR "avmb1_handle_new_ncci: winsize %d too big, set to %d\n", - winsize, CAPI_MAXDATAWINDOW); - winsize = CAPI_MAXDATAWINDOW; - } - np->applid = appl; - np->ncci = ncci; - np->winsize = winsize; - mq_init(np); - np->next = APPL(appl)->nccilist; - APPL(appl)->nccilist = np; - printk(KERN_INFO "b1capi: appl %d ncci 0x%x up\n", appl, ncci); - -} - -void avmb1_handle_free_ncci(avmb1_card * card, - __u16 appl, __u32 ncci) -{ - if (!VALID_APPLID(appl)) { - printk(KERN_ERR "avmb1_handle_free_ncci: illegal appl %d\n", appl); - return; - } - if (ncci != 0xffffffff) { - avmb1_ncci **pp; - for (pp = &APPL(appl)->nccilist; *pp; pp = &(*pp)->next) { - if ((*pp)->ncci == ncci) { - avmb1_ncci *np = *pp; - *pp = np->next; - kfree(np); - printk(KERN_INFO "b1capi: appl %d ncci 0x%x down\n", appl, ncci); - return; - } - } - printk(KERN_ERR "avmb1_handle_free_ncci: ncci 0x%x not found\n", ncci); - } else { - avmb1_ncci **pp, **nextpp; - for (pp = &APPL(appl)->nccilist; *pp; pp = nextpp) { - if (NCCI2CTRL((*pp)->ncci) == card->cnr) { - avmb1_ncci *np = *pp; - *pp = np->next; - printk(KERN_INFO "b1capi: appl %d ncci 0x%x down!\n", appl, np->ncci); - kfree(np); - nextpp = pp; - } else { - nextpp = &(*pp)->next; - } - } - APPL(appl)->releasing--; - if (APPL(appl)->releasing <= 0) { - APPL(appl)->signal = 0; - APPL_MARK_FREE(appl); - printk(KERN_INFO "b1capi: appl %d down\n", appl); - } - } -} - -static avmb1_ncci *find_ncci(avmb1_appl * app, __u32 ncci) -{ - avmb1_ncci *np; - for (np = app->nccilist; np; np = np->next) { - if (np->ncci == ncci) - return np; - } - return 0; -} - - - -/* -------- Receiver ------------------------------------------ */ - - -static void recv_handler(void *dummy) -{ - struct sk_buff *skb; - - while ((skb = skb_dequeue(&recv_queue)) != 0) { - __u16 appl = CAPIMSG_APPID(skb->data); - struct avmb1_ncci *np; - if (!VALID_APPLID(appl)) { - printk(KERN_ERR "b1capi: recv_handler: applid %d ? (%s)\n", - appl, capi_message2str(skb->data)); - kfree_skb(skb); - continue; - } - if (APPL(appl)->signal == 0) { - printk(KERN_ERR "b1capi: recv_handler: applid %d has no signal function\n", - appl); - kfree_skb(skb); - continue; - } - if ( CAPIMSG_COMMAND(skb->data) == CAPI_DATA_B3 - && CAPIMSG_SUBCOMMAND(skb->data) == CAPI_CONF - && (np = find_ncci(APPL(appl), CAPIMSG_NCCI(skb->data))) != 0 - && mq_dequeue(np, CAPIMSG_MSGID(skb->data)) == 0) { - printk(KERN_ERR "b1capi: msgid %hu ncci 0x%x not on queue\n", - CAPIMSG_MSGID(skb->data), np->ncci); - } - skb_queue_tail(&APPL(appl)->recv_queue, skb); - (APPL(appl)->signal) (APPL(appl)->applid, APPL(appl)->param); - } -} - - -void avmb1_handle_capimsg(avmb1_card * card, __u16 appl, struct sk_buff *skb) -{ - if (card->cardstate != CARD_RUNNING) { - printk(KERN_INFO "b1capi: controller %d not active, got: %s", - card->cnr, capi_message2str(skb->data)); - goto error; - return; - } - skb_queue_tail(&recv_queue, skb); - queue_task(&tq_recv_notify, &tq_immediate); - mark_bh(IMMEDIATE_BH); - return; - - error: - kfree_skb(skb); -} - -void avmb1_interrupt(int interrupt, void *devptr, struct pt_regs *regs) -{ - avmb1_card *card; - - card = (avmb1_card *) devptr; - - if (!card) { - printk(KERN_WARNING "avmb1_interrupt: wrong device\n"); - return; - } - if (card->interrupt) { - printk(KERN_ERR "avmb1_interrupt: reentering interrupt hander\n"); - return; - } - - card->interrupt = 1; - - B1_handle_interrupt(card); - - card->interrupt = 0; -} - -/* -------- Notifier ------------------------------------------ */ - -static void notify_up(__u16 contr) -{ - struct capi_interface_user *p; - - printk(KERN_NOTICE "b1capi: notify up contr %d\n", contr); - for (p = capi_users; p; p = p->next) { - if (p->callback) - (*p->callback) (KCI_CONTRUP, contr, - (capi_profile *) - CARD(contr)->version[VER_PROFILE]); - } -} - -static void notify_down(__u16 contr) -{ - struct capi_interface_user *p; - printk(KERN_NOTICE "b1capi: notify down contr %d\n", contr); - for (p = capi_users; p; p = p->next) { - if (p->callback) - (*p->callback) (KCI_CONTRDOWN, contr, 0); - } -} - -static void notify_handler(void *dummy) -{ - __u16 contr; - - for (contr=1; VALID_CARD(contr); contr++) - if (test_and_clear_bit(contr, ¬ify_up_set)) - notify_up(contr); - for (contr=1; VALID_CARD(contr); contr++) - if (test_and_clear_bit(contr, ¬ify_down_set)) - notify_down(contr); - MOD_DEC_USE_COUNT; -} - -/* -------- card ready callback ------------------------------- */ - - -void avmb1_card_ready(avmb1_card * card) -{ - struct capi_profile *profp = - (struct capi_profile *)card->version[VER_PROFILE]; - char *dversion = card->version[VER_DRIVER]; - __u16 appl; - char *cardname, cname[20]; - __u32 flag; - int nbchan = profp->nbchannel; - - card->cversion.majorversion = 2; - card->cversion.minorversion = 0; - card->cversion.majormanuversion = (((dversion[0] - '0') & 0xf) << 4); - card->cversion.majormanuversion |= ((dversion[2] - '0') & 0xf); - card->cversion.minormanuversion = (dversion[3] - '0') << 4; - card->cversion.minormanuversion |= - (dversion[5] - '0') * 10 + ((dversion[6] - '0') & 0xf); - card->cardstate = CARD_RUNNING; - - for (appl = 1; appl <= CAPI_MAXAPPL; appl++) { - if (VALID_APPLID(appl) && !APPL(appl)->releasing) { - int nconn, want = APPL(appl)->rparam.level3cnt; - - if (want > 0) nconn = want; - else nconn = nbchan * -want; - if (nconn == 0) nconn = nbchan; - - B1_send_register(card->port, appl, - 1024 * (nconn+1), nconn, - APPL(appl)->rparam.datablkcnt, - APPL(appl)->rparam.datablklen); - } - } - - set_bit(CARDNR(card), ¬ify_up_set); - MOD_INC_USE_COUNT; - if (schedule_task(&tq_state_notify) == 0) - MOD_DEC_USE_COUNT; - - flag = ((__u8 *)(profp->manu))[1]; - switch (flag) { - case 0: cardname = cardtype2str(card->cardtype); break; - case 3: cardname = "PCMCIA B"; break; - case 4: cardname = "PCMCIA M1"; break; - case 5: cardname = "PCMCIA M2"; break; - case 6: cardname = "B1 V3.0"; break; - case 7: cardname = "B1 PCI"; break; - default: cardname = cname; break; - sprintf(cname, "AVM?%u", (unsigned int)flag); - break; - } - printk(KERN_NOTICE "b1capi: card %d \"%s\" ready.\n", - CARDNR(card), cardname); - flag = ((__u8 *)(profp->manu))[3]; - if (flag) - printk(KERN_NOTICE "b1capi: card %d Protocol:%s%s%s%s%s%s%s\n", - CARDNR(card), - (flag & 0x01) ? " DSS1" : "", - (flag & 0x02) ? " CT1" : "", - (flag & 0x04) ? " VN3" : "", - (flag & 0x08) ? " NI1" : "", - (flag & 0x10) ? " AUSTEL" : "", - (flag & 0x20) ? " ESS" : "", - (flag & 0x40) ? " 1TR6" : "" - ); - flag = ((__u8 *)(profp->manu))[5]; - if (flag) - printk(KERN_NOTICE "b1capi: card %d Linetype:%s%s%s%s\n", - CARDNR(card), - (flag & 0x01) ? " point to point" : "", - (flag & 0x02) ? " point to multipoint" : "", - (flag & 0x08) ? " leased line without D-channel" : "", - (flag & 0x04) ? " leased line with D-channel" : "" - ); -} - -static void avmb1_card_down(avmb1_card * card, int notify) -{ - __u16 appl; - - card->cardstate = CARD_DETECTED; - - for (appl = 1; appl <= CAPI_MAXAPPL; appl++) { - avmb1_ncci **pp, **nextpp; - for (pp = &APPL(appl)->nccilist; *pp; pp = nextpp) { - if (NCCI2CTRL((*pp)->ncci) == card->cnr) { - avmb1_ncci *np = *pp; - *pp = np->next; - printk(KERN_INFO "b1capi: appl %d ncci 0x%x forced down!\n", appl, np->ncci); - kfree(np); - nextpp = pp; - } else { - nextpp = &(*pp)->next; - } - } - } - set_bit(CARDNR(card), ¬ify_down_set); - MOD_INC_USE_COUNT; - if (schedule_task(&tq_state_notify) == 0) - MOD_DEC_USE_COUNT; - printk(KERN_NOTICE "b1capi: card %d down.\n", CARDNR(card)); -} - -/* ------------------------------------------------------------- */ - - -int avmb1_registercard(int port, int irq, int cardtype, int allocio) -{ - struct avmb1_card *card; - int irqval,i; - - - for (i=0; i < CAPI_MAXCONTR && cards[i].cardstate != CARD_FREE; i++) ; - - if (i == CAPI_MAXCONTR) { - printk(KERN_ERR "b1capi: out of controller slots\n"); - return -ENFILE; - } - - card = &cards[i]; - memset(card, 0, sizeof(avmb1_card)); - sprintf(card->name, "avmb1-%d", CARDNR(card)); - - if (allocio) - request_region(port, AVMB1_PORTLEN, card->name); - - if ((irqval = request_irq(irq, avmb1_interrupt, - SA_SHIRQ, card->name, card)) != 0) { - printk(KERN_ERR "b1capi: unable to get IRQ %d (irqval=%d).\n", - irq, irqval); - release_region(port, AVMB1_PORTLEN); - return -EBUSY; - } - - card->cardstate = CARD_DETECTED; - ncards++; - card->cnr = CARDNR(card); - card->port = port; - card->irq = irq; - card->cardtype = cardtype; - return card->cnr; -} - -int avmb1_addcard(int port, int irq, int cardtype) -{ - return avmb1_registercard(port, irq, cardtype, 1); -} - -int avmb1_detectcard(int port, int irq, int cardtype) -{ - int rc; - - if (!B1_valid_irq(irq, cardtype)) { - printk(KERN_WARNING "b1capi: irq %d not valid for %s-card.\n", - irq, cardtype2str(cardtype)); - return -EINVAL; - } - if (!B1_valid_port(port, cardtype)) { - printk(KERN_WARNING "b1capi: port 0x%x not valid for %s-card.\n", - port, cardtype2str(cardtype)); - return -EINVAL; - } - B1_reset(port); - if ((rc = B1_detect(port, cardtype)) != 0) { - printk(KERN_NOTICE "b1capi: NO %s-card at 0x%x (%d)\n", - cardtype2str(cardtype), port, rc); - return -EIO; - } - B1_reset(port); - switch (cardtype) { - default: - case AVM_CARDTYPE_M1: - case AVM_CARDTYPE_M2: - case AVM_CARDTYPE_B1: - case AVM_CARDTYPE_B1PCI: - printk(KERN_NOTICE "b1capi: AVM-%s-Controller detected at 0x%x\n", cardtype2str(cardtype), port); - break; - case AVM_CARDTYPE_T1: - break; - } - - return 0; -} - -int avmb1_probecard(int port, int irq, int cardtype) -{ - if (check_region(port, AVMB1_PORTLEN)) { - printk(KERN_WARNING - "b1capi: ports 0x%03x-0x%03x in use.\n", - port, port + AVMB1_PORTLEN); - return -EBUSY; - } - return avmb1_detectcard(port, irq, cardtype); -} - -int avmb1_unregistercard(int cnr, int freeio) -{ - avmb1_card * card; - if (!VALID_CARD(cnr)) - return -ESRCH; - card = CARD(cnr); - - if (card->cardstate == CARD_FREE) - return -ESRCH; - if (card->cardstate == CARD_RUNNING) - avmb1_card_down(card, freeio); - - if (card->cardstate != CARD_FREE) - if (card->cardtype == AVM_CARDTYPE_T1) - T1_reset(card->port); - - free_irq(card->irq, card); - if (freeio) - release_region(card->port, AVMB1_PORTLEN); - card->cardstate = CARD_FREE; - return 0; -} - -int avmb1_resetcard(int cnr) -{ - avmb1_card * card; - - if (!VALID_CARD(cnr)) - return -ESRCH; - card = CARD(cnr); - if (card->cardstate == CARD_FREE) - return -ESRCH; - - if (card->cardstate == CARD_RUNNING) - avmb1_card_down(card, 0); - - B1_reset(card->port); - B1_reset(card->port); - - card->cardstate = CARD_DETECTED; - - return 0; -} - -/* ------------------------------------------------------------- */ -/* -------- CAPI2.0 Interface ---------------------------------- */ -/* ------------------------------------------------------------- */ - -static int capi_installed(void) -{ - int i; - for (i = 0; i < CAPI_MAXCONTR; i++) { - if (cards[i].cardstate == CARD_RUNNING) - return 1; - } - return 0; -} - -static __u16 capi_register(capi_register_params * rparam, __u16 * applidp) -{ - int nconn, want = rparam->level3cnt; - int i; - int appl; - - if (rparam->datablklen < 128) - return CAPI_LOGBLKSIZETOSMALL; - - for (appl = 1; appl <= CAPI_MAXAPPL; appl++) { - if (APPL_IS_FREE(appl)) - break; - } - if (appl > CAPI_MAXAPPL) - return CAPI_TOOMANYAPPLS; - - APPL_MARK_USED(appl); - skb_queue_head_init(&APPL(appl)->recv_queue); - - memcpy(&APPL(appl)->rparam, rparam, sizeof(capi_register_params)); - - for (i = 0; i < CAPI_MAXCONTR; i++) { - struct capi_profile *profp = - (struct capi_profile *)cards[i].version[VER_PROFILE]; - - if (cards[i].cardstate != CARD_RUNNING) - continue; - - if (want > 0) nconn = want; - else nconn = profp->nbchannel * -want; - if (nconn == 0) nconn = profp->nbchannel; - - B1_send_register(cards[i].port, appl, - 1024 * (nconn+1), nconn, - APPL(appl)->rparam.datablkcnt, - APPL(appl)->rparam.datablklen); - } - *applidp = appl; - printk(KERN_INFO "b1capi: appl %d up\n", appl); - - return CAPI_NOERROR; -} - -static __u16 capi_release(__u16 applid) -{ - struct sk_buff *skb; - int i; - - if (!VALID_APPLID(applid) || APPL(applid)->releasing) - return CAPI_ILLAPPNR; - while ((skb = skb_dequeue(&APPL(applid)->recv_queue)) != 0) - kfree_skb(skb); - for (i = 0; i < CAPI_MAXCONTR; i++) { - if (cards[i].cardstate != CARD_RUNNING) { - continue; - } - APPL(applid)->releasing++; - B1_send_release(cards[i].port, applid); - } - if (APPL(applid)->releasing <= 0) { - APPL(applid)->signal = 0; - APPL_MARK_FREE(applid); - printk(KERN_INFO "b1capi: appl %d down\n", applid); - } - return CAPI_NOERROR; -} - -static __u16 capi_put_message(__u16 applid, struct sk_buff *skb) -{ - avmb1_ncci *np; - int contr; - if (ncards == 0) - return CAPI_REGNOTINSTALLED; - if (!VALID_APPLID(applid)) - return CAPI_ILLAPPNR; - if (skb->len < 12 - || !capi_cmd_valid(CAPIMSG_COMMAND(skb->data)) - || !capi_subcmd_valid(CAPIMSG_SUBCOMMAND(skb->data))) - return CAPI_ILLCMDORSUBCMDORMSGTOSMALL; - contr = CAPIMSG_CONTROLLER(skb->data); - if (!VALID_CARD(contr) || CARD(contr)->cardstate != CARD_RUNNING) { - contr = 1; - if (CARD(contr)->cardstate != CARD_RUNNING) - return CAPI_REGNOTINSTALLED; - } - if (CARD(contr)->blocked) - return CAPI_SENDQUEUEFULL; - - if ( CAPIMSG_COMMAND(skb->data) == CAPI_DATA_B3 - && CAPIMSG_SUBCOMMAND(skb->data) == CAPI_REQ - && (np = find_ncci(APPL(applid), CAPIMSG_NCCI(skb->data))) != 0 - && mq_enqueue(np, CAPIMSG_MSGID(skb->data)) == 0) - return CAPI_SENDQUEUEFULL; - - B1_send_message(CARD(contr)->port, skb); - return CAPI_NOERROR; -} - -static __u16 capi_get_message(__u16 applid, struct sk_buff **msgp) -{ - struct sk_buff *skb; - - if (!VALID_APPLID(applid)) - return CAPI_ILLAPPNR; - if ((skb = skb_dequeue(&APPL(applid)->recv_queue)) == 0) - return CAPI_RECEIVEQUEUEEMPTY; - *msgp = skb; - return CAPI_NOERROR; -} - -static __u16 capi_set_signal(__u16 applid, - void (*signal) (__u16 applid, __u32 param), - __u32 param) -{ - if (!VALID_APPLID(applid)) - return CAPI_ILLAPPNR; - APPL(applid)->signal = signal; - APPL(applid)->param = param; - return CAPI_NOERROR; -} - -static __u16 capi_get_manufacturer(__u16 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; - - strncpy(buf, capi_manufakturer, CAPI_MANUFACTURER_LEN); - return CAPI_NOERROR; -} - -static __u16 capi_get_version(__u16 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; - - memcpy((void *) verp, &CARD(contr)->cversion, - sizeof(capi_version)); - return CAPI_NOERROR; -} - -static __u16 capi_get_serial(__u16 contr, __u8 serial[CAPI_SERIAL_LEN]) -{ - if (contr == 0) { - strncpy(serial, driver_serial, 8); - return CAPI_NOERROR; - } - if (!VALID_CARD(contr) || CARD(contr)->cardstate != CARD_RUNNING) - return 0x2002; - - memcpy((void *) serial, CARD(contr)->version[VER_SERIAL], - CAPI_SERIAL_LEN); - serial[CAPI_SERIAL_LEN - 1] = 0; - return CAPI_NOERROR; -} - -static __u16 capi_get_profile(__u16 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; - - memcpy((void *) profp, CARD(contr)->version[VER_PROFILE], - sizeof(struct capi_profile)); - return CAPI_NOERROR; -} - -static int capi_manufacturer(unsigned int cmd, void *data) -{ - unsigned long flags; - avmb1_loadandconfigdef ldef; - avmb1_extcarddef cdef; - avmb1_resetdef rdef; - avmb1_getdef gdef; - avmb1_card *card; - int rc; - - switch (cmd) { - case AVMB1_ADDCARD: - case AVMB1_ADDCARD_WITH_TYPE: - if (cmd == AVMB1_ADDCARD) { - if ((rc = copy_from_user((void *) &cdef, data, - sizeof(avmb1_carddef)))) - return rc; - cdef.cardtype = AVM_CARDTYPE_B1; - } else { - if ((rc = copy_from_user((void *) &cdef, data, - sizeof(avmb1_extcarddef)))) - return rc; - } - - if ((rc = avmb1_probecard(cdef.port, cdef.irq, cdef.cardtype)) != 0) - return rc; - - if (cdef.cardtype == AVM_CARDTYPE_T1) { - int i; - for (i=0; i < CAPI_MAXCONTR; i++) { - if ( cards[i].cardstate != CARD_FREE - && cards[i].cardtype == AVM_CARDTYPE_T1 - && cards[i].cardnr == cdef.cardnr) { - printk(KERN_ERR - "b1capi: T1-HEMA-card-%d already at 0x%x\n", - cdef.cardnr, cards[i].port); - return -EBUSY; - } - } - rc = T1_detectandinit(cdef.port,cdef.irq,cdef.cardnr); - if (rc) { - printk(KERN_NOTICE "b1capi: NO T1-HEMA-card-%d at 0x%x (%d)\n", - cdef.cardnr, cdef.port, rc); - return -EIO; - } - printk(KERN_NOTICE "b1capi: T1-HEMA-card-%d at 0x%x\n", - cdef.cardnr, cdef.port); - } - - rc = avmb1_addcard(cdef.port, cdef.irq, cdef.cardtype); - if (rc < 0) - return rc; - /* don't want to change interface t - addcard/probecard/registercard */ - if (cdef.cardtype == AVM_CARDTYPE_T1) { - int i; - for (i=0; i < CAPI_MAXCONTR; i++) { - if (cards[i].cnr == rc) { - cards[i].cardnr = cdef.cardnr; - break; - } - } - } - return rc; - - case AVMB1_LOAD: - case AVMB1_LOAD_AND_CONFIG: - - if (cmd == AVMB1_LOAD) { - if ((rc = copy_from_user((void *) &ldef, data, - sizeof(avmb1_loaddef)))) - return rc; - ldef.t4config.len = 0; - ldef.t4config.data = 0; - } else { - if ((rc = copy_from_user((void *) &ldef, data, - sizeof(avmb1_loadandconfigdef)))) - return rc; - } - if (!VALID_CARD(ldef.contr)) - return -ESRCH; - - if (ldef.t4file.len <= 0) { - printk(KERN_DEBUG "b1capi: load: invalid parameter: length of t4file is %d ?\n", ldef.t4file.len); - return -EINVAL; - } - - card = CARD(ldef.contr); - save_flags(flags); - cli(); - if (card->cardstate != CARD_DETECTED) { - restore_flags(flags); - if (loaddebug) - printk(KERN_DEBUG "b1capi: load: contr=%d not in detect state\n", ldef.contr); - return -EBUSY; - } - card->cardstate = CARD_LOADING; - restore_flags(flags); - - if (loaddebug) { - printk(KERN_DEBUG "b1capi: load: reseting contr %d\n", - ldef.contr); - } - - B1_reset(card->port); - - if (loaddebug) { - printk(KERN_DEBUG "b1capi: loading contr %d\n", - ldef.contr); - } - - if ((rc = B1_load_t4file(card->port, &ldef.t4file))) { - B1_reset(card->port); - printk(KERN_ERR "b1capi: failed to load t4file!!\n"); - card->cardstate = CARD_DETECTED; - return rc; - } - - B1_disable_irq(card->port); - - if (ldef.t4config.len > 0) { /* load config */ - if (loaddebug) { - printk(KERN_DEBUG "b1capi: loading config to contr %d\n", - ldef.contr); - } - if ((rc = B1_load_config(card->port, &ldef.t4config))) { - B1_reset(card->port); - printk(KERN_ERR "b1capi: failed to load config!!\n"); - card->cardstate = CARD_DETECTED; - return rc; - } - } - - if (loaddebug) { - printk(KERN_DEBUG "b1capi: load: ready contr %d: checking\n", - ldef.contr); - } - - if (!B1_loaded(card->port)) { - card->cardstate = CARD_DETECTED; - printk(KERN_ERR "b1capi: failed to load t4file.\n"); - return -EIO; - } - /* - * enable interrupt - */ - - card->cardstate = CARD_INITSTATE; - save_flags(flags); - cli(); - B1_setinterrupt(card->port, card->irq, card->cardtype); - restore_flags(flags); - - if (loaddebug) { - printk(KERN_DEBUG "b1capi: load: irq enabled contr %d\n", - ldef.contr); - } - - /* - * init card - */ - if (card->cardtype == AVM_CARDTYPE_T1) - B1_send_init(card->port, AVM_NAPPS, - AVM_NNCCI_PER_CHANNEL*30, - card->cnr - 1); - else - B1_send_init(card->port, AVM_NAPPS, - AVM_NNCCI_PER_CHANNEL*2, - card->cnr - 1); - - if (loaddebug) { - printk(KERN_DEBUG "b1capi: load: waiting for init reply contr %d\n", - ldef.contr); - } - - while (card->cardstate != CARD_RUNNING) { - - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(HZ/10); /* 0.1 sec */ - - if (signal_pending(current)) - return -EINTR; - } - return 0; - - case AVMB1_RESETCARD: - if ((rc = copy_from_user((void *) &rdef, data, - sizeof(avmb1_resetdef)))) - return rc; - - return avmb1_resetcard(rdef.contr); - - case AVMB1_GET_CARDINFO: - if ((rc = copy_from_user((void *) &gdef, data, - sizeof(avmb1_getdef)))) - return rc; - - if (!VALID_CARD(gdef.contr)) - return -ESRCH; - - card = CARD(gdef.contr); - - gdef.cardstate = card->cardstate; - gdef.cardtype = card->cardtype; - - if ((rc = copy_to_user(data, (void *) &gdef, - sizeof(avmb1_getdef)))) - return rc; - - return 0; - case AVMB1_REMOVECARD: - if ((rc = copy_from_user((void *) &rdef, data, - sizeof(avmb1_resetdef)))) - return rc; - if (!VALID_CARD(rdef.contr)) - return -ESRCH; - - card = CARD(rdef.contr); - - if (card->cardstate != CARD_DETECTED) - return -EBUSY; - - return avmb1_unregistercard(rdef.contr, 1); - } - return -EINVAL; -} - -struct capi_interface avmb1_interface = -{ - capi_installed, - capi_register, - capi_release, - capi_put_message, - capi_get_message, - capi_set_signal, - capi_get_manufacturer, - capi_get_version, - capi_get_serial, - capi_get_profile, - capi_manufacturer -}; - -/* ------------------------------------------------------------- */ -/* -------- Exported Functions --------------------------------- */ -/* ------------------------------------------------------------- */ - -struct capi_interface *attach_capi_interface(struct capi_interface_user *userp) -{ - struct capi_interface_user *p; - - for (p = capi_users; p; p = p->next) { - if (p == userp) { - printk(KERN_ERR "b1capi: double attach from %s\n", - userp->name); - return 0; - } - } - userp->next = capi_users; - capi_users = userp; - MOD_INC_USE_COUNT; - printk(KERN_NOTICE "b1capi: %s attached\n", userp->name); - - return &avmb1_interface; -} - -int detach_capi_interface(struct capi_interface_user *userp) -{ - struct capi_interface_user **pp; - - for (pp = &capi_users; *pp; pp = &(*pp)->next) { - if (*pp == userp) { - *pp = userp->next; - userp->next = 0; - MOD_DEC_USE_COUNT; - printk(KERN_NOTICE "b1capi: %s detached\n", userp->name); - return 0; - } - } - printk(KERN_ERR "b1capi: double detach from %s\n", userp->name); - return -1; -} - -/* ------------------------------------------------------------- */ -/* -------- Init & Cleanup ------------------------------------- */ -/* ------------------------------------------------------------- */ - -EXPORT_SYMBOL(attach_capi_interface); -EXPORT_SYMBOL(detach_capi_interface); -EXPORT_SYMBOL(avmb1_addcard); -EXPORT_SYMBOL(avmb1_probecard); -EXPORT_SYMBOL(avmb1_registercard); -EXPORT_SYMBOL(avmb1_unregistercard); -EXPORT_SYMBOL(avmb1_resetcard); -EXPORT_SYMBOL(avmb1_detectcard); - - -/* - * init / exit functions - */ - -#ifdef MODULE -#define avmb1_init init_module -#endif - -int avmb1_init(void) -{ - char *p; - char rev[10]; - - skb_queue_head_init(&recv_queue); - /* init_bh(CAPI_BH, do_capi_bh); */ - - tq_state_notify.routine = notify_handler; - tq_state_notify.data = 0; - - tq_recv_notify.routine = recv_handler; - tq_recv_notify.data = 0; - - - if ((p = strchr(revision, ':'))) { - strcpy(rev, p + 1); - p = strchr(rev, '$'); - *p = 0; - } else - strcpy(rev, " ??? "); - -#ifdef MODULE - printk(KERN_NOTICE "AVM-B1-CAPI-driver Rev%s: loaded\n", rev); -#else - printk(KERN_NOTICE "AVM-B1-CAPI-driver Rev%s: started\n", rev); -#endif - return 0; -} - -#ifdef MODULE -void cleanup_module(void) -{ - char rev[10]; - char *p; - int i; - - if ((p = strchr(revision, ':'))) { - strcpy(rev, p + 1); - p = strchr(rev, '$'); - *p = 0; - } else { - strcpy(rev, " ??? "); - } - - for (i = 0; i < CAPI_MAXCONTR; i++) { - if (cards[i].cardstate != CARD_FREE) { - /* - * disable card - */ - B1_disable_irq(cards[i].port); - avmb1_resetcard(i+1); - /* - * free kernel resources - */ - avmb1_unregistercard(i+1, 1); - } - } - schedule(); /* execute queued tasks .... */ - printk(KERN_NOTICE "AVM-B1-CAPI-driver Rev%s: unloaded\n", rev); -} -#endif diff --git a/drivers/isdn/avmb1/b1lli.c b/drivers/isdn/avmb1/b1lli.c deleted file mode 100644 index 4d9fd647c..000000000 --- a/drivers/isdn/avmb1/b1lli.c +++ /dev/null @@ -1,1074 +0,0 @@ -/* - * $Id: b1lli.c,v 1.10 1999/04/15 19:49:31 calle Exp $ - * - * ISDN lowlevel-module for AVM B1-card. - * - * (c) Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de) - * - * $Log: b1lli.c,v $ - * Revision 1.10 1999/04/15 19:49:31 calle - * fix fuer die B1-PCI. Jetzt geht z.B. auch IRQ 17 ... - * - * Revision 1.9 1999/01/05 18:33:23 he - * merged remaining 2.2pre{1,2} changes (jiffies and Config) - * - * Revision 1.8 1998/10/25 14:39:00 fritz - * Backported from MIPS (Cobalt). - * - * Revision 1.7 1998/03/29 16:06:00 calle - * changes from 2.0 tree merged. - * - * Revision 1.1.2.10 1998/03/20 20:34:41 calle - * port valid check now only for T1, because of the PCI and PCMCIA cards. - * - * Revision 1.1.2.9 1998/03/20 14:38:20 calle - * capidrv: prepared state machines for suspend/resume/hold - * capidrv: fix bug in state machine if B1/T1 is out of nccis - * b1capi: changed some errno returns. - * b1capi: detect if you try to add same T1 to different io address. - * b1capi: change number of nccis depending on number of channels. - * b1lli: cosmetics - * - * Revision 1.1.2.8 1998/03/18 17:43:29 calle - * T1 with fastlink, bugfix for multicontroller support in capidrv.c - * - * Revision 1.1.2.7 1998/03/04 17:33:50 calle - * Changes for T1. - * - * Revision 1.1.2.6 1998/02/27 15:40:44 calle - * T1 running with slow link. bugfix in capi_release. - * - * Revision 1.1.2.5 1998/02/13 16:28:28 calle - * first step for T1 - * - * Revision 1.6 1998/02/13 07:09:11 calle - * change for 2.1.86 (removing FREE_READ/FREE_WRITE from [dev]_kfree_skb() - * - * Revision 1.5 1998/01/31 11:14:41 calle - * merged changes to 2.0 tree, prepare 2.1.82 to work. - * - * Revision 1.4 1997/12/10 20:00:48 calle - * get changes from 2.0 version - * - * Revision 1.1.2.2 1997/11/26 10:46:55 calle - * prepared for M1 (Mobile) and T1 (PMX) cards. - * prepared to set configuration after load to support other D-channel - * protocols, point-to-point and leased lines. - * - * Revision 1.3 1997/10/01 09:21:13 fritz - * Removed old compatibility stuff for 2.0.X kernels. - * From now on, this code is for 2.1.X ONLY! - * Old stuff is still in the separate branch. - * - * Revision 1.2 1997/07/13 12:22:42 calle - * bug fix for more than one controller in connect_req. - * debugoutput now with contrnr. - * - * - * Revision 1.1 1997/03/04 21:50:28 calle - * Frirst version in isdn4linux - * - * Revision 2.2 1997/02/12 09:31:39 calle - * new version - * - * Revision 1.1 1997/01/31 10:32:20 calle - * Initial revision - * - * - */ -/* #define FASTLINK_DEBUG */ - -#include <linux/kernel.h> -#include <linux/skbuff.h> -#include <linux/delay.h> -#include <linux/mm.h> -#include <asm/segment.h> -#include <asm/io.h> -#include <linux/capi.h> -#include <linux/b1lli.h> - -#include "compat.h" -#include "capicmd.h" -#include "capiutil.h" - -extern int showcapimsgs; - -/* - * LLI Messages to the ISDN-ControllerISDN Controller - */ - -#define SEND_POLL 0x72 /* - * after load <- RECEIVE_POLL - */ -#define SEND_INIT 0x11 /* - * first message <- RECEIVE_INIT - * int32 NumApplications int32 - * NumNCCIs int32 BoardNumber - */ -#define SEND_REGISTER 0x12 /* - * register an application int32 - * ApplIDId int32 NumMessages - * int32 NumB3Connections int32 - * NumB3Blocks int32 B3Size - * - * AnzB3Connection != 0 && - * AnzB3Blocks >= 1 && B3Size >= 1 - */ -#define SEND_RELEASE 0x14 /* - * deregister an application int32 - * ApplID - */ -#define SEND_MESSAGE 0x15 /* - * send capi-message int32 length - * capi-data ... - */ -#define SEND_DATA_B3_REQ 0x13 /* - * send capi-data-message int32 - * MsgLength capi-data ... int32 - * B3Length data .... - */ - -#define SEND_CONFIG 0x21 /* - */ - -#define SEND_POLLACK 0x73 /* T1 Watchdog */ - -/* - * LLI Messages from the ISDN-ControllerISDN Controller - */ - -#define RECEIVE_POLL 0x32 /* - * <- after SEND_POLL - */ -#define RECEIVE_INIT 0x27 /* - * <- after SEND_INIT int32 length - * byte total length b1struct board - * driver revision b1struct card - * type b1struct reserved b1struct - * serial number b1struct driver - * capability b1struct d-channel - * protocol b1struct CAPI-2.0 - * profile b1struct capi version - */ -#define RECEIVE_MESSAGE 0x21 /* - * <- after SEND_MESSAGE int32 - * AppllID int32 Length capi-data - * .... - */ -#define RECEIVE_DATA_B3_IND 0x22 /* - * received data int32 AppllID - * int32 Length capi-data ... - * int32 B3Length data ... - */ -#define RECEIVE_START 0x23 /* - * Handshake - */ -#define RECEIVE_STOP 0x24 /* - * Handshake - */ -#define RECEIVE_NEW_NCCI 0x25 /* - * int32 AppllID int32 NCCI int32 - * WindowSize - */ -#define RECEIVE_FREE_NCCI 0x26 /* - * int32 AppllID int32 NCCI - */ -#define RECEIVE_RELEASE 0x26 /* - * int32 AppllID int32 0xffffffff - */ -#define RECEIVE_TASK_READY 0x31 /* - * int32 tasknr - * int32 Length Taskname ... - */ - -#define WRITE_REGISTER 0x00 -#define READ_REGISTER 0x01 - -/* - * port offsets - */ - -#define B1_READ 0x00 -#define B1_WRITE 0x01 -#define B1_INSTAT 0x02 -#define B1_OUTSTAT 0x03 -#define B1_RESET 0x10 -#define B1_ANALYSE 0x04 - -/* Hema card T1 */ - -#define T1_FASTLINK 0x00 -#define T1_SLOWLINK 0x08 - -#define T1_READ B1_READ -#define T1_WRITE B1_WRITE -#define T1_INSTAT B1_INSTAT -#define T1_OUTSTAT B1_OUTSTAT -#define T1_IRQENABLE 0x05 -#define T1_FIFOSTAT 0x06 -#define T1_RESETLINK 0x10 -#define T1_ANALYSE 0x11 -#define T1_IRQMASTER 0x12 -#define T1_IDENT 0x17 -#define T1_RESETBOARD 0x1f - -#define T1F_IREADY 0x01 -#define T1F_IHALF 0x02 -#define T1F_IFULL 0x04 -#define T1F_IEMPTY 0x08 -#define T1F_IFLAGS 0xF0 - -#define T1F_OREADY 0x10 -#define T1F_OHALF 0x20 -#define T1F_OEMPTY 0x40 -#define T1F_OFULL 0x80 -#define T1F_OFLAGS 0xF0 - -/* there are HEMA cards with 1k and 4k FIFO out */ -#define FIFO_OUTBSIZE 256 -#define FIFO_INPBSIZE 512 - -#define HEMA_VERSION_ID 0 -#define HEMA_PAL_ID 0 - -#define B1_STAT0(cardtype) ((cardtype) == AVM_CARDTYPE_M1 ? 0x81200000l : 0x80A00000l) -#define B1_STAT1(cardtype) (0x80E00000l) - - -static inline unsigned char b1outp(unsigned int base, - unsigned short offset, - unsigned char value) -{ - outb(value, base + offset); - return inb(base + B1_ANALYSE); -} - -static inline void t1outp(unsigned int base, - unsigned short offset, - unsigned char value) -{ - outb(value, base + offset); -} - -static inline unsigned char t1inp(unsigned int base, - unsigned short offset) -{ - return inb(base + offset); -} - -static inline int B1_isfastlink(unsigned int base) -{ - return (inb(base + T1_IDENT) & ~0x82) == 1; -} -static inline unsigned char B1_fifostatus(unsigned int base) -{ - return inb(base + T1_FIFOSTAT); -} - -static inline int B1_rx_full(unsigned int base) -{ - return inb(base + B1_INSTAT) & 0x1; -} - -static inline unsigned char B1_get_byte(unsigned int base) -{ - unsigned long i = jiffies + 1 * HZ; /* maximum wait time 1 sec */ - while (!B1_rx_full(base) && time_before(jiffies, i)); - if (B1_rx_full(base)) - return inb(base + B1_READ); - printk(KERN_CRIT "b1lli(0x%x): rx not full after 1 second\n", base); - return 0; -} - -static inline unsigned int B1_get_word(unsigned int base) -{ - unsigned int val = 0; - val |= B1_get_byte(base); - val |= (B1_get_byte(base) << 8); - val |= (B1_get_byte(base) << 16); - val |= (B1_get_byte(base) << 24); - return val; -} - -static inline int B1_tx_empty(unsigned int base) -{ - return inb(base + B1_OUTSTAT) & 0x1; -} - -static inline void B1_put_byte(unsigned int base, unsigned char val) -{ - while (!B1_tx_empty(base)); - b1outp(base, B1_WRITE, val); -} - -static inline void B1_put_word(unsigned int base, unsigned int val) -{ - B1_put_byte(base, val & 0xff); - B1_put_byte(base, (val >> 8) & 0xff); - B1_put_byte(base, (val >> 16) & 0xff); - B1_put_byte(base, (val >> 24) & 0xff); -} - -static inline unsigned int B1_get_slice(unsigned int base, - unsigned char *dp) -{ - unsigned int len, i; -#ifdef FASTLINK_DEBUG - unsigned wcnt = 0, bcnt = 0; -#endif - - len = i = B1_get_word(base); - if (B1_isfastlink(base)) { - int status; - while (i > 0) { - status = B1_fifostatus(base) & (T1F_IREADY|T1F_IHALF); - if (i >= FIFO_INPBSIZE) status |= T1F_IFULL; - - switch (status) { - case T1F_IREADY|T1F_IHALF|T1F_IFULL: - insb(base+B1_READ, dp, FIFO_INPBSIZE); - dp += FIFO_INPBSIZE; - i -= FIFO_INPBSIZE; -#ifdef FASTLINK_DEBUG - wcnt += FIFO_INPBSIZE; -#endif - break; - case T1F_IREADY|T1F_IHALF: - insb(base+B1_READ,dp, i); -#ifdef FASTLINK_DEBUG - wcnt += i; -#endif - dp += i; - i = 0; - if (i == 0) - break; - /* fall through */ - default: - *dp++ = B1_get_byte(base); - i--; -#ifdef FASTLINK_DEBUG - bcnt++; -#endif - break; - } - } -#ifdef FASTLINK_DEBUG - if (wcnt) - printk(KERN_DEBUG "b1lli(0x%x): get_slice l=%d w=%d b=%d\n", - base, len, wcnt, bcnt); -#endif - } else { - while (i-- > 0) - *dp++ = B1_get_byte(base); - } - return len; -} - -static inline void B1_put_slice(unsigned int base, - unsigned char *dp, unsigned int len) -{ - unsigned i = len; - B1_put_word(base, i); - if (B1_isfastlink(base)) { - int status; - while (i > 0) { - status = B1_fifostatus(base) & (T1F_OREADY|T1F_OHALF); - if (i >= FIFO_OUTBSIZE) status |= T1F_OEMPTY; - switch (status) { - case T1F_OREADY|T1F_OHALF|T1F_OEMPTY: - outsb(base+B1_WRITE, dp, FIFO_OUTBSIZE); - dp += FIFO_OUTBSIZE; - i -= FIFO_OUTBSIZE; - break; - case T1F_OREADY|T1F_OHALF: - outsb(base+B1_WRITE, dp, i); - dp += i; - i = 0; - break; - default: - B1_put_byte(base, *dp++); - i--; - break; - } - } - } else { - while (i-- > 0) - B1_put_byte(base, *dp++); - } -} - -static void b1_wr_reg(unsigned int base, - unsigned int reg, - unsigned int value) -{ - B1_put_byte(base, WRITE_REGISTER); - B1_put_word(base, reg); - B1_put_word(base, value); -} - -static inline unsigned int b1_rd_reg(unsigned int base, - unsigned int reg) -{ - B1_put_byte(base, READ_REGISTER); - B1_put_word(base, reg); - return B1_get_word(base); - -} - -static inline void b1_set_test_bit(unsigned int base, - int cardtype, - int onoff) -{ - b1_wr_reg(base, B1_STAT0(cardtype), onoff ? 0x21 : 0x20); -} - -static inline int b1_get_test_bit(unsigned int base, - int cardtype) -{ - return (b1_rd_reg(base, B1_STAT0(cardtype)) & 0x01) != 0; -} - -static int irq_table[16] = -{0, - 0, - 0, - 192, /* irq 3 */ - 32, /* irq 4 */ - 160, /* irq 5 */ - 96, /* irq 6 */ - 224, /* irq 7 */ - 0, - 64, /* irq 9 */ - 80, /* irq 10 */ - 208, /* irq 11 */ - 48, /* irq 12 */ - 0, - 0, - 112, /* irq 15 */ -}; - -static int hema_irq_table[16] = -{0, - 0, - 0, - 0x80, /* irq 3 */ - 0, - 0x90, /* irq 5 */ - 0, - 0xA0, /* irq 7 */ - 0, - 0xB0, /* irq 9 */ - 0xC0, /* irq 10 */ - 0xD0, /* irq 11 */ - 0xE0, /* irq 12 */ - 0, - 0, - 0xF0, /* irq 15 */ -}; - - -int B1_valid_irq(unsigned irq, int cardtype) -{ - switch (cardtype) { - default: - case AVM_CARDTYPE_M1: - case AVM_CARDTYPE_M2: - case AVM_CARDTYPE_B1: - return irq_table[irq & 0xf] != 0; - case AVM_CARDTYPE_T1: - return hema_irq_table[irq & 0xf] != 0; - case AVM_CARDTYPE_B1PCI: - return 1; - } -} - -int B1_valid_port(unsigned port, int cardtype) -{ - switch (cardtype) { - default: - case AVM_CARDTYPE_M1: - case AVM_CARDTYPE_M2: - case AVM_CARDTYPE_B1: -#if 0 /* problem with PCMCIA and PCI cards */ - switch (port) { - case 0x150: - case 0x250: - case 0x300: - case 0x340: - return 1; - } - return 0; -#else - return 1; -#endif - case AVM_CARDTYPE_B1PCI: - return 1; - case AVM_CARDTYPE_T1: - return ((port & 0x7) == 0) && ((port & 0x30) != 0x30); - } -} - -void B1_setinterrupt(unsigned int base, - unsigned irq, int cardtype) -{ - switch (cardtype) { - case AVM_CARDTYPE_T1: - t1outp(base, B1_INSTAT, 0x00); - t1outp(base, B1_INSTAT, 0x02); - t1outp(base, T1_IRQMASTER, 0x08); - break; - default: - case AVM_CARDTYPE_M1: - case AVM_CARDTYPE_M2: - case AVM_CARDTYPE_B1: - b1outp(base, B1_INSTAT, 0x00); - b1outp(base, B1_RESET, irq_table[irq]); - b1outp(base, B1_INSTAT, 0x02); - break; - case AVM_CARDTYPE_B1PCI: - b1outp(base, B1_INSTAT, 0x00); - b1outp(base, B1_RESET, 0xf0); - b1outp(base, B1_INSTAT, 0x02); - break; - } -} - -unsigned char B1_disable_irq(unsigned int base) -{ - return b1outp(base, B1_INSTAT, 0x00); -} - -void T1_disable_irq(unsigned int base) -{ - t1outp(base, T1_IRQMASTER, 0x00); -} - -void B1_reset(unsigned int base) -{ - b1outp(base, B1_RESET, 0); - udelay(55 * 2 * 1000); /* 2 TIC's */ - - b1outp(base, B1_RESET, 1); - udelay(55 * 2 * 1000); /* 2 TIC's */ - - b1outp(base, B1_RESET, 0); - udelay(55 * 2 * 1000); /* 2 TIC's */ -} - -void T1_reset(unsigned int base) -{ - /* reset T1 Controller */ - B1_reset(base); - /* disable irq on HEMA */ - t1outp(base, B1_INSTAT, 0x00); - t1outp(base, B1_OUTSTAT, 0x00); - t1outp(base, T1_IRQMASTER, 0x00); - /* reset HEMA board configuration */ - t1outp(base, T1_RESETBOARD, 0xf); -} - -int B1_detect(unsigned int base, int cardtype) -{ - int onoff, i; - - if (cardtype == AVM_CARDTYPE_T1) - return 0; - - /* - * Statusregister 0000 00xx - */ - if ((inb(base + B1_INSTAT) & 0xfc) - || (inb(base + B1_OUTSTAT) & 0xfc)) - return 1; - /* - * Statusregister 0000 001x - */ - b1outp(base, B1_INSTAT, 0x2); /* enable irq */ - /* b1outp(base, B1_OUTSTAT, 0x2); */ - if ((inb(base + B1_INSTAT) & 0xfe) != 0x2 - /* || (inb(base + B1_OUTSTAT) & 0xfe) != 0x2 */) - return 2; - /* - * Statusregister 0000 000x - */ - b1outp(base, B1_INSTAT, 0x0); /* disable irq */ - b1outp(base, B1_OUTSTAT, 0x0); - if ((inb(base + B1_INSTAT) & 0xfe) - || (inb(base + B1_OUTSTAT) & 0xfe)) - return 3; - - for (onoff = !0, i= 0; i < 10 ; i++) { - b1_set_test_bit(base, cardtype, onoff); - if (b1_get_test_bit(base, cardtype) != onoff) - return 4; - onoff = !onoff; - } - - if (cardtype == AVM_CARDTYPE_M1) - return 0; - - if ((b1_rd_reg(base, B1_STAT1(cardtype)) & 0x0f) != 0x01) - return 5; - - return 0; -} - -int T1_detectandinit(unsigned int base, unsigned irq, int cardnr) -{ - unsigned char cregs[8]; - unsigned char reverse_cardnr; - unsigned long flags; - unsigned char dummy; - int i; - - reverse_cardnr = ((cardnr & 0x01) << 3) | ((cardnr & 0x02) << 1) - | ((cardnr & 0x04) >> 1) | ((cardnr & 0x08) >> 3); - cregs[0] = (HEMA_VERSION_ID << 4) | (reverse_cardnr & 0xf); - cregs[1] = 0x00; /* fast & slow link connected to CON1 */ - cregs[2] = 0x05; /* fast link 20MBit, slow link 20 MBit */ - cregs[3] = 0; - cregs[4] = 0x11; /* zero wait state */ - cregs[5] = hema_irq_table[irq & 0xf]; - cregs[6] = 0; - cregs[7] = 0; - - save_flags(flags); - cli(); - /* board reset */ - t1outp(base, T1_RESETBOARD, 0xf); - udelay(100 * 1000); - dummy = t1inp(base, T1_FASTLINK+T1_OUTSTAT); /* first read */ - - /* write config */ - dummy = (base >> 4) & 0xff; - for (i=1;i<=0xf;i++) t1outp(base, i, dummy); - t1outp(base, HEMA_PAL_ID & 0xf, dummy); - t1outp(base, HEMA_PAL_ID >> 4, cregs[0]); - for(i=1;i<7;i++) t1outp(base, 0, cregs[i]); - t1outp(base, ((base >> 4)) & 0x3, cregs[7]); - restore_flags(flags); - - udelay(100 * 1000); - t1outp(base, T1_FASTLINK+T1_RESETLINK, 0); - t1outp(base, T1_SLOWLINK+T1_RESETLINK, 0); - udelay(10 * 1000); - t1outp(base, T1_FASTLINK+T1_RESETLINK, 1); - t1outp(base, T1_SLOWLINK+T1_RESETLINK, 1); - udelay(100 * 1000); - t1outp(base, T1_FASTLINK+T1_RESETLINK, 0); - t1outp(base, T1_SLOWLINK+T1_RESETLINK, 0); - udelay(10 * 1000); - t1outp(base, T1_FASTLINK+T1_ANALYSE, 0); - udelay(5 * 1000); - t1outp(base, T1_SLOWLINK+T1_ANALYSE, 0); - - if (t1inp(base, T1_FASTLINK+T1_OUTSTAT) != 0x1) /* tx empty */ - return 1; - if (t1inp(base, T1_FASTLINK+T1_INSTAT) != 0x0) /* rx empty */ - return 2; - if (t1inp(base, T1_FASTLINK+T1_IRQENABLE) != 0x0) - return 3; - if ((t1inp(base, T1_FASTLINK+T1_FIFOSTAT) & 0xf0) != 0x70) - return 4; - if ((t1inp(base, T1_FASTLINK+T1_IRQMASTER) & 0x0e) != 0) - return 5; - if ((t1inp(base, T1_FASTLINK+T1_IDENT) & 0x7d) != 1) - return 6; - if (t1inp(base, T1_SLOWLINK+T1_OUTSTAT) != 0x1) /* tx empty */ - return 7; - if ((t1inp(base, T1_SLOWLINK+T1_IRQMASTER) & 0x0e) != 0) - return 8; - if ((t1inp(base, T1_SLOWLINK+T1_IDENT) & 0x7d) != 0) - return 9; - return 0; -} - -extern int loaddebug; - -int B1_load_t4file(unsigned int base, avmb1_t4file * t4file) -{ - /* - * Data is in user space !!! - */ - unsigned char buf[256]; - unsigned char *dp; - int i, left, retval; - - - dp = t4file->data; - left = t4file->len; - while (left > sizeof(buf)) { - retval = copy_from_user(buf, dp, sizeof(buf)); - if (retval) - return -EFAULT; - if (loaddebug) - printk(KERN_DEBUG "b1capi: loading: %d bytes ..", sizeof(buf)); - for (i = 0; i < sizeof(buf); i++) - B1_put_byte(base, buf[i]); - if (loaddebug) - printk("ok\n"); - left -= sizeof(buf); - dp += sizeof(buf); - } - if (left) { - retval = copy_from_user(buf, dp, left); - if (retval) - return -EFAULT; - if (loaddebug) - printk(KERN_DEBUG "b1capi: loading: %d bytes ..", left); - for (i = 0; i < left; i++) - B1_put_byte(base, buf[i]); - if (loaddebug) - printk("ok\n"); - } - return 0; -} - -int B1_load_config(unsigned int base, avmb1_t4file * config) -{ - /* - * Data is in user space !!! - */ - unsigned char buf[256]; - unsigned char *dp; - int i, j, left, retval; - - - dp = config->data; - left = config->len; - if (left) { - B1_put_byte(base, SEND_CONFIG); - B1_put_word(base, 1); - B1_put_byte(base, SEND_CONFIG); - B1_put_word(base, left); - } - while (left > sizeof(buf)) { - retval = copy_from_user(buf, dp, sizeof(buf)); - if (retval) - return -EFAULT; - if (loaddebug) - printk(KERN_DEBUG "b1capi: conf load: %d bytes ..", sizeof(buf)); - for (i = 0; i < sizeof(buf); ) { - B1_put_byte(base, SEND_CONFIG); - for (j=0; j < 4; j++) { - B1_put_byte(base, buf[i++]); - } - } - if (loaddebug) - printk("ok\n"); - left -= sizeof(buf); - dp += sizeof(buf); - } - if (left) { - retval = copy_from_user(buf, dp, left); - if (retval) - return -EFAULT; - if (loaddebug) - printk(KERN_DEBUG "b1capi: conf load: %d bytes ..", left); - for (i = 0; i < left; ) { - B1_put_byte(base, SEND_CONFIG); - for (j=0; j < 4; j++) { - if (i < left) - B1_put_byte(base, buf[i++]); - else - B1_put_byte(base, 0); - } - } - if (loaddebug) - printk("ok\n"); - } - return 0; -} - -int B1_loaded(unsigned int base) -{ - int i; - unsigned char ans; - - if (loaddebug) - printk(KERN_DEBUG "b1capi: loaded: wait 1 ..\n"); - for (i = jiffies + 10 * HZ; time_before(jiffies, i);) { - if (B1_tx_empty(base)) - break; - } - if (!B1_tx_empty(base)) { - printk(KERN_ERR "b1lli(0x%x): B1_loaded: timeout tx\n", base); - return 0; - } - B1_put_byte(base, SEND_POLL); - printk(KERN_DEBUG "b1capi: loaded: wait 2 ..\n"); - for (i = jiffies + 10 * HZ; time_before(jiffies, i);) { - if (B1_rx_full(base)) { - if ((ans = B1_get_byte(base)) == RECEIVE_POLL) { - if (loaddebug) - printk(KERN_DEBUG "b1capi: loaded: ok\n"); - return 1; - } - printk(KERN_ERR "b1lli(0x%x): B1_loaded: got 0x%x ???\n", - base, ans); - return 0; - } - } - printk(KERN_ERR "b1lli(0x%x): B1_loaded: timeout rx\n", base); - return 0; -} - -/* - * ------------------------------------------------------------------- - */ -static inline void parse_version(avmb1_card * card) -{ - int i, j; - for (j = 0; j < AVM_MAXVERSION; j++) - card->version[j] = "\0\0" + 1; - for (i = 0, j = 0; - j < AVM_MAXVERSION && i < card->versionlen; - j++, i += card->versionbuf[i] + 1) - card->version[j] = &card->versionbuf[i + 1]; -} -/* - * ------------------------------------------------------------------- - */ - -void B1_send_init(unsigned int port, - unsigned int napps, unsigned int nncci, unsigned int cardnr) -{ - unsigned long flags; - - save_flags(flags); - cli(); - B1_put_byte(port, SEND_INIT); - B1_put_word(port, napps); - B1_put_word(port, nncci); - B1_put_word(port, cardnr); - restore_flags(flags); -} - -void B1_send_register(unsigned int port, - __u16 appid, __u32 nmsg, - __u32 nb3conn, __u32 nb3blocks, __u32 b3bsize) -{ - unsigned long flags; - - save_flags(flags); - cli(); - B1_put_byte(port, SEND_REGISTER); - B1_put_word(port, appid); - B1_put_word(port, nmsg); - B1_put_word(port, nb3conn); - B1_put_word(port, nb3blocks); - B1_put_word(port, b3bsize); - restore_flags(flags); -} - -void B1_send_release(unsigned int port, - __u16 appid) -{ - unsigned long flags; - - save_flags(flags); - cli(); - B1_put_byte(port, SEND_RELEASE); - B1_put_word(port, appid); - restore_flags(flags); -} - -void B1_send_message(unsigned int port, struct sk_buff *skb) -{ - unsigned long flags; - __u16 len = CAPIMSG_LEN(skb->data); - __u8 cmd = CAPIMSG_COMMAND(skb->data); - __u8 subcmd = CAPIMSG_SUBCOMMAND(skb->data); - __u32 contr = CAPIMSG_CONTROL(skb->data); - - if (CAPICMD(cmd, subcmd) == CAPI_DATA_B3_REQ) { - __u16 dlen = CAPIMSG_DATALEN(skb->data); - - if (showcapimsgs > 2) { - if (showcapimsgs & 1) { - printk(KERN_DEBUG "b1lli: Put [0x%lx] id#%d %s len=%u\n", - (unsigned long) contr, - CAPIMSG_APPID(skb->data), - capi_cmd2str(cmd, subcmd), len); - } else { - printk(KERN_DEBUG "b1lli: Put [0x%lx] %s\n", - (unsigned long) contr, - capi_message2str(skb->data)); - } - - } - save_flags(flags); - cli(); - B1_put_byte(port, SEND_DATA_B3_REQ); - B1_put_slice(port, skb->data, len); - B1_put_slice(port, skb->data + len, dlen); - restore_flags(flags); - } else { - if (showcapimsgs) { - - if (showcapimsgs & 1) { - printk(KERN_DEBUG "b1lli: Put [0x%lx] id#%d %s len=%u\n", - (unsigned long) contr, - CAPIMSG_APPID(skb->data), - capi_cmd2str(cmd, subcmd), len); - } else { - printk(KERN_DEBUG "b1lli: Put [0x%lx] %s\n", (unsigned long)contr, capi_message2str(skb->data)); - } - } - save_flags(flags); - cli(); - B1_put_byte(port, SEND_MESSAGE); - B1_put_slice(port, skb->data, len); - restore_flags(flags); - } - dev_kfree_skb(skb); -} - -/* - * ------------------------------------------------------------------- - */ - -void B1_handle_interrupt(avmb1_card * card) -{ - unsigned char b1cmd; - struct sk_buff *skb; - - unsigned ApplId; - unsigned MsgLen; - unsigned DataB3Len; - unsigned NCCI; - unsigned WindowSize; - -t1retry: - if (!B1_rx_full(card->port)) - return; - - b1cmd = B1_get_byte(card->port); - - switch (b1cmd) { - - case RECEIVE_DATA_B3_IND: - - ApplId = (unsigned) B1_get_word(card->port); - MsgLen = B1_get_slice(card->port, card->msgbuf); - DataB3Len = B1_get_slice(card->port, card->databuf); - - if (showcapimsgs > 2) { - __u8 cmd = CAPIMSG_COMMAND(card->msgbuf); - __u8 subcmd = CAPIMSG_SUBCOMMAND(card->msgbuf); - __u32 contr = CAPIMSG_CONTROL(card->msgbuf); - CAPIMSG_SETDATA(card->msgbuf, card->databuf); - if (showcapimsgs & 1) { - printk(KERN_DEBUG "b1lli: Got [0x%lx] id#%d %s len=%u/%u\n", - (unsigned long) contr, - CAPIMSG_APPID(card->msgbuf), - capi_cmd2str(cmd, subcmd), - MsgLen, DataB3Len); - } else { - printk(KERN_DEBUG "b1lli: Got [0x%lx] %s\n", (unsigned long)contr, capi_message2str(card->msgbuf)); - } - } - if (!(skb = dev_alloc_skb(DataB3Len + MsgLen))) { - printk(KERN_ERR "b1lli: incoming packet dropped\n"); - } else { - memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen); - memcpy(skb_put(skb, DataB3Len), card->databuf, DataB3Len); - CAPIMSG_SETDATA(skb->data, skb->data + MsgLen); - avmb1_handle_capimsg(card, ApplId, skb); - } - break; - - case RECEIVE_MESSAGE: - - ApplId = (unsigned) B1_get_word(card->port); - MsgLen = B1_get_slice(card->port, card->msgbuf); - if (showcapimsgs) { - __u8 cmd = CAPIMSG_COMMAND(card->msgbuf); - __u8 subcmd = CAPIMSG_SUBCOMMAND(card->msgbuf); - __u32 contr = CAPIMSG_CONTROL(card->msgbuf); - if (showcapimsgs & 1) { - printk(KERN_DEBUG "b1lli: Got [0x%lx] id#%d %s len=%u\n", - (unsigned long) contr, - CAPIMSG_APPID(card->msgbuf), - capi_cmd2str(cmd, subcmd), - MsgLen); - } else { - printk(KERN_DEBUG "b1lli: Got [0x%lx] %s\n", - (unsigned long) contr, - capi_message2str(card->msgbuf)); - } - - } - if (!(skb = dev_alloc_skb(MsgLen))) { - printk(KERN_ERR "b1lli: incoming packet dropped\n"); - } else { - memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen); - avmb1_handle_capimsg(card, ApplId, skb); - } - break; - - case RECEIVE_NEW_NCCI: - - ApplId = B1_get_word(card->port); - NCCI = B1_get_word(card->port); - WindowSize = B1_get_word(card->port); - - if (showcapimsgs) - printk(KERN_DEBUG "b1lli(0x%x): NEW_NCCI app %u ncci 0x%x\n", card->port, ApplId, NCCI); - - avmb1_handle_new_ncci(card, ApplId, NCCI, WindowSize); - - break; - - case RECEIVE_FREE_NCCI: - - ApplId = B1_get_word(card->port); - NCCI = B1_get_word(card->port); - - if (showcapimsgs) - printk(KERN_DEBUG "b1lli(0x%x): FREE_NCCI app %u ncci 0x%x\n", card->port, ApplId, NCCI); - - avmb1_handle_free_ncci(card, ApplId, NCCI); - break; - - case RECEIVE_START: - if (card->cardtype == AVM_CARDTYPE_T1) { - B1_put_byte(card->port, SEND_POLLACK); - /* printk(KERN_DEBUG "b1lli: T1 watchdog\n"); */ - } - if (card->blocked) - printk(KERN_DEBUG "b1lli(0x%x): RESTART\n", card->port); - card->blocked = 0; - break; - - case RECEIVE_STOP: - printk(KERN_DEBUG "b1lli(0x%x): STOP\n", card->port); - card->blocked = 1; - break; - - case RECEIVE_INIT: - - card->versionlen = B1_get_slice(card->port, card->versionbuf); - card->cardstate = CARD_ACTIVE; - parse_version(card); - printk(KERN_INFO "b1lli(0x%x): %s-card (%s) now active\n", - card->port, - card->version[VER_CARDTYPE], - card->version[VER_DRIVER]); - avmb1_card_ready(card); - break; - case RECEIVE_TASK_READY: - ApplId = (unsigned) B1_get_word(card->port); - MsgLen = B1_get_slice(card->port, card->msgbuf); - card->msgbuf[MsgLen] = 0; - printk(KERN_INFO "b1lli(0x%x): Task %d \"%s\" ready.\n", - card->port, ApplId, card->msgbuf); - break; - default: - printk(KERN_ERR "b1lli(0x%x): B1_handle_interrupt: 0x%x ???\n", - card->port, b1cmd); - break; - } - if (card->cardtype == AVM_CARDTYPE_T1) - goto t1retry; -} diff --git a/drivers/isdn/avmb1/capi.c b/drivers/isdn/avmb1/capi.c index 73846f660..a4e7217e3 100644 --- a/drivers/isdn/avmb1/capi.c +++ b/drivers/isdn/avmb1/capi.c @@ -1,11 +1,17 @@ /* - * $Id: capi.c,v 1.44 2000/11/25 17:00:59 kai Exp $ + * $Id: capi.c,v 1.45 2000/12/02 19:47:29 kai Exp $ * * CAPI 2.0 Interface for Linux * * Copyright 1996 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: capi.c,v $ + * Revision 1.45 2000/12/02 19:47:29 kai + * Change the Makefiles to new style. + * There may be problems there that I missed, so this shouldn't go into + * an offical kernel any time soon. + * However, if I didn't commit it, we wouldn't find the bugs... + * * Revision 1.44 2000/11/25 17:00:59 kai * compatibility cleanup - final part for the time being * @@ -236,12 +242,12 @@ #include <linux/devfs_fs_kernel.h> #include "capiutil.h" #include "capicmd.h" -#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE +#if defined(CONFIG_ISDN_CAPI_CAPIFS) || defined(CONFIG_ISDN_CAPI_CAPIFS_MODULE) #include "capifs.h" -#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */ +#endif #include <linux/slab.h> -static char *revision = "$Revision: 1.44 $"; +static char *revision = "$Revision: 1.45 $"; MODULE_AUTHOR("Carsten Paeth (calle@calle.in-berlin.de)"); @@ -518,7 +524,7 @@ static struct capincci *capincci_alloc(struct capidev *cdev, __u32 ncci) #ifdef _DEBUG_REFCOUNT printk(KERN_DEBUG "set mp->nccip\n"); #endif -#ifdef CONFIG_ISDN_CAPIFS +#if defined(CONFIG_ISDN_CAPI_CAPIFS) || defined(CONFIG_ISDN_CAPI_CAPIFS_MODULE) kdev = MKDEV(capi_rawmajor, mp->minor); capifs_new_ncci('r', mp->minor, kdev); kdev = MKDEV(capi_ttymajor, mp->minor); @@ -543,7 +549,7 @@ static void capincci_free(struct capidev *cdev, __u32 ncci) *pp = (*pp)->next; #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE if ((mp = np->minorp) != 0) { -#ifdef CONFIG_ISDN_CAPIFS +#if defined(CONFIG_ISDN_CAPI_CAPIFS) || defined(CONFIG_ISDN_CAPI_CAPIFS_MODULE) capifs_free_ncci('r', mp->minor); capifs_free_ncci(0, mp->minor); #endif diff --git a/drivers/isdn/avmb1/kcapi.c b/drivers/isdn/avmb1/kcapi.c index bf6571856..6f7bd4fd0 100644 --- a/drivers/isdn/avmb1/kcapi.c +++ b/drivers/isdn/avmb1/kcapi.c @@ -1,11 +1,16 @@ /* - * $Id: kcapi.c,v 1.21 2000/11/23 20:45:14 kai Exp $ + * $Id: kcapi.c,v 1.21.6.1 2000/12/10 23:39:19 kai Exp $ * * Kernel CAPI 2.0 Module * * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: kcapi.c,v $ + * Revision 1.21.6.1 2000/12/10 23:39:19 kai + * in 2.4 we don't have tq_scheduler anymore. + * also add one supported card to hfc_pci.c + * (from main branch) + * * Revision 1.21 2000/11/23 20:45:14 kai * fixed module_init/exit stuff * Note: compiled-in kernel doesn't work pre 2.2.18 anymore. @@ -30,7 +35,7 @@ * Revision 1.15 2000/04/06 15:01:25 calle * Bugfix: crash in capidrv.c when reseting a capi controller. * - changed code order on remove of controller. - * - using tq schedule for notifier in kcapi.c. + * - using tq_schedule for notifier in kcapi.c. * - now using spin_lock_irqsave() and spin_unlock_irqrestore(). * strange: sometimes even MP hang on unload of isdn.o ... * @@ -131,7 +136,7 @@ #include <linux/b1lli.h> #endif -static char *revision = "$Revision: 1.21 $"; +static char *revision = "$Revision: 1.21.6.1 $"; /* ------------------------------------------------------------- */ diff --git a/drivers/isdn/divert/Makefile b/drivers/isdn/divert/Makefile index 109c900d8..dc1084cb6 100644 --- a/drivers/isdn/divert/Makefile +++ b/drivers/isdn/divert/Makefile @@ -1,19 +1,27 @@ -L_OBJS := -LX_OBJS := -M_OBJS := -MX_OBJS := -O_OBJS := -OX_OBJS := -L_TARGET := -O_TARGET := - -O_OBJS += isdn_divert.o divert_procfs.o -O_TARGET := dss1_divert.o -M_OBJS += dss1_divert.o -OX_OBJS += divert_init.o +# +# Makefile for the dss1_divert ISDN module +# + +# The target object and module list name. + +O_TARGET := vmlinux-obj.o + +# Multipart objects. + +list-multi := dss1_divert.o +dss1_divert-objs := isdn_divert.o divert_procfs.o divert_init.o + +# Each configuration option enables a list of files. + +obj-$(CONFIG_ISDN_DIVERSION) += dss1_divert.o include $(TOPDIR)/Rules.make +# Link rules for multi-part drivers. + +dss1_divert.o: $(dss1_divert-objs) + $(LD) -r -o $@ $(dss1_divert-objs) + diff --git a/drivers/isdn/eicon/Makefile b/drivers/isdn/eicon/Makefile index 63c557492..35f59701d 100644 --- a/drivers/isdn/eicon/Makefile +++ b/drivers/isdn/eicon/Makefile @@ -1,52 +1,43 @@ -L_OBJS := -M_OBJS := -LX_OBJS := -MX_OBJS := -O_OBJS := -OX_OBJS := -L_TARGET := -O_TARGET := - -ifeq ($(CONFIG_ISDN_DRV_EICON_STANDALONE),y) - - ifeq ($(CONFIG_PCI),y) - O_OBJS += common.o idi.o bri.o pri.o log.o xlog.o kprintf.o fpga.o fourbri.o - O_OBJS += lincfg.o linchr.o linsys.o linio.o - O_OBJS += fcheck.o - OX_OBJS += Divas_mod.o - endif - -else - - OX_OBJS += eicon_mod.o - O_OBJS := eicon_isa.o eicon_pci.o eicon_idi.o eicon_io.o - O_OBJS += fcheck.o - ifeq ($(CONFIG_PCI),y) - ifeq ($(CONFIG_ISDN_DRV_EICON_PCI),y) - O_OBJS += common.o idi.o bri.o pri.o log.o xlog.o kprintf.o fpga.o fourbri.o - O_OBJS += lincfg.o linchr.o linsys.o linio.o - endif - endif - -endif - -O_TARGET := - -ifeq ($(CONFIG_ISDN_DRV_EICON),y) - O_TARGET += eicon.o -else - O_TARGET += eicon.o - M_OBJS = eicon.o -endif +# Makefile for the eicon ISDN device driver +# The target object and module list name. + +O_TARGET := vmlinux-obj.o + +# Objects that export symbols. + +export-objs := Divas_mod.o eicon_mod.o + +# Multipart objects. + +list-multi := eicon.o divas.o +eicon-objs := eicon_mod.o eicon_isa.o eicon_pci.o eicon_idi.o \ + eicon_io.o fcheck.o +divas-objs := common.o idi.o bri.o pri.o log.o xlog.o kprintf.o fpga.o \ + fourbri.o lincfg.o linchr.o linsys.o linio.o fcheck.o \ + Divas_mod.o + +# Optional parts of multipart objects. + +eicon-objs-$(CONFIG_ISDN_DRV_EICON_PCI) += common.o idi.o bri.o pri.o log.o \ + xlog.o kprintf.o fpga.o fourbri.o lincfg.o linchr.o \ + linsys.o linio.o + +eicon-objs += $(eicon-objs-y) + +# Each configuration option enables a list of files. + +obj-$(CONFIG_ISDN_DRV_EICON_OLD) += eicon.o +obj-$(CONFIG_ISDN_DRV_EICON_DIVAS) += divas.o include $(TOPDIR)/Rules.make -MD5FILES += common.c idi.c bri.c pri.c log.c xlog.c kprintf.c fpga.c \ - fourbri.c fcheck.c +# Link rules for multi-part drivers. + +eicon.o: $(eicon-objs) + $(LD) -r -o $@ $(eicon-objs) -FCHECK = $(shell md5sum -c md5sums.asc >> /dev/null;echo $$?) +divas.o: $(divas-objs) + $(LD) -r -o $@ $(divas-objs) -fcheck.o: $(MD5FILES) - $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -D FILECHECK=$(FCHECK) -c -o fcheck.o fcheck.c diff --git a/drivers/isdn/hisax/Makefile b/drivers/isdn/hisax/Makefile index 071e3b1ca..66f6b5d4a 100644 --- a/drivers/isdn/hisax/Makefile +++ b/drivers/isdn/hisax/Makefile @@ -1,225 +1,70 @@ -L_OBJS := -M_OBJS := -LX_OBJS := -MX_OBJS := -O_OBJS := -OX_OBJS := -L_TARGET := -O_TARGET := - -O_OBJS := isdnl1.o tei.o isdnl2.o isdnl3.o \ - lmgr.o q931.o callc.o fsm.o cert.o - -# EXTRA_CFLAGS += -S - -ifeq ($(CONFIG_HISAX_EURO),y) - O_OBJS += l3dss1.o -endif - -ifeq ($(CONFIG_HISAX_NI1),y) - O_OBJS += l3ni1.o -endif - -ifeq ($(CONFIG_HISAX_1TR6),y) - O_OBJS += l3_1tr6.o -endif - -ISAC_OBJ := -HSCX_OBJ := -ISAR_OBJ := -HFC_OBJ := -HFC_2BDS0 := -JADE_OBJ := -W6692_OBJ := -NETJ_OBJ := -ICC_OBJ := - -ifeq ($(CONFIG_HISAX_16_0),y) - O_OBJS += teles0.o - ISAC_OBJ := isac.o - HSCX_OBJ := hscx.o -endif - -ifeq ($(CONFIG_HISAX_16_3),y) - O_OBJS += teles3.o - ISAC_OBJ := isac.o - HSCX_OBJ := hscx.o -endif - -ifeq ($(CONFIG_HISAX_TELESPCI),y) - O_OBJS += telespci.o - ISAC_OBJ := isac.o - HSCX_OBJ := hscx.o -endif - -ifeq ($(CONFIG_HISAX_S0BOX),y) - O_OBJS += s0box.o - ISAC_OBJ := isac.o - HSCX_OBJ := hscx.o -endif - -ifeq ($(CONFIG_HISAX_AVM_A1),y) - O_OBJS += avm_a1.o - ISAC_OBJ := isac.o - HSCX_OBJ := hscx.o -endif - -ifeq ($(CONFIG_HISAX_AVM_A1_PCMCIA),y) - O_OBJS += avm_a1p.o - ISAC_OBJ := isac.o - HSCX_OBJ := hscx.o -endif - -ifeq ($(CONFIG_HISAX_FRITZPCI),y) - O_OBJS += avm_pci.o - ISAC_OBJ := isac.o -endif - - -ifeq ($(CONFIG_HISAX_ELSA),y) - O_OBJS += elsa.o - ISAC_OBJ := isac.o - HSCX_OBJ := hscx.o -endif - -ifeq ($(CONFIG_HISAX_IX1MICROR2),y) - O_OBJS += ix1_micro.o - ISAC_OBJ := isac.o - HSCX_OBJ := hscx.o -endif - -ifeq ($(CONFIG_HISAX_DIEHLDIVA),y) - O_OBJS += diva.o - ISAC_OBJ := isac.o - HSCX_OBJ := hscx.o -endif - -ifeq ($(CONFIG_HISAX_ASUSCOM),y) - O_OBJS += asuscom.o - ISAC_OBJ := isac.o - HSCX_OBJ := hscx.o -endif - -ifeq ($(CONFIG_HISAX_TELEINT),y) - O_OBJS += teleint.o - ISAC_OBJ := isac.o - HFC_OBJ := hfc_2bs0.o -endif - -ifeq ($(CONFIG_HISAX_SEDLBAUER),y) - O_OBJS += sedlbauer.o - ISAC_OBJ := isac.o - HSCX_OBJ := hscx.o - ISAR_OBJ := isar.o -endif - -ifeq ($(CONFIG_HISAX_SPORTSTER),y) - O_OBJS += sportster.o - ISAC_OBJ := isac.o - HSCX_OBJ := hscx.o -endif - -ifeq ($(CONFIG_HISAX_MIC),y) - O_OBJS += mic.o - ISAC_OBJ := isac.o - HSCX_OBJ := hscx.o -endif - -ifeq ($(CONFIG_HISAX_NETJET),y) - O_OBJS += nj_s.o - NETJ_OBJ := netjet.o - ISAC_OBJ := isac.o -endif - -ifeq ($(CONFIG_HISAX_NETJET_U),y) - O_OBJS += nj_u.o - NETJ_OBJ := netjet.o - ICC_OBJ := icc.o -endif - -ifeq ($(CONFIG_HISAX_HFCS),y) - O_OBJS += hfcscard.o - HFC_2BDS0 := hfc_2bds0.o -endif - -ifeq ($(CONFIG_HISAX_HFC_PCI),y) - HFC_2BDS0 += hfc_pci.o -endif - -ifeq ($(CONFIG_HISAX_HFC_SX),y) - HFC_2BDS0 += hfc_sx.o -endif - -ifeq ($(CONFIG_HISAX_NICCY),y) - O_OBJS += niccy.o - ISAC_OBJ := isac.o - HSCX_OBJ := hscx.o -endif - -ifeq ($(CONFIG_HISAX_ISURF),y) - O_OBJS += isurf.o - ISAC_OBJ := isac.o - ISAR_OBJ := isar.o -endif - -ifeq ($(CONFIG_HISAX_HSTSAPHIR),y) - O_OBJS += saphir.o - ISAC_OBJ := isac.o - HSCX_OBJ := hscx.o -endif - -ifeq ($(CONFIG_HISAX_BKM_A4T),y) - O_OBJS += bkm_a4t.o - ISAC_OBJ := isac.o - JADE_OBJ := jade.o -endif -ifeq ($(CONFIG_HISAX_SCT_QUADRO),y) - O_OBJS += bkm_a8.o - ISAC_OBJ := isac.o - HSCX_OBJ := hscx.o -endif - -ifeq ($(CONFIG_HISAX_GAZEL),y) - O_OBJS += gazel.o - ISAC_OBJ := isac.o - 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 - -ifeq ($(ISAC_OBJ), isac.o) - ISAC_OBJ += arcofi.o -endif - -O_OBJS += $(ISAC_OBJ) $(HSCX_OBJ) $(ISAR_OBJ) $(JADE_OBJ) -O_OBJS += $(HFC_OBJ) $(HFC_2BDS0) $(W6692_OBJ) $(NETJ_OBJ) $(ICC_OBJ) -OX_OBJS += config.o - -O_TARGET := - -ifeq ($(CONFIG_ISDN_DRV_HISAX),y) - O_TARGET += hisax.o -else - ifeq ($(CONFIG_ISDN_DRV_HISAX),m) - O_TARGET += hisax.o - M_OBJS += hisax.o - endif -endif - +# Makefile for the hisax ISDN device driver + +# The target object and module list name. + +O_TARGET := vmlinux-obj.o + +# Objects that export symbols. + +export-objs := config.o + +# Multipart objects. + +list-multi := hisax.o +hisax-objs := config.o isdnl1.o tei.o isdnl2.o isdnl3.o \ + lmgr.o q931.o callc.o fsm.o cert.o + +# Optional parts of multipart objects. + +hisax-objs-$(CONFIG_HISAX_EURO) += l3dss1.o +hisax-objs-$(CONFIG_HISAX_NI1) += l3ni1.o +hisax-objs-$(CONFIG_HISAX_1TR6) += l3_1tr6.o + +hisax-objs-$(CONFIG_HISAX_16_0) += teles0.o isac.o arcofi.o hscx.o +hisax-objs-$(CONFIG_HISAX_16_3) += teles3.o isac.o arcofi.o hscx.o +hisax-objs-$(CONFIG_HISAX_TELESPCI) += telespci.o isac.o arcofi.o hscx.o +hisax-objs-$(CONFIG_HISAX_S0BOX) += s0box.o isac.o arcofi.o hscx.o +hisax-objs-$(CONFIG_HISAX_AVM_A1) += avm_a1.o isac.o arcofi.o hscx.o +hisax-objs-$(CONFIG_HISAX_AVM_A1_PCMCIA) += avm_a1p.o isac.o arcofi.o hscx.o +hisax-objs-$(CONFIG_HISAX_FRITZPCI) += avm_pci.o isac.o arcofi.o +hisax-objs-$(CONFIG_HISAX_AVM_A1) += avm_a1.o isac.o arcofi.o hscx.o +hisax-objs-$(CONFIG_HISAX_ELSA) += elsa.o isac.o arcofi.o hscx.o +hisax-objs-$(CONFIG_HISAX_IX1MICROR2) += ix1_micro.o isac.o arcofi.o hscx.o +hisax-objs-$(CONFIG_HISAX_DIEHLDIVA) += diva.o isac.o arcofi.o hscx.o +hisax-objs-$(CONFIG_HISAX_ASUSCOM) += asuscom.o isac.o arcofi.o hscx.o +hisax-objs-$(CONFIG_HISAX_TELEINT) += teleint.o isac.o arcofi.o hfc_2bs0.o +hisax-objs-$(CONFIG_HISAX_SEDLBAUER) += sedlbauer.o isac.o arcofi.o hscx.o isar.o +hisax-objs-$(CONFIG_HISAX_SPORTSTER) += sportster.o isac.o arcofi.o hfc_2bs0.o +hisax-objs-$(CONFIG_HISAX_MIC) += mic.o isac.o arcofi.o hfc_2bs0.o +hisax-objs-$(CONFIG_HISAX_NETJET) += nj_s.o netjet.o isac.o arcofi.o +hisax-objs-$(CONFIG_HISAX_NETJET_U) += nj_u.o netjet.o icc.o +hisax-objs-$(CONFIG_HISAX_HFCS) += hfcscard.o hfc_2bds0.o +hisax-objs-$(CONFIG_HISAX_HFC_PCI) += hfc_pci.o +hisax-objs-$(CONFIG_HISAX_HFC_SX) += hfc_sx.o +hisax-objs-$(CONFIG_HISAX_NICCY) += niccy.o isac.o arcofi.o hscx.o +hisax-objs-$(CONFIG_HISAX_ISURF) += isurf.o isac.o arcofi.o isar.o +hisax-objs-$(CONFIG_HISAX_HSTSAPHIR) += saphir.o isac.o arcofi.o hscx.o +hisax-objs-$(CONFIG_HISAX_BKM_A4T) += bkm_a4t.o isac.o arcofi.o jade.o +hisax-objs-$(CONFIG_HISAX_SCT_QUADRO) += bkm_a8.o isac.o arcofi.o hscx.o +hisax-objs-$(CONFIG_HISAX_GAZEL) += gazel.o isac.o arcofi.o hscx.o +hisax-objs-$(CONFIG_HISAX_W6692) += w6692.o +#hisax-objs-$(CONFIG_HISAX_TESTEMU) += testemu.o + +hisax-objs += $(sort $(hisax-objs-y)) + +# Each configuration option enables a list of files. + +obj-$(CONFIG_ISDN_DRV_HISAX) += hisax.o + +MD5FILES := isac.c isdnl1.c isdnl2.c isdnl3.c \ + tei.c callc.c cert.c l3dss1.c l3_1tr6.c \ + elsa.c diva.c sedlbauer.c +CERT := $(shell md5sum -c md5sums.asc >> /dev/null;echo $$?) +CFLAGS_cert.o := -DCERTIFICATION=$(CERT) include $(TOPDIR)/Rules.make -MD5FILES += isac.c isdnl1.c isdnl2.c isdnl3.c \ - tei.c callc.c cert.c l3dss1.c l3_1tr6.c \ - elsa.c diva.c sedlbauer.c - -CERT = $(shell md5sum -c md5sums.asc >> /dev/null;echo $$?) +# Link rules for multi-part drivers. -cert.o: $(MD5FILES) md5sums.asc - $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -D CERTIFICATION=$(CERT) -c -o cert.o cert.c +hisax.o: $(hisax-objs) + $(LD) -r -o $@ $(hisax-objs) diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c index f25e2a159..0b60e89b3 100644 --- a/drivers/isdn/hisax/config.c +++ b/drivers/isdn/hisax/config.c @@ -1,4 +1,4 @@ -/* $Id: config.c,v 2.57.6.3 2000/11/29 17:48:59 kai Exp $ +/* $Id: config.c,v 2.57.6.6 2000/12/10 23:39:19 kai Exp $ * * Author Karsten Keil (keil@isdn4linux.de) * based on the teles driver from Jan den Ouden @@ -1180,7 +1180,6 @@ checkcard(int cardnr, char *id, int *busy_flag) cs->tx_skb = NULL; cs->tx_cnt = 0; cs->event = 0; - INIT_LIST_HEAD(&cs->tqueue.list); cs->tqueue.sync = 0; cs->tqueue.data = cs; @@ -1756,6 +1755,7 @@ static struct pci_device_id hisax_pci_tbl[] __initdata = { {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B00B, PCI_ANY_ID, PCI_ANY_ID}, {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B00C, PCI_ANY_ID, PCI_ANY_ID}, {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B100, PCI_ANY_ID, PCI_ANY_ID}, + {PCI_VENDOR_ID_ABOCOM, PCI_DEVICE_ID_ABOCOM_2BD1, PCI_ANY_ID, PCI_ANY_ID}, {PCI_VENDOR_ID_ASUSTEK, PCI_DEVICE_ID_ASUSTEK_0675, PCI_ANY_ID, PCI_ANY_ID}, {PCI_VENDOR_ID_BERKOM, PCI_DEVICE_ID_BERKOM_T_CONCEPT, PCI_ANY_ID, PCI_ANY_ID}, {PCI_VENDOR_ID_BERKOM, PCI_DEVICE_ID_BERKOM_A1T, PCI_ANY_ID, PCI_ANY_ID}, diff --git a/drivers/isdn/hisax/foreign.c b/drivers/isdn/hisax/foreign.c deleted file mode 100644 index b8ffa4948..000000000 --- a/drivers/isdn/hisax/foreign.c +++ /dev/null @@ -1,780 +0,0 @@ -/* $Id: foreign.c,v 1.1 1998/11/09 07:48:48 baccala Exp $ - * - * HiSax ISDN driver - foreign chipset interface - * - * Author Brent Baccala (baccala@FreeSoft.org) - * - * - * - * $Log: foreign.c,v $ - * Revision 1.1 1998/11/09 07:48:48 baccala - * Initial DBRI ISDN code. Sometimes works (brings up the link and you - * can telnet through it), sometimes doesn't (crashes the machine) - * - * Revision 1.2 1998/02/12 23:07:10 keil - * change for 2.1.86 (removing FREE_READ/FREE_WRITE from [dev]_kfree_skb() - * - * Revision 1.1 1998/02/03 23:20:51 keil - * New files for SPARC isdn support - * - * Revision 1.1 1998/01/08 04:17:12 baccala - * ISDN comes to the Sparc. Key points: - * - * - Existing ISDN HiSax driver provides all the smarts - * - it compiles, runs, talks to an isolated phone switch, connects - * to a Cisco, pings go through - * - AMD 7930 support only (no DBRI yet) - * - no US NI-1 support (may not work on US phone system - untested) - * - periodic packet loss, apparently due to lost interrupts - * - ISDN sometimes freezes, requiring reboot before it will work again - * - * The code is unreliable enough to be consider alpha - * - * - * - */ - -#define __NO_VERSION__ -#include "hisax.h" -#include "isac.h" -#include "isdnl1.h" -#include "foreign.h" -#include "rawhdlc.h" -#include <linux/interrupt.h> - -static const char *foreign_revision = "$Revision: 1.1 $"; - -#define RCV_BUFSIZE 1024 /* Size of raw receive buffer in bytes */ -#define RCV_BUFBLKS 4 /* Number of blocks to divide buffer into - * (must divide RCV_BUFSIZE) */ - -static void Bchan_fill_fifo(struct BCState *, struct sk_buff *); - -static void -Bchan_xmt_bh(struct BCState *bcs) -{ - struct sk_buff *skb; - - if (bcs->hw.foreign.tx_skb != NULL) { - dev_kfree_skb(bcs->hw.foreign.tx_skb); - bcs->hw.foreign.tx_skb = NULL; - } - - if ((skb = skb_dequeue(&bcs->squeue))) { - Bchan_fill_fifo(bcs, skb); - } else { - clear_bit(BC_FLG_BUSY, &bcs->Flag); - bcs->event |= 1 << B_XMTBUFREADY; - queue_task(&bcs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); - } -} - -static void -Bchan_xmit_callback(struct BCState *bcs) -{ - queue_task(&bcs->hw.foreign.tq_xmt, &tq_immediate); - mark_bh(IMMEDIATE_BH); -} - -/* B channel transmission: two modes (three, if you count L1_MODE_NULL) - * - * L1_MODE_HDLC - We need to do HDLC encapsulation before transmiting - * the packet (i.e. make_raw_hdlc_data). Since this can be a - * time-consuming operation, our completion callback just schedules - * a bottom half to do encapsulation for the next packet. In between, - * the link will just idle - * - * L1_MODE_TRANS - Data goes through, well, transparent. No HDLC encap, - * and we can't just let the link idle, so the "bottom half" actually - * gets called during the top half (it's our callback routine in this case), - * but it's a lot faster now since we don't call make_raw_hdlc_data - */ - -static void -Bchan_fill_fifo(struct BCState *bcs, struct sk_buff *skb) -{ - struct IsdnCardState *cs = bcs->cs; - struct foreign_hw *hw = &bcs->hw.foreign; - int len; - - if ((cs->debug & L1_DEB_HSCX) || (cs->debug & L1_DEB_HSCX_FIFO)) { - char tmp[2048]; - char *t = tmp; - - t += sprintf(t, "Bchan_fill_fifo %c cnt %d", - bcs->channel ? 'B' : 'A', skb->len); - if (cs->debug & L1_DEB_HSCX_FIFO) - QuickHex(t, skb->data, skb->len); - debugl1(cs, tmp); - } - - if (hw->doHDLCprocessing) { - len = make_raw_hdlc_data(skb->data, skb->len, - bcs->hw.foreign.tx_buff, RAW_BUFMAX); - if (len > 0) - cs->hw.foreign->bxmit(0, bcs->channel, - bcs->hw.foreign.tx_buff, len, - (void *) &Bchan_xmit_callback, - (void *) bcs); - dev_kfree_skb(skb); - } else { - cs->hw.foreign->bxmit(0, bcs->channel, - skb->data, skb->len, - (void *) &Bchan_xmit_callback, - (void *) bcs); - bcs->hw.foreign.tx_skb = skb; - } -} - -static void -Bchan_mode(struct BCState *bcs, int mode, int bc) -{ - struct IsdnCardState *cs = bcs->cs; - - if (cs->debug & L1_DEB_HSCX) { - char tmp[40]; - sprintf(tmp, "foreign mode %d bchan %d/%d", - mode, bc, bcs->channel); - debugl1(cs, tmp); - } - bcs->mode = mode; -} - -/* Bchan_l2l1 is the entry point for upper layer routines that want to - * transmit on the B channel. PH_DATA_REQ is a normal packet that - * we either start transmitting (if idle) or queue (if busy). - * PH_PULL_REQ can be called to request a callback message (PH_PULL_CNF) - * once the link is idle. After a "pull" callback, the upper layer - * routines can use PH_PULL_IND to send data. - */ - -static void -Bchan_l2l1(struct PStack *st, int pr, void *arg) -{ - struct sk_buff *skb = arg; - - switch (pr) { - case (PH_DATA_REQ): - if (test_bit(BC_FLG_BUSY, &st->l1.bcs->Flag)) { - skb_queue_tail(&st->l1.bcs->squeue, skb); - } else { - test_and_set_bit(BC_FLG_BUSY, &st->l1.bcs->Flag); - Bchan_fill_fifo(st->l1.bcs, skb); - } - break; - case (PH_PULL_IND): - if (test_bit(BC_FLG_BUSY, &st->l1.bcs->Flag)) { - printk(KERN_WARNING "foreign: this shouldn't happen\n"); - break; - } - test_and_set_bit(BC_FLG_BUSY, &st->l1.bcs->Flag); - Bchan_fill_fifo(st->l1.bcs, skb); - break; - case (PH_PULL_REQ): - if (!test_bit(BC_FLG_BUSY, &st->l1.bcs->Flag)) { - clear_bit(FLG_L1_PULL_REQ, &st->l1.Flags); - st->l1.l1l2(st, PH_PULL_CNF, NULL); - } else - set_bit(FLG_L1_PULL_REQ, &st->l1.Flags); - break; - } -} - -/* -**************************************************************************** -***************** Receiver callback and bottom half ************************ -**************************************************************************** -*/ - -/* Bchan_recv_done() is called when a frame has been completely decoded - * into hw->rv_skb and we're ready to hand it off to the HiSax upper - * layer. If a "large" packet is received, stick rv_skb on the - * receive queue and alloc a new (large) skb to act as buffer for - * future receives. If a small packet is received, leave rv_skb - * alone, alloc a new skb of the correct size, and copy the packet - * into it. In any case, flag the channel as B_RCVBUFREADY and - * queue the upper layer's task. - */ - -static void -Bchan_recv_done(struct BCState *bcs, unsigned int len) -{ - struct IsdnCardState *cs = bcs->cs; - struct foreign_hw *hw = &bcs->hw.foreign; - struct sk_buff *skb; - - if (cs->debug & L1_DEB_HSCX_FIFO) { - char tmp[2048]; - char *t = tmp; - - t += sprintf(t, "Bchan_rcv %c cnt %d (%x)", bcs->channel ? 'B' : 'A', len, hw->rv_skb->tail); - QuickHex(t, hw->rv_skb->tail, len); - debugl1(cs, tmp); - } - - if (len > HSCX_BUFMAX/2) { - /* Large packet received */ - - if (!(skb = dev_alloc_skb(HSCX_BUFMAX))) { - printk(KERN_WARNING "foreign: receive out of memory\n"); - } else { - skb_put(hw->rv_skb, len); - skb_queue_tail(&bcs->rqueue, hw->rv_skb); - hw->rv_skb = skb; - - bcs->event |= 1 << B_RCVBUFREADY; - queue_task(&bcs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); - } - } else { - /* Small packet received */ - - if (!(skb = dev_alloc_skb(len))) { - printk(KERN_WARNING "foreign: receive out of memory\n"); - } else { - memcpy(skb_put(skb, len), hw->rv_skb->tail, len); - skb_queue_tail(&bcs->rqueue, skb); - - bcs->event |= 1 << B_RCVBUFREADY; - queue_task(&bcs->tqueue, &tq_immediate); - mark_bh(IMMEDIATE_BH); - } - } -} - -/* Bchan_recv_callback()'s behavior depends on whether we're doing local - * HDLC processing. If so, receive into hw->rv_buff and queue Bchan_rcv_bh - * to decode the HDLC at leisure. Otherwise, receive directly into hw->rv_skb - * and call Bchan_recv_done(). In either case, prepare a new buffer for - * further receives and hand it to the hardware driver. - */ - -static void -Bchan_recv_callback(struct BCState *bcs, int error, unsigned int len) -{ - struct IsdnCardState *cs = bcs->cs; - struct foreign_hw *hw = &bcs->hw.foreign; - - if (hw->doHDLCprocessing) { - - hw->rv_buff_in += RCV_BUFSIZE/RCV_BUFBLKS; - hw->rv_buff_in %= RCV_BUFSIZE; - - if (hw->rv_buff_in != hw->rv_buff_out) { - cs->hw.foreign->brecv(0, bcs->channel, - hw->rv_buff + hw->rv_buff_in, - RCV_BUFSIZE/RCV_BUFBLKS, - (void *) &Bchan_recv_callback, - (void *) bcs); - - } - queue_task(&hw->tq_rcv, &tq_immediate); - mark_bh(IMMEDIATE_BH); - - } else { - if (error) { - char tmp[256]; - sprintf(tmp, "B channel %c receive error %x", - bcs->channel ? 'B' : 'A', error); - debugl1(cs, tmp); - } else { - Bchan_recv_done(bcs, len); - } - cs->hw.foreign->brecv(0, bcs->channel, - hw->rv_skb->tail, HSCX_BUFMAX, - (void *) &Bchan_recv_callback, - (void *) bcs); - - } -} - -/* Bchan_rcv_bh() is a "shim" bottom half handler stuck in between - * Bchan_recv_callback() and the HiSax upper layer if we need to - * do local HDLC processing. - */ - -static void -Bchan_rcv_bh(struct BCState *bcs) -{ - struct IsdnCardState *cs = bcs->cs; - struct foreign_hw *hw = &bcs->hw.foreign; - struct sk_buff *skb; - int len; - - if (cs->debug & L1_DEB_HSCX) { - char tmp[1024]; - - sprintf(tmp, "foreign_Bchan_rcv (%d/%d)", - hw->rv_buff_in, hw->rv_buff_out); - debugl1(cs, tmp); - } - - do { - if (cs->debug & L1_DEB_HSCX) { - char tmp[1024]; - - QuickHex(tmp, hw->rv_buff + hw->rv_buff_out, - RCV_BUFSIZE/RCV_BUFBLKS); - debugl1(cs, tmp); - } - - while ((len = read_raw_hdlc_data(hw->hdlc_state, - hw->rv_buff + hw->rv_buff_out, RCV_BUFSIZE/RCV_BUFBLKS, - hw->rv_skb->tail, HSCX_BUFMAX))) { - if (len > 0) { - Bchan_recv_done(bcs, len); - } else { - char tmp[256]; - sprintf(tmp, "B channel %c receive error", - bcs->channel ? 'B' : 'A'); - debugl1(cs, tmp); - } - } - - if (hw->rv_buff_in == hw->rv_buff_out) { - /* Buffer was filled up - need to restart receiver */ - cs->hw.foreign->brecv(0, bcs->channel, - hw->rv_buff + hw->rv_buff_in, - RCV_BUFSIZE/RCV_BUFBLKS, - (void *) &Bchan_recv_callback, - (void *) bcs); - } - - hw->rv_buff_out += RCV_BUFSIZE/RCV_BUFBLKS; - hw->rv_buff_out %= RCV_BUFSIZE; - - } while (hw->rv_buff_in != hw->rv_buff_out); -} - -static void -Bchan_close(struct BCState *bcs) -{ - struct IsdnCardState *cs = bcs->cs; - struct sk_buff *skb; - - Bchan_mode(bcs, 0, 0); - cs->hw.foreign->bclose(0, bcs->channel); - - if (test_bit(BC_FLG_INIT, &bcs->Flag)) { - while ((skb = skb_dequeue(&bcs->rqueue))) { - dev_kfree_skb(skb); - } - while ((skb = skb_dequeue(&bcs->squeue))) { - dev_kfree_skb(skb); - } - } - test_and_clear_bit(BC_FLG_INIT, &bcs->Flag); -} - -static int -Bchan_open(struct BCState *bcs) -{ - struct IsdnCardState *cs = bcs->cs; - struct foreign_hw *hw = &bcs->hw.foreign; - - if (!test_and_set_bit(BC_FLG_INIT, &bcs->Flag)) { - skb_queue_head_init(&bcs->rqueue); - skb_queue_head_init(&bcs->squeue); - } - test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); - - hw->doHDLCprocessing = 0; - if (bcs->mode == L1_MODE_HDLC) { - if (cs->hw.foreign->bopen(0, bcs->channel, 1, 0xff) == -1) { - if (cs->hw.foreign->bopen(0, bcs->channel, 0, 0xff) == -1) { - return (-1); - } - hw->doHDLCprocessing = 1; - } - } else { - if (cs->hw.foreign->bopen(0, bcs->channel, 0, 0xff) == -1) { - return (-1); - } - } - - hw->rv_buff_in = 0; - hw->rv_buff_out = 0; - hw->tx_skb = NULL; - init_hdlc_state(hw->hdlc_state, 0); - cs->hw.foreign->brecv(0, bcs->channel, - hw->rv_buff + hw->rv_buff_in, - RCV_BUFSIZE/RCV_BUFBLKS, - (void *) &Bchan_recv_callback, (void *) bcs); - - bcs->event = 0; - bcs->tx_cnt = 0; - return (0); -} - -static void -Bchan_init(struct BCState *bcs) -{ - if (!(bcs->hw.foreign.tx_buff = kmalloc(RAW_BUFMAX, GFP_ATOMIC))) { - printk(KERN_WARNING - "HiSax: No memory for foreign.tx_buff\n"); - return; - } - if (!(bcs->hw.foreign.rv_buff = kmalloc(RCV_BUFSIZE, GFP_ATOMIC))) { - printk(KERN_WARNING - "HiSax: No memory for foreign.rv_buff\n"); - return; - } - if (!(bcs->hw.foreign.rv_skb = dev_alloc_skb(HSCX_BUFMAX))) { - printk(KERN_WARNING - "HiSax: No memory for foreign.rv_skb\n"); - return; - } - if (!(bcs->hw.foreign.hdlc_state = kmalloc(sizeof(struct hdlc_state), - GFP_ATOMIC))) { - printk(KERN_WARNING - "HiSax: No memory for foreign.hdlc_state\n"); - return; - } - - bcs->hw.foreign.tq_rcv.sync = 0; - bcs->hw.foreign.tq_rcv.routine = (void (*)(void *)) &Bchan_rcv_bh; - bcs->hw.foreign.tq_rcv.data = (void *) bcs; - - bcs->hw.foreign.tq_xmt.sync = 0; - bcs->hw.foreign.tq_xmt.routine = (void (*)(void *)) &Bchan_xmt_bh; - bcs->hw.foreign.tq_xmt.data = (void *) bcs; -} - -static void -Bchan_manl1(struct PStack *st, int pr, - void *arg) -{ - switch (pr) { - case (PH_ACTIVATE_REQ): - test_and_set_bit(BC_FLG_ACTIV, &st->l1.bcs->Flag); - Bchan_mode(st->l1.bcs, st->l1.mode, st->l1.bc); - st->l1.l1man(st, PH_ACTIVATE_CNF, NULL); - break; - case (PH_DEACTIVATE_REQ): - if (!test_bit(BC_FLG_BUSY, &st->l1.bcs->Flag)) - Bchan_mode(st->l1.bcs, 0, 0); - test_and_clear_bit(BC_FLG_ACTIV, &st->l1.bcs->Flag); - break; - } -} - -int -setstack_foreign(struct PStack *st, struct BCState *bcs) -{ - if (Bchan_open(bcs)) - return (-1); - st->l1.bcs = bcs; - st->l2.l2l1 = Bchan_l2l1; - st->ma.manl1 = Bchan_manl1; - setstack_manager(st); - bcs->st = st; - return (0); -} - - -static void -foreign_drecv_callback(void *arg, int error, unsigned int count) -{ - struct IsdnCardState *cs = (struct IsdnCardState *) arg; - static struct tq_struct task = {0, 0, (void *) &DChannel_proc_rcv, 0}; - struct sk_buff *skb; - - /* NOTE: This function is called directly from an interrupt handler */ - - if (1) { - 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); - } - - task.data = (void *) cs; - queue_task(&task, &tq_immediate); - mark_bh(IMMEDIATE_BH); - } - - if (cs->debug & L1_DEB_ISAC_FIFO) { - char tmp[128]; - char *t = tmp; - - t += sprintf(t, "foreign Drecv cnt %d", count); - if (error) t += sprintf(t, " ERR %x", error); - QuickHex(t, cs->rcvbuf, count); - debugl1(cs, tmp); - } - - cs->hw.foreign->drecv(0, cs->rcvbuf, MAX_DFRAME_LEN, - &foreign_drecv_callback, cs); -} - -static void -foreign_dxmit_callback(void *arg, int error) -{ - struct IsdnCardState *cs = (struct IsdnCardState *) arg; - static struct tq_struct task = {0, 0, (void *) &DChannel_proc_xmt, 0}; - - /* NOTE: This function is called directly from an interrupt handler */ - - /* may wish to do retransmission here, if error indicates collision */ - - if (cs->debug & L1_DEB_ISAC_FIFO) { - char tmp[128]; - char *t = tmp; - - t += sprintf(t, "foreign Dxmit cnt %d", cs->tx_skb->len); - if (error) t += sprintf(t, " ERR %x", error); - QuickHex(t, cs->tx_skb->data, cs->tx_skb->len); - debugl1(cs, tmp); - } - - cs->tx_skb = NULL; - - task.data = (void *) cs; - queue_task(&task, &tq_immediate); - mark_bh(IMMEDIATE_BH); -} - -static void -foreign_Dchan_l2l1(struct PStack *st, int pr, void *arg) -{ - struct IsdnCardState *cs = (struct IsdnCardState *) st->l1.hardware; - struct sk_buff *skb = arg; - char str[64]; - - switch (pr) { - case (PH_DATA_REQ): - 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 { - if ((cs->dlogflag) && (!(skb->data[2] & 1))) { - /* I-FRAME */ - LogFrame(cs, skb->data, skb->len); - sprintf(str, "Q.931 frame user->network tei %d", st->l2.tei); - dlogframe(cs, skb->data+4, skb->len-4, - str); - } - 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 - cs->hw.foreign->dxmit(0, skb->data, skb->len, - &foreign_dxmit_callback, cs); - } - break; - case (PH_PULL_IND): - 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->dlogflag) && (!(skb->data[2] & 1))) { /* I-FRAME */ - LogFrame(cs, skb->data, skb->len); - sprintf(str, "Q.931 frame user->network tei %d", st->l2.tei); - dlogframe(cs, skb->data + 4, skb->len - 4, - str); - } - 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 - cs->hw.foreign->dxmit(0, cs->tx_skb->data, cs->tx_skb->len, - &foreign_dxmit_callback, cs); - break; - case (PH_PULL_REQ): -#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_CNF, NULL); - } else - test_and_set_bit(FLG_L1_PULL_REQ, &st->l1.Flags); - break; - } -} - -int -setDstack_foreign(struct PStack *st, struct IsdnCardState *cs) -{ - st->l2.l2l1 = foreign_Dchan_l2l1; - if (! cs->rcvbuf) { - printk("setDstack_foreign: No cs->rcvbuf!\n"); - } else { - cs->hw.foreign->drecv(0, cs->rcvbuf, MAX_DFRAME_LEN, - &foreign_drecv_callback, cs); - } - return (0); -} - -static void -manl1_msg(struct IsdnCardState *cs, int msg, void *arg) { - struct PStack *st; - - st = cs->stlist; - while (st) { - st->ma.manl1(st, msg, arg); - st = st->next; - } -} - -void -foreign_l1cmd(struct IsdnCardState *cs, int msg, void *arg) -{ - u_char val; - char tmp[32]; - - if (cs->debug & L1_DEB_ISAC) { - sprintf(tmp, "foreign_l1cmd msg %x", msg); - debugl1(cs, tmp); - } - - switch(msg) { - case PH_RESET_REQ: - cs->hw.foreign->liu_deactivate(0); - manl1_msg(cs, PH_POWERUP_CNF, NULL); - break; - case PH_ENABLE_REQ: - break; - case PH_INFO3_REQ: - cs->hw.foreign->liu_activate(0,0); - break; - case PH_TESTLOOP_REQ: - break; - default: - if (cs->debug & L1_DEB_WARN) { - sprintf(tmp, "foreign_l1cmd unknown %4x", msg); - debugl1(cs, tmp); - } - break; - } -} - -static void -foreign_new_ph(struct IsdnCardState *cs) -{ - switch (cs->hw.foreign->get_liu_state(0)) { - case 3: - manl1_msg(cs, PH_POWERUP_CNF, NULL); - break; - - case 7: - manl1_msg(cs, PH_I4_P8_IND, NULL); - break; - - case 8: - manl1_msg(cs, PH_RSYNC_IND, NULL); - break; - } -} - -/* LIU state change callback */ - -static void -foreign_liu_callback(struct IsdnCardState *cs) -{ - static struct tq_struct task = {0, 0, (void *) &foreign_new_ph, 0}; - - if (!cs) - return; - - if (cs->debug & L1_DEB_ISAC) { - char tmp[32]; - sprintf(tmp, "foreign LIU state %d", - cs->hw.foreign->get_liu_state(0)); - debugl1(cs, tmp); - } - - task.data = (void *) cs; - queue_task(&task, &tq_immediate); - mark_bh(IMMEDIATE_BH); -} - -static void init_foreign(struct IsdnCardState *cs) -{ - Bchan_init(&cs->bcs[0]); - Bchan_init(&cs->bcs[1]); - cs->bcs[0].BC_SetStack = setstack_foreign; - cs->bcs[1].BC_SetStack = setstack_foreign; - cs->bcs[0].BC_Close = Bchan_close; - cs->bcs[1].BC_Close = Bchan_close; - Bchan_mode(cs->bcs, 0, 0); - Bchan_mode(cs->bcs + 1, 0, 0); -} - -static int -foreign_card_msg(struct IsdnCardState *cs, int mt, void *arg) -{ - switch (mt) { - case CARD_RESET: - return(0); - case CARD_RELEASE: - return(0); - case CARD_SETIRQ: - return(0); - case CARD_INIT: - cs->l1cmd = foreign_l1cmd; - cs->setstack_d = setDstack_foreign; - cs->hw.foreign->liu_init(0, &foreign_liu_callback, - (void *)cs); - init_foreign(cs); - return(0); - case CARD_TEST: - return(0); - } - return(0); -} - -#if CARD_AMD7930 -extern struct foreign_interface amd7930_foreign_interface; -#endif - -#if CARD_DBRI -extern struct foreign_interface dbri_foreign_interface; -#endif - -int __init -setup_foreign(struct IsdnCard *card) -{ - struct IsdnCardState *cs = card->cs; - char tmp[64]; - - strcpy(tmp, foreign_revision); - printk(KERN_INFO "HiSax: Foreign chip driver Rev. %s\n", - HiSax_getrev(tmp)); - -#if CARD_AMD7930 - if (cs->typ == ISDN_CTYPE_AMD7930) { - cs->hw.foreign = &amd7930_foreign_interface; - cs->irq = cs->hw.foreign->get_irqnum(0); - if (cs->irq == 0) - return (0); - cs->cardmsg = &foreign_card_msg; - return (1); - } -#endif - -#if CARD_DBRI - if (cs->typ == ISDN_CTYPE_DBRI) { - cs->hw.foreign = &dbri_foreign_interface; - cs->irq = cs->hw.foreign->get_irqnum(0); - if (cs->irq == 0) - return (0); - cs->cardmsg = &foreign_card_msg; - return (1); - } -#endif - - return(0); -} diff --git a/drivers/isdn/hisax/foreign.h b/drivers/isdn/hisax/foreign.h deleted file mode 100644 index 50df0199e..000000000 --- a/drivers/isdn/hisax/foreign.h +++ /dev/null @@ -1,193 +0,0 @@ -/* $Id: foreign.h,v 1.1 1998/11/09 07:48:57 baccala Exp $ - * - * HiSax ISDN driver - foreign chipset interface - * - * Author Brent Baccala (baccala@FreeSoft.org) - * - * - * - * $Log: foreign.h,v $ - * Revision 1.1 1998/11/09 07:48:57 baccala - * Initial DBRI ISDN code. Sometimes works (brings up the link and you - * can telnet through it), sometimes doesn't (crashes the machine) - * - */ - -/* - * ISDN operations - * - * Many of these routines take an "int dev" argument, which is simply - * an index into the drivers[] array. Currently, we only support a - * single foreign chip, so the value should always be 0. B channel - * operations require an "int chan", which should be 0 for channel B1 - * and 1 for channel B2 - * - * int get_irqnum(int dev) - * - * returns the interrupt number being used by the chip. ISDN4linux - * uses this number to watch the interrupt during initialization and - * make sure something is happening. - * - * int get_liu_state(int dev) - * - * returns the current state of the ISDN Line Interface Unit (LIU) - * as a number between 2 (state F2) and 7 (state F7). 0 may also be - * returned if the chip doesn't exist or the LIU hasn't been - * activated. The meanings of the states are defined in I.430, ISDN - * BRI Physical Layer Interface. The most important two states are - * F3 (shutdown) and F7 (syncronized). - * - * void liu_init(int dev, void (*callback)(void *), void *callback_arg) - * - * initializes the LIU and optionally registers a callback to be - * signaled upon a change of LIU state. The callback will be called - * with a single opaque callback_arg. Once the callback has been - * triggered, get_liu_state can be used to determine the LIU - * current state. - * - * void liu_activate(int dev, int priority) - * - * requests LIU activation at a given D-channel priority. - * Successful activatation is achieved upon entering state F7, which - * will trigger any callback previously registered with - * liu_init. - * - * void liu_deactivate(int dev) - * - * deactivates LIU. Outstanding D and B channel transactions are - * terminated rudely and without callback notification. LIU change - * of state callback will be triggered, however. - * - * void dxmit(int dev, __u8 *buffer, unsigned int count, - * void (*callback)(void *, int), void *callback_arg) - * - * transmits a packet - specified with buffer, count - over the D-channel - * interface. Buffer should begin with the LAPD address field and - * end with the information field. FCS and flag sequences should not - * be included, nor is bit-stuffing required - all these functions are - * performed by the chip. The callback function will be called - * DURING THE TOP HALF OF AN INTERRUPT HANDLER and will be passed - * both the arbitrary callback_arg and an integer error indication: - * - * 0 - successful transmission; ready for next packet - * non-0 - error value - * - * The callback routine should defer any time-consuming operations - * to a bottom-half handler; however, dxmit may be called - * from within the callback to request back-to-back transmission of - * a second packet (without repeating the priority/collision mechanism) - * - * A comment about the "collision detect" error, which is signalled - * whenever the echoed D-channel data didn't match the transmitted - * data. This is part of ISDN's normal multi-drop T-interface - * operation, indicating that another device has attempted simultaneous - * transmission, but can also result from line noise. An immediate - * requeue via dxmit is suggested, but repeated collision - * errors may indicate a more serious problem. - * - * void drecv(int dev, __u8 *buffer, unsigned int size, - * void (*callback)(void *, int, unsigned int), - * void *callback_arg) - * - * register a buffer - buffer, size - into which a D-channel packet - * can be received. The callback function will be called DURING - * THE TOP HALF OF AN INTERRUPT HANDLER and will be passed an - * arbitrary callback_arg, an integer error indication and the length - * of the received packet, which will start with the address field, - * end with the information field, and not contain flag or FCS - * bytes. Bit-stuffing will already have been corrected for. - * Possible values of second callback argument "error": - * - * 0 - successful reception - * non-0 - error value - * - * int bopen(int dev, int chan, int hdlcmode, u_char xmit_idle_char) - * - * This function should be called before any other operations on a B - * channel. mode is either non-0 to (de)encapsulate using HDLC or 0 - * for transparent operation. In addition to arranging for interrupt - * handling and channel multiplexing, it sets the xmit_idle_char - * which is transmitted on the interface when no data buffer is - * available. Suggested values are: 0 for ISDN audio; FF for HDLC - * mark idle; 7E for HDLC flag idle. Returns 0 on a successful - * open; -1 on error. - * - * If the chip doesn't support HDLC encapsulation (the Am7930 - * doesn't), an error will be returned opening L1_MODE_HDLC; the - * HiSax driver should retry with L1_MODE_TRANS, then be prepared to - * bit-stuff the data before shipping it to the driver. - * - * void bclose(int dev, int chan) - * - * Shuts down a B channel when no longer in use. - * - * void bxmit(int dev, int chan, __u8 *buffer, unsigned int count, - * void (*callback)(void *, int), void *callback_arg) - * - * transmits a data block - specified with buffer, count - over the - * B channel interface specified by dev/chan. In mode L1_MODE_HDLC, - * a complete HDLC frames should be relayed with a single bxmit. - * The callback function will be called DURING THE TOP HALF OF AN - * INTERRUPT HANDLER and will be passed the arbitrary callback_arg - * and an integer error indication: - * - * 0 - successful transmission; ready for next packet - * non-0 - error - * - * The callback routine should defer any time-consuming operations - * to a bottom-half handler; however, bxmit may be called - * from within the callback to request back-to-back transmission of - * another data block - * - * void brecv(int dev, int chan, __u8 *buffer, unsigned int size, - * void (*callback)(void *, int, unsigned int), void *callback_arg) - * - * receive a raw data block - specified with buffer, size - over the - * B channel interface specified by dev/chan. The callback function - * will be called DURING THE TOP HALF OF AN INTERRUPT HANDLER and - * will be passed the arbitrary callback_arg, an integer error - * indication and the length of the received packet. In HDLC mode, - * the packet will start with the address field, end with the - * information field, and will not contain flag or FCS bytes. - * Bit-stuffing will already have been corrected for. - * - * Possible values of second callback argument "error": - * - * 0 - successful reception - * non-0 - error value - * - * The callback routine should defer any time-consuming operations - * to a bottom-half handler; however, brecv may be called - * from within the callback to register another buffer and ensure - * continuous B channel reception without loss of data - * */ - -struct foreign_interface { - int (*get_irqnum)(int dev); - int (*get_liu_state)(int dev); - void (*liu_init)(int dev, void (*callback)(void *), void *callback_arg); - void (*liu_activate)(int dev, int priority); - void (*liu_deactivate)(int dev); - void (*dxmit)(int dev, __u8 *buffer, unsigned int count, - void (*callback)(void *, int), - void *callback_arg); - void (*drecv)(int dev, __u8 *buffer, unsigned int size, - void (*callback)(void *, int, unsigned int), - void *callback_arg); - int (*bopen)(int dev, unsigned int chan, - int hdlcmode, u_char xmit_idle_char); - void (*bclose)(int dev, unsigned int chan); - void (*bxmit)(int dev, unsigned int chan, - __u8 *buffer, unsigned long count, - void (*callback)(void *, int), - void *callback_arg); - void (*brecv)(int dev, unsigned int chan, - __u8 *buffer, unsigned long size, - void (*callback)(void *, int, unsigned int), - void *callback_arg); - - struct foreign_interface *next; -}; - -extern struct foreign_interface amd7930_foreign_interface; -extern struct foreign_interface dbri_foreign_interface; diff --git a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c index c32525e7d..053dd9024 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.34.6.2 2000/11/28 12:02:46 kai Exp $ +/* $Id: hfc_pci.c,v 1.34.6.3 2000/12/10 23:39:19 kai Exp $ * hfc_pci.c low level driver for CCD´s hfc-pci based cards * @@ -35,7 +35,7 @@ extern const char *CardType[]; -static const char *hfcpci_revision = "$Revision: 1.34.6.2 $"; +static const char *hfcpci_revision = "$Revision: 1.34.6.3 $"; /* table entry in the PCI devices list */ typedef struct { @@ -61,6 +61,7 @@ static const PCI_ENTRY id_list[] = {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B00B, "Billion", "B00B"}, {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B00C, "Billion", "B00C"}, {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B100, "Seyeon", "B100"}, + {PCI_VENDOR_ID_ABOCOM, PCI_DEVICE_ID_ABOCOM_2BD1, "Abocom/Magitek", "2BD1"}, {PCI_VENDOR_ID_ASUSTEK, PCI_DEVICE_ID_ASUSTEK_0675, "Asuscom/Askey", "675"}, {PCI_VENDOR_ID_BERKOM, PCI_DEVICE_ID_BERKOM_T_CONCEPT, "German telekom", "T-Concept"}, {PCI_VENDOR_ID_BERKOM, PCI_DEVICE_ID_BERKOM_A1T, "German telekom", "A1T"}, diff --git a/drivers/isdn/hisax/hisax.h b/drivers/isdn/hisax/hisax.h index 22cf911b3..aafbe05a3 100644 --- a/drivers/isdn/hisax/hisax.h +++ b/drivers/isdn/hisax/hisax.h @@ -1,4 +1,4 @@ -/* $Id: hisax.h,v 2.52 2000/11/25 17:01:00 kai Exp $ +/* $Id: hisax.h,v 2.52.6.1 2000/12/06 16:59:19 kai Exp $ * * Basic declarations, defines and prototypes * diff --git a/drivers/isdn/hisax/isdnl1.c b/drivers/isdn/hisax/isdnl1.c index cda9e422c..5506b956f 100644 --- a/drivers/isdn/hisax/isdnl1.c +++ b/drivers/isdn/hisax/isdnl1.c @@ -1,4 +1,4 @@ -/* $Id: isdnl1.c,v 2.41 2000/11/24 17:05:37 kai Exp $ +/* $Id: isdnl1.c,v 2.41.6.1 2000/12/10 22:01:04 kai Exp $ * * isdnl1.c common low level stuff for Siemens Chipsetbased isdn cards * based on the teles driver from Jan den Ouden @@ -15,7 +15,7 @@ * */ -const char *l1_revision = "$Revision: 2.41 $"; +const char *l1_revision = "$Revision: 2.41.6.1 $"; #define __NO_VERSION__ #include <linux/init.h> @@ -343,7 +343,6 @@ init_bcstate(struct IsdnCardState *cs, bcs->cs = cs; bcs->channel = bc; - INIT_LIST_HEAD(&bcs->tqueue.list); bcs->tqueue.sync = 0; bcs->tqueue.routine = (void *) (void *) BChannel_bh; bcs->tqueue.data = bcs; diff --git a/drivers/isdn/hisax/l3ni1.c b/drivers/isdn/hisax/l3ni1.c index 8f4ccf421..4440f44e7 100644 --- a/drivers/isdn/hisax/l3ni1.c +++ b/drivers/isdn/hisax/l3ni1.c @@ -1,4 +1,4 @@ -// $Id: l3ni1.c,v 2.5 2000/11/19 17:02:48 kai Exp $ +// $Id: l3ni1.c,v 2.5.6.1 2000/12/06 16:59:19 kai Exp $ // //----------------------------------------------------------------------------- // @@ -26,7 +26,7 @@ #include <linux/ctype.h> extern char *HiSax_getrev(const char *revision); -const char *ni1_revision = "$Revision: 2.5 $"; +const char *ni1_revision = "$Revision: 2.5.6.1 $"; #define EXT_BEARER_CAPS 1 diff --git a/drivers/isdn/hisax/netjet.c b/drivers/isdn/hisax/netjet.c index 9dede4757..996289aa9 100644 --- a/drivers/isdn/hisax/netjet.c +++ b/drivers/isdn/hisax/netjet.c @@ -1,4 +1,4 @@ -/* $Id: netjet.c,v 1.24 2000/11/24 17:05:38 kai Exp $ +/* $Id: netjet.c,v 1.24.6.1 2000/12/06 16:59:20 kai Exp $ * * netjet.c low level stuff for Traverse Technologie NETJet ISDN cards * @@ -29,7 +29,7 @@ #define virt_to_bus (u_int) #endif -const char *NETjet_revision = "$Revision: 1.24 $"; +const char *NETjet_revision = "$Revision: 1.24.6.1 $"; /* Interface functions */ diff --git a/drivers/isdn/hysdn/Makefile b/drivers/isdn/hysdn/Makefile index 5613784b7..1f119beb7 100644 --- a/drivers/isdn/hysdn/Makefile +++ b/drivers/isdn/hysdn/Makefile @@ -1,27 +1,29 @@ -SUB_DIRS := -MOD_SUB_DIRS := -ALL_SUB_DIRS := - -L_OBJS := -LX_OBJS := -M_OBJS := -MX_OBJS := -O_OBJS := -OX_OBJS := -L_TARGET := -O_TARGET := - -ifeq ($(CONFIG_PROC_FS),y) - ifeq ($(CONFIG_HYSDN),y) - M_OBJS += hysdn.o - O_TARGET += hysdn.o - O_OBJS += hysdn_procconf.o hysdn_proclog.o boardergo.o hysdn_boot.o hysdn_sched.o hysdn_net.o - ifeq ($(CONFIG_HYSDN_CAPI),y) - O_OBJS += hycapi.o - endif - OX_OBJS += hysdn_init.o - endif -endif +# Makefile for the hysdn ISDN device driver + +# The target object and module list name. + +O_TARGET := vmlinux-obj.o + +# Multipart objects. + +list-multi := hysdn.o +hysdn-objs := hysdn_procconf.o hysdn_proclog.o boardergo.o hysdn_boot.o \ + hysdn_sched.o hysdn_net.o hysdn_init.o + +# Optional parts of multipart objects. + +hysdn-objs-$(CONFIG_HYSDN_CAPI) += hycapi.o + +hysdn-objs += $(hysdn-objs-y) + +# Each configuration option enables a list of files. + +obj-$(CONFIG_HYSDN) += hysdn.o include $(TOPDIR)/Rules.make +# Link rules for multi-part drivers. + +hysdn.o: $(hysdn-objs) + $(LD) -r -o $@ $(hysdn-objs) + diff --git a/drivers/isdn/hysdn/boardergo.c b/drivers/isdn/hysdn/boardergo.c index 941a4bfab..92e96ec9b 100644 --- a/drivers/isdn/hysdn/boardergo.c +++ b/drivers/isdn/hysdn/boardergo.c @@ -1,4 +1,4 @@ -/* $Id: boardergo.c,v 1.5 2000/11/22 17:13:13 kai Exp $ +/* $Id: boardergo.c,v 1.5.6.1 2000/12/10 22:01:04 kai Exp $ * Linux driver for HYSDN cards, specific routines for ergo type boards. * @@ -458,7 +458,6 @@ ergo_inithardware(hysdn_card * card) card->writebootseq = ergo_writebootseq; card->waitpofready = ergo_waitpofready; card->set_errlog_state = ergo_set_errlog_state; - INIT_LIST_HEAD(&card->irq_queue.list); card->irq_queue.sync = 0; card->irq_queue.data = card; /* init task queue for interrupt */ card->irq_queue.routine = (void *) (void *) ergo_irq_bh; diff --git a/drivers/isdn/icn/Makefile b/drivers/isdn/icn/Makefile index 17c533ee8..bd716cf0b 100644 --- a/drivers/isdn/icn/Makefile +++ b/drivers/isdn/icn/Makefile @@ -1,8 +1,11 @@ -ifeq ($(CONFIG_ISDN_DRV_ICN),y) - O_TARGET := icn_obj.o - O_OBJS := icn.o -else - M_OBJS := icn.o -endif +# Makefile for the act2000 ISDN device driver + +# The target object and module list name. + +O_TARGET := vmlinux-obj.o + +# Each configuration option enables a list of files. + +obj-$(CONFIG_ISDN_DRV_ICN) += icn.o include $(TOPDIR)/Rules.make diff --git a/drivers/isdn/isdn_cards.c b/drivers/isdn/isdn_cards.c index 8c7636b46..268711139 100644 --- a/drivers/isdn/isdn_cards.c +++ b/drivers/isdn/isdn_cards.c @@ -34,7 +34,7 @@ extern void HiSax_init(void); extern void pcbit_init(void); #endif -#ifdef CONFIG_ISDN_DRV_EICON +#if defined(CONFIG_ISDN_DRV_EICON_OLD) || defined(CONFIG_ISDN_DRV_EICON_DIVAS) extern void eicon_init(void); #endif @@ -57,7 +57,7 @@ isdn_cards_init(void) #if CONFIG_ISDN_DRV_ACT2000 act2000_init(); #endif -#if CONFIG_ISDN_DRV_EICON +#if defined(CONFIG_ISDN_DRV_EICON_OLD) || defined(CONFIG_ISDN_DRV_EICON_DIVAS) eicon_init(); #endif } diff --git a/drivers/isdn/isdn_common.c b/drivers/isdn/isdn_common.c index eea88399b..615d11fc1 100644 --- a/drivers/isdn/isdn_common.c +++ b/drivers/isdn/isdn_common.c @@ -36,6 +36,9 @@ #ifdef CONFIG_ISDN_AUDIO #include "isdn_audio.h" #endif +#ifdef CONFIG_ISDN_DIVERSION_MODULE +#define CONFIG_ISDN_DIVERSION +#endif #ifdef CONFIG_ISDN_DIVERSION #include <linux/isdn_divertif.h> #endif CONFIG_ISDN_DIVERSION diff --git a/drivers/isdn/isdn_net.c b/drivers/isdn/isdn_net.c index b3b431443..757c59ca9 100644 --- a/drivers/isdn/isdn_net.c +++ b/drivers/isdn/isdn_net.c @@ -1,4 +1,4 @@ -/* $Id: isdn_net.c,v 1.140 2000/11/01 17:54:01 detabc Exp $ +/* $Id: isdn_net.c,v 1.140.6.1 2000/12/10 22:01:04 kai Exp $ * Linux ISDN subsystem, network interfaces and related functions (linklevel). * @@ -181,7 +181,7 @@ static __inline__ void isdn_net_zero_frame_cnt(isdn_net_local *lp) int isdn_net_force_dial_lp(isdn_net_local *); static int isdn_net_start_xmit(struct sk_buff *, struct net_device *); -char *isdn_net_revision = "$Revision: 1.140 $"; +char *isdn_net_revision = "$Revision: 1.140.6.1 $"; /* * Code for raw-networking over ISDN @@ -2371,7 +2371,7 @@ isdn_net_new(char *name, struct net_device *master) netdev->local->netdev = netdev; netdev->local->next = netdev->local; - memset(&netdev->local->tqueue, 0, sizeof(struct tq_struct)); + netdev->local->tqueue.sync = 0; netdev->local->tqueue.routine = isdn_net_softint; netdev->local->tqueue.data = netdev->local; spin_lock_init(&netdev->local->xmit_lock); diff --git a/drivers/isdn/isdnloop/Makefile b/drivers/isdn/isdnloop/Makefile index 588d80760..312e9b969 100644 --- a/drivers/isdn/isdnloop/Makefile +++ b/drivers/isdn/isdnloop/Makefile @@ -1,11 +1,14 @@ -L_OBJS := -M_OBJS := - -ifeq ($(CONFIG_ISDN_DRV_LOOP),y) - L_OBJS += isdnloop.o -else - M_OBJS += isdnloop.o -endif +# +# Makefile for the isdnloop ISDN device driver +# + +# The target object and module list name. + +O_TARGET := vmlinux-obj.o + +# Each configuration option enables a list of files. + +obj-$(CONFIG_ISDN_DRV_LOOP) += isdnloop.o include $(TOPDIR)/Rules.make diff --git a/drivers/isdn/pcbit/Makefile b/drivers/isdn/pcbit/Makefile index 50a67269e..7a6a80447 100644 --- a/drivers/isdn/pcbit/Makefile +++ b/drivers/isdn/pcbit/Makefile @@ -1,15 +1,21 @@ -L_OBJS := -M_OBJS := -O_OBJS := module.o edss1.o drv.o layer2.o capi.o callbacks.o - -O_TARGET := -ifeq ($(CONFIG_ISDN_DRV_PCBIT),y) - O_TARGET += pcbit.o -else - ifeq ($(CONFIG_ISDN_DRV_PCBIT),m) - O_TARGET += pcbit.o - M_OBJS += pcbit.o - endif -endif +# Makefile for the pcbit ISDN device driver + +# The target object and module list name. + +O_TARGET := vmlinux-obj.o + +# Multipart objects. + +list-multi := pcbit.o +pcbit-objs := module.o edss1.o drv.o layer2.o capi.o callbacks.o + +# Each configuration option enables a list of files. + +obj-$(CONFIG_ISDN_DRV_PCBIT) += pcbit.o include $(TOPDIR)/Rules.make + +# Link rules for multi-part drivers. + +pcbit.o: $(pcbit-objs) + $(LD) -r -o $@ $(pcbit-objs) diff --git a/drivers/isdn/pcbit/drv.c b/drivers/isdn/pcbit/drv.c index 4f421e75c..1e13e0c68 100644 --- a/drivers/isdn/pcbit/drv.c +++ b/drivers/isdn/pcbit/drv.c @@ -134,8 +134,6 @@ int pcbit_init_dev(int board, int mem_base, int irq) memset(dev->b2, 0, sizeof(struct pcbit_chan)); dev->b2->id = 1; - - INIT_LIST_HEAD(&dev->qdelivery.list); dev->qdelivery.sync = 0; dev->qdelivery.routine = pcbit_deliver; dev->qdelivery.data = dev; diff --git a/drivers/isdn/sc/Makefile b/drivers/isdn/sc/Makefile index ff87210b8..60ac3ce6d 100644 --- a/drivers/isdn/sc/Makefile +++ b/drivers/isdn/sc/Makefile @@ -1,44 +1,22 @@ -# -# $Id: Makefile,v 1.1 1997/03/22 02:01:22 fritz Exp $ -# Copyright (C) 1996 SpellCaster Telecommunications Inc. -# -# 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 -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# For more information, please contact gpl-info@spellcast.com or write: -# -# SpellCaster Telecommunications Inc. -# 5621 Finch Avenue East, Unit #3 -# Scarborough, Ontario Canada -# M1B 2T9 -# +1 (416) 297-8565 -# +1 (416) 297-6433 Facsimile -# - -L_OBJS := -M_OBJS := -O_OBJS := shmem.o init.o debug.o packet.o command.o event.o \ - ioctl.o interrupt.o message.o timer.o - -O_TARGET := -ifeq ($(CONFIG_ISDN_DRV_SC),y) - O_TARGET += sc.o -else - ifeq ($(CONFIG_ISDN_DRV_SC),m) - O_TARGET += sc.o - M_OBJS += sc.o - endif -endif +# Makefile for the sc ISDN device driver + +# The target object and module list name. + +O_TARGET := vmlinux-obj.o + +# Multipart objects. + +list-multi := sc.o +sc-objs := shmem.o init.o debug.o packet.o command.o event.o \ + ioctl.o interrupt.o message.o timer.o + +# Each configuration option enables a list of files. + +obj-$(CONFIG_ISDN_DRV_SC) += sc.o include $(TOPDIR)/Rules.make + +# Link rules for multi-part drivers. + +sc.o: $(sc-objs) + $(LD) -r -o $@ $(sc-objs) |