From owner-p4-projects@FreeBSD.ORG Tue Feb 19 00:35:08 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 96C5C16A469; Tue, 19 Feb 2008 00:35:08 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C7FA16A421 for ; Tue, 19 Feb 2008 00:35:08 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 5270113C45E for ; Tue, 19 Feb 2008 00:35:08 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m1J0Z8Ds008185 for ; Tue, 19 Feb 2008 00:35:08 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m1J0Z868008182 for perforce@freebsd.org; Tue, 19 Feb 2008 00:35:08 GMT (envelope-from sam@freebsd.org) Date: Tue, 19 Feb 2008 00:35:08 GMT Message-Id: <200802190035.m1J0Z868008182@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 Cc: Subject: PERFORCE change 135690 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2008 00:35:08 -0000 http://perforce.freebsd.org/chv.cgi?CH=135690 Change 135690 by sam@sam_ebb on 2008/02/19 00:34:40 Change beacon miss handling to dispatch the event only to sta vap's in RUN state instead of checking in the handler. Affected files ... .. //depot/projects/vap/sys/net80211/ieee80211_proto.c#21 edit .. //depot/projects/vap/sys/net80211/ieee80211_sta.c#5 edit Differences ... ==== //depot/projects/vap/sys/net80211/ieee80211_proto.c#21 (text+ko) ==== @@ -1276,13 +1276,21 @@ void ieee80211_beacon_miss(struct ieee80211com *ic) { - if ((ic->ic_flags & IEEE80211_F_SCAN) == 0) { - struct ieee80211vap *vap; + struct ieee80211vap *vap; - /* XXX locking */ - TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) - if (vap->iv_bmiss != NULL) - vap->iv_bmiss(vap); + if (ic->ic_flags & IEEE80211_F_SCAN) + return; + /* XXX locking */ + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { + /* + * We only pass events through for sta vap's in RUN state; + * may be too restrictive but for now this saves all the + * handlers duplicating these checks. + */ + if (vap->iv_opmode == IEEE80211_M_STA && + vap->iv_state == IEEE80211_S_RUN && + vap->iv_bmiss != NULL) + vap->iv_bmiss(vap); } } ==== //depot/projects/vap/sys/net80211/ieee80211_sta.c#5 (text+ko) ==== @@ -94,26 +94,24 @@ vap->iv_bmiss = sta_beacon_miss; } +/* + * Handle a beacon miss event. The common code filters out + * spurious events that can happen when scanning and/or before + * reaching RUN state. + */ static void sta_beacon_miss(struct ieee80211vap *vap) { struct ieee80211com *ic = vap->iv_ic; - if (ic->ic_flags & IEEE80211_F_SCAN) { - /* XXX check ic_curchan != ic_bsschan? */ - return; - } + KASSERT((ic->ic_flags & IEEE80211_F_SCAN) == 0, ("scanning")); + KASSERT(vap->iv_state == IEEE80211_S_RUN, + ("wrong state %d", vap->iv_state)); + IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE | IEEE80211_MSG_DEBUG, "beacon miss, mode %u state %s\n", vap->iv_opmode, ieee80211_state_name[vap->iv_state]); - /* - * 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 (vap->iv_state < IEEE80211_S_RUN) - return; if (++vap->iv_bmiss_count < vap->iv_bmiss_max) { /*