Lines Matching refs:fore200e

162 fore200e_chunk_alloc(struct fore200e* fore200e, struct chunk* chunk, int size, int alignment, int d…  in fore200e_chunk_alloc()  argument
181 chunk->dma_addr = dma_map_single(fore200e->dev, chunk->align_addr, in fore200e_chunk_alloc()
183 if (dma_mapping_error(fore200e->dev, chunk->dma_addr)) { in fore200e_chunk_alloc()
194 fore200e_chunk_free(struct fore200e* fore200e, struct chunk* chunk) in fore200e_chunk_free() argument
196 dma_unmap_single(fore200e->dev, chunk->dma_addr, chunk->dma_size, in fore200e_chunk_free()
207 fore200e_dma_chunk_alloc(struct fore200e *fore200e, struct chunk *chunk, in fore200e_dma_chunk_alloc() argument
212 chunk->alloc_addr = dma_alloc_coherent(fore200e->dev, chunk->alloc_size, in fore200e_dma_chunk_alloc()
224 fore200e_dma_chunk_free(struct fore200e* fore200e, struct chunk* chunk) in fore200e_dma_chunk_free() argument
226 dma_free_coherent(fore200e->dev, chunk->alloc_size, chunk->alloc_addr, in fore200e_dma_chunk_free()
239 fore200e_poll(struct fore200e* fore200e, volatile u32* addr, u32 val, int msecs) in fore200e_poll() argument
263 fore200e_io_poll(struct fore200e* fore200e, volatile u32 __iomem *addr, u32 val, int msecs) in fore200e_io_poll() argument
269 if ((ok = (fore200e->bus->read(addr) == val))) in fore200e_io_poll()
277 fore200e->bus->read(addr), val); in fore200e_io_poll()
286 fore200e_free_rx_buf(struct fore200e* fore200e) in fore200e_free_rx_buf() argument
294 if ((buffer = fore200e->host_bsq[ scheme ][ magn ].buffer) != NULL) { in fore200e_free_rx_buf()
301 fore200e_chunk_free(fore200e, data); in fore200e_free_rx_buf()
310 fore200e_uninit_bs_queue(struct fore200e* fore200e) in fore200e_uninit_bs_queue() argument
317 struct chunk* status = &fore200e->host_bsq[ scheme ][ magn ].status; in fore200e_uninit_bs_queue()
318 struct chunk* rbd_block = &fore200e->host_bsq[ scheme ][ magn ].rbd_block; in fore200e_uninit_bs_queue()
321 fore200e_dma_chunk_free(fore200e, status); in fore200e_uninit_bs_queue()
324 fore200e_dma_chunk_free(fore200e, rbd_block); in fore200e_uninit_bs_queue()
331 fore200e_reset(struct fore200e* fore200e, int diag) in fore200e_reset() argument
335 fore200e->cp_monitor = fore200e->virt_base + FORE200E_CP_MONITOR_OFFSET; in fore200e_reset()
337 fore200e->bus->write(BSTAT_COLD_START, &fore200e->cp_monitor->bstat); in fore200e_reset()
339 fore200e->bus->reset(fore200e); in fore200e_reset()
342 ok = fore200e_io_poll(fore200e, &fore200e->cp_monitor->bstat, BSTAT_SELFTEST_OK, 1000); in fore200e_reset()
345 printk(FORE200E "device %s self-test failed\n", fore200e->name); in fore200e_reset()
349 printk(FORE200E "device %s self-test passed\n", fore200e->name); in fore200e_reset()
351 fore200e->state = FORE200E_STATE_RESET; in fore200e_reset()
359 fore200e_shutdown(struct fore200e* fore200e) in fore200e_shutdown() argument
362 fore200e->name, fore200e->phys_base, in fore200e_shutdown()
363 fore200e_irq_itoa(fore200e->irq)); in fore200e_shutdown()
365 if (fore200e->state > FORE200E_STATE_RESET) { in fore200e_shutdown()
367 fore200e_reset(fore200e, 0); in fore200e_shutdown()
371 switch(fore200e->state) { in fore200e_shutdown()
374 kfree(fore200e->stats); in fore200e_shutdown()
378 free_irq(fore200e->irq, fore200e->atm_dev); in fore200e_shutdown()
382 fore200e_free_rx_buf(fore200e); in fore200e_shutdown()
386 fore200e_uninit_bs_queue(fore200e); in fore200e_shutdown()
390 fore200e_dma_chunk_free(fore200e, &fore200e->host_rxq.status); in fore200e_shutdown()
391 fore200e_dma_chunk_free(fore200e, &fore200e->host_rxq.rpd); in fore200e_shutdown()
395 fore200e_dma_chunk_free(fore200e, &fore200e->host_txq.status); in fore200e_shutdown()
396 fore200e_dma_chunk_free(fore200e, &fore200e->host_txq.tpd); in fore200e_shutdown()
400 fore200e_dma_chunk_free(fore200e, &fore200e->host_cmdq.status); in fore200e_shutdown()
413 fore200e->bus->unmap(fore200e); in fore200e_shutdown()
421 atm_dev_deregister(fore200e->atm_dev); in fore200e_shutdown()
449 fore200e_pca_irq_check(struct fore200e* fore200e) in fore200e_pca_irq_check() argument
452 int irq_posted = readl(fore200e->regs.pca.psr); in fore200e_pca_irq_check()
455 if (irq_posted && (readl(fore200e->regs.pca.hcr) & PCA200E_HCR_OUTFULL)) { in fore200e_pca_irq_check()
456 DPRINTK(2,"FIFO OUT full, device %d\n", fore200e->atm_dev->number); in fore200e_pca_irq_check()
465 fore200e_pca_irq_ack(struct fore200e* fore200e) in fore200e_pca_irq_ack() argument
467 writel(PCA200E_HCR_CLRINTR, fore200e->regs.pca.hcr); in fore200e_pca_irq_ack()
472 fore200e_pca_reset(struct fore200e* fore200e) in fore200e_pca_reset() argument
474 writel(PCA200E_HCR_RESET, fore200e->regs.pca.hcr); in fore200e_pca_reset()
476 writel(0, fore200e->regs.pca.hcr); in fore200e_pca_reset()
480 static int fore200e_pca_map(struct fore200e* fore200e) in fore200e_pca_map() argument
482 DPRINTK(2, "device %s being mapped in memory\n", fore200e->name); in fore200e_pca_map()
484 fore200e->virt_base = ioremap(fore200e->phys_base, PCA200E_IOSPACE_LENGTH); in fore200e_pca_map()
486 if (fore200e->virt_base == NULL) { in fore200e_pca_map()
487 printk(FORE200E "can't map device %s\n", fore200e->name); in fore200e_pca_map()
491 DPRINTK(1, "device %s mapped to 0x%p\n", fore200e->name, fore200e->virt_base); in fore200e_pca_map()
494 fore200e->regs.pca.hcr = fore200e->virt_base + PCA200E_HCR_OFFSET; in fore200e_pca_map()
495 fore200e->regs.pca.imr = fore200e->virt_base + PCA200E_IMR_OFFSET; in fore200e_pca_map()
496 fore200e->regs.pca.psr = fore200e->virt_base + PCA200E_PSR_OFFSET; in fore200e_pca_map()
498 fore200e->state = FORE200E_STATE_MAP; in fore200e_pca_map()
504 fore200e_pca_unmap(struct fore200e* fore200e) in fore200e_pca_unmap() argument
506 DPRINTK(2, "device %s being unmapped from memory\n", fore200e->name); in fore200e_pca_unmap()
508 if (fore200e->virt_base != NULL) in fore200e_pca_unmap()
509 iounmap(fore200e->virt_base); in fore200e_pca_unmap()
513 static int fore200e_pca_configure(struct fore200e *fore200e) in fore200e_pca_configure() argument
515 struct pci_dev *pci_dev = to_pci_dev(fore200e->dev); in fore200e_pca_configure()
518 DPRINTK(2, "device %s being configured\n", fore200e->name); in fore200e_pca_configure()
548 fore200e->state = FORE200E_STATE_CONFIGURE; in fore200e_pca_configure()
554 fore200e_pca_prom_read(struct fore200e* fore200e, struct prom_data* prom) in fore200e_pca_prom_read() argument
556 struct host_cmdq* cmdq = &fore200e->host_cmdq; in fore200e_pca_prom_read()
567 prom_dma = dma_map_single(fore200e->dev, prom, sizeof(struct prom_data), in fore200e_pca_prom_read()
569 if (dma_mapping_error(fore200e->dev, prom_dma)) in fore200e_pca_prom_read()
572 fore200e->bus->write(prom_dma, &entry->cp_entry->cmd.prom_block.prom_haddr); in fore200e_pca_prom_read()
576 fore200e->bus->write(*(u32*)&opcode, (u32 __iomem *)&entry->cp_entry->cmd.prom_block.opcode); in fore200e_pca_prom_read()
578 ok = fore200e_poll(fore200e, entry->status, STATUS_COMPLETE, 400); in fore200e_pca_prom_read()
582 dma_unmap_single(fore200e->dev, prom_dma, sizeof(struct prom_data), DMA_FROM_DEVICE); in fore200e_pca_prom_read()
585 printk(FORE200E "unable to get PROM data from device %s\n", fore200e->name); in fore200e_pca_prom_read()
603 fore200e_pca_proc_read(struct fore200e* fore200e, char *page) in fore200e_pca_proc_read() argument
605 struct pci_dev *pci_dev = to_pci_dev(fore200e->dev); in fore200e_pca_proc_read()
642 static void fore200e_sba_irq_enable(struct fore200e *fore200e) in fore200e_sba_irq_enable() argument
644 u32 hcr = fore200e->bus->read(fore200e->regs.sba.hcr) & SBA200E_HCR_STICKY; in fore200e_sba_irq_enable()
645 fore200e->bus->write(hcr | SBA200E_HCR_INTR_ENA, fore200e->regs.sba.hcr); in fore200e_sba_irq_enable()
648 static int fore200e_sba_irq_check(struct fore200e *fore200e) in fore200e_sba_irq_check() argument
650 return fore200e->bus->read(fore200e->regs.sba.hcr) & SBA200E_HCR_INTR_REQ; in fore200e_sba_irq_check()
653 static void fore200e_sba_irq_ack(struct fore200e *fore200e) in fore200e_sba_irq_ack() argument
655 u32 hcr = fore200e->bus->read(fore200e->regs.sba.hcr) & SBA200E_HCR_STICKY; in fore200e_sba_irq_ack()
656 fore200e->bus->write(hcr | SBA200E_HCR_INTR_CLR, fore200e->regs.sba.hcr); in fore200e_sba_irq_ack()
659 static void fore200e_sba_reset(struct fore200e *fore200e) in fore200e_sba_reset() argument
661 fore200e->bus->write(SBA200E_HCR_RESET, fore200e->regs.sba.hcr); in fore200e_sba_reset()
663 fore200e->bus->write(0, fore200e->regs.sba.hcr); in fore200e_sba_reset()
666 static int __init fore200e_sba_map(struct fore200e *fore200e) in fore200e_sba_map() argument
668 struct platform_device *op = to_platform_device(fore200e->dev); in fore200e_sba_map()
672 fore200e->regs.sba.hcr = of_ioremap(&op->resource[0], 0, SBA200E_HCR_LENGTH, "SBA HCR"); in fore200e_sba_map()
673 fore200e->regs.sba.bsr = of_ioremap(&op->resource[1], 0, SBA200E_BSR_LENGTH, "SBA BSR"); in fore200e_sba_map()
674 fore200e->regs.sba.isr = of_ioremap(&op->resource[2], 0, SBA200E_ISR_LENGTH, "SBA ISR"); in fore200e_sba_map()
675 fore200e->virt_base = of_ioremap(&op->resource[3], 0, SBA200E_RAM_LENGTH, "SBA RAM"); in fore200e_sba_map()
677 if (!fore200e->virt_base) { in fore200e_sba_map()
678 printk(FORE200E "unable to map RAM of device %s\n", fore200e->name); in fore200e_sba_map()
682 DPRINTK(1, "device %s mapped to 0x%p\n", fore200e->name, fore200e->virt_base); in fore200e_sba_map()
684 fore200e->bus->write(0x02, fore200e->regs.sba.isr); /* XXX hardwired interrupt level */ in fore200e_sba_map()
692 fore200e->state = FORE200E_STATE_MAP; in fore200e_sba_map()
696 static void fore200e_sba_unmap(struct fore200e *fore200e) in fore200e_sba_unmap() argument
698 struct platform_device *op = to_platform_device(fore200e->dev); in fore200e_sba_unmap()
700 of_iounmap(&op->resource[0], fore200e->regs.sba.hcr, SBA200E_HCR_LENGTH); in fore200e_sba_unmap()
701 of_iounmap(&op->resource[1], fore200e->regs.sba.bsr, SBA200E_BSR_LENGTH); in fore200e_sba_unmap()
702 of_iounmap(&op->resource[2], fore200e->regs.sba.isr, SBA200E_ISR_LENGTH); in fore200e_sba_unmap()
703 of_iounmap(&op->resource[3], fore200e->virt_base, SBA200E_RAM_LENGTH); in fore200e_sba_unmap()
706 static int __init fore200e_sba_configure(struct fore200e *fore200e) in fore200e_sba_configure() argument
708 fore200e->state = FORE200E_STATE_CONFIGURE; in fore200e_sba_configure()
712 static int __init fore200e_sba_prom_read(struct fore200e *fore200e, struct prom_data *prom) in fore200e_sba_prom_read() argument
714 struct platform_device *op = to_platform_device(fore200e->dev); in fore200e_sba_prom_read()
736 static int fore200e_sba_proc_read(struct fore200e *fore200e, char *page) in fore200e_sba_proc_read() argument
738 struct platform_device *op = to_platform_device(fore200e->dev); in fore200e_sba_proc_read()
768 fore200e_tx_irq(struct fore200e* fore200e) in fore200e_tx_irq() argument
770 struct host_txq* txq = &fore200e->host_txq; in fore200e_tx_irq()
775 if (fore200e->host_txq.txing == 0) in fore200e_tx_irq()
793 dma_unmap_single(fore200e->dev, entry->tpd->tsd[ 0 ].buffer, entry->tpd->tsd[ 0 ].length, in fore200e_tx_irq()
803 fore200e->atm_dev->number); in fore200e_tx_irq()
826 fore200e->atm_dev->number); in fore200e_tx_irq()
852 fore200e->host_txq.txing--; in fore200e_tx_irq()
902 fore200e_supply(struct fore200e* fore200e) in fore200e_supply() argument
913 bsq = &fore200e->host_bsq[ scheme ][ magn ]; in fore200e_supply()
952 fore200e->bus->write(entry->rbd_block_dma, &entry->cp_entry->rbd_block_haddr); in fore200e_supply()
960 fore200e_push_rpd(struct fore200e* fore200e, struct atm_vcc* vcc, struct rpd* rpd) in fore200e_push_rpd() argument
1014 dma_sync_single_for_cpu(fore200e->dev, buffer->data.dma_addr, in fore200e_push_rpd()
1020 dma_sync_single_for_device(fore200e->dev, buffer->data.dma_addr, in fore200e_push_rpd()
1052 fore200e_collect_rpd(struct fore200e* fore200e, struct rpd* rpd) in fore200e_collect_rpd() argument
1063 bsq = &fore200e->host_bsq[ buffer->scheme ][ buffer->magn ]; in fore200e_collect_rpd()
1085 fore200e_rx_irq(struct fore200e* fore200e) in fore200e_rx_irq() argument
1087 struct host_rxq* rxq = &fore200e->host_rxq; in fore200e_rx_irq()
1100 vc_map = FORE200E_VC_MAP(fore200e, entry->rpd->atm_header.vpi, entry->rpd->atm_header.vci); in fore200e_rx_irq()
1106 fore200e->atm_dev->number, in fore200e_rx_irq()
1115 fore200e_push_rpd(fore200e, vcc, entry->rpd); in fore200e_rx_irq()
1119 fore200e->atm_dev->number, in fore200e_rx_irq()
1127 fore200e_collect_rpd(fore200e, entry->rpd); in fore200e_rx_irq()
1130 fore200e->bus->write(entry->rpd_dma, &entry->cp_entry->rpd_haddr); in fore200e_rx_irq()
1133 fore200e_supply(fore200e); in fore200e_rx_irq()
1140 fore200e_irq(struct fore200e* fore200e) in fore200e_irq() argument
1144 spin_lock_irqsave(&fore200e->q_lock, flags); in fore200e_irq()
1145 fore200e_rx_irq(fore200e); in fore200e_irq()
1146 spin_unlock_irqrestore(&fore200e->q_lock, flags); in fore200e_irq()
1148 spin_lock_irqsave(&fore200e->q_lock, flags); in fore200e_irq()
1149 fore200e_tx_irq(fore200e); in fore200e_irq()
1150 spin_unlock_irqrestore(&fore200e->q_lock, flags); in fore200e_irq()
1158 struct fore200e* fore200e = FORE200E_DEV((struct atm_dev*)dev); in fore200e_interrupt() local
1160 if (fore200e->bus->irq_check(fore200e) == 0) { in fore200e_interrupt()
1162 DPRINTK(3, "interrupt NOT triggered by device %d\n", fore200e->atm_dev->number); in fore200e_interrupt()
1165 DPRINTK(3, "interrupt triggered by device %d\n", fore200e->atm_dev->number); in fore200e_interrupt()
1168 tasklet_schedule(&fore200e->tx_tasklet); in fore200e_interrupt()
1169 tasklet_schedule(&fore200e->rx_tasklet); in fore200e_interrupt()
1171 fore200e_irq(fore200e); in fore200e_interrupt()
1174 fore200e->bus->irq_ack(fore200e); in fore200e_interrupt()
1183 struct fore200e* fore200e = (struct fore200e*) data; in fore200e_tx_tasklet() local
1186 DPRINTK(3, "tx tasklet scheduled for device %d\n", fore200e->atm_dev->number); in fore200e_tx_tasklet()
1188 spin_lock_irqsave(&fore200e->q_lock, flags); in fore200e_tx_tasklet()
1189 fore200e_tx_irq(fore200e); in fore200e_tx_tasklet()
1190 spin_unlock_irqrestore(&fore200e->q_lock, flags); in fore200e_tx_tasklet()
1197 struct fore200e* fore200e = (struct fore200e*) data; in fore200e_rx_tasklet() local
1200 DPRINTK(3, "rx tasklet scheduled for device %d\n", fore200e->atm_dev->number); in fore200e_rx_tasklet()
1202 spin_lock_irqsave(&fore200e->q_lock, flags); in fore200e_rx_tasklet()
1203 fore200e_rx_irq((struct fore200e*) data); in fore200e_rx_tasklet()
1204 spin_unlock_irqrestore(&fore200e->q_lock, flags); in fore200e_rx_tasklet()
1223 fore200e_activate_vcin(struct fore200e* fore200e, int activate, struct atm_vcc* vcc, int mtu) in fore200e_activate_vcin() argument
1225 struct host_cmdq* cmdq = &fore200e->host_cmdq; in fore200e_activate_vcin()
1259 fore200e->bus->write(mtu, &entry->cp_entry->cmd.activate_block.mtu); in fore200e_activate_vcin()
1260fore200e->bus->write(*(u32*)&vpvc, (u32 __iomem *)&entry->cp_entry->cmd.activate_block.vpv… in fore200e_activate_vcin()
1261fore200e->bus->write(*(u32*)&activ_opcode, (u32 __iomem *)&entry->cp_entry->cmd.activate_block.opc… in fore200e_activate_vcin()
1264fore200e->bus->write(*(u32*)&vpvc, (u32 __iomem *)&entry->cp_entry->cmd.deactivate_block.v… in fore200e_activate_vcin()
1265fore200e->bus->write(*(u32*)&deactiv_opcode, (u32 __iomem *)&entry->cp_entry->cmd.deactivate_block… in fore200e_activate_vcin()
1268 ok = fore200e_poll(fore200e, entry->status, STATUS_COMPLETE, 400); in fore200e_activate_vcin()
1306 struct fore200e* fore200e = FORE200E_DEV(vcc->dev); in fore200e_open() local
1316 spin_lock_irqsave(&fore200e->q_lock, flags); in fore200e_open()
1318 vc_map = FORE200E_VC_MAP(fore200e, vpi, vci); in fore200e_open()
1321 spin_unlock_irqrestore(&fore200e->q_lock, flags); in fore200e_open()
1324 fore200e->atm_dev->number, vpi, vci); in fore200e_open()
1331 spin_unlock_irqrestore(&fore200e->q_lock, flags); in fore200e_open()
1350 mutex_lock(&fore200e->rate_mtx); in fore200e_open()
1351 if (fore200e->available_cell_rate < vcc->qos.txtp.max_pcr) { in fore200e_open()
1352 mutex_unlock(&fore200e->rate_mtx); in fore200e_open()
1360 fore200e->available_cell_rate -= vcc->qos.txtp.max_pcr; in fore200e_open()
1361 mutex_unlock(&fore200e->rate_mtx); in fore200e_open()
1371 if (fore200e_activate_vcin(fore200e, 1, vcc, vcc->qos.rxtp.max_sdu) < 0) { in fore200e_open()
1380 fore200e->available_cell_rate += vcc->qos.txtp.max_pcr; in fore200e_open()
1403 vc_map->incarn = ++fore200e->incarn_count; in fore200e_open()
1416 struct fore200e* fore200e; in fore200e_close() local
1421 fore200e = FORE200E_DEV(vcc->dev); in fore200e_close()
1430 fore200e_activate_vcin(fore200e, 0, vcc, 0); in fore200e_close()
1432 spin_lock_irqsave(&fore200e->q_lock, flags); in fore200e_close()
1434 vc_map = FORE200E_VC_MAP(fore200e, vcc->vpi, vcc->vci); in fore200e_close()
1444 spin_unlock_irqrestore(&fore200e->q_lock, flags); in fore200e_close()
1449 mutex_lock(&fore200e->rate_mtx); in fore200e_close()
1450 fore200e->available_cell_rate += vcc->qos.txtp.max_pcr; in fore200e_close()
1451 mutex_unlock(&fore200e->rate_mtx); in fore200e_close()
1467 struct fore200e* fore200e; in fore200e_send() local
1486 fore200e = FORE200E_DEV(vcc->dev); in fore200e_send()
1489 if (!fore200e) in fore200e_send()
1492 txq = &fore200e->host_txq; in fore200e_send()
1519 DPRINTK(2, "misaligned tx PDU on device %s\n", fore200e->name); in fore200e_send()
1527 DPRINTK(2, "incomplete tx AAL0 PDU on device %s\n", fore200e->name); in fore200e_send()
1552 vc_map = FORE200E_VC_MAP(fore200e, vcc->vpi, vcc->vci); in fore200e_send()
1557 spin_lock_irqsave(&fore200e->q_lock, flags); in fore200e_send()
1564 fore200e_tx_irq(fore200e); in fore200e_send()
1568 spin_unlock_irqrestore(&fore200e->q_lock, flags); in fore200e_send()
1578 fore200e->tx_sat++; in fore200e_send()
1580 fore200e->name, fore200e->cp_queues->heartbeat); in fore200e_send()
1601 tpd->tsd[ 0 ].buffer = dma_map_single(fore200e->dev, data, tx_len, in fore200e_send()
1603 if (dma_mapping_error(fore200e->dev, tpd->tsd[0].buffer)) { in fore200e_send()
1606 spin_unlock_irqrestore(&fore200e->q_lock, flags); in fore200e_send()
1658 fore200e->bus->write(*(u32*)&tpd_haddr, (u32 __iomem *)&entry->cp_entry->tpd_haddr); in fore200e_send()
1660 spin_unlock_irqrestore(&fore200e->q_lock, flags); in fore200e_send()
1667 fore200e_getstats(struct fore200e* fore200e) in fore200e_getstats() argument
1669 struct host_cmdq* cmdq = &fore200e->host_cmdq; in fore200e_getstats()
1675 if (fore200e->stats == NULL) { in fore200e_getstats()
1676 fore200e->stats = kzalloc(sizeof(struct stats), GFP_KERNEL); in fore200e_getstats()
1677 if (fore200e->stats == NULL) in fore200e_getstats()
1681 stats_dma_addr = dma_map_single(fore200e->dev, fore200e->stats, in fore200e_getstats()
1683 if (dma_mapping_error(fore200e->dev, stats_dma_addr)) in fore200e_getstats()
1691 fore200e->bus->write(stats_dma_addr, &entry->cp_entry->cmd.stats_block.stats_haddr); in fore200e_getstats()
1695 fore200e->bus->write(*(u32*)&opcode, (u32 __iomem *)&entry->cp_entry->cmd.stats_block.opcode); in fore200e_getstats()
1697 ok = fore200e_poll(fore200e, entry->status, STATUS_COMPLETE, 400); in fore200e_getstats()
1701 dma_unmap_single(fore200e->dev, stats_dma_addr, sizeof(struct stats), DMA_FROM_DEVICE); in fore200e_getstats()
1704 printk(FORE200E "unable to get statistics from device %s\n", fore200e->name); in fore200e_getstats()
1713 fore200e_get_oc3(struct fore200e* fore200e, struct oc3_regs* regs)
1715 struct host_cmdq* cmdq = &fore200e->host_cmdq;
1721 …oc3_regs_dma_addr = fore200e->bus->dma_map(fore200e, regs, sizeof(struct oc3_regs), DMA_FROM_DEVIC…
1730 fore200e->bus->write(oc3_regs_dma_addr, &entry->cp_entry->cmd.oc3_block.regs_haddr);
1734 fore200e->bus->write(*(u32*)&opcode, (u32*)&entry->cp_entry->cmd.oc3_block.opcode);
1736 ok = fore200e_poll(fore200e, entry->status, STATUS_COMPLETE, 400);
1740 fore200e->bus->dma_unmap(fore200e, oc3_regs_dma_addr, sizeof(struct oc3_regs), DMA_FROM_DEVICE);
1743 printk(FORE200E "unable to get OC-3 regs of device %s\n", fore200e->name);
1753 fore200e_set_oc3(struct fore200e* fore200e, u32 reg, u32 value, u32 mask) in fore200e_set_oc3() argument
1755 struct host_cmdq* cmdq = &fore200e->host_cmdq; in fore200e_set_oc3()
1769 fore200e->bus->write(0, &entry->cp_entry->cmd.oc3_block.regs_haddr); in fore200e_set_oc3()
1773 fore200e->bus->write(*(u32*)&opcode, (u32 __iomem *)&entry->cp_entry->cmd.oc3_block.opcode); in fore200e_set_oc3()
1775 ok = fore200e_poll(fore200e, entry->status, STATUS_COMPLETE, 400); in fore200e_set_oc3()
1780 printk(FORE200E "unable to set OC-3 reg 0x%02x of device %s\n", reg, fore200e->name); in fore200e_set_oc3()
1789 fore200e_setloop(struct fore200e* fore200e, int loop_mode) in fore200e_setloop() argument
1816 error = fore200e_set_oc3(fore200e, SUNI_MCT, mct_value, mct_mask); in fore200e_setloop()
1818 fore200e->loop_mode = loop_mode; in fore200e_setloop()
1825 fore200e_fetch_stats(struct fore200e* fore200e, struct sonet_stats __user *arg) in fore200e_fetch_stats() argument
1829 if (fore200e_getstats(fore200e) < 0) in fore200e_fetch_stats()
1832 tmp.section_bip = be32_to_cpu(fore200e->stats->oc3.section_bip8_errors); in fore200e_fetch_stats()
1833 tmp.line_bip = be32_to_cpu(fore200e->stats->oc3.line_bip24_errors); in fore200e_fetch_stats()
1834 tmp.path_bip = be32_to_cpu(fore200e->stats->oc3.path_bip8_errors); in fore200e_fetch_stats()
1835 tmp.line_febe = be32_to_cpu(fore200e->stats->oc3.line_febe_errors); in fore200e_fetch_stats()
1836 tmp.path_febe = be32_to_cpu(fore200e->stats->oc3.path_febe_errors); in fore200e_fetch_stats()
1837 tmp.corr_hcs = be32_to_cpu(fore200e->stats->oc3.corr_hcs_errors); in fore200e_fetch_stats()
1838 tmp.uncorr_hcs = be32_to_cpu(fore200e->stats->oc3.ucorr_hcs_errors); in fore200e_fetch_stats()
1839 tmp.tx_cells = be32_to_cpu(fore200e->stats->aal0.cells_transmitted) + in fore200e_fetch_stats()
1840 be32_to_cpu(fore200e->stats->aal34.cells_transmitted) + in fore200e_fetch_stats()
1841 be32_to_cpu(fore200e->stats->aal5.cells_transmitted); in fore200e_fetch_stats()
1842 tmp.rx_cells = be32_to_cpu(fore200e->stats->aal0.cells_received) + in fore200e_fetch_stats()
1843 be32_to_cpu(fore200e->stats->aal34.cells_received) + in fore200e_fetch_stats()
1844 be32_to_cpu(fore200e->stats->aal5.cells_received); in fore200e_fetch_stats()
1856 struct fore200e* fore200e = FORE200E_DEV(dev); in fore200e_ioctl() local
1863 return fore200e_fetch_stats(fore200e, (struct sonet_stats __user *)arg); in fore200e_ioctl()
1869 return fore200e_setloop(fore200e, (int)(unsigned long)arg); in fore200e_ioctl()
1872 return put_user(fore200e->loop_mode, (int __user *)arg) ? -EFAULT : 0; in fore200e_ioctl()
1886 struct fore200e* fore200e = FORE200E_DEV(vcc->dev); in fore200e_change_qos() local
1902 flags, fore200e->available_cell_rate); in fore200e_change_qos()
1906 mutex_lock(&fore200e->rate_mtx); in fore200e_change_qos()
1907 if (fore200e->available_cell_rate + vcc->qos.txtp.max_pcr < qos->txtp.max_pcr) { in fore200e_change_qos()
1908 mutex_unlock(&fore200e->rate_mtx); in fore200e_change_qos()
1912 fore200e->available_cell_rate += vcc->qos.txtp.max_pcr; in fore200e_change_qos()
1913 fore200e->available_cell_rate -= qos->txtp.max_pcr; in fore200e_change_qos()
1915 mutex_unlock(&fore200e->rate_mtx); in fore200e_change_qos()
1931 static int fore200e_irq_request(struct fore200e *fore200e) in fore200e_irq_request() argument
1933 …if (request_irq(fore200e->irq, fore200e_interrupt, IRQF_SHARED, fore200e->name, fore200e->atm_dev)… in fore200e_irq_request()
1936 fore200e_irq_itoa(fore200e->irq), fore200e->name); in fore200e_irq_request()
1941 fore200e_irq_itoa(fore200e->irq), fore200e->name); in fore200e_irq_request()
1944 tasklet_init(&fore200e->tx_tasklet, fore200e_tx_tasklet, (unsigned long)fore200e); in fore200e_irq_request()
1945 tasklet_init(&fore200e->rx_tasklet, fore200e_rx_tasklet, (unsigned long)fore200e); in fore200e_irq_request()
1948 fore200e->state = FORE200E_STATE_IRQ; in fore200e_irq_request()
1953 static int fore200e_get_esi(struct fore200e *fore200e) in fore200e_get_esi() argument
1961 ok = fore200e->bus->prom_read(fore200e, prom); in fore200e_get_esi()
1968 fore200e->name, in fore200e_get_esi()
1973 fore200e->esi[ i ] = fore200e->atm_dev->esi[ i ] = prom->mac_addr[ i + 2 ]; in fore200e_get_esi()
1982 static int fore200e_alloc_rx_buf(struct fore200e *fore200e) in fore200e_alloc_rx_buf() argument
1992 bsq = &fore200e->host_bsq[ scheme ][ magn ]; in fore200e_alloc_rx_buf()
2018 if (fore200e_chunk_alloc(fore200e, in fore200e_alloc_rx_buf()
2019 &buffer[ i ].data, size, fore200e->bus->buffer_alignment, in fore200e_alloc_rx_buf()
2023 fore200e_chunk_free(fore200e, &buffer[ --i ].data); in fore200e_alloc_rx_buf()
2042 fore200e->state = FORE200E_STATE_ALLOC_BUF; in fore200e_alloc_rx_buf()
2047 static int fore200e_init_bs_queue(struct fore200e *fore200e) in fore200e_init_bs_queue() argument
2059 bsq = &fore200e->host_bsq[ scheme ][ magn ]; in fore200e_init_bs_queue()
2062 if (fore200e_dma_chunk_alloc(fore200e, in fore200e_init_bs_queue()
2066 fore200e->bus->status_alignment) < 0) { in fore200e_init_bs_queue()
2071 if (fore200e_dma_chunk_alloc(fore200e, in fore200e_init_bs_queue()
2075 fore200e->bus->descr_alignment) < 0) { in fore200e_init_bs_queue()
2077 fore200e_dma_chunk_free(fore200e, &bsq->status); in fore200e_init_bs_queue()
2082 cp_entry = fore200e->virt_base + in fore200e_init_bs_queue()
2083 fore200e->bus->read(&fore200e->cp_queues->cp_bsq[ scheme ][ magn ]); in fore200e_init_bs_queue()
2098 fore200e->bus->write(FORE200E_DMA_INDEX(bsq->status.dma_addr, enum status, i), in fore200e_init_bs_queue()
2104 fore200e->state = FORE200E_STATE_INIT_BSQ; in fore200e_init_bs_queue()
2109 static int fore200e_init_rx_queue(struct fore200e *fore200e) in fore200e_init_rx_queue() argument
2111 struct host_rxq* rxq = &fore200e->host_rxq; in fore200e_init_rx_queue()
2118 if (fore200e_dma_chunk_alloc(fore200e, in fore200e_init_rx_queue()
2122 fore200e->bus->status_alignment) < 0) { in fore200e_init_rx_queue()
2127 if (fore200e_dma_chunk_alloc(fore200e, in fore200e_init_rx_queue()
2131 fore200e->bus->descr_alignment) < 0) { in fore200e_init_rx_queue()
2133 fore200e_dma_chunk_free(fore200e, &rxq->status); in fore200e_init_rx_queue()
2138 cp_entry = fore200e->virt_base + fore200e->bus->read(&fore200e->cp_queues->cp_rxq); in fore200e_init_rx_queue()
2153 fore200e->bus->write(FORE200E_DMA_INDEX(rxq->status.dma_addr, enum status, i), in fore200e_init_rx_queue()
2156 fore200e->bus->write(FORE200E_DMA_INDEX(rxq->rpd.dma_addr, struct rpd, i), in fore200e_init_rx_queue()
2163 fore200e->state = FORE200E_STATE_INIT_RXQ; in fore200e_init_rx_queue()
2168 static int fore200e_init_tx_queue(struct fore200e *fore200e) in fore200e_init_tx_queue() argument
2170 struct host_txq* txq = &fore200e->host_txq; in fore200e_init_tx_queue()
2177 if (fore200e_dma_chunk_alloc(fore200e, in fore200e_init_tx_queue()
2181 fore200e->bus->status_alignment) < 0) { in fore200e_init_tx_queue()
2186 if (fore200e_dma_chunk_alloc(fore200e, in fore200e_init_tx_queue()
2190 fore200e->bus->descr_alignment) < 0) { in fore200e_init_tx_queue()
2192 fore200e_dma_chunk_free(fore200e, &txq->status); in fore200e_init_tx_queue()
2197 cp_entry = fore200e->virt_base + fore200e->bus->read(&fore200e->cp_queues->cp_txq); in fore200e_init_tx_queue()
2212 fore200e->bus->write(FORE200E_DMA_INDEX(txq->status.dma_addr, enum status, i), in fore200e_init_tx_queue()
2225 fore200e->state = FORE200E_STATE_INIT_TXQ; in fore200e_init_tx_queue()
2230 static int fore200e_init_cmd_queue(struct fore200e *fore200e) in fore200e_init_cmd_queue() argument
2232 struct host_cmdq* cmdq = &fore200e->host_cmdq; in fore200e_init_cmd_queue()
2239 if (fore200e_dma_chunk_alloc(fore200e, in fore200e_init_cmd_queue()
2243 fore200e->bus->status_alignment) < 0) { in fore200e_init_cmd_queue()
2248 cp_entry = fore200e->virt_base + fore200e->bus->read(&fore200e->cp_queues->cp_cmdq); in fore200e_init_cmd_queue()
2259 fore200e->bus->write(FORE200E_DMA_INDEX(cmdq->status.dma_addr, enum status, i), in fore200e_init_cmd_queue()
2266 fore200e->state = FORE200E_STATE_INIT_CMDQ; in fore200e_init_cmd_queue()
2271 static void fore200e_param_bs_queue(struct fore200e *fore200e, in fore200e_param_bs_queue() argument
2276 struct bs_spec __iomem * bs_spec = &fore200e->cp_queues->init.bs_spec[ scheme ][ magn ]; in fore200e_param_bs_queue()
2278 fore200e->bus->write(queue_length, &bs_spec->queue_length); in fore200e_param_bs_queue()
2279 fore200e->bus->write(fore200e_rx_buf_size[ scheme ][ magn ], &bs_spec->buffer_size); in fore200e_param_bs_queue()
2280 fore200e->bus->write(pool_size, &bs_spec->pool_size); in fore200e_param_bs_queue()
2281 fore200e->bus->write(supply_blksize, &bs_spec->supply_blksize); in fore200e_param_bs_queue()
2285 static int fore200e_initialize(struct fore200e *fore200e) in fore200e_initialize() argument
2290 DPRINTK(2, "device %s being initialized\n", fore200e->name); in fore200e_initialize()
2292 mutex_init(&fore200e->rate_mtx); in fore200e_initialize()
2293 spin_lock_init(&fore200e->q_lock); in fore200e_initialize()
2295 cpq = fore200e->cp_queues = fore200e->virt_base + FORE200E_CP_QUEUES_OFFSET; in fore200e_initialize()
2298 fore200e->bus->write(1, &cpq->imask); in fore200e_initialize()
2300 if (fore200e->bus->irq_enable) in fore200e_initialize()
2301 fore200e->bus->irq_enable(fore200e); in fore200e_initialize()
2303 fore200e->bus->write(NBR_CONNECT, &cpq->init.num_connect); in fore200e_initialize()
2305 fore200e->bus->write(QUEUE_SIZE_CMD, &cpq->init.cmd_queue_len); in fore200e_initialize()
2306 fore200e->bus->write(QUEUE_SIZE_RX, &cpq->init.rx_queue_len); in fore200e_initialize()
2307 fore200e->bus->write(QUEUE_SIZE_TX, &cpq->init.tx_queue_len); in fore200e_initialize()
2309 fore200e->bus->write(RSD_EXTENSION, &cpq->init.rsd_extension); in fore200e_initialize()
2310 fore200e->bus->write(TSD_EXTENSION, &cpq->init.tsd_extension); in fore200e_initialize()
2314 fore200e_param_bs_queue(fore200e, scheme, magn, in fore200e_initialize()
2320 fore200e->bus->write(STATUS_PENDING, &cpq->init.status); in fore200e_initialize()
2321 fore200e->bus->write(OPCODE_INITIALIZE, &cpq->init.opcode); in fore200e_initialize()
2323 ok = fore200e_io_poll(fore200e, &cpq->init.status, STATUS_COMPLETE, 3000); in fore200e_initialize()
2325 printk(FORE200E "device %s initialization failed\n", fore200e->name); in fore200e_initialize()
2329 printk(FORE200E "device %s initialized\n", fore200e->name); in fore200e_initialize()
2331 fore200e->state = FORE200E_STATE_INITIALIZE; in fore200e_initialize()
2336 static void fore200e_monitor_putc(struct fore200e *fore200e, char c) in fore200e_monitor_putc() argument
2338 struct cp_monitor __iomem * monitor = fore200e->cp_monitor; in fore200e_monitor_putc()
2343 fore200e->bus->write(((u32) c) | FORE200E_CP_MONITOR_UART_AVAIL, &monitor->soft_uart.send); in fore200e_monitor_putc()
2347 static int fore200e_monitor_getc(struct fore200e *fore200e) in fore200e_monitor_getc() argument
2349 struct cp_monitor __iomem * monitor = fore200e->cp_monitor; in fore200e_monitor_getc()
2355 c = (int) fore200e->bus->read(&monitor->soft_uart.recv); in fore200e_monitor_getc()
2359 fore200e->bus->write(FORE200E_CP_MONITOR_UART_FREE, &monitor->soft_uart.recv); in fore200e_monitor_getc()
2371 static void fore200e_monitor_puts(struct fore200e *fore200e, char *str) in fore200e_monitor_puts() argument
2376 while (fore200e_monitor_getc(fore200e) >= 0); in fore200e_monitor_puts()
2378 fore200e_monitor_putc(fore200e, *str++); in fore200e_monitor_puts()
2381 while (fore200e_monitor_getc(fore200e) >= 0); in fore200e_monitor_puts()
2390 static int fore200e_load_and_start_fw(struct fore200e *fore200e) in fore200e_load_and_start_fw() argument
2400 sprintf(buf, "%s%s", fore200e->bus->proc_name, FW_EXT); in fore200e_load_and_start_fw()
2401 if ((err = request_firmware(&firmware, buf, fore200e->dev)) < 0) { in fore200e_load_and_start_fw()
2402 printk(FORE200E "problem loading firmware image %s\n", fore200e->bus->model_name); in fore200e_load_and_start_fw()
2409 load_addr = fore200e->virt_base + le32_to_cpu(fw_header->load_offset); in fore200e_load_and_start_fw()
2412 fore200e->name, load_addr, fw_size); in fore200e_load_and_start_fw()
2415 printk(FORE200E "corrupted %s firmware image\n", fore200e->bus->model_name); in fore200e_load_and_start_fw()
2420 fore200e->bus->write(le32_to_cpu(*fw_data), load_addr); in fore200e_load_and_start_fw()
2422 DPRINTK(2, "device %s firmware being started\n", fore200e->name); in fore200e_load_and_start_fw()
2430 fore200e_monitor_puts(fore200e, buf); in fore200e_load_and_start_fw()
2432 if (fore200e_io_poll(fore200e, &fore200e->cp_monitor->bstat, BSTAT_CP_RUNNING, 1000) == 0) { in fore200e_load_and_start_fw()
2433 printk(FORE200E "device %s firmware didn't start\n", fore200e->name); in fore200e_load_and_start_fw()
2437 printk(FORE200E "device %s firmware started\n", fore200e->name); in fore200e_load_and_start_fw()
2439 fore200e->state = FORE200E_STATE_START_FW; in fore200e_load_and_start_fw()
2448 static int fore200e_register(struct fore200e *fore200e, struct device *parent) in fore200e_register() argument
2452 DPRINTK(2, "device %s being registered\n", fore200e->name); in fore200e_register()
2454 atm_dev = atm_dev_register(fore200e->bus->proc_name, parent, &fore200e_ops, in fore200e_register()
2457 printk(FORE200E "unable to register device %s\n", fore200e->name); in fore200e_register()
2461 atm_dev->dev_data = fore200e; in fore200e_register()
2462 fore200e->atm_dev = atm_dev; in fore200e_register()
2467 fore200e->available_cell_rate = ATM_OC3_PCR; in fore200e_register()
2469 fore200e->state = FORE200E_STATE_REGISTER; in fore200e_register()
2474 static int fore200e_init(struct fore200e *fore200e, struct device *parent) in fore200e_init() argument
2476 if (fore200e_register(fore200e, parent) < 0) in fore200e_init()
2479 if (fore200e->bus->configure(fore200e) < 0) in fore200e_init()
2482 if (fore200e->bus->map(fore200e) < 0) in fore200e_init()
2485 if (fore200e_reset(fore200e, 1) < 0) in fore200e_init()
2488 if (fore200e_load_and_start_fw(fore200e) < 0) in fore200e_init()
2491 if (fore200e_initialize(fore200e) < 0) in fore200e_init()
2494 if (fore200e_init_cmd_queue(fore200e) < 0) in fore200e_init()
2497 if (fore200e_init_tx_queue(fore200e) < 0) in fore200e_init()
2500 if (fore200e_init_rx_queue(fore200e) < 0) in fore200e_init()
2503 if (fore200e_init_bs_queue(fore200e) < 0) in fore200e_init()
2506 if (fore200e_alloc_rx_buf(fore200e) < 0) in fore200e_init()
2509 if (fore200e_get_esi(fore200e) < 0) in fore200e_init()
2512 if (fore200e_irq_request(fore200e) < 0) in fore200e_init()
2515 fore200e_supply(fore200e); in fore200e_init()
2518 fore200e->state = FORE200E_STATE_COMPLETE; in fore200e_init()
2527 struct fore200e *fore200e; in fore200e_sba_probe() local
2535 fore200e = kzalloc(sizeof(struct fore200e), GFP_KERNEL); in fore200e_sba_probe()
2536 if (!fore200e) in fore200e_sba_probe()
2539 fore200e->bus = &fore200e_sbus_ops; in fore200e_sba_probe()
2540 fore200e->dev = &op->dev; in fore200e_sba_probe()
2541 fore200e->irq = op->archdata.irqs[0]; in fore200e_sba_probe()
2542 fore200e->phys_base = op->resource[0].start; in fore200e_sba_probe()
2544 sprintf(fore200e->name, "SBA-200E-%d", index); in fore200e_sba_probe()
2546 err = fore200e_init(fore200e, &op->dev); in fore200e_sba_probe()
2548 fore200e_shutdown(fore200e); in fore200e_sba_probe()
2549 kfree(fore200e); in fore200e_sba_probe()
2554 dev_set_drvdata(&op->dev, fore200e); in fore200e_sba_probe()
2561 struct fore200e *fore200e = dev_get_drvdata(&op->dev); in fore200e_sba_remove() local
2563 fore200e_shutdown(fore200e); in fore200e_sba_remove()
2564 kfree(fore200e); in fore200e_sba_remove()
2591 struct fore200e* fore200e; in fore200e_pca_detect() local
2605 fore200e = kzalloc(sizeof(struct fore200e), GFP_KERNEL); in fore200e_pca_detect()
2606 if (fore200e == NULL) { in fore200e_pca_detect()
2611 fore200e->bus = &fore200e_pci_ops; in fore200e_pca_detect()
2612 fore200e->dev = &pci_dev->dev; in fore200e_pca_detect()
2613 fore200e->irq = pci_dev->irq; in fore200e_pca_detect()
2614 fore200e->phys_base = pci_resource_start(pci_dev, 0); in fore200e_pca_detect()
2616 sprintf(fore200e->name, "PCA-200E-%d", index - 1); in fore200e_pca_detect()
2621 fore200e->phys_base, fore200e_irq_itoa(fore200e->irq)); in fore200e_pca_detect()
2623 sprintf(fore200e->name, "PCA-200E-%d", index); in fore200e_pca_detect()
2625 err = fore200e_init(fore200e, &pci_dev->dev); in fore200e_pca_detect()
2627 fore200e_shutdown(fore200e); in fore200e_pca_detect()
2632 pci_set_drvdata(pci_dev, fore200e); in fore200e_pca_detect()
2638 kfree(fore200e); in fore200e_pca_detect()
2647 struct fore200e *fore200e; in fore200e_pca_remove_one() local
2649 fore200e = pci_get_drvdata(pci_dev); in fore200e_pca_remove_one()
2651 fore200e_shutdown(fore200e); in fore200e_pca_remove_one()
2652 kfree(fore200e); in fore200e_pca_remove_one()
2709 struct fore200e* fore200e = FORE200E_DEV(dev); in fore200e_proc_read() local
2717 if (fore200e_getstats(fore200e) < 0) in fore200e_proc_read()
2722 " internal name:\t\t%s\n", fore200e->name); in fore200e_proc_read()
2725 if (fore200e->bus->proc_read) in fore200e_proc_read()
2726 len += fore200e->bus->proc_read(fore200e, page + len); in fore200e_proc_read()
2734 fore200e_irq_itoa(fore200e->irq), in fore200e_proc_read()
2735 (void*)fore200e->phys_base, in fore200e_proc_read()
2736 fore200e->virt_base, in fore200e_proc_read()
2737 fore200e->esi, in fore200e_proc_read()
2738 fore200e->esi[4] * 256 + fore200e->esi[5]); in fore200e_proc_read()
2749 fore200e->host_bsq[ BUFFER_SCHEME_ONE ][ BUFFER_MAGN_SMALL ].freebuf_count, in fore200e_proc_read()
2750 fore200e->host_bsq[ BUFFER_SCHEME_ONE ][ BUFFER_MAGN_LARGE ].freebuf_count, in fore200e_proc_read()
2751 fore200e->host_bsq[ BUFFER_SCHEME_TWO ][ BUFFER_MAGN_SMALL ].freebuf_count, in fore200e_proc_read()
2752 fore200e->host_bsq[ BUFFER_SCHEME_TWO ][ BUFFER_MAGN_LARGE ].freebuf_count); in fore200e_proc_read()
2755 u32 hb = fore200e->bus->read(&fore200e->cp_queues->heartbeat); in fore200e_proc_read()
2786 u32 fw_release = fore200e->bus->read(&fore200e->cp_queues->fw_release); in fore200e_proc_read()
2787 u32 mon960_release = fore200e->bus->read(&fore200e->cp_queues->mon960_release); in fore200e_proc_read()
2788 u32 oc3_revision = fore200e->bus->read(&fore200e->cp_queues->oc3_revision); in fore200e_proc_read()
2789 u32 media_index = FORE200E_MEDIA_INDEX(fore200e->bus->read(&fore200e->cp_queues->media_type)); in fore200e_proc_read()
2795 switch (fore200e->loop_mode) { in fore200e_proc_read()
2819 struct cp_monitor __iomem * cp_monitor = fore200e->cp_monitor; in fore200e_proc_read()
2826 fore200e->bus->read(&cp_monitor->mon_version), in fore200e_proc_read()
2827 fore200e->bus->read(&cp_monitor->bstat)); in fore200e_proc_read()
2837 be32_to_cpu(fore200e->stats->phy.crc_header_errors), in fore200e_proc_read()
2838 be32_to_cpu(fore200e->stats->phy.framing_errors)); in fore200e_proc_read()
2850 be32_to_cpu(fore200e->stats->oc3.section_bip8_errors), in fore200e_proc_read()
2851 be32_to_cpu(fore200e->stats->oc3.path_bip8_errors), in fore200e_proc_read()
2852 be32_to_cpu(fore200e->stats->oc3.line_bip24_errors), in fore200e_proc_read()
2853 be32_to_cpu(fore200e->stats->oc3.line_febe_errors), in fore200e_proc_read()
2854 be32_to_cpu(fore200e->stats->oc3.path_febe_errors), in fore200e_proc_read()
2855 be32_to_cpu(fore200e->stats->oc3.corr_hcs_errors), in fore200e_proc_read()
2856 be32_to_cpu(fore200e->stats->oc3.ucorr_hcs_errors)); in fore200e_proc_read()
2867 be32_to_cpu(fore200e->stats->atm.cells_transmitted), in fore200e_proc_read()
2868 be32_to_cpu(fore200e->stats->atm.cells_received), in fore200e_proc_read()
2869 be32_to_cpu(fore200e->stats->atm.vpi_bad_range), in fore200e_proc_read()
2870 be32_to_cpu(fore200e->stats->atm.vpi_no_conn), in fore200e_proc_read()
2871 be32_to_cpu(fore200e->stats->atm.vci_bad_range), in fore200e_proc_read()
2872 be32_to_cpu(fore200e->stats->atm.vci_no_conn)); in fore200e_proc_read()
2880 be32_to_cpu(fore200e->stats->aal0.cells_transmitted), in fore200e_proc_read()
2881 be32_to_cpu(fore200e->stats->aal0.cells_received), in fore200e_proc_read()
2882 be32_to_cpu(fore200e->stats->aal0.cells_dropped)); in fore200e_proc_read()
2898 be32_to_cpu(fore200e->stats->aal34.cells_transmitted), in fore200e_proc_read()
2899 be32_to_cpu(fore200e->stats->aal34.cells_received), in fore200e_proc_read()
2900 be32_to_cpu(fore200e->stats->aal34.cells_dropped), in fore200e_proc_read()
2901 be32_to_cpu(fore200e->stats->aal34.cells_crc_errors), in fore200e_proc_read()
2902 be32_to_cpu(fore200e->stats->aal34.cells_protocol_errors), in fore200e_proc_read()
2903 be32_to_cpu(fore200e->stats->aal34.cspdus_transmitted), in fore200e_proc_read()
2904 be32_to_cpu(fore200e->stats->aal34.cspdus_received), in fore200e_proc_read()
2905 be32_to_cpu(fore200e->stats->aal34.cspdus_dropped), in fore200e_proc_read()
2906 be32_to_cpu(fore200e->stats->aal34.cspdus_protocol_errors)); in fore200e_proc_read()
2922 be32_to_cpu(fore200e->stats->aal5.cells_transmitted), in fore200e_proc_read()
2923 be32_to_cpu(fore200e->stats->aal5.cells_received), in fore200e_proc_read()
2924 be32_to_cpu(fore200e->stats->aal5.cells_dropped), in fore200e_proc_read()
2925 be32_to_cpu(fore200e->stats->aal5.congestion_experienced), in fore200e_proc_read()
2926 be32_to_cpu(fore200e->stats->aal5.cspdus_transmitted), in fore200e_proc_read()
2927 be32_to_cpu(fore200e->stats->aal5.cspdus_received), in fore200e_proc_read()
2928 be32_to_cpu(fore200e->stats->aal5.cspdus_dropped), in fore200e_proc_read()
2929 be32_to_cpu(fore200e->stats->aal5.cspdus_crc_errors), in fore200e_proc_read()
2930 be32_to_cpu(fore200e->stats->aal5.cspdus_protocol_errors)); in fore200e_proc_read()
2941 be32_to_cpu(fore200e->stats->aux.small_b1_failed), in fore200e_proc_read()
2942 be32_to_cpu(fore200e->stats->aux.large_b1_failed), in fore200e_proc_read()
2943 be32_to_cpu(fore200e->stats->aux.small_b2_failed), in fore200e_proc_read()
2944 be32_to_cpu(fore200e->stats->aux.large_b2_failed), in fore200e_proc_read()
2945 be32_to_cpu(fore200e->stats->aux.rpd_alloc_failed), in fore200e_proc_read()
2946 fore200e->tx_sat); in fore200e_proc_read()
2951 fore200e->stats->aux.receive_carrier ? "ON" : "OFF!"); in fore200e_proc_read()
2961 vcc = fore200e->vc_map[i].vcc; in fore200e_proc_read()
2966 spin_lock_irqsave(&fore200e->q_lock, flags); in fore200e_proc_read()
2984 spin_unlock_irqrestore(&fore200e->q_lock, flags); in fore200e_proc_read()
2988 spin_unlock_irqrestore(&fore200e->q_lock, flags); in fore200e_proc_read()