svn commit: r191466 - projects/mesh11s/sys/net80211

Rui Paulo rpaulo at FreeBSD.org
Fri Apr 24 14:22:10 UTC 2009


Author: rpaulo
Date: Fri Apr 24 14:22:09 2009
New Revision: 191466
URL: http://svn.freebsd.org/changeset/base/191466

Log:
  Initial work on adding mesh ID IE on beacon construction.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  projects/mesh11s/sys/net80211/ieee80211_mesh.c
  projects/mesh11s/sys/net80211/ieee80211_mesh.h
  projects/mesh11s/sys/net80211/ieee80211_node.c
  projects/mesh11s/sys/net80211/ieee80211_output.c
  projects/mesh11s/sys/net80211/ieee80211_scan_sta.c

Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_mesh.c	Fri Apr 24 13:28:25 2009	(r191465)
+++ projects/mesh11s/sys/net80211/ieee80211_mesh.c	Fri Apr 24 14:22:09 2009	(r191466)
@@ -379,8 +379,8 @@ ieee80211_parse_meshid(struct ieee80211_
 	struct ieee80211vap *vap = ni->ni_vap;
 
 	if (vap->iv_caps & IEEE80211_C_MBSS) {
-		const struct ieee80211_meshid_ie *meshid =
-		    (const struct ieee80211_meshid_ie *)ie;
+		/*const struct ieee80211_meshid_ie *meshid =
+		    (const struct ieee80211_meshid_ie *)ie;*/
 
 		/*
 		 * Mesh STAs are QoS stations, so QoS is not optional.
@@ -389,6 +389,29 @@ ieee80211_parse_meshid(struct ieee80211_
 	}
 }
 
+/*
+ * Add a MESH ID element to a frame.
+ */
+uint8_t *
+ieee80211_add_meshid(uint8_t *frm, struct ieee80211vap *vap)
+{
+	struct ieee80211_meshid_ie ie = {
+		.id_ie	= IEEE80211_ELEMID_MESHID,
+		.id_len	= sizeof(struct ieee80211_meshid_ie) +
+		    vap->iv_meshidlen,
+	};
+
+	KASSERT(vap->iv_caps & IEEE80211_C_MBSS,
+	     ("not a mbss vap, caps 0x%x", vap->iv_caps));
+
+	memcpy(frm, &ie, sizeof(ie));
+	frm += sizeof(struct ieee80211_meshid_ie);
+	memcpy(frm, vap->iv_meshid, vap->iv_meshidlen);
+	frm += vap->iv_meshidlen;
+	
+	return frm; 
+}
+
 static int
 mesh_ioctl_get80211(struct ieee80211vap *vap, struct ieee80211req *ireq)
 {

Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_mesh.h	Fri Apr 24 13:28:25 2009	(r191465)
+++ projects/mesh11s/sys/net80211/ieee80211_mesh.h	Fri Apr 24 14:22:09 2009	(r191466)
@@ -289,8 +289,9 @@ struct ieee80211_meshact_ie {
 } __packed;
 
 
-void	ieee80211_mesh_attach(struct ieee80211com *);
-void	ieee80211_mesh_detach(struct ieee80211com *);
-void	ieee80211_parse_meshid(struct ieee80211_node *, const uint8_t *);
+void		ieee80211_mesh_attach(struct ieee80211com *);
+void		ieee80211_mesh_detach(struct ieee80211com *);
+void		ieee80211_parse_meshid(struct ieee80211_node *, const uint8_t *);
+uint8_t *	ieee80211_add_meshid(uint8_t *, struct ieee80211vap *);
 
 #endif /* !_NET80211_IEEE80211_MESH_H_ */

Modified: projects/mesh11s/sys/net80211/ieee80211_node.c
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_node.c	Fri Apr 24 13:28:25 2009	(r191465)
+++ projects/mesh11s/sys/net80211/ieee80211_node.c	Fri Apr 24 14:22:09 2009	(r191466)
@@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$");
 #include <net80211/ieee80211_tdma.h>
 #endif
 #include <net80211/ieee80211_wds.h>
+#include <net80211/ieee80211_mesh.h>
 
 #include <net/bpf.h>
 

Modified: projects/mesh11s/sys/net80211/ieee80211_output.c
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_output.c	Fri Apr 24 13:28:25 2009	(r191465)
+++ projects/mesh11s/sys/net80211/ieee80211_output.c	Fri Apr 24 14:22:09 2009	(r191466)
@@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$");
 #include <net80211/ieee80211_tdma.h>
 #endif
 #include <net80211/ieee80211_wds.h>
+#include <net80211/ieee80211_mesh.h>
 
 #ifdef INET
 #include <netinet/in.h> 
@@ -2331,6 +2332,8 @@ ieee80211_beacon_construct(struct mbuf *
 	 * XXX Vendor-specific OIDs (e.g. Atheros)
 	 *	[tlv] WPA parameters
 	 *	[tlv] WME parameters
+	 *	[tlv] MESH ID
+	 *	[tlv] MESH configuration
 	 *	[tlv] Vendor OUI HT capabilities (optional)
 	 *	[tlv] Vendor OUI HT information (optional)
 	 *	[tlv] Atheros capabilities (optional)
@@ -2441,6 +2444,9 @@ ieee80211_beacon_construct(struct mbuf *
 		bo->bo_appie_len = vap->iv_appie_beacon->ie_len;
 		frm = add_appie(frm, vap->iv_appie_beacon);
 	}
+	if (vap->iv_opmode == IEEE80211_M_MBSS) {
+		frm = ieee80211_add_meshid(frm, vap);
+	}
 	bo->bo_tim_trailer_len = frm - bo->bo_tim_trailer;
 	bo->bo_csa_trailer_len = frm - bo->bo_csa;
 	m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *);
@@ -2642,6 +2648,9 @@ ieee80211_beacon_update(struct ieee80211
 		ieee80211_tdma_update_beacon(vap, bo);
 	}
 #endif
+	if (vap->iv_opmode == IEEE80211_M_MBSS) {
+		/*ieee80211_mesh_update_beacon(vap, bo);*/
+	}
 	if (vap->iv_opmode == IEEE80211_M_HOSTAP) {	/* NB: no IBSS support*/
 		struct ieee80211_tim_ie *tie =
 			(struct ieee80211_tim_ie *) bo->bo_tim;

Modified: projects/mesh11s/sys/net80211/ieee80211_scan_sta.c
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_scan_sta.c	Fri Apr 24 13:28:25 2009	(r191465)
+++ projects/mesh11s/sys/net80211/ieee80211_scan_sta.c	Fri Apr 24 14:22:09 2009	(r191466)
@@ -992,13 +992,14 @@ match_bss(struct ieee80211vap *vap,
 #endif /* IEEE80211_SUPPORT_TDMA */
 	} else if (vap->iv_opmode == IEEE80211_M_MBSS) {
 		/*
-		 * We are only interested in finding non IBSS/ESS nodes.
+		 * Mesh nodes have IBSS & ESS bits in capinfo turned off.
 		 */
 		if (se->se_capinfo & (IEEE80211_CAPINFO_IBSS|IEEE80211_CAPINFO_ESS))
 			fail |= MATCH_CAPINFO;
 		
 		if (vap->iv_caps & IEEE80211_C_MBSS) {
-			/* TBD */
+			/*const struct ieee80211_meshid_ie *meshid =
+			    (const struct ieee80211_meshid_ie *)se->se_ies.meshid_ie;*/
 		}
 	} else {
 		if ((se->se_capinfo & IEEE80211_CAPINFO_ESS) == 0)


More information about the svn-src-projects mailing list