summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_proto.c
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2005-12-12 18:04:44 +0000
committersam <sam@FreeBSD.org>2005-12-12 18:04:44 +0000
commit2911d079c2167e81ddbbf13a22438cb4afd104c9 (patch)
tree50d32d0fd45915775843eb2f2fa292bef499e8a2 /sys/net80211/ieee80211_proto.c
parent8c5ce57de47aee09b1f0055747544c25e39f41e5 (diff)
downloadFreeBSD-src-2911d079c2167e81ddbbf13a22438cb4afd104c9.zip
FreeBSD-src-2911d079c2167e81ddbbf13a22438cb4afd104c9.tar.gz
Add ieee80211_beacon_miss for processing sta mode beacon miss events
in the 802.11 layer: we send a directed probe request frame to the current ap bmiss_max times (w/o answer) before scanning for a new ap. MFC after: 2 weeks
Diffstat (limited to 'sys/net80211/ieee80211_proto.c')
-rw-r--r--sys/net80211/ieee80211_proto.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c
index 8f3abd8..f7834f9 100644
--- a/sys/net80211/ieee80211_proto.c
+++ b/sys/net80211/ieee80211_proto.c
@@ -97,6 +97,7 @@ ieee80211_proto_attach(struct ieee80211com *ic)
ic->ic_rtsthreshold = IEEE80211_RTS_DEFAULT;
ic->ic_fragthreshold = IEEE80211_FRAG_DEFAULT;
ic->ic_fixed_rate = IEEE80211_FIXED_RATE_NONE;
+ ic->ic_bmiss_max = IEEE80211_BMISS_MAX;
ic->ic_mcast_rate = IEEE80211_MCAST_RATE_DEFAULT;
ic->ic_protmode = IEEE80211_PROT_CTSONLY;
ic->ic_roaming = IEEE80211_ROAMING_AUTO;
@@ -817,6 +818,43 @@ ieee80211_wme_updateparams(struct ieee80211com *ic)
}
}
+void
+ieee80211_beacon_miss(struct ieee80211com *ic)
+{
+
+ if (ic->ic_flags & IEEE80211_F_SCAN) {
+ /* XXX check ic_curchan != ic_bsschan? */
+ return;
+ }
+ IEEE80211_DPRINTF(ic,
+ IEEE80211_MSG_STATE | IEEE80211_MSG_DEBUG,
+ "%s\n", "beacon miss");
+
+ /*
+ * Our handling is only meaningful for stations that are
+ * associated; any other conditions else will be handled
+ * through different means (e.g. the tx timeout on mgt frames).
+ */
+ if (ic->ic_opmode != IEEE80211_M_STA || ic->ic_state != IEEE80211_S_RUN)
+ return;
+
+ if (++ic->ic_bmiss_count < ic->ic_bmiss_max) {
+ /*
+ * Send a directed probe req before falling back to a scan;
+ * if we receive a response ic_bmiss_count will be reset.
+ * Some cards mistakenly report beacon miss so this avoids
+ * the expensive scan if the ap is still there.
+ */
+ ieee80211_send_probereq(ic->ic_bss, ic->ic_myaddr,
+ ic->ic_bss->ni_bssid, ic->ic_bss->ni_bssid,
+ ic->ic_bss->ni_essid, ic->ic_bss->ni_esslen,
+ ic->ic_opt_ie, ic->ic_opt_ie_len);
+ return;
+ }
+ ic->ic_bmiss_count = 0;
+ ieee80211_new_state(ic, IEEE80211_S_SCAN, 0);
+}
+
static void
sta_disassoc(void *arg, struct ieee80211_node *ni)
{
OpenPOWER on IntegriCloud