• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/isdn/hardware/mISDN/

Lines Matching defs:dch

1599 	struct dchannel *dch;
1617 if (hc->chan[hc->dslot].dch->dev.D.protocol
1653 dch = hc->chan[(i << 2) | 2].dch;
1654 if (dch) {
1655 state = dch->state;
1656 if (dch->dev.D.protocol == ISDN_P_NT_S0)
1665 if (dch->dev.D.protocol == ISDN_P_TE_S0)
1714 dch = hc->chan[(i << 2) | 2].dch;
1715 if (dch) {
1716 state = dch->state;
1717 if (dch->dev.D.protocol == ISDN_P_NT_S0)
1726 if (dch->dev.D.protocol == ISDN_P_TE_S0)
1757 dch = hc->chan[(i << 2) | 2].dch;
1758 if (dch) {
1759 state = dch->state;
1760 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) {
2092 if (dch || test_bit(FLG_HDLC, &bch->Flags))
2118 if (dch || test_bit(FLG_HDLC, &bch->Flags)) {
2134 if (dch && get_next_dframe(dch)) {
2158 struct dchannel *dch;
2163 dch = hc->chan[ch].dch;
2164 if ((!dch) && (!bch))
2166 if (dch) {
2167 if (!test_bit(FLG_ACTIVE, &dch->Flags))
2169 sp = &dch->rx_skb;
2170 maxlen = dch->maxlen;
2193 if (dch || test_bit(FLG_HDLC, &bch->Flags)) {
2213 if ((dch || test_bit(FLG_HDLC, &bch->Flags)) && f1 != f2)
2234 if (dch || test_bit(FLG_HDLC, &bch->Flags)) {
2301 if (dch)
2302 recv_Dchannel(dch);
2346 signal_state_up(struct dchannel *dch, int info, char *msg)
2360 recv_Dchannel_skb(dch, skb);
2367 struct dchannel *dch;
2407 if (hc->chan[ch].dch &&
2409 dch = hc->chan[ch].dch;
2411 schedule_event(dch,
2419 dch->state);
2425 dch = hc->chan[hc->dslot].dch;
2430 signal_state_up(dch, L1_SIGNAL_LOS_ON,
2433 signal_state_up(dch, L1_SIGNAL_LOS_OFF,
2441 signal_state_up(dch, L1_SIGNAL_AIS_ON,
2444 signal_state_up(dch, L1_SIGNAL_AIS_OFF,
2452 signal_state_up(dch, L1_SIGNAL_SLIP_RX,
2457 signal_state_up(dch, L1_SIGNAL_SLIP_TX,
2465 signal_state_up(dch, L1_SIGNAL_RDI_ON,
2468 signal_state_up(dch, L1_SIGNAL_RDI_OFF,
2543 struct dchannel *dch;
2550 if (hc->chan[ch].dch) {
2551 dch = hc->chan[ch].dch;
2571 dch->dev.D.protocol == ISDN_P_TE_S0) {
2579 dch->state = st_status & 0x0f;
2580 if (dch->dev.D.protocol == ISDN_P_NT_S0)
2584 if (dch->state == active) {
2591 dch->tx_idx = 0;
2593 schedule_event(dch, FLG_PHCHANGE);
2597 __func__, dch->state,
2611 struct dchannel *dch;
2619 dch = hc->chan[ch].dch;
2621 if (((!dch) && (!bch)) || (!hc->created[hc->chan[ch].port])) {
2625 if (dch && (r_irq_fifo_bl & (1 << j)) &&
2626 test_bit(FLG_ACTIVE, &dch->Flags)) {
2640 if (dch && (r_irq_fifo_bl & (1 << j)) &&
2641 test_bit(FLG_ACTIVE, &dch->Flags)) {
2663 struct dchannel *dch;
2743 dch = hc->chan[hc->dslot].dch;
2753 dch->state = HFC_inb_nodebug(hc, R_E1_RD_STA);
2754 while (dch->state != (temp =
2760 dch->state);
2761 dch->state = temp; /* repeat */
2763 dch->state = HFC_inb_nodebug(hc, R_E1_RD_STA)
2765 schedule_event(dch, FLG_PHCHANGE);
2769 __func__, hc->id, dch->state);
3187 hfcm_l1callback(struct dchannel *dch, u_int cmd)
3189 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);
3226 HFC_outb(hc, R_ST_SEL, hc->chan[dch->slot].port);
3233 ~(1 << hc->chan[dch->slot].port);
3237 skb_queue_purge(&dch->squeue);
3238 if (dch->tx_skb) {
3239 dev_kfree_skb(dch->tx_skb);
3240 dch->tx_skb = NULL;
3242 dch->tx_idx = 0;
3243 if (dch->rx_skb) {
3244 dev_kfree_skb(dch->rx_skb);
3245 dch->rx_skb = NULL;
3247 test_and_clear_bit(FLG_TX_BUSY, &dch->Flags);
3248 if (test_and_clear_bit(FLG_BUSY_TIMER, &dch->Flags))
3249 del_timer(&dch->timer);
3260 HFC_outb(hc, R_ST_SEL, hc->chan[dch->slot].port);
3270 test_and_set_bit(FLG_ACTIVE, &dch->Flags);
3271 _queue_data(&dch->dev.D, cmd, MISDN_ID_ANY, 0, NULL,
3275 test_and_clear_bit(FLG_ACTIVE, &dch->Flags);
3276 _queue_data(&dch->dev.D, cmd, MISDN_ID_ANY, 0, NULL,
3280 if (dch->debug & DEBUG_HW)
3296 struct dchannel *dch = container_of(dev, struct dchannel, dev);
3297 struct hfc_multi *hc = dch->hw;
3308 ret = dchannel_senddata(dch, skb);
3311 hfcmulti_tx(hc, dch->slot);
3322 if (dch->dev.D.protocol != ISDN_P_TE_S0) {
3328 __func__, hc->chan[dch->slot].port,
3332 ph_state_change(dch);
3336 __func__, dch->state);
3339 hc->chan[dch->slot].port);
3348 dch->state = 1;
3352 ret = l1_event(dch->l1, hh->prim);
3355 test_and_clear_bit(FLG_L2_ACTIVATED, &dch->Flags);
3356 if (dch->dev.D.protocol != ISDN_P_TE_S0) {
3361 __func__, hc->chan[dch->slot].port,
3371 hc->chan[dch->slot].port);
3376 dch->state = 1;
3378 skb_queue_purge(&dch->squeue);
3379 if (dch->tx_skb) {
3380 dev_kfree_skb(dch->tx_skb);
3381 dch->tx_skb = NULL;
3383 dch->tx_idx = 0;
3384 if (dch->rx_skb) {
3385 dev_kfree_skb(dch->rx_skb);
3386 dch->rx_skb = NULL;
3388 test_and_clear_bit(FLG_TX_BUSY, &dch->Flags);
3389 if (test_and_clear_bit(FLG_BUSY_TIMER, &dch->Flags))
3390 del_timer(&dch->timer);
3392 if (test_and_clear_bit(FLG_L1_BUSY, &dch->Flags))
3393 dchannel_sched_event(&hc->dch, D_CLEARBUSY);
3398 ret = l1_event(dch->l1, hh->prim);
3696 ph_state_change(struct dchannel *dch)
3701 if (!dch) {
3702 printk(KERN_WARNING "%s: ERROR given dch is NULL\n", __func__);
3705 hc = dch->hw;
3706 ch = dch->slot;
3709 if (dch->dev.D.protocol == ISDN_P_TE_E1) {
3713 __func__, hc->id, dch->state);
3718 __func__, hc->id, dch->state);
3720 switch (dch->state) {
3733 test_and_set_bit(FLG_ACTIVE, &dch->Flags);
3734 _queue_data(&dch->dev.D, PH_ACTIVATE_IND,
3741 test_and_clear_bit(FLG_ACTIVE, &dch->Flags);
3742 _queue_data(&dch->dev.D, PH_DEACTIVATE_IND,
3745 hc->e1_state = dch->state;
3747 if (dch->dev.D.protocol == ISDN_P_TE_S0) {
3751 __func__, dch->state);
3752 switch (dch->state) {
3754 l1_event(dch->l1, HW_RESET_IND);
3757 l1_event(dch->l1, HW_DEACT_IND);
3761 l1_event(dch->l1, ANYSIGNAL);
3764 l1_event(dch->l1, INFO2);
3767 l1_event(dch->l1, INFO4_P8);
3773 __func__, dch->state);
3774 switch (dch->state) {
3786 dch->state = 4;
3802 test_and_clear_bit(FLG_ACTIVE, &dch->Flags);
3803 _queue_data(&dch->dev.D, PH_DEACTIVATE_IND,
3811 test_and_set_bit(FLG_ACTIVE, &dch->Flags);
3812 _queue_data(&dch->dev.D, PH_ACTIVATE_IND,
3825 hfcmulti_initmode(struct dchannel *dch)
3827 struct hfc_multi *hc = dch->hw;
3839 mode_hfcmulti(hc, hc->dslot, dch->dev.D.protocol,
3841 dch->timer.function = (void *) hfcmulti_dbusy_timer;
3842 dch->timer.data = (long) dch;
3843 init_timer(&dch->timer);
3879 if (dch->dev.D.protocol == ISDN_P_NT_E1) {
3940 i = dch->slot;
3944 mode_hfcmulti(hc, i, dch->dev.D.protocol, -1, 0, -1, 0);
3945 dch->timer.function = (void *)hfcmulti_dbusy_timer;
3946 dch->timer.data = (long) dch;
3947 init_timer(&dch->timer);
3962 if (dch->dev.D.protocol == ISDN_P_NT_S0) {
3991 if ((dch->dev.D.protocol == ISDN_P_NT_S0) ||
4008 ~(1 << hc->chan[dch->slot].port);
4018 open_dchannel(struct hfc_multi *hc, struct dchannel *dch,
4026 dch->dev.id, __builtin_return_address(0));
4029 if ((dch->dev.D.protocol != ISDN_P_NONE) &&
4030 (dch->dev.D.protocol != rq->protocol)) {
4033 __func__, dch->dev.D.protocol, rq->protocol);
4035 if ((dch->dev.D.protocol == ISDN_P_TE_S0) &&
4037 l1_event(dch->l1, CLOSE_CHANNEL);
4038 if (dch->dev.D.protocol != rq->protocol) {
4040 err = create_l1(dch, hfcm_l1callback);
4044 dch->dev.D.protocol = rq->protocol;
4046 hfcmulti_initmode(dch);
4050 if (((rq->protocol == ISDN_P_NT_S0) && (dch->state == 3)) ||
4051 ((rq->protocol == ISDN_P_TE_S0) && (dch->state == 7)) ||
4052 ((rq->protocol == ISDN_P_NT_E1) && (dch->state == 1)) ||
4053 ((rq->protocol == ISDN_P_TE_E1) && (dch->state == 1))) {
4054 _queue_data(&dch->dev.D, PH_ACTIVATE_IND, MISDN_ID_ANY,
4057 rq->ch = &dch->dev.D;
4064 open_bchannel(struct hfc_multi *hc, struct dchannel *dch,
4070 if (!test_channelmap(rq->adr.channel, dch->dev.channelmap))
4077 ch = (rq->adr.channel - 1) + (dch->slot - 2);
4099 channel_dctrl(struct dchannel *dch, struct mISDN_ctrl_req *cq)
4101 struct hfc_multi *hc = dch->hw;
4150 struct dchannel *dch = container_of(dev, struct dchannel, dev);
4151 struct hfc_multi *hc = dch->hw;
4156 if (dch->debug & DEBUG_HW)
4169 err = open_dchannel(hc, dch, rq); /* locked there */
4177 err = open_dchannel(hc, dch, rq); /* locked there */
4181 err = open_bchannel(hc, dch, rq);
4188 __func__, dch->dev.id,
4194 err = channel_dctrl(dch, arg);
4198 if (dch->debug & DEBUG_HW)
4492 release_port(struct hfc_multi *hc, struct dchannel *dch)
4498 ci = dch->slot;
4515 if (dch->dev.D.protocol == ISDN_P_TE_S0)
4516 l1_event(dch->l1, CLOSE_CHANNEL);
4518 hc->chan[ci].dch = NULL;
4522 mISDN_unregister_device(&dch->dev);
4527 if (dch->timer.function) {
4528 del_timer(&dch->timer);
4529 dch->timer.function = NULL;
4596 mISDN_freedchannel(dch);
4597 kfree(dch);
4632 if (hc->chan[ch].dch)
4633 release_port(hc, hc->chan[ch].dch);
4665 struct dchannel *dch;
4670 dch = kzalloc(sizeof(struct dchannel), GFP_KERNEL);
4671 if (!dch)
4673 dch->debug = debug;
4674 mISDN_initdchannel(dch, MAX_DFRAME_LEN_L1, ph_state_change);
4675 dch->hw = hc;
4676 dch->dev.Dprotocols = (1 << ISDN_P_TE_E1) | (1 << ISDN_P_NT_E1);
4677 dch->dev.Bprotocols = (1 << (ISDN_P_B_RAW & ISDN_P_B_MASK)) |
4679 dch->dev.D.send = handle_dmsg;
4680 dch->dev.D.ctrl = hfcm_dctrl;
4681 dch->dev.nrbchan = (hc->dslot) ? 30 : 31;
4682 dch->slot = hc->dslot;
4683 hc->chan[hc->dslot].dch = dch;
4712 list_add(&bch->ch.list, &dch->dev.bchannels);
4715 set_channelmap(bch->nr, dch->dev.channelmap);
4822 ret = mISDN_register_device(&dch->dev, &hc->pci_dev->dev, name);
4828 release_port(hc, dch);
4835 struct dchannel *dch;
4840 dch = kzalloc(sizeof(struct dchannel), GFP_KERNEL);
4841 if (!dch)
4843 dch->debug = debug;
4844 mISDN_initdchannel(dch, MAX_DFRAME_LEN_L1, ph_state_change);
4845 dch->hw = hc;
4846 dch->dev.Dprotocols = (1 << ISDN_P_TE_S0) | (1 << ISDN_P_NT_S0);
4847 dch->dev.Bprotocols = (1 << (ISDN_P_B_RAW & ISDN_P_B_MASK)) |
4849 dch->dev.D.send = handle_dmsg;
4850 dch->dev.D.ctrl = hfcm_dctrl;
4851 dch->dev.nrbchan = 2;
4853 dch->slot = i + 2;
4854 hc->chan[i + 2].dch = dch;
4857 for (ch = 0; ch < dch->dev.nrbchan; ch++) {
4881 list_add(&bch->ch.list, &dch->dev.bchannels);
4884 set_channelmap(bch->nr, dch->dev.channelmap);
4893 if (dch->dev.D.protocol != ISDN_P_TE_S0) {
4934 ret = mISDN_register_device(&dch->dev, NULL, name);
4938 ret = mISDN_register_device(&dch->dev, &hc->pci_dev->dev, name);
4945 release_port(hc, dch);
5098 release_port(hc, hc->chan[(pt << 2) + 2].dch);