aboutsummaryrefslogtreecommitdiff
path: root/sys/pci/if_pcn.c
diff options
context:
space:
mode:
authorBill Paul <wpaul@FreeBSD.org>2001-02-26 22:23:55 +0000
committerBill Paul <wpaul@FreeBSD.org>2001-02-26 22:23:55 +0000
commite979bff5574b3a6c77366831a05b72e7d3560708 (patch)
tree1448dfbeaf853a6680a0b87b5bced3820c2c7303 /sys/pci/if_pcn.c
parent7d42e30c2ea9a5102e0d3ea858976d0338287f01 (diff)
downloadsrc-e979bff5574b3a6c77366831a05b72e7d3560708.tar.gz
src-e979bff5574b3a6c77366831a05b72e7d3560708.zip
Workaround to prevent VMware from melting down. The pseudo PCnet interface
in VMware reports 0x00000000 in the PCI subsystem ID register, but 0x10001000 when you read the mirror registers in I/O space. This causes pcn_probe() to think it's found a card in 32-bit mode, and performing a 32-bit I/O access makes on a 16-bit port makes VMware go boom. Special case the 0x10001000 value until somebody at VMware grows a clue. Finally discovered by: Andrew Gallatin
Notes
Notes: svn path=/head/; revision=73111
Diffstat (limited to 'sys/pci/if_pcn.c')
-rw-r--r--sys/pci/if_pcn.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/pci/if_pcn.c b/sys/pci/if_pcn.c
index eced63224707..6bf15e0c7ead 100644
--- a/sys/pci/if_pcn.c
+++ b/sys/pci/if_pcn.c
@@ -440,8 +440,16 @@ static int pcn_probe(dev)
chip_id = pcn_bcr_read16(sc, PCN_BCR_PCISUBSYSID);
chip_id <<= 16;
chip_id |= pcn_bcr_read16(sc, PCN_BCR_PCISUBVENID);
+ /*
+ * Note III: the test for 0x10001000 is a hack to
+ * pacify VMware, who's pseudo-PCnet interface is
+ * broken. Reading the subsystem register from PCI
+ * config space yeilds 0x00000000 while reading the
+ * same value from I/O space yeilds 0x10001000. It's
+ * not supposed to be that way.
+ */
if (chip_id == pci_read_config(dev,
- PCIR_SUBVEND_0, 4)) {
+ PCIR_SUBVEND_0, 4) || chip_id == 0x10001000) {
/* We're in 16-bit mode. */
chip_id = pcn_csr_read16(sc, PCN_CSR_CHIPID1);
chip_id <<= 16;