summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/ic/rt2560.c8
-rw-r--r--sys/dev/ic/rt2661.c8
-rw-r--r--sys/dev/ic/rt2860.c8
-rw-r--r--sys/dev/pci/if_ral_pci.c7
4 files changed, 15 insertions, 16 deletions
diff --git a/sys/dev/ic/rt2560.c b/sys/dev/ic/rt2560.c
index 08672c95214..561e82b87b8 100644
--- a/sys/dev/ic/rt2560.c
+++ b/sys/dev/ic/rt2560.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2560.c,v 1.45 2009/08/10 17:47:23 damien Exp $ */
+/* $OpenBSD: rt2560.c,v 1.46 2009/11/01 12:08:36 damien Exp $ */
/*-
* Copyright (c) 2005, 2006
@@ -320,12 +320,12 @@ rt2560_detach(void *xsc)
timeout_del(&sc->scan_to);
timeout_del(&sc->amrr_to);
- ieee80211_ifdetach(ifp); /* free all nodes */
- if_detach(ifp);
-
if (sc->sc_powerhook != NULL)
powerhook_disestablish(sc->sc_powerhook);
+ ieee80211_ifdetach(ifp); /* free all nodes */
+ if_detach(ifp);
+
rt2560_free_tx_ring(sc, &sc->txq);
rt2560_free_tx_ring(sc, &sc->atimq);
rt2560_free_tx_ring(sc, &sc->prioq);
diff --git a/sys/dev/ic/rt2661.c b/sys/dev/ic/rt2661.c
index 49621dc2ba4..f8389695dd5 100644
--- a/sys/dev/ic/rt2661.c
+++ b/sys/dev/ic/rt2661.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2661.c,v 1.50 2009/08/10 17:47:23 damien Exp $ */
+/* $OpenBSD: rt2661.c,v 1.51 2009/11/01 12:08:36 damien Exp $ */
/*-
* Copyright (c) 2006
@@ -354,12 +354,12 @@ rt2661_detach(void *xsc)
timeout_del(&sc->scan_to);
timeout_del(&sc->amrr_to);
- ieee80211_ifdetach(ifp); /* free all nodes */
- if_detach(ifp);
-
if (sc->sc_powerhook != NULL)
powerhook_disestablish(sc->sc_powerhook);
+ ieee80211_ifdetach(ifp); /* free all nodes */
+ if_detach(ifp);
+
for (ac = 0; ac < 4; ac++)
rt2661_free_tx_ring(sc, &sc->txq[ac]);
rt2661_free_tx_ring(sc, &sc->mgtq);
diff --git a/sys/dev/ic/rt2860.c b/sys/dev/ic/rt2860.c
index ed5bb811575..5f977cb89df 100644
--- a/sys/dev/ic/rt2860.c
+++ b/sys/dev/ic/rt2860.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2860.c,v 1.35 2009/08/10 17:47:23 damien Exp $ */
+/* $OpenBSD: rt2860.c,v 1.36 2009/11/01 12:08:36 damien Exp $ */
/*-
* Copyright (c) 2007, 2008
@@ -338,12 +338,12 @@ rt2860_detach(void *xsc)
struct ifnet *ifp = &sc->sc_ic.ic_if;
int qid;
- ieee80211_ifdetach(ifp); /* free all nodes */
- if_detach(ifp);
-
if (sc->sc_powerhook != NULL)
powerhook_disestablish(sc->sc_powerhook);
+ ieee80211_ifdetach(ifp); /* free all nodes */
+ if_detach(ifp);
+
for (qid = 0; qid < 6; qid++)
rt2860_free_tx_ring(sc, &sc->txq[qid]);
rt2860_free_rx_ring(sc, &sc->rxq);
diff --git a/sys/dev/pci/if_ral_pci.c b/sys/dev/pci/if_ral_pci.c
index 561e924697f..bef3a3ab987 100644
--- a/sys/dev/pci/if_ral_pci.c
+++ b/sys/dev/pci/if_ral_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ral_pci.c,v 1.17 2009/05/12 17:43:16 damien Exp $ */
+/* $OpenBSD: if_ral_pci.c,v 1.18 2009/11/01 12:08:36 damien Exp $ */
/*-
* Copyright (c) 2005-2007
@@ -201,12 +201,11 @@ ral_pci_detach(struct device *self, int flags)
int error;
if (psc->sc_ih != NULL) {
+ pci_intr_disestablish(psc->sc_pc, psc->sc_ih);
+
error = (*psc->sc_opns->detach)(sc);
if (error != 0)
return error;
-
- pci_intr_disestablish(psc->sc_pc, psc->sc_ih);
- psc->sc_ih = NULL;
}
if (psc->sc_mapsize > 0)