-/* $OpenBSD: if_iwn.c,v 1.189 2017/05/31 16:12:39 stsp Exp $ */
+/* $OpenBSD: if_iwn.c,v 1.190 2017/06/02 11:18:16 stsp Exp $ */
/*-
* Copyright (c) 2007-2010 Damien Bergamini <damien.bergamini@free.fr>
{
struct iwn_beacon_missed *miss =
(struct iwn_beacon_missed *)(desc + 1);
- uint32_t missed = letoh32(miss->consecutive);
+ uint32_t missed;
if ((ic->ic_opmode != IEEE80211_M_STA) ||
(ic->ic_state != IEEE80211_S_RUN))
bus_dmamap_sync(sc->sc_dmat, data->map, sizeof (*desc),
sizeof (*miss), BUS_DMASYNC_POSTREAD);
+ missed = letoh32(miss->consecutive);
/*
* If more than 5 consecutive beacons are missed,
* state machine will drop us into scanning after timing
* out waiting for a probe response.
*/
- if (missed > ic->ic_bmissthres)
+ if (missed > ic->ic_bmissthres && !ic->ic_mgt_timer)
IEEE80211_SEND_MGMT(ic, ic->ic_bss,
IEEE80211_FC0_SUBTYPE_PROBE_REQ, 0);
break;