• Home
  • Raw
  • Download

Lines Matching refs:dch

1622 	struct dchannel *dch;  in hfcmulti_leds()  local
1637 dch = hc->chan[hc->dnum[0]].dch; in hfcmulti_leds()
1638 if (dch) { in hfcmulti_leds()
1682 dch = hc->chan[(i << 2) | 2].dch; in hfcmulti_leds()
1683 if (dch) { in hfcmulti_leds()
1684 state = dch->state; in hfcmulti_leds()
1685 if (dch->dev.D.protocol == ISDN_P_NT_S0) in hfcmulti_leds()
1746 dch = hc->chan[(i << 2) | 2].dch; in hfcmulti_leds()
1747 if (dch) { in hfcmulti_leds()
1748 state = dch->state; in hfcmulti_leds()
1749 if (dch->dev.D.protocol == ISDN_P_NT_S0) in hfcmulti_leds()
1793 dch = hc->chan[(i << 2) | 2].dch; in hfcmulti_leds()
1794 if (dch) { in hfcmulti_leds()
1795 state = dch->state; in hfcmulti_leds()
1796 if (dch->dev.D.protocol == ISDN_P_NT_S0) in hfcmulti_leds()
1954 struct dchannel *dch; in hfcmulti_tx() local
1959 dch = hc->chan[ch].dch; in hfcmulti_tx()
1960 if ((!dch) && (!bch)) in hfcmulti_tx()
1965 if (dch) { in hfcmulti_tx()
1966 if (!test_bit(FLG_ACTIVE, &dch->Flags)) in hfcmulti_tx()
1968 sp = &dch->tx_skb; in hfcmulti_tx()
1969 idxp = &dch->tx_idx; in hfcmulti_tx()
1999 if (dch || test_bit(FLG_HDLC, &bch->Flags)) { in hfcmulti_tx()
2025 if (hc->ctype != HFC_TYPE_E1 && dch) { in hfcmulti_tx()
2132 if (dch) in hfcmulti_tx()
2137 if (dch || test_bit(FLG_HDLC, &bch->Flags)) in hfcmulti_tx()
2163 if (dch || test_bit(FLG_HDLC, &bch->Flags)) { in hfcmulti_tx()
2175 if (dch && get_next_dframe(dch)) { in hfcmulti_tx()
2199 struct dchannel *dch = NULL; in hfcmulti_rx() local
2207 } else if (hc->chan[ch].dch) { in hfcmulti_rx()
2208 dch = hc->chan[ch].dch; in hfcmulti_rx()
2209 if (!test_bit(FLG_ACTIVE, &dch->Flags)) in hfcmulti_rx()
2233 if (dch || test_bit(FLG_HDLC, &bch->Flags)) { in hfcmulti_rx()
2253 if ((dch || test_bit(FLG_HDLC, &bch->Flags)) && f1 != f2) in hfcmulti_rx()
2272 sp = &dch->rx_skb; in hfcmulti_rx()
2273 maxlen = dch->maxlen + 3; in hfcmulti_rx()
2284 if (dch) in hfcmulti_rx()
2288 if (dch || test_bit(FLG_HDLC, &bch->Flags)) { in hfcmulti_rx()
2355 if (dch) in hfcmulti_rx()
2356 recv_Dchannel(dch); in hfcmulti_rx()
2382 signal_state_up(struct dchannel *dch, int info, char *msg) in signal_state_up() argument
2396 recv_Dchannel_skb(dch, skb); in signal_state_up()
2403 struct dchannel *dch; in handle_timer_irq() local
2443 if (hc->chan[ch].dch && in handle_timer_irq()
2445 dch = hc->chan[ch].dch; in handle_timer_irq()
2447 schedule_event(dch, in handle_timer_irq()
2455 dch->state); in handle_timer_irq()
2461 dch = hc->chan[hc->dnum[0]].dch; in handle_timer_irq()
2467 signal_state_up(dch, L1_SIGNAL_LOS_ON, in handle_timer_irq()
2470 signal_state_up(dch, L1_SIGNAL_LOS_OFF, in handle_timer_irq()
2477 signal_state_up(dch, L1_SIGNAL_AIS_ON, in handle_timer_irq()
2480 signal_state_up(dch, L1_SIGNAL_AIS_OFF, in handle_timer_irq()
2488 signal_state_up(dch, L1_SIGNAL_SLIP_RX, in handle_timer_irq()
2493 signal_state_up(dch, L1_SIGNAL_SLIP_TX, in handle_timer_irq()
2501 signal_state_up(dch, L1_SIGNAL_RDI_ON, in handle_timer_irq()
2504 signal_state_up(dch, L1_SIGNAL_RDI_OFF, in handle_timer_irq()
2579 struct dchannel *dch; in ph_state_irq() local
2586 if (hc->chan[ch].dch) { in ph_state_irq()
2587 dch = hc->chan[ch].dch; in ph_state_irq()
2607 dch->dev.D.protocol == ISDN_P_TE_S0) { in ph_state_irq()
2615 dch->state = st_status & 0x0f; in ph_state_irq()
2616 if (dch->dev.D.protocol == ISDN_P_NT_S0) in ph_state_irq()
2620 if (dch->state == active) { in ph_state_irq()
2627 dch->tx_idx = 0; in ph_state_irq()
2629 schedule_event(dch, FLG_PHCHANGE); in ph_state_irq()
2633 __func__, dch->state, in ph_state_irq()
2647 struct dchannel *dch; in fifo_irq() local
2655 dch = hc->chan[ch].dch; in fifo_irq()
2657 if (((!dch) && (!bch)) || (!hc->created[hc->chan[ch].port])) { in fifo_irq()
2661 if (dch && (r_irq_fifo_bl & (1 << j)) && in fifo_irq()
2662 test_bit(FLG_ACTIVE, &dch->Flags)) { in fifo_irq()
2676 if (dch && (r_irq_fifo_bl & (1 << j)) && in fifo_irq()
2677 test_bit(FLG_ACTIVE, &dch->Flags)) { in fifo_irq()
2699 struct dchannel *dch; in hfcmulti_interrupt() local
2779 dch = hc->chan[hc->dnum[0]].dch; in hfcmulti_interrupt()
2804 dch = hc->chan[hc->dnum[i]].dch; in hfcmulti_interrupt()
2805 dch->state = temp & 0x7; in hfcmulti_interrupt()
2806 schedule_event(dch, FLG_PHCHANGE); in hfcmulti_interrupt()
3234 hfcm_l1callback(struct dchannel *dch, u_int cmd) in hfcm_l1callback() argument
3236 struct hfc_multi *hc = dch->hw; in hfcm_l1callback()
3252 HFC_outb(hc, R_ST_SEL, hc->chan[dch->slot].port); in hfcm_l1callback()
3262 l1_event(dch->l1, HW_POWERUP_IND); in hfcm_l1callback()
3273 HFC_outb(hc, R_ST_SEL, hc->chan[dch->slot].port); in hfcm_l1callback()
3280 ~(1 << hc->chan[dch->slot].port); in hfcm_l1callback()
3284 skb_queue_purge(&dch->squeue); in hfcm_l1callback()
3285 if (dch->tx_skb) { in hfcm_l1callback()
3286 dev_kfree_skb(dch->tx_skb); in hfcm_l1callback()
3287 dch->tx_skb = NULL; in hfcm_l1callback()
3289 dch->tx_idx = 0; in hfcm_l1callback()
3290 if (dch->rx_skb) { in hfcm_l1callback()
3291 dev_kfree_skb(dch->rx_skb); in hfcm_l1callback()
3292 dch->rx_skb = NULL; in hfcm_l1callback()
3294 test_and_clear_bit(FLG_TX_BUSY, &dch->Flags); in hfcm_l1callback()
3295 if (test_and_clear_bit(FLG_BUSY_TIMER, &dch->Flags)) in hfcm_l1callback()
3296 del_timer(&dch->timer); in hfcm_l1callback()
3307 HFC_outb(hc, R_ST_SEL, hc->chan[dch->slot].port); in hfcm_l1callback()
3317 test_and_set_bit(FLG_ACTIVE, &dch->Flags); in hfcm_l1callback()
3318 _queue_data(&dch->dev.D, cmd, MISDN_ID_ANY, 0, NULL, in hfcm_l1callback()
3322 test_and_clear_bit(FLG_ACTIVE, &dch->Flags); in hfcm_l1callback()
3323 _queue_data(&dch->dev.D, cmd, MISDN_ID_ANY, 0, NULL, in hfcm_l1callback()
3327 if (dch->debug & DEBUG_HW) in hfcm_l1callback()
3343 struct dchannel *dch = container_of(dev, struct dchannel, dev); in handle_dmsg() local
3344 struct hfc_multi *hc = dch->hw; in handle_dmsg()
3355 ret = dchannel_senddata(dch, skb); in handle_dmsg()
3358 hfcmulti_tx(hc, dch->slot); in handle_dmsg()
3369 if (dch->dev.D.protocol != ISDN_P_TE_S0) { in handle_dmsg()
3375 __func__, hc->chan[dch->slot].port, in handle_dmsg()
3379 ph_state_change(dch); in handle_dmsg()
3383 __func__, dch->state); in handle_dmsg()
3386 hc->chan[dch->slot].port); in handle_dmsg()
3395 dch->state = 1; in handle_dmsg()
3399 ret = l1_event(dch->l1, hh->prim); in handle_dmsg()
3402 test_and_clear_bit(FLG_L2_ACTIVATED, &dch->Flags); in handle_dmsg()
3403 if (dch->dev.D.protocol != ISDN_P_TE_S0) { in handle_dmsg()
3408 __func__, hc->chan[dch->slot].port, in handle_dmsg()
3418 hc->chan[dch->slot].port); in handle_dmsg()
3423 dch->state = 1; in handle_dmsg()
3425 skb_queue_purge(&dch->squeue); in handle_dmsg()
3426 if (dch->tx_skb) { in handle_dmsg()
3427 dev_kfree_skb(dch->tx_skb); in handle_dmsg()
3428 dch->tx_skb = NULL; in handle_dmsg()
3430 dch->tx_idx = 0; in handle_dmsg()
3431 if (dch->rx_skb) { in handle_dmsg()
3432 dev_kfree_skb(dch->rx_skb); in handle_dmsg()
3433 dch->rx_skb = NULL; in handle_dmsg()
3435 test_and_clear_bit(FLG_TX_BUSY, &dch->Flags); in handle_dmsg()
3436 if (test_and_clear_bit(FLG_BUSY_TIMER, &dch->Flags)) in handle_dmsg()
3437 del_timer(&dch->timer); in handle_dmsg()
3439 if (test_and_clear_bit(FLG_L1_BUSY, &dch->Flags)) in handle_dmsg()
3440 dchannel_sched_event(&hc->dch, D_CLEARBUSY); in handle_dmsg()
3445 ret = l1_event(dch->l1, hh->prim); in handle_dmsg()
3733 ph_state_change(struct dchannel *dch) in ph_state_change() argument
3738 if (!dch) { in ph_state_change()
3742 hc = dch->hw; in ph_state_change()
3743 ch = dch->slot; in ph_state_change()
3746 if (dch->dev.D.protocol == ISDN_P_TE_E1) { in ph_state_change()
3750 __func__, hc->id, dch->state); in ph_state_change()
3755 __func__, hc->id, dch->state); in ph_state_change()
3757 switch (dch->state) { in ph_state_change()
3770 test_and_set_bit(FLG_ACTIVE, &dch->Flags); in ph_state_change()
3771 _queue_data(&dch->dev.D, PH_ACTIVATE_IND, in ph_state_change()
3778 test_and_clear_bit(FLG_ACTIVE, &dch->Flags); in ph_state_change()
3779 _queue_data(&dch->dev.D, PH_DEACTIVATE_IND, in ph_state_change()
3782 hc->e1_state = dch->state; in ph_state_change()
3784 if (dch->dev.D.protocol == ISDN_P_TE_S0) { in ph_state_change()
3788 __func__, dch->state); in ph_state_change()
3789 switch (dch->state) { in ph_state_change()
3791 l1_event(dch->l1, HW_RESET_IND); in ph_state_change()
3794 l1_event(dch->l1, HW_DEACT_IND); in ph_state_change()
3798 l1_event(dch->l1, ANYSIGNAL); in ph_state_change()
3801 l1_event(dch->l1, INFO2); in ph_state_change()
3804 l1_event(dch->l1, INFO4_P8); in ph_state_change()
3810 __func__, dch->state); in ph_state_change()
3811 switch (dch->state) { in ph_state_change()
3823 dch->state = 4; in ph_state_change()
3839 test_and_clear_bit(FLG_ACTIVE, &dch->Flags); in ph_state_change()
3840 _queue_data(&dch->dev.D, PH_DEACTIVATE_IND, in ph_state_change()
3848 test_and_set_bit(FLG_ACTIVE, &dch->Flags); in ph_state_change()
3849 _queue_data(&dch->dev.D, PH_ACTIVATE_IND, in ph_state_change()
3862 hfcmulti_initmode(struct dchannel *dch) in hfcmulti_initmode() argument
3864 struct hfc_multi *hc = dch->hw; in hfcmulti_initmode()
3871 i = dch->slot; in hfcmulti_initmode()
3879 mode_hfcmulti(hc, dch->slot, dch->dev.D.protocol, in hfcmulti_initmode()
3881 dch->timer.function = (void *) hfcmulti_dbusy_timer; in hfcmulti_initmode()
3882 dch->timer.data = (long) dch; in hfcmulti_initmode()
3883 init_timer(&dch->timer); in hfcmulti_initmode()
3896 dch = hc->chan[hc->dnum[0]].dch; in hfcmulti_initmode()
3922 if (dch->dev.D.protocol == ISDN_P_NT_E1) { in hfcmulti_initmode()
3988 mode_hfcmulti(hc, i, dch->dev.D.protocol, -1, 0, -1, 0); in hfcmulti_initmode()
3989 dch->timer.function = (void *) hfcmulti_dbusy_timer; in hfcmulti_initmode()
3990 dch->timer.data = (long) dch; in hfcmulti_initmode()
3991 init_timer(&dch->timer); in hfcmulti_initmode()
4004 if (dch->dev.D.protocol == ISDN_P_NT_S0) { in hfcmulti_initmode()
4033 if ((dch->dev.D.protocol == ISDN_P_NT_S0) || in hfcmulti_initmode()
4050 ~(1 << hc->chan[dch->slot].port); in hfcmulti_initmode()
4060 open_dchannel(struct hfc_multi *hc, struct dchannel *dch, in open_dchannel() argument
4068 dch->dev.id, __builtin_return_address(0)); in open_dchannel()
4071 if ((dch->dev.D.protocol != ISDN_P_NONE) && in open_dchannel()
4072 (dch->dev.D.protocol != rq->protocol)) { in open_dchannel()
4075 __func__, dch->dev.D.protocol, rq->protocol); in open_dchannel()
4077 if ((dch->dev.D.protocol == ISDN_P_TE_S0) && in open_dchannel()
4079 l1_event(dch->l1, CLOSE_CHANNEL); in open_dchannel()
4080 if (dch->dev.D.protocol != rq->protocol) { in open_dchannel()
4082 err = create_l1(dch, hfcm_l1callback); in open_dchannel()
4086 dch->dev.D.protocol = rq->protocol; in open_dchannel()
4088 hfcmulti_initmode(dch); in open_dchannel()
4091 if (test_bit(FLG_ACTIVE, &dch->Flags)) in open_dchannel()
4092 _queue_data(&dch->dev.D, PH_ACTIVATE_IND, MISDN_ID_ANY, in open_dchannel()
4094 rq->ch = &dch->dev.D; in open_dchannel()
4101 open_bchannel(struct hfc_multi *hc, struct dchannel *dch, in open_bchannel() argument
4107 if (!test_channelmap(rq->adr.channel, dch->dev.channelmap)) in open_bchannel()
4114 ch = (rq->adr.channel - 1) + (dch->slot - 2); in open_bchannel()
4135 channel_dctrl(struct dchannel *dch, struct mISDN_ctrl_req *cq) in channel_dctrl() argument
4137 struct hfc_multi *hc = dch->hw; in channel_dctrl()
4174 ret = l1_event(dch->l1, HW_TIMER3_VALUE | (cq->p1 & 0xff)); in channel_dctrl()
4189 struct dchannel *dch = container_of(dev, struct dchannel, dev); in hfcm_dctrl() local
4190 struct hfc_multi *hc = dch->hw; in hfcm_dctrl()
4195 if (dch->debug & DEBUG_HW) in hfcm_dctrl()
4208 err = open_dchannel(hc, dch, rq); /* locked there */ in hfcm_dctrl()
4216 err = open_dchannel(hc, dch, rq); /* locked there */ in hfcm_dctrl()
4220 err = open_bchannel(hc, dch, rq); in hfcm_dctrl()
4227 __func__, dch->dev.id, in hfcm_dctrl()
4233 err = channel_dctrl(dch, arg); in hfcm_dctrl()
4237 if (dch->debug & DEBUG_HW) in hfcm_dctrl()
4531 release_port(struct hfc_multi *hc, struct dchannel *dch) in release_port() argument
4537 ci = dch->slot; in release_port()
4554 if (dch->dev.D.protocol == ISDN_P_TE_S0) in release_port()
4555 l1_event(dch->l1, CLOSE_CHANNEL); in release_port()
4557 hc->chan[ci].dch = NULL; in release_port()
4561 mISDN_unregister_device(&dch->dev); in release_port()
4566 if (dch->timer.function) { in release_port()
4567 del_timer(&dch->timer); in release_port()
4568 dch->timer.function = NULL; in release_port()
4638 mISDN_freedchannel(dch); in release_port()
4639 kfree(dch); in release_port()
4678 if (hc->chan[ch].dch) in release_card()
4679 release_port(hc, hc->chan[ch].dch); in release_card()
4816 struct dchannel *dch; in init_e1_port() local
4822 dch = kzalloc(sizeof(struct dchannel), GFP_KERNEL); in init_e1_port()
4823 if (!dch) in init_e1_port()
4825 dch->debug = debug; in init_e1_port()
4826 mISDN_initdchannel(dch, MAX_DFRAME_LEN_L1, ph_state_change); in init_e1_port()
4827 dch->hw = hc; in init_e1_port()
4828 dch->dev.Dprotocols = (1 << ISDN_P_TE_E1) | (1 << ISDN_P_NT_E1); in init_e1_port()
4829 dch->dev.Bprotocols = (1 << (ISDN_P_B_RAW & ISDN_P_B_MASK)) | in init_e1_port()
4831 dch->dev.D.send = handle_dmsg; in init_e1_port()
4832 dch->dev.D.ctrl = hfcm_dctrl; in init_e1_port()
4833 dch->slot = hc->dnum[pt]; in init_e1_port()
4834 hc->chan[hc->dnum[pt]].dch = dch; in init_e1_port()
4863 list_add(&bch->ch.list, &dch->dev.bchannels); in init_e1_port()
4866 set_channelmap(bch->nr, dch->dev.channelmap); in init_e1_port()
4869 dch->dev.nrbchan = bcount; in init_e1_port()
4877 ret = mISDN_register_device(&dch->dev, &hc->pci_dev->dev, name); in init_e1_port()
4883 release_port(hc, dch); in init_e1_port()
4890 struct dchannel *dch; in init_multi_port() local
4895 dch = kzalloc(sizeof(struct dchannel), GFP_KERNEL); in init_multi_port()
4896 if (!dch) in init_multi_port()
4898 dch->debug = debug; in init_multi_port()
4899 mISDN_initdchannel(dch, MAX_DFRAME_LEN_L1, ph_state_change); in init_multi_port()
4900 dch->hw = hc; in init_multi_port()
4901 dch->dev.Dprotocols = (1 << ISDN_P_TE_S0) | (1 << ISDN_P_NT_S0); in init_multi_port()
4902 dch->dev.Bprotocols = (1 << (ISDN_P_B_RAW & ISDN_P_B_MASK)) | in init_multi_port()
4904 dch->dev.D.send = handle_dmsg; in init_multi_port()
4905 dch->dev.D.ctrl = hfcm_dctrl; in init_multi_port()
4906 dch->dev.nrbchan = 2; in init_multi_port()
4908 dch->slot = i + 2; in init_multi_port()
4909 hc->chan[i + 2].dch = dch; in init_multi_port()
4912 for (ch = 0; ch < dch->dev.nrbchan; ch++) { in init_multi_port()
4936 list_add(&bch->ch.list, &dch->dev.bchannels); in init_multi_port()
4939 set_channelmap(bch->nr, dch->dev.channelmap); in init_multi_port()
4948 if (dch->dev.D.protocol != ISDN_P_TE_S0) { in init_multi_port()
4989 ret = mISDN_register_device(&dch->dev, NULL, name); in init_multi_port()
4993 ret = mISDN_register_device(&dch->dev, &hc->pci_dev->dev, name); in init_multi_port()
5000 release_port(hc, dch); in init_multi_port()
5176 hc->chan[hc->dnum[pt]].dch); in hfcmulti_init()
5179 hc->chan[(pt << 2) + 2].dch); in hfcmulti_init()