From dbb66e289fe84ffc6a663ee4f2fb6a07e6378cf4 Mon Sep 17 00:00:00 2001 From: thompsa Date: Fri, 16 May 2008 04:15:54 +0000 Subject: The beacon miss notification must run without locks held has it calls back into wpi_raw_xmit(); --- sys/dev/wpi/if_wpi.c | 17 +++++++++++++++-- sys/dev/wpi/if_wpivar.h | 1 + 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'sys/dev/wpi') diff --git a/sys/dev/wpi/if_wpi.c b/sys/dev/wpi/if_wpi.c index 6cbd7cd..959e20c 100644 --- a/sys/dev/wpi/if_wpi.c +++ b/sys/dev/wpi/if_wpi.c @@ -188,6 +188,7 @@ static void wpi_rx_intr(struct wpi_softc *, struct wpi_rx_desc *, struct wpi_rx_data *); static void wpi_tx_intr(struct wpi_softc *, struct wpi_rx_desc *); static void wpi_cmd_intr(struct wpi_softc *, struct wpi_rx_desc *); +static void wpi_bmiss(void *, int); static void wpi_notif_intr(struct wpi_softc *); static void wpi_intr(void *); static void wpi_ops(void *, int); @@ -516,6 +517,7 @@ wpi_attach(device_t dev) /* Create the tasks that can be queued */ TASK_INIT(&sc->sc_opstask, 0, wpi_ops, sc); + TASK_INIT(&sc->sc_bmiss_task, 0, wpi_bmiss, sc); WPI_LOCK_INIT(sc); WPI_CMD_LOCK_INIT(sc); @@ -1619,6 +1621,15 @@ wpi_cmd_intr(struct wpi_softc *sc, struct wpi_rx_desc *desc) } static void +wpi_bmiss(void *arg, int npending) +{ + struct wpi_softc *sc = arg; + struct ieee80211com *ic = sc->sc_ifp->if_l2com; + + ieee80211_beacon_miss(ic); +} + +static void wpi_notif_intr(struct wpi_softc *sc) { struct ifnet *ifp = sc->sc_ifp; @@ -1723,7 +1734,8 @@ wpi_notif_intr(struct wpi_softc *sc) DPRINTF(("Beacon miss: %u >= %u\n", le32toh(beacon->consecutive), vap->iv_bmissthreshold)); - ieee80211_beacon_miss(ic); + taskqueue_enqueue(taskqueue_swi, + &sc->sc_bmiss_task); } break; } @@ -3006,7 +3018,8 @@ wpi_rfkill_resume(struct wpi_softc *sc) if (vap != NULL) { if ((ic->ic_flags & IEEE80211_F_SCAN) == 0) { if (vap->iv_opmode != IEEE80211_M_MONITOR) { - ieee80211_beacon_miss(ic); + taskqueue_enqueue(taskqueue_swi, + &sc->sc_bmiss_task); wpi_set_led(sc, WPI_LED_LINK, 0, 1); } else wpi_set_led(sc, WPI_LED_LINK, 5, 5); diff --git a/sys/dev/wpi/if_wpivar.h b/sys/dev/wpi/if_wpivar.h index 1436592..a447fd3 100644 --- a/sys/dev/wpi/if_wpivar.h +++ b/sys/dev/wpi/if_wpivar.h @@ -222,6 +222,7 @@ struct wpi_softc { struct task sc_radioofftask;/* disable rf transmitter task*/ struct task sc_opstask; /* operation handling task */ struct task sc_restarttask; /* reset firmware task */ + struct task sc_bmiss_task; /* beacon miss */ /* Eeprom info */ uint8_t cap; -- cgit v1.1