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