From owner-p4-projects@FreeBSD.ORG Sat Jan 12 23:52:52 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7F5B716A468; Sat, 12 Jan 2008 23:52:52 +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 4458A16A41A for ; Sat, 12 Jan 2008 23:52:52 +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 C4B7E13C455 for ; Sat, 12 Jan 2008 23:52:51 +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 m0CNqpj6051742 for ; Sat, 12 Jan 2008 23:52:51 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m0CNqpcE051739 for perforce@freebsd.org; Sat, 12 Jan 2008 23:52:51 GMT (envelope-from sam@freebsd.org) Date: Sat, 12 Jan 2008 23:52:51 GMT Message-Id: <200801122352.m0CNqpcE051739@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 133143 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: Sat, 12 Jan 2008 23:52:52 -0000 http://perforce.freebsd.org/chv.cgi?CH=133143 Change 133143 by sam@sam_ebb on 2008/01/12 23:52:33 fix handling of multiple vaps pending in CAC: we don't handle this directly in ieee80211_new_state_locked (as for SCAN) so we must explicitly walk the vap list; hide the details in a new ieee80211_cac_completeswitch (a la ieee80211_csa_completeswitch) Affected files ... .. //depot/projects/vap/sys/net80211/ieee80211_dfs.c#3 edit .. //depot/projects/vap/sys/net80211/ieee80211_proto.c#18 edit .. //depot/projects/vap/sys/net80211/ieee80211_proto.h#12 edit Differences ... ==== //depot/projects/vap/sys/net80211/ieee80211_dfs.c#3 (text+ko) ==== @@ -134,7 +134,7 @@ } ieee80211_notify_cac(ic, ic->ic_curchan, IEEE80211_NOTIFY_CAC_EXPIRE); - ieee80211_new_state(vap, IEEE80211_S_RUN, 0); + ieee80211_cac_completeswitch(vap); } } ==== //depot/projects/vap/sys/net80211/ieee80211_proto.c#18 (text+ko) ==== @@ -1367,6 +1367,31 @@ } /* + * Complete a DFS CAC started by ieee80211_dfs_cac_start. + * We clear state and move all vap's in CAC state to RUN state. + */ +void +ieee80211_cac_completeswitch(struct ieee80211vap *vap0) +{ + struct ieee80211com *ic = vap0->iv_ic; + struct ieee80211vap *vap; + + IEEE80211_LOCK(ic); + /* + * Complete CAC state change for lead vap first; then + * clock all the other vap's waiting. + */ + KASSERT(vap0->iv_state == IEEE80211_S_CAC, + ("wrong state %d", vap0->iv_state)); + ieee80211_new_state_locked(vap0, IEEE80211_S_RUN, 0); + + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) + if (vap->iv_state == IEEE80211_S_CAC) + ieee80211_new_state_locked(vap, IEEE80211_S_RUN, 0); + IEEE80211_UNLOCK(ic); +} + +/* * Force all vap's other than the specified vap to the INIT state * and mark them as waiting for a scan to complete. These vaps * will be brought up when the scan completes and the scanning vap ==== //depot/projects/vap/sys/net80211/ieee80211_proto.h#12 (text+ko) ==== @@ -320,6 +320,7 @@ void ieee80211_csa_startswitch(struct ieee80211com *, struct ieee80211_channel *, int mode, int count); void ieee80211_csa_completeswitch(struct ieee80211com *); +void ieee80211_cac_completeswitch(struct ieee80211vap *); /* * Notification methods called from the 802.11 state machine.