Lines Matching refs:np

428 static struct forcedeth_private *np;  variable
517 miicontrol = mii_rw(nic, np->phyaddr, MII_BMCR, MII_READ); in phy_reset()
519 if (mii_rw(nic, np->phyaddr, MII_BMCR, miicontrol)) { in phy_reset()
529 miicontrol = mii_rw(nic, np->phyaddr, MII_BMCR, MII_READ); in phy_reset()
544 reg = mii_rw(nic, np->phyaddr, MII_ADVERTISE, MII_READ); in phy_init()
548 if (mii_rw(nic, np->phyaddr, MII_ADVERTISE, reg)) { in phy_init()
557 mii_status = mii_rw(nic, np->phyaddr, MII_BMSR, MII_READ); in phy_init()
560 np->gigabit = PHY_GIGABIT; in phy_init()
562 mii_rw(nic, np->phyaddr, MII_CTRL1000, MII_READ); in phy_init()
570 (nic, np->phyaddr, MII_CTRL1000, mii_control_1000)) { in phy_init()
575 np->gigabit = 0; in phy_init()
584 if ((np->phy_oui == PHY_OUI_CICADA) && (phyinterface & PHY_RGMII)) { in phy_init()
586 mii_rw(nic, np->phyaddr, MII_RESV1, MII_READ); in phy_init()
589 if (mii_rw(nic, np->phyaddr, MII_RESV1, phy_reserved)) { in phy_init()
594 mii_rw(nic, np->phyaddr, MII_NCONFIG, MII_READ); in phy_init()
596 if (mii_rw(nic, np->phyaddr, MII_NCONFIG, phy_reserved)) { in phy_init()
601 if (np->phy_oui == PHY_OUI_CICADA) { in phy_init()
603 mii_rw(nic, np->phyaddr, MII_SREVISION, MII_READ); in phy_init()
605 if (mii_rw(nic, np->phyaddr, MII_SREVISION, phy_reserved)) { in phy_init()
612 mii_control = mii_rw(nic, np->phyaddr, MII_BMCR, MII_READ); in phy_init()
614 if (mii_rw(nic, np->phyaddr, MII_BMCR, mii_control)) { in phy_init()
631 writel(np->linkspeed, base + NvRegLinkSpeed); in start_rx()
680 writel(NVREG_TXRXCTL_BIT2 | NVREG_TXRXCTL_RESET | np->desc_ver, in txrx_reset()
685 writel(NVREG_TXRXCTL_BIT2 | np->desc_ver, base + NvRegTxRxControl); in txrx_reset()
696 unsigned int refill_rx = np->refill_rx; in alloc_rx()
710 np->refill_rx = refill_rx; in alloc_rx()
711 if (np->cur_rx - refill_rx == RX_RING) in alloc_rx()
720 int newdup = np->duplex; in update_linkspeed()
730 mii_rw(nic, np->phyaddr, MII_BMSR, MII_READ); in update_linkspeed()
731 mii_status = mii_rw(nic, np->phyaddr, MII_BMSR, MII_READ); in update_linkspeed()
736 mii_status = mii_rw(nic, np->phyaddr, MII_BMSR, MII_READ); in update_linkspeed()
762 if (np->gigabit == PHY_GIGABIT) { in update_linkspeed()
764 mii_rw(nic, np->phyaddr, MII_CTRL1000, MII_READ); in update_linkspeed()
766 mii_rw(nic, np->phyaddr, MII_STAT1000, MII_READ); in update_linkspeed()
779 adv = mii_rw(nic, np->phyaddr, MII_ADVERTISE, MII_READ); in update_linkspeed()
780 lpa = mii_rw(nic, np->phyaddr, MII_LPA, MII_READ); in update_linkspeed()
805 if (np->duplex == newdup && np->linkspeed == newls) in update_linkspeed()
809np->linkspeed, np->duplex ? "Full-Duplex": "Half-Duplex", newls, newdup ? "Full-Duplex": "Half-Dup… in update_linkspeed()
811 np->duplex = newdup; in update_linkspeed()
812 np->linkspeed = newls; in update_linkspeed()
814 if (np->gigabit == PHY_GIGABIT) { in update_linkspeed()
817 if ((np->linkspeed & 0xFFF) == NVREG_LINKSPEED_10) in update_linkspeed()
819 else if ((np->linkspeed & 0xFFF) == NVREG_LINKSPEED_100) in update_linkspeed()
821 else if ((np->linkspeed & 0xFFF) == NVREG_LINKSPEED_1000) in update_linkspeed()
828 if (np->duplex == 0) in update_linkspeed()
830 if ((np->linkspeed & 0xFFF) == NVREG_LINKSPEED_100) in update_linkspeed()
832 else if ((np->linkspeed & 0xFFF) == NVREG_LINKSPEED_1000) in update_linkspeed()
836 writel(NVREG_MISC1_FORCE | (np->duplex ? 0 : NVREG_MISC1_HD), in update_linkspeed()
839 writel(np->linkspeed, base + NvRegLinkSpeed); in update_linkspeed()
870 np->next_tx = np->nic_tx = 0; in init_ring()
874 np->cur_rx = 0; in init_ring()
875 np->refill_rx = 0; in init_ring()
945 np->in_shutdown = 0; in forcedeth_reset()
972 np->linkspeed = NVREG_LINKSPEED_FORCE | NVREG_LINKSPEED_10; in forcedeth_reset()
973 np->duplex = 0; in forcedeth_reset()
974 writel(np->linkspeed, base + NvRegLinkSpeed); in forcedeth_reset()
976 writel(np->desc_ver, base + NvRegTxRxControl); in forcedeth_reset()
978 writel(NVREG_TXRXCTL_BIT1 | np->desc_ver, base + NvRegTxRxControl); in forcedeth_reset()
989 np->linkspeed & NVREG_LINKSPEED_10 ? 10 : 100, in forcedeth_reset()
990 np->duplex ? "Full" : "Half"); in forcedeth_reset()
1011 writel((np-> in forcedeth_reset()
1084 i = np->cur_rx % RX_RING; in forcedeth_poll()
1087 len = nv_descr_getlength(&rx_ring[i], np->desc_ver); in forcedeth_poll()
1092 if (np->desc_ver == DESC_VER_1) { in forcedeth_poll()
1110 np->cur_rx++; in forcedeth_poll()
1128 int nr = np->next_tx % TX_RING; in forcedeth_transmit()
1148 tx_ring[nr].FlagLen = cpu_to_le32((s - 1) | np->tx_flags); in forcedeth_transmit()
1150 writel(NVREG_TXRXCTL_KICK | np->desc_ver, base + NvRegTxRxControl); in forcedeth_transmit()
1152 np->next_tx++; in forcedeth_transmit()
1170 np->in_shutdown = 1; in forcedeth_disable()
1182 writel(np->orig_mac[0], base + NvRegMacAddrA); in forcedeth_disable()
1183 writel(np->orig_mac[1], base + NvRegMacAddrB); in forcedeth_disable()
1236 np = &npx; in forcedeth_probe()
1252 np->desc_ver = DESC_VER_1; in forcedeth_probe()
1254 np->desc_ver = DESC_VER_2; in forcedeth_probe()
1261 np->orig_mac[0] = readl(base + NvRegMacAddrA); in forcedeth_probe()
1262 np->orig_mac[1] = readl(base + NvRegMacAddrB); in forcedeth_probe()
1275 nic->node_addr[0] = (np->orig_mac[0] >> 0) & 0xff; in forcedeth_probe()
1276 nic->node_addr[1] = (np->orig_mac[0] >> 8) & 0xff; in forcedeth_probe()
1277 nic->node_addr[2] = (np->orig_mac[0] >> 16) & 0xff; in forcedeth_probe()
1278 nic->node_addr[3] = (np->orig_mac[0] >> 24) & 0xff; in forcedeth_probe()
1279 nic->node_addr[4] = (np->orig_mac[1] >> 0) & 0xff; in forcedeth_probe()
1280 nic->node_addr[5] = (np->orig_mac[1] >> 8) & 0xff; in forcedeth_probe()
1282 nic->node_addr[0] = (np->orig_mac[1] >> 8) & 0xff; in forcedeth_probe()
1283 nic->node_addr[1] = (np->orig_mac[1] >> 0) & 0xff; in forcedeth_probe()
1284 nic->node_addr[2] = (np->orig_mac[0] >> 24) & 0xff; in forcedeth_probe()
1285 nic->node_addr[3] = (np->orig_mac[0] >> 16) & 0xff; in forcedeth_probe()
1286 nic->node_addr[4] = (np->orig_mac[0] >> 8) & 0xff; in forcedeth_probe()
1287 nic->node_addr[5] = (np->orig_mac[0] >> 0) & 0xff; in forcedeth_probe()
1314 np->wolenabled = 0; in forcedeth_probe()
1316 if (np->desc_ver == DESC_VER_1) { in forcedeth_probe()
1317 np->tx_flags = NV_TX_LASTPACKET | NV_TX_VALID; in forcedeth_probe()
1319 np->tx_flags = NV_TX2_LASTPACKET | NV_TX2_VALID; in forcedeth_probe()
1326 np->irqmask = NVREG_IRQMASK_WANTED_2 | NVREG_IRQ_TIMER; in forcedeth_probe()
1334 np->irqmask = NVREG_IRQMASK_WANTED_2; in forcedeth_probe()
1335 np->irqmask |= NVREG_IRQ_TIMER; in forcedeth_probe()
1338 if (np->desc_ver == DESC_VER_1) in forcedeth_probe()
1339 np->tx_flags |= NV_TX_LASTPACKET1; in forcedeth_probe()
1341 np->tx_flags |= NV_TX2_LASTPACKET1; in forcedeth_probe()
1361 np->irqmask = NVREG_IRQMASK_WANTED_2; in forcedeth_probe()
1362 np->irqmask |= NVREG_IRQ_TIMER; in forcedeth_probe()
1365 if (np->desc_ver == DESC_VER_1) in forcedeth_probe()
1366 np->tx_flags |= NV_TX_LASTPACKET1; in forcedeth_probe()
1368 np->tx_flags |= NV_TX2_LASTPACKET1; in forcedeth_probe()
1389 np->phyaddr = i; in forcedeth_probe()
1390 np->phy_oui = id1 | id2; in forcedeth_probe()