Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jun 1995 22:31:36 +0200 (SAT)
From:      John Hay <jhay@mikom.csir.co.za>
To:        davidg@FreeBSD.ORG
Cc:        hackers@FreeBSD.ORG
Subject:   Possible patch for SMC 8216/8416 probe bug
Message-ID:  <199506132031.WAA03979@zibbi.mikom.csir.co.za>

next in thread | raw e-mail | index | archive | help
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 =



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199506132031.WAA03979>