summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2006-08-10 04:25:16 +0000
committerBrad Smith <brad@cvs.openbsd.org>2006-08-10 04:25:16 +0000
commit90857575def4e5074eaf2ea1a9c016839826cb1e (patch)
treeff38783f82683bb00c85f42fa3efdb0d596eee7e /sys/dev/pci
parent3d79bb8cff8a0ad5fbf76e281ffbb64ff5edca00 (diff)
unmap memory address space in bnx_release_resources().
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/if_bnx.c8
-rw-r--r--sys/dev/pci/if_bnxreg.h3
2 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/pci/if_bnx.c b/sys/dev/pci/if_bnx.c
index 5215e219201..4880098ffe5 100644
--- a/sys/dev/pci/if_bnx.c
+++ b/sys/dev/pci/if_bnx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bnx.c,v 1.6 2006/08/10 04:13:09 brad Exp $ */
+/* $OpenBSD: if_bnx.c,v 1.7 2006/08/10 04:25:15 brad Exp $ */
/*-
* Copyright (c) 2006 Broadcom Corporation
@@ -354,7 +354,6 @@ bnx_attach(struct device *parent, struct device *self, void *aux)
struct ifnet *ifp;
u_int32_t val;
pcireg_t memtype;
- bus_size_t size;
sc->bnx_pa = *pa;
@@ -367,7 +366,7 @@ bnx_attach(struct device *parent, struct device *self, void *aux)
case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BIT:
if (pci_mapreg_map(pa, BNX_PCI_BAR0,
memtype, 0, &sc->bnx_btag, &sc->bnx_bhandle,
- NULL, &size, 0) == 0)
+ NULL, &sc->bnx_size, 0) == 0)
break;
default:
printf(": can't find mem space\n");
@@ -2211,6 +2210,9 @@ bnx_release_resources(struct bnx_softc *sc)
if (sc->bnx_intrhand != NULL)
pci_intr_disestablish(pa->pa_pc, sc->bnx_intrhand);
+ if (sc->bnx_size)
+ bus_space_unmap(sc->bnx_btag, sc->bnx_bhandle, sc->bnx_size);
+
DBPRINT(sc, BNX_VERBOSE_RESET, "Exiting %s()\n", __FUNCTION__);
}
diff --git a/sys/dev/pci/if_bnxreg.h b/sys/dev/pci/if_bnxreg.h
index d0b532aea73..337dca6a0ee 100644
--- a/sys/dev/pci/if_bnxreg.h
+++ b/sys/dev/pci/if_bnxreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bnxreg.h,v 1.6 2006/08/10 04:01:52 brad Exp $ */
+/* $OpenBSD: if_bnxreg.h,v 1.7 2006/08/10 04:25:15 brad Exp $ */
/*-
* Copyright (c) 2006 Broadcom Corporation
@@ -4619,6 +4619,7 @@ struct bnx_softc
bus_space_tag_t bnx_btag; /* Device bus tag */
bus_space_handle_t bnx_bhandle; /* Device bus handle */
+ bus_size_t bnx_size;
void *bnx_intrhand; /* Interrupt handler */
void *bnx_powerhook;