Lines Matching defs:bcs
240 write_modem(struct BCState *bcs) {
242 struct IsdnCardState *cs = bcs->cs;
245 if (!bcs->tx_skb)
247 if (bcs->tx_skb->len <= 0)
249 len = bcs->tx_skb->len;
257 skb_copy_from_linear_data(bcs->tx_skb,
259 skb_pull(bcs->tx_skb, count);
265 skb_copy_from_linear_data(bcs->tx_skb,
267 skb_pull(bcs->tx_skb, count);
280 modem_fill(struct BCState *bcs) {
282 if (bcs->tx_skb) {
283 if (bcs->tx_skb->len) {
284 write_modem(bcs);
287 if (test_bit(FLG_LLI_L1WAKEUP, &bcs->st->lli.flag) &&
288 (PACKET_NOACK != bcs->tx_skb->pkt_type)) {
290 spin_lock_irqsave(&bcs->aclock, flags);
291 bcs->ackcnt += bcs->hw.hscx.count;
292 spin_unlock_irqrestore(&bcs->aclock, flags);
293 schedule_event(bcs, B_ACKPENDING);
295 dev_kfree_skb_any(bcs->tx_skb);
296 bcs->tx_skb = NULL;
299 if ((bcs->tx_skb = skb_dequeue(&bcs->squeue))) {
300 bcs->hw.hscx.count = 0;
301 test_and_set_bit(BC_FLG_BUSY, &bcs->Flag);
302 write_modem(bcs);
304 test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag);
305 schedule_event(bcs, B_XMTBUFREADY);
338 skb_queue_tail(&cs->hw.elsa.bcs->rqueue, skb);
340 schedule_event(cs->hw.elsa.bcs, B_RCVBUFREADY);
373 modem_fill(cs->hw.elsa.bcs);
422 extern int open_hscxstate(struct IsdnCardState *cs, struct BCState *bcs);
423 extern void modehscx(struct BCState *bcs, int mode, int bc);
427 close_elsastate(struct BCState *bcs)
429 modehscx(bcs, 0, bcs->channel);
430 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) {
431 if (bcs->hw.hscx.rcvbuf) {
432 if (bcs->mode != L1_MODE_MODEM)
433 kfree(bcs->hw.hscx.rcvbuf);
434 bcs->hw.hscx.rcvbuf = NULL;
436 skb_queue_purge(&bcs->rqueue);
437 skb_queue_purge(&bcs->squeue);
438 if (bcs->tx_skb) {
439 dev_kfree_skb_any(bcs->tx_skb);
440 bcs->tx_skb = NULL;
441 test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag);
550 struct BCState *bcs = st->l1.bcs;
555 spin_lock_irqsave(&bcs->cs->lock, flags);
556 if (bcs->tx_skb) {
557 skb_queue_tail(&bcs->squeue, skb);
559 bcs->tx_skb = skb;
560 test_and_set_bit(BC_FLG_BUSY, &bcs->Flag);
561 bcs->hw.hscx.count = 0;
562 write_modem(bcs);
564 spin_unlock_irqrestore(&bcs->cs->lock, flags);
566 test_and_set_bit(BC_FLG_ACTIV, &bcs->Flag);
568 set_arcofi(bcs->cs, st->l1.bc);
569 mstartup(bcs->cs);
570 modem_set_dial(bcs->cs, test_bit(FLG_ORIG, &st->l2.flag));
571 bcs->cs->hw.elsa.MFlag = 2;
573 test_and_clear_bit(BC_FLG_ACTIV, &bcs->Flag);
574 bcs->cs->dc.isac.arcofi_bc = st->l1.bc;
575 arcofi_fsm(bcs->cs, ARCOFI_START, &ARCOFI_XOP_0);
576 wait_event_interruptible(bcs->cs->dc.isac.arcofi_wait,
577 bcs->cs->dc.isac.arcofi_state == ARCOFI_NOP);
578 bcs->cs->hw.elsa.MFlag = 1;
585 setstack_elsa(struct PStack *st, struct BCState *bcs)
588 bcs->channel = st->l1.bc;
592 if (open_hscxstate(st->l1.hardware, bcs))
597 bcs->mode = L1_MODE_MODEM;
598 if (!test_and_set_bit(BC_FLG_INIT, &bcs->Flag)) {
599 bcs->hw.hscx.rcvbuf = bcs->cs->hw.elsa.rcvbuf;
600 skb_queue_head_init(&bcs->rqueue);
601 skb_queue_head_init(&bcs->squeue);
603 bcs->tx_skb = NULL;
604 test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag);
605 bcs->event = 0;
606 bcs->hw.hscx.rcvidx = 0;
607 bcs->tx_cnt = 0;
608 bcs->cs->hw.elsa.bcs = bcs;
612 st->l1.bcs = bcs;
614 bcs->st = st;
622 cs->bcs[0].BC_SetStack = setstack_elsa;
623 cs->bcs[1].BC_SetStack = setstack_elsa;
624 cs->bcs[0].BC_Close = close_elsastate;
625 cs->bcs[1].BC_Close = close_elsastate;