Lines Matching defs:dch

1608 	struct dchannel *dch;
1623 dch = hc->chan[hc->dnum[0]].dch;
1624 if (dch) {
1668 dch = hc->chan[(i << 2) | 2].dch;
1669 if (dch) {
1670 state = dch->state;
1671 if (dch->dev.D.protocol == ISDN_P_NT_S0)
1732 dch = hc->chan[(i << 2) | 2].dch;
1733 if (dch) {
1734 state = dch->state;
1735 if (dch->dev.D.protocol == ISDN_P_NT_S0)
1779 dch = hc->chan[(i << 2) | 2].dch;
1780 if (dch) {
1781 state = dch->state;
1782 if (dch->dev.D.protocol == ISDN_P_NT_S0)
1940 struct dchannel *dch;
1945 dch = hc->chan[ch].dch;
1946 if ((!dch) && (!bch))
1951 if (dch) {
1952 if (!test_bit(FLG_ACTIVE, &dch->Flags))
1954 sp = &dch->tx_skb;
1955 idxp = &dch->tx_idx;
1985 if (dch || test_bit(FLG_HDLC, &bch->Flags)) {
2011 if (hc->ctype != HFC_TYPE_E1 && dch) {
2118 if (dch)
2123 if (dch || test_bit(FLG_HDLC, &bch->Flags))
2149 if (dch || test_bit(FLG_HDLC, &bch->Flags)) {
2161 if (dch && get_next_dframe(dch)) {
2185 struct dchannel *dch = NULL;
2193 } else if (hc->chan[ch].dch) {
2194 dch = hc->chan[ch].dch;
2195 if (!test_bit(FLG_ACTIVE, &dch->Flags))
2219 if (dch || test_bit(FLG_HDLC, &bch->Flags)) {
2239 if ((dch || test_bit(FLG_HDLC, &bch->Flags)) && f1 != f2)
2258 sp = &dch->rx_skb;
2259 maxlen = dch->maxlen + 3;
2263 pr_warn("card%d: No mem for dch rx_skb\n",
2270 if (dch)
2274 if (dch || test_bit(FLG_HDLC, &bch->Flags)) {
2340 if (dch)
2341 recv_Dchannel(dch);
2367 signal_state_up(struct dchannel *dch, int info, char *msg)
2381 recv_Dchannel_skb(dch, skb);
2388 struct dchannel *dch;
2428 if (hc->chan[ch].dch &&
2430 dch = hc->chan[ch].dch;
2432 schedule_event(dch,
2440 dch->state);
2446 dch = hc->chan[hc->dnum[0]].dch;
2452 signal_state_up(dch, L1_SIGNAL_LOS_ON,
2455 signal_state_up(dch, L1_SIGNAL_LOS_OFF,
2462 signal_state_up(dch, L1_SIGNAL_AIS_ON,
2465 signal_state_up(dch, L1_SIGNAL_AIS_OFF,
2473 signal_state_up(dch, L1_SIGNAL_SLIP_RX,
2478 signal_state_up(dch, L1_SIGNAL_SLIP_TX,
2486 signal_state_up(dch, L1_SIGNAL_RDI_ON,
2489 signal_state_up(dch, L1_SIGNAL_RDI_OFF,
2564 struct dchannel *dch;
2571 if (hc->chan[ch].dch) {
2572 dch = hc->chan[ch].dch;
2592 dch->dev.D.protocol == ISDN_P_TE_S0) {
2600 dch->state = st_status & 0x0f;
2601 if (dch->dev.D.protocol == ISDN_P_NT_S0)
2605 if (dch->state == active) {
2612 dch->tx_idx = 0;
2614 schedule_event(dch, FLG_PHCHANGE);
2618 __func__, dch->state,
2632 struct dchannel *dch;
2640 dch = hc->chan[ch].dch;
2642 if (((!dch) && (!bch)) || (!hc->created[hc->chan[ch].port])) {
2646 if (dch && (r_irq_fifo_bl & (1 << j)) &&
2647 test_bit(FLG_ACTIVE, &dch->Flags)) {
2661 if (dch && (r_irq_fifo_bl & (1 << j)) &&
2662 test_bit(FLG_ACTIVE, &dch->Flags)) {
2684 struct dchannel *dch;
2764 dch = hc->chan[hc->dnum[0]].dch;
2789 dch = hc->chan[hc->dnum[i]].dch;
2790 dch->state = temp & 0x7;
2791 schedule_event(dch, FLG_PHCHANGE);
3219 hfcm_l1callback(struct dchannel *dch, u_int cmd)
3221 struct hfc_multi *hc = dch->hw;
3238 HFC_outb(hc, R_ST_SEL, hc->chan[dch->slot].port);
3248 l1_event(dch->l1, HW_POWERUP_IND);
3260 HFC_outb(hc, R_ST_SEL, hc->chan[dch->slot].port);
3267 ~(1 << hc->chan[dch->slot].port);
3271 skb_queue_splice_init(&dch->squeue, &free_queue);
3272 if (dch->tx_skb) {
3273 __skb_queue_tail(&free_queue, dch->tx_skb);
3274 dch->tx_skb = NULL;
3276 dch->tx_idx = 0;
3277 if (dch->rx_skb) {
3278 __skb_queue_tail(&free_queue, dch->rx_skb);
3279 dch->rx_skb = NULL;
3281 test_and_clear_bit(FLG_TX_BUSY, &dch->Flags);
3282 if (test_and_clear_bit(FLG_BUSY_TIMER, &dch->Flags))
3283 del_timer(&dch->timer);
3295 HFC_outb(hc, R_ST_SEL, hc->chan[dch->slot].port);
3305 test_and_set_bit(FLG_ACTIVE, &dch->Flags);
3306 _queue_data(&dch->dev.D, cmd, MISDN_ID_ANY, 0, NULL,
3310 test_and_clear_bit(FLG_ACTIVE, &dch->Flags);
3311 _queue_data(&dch->dev.D, cmd, MISDN_ID_ANY, 0, NULL,
3315 if (dch->debug & DEBUG_HW)
3331 struct dchannel *dch = container_of(dev, struct dchannel, dev);
3332 struct hfc_multi *hc = dch->hw;
3343 ret = dchannel_senddata(dch, skb);
3346 hfcmulti_tx(hc, dch->slot);
3357 if (dch->dev.D.protocol != ISDN_P_TE_S0) {
3363 __func__, hc->chan[dch->slot].port,
3367 ph_state_change(dch);
3371 __func__, dch->state);
3374 hc->chan[dch->slot].port);
3383 dch->state = 1;
3387 ret = l1_event(dch->l1, hh->prim);
3390 test_and_clear_bit(FLG_L2_ACTIVATED, &dch->Flags);
3391 if (dch->dev.D.protocol != ISDN_P_TE_S0) {
3399 __func__, hc->chan[dch->slot].port,
3409 hc->chan[dch->slot].port);
3414 dch->state = 1;
3416 skb_queue_splice_init(&dch->squeue, &free_queue);
3417 if (dch->tx_skb) {
3418 __skb_queue_tail(&free_queue, dch->tx_skb);
3419 dch->tx_skb = NULL;
3421 dch->tx_idx = 0;
3422 if (dch->rx_skb) {
3423 __skb_queue_tail(&free_queue, dch->rx_skb);
3424 dch->rx_skb = NULL;
3426 test_and_clear_bit(FLG_TX_BUSY, &dch->Flags);
3427 if (test_and_clear_bit(FLG_BUSY_TIMER, &dch->Flags))
3428 del_timer(&dch->timer);
3430 if (test_and_clear_bit(FLG_L1_BUSY, &dch->Flags))
3431 dchannel_sched_event(&hc->dch, D_CLEARBUSY);
3437 ret = l1_event(dch->l1, hh->prim);
3725 ph_state_change(struct dchannel *dch)
3730 if (!dch) {
3731 printk(KERN_WARNING "%s: ERROR given dch is NULL\n", __func__);
3734 hc = dch->hw;
3735 ch = dch->slot;
3738 if (dch->dev.D.protocol == ISDN_P_TE_E1) {
3742 __func__, hc->id, dch->state);
3747 __func__, hc->id, dch->state);
3749 switch (dch->state) {
3762 test_and_set_bit(FLG_ACTIVE, &dch->Flags);
3763 _queue_data(&dch->dev.D, PH_ACTIVATE_IND,
3770 test_and_clear_bit(FLG_ACTIVE, &dch->Flags);
3771 _queue_data(&dch->dev.D, PH_DEACTIVATE_IND,
3774 hc->e1_state = dch->state;
3776 if (dch->dev.D.protocol == ISDN_P_TE_S0) {
3780 __func__, dch->state);
3781 switch (dch->state) {
3783 l1_event(dch->l1, HW_RESET_IND);
3786 l1_event(dch->l1, HW_DEACT_IND);
3790 l1_event(dch->l1, ANYSIGNAL);
3793 l1_event(dch->l1, INFO2);
3796 l1_event(dch->l1, INFO4_P8);
3802 __func__, dch->state);
3803 switch (dch->state) {
3815 dch->state = 4;
3831 test_and_clear_bit(FLG_ACTIVE, &dch->Flags);
3832 _queue_data(&dch->dev.D, PH_DEACTIVATE_IND,
3840 test_and_set_bit(FLG_ACTIVE, &dch->Flags);
3841 _queue_data(&dch->dev.D, PH_ACTIVATE_IND,
3854 hfcmulti_initmode(struct dchannel *dch)
3856 struct hfc_multi *hc = dch->hw;
3863 i = dch->slot;
3871 mode_hfcmulti(hc, dch->slot, dch->dev.D.protocol,
3873 timer_setup(&dch->timer, hfcmulti_dbusy_timer, 0);
3886 dch = hc->chan[hc->dnum[0]].dch;
3912 if (dch->dev.D.protocol == ISDN_P_NT_E1) {
3978 mode_hfcmulti(hc, i, dch->dev.D.protocol, -1, 0, -1, 0);
3979 timer_setup(&dch->timer, hfcmulti_dbusy_timer, 0);
3992 if (dch->dev.D.protocol == ISDN_P_NT_S0) {
4021 if ((dch->dev.D.protocol == ISDN_P_NT_S0) ||
4038 ~(1 << hc->chan[dch->slot].port);
4048 open_dchannel(struct hfc_multi *hc, struct dchannel *dch,
4056 dch->dev.id, __builtin_return_address(0));
4059 if ((dch->dev.D.protocol != ISDN_P_NONE) &&
4060 (dch->dev.D.protocol != rq->protocol)) {
4063 __func__, dch->dev.D.protocol, rq->protocol);
4065 if ((dch->dev.D.protocol == ISDN_P_TE_S0) &&
4067 l1_event(dch->l1, CLOSE_CHANNEL);
4068 if (dch->dev.D.protocol != rq->protocol) {
4070 err = create_l1(dch, hfcm_l1callback);
4074 dch->dev.D.protocol = rq->protocol;
4076 hfcmulti_initmode(dch);
4079 if (test_bit(FLG_ACTIVE, &dch->Flags))
4080 _queue_data(&dch->dev.D, PH_ACTIVATE_IND, MISDN_ID_ANY,
4082 rq->ch = &dch->dev.D;
4089 open_bchannel(struct hfc_multi *hc, struct dchannel *dch,
4095 if (!test_channelmap(rq->adr.channel, dch->dev.channelmap))
4102 ch = (rq->adr.channel - 1) + (dch->slot - 2);
4123 channel_dctrl(struct dchannel *dch, struct mISDN_ctrl_req *cq)
4125 struct hfc_multi *hc = dch->hw;
4162 ret = l1_event(dch->l1, HW_TIMER3_VALUE | (cq->p1 & 0xff));
4177 struct dchannel *dch = container_of(dev, struct dchannel, dev);
4178 struct hfc_multi *hc = dch->hw;
4183 if (dch->debug & DEBUG_HW)
4196 err = open_dchannel(hc, dch, rq); /* locked there */
4204 err = open_dchannel(hc, dch, rq); /* locked there */
4208 err = open_bchannel(hc, dch, rq);
4215 __func__, dch->dev.id,
4221 err = channel_dctrl(dch, arg);
4225 if (dch->debug & DEBUG_HW)
4520 release_port(struct hfc_multi *hc, struct dchannel *dch)
4526 ci = dch->slot;
4543 if (dch->dev.D.protocol == ISDN_P_TE_S0)
4544 l1_event(dch->l1, CLOSE_CHANNEL);
4546 hc->chan[ci].dch = NULL;
4550 mISDN_unregister_device(&dch->dev);
4555 if (dch->timer.function) {
4556 del_timer(&dch->timer);
4557 dch->timer.function = NULL;
4627 mISDN_freedchannel(dch);
4628 kfree(dch);
4667 if (hc->chan[ch].dch)
4668 release_port(hc, hc->chan[ch].dch);
4805 struct dchannel *dch;
4811 dch = kzalloc(sizeof(struct dchannel), GFP_KERNEL);
4812 if (!dch)
4814 dch->debug = debug;
4815 mISDN_initdchannel(dch, MAX_DFRAME_LEN_L1, ph_state_change);
4816 dch->hw = hc;
4817 dch->dev.Dprotocols = (1 << ISDN_P_TE_E1) | (1 << ISDN_P_NT_E1);
4818 dch->dev.Bprotocols = (1 << (ISDN_P_B_RAW & ISDN_P_B_MASK)) |
4820 dch->dev.D.send = handle_dmsg;
4821 dch->dev.D.ctrl = hfcm_dctrl;
4822 dch->slot = hc->dnum[pt];
4823 hc->chan[hc->dnum[pt]].dch = dch;
4852 list_add(&bch->ch.list, &dch->dev.bchannels);
4855 set_channelmap(bch->nr, dch->dev.channelmap);
4858 dch->dev.nrbchan = bcount;
4866 ret = mISDN_register_device(&dch->dev, &hc->pci_dev->dev, name);
4872 release_port(hc, dch);
4879 struct dchannel *dch;
4884 dch = kzalloc(sizeof(struct dchannel), GFP_KERNEL);
4885 if (!dch)
4887 dch->debug = debug;
4888 mISDN_initdchannel(dch, MAX_DFRAME_LEN_L1, ph_state_change);
4889 dch->hw = hc;
4890 dch->dev.Dprotocols = (1 << ISDN_P_TE_S0) | (1 << ISDN_P_NT_S0);
4891 dch->dev.Bprotocols = (1 << (ISDN_P_B_RAW & ISDN_P_B_MASK)) |
4893 dch->dev.D.send = handle_dmsg;
4894 dch->dev.D.ctrl = hfcm_dctrl;
4895 dch->dev.nrbchan = 2;
4897 dch->slot = i + 2;
4898 hc->chan[i + 2].dch = dch;
4901 for (ch = 0; ch < dch->dev.nrbchan; ch++) {
4925 list_add(&bch->ch.list, &dch->dev.bchannels);
4928 set_channelmap(bch->nr, dch->dev.channelmap);
4937 if (dch->dev.D.protocol != ISDN_P_TE_S0) {
4978 ret = mISDN_register_device(&dch->dev, NULL, name);
4982 ret = mISDN_register_device(&dch->dev, &hc->pci_dev->dev, name);
4989 release_port(hc, dch);
5165 hc->chan[hc->dnum[pt]].dch);
5168 hc->chan[(pt << 2) + 2].dch);