summaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-07-03 21:46:06 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-07-03 21:46:06 +0000
commit3e414096429d55fbc8116171bba3487647bbe638 (patch)
tree2b5fcfd9d16fa3a32c829fc2076f6e3785b43374 /drivers/isdn
parent20b23bfcf36fcb2d16d8b844501072541970637c (diff)
Merge with Linux 2.4.0-test3-pre2.
Diffstat (limited to 'drivers/isdn')
-rw-r--r--drivers/isdn/avmb1/Makefile7
-rw-r--r--drivers/isdn/avmb1/b1.c10
-rw-r--r--drivers/isdn/avmb1/b1dma.c15
-rw-r--r--drivers/isdn/avmb1/b1pci.c60
-rw-r--r--drivers/isdn/avmb1/c4.c44
-rw-r--r--drivers/isdn/avmb1/capi.c73
-rw-r--r--drivers/isdn/avmb1/capidrv.c43
-rw-r--r--drivers/isdn/avmb1/kcapi.c12
-rw-r--r--drivers/isdn/avmb1/t1pci.c31
9 files changed, 217 insertions, 78 deletions
diff --git a/drivers/isdn/avmb1/Makefile b/drivers/isdn/avmb1/Makefile
index 77a701611..cd2223911 100644
--- a/drivers/isdn/avmb1/Makefile
+++ b/drivers/isdn/avmb1/Makefile
@@ -1,5 +1,5 @@
#
-# $Id: Makefile,v 1.16 2000/03/17 12:15:44 calle Exp $
+# $Id: Makefile,v 1.18 2000/04/03 16:39:25 calle Exp $
#
# Makefile for the CAPI and AVM-B1 device drivers.
#
@@ -146,6 +146,11 @@ ifeq ($(CONFIG_ISDN_CAPI),y)
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
diff --git a/drivers/isdn/avmb1/b1.c b/drivers/isdn/avmb1/b1.c
index 65c4368cd..ff13e1636 100644
--- a/drivers/isdn/avmb1/b1.c
+++ b/drivers/isdn/avmb1/b1.c
@@ -1,11 +1,14 @@
/*
- * $Id: b1.c,v 1.13 2000/01/25 14:33:38 calle Exp $
+ * $Id: b1.c,v 1.14 2000/06/19 16:51:53 keil Exp $
*
* Common module for AVM B1 cards.
*
* (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
*
* $Log: b1.c,v $
+ * Revision 1.14 2000/06/19 16:51:53 keil
+ * don't free skb in irq context
+ *
* Revision 1.13 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
@@ -86,12 +89,13 @@
#include <linux/capi.h>
#include <asm/io.h>
#include <asm/uaccess.h>
+#include <linux/netdevice.h>
#include "capilli.h"
#include "avmcard.h"
#include "capicmd.h"
#include "capiutil.h"
-static char *revision = "$Revision: 1.13 $";
+static char *revision = "$Revision: 1.14 $";
/* ------------------------------------------------------------- */
@@ -420,7 +424,7 @@ void b1_send_message(struct capi_ctr *ctrl, struct sk_buff *skb)
b1_put_slice(port, skb->data, len);
}
restore_flags(flags);
- dev_kfree_skb(skb);
+ dev_kfree_skb_any(skb);
}
/* ------------------------------------------------------------- */
diff --git a/drivers/isdn/avmb1/b1dma.c b/drivers/isdn/avmb1/b1dma.c
index b40fafae9..168c7202f 100644
--- a/drivers/isdn/avmb1/b1dma.c
+++ b/drivers/isdn/avmb1/b1dma.c
@@ -1,11 +1,14 @@
/*
- * $Id: b1dma.c,v 1.4 2000/04/03 16:38:05 calle Exp $
+ * $Id: b1dma.c,v 1.5 2000/06/19 16:51:53 keil Exp $
*
* Common module for AVM B1 cards that support dma with AMCC
*
* (c) Copyright 2000 by Carsten Paeth (calle@calle.in-berlin.de)
*
* $Log: b1dma.c,v $
+ * Revision 1.5 2000/06/19 16:51:53 keil
+ * don't free skb in irq context
+ *
* Revision 1.4 2000/04/03 16:38:05 calle
* made suppress_pollack static.
*
@@ -32,12 +35,13 @@
#include <linux/capi.h>
#include <asm/io.h>
#include <asm/uaccess.h>
+#include <linux/netdevice.h>
#include "capilli.h"
#include "avmcard.h"
#include "capicmd.h"
#include "capiutil.h"
-static char *revision = "$Revision: 1.4 $";
+static char *revision = "$Revision: 1.5 $";
/* ------------------------------------------------------------- */
@@ -430,7 +434,7 @@ static void b1dma_dispatch_tx(avmcard *card)
b1dmaoutmeml(card->mbase+AMCC_INTCSR, card->csr);
restore_flags(flags);
- dev_kfree_skb(skb);
+ dev_kfree_skb_any(skb);
}
/* ------------------------------------------------------------- */
@@ -615,11 +619,6 @@ static void b1dma_handle_interrupt(avmcard *card)
if ((status & TX_TC_INT) != 0) {
card->csr &= ~EN_TX_TC_INT;
b1dma_dispatch_tx(card);
- } else if (card->csr & EN_TX_TC_INT) {
- if (b1dmainmeml(card->mbase+AMCC_TXLEN) == 0) {
- card->csr &= ~EN_TX_TC_INT;
- b1dma_dispatch_tx(card);
- }
}
b1dmaoutmeml(card->mbase+AMCC_INTCSR, card->csr);
}
diff --git a/drivers/isdn/avmb1/b1pci.c b/drivers/isdn/avmb1/b1pci.c
index e98066806..9e230cb2e 100644
--- a/drivers/isdn/avmb1/b1pci.c
+++ b/drivers/isdn/avmb1/b1pci.c
@@ -1,11 +1,24 @@
/*
- * $Id: b1pci.c,v 1.21 2000/04/03 13:29:24 calle Exp $
+ * $Id: b1pci.c,v 1.25 2000/05/29 12:29:18 keil Exp $
*
* Module for AVM B1 PCI-card.
*
* (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
*
* $Log: b1pci.c,v $
+ * Revision 1.25 2000/05/29 12:29:18 keil
+ * make pci_enable_dev compatible to 2.2 kernel versions
+ *
+ * Revision 1.24 2000/05/19 15:43:22 calle
+ * added calls to pci_device_start().
+ *
+ * Revision 1.23 2000/05/06 00:52:36 kai
+ * merged changes from kernel tree
+ * fixed timer and net_device->name breakage
+ *
+ * Revision 1.22 2000/04/21 13:01:33 calle
+ * Revision in b1pciv4 driver was missing.
+ *
* Revision 1.21 2000/04/03 13:29:24 calle
* make Tim Waugh happy (module unload races in 2.3.99-pre3).
* no real problem there, but now it is much cleaner ...
@@ -74,12 +87,13 @@
#include <linux/pci.h>
#include <linux/capi.h>
#include <asm/io.h>
+#include <linux/isdn.h>
#include "capicmd.h"
#include "capiutil.h"
#include "capilli.h"
#include "avmcard.h"
-static char *revision = "$Revision: 1.21 $";
+static char *revision = "$Revision: 1.25 $";
/* ------------------------------------------------------------- */
@@ -466,16 +480,26 @@ static int add_card(struct pci_dev *dev)
struct capicardparams param;
int retval;
- if (pci_enable_device(dev))
- return 0; /* return failure */
-
- if (pci_resource_flags(dev, 2) & IORESOURCE_IO) { /* B1 PCI V4 */
+ if (pci_resource_start(dev, 2)) { /* B1 PCI V4 */
#ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4
driver = &b1pciv4_driver;
#endif
- param.membase = pci_resource_start (dev, 0);
- param.port = pci_resource_start (dev, 2);
+ param.membase = pci_resource_start(dev, 0);
+ param.port = pci_resource_start(dev, 2);
param.irq = dev->irq;
+
+ retval = pci_enable_device (dev);
+ if (retval != 0) {
+ printk(KERN_ERR
+ "%s: failed to enable AVM-B1 V4 at i/o %#x, irq %d, mem %#x err=%d\n",
+ driver->name, param.port, param.irq, param.membase, retval);
+#ifdef MODULE
+ cleanup_module();
+#endif
+ MOD_DEC_USE_COUNT;
+ return -EIO;
+ }
+
printk(KERN_INFO
"%s: PCI BIOS reports AVM-B1 V4 at i/o %#x, irq %d, mem %#x\n",
driver->name, param.port, param.irq, param.membase);
@@ -491,8 +515,20 @@ static int add_card(struct pci_dev *dev)
}
} else {
param.membase = 0;
- param.port = pci_resource_start (dev, 1);
+ param.port = pci_resource_start(dev, 1);
param.irq = dev->irq;
+
+ retval = pci_enable_device (dev);
+ if (retval != 0) {
+ printk(KERN_ERR
+ "%s: failed to enable AVM-B1 at i/o %#x, irq %d, err=%d\n",
+ driver->name, param.port, param.irq, retval);
+#ifdef MODULE
+ cleanup_module();
+#endif
+ MOD_DEC_USE_COUNT;
+ return -EIO;
+ }
printk(KERN_INFO
"%s: PCI BIOS reports AVM-B1 at i/o %#x, irq %d\n",
driver->name, param.port, param.irq);
@@ -522,6 +558,12 @@ int b1pci_init(void)
strncpy(driver->revision, p + 1, sizeof(driver->revision));
p = strchr(driver->revision, '$');
*p = 0;
+#ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4
+ p = strchr(revision, ':');
+ strncpy(driverv4->revision, p + 1, sizeof(driverv4->revision));
+ p = strchr(driverv4->revision, '$');
+ *p = 0;
+#endif
}
printk(KERN_INFO "%s: revision %s\n", driver->name, driver->revision);
diff --git a/drivers/isdn/avmb1/c4.c b/drivers/isdn/avmb1/c4.c
index 104c0f5cc..09c9bad99 100644
--- a/drivers/isdn/avmb1/c4.c
+++ b/drivers/isdn/avmb1/c4.c
@@ -1,11 +1,24 @@
/*
- * $Id: c4.c,v 1.8 2000/04/03 16:38:05 calle Exp $
+ * $Id: c4.c,v 1.12 2000/06/19 16:51:53 keil Exp $
*
* Module for AVM C4 card.
*
* (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
*
* $Log: c4.c,v $
+ * Revision 1.12 2000/06/19 16:51:53 keil
+ * don't free skb in irq context
+ *
+ * Revision 1.11 2000/06/19 15:11:24 keil
+ * avoid use of freed structs
+ * changes from 2.4.0-ac21
+ *
+ * Revision 1.10 2000/05/29 12:29:18 keil
+ * make pci_enable_dev compatible to 2.2 kernel versions
+ *
+ * Revision 1.9 2000/05/19 15:43:22 calle
+ * added calls to pci_device_start().
+ *
* Revision 1.8 2000/04/03 16:38:05 calle
* made suppress_pollack static.
*
@@ -46,6 +59,7 @@
#include <linux/ioport.h>
#include <linux/pci.h>
#include <linux/capi.h>
+#include <linux/isdn.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include "capicmd.h"
@@ -53,7 +67,7 @@
#include "capilli.h"
#include "avmcard.h"
-static char *revision = "$Revision: 1.8 $";
+static char *revision = "$Revision: 1.12 $";
#undef CONFIG_C4_DEBUG
#undef CONFIG_C4_POLLDEBUG
@@ -510,7 +524,7 @@ static void c4_dispatch_tx(avmcard *card)
c4outmeml(card->mbase+DOORBELL, DBELL_DOWN_ARM);
restore_flags(flags);
- dev_kfree_skb(skb);
+ dev_kfree_skb_any(skb);
}
/* ------------------------------------------------------------- */
@@ -949,8 +963,10 @@ static void c4_remove_ctr(struct capi_ctr *ctrl)
for (i=0; i < 4; i++) {
cinfo = &card->ctrlinfo[i];
- if (cinfo->capi_ctrl)
+ if (cinfo->capi_ctrl) {
di->detach_ctr(cinfo->capi_ctrl);
+ cinfo->capi_ctrl = NULL;
+ }
}
free_irq(card->irq, card);
@@ -1163,7 +1179,6 @@ static int c4_add_card(struct capi_driver *driver, struct capicardparams *p)
cinfo = (avmctrl_info *) kmalloc(sizeof(avmctrl_info)*4, GFP_ATOMIC);
if (!cinfo) {
printk(KERN_WARNING "%s: no memory.\n", driver->name);
- kfree(card->ctrlinfo);
kfree(card->dma);
kfree(card);
MOD_DEC_USE_COUNT;
@@ -1333,12 +1348,21 @@ int c4_init(void)
PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_C4, dev))) {
struct capicardparams param;
- if (pci_enable_device(dev))
- continue;
-
- param.port = pci_resource_start (dev, 1);
+ param.port = pci_resource_start(dev, 1);
param.irq = dev->irq;
- param.membase = pci_resource_start (dev, 0);
+ param.membase = pci_resource_start(dev, 0);
+
+ retval = pci_enable_device (dev);
+ if (retval != 0) {
+ printk(KERN_ERR
+ "%s: failed to enable AVM-C4 at i/o %#x, irq %d, mem %#x err=%d\n",
+ driver->name, param.port, param.irq, param.membase, retval);
+#ifdef MODULE
+ cleanup_module();
+#endif
+ MOD_DEC_USE_COUNT;
+ return -EIO;
+ }
printk(KERN_INFO
"%s: PCI BIOS reports AVM-C4 at i/o %#x, irq %d, mem %#x\n",
diff --git a/drivers/isdn/avmb1/capi.c b/drivers/isdn/avmb1/capi.c
index 8169df482..610c20b6d 100644
--- a/drivers/isdn/avmb1/capi.c
+++ b/drivers/isdn/avmb1/capi.c
@@ -1,11 +1,24 @@
/*
- * $Id: capi.c,v 1.31 2000/04/03 13:29:24 calle Exp $
+ * $Id: capi.c,v 1.35 2000/06/19 15:11:24 keil Exp $
*
* CAPI 2.0 Interface for Linux
*
* Copyright 1996 by Carsten Paeth (calle@calle.in-berlin.de)
*
* $Log: capi.c,v $
+ * Revision 1.35 2000/06/19 15:11:24 keil
+ * avoid use of freed structs
+ * changes from 2.4.0-ac21
+ *
+ * Revision 1.34 2000/06/18 16:09:54 keil
+ * more changes for 2.4
+ *
+ * Revision 1.33 2000/05/18 16:35:43 calle
+ * Uaaahh. Bad memory leak fixed.
+ *
+ * Revision 1.32 2000/04/21 12:38:42 calle
+ * Bugfix: error in proc_ functions, begin-off => off-begin
+ *
* Revision 1.31 2000/04/03 13:29:24 calle
* make Tim Waugh happy (module unload races in 2.3.99-pre3).
* no real problem there, but now it is much cleaner ...
@@ -158,7 +171,6 @@
*
*/
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/kernel.h>
@@ -193,7 +205,7 @@
#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
#include <linux/slab.h>
-static char *revision = "$Revision: 1.31 $";
+static char *revision = "$Revision: 1.35 $";
MODULE_AUTHOR("Carsten Paeth (calle@calle.in-berlin.de)");
@@ -816,7 +828,6 @@ static void capi_signal(__u16 applid, void *param)
if (CAPIMSG_SUBCOMMAND(skb->data) == CAPI_IND) {
-
datahandle = CAPIMSG_U16(skb->data, CAPIMSG_BASELEN+4+4+2);
#ifdef _DEBUG_DATAFLOW
printk(KERN_DEBUG "capi_signal: DATA_B3_IND %u len=%d\n",
@@ -854,14 +865,14 @@ static void capi_signal(__u16 applid, void *param)
/* -------- file_operations for capidev ----------------------------- */
-static long long capi_llseek(struct file *file,
- long long offset, int origin)
+static loff_t
+capi_llseek(struct file *file, loff_t offset, int origin)
{
return -ESPIPE;
}
-static ssize_t capi_read(struct file *file, char *buf,
- size_t count, loff_t *ppos)
+static ssize_t
+capi_read(struct file *file, char *buf, size_t count, loff_t *ppos)
{
struct capidev *cdev = (struct capidev *)file->private_data;
struct sk_buff *skb;
@@ -911,8 +922,8 @@ static ssize_t capi_read(struct file *file, char *buf,
return copied;
}
-static ssize_t capi_write(struct file *file, const char *buf,
- size_t count, loff_t *ppos)
+static ssize_t
+capi_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
{
struct capidev *cdev = (struct capidev *)file->private_data;
struct sk_buff *skb;
@@ -975,7 +986,8 @@ capi_poll(struct file *file, poll_table * wait)
return mask;
}
-static int capi_ioctl(struct inode *inode, struct file *file,
+static int
+capi_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
struct capidev *cdev = (struct capidev *)file->private_data;
@@ -1190,7 +1202,8 @@ static int capi_ioctl(struct inode *inode, struct file *file,
return -EINVAL;
}
-static int capi_open(struct inode *inode, struct file *file)
+static int
+capi_open(struct inode *inode, struct file *file)
{
if (file->private_data)
return -EEXIST;
@@ -1198,19 +1211,23 @@ static int capi_open(struct inode *inode, struct file *file)
if ((file->private_data = capidev_alloc(file)) == 0)
return -ENOMEM;
+ MOD_INC_USE_COUNT;
#ifdef _DEBUG_REFCOUNT
printk(KERN_DEBUG "capi_open %d\n", GET_USE_COUNT(THIS_MODULE));
#endif
return 0;
}
-static int capi_release(struct inode *inode, struct file *file)
+static int
+capi_release(struct inode *inode, struct file *file)
{
struct capidev *cdev = (struct capidev *)file->private_data;
capincci_free(cdev, 0xffffffff);
capidev_free(cdev);
+ file->private_data = NULL;
+ MOD_DEC_USE_COUNT;
#ifdef _DEBUG_REFCOUNT
printk(KERN_DEBUG "capi_release %d\n", GET_USE_COUNT(THIS_MODULE));
#endif
@@ -1232,7 +1249,8 @@ static struct file_operations capi_fops =
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
/* -------- file_operations for capincci ---------------------------- */
-int capinc_raw_open(struct inode *inode, struct file *file)
+static int
+capinc_raw_open(struct inode *inode, struct file *file)
{
struct capiminor *mp;
@@ -1256,14 +1274,14 @@ int capinc_raw_open(struct inode *inode, struct file *file)
return 0;
}
-long long capinc_raw_llseek(struct file *file,
- long long offset, int origin)
+static loff_t
+capinc_raw_llseek(struct file *file, loff_t offset, int origin)
{
return -ESPIPE;
}
-ssize_t capinc_raw_read(struct file *file, char *buf,
- size_t count, loff_t *ppos)
+static ssize_t
+capinc_raw_read(struct file *file, char *buf, size_t count, loff_t *ppos)
{
struct capiminor *mp = (struct capiminor *)file->private_data;
struct sk_buff *skb;
@@ -1320,8 +1338,8 @@ ssize_t capinc_raw_read(struct file *file, char *buf,
return copied;
}
-ssize_t capinc_raw_write(struct file *file, const char *buf,
- size_t count, loff_t *ppos)
+static ssize_t
+capinc_raw_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
{
struct capiminor *mp = (struct capiminor *)file->private_data;
struct sk_buff *skb;
@@ -1358,7 +1376,7 @@ ssize_t capinc_raw_write(struct file *file, const char *buf,
return count;
}
-unsigned int
+static unsigned int
capinc_raw_poll(struct file *file, poll_table * wait)
{
struct capiminor *mp = (struct capiminor *)file->private_data;
@@ -1376,7 +1394,8 @@ capinc_raw_poll(struct file *file, poll_table * wait)
return mask;
}
-int capinc_raw_ioctl(struct inode *inode, struct file *file,
+static int
+capinc_raw_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
struct capiminor *mp = (struct capiminor *)file->private_data;
@@ -1388,15 +1407,17 @@ int capinc_raw_ioctl(struct inode *inode, struct file *file,
return -EINVAL;
}
-int
+static int
capinc_raw_release(struct inode *inode, struct file *file)
{
struct capiminor *mp = (struct capiminor *)file->private_data;
if (mp) {
mp->file = 0;
- if (mp->nccip == 0)
+ if (mp->nccip == 0) {
capiminor_free(mp);
+ file->private_data = NULL;
+ }
}
#ifdef _DEBUG_REFCOUNT
@@ -1405,7 +1426,7 @@ capinc_raw_release(struct inode *inode, struct file *file)
return 0;
}
-struct file_operations capinc_raw_fops =
+static struct file_operations capinc_raw_fops =
{
owner: THIS_MODULE,
llseek: capinc_raw_llseek,
@@ -1875,7 +1896,7 @@ endloop:
*eof = 1;
if (off >= len+begin)
return 0;
- *start = page + (off-begin);
+ *start = page + (begin-off);
return ((count < begin+len-off) ? count : begin+len-off);
}
diff --git a/drivers/isdn/avmb1/capidrv.c b/drivers/isdn/avmb1/capidrv.c
index 9521140f1..0b04920f8 100644
--- a/drivers/isdn/avmb1/capidrv.c
+++ b/drivers/isdn/avmb1/capidrv.c
@@ -1,11 +1,25 @@
/*
- * $Id: capidrv.c,v 1.32 2000/04/07 15:19:58 calle Exp $
+ * $Id: capidrv.c,v 1.36 2000/06/26 15:13:41 keil Exp $
*
* ISDN4Linux Driver, using capi20 interface (kernelcapi)
*
* Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de)
*
* $Log: capidrv.c,v $
+ * Revision 1.36 2000/06/26 15:13:41 keil
+ * features should be or'ed
+ *
+ * Revision 1.35 2000/06/19 15:11:25 keil
+ * avoid use of freed structs
+ * changes from 2.4.0-ac21
+ *
+ * Revision 1.34 2000/06/19 13:13:55 calle
+ * Added Modemsupport!
+ *
+ * Revision 1.33 2000/05/06 00:52:36 kai
+ * merged changes from kernel tree
+ * fixed timer and net_device->name breakage
+ *
* Revision 1.32 2000/04/07 15:19:58 calle
* remove warnings
*
@@ -192,7 +206,7 @@
#include "capicmd.h"
#include "capidrv.h"
-static char *revision = "$Revision: 1.32 $";
+static char *revision = "$Revision: 1.36 $";
static int debugmode = 0;
MODULE_AUTHOR("Carsten Paeth <calle@calle.in-berlin.de>");
@@ -327,6 +341,8 @@ static inline __u32 b1prot(int l2, int l3)
return 2;
case ISDN_PROTO_L2_FAX:
return 4;
+ case ISDN_PROTO_L2_MODEM:
+ return 8;
}
}
@@ -343,6 +359,7 @@ static inline __u32 b2prot(int l2, int l3)
case ISDN_PROTO_L2_V11096:
case ISDN_PROTO_L2_V11019:
case ISDN_PROTO_L2_V11038:
+ case ISDN_PROTO_L2_MODEM:
return 1;
case ISDN_PROTO_L2_FAX:
return 4;
@@ -360,6 +377,7 @@ static inline __u32 b3prot(int l2, int l3)
case ISDN_PROTO_L2_V11096:
case ISDN_PROTO_L2_V11019:
case ISDN_PROTO_L2_V11038:
+ case ISDN_PROTO_L2_MODEM:
default:
return 0;
case ISDN_PROTO_L2_FAX:
@@ -2269,16 +2287,19 @@ static int capidrv_addcontr(__u16 contr, struct capi_profile *profp)
card->interface.writebuf_skb = if_sendbuf;
card->interface.writecmd = 0;
card->interface.readstat = if_readstat;
- card->interface.features = ISDN_FEATURE_L2_X75I |
- ISDN_FEATURE_L2_X75UI |
- ISDN_FEATURE_L2_X75BUI |
- ISDN_FEATURE_L2_HDLC |
+ card->interface.features = ISDN_FEATURE_L2_HDLC |
ISDN_FEATURE_L2_TRANS |
ISDN_FEATURE_L3_TRANS |
- ISDN_FEATURE_L2_V11096 |
+ ISDN_FEATURE_P_UNKNOWN |
+ ISDN_FEATURE_L2_X75I |
+ ISDN_FEATURE_L2_X75UI |
+ ISDN_FEATURE_L2_X75BUI;
+ if (profp->support1 & (1<<2))
+ card->interface.features |= ISDN_FEATURE_L2_V11096 |
ISDN_FEATURE_L2_V11019 |
- ISDN_FEATURE_L2_V11038 |
- ISDN_FEATURE_P_UNKNOWN;
+ ISDN_FEATURE_L2_V11038;
+ if (profp->support1 & (1<<8))
+ card->interface.features |= ISDN_FEATURE_L2_MODEM;
card->interface.hl_hdrlen = 22; /* len of DATA_B3_REQ */
strncpy(card->interface.id, id, sizeof(card->interface.id) - 1);
@@ -2401,10 +2422,10 @@ static int capidrv_delcontr(__u16 contr)
}
spin_unlock_irqrestore(&global_lock, flags);
- kfree(card);
-
printk(KERN_INFO "%s: now down.\n", card->name);
+ kfree(card);
+
MOD_DEC_USE_COUNT;
return 0;
diff --git a/drivers/isdn/avmb1/kcapi.c b/drivers/isdn/avmb1/kcapi.c
index 848f4af97..d8dd4f97b 100644
--- a/drivers/isdn/avmb1/kcapi.c
+++ b/drivers/isdn/avmb1/kcapi.c
@@ -1,11 +1,17 @@
/*
- * $Id: kcapi.c,v 1.15 2000/04/06 15:01:25 calle Exp $
+ * $Id: kcapi.c,v 1.17 2000/04/21 13:00:56 calle Exp $
*
* Kernel CAPI 2.0 Module
*
* (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
*
* $Log: kcapi.c,v $
+ * Revision 1.17 2000/04/21 13:00:56 calle
+ * Bugfix: driver_proc_info was also wrong.
+ *
+ * Revision 1.16 2000/04/21 12:38:42 calle
+ * Bugfix: error in proc_ functions, begin-off => off-begin
+ *
* 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.
@@ -109,7 +115,7 @@
#include <linux/b1lli.h>
#endif
-static char *revision = "$Revision: 1.15 $";
+static char *revision = "$Revision: 1.17 $";
/* ------------------------------------------------------------- */
@@ -1100,7 +1106,7 @@ static int driver_read_proc(char *page, char **start, off_t off,
if (len < off)
return 0;
*eof = 1;
- *start = page - off;
+ *start = page + off;
return ((count < len-off) ? count : len-off);
}
diff --git a/drivers/isdn/avmb1/t1pci.c b/drivers/isdn/avmb1/t1pci.c
index 37ed305c2..07625bd0d 100644
--- a/drivers/isdn/avmb1/t1pci.c
+++ b/drivers/isdn/avmb1/t1pci.c
@@ -1,11 +1,18 @@
/*
- * $Id: t1pci.c,v 1.7 2000/04/07 15:26:55 calle Exp $
+ * $Id: t1pci.c,v 1.9 2000/05/19 15:43:22 calle Exp $
*
* Module for AVM T1 PCI-card.
*
* (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
*
* $Log: t1pci.c,v $
+ * Revision 1.9 2000/05/19 15:43:22 calle
+ * added calls to pci_device_start().
+ *
+ * Revision 1.8 2000/05/06 00:52:36 kai
+ * merged changes from kernel tree
+ * fixed timer and net_device->name breakage
+ *
* Revision 1.7 2000/04/07 15:26:55 calle
* better error message if cabel not connected or T1 has no power.
*
@@ -49,12 +56,13 @@
#include <linux/pci.h>
#include <linux/capi.h>
#include <asm/io.h>
+#include <linux/isdn.h>
#include "capicmd.h"
#include "capiutil.h"
#include "capilli.h"
#include "avmcard.h"
-static char *revision = "$Revision: 1.7 $";
+static char *revision = "$Revision: 1.9 $";
#undef CONFIG_T1PCI_DEBUG
#undef CONFIG_T1PCI_POLLDEBUG
@@ -305,12 +313,21 @@ int t1pci_init(void)
while ((dev = pci_find_device(PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_T1, dev))) {
struct capicardparams param;
- if (pci_enable_device(dev))
- continue;
-
- param.port = pci_resource_start (dev, 1);
+ param.port = pci_resource_start(dev, 1);
param.irq = dev->irq;
- param.membase = pci_resource_start (dev, 0);
+ param.membase = pci_resource_start(dev, 0);
+
+ retval = pci_enable_device (dev);
+ if (retval != 0) {
+ printk(KERN_ERR
+ "%s: failed to enable AVM-T1-PCI at i/o %#x, irq %d, mem %#x err=%d\n",
+ driver->name, param.port, param.irq, param.membase, retval);
+#ifdef MODULE
+ cleanup_module();
+#endif
+ MOD_DEC_USE_COUNT;
+ return -EIO;
+ }
printk(KERN_INFO
"%s: PCI BIOS reports AVM-T1-PCI at i/o %#x, irq %d, mem %#x\n",