• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/isdn/hardware/mISDN/

Lines Matching defs:bch

147 	struct bchannel		bch[2];
320 if (test_bit(FLG_ACTIVE, &hc->bch[0].Flags) &&
321 (hc->bch[0].nr & channel))
322 return &hc->bch[0];
323 else if (test_bit(FLG_ACTIVE, &hc->bch[1].Flags) &&
324 (hc->bch[1].nr & channel))
325 return &hc->bch[1];
378 if (hc->bch[fifo].debug & DEBUG_HW_BCHANNEL)
392 if (hc->bch[fifo].debug & DEBUG_HW_BCHANNEL)
404 hfcpci_empty_bfifo(struct bchannel *bch, struct bzfifo *bz,
411 if ((bch->debug & DEBUG_HW_BCHANNEL) && !(bch->debug & DEBUG_HW_BFIFO))
420 if (bch->debug & DEBUG_HW)
424 bch->err_inv++;
429 bch->rx_skb = mI_alloc_skb(count - 3, GFP_ATOMIC);
430 if (!bch->rx_skb) {
436 ptr = skb_put(bch->rx_skb, count);
456 recv_Bchannel(bch, MISDN_ID_ANY);
546 hfcpci_empty_fifo_trans(struct bchannel *bch, struct bzfifo *rxbz,
580 bch->rx_skb = mI_alloc_skb(fcnt_rx, GFP_ATOMIC);
581 if (bch->rx_skb) {
582 ptr = skb_put(bch->rx_skb, fcnt_rx);
599 recv_Bchannel(bch, fcnt_tx); /* bch, id */
610 main_rec_hfcpci(struct bchannel *bch)
612 struct hfc_pci *hc = bch->hw;
619 if ((bch->nr & 2) && (!hc->hw.bswapped)) {
633 if (bch->debug & DEBUG_HW_BCHANNEL)
635 bch->nr, rxbz->f1, rxbz->f2);
642 if (bch->debug & DEBUG_HW_BCHANNEL)
645 bch->nr, le16_to_cpu(zp->z1),
647 hfcpci_empty_bfifo(bch, rxbz, bdata, rcnt);
660 } else if (test_bit(FLG_TRANSPARENT, &bch->Flags)) {
661 hfcpci_empty_fifo_trans(bch, rxbz, txbz, bdata);
751 hfcpci_fill_fifo(struct bchannel *bch)
753 struct hfc_pci *hc = bch->hw;
761 if ((bch->debug & DEBUG_HW_BCHANNEL) && !(bch->debug & DEBUG_HW_BFIFO))
763 if ((!bch->tx_skb) || bch->tx_skb->len <= 0)
765 count = bch->tx_skb->len - bch->tx_idx;
766 if ((bch->nr & 2) && (!hc->hw.bswapped)) {
774 if (test_bit(FLG_TRANSPARENT, &bch->Flags)) {
777 if (bch->debug & DEBUG_HW_BCHANNEL)
779 "cnt(%d) z1(%x) z2(%x)\n", bch->nr, count,
789 if (test_bit(FLG_FILLEMPTY, &bch->Flags) && !fcnt) {
801 if (bch->debug & DEBUG_HW_BFIFO)
818 count = bch->tx_skb->len - bch->tx_idx;
829 src = bch->tx_skb->data + bch->tx_idx;
834 if (bch->debug & DEBUG_HW_BFIFO)
839 bch->tx_idx += count;
850 if (bch->tx_idx < bch->tx_skb->len)
853 if (test_bit(FLG_TRANSPARENT, &bch->Flags))
854 confirm_Bsend(bch);
855 dev_kfree_skb(bch->tx_skb);
856 if (get_next_bframe(bch))
860 if (bch->debug & DEBUG_HW_BCHANNEL)
863 __func__, bch->nr, bz->f1, bz->f2,
869 if (bch->debug & DEBUG_HW_BCHANNEL)
880 if (bch->debug & DEBUG_HW_BCHANNEL)
882 bch->nr, count, maxlen);
885 if (bch->debug & DEBUG_HW_BCHANNEL)
895 src = bch->tx_skb->data + bch->tx_idx; /* source pointer */
911 dev_kfree_skb(bch->tx_skb);
912 get_next_bframe(bch);
1131 tx_birq(struct bchannel *bch)
1133 if (bch->tx_skb && bch->tx_idx < bch->tx_skb->len)
1134 hfcpci_fill_fifo(bch);
1136 if (bch->tx_skb)
1137 dev_kfree_skb(bch->tx_skb);
1138 if (get_next_bframe(bch))
1139 hfcpci_fill_fifo(bch);
1161 struct bchannel *bch;
1203 bch = Sel_BCS(hc, hc->hw.bswapped ? 2 : 1);
1204 if (bch)
1205 main_rec_hfcpci(bch);
1210 bch = Sel_BCS(hc, 2);
1211 if (bch)
1212 main_rec_hfcpci(bch);
1217 bch = Sel_BCS(hc, hc->hw.bswapped ? 2 : 1);
1218 if (bch)
1219 tx_birq(bch);
1224 bch = Sel_BCS(hc, 2);
1225 if (bch)
1226 tx_birq(bch);
1253 mode_hfcpci(struct bchannel *bch, int bc, int protocol)
1255 struct hfc_pci *hc = bch->hw;
1259 if (bch->debug & DEBUG_HW_BCHANNEL)
1262 bch->state, protocol, bch->nr, bc);
1297 bch->state = -1;
1298 bch->nr = bc;
1300 if (bch->state == ISDN_P_NONE)
1319 if (bch->nr & 2)
1324 bch->state = ISDN_P_NONE;
1325 bch->nr = bc;
1326 test_and_clear_bit(FLG_HDLC, &bch->Flags);
1327 test_and_clear_bit(FLG_TRANSPARENT, &bch->Flags);
1330 bch->state = protocol;
1331 bch->nr = bc;
1362 test_and_set_bit(FLG_TRANSPARENT, &bch->Flags);
1365 bch->state = protocol;
1366 bch->nr = bc;
1391 test_and_set_bit(FLG_HDLC, &bch->Flags);
1445 set_hfcpci_rxtest(struct bchannel *bch, int protocol, int chan)
1447 struct hfc_pci *hc = bch->hw;
1449 if (bch->debug & DEBUG_HW_BCHANNEL)
1452 bch->state, protocol, bch->nr, chan);
1453 if (bch->nr != chan) {
1456 bch->nr, chan);
1461 bch->state = protocol;
1486 bch->state = protocol;
1520 deactivate_bchannel(struct bchannel *bch)
1522 struct hfc_pci *hc = bch->hw;
1526 mISDN_clear_bchannel(bch);
1527 mode_hfcpci(bch, bch->nr, ISDN_P_NONE);
1535 channel_bctrl(struct bchannel *bch, struct mISDN_ctrl_req *cq)
1544 test_and_set_bit(FLG_FILLEMPTY, &bch->Flags);
1547 "off=%d)\n", __func__, bch->nr, !!cq->p1);
1559 struct bchannel *bch = container_of(ch, struct bchannel, ch);
1560 struct hfc_pci *hc = bch->hw;
1564 if (bch->debug & DEBUG_HW)
1569 ret = set_hfcpci_rxtest(bch, ISDN_P_B_RAW, (int)(long)arg);
1574 ret = set_hfcpci_rxtest(bch, ISDN_P_B_HDLC, (int)(long)arg);
1579 mode_hfcpci(bch, bch->nr, ISDN_P_NONE);
1584 test_and_clear_bit(FLG_OPEN, &bch->Flags);
1585 if (test_bit(FLG_ACTIVE, &bch->Flags))
1586 deactivate_bchannel(bch);
1593 ret = channel_bctrl(bch, arg);
1692 struct bchannel *bch = container_of(ch, struct bchannel, ch);
1693 struct hfc_pci *hc = bch->hw;
1702 ret = bchannel_senddata(bch, skb);
1705 hfcpci_fill_fifo(bch);
1708 if (!test_bit(FLG_TRANSPARENT, &bch->Flags))
1715 if (!test_and_set_bit(FLG_ACTIVE, &bch->Flags))
1716 ret = mode_hfcpci(bch, bch->nr, ch->protocol);
1725 deactivate_bchannel(bch);
1748 mode_hfcpci(&hc->bch[0], 1, -1);
1749 mode_hfcpci(&hc->bch[1], 2, -1);
1964 struct bchannel *bch;
1970 bch = &hc->bch[rq->adr.channel - 1];
1971 if (test_and_set_bit(FLG_OPEN, &bch->Flags))
1973 test_and_clear_bit(FLG_FILLEMPTY, &bch->Flags);
1974 bch->ch.protocol = rq->protocol;
1975 rq->ch = &bch->ch; /* TODO: E-channel */
2084 mode_hfcpci(&hc->bch[0], 1, ISDN_P_NONE);
2085 mode_hfcpci(&hc->bch[1], 2, ISDN_P_NONE);
2097 mISDN_freebchannel(&hc->bch[1]);
2098 mISDN_freebchannel(&hc->bch[0]);
2122 card->bch[i].nr = i + 1;
2124 card->bch[i].debug = debug;
2125 mISDN_initbchannel(&card->bch[i], MAX_DATA_MEM);
2126 card->bch[i].hw = card;
2127 card->bch[i].ch.send = hfcpci_l2l1B;
2128 card->bch[i].ch.ctrl = hfc_bctrl;
2129 card->bch[i].ch.nr = i + 1;
2130 list_add(&card->bch[i].ch.list, &card->dch.dev.bchannels);
2143 mISDN_freebchannel(&card->bch[1]);
2144 mISDN_freebchannel(&card->bch[0]);
2296 struct bchannel *bch;
2302 bch = Sel_BCS(hc, hc->hw.bswapped ? 2 : 1);
2303 if (bch && bch->state == ISDN_P_B_RAW) { /* B1 rx&tx */
2304 main_rec_hfcpci(bch);
2305 tx_birq(bch);
2307 bch = Sel_BCS(hc, hc->hw.bswapped ? 1 : 2);
2308 if (bch && bch->state == ISDN_P_B_RAW) { /* B2 rx&tx */
2309 main_rec_hfcpci(bch);
2310 tx_birq(bch);