From owner-p4-projects@FreeBSD.ORG Sun Nov 14 06:17:45 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 65E4516A4D1; Sun, 14 Nov 2004 06:17:45 +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 433C416A4CE for ; Sun, 14 Nov 2004 06:17:45 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1A70643D49 for ; Sun, 14 Nov 2004 06:17:45 +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 iAE6Hi3n058411 for ; Sun, 14 Nov 2004 06:17:45 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id iAE6Hi0q058408 for perforce@freebsd.org; Sun, 14 Nov 2004 06:17:44 GMT (envelope-from sam@freebsd.org) Date: Sun, 14 Nov 2004 06:17:44 GMT Message-Id: <200411140617.iAE6Hi0q058408@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 65080 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, 14 Nov 2004 06:17:46 -0000 http://perforce.freebsd.org/chv.cgi?CH=65080 Change 65080 by sam@sam_ebb on 2004/11/14 06:17:12 Correct ibss setup: o set current operating mode when starting up so 11g operating parameters are set correctly o setup the basic rates when operating in 11g or 11b o setup ERP operation properly While here cleanup some harmless cruft (like not marking SIBSS when operating in hostap mode). Affected files ... .. //depot/projects/wifi/sys/net80211/ieee80211_node.c#15 edit Differences ... ==== //depot/projects/wifi/sys/net80211/ieee80211_node.c#15 (text+ko) ==== @@ -366,26 +366,52 @@ } ni = ic->ic_bss; - ic->ic_flags |= IEEE80211_F_SIBSS; - ieee80211_set_chan(ic, ni, chan); IEEE80211_ADDR_COPY(ni->ni_macaddr, ic->ic_myaddr); IEEE80211_ADDR_COPY(ni->ni_bssid, ic->ic_myaddr); - if (ic->ic_opmode == IEEE80211_M_IBSS) - ni->ni_bssid[0] |= 0x02; /* local bit for IBSS */ ni->ni_esslen = ic->ic_des_esslen; memcpy(ni->ni_essid, ic->ic_des_essid, ni->ni_esslen); ni->ni_rssi = 0; ni->ni_rstamp = 0; ni->ni_tstamp.tsf = 0; ni->ni_intval = ic->ic_lintval; - ni->ni_capinfo = IEEE80211_CAPINFO_IBSS; + ni->ni_capinfo = 0; + ni->ni_erp = 0; if (ic->ic_flags & IEEE80211_F_PRIVACY) ni->ni_capinfo |= IEEE80211_CAPINFO_PRIVACY; if (ic->ic_phytype == IEEE80211_T_FH) { ni->ni_fhdwell = 200; /* XXX */ ni->ni_fhindex = 1; } - ni->ni_erp = 0; + if (ic->ic_opmode == IEEE80211_M_IBSS) { + ic->ic_flags |= IEEE80211_F_SIBSS; + ni->ni_capinfo |= IEEE80211_CAPINFO_IBSS; /* XXX */ + ni->ni_bssid[0] |= 0x02; /* local bit for IBSS */ + } + /* + * Fix the channel and related attributes. + */ + ieee80211_set_chan(ic, ni, chan); + ic->ic_curmode = ieee80211_chan2mode(ic, chan); + /* + * Do mode-specific rate setup. + */ + if (ic->ic_curmode == IEEE80211_MODE_11G) { + /* + * Use a mixed 11b/11g rate set. + */ + ieee80211_set11gbasicrates(&ni->ni_rates, IEEE80211_MODE_11G); + } else if (ic->ic_curmode == IEEE80211_MODE_11B) { + /* + * Force pure 11b rate set. + */ + ieee80211_set11gbasicrates(&ni->ni_rates, IEEE80211_MODE_11B); + } + /* + * Set the erp state (mostly the slot time) to deal with + * the auto-select case; this should be redundant if the + * mode is locked. + */ + ieee80211_reset_erp(ic); ieee80211_new_state(ic, IEEE80211_S_RUN, -1); }