Lines Matching refs:hscx

47 static void bch_int(struct IsdnCardState *cs, u_char hscx);
52 static void bch_init(struct IsdnCardState *cs, int hscx);
458 bcs->hw.hscx.count = 0; in bch_l2l1()
470 bcs->hw.hscx.count = 0; in bch_l2l1()
509 u_char *ptr, hscx; in bch_empty_fifo() local
514 hscx = bcs->hw.hscx.hscx; in bch_empty_fifo()
519 if (bcs->hw.hscx.rcvidx + count > HSCX_BUFMAX) { in bch_empty_fifo()
522 cs->BC_Write_Reg(cs, hscx, IPACX_CMDRB, 0x80); // RMC in bch_empty_fifo()
523 bcs->hw.hscx.rcvidx = 0; in bch_empty_fifo()
527 ptr = bcs->hw.hscx.rcvbuf + bcs->hw.hscx.rcvidx; in bch_empty_fifo()
529 while (cnt--) *ptr++ = cs->BC_Read_Reg(cs, hscx, IPACX_RFIFOB); in bch_empty_fifo()
530 cs->BC_Write_Reg(cs, hscx, IPACX_CMDRB, 0x80); // RMC in bch_empty_fifo()
532 ptr = bcs->hw.hscx.rcvbuf + bcs->hw.hscx.rcvidx; in bch_empty_fifo()
533 bcs->hw.hscx.rcvidx += count; in bch_empty_fifo()
538 t += sprintf(t, "bch_empty_fifo() B-%d cnt %d", hscx, count); in bch_empty_fifo()
552 u_char *ptr, *p, hscx; in bch_fill_fifo() local
561 hscx = bcs->hw.hscx.hscx; in bch_fill_fifo()
574 bcs->hw.hscx.count += count; in bch_fill_fifo()
575 while (cnt--) cs->BC_Write_Reg(cs, hscx, IPACX_XFIFOB, *p++); in bch_fill_fifo()
576 cs->BC_Write_Reg(cs, hscx, IPACX_CMDRB, (more ? 0x08 : 0x0a)); in bch_fill_fifo()
581 t += sprintf(t, "%s() B-%d cnt %d", __func__, hscx, count); in bch_fill_fifo()
591 bch_int(struct IsdnCardState *cs, u_char hscx) in bch_int() argument
599 bcs = cs->bcs + hscx; in bch_int()
600 istab = cs->BC_Read_Reg(cs, hscx, IPACX_ISTAB); in bch_int()
607 rstab = cs->BC_Read_Reg(cs, hscx, IPACX_RSTAB); in bch_int()
611 debugl1(cs, "bch_int() B-%d: invalid frame", hscx); in bch_int()
614 debugl1(cs, "bch_int() B-%d: RDO mode=%d", hscx, bcs->mode); in bch_int()
617 debugl1(cs, "bch_int() B-%d: CRC error", hscx); in bch_int()
618 cs->BC_Write_Reg(cs, hscx, IPACX_CMDRB, 0x80); // RMC in bch_int()
621 count = cs->BC_Read_Reg(cs, hscx, IPACX_RBCLB) & (B_FIFO_SIZE - 1); in bch_int()
624 if ((count = bcs->hw.hscx.rcvidx - 1) > 0) { in bch_int()
630 skb_put_data(skb, bcs->hw.hscx.rcvbuf, in bch_int()
636 bcs->hw.hscx.rcvidx = 0; in bch_int()
648 skb_put_data(skb, bcs->hw.hscx.rcvbuf, in bch_int()
652 bcs->hw.hscx.rcvidx = 0; in bch_int()
659 debugl1(cs, "bch_int() B-%d: RFO error", hscx); in bch_int()
660 cs->BC_Write_Reg(cs, hscx, IPACX_CMDRB, 0x40); // RRES in bch_int()
673 bcs->ackcnt += bcs->hw.hscx.count; in bch_int()
679 bcs->hw.hscx.count = 0; in bch_int()
683 bcs->hw.hscx.count = 0; in bch_int()
699 skb_push(bcs->tx_skb, bcs->hw.hscx.count); in bch_int()
700 bcs->tx_cnt += bcs->hw.hscx.count; in bch_int()
701 bcs->hw.hscx.count = 0; in bch_int()
703 cs->BC_Write_Reg(cs, hscx, IPACX_CMDRB, 0x01); // XRES in bch_int()
705 debugl1(cs, "bch_int() B-%d XDU error", hscx); in bch_int()
716 int hscx = bcs->hw.hscx.hscx; in bch_mode() local
720 debugl1(cs, "mode_bch() switch B-%d mode %d chan %d", hscx, mode, bc); in bch_mode()
725 if (!hscx) in bch_mode()
738 cs->BC_Write_Reg(cs, hscx, IPACX_MODEB, 0xC0); // rec off in bch_mode()
739 cs->BC_Write_Reg(cs, hscx, IPACX_EXMB, 0x30); // std adj. in bch_mode()
740 cs->BC_Write_Reg(cs, hscx, IPACX_MASKB, 0xFF); // ints off in bch_mode()
741 cs->BC_Write_Reg(cs, hscx, IPACX_CMDRB, 0x41); // validate adjustments in bch_mode()
744 cs->BC_Write_Reg(cs, hscx, IPACX_MODEB, 0x88); // ext transp mode in bch_mode()
745 cs->BC_Write_Reg(cs, hscx, IPACX_EXMB, 0x00); // xxx00000 in bch_mode()
746 cs->BC_Write_Reg(cs, hscx, IPACX_CMDRB, 0x41); // validate adjustments in bch_mode()
747 cs->BC_Write_Reg(cs, hscx, IPACX_MASKB, _MASKB_IMASK); in bch_mode()
750 cs->BC_Write_Reg(cs, hscx, IPACX_MODEB, 0xC8); // transp mode 0 in bch_mode()
751 cs->BC_Write_Reg(cs, hscx, IPACX_EXMB, 0x01); // idle=hdlc flags crc enabled in bch_mode()
752 cs->BC_Write_Reg(cs, hscx, IPACX_CMDRB, 0x41); // validate adjustments in bch_mode()
753 cs->BC_Write_Reg(cs, hscx, IPACX_MASKB, _MASKB_IMASK); in bch_mode()
765 kfree(bcs->hw.hscx.rcvbuf); in bch_close_state()
766 bcs->hw.hscx.rcvbuf = NULL; in bch_close_state()
785 if (!(bcs->hw.hscx.rcvbuf = kmalloc(HSCX_BUFMAX, GFP_ATOMIC))) { in bch_open_state()
795 kfree(bcs->hw.hscx.rcvbuf); in bch_open_state()
796 bcs->hw.hscx.rcvbuf = NULL; in bch_open_state()
805 bcs->hw.hscx.rcvidx = 0; in bch_open_state()
828 bch_init(struct IsdnCardState *cs, int hscx) in bch_init() argument
830 cs->bcs[hscx].BC_SetStack = bch_setstack; in bch_init()
831 cs->bcs[hscx].BC_Close = bch_close_state; in bch_init()
832 cs->bcs[hscx].hw.hscx.hscx = hscx; in bch_init()
833 cs->bcs[hscx].cs = cs; in bch_init()
834 bch_mode(cs->bcs + hscx, 0, hscx); in bch_init()