Lines Matching refs:nic

50 #include "nic.h"
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)
333 void TLan_ResetAdapter(struct nic *nic __unused)
384 TLan_PhyDetect(nic);
405 TLan_FinishReset(nic);
407 TLan_PhyPowerDown(nic);
412 void TLan_FinishReset(struct nic *nic)
438 TLan_MiiReadReg(nic, phy, MII_GEN_ID_HI, &tlphy_id1);
439 TLan_MiiReadReg(nic, phy, MII_GEN_ID_LO, &tlphy_id2);
446 TLan_MiiReadReg(nic, phy, MII_GEN_STS, &status);
448 TLan_MiiReadReg(nic, phy, MII_GEN_STS, &status);
452 TLan_MiiReadReg(nic, phy, MII_AN_LPA, &partner);
453 TLan_MiiReadReg(nic, phy, TLAN_TLPHY_PAR,
483 /* TLan_SetTimer( nic, (10*HZ), TLAN_TIMER_LINK_BEAT ); */
485 TLan_PhyMonitor(nic);
494 TLan_MiiReadReg(nic, phy, TLAN_TLPHY_CTL, &tlphy_ctl);
496 TLan_MiiWriteReg(nic, phy, TLAN_TLPHY_CTL, tlphy_ctl);
503 TLan_SetMac(nic, 0, nic->node_addr);
517 /* TLan_SetTimer( nic, (10*HZ), TLAN_TIMER_FINISH_RESET ); */
519 TLan_FinishReset(nic);
529 static int tlan_poll(struct nic *nic, int retrieve)
532 /* nic->packet should contain data on return */
533 /* nic->packetlen should contain length of data */
556 nic->packetlen = framesize;
562 memcpy(nic->packet, rxb +
563 (priv->cur_rx * TLAN_MAX_FRAME_SIZE), nic->packetlen);
567 hex_dump(nic->packet, nic->packetlen);
588 refill_rx(nic);
592 static void refill_rx(struct nic *nic __unused)
611 static void tlan_transmit(struct nic *nic, const char *d, /* Destination */
655 memcpy(tail_buffer + ETH_ALEN, nic->node_addr, ETH_ALEN);
779 static void tlan_disable(struct nic *nic __unused)
799 static void tlan_irq(struct nic *nic __unused, irq_action_t action __unused)
811 static void TLan_SetMulticastList(struct nic *nic) {
821 TLan_SetMac(nic, i + 1, NULL);
836 struct nic *nic = (struct nic *) dev;
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)
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)
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)
1512 TLan_MiiWriteReg(nic, priv->phy[priv->phyNum], MII_GEN_CTL, value);
1519 TLan_PhyReset(nic);
1524 void TLan_PhyReset(struct nic *nic)
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)
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)
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);
1700 /* TLan_SetTimer( nic, (400*HZ/1000), TLAN_TIMER_PHY_PDOWN ); */
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);