Lines Matching refs:bcs

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