summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2007-09-10 18:14:56 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2007-09-10 18:14:56 +0000
commitf9bdf407d1c2a9694df07c9cf1d03a399b8d3c7e (patch)
treee7bfb4830a088fba5f93dfcffdf6dd09a34c611d
parentf436a7aa46be3fa4dcf4c6f4c0b74f99732428c5 (diff)
if more than 5 consecutive beacons are lost, reinitialize sensitivity
state machine.
-rw-r--r--sys/dev/pci/if_iwn.c17
-rw-r--r--sys/dev/pci/if_iwnreg.h11
2 files changed, 26 insertions, 2 deletions
diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c
index a15bf5546e6..56c62ca05ff 100644
--- a/sys/dev/pci/if_iwn.c
+++ b/sys/dev/pci/if_iwn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwn.c,v 1.7 2007/09/10 17:55:48 damien Exp $ */
+/* $OpenBSD: if_iwn.c,v 1.8 2007/09/10 18:14:55 damien Exp $ */
/*-
* Copyright (c) 2007
@@ -1488,6 +1488,21 @@ iwn_notif_intr(struct iwn_softc *sc)
iwn_rx_statistics(sc, desc);
break;
+ case IWN_BEACON_MISSED:
+ {
+ struct iwn_beacon_missed *miss =
+ (struct iwn_beacon_missed *)(desc + 1);
+ /*
+ * If more than 5 consecutive beacons are missed,
+ * reinitialize the sensitivity state machine.
+ */
+ DPRINTFN(2, ("beacons missed %d/%d\n",
+ letoh32(miss->consecutive), letoh32(miss->total)));
+ if (ic->ic_state == IEEE80211_S_RUN &&
+ letoh32(miss->consecutive) > 5)
+ (void)iwn_init_sensitivity(sc);
+ break;
+ }
case IWN_UC_READY:
{
struct iwn_ucode_info *uc =
diff --git a/sys/dev/pci/if_iwnreg.h b/sys/dev/pci/if_iwnreg.h
index 6cb0592fef5..4954b63e539 100644
--- a/sys/dev/pci/if_iwnreg.h
+++ b/sys/dev/pci/if_iwnreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwnreg.h,v 1.4 2007/09/10 17:54:50 damien Exp $ */
+/* $OpenBSD: if_iwnreg.h,v 1.5 2007/09/10 18:14:55 damien Exp $ */
/*-
* Copyright (c) 2007
@@ -216,6 +216,7 @@ struct iwn_rx_desc {
#define IWN_RX_STATISTICS 156
#define IWN_BEACON_STATISTICS 157
#define IWN_STATE_CHANGED 161
+#define IWN_BEACON_MISSED 162
#define IWN_AMPDU_RX_START 192
#define IWN_AMPDU_RX_DONE 193
#define IWN_RX_DONE 195
@@ -622,6 +623,14 @@ struct iwn_tx_stat {
uint32_t status;
} __packed;
+/* structure for IWN_BEACON_MISSED notification */
+struct iwn_beacon_missed {
+ uint32_t consecutive;
+ uint32_t total;
+ uint32_t expected;
+ uint32_t received;
+} __packed;
+
/* structure for IWN_AMPDU_RX_DONE notification */
struct iwn_rx_ampdu {
uint16_t len;