Lines Matching refs:nic
75 static void TLan_ResetLists(struct nic *nic __unused);
76 static void TLan_ResetAdapter(struct nic *nic __unused);
77 static void TLan_FinishReset(struct nic *nic __unused);
84 static void TLan_PhyDetect(struct nic *nic);
85 static void TLan_PhyPowerDown(struct nic *nic);
86 static void TLan_PhyPowerUp(struct nic *nic);
89 static void TLan_SetMac(struct nic *nic __unused, int areg, char *mac);
91 static void TLan_PhyReset(struct nic *nic);
92 static void TLan_PhyStartLink(struct nic *nic);
93 static void TLan_PhyFinishAutoNeg(struct nic *nic);
96 static void TLan_PhyMonitor(struct nic *nic);
100 static void refill_rx(struct nic *nic __unused);
102 static int TLan_MiiReadReg(struct nic *nic __unused, u16, u16, u16 *);
105 static void TLan_MiiWriteReg(struct nic *nic __unused, u16, u16, u16);
273 void TLan_ResetLists(struct nic *nic __unused) in TLan_ResetLists()
333 void TLan_ResetAdapter(struct nic *nic __unused) in TLan_ResetAdapter()
384 TLan_PhyDetect(nic); in TLan_ResetAdapter()
405 TLan_FinishReset(nic); in TLan_ResetAdapter()
407 TLan_PhyPowerDown(nic); in TLan_ResetAdapter()
412 void TLan_FinishReset(struct nic *nic) in TLan_FinishReset() argument
438 TLan_MiiReadReg(nic, phy, MII_GEN_ID_HI, &tlphy_id1); in TLan_FinishReset()
439 TLan_MiiReadReg(nic, phy, MII_GEN_ID_LO, &tlphy_id2); in TLan_FinishReset()
446 TLan_MiiReadReg(nic, phy, MII_GEN_STS, &status); in TLan_FinishReset()
448 TLan_MiiReadReg(nic, phy, MII_GEN_STS, &status); in TLan_FinishReset()
452 TLan_MiiReadReg(nic, phy, MII_AN_LPA, &partner); in TLan_FinishReset()
453 TLan_MiiReadReg(nic, phy, TLAN_TLPHY_PAR, in TLan_FinishReset()
485 TLan_PhyMonitor(nic); in TLan_FinishReset()
494 TLan_MiiReadReg(nic, phy, TLAN_TLPHY_CTL, &tlphy_ctl); in TLan_FinishReset()
496 TLan_MiiWriteReg(nic, phy, TLAN_TLPHY_CTL, tlphy_ctl); in TLan_FinishReset()
503 TLan_SetMac(nic, 0, nic->node_addr); in TLan_FinishReset()
519 TLan_FinishReset(nic); in TLan_FinishReset()
529 static int tlan_poll(struct nic *nic, int retrieve) in tlan_poll() argument
556 nic->packetlen = framesize; in tlan_poll()
562 memcpy(nic->packet, rxb + in tlan_poll()
563 (priv->cur_rx * TLAN_MAX_FRAME_SIZE), nic->packetlen); in tlan_poll()
567 hex_dump(nic->packet, nic->packetlen); in tlan_poll()
588 refill_rx(nic); in tlan_poll()
592 static void refill_rx(struct nic *nic __unused) in refill_rx()
611 static void tlan_transmit(struct nic *nic, const char *d, /* Destination */ in tlan_transmit() argument
655 memcpy(tail_buffer + ETH_ALEN, nic->node_addr, ETH_ALEN); in tlan_transmit()
779 static void tlan_disable(struct nic *nic __unused) in tlan_disable()
799 static void tlan_irq(struct nic *nic __unused, irq_action_t action __unused) in tlan_irq()
811 static void TLan_SetMulticastList(struct nic *nic) { in TLan_SetMulticastList() argument
821 TLan_SetMac(nic, i + 1, NULL); in TLan_SetMulticastList()
836 struct nic *nic = (struct nic *) dev; local
838 struct nic *tlan_probe(struct nic *nic, unsigned short *io_addrs, struct pci_device *pci)
848 nic->irqno = 0;
849 nic->ioaddr = pci->ioaddr & ~3;
886 (u8 *) & nic->node_addr[i]);
891 printf("\nAddress: %!\n", nic->node_addr);
896 TLan_ResetLists(nic);
897 TLan_ResetAdapter(nic);
908 TLan_SetMulticastList(nic);
917 nic->poll = tlan_poll;
918 nic->transmit = tlan_transmit;
919 nic->irq = tlan_irq;
922 nic->disable = tlan_disable;
923 nic->poll = tlan_poll;
924 nic->transmit = tlan_transmit;
925 nic->irq = tlan_irq;
926 return nic;
1185 int TLan_MiiReadReg(struct nic *nic __unused, u16 phy, u16 reg, u16 * val)
1345 void TLan_MiiWriteReg(struct nic *nic __unused, u16 phy, u16 reg, u16 val)
1397 void TLan_SetMac(struct nic *nic __unused, int areg, char *mac)
1431 void TLan_PhyDetect(struct nic *nic) argument
1443 TLan_MiiReadReg(nic, TLAN_PHY_MAX_ADDR, MII_GEN_ID_HI, &hi);
1453 TLan_MiiReadReg(nic, phy, MII_GEN_CTL, &control);
1454 TLan_MiiReadReg(nic, phy, MII_GEN_ID_HI, &hi);
1455 TLan_MiiReadReg(nic, phy, MII_GEN_ID_LO, &lo);
1478 void TLan_PhyPowerDown(struct nic *nic) argument
1485 TLan_MiiWriteReg(nic, priv->phy[priv->phyNum], MII_GEN_CTL, value);
1491 TLan_MiiWriteReg(nic, priv->phy[1], MII_GEN_CTL, value);
1500 TLan_PhyPowerUp(nic);
1505 void TLan_PhyPowerUp(struct nic *nic) argument
1512 TLan_MiiWriteReg(nic, priv->phy[priv->phyNum], MII_GEN_CTL, value);
1519 TLan_PhyReset(nic);
1524 void TLan_PhyReset(struct nic *nic) argument
1534 TLan_MiiWriteReg(nic, phy, MII_GEN_CTL, value);
1535 TLan_MiiReadReg(nic, phy, MII_GEN_CTL, &value);
1537 TLan_MiiReadReg(nic, phy, MII_GEN_CTL, &value);
1546 TLan_PhyStartLink(nic);
1551 void TLan_PhyStartLink(struct nic *nic) argument
1563 TLan_MiiReadReg(nic, phy, MII_GEN_STS, &status);
1564 TLan_MiiReadReg(nic, phy, MII_GEN_STS, &ability);
1570 TLan_MiiWriteReg(nic, phy, MII_GEN_CTL, 0x0000);
1574 TLan_MiiWriteReg(nic, phy, MII_GEN_CTL, 0x0100);
1577 TLan_MiiWriteReg(nic, phy, MII_GEN_CTL, 0x2000);
1581 TLan_MiiWriteReg(nic, phy, MII_GEN_CTL, 0x2100);
1585 TLan_MiiWriteReg(nic, phy, MII_AN_ADV,
1588 TLan_MiiWriteReg(nic, phy, MII_GEN_CTL, 0x1000);
1590 TLan_MiiWriteReg(nic, phy, MII_GEN_CTL, 0x1200);
1599 TLan_PhyFinishAutoNeg(nic);
1614 TLan_PhyPowerDown(nic);
1618 TLan_MiiReadReg(nic, phy, TLAN_TLPHY_CTL, &tctl);
1631 TLan_MiiWriteReg(nic, phy, MII_GEN_CTL, control);
1632 TLan_MiiWriteReg(nic, phy, TLAN_TLPHY_CTL, tctl);
1640 TLan_FinishReset(nic);
1644 void TLan_PhyFinishAutoNeg(struct nic *nic) argument
1656 TLan_MiiReadReg(nic, phy, MII_GEN_STS, &status);
1658 TLan_MiiReadReg(nic, phy, MII_GEN_STS, &status);
1675 TLan_PhyFinishAutoNeg(nic);
1681 TLan_MiiReadReg(nic, phy, MII_AN_ADV, &an_adv);
1682 TLan_MiiReadReg(nic, phy, MII_AN_LPA, &an_lpa);
1702 TLan_PhyPowerDown(nic);
1709 TLan_MiiWriteReg(nic, phy, MII_GEN_CTL,
1714 TLan_MiiWriteReg(nic, phy, MII_GEN_CTL,
1725 TLan_FinishReset(nic);
1758 TLan_MiiReadReg(nic, phy, MII_GEN_STS, &phy_status);
1767 TLan_PhyMonitor(nic);
1784 TLan_PhyMonitor(nic);