From 366cfd8d28aec72aa15f64903338772c9ca31892 Mon Sep 17 00:00:00 2001 From: mtaylor Date: Wed, 9 Apr 2008 23:25:04 +0000 Subject: [PATCH] Enable roaming. Fix another jiffies comparison bug. git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3500 0192ed92-7a03-0410-a25b-9323aeb14dbd --- net80211/ieee80211_scan_sta.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/net80211/ieee80211_scan_sta.c b/net80211/ieee80211_scan_sta.c index 69e5ca4..3ff3d50 100644 --- a/net80211/ieee80211_scan_sta.c +++ b/net80211/ieee80211_scan_sta.c @@ -293,7 +293,8 @@ found: saveie(&ise->se_ath_ie, sp->ath); /* clear failure count after STA_FAIL_AGE passes */ - if (se->se_fails && (jiffies - se->se_lastfail) > STA_FAILS_AGE*HZ) { + if (se->se_fails && + time_after(jiffies, se->se_lastfail + (STA_FAILS_AGE * HZ))) { se->se_fails = 0; IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_SCAN, macaddr, "%s: fails %u", __func__, se->se_fails); @@ -1067,8 +1068,8 @@ sta_age(struct ieee80211_scan_state *ss) */ KASSERT(vap->iv_opmode == IEEE80211_M_STA, ("wrong mode %u", vap->iv_opmode)); - /* XXX turn this off until the ap release is cut */ - if (0 && vap->iv_ic->ic_roaming == IEEE80211_ROAMING_AUTO && + if (vap->iv_opmode == IEEE80211_M_STA && + vap->iv_ic->ic_roaming == IEEE80211_ROAMING_AUTO && vap->iv_state >= IEEE80211_S_RUN) /* XXX vap is implicit */ sta_roam_check(ss, vap); @@ -1123,6 +1124,9 @@ sta_assoc_fail(struct ieee80211_scan_state *ss, struct sta_table *st = ss->ss_priv; struct sta_entry *se; + if (ss->ss_vap->iv_ic->ic_roaming == IEEE80211_ROAMING_MANUAL) + return; + se = sta_lookup(st, macaddr); if (se != NULL) { se->se_fails++; -- 2.35.1