From aad37eaff688ce9a829760c8df614014ce706dbb Mon Sep 17 00:00:00 2001 From: fvdl Date: Wed, 5 Nov 2003 16:03:27 +0000 Subject: [PATCH] Apparently, Dell PERC 4/Di controllers can have two memory BARs, with the second one empty. The previous revision made it pick the empty one. Reinstate the BAR size check. --- sys/dev/pci/amr.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/dev/pci/amr.c b/sys/dev/pci/amr.c index 5606e7e68c90..7d4cba4f20fd 100644 --- a/sys/dev/pci/amr.c +++ b/sys/dev/pci/amr.c @@ -1,4 +1,4 @@ -/* $NetBSD: amr.c,v 1.18 2003/10/29 02:27:32 mycroft Exp $ */ +/* $NetBSD: amr.c,v 1.19 2003/11/05 16:03:27 fvdl Exp $ */ /*- * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: amr.c,v 1.18 2003/10/29 02:27:32 mycroft Exp $"); +__KERNEL_RCSID(0, "$NetBSD: amr.c,v 1.19 2003/11/05 16:03:27 fvdl Exp $"); #include #include @@ -272,10 +272,12 @@ amr_attach(struct device *parent, struct device *self, void *aux) reg = pci_conf_read(pc, pa->pa_tag, i); switch (PCI_MAPREG_TYPE(reg)) { case PCI_MAPREG_TYPE_MEM: - memreg = i; + if (PCI_MAPREG_MEM_SIZE(reg) != 0) + memreg = i; break; case PCI_MAPREG_TYPE_IO: - ioreg = i; + if (PCI_MAPREG_IO_SIZE(reg) != 0) + ioreg = i; break; }