From owner-p4-projects@FreeBSD.ORG Sun Feb 1 14:17:27 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3BAB016A4E1; Sun, 1 Feb 2004 14:17:27 -0800 (PST) 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 F1D2E16A4DB for ; Sun, 1 Feb 2004 14:17:26 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5414543D2D for ; Sun, 1 Feb 2004 14:17:16 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i11MHG0B015829 for ; Sun, 1 Feb 2004 14:17:16 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i11MHFcQ015826 for perforce@freebsd.org; Sun, 1 Feb 2004 14:17:15 -0800 (PST) (envelope-from sam@freebsd.org) Date: Sun, 1 Feb 2004 14:17:15 -0800 (PST) Message-Id: <200402012217.i11MHFcQ015826@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 46327 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: Sun, 01 Feb 2004 22:17:27 -0000 http://perforce.freebsd.org/chv.cgi?CH=46327 Change 46327 by sam@sam_ebb on 2004/02/01 14:16:29 o correct short slot time handling: enable it only for 11g when not operating in ibss mode and when the driver says it can do it o move short slot time handling into ieee80211_reset_erp where it can be shared o move ieee80211_reset_erp call in the state machine from the transition assoc->init to run->init; it's not clear what the original patch was intended to do and/or if this reset logic is even needed Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211.c#11 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_proto.c#7 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211.c#11 (text+ko) ==== @@ -769,19 +769,20 @@ ic->ic_des_chan = IEEE80211_CHAN_ANYC; /* - * Do 11b/11g mixed-mode state setup. + * Do mode-specific rate setup. */ if (mode == IEEE80211_MODE_11G) { - /* use mixed 11b/11g rate set */ + /* + * Use a mixed 11b/11g rate set. + */ ieee80211_set11gbasicrates(&ic->ic_sup_rates[mode], IEEE80211_MODE_11G); } else if (mode == IEEE80211_MODE_11B) { - /* force pure 11b rate set */ + /* + * Force pure 11b rate set. + */ ieee80211_set11gbasicrates(&ic->ic_sup_rates[mode], IEEE80211_MODE_11B); - ic->ic_flags &= ~IEEE80211_F_SHSLOT; - } else { - ic->ic_flags &= ~IEEE80211_F_SHSLOT; } ieee80211_reset_erp(ic, mode); /* reset ERP state */ @@ -808,7 +809,17 @@ ic->ic_flags &= ~IEEE80211_F_USEPROT; ic->ic_nonerpsta = 0; ic->ic_longslotsta = 0; - if (mode == IEEE80211_MODE_11G && (ic->ic_caps & IEEE80211_C_SHSLOT)) + /* + * Short slot time is enabled only when operating in 11g + * and not in an IBSS. We must also honor whether or not + * the driver is capable of doing it. + */ + /* XXX what about auto? */ + if (mode == IEEE80211_MODE_11G && + ic->ic_opmode != IEEE80211_M_IBSS && + (ic->ic_caps & IEEE80211_C_SHSLOT)) + ic->ic_flags |= IEEE80211_F_SHSLOT; + else ic->ic_flags &= ~IEEE80211_F_SHSLOT; /* * Set short preamble and ERP barker-preamble flags. ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_proto.c#7 (text+ko) ==== @@ -347,8 +347,13 @@ ic->ic_longslotsta--; if (ic->ic_longslotsta == 0 && ic->ic_curmode == IEEE80211_MODE_11G) { - /* XXX check capability */ - ic->ic_flags |= IEEE80211_F_SHSLOT; + /* + * Re-enable use of short slot time if supported + * and not operating in IBSS mode (per spec). + */ + if ((ic->ic_caps & IEEE80211_C_SHSLOT) && + ic->ic_opmode != IEEE80211_M_IBSS) + ic->ic_flags |= IEEE80211_F_SHSLOT; } } /* @@ -403,6 +408,7 @@ IEEE80211_REASON_ASSOC_LEAVE); } IEEE80211_NODE_UNLOCK(ic); + ieee80211_reset_erp(ic, ic->ic_curmode); break; default: break; @@ -423,8 +429,6 @@ IEEE80211_REASON_AUTH_LEAVE); } IEEE80211_NODE_UNLOCK(ic); - /* XXX??? */ - ieee80211_reset_erp(ic, ic->ic_curmode); break; default: break;