From e2f83bd3186119f67e12b667a75231df20a4990c Mon Sep 17 00:00:00 2001 From: tsutsui Date: Tue, 18 Apr 2006 12:26:45 +0000 Subject: [PATCH] Check more invalid devices in pci_conf_hook(9). --- sys/arch/cobalt/pci/pci_machdep.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/sys/arch/cobalt/pci/pci_machdep.c b/sys/arch/cobalt/pci/pci_machdep.c index ccc050ee7edb..9f5c8e7f9ca2 100644 --- a/sys/arch/cobalt/pci/pci_machdep.c +++ b/sys/arch/cobalt/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.c,v 1.21 2006/04/09 01:24:05 tsutsui Exp $ */ +/* $NetBSD: pci_machdep.c,v 1.22 2006/04/18 12:26:45 tsutsui Exp $ */ /* * Copyright (c) 2000 Soren S. Jorvang. All rights reserved. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.21 2006/04/09 01:24:05 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.22 2006/04/18 12:26:45 tsutsui Exp $"); #include #include @@ -218,13 +218,25 @@ int pci_conf_hook(pci_chipset_tag_t pc, int bus, int dev, int func, pcireg_t id) { + /* ignore bogus IDs */ + if (PCI_VENDOR(id) == 0) + return 0; + + /* 2700 hardware wedges on accesses to device 6. */ + if (bus == 0 && dev == 6) + return 0; + + /* 2800 hardware wedges on accesses to device 31. */ + if (bus == 0 && dev == 31) + return 0; + /* Don't configure the bridge and PCI probe. */ if (PCI_VENDOR(id) == PCI_VENDOR_GALILEO && PCI_PRODUCT(id) == PCI_PRODUCT_GALILEO_GT64011) return 0; - /* Don't configure device 9 */ - if (dev == 9) + /* Don't configure on-board VIA VT82C586 (pcib, viaide, uhci) */ + if (bus == 0 && dev == 9) return 0; return PCI_CONF_DEFAULT & ~(PCI_COMMAND_SERR_ENABLE |