Lines Matching refs:dch

1578 	struct dchannel *dch;
1593 dch = hc->chan[hc->dnum[0]].dch;
1594 if (dch) {
1638 dch = hc->chan[(i << 2) | 2].dch;
1639 if (dch) {
1640 state = dch->state;
1641 if (dch->dev.D.protocol == ISDN_P_NT_S0)
1702 dch = hc->chan[(i << 2) | 2].dch;
1703 if (dch) {
1704 state = dch->state;
1705 if (dch->dev.D.protocol == ISDN_P_NT_S0)
1749 dch = hc->chan[(i << 2) | 2].dch;
1750 if (dch) {
1751 state = dch->state;
1752 if (dch->dev.D.protocol == ISDN_P_NT_S0)
1910 struct dchannel *dch;
1915 dch = hc->chan[ch].dch;
1916 if ((!dch) && (!bch))
1921 if (dch) {
1922 if (!test_bit(FLG_ACTIVE, &dch->Flags))
1924 sp = &dch->tx_skb;
1925 idxp = &dch->tx_idx;
1955 if (dch || test_bit(FLG_HDLC, &bch->Flags)) {
1981 if (hc->ctype != HFC_TYPE_E1 && dch) {
2088 if (dch)
2093 if (dch || test_bit(FLG_HDLC, &bch->Flags))
2119 if (dch || test_bit(FLG_HDLC, &bch->Flags)) {
2132 if (dch && get_next_dframe(dch)) {
2156 struct dchannel *dch = NULL;
2164 } else if (hc->chan[ch].dch) {
2165 dch = hc->chan[ch].dch;
2166 if (!test_bit(FLG_ACTIVE, &dch->Flags))
2190 if (dch || test_bit(FLG_HDLC, &bch->Flags)) {
2210 if ((dch || test_bit(FLG_HDLC, &bch->Flags)) && f1 != f2)
2229 sp = &dch->rx_skb;
2230 maxlen = dch->maxlen + 3;
2234 pr_warn("card%d: No mem for dch rx_skb\n",
2241 if (dch)
2245 if (dch || test_bit(FLG_HDLC, &bch->Flags)) {
2311 if (dch)
2312 recv_Dchannel(dch);
2338 signal_state_up(struct dchannel *dch, int info, char *msg)
2352 recv_Dchannel_skb(dch, skb);
2359 struct dchannel *dch;
2399 if (hc->chan[ch].dch &&
2401 dch = hc->chan[ch].dch;
2403 schedule_event(dch,
2411 dch->state);
2417 dch = hc->chan[hc->dnum[0]].dch;
2423 signal_state_up(dch, L1_SIGNAL_LOS_ON,
2426 signal_state_up(dch, L1_SIGNAL_LOS_OFF,
2433 signal_state_up(dch, L1_SIGNAL_AIS_ON,
2436 signal_state_up(dch, L1_SIGNAL_AIS_OFF,
2444 signal_state_up(dch, L1_SIGNAL_SLIP_RX,
2449 signal_state_up(dch, L1_SIGNAL_SLIP_TX,
2457 signal_state_up(dch, L1_SIGNAL_RDI_ON,
2460 signal_state_up(dch, L1_SIGNAL_RDI_OFF,
2535 struct dchannel *dch;
2542 if (hc->chan[ch].dch) {
2543 dch = hc->chan[ch].dch;
2563 dch->dev.D.protocol == ISDN_P_TE_S0) {
2571 dch->state = st_status & 0x0f;
2572 if (dch->dev.D.protocol == ISDN_P_NT_S0)
2576 if (dch->state == active) {
2583 dch->tx_idx = 0;
2585 schedule_event(dch, FLG_PHCHANGE);
2589 __func__, dch->state,
2603 struct dchannel *dch;
2611 dch = hc->chan[ch].dch;
2613 if (((!dch) && (!bch)) || (!hc->created[hc->chan[ch].port])) {
2617 if (dch && (r_irq_fifo_bl & (1 << j)) &&
2618 test_bit(FLG_ACTIVE, &dch->Flags)) {
2632 if (dch && (r_irq_fifo_bl & (1 << j)) &&
2633 test_bit(FLG_ACTIVE, &dch->Flags)) {
2655 struct dchannel *dch;
2733 dch = hc->chan[hc->dnum[0]].dch;
2758 dch = hc->chan[hc->dnum[i]].dch;
2759 dch->state = temp & 0x7;
2760 schedule_event(dch, FLG_PHCHANGE);
3188 hfcm_l1callback(struct dchannel *dch, u_int cmd)
3190 struct hfc_multi *hc = dch->hw;
3207 HFC_outb(hc, R_ST_SEL, hc->chan[dch->slot].port);
3217 l1_event(dch->l1, HW_POWERUP_IND);
3229 HFC_outb(hc, R_ST_SEL, hc->chan[dch->slot].port);
3236 ~(1 << hc->chan[dch->slot].port);
3240 skb_queue_splice_init(&dch->squeue, &free_queue);
3241 if (dch->tx_skb) {
3242 __skb_queue_tail(&free_queue, dch->tx_skb);
3243 dch->tx_skb = NULL;
3245 dch->tx_idx = 0;
3246 if (dch->rx_skb) {
3247 __skb_queue_tail(&free_queue, dch->rx_skb);
3248 dch->rx_skb = NULL;
3250 test_and_clear_bit(FLG_TX_BUSY, &dch->Flags);
3251 if (test_and_clear_bit(FLG_BUSY_TIMER, &dch->Flags))
3252 timer_delete(&dch->timer);
3264 HFC_outb(hc, R_ST_SEL, hc->chan[dch->slot].port);
3274 test_and_set_bit(FLG_ACTIVE, &dch->Flags);
3275 _queue_data(&dch->dev.D, cmd, MISDN_ID_ANY, 0, NULL,
3279 test_and_clear_bit(FLG_ACTIVE, &dch->Flags);
3280 _queue_data(&dch->dev.D, cmd, MISDN_ID_ANY, 0, NULL,
3284 if (dch->debug & DEBUG_HW)
3300 struct dchannel *dch = container_of(dev, struct dchannel, dev);
3301 struct hfc_multi *hc = dch->hw;
3312 ret = dchannel_senddata(dch, skb);
3315 hfcmulti_tx(hc, dch->slot);
3326 if (dch->dev.D.protocol != ISDN_P_TE_S0) {
3332 __func__, hc->chan[dch->slot].port,
3336 ph_state_change(dch);
3340 __func__, dch->state);
3343 hc->chan[dch->slot].port);
3352 dch->state = 1;
3356 ret = l1_event(dch->l1, hh->prim);
3359 test_and_clear_bit(FLG_L2_ACTIVATED, &dch->Flags);
3360 if (dch->dev.D.protocol != ISDN_P_TE_S0) {
3368 __func__, hc->chan[dch->slot].port,
3378 hc->chan[dch->slot].port);
3383 dch->state = 1;
3385 skb_queue_splice_init(&dch->squeue, &free_queue);
3386 if (dch->tx_skb) {
3387 __skb_queue_tail(&free_queue, dch->tx_skb);
3388 dch->tx_skb = NULL;
3390 dch->tx_idx = 0;
3391 if (dch->rx_skb) {
3392 __skb_queue_tail(&free_queue, dch->rx_skb);
3393 dch->rx_skb = NULL;
3395 test_and_clear_bit(FLG_TX_BUSY, &dch->Flags);
3396 if (test_and_clear_bit(FLG_BUSY_TIMER, &dch->Flags))
3397 timer_delete(&dch->timer);
3399 if (test_and_clear_bit(FLG_L1_BUSY, &dch->Flags))
3400 dchannel_sched_event(&hc->dch, D_CLEARBUSY);
3406 ret = l1_event(dch->l1, hh->prim);
3694 ph_state_change(struct dchannel *dch)
3699 if (!dch) {
3700 printk(KERN_WARNING "%s: ERROR given dch is NULL\n", __func__);
3703 hc = dch->hw;
3704 ch = dch->slot;
3707 if (dch->dev.D.protocol == ISDN_P_TE_E1) {
3711 __func__, hc->id, dch->state);
3716 __func__, hc->id, dch->state);
3718 switch (dch->state) {
3731 test_and_set_bit(FLG_ACTIVE, &dch->Flags);
3732 _queue_data(&dch->dev.D, PH_ACTIVATE_IND,
3739 test_and_clear_bit(FLG_ACTIVE, &dch->Flags);
3740 _queue_data(&dch->dev.D, PH_DEACTIVATE_IND,
3743 hc->e1_state = dch->state;
3745 if (dch->dev.D.protocol == ISDN_P_TE_S0) {
3749 __func__, dch->state);
3750 switch (dch->state) {
3752 l1_event(dch->l1, HW_RESET_IND);
3755 l1_event(dch->l1, HW_DEACT_IND);
3759 l1_event(dch->l1, ANYSIGNAL);
3762 l1_event(dch->l1, INFO2);
3765 l1_event(dch->l1, INFO4_P8);
3771 __func__, dch->state);
3772 switch (dch->state) {
3784 dch->state = 4;
3800 test_and_clear_bit(FLG_ACTIVE, &dch->Flags);
3801 _queue_data(&dch->dev.D, PH_DEACTIVATE_IND,
3809 test_and_set_bit(FLG_ACTIVE, &dch->Flags);
3810 _queue_data(&dch->dev.D, PH_ACTIVATE_IND,
3823 hfcmulti_initmode(struct dchannel *dch)
3825 struct hfc_multi *hc = dch->hw;
3832 i = dch->slot;
3840 mode_hfcmulti(hc, dch->slot, dch->dev.D.protocol,
3842 timer_setup(&dch->timer, hfcmulti_dbusy_timer, 0);
3855 dch = hc->chan[hc->dnum[0]].dch;
3881 if (dch->dev.D.protocol == ISDN_P_NT_E1) {
3947 mode_hfcmulti(hc, i, dch->dev.D.protocol, -1, 0, -1, 0);
3948 timer_setup(&dch->timer, hfcmulti_dbusy_timer, 0);
3961 if (dch->dev.D.protocol == ISDN_P_NT_S0) {
3990 if ((dch->dev.D.protocol == ISDN_P_NT_S0) ||
4007 ~(1 << hc->chan[dch->slot].port);
4017 open_dchannel(struct hfc_multi *hc, struct dchannel *dch,
4025 dch->dev.id, __builtin_return_address(0));
4028 if ((dch->dev.D.protocol != ISDN_P_NONE) &&
4029 (dch->dev.D.protocol != rq->protocol)) {
4032 __func__, dch->dev.D.protocol, rq->protocol);
4034 if ((dch->dev.D.protocol == ISDN_P_TE_S0) &&
4036 l1_event(dch->l1, CLOSE_CHANNEL);
4037 if (dch->dev.D.protocol != rq->protocol) {
4039 err = create_l1(dch, hfcm_l1callback);
4043 dch->dev.D.protocol = rq->protocol;
4045 hfcmulti_initmode(dch);
4048 if (test_bit(FLG_ACTIVE, &dch->Flags))
4049 _queue_data(&dch->dev.D, PH_ACTIVATE_IND, MISDN_ID_ANY,
4051 rq->ch = &dch->dev.D;
4058 open_bchannel(struct hfc_multi *hc, struct dchannel *dch,
4064 if (!test_channelmap(rq->adr.channel, dch->dev.channelmap))
4071 ch = (rq->adr.channel - 1) + (dch->slot - 2);
4092 channel_dctrl(struct dchannel *dch, struct mISDN_ctrl_req *cq)
4094 struct hfc_multi *hc = dch->hw;
4131 ret = l1_event(dch->l1, HW_TIMER3_VALUE | (cq->p1 & 0xff));
4146 struct dchannel *dch = container_of(dev, struct dchannel, dev);
4147 struct hfc_multi *hc = dch->hw;
4152 if (dch->debug & DEBUG_HW)
4165 err = open_dchannel(hc, dch, rq); /* locked there */
4173 err = open_dchannel(hc, dch, rq); /* locked there */
4177 err = open_bchannel(hc, dch, rq);
4184 __func__, dch->dev.id,
4190 err = channel_dctrl(dch, arg);
4194 if (dch->debug & DEBUG_HW)
4489 release_port(struct hfc_multi *hc, struct dchannel *dch)
4495 ci = dch->slot;
4512 if (dch->dev.D.protocol == ISDN_P_TE_S0)
4513 l1_event(dch->l1, CLOSE_CHANNEL);
4515 hc->chan[ci].dch = NULL;
4519 mISDN_unregister_device(&dch->dev);
4524 if (dch->timer.function) {
4525 timer_delete(&dch->timer);
4526 dch->timer.function = NULL;
4596 mISDN_freedchannel(dch);
4597 kfree(dch);
4636 if (hc->chan[ch].dch)
4637 release_port(hc, hc->chan[ch].dch);
4774 struct dchannel *dch;
4780 dch = kzalloc(sizeof(struct dchannel), GFP_KERNEL);
4781 if (!dch)
4783 dch->debug = debug;
4784 mISDN_initdchannel(dch, MAX_DFRAME_LEN_L1, ph_state_change);
4785 dch->hw = hc;
4786 dch->dev.Dprotocols = (1 << ISDN_P_TE_E1) | (1 << ISDN_P_NT_E1);
4787 dch->dev.Bprotocols = (1 << (ISDN_P_B_RAW & ISDN_P_B_MASK)) |
4789 dch->dev.D.send = handle_dmsg;
4790 dch->dev.D.ctrl = hfcm_dctrl;
4791 dch->slot = hc->dnum[pt];
4792 hc->chan[hc->dnum[pt]].dch = dch;
4821 list_add(&bch->ch.list, &dch->dev.bchannels);
4824 set_channelmap(bch->nr, dch->dev.channelmap);
4827 dch->dev.nrbchan = bcount;
4835 ret = mISDN_register_device(&dch->dev, &hc->pci_dev->dev, name);
4841 release_port(hc, dch);
4848 struct dchannel *dch;
4853 dch = kzalloc(sizeof(struct dchannel), GFP_KERNEL);
4854 if (!dch)
4856 dch->debug = debug;
4857 mISDN_initdchannel(dch, MAX_DFRAME_LEN_L1, ph_state_change);
4858 dch->hw = hc;
4859 dch->dev.Dprotocols = (1 << ISDN_P_TE_S0) | (1 << ISDN_P_NT_S0);
4860 dch->dev.Bprotocols = (1 << (ISDN_P_B_RAW & ISDN_P_B_MASK)) |
4862 dch->dev.D.send = handle_dmsg;
4863 dch->dev.D.ctrl = hfcm_dctrl;
4864 dch->dev.nrbchan = 2;
4866 dch->slot = i + 2;
4867 hc->chan[i + 2].dch = dch;
4870 for (ch = 0; ch < dch->dev.nrbchan; ch++) {
4894 list_add(&bch->ch.list, &dch->dev.bchannels);
4897 set_channelmap(bch->nr, dch->dev.channelmap);
4906 if (dch->dev.D.protocol != ISDN_P_TE_S0) {
4947 ret = mISDN_register_device(&dch->dev, NULL, name);
4951 ret = mISDN_register_device(&dch->dev, &hc->pci_dev->dev, name);
4958 release_port(hc, dch);
5134 hc->chan[hc->dnum[pt]].dch);
5137 hc->chan[(pt << 2) + 2].dch);