Lines Matching refs:bcs

422 Memhscx_empty_fifo(struct BCState *bcs, int count)  in Memhscx_empty_fifo()  argument
425 struct IsdnCardState *cs = bcs->cs; in Memhscx_empty_fifo()
432 if (bcs->hw.hscx.rcvidx + count > HSCX_BUFMAX) { in Memhscx_empty_fifo()
435 MemWriteHSCXCMDR(cs, bcs->hw.hscx.hscx, 0x80); in Memhscx_empty_fifo()
436 bcs->hw.hscx.rcvidx = 0; in Memhscx_empty_fifo()
441 ptr = bcs->hw.hscx.rcvbuf + bcs->hw.hscx.rcvidx; in Memhscx_empty_fifo()
444 *ptr++ = memreadreg(cs->hw.diva.cfg_reg, bcs->hw.hscx.hscx ? 0x40 : 0); in Memhscx_empty_fifo()
445 MemWriteHSCXCMDR(cs, bcs->hw.hscx.hscx, 0x80); in Memhscx_empty_fifo()
446 ptr = bcs->hw.hscx.rcvbuf + bcs->hw.hscx.rcvidx; in Memhscx_empty_fifo()
447 bcs->hw.hscx.rcvidx += count; in Memhscx_empty_fifo()
450 char *t = bcs->blog; in Memhscx_empty_fifo()
453 bcs->hw.hscx.hscx ? 'B' : 'A', count); in Memhscx_empty_fifo()
455 debugl1(cs, bcs->blog); in Memhscx_empty_fifo()
460 Memhscx_fill_fifo(struct BCState *bcs) in Memhscx_fill_fifo() argument
462 struct IsdnCardState *cs = bcs->cs; in Memhscx_fill_fifo()
472 if (!bcs->tx_skb) in Memhscx_fill_fifo()
474 if (bcs->tx_skb->len <= 0) in Memhscx_fill_fifo()
477 more = (bcs->mode == L1_MODE_TRANS) ? 1 : 0; in Memhscx_fill_fifo()
478 if (bcs->tx_skb->len > fifo_size) { in Memhscx_fill_fifo()
482 count = bcs->tx_skb->len; in Memhscx_fill_fifo()
484 MemwaitforXFW(cs, bcs->hw.hscx.hscx); in Memhscx_fill_fifo()
487 p = ptr = bcs->tx_skb->data; in Memhscx_fill_fifo()
488 skb_pull(bcs->tx_skb, count); in Memhscx_fill_fifo()
489 bcs->tx_cnt -= count; in Memhscx_fill_fifo()
490 bcs->hw.hscx.count += count; in Memhscx_fill_fifo()
492 memwritereg(cs->hw.diva.cfg_reg, bcs->hw.hscx.hscx ? 0x40 : 0, in Memhscx_fill_fifo()
494 MemWriteHSCXCMDR(cs, bcs->hw.hscx.hscx, more ? 0x8 : 0xa); in Memhscx_fill_fifo()
497 char *t = bcs->blog; in Memhscx_fill_fifo()
500 bcs->hw.hscx.hscx ? 'B' : 'A', count); in Memhscx_fill_fifo()
502 debugl1(cs, bcs->blog); in Memhscx_fill_fifo()
510 struct BCState *bcs = cs->bcs + hscx; in Memhscx_interrupt() local
515 if (!test_bit(BC_FLG_INIT, &bcs->Flag)) in Memhscx_interrupt()
524 if ((r & 0x40) && bcs->mode) in Memhscx_interrupt()
527 bcs->mode); in Memhscx_interrupt()
537 Memhscx_empty_fifo(bcs, count); in Memhscx_interrupt()
538 if ((count = bcs->hw.hscx.rcvidx - 1) > 0) { in Memhscx_interrupt()
544 memcpy(skb_put(skb, count), bcs->hw.hscx.rcvbuf, count); in Memhscx_interrupt()
545 skb_queue_tail(&bcs->rqueue, skb); in Memhscx_interrupt()
549 bcs->hw.hscx.rcvidx = 0; in Memhscx_interrupt()
550 hscx_sched_event(bcs, B_RCVBUFREADY); in Memhscx_interrupt()
553 Memhscx_empty_fifo(bcs, fifo_size); in Memhscx_interrupt()
554 if (bcs->mode == L1_MODE_TRANS) { in Memhscx_interrupt()
559 memcpy(skb_put(skb, fifo_size), bcs->hw.hscx.rcvbuf, fifo_size); in Memhscx_interrupt()
560 skb_queue_tail(&bcs->rqueue, skb); in Memhscx_interrupt()
562 bcs->hw.hscx.rcvidx = 0; in Memhscx_interrupt()
563 hscx_sched_event(bcs, B_RCVBUFREADY); in Memhscx_interrupt()
567 if (bcs->tx_skb) { in Memhscx_interrupt()
568 if (bcs->tx_skb->len) { in Memhscx_interrupt()
569 Memhscx_fill_fifo(bcs); in Memhscx_interrupt()
572 if (bcs->st->lli.l1writewakeup && in Memhscx_interrupt()
573 (PACKET_NOACK != bcs->tx_skb->pkt_type)) in Memhscx_interrupt()
574 bcs->st->lli.l1writewakeup(bcs->st, bcs->hw.hscx.count); in Memhscx_interrupt()
575 dev_kfree_skb_irq(bcs->tx_skb); in Memhscx_interrupt()
576 bcs->hw.hscx.count = 0; in Memhscx_interrupt()
577 bcs->tx_skb = NULL; in Memhscx_interrupt()
580 if ((bcs->tx_skb = skb_dequeue(&bcs->squeue))) { in Memhscx_interrupt()
581 bcs->hw.hscx.count = 0; in Memhscx_interrupt()
582 test_and_set_bit(BC_FLG_BUSY, &bcs->Flag); in Memhscx_interrupt()
583 Memhscx_fill_fifo(bcs); in Memhscx_interrupt()
585 test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); in Memhscx_interrupt()
586 hscx_sched_event(bcs, B_XMTBUFREADY); in Memhscx_interrupt()
596 struct BCState *bcs; in Memhscx_int_main() local
599 bcs = cs->bcs + 1; in Memhscx_int_main()
602 if (bcs->mode == 1) in Memhscx_int_main()
603 Memhscx_fill_fifo(bcs); in Memhscx_int_main()
608 if (bcs->tx_skb) { in Memhscx_int_main()
609 skb_push(bcs->tx_skb, bcs->hw.hscx.count); in Memhscx_int_main()
610 bcs->tx_cnt += bcs->hw.hscx.count; in Memhscx_int_main()
611 bcs->hw.hscx.count = 0; in Memhscx_int_main()
613 MemWriteHSCXCMDR(cs, bcs->hw.hscx.hscx, 0x01); in Memhscx_int_main()
626 bcs = cs->bcs; in Memhscx_int_main()
629 if (bcs->mode == L1_MODE_TRANS) in Memhscx_int_main()
630 Memhscx_fill_fifo(bcs); in Memhscx_int_main()
635 if (bcs->tx_skb) { in Memhscx_int_main()
636 skb_push(bcs->tx_skb, bcs->hw.hscx.count); in Memhscx_int_main()
637 bcs->tx_cnt += bcs->hw.hscx.count; in Memhscx_int_main()
638 bcs->hw.hscx.count = 0; in Memhscx_int_main()
640 MemWriteHSCXCMDR(cs, bcs->hw.hscx.hscx, 0x01); in Memhscx_int_main()