File: /usr/src/linux/drivers/isdn/hisax/lmgr.c
1 /* $Id: lmgr.c,v 1.7.6.1 2001/02/16 16:43:28 kai Exp $
2 *
3 * Author Karsten Keil (keil@isdn4linux.de)
4 *
5 * Layermanagement module
6 *
7 * This file is (c) under GNU General Public License
8 *
9 */
10
11 #define __NO_VERSION__
12 #include "hisax.h"
13
14 static void
15 error_handling_dchan(struct PStack *st, int Error)
16 {
17 switch (Error) {
18 case 'C':
19 case 'D':
20 case 'G':
21 case 'H':
22 st->l2.l2tei(st, MDL_ERROR | REQUEST, NULL);
23 break;
24 }
25 }
26
27 static void
28 hisax_manager(struct PStack *st, int pr, void *arg)
29 {
30 long Code;
31
32 switch (pr) {
33 case (MDL_ERROR | INDICATION):
34 Code = (long) arg;
35 HiSax_putstatus(st->l1.hardware, "manager: MDL_ERROR",
36 " %c %s", (char)Code,
37 test_bit(FLG_LAPD, &st->l2.flag) ?
38 "D-channel" : "B-channel");
39 if (test_bit(FLG_LAPD, &st->l2.flag))
40 error_handling_dchan(st, Code);
41 break;
42 }
43 }
44
45 void
46 setstack_manager(struct PStack *st)
47 {
48 st->ma.layer = hisax_manager;
49 }
50