Lines Matching refs:ch
53 isdnloop_bchan_send(isdnloop_card * card, int ch) in isdnloop_bchan_send() argument
55 isdnloop_card *rcard = card->rcard[ch]; in isdnloop_bchan_send()
56 int rch = card->rch[ch], len, ack; in isdnloop_bchan_send()
60 while (card->sndcount[ch]) { in isdnloop_bchan_send()
61 if ((skb = skb_dequeue(&card->bqueue[ch]))) { in isdnloop_bchan_send()
63 card->sndcount[ch] -= len; in isdnloop_bchan_send()
66 cmd.arg = ch; in isdnloop_bchan_send()
81 card->sndcount[ch] = 0; in isdnloop_bchan_send()
320 int ch; in isdnloop_polldchan() local
343 ch = (card->imsg[1] - '0') - 1; in isdnloop_polldchan()
345 isdnloop_parse_status(p, ch, card); in isdnloop_polldchan()
478 isdnloop_fake(isdnloop_card * card, char *s, int ch) in isdnloop_fake() argument
481 int len = strlen(s) + ((ch >= 0) ? 3 : 0); in isdnloop_fake()
487 if (ch >= 0) in isdnloop_fake()
488 sprintf(skb_put(skb, 3), "%02d;", ch); in isdnloop_fake()
579 isdnloop_atimeout(isdnloop_card * card, int ch) in isdnloop_atimeout() argument
587 isdnloop_fake(card->rcard[ch], "DDIS_I", card->rch[ch] + 1); in isdnloop_atimeout()
588 card->rcard[ch]->rcard[card->rch[ch]] = NULL; in isdnloop_atimeout()
589 card->rcard[ch] = NULL; in isdnloop_atimeout()
591 isdnloop_fake(card, "DDIS_I", ch + 1); in isdnloop_atimeout()
594 isdnloop_fake(card, buf, ch + 1); in isdnloop_atimeout()
626 isdnloop_start_ctimer(isdnloop_card * card, int ch) in isdnloop_start_ctimer() argument
632 init_timer(&card->c_timer[ch]); in isdnloop_start_ctimer()
633 card->c_timer[ch].expires = jiffies + ISDNLOOP_TIMER_ALERTWAIT; in isdnloop_start_ctimer()
634 if (ch) in isdnloop_start_ctimer()
635 card->c_timer[ch].function = isdnloop_atimeout1; in isdnloop_start_ctimer()
637 card->c_timer[ch].function = isdnloop_atimeout0; in isdnloop_start_ctimer()
638 card->c_timer[ch].data = (unsigned long) card; in isdnloop_start_ctimer()
639 add_timer(&card->c_timer[ch]); in isdnloop_start_ctimer()
651 isdnloop_kill_ctimer(isdnloop_card * card, int ch) in isdnloop_kill_ctimer() argument
657 del_timer(&card->c_timer[ch]); in isdnloop_kill_ctimer()
685 int ch; in isdnloop_try_call() local
693 for (ch = 0; ch < 2; ch++) { in isdnloop_try_call()
695 if ((cc == card) && (ch == lch)) in isdnloop_try_call()
705 e = cc->eazlist[ch]; in isdnloop_try_call()
717 if (!(cc->rcard[ch])) { in isdnloop_try_call()
719 if (!(si2bit[cmd->parm.setup.si1] & cc->sil[ch])) { in isdnloop_try_call()
724 cc->rcard[ch] = card; in isdnloop_try_call()
725 cc->rch[ch] = lch; in isdnloop_try_call()
727 card->rch[lch] = ch; in isdnloop_try_call()
733 if (ch == 1) in isdnloop_try_call()
797 int ch; in isdnloop_parse_cmd() local
803 ch = card->omsg[1] - '0'; in isdnloop_parse_cmd()
804 if ((ch < 0) || (ch > 2)) { in isdnloop_parse_cmd()
812 if (s->command && (ch != 0)) { in isdnloop_parse_cmd()
825 if (card->rcard[ch - 1]) { in isdnloop_parse_cmd()
826 isdnloop_fake(card->rcard[ch - 1], "BCON_I", in isdnloop_parse_cmd()
827 card->rch[ch - 1] + 1); in isdnloop_parse_cmd()
828 isdnloop_fake(card, "BCON_C", ch); in isdnloop_parse_cmd()
833 if (card->rcard[ch - 1]) { in isdnloop_parse_cmd()
834 isdnloop_fake(card->rcard[ch - 1], "BCON_C", in isdnloop_parse_cmd()
835 card->rch[ch - 1] + 1); in isdnloop_parse_cmd()
840 isdnloop_fake(card, "BDIS_C", ch); in isdnloop_parse_cmd()
841 if (card->rcard[ch - 1]) { in isdnloop_parse_cmd()
842 isdnloop_fake(card->rcard[ch - 1], "BDIS_I", in isdnloop_parse_cmd()
843 card->rch[ch - 1] + 1); in isdnloop_parse_cmd()
848 isdnloop_kill_ctimer(card, ch - 1); in isdnloop_parse_cmd()
849 if (card->rcard[ch - 1]) { in isdnloop_parse_cmd()
850 isdnloop_kill_ctimer(card->rcard[ch - 1], card->rch[ch - 1]); in isdnloop_parse_cmd()
851 isdnloop_fake(card->rcard[ch - 1], "DCON_C", in isdnloop_parse_cmd()
852 card->rch[ch - 1] + 1); in isdnloop_parse_cmd()
853 isdnloop_fake(card, "DCON_C", ch); in isdnloop_parse_cmd()
858 isdnloop_kill_ctimer(card, ch - 1); in isdnloop_parse_cmd()
859 if (card->rcard[ch - 1]) { in isdnloop_parse_cmd()
860 isdnloop_kill_ctimer(card->rcard[ch - 1], card->rch[ch - 1]); in isdnloop_parse_cmd()
861 isdnloop_fake(card->rcard[ch - 1], "DDIS_I", in isdnloop_parse_cmd()
862 card->rch[ch - 1] + 1); in isdnloop_parse_cmd()
863 card->rcard[ch - 1] = NULL; in isdnloop_parse_cmd()
865 isdnloop_fake(card, "DDIS_C", ch); in isdnloop_parse_cmd()
877 switch (isdnloop_try_call(card, p, ch - 1, &cmd)) { in isdnloop_parse_cmd()
885 isdnloop_vstphone(card->rcard[ch], in isdnloop_parse_cmd()
887 isdnloop_fake(card->rcard[ch - 1], buf, card->rch[ch - 1] + 1); in isdnloop_parse_cmd()
891 isdnloop_start_ctimer(card, ch - 1); in isdnloop_parse_cmd()
895 isdnloop_fake(card, "DDIS_I", ch); in isdnloop_parse_cmd()
897 isdnloop_fake(card, buf, ch); in isdnloop_parse_cmd()
901 isdnloop_fake(card, "DDIS_I", ch); in isdnloop_parse_cmd()
903 isdnloop_fake(card, buf, ch); in isdnloop_parse_cmd()
909 card->eazlist[ch - 1][0] = '\0'; in isdnloop_parse_cmd()
914 strcpy(card->eazlist[ch - 1], p); in isdnloop_parse_cmd()
918 sprintf(buf, "EAZ-LIST: %s", card->eazlist[ch - 1]); in isdnloop_parse_cmd()
919 isdnloop_fake(card, buf, ch + 1); in isdnloop_parse_cmd()
933 card->sil[ch - 1] |= si2bit[*p - '0']; in isdnloop_parse_cmd()
944 if (card->sil[ch - 1] & (1 << i)) in isdnloop_parse_cmd()
946 isdnloop_fake(card, buf, ch + 1); in isdnloop_parse_cmd()
950 card->sil[ch - 1] = 0; in isdnloop_parse_cmd()