Try to fix passive scanning hang on beacon miss.

PR:		kern/197143
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
This commit is contained in:
adrian 2015-05-03 23:28:54 +00:00
parent 102868722b
commit c053a22b7f
3 changed files with 24 additions and 8 deletions

View File

@ -2135,11 +2135,18 @@ wpi_notif_intr(struct wpi_softc *sc)
__func__, misses, le32toh(miss->total), received,
expected);
if (vap->iv_state == IEEE80211_S_RUN &&
(ic->ic_flags & IEEE80211_F_SCAN) == 0 &&
(misses >= threshold ||
(received == 0 && expected >= threshold)))
ieee80211_beacon_miss(ic);
if (misses >= threshold ||
(received == 0 && expected >= threshold)) {
WPI_RXON_LOCK(sc);
if (callout_pending(&sc->scan_timeout)) {
wpi_cmd(sc, WPI_CMD_SCAN_ABORT, NULL,
0, 1);
}
WPI_RXON_UNLOCK(sc);
if (vap->iv_state == IEEE80211_S_RUN &&
(ic->ic_flags & IEEE80211_F_SCAN) == 0)
ieee80211_beacon_miss(ic);
}
break;
}
@ -2202,17 +2209,21 @@ wpi_notif_intr(struct wpi_softc *sc)
{
bus_dmamap_sync(sc->rxq.data_dmat, data->map,
BUS_DMASYNC_POSTREAD);
#ifdef WPI_DEBUG
struct wpi_stop_scan *scan =
(struct wpi_stop_scan *)(desc + 1);
DPRINTF(sc, WPI_DEBUG_SCAN,
"scan finished nchan=%d status=%d chan=%d\n",
scan->nchan, scan->status, scan->chan);
#endif
WPI_RXON_LOCK(sc);
callout_stop(&sc->scan_timeout);
WPI_RXON_UNLOCK(sc);
ieee80211_scan_next(vap);
if (scan->status == WPI_SCAN_ABORTED)
ieee80211_cancel_scan(vap);
else
ieee80211_scan_next(vap);
break;
}
}

View File

@ -86,6 +86,7 @@ static const char *wpi_cmd_str(int cmd)
WPI_DESC(WPI_CMD_SET_LED);
WPI_DESC(WPI_CMD_SET_POWER_MODE);
WPI_DESC(WPI_CMD_SCAN);
WPI_DESC(WPI_CMD_SCAN_ABORT);
WPI_DESC(WPI_CMD_SET_BEACON);
WPI_DESC(WPI_CMD_TXPOWER);
WPI_DESC(WPI_CMD_BT_COEX);

View File

@ -352,6 +352,7 @@ struct wpi_tx_cmd {
#define WPI_CMD_SET_LED 72
#define WPI_CMD_SET_POWER_MODE 119
#define WPI_CMD_SCAN 128
#define WPI_CMD_SCAN_ABORT 129
#define WPI_CMD_SET_BEACON 145
#define WPI_CMD_TXPOWER 151
#define WPI_CMD_BT_COEX 155
@ -725,6 +726,9 @@ struct wpi_start_scan {
struct wpi_stop_scan {
uint8_t nchan;
uint8_t status;
#define WPI_SCAN_COMPLETED 1
#define WPI_SCAN_ABORTED 2
uint8_t reserved;
uint8_t chan;
uint64_t tsf;