From owner-p4-projects@FreeBSD.ORG Sat Dec 11 00:26:02 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D701716A4D0; Sat, 11 Dec 2004 00:26:01 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 93D1E16A4CE for ; Sat, 11 Dec 2004 00:26:01 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7685C43D2D for ; Sat, 11 Dec 2004 00:26:01 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id iBB0Q1QO002445 for ; Sat, 11 Dec 2004 00:26:01 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id iBB0Q1QQ002442 for perforce@freebsd.org; Sat, 11 Dec 2004 00:26:01 GMT (envelope-from sam@freebsd.org) Date: Sat, 11 Dec 2004 00:26:01 GMT Message-Id: <200412110026.iBB0Q1QQ002442@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 66796 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Dec 2004 00:26:02 -0000 http://perforce.freebsd.org/chv.cgi?CH=66796 Change 66796 by sam@sam_ebb on 2004/12/11 00:25:52 fixup inactivity timers: o ic_inact_auth is a bad name, it's the inactivity threshold for being associated but not authorized; use it that way o reset ni_inact when switching inactivity thresholds to minimize the race against the timer (don't want to lock for this stuff) o change the inactivity probe threshold from a one-shot to cover a range: when below this threshold but not expired send a probe each inactivity interval; should probably guard against the interval being turned way down as this could cause us to spam the net with probes also: o emit identical debug msg for station join in ap mode as printed for station associate in sta mode (i.e. show slot time, preamble, QoS, etc). Affected files ... .. //depot/projects/wifi/sys/net80211/ieee80211_input.c#29 edit .. //depot/projects/wifi/sys/net80211/ieee80211_node.c#27 edit Differences ... ==== //depot/projects/wifi/sys/net80211/ieee80211_input.c#29 (text+ko) ==== @@ -878,7 +878,6 @@ return; } else (void) ieee80211_ref_node(ni); - ni->ni_inact_reload = ic->ic_inact_auth; IEEE80211_SEND_MGMT(ic, ni, IEEE80211_FC0_SUBTYPE_AUTH, seq + 1); IEEE80211_DPRINTF(ic, IEEE80211_MSG_DEBUG | IEEE80211_MSG_AUTH, @@ -1070,7 +1069,6 @@ estatus = IEEE80211_STATUS_CHALLENGE; goto bad; } - ni->ni_inact_reload = ic->ic_inact_auth; IEEE80211_DPRINTF(ic, IEEE80211_MSG_DEBUG | IEEE80211_MSG_AUTH, "[%s] station authenticated (shared key)\n", ==== //depot/projects/wifi/sys/net80211/ieee80211_node.c#27 (text+ko) ==== @@ -198,6 +198,7 @@ ieee80211_node_authorize(struct ieee80211com *ic, struct ieee80211_node *ni) { ni->ni_flags |= IEEE80211_NODE_AUTH; + ni->ni_inact_reload = ic->ic_inact_run; } void @@ -907,7 +908,8 @@ ni->ni_authmode = IEEE80211_AUTH_OPEN; ni->ni_txpower = ic->ic_txpowlimit; /* max power */ ieee80211_crypto_resetkey(ic, &ni->ni_ucastkey, IEEE80211_KEYIX_NONE); - ni->ni_inact = ni->ni_inact_reload = nt->nt_inact_init; + ni->ni_inact_reload = nt->nt_inact_init; + ni->ni_inact = ni->ni_inact_reload; IEEE80211_NODE_SAVEQ_INIT(ni, "unknown"); IEEE80211_NODE_LOCK(nt); @@ -1407,7 +1409,8 @@ * universally supported by drivers (need it * for ps-poll support so it should be...). */ - if (ni->ni_inact == ic->ic_inact_probe) { + if (0 < ni->ni_inact && + ni->ni_inact <= ic->ic_inact_probe) { IEEE80211_DPRINTF(ic, IEEE80211_MSG_NODE, "[%s] probe station due to inactivity\n", ether_sprintf(ni->ni_macaddr)); @@ -1602,14 +1605,20 @@ newassoc = 0; IEEE80211_DPRINTF(ic, IEEE80211_MSG_ASSOC | IEEE80211_MSG_DEBUG, - "[%s] station %s associated at aid %d\n", - ether_sprintf(ni->ni_macaddr), newassoc ? "newly" : "already", - IEEE80211_NODE_AID(ni)); + "[%s] station %sassociated at aid %d: %s preamble, %s slot time%s%s\n", + ether_sprintf(ni->ni_macaddr), newassoc ? "" : "re", + IEEE80211_NODE_AID(ni), + ic->ic_flags & IEEE80211_F_SHPREAMBLE ? "short" : "long", + ic->ic_flags & IEEE80211_F_SHSLOT ? "short" : "long", + ic->ic_flags & IEEE80211_F_USEPROT ? ", protection" : "", + ni->ni_flags & IEEE80211_NODE_QOS ? ", QoS" : "" + ); /* give driver a chance to setup state like ni_txrate */ if (ic->ic_newassoc) ic->ic_newassoc(ic, ni, newassoc); - ni->ni_inact_reload = ic->ic_inact_run; + ni->ni_inact_reload = ic->ic_inact_auth; + ni->ni_inact = ni->ni_inact_reload; IEEE80211_SEND_MGMT(ic, ni, resp, IEEE80211_STATUS_SUCCESS); /* tell the authenticator about new station */ if (ic->ic_auth->ia_node_join != NULL)