svn commit: r231576 - head/sys/net80211
Adrian Chadd
adrian at FreeBSD.org
Mon Feb 13 07:47:37 UTC 2012
Author: adrian
Date: Mon Feb 13 07:47:36 2012
New Revision: 231576
URL: http://svn.freebsd.org/changeset/base/231576
Log:
Correct the 802.11s mesh configuration structure and related tidbits.
* Change the mesh IE size to be IEEE80211_MESH_CONF_SZ rather than the
size of the structure;
* conf_cap is now a uint8_t rather than a uint16_t (uint16_t in D3.0,
uint8_t in the amendment spec);
* Update mesh config capability bits - earlier bits were from draft X,
current is amendment spec;
* Update the following to be an enum rather than #define and added
a VENDOR entry too from the amendment spec;
IEEE80211_MESHCONF_PATH_*
IEEE80211_MESHCONF_METRIC_*
IEEE80211_MESHCONF_CC_*
IEEE80211_MESHCONF_SYNC_*
IEEE80211_MESHCONF_AUTH_*
* Kept IEEE80211_MESHCONF_FORM_* and IEEE80211_MESHCONF_CAP_* as
defines because they are defined in a way that we need to mask in/out
information;
* In IEEE80211_MESHCONF_CAP_* IEEE80211_MESHCONF_CAP_TBTTA is removed
and 0x80 is made reserved as defined in the amendment spec.
Submitted by: monthadar at gmail.com
Reviewed by: rpaulo
Modified:
head/sys/net80211/ieee80211_mesh.c
head/sys/net80211/ieee80211_mesh.h
Modified: head/sys/net80211/ieee80211_mesh.c
==============================================================================
--- head/sys/net80211/ieee80211_mesh.c Mon Feb 13 07:47:16 2012 (r231575)
+++ head/sys/net80211/ieee80211_mesh.c Mon Feb 13 07:47:36 2012 (r231576)
@@ -2289,7 +2289,6 @@ mesh_verify_meshconf(struct ieee80211vap
const struct ieee80211_meshconf_ie *meshconf =
(const struct ieee80211_meshconf_ie *) ie;
const struct ieee80211_mesh_state *ms = vap->iv_mesh;
- uint16_t cap;
if (meshconf == NULL)
return 1;
@@ -2323,10 +2322,8 @@ mesh_verify_meshconf(struct ieee80211vap
meshconf->conf_pselid);
return 1;
}
- /* NB: conf_cap is only read correctly here */
- cap = LE_READ_2(&meshconf->conf_cap);
/* Not accepting peers */
- if (!(cap & IEEE80211_MESHCONF_CAP_AP)) {
+ if (!(meshconf->conf_cap & IEEE80211_MESHCONF_CAP_AP)) {
IEEE80211_DPRINTF(vap, IEEE80211_MSG_MESH,
"not accepting peers: 0x%x\n", meshconf->conf_cap);
return 1;
@@ -2395,7 +2392,7 @@ ieee80211_add_meshconf(uint8_t *frm, str
KASSERT(vap->iv_opmode == IEEE80211_M_MBSS, ("not a MBSS vap"));
*frm++ = IEEE80211_ELEMID_MESHCONF;
- *frm++ = sizeof(struct ieee80211_meshconf_ie) - 2;
+ *frm++ = IEEE80211_MESH_CONF_SZ;
*frm++ = ms->ms_ppath->mpp_ie; /* path selection */
*frm++ = ms->ms_pmetric->mpm_ie; /* link metric */
*frm++ = IEEE80211_MESHCONF_CC_DISABLED;
@@ -2411,7 +2408,7 @@ ieee80211_add_meshconf(uint8_t *frm, str
caps |= IEEE80211_MESHCONF_CAP_AP;
if (ms->ms_flags & IEEE80211_MESHFLAGS_FWD)
caps |= IEEE80211_MESHCONF_CAP_FWRD;
- ADDSHORT(frm, caps);
+ *frm++ = caps;
return frm;
}
Modified: head/sys/net80211/ieee80211_mesh.h
==============================================================================
--- head/sys/net80211/ieee80211_mesh.h Mon Feb 13 07:47:16 2012 (r231575)
+++ head/sys/net80211/ieee80211_mesh.h Mon Feb 13 07:47:36 2012 (r231576)
@@ -40,6 +40,7 @@
* 802.11s Information Elements.
*/
/* Mesh Configuration */
+#define IEEE80211_MESH_CONF_SZ (7)
struct ieee80211_meshconf_ie {
uint8_t conf_ie; /* IEEE80211_ELEMID_MESHCONF */
uint8_t conf_len;
@@ -49,31 +50,66 @@ struct ieee80211_meshconf_ie {
uint8_t conf_syncid; /* Sync. Protocol ID */
uint8_t conf_authid; /* Auth. Protocol ID */
uint8_t conf_form; /* Formation Information */
- uint16_t conf_cap;
+ uint8_t conf_cap;
} __packed;
/* Hybrid Wireless Mesh Protocol */
-#define IEEE80211_MESHCONF_PATH_HWMP 0x00
+enum {
+ /* 0 reserved */
+ IEEE80211_MESHCONF_PATH_HWMP = 1,
+ /* 2-254 reserved */
+ IEEE80211_MESHCONF_PATH_VENDOR = 255,
+};
+
/* Airtime Link Metric */
-#define IEEE80211_MESHCONF_METRIC_AIRTIME 0x00
+enum {
+ /* 0 reserved */
+ IEEE80211_MESHCONF_METRIC_AIRTIME = 1,
+ /* 2-254 reserved */
+ IEEE80211_MESHCONF_METRIC_VENDOR = 255,
+};
+
/* Congestion Control */
-#define IEEE80211_MESHCONF_CC_DISABLED 0x00
-#define IEEE80211_MESHCONF_CC_SIG 0x01
+enum {
+ IEEE80211_MESHCONF_CC_DISABLED = 0,
+ IEEE80211_MESHCONF_CC_SIG = 1,
+ /* 2-254 reserved */
+ IEEE80211_MESHCONF_CC_VENDOR = 255,
+};
+
/* Neighbour Offset */
-#define IEEE80211_MESHCONF_SYNC_NEIGHOFF 0x00
-#define IEEE80211_MESHCONF_AUTH_DISABLED 0x00
-/* Simultaneous Authenticaction of Equals */
-#define IEEE80211_MESHCONF_AUTH_SAE 0x01
-#define IEEE80211_MESHCONF_FORM_MP 0x01 /* Connected to Portal */
-#define IEEE80211_MESHCONF_FORM_NNEIGH_MASK 0x04 /* Number of Neighbours */
+enum {
+ /* 0 reserved */
+ IEEE80211_MESHCONF_SYNC_NEIGHOFF = 1,
+ /* 2-254 rserved */
+ IEEE80211_MESHCONF_SYNC_VENDOR = 255,
+};
+
+/* Authentication Protocol Identifier */
+enum {
+
+ IEEE80211_MESHCONF_AUTH_DISABLED = 0,
+ /* Simultaneous Authenticaction of Equals */
+ IEEE80211_MESHCONF_AUTH_SEA = 1,
+ IEEE80211_MESHCONF_AUTH_8021X = 2, /* IEEE 802.1X */
+ /* 3-254 reserved */
+ IEEE80211_MESHCONF_AUTH_VENDOR = 255,
+};
+
+/* Mesh Formation Info */
+#define IEEE80211_MESHCONF_FORM_MP 0x01 /* Connected to Portal */
+#define IEEE80211_MESHCONF_FORM_NNEIGH_MASK 0x7E /* Number of Neighbours */
+#define IEEE80211_MESHCONF_FORM_SA 0xF0 /* indicating 802.1X auth */
+
+/* Mesh Capability */
#define IEEE80211_MESHCONF_CAP_AP 0x01 /* Accepting Peers */
#define IEEE80211_MESHCONF_CAP_MCCAS 0x02 /* MCCA supported */
#define IEEE80211_MESHCONF_CAP_MCCAE 0x04 /* MCCA enabled */
#define IEEE80211_MESHCONF_CAP_FWRD 0x08 /* forwarding enabled */
#define IEEE80211_MESHCONF_CAP_BTR 0x10 /* Beacon Timing Report Enab */
-#define IEEE80211_MESHCONF_CAP_TBTTA 0x20 /* TBTT Adj. Enabled */
-#define IEEE80211_MESHCONF_CAP_TBTT 0x40 /* TBTT Adjusting */
-#define IEEE80211_MESHCONF_CAP_PSL 0x80 /* Power Save Level */
+#define IEEE80211_MESHCONF_CAP_TBTT 0x20 /* TBTT Adjusting */
+#define IEEE80211_MESHCONF_CAP_PSL 0x40 /* Power Save Level */
+/* 0x80 reserved */
/* Mesh Identifier */
struct ieee80211_meshid_ie {
More information about the svn-src-head
mailing list