summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/cardbus/if_pgt_cardbus.c8
-rw-r--r--sys/dev/ic/pgt.c10
-rw-r--r--sys/dev/ic/pgtvar.h6
3 files changed, 17 insertions, 7 deletions
diff --git a/sys/dev/cardbus/if_pgt_cardbus.c b/sys/dev/cardbus/if_pgt_cardbus.c
index 58180722899..de27604745c 100644
--- a/sys/dev/cardbus/if_pgt_cardbus.c
+++ b/sys/dev/cardbus/if_pgt_cardbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pgt_cardbus.c,v 1.2 2006/10/02 18:06:55 mglocker Exp $ */
+/* $OpenBSD: if_pgt_cardbus.c,v 1.3 2006/10/06 21:55:33 mglocker Exp $ */
/*
* Copyright (c) 2006 Marcus Glocker <mglocker@openbsd.org>
@@ -107,12 +107,12 @@ pgt_cardbus_attach(struct device *parent, struct device *self, void *aux)
csc->sc_ct = ct;
csc->sc_tag = ca->ca_tag;
csc->sc_intrline = ca->ca_intrline;
-#if 0
+
/* power management hooks */
sc->sc_enable = pgt_cardbus_enable;
sc->sc_disable = pgt_cardbus_disable;
sc->sc_power = pgt_cardbus_power;
-#endif
+
/* remember chipset */
if (CARDBUS_PRODUCT(ca->ca_id) == PCI_PRODUCT_INTERSIL_ISL3877)
sc->sc_flags |= SC_ISL3877;
@@ -141,8 +141,6 @@ pgt_cardbus_attach(struct device *parent, struct device *self, void *aux)
mountroothook_establish(pgt_attach, sc);
else
pgt_attach(sc);
-
- Cardbus_function_disable(ct);
}
int
diff --git a/sys/dev/ic/pgt.c b/sys/dev/ic/pgt.c
index b9e909996f9..11d1d5207a5 100644
--- a/sys/dev/ic/pgt.c
+++ b/sys/dev/ic/pgt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pgt.c,v 1.29 2006/10/05 14:22:54 mglocker Exp $ */
+/* $OpenBSD: pgt.c,v 1.30 2006/10/06 21:55:33 mglocker Exp $ */
/*
* Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org>
@@ -581,6 +581,10 @@ pgt_attach(void *xsc)
//sc->sc_debug |= SC_DEBUG_RXFRAG;
//sc->sc_debug |= SC_DEBUG_RXETHER;
+ /* enable card if possible */
+ if (sc->sc_enable != NULL)
+ (*sc->sc_enable)(sc);
+
error = pgt_dma_alloc(sc);
if (error)
return;
@@ -623,6 +627,10 @@ pgt_detach(struct pgt_softc *sc)
pgt_disable(sc, SC_DYING);
pgt_reboot(sc);
+ /* disable card if possible */
+ if (sc->sc_disable != NULL)
+ (*sc->sc_disable)(sc);
+
ieee80211_ifdetach(&sc->sc_ic.ic_if);
if_detach(&sc->sc_ic.ic_if);
diff --git a/sys/dev/ic/pgtvar.h b/sys/dev/ic/pgtvar.h
index 9a0157950f7..d4c6f9ba860 100644
--- a/sys/dev/ic/pgtvar.h
+++ b/sys/dev/ic/pgtvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pgtvar.h,v 1.8 2006/10/02 18:06:55 mglocker Exp $ */
+/* $OpenBSD: pgtvar.h,v 1.9 2006/10/06 21:55:33 mglocker Exp $ */
/*
* Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org>
@@ -175,6 +175,10 @@ struct pgt_softc {
(struct ieee80211com *,
enum ieee80211_state, int);
+ int (*sc_enable)(struct pgt_softc *);
+ void (*sc_disable)(struct pgt_softc *);
+ void (*sc_power)(struct pgt_softc *, int);
+
struct pgt_mgmt_descq sc_mgmtinprog;
struct pgt_descq sc_freeq[PGT_QUEUE_COUNT];
size_t sc_freeq_count[PGT_QUEUE_COUNT];