Lines Matching defs:dch
133 struct dchannel dch;
454 struct dchannel *dch = &hc->dch;
469 if (dch->debug & DEBUG_HW_DCHANNEL)
479 if (dch->debug & DEBUG_HW)
494 dch->rx_skb = mI_alloc_skb(rcnt - 3, GFP_ATOMIC);
495 if (!dch->rx_skb) {
502 ptr = skb_put(dch->rx_skb, rcnt);
524 recv_Dchannel(dch);
664 struct dchannel *dch = &hc->dch;
670 if ((dch->debug & DEBUG_HW_DCHANNEL) && !(dch->debug & DEBUG_HW_DFIFO))
673 if (!dch->tx_skb)
675 count = dch->tx_skb->len - dch->tx_idx;
680 if (dch->debug & DEBUG_HW_DFIFO)
688 if (dch->debug & DEBUG_HW_DCHANNEL)
702 if (dch->debug & DEBUG_HW_DCHANNEL)
706 if (dch->debug & DEBUG_HW_DCHANNEL)
713 src = dch->tx_skb->data + dch->tx_idx; /* source pointer */
732 dch->tx_idx = dch->tx_skb->len;
909 ph_state_te(struct dchannel *dch)
911 if (dch->debug)
913 __func__, dch->state);
914 switch (dch->state) {
916 l1_event(dch->l1, HW_RESET_IND);
919 l1_event(dch->l1, HW_DEACT_IND);
923 l1_event(dch->l1, ANYSIGNAL);
926 l1_event(dch->l1, INFO2);
929 l1_event(dch->l1, INFO4_P8);
939 handle_nt_timer3(struct dchannel *dch) {
940 struct hfc_pci *hc = dch->hw;
942 test_and_clear_bit(FLG_HFC_TIMER_T3, &dch->Flags);
946 test_and_set_bit(FLG_ACTIVE, &dch->Flags);
950 _queue_data(&dch->dev.D, PH_ACTIVATE_IND,
955 ph_state_nt(struct dchannel *dch)
957 struct hfc_pci *hc = dch->hw;
959 if (dch->debug)
961 __func__, dch->state);
962 switch (dch->state) {
966 test_and_clear_bit(FLG_HFC_TIMER_T3, &dch->Flags);
967 test_and_clear_bit(FLG_HFC_TIMER_T1, &dch->Flags);
975 dch->state = 4;
984 test_and_clear_bit(FLG_HFC_TIMER_T3, &dch->Flags);
985 test_and_set_bit(FLG_HFC_TIMER_T1, &dch->Flags);
994 test_and_clear_bit(FLG_HFC_TIMER_T3, &dch->Flags);
995 test_and_clear_bit(FLG_HFC_TIMER_T1, &dch->Flags);
998 test_and_clear_bit(FLG_ACTIVE, &dch->Flags);
1001 test_and_clear_bit(FLG_L2_ACTIVATED, &dch->Flags);
1002 _queue_data(&dch->dev.D, PH_DEACTIVATE_IND,
1007 test_and_clear_bit(FLG_HFC_TIMER_T3, &dch->Flags);
1008 test_and_clear_bit(FLG_HFC_TIMER_T1, &dch->Flags);
1013 if (!test_and_set_bit(FLG_HFC_TIMER_T3, &dch->Flags)) {
1015 &dch->Flags)) {
1016 handle_nt_timer3(dch);
1019 test_and_clear_bit(FLG_HFC_TIMER_T1, &dch->Flags);
1033 ph_state(struct dchannel *dch)
1035 struct hfc_pci *hc = dch->hw;
1038 if (test_bit(FLG_HFC_TIMER_T3, &dch->Flags) &&
1040 handle_nt_timer3(dch);
1042 ph_state_nt(dch);
1044 ph_state_te(dch);
1051 hfc_l1callback(struct dchannel *dch, u_int cmd)
1053 struct hfc_pci *hc = dch->hw;
1072 l1_event(dch->l1, HW_POWERUP_IND);
1077 skb_queue_purge(&dch->squeue);
1078 if (dch->tx_skb) {
1079 dev_kfree_skb(dch->tx_skb);
1080 dch->tx_skb = NULL;
1082 dch->tx_idx = 0;
1083 if (dch->rx_skb) {
1084 dev_kfree_skb(dch->rx_skb);
1085 dch->rx_skb = NULL;
1087 test_and_clear_bit(FLG_TX_BUSY, &dch->Flags);
1088 if (test_and_clear_bit(FLG_BUSY_TIMER, &dch->Flags))
1089 del_timer(&dch->timer);
1095 test_and_set_bit(FLG_ACTIVE, &dch->Flags);
1096 _queue_data(&dch->dev.D, cmd, MISDN_ID_ANY, 0, NULL,
1100 test_and_clear_bit(FLG_ACTIVE, &dch->Flags);
1101 _queue_data(&dch->dev.D, cmd, MISDN_ID_ANY, 0, NULL,
1105 if (dch->debug & DEBUG_HW)
1129 tx_dirq(struct dchannel *dch)
1131 if (dch->tx_skb && dch->tx_idx < dch->tx_skb->len)
1132 hfcpci_fill_dfifo(dch->hw);
1134 dev_kfree_skb(dch->tx_skb);
1135 if (get_next_dframe(dch))
1136 hfcpci_fill_dfifo(dch->hw);
1156 if (hc->dch.debug & DEBUG_HW_DCHANNEL)
1166 if (hc->dch.debug & DEBUG_HW_DCHANNEL)
1171 if (hc->dch.debug & DEBUG_HW_DCHANNEL)
1173 hc->dch.state, exval);
1174 hc->dch.state = exval;
1175 schedule_event(&hc->dch, FLG_PHCHANGE);
1181 schedule_event(&hc->dch, FLG_PHCHANGE);
1190 else if (hc->dch.debug)
1197 else if (hc->dch.debug)
1204 else if (hc->dch.debug)
1211 else if (hc->dch.debug)
1217 if (test_and_clear_bit(FLG_BUSY_TIMER, &hc->dch.Flags))
1218 del_timer(&hc->dch.timer);
1219 tx_dirq(&hc->dch);
1576 struct dchannel *dch = container_of(dev, struct dchannel, dev);
1577 struct hfc_pci *hc = dch->hw;
1586 ret = dchannel_senddata(dch, skb);
1589 hfcpci_fill_dfifo(dch->hw);
1603 if (test_bit(FLG_ACTIVE, &dch->Flags)) {
1605 _queue_data(&dch->dev.D, PH_ACTIVATE_IND,
1609 test_and_set_bit(FLG_L2_ACTIVATED, &dch->Flags);
1613 ret = l1_event(dch->l1, hh->prim);
1617 test_and_clear_bit(FLG_L2_ACTIVATED, &dch->Flags);
1625 skb_queue_splice_init(&dch->squeue, &free_queue);
1626 if (dch->tx_skb) {
1627 __skb_queue_tail(&free_queue, dch->tx_skb);
1628 dch->tx_skb = NULL;
1630 dch->tx_idx = 0;
1631 if (dch->rx_skb) {
1632 __skb_queue_tail(&free_queue, dch->rx_skb);
1633 dch->rx_skb = NULL;
1635 test_and_clear_bit(FLG_TX_BUSY, &dch->Flags);
1636 if (test_and_clear_bit(FLG_BUSY_TIMER, &dch->Flags))
1637 del_timer(&dch->timer);
1639 if (test_and_clear_bit(FLG_L1_BUSY, &dch->Flags))
1640 dchannel_sched_event(&hc->dch, D_CLEARBUSY);
1648 ret = l1_event(dch->l1, hh->prim);
1711 timer_setup(&hc->dch.timer, hfcpci_dbusy_timer, 0);
1866 ret = l1_event(hc->dch.l1, HW_TIMER3_VALUE | (cq->p1 & 0xff));
1885 hc->dch.dev.id, __builtin_return_address(0));
1894 err = create_l1(&hc->dch, hfc_l1callback);
1906 l1_event(hc->dch.l1, CLOSE_CHANNEL);
1908 err = create_l1(&hc->dch, hfc_l1callback);
1918 if (((ch->protocol == ISDN_P_NT_S0) && (hc->dch.state == 3)) ||
1919 ((ch->protocol == ISDN_P_TE_S0) && (hc->dch.state == 7))) {
1955 struct dchannel *dch = container_of(dev, struct dchannel, dev);
1956 struct hfc_pci *hc = dch->hw;
1960 if (dch->debug & DEBUG_HW)
1975 __func__, hc->dch.dev.id,
1983 if (dch->debug & DEBUG_HW)
1998 hc->dch.state = 0;
2065 if (hc->dch.timer.function != NULL) {
2066 del_timer(&hc->dch.timer);
2067 hc->dch.timer.function = NULL;
2071 l1_event(hc->dch.l1, CLOSE_CHANNEL);
2075 mISDN_unregister_device(&hc->dch.dev);
2078 mISDN_freedchannel(&hc->dch);
2090 card->dch.debug = debug;
2092 mISDN_initdchannel(&card->dch, MAX_DFRAME_LEN_L1, ph_state);
2093 card->dch.hw = card;
2094 card->dch.dev.Dprotocols = (1 << ISDN_P_TE_S0) | (1 << ISDN_P_NT_S0);
2095 card->dch.dev.Bprotocols = (1 << (ISDN_P_B_RAW & ISDN_P_B_MASK)) |
2097 card->dch.dev.D.send = hfcpci_l2l1D;
2098 card->dch.dev.D.ctrl = hfc_dctrl;
2099 card->dch.dev.nrbchan = 2;
2102 set_channelmap(i + 1, card->dch.dev.channelmap);
2109 list_add(&card->bch[i].ch.list, &card->dch.dev.bchannels);
2115 err = mISDN_register_device(&card->dch.dev, &card->pdev->dev, name);
2124 mISDN_freedchannel(&card->dch);