From owner-p4-projects@FreeBSD.ORG Fri Nov 12 00:40:12 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EF7A916A4D1; Fri, 12 Nov 2004 00:40:11 +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 CA7F216A4CE for ; Fri, 12 Nov 2004 00:40:11 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AB7C543D3F for ; Fri, 12 Nov 2004 00:40:11 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id iAC0eBgM052864 for ; Fri, 12 Nov 2004 00:40:11 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id iAC0eBtb052861 for perforce@freebsd.org; Fri, 12 Nov 2004 00:40:11 GMT (envelope-from sam@freebsd.org) Date: Fri, 12 Nov 2004 00:40:11 GMT Message-Id: <200411120040.iAC0eBtb052861@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 64925 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: Fri, 12 Nov 2004 00:40:12 -0000 http://perforce.freebsd.org/chv.cgi?CH=64925 Change 64925 by sam@sam_ebb on 2004/11/12 00:39:26 code shuffle; move erp code together in protocol area Affected files ... .. //depot/projects/wifi/sys/net80211/ieee80211.c#6 edit .. //depot/projects/wifi/sys/net80211/ieee80211_node.c#12 edit .. //depot/projects/wifi/sys/net80211/ieee80211_node.h#9 edit .. //depot/projects/wifi/sys/net80211/ieee80211_proto.c#5 edit .. //depot/projects/wifi/sys/net80211/ieee80211_proto.h#4 edit .. //depot/projects/wifi/sys/net80211/ieee80211_var.h#8 edit Differences ... ==== //depot/projects/wifi/sys/net80211/ieee80211.c#6 (text+ko) ==== @@ -833,38 +833,6 @@ } /* - * Reset 11g-related state. - */ -void -ieee80211_reset_erp(struct ieee80211com *ic) -{ - ic->ic_flags &= ~IEEE80211_F_USEPROT; - ic->ic_nonerpsta = 0; - ic->ic_longslotsta = 0; - /* - * 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. - */ - ieee80211_set_shortslottime(ic, - ic->ic_curmode == IEEE80211_MODE_11A || - (ic->ic_curmode == IEEE80211_MODE_11G && - ic->ic_opmode == IEEE80211_M_HOSTAP && - (ic->ic_caps & IEEE80211_C_SHSLOT))); - /* - * Set short preamble and ERP barker-preamble flags. - */ - if (ic->ic_curmode == IEEE80211_MODE_11A || - (ic->ic_caps & IEEE80211_C_SHPREAMBLE)) { - ic->ic_flags |= IEEE80211_F_SHPREAMBLE; - ic->ic_flags &= ~IEEE80211_F_USEBARKER; - } else { - ic->ic_flags &= ~IEEE80211_F_SHPREAMBLE; - ic->ic_flags |= IEEE80211_F_USEBARKER; - } -} - -/* * Return the phy mode for with the specified channel so the * caller can select a rate set. This is problematic for channels * where multiple operating modes are possible (e.g. 11g+11b). ==== //depot/projects/wifi/sys/net80211/ieee80211_node.c#12 (text+ko) ==== @@ -1553,21 +1553,6 @@ ieee80211_free_node(ni); } -/* - * Set the short slot time state and notify the driver. - */ -void -ieee80211_set_shortslottime(struct ieee80211com *ic, int onoff) -{ - if (onoff) - ic->ic_flags |= IEEE80211_F_SHSLOT; - else - ic->ic_flags &= ~IEEE80211_F_SHSLOT; - /* notify driver */ - if (ic->ic_updateslot != NULL) - ic->ic_updateslot(ic->ic_ifp); -} - u_int8_t ieee80211_getrssi(struct ieee80211com *ic) { ==== //depot/projects/wifi/sys/net80211/ieee80211_node.h#9 (text+ko) ==== @@ -300,6 +300,5 @@ struct ieee80211_node *, int); extern void ieee80211_node_leave(struct ieee80211com *, struct ieee80211_node *); -extern void ieee80211_set_shortslottime(struct ieee80211com *, int onoff); extern u_int8_t ieee80211_getrssi(struct ieee80211com *ic); #endif /* _NET80211_IEEE80211_NODE_H_ */ ==== //depot/projects/wifi/sys/net80211/ieee80211_proto.c#5 (text+ko) ==== @@ -405,6 +405,53 @@ } /* + * Reset 11g-related state. + */ +void +ieee80211_reset_erp(struct ieee80211com *ic) +{ + ic->ic_flags &= ~IEEE80211_F_USEPROT; + ic->ic_nonerpsta = 0; + ic->ic_longslotsta = 0; + /* + * 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. + */ + ieee80211_set_shortslottime(ic, + ic->ic_curmode == IEEE80211_MODE_11A || + (ic->ic_curmode == IEEE80211_MODE_11G && + ic->ic_opmode == IEEE80211_M_HOSTAP && + (ic->ic_caps & IEEE80211_C_SHSLOT))); + /* + * Set short preamble and ERP barker-preamble flags. + */ + if (ic->ic_curmode == IEEE80211_MODE_11A || + (ic->ic_caps & IEEE80211_C_SHPREAMBLE)) { + ic->ic_flags |= IEEE80211_F_SHPREAMBLE; + ic->ic_flags &= ~IEEE80211_F_USEBARKER; + } else { + ic->ic_flags &= ~IEEE80211_F_SHPREAMBLE; + ic->ic_flags |= IEEE80211_F_USEBARKER; + } +} + +/* + * Set the short slot time state and notify the driver. + */ +void +ieee80211_set_shortslottime(struct ieee80211com *ic, int onoff) +{ + if (onoff) + ic->ic_flags |= IEEE80211_F_SHSLOT; + else + ic->ic_flags &= ~IEEE80211_F_SHSLOT; + /* notify driver */ + if (ic->ic_updateslot != NULL) + ic->ic_updateslot(ic->ic_ifp); +} + +/* * Check if the specified rate set supports ERP. * NB: the rate set is assumed to be sorted. */ ==== //depot/projects/wifi/sys/net80211/ieee80211_proto.h#4 (text+ko) ==== @@ -67,6 +67,9 @@ extern void ieee80211_pwrsave(struct ieee80211com *, struct ieee80211_node *, struct mbuf *); +extern void ieee80211_reset_erp(struct ieee80211com *); +extern void ieee80211_set_shortslottime(struct ieee80211com *, int onoff); + /* * Return the size of the 802.11 header for a management or data frame. */ ==== //depot/projects/wifi/sys/net80211/ieee80211_var.h#8 (text+ko) ==== @@ -356,7 +356,6 @@ u_int ieee80211_chan2ieee(struct ieee80211com *, struct ieee80211_channel *); u_int ieee80211_ieee2mhz(u_int, u_int); int ieee80211_setmode(struct ieee80211com *, enum ieee80211_phymode); -void ieee80211_reset_erp(struct ieee80211com *); enum ieee80211_phymode ieee80211_chan2mode(struct ieee80211com *, struct ieee80211_channel *);