Lines Matching refs:ch
119 struct comx_channel *ch = dev->priv; in hscx_fill_fifo() local
120 struct mixcom_privdata *hw = ch->HW_privdata; in hscx_fill_fifo()
139 struct comx_channel *ch = dev->priv; in hscx_empty_fifo() local
140 struct mixcom_privdata *hw = ch->HW_privdata; in hscx_empty_fifo()
144 ch->stats.rx_dropped++; in hscx_empty_fifo()
166 struct comx_channel *ch = dev->priv; in MIXCOM_txe() local
167 struct mixcom_privdata *hw = ch->HW_privdata; in MIXCOM_txe()
206 struct comx_channel *ch = dev->priv;
207 struct mixcom_privdata *hw = ch->HW_privdata;
239 struct comx_channel *ch = dev->priv; in mixcom_on() local
248 if (ch->HW_set_clock) ch->HW_set_clock(dev); in mixcom_on()
254 struct comx_channel *ch = dev->priv; in MIXCOM_send_packet() local
255 struct mixcom_privdata *hw = ch->HW_privdata; in MIXCOM_send_packet()
258 if (ch->debug_flags & DEBUG_HW_TX) { in MIXCOM_send_packet()
262 if (!(ch->line_status & LINE_UP)) { in MIXCOM_send_packet()
267 ch->stats.tx_errors++; in MIXCOM_send_packet()
287 ch->stats.tx_packets++; in MIXCOM_send_packet()
288 ch->stats.tx_bytes += skb->len; in MIXCOM_send_packet()
290 if (ch->debug_flags & DEBUG_HW_TX) { in MIXCOM_send_packet()
299 struct comx_channel *ch=dev->priv; in mixcom_receive_frame() local
300 struct mixcom_privdata *hw=ch->HW_privdata; in mixcom_receive_frame()
314 ch->stats.rx_length_errors++; in mixcom_receive_frame()
317 ch->stats.rx_over_errors++; in mixcom_receive_frame()
320 ch->stats.rx_crc_errors++; in mixcom_receive_frame()
323 ch->stats.rx_frame_errors++; in mixcom_receive_frame()
325 ch->stats.rx_packets++; in mixcom_receive_frame()
326 ch->stats.rx_bytes += length; in mixcom_receive_frame()
330 if (ch->debug_flags & DEBUG_HW_RX) { in mixcom_receive_frame()
335 if (ch->LINE_rx) { in mixcom_receive_frame()
336 ch->LINE_rx(dev, hw->recving); in mixcom_receive_frame()
349 struct comx_channel *ch=dev->priv; in mixcom_extended_interrupt() local
350 struct mixcom_privdata *hw=ch->HW_privdata; in mixcom_extended_interrupt()
356 ch->stats.rx_over_errors++; in mixcom_extended_interrupt()
366 ch->stats.tx_errors++; in mixcom_extended_interrupt()
367 ch->stats.tx_aborted_errors++; in mixcom_extended_interrupt()
375 if (ch->LINE_tx) { in mixcom_extended_interrupt()
376 ch->LINE_tx(dev); in mixcom_extended_interrupt()
382 ch->stats.tx_carrier_errors++; in mixcom_extended_interrupt()
384 if (test_and_clear_bit(0, &ch->lineup_pending)) { in mixcom_extended_interrupt()
385 del_timer(&ch->lineup_timer); in mixcom_extended_interrupt()
386 } else if (ch->line_status & LINE_UP) { in mixcom_extended_interrupt()
387 ch->line_status &= ~LINE_UP; in mixcom_extended_interrupt()
388 if (ch->LINE_status) { in mixcom_extended_interrupt()
389 ch->LINE_status(dev,ch->line_status); in mixcom_extended_interrupt()
393 if (!(ch->line_status & LINE_UP) && (rd_hscx(dev, HSCX_STAR) & in mixcom_extended_interrupt()
395 if (!test_and_set_bit(0,&ch->lineup_pending)) { in mixcom_extended_interrupt()
396 ch->lineup_timer.function = comx_lineup_func; in mixcom_extended_interrupt()
397 ch->lineup_timer.data = (unsigned long)dev; in mixcom_extended_interrupt()
398 ch->lineup_timer.expires = jiffies + HZ * in mixcom_extended_interrupt()
399 ch->lineup_delay; in mixcom_extended_interrupt()
400 add_timer(&ch->lineup_timer); in mixcom_extended_interrupt()
418 struct comx_channel *ch, *twin_ch; in MIXCOM_interrupt() local
427 ch = dev->priv; in MIXCOM_interrupt()
428 hw = ch->HW_privdata; in MIXCOM_interrupt()
447 ch->LINE_tx(dev); in MIXCOM_interrupt()
455 if ((ista & HSCX_EXA) && ch->twin) { in MIXCOM_interrupt()
456 mixcom_extended_interrupt(ch->twin); in MIXCOM_interrupt()
459 if ((ista & HSCX_ICA) && ch->twin && in MIXCOM_interrupt()
460 (ista2 = rd_hscx(ch->twin, HSCX_ISTA) & in MIXCOM_interrupt()
463 mixcom_receive_frame(ch->twin); in MIXCOM_interrupt()
466 hscx_empty_fifo(ch->twin, 32); in MIXCOM_interrupt()
469 twin_ch=ch->twin->priv; in MIXCOM_interrupt()
472 hscx_fill_fifo(ch->twin); in MIXCOM_interrupt()
475 ch->LINE_tx(ch->twin); in MIXCOM_interrupt()
487 struct comx_channel *ch = dev->priv; in MIXCOM_open() local
488 struct mixcom_privdata *hw = ch->HW_privdata; in MIXCOM_open()
489 struct proc_dir_entry *procfile = ch->procdir->subdir; in MIXCOM_open()
509 if(hw->channel!=0 || !(ch->init_status & IRQ_ALLOCATED)) { in MIXCOM_open()
520 if(hw->channel==0 && !(ch->init_status & IRQ_ALLOCATED)) { in MIXCOM_open()
531 if(hw->channel==0 && !(ch->init_status & IRQ_ALLOCATED)) { in MIXCOM_open()
532 ch->init_status|=IRQ_ALLOCATED; in MIXCOM_open()
546 ch->init_status |= HW_OPEN; in MIXCOM_open()
549 ch->line_status |= LINE_UP; in MIXCOM_open()
551 ch->line_status &= ~LINE_UP; in MIXCOM_open()
556 ch->LINE_status(dev, ch->line_status); in MIXCOM_open()
577 struct comx_channel *ch = dev->priv; in MIXCOM_close() local
578 struct mixcom_privdata *hw = ch->HW_privdata; in MIXCOM_close()
579 struct proc_dir_entry *procfile = ch->procdir->subdir; in MIXCOM_close()
593 ch->init_status &= ~IRQ_ALLOCATED; in MIXCOM_close()
615 if(!(ch->init_status & IRQ_ALLOCATED)) { in MIXCOM_close()
641 ch->init_status &= ~HW_OPEN; in MIXCOM_close()
647 struct comx_channel *ch = dev->priv; in MIXCOM_statistics() local
651 if(ch->init_status && IRQ_ALLOCATED) { in MIXCOM_statistics()
667 struct comx_channel *ch = dev->priv; in mixcom_read_proc() local
668 struct mixcom_privdata *hw = ch->HW_privdata; in mixcom_read_proc()
682 if (ch->twin) { in mixcom_read_proc()
683 len = sprintf(page, "%s\n",ch->twin->name); in mixcom_read_proc()
704 struct comx_channel *ch = dev->priv; in mixcom_twin_check() local
705 struct proc_dir_entry *procfile = ch->procdir->parent->subdir; in mixcom_twin_check()
706 struct mixcom_privdata *hw = ch->HW_privdata; in mixcom_twin_check()
723 ch->hardware == ch_twin->hardware && in mixcom_twin_check()
756 struct comx_channel *ch = dev->priv; in mixcom_write_proc() local
757 struct mixcom_privdata *hw = ch->HW_privdata; in mixcom_write_proc()
801 if (ch->init_status & HW_OPEN && ch->HW_set_clock) { in mixcom_write_proc()
802 ch->HW_set_clock(dev); in mixcom_write_proc()
825 struct comx_channel *ch = dev->priv; in MIXCOM_init() local
829 if ((ch->HW_privdata = kmalloc(sizeof(struct mixcom_privdata), in MIXCOM_init()
834 memset(hw = ch->HW_privdata, 0, sizeof(struct mixcom_privdata)); in MIXCOM_init()
837 ch->procdir)) == NULL) { in MIXCOM_init()
846 ch->procdir)) == NULL) { in MIXCOM_init()
856 ch->procdir)) == NULL) { in MIXCOM_init()
866 ch->procdir)) == NULL) { in MIXCOM_init()
875 ch->procdir)) == NULL) { in MIXCOM_init()
886 ch->HW_access_board = NULL; in MIXCOM_init()
887 ch->HW_release_board = NULL; in MIXCOM_init()
888 ch->HW_txe = MIXCOM_txe; in MIXCOM_init()
889 ch->HW_open = MIXCOM_open; in MIXCOM_init()
890 ch->HW_close = MIXCOM_close; in MIXCOM_init()
891 ch->HW_send_packet = MIXCOM_send_packet; in MIXCOM_init()
892 ch->HW_statistics = MIXCOM_statistics; in MIXCOM_init()
893 ch->HW_set_clock = NULL; in MIXCOM_init()
901 remove_proc_entry(FILENAME_CHANNEL, ch->procdir); in MIXCOM_init()
903 remove_proc_entry(FILENAME_IRQ, ch->procdir); in MIXCOM_init()
905 remove_proc_entry(FILENAME_IO, ch->procdir); in MIXCOM_init()
907 kfree(ch->HW_privdata); in MIXCOM_init()
913 struct comx_channel *ch = dev->priv; in MIXCOM_exit() local
914 struct mixcom_privdata *hw = ch->HW_privdata; in MIXCOM_exit()
924 kfree(ch->HW_privdata); in MIXCOM_exit()
925 remove_proc_entry(FILENAME_IO, ch->procdir); in MIXCOM_exit()
926 remove_proc_entry(FILENAME_IRQ, ch->procdir); in MIXCOM_exit()
928 remove_proc_entry(FILENAME_CLOCK, ch->procdir); in MIXCOM_exit()
930 remove_proc_entry(FILENAME_CHANNEL, ch->procdir); in MIXCOM_exit()
931 remove_proc_entry(FILENAME_TWIN, ch->procdir); in MIXCOM_exit()