Lines Matching defs:bcs
78 modejade(struct BCState *bcs, int mode, int bc)
80 struct IsdnCardState *cs = bcs->cs;
81 int jade = bcs->hw.hscx.hscx;
86 bcs->mode = mode;
87 bcs->channel = bc;
133 struct BCState *bcs = st->l1.bcs;
139 spin_lock_irqsave(&bcs->cs->lock, flags);
140 if (bcs->tx_skb) {
141 skb_queue_tail(&bcs->squeue, skb);
143 bcs->tx_skb = skb;
144 test_and_set_bit(BC_FLG_BUSY, &bcs->Flag);
145 bcs->hw.hscx.count = 0;
146 bcs->cs->BC_Send_Data(bcs);
148 spin_unlock_irqrestore(&bcs->cs->lock, flags);
151 spin_lock_irqsave(&bcs->cs->lock, flags);
152 if (bcs->tx_skb) {
155 test_and_set_bit(BC_FLG_BUSY, &bcs->Flag);
156 bcs->tx_skb = skb;
157 bcs->hw.hscx.count = 0;
158 bcs->cs->BC_Send_Data(bcs);
160 spin_unlock_irqrestore(&bcs->cs->lock, flags);
163 if (!bcs->tx_skb) {
170 spin_lock_irqsave(&bcs->cs->lock, flags);
171 test_and_set_bit(BC_FLG_ACTIV, &bcs->Flag);
172 modejade(bcs, st->l1.mode, st->l1.bc);
173 spin_unlock_irqrestore(&bcs->cs->lock, flags);
180 spin_lock_irqsave(&bcs->cs->lock, flags);
181 test_and_clear_bit(BC_FLG_ACTIV, &bcs->Flag);
182 test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag);
183 modejade(bcs, 0, st->l1.bc);
184 spin_unlock_irqrestore(&bcs->cs->lock, flags);
191 close_jadestate(struct BCState *bcs)
193 modejade(bcs, 0, bcs->channel);
194 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) {
195 kfree(bcs->hw.hscx.rcvbuf);
196 bcs->hw.hscx.rcvbuf = NULL;
197 kfree(bcs->blog);
198 bcs->blog = NULL;
199 skb_queue_purge(&bcs->rqueue);
200 skb_queue_purge(&bcs->squeue);
201 if (bcs->tx_skb) {
202 dev_kfree_skb_any(bcs->tx_skb);
203 bcs->tx_skb = NULL;
204 test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag);
210 open_jadestate(struct IsdnCardState *cs, struct BCState *bcs)
212 if (!test_and_set_bit(BC_FLG_INIT, &bcs->Flag)) {
213 if (!(bcs->hw.hscx.rcvbuf = kmalloc(HSCX_BUFMAX, GFP_ATOMIC))) {
216 test_and_clear_bit(BC_FLG_INIT, &bcs->Flag);
219 if (!(bcs->blog = kmalloc(MAX_BLOG_SPACE, GFP_ATOMIC))) {
221 "HiSax: No memory for bcs->blog\n");
222 test_and_clear_bit(BC_FLG_INIT, &bcs->Flag);
223 kfree(bcs->hw.hscx.rcvbuf);
224 bcs->hw.hscx.rcvbuf = NULL;
227 skb_queue_head_init(&bcs->rqueue);
228 skb_queue_head_init(&bcs->squeue);
230 bcs->tx_skb = NULL;
231 test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag);
232 bcs->event = 0;
233 bcs->hw.hscx.rcvidx = 0;
234 bcs->tx_cnt = 0;
240 setstack_jade(struct PStack *st, struct BCState *bcs)
242 bcs->channel = st->l1.bc;
243 if (open_jadestate(st->l1.hardware, bcs))
245 st->l1.bcs = bcs;
248 bcs->st = st;
277 cs->bcs[0].BC_SetStack = setstack_jade;
278 cs->bcs[1].BC_SetStack = setstack_jade;
279 cs->bcs[0].BC_Close = close_jadestate;
280 cs->bcs[1].BC_Close = close_jadestate;
281 cs->bcs[0].hw.hscx.hscx = 0;
282 cs->bcs[1].hw.hscx.hscx = 1;
303 modejade(cs->bcs, 0, 0);
304 modejade(cs->bcs + 1, 0, 0);