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 memcpy(skb_put(skb, count), bcs->hw.hscx.rcvbuf, count); in Memhscx_interrupt()
515 skb_queue_tail(&bcs->rqueue, skb); in Memhscx_interrupt()
519 bcs->hw.hscx.rcvidx = 0; in Memhscx_interrupt()
520 schedule_event(bcs, B_RCVBUFREADY); in Memhscx_interrupt()
523 Memhscx_empty_fifo(bcs, fifo_size); in Memhscx_interrupt()
524 if (bcs->mode == L1_MODE_TRANS) { in Memhscx_interrupt()
529 memcpy(skb_put(skb, fifo_size), bcs->hw.hscx.rcvbuf, fifo_size); in Memhscx_interrupt()
530 skb_queue_tail(&bcs->rqueue, skb); in Memhscx_interrupt()
532 bcs->hw.hscx.rcvidx = 0; in Memhscx_interrupt()
533 schedule_event(bcs, B_RCVBUFREADY); in Memhscx_interrupt()
537 if (bcs->tx_skb) { in Memhscx_interrupt()
538 if (bcs->tx_skb->len) { in Memhscx_interrupt()
539 Memhscx_fill_fifo(bcs); in Memhscx_interrupt()
542 if (test_bit(FLG_LLI_L1WAKEUP, &bcs->st->lli.flag) && in Memhscx_interrupt()
543 (PACKET_NOACK != bcs->tx_skb->pkt_type)) { in Memhscx_interrupt()
545 spin_lock_irqsave(&bcs->aclock, flags); in Memhscx_interrupt()
546 bcs->ackcnt += bcs->hw.hscx.count; in Memhscx_interrupt()
547 spin_unlock_irqrestore(&bcs->aclock, flags); in Memhscx_interrupt()
548 schedule_event(bcs, B_ACKPENDING); in Memhscx_interrupt()
550 dev_kfree_skb_irq(bcs->tx_skb); in Memhscx_interrupt()
551 bcs->hw.hscx.count = 0; in Memhscx_interrupt()
552 bcs->tx_skb = NULL; in Memhscx_interrupt()
555 if ((bcs->tx_skb = skb_dequeue(&bcs->squeue))) { in Memhscx_interrupt()
556 bcs->hw.hscx.count = 0; in Memhscx_interrupt()
557 test_and_set_bit(BC_FLG_BUSY, &bcs->Flag); in Memhscx_interrupt()
558 Memhscx_fill_fifo(bcs); in Memhscx_interrupt()
560 test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); in Memhscx_interrupt()
561 schedule_event(bcs, B_XMTBUFREADY); in Memhscx_interrupt()
571 struct BCState *bcs; in Memhscx_int_main() local
574 bcs = cs->bcs + 1; in Memhscx_int_main()
577 if (bcs->mode == 1) in Memhscx_int_main()
578 Memhscx_fill_fifo(bcs); in Memhscx_int_main()
583 if (bcs->tx_skb) { in Memhscx_int_main()
584 skb_push(bcs->tx_skb, bcs->hw.hscx.count); in Memhscx_int_main()
585 bcs->tx_cnt += bcs->hw.hscx.count; in Memhscx_int_main()
586 bcs->hw.hscx.count = 0; in Memhscx_int_main()
588 MemWriteHSCXCMDR(cs, bcs->hw.hscx.hscx, 0x01); in Memhscx_int_main()
601 bcs = cs->bcs; in Memhscx_int_main()
604 if (bcs->mode == L1_MODE_TRANS) in Memhscx_int_main()
605 Memhscx_fill_fifo(bcs); in Memhscx_int_main()
610 if (bcs->tx_skb) { in Memhscx_int_main()
611 skb_push(bcs->tx_skb, bcs->hw.hscx.count); in Memhscx_int_main()
612 bcs->tx_cnt += bcs->hw.hscx.count; in Memhscx_int_main()
613 bcs->hw.hscx.count = 0; in Memhscx_int_main()
615 MemWriteHSCXCMDR(cs, bcs->hw.hscx.hscx, 0x01); in Memhscx_int_main()