summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormglocker <mglocker@openbsd.org>2007-02-25 17:03:08 +0000
committermglocker <mglocker@openbsd.org>2007-02-25 17:03:08 +0000
commitd7fbf97370159a65ee057389d6077b0bc7c9d935 (patch)
treeae7455232e886a756986da34152798321f4be510
parentreword some text to avoid a hideous Xr; (diff)
downloadwireguard-openbsd-d7fbf97370159a65ee057389d6077b0bc7c9d935.tar.xz
wireguard-openbsd-d7fbf97370159a65ee057389d6077b0bc7c9d935.zip
Power on/off cardbus socket at attach/detach time. Makes firmware upload
work on my BCM4318 cardbus device now.
-rw-r--r--sys/dev/cardbus/if_bcw_cardbus.c4
-rw-r--r--sys/dev/ic/bcw.c14
2 files changed, 13 insertions, 5 deletions
diff --git a/sys/dev/cardbus/if_bcw_cardbus.c b/sys/dev/cardbus/if_bcw_cardbus.c
index 91d5c089c1e..19c8cee71a4 100644
--- a/sys/dev/cardbus/if_bcw_cardbus.c
+++ b/sys/dev/cardbus/if_bcw_cardbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bcw_cardbus.c,v 1.7 2007/02/25 10:06:04 mglocker Exp $ */
+/* $OpenBSD: if_bcw_cardbus.c,v 1.8 2007/02/25 17:03:08 mglocker Exp $ */
/*
* Copyright (c) 2006 Jon Simola <jsimola@gmail.com>
@@ -146,7 +146,7 @@ bcw_cardbus_attach(struct device *parent, struct device *self, void *aux)
#endif
bcw_attach(sc);
- Cardbus_function_disable(ct);
+ //Cardbus_function_disable(ct);
}
int
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);
}