summaryrefslogtreecommitdiff
path: root/sys/dev/wi
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2008-07-26 17:04:30 +0000
committerWarner Losh <imp@FreeBSD.org>2008-07-26 17:04:30 +0000
commitfebcff0a3bd6a05f70dc982f84459a8ade0fc73b (patch)
tree4f0e7377520d4e010f9d3c2cd43728416eaaddd2 /sys/dev/wi
parentb834665cd5ce6141136f2f7c63d1e495790cf82a (diff)
Notes
Diffstat (limited to 'sys/dev/wi')
-rw-r--r--sys/dev/wi/if_wi.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c
index 51c672da5983..f0d939f22fc5 100644
--- a/sys/dev/wi/if_wi.c
+++ b/sys/dev/wi/if_wi.c
@@ -250,19 +250,6 @@ wi_attach(device_t dev)
}
ic = ifp->if_l2com;
- /*
- * NB: no locking is needed here; don't put it here
- * unless you can prove it!
- */
- error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE,
- NULL, wi_intr, sc, &sc->wi_intrhand);
-
- if (error) {
- device_printf(dev, "bus_setup_intr() failed! (%d)\n", error);
- wi_free(dev);
- return error;
- }
-
sc->sc_firmware_type = WI_NOTYPE;
sc->wi_cmd_count = 500;
/* Reset the NIC. */
@@ -473,6 +460,17 @@ wi_attach(device_t dev)
if (bootverbose)
ieee80211_announce(ic);
+ error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE,
+ NULL, wi_intr, sc, &sc->wi_intrhand);
+ if (error) {
+ device_printf(dev, "bus_setup_intr() failed! (%d)\n", error);
+ bpfdetach(ifp);
+ ieee80211_ifdetach(ic);
+ if_free(sc->sc_ifp);
+ wi_free(dev);
+ return error;
+ }
+
return (0);
}