Lines Matching refs:ch
46 if (likely(bch->ch.peer)) { in bchannel_bh()
47 err = bch->ch.recv(bch->ch.peer, skb); in bchannel_bh()
57 mISDN_initdchannel(struct dchannel *ch, int maxlen, void *phf) in mISDN_initdchannel() argument
59 test_and_set_bit(FLG_HDLC, &ch->Flags); in mISDN_initdchannel()
60 ch->maxlen = maxlen; in mISDN_initdchannel()
61 ch->hw = NULL; in mISDN_initdchannel()
62 ch->rx_skb = NULL; in mISDN_initdchannel()
63 ch->tx_skb = NULL; in mISDN_initdchannel()
64 ch->tx_idx = 0; in mISDN_initdchannel()
65 ch->phfunc = phf; in mISDN_initdchannel()
66 skb_queue_head_init(&ch->squeue); in mISDN_initdchannel()
67 skb_queue_head_init(&ch->rqueue); in mISDN_initdchannel()
68 INIT_LIST_HEAD(&ch->dev.bchannels); in mISDN_initdchannel()
69 INIT_WORK(&ch->workq, dchannel_bh); in mISDN_initdchannel()
75 mISDN_initbchannel(struct bchannel *ch, unsigned short maxlen, in mISDN_initbchannel() argument
78 ch->Flags = 0; in mISDN_initbchannel()
79 ch->minlen = minlen; in mISDN_initbchannel()
80 ch->next_minlen = minlen; in mISDN_initbchannel()
81 ch->init_minlen = minlen; in mISDN_initbchannel()
82 ch->maxlen = maxlen; in mISDN_initbchannel()
83 ch->next_maxlen = maxlen; in mISDN_initbchannel()
84 ch->init_maxlen = maxlen; in mISDN_initbchannel()
85 ch->hw = NULL; in mISDN_initbchannel()
86 ch->rx_skb = NULL; in mISDN_initbchannel()
87 ch->tx_skb = NULL; in mISDN_initbchannel()
88 ch->tx_idx = 0; in mISDN_initbchannel()
89 skb_queue_head_init(&ch->rqueue); in mISDN_initbchannel()
90 ch->rcount = 0; in mISDN_initbchannel()
91 ch->next_skb = NULL; in mISDN_initbchannel()
92 INIT_WORK(&ch->workq, bchannel_bh); in mISDN_initbchannel()
98 mISDN_freedchannel(struct dchannel *ch) in mISDN_freedchannel() argument
100 if (ch->tx_skb) { in mISDN_freedchannel()
101 dev_kfree_skb(ch->tx_skb); in mISDN_freedchannel()
102 ch->tx_skb = NULL; in mISDN_freedchannel()
104 if (ch->rx_skb) { in mISDN_freedchannel()
105 dev_kfree_skb(ch->rx_skb); in mISDN_freedchannel()
106 ch->rx_skb = NULL; in mISDN_freedchannel()
108 skb_queue_purge(&ch->squeue); in mISDN_freedchannel()
109 skb_queue_purge(&ch->rqueue); in mISDN_freedchannel()
110 flush_work(&ch->workq); in mISDN_freedchannel()
116 mISDN_clear_bchannel(struct bchannel *ch) in mISDN_clear_bchannel() argument
118 if (ch->tx_skb) { in mISDN_clear_bchannel()
119 dev_kfree_skb(ch->tx_skb); in mISDN_clear_bchannel()
120 ch->tx_skb = NULL; in mISDN_clear_bchannel()
122 ch->tx_idx = 0; in mISDN_clear_bchannel()
123 if (ch->rx_skb) { in mISDN_clear_bchannel()
124 dev_kfree_skb(ch->rx_skb); in mISDN_clear_bchannel()
125 ch->rx_skb = NULL; in mISDN_clear_bchannel()
127 if (ch->next_skb) { in mISDN_clear_bchannel()
128 dev_kfree_skb(ch->next_skb); in mISDN_clear_bchannel()
129 ch->next_skb = NULL; in mISDN_clear_bchannel()
131 test_and_clear_bit(FLG_TX_BUSY, &ch->Flags); in mISDN_clear_bchannel()
132 test_and_clear_bit(FLG_TX_NEXT, &ch->Flags); in mISDN_clear_bchannel()
133 test_and_clear_bit(FLG_ACTIVE, &ch->Flags); in mISDN_clear_bchannel()
134 test_and_clear_bit(FLG_FILLEMPTY, &ch->Flags); in mISDN_clear_bchannel()
135 test_and_clear_bit(FLG_TX_EMPTY, &ch->Flags); in mISDN_clear_bchannel()
136 test_and_clear_bit(FLG_RX_OFF, &ch->Flags); in mISDN_clear_bchannel()
137 ch->dropcnt = 0; in mISDN_clear_bchannel()
138 ch->minlen = ch->init_minlen; in mISDN_clear_bchannel()
139 ch->next_minlen = ch->init_minlen; in mISDN_clear_bchannel()
140 ch->maxlen = ch->init_maxlen; in mISDN_clear_bchannel()
141 ch->next_maxlen = ch->init_maxlen; in mISDN_clear_bchannel()
142 skb_queue_purge(&ch->rqueue); in mISDN_clear_bchannel()
143 ch->rcount = 0; in mISDN_clear_bchannel()
148 mISDN_freebchannel(struct bchannel *ch) in mISDN_freebchannel() argument
150 cancel_work_sync(&ch->workq); in mISDN_freebchannel()
151 mISDN_clear_bchannel(ch); in mISDN_freebchannel()
384 queue_ch_frame(struct mISDNchannel *ch, u_int pr, int id, struct sk_buff *skb) in queue_ch_frame() argument
389 _queue_data(ch, pr, id, 0, NULL, GFP_ATOMIC); in queue_ch_frame()
391 if (ch->peer) { in queue_ch_frame()
395 if (!ch->recv(ch->peer, skb)) in queue_ch_frame()
404 dchannel_senddata(struct dchannel *ch, struct sk_buff *skb) in dchannel_senddata() argument
411 if (skb->len > ch->maxlen) { in dchannel_senddata()
413 __func__, skb->len, ch->maxlen); in dchannel_senddata()
417 if (test_and_set_bit(FLG_TX_BUSY, &ch->Flags)) { in dchannel_senddata()
418 skb_queue_tail(&ch->squeue, skb); in dchannel_senddata()
422 ch->tx_skb = skb; in dchannel_senddata()
423 ch->tx_idx = 0; in dchannel_senddata()
430 bchannel_senddata(struct bchannel *ch, struct sk_buff *skb) in bchannel_senddata() argument
438 if (skb->len > ch->maxlen) { in bchannel_senddata()
440 __func__, skb->len, ch->maxlen); in bchannel_senddata()
445 if (ch->next_skb) { in bchannel_senddata()
448 __func__, skb->len, ch->next_skb->len); in bchannel_senddata()
451 if (test_and_set_bit(FLG_TX_BUSY, &ch->Flags)) { in bchannel_senddata()
452 test_and_set_bit(FLG_TX_NEXT, &ch->Flags); in bchannel_senddata()
453 ch->next_skb = skb; in bchannel_senddata()
457 ch->tx_skb = skb; in bchannel_senddata()
458 ch->tx_idx = 0; in bchannel_senddata()
459 confirm_Bsend(ch); in bchannel_senddata()