Handle missed beacons correctly

Approved by: mlaier (comentor)
This commit is contained in:
benjsc 2007-11-27 08:58:32 +00:00
parent 79ae5fe2e3
commit 981215a5d3
2 changed files with 22 additions and 1 deletions

View File

@ -1800,7 +1800,6 @@ wpi_notif_intr(struct wpi_softc *sc)
if (!(desc->qid & 0x80)) /* reply to a command */
wpi_cmd_intr(sc, desc);
/* XXX beacon miss handling? */
switch (desc->type) {
case WPI_RX_DONE:
/* a 802.11 frame was received */
@ -1870,6 +1869,18 @@ wpi_notif_intr(struct wpi_softc *sc)
wpi_queue_cmd(sc, WPI_SCAN_NEXT);
break;
}
case WPI_MISSED_BEACON:
{
struct wpi_missed_beacon *beacon =
(struct wpi_missed_beacon *)(desc + 1);
if (le32toh(beacon->consecutive) >= ic->ic_bmissthreshold) {
DPRINTF(("Beacon miss: %u >= %u\n",
le32toh(beacon->consecutive),
ic->ic_bmissthreshold));
ieee80211_beacon_miss(ic);
}
}
}
sc->rxq.cur = (sc->rxq.cur + 1) % WPI_RX_RING_COUNT;

View File

@ -203,6 +203,7 @@ struct wpi_rx_desc {
#define WPI_START_SCAN 130
#define WPI_STOP_SCAN 132
#define WPI_STATE_CHANGED 161
#define WPI_MISSED_BEACON 162
uint8_t flags;
uint8_t idx;
@ -420,6 +421,15 @@ struct wpi_cmd_beacon {
struct ieee80211_frame wh;
} __packed;
/* structure for notification WPI_MISSED_BEACON */
struct wpi_missed_beacon {
uint32_t consecutive;
uint32_t total;
uint32_t expected;
uint32_t received;
} __packed;
/* structure for WPI_CMD_MRR_SETUP */
struct wpi_mrr_setup {
uint8_t which;