Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Apr 2009 11:12:46 +0000 (UTC)
From:      Rui Paulo <rpaulo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r191558 - projects/mesh11s/sys/net80211
Message-ID:  <200904271112.n3RBCkJj013636@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904271112.n3RBCkJj013636>