Subject: Re: Performance of VIA RhineII (vr) driver in -current?
To: None <cjb@brushtail.apana.org.au, netbsd-users@netbsd.org>
From: Gilbert Fernandes <gilbertf@netbsd-fr.org>
List: netbsd-users
Date: 04/24/2003 21:05:59
On Fri, Apr 25, 2003 at 05:23:10AM +1000, Chris Baird wrote:

> I have a VIA EPIA 800 board in the process of being tuned up to be an
> 'appropriate technology' server. Unfortunately I've discovered
> although Linux-2.4.x (Debian 3.0.0) and FreeBSD 5.0 works well on this
> (tiny) box[1], NetBSD-1.6.1 has show-stopping problems with the
> RhineII Ethernet (vr) device. Is this a solved problem in
> NetBSD-current?

(I replied to you in private but this one if for the mailing-list)

Edit /usr/src/sys/dev/pci/if-vr.c and change the reset function
for this one :

static void
vr_reset(sc)
	struct vr_softc *sc;
{
	int i;

	VR_SETBIT16(sc, VR_COMMAND, VR_CMD_RESET);

	for (i = 0; i < VR_TIMEOUT; i++) {
		DELAY(10);
		if (!(CSR_READ_2(sc, VR_COMMAND) & VR_CMD_RESET))
			break;
	}
	if (i == VR_TIMEOUT) {
		printf("%s: reset never completed!\n",
			sc->vr_dev.dv_xname);
		printf("%s: trying force reset.\n",
			sc->vr_dev.dv_xname);
		VR_SETBIT16(sc, VR_MISC, VR_FORCE_RESET);
	}

	/* Wait a little while for the chip to get its brains in order. */
	DELAY(1000);
}

Add the following two defines to if_vrreg.h so this works :

#define VR_MISC                 0x81
#define VR_FORCE_RESET          0x40

I posted a blurb like this over port-i386@netbsd.org a few days ago.

This seems to have fixed the problem but only one person confirmed.
If more people can confirm we could post a pr about it.

-- 
Gilbert Fernandes