1N/A* 3c595.c -- 3COM 3C595 Fast Etherlink III PCI driver for etherboot 1N/A* Copyright (C) 2000 Shusuke Nisiyama <shu@athena.qe.eng.hokudai.ac.jp> 1N/A* All rights reserved. 1N/A* This software may be used, modified, copied, distributed, and sold, in 1N/A* both source and binary form provided that the above copyright and these 1N/A* terms are retained. Under no circumstances are the authors responsible for 1N/A* the proper functioning of this software, nor do the authors assume any 1N/A* responsibility for damages incurred with its use. 1N/A* This code is based on Martin Renters' etherboot-4.4.3 3c509.c and 1N/A* Herb Peyerl's FreeBSD 3.4-RELEASE if_vx.c driver. 1N/A* Copyright (C) 1993-1994, David Greenman, Martin Renters. 1N/A* Copyright (C) 1993-1995, Andres Vega Garcia. 1N/A* Copyright (C) 1995, Serge Babkin. 1N/A* Copyright (c) 1994 Herb Peyerl <hpeyerl@novatel.ca> 1N/A* timlegge 08-24-2003 Add Multicast Support 1N/A/************************************************************************** 1N/AETH_RESET - Reset adapter 1N/A***************************************************************************/ 1N/A /*********************************************************** 1N/A *************************************************************/ 1N/A /* Disable the card */ 1N/A/* outw(0, BASE + VX_W0_CONFIG_CTRL); */ 1N/A /* Configure IRQ to none */ 1N/A/* outw(SET_IRQ(0), BASE + VX_W0_RESOURCE_CFG); */ 1N/A /* Enable the card */ 1N/A/* outw(ENABLE_DRQ_IRQ, BASE + VX_W0_CONFIG_CTRL); */ 1N/A /* Reload the ether_addr. */ 1N/A /* Window 1 is operating window */ 1N/A for (i = 0; i <
31; i++)
1N/A * Attempt to get rid of any stray interrupts that occured during 1N/A * configuration. On the i386 this isn't possible because one may 1N/A * already be queued. However, a single stray interrupt is 1N/A j = inl(BASE + VX_W3_INTERNAL_CFG) & ~INTERNAL_CONNECTOR_MASK; 1N/A outl(BASE + VX_W3_INTERNAL_CFG, j | (i <<INTERNAL_CONNECTOR_BITS)); 1N/A outw(LINKBEAT_ENABLE, BASE + VX_W4_MEDIA_TYPE); 1N/A /* start tranciever and receiver */ 1N/A/************************************************************************** 1N/AETH_TRANSMIT - Transmit a frame 1N/A***************************************************************************/ 1N/Aconst char *d,
/* Destination */ 1N/Aunsigned int t,
/* Type */ 1N/Aunsigned int s,
/* size */ 1N/Aconst char *p)
/* Packet */ 1N/A /* swap bytes of type */ 1N/A * The 3c595 automatically pads short packets to minimum ethernet length, 1N/A * but we drop packets that are too large. Perhaps we should truncate 1N/A /* drop acknowledgements */ 1N/A /* no room in FIFO */ 1N/A /* wait for Tx complete */ 1N/A/************************************************************************** 1N/AETH_POLL - Wait for a frame 1N/A***************************************************************************/ 1N/A /* common variables */ 1N/A /* variables for 3C595 */ 1N/A /* acknowledge everything */ 1N/A /* acknowledge reception of packet */ 1N/A unsigned short type = 0;
/* used by EDEBUG */ 1N/A/************************************************************************* 1N/A 3Com 595 - specific routines 1N/A**************************************************************************/ 1N/A /* printf("3c595: eeprom failed to come ready.\n"); */ 1N/A printf(
"3c595: eeprom is busy.\n");
/* memory in EPROM is tight */ 1N/A * get_e: gets a 16 bits word from the EEPROM. we must have set the window 1N/A printf(
": disable 'auto select' with DOS util!");
1N/A /* Set the selected connector. */ 1N/A /* First, disable all. */ 1N/A /* Second, enable the selected one. */ 1N/A default:
/* AUI and MII fall here */ 1N/A/************************************************************************** 1N/AETH_PROBE - Look for an adapter 1N/A***************************************************************************/ 1N/A/* eth_nic_base = probeaddrs[0] & ~3; */ 1N/A printf("\nEEPROM:"); 1N/A for (i = 0; i < (EEPROMSIZE/2); i++) { 1N/A printf("%hX:", get_e(i)); 1N/A * Read the station address from the eeprom 1N/A for (i = 0; i <
3; i++) {
1N/APCI_ROM(
0x10b7,
0x5900,
"3c590",
"3Com590"),
/* Vortex 10Mbps */ 1N/APCI_ROM(
0x10b7,
0x5950,
"3c595",
"3Com595"),
/* Vortex 100baseTx */ 1N/APCI_ROM(
0x10b7,
0x5951,
"3c595-1",
"3Com595"),
/* Vortex 100baseT4 */ 1N/APCI_ROM(
0x10b7,
0x5952,
"3c595-2",
"3Com595"),
/* Vortex 100base-MII */ 1N/APCI_ROM(
0x10b7,
0x9000,
"3c900-tpo",
"3Com900-TPO"),
/* 10 Base TPO */ 1N/APCI_ROM(
0x10b7,
0x9001,
"3c900-t4",
"3Com900-Combo"),
/* 10/100 T4 */ 1N/APCI_ROM(
0x10b7,
0x9004,
"3c900b-tpo",
"3Com900B-TPO"),
/* 10 Base TPO */ 1N/APCI_ROM(
0x10b7,
0x9005,
"3c900b-combo",
"3Com900B-Combo"),
/* 10 Base Combo */ 1N/APCI_ROM(
0x10b7,
0x9006,
"3c900b-tpb2",
"3Com900B-2/T"),
/* 10 Base TP and Base2 */ 1N/APCI_ROM(
0x10b7,
0x900a,
"3c900b-fl",
"3Com900B-FL"),
/* 10 Base F */ 1N/APCI_ROM(
0x10b7,
0x9800,
"3c980-cyclone-1",
"3Com980-Cyclone"),
/* Cyclone */ 1N/APCI_ROM(
0x10b7,
0x9805,
"3c9805-1",
"3Com9805"),
/* Dual Port Server Cyclone */ 1N/APCI_ROM(
0x10b7,
0x7646,
"3csoho100-tx-1",
"3CSOHO100-TX"),
/* Hurricane */ 1N/APCI_ROM(
0x10b7,
0x4500,
"3c450-1",
"3Com450 HomePNA Tornado"),