lmgr.c 1001 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* $Id: lmgr.c,v 1.7.6.2 2001/09/23 22:24:50 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. #include "hisax.h"
  13. static void
  14. error_handling_dchan(struct PStack *st, int Error)
  15. {
  16. switch (Error) {
  17. case 'C':
  18. case 'D':
  19. case 'G':
  20. case 'H':
  21. st->l2.l2tei(st, MDL_ERROR | REQUEST, NULL);
  22. break;
  23. }
  24. }
  25. static void
  26. hisax_manager(struct PStack *st, int pr, void *arg)
  27. {
  28. long Code;
  29. switch (pr) {
  30. case (MDL_ERROR | INDICATION):
  31. Code = (long) arg;
  32. HiSax_putstatus(st->l1.hardware, "manager: MDL_ERROR",
  33. " %c %s", (char)Code,
  34. test_bit(FLG_LAPD, &st->l2.flag) ?
  35. "D-channel" : "B-channel");
  36. if (test_bit(FLG_LAPD, &st->l2.flag))
  37. error_handling_dchan(st, Code);
  38. break;
  39. }
  40. }
  41. void
  42. setstack_manager(struct PStack *st)
  43. {
  44. st->ma.layer = hisax_manager;
  45. }