From owner-svn-src-projects@FreeBSD.ORG Mon Apr 27 11:12:46 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D5291065679; Mon, 27 Apr 2009 11:12:46 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50A0E8FC43; Mon, 27 Apr 2009 11:12:46 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3RBCkZH013637; Mon, 27 Apr 2009 11:12:46 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3RBCkJj013636; Mon, 27 Apr 2009 11:12:46 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904271112.n3RBCkJj013636@svn.freebsd.org> From: Rui Paulo Date: Mon, 27 Apr 2009 11:12:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r191558 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Apr 2009 11:12:59 -0000 Author: rpaulo Date: Mon Apr 27 11:12:46 2009 New Revision: 191558 URL: http://svn.freebsd.org/changeset/base/191558 Log: Add initial code to create a MBSS. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Mon Apr 27 11:11:59 2009 (r191557) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Mon Apr 27 11:12:46 2009 (r191558) @@ -132,7 +132,7 @@ mesh_newstate(struct ieee80211vap *vap, * Already have a channel; bypass the * scan and startup immediately. */ - /* ieee80211_create_mesh(vap, vap->iv_des_chan); */ + ieee80211_create_mbss(vap, vap->iv_des_chan); break; } /* @@ -416,6 +416,52 @@ ieee80211_create_mbss(struct ieee80211va "%s: creating mbss on channel %u\n", __func__, ieee80211_chan2ieee(ic, chan)); + ni = ieee80211_alloc_node(&ic->ic_sta, vap, vap->iv_myaddr); + if (ni == NULL) { + /* XXX recovery? */ + return; + } + ni->ni_meshidlen = vap->iv_meshidlen; + memcpy(ni->ni_meshid, vap->iv_meshid, ni->ni_meshidlen); + ni->ni_intval = ic->ic_bintval; + ic->ic_bsschan = chan; + ieee80211_node_set_chan(ni, chan); + ieee80211_setcurchan(ic, ni->ni_chan); + ic->ic_curmode = ieee80211_chan2mode(chan); + /* + * Do mode-specific setup. + */ + if (IEEE80211_IS_CHAN_FULL(chan)) { + if (IEEE80211_IS_CHAN_ANYG(chan)) { + /* + * Use a mixed 11b/11g basic rate set. + */ + ieee80211_setbasicrates(&ni->ni_rates, + IEEE80211_MODE_11G); + if (vap->iv_flags & IEEE80211_F_PUREG) { + /* + * Also mark OFDM rates basic so 11b + * stations do not join (WiFi compliance). + */ + ieee80211_addbasicrates(&ni->ni_rates, + IEEE80211_MODE_11A); + } + } else if (IEEE80211_IS_CHAN_B(chan)) { + /* + * Force pure 11b rate set. + */ + ieee80211_setbasicrates(&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_wme_initparams(vap); + ieee80211_new_state(vap, IEEE80211_S_RUN, -1); } static int