diff options
author | 2001-09-10 12:55:59 +0000 | |
---|---|---|
committer | 2001-09-10 12:55:59 +0000 | |
commit | ad62aca37d7339db815f70440830d266d8521f40 (patch) | |
tree | f88acc8dba7cf90f0eed4bfca8de232faf5553a1 | |
parent | Initial cut at sparc64 gcc config. (diff) | |
download | wireguard-openbsd-ad62aca37d7339db815f70440830d266d8521f40.tar.xz wireguard-openbsd-ad62aca37d7339db815f70440830d266d8521f40.zip |
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.
-rw-r--r-- | sys/arch/macppc/dev/if_wi_obio.c | 11 |
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; |