Subject: CVS commit: src/sys/dev/pci
To: None <source-changes@NetBSD.org>
From: Jonathan Stone <jonathan@netbsd.org>
List: source-changes
Date: 06/01/2006 01:46:41
Module Name:	src
Committed By:	jonathan
Date:		Thu Jun  1 01:46:41 UTC 2006

Modified Files:
	src/sys/dev/pci: if_bge.c

Log Message:
Fix a minor thinko in ascertaining whether or not a bge(4) device is
attached via PCI-Express:

The previous code first checked that the bge ASIC-revision matched the
5750 ASIC-revisoin (the bcm5721 has the same ASIC revision). However, the
bcm5752 is also a PCI-Express device, but has a different ASIC revision.
Thus, we were setting sc->bge_pcie to zero for bcm5752s, which in turn
causes bge_reset() to not perform required PCI-Express setup.

The test for a 5750 ASIC revision may (or may not) have been carried
across from the FreeBSD bge(4) driver. FreeBSD's bge(4) does not
properly detect or handle post-5750 bge devices. Instead, FreeBSD's
bge(4) keeps a sofc copy of the ASIC revision, and for post-5750
devices (5752, 5714, ...) overwrites that softc copy of the
ASIC-revision with the 5750 ASIC revision.  Thus, the test (mutatis
mutandis, using FreeBDS's softc asic-revision field), was correct for
FreeBSD; but manifestly incorrect for NetBSD.

Mark Davies (mark at mcs.vuw.ac..nz) has confirmed via private email
that this change fixes PR kern/kern/33509: his bcm5752 now works.


To generate a diff of this commit:
cvs rdiff -r1.107 -r1.108 src/sys/dev/pci/if_bge.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.