Date: Mon, 27 Apr 2009 18:46:19 +0000 (UTC) From: Rui Paulo <rpaulo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r191582 - projects/mesh11s/sys/net80211 Message-ID: <200904271846.n3RIkJUr023258@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rpaulo Date: Mon Apr 27 18:46:19 2009 New Revision: 191582 URL: http://svn.freebsd.org/changeset/base/191582 Log: * sync mesh conf ie with latest draft * add add_meshconf() function to add this IE to a frame. * while there, simplify names of mesh conf variables and defines. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c projects/mesh11s/sys/net80211/ieee80211_mesh.h Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Mon Apr 27 18:39:55 2009 (r191581) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Mon Apr 27 18:46:19 2009 (r191582) @@ -490,6 +490,33 @@ ieee80211_add_meshid(uint8_t *frm, struc return frm + vap->iv_meshidlen; } +/* + * Add a Mesh Configuration element to a frame. + * For now just use HWMP routing, Airtime link metric, Null Congestion + * Signaling, Null Sync Protocol and Null Authentication. + */ +uint8_t * +ieee80211_add_meshconf(uint8_t *frm, struct ieee80211vap *vap) +{ + static const struct ieee80211_meshconf_ie ie = { + .conf_ie = IEEE80211_ELEMID_MESHCONF, + .conf_len = sizeof(struct ieee80211_meshconf_ie) - 2, + .conf_ver = IEEE80211_MESHCONF_VERSION, + .conf_pselid = IEEE80211_MESHCONF_HWMP, + .conf_pmetid = IEEE80211_MESHCONF_AIRTIME, + .conf_ccid = IEEE80211_MESHCONF_NULL, + .conf_syncid = IEEE80211_MESHCONF_NULL, + .conf_authid = IEEE80211_MESHCONF_NULL, + .conf_form = 0, /* XXX */ + .conf_cap = 1, /* XXX */ + }; + + KASSERT(vap->iv_opmode == IEEE80211_M_MBSS, ("not a mbss vap")); + memcpy(frm, &ie, sizeof(ie)); + + return frm + sizeof(ie); +} + void ieee80211_create_mbss(struct ieee80211vap *vap, struct ieee80211_channel *chan) { Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.h Mon Apr 27 18:39:55 2009 (r191581) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.h Mon Apr 27 18:46:19 2009 (r191582) @@ -39,23 +39,36 @@ struct ieee80211_meshconf_ie { uint8_t conf_ie; /* IEEE80211_ELEMID_MESHCONF */ uint8_t conf_len; uint8_t conf_ver; - uint32_t conf_apspi; /* Active Path Sel. Proto. ID */ - uint32_t conf_apsmi; /* APS Metric Identifier */ - uint32_t conf_ccmi; /* Congestion Control Mode ID */ - uint8_t conf_finfo; /* Formation Information */ + uint32_t conf_pselid; /* Active Path Sel. Proto. ID */ + uint32_t conf_pmetid; /* APS Metric Identifier */ + uint32_t conf_ccid; /* Congestion Control Mode ID */ + uint32_t conf_syncid; /* Sync. Protocol ID */ + uint32_t conf_authid; /* Auth. Protocol ID */ + uint8_t conf_form; /* Formation Information */ uint8_t conf_cap; } __packed; -#define IEEE80211_MESHCONF_APSPI_HWMP_OUI 0x000fac -#define IEEE80211_MESHCONF_APSPI_HWMP_VALUE 0xff /* XXX Linux */ -#define IEEE80211_MESHCONF_APSMI_AIRTIME_OUI 0x000fac -#define IEEE80211_MESHCONF_APSMI_AIRTIME_VALUE 0xff /* XXX Linux */ -#define IEEE80211_MESHCONF_CCMI_DEFAULT_OUI 0x000fac -#define IEEE80211_MESHCONF_CCMI_DEFAULT_VALUE 0xff /* XXX Linux */ -#define IEEE80211_MESHCONF_CCMI_NULL_OUI 0x000fac -#define IEEE80211_MESHCONF_CCMI_NULL_VALUE 255 +#define IEEE80211_MESHCONF_VERSION 1 +#define IEEE80211_MESHCONF_NULL_OUI 0x000fac /* Null Protocol */ +#define IEEE80211_MESHCONF_NULL_VALUE 255 +#define IEEE80211_MESHCONF_NULL (IEEE80211_MESHCONF_NULL_OUI << 8 | IEEE80211_MESHCONF_NULL_VALUE) +#define IEEE80211_MESHCONF_HWMP_OUI 0x000fac +#define IEEE80211_MESHCONF_HWMP_VALUE 0xff /* XXX Linux */ +#define IEEE80211_MESHCONF_HWMP (IEEE80211_MESHCONF_HWMP_OUI << 8 | IEEE80211_MESHCONF_HWMP_VALUE) +#define IEEE80211_MESHCONF_AIRTIME_OUI 0x000fac +#define IEEE80211_MESHCONF_AIRTIME_VALUE 0xff /* XXX Linux */ +#define IEEE80211_MESHCONF_AIRTIME (IEEE80211_MESHCONF_AIRTIME_OUI << 8 | IEEE80211_MESHCONF_AIRTIME_VALUE) +#define IEEE80211_MESHCONF_CCSIG_OUI 0x000fac +#define IEEE80211_MESHCONF_CCSIG_VALUE 0xff /* XXX Linux */ +#define IEEE80211_MESHCONF_NEIGHOFF_OUI 0x000fac /* Neighbour offset */ +#define IEEE80211_MESHCONF_NEIGHOFF_VALUE 0 +#define IEEE80211_MESHCONF_NEIGHOFF (IEEE80211_MESHCONF_NEIGHOFF_OUI << 8 | IEEE80211_MESHCONF_NEIGHOFF_VALUE) +#define IEEE80211_MESHCONF_SAE_OUI 0x000fac +#define IEEE80211_MESHCONF_SAE_VALUE 1 +#define IEEE80211_MESHCONF_SAE (IEEE80211_MESHCONF_SAE_OUI << 8 | IEEE80211_MESHCONF_SAE_VALUE) #define IEEE80211_MESHCONF_FORM_MP (1 << 1) /* connected to portal */ #define IEEE80211_MESHCONF_FORM_NEIGH (1 << 4) /* no of neighbours */ +/* XXX ... */ /* Mesh Identifier */ struct ieee80211_meshid_ie { @@ -293,6 +306,7 @@ void ieee80211_mesh_attach(struct ieee8 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 *); +uint8_t * ieee80211_add_meshconf(uint8_t *, struct ieee80211vap *); void ieee80211_create_mbss(struct ieee80211vap *, struct ieee80211_channel *);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904271846.n3RIkJUr023258>