diff options
author | Marcus Glocker <mglocker@cvs.openbsd.org> | 2006-11-29 21:34:07 +0000 |
---|---|---|
committer | Marcus Glocker <mglocker@cvs.openbsd.org> | 2006-11-29 21:34:07 +0000 |
commit | e5f289c3ed0e2258d84d06f4fb231938503cfd4b (patch) | |
tree | ba2738010bd94bf17a5cf7ab16b7517269f29394 /sys/dev/ic | |
parent | 2f7e792c81f62a7f644ef21ae3da628189ea40b8 (diff) |
From Jon Simola <simola@mecha.com>:
New bcw_powercontrol_crystal_on() function, and fix the license for the
pci wrapper.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/bcw.c | 19 | ||||
-rw-r--r-- | sys/dev/ic/bcwvar.h | 5 |
2 files changed, 21 insertions, 3 deletions
diff --git a/sys/dev/ic/bcw.c b/sys/dev/ic/bcw.c index 264275ad0bc..6721a83e872 100644 --- a/sys/dev/ic/bcw.c +++ b/sys/dev/ic/bcw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bcw.c,v 1.7 2006/11/26 11:14:17 deraadt Exp $ */ +/* $OpenBSD: bcw.c,v 1.8 2006/11/29 21:34:06 mglocker Exp $ */ /* * Copyright (c) 2006 Jon Simola <jsimola@gmail.com> @@ -2124,3 +2124,20 @@ bcw_free_tx_ring(struct bcw_softc *sc, struct bcw_tx_ring *ring) } } +void +bcw_powercontrol_crystal_on(struct bcw_softc *sc) +{ + u_int32_t sbval; + + sbval = bus_space_read_4(sc->sc_iot, sc->sc_ioh, BCW_GPIOI); + if ((sbval & BCW_XTALPOWERUP) != BCW_XTALPOWERUP) { + sbval = bus_space_read_4(sc->sc_iot, sc->sc_ioh, BCW_GPIOO); + sbval |= (BCW_XTALPOWERUP & BCW_PLLPOWERDOWN); + bus_space_write_4(sc->sc_iot, sc->sc_ioh, BCW_GPIOO, sbval); + delay(1000); + sbval = bus_space_read_4(sc->sc_iot, sc->sc_ioh, BCW_GPIOO); + sbval &= ~BCW_PLLPOWERDOWN; + bus_space_write_4(sc->sc_iot, sc->sc_ioh, BCW_GPIOO, sbval); + delay(5000); + } +} diff --git a/sys/dev/ic/bcwvar.h b/sys/dev/ic/bcwvar.h index 8250e8f3e41..08f59231442 100644 --- a/sys/dev/ic/bcwvar.h +++ b/sys/dev/ic/bcwvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bcwvar.h,v 1.6 2006/11/26 11:14:17 deraadt Exp $ */ +/* $OpenBSD: bcwvar.h,v 1.7 2006/11/29 21:34:06 mglocker Exp $ */ /* * Copyright (c) 2006 Jon Simola <jsimola@gmail.com> @@ -178,8 +178,9 @@ struct bcw_softc { }; void bcw_attach(struct bcw_softc *); -int bcw_detach(void *arg); +int bcw_detach(void *); int bcw_intr(void *); +void bcw_powercontrol_crystal_on(struct bcw_softc *); #define BCW_DEBUG #ifdef BCW_DEBUG |