Lines Matching +full:delta +full:- +full:y +full:- +full:threshold
6 Copyright (C) 1999-2001 Naval Research Laboratory
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 Copyright (C) 1999-2001 Naval Research Laboratory
42 ForeRunnerHE(tm)", MANU0361-01 - Rev. A, 08/21/98.
69 #include <linux/dma-mapping.h>
88 #define hprintk(fmt,args...) printk(KERN_ERR DEV_LABEL "%d: " fmt, he_dev->number , ##args)
91 #define HPRINTK(fmt,args...) printk(KERN_DEBUG DEV_LABEL "%d: " fmt, he_dev->number , ##args)
116 static short nvpibits = -1;
117 static short nvcibits = -1;
176 #define he_writel(dev, val, reg) do { writel(val, (dev)->membase + (reg)); wmb(); } while (0)
177 #define he_readl(dev, reg) readl((dev)->membase + (reg))
220 #define he_mkcid(dev, vpi, vci) (((vpi << (dev)->vcibits) | vci) & 0x1fff)
241 /* from page 2-20
336 vpi = cid >> he_dev->vcibits; in __find_vcc()
337 vci = cid & ((1 << he_dev->vcibits) - 1); in __find_vcc()
338 head = &vcc_hash[vci & (VCC_HTABLE_SIZE -1)]; in __find_vcc()
342 if (vcc->dev == he_dev->atm_dev && in __find_vcc()
343 vcc->vci == vci && vcc->vpi == vpi && in __find_vcc()
344 vcc->qos.rxtp.traffic_class != ATM_NONE) { in __find_vcc()
361 return -EIO; in he_init_one()
362 if (dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK(32)) != 0) { in he_init_one()
364 err = -EIO; in he_init_one()
368 atm_dev = atm_dev_register(DEV_LABEL, &pci_dev->dev, &he_ops, -1, NULL); in he_init_one()
370 err = -ENODEV; in he_init_one()
378 err = -ENOMEM; in he_init_one()
381 he_dev->pci_dev = pci_dev; in he_init_one()
382 he_dev->atm_dev = atm_dev; in he_init_one()
383 he_dev->atm_dev->dev_data = he_dev; in he_init_one()
384 atm_dev->dev_data = he_dev; in he_init_one()
385 he_dev->number = atm_dev->number; in he_init_one()
386 tasklet_init(&he_dev->tasklet, he_tasklet, (unsigned long) he_dev); in he_init_one()
387 spin_lock_init(&he_dev->global_lock); in he_init_one()
391 err = -ENODEV; in he_init_one()
394 he_dev->next = NULL; in he_init_one()
396 he_dev->next = he_devs; in he_init_one()
448 unsigned lbufs_per_row = he_dev->cells_per_row / he_dev->cells_per_lbuf; in he_init_rx_lbfp0()
449 unsigned lbuf_bufsize = he_dev->cells_per_lbuf * ATM_CELL_PAYLOAD; in he_init_rx_lbfp0()
450 unsigned row_offset = he_dev->r0_startrow * he_dev->bytes_per_row; in he_init_rx_lbfp0()
457 for (i = 0, lbuf_count = 0; i < he_dev->r0_numbuffs; ++i) { in he_init_rx_lbfp0()
466 row_offset += he_dev->bytes_per_row; in he_init_rx_lbfp0()
471 he_writel(he_dev, lbufd_index - 2, RLBF0_T); in he_init_rx_lbfp0()
472 he_writel(he_dev, he_dev->r0_numbuffs, RLBF0_C); in he_init_rx_lbfp0()
478 unsigned lbufs_per_row = he_dev->cells_per_row / he_dev->cells_per_lbuf; in he_init_rx_lbfp1()
479 unsigned lbuf_bufsize = he_dev->cells_per_lbuf * ATM_CELL_PAYLOAD; in he_init_rx_lbfp1()
480 unsigned row_offset = he_dev->r1_startrow * he_dev->bytes_per_row; in he_init_rx_lbfp1()
487 for (i = 0, lbuf_count = 0; i < he_dev->r1_numbuffs; ++i) { in he_init_rx_lbfp1()
496 row_offset += he_dev->bytes_per_row; in he_init_rx_lbfp1()
501 he_writel(he_dev, lbufd_index - 2, RLBF1_T); in he_init_rx_lbfp1()
502 he_writel(he_dev, he_dev->r1_numbuffs, RLBF1_C); in he_init_rx_lbfp1()
508 unsigned lbufs_per_row = he_dev->cells_per_row / he_dev->cells_per_lbuf; in he_init_tx_lbfp()
509 unsigned lbuf_bufsize = he_dev->cells_per_lbuf * ATM_CELL_PAYLOAD; in he_init_tx_lbfp()
510 unsigned row_offset = he_dev->tx_startrow * he_dev->bytes_per_row; in he_init_tx_lbfp()
512 lbufd_index = he_dev->r0_numbuffs + he_dev->r1_numbuffs; in he_init_tx_lbfp()
517 for (i = 0, lbuf_count = 0; i < he_dev->tx_numbuffs; ++i) { in he_init_tx_lbfp()
526 row_offset += he_dev->bytes_per_row; in he_init_tx_lbfp()
531 he_writel(he_dev, lbufd_index - 1, TLBF_T); in he_init_tx_lbfp()
536 he_dev->tpdrq_base = dma_alloc_coherent(&he_dev->pci_dev->dev, in he_init_tpdrq()
538 &he_dev->tpdrq_phys, in he_init_tpdrq()
540 if (he_dev->tpdrq_base == NULL) { in he_init_tpdrq()
542 return -ENOMEM; in he_init_tpdrq()
545 he_dev->tpdrq_tail = he_dev->tpdrq_base; in he_init_tpdrq()
546 he_dev->tpdrq_head = he_dev->tpdrq_base; in he_init_tpdrq()
548 he_writel(he_dev, he_dev->tpdrq_phys, TPDRQ_B_H); in he_init_tpdrq()
550 he_writel(he_dev, CONFIG_TPDRQ_SIZE - 1, TPDRQ_S); in he_init_tpdrq()
557 unsigned clock, rate, delta; in he_init_cs_block() local
568 rate = he_dev->atm_dev->link_rate; in he_init_cs_block()
569 delta = rate / 16 / 2; in he_init_cs_block()
580 rate -= delta; in he_init_cs_block()
653 unsigned rate, delta; in he_init_cs_block_rcm() local
662 return -ENOMEM; in he_init_cs_block_rcm()
682 rate = he_dev->atm_dev->link_rate; in he_init_cs_block_rcm()
683 delta = rate / 32; in he_init_cs_block_rcm()
694 rate -= delta; in he_init_cs_block_rcm()
700 (*rategrid)[i][j] = (*rategrid)[i - 1][j] / 4; in he_init_cs_block_rcm()
702 (*rategrid)[i][j] = (*rategrid)[i - 1][j] / 2; in he_init_cs_block_rcm()
726 for (i = 255; i > 0; i--) in he_init_cs_block_rcm()
733 * there are two table entries in each 32-bit register in he_init_cs_block_rcm()
737 buf = rate_cps * he_dev->tx_numbuffs / in he_init_cs_block_rcm()
738 (he_dev->atm_dev->link_rate * 2); in he_init_cs_block_rcm()
741 mult = he_dev->atm_dev->link_rate / ATM_OC3_PCR; in he_init_cs_block_rcm()
783 he_dev->rbpl_table = bitmap_zalloc(RBPL_TABLE_SIZE, GFP_KERNEL); in he_init_group()
784 if (!he_dev->rbpl_table) { in he_init_group()
786 return -ENOMEM; in he_init_group()
789 /* rbpl_virt 64-bit pointers */ in he_init_group()
790 he_dev->rbpl_virt = kmalloc_array(RBPL_TABLE_SIZE, in he_init_group()
791 sizeof(*he_dev->rbpl_virt), in he_init_group()
793 if (!he_dev->rbpl_virt) { in he_init_group()
799 he_dev->rbpl_pool = dma_pool_create("rbpl", &he_dev->pci_dev->dev, in he_init_group()
801 if (he_dev->rbpl_pool == NULL) { in he_init_group()
806 he_dev->rbpl_base = dma_alloc_coherent(&he_dev->pci_dev->dev, in he_init_group()
808 &he_dev->rbpl_phys, GFP_KERNEL); in he_init_group()
809 if (he_dev->rbpl_base == NULL) { in he_init_group()
814 INIT_LIST_HEAD(&he_dev->rbpl_outstanding); in he_init_group()
818 heb = dma_pool_alloc(he_dev->rbpl_pool, GFP_KERNEL, &mapping); in he_init_group()
821 heb->mapping = mapping; in he_init_group()
822 list_add(&heb->entry, &he_dev->rbpl_outstanding); in he_init_group()
824 set_bit(i, he_dev->rbpl_table); in he_init_group()
825 he_dev->rbpl_virt[i] = heb; in he_init_group()
826 he_dev->rbpl_hint = i + 1; in he_init_group()
827 he_dev->rbpl_base[i].idx = i << RBP_IDX_OFFSET; in he_init_group()
828 he_dev->rbpl_base[i].phys = mapping + offsetof(struct he_buff, data); in he_init_group()
830 he_dev->rbpl_tail = &he_dev->rbpl_base[CONFIG_RBPL_SIZE - 1]; in he_init_group()
832 he_writel(he_dev, he_dev->rbpl_phys, G0_RBPL_S + (group * 32)); in he_init_group()
833 he_writel(he_dev, RBPL_MASK(he_dev->rbpl_tail), in he_init_group()
835 he_writel(he_dev, (CONFIG_RBPL_BUFSIZE - sizeof(struct he_buff))/4, in he_init_group()
839 RBP_QSIZE(CONFIG_RBPL_SIZE - 1) | in he_init_group()
845 he_dev->rbrq_base = dma_alloc_coherent(&he_dev->pci_dev->dev, in he_init_group()
847 &he_dev->rbrq_phys, GFP_KERNEL); in he_init_group()
848 if (he_dev->rbrq_base == NULL) { in he_init_group()
853 he_dev->rbrq_head = he_dev->rbrq_base; in he_init_group()
854 he_writel(he_dev, he_dev->rbrq_phys, G0_RBRQ_ST + (group * 16)); in he_init_group()
857 RBRQ_THRESH(CONFIG_RBRQ_THRESH) | RBRQ_SIZE(CONFIG_RBRQ_SIZE - 1), in he_init_group()
869 he_dev->tbrq_base = dma_alloc_coherent(&he_dev->pci_dev->dev, in he_init_group()
871 &he_dev->tbrq_phys, GFP_KERNEL); in he_init_group()
872 if (he_dev->tbrq_base == NULL) { in he_init_group()
877 he_dev->tbrq_head = he_dev->tbrq_base; in he_init_group()
879 he_writel(he_dev, he_dev->tbrq_phys, G0_TBRQ_B_T + (group * 16)); in he_init_group()
881 he_writel(he_dev, CONFIG_TBRQ_SIZE - 1, G0_TBRQ_S + (group * 16)); in he_init_group()
887 dma_free_coherent(&he_dev->pci_dev->dev, CONFIG_RBRQ_SIZE * in he_init_group()
888 sizeof(struct he_rbrq), he_dev->rbrq_base, in he_init_group()
889 he_dev->rbrq_phys); in he_init_group()
891 list_for_each_entry_safe(heb, next, &he_dev->rbpl_outstanding, entry) in he_init_group()
892 dma_pool_free(he_dev->rbpl_pool, heb, heb->mapping); in he_init_group()
894 dma_free_coherent(&he_dev->pci_dev->dev, CONFIG_RBPL_SIZE * in he_init_group()
895 sizeof(struct he_rbp), he_dev->rbpl_base, in he_init_group()
896 he_dev->rbpl_phys); in he_init_group()
898 dma_pool_destroy(he_dev->rbpl_pool); in he_init_group()
900 kfree(he_dev->rbpl_virt); in he_init_group()
902 bitmap_free(he_dev->rbpl_table); in he_init_group()
904 return -ENOMEM; in he_init_group()
914 he_dev->irq_base = dma_alloc_coherent(&he_dev->pci_dev->dev, in he_init_irq()
916 &he_dev->irq_phys, GFP_KERNEL); in he_init_irq()
917 if (he_dev->irq_base == NULL) { in he_init_irq()
919 return -ENOMEM; in he_init_irq()
921 he_dev->irq_tailoffset = (unsigned *) in he_init_irq()
922 &he_dev->irq_base[CONFIG_IRQ_SIZE]; in he_init_irq()
923 *he_dev->irq_tailoffset = 0; in he_init_irq()
924 he_dev->irq_head = he_dev->irq_base; in he_init_irq()
925 he_dev->irq_tail = he_dev->irq_base; in he_init_irq()
928 he_dev->irq_base[i].isw = ITYPE_INVALID; in he_init_irq()
930 he_writel(he_dev, he_dev->irq_phys, IRQ0_BASE); in he_init_irq()
959 if (request_irq(he_dev->pci_dev->irq, in he_init_irq()
961 hprintk("irq %d already in use\n", he_dev->pci_dev->irq); in he_init_irq()
962 return -EINVAL; in he_init_irq()
965 he_dev->irq = he_dev->pci_dev->irq; in he_init_irq()
985 pci_dev = he_dev->pci_dev; in he_start()
988 HPRINTK("membase = 0x%lx irq = %d.\n", membase, pci_dev->irq); in he_start()
994 /* 4.3 pci bus controller-specific initialization */ in he_start()
997 return -EINVAL; in he_start()
1002 return -EINVAL; in he_start()
1007 return -EINVAL; in he_start()
1013 return -EINVAL; in he_start()
1018 return -EINVAL; in he_start()
1029 return -EINVAL; in he_start()
1048 if (!(he_dev->membase = ioremap(membase, HE_REGMAP_SIZE))) { in he_start()
1050 return -EINVAL; in he_start()
1061 return -EINVAL; in he_start()
1072 hprintk("disabling 64-bit pci bus transfers\n"); in he_start()
1077 hprintk("64-bit transfers enabled\n"); in he_start()
1083 he_dev->prod_id[i] = read_prom_byte(he_dev, PROD_ID + i); in he_start()
1085 he_dev->media = read_prom_byte(he_dev, MEDIA); in he_start()
1088 dev->esi[i] = read_prom_byte(he_dev, MAC_ADDR + i); in he_start()
1090 hprintk("%s%s, %pM\n", he_dev->prod_id, in he_start()
1091 he_dev->media & 0x40 ? "SM" : "MM", dev->esi); in he_start()
1092 he_dev->atm_dev->link_rate = he_is622(he_dev) ? in he_start()
1148 * 517|____________| 768| | y | in he_start()
1163 he_dev->vcibits = CONFIG_DEFAULT_VCIBITS; in he_start()
1164 he_dev->vpibits = CONFIG_DEFAULT_VPIBITS; in he_start()
1166 if (nvpibits != -1 && nvcibits != -1 && nvpibits+nvcibits != HE_MAXCIDBITS) { in he_start()
1168 return -ENODEV; in he_start()
1171 if (nvpibits != -1) { in he_start()
1172 he_dev->vpibits = nvpibits; in he_start()
1173 he_dev->vcibits = HE_MAXCIDBITS - nvpibits; in he_start()
1176 if (nvcibits != -1) { in he_start()
1177 he_dev->vcibits = nvcibits; in he_start()
1178 he_dev->vpibits = HE_MAXCIDBITS - nvcibits; in he_start()
1183 he_dev->cells_per_row = 40; in he_start()
1184 he_dev->bytes_per_row = 2048; in he_start()
1185 he_dev->r0_numrows = 256; in he_start()
1186 he_dev->tx_numrows = 512; in he_start()
1187 he_dev->r1_numrows = 256; in he_start()
1188 he_dev->r0_startrow = 0; in he_start()
1189 he_dev->tx_startrow = 256; in he_start()
1190 he_dev->r1_startrow = 768; in he_start()
1192 he_dev->cells_per_row = 20; in he_start()
1193 he_dev->bytes_per_row = 1024; in he_start()
1194 he_dev->r0_numrows = 512; in he_start()
1195 he_dev->tx_numrows = 1018; in he_start()
1196 he_dev->r1_numrows = 512; in he_start()
1197 he_dev->r0_startrow = 6; in he_start()
1198 he_dev->tx_startrow = 518; in he_start()
1199 he_dev->r1_startrow = 1536; in he_start()
1202 he_dev->cells_per_lbuf = 4; in he_start()
1203 he_dev->buffer_limit = 4; in he_start()
1204 he_dev->r0_numbuffs = he_dev->r0_numrows * in he_start()
1205 he_dev->cells_per_row / he_dev->cells_per_lbuf; in he_start()
1206 if (he_dev->r0_numbuffs > 2560) in he_start()
1207 he_dev->r0_numbuffs = 2560; in he_start()
1209 he_dev->r1_numbuffs = he_dev->r1_numrows * in he_start()
1210 he_dev->cells_per_row / he_dev->cells_per_lbuf; in he_start()
1211 if (he_dev->r1_numbuffs > 2560) in he_start()
1212 he_dev->r1_numbuffs = 2560; in he_start()
1214 he_dev->tx_numbuffs = he_dev->tx_numrows * in he_start()
1215 he_dev->cells_per_row / he_dev->cells_per_lbuf; in he_start()
1216 if (he_dev->tx_numbuffs > 5120) in he_start()
1217 he_dev->tx_numbuffs = 5120; in he_start()
1239 he_writel(he_dev, he_dev->cells_per_lbuf * ATM_CELL_PAYLOAD, LB_CONFIG); in he_start()
1244 RX_VALVP(he_dev->vpibits) | in he_start()
1245 RX_VALVC(he_dev->vcibits), RC_CONFIG); in he_start()
1249 TX_VCI_MASK(he_dev->vcibits) | in he_start()
1250 LBFREE_CNT(he_dev->tx_numbuffs), TX_CONFIG); in he_start()
1255 (he_is622(he_dev) ? PTMR_PRE(67 - 1) : PTMR_PRE(50 - 1)), in he_start()
1417 return -ENOMEM; in he_start()
1423 he_dev->tpd_pool = dma_pool_create("tpd", &he_dev->pci_dev->dev, in he_start()
1425 if (he_dev->tpd_pool == NULL) { in he_start()
1427 return -ENOMEM; in he_start()
1430 INIT_LIST_HEAD(&he_dev->outstanding_tpds); in he_start()
1433 return -ENOMEM; in he_start()
1463 he_dev->hsp = dma_alloc_coherent(&he_dev->pci_dev->dev, in he_start()
1465 &he_dev->hsp_phys, GFP_KERNEL); in he_start()
1466 if (he_dev->hsp == NULL) { in he_start()
1468 return -ENOMEM; in he_start()
1470 he_writel(he_dev, he_dev->hsp_phys, HSP_BA); in he_start()
1476 suni_init(he_dev->atm_dev); in he_start()
1477 if (he_dev->atm_dev->phy && he_dev->atm_dev->phy->start) in he_start()
1478 he_dev->atm_dev->phy->start(he_dev->atm_dev); in he_start()
1485 val = he_phy_get(he_dev->atm_dev, SUNI_TPOP_APM); in he_start()
1487 he_phy_put(he_dev->atm_dev, val, SUNI_TPOP_APM); in he_start()
1488 he_phy_put(he_dev->atm_dev, SUNI_TACP_IUCHP_CLP, SUNI_TACP_IUCHP); in he_start()
1502 he_dev->cs_stper[i].inuse = 0; in he_start()
1503 he_dev->cs_stper[i].pcr = -1; in he_start()
1505 he_dev->total_bw = 0; in he_start()
1510 he_dev->atm_dev->ci_range.vpi_bits = he_dev->vpibits; in he_start()
1511 he_dev->atm_dev->ci_range.vci_bits = he_dev->vcibits; in he_start()
1513 he_dev->irq_peak = 0; in he_start()
1514 he_dev->rbrq_peak = 0; in he_start()
1515 he_dev->rbpl_peak = 0; in he_start()
1516 he_dev->tbrq_peak = 0; in he_start()
1531 pci_dev = he_dev->pci_dev; in he_stop()
1535 if (he_dev->membase) { in he_stop()
1540 tasklet_disable(&he_dev->tasklet); in he_stop()
1554 if (he_dev->atm_dev->phy && he_dev->atm_dev->phy->stop) in he_stop()
1555 he_dev->atm_dev->phy->stop(he_dev->atm_dev); in he_stop()
1558 if (he_dev->irq) in he_stop()
1559 free_irq(he_dev->irq, he_dev); in he_stop()
1561 if (he_dev->irq_base) in he_stop()
1562 dma_free_coherent(&he_dev->pci_dev->dev, (CONFIG_IRQ_SIZE + 1) in he_stop()
1563 * sizeof(struct he_irq), he_dev->irq_base, he_dev->irq_phys); in he_stop()
1565 if (he_dev->hsp) in he_stop()
1566 dma_free_coherent(&he_dev->pci_dev->dev, sizeof(struct he_hsp), in he_stop()
1567 he_dev->hsp, he_dev->hsp_phys); in he_stop()
1569 if (he_dev->rbpl_base) { in he_stop()
1570 list_for_each_entry_safe(heb, next, &he_dev->rbpl_outstanding, entry) in he_stop()
1571 dma_pool_free(he_dev->rbpl_pool, heb, heb->mapping); in he_stop()
1573 dma_free_coherent(&he_dev->pci_dev->dev, CONFIG_RBPL_SIZE in he_stop()
1574 * sizeof(struct he_rbp), he_dev->rbpl_base, he_dev->rbpl_phys); in he_stop()
1577 kfree(he_dev->rbpl_virt); in he_stop()
1578 bitmap_free(he_dev->rbpl_table); in he_stop()
1579 dma_pool_destroy(he_dev->rbpl_pool); in he_stop()
1581 if (he_dev->rbrq_base) in he_stop()
1582 dma_free_coherent(&he_dev->pci_dev->dev, CONFIG_RBRQ_SIZE * sizeof(struct he_rbrq), in he_stop()
1583 he_dev->rbrq_base, he_dev->rbrq_phys); in he_stop()
1585 if (he_dev->tbrq_base) in he_stop()
1586 dma_free_coherent(&he_dev->pci_dev->dev, CONFIG_TBRQ_SIZE * sizeof(struct he_tbrq), in he_stop()
1587 he_dev->tbrq_base, he_dev->tbrq_phys); in he_stop()
1589 if (he_dev->tpdrq_base) in he_stop()
1590 dma_free_coherent(&he_dev->pci_dev->dev, CONFIG_TBRQ_SIZE * sizeof(struct he_tbrq), in he_stop()
1591 he_dev->tpdrq_base, he_dev->tpdrq_phys); in he_stop()
1593 dma_pool_destroy(he_dev->tpd_pool); in he_stop()
1595 if (he_dev->pci_dev) { in he_stop()
1596 pci_read_config_word(he_dev->pci_dev, PCI_COMMAND, &command); in he_stop()
1598 pci_write_config_word(he_dev->pci_dev, PCI_COMMAND, command); in he_stop()
1601 if (he_dev->membase) in he_stop()
1602 iounmap(he_dev->membase); in he_stop()
1611 tpd = dma_pool_alloc(he_dev->tpd_pool, GFP_ATOMIC, &mapping); in __alloc_tpd()
1615 tpd->status = TPD_ADDR(mapping); in __alloc_tpd()
1616 tpd->reserved = 0; in __alloc_tpd()
1617 tpd->iovec[0].addr = 0; tpd->iovec[0].len = 0; in __alloc_tpd()
1618 tpd->iovec[1].addr = 0; tpd->iovec[1].len = 0; in __alloc_tpd()
1619 tpd->iovec[2].addr = 0; tpd->iovec[2].len = 0; in __alloc_tpd()
1625 ((((unsigned char *)(buf))[(len)-6] << 8) | \
1626 (((unsigned char *)(buf))[(len)-5]))
1635 ((((unsigned char *)(buf))[(len)-2] << 8) | \
1636 (((unsigned char *)(buf))[(len-1)]))
1642 ((unsigned long)he_dev->rbrq_base | in he_service_rbrq()
1643 he_dev->hsp->group[group].rbrq_tail); in he_service_rbrq()
1644 unsigned cid, lastcid = -1; in he_service_rbrq()
1654 while (he_dev->rbrq_head != rbrq_tail) { in he_service_rbrq()
1658 he_dev->rbrq_head, group, in he_service_rbrq()
1659 RBRQ_ADDR(he_dev->rbrq_head), in he_service_rbrq()
1660 RBRQ_BUFLEN(he_dev->rbrq_head), in he_service_rbrq()
1661 RBRQ_CID(he_dev->rbrq_head), in he_service_rbrq()
1662 RBRQ_CRC_ERR(he_dev->rbrq_head) ? " CRC_ERR" : "", in he_service_rbrq()
1663 RBRQ_LEN_ERR(he_dev->rbrq_head) ? " LEN_ERR" : "", in he_service_rbrq()
1664 RBRQ_END_PDU(he_dev->rbrq_head) ? " END_PDU" : "", in he_service_rbrq()
1665 RBRQ_AAL5_PROT(he_dev->rbrq_head) ? " AAL5_PROT" : "", in he_service_rbrq()
1666 RBRQ_CON_CLOSED(he_dev->rbrq_head) ? " CON_CLOSED" : "", in he_service_rbrq()
1667 RBRQ_HBUF_ERR(he_dev->rbrq_head) ? " HBUF_ERR" : ""); in he_service_rbrq()
1669 i = RBRQ_ADDR(he_dev->rbrq_head) >> RBP_IDX_OFFSET; in he_service_rbrq()
1670 heb = he_dev->rbpl_virt[i]; in he_service_rbrq()
1672 cid = RBRQ_CID(he_dev->rbrq_head); in he_service_rbrq()
1679 if (!RBRQ_HBUF_ERR(he_dev->rbrq_head)) { in he_service_rbrq()
1680 clear_bit(i, he_dev->rbpl_table); in he_service_rbrq()
1681 list_del(&heb->entry); in he_service_rbrq()
1682 dma_pool_free(he_dev->rbpl_pool, heb, heb->mapping); in he_service_rbrq()
1688 if (RBRQ_HBUF_ERR(he_dev->rbrq_head)) { in he_service_rbrq()
1690 atomic_inc(&vcc->stats->rx_drop); in he_service_rbrq()
1694 heb->len = RBRQ_BUFLEN(he_dev->rbrq_head) * 4; in he_service_rbrq()
1695 clear_bit(i, he_dev->rbpl_table); in he_service_rbrq()
1696 list_move_tail(&heb->entry, &he_vcc->buffers); in he_service_rbrq()
1697 he_vcc->pdu_len += heb->len; in he_service_rbrq()
1699 if (RBRQ_CON_CLOSED(he_dev->rbrq_head)) { in he_service_rbrq()
1700 lastcid = -1; in he_service_rbrq()
1702 wake_up(&he_vcc->rx_waitq); in he_service_rbrq()
1706 if (!RBRQ_END_PDU(he_dev->rbrq_head)) in he_service_rbrq()
1709 if (RBRQ_LEN_ERR(he_dev->rbrq_head) in he_service_rbrq()
1710 || RBRQ_CRC_ERR(he_dev->rbrq_head)) { in he_service_rbrq()
1712 RBRQ_CRC_ERR(he_dev->rbrq_head) in he_service_rbrq()
1714 RBRQ_LEN_ERR(he_dev->rbrq_head) in he_service_rbrq()
1716 vcc->vpi, vcc->vci); in he_service_rbrq()
1717 atomic_inc(&vcc->stats->rx_err); in he_service_rbrq()
1721 skb = atm_alloc_charge(vcc, he_vcc->pdu_len + rx_skb_reserve, in he_service_rbrq()
1724 HPRINTK("charge failed (%d.%d)\n", vcc->vpi, vcc->vci); in he_service_rbrq()
1733 list_for_each_entry(heb, &he_vcc->buffers, entry) in he_service_rbrq()
1734 skb_put_data(skb, &heb->data, heb->len); in he_service_rbrq()
1736 switch (vcc->qos.aal) { in he_service_rbrq()
1739 skb->len = ATM_AAL0_SDU; in he_service_rbrq()
1740 skb_set_tail_pointer(skb, skb->len); in he_service_rbrq()
1745 skb->len = AAL5_LEN(skb->data, he_vcc->pdu_len); in he_service_rbrq()
1746 skb_set_tail_pointer(skb, skb->len); in he_service_rbrq()
1748 if (vcc->vpi == 0 && vcc->vci >= ATM_NOT_RSV_VCI) { in he_service_rbrq()
1749 skb->ip_summed = CHECKSUM_COMPLETE; in he_service_rbrq()
1750 skb->csum = TCP_CKSUM(skb->data, in he_service_rbrq()
1751 he_vcc->pdu_len); in he_service_rbrq()
1758 if (skb->len > vcc->qos.rxtp.max_sdu) in he_service_rbrq()
1759 …hprintk("pdu_len (%d) > vcc->qos.rxtp.max_sdu (%d)! cid 0x%x\n", skb->len, vcc->qos.rxtp.max_sdu,… in he_service_rbrq()
1763 ATM_SKB(skb)->vcc = vcc; in he_service_rbrq()
1765 spin_unlock(&he_dev->global_lock); in he_service_rbrq()
1766 vcc->push(vcc, skb); in he_service_rbrq()
1767 spin_lock(&he_dev->global_lock); in he_service_rbrq()
1769 atomic_inc(&vcc->stats->rx); in he_service_rbrq()
1774 list_for_each_entry_safe(heb, next, &he_vcc->buffers, entry) in he_service_rbrq()
1775 dma_pool_free(he_dev->rbpl_pool, heb, heb->mapping); in he_service_rbrq()
1776 INIT_LIST_HEAD(&he_vcc->buffers); in he_service_rbrq()
1777 he_vcc->pdu_len = 0; in he_service_rbrq()
1780 he_dev->rbrq_head = (struct he_rbrq *) in he_service_rbrq()
1781 ((unsigned long) he_dev->rbrq_base | in he_service_rbrq()
1782 RBRQ_MASK(he_dev->rbrq_head + 1)); in he_service_rbrq()
1788 if (updated > he_dev->rbrq_peak) in he_service_rbrq()
1789 he_dev->rbrq_peak = updated; in he_service_rbrq()
1791 he_writel(he_dev, RBRQ_MASK(he_dev->rbrq_head), in he_service_rbrq()
1802 ((unsigned long)he_dev->tbrq_base | in he_service_tbrq()
1803 he_dev->hsp->group[group].tbrq_tail); in he_service_tbrq()
1810 while (he_dev->tbrq_head != tbrq_tail) { in he_service_tbrq()
1815 TBRQ_TPD(he_dev->tbrq_head), in he_service_tbrq()
1816 TBRQ_EOS(he_dev->tbrq_head) ? " EOS" : "", in he_service_tbrq()
1817 TBRQ_MULTIPLE(he_dev->tbrq_head) ? " MULTIPLE" : ""); in he_service_tbrq()
1819 list_for_each_entry(__tpd, &he_dev->outstanding_tpds, entry) { in he_service_tbrq()
1820 if (TPD_ADDR(__tpd->status) == TBRQ_TPD(he_dev->tbrq_head)) { in he_service_tbrq()
1822 list_del(&__tpd->entry); in he_service_tbrq()
1829 TBRQ_TPD(he_dev->tbrq_head)); in he_service_tbrq()
1833 if (TBRQ_EOS(he_dev->tbrq_head)) { in he_service_tbrq()
1835 he_mkcid(he_dev, tpd->vcc->vpi, tpd->vcc->vci)); in he_service_tbrq()
1836 if (tpd->vcc) in he_service_tbrq()
1837 wake_up(&HE_VCC(tpd->vcc)->tx_waitq); in he_service_tbrq()
1843 if (tpd->iovec[slot].addr) in he_service_tbrq()
1844 dma_unmap_single(&he_dev->pci_dev->dev, in he_service_tbrq()
1845 tpd->iovec[slot].addr, in he_service_tbrq()
1846 tpd->iovec[slot].len & TPD_LEN_MASK, in he_service_tbrq()
1848 if (tpd->iovec[slot].len & TPD_LST) in he_service_tbrq()
1853 if (tpd->skb) { /* && !TBRQ_MULTIPLE(he_dev->tbrq_head) */ in he_service_tbrq()
1854 if (tpd->vcc && tpd->vcc->pop) in he_service_tbrq()
1855 tpd->vcc->pop(tpd->vcc, tpd->skb); in he_service_tbrq()
1857 dev_kfree_skb_any(tpd->skb); in he_service_tbrq()
1862 dma_pool_free(he_dev->tpd_pool, tpd, TPD_ADDR(tpd->status)); in he_service_tbrq()
1863 he_dev->tbrq_head = (struct he_tbrq *) in he_service_tbrq()
1864 ((unsigned long) he_dev->tbrq_base | in he_service_tbrq()
1865 TBRQ_MASK(he_dev->tbrq_head + 1)); in he_service_tbrq()
1869 if (updated > he_dev->tbrq_peak) in he_service_tbrq()
1870 he_dev->tbrq_peak = updated; in he_service_tbrq()
1872 he_writel(he_dev, TBRQ_MASK(he_dev->tbrq_head), in he_service_tbrq()
1887 rbpl_head = (struct he_rbp *) ((unsigned long)he_dev->rbpl_base | in he_service_rbpl()
1891 new_tail = (struct he_rbp *) ((unsigned long)he_dev->rbpl_base | in he_service_rbpl()
1892 RBPL_MASK(he_dev->rbpl_tail+1)); in he_service_rbpl()
1894 /* table 3.42 -- rbpl_tail should never be set to rbpl_head */ in he_service_rbpl()
1898 i = find_next_zero_bit(he_dev->rbpl_table, RBPL_TABLE_SIZE, he_dev->rbpl_hint); in he_service_rbpl()
1899 if (i > (RBPL_TABLE_SIZE - 1)) { in he_service_rbpl()
1900 i = find_first_zero_bit(he_dev->rbpl_table, RBPL_TABLE_SIZE); in he_service_rbpl()
1901 if (i > (RBPL_TABLE_SIZE - 1)) in he_service_rbpl()
1904 he_dev->rbpl_hint = i + 1; in he_service_rbpl()
1906 heb = dma_pool_alloc(he_dev->rbpl_pool, GFP_ATOMIC, &mapping); in he_service_rbpl()
1909 heb->mapping = mapping; in he_service_rbpl()
1910 list_add(&heb->entry, &he_dev->rbpl_outstanding); in he_service_rbpl()
1911 he_dev->rbpl_virt[i] = heb; in he_service_rbpl()
1912 set_bit(i, he_dev->rbpl_table); in he_service_rbpl()
1913 new_tail->idx = i << RBP_IDX_OFFSET; in he_service_rbpl()
1914 new_tail->phys = mapping + offsetof(struct he_buff, data); in he_service_rbpl()
1916 he_dev->rbpl_tail = new_tail; in he_service_rbpl()
1921 he_writel(he_dev, RBPL_MASK(he_dev->rbpl_tail), G0_RBPL_T); in he_service_rbpl()
1933 spin_lock_irqsave(&he_dev->global_lock, flags); in he_tasklet()
1935 while (he_dev->irq_head != he_dev->irq_tail) { in he_tasklet()
1938 type = ITYPE_TYPE(he_dev->irq_head->isw); in he_tasklet()
1939 group = ITYPE_GROUP(he_dev->irq_head->isw); in he_tasklet()
1943 HPRINTK("rbrq%d threshold\n", group); in he_tasklet()
1950 HPRINTK("tbrq%d threshold\n", group); in he_tasklet()
1964 spin_unlock_irqrestore(&he_dev->global_lock, flags); in he_tasklet()
1965 if (he_dev->atm_dev->phy && he_dev->atm_dev->phy->interrupt) in he_tasklet()
1966 he_dev->atm_dev->phy->interrupt(he_dev->atm_dev); in he_tasklet()
1967 spin_lock_irqsave(&he_dev->global_lock, flags); in he_tasklet()
1981 /* see 8.1.1 -- check all queues */ in he_tasklet()
1983 HPRINTK("isw not updated 0x%x\n", he_dev->irq_head->isw); in he_tasklet()
1990 hprintk("bad isw 0x%x?\n", he_dev->irq_head->isw); in he_tasklet()
1993 he_dev->irq_head->isw = ITYPE_INVALID; in he_tasklet()
1995 he_dev->irq_head = (struct he_irq *) NEXT_ENTRY(he_dev->irq_base, he_dev->irq_head, IRQ_MASK); in he_tasklet()
1999 if (updated > he_dev->irq_peak) in he_tasklet()
2000 he_dev->irq_peak = updated; in he_tasklet()
2005 IRQ_TAIL(he_dev->irq_tail), IRQ0_HEAD); in he_tasklet()
2008 spin_unlock_irqrestore(&he_dev->global_lock, flags); in he_tasklet()
2021 spin_lock_irqsave(&he_dev->global_lock, flags); in he_irq_handler()
2023 he_dev->irq_tail = (struct he_irq *) (((unsigned long)he_dev->irq_base) | in he_irq_handler()
2024 (*he_dev->irq_tailoffset << 2)); in he_irq_handler()
2026 if (he_dev->irq_tail == he_dev->irq_head) { in he_irq_handler()
2028 he_dev->irq_tail = (struct he_irq *) ((unsigned long)he_dev->irq_base | in he_irq_handler()
2034 if (he_dev->irq_head == he_dev->irq_tail /* && !IRQ_PENDING */) in he_irq_handler()
2038 if (he_dev->irq_head != he_dev->irq_tail) { in he_irq_handler()
2040 tasklet_schedule(&he_dev->tasklet); in he_irq_handler()
2044 spin_unlock_irqrestore(&he_dev->global_lock, flags); in he_irq_handler()
2054 HPRINTK("tpdrq %p cid 0x%x -> tpdrq_tail %p\n", in __enqueue_tpd()
2055 tpd, cid, he_dev->tpdrq_tail); in __enqueue_tpd()
2057 /* new_tail = he_dev->tpdrq_tail; */ in __enqueue_tpd()
2058 new_tail = (struct he_tpdrq *) ((unsigned long) he_dev->tpdrq_base | in __enqueue_tpd()
2059 TPDRQ_MASK(he_dev->tpdrq_tail+1)); in __enqueue_tpd()
2068 if (new_tail == he_dev->tpdrq_head) { in __enqueue_tpd()
2069 he_dev->tpdrq_head = (struct he_tpdrq *) in __enqueue_tpd()
2070 (((unsigned long)he_dev->tpdrq_base) | in __enqueue_tpd()
2073 if (new_tail == he_dev->tpdrq_head) { in __enqueue_tpd()
2084 if (tpd->iovec[slot].addr) in __enqueue_tpd()
2085 dma_unmap_single(&he_dev->pci_dev->dev, in __enqueue_tpd()
2086 tpd->iovec[slot].addr, in __enqueue_tpd()
2087 tpd->iovec[slot].len & TPD_LEN_MASK, in __enqueue_tpd()
2090 if (tpd->skb) { in __enqueue_tpd()
2091 if (tpd->vcc->pop) in __enqueue_tpd()
2092 tpd->vcc->pop(tpd->vcc, tpd->skb); in __enqueue_tpd()
2094 dev_kfree_skb_any(tpd->skb); in __enqueue_tpd()
2095 atomic_inc(&tpd->vcc->stats->tx_err); in __enqueue_tpd()
2097 dma_pool_free(he_dev->tpd_pool, tpd, TPD_ADDR(tpd->status)); in __enqueue_tpd()
2103 list_add_tail(&tpd->entry, &he_dev->outstanding_tpds); in __enqueue_tpd()
2104 he_dev->tpdrq_tail->tpd = TPD_ADDR(tpd->status); in __enqueue_tpd()
2105 he_dev->tpdrq_tail->cid = cid; in __enqueue_tpd()
2108 he_dev->tpdrq_tail = new_tail; in __enqueue_tpd()
2110 he_writel(he_dev, TPDRQ_MASK(he_dev->tpdrq_tail), TPDRQ_T); in __enqueue_tpd()
2118 struct he_dev *he_dev = HE_DEV(vcc->dev); in he_open()
2122 short vpi = vcc->vpi; in he_open()
2123 int vci = vcc->vci; in he_open()
2130 set_bit(ATM_VF_ADDR, &vcc->flags); in he_open()
2137 return -ENOMEM; in he_open()
2140 INIT_LIST_HEAD(&he_vcc->buffers); in he_open()
2141 he_vcc->pdu_len = 0; in he_open()
2142 he_vcc->rc_index = -1; in he_open()
2144 init_waitqueue_head(&he_vcc->rx_waitq); in he_open()
2145 init_waitqueue_head(&he_vcc->tx_waitq); in he_open()
2147 vcc->dev_data = he_vcc; in he_open()
2149 if (vcc->qos.txtp.traffic_class != ATM_NONE) { in he_open()
2152 pcr_goal = atm_pcr_goal(&vcc->qos.txtp); in he_open()
2154 pcr_goal = he_dev->atm_dev->link_rate; in he_open()
2156 pcr_goal = -pcr_goal; in he_open()
2160 switch (vcc->qos.aal) { in he_open()
2170 err = -EINVAL; in he_open()
2174 spin_lock_irqsave(&he_dev->global_lock, flags); in he_open()
2176 spin_unlock_irqrestore(&he_dev->global_lock, flags); in he_open()
2180 err = -EBUSY; in he_open()
2184 switch (vcc->qos.txtp.traffic_class) { in he_open()
2195 /* 8.2.3 cbr scheduler wrap problem -- limit to 90% total link rate */ in he_open()
2196 if ((he_dev->total_bw + pcr_goal) in he_open()
2197 > (he_dev->atm_dev->link_rate * 9 / 10)) in he_open()
2199 err = -EBUSY; in he_open()
2203 spin_lock_irqsave(&he_dev->global_lock, flags); /* also protects he_dev->cs_stper[] */ in he_open()
2207 if (he_dev->cs_stper[reg].inuse == 0 || in he_open()
2208 he_dev->cs_stper[reg].pcr == pcr_goal) in he_open()
2212 err = -EBUSY; in he_open()
2213 spin_unlock_irqrestore(&he_dev->global_lock, flags); in he_open()
2217 he_dev->total_bw += pcr_goal; in he_open()
2219 he_vcc->rc_index = reg; in he_open()
2220 ++he_dev->cs_stper[reg].inuse; in he_open()
2221 he_dev->cs_stper[reg].pcr = pcr_goal; in he_open()
2231 spin_unlock_irqrestore(&he_dev->global_lock, flags); in he_open()
2238 err = -EINVAL; in he_open()
2242 spin_lock_irqsave(&he_dev->global_lock, flags); in he_open()
2262 spin_unlock_irqrestore(&he_dev->global_lock, flags); in he_open()
2265 if (vcc->qos.rxtp.traffic_class != ATM_NONE) { in he_open()
2269 &HE_VCC(vcc)->rx_waitq); in he_open()
2271 switch (vcc->qos.aal) { in he_open()
2279 err = -EINVAL; in he_open()
2283 spin_lock_irqsave(&he_dev->global_lock, flags); in he_open()
2287 spin_unlock_irqrestore(&he_dev->global_lock, flags); in he_open()
2290 err = -EBUSY; in he_open()
2296 rsr0 = vcc->qos.rxtp.traffic_class == ATM_UBR ? in he_open()
2312 spin_unlock_irqrestore(&he_dev->global_lock, flags); in he_open()
2319 clear_bit(ATM_VF_ADDR, &vcc->flags); in he_open()
2322 set_bit(ATM_VF_READY, &vcc->flags); in he_open()
2332 struct he_dev *he_dev = HE_DEV(vcc->dev); in he_close()
2339 HPRINTK("close vcc %p %d.%d\n", vcc, vcc->vpi, vcc->vci); in he_close()
2341 clear_bit(ATM_VF_READY, &vcc->flags); in he_close()
2342 cid = he_mkcid(he_dev, vcc->vpi, vcc->vci); in he_close()
2344 if (vcc->qos.rxtp.traffic_class != ATM_NONE) { in he_close()
2353 spin_lock_irqsave(&he_dev->global_lock, flags); in he_close()
2360 add_wait_queue(&he_vcc->rx_waitq, &wait); in he_close()
2365 spin_unlock_irqrestore(&he_dev->global_lock, flags); in he_close()
2369 remove_wait_queue(&he_vcc->rx_waitq, &wait); in he_close()
2379 if (vcc->qos.txtp.traffic_class != ATM_NONE) { in he_close()
2394 while (((tx_inuse = refcount_read(&sk_atm(vcc)->sk_wmem_alloc)) > 1) && in he_close()
2408 spin_lock_irqsave(&he_dev->global_lock, flags); in he_close()
2412 switch (vcc->qos.txtp.traffic_class) { in he_close()
2429 tpd->status |= TPD_EOS | TPD_INT; in he_close()
2430 tpd->skb = NULL; in he_close()
2431 tpd->vcc = vcc; in he_close()
2435 add_wait_queue(&he_vcc->tx_waitq, &wait); in he_close()
2437 spin_unlock_irqrestore(&he_dev->global_lock, flags); in he_close()
2441 remove_wait_queue(&he_vcc->tx_waitq, &wait); in he_close()
2444 spin_lock_irqsave(&he_dev->global_lock, flags); in he_close()
2463 if (vcc->qos.txtp.traffic_class == ATM_CBR) { in he_close()
2464 int reg = he_vcc->rc_index; in he_close()
2468 if (he_dev->cs_stper[reg].inuse == 0) in he_close()
2471 --he_dev->cs_stper[reg].inuse; in he_close()
2473 he_dev->total_bw -= he_dev->cs_stper[reg].pcr; in he_close()
2475 spin_unlock_irqrestore(&he_dev->global_lock, flags); in he_close()
2482 clear_bit(ATM_VF_ADDR, &vcc->flags); in he_close()
2489 struct he_dev *he_dev = HE_DEV(vcc->dev); in he_send()
2490 unsigned cid = he_mkcid(he_dev, vcc->vpi, vcc->vci); in he_send()
2498 HPRINTK("send %d.%d\n", vcc->vpi, vcc->vci); in he_send()
2500 if ((skb->len > HE_TPD_BUFSIZE) || in he_send()
2501 ((vcc->qos.aal == ATM_AAL0) && (skb->len != ATM_AAL0_SDU))) { in he_send()
2502 hprintk("buffer too large (or small) -- %d bytes\n", skb->len ); in he_send()
2503 if (vcc->pop) in he_send()
2504 vcc->pop(vcc, skb); in he_send()
2507 atomic_inc(&vcc->stats->tx_err); in he_send()
2508 return -EINVAL; in he_send()
2512 if (skb_shinfo(skb)->nr_frags) { in he_send()
2514 if (vcc->pop) in he_send()
2515 vcc->pop(vcc, skb); in he_send()
2518 atomic_inc(&vcc->stats->tx_err); in he_send()
2519 return -EINVAL; in he_send()
2522 spin_lock_irqsave(&he_dev->global_lock, flags); in he_send()
2526 if (vcc->pop) in he_send()
2527 vcc->pop(vcc, skb); in he_send()
2530 atomic_inc(&vcc->stats->tx_err); in he_send()
2531 spin_unlock_irqrestore(&he_dev->global_lock, flags); in he_send()
2532 return -ENOMEM; in he_send()
2535 if (vcc->qos.aal == ATM_AAL5) in he_send()
2536 tpd->status |= TPD_CELLTYPE(TPD_USERCELL); in he_send()
2538 char *pti_clp = (void *) (skb->data + 3); in he_send()
2543 tpd->status |= TPD_CELLTYPE(pti); in he_send()
2545 tpd->status |= TPD_CLP; in he_send()
2547 skb_pull(skb, ATM_AAL0_SDU - ATM_CELL_PAYLOAD); in he_send()
2551 tpd->iovec[slot].addr = dma_map_single(&he_dev->pci_dev->dev, skb->data, in he_send()
2553 tpd->iovec[slot].len = skb_headlen(skb); in he_send()
2556 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { in he_send()
2557 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; in he_send()
2560 tpd->vcc = vcc; in he_send()
2561 tpd->skb = NULL; /* not the last fragment in he_send()
2562 so dont ->push() yet */ in he_send()
2568 if (vcc->pop) in he_send()
2569 vcc->pop(vcc, skb); in he_send()
2572 atomic_inc(&vcc->stats->tx_err); in he_send()
2573 spin_unlock_irqrestore(&he_dev->global_lock, flags); in he_send()
2574 return -ENOMEM; in he_send()
2576 tpd->status |= TPD_USERCELL; in he_send()
2580 tpd->iovec[slot].addr = skb_frag_dma_map(&he_dev->pci_dev->dev, in he_send()
2582 tpd->iovec[slot].len = skb_frag_size(frag); in he_send()
2587 tpd->iovec[slot - 1].len |= TPD_LST; in he_send()
2589 tpd->address0 = dma_map_single(&he_dev->pci_dev->dev, skb->data, skb->len, DMA_TO_DEVICE); in he_send()
2590 tpd->length0 = skb->len | TPD_LST; in he_send()
2592 tpd->status |= TPD_INT; in he_send()
2594 tpd->vcc = vcc; in he_send()
2595 tpd->skb = skb; in he_send()
2597 ATM_SKB(skb)->vcc = vcc; in he_send()
2600 spin_unlock_irqrestore(&he_dev->global_lock, flags); in he_send()
2602 atomic_inc(&vcc->stats->tx); in he_send()
2618 return -EPERM; in he_ioctl()
2622 return -EFAULT; in he_ioctl()
2624 spin_lock_irqsave(&he_dev->global_lock, flags); in he_ioctl()
2628 err = -EINVAL; in he_ioctl()
2647 err = -EINVAL; in he_ioctl()
2650 spin_unlock_irqrestore(&he_dev->global_lock, flags); in he_ioctl()
2654 return -EFAULT; in he_ioctl()
2658 if (atm_dev->phy && atm_dev->phy->ioctl) in he_ioctl()
2659 err = atm_dev->phy->ioctl(atm_dev, cmd, arg); in he_ioctl()
2661 err = -EINVAL; in he_ioctl()
2677 spin_lock_irqsave(&he_dev->global_lock, flags); in he_phy_put()
2680 spin_unlock_irqrestore(&he_dev->global_lock, flags); in he_phy_put()
2691 spin_lock_irqsave(&he_dev->global_lock, flags); in he_phy_get()
2693 spin_unlock_irqrestore(&he_dev->global_lock, flags); in he_phy_get()
2714 if (!left--) in he_proc_read()
2717 if (!left--) in he_proc_read()
2719 he_dev->prod_id, he_dev->media & 0x40 ? "SM" : "MM"); in he_proc_read()
2721 if (!left--) in he_proc_read()
2724 spin_lock_irqsave(&he_dev->global_lock, flags); in he_proc_read()
2729 spin_unlock_irqrestore(&he_dev->global_lock, flags); in he_proc_read()
2731 if (!left--) in he_proc_read()
2735 if (!left--) in he_proc_read()
2737 CONFIG_IRQ_SIZE, he_dev->irq_peak); in he_proc_read()
2739 if (!left--) in he_proc_read()
2743 if (!left--) in he_proc_read()
2745 CONFIG_RBRQ_SIZE, he_dev->rbrq_peak); in he_proc_read()
2747 if (!left--) in he_proc_read()
2749 CONFIG_TBRQ_SIZE, he_dev->tbrq_peak); in he_proc_read()
2756 inuse = rbpl_head - rbpl_tail; in he_proc_read()
2761 if (!left--) in he_proc_read()
2766 if (!left--) in he_proc_read()
2770 if (!left--) in he_proc_read()
2771 return sprintf(page, "cs_stper%-2d %8ld %3d\n", i, in he_proc_read()
2772 he_dev->cs_stper[i].pcr, in he_proc_read()
2773 he_dev->cs_stper[i].inuse); in he_proc_read()
2775 if (!left--) in he_proc_read()
2777 he_dev->total_bw, he_dev->atm_dev->link_rate * 10 / 9); in he_proc_read()
2782 /* eeprom routines -- see 4.7 */
2790 val = readl(he_dev->membase + HOST_CNTL); in read_prom_byte()
2804 for (i = 7; i >= 0; i--) { in read_prom_byte()
2817 for (i = 7; i >= 0; i--) { in read_prom_byte()
2837 MODULE_PARM_DESC(disable64, "disable 64-bit pci bus transfers");