summaryrefslogtreecommitdiffstats
path: root/sys/pci
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2001-02-26 22:23:55 +0000
committerwpaul <wpaul@FreeBSD.org>2001-02-26 22:23:55 +0000
commit95dbcd4c3875ca99c450dd5b8a7f6fc938d67c64 (patch)
treef2f706ccebc42033f453cd858b3a0987107fb46c /sys/pci
parent825b685ed9a5971ca52d4f4524a383e84b332e73 (diff)
downloadFreeBSD-src-95dbcd4c3875ca99c450dd5b8a7f6fc938d67c64.zip
FreeBSD-src-95dbcd4c3875ca99c450dd5b8a7f6fc938d67c64.tar.gz
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
Diffstat (limited to 'sys/pci')
-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 eced632..6bf15e0 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;
OpenPOWER on IntegriCloud