patch-2.1.92 linux/drivers/isdn/hisax/lmgr.c

Next file: linux/drivers/isdn/hisax/mic.c
Previous file: linux/drivers/isdn/hisax/l3dss1.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.91/linux/drivers/isdn/hisax/lmgr.c linux/drivers/isdn/hisax/lmgr.c
@@ -0,0 +1,58 @@
+/* $Id: lmgr.c,v 1.2 1997/10/29 19:09:34 keil Exp $
+
+ * Author       Karsten Keil (keil@temic-ech.spacenet.de)
+ *
+ *
+ *  Layermanagement module
+ *
+ * $Log: lmgr.c,v $
+ * Revision 1.2  1997/10/29 19:09:34  keil
+ * new L1
+ *
+ * Revision 1.1  1997/06/26 11:17:25  keil
+ * first version
+ *
+ *
+ */
+
+#define __NO_VERSION__
+#include "hisax.h"
+
+static void
+error_handling_dchan(struct PStack *st, int Error)
+{
+	switch (Error) {
+		case 'C':
+		case 'D':
+		case 'G':
+		case 'H':
+			st->l2.l2tei(st, MDL_ERROR_REQ, NULL);
+			break;
+	}
+}
+
+static void
+hisax_manager(struct PStack *st, int pr, void *arg)
+{
+	char tm[32], str[256];
+	int Code;
+
+	switch (pr) {
+		case MDL_ERROR_IND:
+			Code = (int) arg;
+			jiftime(tm, jiffies);
+			sprintf(str, "%s manager: MDL_ERROR %c %s\n", tm,
+				Code, test_bit(FLG_LAPD, &st->l2.flag) ?
+				"D-channel" : "B-channel");
+			HiSax_putstatus(st->l1.hardware, str);
+			if (test_bit(FLG_LAPD, &st->l2.flag))
+				error_handling_dchan(st, Code);
+			break;
+	}
+}
+
+void
+setstack_manager(struct PStack *st)
+{
+	st->ma.layer = hisax_manager;
+}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov