Check more invalid devices in pci_conf_hook(9).

This commit is contained in:
tsutsui 2006-04-18 12:26:45 +00:00
parent 1525687690
commit e2f83bd318
1 changed files with 16 additions and 4 deletions

View File

@ -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. * Copyright (c) 2000 Soren S. Jorvang. All rights reserved.
@ -26,7 +26,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__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 <sys/types.h> #include <sys/types.h>
#include <sys/param.h> #include <sys/param.h>
@ -218,13 +218,25 @@ int
pci_conf_hook(pci_chipset_tag_t pc, int bus, int dev, int func, pcireg_t id) 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. */ /* Don't configure the bridge and PCI probe. */
if (PCI_VENDOR(id) == PCI_VENDOR_GALILEO && if (PCI_VENDOR(id) == PCI_VENDOR_GALILEO &&
PCI_PRODUCT(id) == PCI_PRODUCT_GALILEO_GT64011) PCI_PRODUCT(id) == PCI_PRODUCT_GALILEO_GT64011)
return 0; return 0;
/* Don't configure device 9 */ /* Don't configure on-board VIA VT82C586 (pcib, viaide, uhci) */
if (dev == 9) if (bus == 0 && dev == 9)
return 0; return 0;
return PCI_CONF_DEFAULT & ~(PCI_COMMAND_SERR_ENABLE | return PCI_CONF_DEFAULT & ~(PCI_COMMAND_SERR_ENABLE |