summaryrefslogtreecommitdiffstats
path: root/sys/dev/wpi
diff options
context:
space:
mode:
authorbenjsc <benjsc@FreeBSD.org>2007-11-27 08:58:32 +0000
committerbenjsc <benjsc@FreeBSD.org>2007-11-27 08:58:32 +0000
commit981215a5d399f0c53f50e0ff06b9fc40658df99d (patch)
treecb4394330bd17bc4774e00a259331f03e458dcb7 /sys/dev/wpi
parent79ae5fe2e3118ca80a1676e578106913043a6886 (diff)
downloadFreeBSD-src-981215a5d399f0c53f50e0ff06b9fc40658df99d.zip
FreeBSD-src-981215a5d399f0c53f50e0ff06b9fc40658df99d.tar.gz
Handle missed beacons correctly
Approved by: mlaier (comentor)
Diffstat (limited to 'sys/dev/wpi')
-rw-r--r--sys/dev/wpi/if_wpi.c13
-rw-r--r--sys/dev/wpi/if_wpireg.h10
2 files changed, 22 insertions, 1 deletions
diff --git a/sys/dev/wpi/if_wpi.c b/sys/dev/wpi/if_wpi.c
index d2ae17f..981fdce 100644
--- a/sys/dev/wpi/if_wpi.c
+++ b/sys/dev/wpi/if_wpi.c
@@ -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;
diff --git a/sys/dev/wpi/if_wpireg.h b/sys/dev/wpi/if_wpireg.h
index a821bf0..0f83d0a 100644
--- a/sys/dev/wpi/if_wpireg.h
+++ b/sys/dev/wpi/if_wpireg.h
@@ -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;
OpenPOWER on IntegriCloud