Introduction

Sad to say, there is a nasty problem where the generic NetBSD kernel trashes WD8013 ethernet boards. What I know about it is this: Since the generic kernel has drivers for all kinds of hardware, there is a lot of groping around in the dark that goes on. While in an ideal world this groping would be, shall we say non-intrusive, in some cases it is not. This particular case is one of those bad and evil situations. If you have a Western Digital or SMC ethernet board jumpered at iobase 0x300 you will amost certainly suffer.

My problems with this date back to when I had an Etherlink-II adapter (the beloved 3c503). This card sort of managed, but among its many shortcomings, its only configuration that would be recognized by the generic NetBSD kernel was the ed2 setting with iobase 0x300, irq 10, rambase 0xcc000. This card is not software configurable, so the kernel did not trash it. But later when I moved up to a WD8013 (an excellent move all told, but an 8216 is better yet), I jumpered it to be an ed2 like the old 3c503, and then when I upgraded to NetBSD 1.1, I got bit, and again on my upgrade to 1.2 (some people never learn). What can be done? Well, the obvious thing is to jumper or configure the card someplace other than 0x300. Another option would be to beg or borrow some other kind of ethernet board (like a 3com or some such), for the duration of the install procedure. Perhaps you could convince the NetBSD kernel folks to either remove the driver that does the nasty probing from the generic kernel, or to fix the driver so it probes in a less damaging way. However, this problem has been around for what seems like years, so there is perhaps no chance of relief from that quarter. Another option is to build a custom kernel and put it onto the boot floppy, but if you are doing a first time install this will be out of the question.

What are the symptoms? Well, you get to the point in the install process where you are going to boot the kernel off the hard disk. As the device probe messages go by, you notice that there is no mention of "ed0" (it has already been roached by a preceding probe). When you try to ifconfig to, lets say mount an NFS partition and load the rest of the distribution, you get some kind of error about no such device being configured. You then go scrounge up some DOS diskettes and run the EZSETUP utility from SMC and it reports that it cannot find an ethernet board. Too much fun, eh?

Last night I managed to fix a WD8013 board that had been screwed up in this fashion. It involves using DOS debug and poking around with some of the registers on the board. Port 0x301 is the ICR register, bit 0x80 is the bit that tells the board to store information into NVRAM. Ports 0x308 thru 0x30d hold the 6-byte hardware ethernet address, Port 0x30e holds a product ID (see table below), and Port 0x30f holds a checksum. Your challenge is to restore the contents of these 8 bytes to their proper values. If you are lucky (as I was) the 6-byte ethernet address is on a sticker on your card, or you can find a record of it somewhere. You could really use anything, but you would be advised to use the "offical" value to avoid having the same address as some other node in the world. The product ID is easy if you know what kind of card you have. Look in /dev/isa/if_edreg.h for a more complete list. The checksum is whatever it takes for the sum of the 8 bytes (modulo 256) to be 0xff. Easy to work out with a hex calculator.

In my case, the first byte of the ethernet address had been overwritten by an 0x05, and the card type was zeroed. The checksum needed to be recalculated after these were corrected, then things were fine. In a case prior to NetBSD 1.2, just powering the system off would allow the EZSETUP utility to recognize them later, but not so last night.

Here is a cookbook procedure:

Your board should now be back in working order, you can use EZSETUP to investigate. At this point you have the challenge of how to rejumper your board or reconfigure it to work with NetBSD.

Here is a list of product ID's for port 0x30e:

0x26
8013W
0x27
8013EP
0x28
8013WC
0x29
8013EPC
0x2a
8216T
0x2b
8216C
0x2c
8216EBP