patch-2.4.0-test7 linux/drivers/isdn/hysdn/hysdn_init.c

Next file: linux/drivers/isdn/hysdn/hysdn_net.c
Previous file: linux/drivers/isdn/hysdn/hysdn_defs.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test6/linux/drivers/isdn/hysdn/hysdn_init.c linux/drivers/isdn/hysdn/hysdn_init.c
@@ -1,4 +1,4 @@
-/* $Id: hysdn_init.c,v 1.1 2000/02/10 19:45:18 werner Exp $
+/* $Id: hysdn_init.c,v 1.5 2000/08/20 16:46:09 keil Exp $
 
  * Linux driver for HYSDN cards, init functions.
  * written by Werner Cornelius (werner@titro.de) for Hypercope GmbH
@@ -20,6 +20,18 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
  * $Log: hysdn_init.c,v $
+ * Revision 1.5  2000/08/20 16:46:09  keil
+ * Changes for 2.4
+ *
+ * Revision 1.4  2000/06/18 16:08:18  keil
+ * 2.4 PCI changes and some cosmetics
+ *
+ * Revision 1.3  2000/06/13 09:15:07  ualbrecht
+ * Module will now unload more gracefully.
+ *
+ * Revision 1.2  2000/05/17 11:41:30  ualbrecht
+ * CAPI 2.0 support added
+ *
  * Revision 1.1  2000/02/10 19:45:18  werner
  *
  * Initial release
@@ -37,7 +49,7 @@
 
 #include "hysdn_defs.h"
 
-static char *hysdn_init_revision = "$Revision: 1.1 $";
+static char *hysdn_init_revision = "$Revision: 1.5 $";
 int cardmax;			/* number of found cards */
 hysdn_card *card_root = NULL;	/* pointer to first card */
 
@@ -77,7 +89,6 @@
 {
 	struct pci_dev *akt_pcidev = NULL;
 	hysdn_card *card, *card_last;
-	uchar irq;
 	int i;
 
 	card_root = NULL;
@@ -218,6 +229,14 @@
 		free_resources();	/* proc file_sys not created */
 		return (-1);
 	}
+#ifdef CONFIG_HYSDN_CAPI
+	if(cardmax > 0) {
+		if(hycapi_init()) {
+			printk(KERN_ERR "HYCAPI: init failed\n");
+			return(-1);
+		}
+	}
+#endif /* CONFIG_HYSDN_CAPI */
 	return (0);		/* no error */
 }				/* init_module */
 
@@ -233,8 +252,18 @@
 void
 cleanup_module(void)
 {
-
+#ifdef CONFIG_HYSDN_CAPI
+	hysdn_card *card;
+#endif /* CONFIG_HYSDN_CAPI */
 	stop_cards();
+#ifdef CONFIG_HYSDN_CAPI
+	card = card_root;	/* first in chain */
+	while (card) {
+		hycapi_capi_release(card);
+		card = card->next;	/* remove card from chain */
+	}			/* while card */
+	hycapi_cleanup();
+#endif /* CONFIG_HYSDN_CAPI */
 	hysdn_procconf_release();
 	free_resources();
 	printk(KERN_NOTICE "HYSDN: module unloaded\n");

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)