summaryrefslogtreecommitdiff
path: root/sys/dev/ic/bcw.c
diff options
context:
space:
mode:
authorMarcus Glocker <mglocker@cvs.openbsd.org>2007-02-25 17:03:09 +0000
committerMarcus Glocker <mglocker@cvs.openbsd.org>2007-02-25 17:03:09 +0000
commitf9a1ab22b8694cf0fcb58ba8cd115d4e062024c4 (patch)
tree6fc335746bfee144caeadecb6e891eb64b825f8d /sys/dev/ic/bcw.c
parentea84a3edc5fb3ee3e98b5be0871225a310751681 (diff)
Power on/off cardbus socket at attach/detach time. Makes firmware upload
work on my BCM4318 cardbus device now.
Diffstat (limited to 'sys/dev/ic/bcw.c')
-rw-r--r--sys/dev/ic/bcw.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/dev/ic/bcw.c b/sys/dev/ic/bcw.c
index dd558eb5dc5..31a14521ff4 100644
--- a/sys/dev/ic/bcw.c
+++ b/sys/dev/ic/bcw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bcw.c,v 1.58 2007/02/25 09:59:18 mglocker Exp $ */
+/* $OpenBSD: bcw.c,v 1.59 2007/02/25 17:03:08 mglocker Exp $ */
/*
* Copyright (c) 2006 Jon Simola <jsimola@gmail.com>
@@ -685,14 +685,18 @@ bcw_attach(struct bcw_softc *sc)
int error;
int i;
uint32_t sbval;
-// uint16_t sbval16;
+ //uint16_t sbval16;
uint32_t core_id, core_rev, core_vendor;
+ /* power on cardbus socket */
+ if (sc->sc_enable)
+ sc->sc_enable(sc);
+
/*
* Don't reset the chip here, we can only reset each core and we
* haven't identified the cores yet.
*/
-// bcw_reset(sc);
+ //bcw_reset(sc);
/*
* Attach to the Backplane and start the card up
@@ -2228,6 +2232,10 @@ bcw_detach(void *arg)
bcw_free_rx_ring(sc, &sc->sc_rxring);
bcw_free_tx_ring(sc, &sc->sc_txring);
+ /* power off cardbus socket */
+ if (sc->sc_disable)
+ sc->sc_disable(sc);
+
return (0);
}