Lines Matching refs:lp

278 static struct pcnet32_private *lp;  variable
408 lp->tx_full = 0; in pcnet32_init_ring()
409 lp->cur_rx = lp->cur_tx = 0; in pcnet32_init_ring()
425 lp->init_block.tlen_rlen = in pcnet32_init_ring()
428 lp->init_block.phys_addr[i] = nic->node_addr[i]; in pcnet32_init_ring()
429 lp->init_block.rx_ring = (u32) virt_to_le32desc(&rx_ring[0]); in pcnet32_init_ring()
430 lp->init_block.tx_ring = (u32) virt_to_le32desc(&tx_ring[0]); in pcnet32_init_ring()
444 lp->a.reset(ioaddr); in pcnet32_reset()
447 lp->a.write_bcr(ioaddr, 20, 2); in pcnet32_reset()
450 val = lp->a.read_bcr(ioaddr, 2) & ~2; in pcnet32_reset()
451 if (lp->options & PCNET32_PORT_ASEL) in pcnet32_reset()
453 lp->a.write_bcr(ioaddr, 2, val); in pcnet32_reset()
455 if (lp->full_duplex) { in pcnet32_reset()
456 val = lp->a.read_bcr(ioaddr, 9) & ~3; in pcnet32_reset()
457 if (lp->options & PCNET32_PORT_FD) { in pcnet32_reset()
459 if (lp->options == in pcnet32_reset()
462 } else if (lp->options & PCNET32_PORT_ASEL) { in pcnet32_reset()
464 i = ((lp->a. in pcnet32_reset()
466 88) | (lp->a.read_csr(ioaddr, in pcnet32_reset()
472 lp->a.write_bcr(ioaddr, 9, val); in pcnet32_reset()
476 val = lp->a.read_csr(ioaddr, 124) & ~0x10; in pcnet32_reset()
477 if ((lp->options & PCNET32_PORT_PORTSEL) == PCNET32_PORT_GPSI) in pcnet32_reset()
479 lp->a.write_csr(ioaddr, 124, val); in pcnet32_reset()
481 if (lp->mii && !(lp->options & PCNET32_PORT_ASEL)) { in pcnet32_reset()
482 val = lp->a.read_bcr(ioaddr, 32) & ~0x38; /* disable Auto Negotiation, set 10Mbps, HD */ in pcnet32_reset()
483 if (lp->options & PCNET32_PORT_FD) in pcnet32_reset()
485 if (lp->options & PCNET32_PORT_100) in pcnet32_reset()
487 lp->a.write_bcr(ioaddr, 32, val); in pcnet32_reset()
489 if (lp->options & PCNET32_PORT_ASEL) { /* enable auto negotiate, setup, disable fd */ in pcnet32_reset()
490 val = lp->a.read_bcr(ioaddr, 32) & ~0x98; in pcnet32_reset()
492 lp->a.write_bcr(ioaddr, 32, val); in pcnet32_reset()
497 if (lp->dxsuflo) { /* Disable transmit stop on underflow */ in pcnet32_reset()
498 val = lp->a.read_csr(ioaddr, 3); in pcnet32_reset()
500 lp->a.write_csr(ioaddr, 3, val); in pcnet32_reset()
504 if (lp->ltint) { /* Enable TxDone-intr inhibitor */ in pcnet32_reset()
505 val = lp->a.read_csr(ioaddr, 5); in pcnet32_reset()
507 lp->a.write_csr(ioaddr, 5, val); in pcnet32_reset()
509 lp->init_block.mode = in pcnet32_reset()
510 le16_to_cpu((lp->options & PCNET32_PORT_PORTSEL) << 7); in pcnet32_reset()
511 lp->init_block.filter[0] = 0xffffffff; in pcnet32_reset()
512 lp->init_block.filter[1] = 0xffffffff; in pcnet32_reset()
518 lp->a.write_csr(ioaddr, 1, in pcnet32_reset()
519 (virt_to_bus(&lp->init_block)) & 0xffff); in pcnet32_reset()
520 lp->a.write_csr(ioaddr, 2, (virt_to_bus(&lp->init_block)) >> 16); in pcnet32_reset()
521 lp->a.write_csr(ioaddr, 4, 0x0915); in pcnet32_reset()
522 lp->a.write_csr(ioaddr, 0, 0x0001); in pcnet32_reset()
527 if (lp->a.read_csr(ioaddr, 0) & 0x0100) in pcnet32_reset()
533 lp->a.write_csr(ioaddr, 0, 0x0042); in pcnet32_reset()
535 dprintf(("pcnet32 open, csr0 %hX.\n", lp->a.read_csr(ioaddr, 0))); in pcnet32_reset()
551 entry = lp->cur_rx & RX_RING_MOD_MASK; in pcnet32_poll()
569 lp->cur_rx++; in pcnet32_poll()
595 ptxb = txb + (lp->cur_tx * PKT_BUF_SZ); in pcnet32_transmit()
617 lp->a.write_csr(ioaddr, 0, 0x0048); in pcnet32_transmit()
620 lp->cur_tx = 0; /* (lp->cur_tx + 1); */ in pcnet32_transmit()
640 lp->a.write_csr(ioaddr, 0, 0x0004); in pcnet32_disable()
646 lp->a.write_bcr(ioaddr, 20, 4); in pcnet32_disable()
810 lp = &lpx; in pcnet32_probe()
849 lp->name = chipname; in pcnet32_probe()
850 lp->shared_irq = shared; in pcnet32_probe()
851 lp->full_duplex = fdx; in pcnet32_probe()
852 lp->dxsuflo = dxsuflo; in pcnet32_probe()
853 lp->ltint = ltint; in pcnet32_probe()
854 lp->mii = mii; in pcnet32_probe()
858 lp->options = PCNET32_PORT_ASEL; in pcnet32_probe()
860 lp->options = options_mapping[options[cards_found]]; in pcnet32_probe()
862 if (fdx && !(lp->options & PCNET32_PORT_ASEL) && in pcnet32_probe()
864 lp->options |= PCNET32_PORT_FD; in pcnet32_probe()
870 lp->a = *a; in pcnet32_probe()
875 lp->options = PCNET32_PORT_FD | PCNET32_PORT_GPSI; in pcnet32_probe()
877 lp->init_block.mode = le16_to_cpu(0x0003); /* Disable Rx and Tx. */ in pcnet32_probe()
878 lp->init_block.tlen_rlen = in pcnet32_probe()
881 lp->init_block.phys_addr[i] = nic->node_addr[i]; in pcnet32_probe()
882 lp->init_block.filter[0] = 0xffffffff; in pcnet32_probe()
883 lp->init_block.filter[1] = 0xffffffff; in pcnet32_probe()
884 lp->init_block.rx_ring = virt_to_bus(&rx_ring); in pcnet32_probe()
885 lp->init_block.tx_ring = virt_to_bus(&tx_ring); in pcnet32_probe()
891 a->write_csr(ioaddr, 1, (virt_to_bus(&lp->init_block)) & 0xffff); in pcnet32_probe()
892 a->write_csr(ioaddr, 2, (virt_to_bus(&lp->init_block)) >> 16); in pcnet32_probe()
912 lp->phys[0] = 1; /* Default Setting */ in pcnet32_probe()
916 lp->phys[phy_idx++] = phy; in pcnet32_probe()
917 lp->mii_if.advertising = in pcnet32_probe()
923 lp->mii_if.advertising)); in pcnet32_probe()
929 lp->mii_if.phy_id = lp->phys[0]; in pcnet32_probe()
931 lp->mii_if.advertising = in pcnet32_probe()
932 mdio_read(nic, lp->phys[0], MII_ADVERTISE); in pcnet32_probe()
934 mii_lpa = mdio_read(nic, lp->phys[0], MII_LPA); in pcnet32_probe()
935 lp->mii_if.advertising &= mii_lpa; in pcnet32_probe()
936 if (lp->mii_if.advertising & ADVERTISE_100FULL) in pcnet32_probe()
938 else if (lp->mii_if.advertising & ADVERTISE_100HALF) in pcnet32_probe()
940 else if (lp->mii_if.advertising & ADVERTISE_10FULL) in pcnet32_probe()
942 else if (lp->mii_if.advertising & ADVERTISE_10HALF) in pcnet32_probe()
960 if (!lp->mii) in mdio_read()
963 phyaddr = lp->a.read_bcr(ioaddr, 33); in mdio_read()
965 lp->a.write_bcr(ioaddr, 33, in mdio_read()
967 val_out = lp->a.read_bcr(ioaddr, 34); in mdio_read()
968 lp->a.write_bcr(ioaddr, 33, phyaddr); in mdio_read()
979 if (!lp->mii)
982 phyaddr = lp->a.read_bcr(ioaddr, 33);
984 lp->a.write_bcr(ioaddr, 33,
986 lp->a.write_bcr(ioaddr, 34, val);
987 lp->a.write_bcr(ioaddr, 33, phyaddr);