summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2006-02-13 08:54:55 +0000
committerBrad Smith <brad@cvs.openbsd.org>2006-02-13 08:54:55 +0000
commit91f2316bfc843dcca5d0366529babfd626e6d0a5 (patch)
tree7700c7a292a9b903ec47e039693cc58837ebf650 /sys
parent5a21d542c6b193743039b417edbe2f5ca04ed637 (diff)
use pci_mapreg_type().
ok damien@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_nfe.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/sys/dev/pci/if_nfe.c b/sys/dev/pci/if_nfe.c
index 646ef789285..7887d5338f4 100644
--- a/sys/dev/pci/if_nfe.c
+++ b/sys/dev/pci/if_nfe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_nfe.c,v 1.35 2006/02/13 06:15:32 brad Exp $ */
+/* $OpenBSD: if_nfe.c,v 1.36 2006/02/13 08:54:54 brad Exp $ */
/*-
* Copyright (c) 2006 Damien Bergamini <damien.bergamini@free.fr>
@@ -160,9 +160,17 @@ nfe_attach(struct device *parent, struct device *self, void *aux)
const char *intrstr;
struct ifnet *ifp;
bus_size_t memsize;
-
- if (pci_mapreg_map(pa, NFE_PCI_BA, PCI_MAPREG_TYPE_MEM, 0,
- &sc->sc_memt, &sc->sc_memh, NULL, &memsize, 0) != 0) {
+ pcireg_t memtype;
+
+ memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, NFE_PCI_BA);
+ switch (memtype) {
+ case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT:
+ case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BIT:
+ if (pci_mapreg_map(pa, NFE_PCI_BA,
+ memtype, 0, &sc->sc_memt, &sc->sc_memh,
+ NULL, &memsize, 0) == 0)
+ break;
+ default:
printf(": can't map mem space\n");
return;
}