119#define TX_TIME_OUT 2*TICKS_PER_SEC
123#define get_unaligned(ptr) (*(ptr))
124#define put_unaligned(val, ptr) ((void)( *(ptr) = (val) ))
125#define get_u16(ptr) (*(u16 *)(ptr))
126#define virt_to_le32desc(addr) virt_to_bus(addr)
128#define TULIP_IOTYPE PCI_USES_MASTER | PCI_USES_IO | PCI_ADDR0
129#define TULIP_SIZE 0x80
135#define FULL_DUPLEX_MAGIC 0x6969
137static const int csr0 = 0x01A00000 | 0x8000;
142 "10baseT",
"10base2",
"AUI",
"100baseTx",
143 "10baseT-FDX",
"100baseTx-FDX",
"100baseT4",
"100baseFx",
144 "100baseFx-FDX",
"MII 10baseT",
"MII 10baseT-FDX",
"MII",
145 "10baseT(forced)",
"MII 100baseTx",
"MII 100baseTx-FDX",
"MII 100baseT4",
146 "MII 100baseFx-HDX",
"MII 100baseFx-FDX",
"Home-PNA 1Mbps",
"Invalid-19",
177 {
"Digital DC21040 Tulip", { 0x00021011, 0xffffffff, 0, 0, 0, 0 },
179 {
"Digital DC21041 Tulip", { 0x00141011, 0xffffffff, 0, 0, 0, 0 },
181 {
"Digital DS21140A Tulip", { 0x00091011, 0xffffffff, 0,0, 0x20,0xf0 },
183 {
"Digital DS21140 Tulip", { 0x00091011, 0xffffffff, 0, 0, 0, 0 },
185 {
"Digital DS21143 Tulip", { 0x00191011, 0xffffffff, 0,0, 65,0xff },
187 {
"Digital DS21142 Tulip", { 0x00191011, 0xffffffff, 0, 0, 0, 0 },
189 {
"Kingston KNE110tx (PNIC)", { 0x000211AD, 0xffffffff, 0xf0022646, 0xffffffff, 0, 0 },
191 {
"Lite-On 82c168 PNIC", { 0x000211AD, 0xffffffff, 0, 0, 0, 0 },
193 {
"Macronix 98713 PMAC", { 0x051210d9, 0xffffffff, 0, 0, 0, 0 },
195 {
"Macronix 98715 PMAC", { 0x053110d9, 0xffffffff, 0, 0, 0, 0 },
197 {
"Macronix 98725 PMAC", { 0x053110d9, 0xffffffff, 0, 0, 0, 0 },
199 {
"ASIX AX88141", { 0x1400125B, 0xffffffff, 0,0, 0x10, 0xf0 },
201 {
"ASIX AX88140", { 0x1400125B, 0xffffffff, 0, 0, 0, 0 },
203 {
"Lite-On LC82C115 PNIC-II", { 0xc11511AD, 0xffffffff, 0, 0, 0, 0 },
205 {
"ADMtek AN981 Comet", { 0x09811317, 0xffffffff, 0, 0, 0, 0 },
207 {
"ADMTek AN983 Comet", { 0x12161113, 0xffffffff, 0, 0, 0, 0 },
209 {
"ADMTek Comet AN983b", { 0x95111317, 0xffffffff, 0, 0, 0, 0 },
211 {
"ADMtek Centaur-P", { 0x09851317, 0xffffffff, 0, 0, 0, 0 },
213 {
"ADMtek Centaur-C", { 0x19851317, 0xffffffff, 0, 0, 0, 0 },
215 {
"Compex RL100-TX", { 0x988111F6, 0xffffffff, 0, 0, 0, 0 },
217 {
"Intel 21145 Tulip", { 0x00398086, 0xffffffff, 0, 0, 0, 0 },
219 {
"Xircom Tulip clone", { 0x0003115d, 0xffffffff, 0, 0, 0, 0 },
221 {
"Davicom DM9102", { 0x91021282, 0xffffffff, 0, 0, 0, 0 },
223 {
"Davicom DM9100", { 0x91001282, 0xffffffff, 0, 0, 0, 0 },
225 {
"Macronix mxic-98715 (EN1217)", { 0x12171113, 0xffffffff, 0, 0, 0, 0 },
227 {
"3Com 3cSOHO100B-TX (ADMtek Centuar)", { 0x930010b7, 0xffffffff, 0, 0, 0, 0 },
229 {
"SG Thomson STE10/100A", { 0x2774104a, 0xffffffff, 0, 0, 0, 0 },
231 {
NULL, { 0, 0, 0, 0, 0, 0 }, 0, 0, 0 },
246 {
"Digital DC21040 Tulip", 0},
276{0,0,0,16, 3,19,16,24, 27,4,7,5, 0,20,23,20, 20,31,0,0, };
277static u8 t21040_csr13[] = {2,0x0C,8,4, 4,0,0,0, 0,0,0,0, 4,0,0,0};
342#define EEPROM_ADDRLEN 6
343#define EEPROM_SIZE 128
346#define EE_WRITE_CMD (5 << addr_len)
347#define EE_READ_CMD (6 << addr_len)
348#define EE_ERASE_CMD (7 << addr_len)
351#define EE_SHIFT_CLK 0x02
353#define EE_DATA_WRITE 0x04
354#define EE_WRITE_0 0x01
355#define EE_WRITE_1 0x05
356#define EE_DATA_READ 0x08
357#define EE_ENB (0x4800 | EE_CS)
362#define eeprom_delay() inl(ee_addr)
374#define DESC_RING_WRAP 0x02000000
427#define TX_RING_SIZE 2
428#define RX_RING_SIZE 4
436#define tulip_bss NIC_FAKE_BSS ( struct tulip_bss )
437#define tx_ring tulip_bss.tx_ring
438#define txb tulip_bss.txb
439#define rx_ring tulip_bss.rx_ring
440#define rxb tulip_bss.rxb
452 {
"Asante", 0, 0, 0x94, {0x1e00, 0x0000, 0x0800, 0x0100, 0x018c,
453 0x0000, 0x0000, 0xe078, 0x0001, 0x0050, 0x0018 }},
454 {
"SMC9332DST", 0, 0, 0xC0, { 0x1e00, 0x0000, 0x0800, 0x041f,
459 {
"Cogent EM100", 0, 0, 0x92, { 0x1e00, 0x0000, 0x0800, 0x063f,
466 {
"Maxtech NX-110", 0, 0, 0xE8, { 0x1e00, 0x0000, 0x0800, 0x0513,
472 {
"Accton EN1207", 0, 0, 0xE8, { 0x1e00, 0x0000, 0x0800, 0x051F,
481static const char *
block_name[] = {
"21140 non-MII",
"21140 MII PHY",
482 "21142 Serial PHY",
"21142 MII PHY",
"21143 SYM PHY",
"21143 reset method"};
496 unsigned int s,
const char *p);
539#define mdio_delay() inl(mdio_addr)
544#define MDIO_SHIFT_CLK 0x10000
545#define MDIO_DATA_WRITE0 0x00000
546#define MDIO_DATA_WRITE1 0x20000
547#define MDIO_ENB 0x00000
548#define MDIO_ENB_IN 0x40000
549#define MDIO_DATA_READ 0x80000
559 int read_cmd = (0xf6 << 10) | (phy_id << 5) | location;
567 outl(0x60020000 + (phy_id<<23) + (location<<18),
ioaddr + 0xA0);
579 return inl(
ioaddr + 0xB4 + (location<<2));
580 else if (location == 17)
582 else if (location >= 29 && location <= 31)
583 return inl(
ioaddr + 0xD4 + ((location-29)<<2));
589 for (i = 32; i >= 0; i--) {
596 for (i = 15; i >= 0; i--) {
605 for (i = 19; i > 0; i--) {
612 return (
retval>>1) & 0xffff;
618 int cmd = (0x5002 << 16) | (phy_id << 23) | (location<<18) |
value;
627 if ( ! (
inl(
ioaddr + 0xA0) & 0x80000000))
638 else if (location == 17)
640 else if (location >= 29 && location <= 31)
646 for (i = 32; i >= 0; i--) {
653 for (i = 31; i >= 0; i--) {
661 for (i = 2; i > 0; i--) {
680 unsigned short retval = 0;
690 for (i = 4 + addr_len; i >= 0; i--) {
699 for (i = 16; i > 0; i--) {
719 int new_advertise = 0;
727 for (i = 0; i < 8; i ++)
740 DBG(
"%s: Old format EEPROM on '%s' board.\n%s: Using substitute media control info.\n",
746 DBG(
"%s: Old style EEPROM with no media selection information.\n",
753 DBG(
"%s: Multiport cards (%d ports) may not work correctly.\n",
760 DBG2(
"%s: No Valid Media Table. ee_data[27] = %hhX\n",
767 DBG(
"%s: 21041 Media table, default media %hX (%s).\n",
770 for (i = 0; i <
count; i++) {
771 unsigned char media_block = *p++;
773 if (media_block & 0x40)
776 case 0: new_advertise |= 0x0020;
break;
777 case 4: new_advertise |= 0x0040;
break;
779 DBG(
"%s: 21041 media #%d, %s.\n",
783 unsigned char csr12dir = 0;
793 tp->mtable = mtable = (
struct mediatable *)&
tp->media_table_storage[0];
801 DBG(
"%s: EEPROM default media type %s.\n",
tp->nic_name,
804 for (i = 0; i <
count; i++) {
807 if ((p[0] & 0x80) == 0) {
809 leaf->
media = p[0] & 0x3f;
811 if ((p[2] & 0x61) == 0x01)
815 switch(leaf->
type = p[1]) {
818 leaf->
media = p[2] & 0x0f;
825 if ((p[2] & 0x3f) == 0) {
826 u32 base15 = (p[2] & 0x40) ?
get_u16(p + 7) : 0x0008;
827 u16 *p1 = (
u16 *)(p + (p[2] & 0x40 ? 9 : 3));
835 switch (leaf->
media) {
836 case 0: new_advertise |= 0x0020;
break;
837 case 4: new_advertise |= 0x0040;
break;
838 case 3: new_advertise |= 0x0080;
break;
839 case 5: new_advertise |= 0x0100;
break;
840 case 6: new_advertise |= 0x0200;
break;
847 p += (p[0] & 0x3f) + 1;
849 if (leaf->
media == 11) {
851 DBG2(
"%s: MII interface PHY %d, setup/reset sequences %d/%d long, capabilities %hhX %hhX.\n",
855 DBG(
"%s: Index #%d - Media %s (#%d) described "
856 "by a %s (%d) block.\n",
862 tp->sym_advertise = new_advertise;
891 tx_ring[0].status = 0x00000000;
897 tx_ring[1].status = 0x00000000;
935 if (
tp->mii_cnt || (
tp->mtable &&
tp->mtable->has_mii)) {
958 outl(addr_high + (addr_high<<16),
ioaddr + 0xB8);
976 }
else if (
tp->chip_id ==
COMET) {
985 u32 tx_flags = 0x08000000 | 192;
989 for (i=0; i<192; i++)
1024 DBG (
"%s: TX Setup Timeout.\n",
tp->nic_name);
1042 unsigned int s,
const char *p)
1066 DBG2(
"%s: sending %d bytes ethtype %hX\n",
tp->nic_name, s, t);
1086 DBG (
"TX Timeout!\n");
1102 if (
rx_ring[
tp->cur_rx].status & 0x80000000)
1105 if ( ! retrieve )
return 1;
1112 if (
rx_ring[
tp->cur_rx].status & 0x00008000) {
1114 rx_ring[
tp->cur_rx].status = 0x80000000;
1123 rx_ring[
tp->cur_rx].status = 0x80000000;
1181 static unsigned char last_phys_addr[
ETH_ALEN] = {0x00,
'L',
'i',
'n',
'u',
'x'};
1198 tp->default_port = 0;
1214 DBG2 (
"%s: Looking for Tulip Chip: Vendor=%hX Device=%hX\n",
tp->nic_name,
1215 tp->vendor_id,
tp->dev_id);
1222 if ( (((
u32)
tp->dev_id << 16) |
tp->vendor_id) ==
1231 DBG (
"%s: Unknown Tulip Chip: Vendor=%hX Device=%hX\n",
tp->nic_name,
1232 tp->vendor_id,
tp->dev_id);
1239 DBG2 (
"%s: tp->pci_id_idx == %d, name == %s\n",
tp->nic_name,
1241 DBG2 (
"%s: chip_idx == %d, name == %s\n",
tp->nic_name,
chip_idx,
1250 DBG(
"%s: The Tulip chip at %X is not functioning.\n",
1251 tp->nic_name, (
unsigned int)
ioaddr);
1257 DBG(
"%s: [chip: %s] rev %d at %hX\n",
tp->nic_name,
1259 DBG(
"%s: Vendor=%hX Device=%hX",
tp->nic_name,
tp->vendor_id,
tp->dev_id);
1262 DBG(
" 21040 compatible mode.");
1273 int value, boguscnt = 100000;
1278 sum +=
value & 0xff;
1281 for (i = 0; i < 3; i++) {
1282 int value, boguscnt = 100000;
1288 sum +=
value & 0xffff;
1301 for (i = 0; i <
sizeof(
ee_data)/2; i++)
1308 for (i = 0; i < 8; i ++)
1316 sum +=
ee_data[i + sa_offset];
1328 if (sum == 0 || sum ==
ETH_ALEN*0xff) {
1329 DBG(
"%s: EEPROM not present!\n",
tp->nic_name);
1342 tp->revision = chip_rev;
1348 tp->csr0 &= ~0x01000000;
1353 static const u16 media2advert[] = { 0x20, 0x40, 0x03e0, 0x60,
1354 0x80, 0x100, 0x200 };
1355 tp->mii_advertise = media2advert[
tp->default_port - 9];
1385 (
tp->mtable &&
tp->mtable->has_mii) ||
1387 unsigned int phy, phy_idx;
1388 if (
tp->mtable &&
tp->mtable->has_mii) {
1389 for (i = 0; i <
tp->mtable->leafcount; i++)
1390 if (
tp->mtable->mleaf[i].media == 11) {
1392 tp->saved_if_port =
tp->if_port;
1394 tp->if_port =
tp->saved_if_port;
1400 for (phy = 0, phy_idx = 0; phy < 32 && phy_idx <
sizeof(
tp->phys);
1403 if ((mii_status & 0x8301) == 0x8001 ||
1404 ((mii_status & 0x8000) == 0 && (mii_status & 0x7800) != 0)) {
1409 if (
tp->mii_advertise)
1410 to_advert =
tp->mii_advertise;
1411 else if (
tp->advertising[phy_idx])
1412 to_advert =
tp->advertising[phy_idx];
1414 tp->mii_advertise = to_advert = mii_advert;
1416 tp->phys[phy_idx++] = phy;
1417 DBG(
"%s: MII transceiver %d config %hX status %hX advertising %hX.\n",
1418 tp->nic_name, phy, mii_reg0, mii_status, mii_advert);
1420 if (mii_advert != to_advert) {
1421 DBG(
"%s: Advertising %hX on PHY %d previously advertising %hX.\n",
1422 tp->nic_name, to_advert, phy, mii_advert);
1427 (
tp->full_duplex ? 0x1100 : 0x1000) |
1431 tp->mii_cnt = phy_idx;
1432 if (
tp->mtable &&
tp->mtable->has_mii && phy_idx == 0) {
1433 DBG(
"%s: ***WARNING***: No MII transceiver found!\n",
1440 switch (
tp->chip_id) {
1447 if (
tp->sym_advertise == 0)
1448 tp->sym_advertise = 0x0061;
1470 if ( !
tp->mii_cnt) {
1497 int csr14 = ((
tp->sym_advertise & 0x0780) << 9) |
1498 ((
tp->sym_advertise&0x0020)<<1) | 0xffbf;
1503 tp->nway =
tp->mediasense = 1;
1504 tp->nwayset =
tp->lpar = 0;
1506 tp->csr6 = 0x01000000 | (
tp->sym_advertise & 0x0040 ? 0x0200 : 0);
1509 DBG2(
"%s: Restarting internal NWay autonegotiation, %X.\n",
1510 tp->nic_name, csr14);
1513 tp->csr6 = 0x82420000 | (
tp->sym_advertise & 0x0040 ? 0x0200 : 0);
1515 if (
tp->mtable &&
tp->mtable->csr15dir) {
1518 }
else if (
tp->chip_id !=
PNIC2)
1532 tp->saved_if_port =
tp->if_port;
1533 if (
tp->if_port == 0)
1534 tp->if_port =
tp->default_port;
1542 (
tp->if_port == 12 ? 0 :
tp->if_port);
1543 for (i = 0; i <
tp->mtable->leafcount; i++)
1544 if (
tp->mtable->mleaf[i].media == looking_for) {
1545 DBG(
"%s: Using user-specified media %s.\n",
1550 if ((
tp->mtable->defaultmedia & 0x0800) == 0) {
1551 int looking_for =
tp->mtable->defaultmedia & 15;
1552 for (i = 0; i <
tp->mtable->leafcount; i++)
1553 if (
tp->mtable->mleaf[i].media == looking_for) {
1554 DBG(
"%s: Using EEPROM-set media %s.\n",
1560 for (i =
tp->mtable->leafcount - 1;
1579 switch(
tp->chip_id) {
1587 DBG2(
"%s: Using MII transceiver %d, status %hX.\n",
1590 tp->csr6 = 0x820E0000;
1603 tp->csr6 = 0x814C0000 | (
tp->full_duplex ? 0x0200 : 0);
1610 tp->csr6 = 0x00420000;
1617 tp->csr6 = 0x01880000 | (
tp->full_duplex ? 0x0200 : 0);
1623 tp->csr6 = 0x01a80200;
1631 tp->csr6 = 0x00040000;
1634 tp->csr6 =
tp->mii_cnt ? 0x00040100 : 0x00000100;
1644 u32 new_csr6 =
tp->csr6 & ~0x40C40200;
1648 if (phy_reg & 0x78000000) {
1649 if (phy_reg & 0x20000000)
tp->if_port = 5;
1650 else if (phy_reg & 0x40000000)
tp->if_port = 3;
1651 else if (phy_reg & 0x10000000)
tp->if_port = 4;
1652 else if (phy_reg & 0x08000000)
tp->if_port = 0;
1654 new_csr6 = (
tp->if_port & 1) ? 0x01860000 : 0x00420000;
1656 if (
tp->if_port & 1)
1658 if (phy_reg & 0x30000000) {
1659 tp->full_duplex = 1;
1660 new_csr6 |= 0x00000200;
1662 DBG2(
"%s: PNIC autonegotiated status %X, %s.\n",
1664 if (
tp->csr6 != new_csr6) {
1665 tp->csr6 = new_csr6;
1683 unsigned char *p = mleaf->
leafdata;
1684 switch (mleaf->
type) {
1686 DBG2(
"%s: Using a 21140 non-MII transceiver"
1687 " with control setting %hhX.\n",
1688 tp->nic_name, p[1]);
1693 new_csr6 = 0x02000000 | ((p[2] & 0x71) << 18);
1697 u32 csr13val, csr14val, csr15dir, csr15val;
1698 for (i = 0; i < 5; i++)
1699 setup[i] =
get_u16(&p[i*2 + 1]);
1701 tp->if_port = p[0] & 15;
1703 tp->full_duplex = 1;
1707 unsigned char *rst = rleaf->
leafdata;
1708 DBG2(
"%s: Resetting the transceiver.\n",
1710 for (i = 0; i < rst[0]; i++)
1713 DBG2(
"%s: 21143 non-MII %s transceiver control %hX/%hX.\n",
1716 csr13val = setup[0];
1717 csr14val = setup[1];
1718 csr15dir = (setup[3]<<16) | setup[2];
1719 csr15val = (setup[4]<<16) | setup[2];
1727 csr14val = 0x0003FF7F;
1728 csr15dir = (setup[0]<<16) | 0x0008;
1729 csr15val = (setup[1]<<16) | 0x0008;
1730 if (
tp->if_port <= 4)
1740 DBG2(
"%s: Setting CSR15 to %X/%X.\n",
1741 tp->nic_name, csr15dir, csr15val);
1742 if (mleaf->
type == 4)
1743 new_csr6 = 0x82020000 | ((setup[2] & 0x71) << 18);
1745 new_csr6 = 0x82420000;
1750 int init_length = p[1];
1754 new_csr6 = 0x020E0000;
1755 if (mleaf->
type == 3) {
1756 u16 *init_sequence = (
u16*)(p+2);
1757 u16 *reset_sequence = &((
u16*)(p+3))[init_length];
1758 int reset_length = p[2 + init_length*2];
1759 misc_info = reset_sequence + reset_length;
1761 for (i = 0; i < reset_length; i++)
1763 for (i = 0; i < init_length; i++)
1766 u8 *init_sequence = p + 2;
1767 u8 *reset_sequence = p + 3 + init_length;
1768 int reset_length = p[2 + init_length];
1769 misc_info = (
u16*)(reset_sequence + reset_length);
1772 for (i = 0; i < reset_length; i++)
1775 for (i = 0; i < init_length; i++)
1778 tp->advertising[phy_num] =
get_u16(&misc_info[1]) | 1;
1780 if (
tp->mii_advertise == 0)
1781 tp->mii_advertise =
tp->advertising[phy_num];
1782 DBG2(
"%s: Advertising %hX on MII %d.\n",
1783 tp->nic_name,
tp->mii_advertise,
tp->phys[phy_num]);
1789 DBG(
"%s: Invalid media table selection %d.\n",
1790 tp->nic_name, mleaf->
type);
1791 new_csr6 = 0x020E0000;
1793 DBG2(
"%s: Using media type %s, CSR12 is %hhX.\n",
1797 int port =
tp->if_port <= 4 ?
tp->if_port : 0;
1798 DBG2(
"%s: 21041 using media %s, CSR12 is %hX.\n",
1805 new_csr6 = 0x80020000;
1808 tp->if_port =
tp->mii_cnt ? 11 : 0;
1809 DBG2(
"%s: PNIC PHY status is %hX, media %s.\n",
1812 new_csr6 = 0x810C0000;
1818 new_csr6 = 0x00420000;
1821 }
else if (
tp->if_port == 3 ||
tp->if_port == 5) {
1823 new_csr6 = 0x01860000;
1828 new_csr6 = 0x00420000;
1834 DBG2(
"%s: 21040 media type is %s, CSR12 is %hhX.\n",
1837 tp->full_duplex = 1;
1851 if (
tp->default_port == 0)
1852 tp->if_port =
tp->mii_cnt ? 11 : 3;
1854 new_csr6 = 0x020E0000;
1856 new_csr6 = 0x028600000;
1858 new_csr6 = 0x038600000;
1859 DBG2(
"%s: No media description table, assuming "
1860 "%s transceiver, CSR12 %hhX.\n",
1865 tp->csr6 = new_csr6 | (
tp->csr6 & 0xfdff) | (
tp->full_duplex ? 0x0200 : 0);
1877 unsigned int bmsr, lpa, negotiated, new_csr6;
1882 DBG2(
"%s: MII status %#x, Link partner report %#x.\n",
1883 tp->nic_name, bmsr, lpa);
1887 if ((bmsr & 4) == 0) {
1889 if ((new_bmsr & 4) == 0) {
1890 DBG2(
"%s: No link beat on the MII interface,"
1891 " status %#x.\n",
tp->nic_name,
1896 tp->full_duplex = lpa & 0x140;
1898 new_csr6 =
tp->csr6;
1899 negotiated = lpa &
tp->advertising[0];
1901 if(negotiated & 0x380) new_csr6 &= ~0x400000;
1902 else new_csr6 |= 0x400000;
1903 if (
tp->full_duplex) new_csr6 |= 0x200;
1904 else new_csr6 &= ~0x200;
1906 if (new_csr6 !=
tp->csr6) {
1907 tp->csr6 = new_csr6;
1909 DBG(
"%s: Setting %s-duplex based on MII"
1910 "#%d link partner capability of %#x.\n",
1912 tp->full_duplex ?
"full" :
"half",
1921PCI_ROM(0x1011, 0x0002,
"dc21040",
"Digital Tulip", 0),
1922PCI_ROM(0x1011, 0x0009,
"ds21140",
"Digital Tulip Fast", 0),
1923PCI_ROM(0x1011, 0x0014,
"dc21041",
"Digital Tulip+", 0),
1924PCI_ROM(0x1011, 0x0019,
"ds21142",
"Digital Tulip 21142", 0),
1925PCI_ROM(0x104a, 0x0981,
"tulip-0981",
"Tulip 0x104a 0x0981", 0),
1926PCI_ROM(0x104a, 0x2774,
"SGThomson-STE10100A",
"Tulip 0x104a 0x2774", 0),
1927PCI_ROM(0x10b7, 0x9300,
"3csoho100b-tx",
"3ComSOHO100B-TX", 0),
1928PCI_ROM(0x10b9, 0x5261,
"ali1563",
"ALi 1563 integrated ethernet", 0),
1929PCI_ROM(0x10d9, 0x0512,
"mx98713",
"Macronix MX987x3", 0),
1930PCI_ROM(0x10d9, 0x0531,
"mx98715",
"Macronix MX987x5", 0),
1931PCI_ROM(0x1113, 0x1216,
"an983",
"ADMTek AN983 Comet", 0),
1932PCI_ROM(0x1113, 0x1217,
"mxic-98715",
"Macronix MX987x5", 0),
1933PCI_ROM(0x1113, 0x9511,
"tulip-9511",
"Tulip 0x1113 0x9511", 0),
1934PCI_ROM(0x115d, 0x0003,
"xircomtulip",
"Xircom Tulip", 0),
1935PCI_ROM(0x1186, 0x1561,
"tulip-1561",
"Tulip 0x1186 0x1561", 0),
1936PCI_ROM(0x11ad, 0x0002,
"82c168",
"Netgear FA310TX", 0),
1937PCI_ROM(0x11ad, 0xc115,
"lc82c115",
"LinkSys LNE100TX", 0),
1938PCI_ROM(0x11f6, 0x9881,
"rl100tx",
"Compex RL100-TX", 0),
1939PCI_ROM(0x1259, 0xa120,
"tulip-a120",
"Tulip 0x1259 0xa120", 0),
1940PCI_ROM(0x125b, 0x1400,
"ax88140",
"ASIX AX88140", 0),
1941PCI_ROM(0x1282, 0x9009,
"dm9009",
"Davicom 9009", 0),
1942PCI_ROM(0x1282, 0x9100,
"dm9100",
"Davicom 9100", 0),
1943PCI_ROM(0x1282, 0x9102,
"dm9102",
"Davicom 9102", 0),
1944PCI_ROM(0x1282, 0x9132,
"dm9132",
"Davicom 9132", 0),
1945PCI_ROM(0x1317, 0x0981,
"an981",
"ADMtek AN981 Comet", 0),
1946PCI_ROM(0x1317, 0x0985,
"centaur-p",
"ADMtek Centaur-P", 0),
1947PCI_ROM(0x1317, 0x1985,
"centaur-c",
"ADMTek Centaur-C", 0),
1948PCI_ROM(0x1317, 0x9511,
"an983b",
"ADMTek Comet 983b", 0),
1949PCI_ROM(0x13d1, 0xab02,
"tulip-ab02",
"Tulip 0x13d1 0xab02", 0),
1950PCI_ROM(0x13d1, 0xab03,
"tulip-ab03",
"Tulip 0x13d1 0xab03", 0),
1951PCI_ROM(0x13d1, 0xab08,
"tulip-ab08",
"Tulip 0x13d1 0xab08", 0),
1952PCI_ROM(0x14f1, 0x1803,
"lanfinity",
"Conexant LANfinity", 0),
1953PCI_ROM(0x1626, 0x8410,
"tulip-8410",
"Tulip 0x1626 0x8410", 0),
1954PCI_ROM(0x1737, 0xab08,
"tulip-1737-ab08",
"Tulip 0x1737 0xab08", 0),
1955PCI_ROM(0x1737, 0xab09,
"tulip-ab09",
"Tulip 0x1737 0xab09", 0),
1956PCI_ROM(0x8086, 0x0039,
"intel21145",
"Intel Tulip", 0),
#define NULL
NULL pointer (VOID *)
pseudo_bit_t value[0x00020]
static unsigned long ioaddr
static unsigned char ee_data[EEPROM_SIZE]
uint8_t id
Request identifier.
static void set_rx_mode(void)
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
#define __unused
Declare a variable or data structure as unused.
#define DBG(...)
Print a debugging message.
static unsigned int count
Number of entries.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
uint32_t revision
Entry point revision.
#define le16_to_cpu(value)
#define cpu_to_le32(value)
#define outw(data, io_addr)
#define outl(data, io_addr)
int pci_read_config_byte(struct pci_device *pci, unsigned int where, uint8_t *value)
Read byte from PCI configuration space.
int pci_write_config_dword(struct pci_device *pci, unsigned int where, uint32_t value)
Write 32-bit dword to PCI configuration space.
#define TICKS_PER_SEC
Number of ticks per second.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
void startup(void)
Start up iPXE.
int dummy_connect(struct nic *nic __unused)
#define DRIVER(_name_text, _unused2, _unused3, _name, _probe, _disable, _fake_bss)
#define PCI_DRIVER(_name, _ids, _class)
static struct command_descriptor read_cmd
"read" command descriptor
void adjust_pci_device(struct pci_device *pci)
Enable PCI device.
#define PCI_ROM(_vendor, _device, _name, _description, _data)
#define PCI_REVISION
PCI revision.
static int mdio_read(void *ioaddr, int phy_id, int reg)
unsigned char * node_addr
struct nic_operations * nic_op
A PCI device ID list entry.
unsigned long ioaddr
I/O address.
struct pci_device_id * id
Driver device ID.
uint16_t vendor
Vendor ID.
uint16_t device
Device ID.
enum pci_id_flags_bits pci_flags
unsigned char rxb[RX_RING_SIZE *BUFLEN]
struct tulip_tx_desc tx_ring[TX_RING_SIZE]
unsigned char txb[BUFLEN]
struct tulip_rx_desc rx_ring[RX_RING_SIZE]
unsigned int full_duplex_lock
u8 media_table_storage[(sizeof(struct mediatable)+32 *sizeof(struct medialeaf))]
unsigned int default_port
unsigned char eeprom[EEPROM_SIZE]
struct mediatable * mtable
unsigned char ehdr[ETH_HLEN]
unsigned long currticks(void)
Get current system time in ticks.
static struct tulip_chip_table tulip_tbl[]
static const char * block_name[]
static int tulip_check_duplex(struct nic *nic)
static void whereami(const char *str)
static const char *const medianame[32]
static u16 t21041_csr13[]
static struct tulip_private * tp
#define put_unaligned(val, ptr)
static const struct pci_id_info pci_id_tbl[]
static u16 t21142_csr14[]
static void start_link(struct nic *nic)
static int mdio_read(struct nic *nic, int phy_id, int location)
static void tulip_transmit(struct nic *nic, const char *d, unsigned int t, unsigned int s, const char *p)
static void init_media(struct nic *nic)
#define FULL_DUPLEX_MAGIC
#define virt_to_le32desc(addr)
static void pnic_do_nway(struct nic *nic)
static const char media_cap[32]
static int tulip_probe(struct nic *nic, struct pci_device *pci)
static void tulip_disable(struct nic *nic, void *hwdev)
static void parse_eeprom(struct nic *nic)
static struct nic_operations tulip_operations
static void tulip_reset(struct nic *nic)
static void tulip_irq(struct nic *nic __unused, irq_action_t action __unused)
static void nway_start(struct nic *nic)
static void tulip_wait(unsigned int nticks)
static u16 t21041_csr15[]
static int tulip_poll(struct nic *nic, int retrieve)
static struct fixups eeprom_fixups[]
static void tulip_init_ring(struct nic *nic)
static u16 t21041_csr14[]
static struct pci_device_id tulip_nics[]
#define get_unaligned(ptr)
static void select_media(struct nic *nic, int startup)
static int read_eeprom(unsigned long ioaddr, int location, int addr_len)
static void mdio_write(struct nic *nic, int phy_id, int location, int value)