svn commit: r195577 - in projects/mesh11s/sys: conf net80211

Sam Leffler sam at FreeBSD.org
Fri Jul 10 18:35:12 UTC 2009


Author: sam
Date: Fri Jul 10 18:35:11 2009
New Revision: 195577
URL: http://svn.freebsd.org/changeset/base/195577

Log:
  add IEEE80211_SUPPORT_MESH knob to control inclusion of mesh support

Modified:
  projects/mesh11s/sys/conf/files
  projects/mesh11s/sys/conf/options
  projects/mesh11s/sys/net80211/ieee80211.c
  projects/mesh11s/sys/net80211/ieee80211_ddb.c
  projects/mesh11s/sys/net80211/ieee80211_input.c
  projects/mesh11s/sys/net80211/ieee80211_node.c
  projects/mesh11s/sys/net80211/ieee80211_output.c
  projects/mesh11s/sys/net80211/ieee80211_proto.c
  projects/mesh11s/sys/net80211/ieee80211_scan_sta.c

Modified: projects/mesh11s/sys/conf/files
==============================================================================
--- projects/mesh11s/sys/conf/files	Fri Jul 10 18:34:19 2009	(r195576)
+++ projects/mesh11s/sys/conf/files	Fri Jul 10 18:35:11 2009	(r195577)
@@ -2246,10 +2246,10 @@ net80211/ieee80211_dfs.c	optional wlan
 net80211/ieee80211_freebsd.c	optional wlan
 net80211/ieee80211_hostap.c	optional wlan
 net80211/ieee80211_ht.c		optional wlan
-net80211/ieee80211_hwmp.c	optional wlan
+net80211/ieee80211_hwmp.c	optional wlan ieee80211_support_mesh
 net80211/ieee80211_input.c	optional wlan
 net80211/ieee80211_ioctl.c	optional wlan
-net80211/ieee80211_mesh.c	optional wlan
+net80211/ieee80211_mesh.c	optional wlan ieee80211_support_mesh
 net80211/ieee80211_monitor.c	optional wlan
 net80211/ieee80211_node.c	optional wlan
 net80211/ieee80211_output.c	optional wlan

Modified: projects/mesh11s/sys/conf/options
==============================================================================
--- projects/mesh11s/sys/conf/options	Fri Jul 10 18:34:19 2009	(r195576)
+++ projects/mesh11s/sys/conf/options	Fri Jul 10 18:35:11 2009	(r195577)
@@ -804,6 +804,7 @@ INTR_FILTER
 IEEE80211_DEBUG		opt_wlan.h
 IEEE80211_DEBUG_REFCNT	opt_wlan.h
 IEEE80211_AMPDU_AGE	opt_wlan.h
+IEEE80211_SUPPORT_MESH	opt_wlan.h
 IEEE80211_SUPPORT_SUPERG	opt_wlan.h
 IEEE80211_SUPPORT_TDMA	opt_wlan.h
 

Modified: projects/mesh11s/sys/net80211/ieee80211.c
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211.c	Fri Jul 10 18:34:19 2009	(r195576)
+++ projects/mesh11s/sys/net80211/ieee80211.c	Fri Jul 10 18:35:11 2009	(r195577)
@@ -74,7 +74,9 @@ const int ieee80211_opcap[IEEE80211_OPMO
 	[IEEE80211_M_AHDEMO]	= IEEE80211_C_AHDEMO,
 	[IEEE80211_M_HOSTAP]	= IEEE80211_C_HOSTAP,
 	[IEEE80211_M_MONITOR]	= IEEE80211_C_MONITOR,
+#ifdef IEEE80211_SUPPORT_MBSS
 	[IEEE80211_M_MBSS]	= IEEE80211_C_MBSS,
+#endif
 };
 
 static const uint8_t ieee80211broadcastaddr[IEEE80211_ADDR_LEN] =

Modified: projects/mesh11s/sys/net80211/ieee80211_ddb.c
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_ddb.c	Fri Jul 10 18:34:19 2009	(r195576)
+++ projects/mesh11s/sys/net80211/ieee80211_ddb.c	Fri Jul 10 18:35:11 2009	(r195577)
@@ -50,7 +50,9 @@ __FBSDID("$FreeBSD$");
 #ifdef IEEE80211_SUPPORT_TDMA
 #include <net80211/ieee80211_tdma.h>
 #endif
+#ifdef IEEE80211_SUPPORT_MESH
 #include <net80211/ieee80211_mesh.h>
+#endif
 
 #include <ddb/ddb.h>
 #include <ddb/db_sym.h>
@@ -78,7 +80,9 @@ static void _db_show_txparams(const char
 	const struct ieee80211_txparam *tp);
 static void _db_show_ageq(const char *tag, const struct ieee80211_ageq *q);
 static void _db_show_stats(const struct ieee80211_stats *);
+#ifdef IEEE80211_SUPPORT_MESH
 static void _db_show_mesh(const struct ieee80211_mesh_state *);
+#endif
 
 DB_SHOW_COMMAND(sta, db_show_sta)
 {
@@ -181,6 +185,7 @@ DB_SHOW_ALL_COMMAND(vaps, db_show_all_va
 	}
 }
 
+#ifdef IEEE80211_SUPPORT_MESH
 DB_SHOW_ALL_COMMAND(mesh, db_show_mesh)
 {
 	const struct ieee80211_mesh_state *ms;
@@ -192,6 +197,7 @@ DB_SHOW_ALL_COMMAND(mesh, db_show_mesh)
 	ms = (const struct ieee80211_mesh_state *) addr;
 	_db_show_mesh(ms);
 }
+#endif /* IEEE80211_SUPPORT_MESH */
 
 static void
 _db_show_txampdu(const char *sep, int ix, const struct ieee80211_tx_ampdu *tap)
@@ -298,12 +304,12 @@ _db_show_sta(const struct ieee80211_node
 
 	db_printf("\tinact %u inact_reload %u txrate %u\n",
 		ni->ni_inact, ni->ni_inact_reload, ni->ni_txrate);
-
+#ifdef IEEE80211_SUPPORT_MESH
 	_db_show_ssid("\tmeshid ", 0, ni->ni_meshidlen, ni->ni_meshid);
 	db_printf(" mlstate %b mllid 0x%x mlpid 0x%x mlrcnt %u mltval %u\n",
 	    ni->ni_mlstate, IEEE80211_MESH_MLSTATE_BITS,
 	    ni->ni_mllid, ni->ni_mlpid, ni->ni_mlrcnt, ni->ni_mltval);
-	/* XXX wdsq */
+#endif
 }
 
 #ifdef IEEE80211_SUPPORT_TDMA
@@ -851,6 +857,7 @@ _db_show_stats(const struct ieee80211_st
 {
 }
 
+#ifdef IEEE80211_SUPPORT_MESH
 static void
 _db_show_mesh(const struct ieee80211_mesh_state *ms)
 {
@@ -870,4 +877,5 @@ _db_show_mesh(const struct ieee80211_mes
 		i++;
 	}
 }
+#endif /* IEEE80211_SUPPORT_MESH */
 #endif /* DDB */

Modified: projects/mesh11s/sys/net80211/ieee80211_input.c
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_input.c	Fri Jul 10 18:34:19 2009	(r195576)
+++ projects/mesh11s/sys/net80211/ieee80211_input.c	Fri Jul 10 18:35:11 2009	(r195577)
@@ -46,7 +46,9 @@ __FBSDID("$FreeBSD$");
 
 #include <net80211/ieee80211_var.h>
 #include <net80211/ieee80211_input.h>
+#ifdef IEEE80211_SUPPORT_MESH
 #include <net80211/ieee80211_mesh.h>
+#endif
 
 #include <net/bpf.h>
 
@@ -231,12 +233,16 @@ ieee80211_deliver_data(struct ieee80211v
 struct mbuf *
 ieee80211_decap(struct ieee80211vap *vap, struct mbuf *m, int hdrlen)
 {
+#ifdef IEEE80211_SUPPORT_MESH
 	union {
 		struct ieee80211_qosframe_addr4 wh4;
 		uint8_t b[sizeof(struct ieee80211_qosframe_addr4) +
 			  sizeof(struct ieee80211_meshcntl_ae11)];
 	} whu;
 #define	wh	whu.wh4
+#else
+	struct ieee80211_qosframe_addr4 wh;
+#endif
 	struct ether_header *eh;
 	struct llc *llc;
 
@@ -568,12 +574,14 @@ ieee80211_parse_beacon(struct ieee80211_
 		case IEEE80211_ELEMID_HTINFO:
 			scan->htinfo = frm;
 			break;
+#ifdef IEEE80211_SUPPORT_TDMA
 		case IEEE80211_ELEMID_MESHID:
 			scan->meshid = frm;
 			break;
 		case IEEE80211_ELEMID_MESHCONF:
 			scan->meshconf = frm;
 			break;
+#endif
 		case IEEE80211_ELEMID_VENDOR:
 			if (iswpaoui(frm))
 				scan->wpa = frm;

Modified: projects/mesh11s/sys/net80211/ieee80211_node.c
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_node.c	Fri Jul 10 18:34:19 2009	(r195576)
+++ projects/mesh11s/sys/net80211/ieee80211_node.c	Fri Jul 10 18:35:11 2009	(r195577)
@@ -367,9 +367,11 @@ ieee80211_create_ibss(struct ieee80211va
 		if ((vap->iv_caps & IEEE80211_C_TDMA) == 0)
 #endif
 			memset(ni->ni_bssid, 0, IEEE80211_ADDR_LEN);
+#ifdef IEEE80211_SUPPORT_MESH
 	} else if (vap->iv_opmode == IEEE80211_M_MBSS) {
 		ni->ni_meshidlen = vap->iv_mesh->ms_idlen;
 		memcpy(ni->ni_meshid, vap->iv_mesh->ms_id, ni->ni_meshidlen);
+#endif
 	}
 	/* 
 	 * Fix the channel and related attributes.
@@ -795,8 +797,10 @@ ieee80211_sta_join(struct ieee80211vap *
 			ieee80211_parse_htcap(ni, ni->ni_ies.htcap_ie);
 		if (ni->ni_ies.htinfo_ie != NULL)
 			ieee80211_parse_htinfo(ni, ni->ni_ies.htinfo_ie);
+#ifdef IEEE80211_SUPPORT_MESH
 		if (ni->ni_ies.meshid_ie != NULL)
 			ieee80211_parse_meshid(ni, ni->ni_ies.meshid_ie);
+#endif
 #ifdef IEEE80211_SUPPORT_TDMA
 		if (ni->ni_ies.tdma_ie != NULL)
 			ieee80211_parse_tdma(ni, ni->ni_ies.tdma_ie);
@@ -927,9 +931,11 @@ ieee80211_ies_expand(struct ieee80211_ie
 		case IEEE80211_ELEMID_HTCAP:
 			ies->htcap_ie = ie;
 			break;
+#ifdef IEEE80211_SUPPORT_MESH
 		case IEEE80211_ELEMID_MESHID:
 			ies->meshid_ie = ie;
 			break;
+#endif
 		}
 		ielen -= 2 + ie[1];
 		ie += 2 + ie[1];
@@ -967,12 +973,13 @@ node_cleanup(struct ieee80211_node *ni)
 	else if (ni->ni_ath_flags & IEEE80211_NODE_ATH)
 		ieee80211_ff_node_cleanup(ni);
 #endif
+#ifdef IEEE80211_SUPPORT_MESH
 	/*
 	 * Cleanup any mesh-related state.
 	 */
 	if (vap->iv_opmode == IEEE80211_M_MBSS)
 		ieee80211_mesh_node_cleanup(ni);
-
+#endif
 	/*
 	 * Clear any staging queue entries.
 	 */
@@ -1112,9 +1119,10 @@ ieee80211_alloc_node(struct ieee80211_no
 	ni->ni_inact = ni->ni_inact_reload;
 	ni->ni_ath_defkeyix = 0x7fff;
 	ieee80211_psq_init(&ni->ni_psq, "unknown");
+#ifdef IEEE80211_SUPPORT_MESH
 	if (vap->iv_opmode == IEEE80211_M_MBSS)
 		ieee80211_mesh_node_init(vap, ni);
-
+#endif
 	IEEE80211_NODE_LOCK(nt);
 	TAILQ_INSERT_TAIL(&nt->nt_node, ni, ni_list);
 	LIST_INSERT_HEAD(&nt->nt_hash[hash], ni, ni_hash);
@@ -1404,8 +1412,6 @@ ieee80211_init_neighbor(struct ieee80211
 	const struct ieee80211_frame *wh,
 	const struct ieee80211_scanparams *sp)
 {
-	struct ieee80211vap *vap = ni->ni_vap;
-	
 	ni->ni_esslen = sp->ssid[1];
 	memcpy(ni->ni_essid, sp->ssid + 2, sp->ssid[1]);
 	IEEE80211_ADDR_COPY(ni->ni_bssid, wh->i_addr3);
@@ -1417,9 +1423,10 @@ ieee80211_init_neighbor(struct ieee80211
 	ni->ni_fhindex = sp->fhindex;
 	ni->ni_erp = sp->erp;
 	ni->ni_timoff = sp->timoff;
-	if (vap->iv_opmode == IEEE80211_M_MBSS)
+#ifdef IEEE80211_SUPPORT_MESH
+	if (ni->ni_vap->iv_opmode == IEEE80211_M_MBSS)
 		ieee80211_mesh_init_neighbor(ni, wh, sp);
-
+#endif
 	if (ieee80211_ies_init(&ni->ni_ies, sp->ies, sp->ies_len)) {
 		ieee80211_ies_expand(&ni->ni_ies);
 		if (ni->ni_ies.wme_ie != NULL)
@@ -2553,6 +2560,7 @@ get_adhoc_rssi(void *arg, struct ieee802
 	}
 }
 
+#ifdef IEEE80211_SUPPORT_MESH
 static void
 get_mesh_rssi(void *arg, struct ieee80211_node *ni)
 {
@@ -2571,7 +2579,7 @@ get_mesh_rssi(void *arg, struct ieee8021
 		info->rssi_total += rssi;
 	}
 }
-
+#endif /* IEEE80211_SUPPORT_MESH */
 
 int8_t
 ieee80211_getrssi(struct ieee80211vap *vap)
@@ -2591,9 +2599,11 @@ ieee80211_getrssi(struct ieee80211vap *v
 	case IEEE80211_M_HOSTAP:	/* average of all associated stations */
 		ieee80211_iterate_nodes(&ic->ic_sta, get_hostap_rssi, &info);
 		break;
+#ifdef IEEE80211_SUPPORT_MESH
 	case IEEE80211_M_MBSS:		/* average of all mesh neighbors */
 		ieee80211_iterate_nodes(&ic->ic_sta, get_mesh_rssi, &info);
 		break;
+#endif
 	case IEEE80211_M_MONITOR:	/* XXX */
 	case IEEE80211_M_STA:		/* use stats from associated ap */
 	default:

Modified: projects/mesh11s/sys/net80211/ieee80211_output.c
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_output.c	Fri Jul 10 18:34:19 2009	(r195576)
+++ projects/mesh11s/sys/net80211/ieee80211_output.c	Fri Jul 10 18:35:11 2009	(r195577)
@@ -218,7 +218,9 @@ ieee80211_start(struct ifnet *ifp)
 				ieee80211_dwds_mcast(vap, m);
 			}
 		}
+#ifdef IEEE80211_SUPPORT_MESH
 		if (vap->iv_opmode != IEEE80211_M_MBSS) {
+#endif
 			ni = ieee80211_find_txnode(vap, eh->ether_dhost);
 			if (ni == NULL) {
 				/* NB: ieee80211_find_txnode does stat+msg */
@@ -238,6 +240,7 @@ ieee80211_start(struct ifnet *ifp)
 				ieee80211_free_node(ni);
 				continue;
 			}
+#ifdef IEEE80211_SUPPORT_MESH
 		} else {
 			ni = ieee80211_mesh_discover(vap, eh->ether_dhost, m);
 			if (ni == NULL) {
@@ -250,6 +253,7 @@ ieee80211_start(struct ifnet *ifp)
 				continue;
 			}
 		}
+#endif
 
 		if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT) &&
 		    (m->m_flags & M_PWR_SAV) == 0) {
@@ -525,6 +529,7 @@ ieee80211_send_setup(
 			IEEE80211_ADDR_COPY(WH4(wh)->i_addr4, sa);
 			break;
 		case IEEE80211_M_MBSS:
+#ifdef IEEE80211_SUPPORT_MESH
 			/* XXX add support for proxied addresses */
 			if (IEEE80211_IS_MULTICAST(da)) {
 				wh->i_fc[1] = IEEE80211_FC1_DIR_FROMDS;
@@ -540,6 +545,7 @@ ieee80211_send_setup(
 				IEEE80211_ADDR_COPY(wh->i_addr3, da);
 				IEEE80211_ADDR_COPY(WH4(wh)->i_addr4, sa);
 			}
+#endif
 			break;
 		case IEEE80211_M_MONITOR:	/* NB: to quiet compiler */
 			break;
@@ -548,9 +554,11 @@ ieee80211_send_setup(
 		wh->i_fc[1] = IEEE80211_FC1_DIR_NODS;
 		IEEE80211_ADDR_COPY(wh->i_addr1, da);
 		IEEE80211_ADDR_COPY(wh->i_addr2, sa);
+#ifdef IEEE80211_SUPPORT_MESH
 		if (vap->iv_opmode == IEEE80211_M_MBSS)
 			IEEE80211_ADDR_COPY(wh->i_addr3, sa);
 		else
+#endif
 			IEEE80211_ADDR_COPY(wh->i_addr3, bssid);
 	}
 	*(uint16_t *)&wh->i_dur[0] = 0;
@@ -977,7 +985,10 @@ ieee80211_encap(struct ieee80211vap *vap
 {
 #define	WH4(wh)	((struct ieee80211_frame_addr4 *)(wh))
 	struct ieee80211com *ic = ni->ni_ic;
+#ifdef IEEE80211_SUPPORT_MESH
 	struct ieee80211_mesh_state *ms = vap->iv_mesh;
+	struct ieee80211_meshcntl_ae11 *mc;
+#endif
 	struct ether_header eh;
 	struct ieee80211_frame *wh;
 	struct ieee80211_key *key;
@@ -985,7 +996,6 @@ ieee80211_encap(struct ieee80211vap *vap
 	int hdrsize, hdrspace, datalen, addqos, txfrag, is4addr;
 	ieee80211_seq seqno;
 	int meshhdrsize, meshae;
-	struct ieee80211_meshcntl_ae11 *mc;
 	uint8_t *qos;
 
 	/*
@@ -1039,6 +1049,7 @@ ieee80211_encap(struct ieee80211vap *vap
 		hdrsize = sizeof(struct ieee80211_qosframe);
 	else
 		hdrsize = sizeof(struct ieee80211_frame);
+#ifdef IEEE80211_SUPPORT_MESH
 	if (vap->iv_opmode == IEEE80211_M_MBSS) {
 		/*
 		 * Mesh data frames are encapsulated according to the
@@ -1072,6 +1083,7 @@ ieee80211_encap(struct ieee80211vap *vap
 			meshhdrsize += 3*IEEE80211_ADDR_LEN;
 		}
 	} else {
+#endif
 		/*
 		 * 4-address frames need to be generated for:
 		 * o packets sent through a WDS vap (IEEE80211_M_WDS)
@@ -1084,7 +1096,9 @@ ieee80211_encap(struct ieee80211vap *vap
 		if (is4addr)
 			hdrsize += IEEE80211_ADDR_LEN;
 		meshhdrsize = meshae = 0;
+#ifdef IEEE80211_SUPPORT_MESH
 	}
+#endif
 	/*
 	 * Honor driver DATAPAD requirement.
 	 */
@@ -1162,6 +1176,7 @@ ieee80211_encap(struct ieee80211vap *vap
 		IEEE80211_ADDR_COPY(wh->i_addr2, ni->ni_bssid);
 		IEEE80211_ADDR_COPY(wh->i_addr3, eh.ether_shost);
 		break;
+#ifdef IEEE80211_SUPPORT_MESH
 	case IEEE80211_M_MBSS:
 		/* NB: offset by hdrspace to deal with DATAPAD */
 		mc = (struct ieee80211_meshcntl_ae11 *)
@@ -1214,8 +1229,9 @@ ieee80211_encap(struct ieee80211vap *vap
 		ms->ms_seq++;
 		LE_WRITE_4(mc->mc_seq, ms->ms_seq);
 		break;
-	case IEEE80211_M_MONITOR:
+#endif
 	case IEEE80211_M_WDS:		/* NB: is4addr should always be true */
+	default:
 		goto bad;
 	}
 	if (m->m_flags & M_MORE_DATA)
@@ -2222,8 +2238,10 @@ ieee80211_alloc_proberesp(struct ieee802
 #ifdef IEEE80211_SUPPORT_SUPERG
 	       + sizeof(struct ieee80211_ath_ie)
 #endif
+#ifdef IEEE80211_SUPPORT_MESH
 	       + 2 + IEEE80211_MESHID_LEN
 	       + sizeof(struct ieee80211_meshconf_ie)
+#endif
 	       + (vap->iv_appie_proberesp != NULL ?
 			vap->iv_appie_proberesp->ie_len : 0)
 	);
@@ -2313,10 +2331,12 @@ ieee80211_alloc_proberesp(struct ieee802
 #endif
 	if (vap->iv_appie_proberesp != NULL)
 		frm = add_appie(frm, vap->iv_appie_proberesp);
+#ifdef IEEE80211_SUPPORT_MESH
 	if (vap->iv_opmode == IEEE80211_M_MBSS) {
 		frm = ieee80211_add_meshid(frm, vap);
 		frm = ieee80211_add_meshconf(frm, vap);
 	}
+#endif
 	m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *);
 
 	return m;
@@ -2619,10 +2639,12 @@ ieee80211_beacon_construct(struct mbuf *
 		bo->bo_appie_len = vap->iv_appie_beacon->ie_len;
 		frm = add_appie(frm, vap->iv_appie_beacon);
 	}
+#ifdef IEEE80211_SUPPORT_MESH
 	if (vap->iv_opmode == IEEE80211_M_MBSS) {
 		frm = ieee80211_add_meshid(frm, vap);
 		frm = ieee80211_add_meshconf(frm, vap);
 	}
+#endif
 	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 *);
@@ -2635,7 +2657,6 @@ struct mbuf *
 ieee80211_beacon_alloc(struct ieee80211_node *ni,
 	struct ieee80211_beacon_offsets *bo)
 {
-	static const uint8_t zerobssid[IEEE80211_ADDR_LEN];
 	struct ieee80211vap *vap = ni->ni_vap;
 	struct ieee80211com *ic = ni->ni_ic;
 	struct ifnet *ifp = vap->iv_ifp;
@@ -2701,10 +2722,10 @@ ieee80211_beacon_alloc(struct ieee80211_
 		 + (vap->iv_caps & IEEE80211_C_TDMA ?	/* TDMA */
 			sizeof(struct ieee80211_tdma_param) : 0)
 #endif
-		 + (vap->iv_opmode == IEEE80211_M_MBSS ?
-			2 + ni->ni_meshidlen : 0)
-		 + (vap->iv_opmode == IEEE80211_M_MBSS ?
-			sizeof(struct ieee80211_meshconf_ie) : 0)
+#ifdef IEEE80211_SUPPORT_MESH
+		 + 2 + ni->ni_meshidlen
+		 + sizeof(struct ieee80211_meshconf_ie)
+#endif
 		 + IEEE80211_MAX_APPIE
 		 ;
 	m = ieee80211_getmgtframe(&frm,
@@ -2726,9 +2747,12 @@ ieee80211_beacon_alloc(struct ieee80211_
 	*(uint16_t *)wh->i_dur = 0;
 	IEEE80211_ADDR_COPY(wh->i_addr1, ifp->if_broadcastaddr);
 	IEEE80211_ADDR_COPY(wh->i_addr2, vap->iv_myaddr);
-	if (vap->iv_opmode == IEEE80211_M_MBSS)
+#ifdef IEEE80211_SUPPORT_MESH
+	if (vap->iv_opmode == IEEE80211_M_MBSS) {
+		static const uint8_t zerobssid[IEEE80211_ADDR_LEN];
 		IEEE80211_ADDR_COPY(wh->i_addr3, zerobssid);
-	else
+	} else
+#endif
 		IEEE80211_ADDR_COPY(wh->i_addr3, ni->ni_bssid);
 	*(uint16_t *)wh->i_seq = 0;
 

Modified: projects/mesh11s/sys/net80211/ieee80211_proto.c
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_proto.c	Fri Jul 10 18:34:19 2009	(r195576)
+++ projects/mesh11s/sys/net80211/ieee80211_proto.c	Fri Jul 10 18:35:11 2009	(r195577)
@@ -50,7 +50,9 @@ __FBSDID("$FreeBSD$");
 #include <net80211/ieee80211_sta.h>
 #include <net80211/ieee80211_hostap.h>
 #include <net80211/ieee80211_wds.h>
+#ifdef IEEE80211_SUPPORT_MESH
 #include <net80211/ieee80211_mesh.h>
+#endif
 #include <net80211/ieee80211_monitor.h>
 #include <net80211/ieee80211_input.h>
 
@@ -154,7 +156,9 @@ ieee80211_proto_attach(struct ieee80211c
 	ieee80211_sta_attach(ic);
 	ieee80211_wds_attach(ic);
 	ieee80211_hostap_attach(ic);
+#ifdef IEEE80211_SUPPORT_MESH
 	ieee80211_mesh_attach(ic);
+#endif
 	ieee80211_monitor_attach(ic);
 }
 
@@ -162,7 +166,9 @@ void
 ieee80211_proto_detach(struct ieee80211com *ic)
 {
 	ieee80211_monitor_detach(ic);
+#ifdef IEEE80211_SUPPORT_MESH
 	ieee80211_mesh_detach(ic);
+#endif
 	ieee80211_hostap_detach(ic);
 	ieee80211_wds_detach(ic);
 	ieee80211_adhoc_detach(ic);

Modified: projects/mesh11s/sys/net80211/ieee80211_scan_sta.c
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_scan_sta.c	Fri Jul 10 18:34:19 2009	(r195576)
+++ projects/mesh11s/sys/net80211/ieee80211_scan_sta.c	Fri Jul 10 18:35:11 2009	(r195577)
@@ -48,7 +48,9 @@ __FBSDID("$FreeBSD$");
 #ifdef IEEE80211_SUPPORT_TDMA
 #include <net80211/ieee80211_tdma.h>
 #endif
+#ifdef IEEE80211_SUPPORT_MESH
 #include <net80211/ieee80211_mesh.h>
+#endif
 
 #include <net/bpf.h>
 
@@ -142,6 +144,10 @@ isocmp(const uint8_t cc1[], const uint8_
 
 /* number of references from net80211 layer */
 static	int nrefs = 0;
+/*
+ * Module glue.
+ */
+IEEE80211_SCANNER_MODULE(sta, 1);
 
 /*
  * Attach prior to any scanning work.
@@ -284,8 +290,10 @@ found:
 	memcpy(ise->se_tstamp.data, sp->tstamp, sizeof(ise->se_tstamp));
 	ise->se_intval = sp->bintval;
 	ise->se_capinfo = sp->capinfo;
+#ifdef IEEE80211_SUPPORT_MESH
 	if (sp->meshid != NULL && sp->meshid[1] != 0)
 		memcpy(ise->se_meshid, sp->meshid, 2+sp->meshid[1]);
+#endif
 	/*
 	 * Beware of overriding se_chan for frames seen
 	 * off-channel; this can cause us to attempt an
@@ -996,6 +1004,7 @@ match_bss(struct ieee80211vap *vap,
 #endif
 		}
 #endif /* IEEE80211_SUPPORT_TDMA */
+#ifdef IEEE80211_SUPPORT_MESH
 	} else if (vap->iv_opmode == IEEE80211_M_MBSS) {
 		const struct ieee80211_mesh_state *ms = vap->iv_mesh;
 		/*
@@ -1006,10 +1015,11 @@ match_bss(struct ieee80211vap *vap,
 			fail |= MATCH_CAPINFO;
 		else if (se->se_meshid == NULL)
 			fail |= MATCH_MESH_NOID;
-		else if (vap->iv_mesh->ms_idlen != 0 &&
+		else if (ms->ms_idlen != 0 &&
 		    match_id(se->se_meshid, ms->ms_id, ms->ms_idlen))
 			fail |= MATCH_MESHID;
 	} else {
+#endif
 		if ((se->se_capinfo & IEEE80211_CAPINFO_ESS) == 0)
 			fail |= MATCH_CAPINFO;
 		/*
@@ -1439,6 +1449,7 @@ static const struct ieee80211_scanner st
 	.scan_assoc_fail	= sta_assoc_fail,
 	.scan_assoc_success	= sta_assoc_success,
 };
+IEEE80211_SCANNER_ALG(sta, IEEE80211_M_STA, sta_default);
 
 /*
  * Adhoc mode-specific support.
@@ -1655,6 +1666,8 @@ static const struct ieee80211_scanner ad
 	.scan_assoc_fail	= sta_assoc_fail,
 	.scan_assoc_success	= sta_assoc_success,
 };
+IEEE80211_SCANNER_ALG(ibss, IEEE80211_M_IBSS, adhoc_default);
+IEEE80211_SCANNER_ALG(ahdemo, IEEE80211_M_AHDEMO, adhoc_default);
 
 static void
 ap_force_promisc(struct ieee80211com *ic)
@@ -1806,7 +1819,9 @@ static const struct ieee80211_scanner ap
 	.scan_assoc_success	= sta_assoc_success,
 	.scan_assoc_fail	= sta_assoc_fail,
 };
+IEEE80211_SCANNER_ALG(ap, IEEE80211_M_HOSTAP, ap_default);
 
+#ifdef IEEE80211_SUPPORT_MESH
 /*
  * Pick an mbss network to join or find a channel
  * to use to start an mbss network.
@@ -1907,13 +1922,5 @@ static const struct ieee80211_scanner me
 	.scan_assoc_fail	= sta_assoc_fail,
 	.scan_assoc_success	= sta_assoc_success,
 };
-
-/*
- * Module glue.
- */
-IEEE80211_SCANNER_MODULE(sta, 1);
-IEEE80211_SCANNER_ALG(sta, IEEE80211_M_STA, sta_default);
-IEEE80211_SCANNER_ALG(ibss, IEEE80211_M_IBSS, adhoc_default);
-IEEE80211_SCANNER_ALG(ahdemo, IEEE80211_M_AHDEMO, adhoc_default);
-IEEE80211_SCANNER_ALG(ap, IEEE80211_M_HOSTAP, ap_default);
 IEEE80211_SCANNER_ALG(mesh, IEEE80211_M_MBSS, mesh_default);
+#endif /* IEEE80211_SUPPORT_MESH */


More information about the svn-src-projects mailing list