summaryrefslogtreecommitdiffstats
path: root/sys/net80211
diff options
context:
space:
mode:
authorrpaulo <rpaulo@FreeBSD.org>2009-10-19 18:46:22 +0000
committerrpaulo <rpaulo@FreeBSD.org>2009-10-19 18:46:22 +0000
commit224a3302020dcc2c55d6138ee19ed91305ae9176 (patch)
tree55a8e5222aa1f03a0a4abb6838c2f9ed5985dc0f /sys/net80211
parentfca91fda32721bc606e229d3aeb7600fb317d729 (diff)
downloadFreeBSD-src-224a3302020dcc2c55d6138ee19ed91305ae9176.zip
FreeBSD-src-224a3302020dcc2c55d6138ee19ed91305ae9176.tar.gz
Implement the missing support for updating the mesh conf number of
neighbors via ieee80211_beacon_notify(). MFC after: 3 days
Diffstat (limited to 'sys/net80211')
-rw-r--r--sys/net80211/ieee80211_mesh.c14
-rw-r--r--sys/net80211/ieee80211_mesh.h2
-rw-r--r--sys/net80211/ieee80211_output.c12
-rw-r--r--sys/net80211/ieee80211_proto.h4
4 files changed, 31 insertions, 1 deletions
diff --git a/sys/net80211/ieee80211_mesh.c b/sys/net80211/ieee80211_mesh.c
index 52a9e24..432ce23 100644
--- a/sys/net80211/ieee80211_mesh.c
+++ b/sys/net80211/ieee80211_mesh.c
@@ -739,10 +739,12 @@ mesh_linkchange(struct ieee80211_node *ni, enum ieee80211_mesh_mlstate state)
ni->ni_mlstate != IEEE80211_NODE_MESH_ESTABLISHED) {
KASSERT(ms->ms_neighbors < 65535, ("neighbor count overflow"));
ms->ms_neighbors++;
+ ieee80211_beacon_notify(vap, IEEE80211_BEACON_MESHCONF);
} else if (ni->ni_mlstate == IEEE80211_NODE_MESH_ESTABLISHED &&
state != IEEE80211_NODE_MESH_ESTABLISHED) {
KASSERT(ms->ms_neighbors > 0, ("neighbor count 0"));
ms->ms_neighbors--;
+ ieee80211_beacon_notify(vap, IEEE80211_BEACON_MESHCONF);
}
ni->ni_mlstate = state;
switch (state) {
@@ -2553,6 +2555,18 @@ ieee80211_mesh_init_neighbor(struct ieee80211_node *ni,
ieee80211_parse_meshid(ni, sp->meshid);
}
+void
+ieee80211_mesh_update_beacon(struct ieee80211vap *vap,
+ struct ieee80211_beacon_offsets *bo)
+{
+ KASSERT(vap->iv_opmode == IEEE80211_M_MBSS, ("not a MBSS vap"));
+
+ if (isset(bo->bo_flags, IEEE80211_BEACON_MESHCONF)) {
+ (void)ieee80211_add_meshconf(bo->bo_meshconf, vap);
+ clrbit(bo->bo_flags, IEEE80211_BEACON_MESHCONF);
+ }
+}
+
static int
mesh_ioctl_get80211(struct ieee80211vap *vap, struct ieee80211req *ireq)
{
diff --git a/sys/net80211/ieee80211_mesh.h b/sys/net80211/ieee80211_mesh.h
index 72108dd..de9b5c2 100644
--- a/sys/net80211/ieee80211_mesh.h
+++ b/sys/net80211/ieee80211_mesh.h
@@ -470,6 +470,8 @@ struct ieee80211_scanparams;
void ieee80211_mesh_init_neighbor(struct ieee80211_node *,
const struct ieee80211_frame *,
const struct ieee80211_scanparams *);
+void ieee80211_mesh_update_beacon(struct ieee80211vap *,
+ struct ieee80211_beacon_offsets *);
/*
* Return non-zero if proxy operation is enabled.
diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c
index f1a21bc..d2da01f 100644
--- a/sys/net80211/ieee80211_output.c
+++ b/sys/net80211/ieee80211_output.c
@@ -2658,6 +2658,7 @@ ieee80211_beacon_construct(struct mbuf *m, uint8_t *frm,
#ifdef IEEE80211_SUPPORT_MESH
if (vap->iv_opmode == IEEE80211_M_MBSS) {
frm = ieee80211_add_meshid(frm, vap);
+ bo->bo_meshconf = frm;
frm = ieee80211_add_meshconf(frm, vap);
}
#endif
@@ -2874,6 +2875,11 @@ ieee80211_beacon_update(struct ieee80211_node *ni,
ieee80211_tdma_update_beacon(vap, bo);
}
#endif
+#ifdef IEEE80211_SUPPORT_MESH
+ if (vap->iv_opmode == IEEE80211_M_MBSS)
+ ieee80211_mesh_update_beacon(vap, bo);
+#endif
+
if (vap->iv_opmode == IEEE80211_M_HOSTAP ||
vap->iv_opmode == IEEE80211_M_MBSS) { /* NB: no IBSS support*/
struct ieee80211_tim_ie *tie =
@@ -2928,6 +2934,9 @@ ieee80211_beacon_update(struct ieee80211_node *ni,
#ifdef IEEE80211_TDMA_SUPPORT
bo->bo_tdma += adjust;
#endif
+#ifdef IEEE80211_MESH_SUPPORT
+ bo->bo_meshconf += adjust;
+#endif
bo->bo_appie += adjust;
bo->bo_wme += adjust;
bo->bo_csa += adjust;
@@ -2979,6 +2988,9 @@ ieee80211_beacon_update(struct ieee80211_node *ni,
#ifdef IEEE80211_TDMA_SUPPORT
bo->bo_tdma += sizeof(*csa);
#endif
+#ifdef IEEE80211_MESH_SUPPORT
+ bo->bo_meshconf += sizeof(*csa);
+#endif
bo->bo_appie += sizeof(*csa);
bo->bo_csa_trailer_len += sizeof(*csa);
bo->bo_tim_trailer_len += sizeof(*csa);
diff --git a/sys/net80211/ieee80211_proto.h b/sys/net80211/ieee80211_proto.h
index 9bfbc61..e036dac 100644
--- a/sys/net80211/ieee80211_proto.h
+++ b/sys/net80211/ieee80211_proto.h
@@ -317,7 +317,8 @@ struct ieee80211_beacon_offsets {
uint16_t bo_appie_len; /* AppIE length in bytes */
uint16_t bo_csa_trailer_len;;
uint8_t *bo_csa; /* start of CSA element */
- uint8_t *bo_spare[4];
+ uint8_t *bo_meshconf; /* start of MESHCONF element */
+ uint8_t *bo_spare[3];
};
struct mbuf *ieee80211_beacon_alloc(struct ieee80211_node *,
struct ieee80211_beacon_offsets *);
@@ -345,6 +346,7 @@ enum {
IEEE80211_BEACON_CSA = 7, /* Channel Switch Announcement */
IEEE80211_BEACON_TDMA = 9, /* TDMA Info */
IEEE80211_BEACON_ATH = 10, /* ATH parameters */
+ IEEE80211_BEACON_MESHCONF = 11, /* Mesh Configuration */
};
int ieee80211_beacon_update(struct ieee80211_node *,
struct ieee80211_beacon_offsets *, struct mbuf *, int mcast);
OpenPOWER on IntegriCloud