Lines Matching +full:p +full:- +full:mos

1 // SPDX-License-Identifier: GPL-2.0-only
27 #define ReadISAC(is, o) (is->read_reg(is->dch.hw, o + is->off))
28 #define WriteISAC(is, o, v) (is->write_reg(is->dch.hw, o + is->off, v))
29 #define ReadHSCX(h, o) (h->ip->read_reg(h->ip->hw, h->off + o))
30 #define WriteHSCX(h, o, v) (h->ip->write_reg(h->ip->hw, h->off + o, v))
31 #define ReadIPAC(ip, o) (ip->read_reg(ip->hw, o))
32 #define WriteIPAC(ip, o, v) (ip->write_reg(ip->hw, o, v))
37 pr_debug("%s: ph_command %x\n", isac->name, command); in ph_command()
38 if (isac->type & IPAC_TYPE_ISACX) in ph_command()
47 switch (isac->state) { in isac_ph_state_change()
52 schedule_event(&isac->dch, FLG_PHCHANGE); in isac_ph_state_change()
60 switch (isac->state) { in isac_ph_state_bh()
63 dch->state = 0; in isac_ph_state_bh()
64 l1_event(dch->l1, HW_RESET_IND); in isac_ph_state_bh()
67 dch->state = 3; in isac_ph_state_bh()
68 l1_event(dch->l1, HW_DEACT_CNF); in isac_ph_state_bh()
72 dch->state = 3; in isac_ph_state_bh()
73 l1_event(dch->l1, HW_DEACT_IND); in isac_ph_state_bh()
76 dch->state = 4; in isac_ph_state_bh()
77 l1_event(dch->l1, HW_POWERUP_IND); in isac_ph_state_bh()
80 if (dch->state <= 5) { in isac_ph_state_bh()
81 dch->state = 5; in isac_ph_state_bh()
82 l1_event(dch->l1, ANYSIGNAL); in isac_ph_state_bh()
84 dch->state = 8; in isac_ph_state_bh()
85 l1_event(dch->l1, LOSTFRAMING); in isac_ph_state_bh()
89 dch->state = 6; in isac_ph_state_bh()
90 l1_event(dch->l1, INFO2); in isac_ph_state_bh()
93 dch->state = 7; in isac_ph_state_bh()
94 l1_event(dch->l1, INFO4_P8); in isac_ph_state_bh()
97 dch->state = 7; in isac_ph_state_bh()
98 l1_event(dch->l1, INFO4_P10); in isac_ph_state_bh()
101 pr_debug("%s: TE newstate %x\n", isac->name, dch->state); in isac_ph_state_bh()
109 pr_debug("%s: %s %d\n", isac->name, __func__, count); in isac_empty_fifo()
111 if (!isac->dch.rx_skb) { in isac_empty_fifo()
112 isac->dch.rx_skb = mI_alloc_skb(isac->dch.maxlen, GFP_ATOMIC); in isac_empty_fifo()
113 if (!isac->dch.rx_skb) { in isac_empty_fifo()
114 pr_info("%s: D receive out of memory\n", isac->name); in isac_empty_fifo()
119 if ((isac->dch.rx_skb->len + count) >= isac->dch.maxlen) { in isac_empty_fifo()
120 pr_debug("%s: %s overrun %d\n", isac->name, __func__, in isac_empty_fifo()
121 isac->dch.rx_skb->len + count); in isac_empty_fifo()
125 ptr = skb_put(isac->dch.rx_skb, count); in isac_empty_fifo()
126 isac->read_fifo(isac->dch.hw, isac->off, ptr, count); in isac_empty_fifo()
128 if (isac->dch.debug & DEBUG_HW_DFIFO) { in isac_empty_fifo()
131 snprintf(pfx, MISDN_MAX_IDLEN + 15, "D-recv %s %d ", in isac_empty_fifo()
132 isac->name, count); in isac_empty_fifo()
143 if (!isac->dch.tx_skb) in isac_fill_fifo()
145 count = isac->dch.tx_skb->len - isac->dch.tx_idx; in isac_fill_fifo()
154 pr_debug("%s: %s %d\n", isac->name, __func__, count); in isac_fill_fifo()
155 ptr = isac->dch.tx_skb->data + isac->dch.tx_idx; in isac_fill_fifo()
156 isac->dch.tx_idx += count; in isac_fill_fifo()
157 isac->write_fifo(isac->dch.hw, isac->off, ptr, count); in isac_fill_fifo()
159 if (test_and_set_bit(FLG_BUSY_TIMER, &isac->dch.Flags)) { in isac_fill_fifo()
160 pr_debug("%s: %s dbusytimer running\n", isac->name, __func__); in isac_fill_fifo()
161 del_timer(&isac->dch.timer); in isac_fill_fifo()
163 isac->dch.timer.expires = jiffies + ((DBUSY_TIMER_VALUE * HZ)/1000); in isac_fill_fifo()
164 add_timer(&isac->dch.timer); in isac_fill_fifo()
165 if (isac->dch.debug & DEBUG_HW_DFIFO) { in isac_fill_fifo()
168 snprintf(pfx, MISDN_MAX_IDLEN + 15, "D-send %s %d ", in isac_fill_fifo()
169 isac->name, count); in isac_fill_fifo()
182 pr_debug("%s: ISAC RDO\n", isac->name); in isac_rme_irq()
184 isac->dch.err_rx++; in isac_rme_irq()
188 pr_debug("%s: ISAC CRC error\n", isac->name); in isac_rme_irq()
190 isac->dch.err_crc++; in isac_rme_irq()
194 dev_kfree_skb(isac->dch.rx_skb); in isac_rme_irq()
195 isac->dch.rx_skb = NULL; in isac_rme_irq()
201 recv_Dchannel(&isac->dch); in isac_rme_irq()
208 if (test_and_clear_bit(FLG_BUSY_TIMER, &isac->dch.Flags)) in isac_xpr_irq()
209 del_timer(&isac->dch.timer); in isac_xpr_irq()
210 if (isac->dch.tx_skb && isac->dch.tx_idx < isac->dch.tx_skb->len) { in isac_xpr_irq()
213 dev_kfree_skb(isac->dch.tx_skb); in isac_xpr_irq()
214 if (get_next_dframe(&isac->dch)) in isac_xpr_irq()
222 if (test_and_clear_bit(FLG_BUSY_TIMER, &isac->dch.Flags)) in isac_retransmit()
223 del_timer(&isac->dch.timer); in isac_retransmit()
224 if (test_bit(FLG_TX_BUSY, &isac->dch.Flags)) { in isac_retransmit()
226 isac->dch.tx_idx = 0; in isac_retransmit()
228 } else if (isac->dch.tx_skb) { /* should not happen */ in isac_retransmit()
229 pr_info("%s: tx_skb exist but not busy\n", isac->name); in isac_retransmit()
230 test_and_set_bit(FLG_TX_BUSY, &isac->dch.Flags); in isac_retransmit()
231 isac->dch.tx_idx = 0; in isac_retransmit()
234 pr_info("%s: ISAC XDU no TX_BUSY\n", isac->name); in isac_retransmit()
235 if (get_next_dframe(&isac->dch)) in isac_retransmit()
247 pr_debug("%s: ISAC MOSR %02x\n", isac->name, val); in isac_mos_irq()
250 if (!isac->mon_rx) { in isac_mos_irq()
251 isac->mon_rx = kmalloc(MAX_MON_FRAME, GFP_ATOMIC); in isac_mos_irq()
252 if (!isac->mon_rx) { in isac_mos_irq()
254 isac->name); in isac_mos_irq()
255 isac->mocr &= 0xf0; in isac_mos_irq()
256 isac->mocr |= 0x0a; in isac_mos_irq()
257 WriteISAC(isac, ISAC_MOCR, isac->mocr); in isac_mos_irq()
260 isac->mon_rxp = 0; in isac_mos_irq()
262 if (isac->mon_rxp >= MAX_MON_FRAME) { in isac_mos_irq()
263 isac->mocr &= 0xf0; in isac_mos_irq()
264 isac->mocr |= 0x0a; in isac_mos_irq()
265 WriteISAC(isac, ISAC_MOCR, isac->mocr); in isac_mos_irq()
266 isac->mon_rxp = 0; in isac_mos_irq()
267 pr_debug("%s: ISAC MON RX overflow!\n", isac->name); in isac_mos_irq()
270 isac->mon_rx[isac->mon_rxp++] = ReadISAC(isac, ISAC_MOR0); in isac_mos_irq()
271 pr_debug("%s: ISAC MOR0 %02x\n", isac->name, in isac_mos_irq()
272 isac->mon_rx[isac->mon_rxp - 1]); in isac_mos_irq()
273 if (isac->mon_rxp == 1) { in isac_mos_irq()
274 isac->mocr |= 0x04; in isac_mos_irq()
275 WriteISAC(isac, ISAC_MOCR, isac->mocr); in isac_mos_irq()
280 if (!isac->mon_rx) { in isac_mos_irq()
281 isac->mon_rx = kmalloc(MAX_MON_FRAME, GFP_ATOMIC); in isac_mos_irq()
282 if (!isac->mon_rx) { in isac_mos_irq()
284 isac->name); in isac_mos_irq()
285 isac->mocr &= 0x0f; in isac_mos_irq()
286 isac->mocr |= 0xa0; in isac_mos_irq()
287 WriteISAC(isac, ISAC_MOCR, isac->mocr); in isac_mos_irq()
290 isac->mon_rxp = 0; in isac_mos_irq()
292 if (isac->mon_rxp >= MAX_MON_FRAME) { in isac_mos_irq()
293 isac->mocr &= 0x0f; in isac_mos_irq()
294 isac->mocr |= 0xa0; in isac_mos_irq()
295 WriteISAC(isac, ISAC_MOCR, isac->mocr); in isac_mos_irq()
296 isac->mon_rxp = 0; in isac_mos_irq()
297 pr_debug("%s: ISAC MON RX overflow!\n", isac->name); in isac_mos_irq()
300 isac->mon_rx[isac->mon_rxp++] = ReadISAC(isac, ISAC_MOR1); in isac_mos_irq()
301 pr_debug("%s: ISAC MOR1 %02x\n", isac->name, in isac_mos_irq()
302 isac->mon_rx[isac->mon_rxp - 1]); in isac_mos_irq()
303 isac->mocr |= 0x40; in isac_mos_irq()
304 WriteISAC(isac, ISAC_MOCR, isac->mocr); in isac_mos_irq()
308 isac->mocr &= 0xf0; in isac_mos_irq()
309 WriteISAC(isac, ISAC_MOCR, isac->mocr); in isac_mos_irq()
310 isac->mocr |= 0x0a; in isac_mos_irq()
311 WriteISAC(isac, ISAC_MOCR, isac->mocr); in isac_mos_irq()
312 if (isac->monitor) { in isac_mos_irq()
313 ret = isac->monitor(isac->dch.hw, MONITOR_RX_0, in isac_mos_irq()
314 isac->mon_rx, isac->mon_rxp); in isac_mos_irq()
316 kfree(isac->mon_rx); in isac_mos_irq()
319 isac->name, isac->mon_rxp); in isac_mos_irq()
320 kfree(isac->mon_rx); in isac_mos_irq()
322 isac->mon_rx = NULL; in isac_mos_irq()
323 isac->mon_rxp = 0; in isac_mos_irq()
326 isac->mocr &= 0x0f; in isac_mos_irq()
327 WriteISAC(isac, ISAC_MOCR, isac->mocr); in isac_mos_irq()
328 isac->mocr |= 0xa0; in isac_mos_irq()
329 WriteISAC(isac, ISAC_MOCR, isac->mocr); in isac_mos_irq()
330 if (isac->monitor) { in isac_mos_irq()
331 ret = isac->monitor(isac->dch.hw, MONITOR_RX_1, in isac_mos_irq()
332 isac->mon_rx, isac->mon_rxp); in isac_mos_irq()
334 kfree(isac->mon_rx); in isac_mos_irq()
337 isac->name, isac->mon_rxp); in isac_mos_irq()
338 kfree(isac->mon_rx); in isac_mos_irq()
340 isac->mon_rx = NULL; in isac_mos_irq()
341 isac->mon_rxp = 0; in isac_mos_irq()
344 if ((!isac->mon_tx) || (isac->mon_txc && in isac_mos_irq()
345 (isac->mon_txp >= isac->mon_txc) && !(val & 0x08))) { in isac_mos_irq()
346 isac->mocr &= 0xf0; in isac_mos_irq()
347 WriteISAC(isac, ISAC_MOCR, isac->mocr); in isac_mos_irq()
348 isac->mocr |= 0x0a; in isac_mos_irq()
349 WriteISAC(isac, ISAC_MOCR, isac->mocr); in isac_mos_irq()
350 if (isac->mon_txc && (isac->mon_txp >= isac->mon_txc)) { in isac_mos_irq()
351 if (isac->monitor) in isac_mos_irq()
352 isac->monitor(isac->dch.hw, in isac_mos_irq()
355 kfree(isac->mon_tx); in isac_mos_irq()
356 isac->mon_tx = NULL; in isac_mos_irq()
357 isac->mon_txc = 0; in isac_mos_irq()
358 isac->mon_txp = 0; in isac_mos_irq()
361 if (isac->mon_txc && (isac->mon_txp >= isac->mon_txc)) { in isac_mos_irq()
362 if (isac->monitor) in isac_mos_irq()
363 isac->monitor(isac->dch.hw, in isac_mos_irq()
365 kfree(isac->mon_tx); in isac_mos_irq()
366 isac->mon_tx = NULL; in isac_mos_irq()
367 isac->mon_txc = 0; in isac_mos_irq()
368 isac->mon_txp = 0; in isac_mos_irq()
371 WriteISAC(isac, ISAC_MOX0, isac->mon_tx[isac->mon_txp++]); in isac_mos_irq()
372 pr_debug("%s: ISAC %02x -> MOX0\n", isac->name, in isac_mos_irq()
373 isac->mon_tx[isac->mon_txp - 1]); in isac_mos_irq()
377 if ((!isac->mon_tx) || (isac->mon_txc && in isac_mos_irq()
378 (isac->mon_txp >= isac->mon_txc) && !(val & 0x80))) { in isac_mos_irq()
379 isac->mocr &= 0x0f; in isac_mos_irq()
380 WriteISAC(isac, ISAC_MOCR, isac->mocr); in isac_mos_irq()
381 isac->mocr |= 0xa0; in isac_mos_irq()
382 WriteISAC(isac, ISAC_MOCR, isac->mocr); in isac_mos_irq()
383 if (isac->mon_txc && (isac->mon_txp >= isac->mon_txc)) { in isac_mos_irq()
384 if (isac->monitor) in isac_mos_irq()
385 isac->monitor(isac->dch.hw, in isac_mos_irq()
388 kfree(isac->mon_tx); in isac_mos_irq()
389 isac->mon_tx = NULL; in isac_mos_irq()
390 isac->mon_txc = 0; in isac_mos_irq()
391 isac->mon_txp = 0; in isac_mos_irq()
394 if (isac->mon_txc && (isac->mon_txp >= isac->mon_txc)) { in isac_mos_irq()
395 if (isac->monitor) in isac_mos_irq()
396 isac->monitor(isac->dch.hw, in isac_mos_irq()
398 kfree(isac->mon_tx); in isac_mos_irq()
399 isac->mon_tx = NULL; in isac_mos_irq()
400 isac->mon_txc = 0; in isac_mos_irq()
401 isac->mon_txp = 0; in isac_mos_irq()
404 WriteISAC(isac, ISAC_MOX1, isac->mon_tx[isac->mon_txp++]); in isac_mos_irq()
405 pr_debug("%s: ISAC %02x -> MOX1\n", isac->name, in isac_mos_irq()
406 isac->mon_tx[isac->mon_txp - 1]); in isac_mos_irq()
418 pr_debug("%s: ISAC CIR0 %02X\n", isac->name, val); in isac_cisq_irq()
420 pr_debug("%s: ph_state change %x->%x\n", isac->name, in isac_cisq_irq()
421 isac->state, (val >> 2) & 0xf); in isac_cisq_irq()
422 isac->state = (val >> 2) & 0xf; in isac_cisq_irq()
427 pr_debug("%s: ISAC CIR1 %02X\n", isac->name, val); in isac_cisq_irq()
437 pr_debug("%s: ISACX CIR0 %02X\n", isac->name, val); in isacsx_cic_irq()
439 pr_debug("%s: ph_state change %x->%x\n", isac->name, in isacsx_cic_irq()
440 isac->state, val >> 4); in isacsx_cic_irq()
441 isac->state = val >> 4; in isacsx_cic_irq()
458 pr_debug("%s: RSTAD %#x, dropped\n", isac->name, val); in isacsx_rme_irq()
461 isac->dch.err_rx++; in isacsx_rme_irq()
463 isac->dch.err_crc++; in isacsx_rme_irq()
466 dev_kfree_skb(isac->dch.rx_skb); in isacsx_rme_irq()
467 isac->dch.rx_skb = NULL; in isacsx_rme_irq()
473 if (isac->dch.rx_skb) { in isacsx_rme_irq()
474 skb_trim(isac->dch.rx_skb, isac->dch.rx_skb->len - 1); in isacsx_rme_irq()
475 pr_debug("%s: dchannel received %d\n", isac->name, in isacsx_rme_irq()
476 isac->dch.rx_skb->len); in isacsx_rme_irq()
477 recv_Dchannel(&isac->dch); in isacsx_rme_irq()
487 pr_debug("%s: ISAC interrupt %02x\n", isac->name, val); in mISDNisac_irq()
488 if (isac->type & IPAC_TYPE_ISACX) { in mISDNisac_irq()
493 pr_debug("%s: ISTAD %02x\n", isac->name, val); in mISDNisac_irq()
495 pr_debug("%s: ISAC XDU\n", isac->name); in mISDNisac_irq()
497 isac->dch.err_tx++; in mISDNisac_irq()
502 pr_debug("%s: ISAC XMR\n", isac->name); in mISDNisac_irq()
504 isac->dch.err_tx++; in mISDNisac_irq()
511 pr_debug("%s: ISAC RFO\n", isac->name); in mISDNisac_irq()
528 if (val & 0x20) /* RSC - never */ in mISDNisac_irq()
529 pr_debug("%s: ISAC RSC interrupt\n", isac->name); in mISDNisac_irq()
530 if (val & 0x02) /* SIN - never */ in mISDNisac_irq()
531 pr_debug("%s: ISAC SIN interrupt\n", isac->name); in mISDNisac_irq()
534 pr_debug("%s: ISAC EXIR %02x\n", isac->name, val); in mISDNisac_irq()
536 pr_debug("%s: ISAC XMR\n", isac->name); in mISDNisac_irq()
538 pr_debug("%s: ISAC XDU\n", isac->name); in mISDNisac_irq()
540 isac->dch.err_tx++; in mISDNisac_irq()
544 if (val & 0x04) /* MOS */ in mISDNisac_irq()
558 int ret = -EINVAL; in isac_l1hw()
563 switch (hh->prim) { in isac_l1hw()
565 spin_lock_irqsave(isac->hwlock, flags); in isac_l1hw()
568 id = hh->id; /* skb can be freed */ in isac_l1hw()
571 spin_unlock_irqrestore(isac->hwlock, flags); in isac_l1hw()
574 spin_unlock_irqrestore(isac->hwlock, flags); in isac_l1hw()
577 ret = l1_event(dch->l1, hh->prim); in isac_l1hw()
580 test_and_clear_bit(FLG_L2_ACTIVATED, &dch->Flags); in isac_l1hw()
581 ret = l1_event(dch->l1, hh->prim); in isac_l1hw()
599 spin_lock_irqsave(isac->hwlock, flags); in isac_ctrl()
600 if (!(isac->type & IPAC_TYPE_ISACX)) { in isac_ctrl()
613 spin_unlock_irqrestore(isac->hwlock, flags); in isac_ctrl()
616 ret = l1_event(isac->dch.l1, HW_TIMER3_VALUE | (para & 0xff)); in isac_ctrl()
619 pr_debug("%s: %s unknown command %x %lx\n", isac->name, in isac_ctrl()
621 ret = -1; in isac_ctrl()
632 pr_debug("%s: cmd(%x) state(%02x)\n", isac->name, cmd, isac->state); in isac_l1cmd()
635 spin_lock_irqsave(isac->hwlock, flags); in isac_l1cmd()
637 spin_unlock_irqrestore(isac->hwlock, flags); in isac_l1cmd()
640 spin_lock_irqsave(isac->hwlock, flags); in isac_l1cmd()
642 spin_unlock_irqrestore(isac->hwlock, flags); in isac_l1cmd()
645 spin_lock_irqsave(isac->hwlock, flags); in isac_l1cmd()
646 if ((isac->state == ISAC_IND_EI) || in isac_l1cmd()
647 (isac->state == ISAC_IND_DR) || in isac_l1cmd()
648 (isac->state == ISAC_IND_DR6) || in isac_l1cmd()
649 (isac->state == ISAC_IND_RS)) in isac_l1cmd()
653 spin_unlock_irqrestore(isac->hwlock, flags); in isac_l1cmd()
656 skb_queue_purge(&dch->squeue); in isac_l1cmd()
657 if (dch->tx_skb) { in isac_l1cmd()
658 dev_kfree_skb(dch->tx_skb); in isac_l1cmd()
659 dch->tx_skb = NULL; in isac_l1cmd()
661 dch->tx_idx = 0; in isac_l1cmd()
662 if (dch->rx_skb) { in isac_l1cmd()
663 dev_kfree_skb(dch->rx_skb); in isac_l1cmd()
664 dch->rx_skb = NULL; in isac_l1cmd()
666 test_and_clear_bit(FLG_TX_BUSY, &dch->Flags); in isac_l1cmd()
667 if (test_and_clear_bit(FLG_BUSY_TIMER, &dch->Flags)) in isac_l1cmd()
668 del_timer(&dch->timer); in isac_l1cmd()
671 spin_lock_irqsave(isac->hwlock, flags); in isac_l1cmd()
673 spin_unlock_irqrestore(isac->hwlock, flags); in isac_l1cmd()
676 test_and_set_bit(FLG_ACTIVE, &dch->Flags); in isac_l1cmd()
677 _queue_data(&dch->dev.D, cmd, MISDN_ID_ANY, 0, NULL, in isac_l1cmd()
681 test_and_clear_bit(FLG_ACTIVE, &dch->Flags); in isac_l1cmd()
682 _queue_data(&dch->dev.D, cmd, MISDN_ID_ANY, 0, NULL, in isac_l1cmd()
686 pr_debug("%s: %s unknown command %x\n", isac->name, in isac_l1cmd()
688 return -1; in isac_l1cmd()
696 if (isac->type & IPAC_TYPE_ISACX) in isac_release()
698 else if (isac->type != 0) in isac_release()
700 if (isac->dch.timer.function != NULL) { in isac_release()
701 del_timer(&isac->dch.timer); in isac_release()
702 isac->dch.timer.function = NULL; in isac_release()
704 kfree(isac->mon_rx); in isac_release()
705 isac->mon_rx = NULL; in isac_release()
706 kfree(isac->mon_tx); in isac_release()
707 isac->mon_tx = NULL; in isac_release()
708 if (isac->dch.l1) in isac_release()
709 l1_event(isac->dch.l1, CLOSE_CHANNEL); in isac_release()
710 mISDN_freedchannel(&isac->dch); in isac_release()
720 if (test_bit(FLG_BUSY_TIMER, &isac->dch.Flags)) { in dbusy_timer_handler()
721 spin_lock_irqsave(isac->hwlock, flags); in dbusy_timer_handler()
724 pr_debug("%s: D-Channel Busy RBCH %02x STAR %02x\n", in dbusy_timer_handler()
725 isac->name, rbch, star); in dbusy_timer_handler()
726 if (rbch & ISAC_RBCH_XAC) /* D-Channel Busy */ in dbusy_timer_handler()
727 test_and_set_bit(FLG_L1_BUSY, &isac->dch.Flags); in dbusy_timer_handler()
730 test_and_clear_bit(FLG_BUSY_TIMER, &isac->dch.Flags); in dbusy_timer_handler()
731 if (isac->dch.tx_idx) in dbusy_timer_handler()
732 isac->dch.tx_idx = 0; in dbusy_timer_handler()
734 pr_info("%s: ISAC D-Channel Busy no tx_idx\n", in dbusy_timer_handler()
735 isac->name); in dbusy_timer_handler()
739 spin_unlock_irqrestore(isac->hwlock, flags); in dbusy_timer_handler()
746 pr_debug("%s: %s dev(%d) open from %p\n", isac->name, __func__, in open_dchannel_caller()
747 isac->dch.dev.id, caller); in open_dchannel_caller()
748 if (rq->protocol != ISDN_P_TE_S0) in open_dchannel_caller()
749 return -EINVAL; in open_dchannel_caller()
750 if (rq->adr.channel == 1) in open_dchannel_caller()
751 /* E-Channel not supported */ in open_dchannel_caller()
752 return -EINVAL; in open_dchannel_caller()
753 rq->ch = &isac->dch.dev.D; in open_dchannel_caller()
754 rq->ch->protocol = rq->protocol; in open_dchannel_caller()
755 if (isac->dch.state == 7) in open_dchannel_caller()
756 _queue_data(rq->ch, PH_ACTIVATE_IND, MISDN_ID_ANY, in open_dchannel_caller()
777 if (!isac->dch.l1) { in isac_init()
778 err = create_l1(&isac->dch, isac_l1cmd); in isac_init()
782 isac->mon_tx = NULL; in isac_init()
783 isac->mon_rx = NULL; in isac_init()
784 timer_setup(&isac->dch.timer, dbusy_timer_handler, 0); in isac_init()
785 isac->mocr = 0xaa; in isac_init()
786 if (isac->type & IPAC_TYPE_ISACX) { in isac_init()
790 pr_debug("%s: ISACX STARD %x\n", isac->name, val); in isac_init()
792 pr_debug("%s: ISACX ISTAD %x\n", isac->name, val); in isac_init()
794 pr_debug("%s: ISACX ISTA %x\n", isac->name, val); in isac_init()
803 if (isac->dch.debug & DEBUG_HW) in isac_init()
805 isac->name, val & 0x3f); in isac_init()
807 pr_debug("%s: ISACX CIR0 %02X\n", isac->name, val); in isac_init()
808 isac->state = val >> 4; in isac_init()
816 pr_debug("%s: ISAC STAR %x\n", isac->name, val); in isac_init()
818 pr_debug("%s: ISAC MODE %x\n", isac->name, val); in isac_init()
820 pr_debug("%s: ISAC ADF2 %x\n", isac->name, val); in isac_init()
822 pr_debug("%s: ISAC ISTA %x\n", isac->name, val); in isac_init()
825 pr_debug("%s: ISAC EXIR %x\n", isac->name, val); in isac_init()
828 if (isac->dch.debug & DEBUG_HW) in isac_init()
829 pr_notice("%s: ISAC version (%x): %s\n", isac->name, in isac_init()
831 isac->type |= ((val >> 5) & 3); in isac_init()
832 if (!isac->adf2) in isac_init()
833 isac->adf2 = 0x80; in isac_init()
834 if (!(isac->adf2 & 0x80)) { /* only IOM 2 Mode */ in isac_init()
836 isac->name, isac->adf2); in isac_init()
838 return -EINVAL; in isac_init()
840 WriteISAC(isac, ISAC_ADF2, isac->adf2); in isac_init()
848 pr_debug("%s: ISAC CIR0 %x\n", isac->name, val); in isac_init()
849 isac->state = (val >> 2) & 0xf; in isac_init()
860 mISDN_initdchannel(&isac->dch, MAX_DFRAME_LEN_L1, isac_ph_state_bh); in mISDNisac_init()
861 isac->dch.hw = hw; in mISDNisac_init()
862 isac->dch.dev.D.send = isac_l1hw; in mISDNisac_init()
863 isac->init = isac_init; in mISDNisac_init()
864 isac->release = isac_release; in mISDNisac_init()
865 isac->ctrl = isac_ctrl; in mISDNisac_init()
866 isac->open = open_dchannel; in mISDNisac_init()
867 isac->dch.dev.Dprotocols = (1 << ISDN_P_TE_S0); in mISDNisac_init()
868 isac->dch.dev.nrbchan = 2; in mISDNisac_init()
883 to--; in waitforCEC()
886 pr_debug("%s: B%1d CEC %d us\n", hx->ip->name, hx->bch.nr, in waitforCEC()
887 50 - to); in waitforCEC()
889 pr_info("%s: B%1d CEC timeout\n", hx->ip->name, hx->bch.nr); in waitforCEC()
903 to--; in waitforXFW()
906 pr_debug("%s: B%1d XFW %d us\n", hx->ip->name, hx->bch.nr, in waitforXFW()
907 50 - to); in waitforXFW()
909 pr_info("%s: B%1d XFW timeout\n", hx->ip->name, hx->bch.nr); in waitforXFW()
915 if (hx->ip->type & IPAC_TYPE_IPACX) in hscx_cmdr()
926 u8 *p; in hscx_empty_fifo() local
929 pr_debug("%s: B%1d %d\n", hscx->ip->name, hscx->bch.nr, count); in hscx_empty_fifo()
930 if (test_bit(FLG_RX_OFF, &hscx->bch.Flags)) { in hscx_empty_fifo()
931 hscx->bch.dropcnt += count; in hscx_empty_fifo()
935 maxlen = bchannel_get_rxbuf(&hscx->bch, count); in hscx_empty_fifo()
938 if (hscx->bch.rx_skb) in hscx_empty_fifo()
939 skb_trim(hscx->bch.rx_skb, 0); in hscx_empty_fifo()
941 hscx->ip->name, hscx->bch.nr, count); in hscx_empty_fifo()
944 p = skb_put(hscx->bch.rx_skb, count); in hscx_empty_fifo()
946 if (hscx->ip->type & IPAC_TYPE_IPACX) in hscx_empty_fifo()
947 hscx->ip->read_fifo(hscx->ip->hw, in hscx_empty_fifo()
948 hscx->off + IPACX_RFIFOB, p, count); in hscx_empty_fifo()
950 hscx->ip->read_fifo(hscx->ip->hw, in hscx_empty_fifo()
951 hscx->off, p, count); in hscx_empty_fifo()
955 if (hscx->bch.debug & DEBUG_HW_BFIFO) { in hscx_empty_fifo()
956 snprintf(hscx->log, 64, "B%1d-recv %s %d ", in hscx_empty_fifo()
957 hscx->bch.nr, hscx->ip->name, count); in hscx_empty_fifo()
958 print_hex_dump_bytes(hscx->log, DUMP_PREFIX_OFFSET, p, count); in hscx_empty_fifo()
966 u8 *p; in hscx_fill_fifo() local
968 if (!hscx->bch.tx_skb) { in hscx_fill_fifo()
969 if (!test_bit(FLG_TX_EMPTY, &hscx->bch.Flags)) in hscx_fill_fifo()
971 count = hscx->fifo_size; in hscx_fill_fifo()
973 p = hscx->log; in hscx_fill_fifo()
974 memset(p, hscx->bch.fill[0], count); in hscx_fill_fifo()
976 count = hscx->bch.tx_skb->len - hscx->bch.tx_idx; in hscx_fill_fifo()
979 p = hscx->bch.tx_skb->data + hscx->bch.tx_idx; in hscx_fill_fifo()
981 more = test_bit(FLG_TRANSPARENT, &hscx->bch.Flags) ? 1 : 0; in hscx_fill_fifo()
982 if (count > hscx->fifo_size) { in hscx_fill_fifo()
983 count = hscx->fifo_size; in hscx_fill_fifo()
986 pr_debug("%s: B%1d %d/%d/%d\n", hscx->ip->name, hscx->bch.nr, in hscx_fill_fifo()
987 count, hscx->bch.tx_idx, hscx->bch.tx_skb->len); in hscx_fill_fifo()
988 hscx->bch.tx_idx += count; in hscx_fill_fifo()
990 if (hscx->ip->type & IPAC_TYPE_IPACX) in hscx_fill_fifo()
991 hscx->ip->write_fifo(hscx->ip->hw, in hscx_fill_fifo()
992 hscx->off + IPACX_XFIFOB, p, count); in hscx_fill_fifo()
995 hscx->ip->write_fifo(hscx->ip->hw, in hscx_fill_fifo()
996 hscx->off, p, count); in hscx_fill_fifo()
1000 if (hscx->bch.tx_skb && (hscx->bch.debug & DEBUG_HW_BFIFO)) { in hscx_fill_fifo()
1001 snprintf(hscx->log, 64, "B%1d-send %s %d ", in hscx_fill_fifo()
1002 hscx->bch.nr, hscx->ip->name, count); in hscx_fill_fifo()
1003 print_hex_dump_bytes(hscx->log, DUMP_PREFIX_OFFSET, p, count); in hscx_fill_fifo()
1010 if (hx->bch.tx_skb && hx->bch.tx_idx < hx->bch.tx_skb->len) { in hscx_xpr()
1013 dev_kfree_skb(hx->bch.tx_skb); in hscx_xpr()
1014 if (get_next_bframe(&hx->bch)) { in hscx_xpr()
1016 test_and_clear_bit(FLG_TX_EMPTY, &hx->bch.Flags); in hscx_xpr()
1017 } else if (test_bit(FLG_TX_EMPTY, &hx->bch.Flags)) { in hscx_xpr()
1029 if (hx->ip->type & IPAC_TYPE_IPACX) in ipac_rme()
1033 pr_debug("%s: B%1d RSTAB %02x\n", hx->ip->name, hx->bch.nr, rstab); in ipac_rme()
1037 if (hx->bch.debug & DEBUG_HW_BCHANNEL) in ipac_rme()
1039 hx->ip->name, hx->bch.nr); in ipac_rme()
1042 if (hx->bch.debug & DEBUG_HW_BCHANNEL) in ipac_rme()
1044 hx->ip->name, hx->bch.nr, in ipac_rme()
1045 hx->bch.state); in ipac_rme()
1048 if (hx->bch.debug & DEBUG_HW_BCHANNEL) in ipac_rme()
1050 hx->ip->name, hx->bch.nr); in ipac_rme()
1055 if (hx->ip->type & IPAC_TYPE_IPACX) in ipac_rme()
1059 count &= (hx->fifo_size - 1); in ipac_rme()
1061 count = hx->fifo_size; in ipac_rme()
1063 if (!hx->bch.rx_skb) in ipac_rme()
1065 if (hx->bch.rx_skb->len < 2) { in ipac_rme()
1067 hx->ip->name, hx->bch.nr, hx->bch.rx_skb->len); in ipac_rme()
1068 skb_trim(hx->bch.rx_skb, 0); in ipac_rme()
1070 skb_trim(hx->bch.rx_skb, hx->bch.rx_skb->len - 1); in ipac_rme()
1071 recv_Bchannel(&hx->bch, 0, false); in ipac_rme()
1080 if (hx->ip->type & IPAC_TYPE_IPACX) in ipac_irq()
1082 else if (hx->ip->type & IPAC_TYPE_IPAC) { in ipac_irq()
1084 m = (hx->bch.nr & 1) ? IPAC__EXA : IPAC__EXB; in ipac_irq()
1087 pr_debug("%s: B%1d EXIRB %02x\n", hx->ip->name, in ipac_irq()
1088 hx->bch.nr, exirb); in ipac_irq()
1090 } else if (hx->bch.nr & 2) { /* HSCX B */ in ipac_irq()
1092 ipac_irq(&hx->ip->hscx[0], ista); in ipac_irq()
1095 pr_debug("%s: B%1d EXIRB %02x\n", hx->ip->name, in ipac_irq()
1096 hx->bch.nr, exirb); in ipac_irq()
1103 pr_debug("%s: B%1d EXIRB %02x\n", hx->ip->name, in ipac_irq()
1104 hx->bch.nr, exirb); in ipac_irq()
1112 pr_debug("%s: B%1d ISTAB %02x\n", hx->ip->name, hx->bch.nr, istab); in ipac_irq()
1114 if (!test_bit(FLG_ACTIVE, &hx->bch.Flags)) in ipac_irq()
1121 hscx_empty_fifo(hx, hx->fifo_size); in ipac_irq()
1122 if (test_bit(FLG_TRANSPARENT, &hx->bch.Flags)) in ipac_irq()
1123 recv_Bchannel(&hx->bch, 0, false); in ipac_irq()
1127 pr_debug("%s: B%1d RFO error\n", hx->ip->name, hx->bch.nr); in ipac_irq()
1135 if (test_bit(FLG_TRANSPARENT, &hx->bch.Flags)) { in ipac_irq()
1136 if (test_bit(FLG_FILLEMPTY, &hx->bch.Flags)) in ipac_irq()
1137 test_and_set_bit(FLG_TX_EMPTY, &hx->bch.Flags); in ipac_irq()
1141 pr_debug("%s: B%1d XDU error at len %d\n", hx->ip->name, in ipac_irq()
1142 hx->bch.nr, hx->bch.tx_idx); in ipac_irq()
1143 hx->bch.tx_idx = 0; in ipac_irq()
1153 struct isac_hw *isac = &ipac->isac; in mISDNipac_irq()
1155 if (ipac->type & IPAC_TYPE_IPACX) { in mISDNipac_irq()
1157 while (ista && --cnt) { in mISDNipac_irq()
1158 pr_debug("%s: ISTA %02x\n", ipac->name, ista); in mISDNipac_irq()
1160 ipac_irq(&ipac->hscx[0], ista); in mISDNipac_irq()
1162 ipac_irq(&ipac->hscx[1], ista); in mISDNipac_irq()
1164 mISDNisac_irq(&ipac->isac, ista); in mISDNipac_irq()
1167 } else if (ipac->type & IPAC_TYPE_IPAC) { in mISDNipac_irq()
1169 while (ista && --cnt) { in mISDNipac_irq()
1170 pr_debug("%s: ISTA %02x\n", ipac->name, ista); in mISDNipac_irq()
1173 pr_debug("%s: ISTAD %02x\n", ipac->name, istad); in mISDNipac_irq()
1175 pr_debug("%s TIN2 irq\n", ipac->name); in mISDNipac_irq()
1181 ipac_irq(&ipac->hscx[0], ista); in mISDNipac_irq()
1183 ipac_irq(&ipac->hscx[1], ista); in mISDNipac_irq()
1186 } else if (ipac->type & IPAC_TYPE_HSCX) { in mISDNipac_irq()
1187 while (--cnt) { in mISDNipac_irq()
1188 ista = ReadIPAC(ipac, IPAC_ISTAB + ipac->hscx[1].off); in mISDNipac_irq()
1189 pr_debug("%s: B2 ISTA %02x\n", ipac->name, ista); in mISDNipac_irq()
1191 ipac_irq(&ipac->hscx[1], ista); in mISDNipac_irq()
1193 pr_debug("%s: ISTAD %02x\n", ipac->name, istad); in mISDNipac_irq()
1203 pr_debug("%s: %d irqloops cpu%d\n", ipac->name, in mISDNipac_irq()
1204 maxloop - cnt, smp_processor_id()); in mISDNipac_irq()
1206 pr_notice("%s: %d IRQ LOOP cpu%d\n", ipac->name, in mISDNipac_irq()
1215 pr_debug("%s: HSCX %c protocol %x-->%x ch %d\n", hscx->ip->name, in hscx_mode()
1216 '@' + hscx->bch.nr, hscx->bch.state, bprotocol, hscx->bch.nr); in hscx_mode()
1217 if (hscx->ip->type & IPAC_TYPE_IPACX) { in hscx_mode()
1218 if (hscx->bch.nr & 1) { /* B1 and ICA */ in hscx_mode()
1219 WriteIPAC(hscx->ip, ISACX_BCHA_TSDP_BC1, 0x80); in hscx_mode()
1220 WriteIPAC(hscx->ip, ISACX_BCHA_CR, 0x88); in hscx_mode()
1222 WriteIPAC(hscx->ip, ISACX_BCHB_TSDP_BC1, 0x81); in hscx_mode()
1223 WriteIPAC(hscx->ip, ISACX_BCHB_CR, 0x88); in hscx_mode()
1231 test_and_clear_bit(FLG_HDLC, &hscx->bch.Flags); in hscx_mode()
1232 test_and_clear_bit(FLG_TRANSPARENT, &hscx->bch.Flags); in hscx_mode()
1239 test_and_set_bit(FLG_TRANSPARENT, &hscx->bch.Flags); in hscx_mode()
1246 test_and_set_bit(FLG_HDLC, &hscx->bch.Flags); in hscx_mode()
1249 pr_info("%s: protocol not known %x\n", hscx->ip->name, in hscx_mode()
1251 return -ENOPROTOOPT; in hscx_mode()
1253 } else if (hscx->ip->type & IPAC_TYPE_IPAC) { /* IPAC */ in hscx_mode()
1258 WriteHSCX(hscx, IPAC_TSAX, hscx->slot); in hscx_mode()
1259 WriteHSCX(hscx, IPAC_TSAR, hscx->slot); in hscx_mode()
1267 test_and_clear_bit(FLG_HDLC, &hscx->bch.Flags); in hscx_mode()
1268 test_and_clear_bit(FLG_TRANSPARENT, &hscx->bch.Flags); in hscx_mode()
1275 test_and_set_bit(FLG_TRANSPARENT, &hscx->bch.Flags); in hscx_mode()
1282 test_and_set_bit(FLG_HDLC, &hscx->bch.Flags); in hscx_mode()
1285 pr_info("%s: protocol not known %x\n", hscx->ip->name, in hscx_mode()
1287 return -ENOPROTOOPT; in hscx_mode()
1289 } else if (hscx->ip->type & IPAC_TYPE_HSCX) { /* HSCX */ in hscx_mode()
1294 WriteHSCX(hscx, IPAC_TSAX, hscx->slot); in hscx_mode()
1295 WriteHSCX(hscx, IPAC_TSAR, hscx->slot); in hscx_mode()
1303 test_and_clear_bit(FLG_HDLC, &hscx->bch.Flags); in hscx_mode()
1304 test_and_clear_bit(FLG_TRANSPARENT, &hscx->bch.Flags); in hscx_mode()
1311 test_and_set_bit(FLG_TRANSPARENT, &hscx->bch.Flags); in hscx_mode()
1318 test_and_set_bit(FLG_HDLC, &hscx->bch.Flags); in hscx_mode()
1321 pr_info("%s: protocol not known %x\n", hscx->ip->name, in hscx_mode()
1323 return -ENOPROTOOPT; in hscx_mode()
1326 return -EINVAL; in hscx_mode()
1327 hscx->bch.state = bprotocol; in hscx_mode()
1336 int ret = -EINVAL; in hscx_l2l1()
1340 switch (hh->prim) { in hscx_l2l1()
1342 spin_lock_irqsave(hx->ip->hwlock, flags); in hscx_l2l1()
1348 spin_unlock_irqrestore(hx->ip->hwlock, flags); in hscx_l2l1()
1351 spin_lock_irqsave(hx->ip->hwlock, flags); in hscx_l2l1()
1352 if (!test_and_set_bit(FLG_ACTIVE, &bch->Flags)) in hscx_l2l1()
1353 ret = hscx_mode(hx, ch->protocol); in hscx_l2l1()
1356 spin_unlock_irqrestore(hx->ip->hwlock, flags); in hscx_l2l1()
1362 spin_lock_irqsave(hx->ip->hwlock, flags); in hscx_l2l1()
1365 spin_unlock_irqrestore(hx->ip->hwlock, flags); in hscx_l2l1()
1372 hx->ip->name, __func__, hh->prim, hh->id); in hscx_l2l1()
1373 ret = -EINVAL; in hscx_l2l1()
1391 int ret = -EINVAL; in hscx_bctrl()
1394 pr_debug("%s: %s cmd:%x %p\n", hx->ip->name, __func__, cmd, arg); in hscx_bctrl()
1397 test_and_clear_bit(FLG_OPEN, &bch->Flags); in hscx_bctrl()
1398 cancel_work_sync(&bch->workq); in hscx_bctrl()
1399 spin_lock_irqsave(hx->ip->hwlock, flags); in hscx_bctrl()
1402 spin_unlock_irqrestore(hx->ip->hwlock, flags); in hscx_bctrl()
1403 ch->protocol = ISDN_P_NONE; in hscx_bctrl()
1404 ch->peer = NULL; in hscx_bctrl()
1405 module_put(hx->ip->owner); in hscx_bctrl()
1413 hx->ip->name, __func__, cmd); in hscx_bctrl()
1421 isac_release(&ipac->isac); in free_ipac()
1439 if (hx->ip->type & IPAC_TYPE_HSCX) { in hscx_init()
1442 pr_debug("%s: HSCX VSTR %02x\n", hx->ip->name, val); in hscx_init()
1443 if (hx->bch.debug & DEBUG_HW) in hscx_init()
1444 pr_notice("%s: HSCX version %s\n", hx->ip->name, in hscx_init()
1458 if (ipac->type & IPAC_TYPE_HSCX) { in ipac_init()
1459 hscx_init(&ipac->hscx[0]); in ipac_init()
1460 hscx_init(&ipac->hscx[1]); in ipac_init()
1462 } else if (ipac->type & IPAC_TYPE_IPAC) { in ipac_init()
1463 hscx_init(&ipac->hscx[0]); in ipac_init()
1464 hscx_init(&ipac->hscx[1]); in ipac_init()
1468 pr_debug("%s: IPAC CONF %02x/%02x\n", ipac->name, in ipac_init()
1469 val, ipac->conf); in ipac_init()
1470 WriteIPAC(ipac, IPAC_CONF, ipac->conf); in ipac_init()
1472 if (ipac->hscx[0].bch.debug & DEBUG_HW) in ipac_init()
1473 pr_notice("%s: IPAC Design ID %02x\n", ipac->name, val); in ipac_init()
1476 return isac_init(&ipac->isac); in ipac_init()
1484 if (rq->adr.channel == 0 || rq->adr.channel > 2) in open_bchannel()
1485 return -EINVAL; in open_bchannel()
1486 if (rq->protocol == ISDN_P_NONE) in open_bchannel()
1487 return -EINVAL; in open_bchannel()
1488 bch = &ipac->hscx[rq->adr.channel - 1].bch; in open_bchannel()
1489 if (test_and_set_bit(FLG_OPEN, &bch->Flags)) in open_bchannel()
1490 return -EBUSY; /* b-channel can be only open once */ in open_bchannel()
1491 test_and_clear_bit(FLG_FILLEMPTY, &bch->Flags); in open_bchannel()
1492 bch->ch.protocol = rq->protocol; in open_bchannel()
1493 rq->ch = &bch->ch; in open_bchannel()
1502 switch (cq->op) { in channel_ctrl()
1504 cq->op = MISDN_CTRL_LOOP | MISDN_CTRL_L1_TIMER3; in channel_ctrl()
1507 /* cq->channel: 0 disable, 1 B1 loop 2 B2 loop, 3 both */ in channel_ctrl()
1508 if (cq->channel < 0 || cq->channel > 3) { in channel_ctrl()
1509 ret = -EINVAL; in channel_ctrl()
1512 ret = ipac->ctrl(ipac, HW_TESTLOOP, cq->channel); in channel_ctrl()
1515 ret = ipac->isac.ctrl(&ipac->isac, HW_TIMER3_VALUE, cq->p1); in channel_ctrl()
1518 pr_info("%s: unknown CTRL OP %x\n", ipac->name, cq->op); in channel_ctrl()
1519 ret = -EINVAL; in channel_ctrl()
1535 pr_debug("%s: DCTRL: %x %p\n", ipac->name, cmd, arg); in ipac_dctrl()
1539 if (rq->protocol == ISDN_P_TE_S0) in ipac_dctrl()
1545 if (!try_module_get(ipac->owner)) in ipac_dctrl()
1546 pr_info("%s: cannot get module\n", ipac->name); in ipac_dctrl()
1549 pr_debug("%s: dev(%d) close from %p\n", ipac->name, in ipac_dctrl()
1550 dch->dev.id, __builtin_return_address(0)); in ipac_dctrl()
1551 module_put(ipac->owner); in ipac_dctrl()
1557 pr_debug("%s: unknown DCTRL command %x\n", ipac->name, cmd); in ipac_dctrl()
1558 return -EINVAL; in ipac_dctrl()
1569 ipac->hw = hw; in mISDNipac_init()
1570 if (ipac->isac.dch.debug & DEBUG_HW) in mISDNipac_init()
1571 pr_notice("%s: ipac type %x\n", ipac->name, ipac->type); in mISDNipac_init()
1572 if (ipac->type & IPAC_TYPE_HSCX) { in mISDNipac_init()
1573 ipac->isac.type = IPAC_TYPE_ISAC; in mISDNipac_init()
1574 ipac->hscx[0].off = 0; in mISDNipac_init()
1575 ipac->hscx[1].off = 0x40; in mISDNipac_init()
1576 ipac->hscx[0].fifo_size = 32; in mISDNipac_init()
1577 ipac->hscx[1].fifo_size = 32; in mISDNipac_init()
1578 } else if (ipac->type & IPAC_TYPE_IPAC) { in mISDNipac_init()
1579 ipac->isac.type = IPAC_TYPE_IPAC | IPAC_TYPE_ISAC; in mISDNipac_init()
1580 ipac->hscx[0].off = 0; in mISDNipac_init()
1581 ipac->hscx[1].off = 0x40; in mISDNipac_init()
1582 ipac->hscx[0].fifo_size = 64; in mISDNipac_init()
1583 ipac->hscx[1].fifo_size = 64; in mISDNipac_init()
1584 } else if (ipac->type & IPAC_TYPE_IPACX) { in mISDNipac_init()
1585 ipac->isac.type = IPAC_TYPE_IPACX | IPAC_TYPE_ISACX; in mISDNipac_init()
1586 ipac->hscx[0].off = IPACX_OFF_ICA; in mISDNipac_init()
1587 ipac->hscx[1].off = IPACX_OFF_ICB; in mISDNipac_init()
1588 ipac->hscx[0].fifo_size = 64; in mISDNipac_init()
1589 ipac->hscx[1].fifo_size = 64; in mISDNipac_init()
1593 mISDNisac_init(&ipac->isac, hw); in mISDNipac_init()
1595 ipac->isac.dch.dev.D.ctrl = ipac_dctrl; in mISDNipac_init()
1598 ipac->hscx[i].bch.nr = i + 1; in mISDNipac_init()
1599 set_channelmap(i + 1, ipac->isac.dch.dev.channelmap); in mISDNipac_init()
1600 list_add(&ipac->hscx[i].bch.ch.list, in mISDNipac_init()
1601 &ipac->isac.dch.dev.bchannels); in mISDNipac_init()
1602 mISDN_initbchannel(&ipac->hscx[i].bch, MAX_DATA_MEM, in mISDNipac_init()
1603 ipac->hscx[i].fifo_size); in mISDNipac_init()
1604 ipac->hscx[i].bch.ch.nr = i + 1; in mISDNipac_init()
1605 ipac->hscx[i].bch.ch.send = &hscx_l2l1; in mISDNipac_init()
1606 ipac->hscx[i].bch.ch.ctrl = hscx_bctrl; in mISDNipac_init()
1607 ipac->hscx[i].bch.hw = hw; in mISDNipac_init()
1608 ipac->hscx[i].ip = ipac; in mISDNipac_init()
1611 ipac->hscx[i].slot = (i == 0) ? 0x2f : 0x03; in mISDNipac_init()
1614 ipac->init = ipac_init; in mISDNipac_init()
1615 ipac->release = free_ipac; in mISDNipac_init()