diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2005-07-09 21:47:21 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2005-07-09 21:47:21 +0000 |
commit | 01078ef1e766cf7c6fc0ebef7d702058e54b9c3d (patch) | |
tree | 6b30f6339d709250c7557b174392a337966cc347 /sys/dev/pci/ciss_pci.c | |
parent | 778a1a47affe57da0cc1e0051a2fbaf4aec49168 (diff) |
handle 64bit bar; found by mpf@
Diffstat (limited to 'sys/dev/pci/ciss_pci.c')
-rw-r--r-- | sys/dev/pci/ciss_pci.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/pci/ciss_pci.c b/sys/dev/pci/ciss_pci.c index 81e2a975114..1e522a04765 100644 --- a/sys/dev/pci/ciss_pci.c +++ b/sys/dev/pci/ciss_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ciss_pci.c,v 1.1 2005/07/06 01:52:13 mickey Exp $ */ +/* $OpenBSD: ciss_pci.c,v 1.2 2005/07/09 21:47:20 mickey Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -80,9 +80,15 @@ ciss_pci_attach(struct device *parent, struct device *self, void *aux) bus_size_t size, cfgsz; pci_intr_handle_t ih; const char *intrstr; - int cfg_bar; + int cfg_bar, memtype; - if (pci_mapreg_map(pa, CISS_BAR, PCI_MAPREG_TYPE_MEM, 0, + memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, CISS_BAR); + if (memtype != (PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT) && + memtype != (PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BIT)) { + printf(": wrong BAR type\n"); + return; + } + if (pci_mapreg_map(pa, CISS_BAR, memtype, 0, &sc->iot, &sc->ioh, NULL, &size, 0)) { printf(": can't map controller i/o space\n"); return; |