1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969 |
-
-
-
-
- FILE_LICENCE ( GPL_ANY );
-
-
-
-
-
-
-
-
-
-
-
-
- #include "etherboot.h"
- #include "nic.h"
-
- #include <ipxe/ethernet.h>
- #include <ipxe/pci.h>
-
-
-
- #define TX_TIME_OUT 2*TICKS_PER_SEC
-
-
- #define get_unaligned(ptr) (*(ptr))
- #define put_unaligned(val, ptr) ((void)( *(ptr) = (val) ))
- #define get_u16(ptr) (*(u16 *)(ptr))
- #define virt_to_le32desc(addr) virt_to_bus(addr)
-
- #define TULIP_IOTYPE PCI_USES_MASTER | PCI_USES_IO | PCI_ADDR0
- #define TULIP_SIZE 0x80
-
-
- #define FULL_DUPLEX_MAGIC 0x6969
-
- static const int csr0 = 0x01A00000 | 0x8000;
-
-
- #define MEDIA_MASK 31
- static const char * const medianame[32] = {
- "10baseT", "10base2", "AUI", "100baseTx",
- "10baseT-FDX", "100baseTx-FDX", "100baseT4", "100baseFx",
- "100baseFx-FDX", "MII 10baseT", "MII 10baseT-FDX", "MII",
- "10baseT(forced)", "MII 100baseTx", "MII 100baseTx-FDX", "MII 100baseT4",
- "MII 100baseFx-HDX", "MII 100baseFx-FDX", "Home-PNA 1Mbps", "Invalid-19",
- };
-
-
- enum tulip_chips {
- DC21040=0, DC21041=1, DC21140=2, DC21142=3, DC21143=3,
- LC82C168, MX98713, MX98715, MX98725, AX88141, AX88140, PNIC2, COMET,
- COMPEX9881, I21145, XIRCOM, SGThomson,
- };
-
- enum pci_id_flags_bits {
-
- PCI_USES_IO=1, PCI_USES_MEM=2, PCI_USES_MASTER=4,
-
- PCI_ADDR0=0<<4, PCI_ADDR1=1<<4, PCI_ADDR2=2<<4, PCI_ADDR3=3<<4,
- PCI_ADDR_64BITS=0x100, PCI_NO_ACPI_WAKE=0x200, PCI_NO_MIN_LATENCY=0x400,
- PCI_UNUSED_IRQ=0x800,
- };
-
- struct pci_id_info {
- char *name;
- struct match_info {
- u32 pci, pci_mask, subsystem, subsystem_mask;
- u32 revision, revision_mask;
- } id;
- enum pci_id_flags_bits pci_flags;
- int io_size;
- int drv_flags;
- };
-
- static const struct pci_id_info pci_id_tbl[] = {
- { "Digital DC21040 Tulip", { 0x00021011, 0xffffffff, 0, 0, 0, 0 },
- TULIP_IOTYPE, 0x80, DC21040 },
- { "Digital DC21041 Tulip", { 0x00141011, 0xffffffff, 0, 0, 0, 0 },
- TULIP_IOTYPE, 0x80, DC21041 },
- { "Digital DS21140A Tulip", { 0x00091011, 0xffffffff, 0,0, 0x20,0xf0 },
- TULIP_IOTYPE, 0x80, DC21140 },
- { "Digital DS21140 Tulip", { 0x00091011, 0xffffffff, 0, 0, 0, 0 },
- TULIP_IOTYPE, 0x80, DC21140 },
- { "Digital DS21143 Tulip", { 0x00191011, 0xffffffff, 0,0, 65,0xff },
- TULIP_IOTYPE, TULIP_SIZE, DC21142 },
- { "Digital DS21142 Tulip", { 0x00191011, 0xffffffff, 0, 0, 0, 0 },
- TULIP_IOTYPE, TULIP_SIZE, DC21142 },
- { "Kingston KNE110tx (PNIC)", { 0x000211AD, 0xffffffff, 0xf0022646, 0xffffffff, 0, 0 },
- TULIP_IOTYPE, 256, LC82C168 },
- { "Lite-On 82c168 PNIC", { 0x000211AD, 0xffffffff, 0, 0, 0, 0 },
- TULIP_IOTYPE, 256, LC82C168 },
- { "Macronix 98713 PMAC", { 0x051210d9, 0xffffffff, 0, 0, 0, 0 },
- TULIP_IOTYPE, 256, MX98713 },
- { "Macronix 98715 PMAC", { 0x053110d9, 0xffffffff, 0, 0, 0, 0 },
- TULIP_IOTYPE, 256, MX98715 },
- { "Macronix 98725 PMAC", { 0x053110d9, 0xffffffff, 0, 0, 0, 0 },
- TULIP_IOTYPE, 256, MX98725 },
- { "ASIX AX88141", { 0x1400125B, 0xffffffff, 0,0, 0x10, 0xf0 },
- TULIP_IOTYPE, 128, AX88141 },
- { "ASIX AX88140", { 0x1400125B, 0xffffffff, 0, 0, 0, 0 },
- TULIP_IOTYPE, 128, AX88140 },
- { "Lite-On LC82C115 PNIC-II", { 0xc11511AD, 0xffffffff, 0, 0, 0, 0 },
- TULIP_IOTYPE, 256, PNIC2 },
- { "ADMtek AN981 Comet", { 0x09811317, 0xffffffff, 0, 0, 0, 0 },
- TULIP_IOTYPE, 256, COMET },
- { "ADMTek AN983 Comet", { 0x12161113, 0xffffffff, 0, 0, 0, 0 },
- TULIP_IOTYPE, 256, COMET },
- { "ADMTek Comet AN983b", { 0x95111317, 0xffffffff, 0, 0, 0, 0 },
- TULIP_IOTYPE, 256, COMET },
- { "ADMtek Centaur-P", { 0x09851317, 0xffffffff, 0, 0, 0, 0 },
- TULIP_IOTYPE, 256, COMET },
- { "ADMtek Centaur-C", { 0x19851317, 0xffffffff, 0, 0, 0, 0 },
- TULIP_IOTYPE, 256, COMET },
- { "Compex RL100-TX", { 0x988111F6, 0xffffffff, 0, 0, 0, 0 },
- TULIP_IOTYPE, 128, COMPEX9881 },
- { "Intel 21145 Tulip", { 0x00398086, 0xffffffff, 0, 0, 0, 0 },
- TULIP_IOTYPE, 128, I21145 },
- { "Xircom Tulip clone", { 0x0003115d, 0xffffffff, 0, 0, 0, 0 },
- TULIP_IOTYPE, 128, XIRCOM },
- { "Davicom DM9102", { 0x91021282, 0xffffffff, 0, 0, 0, 0 },
- TULIP_IOTYPE, 0x80, DC21140 },
- { "Davicom DM9100", { 0x91001282, 0xffffffff, 0, 0, 0, 0 },
- TULIP_IOTYPE, 0x80, DC21140 },
- { "Macronix mxic-98715 (EN1217)", { 0x12171113, 0xffffffff, 0, 0, 0, 0 },
- TULIP_IOTYPE, 256, MX98715 },
- { "3Com 3cSOHO100B-TX (ADMtek Centuar)", { 0x930010b7, 0xffffffff, 0, 0, 0, 0 },
- TULIP_IOTYPE, TULIP_SIZE, COMET },
- { "SG Thomson STE10/100A", { 0x2774104a, 0xffffffff, 0, 0, 0, 0 },
- TULIP_IOTYPE, 256, COMET },
- { NULL, { 0, 0, 0, 0, 0, 0 }, 0, 0, 0 },
- };
-
- enum tbl_flag {
- HAS_MII=1, HAS_MEDIA_TABLE=2, CSR12_IN_SROM=4, ALWAYS_CHECK_MII=8,
- HAS_PWRDWN=0x10, MC_HASH_ONLY=0x20,
- HAS_PNICNWAY=0x80, HAS_NWAY=0x40,
- HAS_INTR_MITIGATION=0x100, IS_ASIX=0x200, HAS_8023X=0x400,
- };
-
-
- static struct tulip_chip_table {
- char *chip_name;
- int flags;
- } tulip_tbl[] = {
- { "Digital DC21040 Tulip", 0},
- { "Digital DC21041 Tulip", HAS_MEDIA_TABLE | HAS_NWAY },
- { "Digital DS21140 Tulip", HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM },
- { "Digital DS21143 Tulip", HAS_MII | HAS_MEDIA_TABLE | ALWAYS_CHECK_MII
- | HAS_PWRDWN | HAS_NWAY | HAS_INTR_MITIGATION },
- { "Lite-On 82c168 PNIC", HAS_MII | HAS_PNICNWAY },
- { "Macronix 98713 PMAC", HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM },
- { "Macronix 98715 PMAC", HAS_MEDIA_TABLE },
- { "Macronix 98725 PMAC", HAS_MEDIA_TABLE },
- { "ASIX AX88140", HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM
- | MC_HASH_ONLY | IS_ASIX },
- { "ASIX AX88141", HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM | MC_HASH_ONLY
- | IS_ASIX },
- { "Lite-On PNIC-II", HAS_MII | HAS_NWAY | HAS_8023X },
- { "ADMtek Comet", HAS_MII | MC_HASH_ONLY },
- { "Compex 9881 PMAC", HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM },
- { "Intel DS21145 Tulip", HAS_MII | HAS_MEDIA_TABLE | ALWAYS_CHECK_MII
- | HAS_PWRDWN | HAS_NWAY },
- { "Xircom tulip work-alike", HAS_MII | HAS_MEDIA_TABLE | ALWAYS_CHECK_MII
- | HAS_PWRDWN | HAS_NWAY },
- { "SGThomson STE10/100A", HAS_MII | MC_HASH_ONLY },
- { NULL, 0 },
- };
-
-
- enum MediaIs {
- MediaIsFD = 1, MediaAlwaysFD=2, MediaIsMII=4, MediaIsFx=8,
- MediaIs100=16};
-
- static const char media_cap[32] =
- {0,0,0,16, 3,19,16,24, 27,4,7,5, 0,20,23,20, 20,31,0,0, };
- static u8 t21040_csr13[] = {2,0x0C,8,4, 4,0,0,0, 0,0,0,0, 4,0,0,0};
-
-
- static u16 t21041_csr13[] = { 0xEF01, 0xEF09, 0xEF09, 0xEF01, 0xEF09, };
- static u16 t21041_csr14[] = { 0xFFFF, 0xF7FD, 0xF7FD, 0x7F3F, 0x7F3D, };
- static u16 t21041_csr15[] = { 0x0008, 0x0006, 0x000E, 0x0008, 0x0008, };
-
-
- static u16 t21142_csr14[] = { 0xFFFF, 0x0705, 0x0705, 0x0000, 0x7F3D, };
-
-
-
- enum tulip_offsets {
- CSR0=0, CSR1=0x08, CSR2=0x10, CSR3=0x18, CSR4=0x20, CSR5=0x28,
- CSR6=0x30, CSR7=0x38, CSR8=0x40, CSR9=0x48, CSR10=0x50, CSR11=0x58,
- CSR12=0x60, CSR13=0x68, CSR14=0x70, CSR15=0x78, CSR16=0x80, CSR20=0xA0
- };
-
-
- enum status_bits {
- TimerInt=0x800, TPLnkFail=0x1000, TPLnkPass=0x10,
- NormalIntr=0x10000, AbnormalIntr=0x8000,
- RxJabber=0x200, RxDied=0x100, RxNoBuf=0x80, RxIntr=0x40,
- TxFIFOUnderflow=0x20, TxJabber=0x08, TxNoBuf=0x04, TxDied=0x02, TxIntr=0x01,
- };
-
-
- enum csr6_mode_bits {
- TxOn=0x2000, RxOn=0x0002, FullDuplex=0x0200,
- AcceptBroadcast=0x0100, AcceptAllMulticast=0x0080,
- AcceptAllPhys=0x0040, AcceptRunt=0x0008,
- };
-
-
- enum desc_status_bits {
- DescOwnded=0x80000000, RxDescFatalErr=0x8000, RxWholePkt=0x0300,
- };
-
- struct medialeaf {
- u8 type;
- u8 media;
- unsigned char *leafdata;
- };
-
- struct mediatable {
- u16 defaultmedia;
- u8 leafcount, csr12dir;
- unsigned has_mii:1, has_nonmii:1, has_reset:6;
- u32 csr15dir, csr15val;
- struct medialeaf mleaf[0];
- };
-
- struct mediainfo {
- struct mediainfo *next;
- int info_type;
- int index;
- unsigned char *info;
- };
-
-
- #define EEPROM_ADDRLEN 6
- #define EEPROM_SIZE 128
-
-
- #define EE_WRITE_CMD (5 << addr_len)
- #define EE_READ_CMD (6 << addr_len)
- #define EE_ERASE_CMD (7 << addr_len)
-
-
- #define EE_SHIFT_CLK 0x02
- #define EE_CS 0x01
- #define EE_DATA_WRITE 0x04
- #define EE_WRITE_0 0x01
- #define EE_WRITE_1 0x05
- #define EE_DATA_READ 0x08
- #define EE_ENB (0x4800 | EE_CS)
-
-
- #define eeprom_delay() inl(ee_addr)
-
-
- #define BUFLEN 1536
-
-
- #define DESC_RING_WRAP 0x02000000
-
-
- struct tulip_rx_desc {
- volatile u32 status;
- u32 length;
- u32 buffer1, buffer2;
- };
-
- struct tulip_tx_desc {
- volatile u32 status;
- u32 length;
- u32 buffer1, buffer2;
- };
-
-
-
-
-
- static u32 ioaddr;
-
- struct tulip_private {
- int cur_rx;
- int chip_id;
- int pci_id_idx;
- int revision;
- int flags;
- unsigned short vendor_id;
- unsigned short dev_id;
- unsigned char ehdr[ETH_HLEN];
- const char *nic_name;
- unsigned int csr0, csr6;
- unsigned int if_port;
- unsigned int full_duplex;
- unsigned int full_duplex_lock;
- unsigned int medialock;
- unsigned int mediasense;
- unsigned int nway, nwayset;
- unsigned int default_port;
- unsigned char eeprom[EEPROM_SIZE];
- u8 media_table_storage[(sizeof(struct mediatable) + 32*sizeof(struct medialeaf))];
- u16 sym_advertise, mii_advertise;
- struct mediatable *mtable;
- u16 lpar;
- u16 advertising[4];
- signed char phys[4], mii_cnt;
- int cur_index;
- int saved_if_port;
- };
-
-
-
- #define TX_RING_SIZE 2
- #define RX_RING_SIZE 4
- struct {
- struct tulip_tx_desc tx_ring[TX_RING_SIZE];
- unsigned char txb[BUFLEN];
- struct tulip_rx_desc rx_ring[RX_RING_SIZE];
- unsigned char rxb[RX_RING_SIZE * BUFLEN];
- struct tulip_private tpx;
- } tulip_bss __shared __attribute__ ((aligned(4)));
- #define tx_ring tulip_bss.tx_ring
- #define txb tulip_bss.txb
- #define rx_ring tulip_bss.rx_ring
- #define rxb tulip_bss.rxb
-
- static struct tulip_private *tp;
-
-
- static struct fixups {
- char *name;
- unsigned char addr0, addr1, addr2;
- u16 newtable[32];
- } eeprom_fixups[] = {
- {"Asante", 0, 0, 0x94, {0x1e00, 0x0000, 0x0800, 0x0100, 0x018c,
- 0x0000, 0x0000, 0xe078, 0x0001, 0x0050, 0x0018 }},
- {"SMC9332DST", 0, 0, 0xC0, { 0x1e00, 0x0000, 0x0800, 0x041f,
- 0x0000, 0x009E,
- 0x0004, 0x009E,
- 0x0903, 0x006D,
- 0x0905, 0x006D, }},
- {"Cogent EM100", 0, 0, 0x92, { 0x1e00, 0x0000, 0x0800, 0x063f,
- 0x0107, 0x8021,
- 0x0108, 0x8021,
- 0x0100, 0x009E,
- 0x0104, 0x009E,
- 0x0103, 0x006D,
- 0x0105, 0x006D, }},
- {"Maxtech NX-110", 0, 0, 0xE8, { 0x1e00, 0x0000, 0x0800, 0x0513,
- 0x1001, 0x009E,
- 0x0000, 0x009E,
- 0x0004, 0x009E,
- 0x0303, 0x006D,
- 0x0305, 0x006D, }},
- {"Accton EN1207", 0, 0, 0xE8, { 0x1e00, 0x0000, 0x0800, 0x051F,
- 0x1B01, 0x0000,
- 0x0B00, 0x009E,
- 0x0B04, 0x009E,
- 0x1B03, 0x006D,
- 0x1B05, 0x006D,
- }},
- {NULL, 0, 0, 0, {}}};
-
- static const char * block_name[] = {"21140 non-MII", "21140 MII PHY",
- "21142 Serial PHY", "21142 MII PHY", "21143 SYM PHY", "21143 reset method"};
-
-
-
-
-
- static int mdio_read(struct nic *nic, int phy_id, int location);
- static void mdio_write(struct nic *nic, int phy_id, int location, int value);
- static int read_eeprom(unsigned long ioaddr, int location, int addr_len);
- static void parse_eeprom(struct nic *nic);
- static int tulip_probe(struct nic *nic,struct pci_device *pci);
- static void tulip_init_ring(struct nic *nic);
- static void tulip_reset(struct nic *nic);
- static void tulip_transmit(struct nic *nic, const char *d, unsigned int t,
- unsigned int s, const char *p);
- static int tulip_poll(struct nic *nic, int retrieve);
- static void tulip_disable(struct nic *nic);
- static void nway_start(struct nic *nic);
- static void pnic_do_nway(struct nic *nic);
- static void select_media(struct nic *nic, int startup);
- static void init_media(struct nic *nic);
- static void start_link(struct nic *nic);
- static int tulip_check_duplex(struct nic *nic);
-
- static void tulip_wait(unsigned int nticks);
-
-
-
-
-
-
- static void whereami (const char *str)
- {
- DBGP("%s\n", str);
-
- }
-
- static void tulip_wait(unsigned int nticks)
- {
- unsigned int to = currticks() + nticks;
- while (currticks() < to)
- ;
- }
-
-
-
-
-
-
-
-
-
- #define mdio_delay() inl(mdio_addr)
-
-
- #define MDIO_SHIFT_CLK 0x10000
- #define MDIO_DATA_WRITE0 0x00000
- #define MDIO_DATA_WRITE1 0x20000
- #define MDIO_ENB 0x00000
- #define MDIO_ENB_IN 0x40000
- #define MDIO_DATA_READ 0x80000
-
-
-
- int mdio_read(struct nic *nic __unused, int phy_id, int location)
- {
- int i;
- int read_cmd = (0xf6 << 10) | (phy_id << 5) | location;
- int retval = 0;
- long mdio_addr = ioaddr + CSR9;
-
- whereami("mdio_read\n");
-
- if (tp->chip_id == LC82C168) {
- int i = 1000;
- outl(0x60020000 + (phy_id<<23) + (location<<18), ioaddr + 0xA0);
- inl(ioaddr + 0xA0);
- inl(ioaddr + 0xA0);
- while (--i > 0)
- if ( ! ((retval = inl(ioaddr + 0xA0)) & 0x80000000))
- return retval & 0xffff;
- return 0xffff;
- }
-
- if (tp->chip_id == COMET) {
- if (phy_id == 1) {
- if (location < 7)
- return inl(ioaddr + 0xB4 + (location<<2));
- else if (location == 17)
- return inl(ioaddr + 0xD0);
- else if (location >= 29 && location <= 31)
- return inl(ioaddr + 0xD4 + ((location-29)<<2));
- }
- return 0xffff;
- }
-
-
- for (i = 32; i >= 0; i--) {
- outl(MDIO_ENB | MDIO_DATA_WRITE1, mdio_addr);
- mdio_delay();
- outl(MDIO_ENB | MDIO_DATA_WRITE1 | MDIO_SHIFT_CLK, mdio_addr);
- mdio_delay();
- }
-
- for (i = 15; i >= 0; i--) {
- int dataval = (read_cmd & (1 << i)) ? MDIO_DATA_WRITE1 : 0;
-
- outl(MDIO_ENB | dataval, mdio_addr);
- mdio_delay();
- outl(MDIO_ENB | dataval | MDIO_SHIFT_CLK, mdio_addr);
- mdio_delay();
- }
-
- for (i = 19; i > 0; i--) {
- outl(MDIO_ENB_IN, mdio_addr);
- mdio_delay();
- retval = (retval << 1) | ((inl(mdio_addr) & MDIO_DATA_READ) ? 1 : 0);
- outl(MDIO_ENB_IN | MDIO_SHIFT_CLK, mdio_addr);
- mdio_delay();
- }
- return (retval>>1) & 0xffff;
- }
-
- void mdio_write(struct nic *nic __unused, int phy_id, int location, int value)
- {
- int i;
- int cmd = (0x5002 << 16) | (phy_id << 23) | (location<<18) | value;
- long mdio_addr = ioaddr + CSR9;
-
- whereami("mdio_write\n");
-
- if (tp->chip_id == LC82C168) {
- int i = 1000;
- outl(cmd, ioaddr + 0xA0);
- do
- if ( ! (inl(ioaddr + 0xA0) & 0x80000000))
- break;
- while (--i > 0);
- return;
- }
-
- if (tp->chip_id == COMET) {
- if (phy_id != 1)
- return;
- if (location < 7)
- outl(value, ioaddr + 0xB4 + (location<<2));
- else if (location == 17)
- outl(value, ioaddr + 0xD0);
- else if (location >= 29 && location <= 31)
- outl(value, ioaddr + 0xD4 + ((location-29)<<2));
- return;
- }
-
-
- for (i = 32; i >= 0; i--) {
- outl(MDIO_ENB | MDIO_DATA_WRITE1, mdio_addr);
- mdio_delay();
- outl(MDIO_ENB | MDIO_DATA_WRITE1 | MDIO_SHIFT_CLK, mdio_addr);
- mdio_delay();
- }
-
- for (i = 31; i >= 0; i--) {
- int dataval = (cmd & (1 << i)) ? MDIO_DATA_WRITE1 : 0;
- outl(MDIO_ENB | dataval, mdio_addr);
- mdio_delay();
- outl(MDIO_ENB | dataval | MDIO_SHIFT_CLK, mdio_addr);
- mdio_delay();
- }
-
- for (i = 2; i > 0; i--) {
- outl(MDIO_ENB_IN, mdio_addr);
- mdio_delay();
- outl(MDIO_ENB_IN | MDIO_SHIFT_CLK, mdio_addr);
- mdio_delay();
- }
- }
-
-
-
-
-
-
-
- static int read_eeprom(unsigned long ioaddr, int location, int addr_len)
- {
- int i;
- unsigned short retval = 0;
- long ee_addr = ioaddr + CSR9;
- int read_cmd = location | EE_READ_CMD;
-
- whereami("read_eeprom\n");
-
- outl(EE_ENB & ~EE_CS, ee_addr);
- outl(EE_ENB, ee_addr);
-
-
- for (i = 4 + addr_len; i >= 0; i--) {
- short dataval = (read_cmd & (1 << i)) ? EE_DATA_WRITE : 0;
- outl(EE_ENB | dataval, ee_addr);
- eeprom_delay();
- outl(EE_ENB | dataval | EE_SHIFT_CLK, ee_addr);
- eeprom_delay();
- }
- outl(EE_ENB, ee_addr);
-
- for (i = 16; i > 0; i--) {
- outl(EE_ENB | EE_SHIFT_CLK, ee_addr);
- eeprom_delay();
- retval = (retval << 1) | ((inl(ee_addr) & EE_DATA_READ) ? 1 : 0);
- outl(EE_ENB, ee_addr);
- eeprom_delay();
- }
-
-
- outl(EE_ENB & ~EE_CS, ee_addr);
- return retval;
- }
-
-
-
-
-
- static void parse_eeprom(struct nic *nic)
- {
- unsigned char *p, *ee_data = tp->eeprom;
- int new_advertise = 0;
- int i;
-
- whereami("parse_eeprom\n");
-
- tp->mtable = NULL;
-
-
- for (i = 0; i < 8; i ++)
- if (ee_data[i] != ee_data[16+i])
- break;
- if (i >= 8) {
-
- for (i = 0; eeprom_fixups[i].name; i++) {
- if (nic->node_addr[0] == eeprom_fixups[i].addr0
- && nic->node_addr[1] == eeprom_fixups[i].addr1
- && nic->node_addr[2] == eeprom_fixups[i].addr2) {
- if (nic->node_addr[2] == 0xE8 && ee_data[0x1a] == 0x55)
- i++;
- memcpy(ee_data + 26, eeprom_fixups[i].newtable,
- sizeof(eeprom_fixups[i].newtable));
- DBG("%s: Old format EEPROM on '%s' board.\n%s: Using substitute media control info.\n",
- tp->nic_name, eeprom_fixups[i].name, tp->nic_name);
- break;
- }
- }
- if (eeprom_fixups[i].name == NULL) {
- DBG("%s: Old style EEPROM with no media selection information.\n",
- tp->nic_name);
- return;
- }
- }
-
- if (ee_data[19] > 1) {
- DBG("%s: Multiport cards (%d ports) may not work correctly.\n",
- tp->nic_name, ee_data[19]);
- }
-
- p = (void *)ee_data + ee_data[27];
-
- if (ee_data[27] == 0) {
- DBG2("%s: No Valid Media Table. ee_data[27] = %hhX\n",
- tp->nic_name, ee_data[27]);
- } else if (tp->chip_id == DC21041) {
- int media = get_u16(p);
- int count = p[2];
- p += 3;
-
- DBG("%s: 21041 Media table, default media %hX (%s).\n",
- tp->nic_name, media,
- media & 0x0800 ? "Autosense" : medianame[media & 15]);
- for (i = 0; i < count; i++) {
- unsigned char media_block = *p++;
- int media_code = media_block & MEDIA_MASK;
- if (media_block & 0x40)
- p += 6;
- switch(media_code) {
- case 0: new_advertise |= 0x0020; break;
- case 4: new_advertise |= 0x0040; break;
- }
- DBG("%s: 21041 media #%d, %s.\n",
- tp->nic_name, media_code, medianame[media_code]);
- }
- } else {
- unsigned char csr12dir = 0;
- int count;
- struct mediatable *mtable;
- u16 media = get_u16(p);
-
- p += 2;
- if (tp->flags & CSR12_IN_SROM)
- csr12dir = *p++;
- count = *p++;
-
- tp->mtable = mtable = (struct mediatable *)&tp->media_table_storage[0];
-
- mtable->defaultmedia = media;
- mtable->leafcount = count;
- mtable->csr12dir = csr12dir;
- mtable->has_nonmii = mtable->has_mii = mtable->has_reset = 0;
- mtable->csr15dir = mtable->csr15val = 0;
-
- DBG("%s: EEPROM default media type %s.\n", tp->nic_name,
- media & 0x0800 ? "Autosense" : medianame[media & MEDIA_MASK]);
-
- for (i = 0; i < count; i++) {
- struct medialeaf *leaf = &mtable->mleaf[i];
-
- if ((p[0] & 0x80) == 0) {
- leaf->type = 0;
- leaf->media = p[0] & 0x3f;
- leaf->leafdata = p;
- if ((p[2] & 0x61) == 0x01)
- mtable->has_mii = 1;
- p += 4;
- } else {
- switch(leaf->type = p[1]) {
- case 5:
- mtable->has_reset = i;
- leaf->media = p[2] & 0x0f;
- break;
- case 1: case 3:
- mtable->has_mii = 1;
- leaf->media = 11;
- break;
- case 2:
- if ((p[2] & 0x3f) == 0) {
- u32 base15 = (p[2] & 0x40) ? get_u16(p + 7) : 0x0008;
- u16 *p1 = (u16 *)(p + (p[2] & 0x40 ? 9 : 3));
- mtable->csr15dir = (get_unaligned(p1 + 0)<<16) + base15;
- mtable->csr15val = (get_unaligned(p1 + 1)<<16) + base15;
- }
-
- case 0: case 4:
- mtable->has_nonmii = 1;
- leaf->media = p[2] & MEDIA_MASK;
- switch (leaf->media) {
- case 0: new_advertise |= 0x0020; break;
- case 4: new_advertise |= 0x0040; break;
- case 3: new_advertise |= 0x0080; break;
- case 5: new_advertise |= 0x0100; break;
- case 6: new_advertise |= 0x0200; break;
- }
- break;
- default:
- leaf->media = 19;
- }
- leaf->leafdata = p + 2;
- p += (p[0] & 0x3f) + 1;
- }
- if (leaf->media == 11) {
- unsigned char *bp = leaf->leafdata;
- DBG2("%s: MII interface PHY %d, setup/reset sequences %d/%d long, capabilities %hhX %hhX.\n",
- tp->nic_name, bp[0], bp[1], bp[2 + bp[1]*2],
- bp[5 + bp[2 + bp[1]*2]*2], bp[4 + bp[2 + bp[1]*2]*2]);
- }
- DBG("%s: Index #%d - Media %s (#%d) described "
- "by a %s (%d) block.\n",
- tp->nic_name, i, medianame[leaf->media], leaf->media,
- leaf->type < 6 ? block_name[leaf->type] : "UNKNOWN",
- leaf->type);
- }
- if (new_advertise)
- tp->sym_advertise = new_advertise;
- }
- }
-
-
-
-
-
- static void tulip_init_ring(struct nic *nic __unused)
- {
- int i;
-
- whereami("tulip_init_ring\n");
-
- tp->cur_rx = 0;
-
- for (i = 0; i < RX_RING_SIZE; i++) {
- rx_ring[i].status = cpu_to_le32(0x80000000);
- rx_ring[i].length = cpu_to_le32(BUFLEN);
- rx_ring[i].buffer1 = virt_to_le32desc(&rxb[i * BUFLEN]);
- rx_ring[i].buffer2 = virt_to_le32desc(&rx_ring[i+1]);
- }
-
- rx_ring[i-1].length = cpu_to_le32(DESC_RING_WRAP | BUFLEN);
- rx_ring[i-1].buffer2 = virt_to_le32desc(&rx_ring[0]);
-
-
-
-
- tx_ring[0].status = 0x00000000;
- tx_ring[0].buffer1 = virt_to_le32desc(&txb[0]);
- tx_ring[0].buffer2 = virt_to_le32desc(&tx_ring[1]);
-
-
-
- tx_ring[1].status = 0x00000000;
- tx_ring[1].buffer1 = virt_to_le32desc(&txb[0]);
- tx_ring[1].buffer2 = virt_to_le32desc(&tx_ring[0]);
-
-
- tx_ring[1].length = cpu_to_le32(DESC_RING_WRAP | BUFLEN);
- }
-
-
- static void set_rx_mode(struct nic *nic __unused) {
- int csr6 = inl(ioaddr + CSR6) & ~0x00D5;
-
- tp->csr6 &= ~0x00D5;
-
-
- tp->csr6 |= AcceptAllMulticast;
- csr6 |= AcceptAllMulticast;
-
- outl(csr6, ioaddr + CSR6);
-
-
-
- }
-
-
-
-
- static void tulip_reset(struct nic *nic)
- {
- int i;
- unsigned long to;
-
- whereami("tulip_reset\n");
-
-
- outl(inl(ioaddr + CSR6) & ~0x00002002, ioaddr + CSR6);
-
-
- if (tp->mii_cnt || (tp->mtable && tp->mtable->has_mii)) {
- outl(0x814C0000, ioaddr + CSR6);
- }
-
-
- outl(0x00000001, ioaddr + CSR0);
- tulip_wait(1);
-
-
- outl(tp->csr0, ioaddr + CSR0);
-
-
- tulip_wait(1);
-
-
- tulip_init_ring(nic);
-
- if (tp->chip_id == PNIC2) {
- u32 addr_high = (nic->node_addr[1]<<8) + (nic->node_addr[0]<<0);
-
- outl((nic->node_addr[5]<<8) + nic->node_addr[4] +
- (nic->node_addr[3]<<24) + (nic->node_addr[2]<<16),
- ioaddr + 0xB0);
- outl(addr_high + (addr_high<<16), ioaddr + 0xB8);
- }
-
-
- if (tp->flags & MC_HASH_ONLY) {
- u32 addr_low = cpu_to_le32(get_unaligned((u32 *)nic->node_addr));
- u32 addr_high = cpu_to_le32(get_unaligned((u16 *)(nic->node_addr+4)));
-
-
- if (tp->flags & IS_ASIX) {
- outl(0, ioaddr + CSR13);
- outl(addr_low, ioaddr + CSR14);
- outl(1, ioaddr + CSR13);
- outl(addr_high, ioaddr + CSR14);
- outl(2, ioaddr + CSR13);
- outl(0, ioaddr + CSR14);
- outl(3, ioaddr + CSR13);
- outl(0, ioaddr + CSR14);
- } else if (tp->chip_id == COMET) {
- outl(addr_low, ioaddr + 0xA4);
- outl(addr_high, ioaddr + 0xA8);
- outl(0, ioaddr + 0xAC);
- outl(0, ioaddr + 0xB0);
- }
- } else {
-
-
- u32 tx_flags = 0x08000000 | 192;
-
-
-
- for (i=0; i<192; i++)
- txb[i] = 0xFF;
- txb[0] = nic->node_addr[0];
- txb[1] = nic->node_addr[1];
- txb[4] = nic->node_addr[2];
- txb[5] = nic->node_addr[3];
- txb[8] = nic->node_addr[4];
- txb[9] = nic->node_addr[5];
-
- tx_ring[0].length = cpu_to_le32(tx_flags);
- tx_ring[0].buffer1 = virt_to_le32desc(&txb[0]);
- tx_ring[0].status = cpu_to_le32(0x80000000);
- }
-
-
- outl(virt_to_le32desc(&rx_ring[0]), ioaddr + CSR3);
- outl(virt_to_le32desc(&tx_ring[0]), ioaddr + CSR4);
-
- init_media(nic);
-
-
- outl((tp->csr6 & ~0x00002002), ioaddr + CSR6);
-
-
- if (!(tp->flags & MC_HASH_ONLY)) {
-
- outl(tp->csr6 | 0x00002000, ioaddr + CSR6);
-
- outl(0, ioaddr + CSR1);
-
- to = currticks() + TX_TIME_OUT;
- while ((tx_ring[0].status & 0x80000000) && (currticks() < to))
- ;
-
- if (currticks() >= to) {
- DBG ("%s: TX Setup Timeout.\n", tp->nic_name);
- }
- }
-
- if (tp->chip_id == LC82C168)
- tulip_check_duplex(nic);
-
- set_rx_mode(nic);
-
-
- outl(tp->csr6 | 0x00002002, ioaddr + CSR6);
- }
-
-
-
-
-
- static void tulip_transmit(struct nic *nic, const char *d, unsigned int t,
- unsigned int s, const char *p)
- {
- u16 nstype;
- u32 to;
- u32 csr6 = inl(ioaddr + CSR6);
-
- whereami("tulip_transmit\n");
-
-
- outl(csr6 & ~0x00002000, ioaddr + CSR6);
-
- memcpy(txb, d, ETH_ALEN);
- memcpy(txb + ETH_ALEN, nic->node_addr, ETH_ALEN);
- nstype = htons((u16) t);
- memcpy(txb + 2 * ETH_ALEN, (u8 *)&nstype, 2);
- memcpy(txb + ETH_HLEN, p, s);
-
- s += ETH_HLEN;
- s &= 0x0FFF;
-
-
- while (s < ETH_ZLEN)
- txb[s++] = '\0';
-
- DBG2("%s: sending %d bytes ethtype %hX\n", tp->nic_name, s, t);
-
-
-
- tx_ring[0].length = cpu_to_le32(0x60000000 | s);
- tx_ring[0].status = cpu_to_le32(0x80000000);
-
-
- outl(virt_to_le32desc(&tx_ring[0]), ioaddr + CSR4);
-
-
- outl(csr6 | 0x00002000, ioaddr + CSR6);
-
- outl(0, ioaddr + CSR1);
-
- to = currticks() + TX_TIME_OUT;
- while ((tx_ring[0].status & 0x80000000) && (currticks() < to))
- ;
-
- if (currticks() >= to) {
- DBG ("TX Timeout!\n");
- }
-
-
- outl(csr6 & ~0x00002000, ioaddr + CSR6);
- }
-
-
-
-
- static int tulip_poll(struct nic *nic, int retrieve)
- {
-
- whereami("tulip_poll\n");
-
-
- if (rx_ring[tp->cur_rx].status & 0x80000000)
- return 0;
-
- if ( ! retrieve ) return 1;
-
- whereami("tulip_poll got one\n");
-
- nic->packetlen = (rx_ring[tp->cur_rx].status & 0x3FFF0000) >> 16;
-
-
- if (rx_ring[tp->cur_rx].status & 0x00008000) {
-
- rx_ring[tp->cur_rx].status = 0x80000000;
- tp->cur_rx = (tp->cur_rx + 1) % RX_RING_SIZE;
- return 0;
- }
-
-
- memcpy(nic->packet, rxb + tp->cur_rx * BUFLEN, nic->packetlen);
-
-
- rx_ring[tp->cur_rx].status = 0x80000000;
- tp->cur_rx = (tp->cur_rx + 1) % RX_RING_SIZE;
-
- return 1;
- }
-
-
-
-
- static void tulip_disable ( struct nic *nic ) {
-
- whereami("tulip_disable\n");
-
- tulip_reset(nic);
-
-
- outl(0x00000000, ioaddr + CSR7);
-
-
- outl(inl(ioaddr + CSR6) & ~0x00002002, ioaddr + CSR6);
-
-
- inl(ioaddr + CSR8);
- }
-
-
-
-
- static void tulip_irq(struct nic *nic __unused, irq_action_t action __unused)
- {
- switch ( action ) {
- case DISABLE :
- break;
- case ENABLE :
- break;
- case FORCE :
- break;
- }
- }
-
- static struct nic_operations tulip_operations = {
- .connect = dummy_connect,
- .poll = tulip_poll,
- .transmit = tulip_transmit,
- .irq = tulip_irq,
-
- };
-
-
-
-
- static int tulip_probe ( struct nic *nic, struct pci_device *pci ) {
-
- u32 i;
- u8 chip_rev;
- u8 ee_data[EEPROM_SIZE];
- unsigned short sum;
- int chip_idx;
- static unsigned char last_phys_addr[ETH_ALEN] = {0x00, 'L', 'i', 'n', 'u', 'x'};
-
- if (pci->ioaddr == 0)
- return 0;
-
- ioaddr = pci->ioaddr;
- nic->ioaddr = pci->ioaddr & ~3;
- nic->irqno = 0;
-
-
- tp = &tulip_bss.tpx;
-
- tp->vendor_id = pci->vendor;
- tp->dev_id = pci->device;
- tp->nic_name = pci->id->name;
-
- tp->if_port = 0;
- tp->default_port = 0;
-
- adjust_pci_device(pci);
-
-
- outl(0x00000000, ioaddr + CSR7);
-
-
- outl(inl(ioaddr + CSR6) & ~0x00002002, ioaddr + CSR6);
-
-
- inl(ioaddr + CSR8);
-
- DBG("\n");
- whereami("tulip_probe\n");
-
- DBG2 ("%s: Looking for Tulip Chip: Vendor=%hX Device=%hX\n", tp->nic_name,
- tp->vendor_id, tp->dev_id);
-
-
- i = 0;
- chip_idx = -1;
-
- while (pci_id_tbl[i].name) {
- if ( (((u32) tp->dev_id << 16) | tp->vendor_id) ==
- (pci_id_tbl[i].id.pci & pci_id_tbl[i].id.pci_mask) ) {
- chip_idx = pci_id_tbl[i].drv_flags;
- break;
- }
- i++;
- }
-
- if (chip_idx == -1) {
- DBG ("%s: Unknown Tulip Chip: Vendor=%hX Device=%hX\n", tp->nic_name,
- tp->vendor_id, tp->dev_id);
- return 0;
- }
-
- tp->pci_id_idx = i;
- tp->flags = tulip_tbl[chip_idx].flags;
-
- DBG2 ("%s: tp->pci_id_idx == %d, name == %s\n", tp->nic_name,
- tp->pci_id_idx, pci_id_tbl[tp->pci_id_idx].name);
- DBG2 ("%s: chip_idx == %d, name == %s\n", tp->nic_name, chip_idx,
- tulip_tbl[chip_idx].chip_name);
-
-
-
- if (tp->flags & HAS_PWRDWN)
- pci_write_config_dword(pci, 0x40, 0x00000000);
-
- if (inl(ioaddr + CSR5) == 0xFFFFFFFF) {
- DBG("%s: The Tulip chip at %X is not functioning.\n",
- tp->nic_name, (unsigned int) ioaddr);
- return 0;
- }
-
- pci_read_config_byte(pci, PCI_REVISION, &chip_rev);
-
- DBG("%s: [chip: %s] rev %d at %hX\n", tp->nic_name,
- tulip_tbl[chip_idx].chip_name, chip_rev, (unsigned int) ioaddr);
- DBG("%s: Vendor=%hX Device=%hX", tp->nic_name, tp->vendor_id, tp->dev_id);
-
- if (chip_idx == DC21041 && inl(ioaddr + CSR9) & 0x8000) {
- DBG(" 21040 compatible mode.");
- chip_idx = DC21040;
- }
-
- DBG("\n");
-
-
- sum = 0;
- if (chip_idx == DC21040) {
- outl(0, ioaddr + CSR9);
- for (i = 0; i < ETH_ALEN; i++) {
- int value, boguscnt = 100000;
- do
- value = inl(ioaddr + CSR9);
- while (value < 0 && --boguscnt > 0);
- nic->node_addr[i] = value;
- sum += value & 0xff;
- }
- } else if (chip_idx == LC82C168) {
- for (i = 0; i < 3; i++) {
- int value, boguscnt = 100000;
- outl(0x600 | i, ioaddr + 0x98);
- do
- value = inl(ioaddr + CSR9);
- while (value < 0 && --boguscnt > 0);
- put_unaligned(le16_to_cpu(value), ((u16*)nic->node_addr) + i);
- sum += value & 0xffff;
- }
- } else if (chip_idx == COMET) {
-
- put_unaligned(inl(ioaddr + 0xA4), (u32 *)nic->node_addr);
- put_unaligned(inl(ioaddr + 0xA8), (u16 *)(nic->node_addr + 4));
- for (i = 0; i < ETH_ALEN; i ++)
- sum += nic->node_addr[i];
- } else {
-
- int sa_offset = 0;
- int ee_addr_size = read_eeprom(ioaddr, 0xff, 8) & 0x40000 ? 8 : 6;
-
- for (i = 0; i < sizeof(ee_data)/2; i++)
- ((u16 *)ee_data)[i] =
- le16_to_cpu(read_eeprom(ioaddr, i, ee_addr_size));
-
-
-
-
- for (i = 0; i < 8; i ++)
- if (ee_data[i] != ee_data[16+i])
- sa_offset = 20;
- if (ee_data[0] == 0xff && ee_data[1] == 0xff && ee_data[2] == 0) {
- sa_offset = 2;
- }
- for (i = 0; i < ETH_ALEN; i ++) {
- nic->node_addr[i] = ee_data[i + sa_offset];
- sum += ee_data[i + sa_offset];
- }
- }
-
- if ((nic->node_addr[0] == 0xA0 || nic->node_addr[0] == 0xC0)
- && nic->node_addr[1] == 0x00)
- for (i = 0; i < ETH_ALEN; i+=2) {
- char tmp = nic->node_addr[i];
- nic->node_addr[i] = nic->node_addr[i+1];
- nic->node_addr[i+1] = tmp;
- }
-
- if (sum == 0 || sum == ETH_ALEN*0xff) {
- DBG("%s: EEPROM not present!\n", tp->nic_name);
- for (i = 0; i < ETH_ALEN-1; i++)
- nic->node_addr[i] = last_phys_addr[i];
- nic->node_addr[i] = last_phys_addr[i] + 1;
- }
-
- for (i = 0; i < ETH_ALEN; i++)
- last_phys_addr[i] = nic->node_addr[i];
-
- DBG ( "%s: %s at ioaddr %hX\n", tp->nic_name, eth_ntoa ( nic->node_addr ),
- (unsigned int) ioaddr );
-
- tp->chip_id = chip_idx;
- tp->revision = chip_rev;
- tp->csr0 = csr0;
-
-
-
- if (chip_idx == DC21143 && chip_rev == 65)
- tp->csr0 &= ~0x01000000;
- else if (tp->flags & IS_ASIX)
- tp->csr0 |= 0x2000;
-
- if (media_cap[tp->default_port] & MediaIsMII) {
- static const u16 media2advert[] = { 0x20, 0x40, 0x03e0, 0x60,
- 0x80, 0x100, 0x200 };
- tp->mii_advertise = media2advert[tp->default_port - 9];
- tp->mii_advertise |= (tp->flags & HAS_8023X);
- }
-
-
-
- if (tp->flags & HAS_MEDIA_TABLE) {
- memcpy(tp->eeprom, ee_data, sizeof(tp->eeprom));
- parse_eeprom(nic);
- }
-
- start_link(nic);
-
-
- tulip_reset(nic);
- nic->nic_op = &tulip_operations;
-
-
- tulip_wait(4*TICKS_PER_SEC);
-
- return 1;
- }
-
- static void start_link(struct nic *nic)
- {
- int i;
-
- whereami("start_link\n");
-
- if ((tp->flags & ALWAYS_CHECK_MII) ||
- (tp->mtable && tp->mtable->has_mii) ||
- ( ! tp->mtable && (tp->flags & HAS_MII))) {
- unsigned int phy, phy_idx;
- if (tp->mtable && tp->mtable->has_mii) {
- for (i = 0; i < tp->mtable->leafcount; i++)
- if (tp->mtable->mleaf[i].media == 11) {
- tp->cur_index = i;
- tp->saved_if_port = tp->if_port;
- select_media(nic, 2);
- tp->if_port = tp->saved_if_port;
- break;
- }
- }
-
-
- for (phy = 0, phy_idx = 0; phy < 32 && phy_idx < sizeof(tp->phys);
- phy++) {
- int mii_status = mdio_read(nic, phy, 1);
- if ((mii_status & 0x8301) == 0x8001 ||
- ((mii_status & 0x8000) == 0 && (mii_status & 0x7800) != 0)) {
- int mii_reg0 = mdio_read(nic, phy, 0);
- int mii_advert = mdio_read(nic, phy, 4);
- int to_advert;
-
- if (tp->mii_advertise)
- to_advert = tp->mii_advertise;
- else if (tp->advertising[phy_idx])
- to_advert = tp->advertising[phy_idx];
- else
- tp->mii_advertise = to_advert = mii_advert;
-
- tp->phys[phy_idx++] = phy;
- DBG("%s: MII transceiver %d config %hX status %hX advertising %hX.\n",
- tp->nic_name, phy, mii_reg0, mii_status, mii_advert);
-
- if (mii_advert != to_advert) {
- DBG("%s: Advertising %hX on PHY %d previously advertising %hX.\n",
- tp->nic_name, to_advert, phy, mii_advert);
- mdio_write(nic, phy, 4, to_advert);
- }
-
- mdio_write(nic, phy, 0, mii_reg0 |
- (tp->full_duplex ? 0x1100 : 0x1000) |
- (media_cap[tp->default_port]&MediaIs100 ? 0x2000:0));
- }
- }
- tp->mii_cnt = phy_idx;
- if (tp->mtable && tp->mtable->has_mii && phy_idx == 0) {
- DBG("%s: ***WARNING***: No MII transceiver found!\n",
- tp->nic_name);
- tp->phys[0] = 1;
- }
- }
-
-
- switch (tp->chip_id) {
- case DC21040:
- outl(0x00000000, ioaddr + CSR13);
- outl(0x00000004, ioaddr + CSR13);
- break;
- case DC21041:
-
- if (tp->sym_advertise == 0)
- tp->sym_advertise = 0x0061;
- outl(0x00000000, ioaddr + CSR13);
- outl(0xFFFFFFFF, ioaddr + CSR14);
- outl(0x00000008, ioaddr + CSR15);
- outl(inl(ioaddr + CSR6) | 0x0200, ioaddr + CSR6);
- outl(0x0000EF01, ioaddr + CSR13);
- break;
- case DC21140: default:
- if (tp->mtable)
- outl(tp->mtable->csr12dir | 0x100, ioaddr + CSR12);
- break;
- case DC21142:
- case PNIC2:
- if (tp->mii_cnt || media_cap[tp->if_port] & MediaIsMII) {
- outl(0x82020000, ioaddr + CSR6);
- outl(0x0000, ioaddr + CSR13);
- outl(0x0000, ioaddr + CSR14);
- outl(0x820E0000, ioaddr + CSR6);
- } else
- nway_start(nic);
- break;
- case LC82C168:
- if ( ! tp->mii_cnt) {
- tp->nway = 1;
- tp->nwayset = 0;
- outl(0x00420000, ioaddr + CSR6);
- outl(0x30, ioaddr + CSR12);
- outl(0x0001F078, ioaddr + 0xB8);
- outl(0x0201F078, ioaddr + 0xB8);
- }
- break;
- case MX98713: case COMPEX9881:
- outl(0x00000000, ioaddr + CSR6);
- outl(0x000711C0, ioaddr + CSR14);
- outl(0x00000001, ioaddr + CSR13);
- break;
- case MX98715: case MX98725:
- outl(0x01a80000, ioaddr + CSR6);
- outl(0xFFFFFFFF, ioaddr + CSR14);
- outl(0x00001000, ioaddr + CSR12);
- break;
- case COMET:
-
- break;
- }
- }
-
- static void nway_start(struct nic *nic __unused)
- {
- int csr14 = ((tp->sym_advertise & 0x0780) << 9) |
- ((tp->sym_advertise&0x0020)<<1) | 0xffbf;
-
- whereami("nway_start\n");
-
- tp->if_port = 0;
- tp->nway = tp->mediasense = 1;
- tp->nwayset = tp->lpar = 0;
- if (tp->chip_id == PNIC2) {
- tp->csr6 = 0x01000000 | (tp->sym_advertise & 0x0040 ? 0x0200 : 0);
- return;
- }
- DBG2("%s: Restarting internal NWay autonegotiation, %X.\n",
- tp->nic_name, csr14);
- outl(0x0001, ioaddr + CSR13);
- outl(csr14, ioaddr + CSR14);
- tp->csr6 = 0x82420000 | (tp->sym_advertise & 0x0040 ? 0x0200 : 0);
- outl(tp->csr6, ioaddr + CSR6);
- if (tp->mtable && tp->mtable->csr15dir) {
- outl(tp->mtable->csr15dir, ioaddr + CSR15);
- outl(tp->mtable->csr15val, ioaddr + CSR15);
- } else if (tp->chip_id != PNIC2)
- outw(0x0008, ioaddr + CSR15);
- if (tp->chip_id == DC21041)
- outl(0xEF01, ioaddr + CSR12);
- else
- outl(0x1301, ioaddr + CSR12);
- }
-
- static void init_media(struct nic *nic)
- {
- int i;
-
- whereami("init_media\n");
-
- tp->saved_if_port = tp->if_port;
- if (tp->if_port == 0)
- tp->if_port = tp->default_port;
-
-
- i = 0;
- if (tp->mtable == NULL)
- goto media_picked;
- if (tp->if_port) {
- int looking_for = media_cap[tp->if_port] & MediaIsMII ? 11 :
- (tp->if_port == 12 ? 0 : tp->if_port);
- for (i = 0; i < tp->mtable->leafcount; i++)
- if (tp->mtable->mleaf[i].media == looking_for) {
- DBG("%s: Using user-specified media %s.\n",
- tp->nic_name, medianame[tp->if_port]);
- goto media_picked;
- }
- }
- if ((tp->mtable->defaultmedia & 0x0800) == 0) {
- int looking_for = tp->mtable->defaultmedia & 15;
- for (i = 0; i < tp->mtable->leafcount; i++)
- if (tp->mtable->mleaf[i].media == looking_for) {
- DBG("%s: Using EEPROM-set media %s.\n",
- tp->nic_name, medianame[looking_for]);
- goto media_picked;
- }
- }
-
- for (i = tp->mtable->leafcount - 1;
- (media_cap[tp->mtable->mleaf[i].media] & MediaAlwaysFD) && i > 0; i--)
- ;
- media_picked:
-
- tp->csr6 = 0;
- tp->cur_index = i;
- tp->nwayset = 0;
-
- if (tp->if_port) {
- if (tp->chip_id == DC21143 && media_cap[tp->if_port] & MediaIsMII) {
-
- outl(0x0000, ioaddr + CSR13);
- outl(0x0000, ioaddr + CSR14);
- outl(0x0008, ioaddr + CSR15);
- }
- select_media(nic, 1);
- return;
- }
- switch(tp->chip_id) {
- case DC21041:
-
- nway_start(nic);
- break;
- case DC21142:
- if (tp->mii_cnt) {
- select_media(nic, 1);
- DBG2("%s: Using MII transceiver %d, status %hX.\n",
- tp->nic_name, tp->phys[0], mdio_read(nic, tp->phys[0], 1));
- outl(0x82020000, ioaddr + CSR6);
- tp->csr6 = 0x820E0000;
- tp->if_port = 11;
- outl(0x0000, ioaddr + CSR13);
- outl(0x0000, ioaddr + CSR14);
- } else
- nway_start(nic);
- break;
- case PNIC2:
- nway_start(nic);
- break;
- case LC82C168:
- if (tp->mii_cnt) {
- tp->if_port = 11;
- tp->csr6 = 0x814C0000 | (tp->full_duplex ? 0x0200 : 0);
- outl(0x0001, ioaddr + CSR15);
- } else if (inl(ioaddr + CSR5) & TPLnkPass)
- pnic_do_nway(nic);
- else {
-
- outl(0x32, ioaddr + CSR12);
- tp->csr6 = 0x00420000;
- outl(0x0001B078, ioaddr + 0xB8);
- outl(0x0201B078, ioaddr + 0xB8);
- }
- break;
- case MX98713: case COMPEX9881:
- tp->if_port = 0;
- tp->csr6 = 0x01880000 | (tp->full_duplex ? 0x0200 : 0);
- outl(0x0f370000 | inw(ioaddr + 0x80), ioaddr + 0x80);
- break;
- case MX98715: case MX98725:
-
- tp->if_port = 0;
- tp->csr6 = 0x01a80200;
- outl(0x0f370000 | inw(ioaddr + 0x80), ioaddr + 0x80);
- outl(0x11000 | inw(ioaddr + 0xa0), ioaddr + 0xa0);
- break;
- case COMET:
-
- outl(inl(ioaddr + 0x88) | 1, ioaddr + 0x88);
- tp->if_port = 0;
- tp->csr6 = 0x00040000;
- break;
- case AX88140: case AX88141:
- tp->csr6 = tp->mii_cnt ? 0x00040100 : 0x00000100;
- break;
- default:
- select_media(nic, 1);
- }
- }
-
- static void pnic_do_nway(struct nic *nic __unused)
- {
- u32 phy_reg = inl(ioaddr + 0xB8);
- u32 new_csr6 = tp->csr6 & ~0x40C40200;
-
- whereami("pnic_do_nway\n");
-
- if (phy_reg & 0x78000000) {
- if (phy_reg & 0x20000000) tp->if_port = 5;
- else if (phy_reg & 0x40000000) tp->if_port = 3;
- else if (phy_reg & 0x10000000) tp->if_port = 4;
- else if (phy_reg & 0x08000000) tp->if_port = 0;
- tp->nwayset = 1;
- new_csr6 = (tp->if_port & 1) ? 0x01860000 : 0x00420000;
- outl(0x32 | (tp->if_port & 1), ioaddr + CSR12);
- if (tp->if_port & 1)
- outl(0x1F868, ioaddr + 0xB8);
- if (phy_reg & 0x30000000) {
- tp->full_duplex = 1;
- new_csr6 |= 0x00000200;
- }
- DBG2("%s: PNIC autonegotiated status %X, %s.\n",
- tp->nic_name, phy_reg, medianame[tp->if_port]);
- if (tp->csr6 != new_csr6) {
- tp->csr6 = new_csr6;
- outl(tp->csr6 | 0x0002, ioaddr + CSR6);
- outl(tp->csr6 | 0x2002, ioaddr + CSR6);
- }
- }
- }
-
-
- static void select_media(struct nic *nic, int startup)
- {
- struct mediatable *mtable = tp->mtable;
- u32 new_csr6;
- int i;
-
- whereami("select_media\n");
-
- if (mtable) {
- struct medialeaf *mleaf = &mtable->mleaf[tp->cur_index];
- unsigned char *p = mleaf->leafdata;
- switch (mleaf->type) {
- case 0:
- DBG2("%s: Using a 21140 non-MII transceiver"
- " with control setting %hhX.\n",
- tp->nic_name, p[1]);
- tp->if_port = p[0];
- if (startup)
- outl(mtable->csr12dir | 0x100, ioaddr + CSR12);
- outl(p[1], ioaddr + CSR12);
- new_csr6 = 0x02000000 | ((p[2] & 0x71) << 18);
- break;
- case 2: case 4: {
- u16 setup[5];
- u32 csr13val, csr14val, csr15dir, csr15val;
- for (i = 0; i < 5; i++)
- setup[i] = get_u16(&p[i*2 + 1]);
-
- tp->if_port = p[0] & 15;
- if (media_cap[tp->if_port] & MediaAlwaysFD)
- tp->full_duplex = 1;
-
- if (startup && mtable->has_reset) {
- struct medialeaf *rleaf = &mtable->mleaf[mtable->has_reset];
- unsigned char *rst = rleaf->leafdata;
- DBG2("%s: Resetting the transceiver.\n",
- tp->nic_name);
- for (i = 0; i < rst[0]; i++)
- outl(get_u16(rst + 1 + (i<<1)) << 16, ioaddr + CSR15);
- }
- DBG2("%s: 21143 non-MII %s transceiver control %hX/%hX.\n",
- tp->nic_name, medianame[tp->if_port], setup[0], setup[1]);
- if (p[0] & 0x40) {
- csr13val = setup[0];
- csr14val = setup[1];
- csr15dir = (setup[3]<<16) | setup[2];
- csr15val = (setup[4]<<16) | setup[2];
- outl(0, ioaddr + CSR13);
- outl(csr14val, ioaddr + CSR14);
- outl(csr15dir, ioaddr + CSR15);
- outl(csr15val, ioaddr + CSR15);
- outl(csr13val, ioaddr + CSR13);
- } else {
- csr13val = 1;
- csr14val = 0x0003FF7F;
- csr15dir = (setup[0]<<16) | 0x0008;
- csr15val = (setup[1]<<16) | 0x0008;
- if (tp->if_port <= 4)
- csr14val = t21142_csr14[tp->if_port];
- if (startup) {
- outl(0, ioaddr + CSR13);
- outl(csr14val, ioaddr + CSR14);
- }
- outl(csr15dir, ioaddr + CSR15);
- outl(csr15val, ioaddr + CSR15);
- if (startup) outl(csr13val, ioaddr + CSR13);
- }
- DBG2("%s: Setting CSR15 to %X/%X.\n",
- tp->nic_name, csr15dir, csr15val);
- if (mleaf->type == 4)
- new_csr6 = 0x82020000 | ((setup[2] & 0x71) << 18);
- else
- new_csr6 = 0x82420000;
- break;
- }
- case 1: case 3: {
- int phy_num = p[0];
- int init_length = p[1];
- u16 *misc_info;
-
- tp->if_port = 11;
- new_csr6 = 0x020E0000;
- if (mleaf->type == 3) {
- u16 *init_sequence = (u16*)(p+2);
- u16 *reset_sequence = &((u16*)(p+3))[init_length];
- int reset_length = p[2 + init_length*2];
- misc_info = reset_sequence + reset_length;
- if (startup)
- for (i = 0; i < reset_length; i++)
- outl(get_u16(&reset_sequence[i]) << 16, ioaddr + CSR15);
- for (i = 0; i < init_length; i++)
- outl(get_u16(&init_sequence[i]) << 16, ioaddr + CSR15);
- } else {
- u8 *init_sequence = p + 2;
- u8 *reset_sequence = p + 3 + init_length;
- int reset_length = p[2 + init_length];
- misc_info = (u16*)(reset_sequence + reset_length);
- if (startup) {
- outl(mtable->csr12dir | 0x100, ioaddr + CSR12);
- for (i = 0; i < reset_length; i++)
- outl(reset_sequence[i], ioaddr + CSR12);
- }
- for (i = 0; i < init_length; i++)
- outl(init_sequence[i], ioaddr + CSR12);
- }
- tp->advertising[phy_num] = get_u16(&misc_info[1]) | 1;
- if (startup < 2) {
- if (tp->mii_advertise == 0)
- tp->mii_advertise = tp->advertising[phy_num];
- DBG2("%s: Advertising %hX on MII %d.\n",
- tp->nic_name, tp->mii_advertise, tp->phys[phy_num]);
- mdio_write(nic, tp->phys[phy_num], 4, tp->mii_advertise);
- }
- break;
- }
- default:
- DBG("%s: Invalid media table selection %d.\n",
- tp->nic_name, mleaf->type);
- new_csr6 = 0x020E0000;
- }
- DBG2("%s: Using media type %s, CSR12 is %hhX.\n",
- tp->nic_name, medianame[tp->if_port],
- inl(ioaddr + CSR12) & 0xff);
- } else if (tp->chip_id == DC21041) {
- int port = tp->if_port <= 4 ? tp->if_port : 0;
- DBG2("%s: 21041 using media %s, CSR12 is %hX.\n",
- tp->nic_name, medianame[port == 3 ? 12: port],
- inl(ioaddr + CSR12));
- outl(0x00000000, ioaddr + CSR13);
- outl(t21041_csr14[port], ioaddr + CSR14);
- outl(t21041_csr15[port], ioaddr + CSR15);
- outl(t21041_csr13[port], ioaddr + CSR13);
- new_csr6 = 0x80020000;
- } else if (tp->chip_id == LC82C168) {
- if (startup && ! tp->medialock)
- tp->if_port = tp->mii_cnt ? 11 : 0;
- DBG2("%s: PNIC PHY status is %hX, media %s.\n",
- tp->nic_name, inl(ioaddr + 0xB8), medianame[tp->if_port]);
- if (tp->mii_cnt) {
- new_csr6 = 0x810C0000;
- outl(0x0001, ioaddr + CSR15);
- outl(0x0201B07A, ioaddr + 0xB8);
- } else if (startup) {
-
- outl(0x32, ioaddr + CSR12);
- new_csr6 = 0x00420000;
- outl(0x0001B078, ioaddr + 0xB8);
- outl(0x0201B078, ioaddr + 0xB8);
- } else if (tp->if_port == 3 || tp->if_port == 5) {
- outl(0x33, ioaddr + CSR12);
- new_csr6 = 0x01860000;
-
- outl(startup ? 0x0201F868 : 0x0001F868, ioaddr + 0xB8);
- } else {
- outl(0x32, ioaddr + CSR12);
- new_csr6 = 0x00420000;
- outl(0x1F078, ioaddr + 0xB8);
- }
- } else if (tp->chip_id == DC21040) {
-
- int csr12 = inl(ioaddr + CSR12);
- DBG2("%s: 21040 media type is %s, CSR12 is %hhX.\n",
- tp->nic_name, medianame[tp->if_port], csr12);
- if (media_cap[tp->if_port] & MediaAlwaysFD)
- tp->full_duplex = 1;
- new_csr6 = 0x20000;
-
- outl(FULL_DUPLEX_MAGIC, ioaddr + CSR11);
- outl(0x00000000, ioaddr + CSR13);
- if (t21040_csr13[tp->if_port] & 8) {
- outl(0x0705, ioaddr + CSR14);
- outl(0x0006, ioaddr + CSR15);
- } else {
- outl(0xffff, ioaddr + CSR14);
- outl(0x0000, ioaddr + CSR15);
- }
- outl(0x8f01 | t21040_csr13[tp->if_port], ioaddr + CSR13);
- } else {
- if (tp->default_port == 0)
- tp->if_port = tp->mii_cnt ? 11 : 3;
- if (media_cap[tp->if_port] & MediaIsMII) {
- new_csr6 = 0x020E0000;
- } else if (media_cap[tp->if_port] & MediaIsFx) {
- new_csr6 = 0x028600000;
- } else
- new_csr6 = 0x038600000;
- DBG2("%s: No media description table, assuming "
- "%s transceiver, CSR12 %hhX.\n",
- tp->nic_name, medianame[tp->if_port],
- inl(ioaddr + CSR12));
- }
-
- tp->csr6 = new_csr6 | (tp->csr6 & 0xfdff) | (tp->full_duplex ? 0x0200 : 0);
- return;
- }
-
-
- static int tulip_check_duplex(struct nic *nic)
- {
- unsigned int bmsr, lpa, negotiated, new_csr6;
-
- bmsr = mdio_read(nic, tp->phys[0], 1);
- lpa = mdio_read(nic, tp->phys[0], 5);
-
- DBG2("%s: MII status %#x, Link partner report %#x.\n",
- tp->nic_name, bmsr, lpa);
-
- if (bmsr == 0xffff)
- return -2;
- if ((bmsr & 4) == 0) {
- int new_bmsr = mdio_read(nic, tp->phys[0], 1);
- if ((new_bmsr & 4) == 0) {
- DBG2("%s: No link beat on the MII interface,"
- " status %#x.\n", tp->nic_name,
- new_bmsr);
- return -1;
- }
- }
- tp->full_duplex = lpa & 0x140;
-
- new_csr6 = tp->csr6;
- negotiated = lpa & tp->advertising[0];
-
- if(negotiated & 0x380) new_csr6 &= ~0x400000;
- else new_csr6 |= 0x400000;
- if (tp->full_duplex) new_csr6 |= 0x200;
- else new_csr6 &= ~0x200;
-
- if (new_csr6 != tp->csr6) {
- tp->csr6 = new_csr6;
-
- DBG("%s: Setting %s-duplex based on MII"
- "#%d link partner capability of %#x.\n",
- tp->nic_name,
- tp->full_duplex ? "full" : "half",
- tp->phys[0], lpa);
- return 1;
- }
-
- return 0;
- }
-
- static struct pci_device_id tulip_nics[] = {
- PCI_ROM(0x1011, 0x0002, "dc21040", "Digital Tulip", 0),
- PCI_ROM(0x1011, 0x0009, "ds21140", "Digital Tulip Fast", 0),
- PCI_ROM(0x1011, 0x0014, "dc21041", "Digital Tulip+", 0),
- PCI_ROM(0x1011, 0x0019, "ds21142", "Digital Tulip 21142", 0),
- PCI_ROM(0x10b7, 0x9300, "3csoho100b-tx","3ComSOHO100B-TX", 0),
- PCI_ROM(0x10b9, 0x5261, "ali1563", "ALi 1563 integrated ethernet", 0),
- PCI_ROM(0x10d9, 0x0512, "mx98713", "Macronix MX987x3", 0),
- PCI_ROM(0x10d9, 0x0531, "mx98715", "Macronix MX987x5", 0),
- PCI_ROM(0x1113, 0x1217, "mxic-98715", "Macronix MX987x5", 0),
- PCI_ROM(0x11ad, 0xc115, "lc82c115", "LinkSys LNE100TX", 0),
- PCI_ROM(0x11ad, 0x0002, "82c168", "Netgear FA310TX", 0),
- PCI_ROM(0x1282, 0x9100, "dm9100", "Davicom 9100", 0),
- PCI_ROM(0x1282, 0x9102, "dm9102", "Davicom 9102", 0),
- PCI_ROM(0x1282, 0x9009, "dm9009", "Davicom 9009", 0),
- PCI_ROM(0x1282, 0x9132, "dm9132", "Davicom 9132", 0),
- PCI_ROM(0x1317, 0x0985, "centaur-p", "ADMtek Centaur-P", 0),
- PCI_ROM(0x1317, 0x0981, "an981", "ADMtek AN981 Comet", 0),
- PCI_ROM(0x1113, 0x1216, "an983", "ADMTek AN983 Comet", 0),
- PCI_ROM(0x1317, 0x9511, "an983b", "ADMTek Comet 983b", 0),
- PCI_ROM(0x1317, 0x1985, "centaur-c", "ADMTek Centaur-C", 0),
- PCI_ROM(0x8086, 0x0039, "intel21145", "Intel Tulip", 0),
- PCI_ROM(0x125b, 0x1400, "ax88140", "ASIX AX88140", 0),
- PCI_ROM(0x11f6, 0x9881, "rl100tx", "Compex RL100-TX", 0),
- PCI_ROM(0x115d, 0x0003, "xircomtulip", "Xircom Tulip", 0),
- PCI_ROM(0x104a, 0x0981, "tulip-0981", "Tulip 0x104a 0x0981", 0),
- PCI_ROM(0x104a, 0x2774, "SGThomson-STE10100A", "Tulip 0x104a 0x2774", 0),
- PCI_ROM(0x1113, 0x9511, "tulip-9511", "Tulip 0x1113 0x9511", 0),
- PCI_ROM(0x1186, 0x1561, "tulip-1561", "Tulip 0x1186 0x1561", 0),
- PCI_ROM(0x1259, 0xa120, "tulip-a120", "Tulip 0x1259 0xa120", 0),
- PCI_ROM(0x13d1, 0xab02, "tulip-ab02", "Tulip 0x13d1 0xab02", 0),
- PCI_ROM(0x13d1, 0xab03, "tulip-ab03", "Tulip 0x13d1 0xab03", 0),
- PCI_ROM(0x13d1, 0xab08, "tulip-ab08", "Tulip 0x13d1 0xab08", 0),
- PCI_ROM(0x14f1, 0x1803, "lanfinity", "Conexant LANfinity", 0),
- PCI_ROM(0x1626, 0x8410, "tulip-8410", "Tulip 0x1626 0x8410", 0),
- PCI_ROM(0x1737, 0xab08, "tulip-1737-ab08","Tulip 0x1737 0xab08", 0),
- PCI_ROM(0x1737, 0xab09, "tulip-ab09", "Tulip 0x1737 0xab09", 0),
- };
-
- PCI_DRIVER ( tulip_driver, tulip_nics, PCI_NO_CLASS );
-
- DRIVER ( "Tulip", nic_driver, pci_driver, tulip_driver,
- tulip_probe, tulip_disable );
-
|