Lines Matching full:bch
69 if (isar->ch[0].bch.debug & DEBUG_HW_BFIFO) { in send_mbox()
98 if (isar->ch[0].bch.debug & DEBUG_HW_BFIFO) { in rcv_mbox()
175 u32 saved_debug = isar->ch[0].bch.debug; in load_firmware()
194 isar->ch[0].bch.debug &= ~DEBUG_HW_BFIFO; in load_firmware()
281 isar->ch[0].bch.debug = saved_debug; in load_firmware()
393 isar->ch[0].bch.debug = saved_debug; in load_firmware()
405 _queue_data(&ch->bch.ch, PH_CONTROL_IND, status, 0, NULL, GFP_ATOMIC); in deliver_status()
419 if (test_bit(FLG_RX_OFF, &ch->bch.Flags)) { in isar_rcv_frame()
420 ch->bch.dropcnt += ch->is->clsb; in isar_rcv_frame()
424 switch (ch->bch.state) { in isar_rcv_frame()
433 maxlen = bchannel_get_rxbuf(&ch->bch, ch->is->clsb); in isar_rcv_frame()
436 ch->is->name, ch->bch.nr, ch->is->clsb); in isar_rcv_frame()
440 rcv_mbox(ch->is, skb_put(ch->bch.rx_skb, ch->is->clsb)); in isar_rcv_frame()
441 recv_Bchannel(&ch->bch, 0, false); in isar_rcv_frame()
444 maxlen = bchannel_get_rxbuf(&ch->bch, ch->is->clsb); in isar_rcv_frame()
447 ch->is->name, ch->bch.nr, ch->is->clsb); in isar_rcv_frame()
456 ch->bch.err_inv++; in isar_rcv_frame()
458 ch->bch.err_crc++; in isar_rcv_frame()
460 skb_trim(ch->bch.rx_skb, 0); in isar_rcv_frame()
465 skb_trim(ch->bch.rx_skb, 0); in isar_rcv_frame()
466 ptr = skb_put(ch->bch.rx_skb, ch->is->clsb); in isar_rcv_frame()
469 if (ch->bch.rx_skb->len < 3) { /* last 2 are the FCS */ in isar_rcv_frame()
471 ch->is->name, ch->bch.rx_skb->len); in isar_rcv_frame()
472 skb_trim(ch->bch.rx_skb, 0); in isar_rcv_frame()
475 skb_trim(ch->bch.rx_skb, ch->bch.rx_skb->len - 2); in isar_rcv_frame()
476 recv_Bchannel(&ch->bch, 0, false); in isar_rcv_frame()
484 if (ch->bch.rx_skb) in isar_rcv_frame()
485 skb_trim(ch->bch.rx_skb, 0); in isar_rcv_frame()
488 if (!ch->bch.rx_skb) { in isar_rcv_frame()
489 ch->bch.rx_skb = mI_alloc_skb(ch->bch.maxlen, in isar_rcv_frame()
491 if (unlikely(!ch->bch.rx_skb)) { in isar_rcv_frame()
499 rcv_mbox(ch->is, skb_put(ch->bch.rx_skb, ch->is->clsb)); in isar_rcv_frame()
501 ch->is->name, ch->bch.rx_skb->len); in isar_rcv_frame()
512 recv_Bchannel(&ch->bch, 0, false); in isar_rcv_frame()
521 if (ch->bch.rx_skb) in isar_rcv_frame()
522 skb_trim(ch->bch.rx_skb, 0); in isar_rcv_frame()
526 if ((ch->bch.rx_skb->len + ch->is->clsb) > in isar_rcv_frame()
527 (ch->bch.maxlen + 2)) { in isar_rcv_frame()
531 skb_trim(ch->bch.rx_skb, 0); in isar_rcv_frame()
536 skb_trim(ch->bch.rx_skb, 0); in isar_rcv_frame()
541 skb_trim(ch->bch.rx_skb, 0); in isar_rcv_frame()
542 ptr = skb_put(ch->bch.rx_skb, ch->is->clsb); in isar_rcv_frame()
545 if (ch->bch.rx_skb->len < 3) { /* last 2 are the FCS */ in isar_rcv_frame()
547 ch->is->name, ch->bch.rx_skb->len); in isar_rcv_frame()
548 skb_trim(ch->bch.rx_skb, 0); in isar_rcv_frame()
551 skb_trim(ch->bch.rx_skb, ch->bch.rx_skb->len - 2); in isar_rcv_frame()
552 recv_Bchannel(&ch->bch, 0, false); in isar_rcv_frame()
558 if (ch->bch.rx_skb) in isar_rcv_frame()
559 skb_trim(ch->bch.rx_skb, 0); in isar_rcv_frame()
567 pr_info("isar_rcv_frame protocol (%x)error\n", ch->bch.state); in isar_rcv_frame()
580 pr_debug("%s: ch%d tx_skb %d tx_idx %d\n", ch->is->name, ch->bch.nr, in isar_fill_fifo()
581 ch->bch.tx_skb ? ch->bch.tx_skb->len : -1, ch->bch.tx_idx); in isar_fill_fifo()
585 if (!ch->bch.tx_skb) { in isar_fill_fifo()
586 if (!test_bit(FLG_TX_EMPTY, &ch->bch.Flags) || in isar_fill_fifo()
587 (ch->bch.state != ISDN_P_B_RAW)) in isar_fill_fifo()
591 memset(ch->is->buf, ch->bch.fill[0], count); in isar_fill_fifo()
596 count = ch->bch.tx_skb->len - ch->bch.tx_idx; in isar_fill_fifo()
605 ptr = ch->bch.tx_skb->data + ch->bch.tx_idx; in isar_fill_fifo()
606 if (!ch->bch.tx_idx) { in isar_fill_fifo()
608 if ((ch->bch.state == ISDN_P_B_T30_FAX) && in isar_fill_fifo()
614 &ch->bch.Flags); in isar_fill_fifo()
619 &ch->bch.Flags); in isar_fill_fifo()
625 ch->bch.tx_idx += count; in isar_fill_fifo()
626 switch (ch->bch.state) { in isar_fill_fifo()
654 __func__, ch->bch.state); in isar_fill_fifo()
678 ch->bch.nr, ch->bch.tx_skb ? ch->bch.tx_skb->len : -1, in send_next()
679 ch->bch.tx_idx); in send_next()
680 if (ch->bch.state == ISDN_P_B_T30_FAX) { in send_next()
682 if (test_bit(FLG_LASTDATA, &ch->bch.Flags)) { in send_next()
684 test_and_set_bit(FLG_NMD_DATA, &ch->bch.Flags); in send_next()
687 if (test_bit(FLG_DLEETX, &ch->bch.Flags)) { in send_next()
688 test_and_set_bit(FLG_LASTDATA, &ch->bch.Flags); in send_next()
689 test_and_set_bit(FLG_NMD_DATA, &ch->bch.Flags); in send_next()
693 dev_kfree_skb(ch->bch.tx_skb); in send_next()
694 if (get_next_bframe(&ch->bch)) { in send_next()
696 test_and_clear_bit(FLG_TX_EMPTY, &ch->bch.Flags); in send_next()
697 } else if (test_bit(FLG_TX_EMPTY, &ch->bch.Flags)) { in send_next()
700 if (test_and_clear_bit(FLG_DLEETX, &ch->bch.Flags)) { in send_next()
702 &ch->bch.Flags)) { in send_next()
704 &ch->bch.Flags)) { in send_next()
709 test_and_set_bit(FLG_LL_OK, &ch->bch.Flags); in send_next()
713 } else if (test_bit(FLG_FILLEMPTY, &ch->bch.Flags)) { in send_next()
714 test_and_set_bit(FLG_TX_EMPTY, &ch->bch.Flags); in send_next()
727 if (ch && test_bit(FLG_ACTIVE, &ch->bch.Flags)) { in check_send()
728 if (ch->bch.tx_skb && (ch->bch.tx_skb->len > in check_send()
729 ch->bch.tx_idx)) in check_send()
737 if (ch && test_bit(FLG_ACTIVE, &ch->bch.Flags)) { in check_send()
738 if (ch->bch.tx_skb && (ch->bch.tx_skb->len > in check_send()
739 ch->bch.tx_idx)) in check_send()
872 if (test_bit(BC_FLG_ORIG, &ch->bch.Flags)) in isar_pump_statev_fax()
873 isar_pump_cmd(bch, HW_MOD_FRH, 3); in isar_pump_statev_fax()
875 isar_pump_cmd(bch, HW_MOD_FTH, 3); in isar_pump_statev_fax()
932 &ch->bch.Flags)) in isar_pump_statev_fax()
937 &ch->bch.Flags); in isar_pump_statev_fax()
985 if (test_and_clear_bit(FLG_LL_OK, &ch->bch.Flags)) in isar_pump_statev_fax()
1064 ch->bch.err_tx++; in mISDNisar_irq()
1066 ch->bch.err_rdo++; in mISDNisar_irq()
1077 if (ch->bch.state == ISDN_P_B_MODEM_ASYNC) in mISDNisar_irq()
1079 else if (ch->bch.state == ISDN_P_B_T30_FAX) in mISDNisar_irq()
1081 else if (ch->bch.state == ISDN_P_B_RAW) { in mISDNisar_irq()
1091 _queue_data(&ch->bch.ch, PH_CONTROL_IND, in mISDNisar_irq()
1096 isar->name, ch->bch.state, in mISDNisar_irq()
1140 pr_debug("%s: ftimer flags %lx\n", ch->is->name, ch->bch.Flags); in ftimer_handler()
1141 test_and_clear_bit(FLG_FTI_RUN, &ch->bch.Flags); in ftimer_handler()
1142 if (test_and_clear_bit(FLG_LL_CONN, &ch->bch.Flags)) in ftimer_handler()
1151 switch (ch->bch.state) { in setup_pump()
1158 if (test_bit(FLG_DTMFSEND, &ch->bch.Flags)) { in setup_pump()
1170 if (test_bit(FLG_ORIGIN, &ch->bch.Flags)) { in setup_pump()
1186 if (test_bit(FLG_ORIGIN, &ch->bch.Flags)) { in setup_pump()
1197 test_and_set_bit(FLG_FTI_RUN, &ch->bch.Flags); in setup_pump()
1210 switch (ch->bch.state) { in setup_sart()
1242 if (ch->bch.nr == 2) { in setup_iom2()
1246 switch (ch->bch.state) { in setup_iom2()
1261 if (test_bit(FLG_DTMFSEND, &ch->bch.Flags)) in setup_iom2()
1276 if (ch->bch.state == ISDN_P_NONE) { /* New Setup */ in modeisar()
1282 test_and_clear_bit(FLG_HDLC, &ch->bch.Flags); in modeisar()
1283 test_and_clear_bit(FLG_TRANSPARENT, &ch->bch.Flags); in modeisar()
1298 test_and_set_bit(FLG_HDLC, &ch->bch.Flags); in modeisar()
1301 &ch->bch.Flags); in modeisar()
1322 ch->bch.nr, ch->dpath, ch->bch.state, bprotocol); in modeisar()
1323 ch->bch.state = bprotocol; in modeisar()
1327 if (ch->bch.state == ISDN_P_NONE) { in modeisar()
1334 ch->is->ctrl(ch->is->hw, HW_DEACT_IND, ch->bch.nr); in modeisar()
1336 ch->is->ctrl(ch->is->hw, HW_ACTIVATE_IND, ch->bch.nr); in modeisar()
1347 ch->is->name, cmd, para, ch->bch.state); in isar_pump_cmd()
1460 isar->ch[i].bch.state = 0; in isar_setup()
1469 struct bchannel *bch = container_of(ch, struct bchannel, ch); in isar_l2l1() local
1470 struct isar_ch *ich = container_of(bch, struct isar_ch, bch); in isar_l2l1()
1479 ret = bchannel_senddata(bch, skb); in isar_l2l1()
1488 if (!test_and_set_bit(FLG_ACTIVE, &bch->Flags)) in isar_l2l1()
1499 mISDN_clear_bchannel(bch); in isar_l2l1()
1512 if (bch->state == ISDN_P_B_L2DTMF) { in isar_l2l1()
1527 __func__, bch->state); in isar_l2l1()
1536 test_bit(FLG_INITIALIZED, &bch->Flags)) { in isar_l2l1()
1546 test_and_set_bit(FLG_DLEETX, &bch->Flags); in isar_l2l1()
1564 channel_bctrl(struct bchannel *bch, struct mISDN_ctrl_req *cq) in channel_bctrl() argument
1566 return mISDN_ctrl_bchannel(bch, cq); in channel_bctrl()
1572 struct bchannel *bch = container_of(ch, struct bchannel, ch); in isar_bctrl() local
1573 struct isar_ch *ich = container_of(bch, struct isar_ch, bch); in isar_bctrl()
1580 test_and_clear_bit(FLG_OPEN, &bch->Flags); in isar_bctrl()
1581 cancel_work_sync(&bch->workq); in isar_bctrl()
1583 mISDN_clear_bchannel(bch); in isar_bctrl()
1592 ret = channel_bctrl(bch, arg); in isar_bctrl()
1608 test_and_clear_bit(FLG_INITIALIZED, &isar->ch[0].bch.Flags); in free_isar()
1609 test_and_clear_bit(FLG_INITIALIZED, &isar->ch[1].bch.Flags); in free_isar()
1619 if (isar->ch[0].bch.debug & DEBUG_HW) in init_isar()
1629 test_and_set_bit(FLG_INITIALIZED, &isar->ch[0].bch.Flags); in init_isar()
1631 test_and_set_bit(FLG_INITIALIZED, &isar->ch[1].bch.Flags); in init_isar()
1638 struct bchannel *bch; in isar_open() local
1644 bch = &isar->ch[rq->adr.channel - 1].bch; in isar_open()
1645 if (test_and_set_bit(FLG_OPEN, &bch->Flags)) in isar_open()
1647 bch->ch.protocol = rq->protocol; in isar_open()
1648 rq->ch = &bch->ch; in isar_open()
1659 isar->ch[i].bch.nr = i + 1; in mISDNisar_init()
1660 mISDN_initbchannel(&isar->ch[i].bch, MAX_DATA_MEM, 32); in mISDNisar_init()
1661 isar->ch[i].bch.ch.nr = i + 1; in mISDNisar_init()
1662 isar->ch[i].bch.ch.send = &isar_l2l1; in mISDNisar_init()
1663 isar->ch[i].bch.ch.ctrl = isar_bctrl; in mISDNisar_init()
1664 isar->ch[i].bch.hw = hw; in mISDNisar_init()