Lines Matching refs:ch

127 	struct comx_channel *ch = dev->priv;  in COMX_set_clock()  local
128 struct comx_privdata *hw = ch->HW_privdata; in COMX_set_clock()
135 struct comx_channel *ch = dev->priv; in COMX_access_board() local
151 if (!ch->twin || ret != ch->twin) { in COMX_access_board()
153 ch->HW_board_on(dev); in COMX_access_board()
164 struct comx_channel *ch = dev->priv; in COMX_release_board() local
173 if (!ch->twin || ch->twin != savep) { in COMX_release_board()
174 ch->HW_board_off(dev); in COMX_release_board()
184 struct comx_channel *ch = dev->priv; in COMX_txe() local
187 savep = ch->HW_access_board(dev); in COMX_txe()
191 ch->HW_release_board(dev,savep); in COMX_txe()
201 struct comx_channel *ch = dev->priv; in COMX_send_packet() local
202 struct comx_privdata *hw = ch->HW_privdata; in COMX_send_packet()
206 savep = ch->HW_access_board(dev); in COMX_send_packet()
208 if (ch->debug_flags & DEBUG_HW_TX) { in COMX_send_packet()
218 if ((ch->line_status & LINE_UP) && tmp==1) { in COMX_send_packet()
240 ch->stats.tx_packets++; in COMX_send_packet()
241 ch->stats.tx_bytes += lensave; in COMX_send_packet()
244 ch->stats.tx_dropped++; in COMX_send_packet()
252 ch->HW_release_board(dev, savep); in COMX_send_packet()
259 struct comx_channel *ch = dev->priv; in comx_read_buffer() local
278 ch->stats.rx_dropped++; in comx_read_buffer()
293 ch->stats.rx_packets++; in comx_read_buffer()
294 ch->stats.rx_bytes += len; in comx_read_buffer()
295 if (ch->debug_flags & DEBUG_HW_RX) { in comx_read_buffer()
298 ch->LINE_rx(dev, skb); in comx_read_buffer()
304 struct comx_channel *ch=dev->priv; in comx_line_change() local
309 if (ch->lineup_delay) { in comx_line_change()
310 if (!test_and_set_bit(0, &ch->lineup_pending)) { in comx_line_change()
311 ch->lineup_timer.function = comx_lineup_func; in comx_line_change()
312 ch->lineup_timer.data = (unsigned long)dev; in comx_line_change()
313 ch->lineup_timer.expires = jiffies + in comx_line_change()
314 HZ*ch->lineup_delay; in comx_line_change()
315 add_timer(&ch->lineup_timer); in comx_line_change()
320 ch->LINE_status(dev, ch->line_status |= LINE_UP); in comx_line_change()
324 if (test_and_clear_bit(0, &ch->lineup_pending)) { in comx_line_change()
325 del_timer(&ch->lineup_timer); in comx_line_change()
327 ch->line_status &= ~LINE_UP; in comx_line_change()
328 if (ch->LINE_status) { in comx_line_change()
329 ch->LINE_status(dev, ch->line_status); in comx_line_change()
341 struct comx_channel *ch = dev->priv; in COMX_interrupt() local
342 struct comx_privdata *hw = ch->HW_privdata; in COMX_interrupt()
356 interrupted = ch->HW_access_board(dev); in COMX_interrupt()
367 if (ch->twin) { in COMX_interrupt()
368 dev = ch->twin; in COMX_interrupt()
369 ch = dev->priv; in COMX_interrupt()
370 hw = ch->HW_privdata; in COMX_interrupt()
380 if ((ch->init_status & (HW_OPEN | LINE_OPEN)) != in COMX_interrupt()
392 ch->stats.rx_missed_errors += (tmp >> 8) & 0xff; in COMX_interrupt()
393 ch->stats.rx_over_errors += tmp & 0xff; in COMX_interrupt()
401 ch->stats.rx_crc_errors += (tmp >> 8) & 0xff; in COMX_interrupt()
402 ch->stats.rx_missed_errors += tmp & 0xff; in COMX_interrupt()
405 if ((ch->line_status & LINE_UP) && ch->LINE_rx) { in COMX_interrupt()
419 if (tmp==1 && ch->LINE_tx) { in COMX_interrupt()
420 ch->LINE_tx(dev); in COMX_interrupt()
433 if ((linestat & LINE_UP) != (ch->line_status & LINE_UP)) { in COMX_interrupt()
434 ch->stats.tx_carrier_errors++; in COMX_interrupt()
447 ch->HW_release_board(dev, interrupted); in COMX_interrupt()
452 struct comx_channel *ch = dev->priv; in COMX_open() local
453 struct comx_privdata *hw = ch->HW_privdata; in COMX_open()
454 struct proc_dir_entry *procfile = ch->procdir->subdir; in COMX_open()
464 if (ch->twin && (((struct comx_channel *)(ch->twin->priv))->init_status & HW_OPEN)) { in COMX_open()
478 ch->init_status |= IRQ_ALLOCATED; in COMX_open()
479 if (!ch->HW_load_board || ch->HW_load_board(dev)) { in COMX_open()
480 ch->init_status &= ~IRQ_ALLOCATED; in COMX_open()
486 savep = ch->HW_access_board(dev); in COMX_open()
489 if (ch->HW_set_clock) { in COMX_open()
490 ch->HW_set_clock(dev); in COMX_open()
501 ch->HW_release_board(dev, savep); in COMX_open()
516 ch->HW_release_board(dev, savep); in COMX_open()
521 ch->init_status |= HW_OPEN; in COMX_open()
525 ch->line_status &= ~LINE_UP; in COMX_open()
527 ch->line_status |= LINE_UP; in COMX_open()
530 if (ch->LINE_status) { in COMX_open()
531 ch->LINE_status(dev, ch->line_status); in COMX_open()
534 ch->HW_release_board(dev, savep); in COMX_open()
561 struct comx_channel *ch = dev->priv; in COMX_close() local
562 struct proc_dir_entry *procfile = ch->procdir->subdir; in COMX_close()
563 struct comx_privdata *hw = ch->HW_privdata; in COMX_close()
567 savep = ch->HW_access_board(dev); in COMX_close()
573 ch->HW_release_board(dev, savep); in COMX_close()
575 if (ch->init_status & IRQ_ALLOCATED) { in COMX_close()
577 ch->init_status &= ~IRQ_ALLOCATED; in COMX_close()
581 if (ch->twin && (twin_ch = ch->twin->priv) && in COMX_close()
584 if (request_irq(dev->irq, COMX_interrupt, 0, ch->twin->name, in COMX_close()
585 (void *)ch->twin) == 0) { in COMX_close()
601 ch->init_status &= ~HW_OPEN; in COMX_close()
607 struct comx_channel *ch = dev->priv; in COMX_statistics() local
608 struct comx_privdata *hw = ch->HW_privdata; in COMX_statistics()
612 savep = ch->HW_access_board(dev); in COMX_statistics()
617 (ch->init_status & HW_OPEN) ? "HW_OPEN" : "", in COMX_statistics()
618 (ch->init_status & LINE_OPEN) ? "LINE_OPEN" : "", in COMX_statistics()
619 (ch->init_status & FW_LOADED) ? "FW_LOADED" : "", in COMX_statistics()
620 (ch->init_status & IRQ_ALLOCATED) ? "IRQ_ALLOCATED" : "", in COMX_statistics()
633 ch->HW_release_board(dev, savep); in COMX_statistics()
640 struct comx_channel *ch = dev->priv; in COMX_load_board() local
641 struct comx_privdata *hw = ch->HW_privdata; in COMX_load_board()
654 struct comx_channel *twin_ch = ch->twin ? ch->twin->priv : NULL; in COMX_load_board()
762 ch->init_status |= FW_LOADED; in COMX_load_board()
777 struct comx_channel *ch = dev->priv; in CMX_load_board() local
778 struct comx_privdata *hw = ch->HW_privdata; in CMX_load_board()
793 struct comx_channel *twin_ch = ch->twin ? ch->twin->priv : NULL; in CMX_load_board()
860 ch->init_status |= FW_LOADED; in CMX_load_board()
875 struct comx_channel *ch = dev->priv; in HICOMX_load_board() local
876 struct comx_privdata *hw = ch->HW_privdata; in HICOMX_load_board()
890 struct comx_channel *twin_ch = ch->twin ? ch->twin->priv : NULL; in HICOMX_load_board()
982 ch->init_status |= FW_LOADED; in HICOMX_load_board()
999 struct comx_channel *ch = dev->priv; in comx_twin_check() local
1000 struct proc_dir_entry *procfile = ch->procdir->parent->subdir; in comx_twin_check()
1001 struct comx_privdata *hw = ch->HW_privdata; in comx_twin_check()
1023 ch->hardware == ch_twin->hardware) { in comx_twin_check()
1035 struct comx_channel *ch = dev->priv; in comxhw_write_proc() local
1036 struct comx_privdata *hw = ch->HW_privdata; in comxhw_write_proc()
1040 if(ch->init_status & HW_OPEN) { in comxhw_write_proc()
1099 if ((ch->twin = comx_twin_check(dev)) != NULL) { in comxhw_write_proc()
1100 struct comx_channel *twin_ch = ch->twin->priv; in comxhw_write_proc()
1112 if ((ch->twin = comx_twin_check(dev)) != NULL) { in comxhw_write_proc()
1113 struct comx_channel *twin_ch = ch->twin->priv; in comxhw_write_proc()
1123 if ((ch->twin = comx_twin_check(dev)) != NULL) { in comxhw_write_proc()
1124 struct comx_channel *twin_ch = ch->twin->priv; in comxhw_write_proc()
1139 if ((ch->twin = comx_twin_check(dev)) != NULL) { in comxhw_write_proc()
1140 struct comx_channel *twin_ch = ch->twin->priv; in comxhw_write_proc()
1164 struct comx_channel *ch = dev->priv; in comxhw_read_proc() local
1165 struct comx_privdata *hw = ch->HW_privdata; in comxhw_read_proc()
1178 len = sprintf(page, "%s\n", ch->twin ? ch->twin->name : "none"); in comxhw_read_proc()
1215 struct comx_channel *ch = dev->priv; in COMX_init() local
1219 if ((ch->HW_privdata = kmalloc(sizeof(struct comx_privdata), in COMX_init()
1223 memset(hw = ch->HW_privdata, 0, sizeof(struct comx_privdata)); in COMX_init()
1225 if (ch->hardware == &comx_hw || ch->hardware == &cmx_hw) { in COMX_init()
1232 } else if (ch->hardware == &hicomx_hw) { in COMX_init()
1243 if ((new_file = create_proc_entry(FILENAME_IO, S_IFREG | 0644, ch->procdir)) in COMX_init()
1253 if ((new_file = create_proc_entry(FILENAME_IRQ, S_IFREG | 0644, ch->procdir)) in COMX_init()
1264 ch->procdir)) == NULL) { in COMX_init()
1273 if (ch->hardware == &hicomx_hw || ch->hardware == &cmx_hw) { in COMX_init()
1275 ch->procdir)) == NULL) { in COMX_init()
1286 ch->procdir)) == NULL) { in COMX_init()
1296 ch->procdir)) == NULL) { in COMX_init()
1305 ch->procdir)) == NULL) { in COMX_init()
1313 if (ch->hardware == &comx_hw) { in COMX_init()
1314 ch->HW_board_on = COMX_board_on; in COMX_init()
1315 ch->HW_board_off = COMX_board_off; in COMX_init()
1316 ch->HW_load_board = COMX_load_board; in COMX_init()
1317 } else if (ch->hardware == &cmx_hw) { in COMX_init()
1318 ch->HW_board_on = COMX_board_on; in COMX_init()
1319 ch->HW_board_off = COMX_board_off; in COMX_init()
1320 ch->HW_load_board = CMX_load_board; in COMX_init()
1321 ch->HW_set_clock = COMX_set_clock; in COMX_init()
1322 } else if (ch->hardware == &hicomx_hw) { in COMX_init()
1323 ch->HW_board_on = HICOMX_board_on; in COMX_init()
1324 ch->HW_board_off = HICOMX_board_off; in COMX_init()
1325 ch->HW_load_board = HICOMX_load_board; in COMX_init()
1326 ch->HW_set_clock = COMX_set_clock; in COMX_init()
1331 ch->HW_access_board = COMX_access_board; in COMX_init()
1332 ch->HW_release_board = COMX_release_board; in COMX_init()
1333 ch->HW_txe = COMX_txe; in COMX_init()
1334 ch->HW_open = COMX_open; in COMX_init()
1335 ch->HW_close = COMX_close; in COMX_init()
1336 ch->HW_send_packet = COMX_send_packet; in COMX_init()
1337 ch->HW_statistics = COMX_statistics; in COMX_init()
1339 if ((ch->twin = comx_twin_check(dev)) != NULL) { in COMX_init()
1340 struct comx_channel *twin_ch = ch->twin->priv; in COMX_init()
1349 remove_proc_entry(FILENAME_TWIN, ch->procdir); in COMX_init()
1351 remove_proc_entry(FILENAME_MEMADDR, ch->procdir); in COMX_init()
1353 if (ch->hardware == &hicomx_hw || ch->hardware == &cmx_hw) in COMX_init()
1354 remove_proc_entry(FILENAME_CLOCK, ch->procdir); in COMX_init()
1356 remove_proc_entry(FILENAME_CHANNEL, ch->procdir); in COMX_init()
1358 remove_proc_entry(FILENAME_IRQ, ch->procdir); in COMX_init()
1360 remove_proc_entry(FILENAME_IO, ch->procdir); in COMX_init()
1362 kfree(ch->HW_privdata); in COMX_init()
1369 struct comx_channel *ch = dev->priv; in COMX_exit() local
1370 struct comx_privdata *hw = ch->HW_privdata; in COMX_exit()
1375 } if (ch->twin) { in COMX_exit()
1376 struct comx_channel *twin_ch = ch->twin->priv; in COMX_exit()
1381 kfree(ch->HW_privdata); in COMX_exit()
1382 remove_proc_entry(FILENAME_IO, ch->procdir); in COMX_exit()
1383 remove_proc_entry(FILENAME_IRQ, ch->procdir); in COMX_exit()
1384 remove_proc_entry(FILENAME_CHANNEL, ch->procdir); in COMX_exit()
1385 remove_proc_entry(FILENAME_MEMADDR, ch->procdir); in COMX_exit()
1386 remove_proc_entry(FILENAME_FIRMWARE, ch->procdir); in COMX_exit()
1387 remove_proc_entry(FILENAME_TWIN, ch->procdir); in COMX_exit()
1388 if (ch->hardware == &hicomx_hw || ch->hardware == &cmx_hw) { in COMX_exit()
1389 remove_proc_entry(FILENAME_CLOCK, ch->procdir); in COMX_exit()