Lines Matching refs:bcs
401 Memhscx_empty_fifo(struct BCState *bcs, int count) in Memhscx_empty_fifo() argument
404 struct IsdnCardState *cs = bcs->cs; in Memhscx_empty_fifo()
410 if (bcs->hw.hscx.rcvidx + count > HSCX_BUFMAX) { in Memhscx_empty_fifo()
413 MemWriteHSCXCMDR(cs, bcs->hw.hscx.hscx, 0x80); in Memhscx_empty_fifo()
414 bcs->hw.hscx.rcvidx = 0; in Memhscx_empty_fifo()
417 ptr = bcs->hw.hscx.rcvbuf + bcs->hw.hscx.rcvidx; in Memhscx_empty_fifo()
420 *ptr++ = memreadreg(cs->hw.diva.cfg_reg, bcs->hw.hscx.hscx ? 0x40 : 0); in Memhscx_empty_fifo()
421 MemWriteHSCXCMDR(cs, bcs->hw.hscx.hscx, 0x80); in Memhscx_empty_fifo()
422 ptr = bcs->hw.hscx.rcvbuf + bcs->hw.hscx.rcvidx; in Memhscx_empty_fifo()
423 bcs->hw.hscx.rcvidx += count; in Memhscx_empty_fifo()
425 char *t = bcs->blog; in Memhscx_empty_fifo()
428 bcs->hw.hscx.hscx ? 'B' : 'A', count); in Memhscx_empty_fifo()
430 debugl1(cs, "%s", bcs->blog); in Memhscx_empty_fifo()
435 Memhscx_fill_fifo(struct BCState *bcs) in Memhscx_fill_fifo() argument
437 struct IsdnCardState *cs = bcs->cs; in Memhscx_fill_fifo()
445 if (!bcs->tx_skb) in Memhscx_fill_fifo()
447 if (bcs->tx_skb->len <= 0) in Memhscx_fill_fifo()
450 more = (bcs->mode == L1_MODE_TRANS) ? 1 : 0; in Memhscx_fill_fifo()
451 if (bcs->tx_skb->len > fifo_size) { in Memhscx_fill_fifo()
455 count = bcs->tx_skb->len; in Memhscx_fill_fifo()
457 MemwaitforXFW(cs, bcs->hw.hscx.hscx); in Memhscx_fill_fifo()
458 p = ptr = bcs->tx_skb->data; in Memhscx_fill_fifo()
459 skb_pull(bcs->tx_skb, count); in Memhscx_fill_fifo()
460 bcs->tx_cnt -= count; in Memhscx_fill_fifo()
461 bcs->hw.hscx.count += count; in Memhscx_fill_fifo()
463 memwritereg(cs->hw.diva.cfg_reg, bcs->hw.hscx.hscx ? 0x40 : 0, in Memhscx_fill_fifo()
465 MemWriteHSCXCMDR(cs, bcs->hw.hscx.hscx, more ? 0x8 : 0xa); in Memhscx_fill_fifo()
467 char *t = bcs->blog; in Memhscx_fill_fifo()
470 bcs->hw.hscx.hscx ? 'B' : 'A', count); in Memhscx_fill_fifo()
472 debugl1(cs, "%s", bcs->blog); in Memhscx_fill_fifo()
480 struct BCState *bcs = cs->bcs + hscx; in Memhscx_interrupt() local
485 if (!test_bit(BC_FLG_INIT, &bcs->Flag)) in Memhscx_interrupt()
494 if ((r & 0x40) && bcs->mode) in Memhscx_interrupt()
497 bcs->mode); in Memhscx_interrupt()
507 Memhscx_empty_fifo(bcs, count); in Memhscx_interrupt()
508 if ((count = bcs->hw.hscx.rcvidx - 1) > 0) { in Memhscx_interrupt()
514 skb_put_data(skb, bcs->hw.hscx.rcvbuf, in Memhscx_interrupt()
516 skb_queue_tail(&bcs->rqueue, skb); in Memhscx_interrupt()
520 bcs->hw.hscx.rcvidx = 0; in Memhscx_interrupt()
521 schedule_event(bcs, B_RCVBUFREADY); in Memhscx_interrupt()
524 Memhscx_empty_fifo(bcs, fifo_size); in Memhscx_interrupt()
525 if (bcs->mode == L1_MODE_TRANS) { in Memhscx_interrupt()
530 skb_put_data(skb, bcs->hw.hscx.rcvbuf, in Memhscx_interrupt()
532 skb_queue_tail(&bcs->rqueue, skb); in Memhscx_interrupt()
534 bcs->hw.hscx.rcvidx = 0; in Memhscx_interrupt()
535 schedule_event(bcs, B_RCVBUFREADY); in Memhscx_interrupt()
539 if (bcs->tx_skb) { in Memhscx_interrupt()
540 if (bcs->tx_skb->len) { in Memhscx_interrupt()
541 Memhscx_fill_fifo(bcs); in Memhscx_interrupt()
544 if (test_bit(FLG_LLI_L1WAKEUP, &bcs->st->lli.flag) && in Memhscx_interrupt()
545 (PACKET_NOACK != bcs->tx_skb->pkt_type)) { in Memhscx_interrupt()
547 spin_lock_irqsave(&bcs->aclock, flags); in Memhscx_interrupt()
548 bcs->ackcnt += bcs->hw.hscx.count; in Memhscx_interrupt()
549 spin_unlock_irqrestore(&bcs->aclock, flags); in Memhscx_interrupt()
550 schedule_event(bcs, B_ACKPENDING); in Memhscx_interrupt()
552 dev_kfree_skb_irq(bcs->tx_skb); in Memhscx_interrupt()
553 bcs->hw.hscx.count = 0; in Memhscx_interrupt()
554 bcs->tx_skb = NULL; in Memhscx_interrupt()
557 if ((bcs->tx_skb = skb_dequeue(&bcs->squeue))) { in Memhscx_interrupt()
558 bcs->hw.hscx.count = 0; in Memhscx_interrupt()
559 test_and_set_bit(BC_FLG_BUSY, &bcs->Flag); in Memhscx_interrupt()
560 Memhscx_fill_fifo(bcs); in Memhscx_interrupt()
562 test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); in Memhscx_interrupt()
563 schedule_event(bcs, B_XMTBUFREADY); in Memhscx_interrupt()
573 struct BCState *bcs; in Memhscx_int_main() local
576 bcs = cs->bcs + 1; in Memhscx_int_main()
579 if (bcs->mode == 1) in Memhscx_int_main()
580 Memhscx_fill_fifo(bcs); in Memhscx_int_main()
585 if (bcs->tx_skb) { in Memhscx_int_main()
586 skb_push(bcs->tx_skb, bcs->hw.hscx.count); in Memhscx_int_main()
587 bcs->tx_cnt += bcs->hw.hscx.count; in Memhscx_int_main()
588 bcs->hw.hscx.count = 0; in Memhscx_int_main()
590 MemWriteHSCXCMDR(cs, bcs->hw.hscx.hscx, 0x01); in Memhscx_int_main()
603 bcs = cs->bcs; in Memhscx_int_main()
606 if (bcs->mode == L1_MODE_TRANS) in Memhscx_int_main()
607 Memhscx_fill_fifo(bcs); in Memhscx_int_main()
612 if (bcs->tx_skb) { in Memhscx_int_main()
613 skb_push(bcs->tx_skb, bcs->hw.hscx.count); in Memhscx_int_main()
614 bcs->tx_cnt += bcs->hw.hscx.count; in Memhscx_int_main()
615 bcs->hw.hscx.count = 0; in Memhscx_int_main()
617 MemWriteHSCXCMDR(cs, bcs->hw.hscx.hscx, 0x01); in Memhscx_int_main()