Lines Matching full:ch
36 mISDN_queue_message(struct mISDNchannel *ch, struct sk_buff *skb) in mISDN_queue_message() argument
38 _queue_message(ch->st, skb); in mISDN_queue_message()
45 struct mISDNchannel *ch; in get_channel4id() local
48 list_for_each_entry(ch, &st->layer2, list) { in get_channel4id()
49 if (id == ch->nr) in get_channel4id()
52 ch = NULL; in get_channel4id()
55 return ch; in get_channel4id()
86 struct mISDNchannel *ch; in send_layer2() local
93 list_for_each_entry(ch, &st->layer2, list) { in send_layer2()
94 if (list_is_last(&ch->list, &st->layer2)) { in send_layer2()
101 ret = ch->send(ch, cskb); in send_layer2()
105 "%s ch%d prim(%x) addr(%x)" in send_layer2()
107 __func__, ch->nr, in send_layer2()
108 hh->prim, ch->addr, ret); in send_layer2()
112 printk(KERN_WARNING "%s ch%d addr %x no mem\n", in send_layer2()
113 __func__, ch->nr, ch->addr); in send_layer2()
118 list_for_each_entry(ch, &st->layer2, list) { in send_layer2()
119 if ((hh->id & MISDN_ID_ADDR_MASK) == ch->addr) { in send_layer2()
120 ret = ch->send(ch, skb); in send_layer2()
143 struct mISDNchannel *ch; in send_msg_to_layer() local
162 ch = get_channel4id(st, hh->id); in send_msg_to_layer()
163 if (ch) in send_msg_to_layer()
164 return ch->send(ch, skb); in send_msg_to_layer()
172 ch = get_channel4id(st, hh->id); in send_msg_to_layer()
173 if (ch) in send_msg_to_layer()
174 return ch->send(ch, skb); in send_msg_to_layer()
325 l1_receive(struct mISDNchannel *ch, struct sk_buff *skb) in l1_receive() argument
327 if (!ch->st) in l1_receive()
330 _queue_message(ch->st, skb); in l1_receive()
335 set_channel_address(struct mISDNchannel *ch, u_int sapi, u_int tei) in set_channel_address() argument
337 ch->addr = sapi | (tei << 8); in set_channel_address()
341 __add_layer2(struct mISDNchannel *ch, struct mISDNstack *st) in __add_layer2() argument
343 list_add_tail(&ch->list, &st->layer2); in __add_layer2()
347 add_layer2(struct mISDNchannel *ch, struct mISDNstack *st) in add_layer2() argument
350 __add_layer2(ch, st); in add_layer2()
355 st_own_ctrl(struct mISDNchannel *ch, u_int cmd, void *arg) in st_own_ctrl() argument
357 if (!ch->st || !ch->st->layer1) in st_own_ctrl()
359 return ch->st->layer1->ctrl(ch->st->layer1, cmd, arg); in st_own_ctrl()
417 connect_layer1(struct mISDNdevice *dev, struct mISDNchannel *ch, in connect_layer1() argument
420 struct mISDN_sock *msk = container_of(ch, struct mISDN_sock, ch); in connect_layer1()
434 ch->recv = mISDN_queue_message; in connect_layer1()
435 ch->peer = &dev->D.st->own; in connect_layer1()
436 ch->st = dev->D.st; in connect_layer1()
455 connect_Bstack(struct mISDNdevice *dev, struct mISDNchannel *ch, in connect_Bstack() argument
467 ch->st = dev->D.st; in connect_Bstack()
475 ch->recv = rq.ch->send; in connect_Bstack()
476 ch->peer = rq.ch; in connect_Bstack()
477 rq.ch->recv = ch->send; in connect_Bstack()
478 rq.ch->peer = ch; in connect_Bstack()
479 rq.ch->st = dev->D.st; in connect_Bstack()
486 rq2.ch = ch; in connect_Bstack()
490 ch->recv = rq2.ch->send; in connect_Bstack()
491 ch->peer = rq2.ch; in connect_Bstack()
492 rq2.ch->st = dev->D.st; in connect_Bstack()
497 rq2.ch->ctrl(rq2.ch, CLOSE_CHANNEL, NULL); in connect_Bstack()
500 rq2.ch->recv = rq.ch->send; in connect_Bstack()
501 rq2.ch->peer = rq.ch; in connect_Bstack()
502 rq.ch->recv = rq2.ch->send; in connect_Bstack()
503 rq.ch->peer = rq2.ch; in connect_Bstack()
504 rq.ch->st = dev->D.st; in connect_Bstack()
506 ch->protocol = protocol; in connect_Bstack()
507 ch->nr = rq.ch->nr; in connect_Bstack()
512 create_l2entity(struct mISDNdevice *dev, struct mISDNchannel *ch, in create_l2entity() argument
533 ch->recv = mISDN_queue_message; in create_l2entity()
534 ch->peer = &dev->D.st->own; in create_l2entity()
535 ch->st = dev->D.st; in create_l2entity()
543 rq.ch = ch; in create_l2entity()
547 if ((protocol == ISDN_P_LAPD_NT) && !rq.ch) in create_l2entity()
549 add_layer2(rq.ch, dev->D.st); in create_l2entity()
550 rq.ch->recv = mISDN_queue_message; in create_l2entity()
551 rq.ch->peer = &dev->D.st->own; in create_l2entity()
552 rq.ch->ctrl(rq.ch, OPEN_CHANNEL, NULL); /* can't fail */ in create_l2entity()
562 delete_channel(struct mISDNchannel *ch) in delete_channel() argument
564 struct mISDN_sock *msk = container_of(ch, struct mISDN_sock, ch); in delete_channel()
567 if (!ch->st) { in delete_channel()
573 dev_name(&ch->st->dev->dev), ch->protocol); in delete_channel()
574 if (ch->protocol >= ISDN_P_B_START) { in delete_channel()
575 if (ch->peer) { in delete_channel()
576 ch->peer->ctrl(ch->peer, CLOSE_CHANNEL, NULL); in delete_channel()
577 ch->peer = NULL; in delete_channel()
581 switch (ch->protocol) { in delete_channel()
586 write_lock_bh(&ch->st->l1sock.lock); in delete_channel()
588 write_unlock_bh(&ch->st->l1sock.lock); in delete_channel()
589 ch->st->dev->D.ctrl(&ch->st->dev->D, CLOSE_CHANNEL, NULL); in delete_channel()
592 pch = get_channel4id(ch->st, ch->nr); in delete_channel()
594 mutex_lock(&ch->st->lmutex); in delete_channel()
596 mutex_unlock(&ch->st->lmutex); in delete_channel()
598 pch = ch->st->dev->teimgr; in delete_channel()
605 pch = ch->st->dev->teimgr; in delete_channel()