Lines Matching full:nic
22 The TRENDnet TE100-PCIA NIC which uses a genuine Intel 21143-PD
82 particular, the TRENDnet TE100-PCIA NIC which uses a genuine Intel
108 #include "nic.h"
480 static int mdio_read(struct nic *nic, int phy_id, int location);
481 static void mdio_write(struct nic *nic, int phy_id, int location, int value);
483 static void parse_eeprom(struct nic *nic);
484 struct nic *tulip_probe(struct nic *nic, unsigned short *io_addrs,
486 static void tulip_init_ring(struct nic *nic);
487 static void tulip_reset(struct nic *nic);
488 static void tulip_transmit(struct nic *nic, const char *d, unsigned int t,
490 static int tulip_poll(struct nic *nic);
491 static void tulip_disable(struct nic *nic);
492 static void nway_start(struct nic *nic);
493 static void pnic_do_nway(struct nic *nic);
494 static void select_media(struct nic *nic, int startup);
495 static void init_media(struct nic *nic);
496 static void start_link(struct nic *nic);
497 static int tulip_check_duplex(struct nic *nic);
572 int mdio_read(struct nic *nic, int phy_id, int location)
633 void mdio_write(struct nic *nic, int phy_id, int location, int value)
740 static void parse_eeprom(struct nic *nic)
759 if (nic->node_addr[0] == eeprom_fixups[i].addr0
760 && nic->node_addr[1] == eeprom_fixups[i].addr1
761 && nic->node_addr[2] == eeprom_fixups[i].addr2) {
762 if (nic->node_addr[2] == 0xE8 && ee_data[0x1a] == 0x55)
909 static void tulip_init_ring(struct nic *nic)
950 static void tulip_reset(struct nic *nic)
979 tulip_init_ring(nic);
982 u32 addr_high = (nic->node_addr[1]<<8) + (nic->node_addr[0]<<0);
984 outl((nic->node_addr[5]<<8) + nic->node_addr[4] +
985 (nic->node_addr[3]<<24) + (nic->node_addr[2]<<16),
992 u32 addr_low = cpu_to_le32(get_unaligned((u32 *)nic->node_addr));
993 u32 addr_high = cpu_to_le32(get_unaligned((u16 *)(nic->node_addr+4)));
1020 txb[0] = nic->node_addr[0];
1021 txb[1] = nic->node_addr[1];
1022 txb[4] = nic->node_addr[2];
1023 txb[5] = nic->node_addr[3];
1024 txb[8] = nic->node_addr[4];
1025 txb[9] = nic->node_addr[5];
1036 init_media(nic);
1058 tulip_check_duplex(nic);
1069 static void tulip_transmit(struct nic *nic, const char *d, unsigned int t,
1084 memcpy(txb + ETH_ALEN, nic->node_addr, ETH_ALEN);
1130 static int tulip_poll(struct nic *nic)
1137 /* no packet waiting. packet still owned by NIC */
1145 nic->packetlen = (rx_ring[tp->cur_rx].status & 0x3FFF0000) >> 16;
1156 memcpy(nic->packet, rxb + tp->cur_rx * BUFLEN, nic->packetlen);
1169 static void tulip_disable(struct nic *nic)
1190 struct nic *tulip_probe(struct nic *nic, unsigned short *io_addrs,
1301 nic->node_addr[i] = value;
1311 put_unaligned(le16_to_cpu(value), ((u16*)nic->node_addr) + i);
1316 put_unaligned(inl(ioaddr + 0xA4), (u32 *)nic->node_addr);
1317 put_unaligned(inl(ioaddr + 0xA8), (u16 *)(nic->node_addr + 4));
1319 sum += nic->node_addr[i];
1339 nic->node_addr[i] = ee_data[i + sa_offset];
1344 if ((nic->node_addr[0] == 0xA0 || nic->node_addr[0] == 0xC0)
1345 && nic->node_addr[1] == 0x00)
1347 char tmp = nic->node_addr[i];
1348 nic->node_addr[i] = nic->node_addr[i+1];
1349 nic->node_addr[i+1] = tmp;
1355 nic->node_addr[i] = last_phys_addr[i];
1356 nic->node_addr[i] = last_phys_addr[i] + 1;
1360 last_phys_addr[i] = nic->node_addr[i];
1362 printf("%s: %! at ioaddr %hX\n", tp->nic_name, nic->node_addr, ioaddr);
1385 parse_eeprom(nic);
1388 start_link(nic);
1391 tulip_reset(nic);
1393 nic->reset = tulip_reset;
1394 nic->poll = tulip_poll;
1395 nic->transmit = tulip_transmit;
1396 nic->disable = tulip_disable;
1401 return nic;
1404 static void start_link(struct nic *nic)
1421 select_media(nic, 2);
1430 int mii_status = mdio_read(nic, phy, 1);
1433 int mii_reg0 = mdio_read(nic, phy, 0);
1434 int mii_advert = mdio_read(nic, phy, 4);
1451 mdio_write(nic, phy, 4, to_advert);
1454 mdio_write(nic, phy, 0, mii_reg0 |
1495 nway_start(nic);
1523 static void nway_start(struct nic *nic)
1559 static void init_media(struct nic *nic)
1611 select_media(nic, 1);
1617 nway_start(nic);
1621 select_media(nic, 1);
1625 tp->nic_name, tp->phys[0], mdio_read(nic, tp->phys[0], 1));
1633 nway_start(nic);
1636 nway_start(nic);
1644 pnic_do_nway(nic);
1673 select_media(nic, 1);
1677 static void pnic_do_nway(struct nic *nic)
1714 static void select_media(struct nic *nic, int startup)
1843 mdio_write(nic, tp->phys[phy_num], 4, tp->mii_advertise);
1949 static int tulip_check_duplex(struct nic *nic)
1953 bmsr = mdio_read(nic, tp->phys[0], 1);
1954 lpa = mdio_read(nic, tp->phys[0], 5);
1965 int new_bmsr = mdio_read(nic, tp->phys[0], 1);