Lines Matching refs:bch

81 		if (isar->ch[0].bch.debug & DEBUG_HW_BFIFO) {  in send_mbox()
110 if (isar->ch[0].bch.debug & DEBUG_HW_BFIFO) { in rcv_mbox()
187 u32 saved_debug = isar->ch[0].bch.debug; in load_firmware()
206 isar->ch[0].bch.debug &= ~DEBUG_HW_BFIFO; in load_firmware()
293 isar->ch[0].bch.debug = saved_debug; in load_firmware()
405 isar->ch[0].bch.debug = saved_debug; in load_firmware()
417 _queue_data(&ch->bch.ch, PH_CONTROL_IND, status, 0, NULL, GFP_ATOMIC); in deliver_status()
430 switch (ch->bch.state) { in isar_rcv_frame()
439 if (!ch->bch.rx_skb) { in isar_rcv_frame()
440 ch->bch.rx_skb = mI_alloc_skb(ch->bch.maxlen, in isar_rcv_frame()
442 if (unlikely(!ch->bch.rx_skb)) { in isar_rcv_frame()
449 rcv_mbox(ch->is, skb_put(ch->bch.rx_skb, ch->is->clsb)); in isar_rcv_frame()
450 recv_Bchannel(&ch->bch, 0); in isar_rcv_frame()
453 if (!ch->bch.rx_skb) { in isar_rcv_frame()
454 ch->bch.rx_skb = mI_alloc_skb(ch->bch.maxlen, in isar_rcv_frame()
456 if (unlikely(!ch->bch.rx_skb)) { in isar_rcv_frame()
463 if ((ch->bch.rx_skb->len + ch->is->clsb) > in isar_rcv_frame()
464 (ch->bch.maxlen + 2)) { in isar_rcv_frame()
468 skb_trim(ch->bch.rx_skb, 0); in isar_rcv_frame()
476 ch->bch.err_inv++; in isar_rcv_frame()
478 ch->bch.err_crc++; in isar_rcv_frame()
480 skb_trim(ch->bch.rx_skb, 0); in isar_rcv_frame()
485 skb_trim(ch->bch.rx_skb, 0); in isar_rcv_frame()
486 ptr = skb_put(ch->bch.rx_skb, ch->is->clsb); in isar_rcv_frame()
489 if (ch->bch.rx_skb->len < 3) { /* last 2 are the FCS */ in isar_rcv_frame()
491 ch->is->name, ch->bch.rx_skb->len); in isar_rcv_frame()
492 skb_trim(ch->bch.rx_skb, 0); in isar_rcv_frame()
495 skb_trim(ch->bch.rx_skb, ch->bch.rx_skb->len - 2); in isar_rcv_frame()
496 recv_Bchannel(&ch->bch, 0); in isar_rcv_frame()
504 if (ch->bch.rx_skb) in isar_rcv_frame()
505 skb_trim(ch->bch.rx_skb, 0); in isar_rcv_frame()
508 if (!ch->bch.rx_skb) { in isar_rcv_frame()
509 ch->bch.rx_skb = mI_alloc_skb(ch->bch.maxlen, in isar_rcv_frame()
511 if (unlikely(!ch->bch.rx_skb)) { in isar_rcv_frame()
519 rcv_mbox(ch->is, skb_put(ch->bch.rx_skb, ch->is->clsb)); in isar_rcv_frame()
521 ch->is->name, ch->bch.rx_skb->len); in isar_rcv_frame()
532 recv_Bchannel(&ch->bch, 0); in isar_rcv_frame()
541 if (ch->bch.rx_skb) in isar_rcv_frame()
542 skb_trim(ch->bch.rx_skb, 0); in isar_rcv_frame()
546 if ((ch->bch.rx_skb->len + ch->is->clsb) > in isar_rcv_frame()
547 (ch->bch.maxlen + 2)) { in isar_rcv_frame()
551 skb_trim(ch->bch.rx_skb, 0); in isar_rcv_frame()
556 skb_trim(ch->bch.rx_skb, 0); in isar_rcv_frame()
561 skb_trim(ch->bch.rx_skb, 0); in isar_rcv_frame()
562 ptr = skb_put(ch->bch.rx_skb, ch->is->clsb); in isar_rcv_frame()
565 if (ch->bch.rx_skb->len < 3) { /* last 2 are the FCS */ in isar_rcv_frame()
567 ch->is->name, ch->bch.rx_skb->len); in isar_rcv_frame()
568 skb_trim(ch->bch.rx_skb, 0); in isar_rcv_frame()
571 skb_trim(ch->bch.rx_skb, ch->bch.rx_skb->len - 2); in isar_rcv_frame()
572 recv_Bchannel(&ch->bch, 0); in isar_rcv_frame()
578 if (ch->bch.rx_skb) in isar_rcv_frame()
579 skb_trim(ch->bch.rx_skb, 0); in isar_rcv_frame()
587 pr_info("isar_rcv_frame protocol (%x)error\n", ch->bch.state); in isar_rcv_frame()
601 ch->is->name, ch->bch.nr, ch->bch.tx_skb, ch->bch.tx_idx); in isar_fill_fifo()
602 if (!ch->bch.tx_skb) in isar_fill_fifo()
604 count = ch->bch.tx_skb->len - ch->bch.tx_idx; in isar_fill_fifo()
616 ptr = ch->bch.tx_skb->data + ch->bch.tx_idx; in isar_fill_fifo()
617 if (!ch->bch.tx_idx) { in isar_fill_fifo()
619 if ((ch->bch.state == ISDN_P_B_T30_FAX) && in isar_fill_fifo()
625 &ch->bch.Flags); in isar_fill_fifo()
630 &ch->bch.Flags); in isar_fill_fifo()
636 ch->bch.tx_idx += count; in isar_fill_fifo()
637 switch (ch->bch.state) { in isar_fill_fifo()
665 __func__, ch->bch.state); in isar_fill_fifo()
689 ch->is->name, __func__, ch->bch.nr, in send_next()
690 ch->bch.tx_skb, ch->bch.tx_idx); in send_next()
691 if (ch->bch.state == ISDN_P_B_T30_FAX) { in send_next()
693 if (test_bit(FLG_LASTDATA, &ch->bch.Flags)) { in send_next()
695 test_and_set_bit(FLG_NMD_DATA, &ch->bch.Flags); in send_next()
698 if (test_bit(FLG_DLEETX, &ch->bch.Flags)) { in send_next()
699 test_and_set_bit(FLG_LASTDATA, &ch->bch.Flags); in send_next()
700 test_and_set_bit(FLG_NMD_DATA, &ch->bch.Flags); in send_next()
704 if (ch->bch.tx_skb) { in send_next()
706 if (test_bit(FLG_TRANSPARENT, &ch->bch.Flags)) in send_next()
707 confirm_Bsend(&ch->bch); in send_next()
708 dev_kfree_skb(ch->bch.tx_skb); in send_next()
710 if (get_next_bframe(&ch->bch)) in send_next()
713 if (test_and_clear_bit(FLG_DLEETX, &ch->bch.Flags)) { in send_next()
715 &ch->bch.Flags)) { in send_next()
717 &ch->bch.Flags)) { in send_next()
722 test_and_set_bit(FLG_LL_OK, &ch->bch.Flags); in send_next()
738 if (ch && test_bit(FLG_ACTIVE, &ch->bch.Flags)) { in check_send()
739 if (ch->bch.tx_skb && (ch->bch.tx_skb->len > in check_send()
740 ch->bch.tx_idx)) in check_send()
748 if (ch && test_bit(FLG_ACTIVE, &ch->bch.Flags)) { in check_send()
749 if (ch->bch.tx_skb && (ch->bch.tx_skb->len > in check_send()
750 ch->bch.tx_idx)) in check_send()
883 if (test_bit(BC_FLG_ORIG, &ch->bch.Flags)) in isar_pump_statev_fax()
884 isar_pump_cmd(bch, HW_MOD_FRH, 3); in isar_pump_statev_fax()
886 isar_pump_cmd(bch, HW_MOD_FTH, 3); in isar_pump_statev_fax()
943 &ch->bch.Flags)) in isar_pump_statev_fax()
948 &ch->bch.Flags); in isar_pump_statev_fax()
995 if (test_and_clear_bit(FLG_LL_OK, &ch->bch.Flags)) in isar_pump_statev_fax()
1074 ch->bch.err_tx++; in mISDNisar_irq()
1076 ch->bch.err_rdo++; in mISDNisar_irq()
1087 if (ch->bch.state == ISDN_P_B_MODEM_ASYNC) in mISDNisar_irq()
1089 else if (ch->bch.state == ISDN_P_B_T30_FAX) in mISDNisar_irq()
1091 else if (ch->bch.state == ISDN_P_B_RAW) { in mISDNisar_irq()
1101 _queue_data(&ch->bch.ch, PH_CONTROL_IND, in mISDNisar_irq()
1106 isar->name, ch->bch.state, in mISDNisar_irq()
1150 pr_debug("%s: ftimer flags %lx\n", ch->is->name, ch->bch.Flags); in ftimer_handler()
1151 test_and_clear_bit(FLG_FTI_RUN, &ch->bch.Flags); in ftimer_handler()
1152 if (test_and_clear_bit(FLG_LL_CONN, &ch->bch.Flags)) in ftimer_handler()
1161 switch (ch->bch.state) { in setup_pump()
1168 if (test_bit(FLG_DTMFSEND, &ch->bch.Flags)) { in setup_pump()
1179 if (test_bit(FLG_ORIGIN, &ch->bch.Flags)) { in setup_pump()
1195 if (test_bit(FLG_ORIGIN, &ch->bch.Flags)) { in setup_pump()
1206 test_and_set_bit(FLG_FTI_RUN, &ch->bch.Flags); in setup_pump()
1219 switch (ch->bch.state) { in setup_sart()
1251 if (ch->bch.nr == 2) { in setup_iom2()
1255 switch (ch->bch.state) { in setup_iom2()
1269 if (test_bit(FLG_DTMFSEND, &ch->bch.Flags)) in setup_iom2()
1284 if (ch->bch.state == ISDN_P_NONE) { /* New Setup */ in modeisar()
1290 test_and_clear_bit(FLG_HDLC, &ch->bch.Flags); in modeisar()
1291 test_and_clear_bit(FLG_TRANSPARENT, &ch->bch.Flags); in modeisar()
1306 test_and_set_bit(FLG_HDLC, &ch->bch.Flags); in modeisar()
1309 &ch->bch.Flags); in modeisar()
1330 ch->bch.nr, ch->dpath, ch->bch.state, bprotocol); in modeisar()
1331 ch->bch.state = bprotocol; in modeisar()
1335 if (ch->bch.state == ISDN_P_NONE) { in modeisar()
1342 ch->is->ctrl(ch->is->hw, HW_DEACT_IND, ch->bch.nr); in modeisar()
1344 ch->is->ctrl(ch->is->hw, HW_ACTIVATE_IND, ch->bch.nr); in modeisar()
1355 ch->is->name, cmd, para, ch->bch.state); in isar_pump_cmd()
1468 isar->ch[i].bch.state = 0; in isar_setup()
1477 struct bchannel *bch = container_of(ch, struct bchannel, ch); in isar_l2l1() local
1478 struct isar_ch *ich = container_of(bch, struct isar_ch, bch); in isar_l2l1()
1487 ret = bchannel_senddata(bch, skb); in isar_l2l1()
1493 if (!test_bit(FLG_TRANSPARENT, &bch->Flags)) in isar_l2l1()
1500 if (!test_and_set_bit(FLG_ACTIVE, &bch->Flags)) in isar_l2l1()
1511 mISDN_clear_bchannel(bch); in isar_l2l1()
1524 if (bch->state == ISDN_P_B_L2DTMF) { in isar_l2l1()
1539 __func__, bch->state); in isar_l2l1()
1548 test_bit(FLG_INITIALIZED, &bch->Flags)) { in isar_l2l1()
1558 test_and_set_bit(FLG_DLEETX, &bch->Flags); in isar_l2l1()
1575 channel_bctrl(struct bchannel *bch, struct mISDN_ctrl_req *cq) in channel_bctrl() argument
1596 struct bchannel *bch = container_of(ch, struct bchannel, ch); in isar_bctrl() local
1597 struct isar_ch *ich = container_of(bch, struct isar_ch, bch); in isar_bctrl()
1604 test_and_clear_bit(FLG_OPEN, &bch->Flags); in isar_bctrl()
1605 if (test_bit(FLG_ACTIVE, &bch->Flags)) { in isar_bctrl()
1607 mISDN_freebchannel(bch); in isar_bctrl()
1611 skb_queue_purge(&bch->rqueue); in isar_bctrl()
1612 bch->rcount = 0; in isar_bctrl()
1620 ret = channel_bctrl(bch, arg); in isar_bctrl()
1636 test_and_clear_bit(FLG_INITIALIZED, &isar->ch[0].bch.Flags); in free_isar()
1637 test_and_clear_bit(FLG_INITIALIZED, &isar->ch[1].bch.Flags); in free_isar()
1647 if (isar->ch[0].bch.debug & DEBUG_HW) in init_isar()
1659 test_and_set_bit(FLG_INITIALIZED, &isar->ch[0].bch.Flags); in init_isar()
1663 test_and_set_bit(FLG_INITIALIZED, &isar->ch[1].bch.Flags); in init_isar()
1670 struct bchannel *bch; in isar_open() local
1676 bch = &isar->ch[rq->adr.channel - 1].bch; in isar_open()
1677 if (test_and_set_bit(FLG_OPEN, &bch->Flags)) in isar_open()
1679 test_and_clear_bit(FLG_FILLEMPTY, &bch->Flags); in isar_open()
1680 bch->ch.protocol = rq->protocol; in isar_open()
1681 rq->ch = &bch->ch; in isar_open()
1692 isar->ch[i].bch.nr = i + 1; in mISDNisar_init()
1693 mISDN_initbchannel(&isar->ch[i].bch, MAX_DATA_MEM); in mISDNisar_init()
1694 isar->ch[i].bch.ch.nr = i + 1; in mISDNisar_init()
1695 isar->ch[i].bch.ch.send = &isar_l2l1; in mISDNisar_init()
1696 isar->ch[i].bch.ch.ctrl = isar_bctrl; in mISDNisar_init()
1697 isar->ch[i].bch.hw = hw; in mISDNisar_init()