Lines Matching defs:dch
26 #define ReadISAC(is, o) (is->read_reg(is->dch.hw, o + is->off))
27 #define WriteISAC(is, o, v) (is->write_reg(is->dch.hw, o + is->off, v))
51 schedule_event(&isac->dch, FLG_PHCHANGE);
55 isac_ph_state_bh(struct dchannel *dch)
57 struct isac_hw *isac = container_of(dch, struct isac_hw, dch);
62 dch->state = 0;
63 l1_event(dch->l1, HW_RESET_IND);
66 dch->state = 3;
67 l1_event(dch->l1, HW_DEACT_CNF);
71 dch->state = 3;
72 l1_event(dch->l1, HW_DEACT_IND);
75 dch->state = 4;
76 l1_event(dch->l1, HW_POWERUP_IND);
79 if (dch->state <= 5) {
80 dch->state = 5;
81 l1_event(dch->l1, ANYSIGNAL);
83 dch->state = 8;
84 l1_event(dch->l1, LOSTFRAMING);
88 dch->state = 6;
89 l1_event(dch->l1, INFO2);
92 dch->state = 7;
93 l1_event(dch->l1, INFO4_P8);
96 dch->state = 7;
97 l1_event(dch->l1, INFO4_P10);
100 pr_debug("%s: TE newstate %x\n", isac->name, dch->state);
110 if (!isac->dch.rx_skb) {
111 isac->dch.rx_skb = mI_alloc_skb(isac->dch.maxlen, GFP_ATOMIC);
112 if (!isac->dch.rx_skb) {
118 if ((isac->dch.rx_skb->len + count) >= isac->dch.maxlen) {
120 isac->dch.rx_skb->len + count);
124 ptr = skb_put(isac->dch.rx_skb, count);
125 isac->read_fifo(isac->dch.hw, isac->off, ptr, count);
127 if (isac->dch.debug & DEBUG_HW_DFIFO) {
142 if (!isac->dch.tx_skb)
144 count = isac->dch.tx_skb->len - isac->dch.tx_idx;
154 ptr = isac->dch.tx_skb->data + isac->dch.tx_idx;
155 isac->dch.tx_idx += count;
156 isac->write_fifo(isac->dch.hw, isac->off, ptr, count);
158 if (test_and_set_bit(FLG_BUSY_TIMER, &isac->dch.Flags)) {
160 del_timer(&isac->dch.timer);
162 isac->dch.timer.expires = jiffies + ((DBUSY_TIMER_VALUE * HZ)/1000);
163 add_timer(&isac->dch.timer);
164 if (isac->dch.debug & DEBUG_HW_DFIFO) {
183 isac->dch.err_rx++;
189 isac->dch.err_crc++;
193 dev_kfree_skb(isac->dch.rx_skb);
194 isac->dch.rx_skb = NULL;
200 recv_Dchannel(&isac->dch);
207 if (test_and_clear_bit(FLG_BUSY_TIMER, &isac->dch.Flags))
208 del_timer(&isac->dch.timer);
209 if (isac->dch.tx_skb && isac->dch.tx_idx < isac->dch.tx_skb->len) {
212 dev_kfree_skb(isac->dch.tx_skb);
213 if (get_next_dframe(&isac->dch))
221 if (test_and_clear_bit(FLG_BUSY_TIMER, &isac->dch.Flags))
222 del_timer(&isac->dch.timer);
223 if (test_bit(FLG_TX_BUSY, &isac->dch.Flags)) {
225 isac->dch.tx_idx = 0;
227 } else if (isac->dch.tx_skb) { /* should not happen */
229 test_and_set_bit(FLG_TX_BUSY, &isac->dch.Flags);
230 isac->dch.tx_idx = 0;
234 if (get_next_dframe(&isac->dch))
312 ret = isac->monitor(isac->dch.hw, MONITOR_RX_0,
330 ret = isac->monitor(isac->dch.hw, MONITOR_RX_1,
351 isac->monitor(isac->dch.hw,
362 isac->monitor(isac->dch.hw,
384 isac->monitor(isac->dch.hw,
395 isac->monitor(isac->dch.hw,
460 isac->dch.err_rx++;
462 isac->dch.err_crc++;
465 dev_kfree_skb(isac->dch.rx_skb);
466 isac->dch.rx_skb = NULL;
472 if (isac->dch.rx_skb) {
473 skb_trim(isac->dch.rx_skb, isac->dch.rx_skb->len - 1);
475 isac->dch.rx_skb->len);
476 recv_Dchannel(&isac->dch);
496 isac->dch.err_tx++;
503 isac->dch.err_tx++;
539 isac->dch.err_tx++;
555 struct dchannel *dch = container_of(dev, struct dchannel, dev);
556 struct isac_hw *isac = container_of(dch, struct isac_hw, dch);
565 ret = dchannel_senddata(dch, skb);
576 ret = l1_event(dch->l1, hh->prim);
579 test_and_clear_bit(FLG_L2_ACTIVATED, &dch->Flags);
580 ret = l1_event(dch->l1, hh->prim);
615 ret = l1_event(isac->dch.l1, HW_TIMER3_VALUE | (para & 0xff));
626 isac_l1cmd(struct dchannel *dch, u32 cmd)
628 struct isac_hw *isac = container_of(dch, struct isac_hw, dch);
655 skb_queue_purge(&dch->squeue);
656 if (dch->tx_skb) {
657 dev_kfree_skb(dch->tx_skb);
658 dch->tx_skb = NULL;
660 dch->tx_idx = 0;
661 if (dch->rx_skb) {
662 dev_kfree_skb(dch->rx_skb);
663 dch->rx_skb = NULL;
665 test_and_clear_bit(FLG_TX_BUSY, &dch->Flags);
666 if (test_and_clear_bit(FLG_BUSY_TIMER, &dch->Flags))
667 del_timer(&dch->timer);
675 test_and_set_bit(FLG_ACTIVE, &dch->Flags);
676 _queue_data(&dch->dev.D, cmd, MISDN_ID_ANY, 0, NULL,
680 test_and_clear_bit(FLG_ACTIVE, &dch->Flags);
681 _queue_data(&dch->dev.D, cmd, MISDN_ID_ANY, 0, NULL,
699 if (isac->dch.timer.function != NULL) {
700 del_timer(&isac->dch.timer);
701 isac->dch.timer.function = NULL;
707 if (isac->dch.l1)
708 l1_event(isac->dch.l1, CLOSE_CHANNEL);
709 mISDN_freedchannel(&isac->dch);
715 struct isac_hw *isac = from_timer(isac, t, dch.timer);
719 if (test_bit(FLG_BUSY_TIMER, &isac->dch.Flags)) {
726 test_and_set_bit(FLG_L1_BUSY, &isac->dch.Flags);
729 test_and_clear_bit(FLG_BUSY_TIMER, &isac->dch.Flags);
730 if (isac->dch.tx_idx)
731 isac->dch.tx_idx = 0;
746 isac->dch.dev.id, caller);
752 rq->ch = &isac->dch.dev.D;
754 if (isac->dch.state == 7)
776 if (!isac->dch.l1) {
777 err = create_l1(&isac->dch, isac_l1cmd);
783 timer_setup(&isac->dch.timer, dbusy_timer_handler, 0);
802 if (isac->dch.debug & DEBUG_HW)
827 if (isac->dch.debug & DEBUG_HW)
859 mISDN_initdchannel(&isac->dch, MAX_DFRAME_LEN_L1, isac_ph_state_bh);
860 isac->dch.hw = hw;
861 isac->dch.dev.D.send = isac_l1hw;
866 isac->dch.dev.Dprotocols = (1 << ISDN_P_TE_S0);
867 isac->dch.dev.nrbchan = 2;
1528 struct dchannel *dch = container_of(dev, struct dchannel, dev);
1529 struct isac_hw *isac = container_of(dch, struct isac_hw, dch);
1549 dch->dev.id, __builtin_return_address(0));
1569 if (ipac->isac.dch.debug & DEBUG_HW)
1594 ipac->isac.dch.dev.D.ctrl = ipac_dctrl;
1598 set_channelmap(i + 1, ipac->isac.dch.dev.channelmap);
1600 &ipac->isac.dch.dev.bchannels);