Lines Matching refs:chanp
29 static int init_b_st(struct Channel *chanp, int incoming);
30 static void release_b_st(struct Channel *chanp);
69 link_debug(struct Channel *chanp, int direction, char *fmt, ...)
75 sprintf(tmp, "Ch%d %s ", chanp->chan,
77 VHiSax_putstatus(chanp->cs, tmp, fmt, args);
174 HL_LL(struct Channel *chanp, int command)
178 ic.driver = chanp->cs->myid;
180 ic.arg = chanp->chan;
181 chanp->cs->iif.statcallb(&ic);
185 lli_deliver_cause(struct Channel *chanp)
189 if (!chanp->proc)
191 if (chanp->proc->para.cause == NO_CAUSE)
193 ic.driver = chanp->cs->myid;
195 ic.arg = chanp->chan;
196 if (chanp->cs->protocol == ISDN_PTYPE_EURO)
197 sprintf(ic.parm.num, "E%02X%02X", chanp->proc->para.loc & 0x7f,
198 chanp->proc->para.cause & 0x7f);
200 sprintf(ic.parm.num, "%02X%02X", chanp->proc->para.loc & 0x7f,
201 chanp->proc->para.cause & 0x7f);
202 chanp->cs->iif.statcallb(&ic);
208 struct Channel *chanp = fi->userdata;
211 chanp->Flags = 0;
212 chanp->cs->cardmsg(chanp->cs, MDL_INFO_REL, (void *) (long)chanp->chan);
218 struct Channel *chanp = fi->userdata;
222 if (!chanp->leased)
224 chanp->cs->cardmsg(chanp->cs, MDL_INFO_SETUP, (void *) (long)chanp->chan);
226 if (chanp->debug & 1)
227 link_debug(chanp, 0, "STAT_ICALL_LEASED");
228 ic.driver = chanp->cs->myid;
229 ic.command = ((chanp->chan < 2) ? ISDN_STAT_ICALL : ISDN_STAT_ICALLW);
230 ic.arg = chanp->chan;
235 sprintf(ic.parm.setup.eazmsn,"%d", chanp->chan + 1);
236 sprintf(ic.parm.setup.phone,"LEASED%d", chanp->cs->myid);
237 ret = chanp->cs->iif.statcallb(&ic);
238 if (chanp->debug & 1)
239 link_debug(chanp, 1, "statcallb ret=%d", ret);
241 chanp->cs->cardmsg(chanp->cs, MDL_INFO_REL, (void *) (long)chanp->chan);
253 struct Channel *chanp = fi->userdata;
256 if (chanp->debug & 1)
257 link_debug(chanp, 0, "STAT_DCONN");
258 HL_LL(chanp, ISDN_STAT_DCONN);
259 init_b_st(chanp, 0);
260 chanp->b_st->lli.l4l3(chanp->b_st, DL_ESTABLISH | REQUEST, NULL);
266 struct Channel *chanp = fi->userdata;
268 FsmDelTimer(&chanp->drel_timer, 60);
269 FsmDelTimer(&chanp->dial_timer, 73);
270 chanp->l2_active_protocol = chanp->l2_protocol;
271 chanp->incoming = 0;
272 chanp->cs->cardmsg(chanp->cs, MDL_INFO_SETUP, (void *) (long)chanp->chan);
273 if (chanp->leased) {
277 chanp->d_st->lli.l4l3(chanp->d_st, CC_SETUP | REQUEST, chanp);
284 struct Channel *chanp = fi->userdata;
286 FsmDelTimer(&chanp->drel_timer, 60);
287 FsmDelTimer(&chanp->dial_timer, 73);
288 chanp->l2_active_protocol = chanp->l2_protocol;
289 chanp->incoming = 0;
290 chanp->cs->cardmsg(chanp->cs, MDL_INFO_SETUP, (void *) (long)chanp->chan);
291 if (chanp->leased) {
295 chanp->d_st->lli.l4l3(chanp->d_st, CC_RESUME | REQUEST, chanp);
302 struct Channel *chanp = fi->userdata;
307 chanp->data_open = !0;
308 if (chanp->bcs->conmsg)
309 strcpy(ic.parm.num, chanp->bcs->conmsg);
312 if (chanp->debug & 1)
313 link_debug(chanp, 0, "STAT_BCONN %s", ic.parm.num);
314 ic.driver = chanp->cs->myid;
316 ic.arg = chanp->chan;
317 chanp->cs->iif.statcallb(&ic);
318 chanp->cs->cardmsg(chanp->cs, MDL_INFO_CONN, (void *) (long)chanp->chan);
331 struct Channel *chanp = fi->userdata;
335 chanp->cs->cardmsg(chanp->cs, MDL_INFO_SETUP, (void *) (long)chanp->chan);
343 if (chanp->debug & 1)
344 link_debug(chanp, 0, (chanp->chan < 2) ? "STAT_ICALL" : "STAT_ICALLW");
345 ic.driver = chanp->cs->myid;
346 ic.command = ((chanp->chan < 2) ? ISDN_STAT_ICALL : ISDN_STAT_ICALLW);
348 ic.arg = chanp->chan;
353 memcpy(&ic.parm.setup, &chanp->proc->para.setup, sizeof(setup_parm));
354 ret = chanp->cs->iif.statcallb(&ic);
355 if (chanp->debug & 1)
356 link_debug(chanp, 1, "statcallb ret=%d", ret);
360 FsmDelTimer(&chanp->drel_timer, 61);
362 chanp->d_st->lli.l4l3(chanp->d_st, CC_ALERTING | REQUEST, chanp->proc);
366 FsmDelTimer(&chanp->drel_timer, 61);
368 chanp->d_st->lli.l4l3(chanp->d_st, CC_PROCEED_SEND | REQUEST, chanp->proc);
370 memcpy(&chanp->setup, &ic.parm.setup, sizeof(setup_parm));
371 chanp->d_st->lli.l4l3(chanp->d_st, CC_REDIR | REQUEST, chanp->proc);
377 FsmDelTimer(&chanp->drel_timer, 61);
378 chanp->d_st->lli.l4l3(chanp->d_st, CC_MORE_INFO | REQUEST, chanp->proc);
382 chanp->d_st->lli.l4l3(chanp->d_st, CC_IGNORE | REQUEST, chanp->proc);
383 chanp->cs->cardmsg(chanp->cs, MDL_INFO_REL, (void *) (long)chanp->chan);
388 chanp->d_st->lli.l4l3(chanp->d_st, CC_IGNORE | REQUEST, chanp->proc);
389 chanp->cs->cardmsg(chanp->cs, MDL_INFO_REL, (void *) (long)chanp->chan);
396 struct Channel *chanp = fi->userdata;
399 chanp->d_st->lli.l4l3(chanp->d_st, CC_SETUP | RESPONSE, chanp->proc);
405 struct Channel *chanp = fi->userdata;
408 chanp->d_st->lli.l4l3(chanp->d_st, CC_ALERTING | REQUEST, chanp->proc);
414 struct Channel *chanp = fi->userdata;
416 chanp->d_st->lli.l4l3(chanp->d_st, CC_REDIR | REQUEST, chanp->proc);
422 struct Channel *chanp = fi->userdata;
425 if (chanp->debug & 1)
426 link_debug(chanp, 0, "STAT_DCONN");
427 HL_LL(chanp, ISDN_STAT_DCONN);
428 chanp->l2_active_protocol = chanp->l2_protocol;
429 chanp->incoming = !0;
430 init_b_st(chanp, !0);
431 chanp->b_st->lli.l4l3(chanp->b_st, DL_ESTABLISH | REQUEST, NULL);
437 struct Channel *chanp = fi->userdata;
439 if (chanp->leased) {
444 chanp->d_st->lli.l4l3(chanp->d_st, CC_ALERTING | REQUEST, chanp->proc);
446 chanp->d_st->lli.l4l3(chanp->d_st, CC_SETUP | RESPONSE, chanp->proc);
455 struct Channel *chanp = fi->userdata;
457 chanp->d_st->lli.l4l3(chanp->d_st, CC_SUSPEND | REQUEST, chanp->proc);
463 lli_leased_hup(struct FsmInst *fi, struct Channel *chanp)
467 ic.driver = chanp->cs->myid;
469 ic.arg = chanp->chan;
471 chanp->cs->iif.statcallb(&ic);
472 if (chanp->debug & 1)
473 link_debug(chanp, 0, "STAT_DHUP");
474 HL_LL(chanp, ISDN_STAT_DHUP);
481 struct Channel *chanp = fi->userdata;
483 if (chanp->leased) {
484 lli_leased_hup(fi, chanp);
487 if (chanp->proc)
488 chanp->proc->para.cause = 0x10; /* Normal Call Clearing */
489 chanp->d_st->lli.l4l3(chanp->d_st, CC_DISCONNECT | REQUEST,
490 chanp->proc);
497 struct Channel *chanp = fi->userdata;
499 if (chanp->leased) {
500 lli_leased_hup(fi, chanp);
503 if (chanp->proc)
504 chanp->proc->para.cause = 0x15; /* Call Rejected */
505 chanp->d_st->lli.l4l3(chanp->d_st, CC_DISCONNECT | REQUEST,
506 chanp->proc);
513 struct Channel *chanp = fi->userdata;
515 if (chanp->leased) {
516 lli_leased_hup(fi, chanp);
518 if (chanp->debug & 1)
519 link_debug(chanp, 0, "STAT_DHUP");
520 lli_deliver_cause(chanp);
521 HL_LL(chanp, ISDN_STAT_DHUP);
529 struct Channel *chanp = fi->userdata;
531 if (chanp->leased) {
532 lli_leased_hup(fi, chanp);
536 if (chanp->proc)
537 chanp->proc->para.cause = 0x15; /* Call Rejected */
538 chanp->d_st->lli.l4l3(chanp->d_st, CC_REJECT | REQUEST, chanp->proc);
541 FsmRestartTimer(&chanp->drel_timer, 40, EV_HANGUP, NULL, 63);
543 chanp->d_st->lli.l4l3(chanp->d_st, CC_ALERTING | REQUEST, chanp->proc);
550 struct Channel *chanp = fi->userdata;
552 chanp->data_open = 0;
554 chanp->b_st->lli.l4l3(chanp->b_st, DL_RELEASE | REQUEST, NULL);
560 struct Channel *chanp = fi->userdata;
562 if (chanp->leased) {
563 lli_leased_hup(fi, chanp);
572 struct Channel *chanp = fi->userdata;
574 release_b_st(chanp);
581 struct Channel *chanp = fi->userdata;
583 if (chanp->debug & 1)
584 link_debug(chanp, 0, "STAT_BHUP");
585 HL_LL(chanp, ISDN_STAT_BHUP);
592 struct Channel *chanp = fi->userdata;
595 chanp->data_open = 0;
596 if (chanp->debug & 1)
597 link_debug(chanp, 0, "STAT_BHUP");
598 HL_LL(chanp, ISDN_STAT_BHUP);
599 release_b_st(chanp);
605 struct Channel *chanp = fi->userdata;
607 chanp->data_open = 0;
609 chanp->b_st->lli.l4l3(chanp->b_st, DL_RELEASE | REQUEST, NULL);
616 struct Channel *chanp = fi->userdata;
618 release_b_st(chanp);
625 struct Channel *chanp = fi->userdata;
627 if (chanp->debug & 1)
628 link_debug(chanp, 0, "STAT_BHUP");
629 HL_LL(chanp, ISDN_STAT_BHUP);
636 struct Channel *chanp = fi->userdata;
638 chanp->data_open = 0;
639 chanp->b_st->lli.l4l3(chanp->b_st, DL_RELEASE | REQUEST, NULL);
646 struct Channel *chanp = fi->userdata;
648 if (chanp->leased) {
649 lli_leased_hup(fi, chanp);
652 chanp->d_st->lli.l4l3(chanp->d_st, CC_RELEASE | REQUEST,
653 chanp->proc);
660 struct Channel *chanp = fi->userdata;
662 release_b_st(chanp);
669 struct Channel *chanp = fi->userdata;
671 if (chanp->debug & 1)
672 link_debug(chanp, 0, "STAT_BHUP");
673 HL_LL(chanp, ISDN_STAT_BHUP);
682 struct Channel *chanp = fi->userdata;
685 ic.driver = chanp->cs->myid;
687 ic.arg = chanp->chan;
688 sprintf(ic.parm.num, "%d", chanp->proc->para.chargeinfo);
689 chanp->cs->iif.statcallb(&ic);
697 struct Channel *chanp = fi->userdata;
699 if (chanp->debug & 1)
700 link_debug(chanp, 0, "STAT_DHUP");
701 HL_LL(chanp, ISDN_STAT_DHUP);
707 struct Channel *chanp = fi->userdata;
709 if (chanp->debug & 1)
710 link_debug(chanp, 0, "STAT_DHUP");
711 HL_LL(chanp, ISDN_STAT_DHUP);
724 struct Channel *chanp = fi->userdata;
728 ic.driver = chanp->cs->myid;
730 ic.arg = chanp->chan;
732 chanp->cs->iif.statcallb(&ic);
733 HL_LL(chanp, ISDN_STAT_DHUP);
734 chanp->Flags = 0;
735 chanp->cs->cardmsg(chanp->cs, MDL_INFO_REL, (void *) (long)chanp->chan);
741 struct Channel *chanp = fi->userdata;
743 release_b_st(chanp);
750 struct Channel *chanp = fi->userdata;
752 if (chanp->debug & 1)
753 link_debug(chanp, 0, "STAT_BHUP");
754 HL_LL(chanp, ISDN_STAT_BHUP);
761 struct Channel *chanp = fi->userdata;
763 chanp->data_open = 0;
764 chanp->b_st->lli.l4l3(chanp->b_st, DL_RELEASE | REQUEST, NULL);
854 release_b_st(struct Channel *chanp)
856 struct PStack *st = chanp->b_st;
858 if(test_and_clear_bit(FLG_START_B, &chanp->Flags)) {
859 chanp->bcs->BC_Close(chanp->bcs);
860 switch (chanp->l2_active_protocol) {
879 struct Channel *chanp = st->lli.userdata;
889 chanp += 2;
893 if (chanp->fi.state == ST_NULL)
894 return (chanp);
895 chanp++;
901 chanp = st->lli.userdata;
902 chanp += i;
904 if (chanp->fi.state == ST_NULL)
905 return (chanp);
906 chanp++;
928 struct Channel *chanp;
934 if (!(chanp = selectfreechannel(pc->st, pc->para.bchannel))) {
938 chanp->proc = pc;
939 pc->chan = chanp;
940 FsmEvent(&chanp->fi, EV_SETUP_IND, NULL);
944 if (!(chanp = pc->chan))
949 FsmEvent(&chanp->fi, EV_SETUP_IND, NULL);
952 FsmEvent(&chanp->fi, EV_DISCONNECT_IND, NULL);
955 FsmEvent(&chanp->fi, EV_RELEASE, NULL);
958 FsmEvent(&chanp->fi, EV_RELEASE, NULL);
961 FsmEvent(&chanp->fi, EV_SETUP_CNF, NULL);
964 FsmEvent(&chanp->fi, EV_RELEASE, NULL);
967 FsmEvent(&chanp->fi, EV_RELEASE, NULL);
970 FsmEvent(&chanp->fi, EV_SETUP_CMPL_IND, NULL);
973 FsmEvent(&chanp->fi, EV_SETUP_CNF, NULL);
976 FsmEvent(&chanp->fi, EV_CINF, NULL);
979 FsmEvent(&chanp->fi, EV_NOSETUP_RSP, NULL);
982 FsmEvent(&chanp->fi, EV_SETUP_ERR, NULL);
985 FsmEvent(&chanp->fi, EV_CONNECT_ERR, NULL);
988 FsmEvent(&chanp->fi, EV_RELEASE, NULL);
997 stat_redir_result(cs, chanp->chan, pc->redir_result);
1000 if (chanp->debug & 0x800) {
1001 HiSax_putstatus(chanp->cs, "Ch",
1003 chanp->chan, pr);
1034 init_d_st(struct Channel *chanp)
1037 struct IsdnCardState *cs = chanp->cs;
1041 err = init_PStack(&chanp->d_st);
1044 st = chanp->d_st;
1060 sprintf(tmp, "DCh%d Q.921 ", chanp->chan);
1064 setstack_l3dc(st, chanp);
1065 st->lli.userdata = chanp;
1075 struct Channel *chanp = fi->userdata;
1079 sprintf(tmp, "Ch%d callc ", chanp->chan);
1080 VHiSax_putstatus(chanp->cs, tmp, fmt, args);
1087 struct Channel *chanp = csta->channel + chan;
1090 chanp->cs = csta;
1091 chanp->bcs = csta->bcs + chan;
1092 chanp->chan = chan;
1093 chanp->incoming = 0;
1094 chanp->debug = 0;
1095 chanp->Flags = 0;
1096 chanp->leased = 0;
1097 err = init_PStack(&chanp->b_st);
1100 chanp->b_st->l1.delay = DEFAULT_B_DELAY;
1101 chanp->fi.fsm = &callcfsm;
1102 chanp->fi.state = ST_NULL;
1103 chanp->fi.debug = 0;
1104 chanp->fi.userdata = chanp;
1105 chanp->fi.printdebug = callc_debug;
1106 FsmInitTimer(&chanp->fi, &chanp->dial_timer);
1107 FsmInitTimer(&chanp->fi, &chanp->drel_timer);
1109 err = init_d_st(chanp);
1113 chanp->d_st = csta->channel->d_st;
1115 chanp->data_open = 0;
1147 release_d_st(struct Channel *chanp)
1149 struct PStack *st = chanp->d_st;
1157 chanp->d_st = NULL;
1186 struct Channel *chanp = (struct Channel *) st->lli.userdata;
1191 if (chanp->data_open) {
1192 if (chanp->debug & 0x800)
1193 link_debug(chanp, 0, "lldata: %d", skb->len);
1194 chanp->cs->iif.rcvcallb_skb(chanp->cs->myid, chanp->chan, skb);
1196 link_debug(chanp, 0, "lldata: channel not open");
1202 FsmEvent(&chanp->fi, EV_BC_EST, NULL);
1206 FsmEvent(&chanp->fi, EV_BC_REL, NULL);
1218 struct Channel *chanp = (struct Channel *) st->lli.userdata;
1223 if (chanp->data_open) {
1224 if (chanp->debug & 0x800)
1225 link_debug(chanp, 0, "lltrans: %d", skb->len);
1226 chanp->cs->iif.rcvcallb_skb(chanp->cs->myid, chanp->chan, skb);
1228 link_debug(chanp, 0, "lltrans: channel not open");
1234 FsmEvent(&chanp->fi, EV_BC_EST, NULL);
1238 FsmEvent(&chanp->fi, EV_BC_REL, NULL);
1250 struct Channel *chanp = st->lli.userdata;
1253 if (chanp->debug & 0x800)
1254 link_debug(chanp, 0, "llwakeup: %d", len);
1255 ic.driver = chanp->cs->myid;
1257 ic.arg = chanp->chan;
1259 chanp->cs->iif.statcallb(&ic);
1263 init_b_st(struct Channel *chanp, int incoming)
1265 struct PStack *st = chanp->b_st;
1266 struct IsdnCardState *cs = chanp->cs;
1270 if (chanp->leased)
1271 st->l1.bc = chanp->chan & 1;
1273 st->l1.bc = chanp->proc->para.bchannel - 1;
1274 switch (chanp->l2_active_protocol) {
1292 chanp->bcs->conmsg = NULL;
1293 if (chanp->bcs->BC_SetStack(st, chanp->bcs))
1305 switch (chanp->l2_active_protocol) {
1307 sprintf(tmp, "Ch%d X.75", chanp->chan);
1309 setstack_l3bc(st, chanp);
1311 st->lli.userdata = chanp;
1314 st->l2.l2m.debug = chanp->debug & 16;
1315 st->l2.debug = chanp->debug & 64;
1323 st->lli.userdata = chanp;
1327 setstack_l3bc(st, chanp);
1330 test_and_set_bit(FLG_START_B, &chanp->Flags);
1337 struct Channel *chanp = (struct Channel *) st->lli.userdata;
1342 link_debug(chanp, 0, "leased line d-channel DATA");
1360 struct Channel *chanp = (struct Channel *) st->lli.userdata;
1366 link_debug(chanp, 0, "leased line d-channel DATA");
1374 if (test_bit(FLG_TWO_DCHAN, &chanp->cs->HW_Flags))
1379 FsmEvent(&chanp->fi, event, NULL);
1380 chanp++;
1395 struct Channel *chanp = csta->channel;
1398 chanp[i].debug = debugflags;
1399 chanp[i].fi.debug = debugflags & 2;
1400 chanp[i].d_st->l2.l2m.debug = debugflags & 8;
1401 chanp[i].b_st->l2.l2m.debug = debugflags & 0x10;
1402 chanp[i].d_st->l2.debug = debugflags & 0x20;
1403 chanp[i].b_st->l2.debug = debugflags & 0x40;
1404 chanp[i].d_st->l3.l3m.debug = debugflags & 0x80;
1405 chanp[i].b_st->l3.l3m.debug = debugflags & 0x100;
1406 chanp[i].b_st->ma.tei_m.debug = debugflags & 0x200;
1407 chanp[i].b_st->ma.debug = debugflags & 0x200;
1408 chanp[i].d_st->l1.l1m.debug = debugflags & 0x1000;
1409 chanp[i].b_st->l1.l1m.debug = debugflags & 0x2000;
1420 capi_debug(struct Channel *chanp, capi_msg *cm)
1427 HiSax_putstatus(chanp->cs, "Ch", "%d CAPIMSG %s", chanp->chan, tmpbuf);
1431 lli_got_fac_req(struct Channel *chanp, capi_msg *cm) {
1440 strncpy(chanp->setup.phone, &cm->para[5], cm->para[5] +1);
1441 FsmEvent(&chanp->fi, EV_SUSPEND, cm);
1444 strncpy(chanp->setup.phone, &cm->para[5], cm->para[5] +1);
1445 if (chanp->fi.state == ST_NULL) {
1446 FsmEvent(&chanp->fi, EV_RESUME, cm);
1448 FsmDelTimer(&chanp->dial_timer, 72);
1449 FsmAddTimer(&chanp->dial_timer, 80, EV_RESUME, cm, 73);
1456 lli_got_manufacturer(struct Channel *chanp, struct IsdnCardState *cs, capi_msg *cm) {
1499 struct Channel *chanp;
1511 chanp = csta->channel + ic->arg;
1514 chanp = csta->channel + (ic->arg & 0xff);
1515 if (chanp->debug & 1)
1516 link_debug(chanp, 1, "SETL2 card %d %ld",
1518 chanp->l2_protocol = ic->arg >> 8;
1521 chanp = csta->channel + (ic->arg & 0xff);
1522 if (chanp->debug & 1)
1523 link_debug(chanp, 1, "SETL3 card %d %ld",
1525 chanp->l3_protocol = ic->arg >> 8;
1528 chanp = csta->channel + (ic->arg & 0xff);
1529 if (chanp->debug & 1)
1530 link_debug(chanp, 1, "DIAL %s -> %s (%d,%d)",
1533 memcpy(&chanp->setup, &ic->parm.setup, sizeof(setup_parm));
1534 if (!strcmp(chanp->setup.eazmsn, "0"))
1535 chanp->setup.eazmsn[0] = '\0';
1538 if (chanp->fi.state == ST_NULL) {
1539 FsmEvent(&chanp->fi, EV_DIAL, NULL);
1541 FsmDelTimer(&chanp->dial_timer, 70);
1542 FsmAddTimer(&chanp->dial_timer, 50, EV_DIAL, NULL, 71);
1546 chanp = csta->channel + ic->arg;
1547 if (chanp->debug & 1)
1548 link_debug(chanp, 1, "ACCEPTB");
1549 FsmEvent(&chanp->fi, EV_ACCEPTB, NULL);
1552 chanp = csta->channel + ic->arg;
1553 memcpy(&chanp->setup, &ic->parm.setup, sizeof(setup_parm));
1554 if (chanp->debug & 1)
1555 link_debug(chanp, 1, "ACCEPTD");
1556 FsmEvent(&chanp->fi, EV_ACCEPTD, NULL);
1559 chanp = csta->channel + ic->arg;
1560 if (chanp->debug & 1)
1561 link_debug(chanp, 1, "HANGUP");
1562 FsmEvent(&chanp->fi, EV_HANGUP, NULL);
1565 chanp = csta->channel + ic->arg;
1566 if (chanp->debug & 1)
1567 capi_debug(chanp, &ic->parm.cmsg);
1573 lli_got_fac_req(chanp, &ic->parm.cmsg);
1577 lli_got_manufacturer(chanp, csta, &ic->parm.cmsg);
1615 chanp = csta->channel +num;
1616 chanp->leased = 1;
1620 chanp->d_st->l1.l1l2 = leased_l1l2;
1621 chanp->d_st->lli.l4l3 = leased_l4l3;
1622 chanp->d_st->lli.l4l3(chanp->d_st,
1654 chanp = csta->channel + (num & 1);
1657 test_and_clear_bit(FLG_FIXED_TEI, &chanp->d_st->l2.flag);
1658 chanp->d_st->l2.tei = -1;
1662 test_and_set_bit(FLG_FIXED_TEI, &chanp->d_st->l2.flag);
1663 chanp->d_st->l2.tei = num;
1668 chanp->d_st->lli.l4l3(chanp->d_st,
1703 chanp = csta->channel + ic->arg;
1704 if (chanp->debug & 1)
1705 link_debug(chanp, 1, "PROCEED");
1706 FsmEvent(&chanp->fi, EV_PROCEED, NULL);
1710 chanp = csta->channel + ic->arg;
1711 if (chanp->debug & 1)
1712 link_debug(chanp, 1, "ALERT");
1713 FsmEvent(&chanp->fi, EV_ALERT, NULL);
1717 chanp = csta->channel + ic->arg;
1718 if (chanp->debug & 1)
1719 link_debug(chanp, 1, "REDIR");
1720 memcpy(&chanp->setup, &ic->parm.setup, sizeof(setup_parm));
1721 FsmEvent(&chanp->fi, EV_REDIR, NULL);
1743 struct Channel *chanp;
1753 chanp = csta->channel + chan;
1754 st = chanp->b_st;
1755 if (!chanp->data_open) {
1756 link_debug(chanp, 1, "writebuf: channel not open");
1760 link_debug(chanp, 1, "writebuf: packet too large (%d bytes)", len);
1766 if ((len + chanp->bcs->tx_cnt) > MAX_DATA_MEM) {
1770 if (chanp->debug & 0x800)
1771 link_debug(chanp, 1, "writebuf: no buffers for %d bytes", len);
1773 } else if (chanp->debug & 0x800)
1774 link_debug(chanp, 1, "writebuf %d/%d/%d", len, chanp->bcs->tx_cnt,MAX_DATA_MEM);
1780 if (chanp->l2_active_protocol == ISDN_PROTO_L2_X75I)
1783 chanp->bcs->tx_cnt += len;