summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2001-09-10 12:56:00 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2001-09-10 12:56:00 +0000
commitcff8de58eff2696fccdd3acc6fc363013e7528e8 (patch)
tree833cca3bc0326c86a59be4139a54208ff1ef8148 /sys/arch
parent12a89bdb38a94c396f807cfdba0d19faf3b0bcaa (diff)
Devices should not poke random memory, even hacked code which should be
calling another driver to turn on it's enables properly. For now wi_obio will mapiodev the keywest enable region.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/macppc/dev/if_wi_obio.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/arch/macppc/dev/if_wi_obio.c b/sys/arch/macppc/dev/if_wi_obio.c
index a0788d1cfa0..e7cf9b4893b 100644
--- a/sys/arch/macppc/dev/if_wi_obio.c
+++ b/sys/arch/macppc/dev/if_wi_obio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi_obio.c,v 1.1 2001/09/01 15:50:00 drahn Exp $ */
+/* $OpenBSD: if_wi_obio.c,v 1.2 2001/09/10 12:55:59 drahn Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -85,6 +85,7 @@ void wi_stop __P((struct wi_softc *));
struct wi_obio_softc {
struct wi_softc sc_wi;
+ u_int keywest;
};
struct cfattach wi_obio_ca = {
@@ -121,6 +122,8 @@ wi_obio_attach(parent, self, aux)
if (bus_space_map(sc->wi_btag, ca->ca_reg[0], ca->ca_reg[1], 0, &sc->wi_bhandle)) {
printf("cant' map i/o space\n");
}
+ /* FSCKING hackery */
+ psc->keywest = (u_int) mapiodev(0x80000000, 0x1d000);
/* Establish the interrupt. */
mac_intr_establish(parent, ca->ca_intr[0], IST_LEVEL, IPL_NET,
@@ -194,7 +197,8 @@ int
wi_obio_enable(sc)
struct wi_softc *sc;
{
- const u_int keywest = 0x80000000; /* XXX */
+ struct wi_obio_softc *psc = (struct wi_obio_softc *)sc;
+ const u_int keywest = psc->keywest; /* XXX */
const u_int fcr2 = keywest + 0x40;
const u_int gpio = keywest + 0x6a;
const u_int extint_gpio = keywest + 0x58;
@@ -236,7 +240,8 @@ void
wi_obio_disable(sc)
struct wi_softc *sc;
{
- const u_int keywest = 0x80000000; /* XXX */
+ struct wi_obio_softc *psc = (struct wi_obio_softc *)sc;
+ const u_int keywest = psc->keywest; /* XXX */
const u_int fcr2 = keywest + 0x40;
u_int x;