Lines Matching refs:dch
1577 struct dchannel *dch;
1592 dch = hc->chan[hc->dnum[0]].dch;
1593 if (dch) {
1637 dch = hc->chan[(i << 2) | 2].dch;
1638 if (dch) {
1639 state = dch->state;
1640 if (dch->dev.D.protocol == ISDN_P_NT_S0)
1701 dch = hc->chan[(i << 2) | 2].dch;
1702 if (dch) {
1703 state = dch->state;
1704 if (dch->dev.D.protocol == ISDN_P_NT_S0)
1748 dch = hc->chan[(i << 2) | 2].dch;
1749 if (dch) {
1750 state = dch->state;
1751 if (dch->dev.D.protocol == ISDN_P_NT_S0)
1909 struct dchannel *dch;
1914 dch = hc->chan[ch].dch;
1915 if ((!dch) && (!bch))
1920 if (dch) {
1921 if (!test_bit(FLG_ACTIVE, &dch->Flags))
1923 sp = &dch->tx_skb;
1924 idxp = &dch->tx_idx;
1954 if (dch || test_bit(FLG_HDLC, &bch->Flags)) {
1980 if (hc->ctype != HFC_TYPE_E1 && dch) {
2087 if (dch)
2092 if (dch || test_bit(FLG_HDLC, &bch->Flags))
2118 if (dch || test_bit(FLG_HDLC, &bch->Flags)) {
2130 if (dch && get_next_dframe(dch)) {
2154 struct dchannel *dch = NULL;
2162 } else if (hc->chan[ch].dch) {
2163 dch = hc->chan[ch].dch;
2164 if (!test_bit(FLG_ACTIVE, &dch->Flags))
2188 if (dch || test_bit(FLG_HDLC, &bch->Flags)) {
2208 if ((dch || test_bit(FLG_HDLC, &bch->Flags)) && f1 != f2)
2227 sp = &dch->rx_skb;
2228 maxlen = dch->maxlen + 3;
2232 pr_warn("card%d: No mem for dch rx_skb\n",
2239 if (dch)
2243 if (dch || test_bit(FLG_HDLC, &bch->Flags)) {
2309 if (dch)
2310 recv_Dchannel(dch);
2336 signal_state_up(struct dchannel *dch, int info, char *msg)
2350 recv_Dchannel_skb(dch, skb);
2357 struct dchannel *dch;
2397 if (hc->chan[ch].dch &&
2399 dch = hc->chan[ch].dch;
2401 schedule_event(dch,
2409 dch->state);
2415 dch = hc->chan[hc->dnum[0]].dch;
2421 signal_state_up(dch, L1_SIGNAL_LOS_ON,
2424 signal_state_up(dch, L1_SIGNAL_LOS_OFF,
2431 signal_state_up(dch, L1_SIGNAL_AIS_ON,
2434 signal_state_up(dch, L1_SIGNAL_AIS_OFF,
2442 signal_state_up(dch, L1_SIGNAL_SLIP_RX,
2447 signal_state_up(dch, L1_SIGNAL_SLIP_TX,
2455 signal_state_up(dch, L1_SIGNAL_RDI_ON,
2458 signal_state_up(dch, L1_SIGNAL_RDI_OFF,
2533 struct dchannel *dch;
2540 if (hc->chan[ch].dch) {
2541 dch = hc->chan[ch].dch;
2561 dch->dev.D.protocol == ISDN_P_TE_S0) {
2569 dch->state = st_status & 0x0f;
2570 if (dch->dev.D.protocol == ISDN_P_NT_S0)
2574 if (dch->state == active) {
2581 dch->tx_idx = 0;
2583 schedule_event(dch, FLG_PHCHANGE);
2587 __func__, dch->state,
2601 struct dchannel *dch;
2609 dch = hc->chan[ch].dch;
2611 if (((!dch) && (!bch)) || (!hc->created[hc->chan[ch].port])) {
2615 if (dch && (r_irq_fifo_bl & (1 << j)) &&
2616 test_bit(FLG_ACTIVE, &dch->Flags)) {
2630 if (dch && (r_irq_fifo_bl & (1 << j)) &&
2631 test_bit(FLG_ACTIVE, &dch->Flags)) {
2653 struct dchannel *dch;
2731 dch = hc->chan[hc->dnum[0]].dch;
2756 dch = hc->chan[hc->dnum[i]].dch;
2757 dch->state = temp & 0x7;
2758 schedule_event(dch, FLG_PHCHANGE);
3186 hfcm_l1callback(struct dchannel *dch, u_int cmd)
3188 struct hfc_multi *hc = dch->hw;
3205 HFC_outb(hc, R_ST_SEL, hc->chan[dch->slot].port);
3215 l1_event(dch->l1, HW_POWERUP_IND);
3227 HFC_outb(hc, R_ST_SEL, hc->chan[dch->slot].port);
3234 ~(1 << hc->chan[dch->slot].port);
3238 skb_queue_splice_init(&dch->squeue, &free_queue);
3239 if (dch->tx_skb) {
3240 __skb_queue_tail(&free_queue, dch->tx_skb);
3241 dch->tx_skb = NULL;
3243 dch->tx_idx = 0;
3244 if (dch->rx_skb) {
3245 __skb_queue_tail(&free_queue, dch->rx_skb);
3246 dch->rx_skb = NULL;
3248 test_and_clear_bit(FLG_TX_BUSY, &dch->Flags);
3249 if (test_and_clear_bit(FLG_BUSY_TIMER, &dch->Flags))
3250 del_timer(&dch->timer);
3262 HFC_outb(hc, R_ST_SEL, hc->chan[dch->slot].port);
3272 test_and_set_bit(FLG_ACTIVE, &dch->Flags);
3273 _queue_data(&dch->dev.D, cmd, MISDN_ID_ANY, 0, NULL,
3277 test_and_clear_bit(FLG_ACTIVE, &dch->Flags);
3278 _queue_data(&dch->dev.D, cmd, MISDN_ID_ANY, 0, NULL,
3282 if (dch->debug & DEBUG_HW)
3298 struct dchannel *dch = container_of(dev, struct dchannel, dev);
3299 struct hfc_multi *hc = dch->hw;
3310 ret = dchannel_senddata(dch, skb);
3313 hfcmulti_tx(hc, dch->slot);
3324 if (dch->dev.D.protocol != ISDN_P_TE_S0) {
3330 __func__, hc->chan[dch->slot].port,
3334 ph_state_change(dch);
3338 __func__, dch->state);
3341 hc->chan[dch->slot].port);
3350 dch->state = 1;
3354 ret = l1_event(dch->l1, hh->prim);
3357 test_and_clear_bit(FLG_L2_ACTIVATED, &dch->Flags);
3358 if (dch->dev.D.protocol != ISDN_P_TE_S0) {
3366 __func__, hc->chan[dch->slot].port,
3376 hc->chan[dch->slot].port);
3381 dch->state = 1;
3383 skb_queue_splice_init(&dch->squeue, &free_queue);
3384 if (dch->tx_skb) {
3385 __skb_queue_tail(&free_queue, dch->tx_skb);
3386 dch->tx_skb = NULL;
3388 dch->tx_idx = 0;
3389 if (dch->rx_skb) {
3390 __skb_queue_tail(&free_queue, dch->rx_skb);
3391 dch->rx_skb = NULL;
3393 test_and_clear_bit(FLG_TX_BUSY, &dch->Flags);
3394 if (test_and_clear_bit(FLG_BUSY_TIMER, &dch->Flags))
3395 del_timer(&dch->timer);
3397 if (test_and_clear_bit(FLG_L1_BUSY, &dch->Flags))
3398 dchannel_sched_event(&hc->dch, D_CLEARBUSY);
3404 ret = l1_event(dch->l1, hh->prim);
3692 ph_state_change(struct dchannel *dch)
3697 if (!dch) {
3698 printk(KERN_WARNING "%s: ERROR given dch is NULL\n", __func__);
3701 hc = dch->hw;
3702 ch = dch->slot;
3705 if (dch->dev.D.protocol == ISDN_P_TE_E1) {
3709 __func__, hc->id, dch->state);
3714 __func__, hc->id, dch->state);
3716 switch (dch->state) {
3729 test_and_set_bit(FLG_ACTIVE, &dch->Flags);
3730 _queue_data(&dch->dev.D, PH_ACTIVATE_IND,
3737 test_and_clear_bit(FLG_ACTIVE, &dch->Flags);
3738 _queue_data(&dch->dev.D, PH_DEACTIVATE_IND,
3741 hc->e1_state = dch->state;
3743 if (dch->dev.D.protocol == ISDN_P_TE_S0) {
3747 __func__, dch->state);
3748 switch (dch->state) {
3750 l1_event(dch->l1, HW_RESET_IND);
3753 l1_event(dch->l1, HW_DEACT_IND);
3757 l1_event(dch->l1, ANYSIGNAL);
3760 l1_event(dch->l1, INFO2);
3763 l1_event(dch->l1, INFO4_P8);
3769 __func__, dch->state);
3770 switch (dch->state) {
3782 dch->state = 4;
3798 test_and_clear_bit(FLG_ACTIVE, &dch->Flags);
3799 _queue_data(&dch->dev.D, PH_DEACTIVATE_IND,
3807 test_and_set_bit(FLG_ACTIVE, &dch->Flags);
3808 _queue_data(&dch->dev.D, PH_ACTIVATE_IND,
3821 hfcmulti_initmode(struct dchannel *dch)
3823 struct hfc_multi *hc = dch->hw;
3830 i = dch->slot;
3838 mode_hfcmulti(hc, dch->slot, dch->dev.D.protocol,
3840 timer_setup(&dch->timer, hfcmulti_dbusy_timer, 0);
3853 dch = hc->chan[hc->dnum[0]].dch;
3879 if (dch->dev.D.protocol == ISDN_P_NT_E1) {
3945 mode_hfcmulti(hc, i, dch->dev.D.protocol, -1, 0, -1, 0);
3946 timer_setup(&dch->timer, hfcmulti_dbusy_timer, 0);
3959 if (dch->dev.D.protocol == ISDN_P_NT_S0) {
3988 if ((dch->dev.D.protocol == ISDN_P_NT_S0) ||
4005 ~(1 << hc->chan[dch->slot].port);
4015 open_dchannel(struct hfc_multi *hc, struct dchannel *dch,
4023 dch->dev.id, __builtin_return_address(0));
4026 if ((dch->dev.D.protocol != ISDN_P_NONE) &&
4027 (dch->dev.D.protocol != rq->protocol)) {
4030 __func__, dch->dev.D.protocol, rq->protocol);
4032 if ((dch->dev.D.protocol == ISDN_P_TE_S0) &&
4034 l1_event(dch->l1, CLOSE_CHANNEL);
4035 if (dch->dev.D.protocol != rq->protocol) {
4037 err = create_l1(dch, hfcm_l1callback);
4041 dch->dev.D.protocol = rq->protocol;
4043 hfcmulti_initmode(dch);
4046 if (test_bit(FLG_ACTIVE, &dch->Flags))
4047 _queue_data(&dch->dev.D, PH_ACTIVATE_IND, MISDN_ID_ANY,
4049 rq->ch = &dch->dev.D;
4056 open_bchannel(struct hfc_multi *hc, struct dchannel *dch,
4062 if (!test_channelmap(rq->adr.channel, dch->dev.channelmap))
4069 ch = (rq->adr.channel - 1) + (dch->slot - 2);
4090 channel_dctrl(struct dchannel *dch, struct mISDN_ctrl_req *cq)
4092 struct hfc_multi *hc = dch->hw;
4129 ret = l1_event(dch->l1, HW_TIMER3_VALUE | (cq->p1 & 0xff));
4144 struct dchannel *dch = container_of(dev, struct dchannel, dev);
4145 struct hfc_multi *hc = dch->hw;
4150 if (dch->debug & DEBUG_HW)
4163 err = open_dchannel(hc, dch, rq); /* locked there */
4171 err = open_dchannel(hc, dch, rq); /* locked there */
4175 err = open_bchannel(hc, dch, rq);
4182 __func__, dch->dev.id,
4188 err = channel_dctrl(dch, arg);
4192 if (dch->debug & DEBUG_HW)
4487 release_port(struct hfc_multi *hc, struct dchannel *dch)
4493 ci = dch->slot;
4510 if (dch->dev.D.protocol == ISDN_P_TE_S0)
4511 l1_event(dch->l1, CLOSE_CHANNEL);
4513 hc->chan[ci].dch = NULL;
4517 mISDN_unregister_device(&dch->dev);
4522 if (dch->timer.function) {
4523 del_timer(&dch->timer);
4524 dch->timer.function = NULL;
4594 mISDN_freedchannel(dch);
4595 kfree(dch);
4634 if (hc->chan[ch].dch)
4635 release_port(hc, hc->chan[ch].dch);
4772 struct dchannel *dch;
4778 dch = kzalloc(sizeof(struct dchannel), GFP_KERNEL);
4779 if (!dch)
4781 dch->debug = debug;
4782 mISDN_initdchannel(dch, MAX_DFRAME_LEN_L1, ph_state_change);
4783 dch->hw = hc;
4784 dch->dev.Dprotocols = (1 << ISDN_P_TE_E1) | (1 << ISDN_P_NT_E1);
4785 dch->dev.Bprotocols = (1 << (ISDN_P_B_RAW & ISDN_P_B_MASK)) |
4787 dch->dev.D.send = handle_dmsg;
4788 dch->dev.D.ctrl = hfcm_dctrl;
4789 dch->slot = hc->dnum[pt];
4790 hc->chan[hc->dnum[pt]].dch = dch;
4819 list_add(&bch->ch.list, &dch->dev.bchannels);
4822 set_channelmap(bch->nr, dch->dev.channelmap);
4825 dch->dev.nrbchan = bcount;
4833 ret = mISDN_register_device(&dch->dev, &hc->pci_dev->dev, name);
4839 release_port(hc, dch);
4846 struct dchannel *dch;
4851 dch = kzalloc(sizeof(struct dchannel), GFP_KERNEL);
4852 if (!dch)
4854 dch->debug = debug;
4855 mISDN_initdchannel(dch, MAX_DFRAME_LEN_L1, ph_state_change);
4856 dch->hw = hc;
4857 dch->dev.Dprotocols = (1 << ISDN_P_TE_S0) | (1 << ISDN_P_NT_S0);
4858 dch->dev.Bprotocols = (1 << (ISDN_P_B_RAW & ISDN_P_B_MASK)) |
4860 dch->dev.D.send = handle_dmsg;
4861 dch->dev.D.ctrl = hfcm_dctrl;
4862 dch->dev.nrbchan = 2;
4864 dch->slot = i + 2;
4865 hc->chan[i + 2].dch = dch;
4868 for (ch = 0; ch < dch->dev.nrbchan; ch++) {
4892 list_add(&bch->ch.list, &dch->dev.bchannels);
4895 set_channelmap(bch->nr, dch->dev.channelmap);
4904 if (dch->dev.D.protocol != ISDN_P_TE_S0) {
4945 ret = mISDN_register_device(&dch->dev, NULL, name);
4949 ret = mISDN_register_device(&dch->dev, &hc->pci_dev->dev, name);
4956 release_port(hc, dch);
5132 hc->chan[hc->dnum[pt]].dch);
5135 hc->chan[(pt << 2) + 2].dch);