Implement the missing support for updating the mesh conf number of
neighbors via ieee80211_beacon_notify(). MFC after: 3 days
This commit is contained in:
parent
fca91fda32
commit
224a330202
@ -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)
|
||||
{
|
||||
|
@ -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.
|
||||
|
@ -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 =
|
||||
@ -2927,6 +2933,9 @@ ieee80211_beacon_update(struct ieee80211_node *ni,
|
||||
#endif
|
||||
#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;
|
||||
@ -2978,6 +2987,9 @@ ieee80211_beacon_update(struct ieee80211_node *ni,
|
||||
#endif
|
||||
#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);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user