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

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

diff -u --recursive --new-file v2.4.0-test6/linux/drivers/isdn/hysdn/hysdn_sched.c linux/drivers/isdn/hysdn/hysdn_sched.c
@@ -1,4 +1,4 @@
-/* $Id: hysdn_sched.c,v 1.1 2000/02/10 19:45:18 werner Exp $
+/* $Id: hysdn_sched.c,v 1.3 2000/05/17 11:41:30 ualbrecht Exp $
 
  * Linux driver for HYSDN cards, scheduler routines for handling exchange card <-> pc.
  *
@@ -21,6 +21,12 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
  * $Log: hysdn_sched.c,v $
+ * Revision 1.3  2000/05/17 11:41:30  ualbrecht
+ * CAPI 2.0 support added
+ *
+ * Revision 1.2  2000/04/23 14:18:36  kai
+ * merge changes from main tree
+ *
  * Revision 1.1  2000/02/10 19:45:18  werner
  *
  * Initial release
@@ -29,6 +35,7 @@
  */
 
 #define __NO_VERSION__
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/version.h>
 #include <asm/io.h>
@@ -60,7 +67,12 @@
 			if (card->err_log_state == ERRLOG_STATE_ON)
 				card->err_log_state = ERRLOG_STATE_START;	/* start new fetch */
 			break;
-
+#ifdef CONFIG_HYSDN_CAPI
+         	case CHAN_CAPI:
+/* give packet to CAPI handler */
+			hycapi_rx_capipkt(card, buf, len);
+			break;
+#endif /* CONFIG_HYSDN_CAPI */
 		default:
 			printk(KERN_INFO "irq message channel %d len %d unhandled \n", chan, len);
 			break;
@@ -125,6 +137,17 @@
 		} else
 			hysdn_tx_netack(card);	/* aknowledge packet -> throw away */
 	}			/* send a network packet if available */
+#ifdef CONFIG_HYSDN_CAPI
+	if((skb = hycapi_tx_capiget(card)) != NULL) {
+		if (skb->len <= maxlen) {
+			memcpy(buf, skb->data, skb->len);
+			*len = skb->len;
+			*chan = CHAN_CAPI;
+			hycapi_tx_capiack(card);
+			return (1);	/* go and send the data */
+		}
+	}
+#endif /* CONFIG_HYSDN_CAPI */
 	return (0);		/* nothing to send */
 }				/* hysdn_sched_tx */
 

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