From owner-freebsd-hackers Tue Jun 13 13:31:12 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id NAA09117 for hackers-outgoing; Tue, 13 Jun 1995 13:31:12 -0700 Received: from zibbi.mikom.csir.co.za (some.schmuck.lame.delegated.to.RAIN.PSG.COM [146.64.24.58]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id NAA09094 ; Tue, 13 Jun 1995 13:31:05 -0700 Received: (from jhay@localhost) by zibbi.mikom.csir.co.za (8.6.11/8.6.6) id WAA03979; Tue, 13 Jun 1995 22:31:36 +0200 From: John Hay Message-Id: <199506132031.WAA03979@zibbi.mikom.csir.co.za> Subject: Possible patch for SMC 8216/8416 probe bug To: davidg@FreeBSD.ORG Date: Tue, 13 Jun 1995 22:31:36 +0200 (SAT) Cc: hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4 PL23] Content-Type: text Content-Length: 1928 Sender: hackers-owner@FreeBSD.ORG Precedence: bulk Here is a possible fix for the bug in probing the 8216C/8416/C cards. The problem was that the memory of the card wasn't enabled before it was written to. I'm not sure if all these things is needed, but I found them lower down in the probe code. Also I'm not sure if I have to preserve the value of the ED_WD_LAAR register. The probe does that later on and I didn't want to clobber it. I have tried it on my 8216C and it works. I don't have a 8416C to test it on. Maybe David Greenman should look at it, as he seems to do most stuff in the if_ed.c driver. -- John Hay -- jhay@mikom.csir.co.za *** if_ed.c.orig Sun Jun 4 19:31:09 1995 --- if_ed.c Tue Jun 13 22:20:56 1995 *************** *** 390,395 **** --- 390,412 ---- isa16bit = 1; break; case ED_TYPE_SMC8216C: /* 8216 has 16K shared mem -- 8416 has 8K */ + { + int tval; + + tval = inb(sc->asic_addr + ED_WD_LAAR); + sc->mem_start = (caddr_t) isa_dev->id_maddr; + + outb(sc->asic_addr + ED_WD_LAAR, ED_WD_LAAR_M16EN); + outb(sc->asic_addr + ED_WD_MSR, ED_WD_MSR_MENB); + outb(sc->asic_addr + ED_WD790_HWR, + (inb(sc->asic_addr + ED_WD790_HWR) | ED_WD790_HWR_SWH)); + outb(sc->asic_addr + ED_WD790_RAR, + ((kvtop(sc->mem_start) >> 13) & 0x0f) | + ((kvtop(sc->mem_start) >> 11) & 0x40) | + (inb(sc->asic_addr + ED_WD790_RAR) & 0xb0)); + outb(sc->asic_addr + ED_WD790_HWR, + (inb(sc->asic_addr + ED_WD790_HWR) & ~ED_WD790_HWR_SWH)); + (unsigned int) *(isa_dev->id_maddr+8192) = (unsigned int)0; if ((unsigned int) *(isa_dev->id_maddr+8192)) { sc->type_str = "SMC8416C/SMC8416BT"; *************** *** 402,410 **** --- 419,429 ---- "Ethernet adapter: SMC 8216 or 8216C"; memsize = 16384; } + outb(sc->asic_addr + ED_WD_LAAR, tval); isa16bit = 1; sc->is790 = 1; break; + } case ED_TYPE_SMC8216T: sc->type_str = "SMC8216T"; sc->kdc.kdc_description =