Lines Matching refs:dch

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